From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvb1S-0001Og-ER for qemu-devel@nongnu.org; Sun, 08 Nov 2015 20:13:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvb1R-0007zo-4Q for qemu-devel@nongnu.org; Sun, 08 Nov 2015 20:13:26 -0500 From: Michael Davidsaver Date: Sun, 8 Nov 2015 20:11:41 -0500 Message-Id: <1447031505-12477-15-git-send-email-mdavidsaver@gmail.com> In-Reply-To: <1447031505-12477-1-git-send-email-mdavidsaver@gmail.com> References: <1447031505-12477-1-git-send-email-mdavidsaver@gmail.com> Subject: [Qemu-devel] [PATCH 14/18] armv7m: auto-clear FAULTMASK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , qemu-arm@nongnu.org, Michael Davidsaver on return from all exceptions other than NMI Signed-off-by: Michael Davidsaver --- target-arm/helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 5be09b8..83af528 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -5379,8 +5379,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); -- 2.1.4