summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/fpu/core.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-15 01:09:34 +0200
committerBorislav Petkov <bp@suse.de>2021-10-21 19:38:55 +0200
commit2bd264bce238cedbf00bde1f28ad51ba45b9114e (patch)
treea987bdb7fdca3a674b55bfbbf06c304d88077cb7 /arch/x86/kernel/fpu/core.c
parentcd9ae761744912a96d7fd968b9c0173594e3f6be (diff)
downloadlinux-2bd264bce238cedbf00bde1f28ad51ba45b9114e.tar.bz2
x86/fpu: Move xstate size to fpu_*_cfg
Use the new kernel and user space config storage to store and retrieve the XSTATE buffer sizes. The default and the maximum size are the same for now, but will change when support for dynamically enabled features is added. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211014230739.296830097@linutronix.de
Diffstat (limited to 'arch/x86/kernel/fpu/core.c')
-rw-r--r--arch/x86/kernel/fpu/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 3512bb241d95..69abf3a2299d 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -298,7 +298,7 @@ void fpu_sync_fpstate(struct fpu *fpu)
static inline unsigned int init_fpstate_copy_size(void)
{
if (!use_xsave())
- return fpu_kernel_xstate_size;
+ return fpu_kernel_cfg.default_size;
/* XSAVE(S) just needs the legacy and the xstate header part */
return sizeof(init_fpstate.regs.xsave);
@@ -347,8 +347,8 @@ void fpstate_reset(struct fpu *fpu)
fpu->fpstate = &fpu->__fpstate;
/* Initialize sizes and feature masks */
- fpu->fpstate->size = fpu_kernel_xstate_size;
- fpu->fpstate->user_size = fpu_user_xstate_size;
+ fpu->fpstate->size = fpu_kernel_cfg.default_size;
+ fpu->fpstate->user_size = fpu_user_cfg.default_size;
fpu->fpstate->xfeatures = xfeatures_mask_all;
fpu->fpstate->user_xfeatures = xfeatures_mask_uabi();
}
@@ -420,7 +420,7 @@ int fpu_clone(struct task_struct *dst)
void fpu_thread_struct_whitelist(unsigned long *offset, unsigned long *size)
{
*offset = offsetof(struct thread_struct, fpu.__fpstate.regs);
- *size = fpu_kernel_xstate_size;
+ *size = fpu_kernel_cfg.default_size;
}
/*