linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix two issues in XSAVES offset calculation
@ 2020-01-09 21:14 Yu-cheng Yu
  2020-01-09 21:14 ` [PATCH 1/3] x86/fpu/xstate: Fix last_good_offset in setup_xstate_features() Yu-cheng Yu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yu-cheng Yu @ 2020-01-09 21:14 UTC (permalink / raw)
  To: linux-kernel, x86, H. Peter Anvin, Thomas Gleixner, Ingo Molnar,
	Dave Hansen, Tony Luck, Andy Lutomirski, Borislav Petkov,
	Rik van Riel, Ravi V. Shankar, Sebastian Andrzej Siewior,
	Fenghua Yu, Peter Zijlstra
  Cc: Yu-cheng Yu

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/20190813205225.12032-1-yu-cheng.yu@intel.com/
    https://lkml.kernel.org/r/20190813205359.12196-1-yu-cheng.yu@intel.com/

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(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-12 14:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 21:14 [PATCH 0/3] Fix two issues in XSAVES offset calculation Yu-cheng Yu
2020-01-09 21:14 ` [PATCH 1/3] x86/fpu/xstate: Fix last_good_offset in setup_xstate_features() Yu-cheng Yu
2020-02-11 18:56   ` Borislav Petkov
2020-02-12 14:50   ` [tip: x86/fpu] " tip-bot2 for Yu-cheng Yu
2020-01-09 21:14 ` [PATCH 2/3] x86/fpu/xstate: Fix XSAVES offsets in setup_xstate_comp() Yu-cheng Yu
2020-02-12 14:50   ` [tip: x86/fpu] " tip-bot2 for Yu-cheng Yu
2020-01-09 21:14 ` [PATCH 3/3] x86/fpu/xstate: WARN_ONCE on checking alignment of disabled xfeatures Yu-cheng Yu
2020-02-12 14:50   ` [tip: x86/fpu] x86/fpu/xstate: Warn when " tip-bot2 for Yu-cheng Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).