x86, fpu: Avoid FPU lazy restore after suspend
Vincent Palatin authored
commit 644c1541

 upstream.

When a cpu enters S3 state, the FPU state is lost.
After resuming for S3, if we try to lazy restore the FPU for a process running
on the same CPU, this will result in a corrupted FPU context.

Ensure that "fpu_owner_task" is properly invalided when (re-)initializing a CPU,
so nobody will try to lazy restore a state which doesn't exist in the hardware.

Tested with a 64-bit kernel on a 4-core Ivybridge CPU with eagerfpu=off,
by doing thousands of suspend/resume cycles with 4 processes doing FPU
operations running. Without the patch, a process is killed after a
few hundreds cycles by a SIGFPE.
Signed-off-by: default avatarVincent Palatin <vpalatin@chromium.org>
Cc: Duncan Laurie <dlaurie@chromium.org>
Cc: Olof Johansson <olofj@chromium.org>
Link: http://lkml.kernel.org/r/1354306532-1014-1-git-send-email-vpalatin@chromium.org

Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
1b9dd61a
Name Last commit Last update
..
alpha alpha: Add missing RCU idle APIs on idle loop
arm ARM: Kirkwood: Update PCI-E fixup
avr32 avr32: fix nop compile fails from system.h split up
blackfin blackfin: fix ifdef fustercluck in mach-bf538/boards/ezkit.c
c6x irq: Kill pointless irqd_to_hw export
cris cris: Add missing RCU idle APIs on idle loop
frv frv: Add missing RCU idle APIs on idle loop
h8300 h8300: Add missing RCU idle APIs on idle loop
hexagon hexagon: add missing cpu.h include
ia64 ia64: Add missing RCU idle APIs on idle loop
m32r m32r: Add missing RCU idle APIs on idle loop
m68k m68k: fix sigset_t accessor functions
microblaze microblaze: Do not select GENERIC_GPIO by default
mips mips,kgdb: fix recursive page fault with CONFIG_KPROBES
mn10300 mn10300: Add missing RCU idle APIs on idle loop
openrisc Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system
parisc PARISC: fix user-triggerable panic on parisc
powerpc powerpc/eeh: Lock module while handling EEH event
s390 s390/signal: set correct address space control
score score: Add missing RCU idle APIs on idle loop
sh sh: Fix up tracepoint build fallout from static key introduction.
sparc sparc64: not any error from do_sigaltstack() should fail rt_sigreturn()
tile arch/tile: avoid generating .eh_frame information in modules
um um: Implement a custom pte_same() function
unicore32 Merge branch 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
x86
xtensa
.gitignore
Kconfig