[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#270426: Fixed with 2.6.9



On Thu, Nov 04, 2004 at 12:35:51PM +0900, Horms wrote:
> On Wed, Nov 03, 2004 at 06:17:15PM +0100, Daniel Vollmer wrote:
> > The problem does not occur anymore with the newly released 2.6.9
> > kernel-image.
> 
> Thanks, I will try and track down what change resolved the problem.
> Any pointers greatly appreciated.

Hi,

I took a look through the change logs 2.6.9 for ACPI changes.
However, there are rather a lot of them, so I am not sure exactly
which one resolves this problem. The one that seems most likely
is annotated as:

  [ACPI] reserve EBDA for Dell BIOS that neglects to. (David Shaohua Li)
  http://bugme.osdl.org/show_bug.cgi?id=2990

I have attached the patch that went into BK and thus 2.6.9.
It seems to apply cleanly to the Debian 2.6.8 tree, is anyone
able to test it to see if it resolves the problem at hand?

-- 
Horms
# origin: len.brown (BitKeeper)
# cset: 1.1731.1.8 (2.6) key=40ec3899SHh6vR4lsWkKtRhKVbnqew
# inclusion: upstream
# descrition: [ACPI] reserve EBDA for Dell BIOS that neglects to. (David Shaohua Li)
# revision date: Thu, 04 Nov 2004 16:14:29 +0900
#
# rset: ChangeSet|1.1731.1.7..1.1731.1.8
# rset: arch/x86_64/kernel/setup.c|1.41..1.41.1.1
# rset: arch/i386/kernel/setup.c|1.119..1.119.1.1
# rset: arch/i386/mm/discontig.c|1.16..1.16.1.1
#
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/07/07 13:53:29-04:00 len.brown@intel.com 
#   [ACPI] reserve EBDA for Dell BIOS that neglects to. (David Shaohua Li)
#   http://bugme.osdl.org/show_bug.cgi?id=2990
# 
# arch/x86_64/kernel/setup.c
#   2004/06/30 23:30:27-04:00 len.brown@intel.com +17 -0
#   reserve EBDA for Dell BIOS that neglects to.
# 
# arch/i386/mm/discontig.c
#   2004/06/30 22:51:37-04:00 len.brown@intel.com +15 -0
#   reserve EBDA for Dell BIOS that neglects to.
# 
# arch/i386/kernel/setup.c
#   2004/06/30 22:51:37-04:00 len.brown@intel.com +15 -0
#   reserve EBDA for Dell BIOS that neglects to.
# 
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	2004-11-04 16:14:28 +09:00
+++ b/arch/i386/kernel/setup.c	2004-11-04 16:14:29 +09:00
@@ -49,6 +49,7 @@
 #include <asm/ist.h>
 #include <asm/std_resources.h>
 #include "setup_arch_pre.h"
+#include <bios_ebda.h>
 
 /* This value is set up by the early boot code to point to the value
    immediately after the boot time page tables.  It contains a *physical*
@@ -808,6 +809,17 @@
 	}
 }
 
+/*
+ * workaround for Dell systems that neglect to reserve EBDA
+ */
+static void __init reserve_ebda_region(void)
+{
+	unsigned int addr;
+	addr = get_bios_ebda();
+	if (addr)
+		reserve_bootmem(addr, PAGE_SIZE);	
+}
+
 static unsigned long __init setup_memory(void)
 {
 	unsigned long bootmap_size, start_pfn, max_low_pfn;
@@ -853,6 +865,9 @@
 	 * enabling clean reboots, SMP operation, laptop functions.
 	 */
 	reserve_bootmem(0, PAGE_SIZE);
+
+	/* reserve EBDA region, it's a 4K region */
+	reserve_ebda_region();
 
     /* could be an AMD 768MPX chipset. Reserve a page  before VGA to prevent
        PCI prefetch into it (errata #56). Usually the page is reserved anyways,
diff -Nru a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
--- a/arch/i386/mm/discontig.c	2004-11-04 16:14:29 +09:00
+++ b/arch/i386/mm/discontig.c	2004-11-04 16:14:29 +09:00
@@ -31,6 +31,7 @@
 #include <asm/e820.h>
 #include <asm/setup.h>
 #include <asm/mmzone.h>
+#include <bios_ebda.h>
 
 struct pglist_data *node_data[MAX_NUMNODES];
 bootmem_data_t node0_bdata;
@@ -227,6 +228,17 @@
 	return reserve_pages;
 }
 
+/*
+ * workaround for Dell systems that neglect to reserve EBDA
+ */
+static void __init reserve_ebda_region_node(void)
+{
+	unsigned int addr;
+	addr = get_bios_ebda();
+	if (addr)
+		reserve_bootmem_node(NODE_DATA(0), addr, PAGE_SIZE);
+}
+
 unsigned long __init setup_memory(void)
 {
 	int nid;
@@ -300,6 +312,9 @@
 	 * trampoline before removing it. (see the GDT stuff)
 	 */
 	reserve_bootmem_node(NODE_DATA(0), PAGE_SIZE, PAGE_SIZE);
+
+	/* reserve EBDA region, it's a 4K region */
+	reserve_ebda_region_node();
 
 #ifdef CONFIG_ACPI_SLEEP
 	/*
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c	2004-11-04 16:14:28 +09:00
+++ b/arch/x86_64/kernel/setup.c	2004-11-04 16:14:28 +09:00
@@ -422,6 +422,20 @@
 #define copy_edd() do {} while (0)
 #endif
 
+#define EBDA_ADDR_POINTER 0x40E
+static void __init reserve_ebda_region(void)
+{
+	unsigned int addr;
+	/** 
+	 * there is a real-mode segmented pointer pointing to the 
+	 * 4K EBDA area at 0x40E
+	 */
+	addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER);
+	addr <<= 4;
+	if (addr)
+		reserve_bootmem_generic(addr, PAGE_SIZE);
+}
+
 void __init setup_arch(char **cmdline_p)
 {
 	unsigned long low_mem_size;
@@ -485,6 +499,9 @@
 	 * enabling clean reboots, SMP operation, laptop functions.
 	 */
 	reserve_bootmem_generic(0, PAGE_SIZE);
+
+	/* reserve ebda region */
+	reserve_ebda_region();
 
 #ifdef CONFIG_SMP
 	/*

Reply to: