[PATCH v2 19/54] accel/tcg: Remove tlb_n_used_entries_inc

Richard Henderson posted 54 patches 1 week, 2 days ago
[PATCH v2 19/54] accel/tcg: Remove tlb_n_used_entries_inc
Posted by Richard Henderson 1 week, 2 days ago
Expand the function into its only caller, using the
existing CPUTLBDesc local pointer.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cputlb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 8caa8c0f1d..3e24529f4f 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -354,11 +354,6 @@ static void tlb_mmu_init(CPUTLBDesc *desc, CPUTLBDescFast *fast, int64_t now)
     tlb_mmu_flush_locked(desc, fast);
 }
 
-static inline void tlb_n_used_entries_inc(CPUState *cpu, uintptr_t mmu_idx)
-{
-    cpu->neg.tlb.d[mmu_idx].n_used_entries++;
-}
-
 void tlb_init(CPUState *cpu)
 {
     int64_t now = get_clock_realtime();
@@ -1211,7 +1206,7 @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx,
 
     node->full = *full;
     copy_tlb_helper_locked(te, &node->copy);
-    tlb_n_used_entries_inc(cpu, mmu_idx);
+    desc->n_used_entries++;
     qemu_spin_unlock(&tlb->c.lock);
 }
 
-- 
2.43.0
Re: [PATCH v2 19/54] accel/tcg: Remove tlb_n_used_entries_inc
Posted by Pierrick Bouvier 1 week, 1 day ago
On 11/14/24 08:00, Richard Henderson wrote:
> Expand the function into its only caller, using the
> existing CPUTLBDesc local pointer.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   accel/tcg/cputlb.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 8caa8c0f1d..3e24529f4f 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -354,11 +354,6 @@ static void tlb_mmu_init(CPUTLBDesc *desc, CPUTLBDescFast *fast, int64_t now)
>       tlb_mmu_flush_locked(desc, fast);
>   }
>   
> -static inline void tlb_n_used_entries_inc(CPUState *cpu, uintptr_t mmu_idx)
> -{
> -    cpu->neg.tlb.d[mmu_idx].n_used_entries++;
> -}
> -
>   void tlb_init(CPUState *cpu)
>   {
>       int64_t now = get_clock_realtime();
> @@ -1211,7 +1206,7 @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx,
>   
>       node->full = *full;
>       copy_tlb_helper_locked(te, &node->copy);
> -    tlb_n_used_entries_inc(cpu, mmu_idx);
> +    desc->n_used_entries++;
>       qemu_spin_unlock(&tlb->c.lock);
>   }
>   

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>