x86/pvh: don't copy to/from trap_ctxt for 32b PVH guests
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Mon, 22 Jun 2015 15:52:13 +0000 (17:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 22 Jun 2015 15:52:13 +0000 (17:52 +0200)
.. as this field is not used by PVH guests

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/domctl.c

index e396c6cffc451697ef9873a3a609dc321ef70906..c7ef1e6aaa11b94ef3b53051eb4ca516bd74e417 100644 (file)
@@ -805,9 +805,12 @@ int arch_set_info_guest(
     else
     {
         XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs);
-        for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
-            XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
-                           c.cmp->trap_ctxt + i);
+        if ( is_pv_domain(d) )
+        {
+            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
+                XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
+                               c.cmp->trap_ctxt + i);
+        }
     }
 
     if ( has_hvm_container_domain(d) )
index d8ffe2b80e60e75010aef4696bf32993dfc28b8a..82bd8186b4308db69c2efcbec1499151acbf12db 100644 (file)
@@ -1204,9 +1204,12 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     else
     {
         XLAT_cpu_user_regs(&c.cmp->user_regs, &v->arch.user_regs);
-        for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
-            XLAT_trap_info(c.cmp->trap_ctxt + i,
-                           v->arch.pv_vcpu.trap_ctxt + i);
+        if ( is_pv_domain(d) )
+        {
+            for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i )
+                XLAT_trap_info(c.cmp->trap_ctxt + i,
+                               v->arch.pv_vcpu.trap_ctxt + i);
+        }
     }
 
     for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )