diff mbox series

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

Message ID 20240119144024.14289-22-anjo@rev.ng (mailing list archive)
State New, archived
Headers show
Series Compile accel/tcg once (partially) | expand

Commit Message

Anton Johansson Jan. 19, 2024, 2:40 p.m. UTC
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(-)

Comments

Richard Henderson Jan. 24, 2024, 1:23 a.m. UTC | #1
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~
diff mbox series

Patch

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;