[RFC PATCH 21/34] accel/tcg: [CPUTLB] Use tcg_ctx->tlb_dyn_max_bits

Anton Johansson via posted 34 patches 10 months, 1 week ago
[RFC PATCH 21/34] accel/tcg: [CPUTLB] Use tcg_ctx->tlb_dyn_max_bits
Posted by Anton Johansson via 10 months, 1 week ago
CPU_TLB_DYN_MAX_BITS depends on TARGET_VIRT_ADDR_SPACE_BITS on 64-bit
hosts, and is not yet target independent.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 accel/tcg/cputlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 967d5da6d4..42be5b6289 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -172,7 +172,7 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast,
     rate = desc->window_max_entries * 100 / old_size;
 
     if (rate > 70) {
-        new_size = MIN(old_size << 1, 1 << CPU_TLB_DYN_MAX_BITS);
+        new_size = MIN(old_size << 1, 1 << tcg_ctx->tlb_dyn_max_bits);
     } else if (rate < 30 && window_expired) {
         size_t ceil = pow2ceil(desc->window_max_entries);
         size_t expected_rate = desc->window_max_entries * 100 / ceil;
-- 
2.43.0
Re: [RFC PATCH 21/34] accel/tcg: [CPUTLB] Use tcg_ctx->tlb_dyn_max_bits
Posted by Richard Henderson 10 months, 1 week ago
On 1/20/24 00:40, Anton Johansson wrote:
> @@ -172,7 +172,7 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast,
>       rate = desc->window_max_entries * 100 / old_size;
>   
>       if (rate > 70) {
> -        new_size = MIN(old_size << 1, 1 << CPU_TLB_DYN_MAX_BITS);
> +        new_size = MIN(old_size << 1, 1 << tcg_ctx->tlb_dyn_max_bits);

Out of scope.


r~