Skip to content

Commit

Permalink
target/arm: Correct condition for v8M callee stack push
Browse files Browse the repository at this point in the history
In v7m_exception_taken() we were incorrectly using a
"LR bit EXCRET.ES is 1" check when it should be 0
(compare the pseudocode ExceptionTaken() function).
This meant we didn't stack the callee-saved registers
when tailchaining from a NonSecure to a Secure exception.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181002145940.30931-1-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Oct 8, 2018
1 parent 846690d commit 7b73a1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/arm/helper.c
Expand Up @@ -6938,7 +6938,7 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain,
* not already saved.
*/
if (lr & R_V7M_EXCRET_DCRS_MASK &&
!(dotailchain && (lr & R_V7M_EXCRET_ES_MASK))) {
!(dotailchain && !(lr & R_V7M_EXCRET_ES_MASK))) {
push_failed = v7m_push_callee_stack(cpu, lr, dotailchain,
ignore_stackfaults);
}
Expand Down

0 comments on commit 7b73a1c

Please sign in to comment.