From eaa080e2325233aed4411bd9b85e46f606c53dd5 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 2 Mar 2018 13:45:55 -0500 Subject: [PATCH] armv7m: set CFSR.UNDEFINSTR on undefined instructions When we take an exception for an undefined instruction, set the appropriate CFSR bit. Backports commit 81dd9648c69bb89afdd6f4bb3ed6f3efdac96524 from qemu --- qemu/target/arm/helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index a1ef6a96..74fd5db4 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -5443,6 +5443,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) switch (cs->exception_index) { case EXCP_UDEF: //armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); + env->v7m.cfsr |= R_V7M_CFSR_UNDEFINSTR_MASK; return; case EXCP_SWI: /* The PC already points to the next instruction. */