[PATCH] accel/tcg: Remove a redundant argument attrs in io_prepare()

Jim Shu posted 1 patch 3 days, 13 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260203142737.2164763-1-jim.shu@sifive.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
accel/tcg/cputlb.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
[PATCH] accel/tcg: Remove a redundant argument attrs in io_prepare()
Posted by Jim Shu 3 days, 13 hours ago
attrs is already in CPUTLBEntryFull, so this argument is redundant.
Just remove it.

Clean up commit 94c6e9cf04409e38563080348d6136879f91ffee

Signed-off-by: Jim Shu <jim.shu@sifive.com>
---
 accel/tcg/cputlb.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 76546c66515..15ee29e7524 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1271,7 +1271,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
 
 static MemoryRegionSection *
 io_prepare(hwaddr *out_offset, CPUState *cpu, CPUTLBEntryFull *full,
-           MemTxAttrs attrs, vaddr addr, uintptr_t retaddr)
+           vaddr addr, uintptr_t retaddr)
 {
     MemoryRegionSection *section;
     hwaddr mr_offset;
@@ -1974,12 +1974,10 @@ static uint64_t do_ld_mmio_beN(CPUState *cpu, CPUTLBEntryFull *full,
     MemoryRegionSection *section;
     MemoryRegion *mr;
     hwaddr mr_offset;
-    MemTxAttrs attrs;
 
     tcg_debug_assert(size > 0 && size <= 8);
 
-    attrs = full->attrs;
-    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
+    section = io_prepare(&mr_offset, cpu, full, addr, ra);
     mr = section->mr;
 
     BQL_LOCK_GUARD();
@@ -1994,13 +1992,11 @@ static Int128 do_ld16_mmio_beN(CPUState *cpu, CPUTLBEntryFull *full,
     MemoryRegionSection *section;
     MemoryRegion *mr;
     hwaddr mr_offset;
-    MemTxAttrs attrs;
     uint64_t a, b;
 
     tcg_debug_assert(size > 8 && size <= 16);
 
-    attrs = full->attrs;
-    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
+    section = io_prepare(&mr_offset, cpu, full, addr, ra);
     mr = section->mr;
 
     BQL_LOCK_GUARD();
@@ -2492,12 +2488,10 @@ static uint64_t do_st_mmio_leN(CPUState *cpu, CPUTLBEntryFull *full,
     MemoryRegionSection *section;
     hwaddr mr_offset;
     MemoryRegion *mr;
-    MemTxAttrs attrs;
 
     tcg_debug_assert(size > 0 && size <= 8);
 
-    attrs = full->attrs;
-    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
+    section = io_prepare(&mr_offset, cpu, full, addr, ra);
     mr = section->mr;
 
     BQL_LOCK_GUARD();
@@ -2512,12 +2506,10 @@ static uint64_t do_st16_mmio_leN(CPUState *cpu, CPUTLBEntryFull *full,
     MemoryRegionSection *section;
     MemoryRegion *mr;
     hwaddr mr_offset;
-    MemTxAttrs attrs;
 
     tcg_debug_assert(size > 8 && size <= 16);
 
-    attrs = full->attrs;
-    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
+    section = io_prepare(&mr_offset, cpu, full, addr, ra);
     mr = section->mr;
 
     BQL_LOCK_GUARD();
-- 
2.43.0
Re: [PATCH] accel/tcg: Remove a redundant argument attrs in io_prepare()
Posted by Richard Henderson 3 days, 5 hours ago
On 2/4/26 00:27, Jim Shu wrote:
> attrs is already in CPUTLBEntryFull, so this argument is redundant.
> Just remove it.
> 
> Clean up commit 94c6e9cf04409e38563080348d6136879f91ffee
> 
> Signed-off-by: Jim Shu <jim.shu@sifive.com>
> ---
>   accel/tcg/cputlb.c | 18 +++++-------------
>   1 file changed, 5 insertions(+), 13 deletions(-)

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

and queued, thanks.

r~
Re: [PATCH] accel/tcg: Remove a redundant argument attrs in io_prepare()
Posted by Gustavo Romero 3 days, 12 hours ago
Hi Jim,

On 2/3/26 11:27, Jim Shu wrote:
> attrs is already in CPUTLBEntryFull, so this argument is redundant.
> Just remove it.
> 
> Clean up commit 94c6e9cf04409e38563080348d6136879f91ffee
> 
> Signed-off-by: Jim Shu <jim.shu@sifive.com>
> ---
>   accel/tcg/cputlb.c | 18 +++++-------------
>   1 file changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 76546c66515..15ee29e7524 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1271,7 +1271,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
>   
>   static MemoryRegionSection *
>   io_prepare(hwaddr *out_offset, CPUState *cpu, CPUTLBEntryFull *full,
> -           MemTxAttrs attrs, vaddr addr, uintptr_t retaddr)
> +           vaddr addr, uintptr_t retaddr)
>   {
>       MemoryRegionSection *section;
>       hwaddr mr_offset;
> @@ -1974,12 +1974,10 @@ static uint64_t do_ld_mmio_beN(CPUState *cpu, CPUTLBEntryFull *full,
>       MemoryRegionSection *section;
>       MemoryRegion *mr;
>       hwaddr mr_offset;
> -    MemTxAttrs attrs;
>   
>       tcg_debug_assert(size > 0 && size <= 8);
>   
> -    attrs = full->attrs;
> -    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
> +    section = io_prepare(&mr_offset, cpu, full, addr, ra);
>       mr = section->mr;
>   
>       BQL_LOCK_GUARD();
> @@ -1994,13 +1992,11 @@ static Int128 do_ld16_mmio_beN(CPUState *cpu, CPUTLBEntryFull *full,
>       MemoryRegionSection *section;
>       MemoryRegion *mr;
>       hwaddr mr_offset;
> -    MemTxAttrs attrs;
>       uint64_t a, b;
>   
>       tcg_debug_assert(size > 8 && size <= 16);
>   
> -    attrs = full->attrs;
> -    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
> +    section = io_prepare(&mr_offset, cpu, full, addr, ra);
>       mr = section->mr;
>   
>       BQL_LOCK_GUARD();
> @@ -2492,12 +2488,10 @@ static uint64_t do_st_mmio_leN(CPUState *cpu, CPUTLBEntryFull *full,
>       MemoryRegionSection *section;
>       hwaddr mr_offset;
>       MemoryRegion *mr;
> -    MemTxAttrs attrs;
>   
>       tcg_debug_assert(size > 0 && size <= 8);
>   
> -    attrs = full->attrs;
> -    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
> +    section = io_prepare(&mr_offset, cpu, full, addr, ra);
>       mr = section->mr;
>   
>       BQL_LOCK_GUARD();
> @@ -2512,12 +2506,10 @@ static uint64_t do_st16_mmio_leN(CPUState *cpu, CPUTLBEntryFull *full,
>       MemoryRegionSection *section;
>       MemoryRegion *mr;
>       hwaddr mr_offset;
> -    MemTxAttrs attrs;
>   
>       tcg_debug_assert(size > 8 && size <= 16);
>   
> -    attrs = full->attrs;
> -    section = io_prepare(&mr_offset, cpu, full, attrs, addr, ra);
> +    section = io_prepare(&mr_offset, cpu, full, addr, ra);
>       mr = section->mr;
>   
>       BQL_LOCK_GUARD();


Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>


Cheers,
Gustavo
Re: [PATCH] accel/tcg: Remove a redundant argument attrs in io_prepare()
Posted by Philippe Mathieu-Daudé 3 days, 13 hours ago
On 3/2/26 15:27, Jim Shu wrote:
> attrs is already in CPUTLBEntryFull, so this argument is redundant.
> Just remove it.
> 
> Clean up commit 94c6e9cf04409e38563080348d6136879f91ffee
> 
> Signed-off-by: Jim Shu <jim.shu@sifive.com>
> ---
>   accel/tcg/cputlb.c | 18 +++++-------------
>   1 file changed, 5 insertions(+), 13 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>