]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen/pvh: do not mark the low 1MB as IO mem
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 11 Jan 2018 11:41:18 +0000 (11:41 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 16 Jan 2018 18:34:05 +0000 (18:34 +0000)
On PVH there's nothing special on the low 1MB.

This is an optional patch that doesn't affect the functionality of the
shim.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index a21a668d735c8da3f5a2c604597386a9251332e0..1147a1afb1bc31ce544d0c76022b48461a8dadf6 100644 (file)
 #include <asm/fixmap.h>
 #include <asm/io_apic.h>
 #include <asm/pci.h>
+#include <asm/guest.h>
 
 #include <asm/hvm/grant_table.h>
 #include <asm/pv/grant_table.h>
@@ -288,8 +289,12 @@ void __init arch_init_memory(void)
     dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0, NULL);
     BUG_ON(IS_ERR(dom_cow));
 
-    /* First 1MB of RAM is historically marked as I/O. */
-    for ( i = 0; i < 0x100; i++ )
+    /*
+     * First 1MB of RAM is historically marked as I/O.  If we booted PVH,
+     * reclaim the space.  Irrespective, leave MFN 0 as special for the sake
+     * of 0 being a very common default value.
+     */
+    for ( i = 0; i < (pvh_boot ? 1 : 0x100); i++ )
         share_xen_page_with_guest(mfn_to_page(_mfn(i)),
                                   dom_io, XENSHARE_writable);