From: Roger Pau Monne Date: Thu, 11 Jan 2018 11:41:18 +0000 (+0000) Subject: xen/pvh: do not mark the low 1MB as IO mem X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~786 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=01fe63ce354f5e3c2f42cc35b76fcab2f400fd93;p=xen.git xen/pvh: do not mark the low 1MB as IO mem 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é Signed-off-by: Andrew Cooper --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a21a668d73..1147a1afb1 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -122,6 +122,7 @@ #include #include #include +#include #include #include @@ -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);