From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 15523334448717.50886432291577; Mon, 11 Mar 2019 12:44:04 -0700 (PDT) Received: from localhost ([127.0.0.1]:39243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qq9-0007wR-Tf for importer@patchew.org; Mon, 11 Mar 2019 15:44:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qb0-000408-5O for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007WL-6B for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:56175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007SX-L5 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPD-0005b3-45; Mon, 11 Mar 2019 20:16:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=t/LnXJcJmhULubJxs2sdLX2OcR5UFpTtzE8whiOhpwc=; b=AZPk89sSxWsw/i8cS1pXEYG6+h 0hp+eTwYdBU3yt4rPg2SJi1RnYUQZX/nHMbDOZNHhxe8XHsslnZ/HhTZd+EvMrltxB/5Rk18enn0M 2ixQt3m2vCk4Z4aPfE4P6uKCQ5S0OxbC79z3Y0GfhYQN8x6IO6yPao/DWupUsvZqlCwA=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:52 +0100 Message-Id: <20190311191602.25796-2-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 01/11] target/hppa: fix overwriting source reg in addb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When one of the source registers is the same as the destination register, the source register gets overwritten with the destionation value before do_add_sv() is called, which leads to unexpection condition matches. Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index dc5636fe94..7001c2eb80 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3033,7 +3033,7 @@ static bool do_addb(DisasContext *ctx, unsigned r, TC= Gv_reg in1, DisasCond cond; =20 in2 =3D load_gpr(ctx, r); - dest =3D dest_gpr(ctx, r); + dest =3D tcg_temp_new(); sv =3D NULL; cb_msb =3D NULL; =20 @@ -3049,6 +3049,8 @@ static bool do_addb(DisasContext *ctx, unsigned r, TC= Gv_reg in1, } =20 cond =3D do_cond(c * 2 + f, dest, cb_msb, sv); + save_gpr(ctx, r, dest); + tcg_temp_free(dest); return do_cbranch(ctx, disp, n, &cond); } =20 --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333480596860.4781231582799; Mon, 11 Mar 2019 12:44:40 -0700 (PDT) Received: from localhost ([127.0.0.1]:39245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qqj-0008QG-Kb for importer@patchew.org; Mon, 11 Mar 2019 15:44:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qb1-0004Gr-MM for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007W2-4E for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:32790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007TP-L6 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPD-0005b3-S9; Mon, 11 Mar 2019 20:16:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=jda9+Xj972jJQ8j7frsw2IM2mNQIk4qUSDn0d2axkqM=; b=etJYKTPXhnrFc5iaaebzpWHUjW LogcyilxK8u6ewhHFcGbvBG4UQAfqZ4CVATByOoaZepLHLUHIHz56I2U41z1ZtP8kY3ggLOQWNDwh IfrvYXmThkJMXczIGx3O0h30hLyysk4Vgg2a4e6mYgdq7eDKunKitCZDp6t16csVD9Nk=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:53 +0100 Message-Id: <20190311191602.25796-3-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 02/11] target/hppa: fix TLB handling for page 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Assume the following sequence: pitlbe r0(sr0,r0) iitlba r4,(sr0,r0) ldil L%3000000,r5 iitlbp r5,(sr0,r0) This will purge the whole TLB and add an entry for page 0. However the current TLB implementation in helper_iitlba() will store to the last empty TLB entry, while helper_iitlbp() will write to the first empty entry. That is because an empty entry will match address 0 in helper_iitlba() Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/mem_helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index aecf3075f6..f30824f4e1 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -238,15 +238,17 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong ad= dr, target_ureg reg) { hppa_tlb_entry *empty =3D NULL; int i; - /* Zap any old entries covering ADDR; notice empty entries on the way.= */ for (i =3D 0; i < ARRAY_SIZE(env->tlb); ++i) { hppa_tlb_entry *ent =3D &env->tlb[i]; - if (!ent->entry_valid) { - empty =3D ent; - } else if (ent->va_b <=3D addr && addr <=3D ent->va_e) { - hppa_flush_tlb_ent(env, ent); - empty =3D ent; + if (ent->va_b <=3D addr && addr <=3D ent->va_e) { + if (ent->entry_valid) { + hppa_flush_tlb_ent(env, ent); + } + + if (!empty) { + empty =3D ent; + } } } =20 --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333298532243.0054596696442; Mon, 11 Mar 2019 12:41:38 -0700 (PDT) Received: from localhost ([127.0.0.1]:39203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qnm-00066d-Hc for importer@patchew.org; Mon, 11 Mar 2019 15:41:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qb2-0004H6-1A for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007WE-67 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:35216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007TU-L4 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPE-0005b3-6a; Mon, 11 Mar 2019 20:16:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=hjyQtaERXgBPw55s2yYyHpIUukXZPfb/gFDWA/ASLgU=; b=EH8psCoGc75jDiRNhQ4VIWTf6y 1o2w9gQXKuQyRYsTobVEJ+ud3Ut73ux4QyV23IS2j5v++/J9yP6OM9N94i6/NWeRifAY/7sV/m3vd OzEOSIANuIcu0qPjRAmOOeZkpIL3AU3Uwtm7A7544rRRRTj4xCLP89Tyq8mpACtpO2lQ=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:54 +0100 Message-Id: <20190311191602.25796-4-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 03/11] target/hppa: report ITLB_EXCP_MISS for ITLB misses X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/mem_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index f30824f4e1..07ecfaf092 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -96,9 +96,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr ad= dr, int mmu_idx, if (ent =3D=3D NULL || !ent->entry_valid) { phys =3D 0; prot =3D 0; - /* ??? Unconditionally report data tlb miss, - even if this is an instruction fetch. */ - ret =3D EXCP_DTLB_MISS; + ret =3D (type =3D=3D PAGE_EXEC) ? EXCP_ITLB_MISS : EXCP_DTLB_MISS; goto egress; } =20 --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333374848642.5993418886028; Mon, 11 Mar 2019 12:42:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:39231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qp1-000786-Je for importer@patchew.org; Mon, 11 Mar 2019 15:42:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qay-00042z-9w for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007Wa-9O for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:43467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007Uw-SW for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPE-0005b3-HH; Mon, 11 Mar 2019 20:16:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=JiRWff1OOFlzlNh1aqvkdxvmYtLa6bTHgLw0GtPuP5I=; b=YbmWfphTdv9tuUJvoOQXlEtX3U 7RIV+Ww2tLohyReNXbA2D8o4bzem8hD/IcjLD6HxSms7NkxJAQHFV+pKDlXw6oTv5/iAiU3shacn/ 6Eu8Qi3ZdbqY0RT4INsUz2QsUS4taHDMp0v2JuavxbNWL7+Ai2hVkUPfQd7rkheIidAU=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:55 +0100 Message-Id: <20190311191602.25796-5-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 04/11] target/hppa: add TLB trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" To ease TLB debugging add a few trace events, which are disabled by default so that there's no performance impact. Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- Makefile.objs | 1 + target/hppa/mem_helper.c | 20 ++++++++++++++++++-- target/hppa/op_helper.c | 2 ++ target/hppa/trace-events | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 target/hppa/trace-events diff --git a/Makefile.objs b/Makefile.objs index ef65a6c12e..4df63e1633 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -183,6 +183,7 @@ trace-events-subdirs +=3D qapi trace-events-subdirs +=3D qom trace-events-subdirs +=3D scsi trace-events-subdirs +=3D target/arm +trace-events-subdirs +=3D target/hppa trace-events-subdirs +=3D target/i386 trace-events-subdirs +=3D target/mips trace-events-subdirs +=3D target/ppc diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 07ecfaf092..26da953185 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -22,6 +22,7 @@ #include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qom/cpu.h" +#include "trace.h" =20 #ifdef CONFIG_USER_ONLY int hppa_cpu_handle_mmu_fault(CPUState *cs, vaddr address, @@ -43,9 +44,11 @@ static hppa_tlb_entry *hppa_find_tlb(CPUHPPAState *env, = vaddr addr) for (i =3D 0; i < ARRAY_SIZE(env->tlb); ++i) { hppa_tlb_entry *ent =3D &env->tlb[i]; if (ent->va_b <=3D addr && addr <=3D ent->va_e) { + trace_hppa_tlb_find_entry(env, ent + i, ent->entry_valid, ent-= >va_b, ent->va_e, ent->pa); return ent; } } + trace_hppa_tlb_find_entry_not_found(env, addr); return NULL; } =20 @@ -55,6 +58,8 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, hppa_tl= b_entry *ent) unsigned i, n =3D 1 << (2 * ent->page_size); uint64_t addr =3D ent->va_b; =20 + trace_hppa_tlb_flush_ent(env, ent, ent->va_b, ent->va_e, ent->pa); + for (i =3D 0; i < n; ++i, addr +=3D TARGET_PAGE_SIZE) { /* Do not flush MMU_PHYS_IDX. */ tlb_flush_page_by_mmuidx(cs, addr, 0xf); @@ -169,6 +174,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr = addr, int mmu_idx, egress: *pphys =3D phys; *pprot =3D prot; + trace_hppa_tlb_get_physical_address(env, ret, prot, addr, phys); return ret; } =20 @@ -198,6 +204,7 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, MMUAccessType type, int mmu_idx, uintptr_t retaddr) { HPPACPU *cpu =3D HPPA_CPU(cs); + CPUHPPAState *env =3D &cpu->env; int prot, excp, a_prot; hwaddr phys; =20 @@ -213,9 +220,10 @@ void tlb_fill(CPUState *cs, target_ulong addr, int siz= e, break; } =20 - excp =3D hppa_get_physical_address(&cpu->env, addr, mmu_idx, + excp =3D hppa_get_physical_address(env, addr, mmu_idx, a_prot, &phys, &prot); if (unlikely(excp >=3D 0)) { + trace_hppa_tlb_fill_excp(env, addr, size, type, mmu_idx); /* Failure. Raise the indicated exception. */ cs->exception_index =3D excp; if (cpu->env.psw & PSW_Q) { @@ -226,6 +234,8 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, cpu_loop_exit_restore(cs, retaddr); } =20 + trace_hppa_tlb_fill_success(env, addr & TARGET_PAGE_MASK, + phys & TARGET_PAGE_MASK, size, type, mmu_idx); /* Success! Store the translation into the QEMU TLB. */ tlb_set_page(cs, addr & TARGET_PAGE_MASK, phys & TARGET_PAGE_MASK, prot, mmu_idx, TARGET_PAGE_SIZE); @@ -259,6 +269,7 @@ void HELPER(itlba)(CPUHPPAState *env, target_ulong addr= , target_ureg reg) empty->va_b =3D addr & TARGET_PAGE_MASK; empty->va_e =3D empty->va_b + TARGET_PAGE_SIZE - 1; empty->pa =3D extract32(reg, 5, 20) << TARGET_PAGE_BITS; + trace_hppa_tlb_itlba(env, empty, empty->va_b, empty->va_e, empty->pa); } =20 /* Insert (Insn/Data) TLB Protection. Note this is PA 1.1 only. */ @@ -280,6 +291,8 @@ void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr= , target_ureg reg) ent->d =3D extract32(reg, 28, 1); ent->t =3D extract32(reg, 29, 1); ent->entry_valid =3D 1; + trace_hppa_tlb_itlbp(env, ent, ent->access_id, ent->u, ent->ar_pl2, + ent->ar_pl1, ent->ar_type, ent->b, ent->d, ent->t= ); } =20 /* Purge (Insn/Data) TLB. This is explicitly page-based, and is @@ -299,6 +312,7 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) { CPUState *src =3D CPU(hppa_env_get_cpu(env)); CPUState *cpu; + trace_hppa_tlb_ptlb(env); run_on_cpu_data data =3D RUN_ON_CPU_TARGET_PTR(addr); =20 CPU_FOREACH(cpu) { @@ -314,7 +328,7 @@ void HELPER(ptlb)(CPUHPPAState *env, target_ulong addr) void HELPER(ptlbe)(CPUHPPAState *env) { CPUState *src =3D CPU(hppa_env_get_cpu(env)); - + trace_hppa_tlb_ptlbe(env); memset(env->tlb, 0, sizeof(env->tlb)); tlb_flush_by_mmuidx(src, 0xf); } @@ -335,8 +349,10 @@ target_ureg HELPER(lpa)(CPUHPPAState *env, target_ulon= g addr) if (excp =3D=3D EXCP_DTLB_MISS) { excp =3D EXCP_NA_DTLB_MISS; } + trace_hppa_tlb_lpa_failed(env, addr); hppa_dynamic_excp(env, excp, GETPC()); } + trace_hppa_tlb_lpa_success(env, addr, phys); return phys; } =20 diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 268caaaa20..a05681d480 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -25,6 +25,7 @@ #include "sysemu/sysemu.h" #include "qemu/timer.h" #include "fpu/softfloat.h" +#include "trace.h" =20 void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp) { @@ -165,6 +166,7 @@ target_ureg HELPER(probe)(CPUHPPAState *env, target_ulo= ng addr, int prot, excp; hwaddr phys; =20 + trace_hppa_tlb_probe(addr, level, want); /* Fail if the requested privilege level is higher than current. */ if (level < (env->iaoq_f & 3)) { return 0; diff --git a/target/hppa/trace-events b/target/hppa/trace-events new file mode 100644 index 0000000000..80dae5bd8b --- /dev/null +++ b/target/hppa/trace-events @@ -0,0 +1,18 @@ +# See docs/devel/tracing.txt for syntax documentation. + +# target/hppa/mem_helper.c +disable hppa_tlb_flush_ent(void *env, void *ent, uint64_t va_b, uint64_t v= a_e, uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%lx va_e=3D0x%lx pa=3D0x%lx" +disable hppa_tlb_find_entry(void *env, void *ent, int valid, uint64_t va_b= , uint64_t va_e, uint64_t pa) "env=3D%p ent=3D%p valid=3D%d va_b=3D0x%lx va= _e=3D0x%lx pa=3D0x%lx" +disable hppa_tlb_find_entry_not_found(void *env, uint64_t addr) "env=3D%p = addr=3D%08lx" +disable hppa_tlb_get_physical_address(void *env, int ret, int prot, uint64= _t addr, uint64_t phys) "env=3D%p ret=3D%d prot=3D%d addr=3D0x%lx phys=3D0x= %lx" +disable hppa_tlb_fill_excp(void *env, uint64_t addr, int size, int type, i= nt mmu_idx) "env=3D%p addr=3D0x%lx size=3D%d type=3D%d mmu_idx=3D%d" +disable hppa_tlb_fill_success(void *env, uint64_t addr, uint64_t phys, int= size, int type, int mmu_idx) "env=3D%p addr=3D0x%lx phys=3D0x%lx size=3D%d= type=3D%d mmu_idx=3D%d" +disable hppa_tlb_itlba(void *env, void *ent, uint64_t va_b, uint64_t va_e,= uint64_t pa) "env=3D%p ent=3D%p va_b=3D0x%lx va_e=3D0x%lx pa=3D0x%lx" +disable hppa_tlb_itlbp(void *env, void *ent, int access_id, int u, int pl2= , int pl1, int type, int b, int d, int t) "env=3D%p ent=3D%p access_id=3D%x= u=3D%d pl2=3D%d pl1=3D%d type=3D%d b=3D%d d=3D%d t=3D%d" +disable hppa_tlb_ptlb(void *env) "env=3D%p" +disable hppa_tlb_ptlbe(void *env) "env=3D%p" +disable hppa_tlb_lpa_success(void *env, uint64_t addr, uint64_t phys) "env= =3D%p addr=3D0x%lx phys=3D0x%lx" +disable hppa_tlb_lpa_failed(void *env, uint64_t addr) "env=3D%p addr=3D0x%= lx" + +# target/hppa/op_helper.c +disable hppa_tlb_probe(uint64_t addr, int level, int want) "addr=3D0x%lx l= evel=3D%d want=3D%d" --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552332951722549.7834351964611; Mon, 11 Mar 2019 12:35:51 -0700 (PDT) Received: from localhost ([127.0.0.1]:39105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3QiB-0001O4-KE for importer@patchew.org; Mon, 11 Mar 2019 15:35:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qay-0004H6-AV for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007WY-7E for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:34601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007V1-TP for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPE-0005b3-Sm; Mon, 11 Mar 2019 20:16:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=fkVxiipspqWsXPV+lUU5kQbxFUcwo4mXBTEUIIEYGGY=; b=cwiDzdBHGnk3LEYvtiQjk8CMEL ziWmyOUi4b01dg6b1njxXWJ0QcwQI2OKgbwk+hEEh/0R2qYgd9Bsuh+CU6KLiJ9Gi+g79OcW2l3Hq u6p8IRotTGRNJfjveAdx1/JfQ7byz9S6Mh0Cv3PJotgXrVrHo+EK4p/ajDR+53eR/BjE=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:56 +0100 Message-Id: <20190311191602.25796-6-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 05/11] target/hppa: remove PSW I/R/Q bit check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" HP ODE use rfi to set the Q bit, and i don't see anything in the documentation that this is forbidden. So remove it. Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/op_helper.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index a05681d480..a55a5dfc02 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -678,11 +678,6 @@ target_ureg HELPER(swap_system_mask)(CPUHPPAState *env= , target_ureg nsm) =20 void HELPER(rfi)(CPUHPPAState *env) { - /* ??? On second reading this condition simply seems - to be undefined rather than a diagnosed trap. */ - if (env->psw & (PSW_I | PSW_R | PSW_Q)) { - helper_excp(env, EXCP_ILL); - } env->iasq_f =3D (uint64_t)env->cr[CR_IIASQ] << 32; env->iasq_b =3D (uint64_t)env->cr_back[0] << 32; env->iaoq_f =3D env->cr[CR_IIAOQ]; --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552332902861610.9799461385105; Mon, 11 Mar 2019 12:35:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:39084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3QhO-0000VN-Qe for importer@patchew.org; Mon, 11 Mar 2019 15:34:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qay-0004Hb-UB for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007Wk-8A for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:37539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007V4-UI for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPF-0005b3-7K; Mon, 11 Mar 2019 20:16:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=mvD/tHm9tatu6VqRldygYueCXnryH2lnAdN5UD3Gwa8=; b=Hes01+u+9FjHOnyO5VgKTT7/eC iIFXZ/bzc9R3ZlugwYAMeXSvdHGT19iPtKOMEkfeKE3T4gCyLyFIFPphtVtGWjJYBmwZ11jit3A7E TzaXrnJxWbxTQ9VTmJRrQ3LXM4/hs6OvIwFNCS6kwnVpGPd1WAmBu+8C3dhfQS9UyYEw=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:57 +0100 Message-Id: <20190311191602.25796-7-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 06/11] target/hppa: ignore DIAG opcode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" DIAG is usually only used by diagnostics software as it's CPU specific. In most of the cases it's better to ignore it and log a message that it's not implemented. Signed-off-by: Sven Schnelle --- target/hppa/insns.decode | 3 +++ target/hppa/translate.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 55ff39dd05..098370c2f0 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -525,3 +525,6 @@ fmpy_d 001110 ..... ..... 010 ..... ... ..... = @f0e_d_3 fdiv_d 001110 ..... ..... 011 ..... ... ..... @f0e_d_3 =20 xmpyu 001110 ..... ..... 010 .0111 .00 t:5 r1=3D%ra64 r2=3D%r= b64 + +# diag +diag 000101 ----- ----- ---- ---- ---- ---- diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 7001c2eb80..441f0ea9d6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4292,3 +4292,9 @@ void restore_state_to_opc(CPUHPPAState *env, Translat= ionBlock *tb, that the instruction was not nullified. */ env->psw_n =3D 0; } + +static bool trans_diag(DisasContext *ctx, arg_diag *a) +{ + qemu_log_mask(LOG_UNIMP, "DIAG opcode ignored\n"); + return true; +} --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333137697613.6831854486198; Mon, 11 Mar 2019 12:38:57 -0700 (PDT) Received: from localhost ([127.0.0.1]:39143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3QlC-0003oy-L4 for importer@patchew.org; Mon, 11 Mar 2019 15:38:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qb0-00042z-5s for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007Wv-AN for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:42532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007V7-U7 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPF-0005b3-Iq; Mon, 11 Mar 2019 20:16:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=bR0VqSapsfo1dmyE7cHp+JGCkE910cVTz+MI7LCB+tI=; b=M29ijErufN2iIQgFqXreTFxa+J W+X7f+/0LXBvrp6rK1HIIiSii95j7y+rPo0uWIKjC9G6zQsPOn8KX9uBjrStrsTaFk5h7LiJzixtE 6HLUkCFVB/M3YuWEe8J77rGXVRrnytwDIlSpAj9R99xDAN1luX8gWR7UZBYYJCtnI98A=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:58 +0100 Message-Id: <20190311191602.25796-8-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 07/11] target/hppa: fix b,gate instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) b,gate does GR[t] =E2=86=90 cat(GR[t]{0..29},IAOQ_Front{30..31}); instead of saving the link address to register t. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 441f0ea9d6..a393a12252 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3464,6 +3464,7 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gat= e *a) } =20 #ifndef CONFIG_USER_ONLY + TCGv_reg tmp; if (ctx->tb_flags & PSW_C) { CPUHPPAState *env =3D ctx->cs->env_ptr; int type =3D hppa_artype_for_page(env, ctx->base.pc_next); @@ -3480,12 +3481,13 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_g= ate *a) if (type >=3D 4 && type - 4 < ctx->privilege) { dest =3D deposit32(dest, 0, 2, type - 4); } + tmp =3D dest_gpr(ctx, a->l); + tcg_gen_deposit_reg(tmp, tmp, cpu_iaoq_f, 0, 2); } else { dest &=3D -4; /* priv =3D 0 */ } #endif - - return do_dbranch(ctx, dest, a->l, a->n); + return do_dbranch(ctx, dest, 0, a->n); } =20 static bool trans_blr(DisasContext *ctx, arg_blr *a) --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333554032799.7613501230371; Mon, 11 Mar 2019 12:45:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:39298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qrs-0000sW-32 for importer@patchew.org; Mon, 11 Mar 2019 15:45:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qb0-0004H6-6I for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007WT-7P for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:41572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007Uy-UK for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPF-0005b3-TR; Mon, 11 Mar 2019 20:16:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=8BwF07kIQlkugKUGl8RwKfTU6CeTepNrx6k7+aaOu1o=; b=mZCu/GVz5s+029ECjNXL4qJepn +2NLiOIZT6B7pU5gSh/kqEzkFKFYz6dSsUx3KzHwvz6PGRbBQLx3565bUFCibxaC+mKPpPA5dnUpl 9cPVUnyR0BAUvfpVRR8fNgBqBPu0/aVAA3wCck1O80Bdz2KnTYBtKhkhzfu238QCyM5g=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:15:59 +0100 Message-Id: <20190311191602.25796-9-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 08/11] target/hppa: allow multiple itlbp without itlba X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The ODE software calls itlbp on existing TLB entries without calling itlba first, so this seems to be valid. Signed-off-by: Sven Schnelle --- target/hppa/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 26da953185..fc1b6a4fcd 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -277,7 +277,7 @@ void HELPER(itlbp)(CPUHPPAState *env, target_ulong addr= , target_ureg reg) { hppa_tlb_entry *ent =3D hppa_find_tlb(env, addr); =20 - if (unlikely(ent =3D=3D NULL || ent->entry_valid)) { + if (unlikely(ent =3D=3D NULL)) { qemu_log_mask(LOG_GUEST_ERROR, "ITLBP not following ITLBA\n"); return; } --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333065285851.466618628138; Mon, 11 Mar 2019 12:37:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:39139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qk2-0002qG-5A for importer@patchew.org; Mon, 11 Mar 2019 15:37:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qay-000408-AM for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007X3-As for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:60085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007VL-Q9 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPG-0005b3-7f; Mon, 11 Mar 2019 20:16:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=vE+RRaL7+7zHUE/ZfCoIuzJwuIq8Tffb7mWVZpnwh9k=; b=IlFCJEobHXMrqQQu+aVnSGDZHO SGWy+EjdcJAuiRtVABFCWBEWdEBRfPLW0HrbU+keUPIbg1NkwScodRJ9AWke5HxV/ujEzYwyW79e5 iktV5mZ/rguKMAa8H9JVxSBphUJaKZvGpfRrZcanJFcIYspTMeTzziVQozNp3oexbMLI=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:16:00 +0100 Message-Id: <20190311191602.25796-10-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 09/11] target/hppa: add TLB protection id check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Sven Schnelle --- target/hppa/cpu.h | 4 ++++ target/hppa/mem_helper.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 861bbb1f16..d808796ee3 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -143,6 +143,10 @@ #endif =20 #define CR_RC 0 +#define CR_PID1 8 +#define CR_PID2 9 +#define CR_PID3 12 +#define CR_PID4 13 #define CR_SCRCCR 10 #define CR_SAR 11 #define CR_IVA 14 diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index fc1b6a4fcd..a52d691d15 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -85,7 +85,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr ad= dr, int mmu_idx, int type, hwaddr *pphys, int *pprot) { hwaddr phys; - int prot, r_prot, w_prot, x_prot; + int prot, r_prot, w_prot, x_prot, wd; hppa_tlb_entry *ent; int ret =3D -1; =20 @@ -130,7 +130,31 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr= addr, int mmu_idx, break; } =20 - /* ??? Check PSW_P and ent->access_prot. This can remove PAGE_WRITE. = */ + /* access_id =3D=3D 0 means public page and no check is performed */ + if ((env->psw & PSW_P) && ent->access_id) { + wd =3D 1; + + if (ent->access_id =3D=3D (env->cr[CR_PID1] >> 1)) { + wd &=3D env->cr[CR_PID1]; + } + + if (ent->access_id =3D=3D (env->cr[CR_PID2] >> 1)) { + wd &=3D env->cr[CR_PID2]; + } + + if (ent->access_id =3D=3D (env->cr[CR_PID3] >> 1)) { + wd &=3D env->cr[CR_PID3]; + } + + if (ent->access_id =3D=3D (env->cr[CR_PID4] >> 1)) { + wd &=3D env->cr[CR_PID4]; + } + + if (wd && (type & w_prot)) { + ret =3D EXCP_DMPI; + goto egress; + } + } =20 /* No guest access type indicates a non-architectural access from within QEMU. Bypass checks for access, D, B and T bits. */ --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552333242067503.7130144009834; Mon, 11 Mar 2019 12:40:42 -0700 (PDT) Received: from localhost ([127.0.0.1]:39184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qmr-0005FU-2B for importer@patchew.org; Mon, 11 Mar 2019 15:40:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qay-0004Gr-Up for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPI-0007Wq-9m for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:17 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:60429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPH-0007VJ-Po for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:16 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPG-0005b3-I2; Mon, 11 Mar 2019 20:16:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=PVKznZTSjVTkTSAGY25xUpbDVWJc9ne1eMAWp5CBlF4=; b=IIDASj1Ht+c4VT4/OM37ge2sEa fCt+glm274LGaGu50faBfj2FIuSMA9MlHEIAbMchTnz8e0uMCgxYztcvRVHm4TyjCXvLzY9lyz8hk YBUhDE22YJVNzLaSCEjzSRnCqyR4nalQwvBUvmht0YGUdkxIWE7Wv+XvsABDnxE2mCfY=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:16:01 +0100 Message-Id: <20190311191602.25796-11-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 10/11] target/hppa: exit TB if either Data or Instruction TLB changes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The current code assumes that we don't need to exit the TB if a Data Cache Flush or Insert has happend. However, as we have a shared Data/Instruction TLB, a Data cache flush also flushes Instruction TLB entries, and a Data cache TLB insert might also evict a Instruction TLB entry. So exit the TB in all cases if Instruction translation is enabled. Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson --- target/hppa/translate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a393a12252..fcacff963e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2474,9 +2474,8 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlb= x *a) gen_helper_itlbp(cpu_env, addr, reg); } =20 - /* Exit TB for ITLB change if mmu is enabled. This *should* not be - the case, since the OS TLB fill handler runs with mmu disabled. */ - if (!a->data && (ctx->tb_flags & PSW_C)) { + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { ctx->base.is_jmp =3D DISAS_IAQ_N_STALE; } return nullify_end(ctx); @@ -2503,7 +2502,7 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlb= x *a) } =20 /* Exit TB for TLB change if mmu is enabled. */ - if (!a->data && (ctx->tb_flags & PSW_C)) { + if (ctx->tb_flags & PSW_C) { ctx->base.is_jmp =3D DISAS_IAQ_N_STALE; } return nullify_end(ctx); --=20 2.20.1 From nobody Mon Apr 29 13:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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 1552332875923497.17164656495277; Mon, 11 Mar 2019 12:34:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:39081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qgs-0008W8-Qo for importer@patchew.org; Mon, 11 Mar 2019 15:34:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Qaw-00042z-9e for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3QPT-0007gO-KQ for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:28 -0400 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:40483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3QPT-0007XF-Br for qemu-devel@nongnu.org; Mon, 11 Mar 2019 15:16:27 -0400 Received: from [134.3.47.207] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1h3QPG-0005b3-RS; Mon, 11 Mar 2019 20:16:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=FfvFQjNyq/aY/HU+gdul9HyhsrtSYu3iaRsYf95eGUs=; b=N2uZuM71SkmpuoJBDjKRVtX61y 9lx8HZ5U96ViyIWNxtAh9i8iszWCdVurVl37rpBdvpTUsV84iv2YvgEc1jvVUwv6tcCcopFXMCuFt 0344IMHXSiH3vtF25zAVseKluuWEBq69yuBCmie7/WgyxXL/z1LeJ95/ssI0HUCK3P3c=; From: Sven Schnelle To: Richard Henderson Date: Mon, 11 Mar 2019 20:16:02 +0100 Message-Id: <20190311191602.25796-12-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311191602.25796-1-svens@stackframe.org> References: <20190311191602.25796-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 11/11] target/hppa: call eval_interrupt() after ssm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" HP-UX (all versions) is losing timer interrupts, which leads to hangs. Pressing a key on the console fixes this, so it looks like QEMU is just looping trough TBs without checking for interrupts. Further investion showed that this happens when interrupts are triggered, without PSW_I enabled. Calling eval_interrupt() after PSW_I is set seems to fix this. Signed-off-by: Sven Schnelle --- target/hppa/cpu.h | 1 + target/hppa/int_helper.c | 2 +- target/hppa/op_helper.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index d808796ee3..3440ccad28 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -366,5 +366,6 @@ void hppa_cpu_alarm_timer(void *); int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr); #endif void QEMU_NORETURN hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_= t ra); +void eval_interrupt(HPPACPU *cpu); =20 #endif /* HPPA_CPU_H */ diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index 8d5edd3a20..e3acaa39eb 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -25,7 +25,7 @@ #include "qom/cpu.h" =20 #ifndef CONFIG_USER_ONLY -static void eval_interrupt(HPPACPU *cpu) +void eval_interrupt(HPPACPU *cpu) { CPUState *cs =3D CPU(cpu); if (cpu->env.cr[CR_EIRR] & cpu->env.cr[CR_EIEM]) { diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index a55a5dfc02..f93211c84f 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -662,6 +662,7 @@ void HELPER(reset)(CPUHPPAState *env) =20 target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) { + HPPACPU *cpu =3D hppa_env_get_cpu(env); target_ulong psw =3D env->psw; /* * Setting the PSW Q bit to 1, if it was not already 1, is an @@ -673,6 +674,11 @@ target_ureg HELPER(swap_system_mask)(CPUHPPAState *env= , target_ureg nsm) * so let this go without comment. */ env->psw =3D (psw & ~PSW_SM) | (nsm & PSW_SM); + if (!(psw & PSW_I) && (nsm & PSW_I)) { + qemu_mutex_lock_iothread(); + eval_interrupt(cpu); + qemu_mutex_unlock_iothread(); + } return psw & PSW_SM; } =20 --=20 2.20.1