aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
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')
-rw-r--r--arch/x86/kernel/e820.c18
-rw-r--r--arch/x86/kernel/setup.c13
2 files changed, 15 insertions, 16 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;
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index bea8ae77d059..a7c3471ea17c 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -709,22 +709,18 @@ void __init setup_arch(char **cmdline_p)
709 early_gart_iommu_check(); 709 early_gart_iommu_check();
710#endif 710#endif
711 711
712 e820_register_active_regions(0, 0, -1UL);
713 /* 712 /*
714 * partially used pages are not usable - thus 713 * partially used pages are not usable - thus
715 * we are rounding upwards: 714 * we are rounding upwards:
716 */ 715 */
717 max_pfn = e820_end_of_ram(); 716 max_pfn = e820_end();
718 717
719 /* preallocate 4k for mptable mpc */ 718 /* preallocate 4k for mptable mpc */
720 early_reserve_e820_mpc_new(); 719 early_reserve_e820_mpc_new();
721 /* update e820 for memory not covered by WB MTRRs */ 720 /* update e820 for memory not covered by WB MTRRs */
722 mtrr_bp_init(); 721 mtrr_bp_init();
723 if (mtrr_trim_uncached_memory(max_pfn)) { 722 if (mtrr_trim_uncached_memory(max_pfn))
724 remove_all_active_ranges(); 723 max_pfn = e820_end();
725 e820_register_active_regions(0, 0, -1UL);
726 max_pfn = e820_end_of_ram();
727 }
728 724
729#ifdef CONFIG_X86_32 725#ifdef CONFIG_X86_32
730 /* max_low_pfn get updated here */ 726 /* max_low_pfn get updated here */
@@ -767,9 +763,6 @@ void __init setup_arch(char **cmdline_p)
767 */ 763 */
768 acpi_boot_table_init(); 764 acpi_boot_table_init();
769 765
770 /* Remove active ranges so rediscovery with NUMA-awareness happens */
771 remove_all_active_ranges();
772
773#ifdef CONFIG_ACPI_NUMA 766#ifdef CONFIG_ACPI_NUMA
774 /* 767 /*
775 * Parse SRAT to discover nodes. 768 * Parse SRAT to discover nodes.