aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a2bb18e02839..ca45696f30fb 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -920,8 +920,22 @@ void __init setup_arch(char **cmdline_p)
920 920
921#ifdef CONFIG_X86_64 921#ifdef CONFIG_X86_64
922 if (max_pfn > max_low_pfn) { 922 if (max_pfn > max_low_pfn) {
923 max_pfn_mapped = init_memory_mapping(1UL<<32, 923 int i;
924 max_pfn<<PAGE_SHIFT); 924 unsigned long start, end;
925 unsigned long start_pfn, end_pfn;
926
927 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn,
928 NULL) {
929
930 end = PFN_PHYS(end_pfn);
931 if (end <= (1UL<<32))
932 continue;
933
934 start = PFN_PHYS(start_pfn);
935 max_pfn_mapped = init_memory_mapping(
936 max((1UL<<32), start), end);
937 }
938
925 /* can we preseve max_low_pfn ?*/ 939 /* can we preseve max_low_pfn ?*/
926 max_low_pfn = max_pfn; 940 max_low_pfn = max_pfn;
927 } 941 }
@@ -1035,6 +1049,18 @@ void __init setup_arch(char **cmdline_p)
1035 arch_init_ideal_nops(); 1049 arch_init_ideal_nops();
1036 1050
1037 register_refined_jiffies(CLOCK_TICK_RATE); 1051 register_refined_jiffies(CLOCK_TICK_RATE);
1052
1053#ifdef CONFIG_EFI
1054 /* Once setup is done above, disable efi_enabled on mismatched
1055 * firmware/kernel archtectures since there is no support for
1056 * runtime services.
1057 */
1058 if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
1059 pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
1060 efi_unmap_memmap();
1061 efi_enabled = 0;
1062 }
1063#endif
1038} 1064}
1039 1065
1040#ifdef CONFIG_X86_32 1066#ifdef CONFIG_X86_32