Skip to content

Fix small issues in XSAVES

Yu-cheng Yu lkml 2 versions – 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 · linked by author and title

  1. v2 Latest3 patches 11 repliesApplied
  2. v13 patches 0 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3x86/fpu/xstate: Fix small issues before adding supervisor xstatesarch/x86/kernel/fpu/xstate.c+5 -71 reply
2/3x86/fpu/xstate: Make xfeature_is_supervisor()/xfeature_is_user() return boolarch/x86/kernel/fpu/xstate.c+3 -32 replies
3/3x86/fpu/xstate: Invalidate fpregs when __fpu_restore_sig() failsarch/x86/include/asm/fpu/internal.h arch/x86/kernel/fpu/core.c+28 -214 replies

Reviews trailers per patch

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

PatchDave HansenTony LuckYu-cheng YuSebastian Andrzej Siewior
1/3R-b R-b A-b
2/3A-b
3/3A-b Debugged-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/3] Fix small issues in XSAVES

Rebase v1 to Linux v5.5-rc1. This supersedes the previous version, but does not have any functional changes.

The first two patches in this series are split from my supervisor xstate patches [2]. The third is to fix a vital issue in __fpu_restore_sig(), and more RFC than the others. All three are not directly related to supervisor xstates or CET, split them out and submit first. I will re-submit supervisor xstate patches shortly.

When__fpu_restore_sig() fails, partially cleared FPU registers still belong to the previous owner task. That causes that task to use corrupted xregs. Fix it by doing __cpu_invalidate_fpregs_state() in functions that copy into fpregs. Further details are in the commit log of patch #3.

[1] v1 of this series:

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

[2] Support XSAVES supervisor states

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

[3] CET patches:

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

Yu-cheng Yu (3):
x86/fpu/xstate: Fix small issues before adding supervisor xstates x86/fpu/xstate: Make xfeature_is_supervisor()/xfeature_is_user()
return bool
x86/fpu/xstate: Invalidate fpregs when __fpu_restore_sig() fails

 arch/x86/include/asm/fpu/internal.h | 14 ++++++++++++++
 arch/x86/kernel/fpu/core.c          | 16 ++++++++++++++--
 arch/x86/kernel/fpu/xstate.c        | 18 ++++++++----------
 3 files changed, 36 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1