]> xenbits.xensource.com Git - xen.git/commit
x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Mon, 7 Oct 2024 15:52:39 +0000 (16:52 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 21 Oct 2024 17:28:59 +0000 (18:28 +0100)
commitedb48e76458bb93b89daa4bfb621f4419262d370
tree4a8d6bbcaba67ec92e5f72db44589a8b8a1c0534
parent7cf6e073e47f7c7edfe764ce904df283ec7ddad8
x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu

fpu_ctxt is either a pointer to the legacy x87/SSE save area (used by FXSAVE) or
a pointer aliased with xsave_area that points to its fpu_sse subfield. Such
subfield is at the base and is identical in size and layout to the legacy
buffer.

This patch merges the 2 pointers in the arch_vcpu into a single XSAVE area. In
the very rare case in which the host doesn't support XSAVE all we're doing is
wasting a tiny amount of memory and trading those for a lot more simplicity in
the code.

While at it, dedup the setup logic in vcpu_init_fpu() and integrate it
into xstate_alloc_save_area().

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/i387.c
xen/arch/x86/include/asm/domain.h
xen/arch/x86/x86_emulate/blk.c
xen/arch/x86/xstate.c