]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.223.5 (41ee68b5s7SXOX6FRHT9GQ92WWOtRA)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 Jan 2005 14:03:33 +0000 (14:03 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 Jan 2005 14:03:33 +0000 (14:03 +0000)
Truncate the e820 RAM map to 4GB maximum on 32-bit x86.
We don't support PAE36 mode.

xen/arch/x86/e820.c

index 63bc128c7e47f3af67e1a83fe23052e7d18721de..50f1b5fc8b7b4957d3430ba43fea4a065ef2c6e2 100644 (file)
@@ -309,8 +309,33 @@ static void __init machine_specific_memory_setup(
     struct e820entry *raw, int raw_nr)
 {
     char nr = (char)raw_nr;
+    int i;
+
     sanitize_e820_map(raw, &nr);
+
     (void)copy_e820_map(raw, nr);
+
+#ifdef __i386__
+    /* 32-bit systems restricted to a 4GB physical memory map. */
+    for ( i = 0; i < e820.nr_map; i++ )
+    {
+        if ( (e820.map[i].addr + e820.map[i].size) <= 0x100000000ULL )
+            continue;
+        printk("WARNING: Only the first 4GB of the physical memory map "
+               "can be accessed\n"
+               "         by Xen in 32-bit mode. "
+               "Truncating the memory map...\n");
+        if ( e820.map[i].addr >= 0x100000000ULL )
+        {
+            e820.nr_map = i;
+        }
+        else
+        {
+            e820.map[i].size = 0x100000000ULL - e820.map[i].addr;
+            e820.nr_map = i + 1;                
+        }            
+    }
+#endif
 }
 
 unsigned long init_e820(struct e820entry *raw, int raw_nr)