diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 00:37:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 00:44:13 -0400 |
commit | 82da65dab5f438ac7df28eeb43e2f5b742aa00ef (patch) | |
tree | 0b2a579d9385c516f6fbb3e2689f6611c9228aa7 /arch/x86 | |
parent | a1e4891fd48d298870b704c6eb48cba0da5ed6b1 (diff) |
x86: setup_smep needs to be __cpuinit
The setup_smep function gets calle at resume time too, and is thus not a
pure __init function. When marked as __init, it gets thrown out after
the kernel has initialized, and when the kernel is suspended and
resumed, the code will no longer be around, and we'll get a nice "kernel
tried to execute NX-protected page" oops because the page is no longer
marked executable.
Reported-and-tested-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index cbc70a27430..c8b41623377 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -254,7 +254,7 @@ static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) | |||
254 | } | 254 | } |
255 | #endif | 255 | #endif |
256 | 256 | ||
257 | static int disable_smep __initdata; | 257 | static int disable_smep __cpuinitdata; |
258 | static __init int setup_disable_smep(char *arg) | 258 | static __init int setup_disable_smep(char *arg) |
259 | { | 259 | { |
260 | disable_smep = 1; | 260 | disable_smep = 1; |
@@ -262,7 +262,7 @@ static __init int setup_disable_smep(char *arg) | |||
262 | } | 262 | } |
263 | __setup("nosmep", setup_disable_smep); | 263 | __setup("nosmep", setup_disable_smep); |
264 | 264 | ||
265 | static __init void setup_smep(struct cpuinfo_x86 *c) | 265 | static __cpuinit void setup_smep(struct cpuinfo_x86 *c) |
266 | { | 266 | { |
267 | if (cpu_has(c, X86_FEATURE_SMEP)) { | 267 | if (cpu_has(c, X86_FEATURE_SMEP)) { |
268 | if (unlikely(disable_smep)) { | 268 | if (unlikely(disable_smep)) { |