lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [x86, build] 6dafca9780: WARNING:at_arch/x86/kernel/ftrace.c:#ftrace_verify_code
On Sun, Feb 28, 2021 at 11:25 PM kernel test robot
<oliver.sang@intel.com> wrote:
>
>
> Greeting,
>
> FYI, we noticed the following commit (built with clang-13):
>
> commit: 6dafca97803309c3cb5148d449bfa711e41ddef2 ("x86, build: use objtool mcount")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

Thanks for the report, I'm able to reproduce the warning.

> [ 4.764496] ------------[ ftrace bug ]------------
> [ 4.764847] ftrace failed to modify
> [ 4.764852] do_sys_open (kbuild/src/consumer/fs/open.c:1186)
> [ 4.765483] actual: 0f:1f:44:00:00
> [ 4.765784] Setting ftrace call site to call ftrace function
> [ 4.766193] ftrace record flags: 50000001
> [ 4.766490] (1) R
> [ 4.766490] expected tramp: ffffffff81037af0
> [ 4.766959] ------------[ cut here ]------------

Basically, the problem is that ftrace_replace_code() expects to find
ideal_nops[NOP_ATOMIC5] here, which in this case is 66:66:66:66:90,
while objtool has replaced the __fentry__ call with 0f:1f:44:00:00.

As ideal_nops changes depending on kernel config and hardware, when
CC_USING_NOP_MCOUNT is defined we could either change
ftrace_nop_replace() to always use P6_NOP5, or skip
ftrace_verify_code() in ftrace_replace_code() for
FTRACE_UPDATE_MAKE_CALL.

Steven, Peter, any thoughts?

Sami

\
 
 \ /
  Last update: 2021-03-02 15:11    [W:0.065 / U:3.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site