With function helper_invtlb_page_asid(), one TLB entry in LoongArch
emulated TLB is invalidated if found. Also invalidate_tlb_entry()
can be called so that only one QEMU TLB entry will be flushed.

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

diff --git a/target/loongarch/tcg/tlb_helper.c 
b/target/loongarch/tcg/tlb_helper.c
index d83e5fb7f8..7a4de7e566 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -552,7 +552,6 @@ void helper_invtlb_page_asid(CPULoongArchState *env, 
target_ulong info,
                              target_ulong addr)
 {
     int index, asid = info & 0x3ff;
-    LoongArchTLB *tlb;
     tlb_match func;
     bool ret;
 
@@ -562,9 +561,7 @@ void helper_invtlb_page_asid(CPULoongArchState *env, 
target_ulong info,
         return;
     }
 
-    tlb = &env->tlb[index];
-    tlb->tlb_misc = FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 0);
-    tlb_flush(env_cpu(env));
+    invalidate_tlb(env, index);
 }
 
 void helper_invtlb_page_asid_or_g(CPULoongArchState *env,
-- 
2.39.3


Reply via email to