summaryrefslogtreecommitdiffstats
path: root/target/arm
diff options
context:
space:
mode:
authorMichael Davidsaver2017-01-27 16:20:22 +0100
committerPeter Maydell2017-01-27 16:20:22 +0100
commita20ee6005564590d33eabec11ed4dc7c432db36b (patch)
treec77428f4d2e13798634b53bd7cf499cbae814af5 /target/arm
parentarmv7m: Fix reads of CONTROL register bit 1 (diff)
downloadqemu-a20ee6005564590d33eabec11ed4dc7c432db36b.tar.gz
qemu-a20ee6005564590d33eabec11ed4dc7c432db36b.tar.xz
qemu-a20ee6005564590d33eabec11ed4dc7c432db36b.zip
armv7m: Clear FAULTMASK on return from non-NMI exceptions
FAULTMASK must be cleared on return from all exceptions other than NMI. Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1484937883-1068-7-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target/arm')
-rw-r--r--target/arm/helper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc383d16bb..cfbc6229c2 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -5969,8 +5969,13 @@ static void do_v7m_exception_exit(CPUARMState *env)
uint32_t xpsr;
type = env->regs[15];
- if (env->v7m.exception != 0)
+ if (env->v7m.exception != ARMV7M_EXCP_NMI) {
+ /* Auto-clear FAULTMASK on return from other than NMI */
+ env->daif &= ~PSTATE_F;
+ }
+ if (env->v7m.exception != 0) {
armv7m_nvic_complete_irq(env->nvic, env->v7m.exception);
+ }
/* Switch to the target stack. */
switch_v7m_sp(env, (type & 4) != 0);