提交 1bbbbe77 编写于 作者: J Jacob Shin 提交者: H. Peter Anvin

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: NJacob Shin <jacob.shin@amd.com>
Link: http://lkml.kernel.org/r/1319145326-13902-1-git-send-email-jacob.shin@amd.comSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
上级 961c7976
...@@ -919,8 +919,21 @@ void __init setup_arch(char **cmdline_p) ...@@ -919,8 +919,21 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
if (max_pfn > max_low_pfn) { if (max_pfn > max_low_pfn) {
max_pfn_mapped = init_memory_mapping(1UL<<32, int i;
max_pfn<<PAGE_SHIFT); for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
if (ei->addr + ei->size <= 1UL << 32)
continue;
if (ei->type == E820_RESERVED)
continue;
max_pfn_mapped = init_memory_mapping(
ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr,
ei->addr + ei->size);
}
/* can we preseve max_low_pfn ?*/ /* can we preseve max_low_pfn ?*/
max_low_pfn = max_pfn; max_low_pfn = max_pfn;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册