1 #include <linux/sched.h>
2 #include <linux/spinlock.h>
3 #include <linux/errno.h>
4 #include <linux/init.h>
6 #include <asm/pgtable.h>
9 static int disable_nx __cpuinitdata;
14 * Control non-executable mappings for processes.
19 static int __init noexec_setup(char *str)
23 if (!strncmp(str, "on", 2)) {
25 } else if (!strncmp(str, "off", 3)) {
32 early_param("noexec", noexec_setup);
34 void __cpuinit x86_configure_nx(void)
36 if (cpu_has_nx && !disable_nx)
37 __supported_pte_mask |= _PAGE_NX;
39 __supported_pte_mask &= ~_PAGE_NX;
42 void __init x86_report_nx(void)
46 printk(KERN_INFO "Using x86 segment limits to approximate NX protection\n");
49 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
52 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
54 printk(KERN_INFO "NX (Execute Disable) protection: "
55 "disabled by kernel command line option\n");
57 printk(KERN_INFO "NX (Execute Disable) protection: "
61 /* 32bit non-PAE kernel, NX cannot be used */
62 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
63 "cannot be enabled: non-PAE kernel!\n");