Commit dbead405 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

ARM: 5909/1: ARM: Correct the FPSCR bits setting when raising exceptions

Commit c98929c0 removed the clearing of the FPSCR[31:28] bits from the
vfp_raise_exceptions() function and the new bits are or'ed with the old
FPSCR bits leading to unexpected results (the original commit was
referring to the cumulative bits - FPSCR[4:0]).
Reported-by: default avatarTom Hameenanttila <tmhameen@marvell.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c540b9ff
...@@ -197,10 +197,13 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_ ...@@ -197,10 +197,13 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_
} }
/* /*
* Update the FPSCR with the additional exception flags. * If any of the status flags are set, update the FPSCR.
* Comparison instructions always return at least one of * Comparison instructions always return at least one of
* these flags set. * these flags set.
*/ */
if (exceptions & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
fpscr &= ~(FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V);
fpscr |= exceptions; fpscr |= exceptions;
fmxr(FPSCR, fpscr); fmxr(FPSCR, fpscr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment