summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2025-09-04 18:07:18 +0800
committerBibo Mao <maobibo@loongson.cn>2025-09-28 16:10:34 +0800
commit56db997db04b14c15fbfbdaaa5eb924c53b730fa (patch)
tree5f31dcb79a7c709937886015feefb0164fccffd7
parenteae570bdcd2d22c0e4bc058faff7f5ff874cb801 (diff)
downloadfocaccia-qemu-56db997db04b14c15fbfbdaaa5eb924c53b730fa.tar.gz
focaccia-qemu-56db997db04b14c15fbfbdaaa5eb924c53b730fa.zip
target/loongarch: Invalid tlb entry in invalidate_tlb()
Invalid tlb entry in function invalidate_tlb(), and its usage is
simple and easy to use.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
-rw-r--r--target/loongarch/tcg/tlb_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 7a85d9ca55..b777f68f71 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -123,6 +123,7 @@ static void invalidate_tlb_entry(CPULoongArchState *env, int index)
         return;
     }
 
+    tlb->tlb_misc = FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 0);
     tlb_ps = FIELD_EX64(tlb->tlb_misc, TLB_MISC, PS);
     pagesize = MAKE_64BIT_MASK(tlb_ps, 1);
     mask = MAKE_64BIT_MASK(0, tlb_ps + 1);
@@ -338,7 +339,6 @@ void helper_tlbwr(CPULoongArchState *env)
     old = env->tlb + index;
     if (FIELD_EX64(env->CSR_TLBIDX, CSR_TLBIDX, NE)) {
         invalidate_tlb(env, index);
-        old->tlb_misc = FIELD_DP64(old->tlb_misc, TLB_MISC, E, 0);
         return;
     }