x86/hvm: Map/unmap xsave area in hvmemul_{get,put}_fpu()

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Alejandro Vallejo authored and Jan Beulich committed 2025-03-05 16:36:25 +01:00
1 parent e628968f4f
commit c4a1b992e5
1 file changed
+10 -2
+10 -2
View File
@@ -2467,7 +2467,9 @@ static int cf_check hvmemul_get_fpu(
alternative_vcall(hvm_funcs.fpu_dirty_intercept);
else if ( type == X86EMUL_FPU_fpu )
{
const fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
/* Has a fastpath for `current`, so there's no actual map */
const struct xsave_struct *xsave_area = VCPU_MAP_XSAVE_AREA(curr);
const fpusse_t *fpu_ctxt = &xsave_area->fpu_sse;
/*
* Latch current register state so that we can back out changes
@@ -2493,6 +2495,8 @@ static int cf_check hvmemul_get_fpu(
else
ASSERT(fcw == fpu_ctxt->fcw);
}
VCPU_UNMAP_XSAVE_AREA(curr, xsave_area);
}
return X86EMUL_OKAY;
@@ -2507,7 +2511,9 @@ static void cf_check hvmemul_put_fpu(
if ( aux )
{
fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
/* Has a fastpath for `current`, so there's no actual map */
struct xsave_struct *xsave_area = VCPU_MAP_XSAVE_AREA(curr);
fpusse_t *fpu_ctxt = &xsave_area->fpu_sse;
bool dval = aux->dval;
int mode = hvm_guest_x86_mode(curr);
@@ -2563,6 +2569,8 @@ static void cf_check hvmemul_put_fpu(
fpu_ctxt->fop = aux->op;
VCPU_UNMAP_XSAVE_AREA(curr, xsave_area);
/* Re-use backout code below. */
backout = X86EMUL_FPU_fpu;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.