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

[Xen-devel] [PATCH v2 2/4] x86/e820: do not fixup memmap in copy_e820_map



And instead use the newly introduced e820_remove_range helper to
remove any RAM region from the low 1MB VGA/ROM region afterwards.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/e820.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index ba81b2f2dd..5b63667087 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -320,20 +320,6 @@ static int __init copy_e820_map(struct e820entry * 
biosmap, int nr_map)
         if (start > end)
             return -1;
 
-        /*
-         * Some BIOSes claim RAM in the 640k - 1M region.
-         * Not right. Fix it up.
-         */
-        if (type == E820_RAM) {
-            if (start < 0x100000ULL && end > 0xA0000ULL) {
-                if (start < 0xA0000ULL)
-                    add_memory_region(start, 0xA0000ULL-start, type);
-                if (end <= 0x100000ULL)
-                    continue;
-                start = 0x100000ULL;
-                size = end - start;
-            }
-        }
         add_memory_region(start, size, type);
     } while (biosmap++,--nr_map);
     return 0;
@@ -510,6 +496,12 @@ static void __init reserve_dmi_region(void)
     }
 }
 
+static void __init reserve_vga_region(void)
+{
+    /* Remove any RAM regions from the VGA hole. */
+    e820_remove_range(&e820, KB(640), MB(1) - 1, E820_RAM, true);
+}
+
 static void __init machine_specific_memory_setup(struct e820map *raw)
 {
     unsigned long mpt_limit, ro_mpt_limit;
@@ -545,6 +537,12 @@ static void __init machine_specific_memory_setup(struct 
e820map *raw)
 
     reserve_dmi_region();
 
+    /*
+     * Some BIOSes claim RAM in the 640k - 1M region.
+     * Not right. Fix it up.
+     */
+    reserve_vga_region();
+
     top_of_ram = mtrr_top_of_ram();
     if ( top_of_ram )
         clip_to_limit(top_of_ram, "MTRRs do not cover all of memory.");
-- 
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.