Skip to contentSkip to conversation

target/arm: Don't read r4 from v8M exception stackframe twice

PATCH In review Peter Maydell 3 participants 3 messages Oct 2, 2018 – Oct 3, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: Don't read r4 from v8M exception stackframe twice

A cut-and-paste error meant we were reading r4 from the v8M callee-saves exception stack frame twice. This is harmless since it just meant we did two memory accesses to the same location, but it's unnecessary. Delete it.

---
 target/arm/helper.c | 1 -
 1 file changed, 1 deletion(-)
target/arm/helper.c +0 -1
index 073fb3c5cb0..5e721a65272 100644
@@ -7303,7 +7303,6 @@ static void do_v7m_exception_exit(ARMCPU *cpu)
             }
 
             pop_ok = pop_ok &&
-                v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[5], frameptr + 0xc, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[6], frameptr + 0x10, mmu_idx) &&
Signature · 1 line
2.19.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Peter Maydell

A cut-and-paste error meant we were reading r4 from the v8M callee-saves exception stack frame twice. This is harmless since it just meant we did two memory accesses to the same location, but it's unnecessary. Delete it.

Quoted 17 lines
---
 target/arm/helper.c | 1 -
 1 file changed, 1 deletion(-)
target/arm/helper.c +0 -1
index 073fb3c5cb0..5e721a65272 100644
@@ -7303,7 +7303,6 @@ static void do_v7m_exception_exit(ARMCPU *cpu)
             }
 
             pop_ok = pop_ok &&
-                v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[5], frameptr + 0xc, mmu_idx) &&
                 v7m_stack_read(cpu, &env->regs[6], frameptr + 0x10, mmu_idx) &&
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 9 lines · Peter Maydell

A cut-and-paste error meant we were reading r4 from the v8M callee-saves exception stack frame twice. This is harmless since it just meant we did two memory accesses to the same location, but it's unnecessary. Delete it.

---
 target/arm/helper.c | 1 -
 1 file changed, 1 deletion(-)

r~