Skip to content

x86/fpu/xsave: Add XSAVEC support and XGETBV1 utilization

Thomas Gleixner lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/fpu branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 11 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86/fpu/xsave: Support XSAVEC in the kernelarch/x86/include/asm/cpufeatures.h arch/x86/kernel/fpu/xstate.c arch/x86/kernel/fpu/xstate.h+48 -262 replies
2/3x86/fpu/xsave: Prepare for optimized compactionarch/x86/kernel/fpu/xstate.c arch/x86/kernel/fpu/xstate.h+84 -73 replies
3/3x86/fpu/xsave: Optimize XSAVEC/S when XGETBV1 is supportedarch/x86/kernel/fpu/xstate.c arch/x86/kernel/fpu/xstate.h+21 -56 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchAndrew Cooper
1/3Requested-by
2/3
3/3

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

Read the v1 thread

Cover letter [patch 0/3] x86/fpu/xsave: Add XSAVEC support and XGETBV1 utilization

This series adds:

1) XSAVEC support

Hypervisors expose XSAVEC but not XSAVES to guests, but the kernel does not support XSAVEC. Which means it cannot make use of the compacted storage format.

2) Utilize XGETBV1

XGETBV1 reads a bitmap which contains the current active XSTATE components. This bitmap can be used to optimize the behaviour of XSAVES and XSAVEC by requesting only the active components to be saved.

While the init optimization of XSAVEC and XSAVES skips writing the state of components which are inactive, the buffer layout is still providing the space for the inactive, but requested to save components. Which is suboptimal in terms of prefetch and dTLB when the active component bitmap is sparse.

Thanks,

tglx

---
 include/asm/cpufeatures.h |    2 
 kernel/fpu/xstate.c       |  145 +++++++++++++++++++++++++++++++++++++---------
 kernel/fpu/xstate.h       |   42 ++++++++++---
 3 files changed, 152 insertions(+), 37 deletions(-)