Re: [x86, build] 6dafca9780: WARNING:at_arch/x86/kernel/ftrace.c:#ftrace_verify_code

From: Steven Rostedt
Date: Tue Mar 02 2021 - 02:50:22 EST


On Mon, 1 Mar 2021 18:40:32 -0800
Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:

> On Mon, Mar 01, 2021 at 08:15:26PM -0500, Steven Rostedt wrote:
> > On Mon, 1 Mar 2021 16:03:51 -0800
> > Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:
> > >
> > > > ret = ftrace_verify_code(rec->ip, old);
> > > > +
> > > > + if (__is_defined(CC_USING_NOP_MCOUNT) && ret && old_nop) {
> > > > + /* Compiler could have put in P6_NOP5 */
> > > > + old = P6_NOP5;
> > > > + ret = ftrace_verify_code(rec->ip, old);
> > > > + }
> > > > +
> > >
> > > Wouldn't that still hit WARN(1) in the initial ftrace_verify_code()
> > > call if ideal_nops doesn't match?
> >
> > That was too quickly written ;-)
> >
> > Take 2:
> >
> > [ with fixes for setting p6_nop ]
>
> Thanks, I tested this with the config from the build bot, and I can
> confirm that it fixes the issue for me.
>
> I also tested a quick patch to disable the __fentry__ conversion in
> objtool, and it seems to work too, but it's probably a good idea to
> fix the issue with CC_USING_NOP_MCOUNT in any case.

Thanks for testing, I'll make this into a proper patch and start
testing it internally. I'm assuming you want this to go into the -rc
release and possibly stable?

-- Steve