]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/hvm: Map/unmap xsave area in hvm_save_cpu_ctxt()
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Wed, 5 Mar 2025 15:35:04 +0000 (16:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 5 Mar 2025 15:35:04 +0000 (16:35 +0100)
No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 4851e2e150295f95c4b6c6fe4c6ba4a7ce2a6c34..969e43c2f216f8a9da74a2385007019148303bd7 100644 (file)
@@ -913,11 +913,11 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
 
     if ( v->fpu_initialised )
     {
-        BUILD_BUG_ON(sizeof(ctxt.fpu_regs) !=
-                     sizeof(v->arch.xsave_area->fpu_sse));
-        memcpy(ctxt.fpu_regs, &v->arch.xsave_area->fpu_sse,
-               sizeof(ctxt.fpu_regs));
+        const struct xsave_struct *xsave_area = VCPU_MAP_XSAVE_AREA(v);
 
+        BUILD_BUG_ON(sizeof(ctxt.fpu_regs) != sizeof(xsave_area->fpu_sse));
+        memcpy(ctxt.fpu_regs, &xsave_area->fpu_sse, sizeof(ctxt.fpu_regs));
+        VCPU_UNMAP_XSAVE_AREA(v, xsave_area);
         ctxt.flags = XEN_X86_FPU_INITIALISED;
     }