android_kernel_oneplus_msm8998/arch/x86
Andy Lutomirski a2dd28441a x86/fpu: Fix FNSAVE usage in eagerfpu mode
commit 5ed73f40735c68d8a656b46d09b1885d3b8740ae upstream.

In eager fpu mode, having deactivated FPU without immediately
reloading some other context is illegal.  Therefore, to recover from
FNSAVE, we can't just deactivate the state -- we need to reload it
if we're not actively context switching.

We had this wrong in fpu__save() and fpu__copy().  Fix both.
__kernel_fpu_begin() was fine -- add a comment.

This fixes a warning triggerable with nofxsr eagerfpu=on.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: yu-cheng yu <yu-cheng.yu@intel.com>
Link: http://lkml.kernel.org/r/60662444e13c76f06e23c15c5dcdba31b4ac3d67.1453675014.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-16 09:54:25 +02:00
..
boot efi: Avoid potential crashes, fix the 'struct efi_pci_io_protocol_32' definition for mixed mode 2018-05-26 08:48:56 +02:00
configs kconfig: tinyconfig: provide whole choice blocks to avoid warnings 2016-09-24 10:07:42 +02:00
crypto x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2018-06-16 09:54:24 +02:00
entry x86/entry/64: Don't use IST entry for #BP stack 2018-03-28 18:40:16 +02:00
ia32 Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-03 21:05:40 -08:00
include x86/fpu: Hard-disable lazy FPU mode 2018-06-16 09:54:25 +02:00
kernel x86/fpu: Fix FNSAVE usage in eagerfpu mode 2018-06-16 09:54:25 +02:00
kvm KVM: lapic: stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use 2018-05-30 07:49:11 +02:00
lguest x86/paravirt: Prevent rtc_cmos platform device init on PV guests 2015-12-19 21:35:13 +01:00
lib x86/hweight: Don't clobber %rdi 2018-04-24 09:32:04 +02:00
math-emu x86/fpu/math-emu: Fix possible uninitialized variable use 2018-02-25 11:03:43 +01:00
mm x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros 2018-06-16 09:54:24 +02:00
net bpf, x64: increase number of passes 2018-03-28 18:40:17 +02:00
oprofile x86/oprofile: Fix bogus GCC-8 warning in nmi_setup() 2018-02-28 10:17:22 +01:00
pci x86/PCI: Make broadcom_postcore_init() check acpi_disabled 2017-12-16 10:33:48 +01:00
platform x86/platform/olpc: Fix resume handler build warning 2018-02-25 11:03:47 +01:00
power x86/power: Fix swsusp_arch_resume prototype 2018-05-30 07:48:55 +02:00
purgatory x86/kexec: add -fno-PIE 2016-11-26 09:54:52 +01:00
ras x86/ras/mce_amd_inj: Inject bank 4 errors on the NBC 2015-10-12 16:15:48 +02:00
realmode x86/pti/efi: broken conversion from efi to kernel page table 2018-01-17 09:35:29 +01:00
tools x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-18 11:17:52 +01:00
um um: Use POSIX ucontext_t instead of struct ucontext 2018-04-24 09:32:08 +02:00
video
xen tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all} 2018-05-26 08:48:54 +02:00
.gitignore x86/build: Add arch/x86/purgatory/ make generated files to gitignore 2014-10-09 09:29:46 +02:00
Kbuild x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ 2015-06-03 18:51:37 +02:00
Kconfig x86/hweight: Get rid of the special calling convention 2018-04-24 09:32:04 +02:00
Kconfig.cpu x86/Kconfig/cpus: Fix/complete CPU type help texts 2015-10-21 11:12:56 +02:00
Kconfig.debug x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG 2018-02-25 11:03:43 +01:00
Makefile x86/build/64: Force the linker to use 2MB page size 2018-03-28 18:40:16 +02:00
Makefile.um kbuild: use relative path more to include Makefile 2015-04-02 16:42:08 +02:00
Makefile_32.cpu