aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2009-03-05 07:54:56 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-05 08:17:12 -0500
commit54e63f3a4282a8bc5b39db29095f076ece2b1073 (patch)
tree105ebabc730cfeed7f27c3de5793d8d809501e90 /arch
parente7179853e7552ba6631e2cdd9f5c374383403b4b (diff)
x86: ifdef 32-bit specific setup in init_memory_mapping()
Impact: cleanup Enabling NX, PSE, and PGE are only required on 32-bit so ifdef them in both versions of the function. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <1236257708-27269-5-git-send-email-penberg@cs.helsinki.fi> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/mm/init_32.c2
-rw-r--r--arch/x86/mm/init_64.c18
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index cfc68d601380..eb98cb90cb39 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -948,6 +948,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
948 use_gbpages = direct_gbpages; 948 use_gbpages = direct_gbpages;
949#endif 949#endif
950 950
951#ifdef CONFIG_X86_32
951#ifdef CONFIG_X86_PAE 952#ifdef CONFIG_X86_PAE
952 set_nx(); 953 set_nx();
953 if (nx_enabled) 954 if (nx_enabled)
@@ -963,6 +964,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
963 set_in_cr4(X86_CR4_PGE); 964 set_in_cr4(X86_CR4_PGE);
964 __supported_pte_mask |= _PAGE_GLOBAL; 965 __supported_pte_mask |= _PAGE_GLOBAL;
965 } 966 }
967#endif
966 968
967 if (use_gbpages) 969 if (use_gbpages)
968 page_size_mask |= 1 << PG_LEVEL_1G; 970 page_size_mask |= 1 << PG_LEVEL_1G;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 151e5ba34412..c3c0be5b6373 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -712,6 +712,24 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
712 use_gbpages = direct_gbpages; 712 use_gbpages = direct_gbpages;
713#endif 713#endif
714 714
715#ifdef CONFIG_X86_32
716#ifdef CONFIG_X86_PAE
717 set_nx();
718 if (nx_enabled)
719 printk(KERN_INFO "NX (Execute Disable) protection: active\n");
720#endif
721
722 /* Enable PSE if available */
723 if (cpu_has_pse)
724 set_in_cr4(X86_CR4_PSE);
725
726 /* Enable PGE if available */
727 if (cpu_has_pge) {
728 set_in_cr4(X86_CR4_PGE);
729 __supported_pte_mask |= _PAGE_GLOBAL;
730 }
731#endif
732
715 if (use_gbpages) 733 if (use_gbpages)
716 page_size_mask |= 1 << PG_LEVEL_1G; 734 page_size_mask |= 1 << PG_LEVEL_1G;
717 if (use_pse) 735 if (use_pse)