Re: [tip:x86/urgent] x86, efi: Delete efi_ioremap() and fix CONFIG_X86_32 oops
From: Yinghai Lu <yinghai@kernel.org>
Date: 2012-02-23 02:20:04
Also in:
lkml
On Wed, Feb 22, 2012 at 5:16 PM, tip-bot for Matt Fleming [off-list ref] wrote:
Commit-ID: �f75bd1837564657b21431e44243e064a77276589 Gitweb: � � http://git.kernel.org/tip/f75bd1837564657b21431e44243e064a77276589 Author: � � Matt Fleming [off-list ref] AuthorDate: Mon, 20 Feb 2012 13:30:26 +0000 Committer: �H. Peter Anvin [off-list ref] CommitDate: Wed, 22 Feb 2012 14:49:55 -0800 x86, efi: Delete efi_ioremap() and fix CONFIG_X86_32 oops
...
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index d7d5099..e22bb08 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c@@ -690,6 +690,8 @@ early_param("reservelow", parse_reservelow);�void __init setup_arch(char **cmdline_p) �{ + � � � unsigned long end_pfn; + �#ifdef CONFIG_X86_32 � � � �memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); � � � �visws_early_detect();@@ -926,7 +928,24 @@ void __init setup_arch(char **cmdline_p)� � � �init_gbpages(); � � � �/* max_pfn_mapped is updated here */ - � � � max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); + � � � end_pfn = max_low_pfn; + +#ifdef CONFIG_X86_64 + � � � /* + � � � �* There may be regions after the last E820_RAM region that we + � � � �* want to include in the kernel direct mapping because their + � � � �* contents are needed at runtime. + � � � �*/ + � � � if (efi_enabled) { + � � � � � � � unsigned long efi_end; + + � � � � � � � efi_end = e820_end_pfn(MAXMEM>>PAGE_SHIFT, E820_RESERVED_EFI);
+ � � � � � � � if (efi_end > end_pfn) + � � � � � � � � � � � end_pfn = efi_end; + � � � } +#endif + + � � � max_low_pfn_mapped = init_memory_mapping(0, end_pfn << PAGE_SHIFT);
Why is MAXMEM used here?
EFI reserved area could be above 4G?
if that is the case, you will map all mmio hole below 4g.
Yinghai