From aa71933721d8fb1b037655603c60ce29b9d83aa3 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sun, 4 Mar 2018 23:11:12 -0500 Subject: [PATCH] target/arm: Remove unnecessary '| 0xf0000000' from do_v7m_exception_exit() In do_v7m_exception_exit(), there's no need to force the high 4 bits of 'type' to 1 when calling v7m_exception_taken(), because we know that they're always 1 or we could not have got to this "handle return to magic exception return address" code. Remove the unnecessary ORs. Backports commit 7115cdf5782922611bcc44c89eec5990db7f6466 from qemu --- qemu/target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index e39f0811..fed3db35 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -5571,7 +5571,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK; // Unicorn: commented out //armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); - v7m_exception_taken(cpu, type | 0xf0000000); + v7m_exception_taken(cpu, type); qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing " "stackframe: failed exception return integrity check\n"); return; @@ -5614,7 +5614,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) //armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK; v7m_push_stack(cpu); - v7m_exception_taken(cpu, type | 0xf0000000); + v7m_exception_taken(cpu, type); qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on new stackframe: " "failed exception return integrity check\n"); return;