Messages in this thread | | | Date | Sat, 21 May 2011 12:43:10 +0200 | From | Ingo Molnar <> | Subject | Re: [tip:x86/smep] x86, cpu: Enable/disable Supervisor Mode Execution Protection |
| |
* Yinghai Lu <yinghai@kernel.org> wrote:
> > +static __init void setup_smep(struct cpuinfo_x86 *c) > > +{ > > + if (cpu_has(c, X86_FEATURE_SMEP)) { > > + if (unlikely(disable_smep)) { > > + setup_clear_cpu_cap(X86_FEATURE_SMEP); > > + clear_in_cr4(X86_CR4_SMEP); > > + } else > > + set_in_cr4(X86_CR4_SMEP); > > + } > > +} > > should be __cpuinit for this function. > > otherwise got: > > WARNING: arch/x86/built-in.o(.cpuinit.text+0x1b10): Section mismatch in reference from the function identify_cpu() to the function .init.text:setup_smep() > The function __cpuinit identify_cpu() references > a function __init setup_smep(). > If setup_smep is only used by identify_cpu then > annotate setup_smep with a matching annotation.
Yeah, indeed, and it might in fact crash with certain .config's. Mind sending a tested patch?
Thanks,
Ingo
| |