[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] x86/fpu: Map/umap xsave area in vcpu_{reset,setup}_fpu()
commit dd9f4e7b51793e09c0c1448bebec296324ed2909 Author: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx> AuthorDate: Wed Mar 5 16:35:37 2025 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Mar 5 16:35:37 2025 +0100 x86/fpu: Map/umap xsave area in vcpu_{reset,setup}_fpu() No functional change. Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> --- xen/arch/x86/i387.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c index 8fba0aef42..5429531ddd 100644 --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -304,24 +304,32 @@ int vcpu_init_fpu(struct vcpu *v) void vcpu_reset_fpu(struct vcpu *v) { + struct xsave_struct *xsave_area = VCPU_MAP_XSAVE_AREA(v); + v->fpu_initialised = false; - *v->arch.xsave_area = (struct xsave_struct) { + *xsave_area = (struct xsave_struct) { .xsave_hdr.xstate_bv = X86_XCR0_X87, }; /* Old gcc doesn't permit these to be part of the initializer. */ - v->arch.xsave_area->fpu_sse.mxcsr = MXCSR_DEFAULT; - v->arch.xsave_area->fpu_sse.fcw = FCW_RESET; - v->arch.xsave_area->fpu_sse.ftw = FXSAVE_FTW_RESET; + xsave_area->fpu_sse.mxcsr = MXCSR_DEFAULT; + xsave_area->fpu_sse.fcw = FCW_RESET; + xsave_area->fpu_sse.ftw = FXSAVE_FTW_RESET; + + VCPU_UNMAP_XSAVE_AREA(v, xsave_area); } void vcpu_setup_fpu(struct vcpu *v, const void *data) { + struct xsave_struct *xsave_area = VCPU_MAP_XSAVE_AREA(v); + v->fpu_initialised = true; - *v->arch.xsave_area = (struct xsave_struct) { + *xsave_area = (struct xsave_struct) { .fpu_sse = *(const fpusse_t*)data, .xsave_hdr.xstate_bv = XSTATE_FP_SSE, }; + + VCPU_UNMAP_XSAVE_AREA(v, xsave_area); } /* Free FPU's context save area */ -- generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |