x86/dom0: fix copy of low 1MB data for PVH
diff mbox series

Message ID 20200331163302.60617-1-roger.pau@citrix.com
State New
Headers show
Series
  • x86/dom0: fix copy of low 1MB data for PVH
Related show

Commit Message

Roger Pau Monné March 31, 2020, 4:33 p.m. UTC
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>
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich April 1, 2020, 8:06 a.m. UTC | #1
On 31.03.2020 18:33, Roger Pau Monne wrote:
> 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>

Patch
diff mbox series

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2afd44c8a4..12a82c9d7c 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -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 )