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 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)) {
31 early_param("noexec", noexec_setup);
33 void __cpuinit x86_configure_nx(void)
35 if (cpu_has_nx && !disable_nx)
36 __supported_pte_mask |= _PAGE_NX;
38 __supported_pte_mask &= ~_PAGE_NX;
41 void __init x86_report_nx(void)
46 printk(KERN_INFO "NX (Execute Disable) protection: "
47 "approximated by x86 segment limits\n");
49 printk(KERN_INFO "NX (Execute Disable) protection: "
50 "approximation disabled by kernel command "
53 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
57 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
59 printk(KERN_INFO "NX (Execute Disable) protection: "
60 "disabled by kernel command line option\n");
62 printk(KERN_INFO "NX (Execute Disable) protection: "
66 /* 32bit non-PAE kernel, NX cannot be used */
67 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
68 "cannot be enabled: non-PAE kernel!\n");