1
0
Fork 0
alistair23-linux/arch/x86/include/asm/fpu
Petteri Aimonen c4db485dd3 x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
[ Upstream commit 7ad816762f ]

Previously, kernel floating point code would run with the MXCSR control
register value last set by userland code by the thread that was active
on the CPU core just before kernel call. This could affect calculation
results if rounding mode was changed, or a crash if a FPU/SIMD exception
was unmasked.

Restore MXCSR to the kernel's default value.

 [ bp: Carve out from a bigger patch by Petteri, add feature check, add
   FNINIT call too (amluto). ]

Signed-off-by: Petteri Aimonen <jpa@git.mail.kapsi.fi>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=207979
Link: https://lkml.kernel.org/r/20200624114646.28953-2-bp@alien8.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-22 09:32:51 +02:00
..
api.h x86/fpu: Defer FPU state load until return to userspace 2019-04-12 19:34:47 +02:00
internal.h x86/fpu: Reset MXCSR to default in kernel_fpu_begin() 2020-07-22 09:32:51 +02:00
regset.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
signal.h x86/fpu: Remove fpu->initialized usage in __fpu__restore_sig() 2019-04-09 19:27:29 +02:00
types.h x86/fpu: Remove fpu->initialized 2019-04-10 15:42:40 +02:00
xstate.h x86/fpu: Inline fpu__xstate_clear_all_cpu_caps() 2019-07-07 12:01:47 +02:00