On 2025/9/3 下午9:21, Richard Henderson wrote:
On 9/3/25 10:48, Bibo Mao wrote:
With function helper_invtlb_page_asid(), currently it is to search
TLB entry one by one. Instead STLB can be searched at first with hash
method, and then search MTLB with one by one method

Here common API loongarch_tlb_search_cb() is used in function
helper_invtlb_page_asid()

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

diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 620de85a3a..c074c956a2 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -32,6 +32,15 @@ static bool tlb_match_any(int global, int asid, int tlb_asid)
      return false;
  }
+static bool tlb_match_asid(int global, int asid, int tlb_asid)
+{
+    if (!global && tlb_asid == asid) {
+        return true;
+    }
+
+    return false;

return !global && tlb_asid == asid;
will do.

Regards
Bibo Mao

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~


Reply via email to