aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-08 21:56:38 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 04:43:25 -0400
commit2dc807b37b7b8c7df445513ad2b415df4ebcaf6d (patch)
treea28cb322758351c9549c1e73f1ebcad3d85913e2 /arch/x86/kernel/e820.c
parent49c980df552499e5e8595b52448f612fdab0484a (diff)
x86: make max_pfn cover acpi table below 4g
When system have 4g less ram installed, and acpi table sit near end of ram, make max_pfn cover them too, so 64bit kernel don't need to mess up fixmap. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: "Suresh Siddha" <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r--arch/x86/kernel/e820.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index e07d4019e266..2e08619a9c5c 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1056,12 +1056,20 @@ unsigned long __initdata end_user_pfn = MAX_ARCH_PFN;
1056/* 1056/*
1057 * Find the highest page frame number we have available 1057 * Find the highest page frame number we have available
1058 */ 1058 */
1059unsigned long __init e820_end_of_ram(void) 1059unsigned long __init e820_end(void)
1060{ 1060{
1061 unsigned long last_pfn; 1061 int i;
1062 unsigned long last_pfn = 0;
1062 unsigned long max_arch_pfn = MAX_ARCH_PFN; 1063 unsigned long max_arch_pfn = MAX_ARCH_PFN;
1063 1064
1064 last_pfn = find_max_pfn_with_active_regions(); 1065 for (i = 0; i < e820.nr_map; i++) {
1066 struct e820entry *ei = &e820.map[i];
1067 unsigned long end_pfn;
1068
1069 end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT;
1070 if (end_pfn > last_pfn)
1071 last_pfn = end_pfn;
1072 }
1065 1073
1066 if (last_pfn > max_arch_pfn) 1074 if (last_pfn > max_arch_pfn)
1067 last_pfn = max_arch_pfn; 1075 last_pfn = max_arch_pfn;
@@ -1192,9 +1200,7 @@ static int __init parse_memmap_opt(char *p)
1192 * the real mem size before original memory map is 1200 * the real mem size before original memory map is
1193 * reset. 1201 * reset.
1194 */ 1202 */
1195 e820_register_active_regions(0, 0, -1UL); 1203 saved_max_pfn = e820_end();
1196 saved_max_pfn = e820_end_of_ram();
1197 remove_all_active_ranges();
1198#endif 1204#endif
1199 e820.nr_map = 0; 1205 e820.nr_map = 0;
1200 userdef = 1; 1206 userdef = 1;