Re: [PATCH] extable: Make init_kernel_text() global
From: Steven Rostedt
Date: Fri Feb 16 2018 - 13:04:00 EST
On Fri, 16 Feb 2018 11:57:44 -0600
Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> On Fri, Feb 16, 2018 at 11:55:54AM -0500, Jason Baron wrote:
> > > +/* Disable any jump label entries in __init code */
> > > +void __init jump_label_invalidate_init(void)
> > > +{
> > > + struct jump_entry *iter_start = __start___jump_table;
> > > + struct jump_entry *iter_stop = __stop___jump_table;
> > > + struct jump_entry *iter;
> > > +
> > > + for (iter = iter_start; iter < iter_stop; iter++)
> > > + if (iter->code >= (unsigned long)_sinittext &&
> > > + iter->code < (unsigned long)_einittext)
> > > + iter->code = 0;
> > > +}
> >
> > Seems like this wants to use init_kernel_text() but i see its marked
> > 'static', perhaps it can be moved to a header?
>
> How about this patch on top?
Yes please.
>
> ---------
>
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Subject: [PATCH] extable: Make init_kernel_text() global
>
> Convert init_kernel_text() to a global function and use it in a few
> places instead of manually comparing _sinittext and _einittext.
>
> Note that kallsyms.h has a very similar function called
> is_kernel_inittext(), but its end check is inclusive. I'm not sure
> whether that's intentional behavior, so I didn't touch it.
>
> Suggested-by: Jason Baron <jbaron@xxxxxxxxxx>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> ---
Acked-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
-- Steve