public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] tip/x86_64: fix e820 merge issue which broke max_pfn_mapped
@ 2008-07-08 23:08 Suresh Siddha
  2008-07-09  0:47 ` Yinghai Lu
  2008-07-09  0:59 ` Yinghai Lu
  0 siblings, 2 replies; 16+ messages in thread
From: Suresh Siddha @ 2008-07-08 23:08 UTC (permalink / raw)
  To: mingo, hpa, tglx; +Cc: linux-kernel, yhlu.kernel

With out this 64bit tip/master doesn't boot using ACPI on my system.
---
 
max_pfn_mapped should include all e820 entries.
The direct mapping extends to max_pfn_mapped, so that we can directly access
apertures, ACPI and other tables without having to play with fixmaps.

With this, my system with 1GB memory boots fine with ACPI enabled.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

Index: tree-x86/arch/x86/kernel/e820.c
===================================================================
--- tree-x86.orig/arch/x86/kernel/e820.c	2008-07-08 15:31:24.000000000 -0700
+++ tree-x86/arch/x86/kernel/e820.c	2008-07-08 15:55:09.000000000 -0700
@@ -1040,6 +1040,10 @@
 
 	if (last_pfn > max_arch_pfn)
 		last_pfn = max_arch_pfn;
+#ifdef CONFIG_X86_64
+	if (last_pfn > max_pfn_mapped)
+		max_pfn_mapped = last_pfn;
+#endif
 	if (last_pfn > end_user_pfn)
 		last_pfn = end_user_pfn;
 
@@ -1067,6 +1071,12 @@
 	if (*ei_startpfn >= *ei_endpfn)
 		return 0;
 
+#ifdef CONFIG_X86_64
+	/* Check if max_pfn_mapped should be updated */
+	if (ei->type != E820_RAM && *ei_endpfn > max_pfn_mapped)
+		max_pfn_mapped = *ei_endpfn;
+#endif
+
 	/* Skip if map is outside the node */
 	if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
 				    *ei_startpfn >= last_pfn)
Index: tree-x86/arch/x86/kernel/setup.c
===================================================================
--- tree-x86.orig/arch/x86/kernel/setup.c	2008-07-08 15:33:42.000000000 -0700
+++ tree-x86/arch/x86/kernel/setup.c	2008-07-08 15:33:49.000000000 -0700
@@ -722,8 +722,12 @@
 	high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
 #endif
 
+#ifdef CONFIG_X86_32
 	/* max_pfn_mapped is updated here */
 	max_pfn_mapped = init_memory_mapping(0, (max_low_pfn << PAGE_SHIFT));
+#else
+	max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT));
+#endif
 
 	/*
 	 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-07-09 20:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 23:08 [patch] tip/x86_64: fix e820 merge issue which broke max_pfn_mapped Suresh Siddha
2008-07-09  0:47 ` Yinghai Lu
2008-07-09  0:59 ` Yinghai Lu
2008-07-09  1:56   ` Yinghai Lu
2008-07-09 17:56     ` Suresh Siddha
2008-07-09 18:05       ` Yinghai Lu
2008-07-09 18:11         ` Jeremy Fitzhardinge
2008-07-09 18:44           ` Suresh Siddha
2008-07-09 18:47             ` Yinghai Lu
2008-07-09 18:50               ` Suresh Siddha
2008-07-09 18:51                 ` Yinghai Lu
2008-07-09 19:03             ` Jeremy Fitzhardinge
2008-07-09 20:34               ` Ingo Molnar
2008-07-09 18:48         ` Suresh Siddha
2008-07-09 18:59           ` Yinghai Lu
2008-07-09 17:00   ` Suresh Siddha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox