On 28.10.2024 16:49, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/xstate.c
> +++ b/xen/arch/x86/xstate.c
> @@ -993,7 +993,12 @@ int handle_xsetbv(u32 index, u64 new_bv)
>
> clts();
> if ( curr->fpu_dirtied )
> - asm ( "stmxcsr %0" : "=m" (curr->arch.xsave_area->fpu_sse.mxcsr)
> );
> + {
> + struct xsave_struct *xsave_area = vcpu_map_xsave_area(curr);
> +
> + asm ( "stmxcsr %0" : "=m" (xsave_area->fpu_sse.mxcsr) );
> + vcpu_unmap_xsave_area(curr, xsave_area);
> + }
Since it's curr that we're dealing with, is this largely a cosmetic change? I.e.
there's no going to be any actual map/unmap operation in that case? Otherwise
I'd be inclined to say that an actual map/unmap is pretty high overhead for a
mere store of a 32-bit value.
Jan