diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-25 08:27:44 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 15:47:43 +0200 |
commit | 530b37e43ce3f0bb9969308c0a64901b442f8e0a (patch) | |
tree | 0c6090a2620eff48bdbeed2d631ad2a29e6a018a /arch/x86/kernel/fpu/init.c | |
parent | 011545b570be22191047d07299515c1d711eeb38 (diff) |
x86/fpu: Do CLTS fpu__init_system()
mxcsr_feature_mask_init() depends on TS being cleared, as it executes
an FXSAVE instruction.
After later changes we will move the TS setup into fpu__init_cpu(),
which will interact with this - so clear the TS flag explicitly.
Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/fpu/init.c')
-rw-r--r-- | arch/x86/kernel/fpu/init.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 2752b4bae854..567e7e6cdc6b 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -214,6 +214,13 @@ void fpu__init_system(void) fpu__init_cpu(); /* + * But don't leave CR0::TS set yet, as some of the FPU setup methods depend + * on being able to execute FPU instructions that will fault on a set TS, + * such as the FXSAVE in mxcsr_feature_mask_init(). + */ + clts(); + + /* * Set up the legacy init FPU context. (xstate init might overwrite this * with a more modern format, if the CPU supports it.) */ |