diff options
author | Michael Davidsaver <mdavidsaver@gmail.com> | 2017-01-20 16:31:19 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-01-20 18:48:53 +0000 |
commit | 0aabebf3592f2a3ea762a0b806a60036fdaca749 (patch) | |
tree | 580f8e5bbf84504901bd6b44f8ab3d259bd612e2 | |
parent | 88c3a61ee6a088210d219fb8ea3c65b813ed742c (diff) |
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>
-rw-r--r-- | target/arm/helper.c | 7 |
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); |