linux/arch/x86/kernel/fpu
Petteri Aimonen 7ad816762f x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
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
2020-06-29 10:02:00 +02:00
..
bugs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c x86/fpu: Reset MXCSR to default in kernel_fpu_begin() 2020-06-29 10:02:00 +02:00
init.c x86/fpu/xstate: Define new macros for supervisor and user xstates 2020-05-12 20:34:38 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
regset.c x86/fpu/xstate: Rename validate_xstate_header() to validate_user_xstate_header() 2020-05-12 20:20:32 +02:00
signal.c x86/fpu/xstate: Restore supervisor states for signal return 2020-05-16 12:20:50 +02:00
xstate.c Most of the changes here related to 'XSAVES supervisor state' support, 2020-06-01 14:09:26 -07:00