Skip to contentSkip to conversation

target-arm: Clear IT bits when taking exceptions in v7M

PATCH New Peter Maydell 1 participant 1 message Mar 2, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: Clear IT bits when taking exceptions in v7M

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.)

---
 target-arm/helper.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
target-arm/helper.c +2 -1
index 4929372..71fcc41 100644
@@ -882,7 +882,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;
Signature · 1 line
1.7.1