target-arm: Clear IT bits when taking exceptions in v7M
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 14 Mar 2012 12:26:10 +0000 (12:26 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 15 Mar 2012 17:00:52 +0000 (17:00 +0000)
When taking an exception for an M profile core, we must clear
the IT bits. Since the IT bits are cached in env->condexec_bits
we must clear them there: writing the bits in env->uncached_cpsr
has no effect. (Reported as LP:944645.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target-arm/helper.c

index 4116feebf5363fbc6efa1a6a2fa15b37c0c406c1..1314f23d59b09179dbcaea35c3b80a6396181da0 100644 (file)
@@ -877,7 +877,8 @@ static void do_interrupt_v7m(CPUARMState *env)
     v7m_push(env, env->regs[1]);
     v7m_push(env, env->regs[0]);
     switch_v7m_sp(env, 0);
-    env->uncached_cpsr &= ~CPSR_IT;
+    /* Clear IT bits */
+    env->condexec_bits = 0;
     env->regs[14] = lr;
     addr = ldl_phys(env->v7m.vecbase + env->v7m.exception * 4);
     env->regs[15] = addr & 0xfffffffe;