Re: [PATCH] ftrace: x86: Fix a compile error about get_kernel_nofault()

Sami Tolvanen
2025-02-12T16:53:05Z

On Tue, Feb 11, 2025 at 7:49 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Tue, 11 Feb 2025 11:09:14 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > I was aiming my patch for x86/core, but if there's a reason to expedite
> > them, I can stick it in x86/urgent I suppose.
> >
> > Just need a reason -- what's this compile error nonsense about, my
> > kernels build just fine?
>
> Masami,
>
> Do you have a config that fails to build without this fix? If so, can you
> please reply with it, and then this can go in as a quick fix.

x86 builds with both CONFIG_GENDWARFKSYMS and CONFIG_FUNCTION_TRACER
are broken without this fix. Here's how to reproduce:

$ make defconfig
$ ./scripts/config -e DEBUG_INFO -e DEBUG_INFO_DWARF5 -e MODVERSIONS
-e GENDWARFKSYMS -e FUNCTION_TRACER
$ make olddefconfig && make -j
...
In file included from ./arch/x86/include/asm/asm-prototypes.h:2,
from <stdin>:3:
./arch/x86/include/asm/ftrace.h: In function ‘arch_ftrace_get_symaddr’:
./arch/x86/include/asm/ftrace.h:46:21: error: implicit declaration of
function ‘get_kernel_nofault’ [-Wimplicit-function-declaration]
46 | if (get_kernel_nofault(instr, (u32
*)(fentry_ip - ENDBR_INSN_SIZE)))
...

Sami