summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2025-09-04 19:11:25 +0800
committerBibo Mao <maobibo@loongson.cn>2025-09-28 16:10:34 +0800
commit66746876fed5eb3c04c2f958bef927df3389d42c (patch)
tree30332a108b2bb3486f3403f9b8bbe6391fe13042
parent56db997db04b14c15fbfbdaaa5eb924c53b730fa (diff)
downloadfocaccia-qemu-66746876fed5eb3c04c2f958bef927df3389d42c.tar.gz
focaccia-qemu-66746876fed5eb3c04c2f958bef927df3389d42c.zip
target/loongarch: Only flush one TLB entry in helper_invtlb_page_asid_or_g()
With function helper_invtlb_page_asid_or_g(), only one TLB entry in
LoongArch emulated TLB is invalidated. so with QEMU TLB, it is not
necessary to flush all QEMU TLB, only flush address range specified
LoongArch emulated TLB is ok. Here invalidate_tlb_entry() is called
so that only QEMU TLB entry with specified address range is flushed.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/loongarch/tcg/tlb_helper.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index b777f68f71..243f945612 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -556,8 +556,7 @@ void helper_invtlb_page_asid_or_g(CPULoongArchState *env,
     func = tlb_match_any;
     tlb = loongarch_tlb_search_cb(env, addr, asid, func);
     if (tlb) {
-        tlb->tlb_misc = FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 0);
-        tlb_flush(env_cpu(env));
+        invalidate_tlb(env, tlb - env->tlb);
     }
 }