Merge branches 'x86/fpu', 'x86/mm' and 'x86/asm' into x86/pkeys
[cascardo/linux.git] / arch / x86 / mm / setup_nx.c
index 92e2eac..8bea847 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <asm/pgtable.h>
 #include <asm/proto.h>
+#include <asm/cpufeature.h>
 
 static int disable_nx;
 
@@ -31,9 +32,8 @@ early_param("noexec", noexec_setup);
 
 void x86_configure_nx(void)
 {
-       if (boot_cpu_has(X86_FEATURE_NX) && !disable_nx)
-               __supported_pte_mask |= _PAGE_NX;
-       else
+       /* If disable_nx is set, clear NX on all new mappings going forward. */
+       if (disable_nx)
                __supported_pte_mask &= ~_PAGE_NX;
 }