[ARM] 3499/1: Fix VFP FPSCR corruption for double exception case
authorGeorge G. Davis <davis_g@mvista.com>
Fri, 5 May 2006 21:32:23 +0000 (22:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 5 May 2006 21:32:23 +0000 (22:32 +0100)
Patch from George G. Davis

The ARM VFP FPSCR register is corrupted when a condition flags modifying
VFP instruction is followed by a non-condition flags modifying VFP
instruction and both instructions raise exceptions.  The fix is to
read the current FPSCR in between emulation of these two instructions
and use the current FPSCR value when handling the second exception.

Signed-off-by: George G. Davis <gdavis@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

arch/arm/vfp/vfpmodule.c

index 37ff814..03486be 100644 (file)
@@ -245,7 +245,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
         */
        barrier();
        trigger = fmrx(FPINST2);
-       fpscr = fmrx(FPSCR);
+       orig_fpscr = fpscr = fmrx(FPSCR);
 
  emulate:
        exceptions = vfp_emulate_instruction(trigger, fpscr, regs);