[ARM] 3748/3: Correct error check in vfp_raise_exceptions

Patch from Daniel Jacobowitz

The recent fix to hide VFP_NAN_FLAG broke the check in vfp_raise_exceptions;
it would attempt to deliver an exception mask of 0xfffffeff instead of reporting
a serious error condition using printk. Define a safe constant to use for
an invalid exception maskm, and use it at both ends.

Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Daniel Jacobowitz and committed by Russell King 7c6f2514 3a13813e

+10 -2
+8
arch/arm/vfp/vfp.h
··· 353 353 * A special flag to tell the normalisation code not to normalise. 354 354 */ 355 355 #define VFP_NAN_FLAG 0x100 356 + 357 + /* 358 + * A bit pattern used to indicate the initial (unset) value of the 359 + * exception mask, in case nothing handles an instruction. This 360 + * doesn't include the NAN flag, which get masked out before 361 + * we check for an error. 362 + */ 363 + #define VFP_EXCEPTION_ERROR ((u32)-1 & ~VFP_NAN_FLAG)
+2 -2
arch/arm/vfp/vfpmodule.c
··· 131 131 132 132 pr_debug("VFP: raising exceptions %08x\n", exceptions); 133 133 134 - if (exceptions == (u32)-1) { 134 + if (exceptions == VFP_EXCEPTION_ERROR) { 135 135 vfp_panic("unhandled bounce"); 136 136 vfp_raise_sigfpe(0, regs); 137 137 return; ··· 170 170 */ 171 171 static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs) 172 172 { 173 - u32 exceptions = (u32)-1; 173 + u32 exceptions = VFP_EXCEPTION_ERROR; 174 174 175 175 pr_debug("VFP: emulate: INST=0x%08x SCR=0x%08x\n", inst, fpscr); 176 176