Re: [PATCH 1/3] jump_label: Warn on failed jump_label patch
From: Josh Poimboeuf
Date: Wed Feb 14 2018 - 12:34:30 EST
On Wed, Feb 14, 2018 at 12:18:20PM -0500, Jason Baron wrote:
>
>
> On 02/14/2018 12:01 PM, Steven Rostedt wrote:
> > On Wed, 14 Feb 2018 10:40:41 -0600
> > Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> >
> >> When the jump label code encounters an address which isn't recognized by
> >> kernel_text_address(), it just silently fails.
> >>
> >> This can be dangerous because jump labels are used in a variety of
> >> places, and are generally expected to work. Convert the silent failure
> >> to a warning.
> >
> > I made ftrace function tracing work on init code, can we do the same
> > with tracepoints (aka jump labels)?
> >
>
> jump labels do work on init code, except they don't work on it after it
> has been freed :)
>
> It uses 'kernel_text_address()', which will return true for init code if
> system_state < SYSTEM_RUNNING. See: core_kernel_text().
>
> So I'm guessing that the warnings here are coming from init code that
> has already been freed. Are we sure that these warnings are coming from
> init code that hasn't already been freed?
Ah, I see. I missed that 'system_state < SYSTEM_RUNNING' check. It was
nicely hidden. :-)
So I guess patches 2 & 3 can be dropped, as those tracepoints can still
be used during boot.
And in patch 1 the warning conditions need to be tweaked a bit to
exclude the __init case.
--
Josh