diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-04-21 11:39:27 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-21 10:48:08 +0200 |
commit | 89388913f2c88a2cd15d24abab571b17a2596127 (patch) | |
tree | 2d3791f3fe4b844ba007371c2fe203b304e4c2cc /arch/x86/mm/init_32.c | |
parent | 8ecee4620e76aae418bfa0e8cc830e92cb559bbb (diff) | |
download | op-kernel-dev-89388913f2c88a2cd15d24abab571b17a2596127.zip op-kernel-dev-89388913f2c88a2cd15d24abab571b17a2596127.tar.gz |
x86: unify noexec handling
This patch unifies noexec handling on 32-bit and 64-bit.
[ Impact: cleanup ]
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
[ mingo@elte.hu: build fix ]
LKML-Reference: <1240303167.771.69.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 749559e..2b27120 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -587,61 +587,9 @@ void zap_low_mappings(void) flush_tlb_all(); } -int nx_enabled; - pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP); EXPORT_SYMBOL_GPL(__supported_pte_mask); -#ifdef CONFIG_X86_PAE - -static int disable_nx __initdata; - -/* - * noexec = on|off - * - * Control non executable mappings. - * - * on Enable - * off Disable - */ -static int __init noexec_setup(char *str) -{ - if (!str || !strcmp(str, "on")) { - if (cpu_has_nx) { - __supported_pte_mask |= _PAGE_NX; - disable_nx = 0; - } - } else { - if (!strcmp(str, "off")) { - disable_nx = 1; - __supported_pte_mask &= ~_PAGE_NX; - } else { - return -EINVAL; - } - } - - return 0; -} -early_param("noexec", noexec_setup); - -void __init set_nx(void) -{ - unsigned int v[4], l, h; - - if (cpu_has_pae && (cpuid_eax(0x80000000) > 0x80000001)) { - cpuid(0x80000001, &v[0], &v[1], &v[2], &v[3]); - - if ((v[3] & (1 << 20)) && !disable_nx) { - rdmsr(MSR_EFER, l, h); - l |= EFER_NX; - wrmsr(MSR_EFER, l, h); - nx_enabled = 1; - __supported_pte_mask |= _PAGE_NX; - } - } -} -#endif - /* user-defined highmem size */ static unsigned int highmem_pages = -1; |