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

[Xen-changelog] [xen staging] guest/pvh: special case the low 1MB



commit c49338ef287c44113476d4c6ccaad7fa2924f8c7
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Nov 12 17:14:57 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 12 17:14:57 2018 +0100

    guest/pvh: special case the low 1MB
    
    When running as a PVH guest Xen only special cases the trampoline
    code in the low 1MB, without also reserving the space used by the
    relocated metadata or the trampoline stack.
    
    Fix this by always reserving the low 1MB regardless of whether Xen is
    running as a guest or natively.
    
    Reported-by: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/mm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2c450cc208..16c7d88a8e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -291,16 +291,13 @@ void __init arch_init_memory(void)
     BUG_ON(IS_ERR(dom_cow));
 
     /*
-     * 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. Also reserve the RAM needed by
-     * the trampoline on PVH starting at MFN 1.
+     * First 1MB of RAM is historically marked as I/O.
+     * Note that apart from IO Xen also uses the low 1MB to store the AP boot
+     * trampoline and boot information metadata. Due to this always special
+     * case the low 1MB.
      */
     BUG_ON(pvh_boot && trampoline_phys != 0x1000);
-    for ( i = 0;
-          i < (pvh_boot ? (1 + PFN_UP(trampoline_end - trampoline_start))
-                        : 0x100);
-          i++ )
+    for ( i = 0; i < 0x100; i++ )
         share_xen_page_with_guest(mfn_to_page(_mfn(i)), dom_io, SHARE_rw);
 
     /* Any areas not specified as RAM by the e820 map are considered I/O. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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