Skip to content

Fix two issues in XSAVES offset calculation

Yu-cheng Yu 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 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3x86/fpu/xstate: Fix last_good_offset in setup_xstate_features()arch/x86/kernel/fpu/xstate.c+14 -101 reply
2/3x86/fpu/xstate: Fix XSAVES offsets in setup_xstate_comp()arch/x86/kernel/fpu/xstate.c+11 -190 replies
3/3x86/fpu/xstate: WARN_ONCE on checking alignment of disabled xfeaturesarch/x86/kernel/fpu/xstate.c+7 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDave Hansen
1/3R-b R-b
2/3R-b
3/3R-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/3] Fix two issues in XSAVES offset calculation

This series fixes two issues in XSAVES offset calculation:

- In setup_xstate_features(), supervisor xstate offsets are left as -1's, but still being tracked as last_good_offset;
- In setup_xstate_comp(), alignments are being added to disabled xstate offsets.

These issues have not been visible because supervisor xstates have not been enabled and there is no xfeature requiring alignment. They are triggered only when adding an aligned non-supervisor xstate after CET [1] supervisor states.

To detect future potential issues, also add a patch to issue warnings when checking alignments of disabled xfeatures.

Details are in each patch's commit log.

[1] CET patches:

    https://lkml.kernel.org/r/[email protected]/
    https://lkml.kernel.org/r/[email protected]/

Yu-cheng Yu (3):
x86/fpu/xstate: Fix last_good_offset in setup_xstate_features() x86/fpu/xstate: Fix XSAVES offsets in setup_xstate_comp() x86/fpu/xstate: WARN_ONCE on checking alignment of disabled xfeatures

 arch/x86/kernel/fpu/xstate.c | 61 +++++++++++++++++++-----------------
 1 file changed, 32 insertions(+), 29 deletions(-)
Signature · 1 line
2.21.0