Skip to content

Commit

Permalink
[ARM] 3748/3: Correct error check in vfp_raise_exceptions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Jacobowitz authored and Russell King committed Aug 27, 2006
1 parent 3a13813 commit 7c6f251
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions arch/arm/vfp/vfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,11 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand);
* A special flag to tell the normalisation code not to normalise.
*/
#define VFP_NAN_FLAG 0x100

/*
* A bit pattern used to indicate the initial (unset) value of the
* exception mask, in case nothing handles an instruction. This
* doesn't include the NAN flag, which get masked out before
* we check for an error.
*/
#define VFP_EXCEPTION_ERROR ((u32)-1 & ~VFP_NAN_FLAG)
4 changes: 2 additions & 2 deletions arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_

pr_debug("VFP: raising exceptions %08x\n", exceptions);

if (exceptions == (u32)-1) {
if (exceptions == VFP_EXCEPTION_ERROR) {
vfp_panic("unhandled bounce");
vfp_raise_sigfpe(0, regs);
return;
Expand Down Expand Up @@ -170,7 +170,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_
*/
static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
{
u32 exceptions = (u32)-1;
u32 exceptions = VFP_EXCEPTION_ERROR;

pr_debug("VFP: emulate: INST=0x%08x SCR=0x%08x\n", inst, fpscr);

Expand Down

0 comments on commit 7c6f251

Please sign in to comment.