Skip to content

x86: FPU handling cleanup

Alejandro Vallejo xen-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 4 repliesIn review
  2. v32 patches 9 repliesSuperseded
  3. v22 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches10 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpuxen/arch/x86/domctl.c xen/arch/x86/hvm/emulate.c xen/arch/x86/hvm/hvm.c +4 more+28 -532 replies
2/2x86/fpu: Rework fpu_setup_fpu() uses to split it in twoxen/arch/x86/domain.c xen/arch/x86/hvm/hvm.c xen/arch/x86/i387.c +2 more+45 -472 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJan Beulich
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] x86: FPU handling cleanup

v3: https://lore.kernel.org/xen-devel/[email protected]/
v3 -> v4: Removal vcpu_default_fpu() + style changes

v2: https://lore.kernel.org/xen-devel/[email protected]/
v2 -> v3: Cosmetic changes and wiped big comment about missing data in the
migration stream. Details in each patch.

v1: https://lore.kernel.org/xen-devel/[email protected]/
v1 -> v2: v1/patch1 and v1/patch2 are already in staging.

=============================== Original cover letter ========================= I want to eventually reach a position in which the FPU state can be allocated from the domheap and hidden via the same core mechanism proposed in Elias' directmap removal series. Doing so is complicated by the presence of 2 aliased pointers (v->arch.fpu_ctxt and v->arch.xsave_area) and the rather complicated semantics of vcpu_setup_fpu(). This series tries to simplify the code so moving to a "map/modify/unmap" model is more tractable.

Patches 1 and 2 are trivial refactors.

Patch 3 unifies FPU state so an XSAVE area is allocated per vCPU regardless of the host supporting it or not. The rationale is that the memory savings are negligible and not worth the extra complexity.

Patch 4 is a non-trivial split of the vcpu_setup_fpu() into 2 separate functions. One to override x87/SSE state, and another to set a reset state.
===============================================================================

Alejandro Vallejo (3):
x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu x86/fpu: Rework fpu_setup_fpu() uses to split it in two x86/fpu: Remove remaining uses of FCW_DEFAULT

 xen/arch/x86/domain.c             |  7 ++-
 xen/arch/x86/domctl.c             |  6 +-
 xen/arch/x86/hvm/emulate.c        |  4 +-
 xen/arch/x86/hvm/hvm.c            | 18 +++---
 xen/arch/x86/i387.c               | 94 ++++++++-----------------------
 xen/arch/x86/include/asm/domain.h |  6 --
 xen/arch/x86/include/asm/i387.h   | 21 +++++--
 xen/arch/x86/include/asm/xstate.h |  2 +-
 xen/arch/x86/x86_emulate/blk.c    |  2 +-
 xen/arch/x86/xstate.c             | 14 +++--
 xen/common/efi/runtime.c          |  2 +-
 11 files changed, 74 insertions(+), 102 deletions(-)
Signature · 1 line
2.46.0