Skip to content

x86/xstate: Fixes to size calculations

Andrew Cooper xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5x86/xstate: Elide redundant writes in set_xcr0()xen/arch/x86/domain.c xen/arch/x86/xstate.c+12 -71 reply
2/5x86/xstate: Rename _xstate_ctxt_size() to hw_uncompressed_size()xen/arch/x86/xstate.c+7 -81 reply
3/5x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size()xen/arch/x86/domctl.c xen/arch/x86/hvm/hvm.c xen/arch/x86/xstate.c +1 more+34 -126 replies
4/5x86/cpuid: Simplify recalculate_xstate()xen/arch/x86/cpuid.c+17 -355 replies
5/5x86/cpuid: Fix handling of xsave dynamic leavesxen/arch/x86/cpuid.c xen/arch/x86/xstate.c xen/include/asm-x86/xstate.h+57 -165 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchJan Beulich
1/5R-b
2/5R-b
3/5
4/5
5/5R-b

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/5] x86/xstate: Fixes to size calculations

Various fixes and improvements to xsave image size calculations.

* Skip redundant xcr0 writes
* Don't reconfigure xcr0 to query hardware when we can trivially calculate the answer ourselves.
* Fix latent bug with CPUID.0xD[0].ebx.
* Rework CPUID.0xD[1].ebx to behave correctly when supervisor states are in use.

Results from AMD Milan with some prototype CET handling, as well as the debug cross checks, in place:
(d1) xstates 0x0001, uncomp 0x240, comp 0x240
(d1) xstates 0x0003, uncomp 0x240, comp 0x240
(d1) xstates 0x0007, uncomp 0x340, comp 0x340
(d1) xstates 0x0207, uncomp 0x988, comp 0x348
(d1) xstates 0x0a07, uncomp 0x988, comp 0x358
(d1) xstates 0x1a07, uncomp 0x988, comp 0x370

Andrew Cooper (5):
x86/xstate: Elide redundant writes in set_xcr0() x86/xstate: Rename _xstate_ctxt_size() to hw_uncompressed_size() x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size() x86/cpuid: Simplify recalculate_xstate()
x86/cpuid: Fix handling of xsave dynamic leaves

 xen/arch/x86/cpuid.c         |  75 +++++++++------------------
 xen/arch/x86/domain.c        |   4 +-
 xen/arch/x86/domctl.c        |   2 +-
 xen/arch/x86/hvm/hvm.c       |   2 +-
 xen/arch/x86/xstate.c        | 117 +++++++++++++++++++++++++++++++++++--------
 xen/include/asm-x86/xstate.h |   3 +-
 6 files changed, 126 insertions(+), 77 deletions(-)
Signature · 1 line
2.11.0