From nobody Sat Nov 23 23:03:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728543263306188.25396194139466; Wed, 9 Oct 2024 23:54:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn32-00019M-Nm; Thu, 10 Oct 2024 02:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syn30-00017i-2M for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:18 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn2w-00040a-5Z for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:17 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8BxqrHUeQdn7+IRAA--.25543S3; Thu, 10 Oct 2024 14:53:08 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by front1 (Coremail) with SMTP id qMiowMBxXuTTeQdnBiAiAA--.41709S3; Thu, 10 Oct 2024 14:53:07 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, maobibo@loongson.cn, philmd@linaro.org Subject: [PATCH v2 1/5] target/loongarch: Add a new cpu_type la664 Date: Thu, 10 Oct 2024 14:35:32 +0800 Message-Id: <20241010063536.2276871-2-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010063536.2276871-1-gaosong@loongson.cn> References: <20241010063536.2276871-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMBxXuTTeQdnBiAiAA--.41709S3 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1728543265471116600 Content-Type: text/plain; charset="utf-8" Add a new LoongArch cpu type la664. The la664 has many new features, such as new atomic instructions, hardware page table walk, etc. We will implement them later. Signed-off-by: Song Gao --- target/loongarch/cpu.c | 50 +++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 7212fb5f8f..d55b4110a9 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -374,20 +374,11 @@ static int loongarch_cpu_mmu_index(CPUState *cs, bool= ifetch) return MMU_DA_IDX; } =20 -static void loongarch_la464_initfn(Object *obj) +static void loongarch_common_initfn(CPULoongArchState *env, Object *obj) { - LoongArchCPU *cpu =3D LOONGARCH_CPU(obj); - CPULoongArchState *env =3D &cpu->env; - int i; - - for (i =3D 0; i < 21; i++) { - env->cpucfg[i] =3D 0x0; - } - - cpu->dtb_compatible =3D "loongarch,Loongson-3A5000"; - env->cpucfg[0] =3D 0x14c010; /* PRID */ + uint32_t data; =20 - uint32_t data =3D 0; + data =3D 0; data =3D FIELD_DP32(data, CPUCFG1, ARCH, 2); data =3D FIELD_DP32(data, CPUCFG1, PGMMU, 1); data =3D FIELD_DP32(data, CPUCFG1, IOCSR, 1); @@ -472,14 +463,42 @@ static void loongarch_la464_initfn(Object *obj) loongarch_cpu_post_init(obj); } =20 -static void loongarch_la132_initfn(Object *obj) +static void loongarch_la664_initfn(Object *obj) { LoongArchCPU *cpu =3D LOONGARCH_CPU(obj); CPULoongArchState *env =3D &cpu->env; =20 - int i; + for (unsigned i =3D 0; i < ARRAY_SIZE(env->cpucfg); i++) { + env->cpucfg[i] =3D 0x0; + } + + cpu->dtb_compatible =3D "loongarch,Loongson-3A6000"; + env->cpucfg[0] =3D 0x14d000; /* PRID */ + + loongarch_common_initfn(env, obj); +} + +static void loongarch_la464_initfn(Object *obj) +{ + LoongArchCPU *cpu =3D LOONGARCH_CPU(obj); + CPULoongArchState *env =3D &cpu->env; + + for (unsigned i =3D 0; i < ARRAY_SIZE(env->cpucfg); i++) { + env->cpucfg[i] =3D 0x0; + } + + cpu->dtb_compatible =3D "loongarch,Loongson-3A5000"; + env->cpucfg[0] =3D 0x14c010; /* PRID */ + + loongarch_common_initfn(env, obj); +} + +static void loongarch_la132_initfn(Object *obj) +{ + LoongArchCPU *cpu =3D LOONGARCH_CPU(obj); + CPULoongArchState *env =3D &cpu->env; =20 - for (i =3D 0; i < 21; i++) { + for (unsigned i =3D 0; i < ARRAY_SIZE(env->cpucfg); i++) { env->cpucfg[i] =3D 0x0; } =20 @@ -872,6 +891,7 @@ static const TypeInfo loongarch_cpu_type_infos[] =3D { .abstract =3D true, .class_init =3D loongarch64_cpu_class_init, }, + DEFINE_LOONGARCH_CPU_TYPE(64, "la664", loongarch_la664_initfn), DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn), DEFINE_LOONGARCH_CPU_TYPE(32, "la132", loongarch_la132_initfn), DEFINE_LOONGARCH_CPU_TYPE(64, "max", loongarch_max_initfn), --=20 2.33.0 From nobody Sat Nov 23 23:03:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728543253965989.2265131720291; Wed, 9 Oct 2024 23:54:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn32-00018x-BL; Thu, 10 Oct 2024 02:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syn30-000183-Ch for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:18 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn2y-00040t-BZ for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:18 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8BxUejUeQdn8eIRAA--.25707S3; Thu, 10 Oct 2024 14:53:08 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by front1 (Coremail) with SMTP id qMiowMBxXuTTeQdnBiAiAA--.41709S4; Thu, 10 Oct 2024 14:53:08 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, maobibo@loongson.cn, philmd@linaro.org Subject: [PATCH v2 2/5] target/loongarch: Add do_lddir/ldpte() Date: Thu, 10 Oct 2024 14:35:33 +0800 Message-Id: <20241010063536.2276871-3-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010063536.2276871-1-gaosong@loongson.cn> References: <20241010063536.2276871-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMBxXuTTeQdnBiAiAA--.41709S4 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1728543255339116600 Content-Type: text/plain; charset="utf-8" do_lddir is used for accessing directory entries during page table walking, do_ldpte is used for page table entry accesses during page table walking. Signed-off-by: Song Gao --- target/loongarch/tcg/tlb_helper.c | 53 ++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_h= elper.c index 97f38fc391..3c3452b316 100644 --- a/target/loongarch/tcg/tlb_helper.c +++ b/target/loongarch/tcg/tlb_helper.c @@ -507,11 +507,11 @@ bool loongarch_cpu_tlb_fill(CPUState *cs, vaddr addre= ss, int size, cpu_loop_exit_restore(cs, retaddr); } =20 -target_ulong helper_lddir(CPULoongArchState *env, target_ulong base, - target_ulong level, uint32_t mem_idx) +static target_ulong do_lddir(CPULoongArchState *env, target_ulong base, + target_ulong badvaddr, target_ulong level) { CPUState *cs =3D env_cpu(env); - target_ulong badvaddr, index, phys, ret; + target_ulong index, phys, ret; int shift; uint64_t dir_base, dir_width; =20 @@ -535,7 +535,6 @@ target_ulong helper_lddir(CPULoongArchState *env, targe= t_ulong base, } } =20 - badvaddr =3D env->CSR_TLBRBADV; base =3D base & TARGET_PHYS_MASK; =20 /* 0:64bit, 1:128bit, 2:192bit, 3:256bit */ @@ -549,11 +548,18 @@ target_ulong helper_lddir(CPULoongArchState *env, tar= get_ulong base, return ret; } =20 -void helper_ldpte(CPULoongArchState *env, target_ulong base, target_ulong = odd, - uint32_t mem_idx) +target_ulong helper_lddir(CPULoongArchState *env, target_ulong base, + target_ulong level, uint32_t mem_idx) +{ + return do_lddir(env, base, env->CSR_TLBRBADV, level); +} + +static void do_ldpte(CPULoongArchState *env, target_ulong base, + target_ulong badvaddr, target_ulong *ptval0, + target_ulong *ptval1, target_ulong *ps) { CPUState *cs =3D env_cpu(env); - target_ulong phys, tmp0, ptindex, ptoffset0, ptoffset1, ps, badv; + target_ulong ptindex, ptoffset0, ptoffset1, phys0, phys1; int shift; uint64_t ptbase =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTBASE); uint64_t ptwidth =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTWIDTH); @@ -584,34 +590,43 @@ void helper_ldpte(CPULoongArchState *env, target_ulon= g base, target_ulong odd, base =3D FIELD_DP64(base, TLBENTRY, G, 1); } =20 - ps =3D dir_base + dir_width - 1; + *ps =3D dir_base + dir_width - 1; /* * Huge pages are evenly split into parity pages * when loaded into the tlb, * so the tlb page size needs to be divided by 2. */ - tmp0 =3D base; - if (odd) { - tmp0 +=3D MAKE_64BIT_MASK(ps, 1); - } + *ptval0 =3D base; + *ptval1 =3D base + MAKE_64BIT_MASK(*ps, 1); } else { /* 0:64bit, 1:128bit, 2:192bit, 3:256bit */ shift =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTEWIDTH); shift =3D (shift + 1) * 3; - badv =3D env->CSR_TLBRBADV; =20 - ptindex =3D (badv >> ptbase) & ((1 << ptwidth) - 1); - ptindex =3D ptindex & ~0x1; /* clear bit 0 */ + ptindex =3D (badvaddr >> ptbase) & ((1 << ptwidth) - 1); + ptindex =3D ptindex & ~0x1; /* clear bit 0 */ ptoffset0 =3D ptindex << shift; ptoffset1 =3D (ptindex + 1) << shift; =20 - phys =3D base | (odd ? ptoffset1 : ptoffset0); - tmp0 =3D ldq_phys(cs->as, phys) & TARGET_PHYS_MASK; - ps =3D ptbase; + phys0 =3D base | ptoffset0; + phys1 =3D base | ptoffset1; + *ptval0 =3D ldq_phys(cs->as, phys0) & TARGET_PHYS_MASK; + *ptval1 =3D ldq_phys(cs->as, phys1) & TARGET_PHYS_MASK; + *ps =3D ptbase; } =20 + return; +} + +void helper_ldpte(CPULoongArchState *env, target_ulong base, target_ulong = odd, + uint32_t mem_idx) +{ + target_ulong tmp0, tmp1, ps; + + do_ldpte(env, base, env->CSR_TLBRBADV, &tmp0, &tmp1, &ps); + if (odd) { - env->CSR_TLBRELO1 =3D tmp0; + env->CSR_TLBRELO1 =3D tmp1; } else { env->CSR_TLBRELO0 =3D tmp0; } --=20 2.33.0 From nobody Sat Nov 23 23:03:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728543264321514.2931258105802; Wed, 9 Oct 2024 23:54:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn34-00019b-1v; Thu, 10 Oct 2024 02:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syn31-00018L-DI for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:19 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn2y-00040s-Nt for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:18 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8DxeXLVeQdn8uIRAA--.25841S3; Thu, 10 Oct 2024 14:53:09 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by front1 (Coremail) with SMTP id qMiowMBxXuTTeQdnBiAiAA--.41709S5; Thu, 10 Oct 2024 14:53:08 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, maobibo@loongson.cn, philmd@linaro.org Subject: [PATCH v2 3/5] target/loongarch: Add do_fill_tlb_entry() Date: Thu, 10 Oct 2024 14:35:34 +0800 Message-Id: <20241010063536.2276871-4-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010063536.2276871-1-gaosong@loongson.cn> References: <20241010063536.2276871-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMBxXuTTeQdnBiAiAA--.41709S5 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1728543265472116600 Content-Type: text/plain; charset="utf-8" do_fill_tlb_entry is used to fill a tlb entry. Signed-off-by: Song Gao --- target/loongarch/tcg/tlb_helper.c | 43 ++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_h= elper.c index 3c3452b316..bc6d708484 100644 --- a/target/loongarch/tcg/tlb_helper.c +++ b/target/loongarch/tcg/tlb_helper.c @@ -160,11 +160,33 @@ static void invalidate_tlb(CPULoongArchState *env, in= t index) invalidate_tlb_entry(env, index); } =20 -static void fill_tlb_entry(CPULoongArchState *env, int index) +static void do_fill_tlb_entry(CPULoongArchState *env, uint64_t vppn, + uint64_t lo0, uint64_t lo1, int index, uint8= _t ps) { LoongArchTLB *tlb =3D &env->tlb[index]; + uint16_t asid; + + if (ps =3D=3D 0) { + qemu_log_mask(CPU_LOG_MMU, "page size is 0\n"); + } + + /* Only MTLB has the ps fields */ + if (index >=3D LOONGARCH_STLB) { + tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, PS, ps); + } + + tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, VPPN, vppn); + tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 1); + asid =3D FIELD_EX64(env->CSR_ASID, CSR_ASID, ASID); + tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, ASID, asid); + + tlb->tlb_entry0 =3D lo0; + tlb->tlb_entry1 =3D lo1; +} + +static void fill_tlb_entry(CPULoongArchState *env, int index) +{ uint64_t lo0, lo1, csr_vppn; - uint16_t csr_asid; uint8_t csr_ps; =20 if (FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR)) { @@ -187,22 +209,7 @@ static void fill_tlb_entry(CPULoongArchState *env, int= index) lo1 =3D env->CSR_TLBELO1; } =20 - if (csr_ps =3D=3D 0) { - qemu_log_mask(CPU_LOG_MMU, "page size is 0\n"); - } - - /* Only MTLB has the ps fields */ - if (index >=3D LOONGARCH_STLB) { - tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, PS, csr_ps); - } - - tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, VPPN, csr_vppn); - tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, E, 1); - csr_asid =3D FIELD_EX64(env->CSR_ASID, CSR_ASID, ASID); - tlb->tlb_misc =3D FIELD_DP64(tlb->tlb_misc, TLB_MISC, ASID, csr_asid); - - tlb->tlb_entry0 =3D lo0; - tlb->tlb_entry1 =3D lo1; + do_fill_tlb_entry(env, csr_vppn, lo0, lo1, index, csr_ps); } =20 /* Return an random value between low and high */ --=20 2.33.0 From nobody Sat Nov 23 23:03:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728543252754758.3953247209373; Wed, 9 Oct 2024 23:54:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn31-00018D-Ic; Thu, 10 Oct 2024 02:53:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syn2z-00017h-Vy for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:18 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn2w-00040b-5N for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:17 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxjnPVeQdn9OIRAA--.25757S3; Thu, 10 Oct 2024 14:53:09 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by front1 (Coremail) with SMTP id qMiowMBxXuTTeQdnBiAiAA--.41709S6; Thu, 10 Oct 2024 14:53:09 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, maobibo@loongson.cn, philmd@linaro.org Subject: [PATCH v2 4/5] target/loongarch: Add get_random_tlb_index() Date: Thu, 10 Oct 2024 14:35:35 +0800 Message-Id: <20241010063536.2276871-5-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010063536.2276871-1-gaosong@loongson.cn> References: <20241010063536.2276871-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMBxXuTTeQdnBiAiAA--.41709S6 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1728543254312116600 Content-Type: text/plain; charset="utf-8" get_random_tlb_index() is used to get a random tlb index. Signed-off-by: Song Gao --- target/loongarch/tcg/tlb_helper.c | 34 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_h= elper.c index bc6d708484..463e9be7f2 100644 --- a/target/loongarch/tcg/tlb_helper.c +++ b/target/loongarch/tcg/tlb_helper.c @@ -291,19 +291,12 @@ void helper_tlbwr(CPULoongArchState *env) fill_tlb_entry(env, index); } =20 -void helper_tlbfill(CPULoongArchState *env) +static int get_random_tlb_index(CPULoongArchState *env, + uint64_t entryhi, uint16_t pagesize) { - uint64_t address, entryhi; + uint64_t address; + uint16_t stlb_ps; int index, set, stlb_idx; - uint16_t pagesize, stlb_ps; - - if (FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR)) { - entryhi =3D env->CSR_TLBREHI; - pagesize =3D FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI, PS); - } else { - entryhi =3D env->CSR_TLBEHI; - pagesize =3D FIELD_EX64(env->CSR_TLBIDX, CSR_TLBIDX, PS); - } =20 stlb_ps =3D FIELD_EX64(env->CSR_STLBPS, CSR_STLBPS, PS); =20 @@ -323,6 +316,25 @@ void helper_tlbfill(CPULoongArchState *env) index =3D get_random_tlb(LOONGARCH_STLB, LOONGARCH_TLB_MAX - 1); } =20 + return index; +} + +void helper_tlbfill(CPULoongArchState *env) +{ + uint64_t entryhi; + uint16_t pagesize; + int index; + + if (FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR)) { + entryhi =3D env->CSR_TLBREHI; + pagesize =3D FIELD_EX64(env->CSR_TLBREHI, CSR_TLBREHI, PS); + } else { + entryhi =3D env->CSR_TLBEHI; + pagesize =3D FIELD_EX64(env->CSR_TLBIDX, CSR_TLBIDX, PS); + } + + index =3D get_random_tlb_index(env, entryhi, pagesize); + invalidate_tlb(env, index); fill_tlb_entry(env, index); } --=20 2.33.0 From nobody Sat Nov 23 23:03:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728543280630824.7527521356553; Wed, 9 Oct 2024 23:54:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn32-00018I-Az; Thu, 10 Oct 2024 02:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syn2z-00017Y-45 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:17 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syn2w-00040c-0f for qemu-devel@nongnu.org; Thu, 10 Oct 2024 02:53:16 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8BxnnPWeQdn9+IRAA--.26015S3; Thu, 10 Oct 2024 14:53:10 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by front1 (Coremail) with SMTP id qMiowMBxXuTTeQdnBiAiAA--.41709S7; Thu, 10 Oct 2024 14:53:09 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, maobibo@loongson.cn, philmd@linaro.org Subject: [PATCH v2 5/5] target/loongarch/tcg: Add hardware page table walker support Date: Thu, 10 Oct 2024 14:35:36 +0800 Message-Id: <20241010063536.2276871-6-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241010063536.2276871-1-gaosong@loongson.cn> References: <20241010063536.2276871-1-gaosong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowMBxXuTTeQdnBiAiAA--.41709S7 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1728543281737116600 Content-Type: text/plain; charset="utf-8" Add hardware page table walker (HPTW) feature for la664. Set CPUCFG2.HPTW =3D 1 to indicate that HPTW is implemented on this CPU. Set PWCH.HPTW_EN =3D 1 to enable HPTW. Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 3 + target/loongarch/cpu.c | 1 + target/loongarch/cpu.h | 1 + target/loongarch/cpu_helper.c | 26 +++++- target/loongarch/internals.h | 4 +- target/loongarch/tcg/tlb_helper.c | 147 +++++++++++++++++++++++++++++- 6 files changed, 176 insertions(+), 6 deletions(-) diff --git a/target/loongarch/cpu-csr.h b/target/loongarch/cpu-csr.h index 0834e91f30..1aa015dc44 100644 --- a/target/loongarch/cpu-csr.h +++ b/target/loongarch/cpu-csr.h @@ -68,6 +68,8 @@ FIELD(TLBENTRY, PLV, 2, 2) FIELD(TLBENTRY, MAT, 4, 2) FIELD(TLBENTRY, G, 6, 1) FIELD(TLBENTRY, HUGE, 6, 1) +FIELD(TLBENTRY, PRESENT, 7, 1) +FIELD(TLBENTRY, WRITE, 8, 1) FIELD(TLBENTRY, HGLOBAL, 12, 1) FIELD(TLBENTRY, LEVEL, 13, 2) FIELD(TLBENTRY_32, PPN, 8, 24) @@ -103,6 +105,7 @@ FIELD(CSR_PWCH, DIR3_BASE, 0, 6) FIELD(CSR_PWCH, DIR3_WIDTH, 6, 6) FIELD(CSR_PWCH, DIR4_BASE, 12, 6) FIELD(CSR_PWCH, DIR4_WIDTH, 18, 6) +FIELD(CSR_PWCH, HPTW_EN, 24, 1) =20 #define LOONGARCH_CSR_STLBPS 0x1e /* Stlb page size */ FIELD(CSR_STLBPS, PS, 0, 5) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d55b4110a9..9dbf2ce67b 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -476,6 +476,7 @@ static void loongarch_la664_initfn(Object *obj) env->cpucfg[0] =3D 0x14d000; /* PRID */ =20 loongarch_common_initfn(env, obj); + env->cpucfg[2] =3D FIELD_DP32(env->cpucfg[2], CPUCFG2, HPTW, 1); } =20 static void loongarch_la464_initfn(Object *obj) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 6c41fafb70..84f92507d6 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -155,6 +155,7 @@ FIELD(CPUCFG2, LBT_ARM, 19, 1) FIELD(CPUCFG2, LBT_MIPS, 20, 1) FIELD(CPUCFG2, LSPW, 21, 1) FIELD(CPUCFG2, LAM, 22, 1) +FIELD(CPUCFG2, HPTW, 24, 1) =20 /* cpucfg[3] bits */ FIELD(CPUCFG3, CCDMA, 0, 1) diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c index 580362ac3e..35c95e9a27 100644 --- a/target/loongarch/cpu_helper.c +++ b/target/loongarch/cpu_helper.c @@ -178,10 +178,11 @@ static hwaddr dmw_va2pa(CPULoongArchState *env, targe= t_ulong va, =20 int get_physical_address(CPULoongArchState *env, hwaddr *physical, int *prot, target_ulong address, - MMUAccessType access_type, int mmu_idx) + MMUAccessType access_type, int mmu_idx, bool is_d= ebug) { int user_mode =3D mmu_idx =3D=3D MMU_USER_IDX; int kernel_mode =3D mmu_idx =3D=3D MMU_KERNEL_IDX; + int ret; uint32_t plv, base_c, base_v; int64_t addr_high; uint8_t da =3D FIELD_EX64(env->CSR_CRMD, CSR_CRMD, DA); @@ -221,8 +222,25 @@ int get_physical_address(CPULoongArchState *env, hwadd= r *physical, } =20 /* Mapped address */ - return loongarch_map_address(env, physical, prot, address, - access_type, mmu_idx); + ret =3D loongarch_map_address(env, physical, prot, address, + access_type, mmu_idx); +#ifdef CONFIG_TCG + if (!FIELD_EX32(env->cpucfg[2], CPUCFG2, HPTW)) { + return ret; + } + + if (!FIELD_EX32(env->CSR_PWCH, CSR_PWCH, HPTW_EN)) { + return ret; + } + + if (do_page_walk(env, address, access_type, ret, physical, is_debug)) { + if (!is_debug) { + ret =3D loongarch_map_address(env, physical, prot, address, + access_type, mmu_idx); + } + } +#endif + return ret; } =20 hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) @@ -232,7 +250,7 @@ hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cs, = vaddr addr) int prot; =20 if (get_physical_address(env, &phys_addr, &prot, addr, MMU_DATA_LOAD, - cpu_mmu_index(cs, false)) !=3D 0) { + cpu_mmu_index(cs, false), true) !=3D 0) { return -1; } return phys_addr; diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h index 1a02427627..fc8357914b 100644 --- a/target/loongarch/internals.h +++ b/target/loongarch/internals.h @@ -56,13 +56,15 @@ bool loongarch_tlb_search(CPULoongArchState *env, targe= t_ulong vaddr, int *index); int get_physical_address(CPULoongArchState *env, hwaddr *physical, int *prot, target_ulong address, - MMUAccessType access_type, int mmu_idx); + MMUAccessType access_type, int mmu_idx, bool is_d= ebug); hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); =20 #ifdef CONFIG_TCG bool loongarch_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); +bool do_page_walk(CPULoongArchState *env, vaddr address, + MMUAccessType, int tlb_error, hwaddr *physical, bool is_= debug); #endif #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_h= elper.c index 463e9be7f2..cecffde56e 100644 --- a/target/loongarch/tcg/tlb_helper.c +++ b/target/loongarch/tcg/tlb_helper.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/guest-random.h" +#include "qemu/atomic.h" =20 #include "cpu.h" #include "internals.h" @@ -504,7 +505,7 @@ bool loongarch_cpu_tlb_fill(CPUState *cs, vaddr address= , int size, =20 /* Data access */ ret =3D get_physical_address(env, &physical, &prot, address, - access_type, mmu_idx); + access_type, mmu_idx, false); =20 if (ret =3D=3D TLBRET_MATCH) { tlb_set_page(cs, address & TARGET_PAGE_MASK, @@ -651,3 +652,147 @@ void helper_ldpte(CPULoongArchState *env, target_ulon= g base, target_ulong odd, } env->CSR_TLBREHI =3D FIELD_DP64(env->CSR_TLBREHI, CSR_TLBREHI, PS, ps); } + +static target_ulong get_pte_base(CPULoongArchState *env, vaddr address) +{ + uint64_t dir_base, dir_width; + target_ulong base; + int i; + + /* Get PGD */ + base =3D ((address >> 63) & 0x1) ? env->CSR_PGDH : env->CSR_PGDL; + + for (i =3D 4; i > 0; i--) { + get_dir_base_width(env, &dir_base, &dir_width, i); + /* + * LDDIR: level =3D 2 corresponds to Dir1 in PWCL. + * PWCL/PWCH: dir >=3D 1 && dir_width =3D=3D 0 means no such level. + */ + if (i >=3D 2 && dir_width =3D=3D 0) { + continue; + } + base =3D do_lddir(env, base, address, i); + } + + return base; +} + +bool do_page_walk(CPULoongArchState *env, vaddr address, + MMUAccessType access_type, int tlb_error, + hwaddr *physical, bool is_debug) +{ + CPUState *cs =3D env_cpu(env); + target_ulong base, ps, tmp0, tmp1, ptindex, ptoffset, cur_val, new_val= , old_val; + uint64_t entrylo0, entrylo1, tlbehi, vppn; + uint64_t ptbase =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTBASE); + uint64_t ptwidth =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTWIDTH); + int index, shift; + bool ret =3D false; + + /* + * tlb error map : + * TLBRET_NOMATCH : tlb fill + * TLBRET_INVALID : access_type =3D 0/2 tlb_load + * : access_type =3D 1 tlb_store + * TLBRET_DIRTY : tlb_modify + */ + switch (tlb_error) { + case TLBRET_NOMATCH: + base =3D get_pte_base(env, address); + if (base =3D=3D 0) { + return ret; + } + do_ldpte(env, base, address, &tmp0, &tmp1, &ps); + entrylo0 =3D tmp0; + entrylo1 =3D tmp1; + tlbehi =3D address & (TARGET_PAGE_MASK << 1); + vppn =3D FIELD_EX64(tlbehi, CSR_TLBEHI_64, VPPN); + if (is_debug) { + uint64_t tlb_ppn, tlb_entry; + uint8_t n; + n =3D (address >> ps) & 0x1;/* Odd or even */ + + tlb_entry =3D n ? entrylo1: entrylo1; + tlb_ppn =3D FIELD_EX64(tlb_entry, TLBENTRY_64, PPN); + /* Remove sw bit between bit12 -- bit PS */ + tlb_ppn =3D tlb_ppn & ~(((0x1UL << (ps - 12)) -1)); + *physical =3D (tlb_ppn << R_TLBENTRY_64_PPN_SHIFT) | + (address & MAKE_64BIT_MASK(0, ps)); + } else { + index =3D get_random_tlb_index(env, tlbehi, ps); + invalidate_tlb(env, index); + do_fill_tlb_entry(env, vppn, entrylo0, entrylo1, index, ps); + } + + ret =3D true; + break; + case TLBRET_DIRTY: + case TLBRET_INVALID: + base =3D get_pte_base(env, address); + + /* 0:64bit, 1:128bit, 2:192bit, 3:256bit */ + shift =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTEWIDTH); + shift =3D (shift + 1) * 3; + ptindex =3D (address >> ptbase) & ((1 << ptwidth) -1); + ptoffset =3D ptindex << shift; + tmp0 =3D base | ptoffset; + retry: + old_val =3D ldq_phys(cs->as, tmp0) & TARGET_PHYS_MASK; + + if (old_val =3D=3D 0) { + return ret; + } + + new_val =3D old_val; + /* Check pte val, and do tlb modify. */ + if ((tlb_error =3D=3D TLBRET_INVALID) && + (access_type =3D=3D MMU_INST_FETCH )) { + if (!(FIELD_EX64(new_val, TLBENTRY, PRESENT))) { + break; + } + new_val =3D FIELD_DP64(new_val, TLBENTRY, V, 1); + } else if ((tlb_error =3D=3D TLBRET_INVALID) && + access_type =3D=3D MMU_DATA_STORE) { + if (!((FIELD_EX64(new_val, TLBENTRY, PRESENT) && + (FIELD_EX64(new_val, TLBENTRY, WRITE))))){ + break; + } + new_val =3D FIELD_DP64(new_val, TLBENTRY, V, 1); + } else if (tlb_error =3D=3D TLBRET_DIRTY) { + if (!(FIELD_EX64(new_val, TLBENTRY, PRESENT) && + (FIELD_EX64(new_val, TLBENTRY, WRITE)))) { + break; + } + new_val =3D FIELD_DP64(new_val, TLBENTRY, V, 1); + } + + if (old_val !=3D new_val) { + cur_val =3D qatomic_cmpxchg((uint64_t *)tmp0, old_val, new_val= ); + if (cur_val =3D=3D old_val) { + goto retry; + } + } + + tmp0 =3D tmp0 & (~0x8); + entrylo0 =3D ldq_phys(cs->as, tmp0) & TARGET_PHYS_MASK; + entrylo1 =3D ldq_phys(cs->as, tmp0 | 0x8) & TARGET_PHYS_MASK; + tlbehi =3D address & (TARGET_PAGE_MASK << 1); + ps =3D FIELD_EX64(env->CSR_PWCL, CSR_PWCL, PTBASE); + vppn =3D FIELD_EX64(tlbehi, CSR_TLBEHI_64, VPPN); + + /* + * srch tlb index with tlb entryhi + * if no match, we use get_random_tlb_index() to get random index. + */ + if (!loongarch_tlb_search(env, tlbehi, &index)) { + index =3D get_random_tlb_index(env, tlbehi, ps); + } + invalidate_tlb(env, index); + do_fill_tlb_entry(env, vppn, entrylo0, entrylo1, index, ps); + ret =3D true; + break; + default: + ; + } + return ret; +} --=20 2.33.0