summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/fpu/xstate.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-13 17:55:49 +0300
committerBorislav Petkov <bp@suse.de>2021-10-21 15:03:36 +0300
commit073e627a4537e682c43a1e8df659ce24cbced40c (patch)
tree42bd41d970df4ba299229671be9267e064af7d0b /arch/x86/kernel/fpu/xstate.h
parentbe31dfdfd75b172af3ddcfa7511cdc3bb7adb25e (diff)
downloadlinux-073e627a4537e682c43a1e8df659ce24cbced40c.tar.xz
x86/fpu/xstate: Use fpstate for os_xsave()
With variable feature sets XSAVE[S] requires to know the feature set for which the buffer is valid. Retrieve it from fpstate. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211013145323.025695590@linutronix.de
Diffstat (limited to 'arch/x86/kernel/fpu/xstate.h')
-rw-r--r--arch/x86/kernel/fpu/xstate.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/fpu/xstate.h b/arch/x86/kernel/fpu/xstate.h
index 99f8cfec719d..24a1479caea2 100644
--- a/arch/x86/kernel/fpu/xstate.h
+++ b/arch/x86/kernel/fpu/xstate.h
@@ -101,16 +101,16 @@ extern void *get_xsave_addr(struct xregs_state *xsave, int xfeature_nr);
* Uses either XSAVE or XSAVEOPT or XSAVES depending on the CPU features
* and command line options. The choice is permanent until the next reboot.
*/
-static inline void os_xsave(struct xregs_state *xstate)
+static inline void os_xsave(struct fpstate *fpstate)
{
- u64 mask = xfeatures_mask_all;
+ u64 mask = fpstate->xfeatures;
u32 lmask = mask;
u32 hmask = mask >> 32;
int err;
WARN_ON_FPU(!alternatives_patched);
- XSTATE_XSAVE(xstate, lmask, hmask, err);
+ XSTATE_XSAVE(&fpstate->regs.xsave, lmask, hmask, err);
/* We should never fault when copying to a kernel buffer: */
WARN_ON_FPU(err);