[Qemu-devel] [PATCH] target/arm: Don't read r4 from v8M exception stackframe twice

Peter Maydell posted 1 patch 5 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181002150304.2287-1-peter.maydell@linaro.org
Test docker-clang@ubuntu failed
Test checkpatch passed
target/arm/helper.c | 1 -
1 file changed, 1 deletion(-)
[Qemu-devel] [PATCH] target/arm: Don't read r4 from v8M exception stackframe twice
Posted by Peter Maydell 5 years, 6 months ago
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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/helper.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 073fb3c5cb0..5e721a65272 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -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) &&
-- 
2.19.0


Re: [Qemu-devel] [PATCH] target/arm: Don't read r4 from v8M exception stackframe twice
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
On 02/10/2018 17:03, Peter Maydell wrote:
> 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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  target/arm/helper.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index 073fb3c5cb0..5e721a65272 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -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) &&
> 

Re: [Qemu-devel] [PATCH] target/arm: Don't read r4 from v8M exception stackframe twice
Posted by Richard Henderson 5 years, 6 months ago
On 10/2/18 10:03 AM, Peter Maydell wrote:
> 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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/helper.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~