]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/loongarch: Only flush one TLB entry in helper_invtlb_page_asid_or_g()
authorBibo Mao <maobibo@loongson.cn>
Thu, 4 Sep 2025 11:11:25 +0000 (19:11 +0800)
committerBibo Mao <maobibo@loongson.cn>
Sun, 28 Sep 2025 08:10:34 +0000 (16:10 +0800)
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>
target/loongarch/tcg/tlb_helper.c

index b777f68f7148bcd1063a3ff6a008f3ef24b29861..243f9456129b1fbab371efe138af07810c13fd92 100644 (file)
@@ -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);
     }
 }