mbox series

[stable,4.9,v2,0/4] ARM: ftrace MODULE_PLTS warning

Message ID 20210922170246.190499-1-f.fainelli@gmail.com (mailing list archive)
Headers show
Series ARM: ftrace MODULE_PLTS warning | expand

Message

Florian Fainelli Sept. 22, 2021, 5:02 p.m. UTC
This patch series is present in v5.14 and fixes warnings seen at insmod
with FTRACE and MODULE_PLTS enabled on ARM/Linux.

Changes in v2:

- included build fix without DYNAMIC_FTRACE
- preserved Author's original name in 4.9 submission

Alex Sverdlin (4):
  ARM: 9077/1: PLT: Move struct plt_entries definition to header
  ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link()
  ARM: 9079/1: ftrace: Add MODULE_PLTS support
  ARM: 9098/1: ftrace: MODULE_PLT: Fix build problem without
    DYNAMIC_FTRACE

 arch/arm/include/asm/ftrace.h |  3 +++
 arch/arm/include/asm/insn.h   |  8 +++---
 arch/arm/include/asm/module.h | 10 +++++++
 arch/arm/kernel/ftrace.c      | 45 +++++++++++++++++++++++++++-----
 arch/arm/kernel/insn.c        | 19 +++++++-------
 arch/arm/kernel/module-plts.c | 49 +++++++++++++++++++++++++++--------
 6 files changed, 103 insertions(+), 31 deletions(-)

Comments

Greg KH Sept. 23, 2021, 10:35 a.m. UTC | #1
On Wed, Sep 22, 2021 at 10:02:42AM -0700, Florian Fainelli wrote:
> This patch series is present in v5.14 and fixes warnings seen at insmod
> with FTRACE and MODULE_PLTS enabled on ARM/Linux.

All now queued up, thanks.

greg k-h
Sasha Levin Sept. 24, 2021, 11:52 a.m. UTC | #2
On Thu, Sep 23, 2021 at 12:35:03PM +0200, Greg Kroah-Hartman wrote:
>On Wed, Sep 22, 2021 at 10:02:42AM -0700, Florian Fainelli wrote:
>> This patch series is present in v5.14 and fixes warnings seen at insmod
>> with FTRACE and MODULE_PLTS enabled on ARM/Linux.
>
>All now queued up, thanks.

Looks like 4.19 and older break the build:

arch/arm/kernel/ftrace.c: In function 'ftrace_update_ftrace_func':
arch/arm/kernel/ftrace.c:157:9: error: too few arguments to function 'ftrace_call_replace'
   157 |   new = ftrace_call_replace(pc, (unsigned long)func);
       |         ^~~~~~~~~~~~~~~~~~~
arch/arm/kernel/ftrace.c:99:22: note: declared here
    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
       |                      ^~~~~~~~~~~~~~~~~~~
arch/arm/kernel/ftrace.c: In function 'ftrace_make_nop':
arch/arm/kernel/ftrace.c:240:9: error: too few arguments to function 'ftrace_call_replace'
   240 |   old = ftrace_call_replace(ip, adjust_address(rec, addr));
       |         ^~~~~~~~~~~~~~~~~~~
arch/arm/kernel/ftrace.c:99:22: note: declared here
    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
       |                      ^~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:303: arch/arm/kernel/ftrace.o] Error 1

I've dropped them.
Alexander Sverdlin Sept. 24, 2021, 3:27 p.m. UTC | #3
Hi Sasha,

On 24/09/2021 13:52, Sasha Levin wrote:
>>> This patch series is present in v5.14 and fixes warnings seen at insmod
>>> with FTRACE and MODULE_PLTS enabled on ARM/Linux.
>>
>> All now queued up, thanks.
> 
> Looks like 4.19 and older break the build:
> 
> arch/arm/kernel/ftrace.c: In function 'ftrace_update_ftrace_func':
> arch/arm/kernel/ftrace.c:157:9: error: too few arguments to function 'ftrace_call_replace'
>   157 |   new = ftrace_call_replace(pc, (unsigned long)func);
>       |         ^~~~~~~~~~~~~~~~~~~

in principle you can add ", true" as a third argument in all these ftrace_call_replace()
call-sites which still have two args.

> arch/arm/kernel/ftrace.c:99:22: note: declared here
>    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
>       |                      ^~~~~~~~~~~~~~~~~~~
> arch/arm/kernel/ftrace.c: In function 'ftrace_make_nop':
> arch/arm/kernel/ftrace.c:240:9: error: too few arguments to function 'ftrace_call_replace'
>   240 |   old = ftrace_call_replace(ip, adjust_address(rec, addr));
>       |         ^~~~~~~~~~~~~~~~~~~
> arch/arm/kernel/ftrace.c:99:22: note: declared here
>    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
>       |                      ^~~~~~~~~~~~~~~~~~~
> make[2]: *** [scripts/Makefile.build:303: arch/arm/kernel/ftrace.o] Error 1
> 
> I've dropped them.
Florian Fainelli Sept. 24, 2021, 4:11 p.m. UTC | #4
On 9/24/21 8:27 AM, Alexander Sverdlin wrote:
> Hi Sasha,
> 
> On 24/09/2021 13:52, Sasha Levin wrote:
>>>> This patch series is present in v5.14 and fixes warnings seen at insmod
>>>> with FTRACE and MODULE_PLTS enabled on ARM/Linux.
>>>
>>> All now queued up, thanks.
>>
>> Looks like 4.19 and older break the build:
>>
>> arch/arm/kernel/ftrace.c: In function 'ftrace_update_ftrace_func':
>> arch/arm/kernel/ftrace.c:157:9: error: too few arguments to function 'ftrace_call_replace'
>>   157 |   new = ftrace_call_replace(pc, (unsigned long)func);
>>       |         ^~~~~~~~~~~~~~~~~~~
> 
> in principle you can add ", true" as a third argument in all these ftrace_call_replace()
> call-sites which still have two args.

Sasha, what configuration failed to build? I build tested with
mutli_v7_defconfig which does enable FTRACE by default and then ensured
that CONFIG_ARM_MODULE_PLTS was enabled. From there I will re-submit,
sorry about that.

> 
>> arch/arm/kernel/ftrace.c:99:22: note: declared here
>>    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
>>       |                      ^~~~~~~~~~~~~~~~~~~
>> arch/arm/kernel/ftrace.c: In function 'ftrace_make_nop':
>> arch/arm/kernel/ftrace.c:240:9: error: too few arguments to function 'ftrace_call_replace'
>>   240 |   old = ftrace_call_replace(ip, adjust_address(rec, addr));
>>       |         ^~~~~~~~~~~~~~~~~~~
>> arch/arm/kernel/ftrace.c:99:22: note: declared here
>>    99 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
>>       |                      ^~~~~~~~~~~~~~~~~~~
>> make[2]: *** [scripts/Makefile.build:303: arch/arm/kernel/ftrace.o] Error 1
>>
>> I've dropped them.
>
Sasha Levin Sept. 24, 2021, 4:41 p.m. UTC | #5
On Fri, Sep 24, 2021 at 09:11:18AM -0700, Florian Fainelli wrote:
>On 9/24/21 8:27 AM, Alexander Sverdlin wrote:
>> Hi Sasha,
>>
>> On 24/09/2021 13:52, Sasha Levin wrote:
>>>>> This patch series is present in v5.14 and fixes warnings seen at insmod
>>>>> with FTRACE and MODULE_PLTS enabled on ARM/Linux.
>>>>
>>>> All now queued up, thanks.
>>>
>>> Looks like 4.19 and older break the build:
>>>
>>> arch/arm/kernel/ftrace.c: In function 'ftrace_update_ftrace_func':
>>> arch/arm/kernel/ftrace.c:157:9: error: too few arguments to function 'ftrace_call_replace'
>>>   157 |   new = ftrace_call_replace(pc, (unsigned long)func);
>>>       |         ^~~~~~~~~~~~~~~~~~~
>>
>> in principle you can add ", true" as a third argument in all these ftrace_call_replace()
>> call-sites which still have two args.
>
>Sasha, what configuration failed to build? I build tested with
>mutli_v7_defconfig which does enable FTRACE by default and then ensured
>that CONFIG_ARM_MODULE_PLTS was enabled. From there I will re-submit,
>sorry about that.

allmodconfig seemed to have hit that.