summaryrefslogtreecommitdiff
path: root/arch/x86/mm/setup_nx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/setup_nx.c')
-rw-r--r--arch/x86/mm/setup_nx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
index 8bea84724a7d..f65a33f505b6 100644
--- a/arch/x86/mm/setup_nx.c
+++ b/arch/x86/mm/setup_nx.c
@@ -32,8 +32,9 @@ early_param("noexec", noexec_setup);
void x86_configure_nx(void)
{
- /* If disable_nx is set, clear NX on all new mappings going forward. */
- if (disable_nx)
+ if (boot_cpu_has(X86_FEATURE_NX) && !disable_nx)
+ __supported_pte_mask |= _PAGE_NX;
+ else
__supported_pte_mask &= ~_PAGE_NX;
}