aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Shin <jacob.shin@amd.com>2011-10-20 17:15:26 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-10-17 13:59:39 -0400
commit1bbbbe779aabe1f0768c2bf8f8c0a5583679b54a (patch)
treeab09b4f7fded56cf36943ec56ef6b54baa786b67
parent961c79761dda351b5fb263a0654b98daac130b7a (diff)
x86: Exclude E820_RESERVED regions and memory holes above 4 GB from direct mapping.
On systems with very large memory (1 TB in our case), BIOS may report a reserved region or a hole in the E820 map, even above the 4 GB range. Exclude these from the direct mapping. [ hpa: this should be done not just for > 4 GB but for everything above the legacy region (1 MB), at the very least. That, however, turns out to require significant restructuring. That work is well underway, but is not suitable for rc/stable. ] Cc: stable@kernel.org # > 2.6.32 Signed-off-by: Jacob Shin <jacob.shin@amd.com> Link: http://lkml.kernel.org/r/1319145326-13902-1-git-send-email-jacob.shin@amd.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/kernel/setup.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f4b9b80e1b95..198e774498ec 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -919,8 +919,21 @@ void __init setup_arch(char **cmdline_p)
919 919
920#ifdef CONFIG_X86_64 920#ifdef CONFIG_X86_64
921 if (max_pfn > max_low_pfn) { 921 if (max_pfn > max_low_pfn) {
922 max_pfn_mapped = init_memory_mapping(1UL<<32, 922 int i;
923 max_pfn<<PAGE_SHIFT); 923 for (i = 0; i < e820.nr_map; i++) {
924 struct e820entry *ei = &e820.map[i];
925
926 if (ei->addr + ei->size <= 1UL << 32)
927 continue;
928
929 if (ei->type == E820_RESERVED)
930 continue;
931
932 max_pfn_mapped = init_memory_mapping(
933 ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr,
934 ei->addr + ei->size);
935 }
936
924 /* can we preseve max_low_pfn ?*/ 937 /* can we preseve max_low_pfn ?*/
925 max_low_pfn = max_pfn; 938 max_low_pfn = max_pfn;
926 } 939 }