1
0
Fork 0
alistair23-linux/arch/x86
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
..
boot x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld 2020-06-24 17:50:49 +02:00
configs x86/defconfigs: Remove useless UEVENT_HELPER_PATH 2019-06-21 19:22:08 +02:00
crypto crypto: arch/nhpoly1305 - process in explicit 4k chunks 2020-05-14 07:58:25 +02:00
entry x86/unwind/orc: Fix premature unwind stoppage due to IRET frames 2020-05-14 07:58:29 +02:00
events perf/x86/rapl: Fix RAPL config variable bug 2020-07-16 08:16:32 +02:00
hyperv x86/Hyper-V: Report crash data in die() when panic_on_oops is set 2020-04-23 10:36:24 +02:00
ia32 syscalls/x86: Use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn 2020-01-17 19:48:30 +01:00
include x86/fpu: Reset MXCSR to default in kernel_fpu_begin() 2020-07-22 09:32:51 +02:00
kernel x86/fpu: Reset MXCSR to default in kernel_fpu_begin() 2020-07-22 09:32:51 +02:00
kvm KVM: x86: Mark CR4.TSD as being possibly owned by the guest 2020-07-16 08:16:44 +02:00
lib x86/asm/64: Align start of __clear_user() loop to 16-bytes 2020-06-30 15:37:08 -04:00
math-emu x86/math-emu: Check __copy_from_user() result 2019-12-31 16:43:32 +01:00
mm x86/mm: Stop printing BRK addresses 2020-06-22 09:31:08 +02:00
net bpf, x86: Fix encoding for lower 8-bit registers in BPF_STX BPF_B 2020-05-02 08:48:55 +02:00
oprofile
pci x86/PCI: Mark Intel C620 MROMs as having non-compliant BARs 2020-06-17 16:40:24 +02:00
platform efi/x86: Fix the deletion of variables in mixed mode 2020-04-17 10:50:25 +02:00
power Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:04:39 -07:00
purgatory x86/purgatory: Disable various profiling and sanitizing options 2020-06-24 17:50:20 +02:00
ras RAS/CEC: Add CONFIG_RAS_CEC_DEBUG and move CEC debug features there 2019-06-08 17:39:24 +02:00
realmode x86/realmode: Remove trampoline_status 2019-07-22 11:30:18 +02:00
tools x86/insn: Fix awk regexp warnings 2019-11-29 10:09:45 +01:00
um um: Implement copy_thread_tls 2020-01-14 20:08:35 +01:00
video treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
xen x86: Fix early boot crash on gcc-10, third try 2020-05-20 08:20:34 +02:00
.gitignore
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kconfig x86/tsx: Add config options to set tsx=on|off|auto 2019-10-28 09:12:18 +01:00
Kconfig.cpu x86/cpu: Create Zhaoxin processors architecture support file 2019-06-22 11:45:57 +02:00
Kconfig.debug x86, perf: Fix the dependency of the x86 insn decoder selftest 2019-09-02 20:05:58 +02:00
Makefile x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning 2019-08-28 17:31:31 +02:00
Makefile.um x86, powerpc: Remove -funit-at-a-time compiler option entirely 2018-12-09 11:55:32 +01:00
Makefile_32.cpu