From 01fe63ce354f5e3c2f42cc35b76fcab2f400fd93 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 11 Jan 2018 11:41:18 +0000 Subject: [PATCH] xen/pvh: do not mark the low 1MB as IO mem MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- xen/arch/x86/mm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.30.2