[ARM] vfp: fix leak of VFP_NAN_FLAG into FPSCR
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 25 Apr 2006 19:41:27 +0000 (20:41 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 25 Apr 2006 19:41:27 +0000 (20:41 +0100)
The VFP code can leak VFP_NAN_FLAG into the FPSCR. It doesn't correspond
to any real FPSCR bit (and overlaps one of the exception flags).

Bug report from Daniel Jacobowitz

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/vfp/vfpdouble.c
arch/arm/vfp/vfpmodule.c
arch/arm/vfp/vfpsingle.c

index febd115dba28aa5a2314bc6727c3529aa1b6fc4c..009038c8113e873cd66d35267619a6a015de7ad0 100644 (file)
@@ -197,7 +197,7 @@ u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exce
                         dd, d, exceptions);
                vfp_put_double(dd, d);
        }
-       return exceptions & ~VFP_NAN_FLAG;
+       return exceptions;
 }
 
 /*
index 22f3da4e0829b3d80b94ed3bd3a0225e19fa3590..37ff8145b5b50bf52ea9f22f5212068764167e5f 100644 (file)
@@ -180,7 +180,7 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
                 * emulate it.
                 */
        }
-       return exceptions;
+       return exceptions & ~VFP_NAN_FLAG;
 }
 
 /*
index 4ac27f1939347dadc280131da47c93737db3ad55..dae2c2f460529c835ad74fac887d1b6e1e7c807a 100644 (file)
@@ -203,7 +203,7 @@ u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exce
                vfp_put_float(sd, d);
        }
 
-       return exceptions & ~VFP_NAN_FLAG;
+       return exceptions;
 }
 
 /*