sh: Fix occasional FPU register corruption under preempt.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 26 Mar 2008 10:02:47 +0000 (19:02 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 26 Mar 2008 10:02:47 +0000 (19:02 +0900)
commit9bbafce2eec190ef7e44b0eb1095ba17ce6ad3af
tree8deae79efc43d39763bdba8ca9b670e6a1782859
parent05dda977f2574c3341abef9b74c27d2b362e1e3a
sh: Fix occasional FPU register corruption under preempt.

Presently with preempt enabled there's the possibility to be preempted
after the TIF_USEDFPU test and the register save, leading to bogus
state post-__switch_to(). Use an explicit preempt_disable()/enable()
pair around unlazy_fpu()/clear_fpu() to avoid this. Follows the x86
change.

Reported-by: Takuo Koguchi <takuo.koguchi.sw@hitachi.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/sh2a/fpu.c
arch/sh/kernel/cpu/sh4/fpu.c
arch/sh/kernel/cpu/sh5/fpu.c
arch/sh/kernel/dump_task.c
arch/sh/kernel/process_32.c
arch/sh/kernel/signal_32.c
include/asm-sh/fpu.h
include/asm-sh/processor.h
include/asm-sh/processor_32.h
include/asm-sh/processor_64.h