Skip to content

x86, fpu: XSAVE cleanups and sanity checks

Dave Hansen lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 2 repliesIn review
  2. v315 patches 1 replySuperseded
  3. v211 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v111 patches4 repliesSuperseded

Changes in v4 from the cover letter

* Fix up a few compile errors/warnings

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15x86, fpu: print xfeature buffer size in decimalarch/x86/kernel/fpu/xstate.c+2 -20 replies
2/15x86, fpu: move XSAVE-disabling code to a helperarch/x86/include/asm/fpu/xstate.h arch/x86/kernel/fpu/init.c arch/x86/kernel/fpu/xstate.c+21 -110 replies
3/15x86, fpu: remove XSTATE_RESERVEarch/x86/include/asm/fpu/types.h arch/x86/kernel/fpu/xstate.c+59 -160 replies
4/15x86, fpu: kill LWP supportarch/x86/include/asm/fpu/types.h+0 -50 replies
5/15x86, fpu: XSAVE macro renamesarch/x86/crypto/camellia_aesni_avx2_glue.c arch/x86/crypto/camellia_aesni_avx_glue.c arch/x86/crypto/cast5_avx_glue.c +18 more+101 -801 reply
6/15x86, fpu: rename XFEATURES_NR_MAXarch/x86/include/asm/fpu/types.h arch/x86/kernel/fpu/xstate.c+3 -30 replies
7/15x86, fpu: rework XSTATE_* macros to remove magic '2'arch/x86/include/asm/fpu/types.h arch/x86/kernel/fpu/xstate.c+9 -60 replies
8/15x86, fpu: remove xfeature_nrarch/x86/kernel/fpu/xstate.c+8 -160 replies
9/15x86, fpu: add helper xfeature_enabled() instead of test_bit()arch/x86/kernel/fpu/xstate.c+13 -30 replies
10/15x86, fpu: rework MPX 'xstate' typesarch/x86/include/asm/fpu/types.h arch/x86/include/asm/trace/mpx.h arch/x86/kernel/traps.c +1 more+33 -140 replies
11/15x86, fpu: rework YMM definitionarch/x86/include/asm/fpu/types.h+11 -50 replies
12/15x86, fpu: add C structures for AVX-512 state componentsarch/x86/include/asm/fpu/types.h+33 -00 replies
13/15x86, fpu: correct and check XSAVE xstate size calculationsarch/x86/kernel/fpu/xstate.c+174 -100 replies
14/15x86, fpu: check to ensure increasing-offset xstate offsetsarch/x86/kernel/fpu/xstate.c+24 -110 replies
15/15x86, fpu: check CPU-provided sizes against struct declarationsarch/x86/kernel/fpu/xstate.c+45 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH 00/15] [v4] x86, fpu: XSAVE cleanups and sanity checks

Changes in v4:
* Fix up a few compile errors/warnings

Changes in v3:
* rework XSTATE_* macros using Ingo's suggested naming
* change state size printk to be in decimal
* add some more sanity-checking to detect and work around an undersized 'xregs_state'
* remove "nr_" from some of the names used.

Changes in v2:
* remove references to Processor Trace XSAVE state (will defer to another patch set)
* Remove some cruft from last patch
* move last_good_offset fix in to the patch that introduced it

These patches make some updates to the x86 XSAVE code.

They have been build and boot tested including on hardware and/or simulators with AVX-512 and MPX. It boots in all of the tested configurations without hitting any of the new warnings in this code. I even added the Memory Protecion Keys (the xfeature after MPX) patches on top of this and everything works fine.

There are basically 5 things going on here:
* removal of the LWP (lightweight profiling) code
* naming and type cleanups
* removal of xfeatures_nr variable
* addition of AVX-512 C structures
* new sanity checks of XSAVE buffer sizing

Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc Tim Chen <[email protected]>