[PATCH 5/6] target/loongarch: Only flush one TLB entry in helper_invtlb_page_asid_or_g

Bibo Mao posted 6 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH 5/6] target/loongarch: Only flush one TLB entry in helper_invtlb_page_asid_or_g
Posted by Bibo Mao 3 months, 1 week ago
With function helper_invtlb_page_asid_or_g(), one TLB entry in
LoongArch emulated TLB is invalidated. Also invalidate_tlb_entry()
can be called so that only one QEMU TLB entry will be flushed.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 target/loongarch/tcg/tlb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 5864858ccf..c7f7c697af 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -581,9 +581,9 @@ void helper_invtlb_page_asid_or_g(CPULoongArchState *env,
         return;
     }
 
+    invalidate_tlb_entry(env, index);
     tlb = &env->tlb[index];
     tlb->tlb_misc = FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 0);
-    tlb_flush(env_cpu(env));
 }
 
 /*
-- 
2.39.3