summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/fpu/xstate.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-13 16:55:46 +0200
committerBorislav Petkov <bp@suse.de>2021-10-21 13:51:42 +0200
commit248452ce21aeb08da2d2af23d88f890886bd379f (patch)
treecfc901275ac0e1f6e4741d3cf5c5fc129acf14e5 /arch/x86/kernel/fpu/xstate.c
parent2dd8eedc80b184bb16aad697ae60367c5bf07299 (diff)
downloadlinux-248452ce21aeb08da2d2af23d88f890886bd379f.tar.bz2
x86/fpu: Add size and mask information to fpstate
Add state size and feature mask information to the fpstate container. This will be used for runtime checks with the upcoming support for dynamically enabled features and dynamically sized buffers. That avoids conditionals all over the place as the required information is accessible for both default and extended buffers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211013145322.921388806@linutronix.de
Diffstat (limited to 'arch/x86/kernel/fpu/xstate.c')
-rw-r--r--arch/x86/kernel/fpu/xstate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index ca72a3e9080c..4beb010d19fc 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -720,6 +720,7 @@ static void __init fpu__init_disable_system_xstate(void)
xfeatures_mask_all = 0;
cr4_clear_bits(X86_CR4_OSXSAVE);
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
+ fpstate_reset(&current->thread.fpu);
}
/*
@@ -792,6 +793,8 @@ void __init fpu__init_system_xstate(void)
if (err)
goto out_disable;
+ fpstate_reset(&current->thread.fpu);
+
/*
* Update info used for ptrace frames; use standard-format size and no
* supervisor xstates: