lkml.org 
[lkml]   [2011]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2011-05-21 12:45    [from the cache]
©2003-2011 Jasper Spaans