x86/dom0: fix copy of low 1MB data for PVH
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 1 Apr 2020 10:36:57 +0000 (12:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 1 Apr 2020 10:36:57 +0000 (12:36 +0200)
The orders of start and end are inverted in order to calculate the
size of the copy operation.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/dom0_build.c

index 2afd44c8a4adc10c53ee03ed18929327bc967c26..12a82c9d7cb3700cb2f4dfc0a6f87b0275d7bf67 100644 (file)
@@ -463,7 +463,7 @@ static int __init pvh_populate_p2m(struct domain *d)
             enum hvm_translation_result res =
                  hvm_copy_to_guest_phys(mfn_to_maddr(_mfn(addr)),
                                         mfn_to_virt(addr),
-                                        d->arch.e820[i].addr - end,
+                                        end - d->arch.e820[i].addr,
                                         v);
 
             if ( res != HVMTRANS_okay )