Re: [PATCH v7 2/2] ARM: ftrace: Add MODULE_PLTS support
From: Alexander Sverdlin
Date: Wed Mar 24 2021 - 12:34:33 EST
Hello Qais,
On 24/03/2021 16:57, Qais Yousef wrote:
>>> FWIW my main concern is about duplicating the range check in
>>> ftrace_call_replace() and using magic values that already exist in
>>> __arm_gen_branch_{arm, thumb2}() and better remain encapsulated there.
>> could you please check the negative limits? I have an opinion, my limits are
>> correct. I could add extra parameter to arm_gen_branch_link(), but for this
>> I first need to fix its negative limits, which, I believe, well... Approximate :)
> Can you elaborate please?
>
> If you look at Arm ARM [1] the ranges are defined in page 347
>
> Encoding T1 Even numbers in the range –16777216 to 16777214.
> Encoding T2 Multiples of 4 in the range –16777216 to 16777212.
> Encoding A1 Multiples of 4 in the range –33554432 to 33554428.
> Encoding A2 Even numbers in the range –33554432 to 33554430.
>
> which matches what's in the code (T1 for thumb2 and A1 for arm).
>
> Why do you think it's wrong?
thanks for checking this! I'll re-send v8 with your proposal.
--
Best regards,
Alexander Sverdlin.