From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015244328455.0835905644781; Mon, 20 Mar 2017 06:07:24 -0700 (PDT) Received: from localhost ([::1]:32906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx1v-0008Jn-5O for importer@patchew.org; Mon, 20 Mar 2017 09:07:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvW-0003vM-Js for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvS-00070f-Kl for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:46 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:51890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvS-0006yc-Es for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:42 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 863777532DFB1; Mon, 20 Mar 2017 13:00:35 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:38 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:17 +0000 Message-ID: <1490014826-4472-2-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 01/10] target-mips: fix compiler warnings (clang 5) 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 static code analyzer complain: target/mips/helper.c:453:5: warning: Function call argument is an uninitial= ized value qemu_log_mask(CPU_LOG_MMU, ^~~~~~~~~~~~~~~~~~~~~~~~~~ 'physical' and 'prot' are uninitialized if 'ret' is not TLBRET_MATCH. Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- target/mips/helper.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/target/mips/helper.c b/target/mips/helper.c index d2e7795..e359ca3 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -450,10 +450,18 @@ int mips_cpu_handle_mmu_fault(CPUState *cs, vaddr add= ress, int rw, access_type =3D ACCESS_INT; ret =3D get_physical_address(env, &physical, &prot, address, rw, access_type); - qemu_log_mask(CPU_LOG_MMU, - "%s address=3D%" VADDR_PRIx " ret %d physical " TARGET_FMT_plx - " prot %d\n", - __func__, address, ret, physical, prot); + switch (ret) { + case TLBRET_MATCH: + qemu_log_mask(CPU_LOG_MMU, + "%s address=3D%" VADDR_PRIx " physical " TARGET_FMT_= plx + " prot %d\n", __func__, address, physical, prot); + break; + default: + qemu_log_mask(CPU_LOG_MMU, + "%s address=3D%" VADDR_PRIx " ret %d\n", __func__, a= ddress, + ret); + break; + } if (ret =3D=3D TLBRET_MATCH) { tlb_set_page(cs, address & TARGET_PAGE_MASK, physical & TARGET_PAGE_MASK, prot | PAGE_EXEC, --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015067333352.57609681362123; Mon, 20 Mar 2017 06:04:27 -0700 (PDT) Received: from localhost ([::1]:32888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwz4-0005nk-3a for importer@patchew.org; Mon, 20 Mar 2017 09:04:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0003uk-OS for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvS-00070J-8o for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:1624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvS-0006z0-2W for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:42 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 20B59879FEDEF; Mon, 20 Mar 2017 13:00:36 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:38 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:18 +0000 Message-ID: <1490014826-4472-3-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 02/10] target-mips: remove old & unuseful comments 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- target/mips/translate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 8b4a072..1fe0ff3 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -5137,7 +5137,6 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int= reg, int sel) // gen_helper_mfc0_contextconfig(arg); /* SmartMIPS ASE */ rn =3D "ContextConfig"; goto cp0_unimplemented; -// break; case 2: CP0_CHECK(ctx->ulri); tcg_gen_ld32s_tl(arg, cpu_env, @@ -5791,7 +5790,6 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int= reg, int sel) // gen_helper_mtc0_contextconfig(cpu_env, arg); /* SmartMIPS AS= E */ rn =3D "ContextConfig"; goto cp0_unimplemented; -// break; case 2: CP0_CHECK(ctx->ulri); tcg_gen_st_tl(arg, cpu_env, @@ -6454,7 +6452,6 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) // gen_helper_dmfc0_contextconfig(arg); /* SmartMIPS ASE */ rn =3D "ContextConfig"; goto cp0_unimplemented; -// break; case 2: CP0_CHECK(ctx->ulri); tcg_gen_ld_tl(arg, cpu_env, @@ -7092,7 +7089,6 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) // gen_helper_mtc0_contextconfig(cpu_env, arg); /* SmartMIPS ASE= */ rn =3D "ContextConfig"; goto cp0_unimplemented; -// break; case 2: CP0_CHECK(ctx->ulri); tcg_gen_st_tl(arg, cpu_env, --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490014961728244.4568843747794; Mon, 20 Mar 2017 06:02:41 -0700 (PDT) Received: from localhost ([::1]:32868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwxM-0004Pc-Ae for importer@patchew.org; Mon, 20 Mar 2017 09:02:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvb-0003yN-HR for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvV-00072B-D5 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:51 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:26502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0006zK-7z for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id AD2B013DCC847; Mon, 20 Mar 2017 13:00:36 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:39 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:19 +0000 Message-ID: <1490014826-4472-4-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 03/10] target-mips: log bad coprocessor0 register accesses with LOG_UNIMP 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- target/mips/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 1fe0ff3..5c030a9 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -4872,7 +4872,7 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) return; =20 cp0_unimplemented: - LOG_DISAS("mfhc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "mfhc0 %s (reg %d sel %d)\n", rn, reg, sel); tcg_gen_movi_tl(arg, 0); } =20 @@ -4944,7 +4944,7 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) =20 (void)rn; /* avoid a compiler warning */ cp0_unimplemented: - LOG_DISAS("mthc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "mthc0 %s (reg %d sel %d)\n", rn, reg, sel); } =20 static inline void gen_mfc0_unimplemented(DisasContext *ctx, TCGv arg) @@ -5627,7 +5627,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int= reg, int sel) return; =20 cp0_unimplemented: - LOG_DISAS("mfc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "mfc0 %s (reg %d sel %d)\n", rn, reg, sel); gen_mfc0_unimplemented(ctx, arg); } =20 @@ -6294,7 +6294,7 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int= reg, int sel) return; =20 cp0_unimplemented: - LOG_DISAS("mtc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "mtc0 %s (reg %d sel %d)\n", rn, reg, sel); } =20 #if defined(TARGET_MIPS64) @@ -6928,7 +6928,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) return; =20 cp0_unimplemented: - LOG_DISAS("dmfc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "dmfc0 %s (reg %d sel %d)\n", rn, reg, sel); gen_mfc0_unimplemented(ctx, arg); } =20 @@ -7593,7 +7593,7 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) return; =20 cp0_unimplemented: - LOG_DISAS("dmtc0 %s (reg %d sel %d)\n", rn, reg, sel); + qemu_log_mask(LOG_UNIMP, "dmtc0 %s (reg %d sel %d)\n", rn, reg, sel); } #endif /* TARGET_MIPS64 */ =20 --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015213393270.7175207195927; Mon, 20 Mar 2017 06:06:53 -0700 (PDT) Received: from localhost ([::1]:32904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx1P-0007w5-Ig for importer@patchew.org; Mon, 20 Mar 2017 09:06:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0003ui-O8 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvT-00071G-A0 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:36224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvT-00070o-04 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:43 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 47390BFAE265B; Mon, 20 Mar 2017 13:00:37 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:40 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:20 +0000 Message-ID: <1490014826-4472-5-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 04/10] target-mips: replace break by goto cp0_unimplemented 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 this fixes many warnings like: target/mips/translate.c:6253:13: warning: Value stored to 'rn' is never read rn =3D "invalid sel"; ^ ~~~~~~~~~~~~~ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- target/mips/translate.c | 88 ++++++++++++++++++++++++---------------------= ---- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 5c030a9..fc11e15 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -5458,19 +5458,19 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, i= nt reg, int sel) case 1: // gen_helper_mfc0_tracecontrol(arg); /* PDtrace support */ rn =3D "TraceControl"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mfc0_tracecontrol2(arg); /* PDtrace support */ rn =3D "TraceControl2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_mfc0_usertracedata(arg); /* PDtrace support */ rn =3D "UserTraceData"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mfc0_tracebpc(arg); /* PDtrace support */ rn =3D "TraceBPC"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -5496,31 +5496,31 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, i= nt reg, int sel) case 1: // gen_helper_mfc0_performance1(arg); rn =3D "Performance1"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mfc0_performance2(arg); rn =3D "Performance2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_mfc0_performance3(arg); rn =3D "Performance3"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mfc0_performance4(arg); rn =3D "Performance4"; -// break; + goto cp0_unimplemented; case 5: // gen_helper_mfc0_performance5(arg); rn =3D "Performance5"; -// break; + goto cp0_unimplemented; case 6: // gen_helper_mfc0_performance6(arg); rn =3D "Performance6"; -// break; + goto cp0_unimplemented; case 7: // gen_helper_mfc0_performance7(arg); rn =3D "Performance7"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -6116,13 +6116,13 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, i= nt reg, int sel) rn =3D "TraceControl"; /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mtc0_tracecontrol2(cpu_env, arg); /* PDtrace supp= ort */ rn =3D "TraceControl2"; /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; -// break; + goto cp0_unimplemented; case 3: /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; @@ -6130,13 +6130,13 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, i= nt reg, int sel) rn =3D "UserTraceData"; /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mtc0_tracebpc(cpu_env, arg); /* PDtrace support */ /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; rn =3D "TraceBPC"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -6161,31 +6161,31 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, i= nt reg, int sel) case 1: // gen_helper_mtc0_performance1(arg); rn =3D "Performance1"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mtc0_performance2(arg); rn =3D "Performance2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_mtc0_performance3(arg); rn =3D "Performance3"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mtc0_performance4(arg); rn =3D "Performance4"; -// break; + goto cp0_unimplemented; case 5: // gen_helper_mtc0_performance5(arg); rn =3D "Performance5"; -// break; + goto cp0_unimplemented; case 6: // gen_helper_mtc0_performance6(arg); rn =3D "Performance6"; -// break; + goto cp0_unimplemented; case 7: // gen_helper_mtc0_performance7(arg); rn =3D "Performance7"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -6766,19 +6766,19 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, = int reg, int sel) case 1: // gen_helper_dmfc0_tracecontrol(arg, cpu_env); /* PDtrace supp= ort */ rn =3D "TraceControl"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_dmfc0_tracecontrol2(arg, cpu_env); /* PDtrace sup= port */ rn =3D "TraceControl2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_dmfc0_usertracedata(arg, cpu_env); /* PDtrace sup= port */ rn =3D "UserTraceData"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_dmfc0_tracebpc(arg, cpu_env); /* PDtrace support = */ rn =3D "TraceBPC"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -6803,31 +6803,31 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, = int reg, int sel) case 1: // gen_helper_dmfc0_performance1(arg); rn =3D "Performance1"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_dmfc0_performance2(arg); rn =3D "Performance2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_dmfc0_performance3(arg); rn =3D "Performance3"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_dmfc0_performance4(arg); rn =3D "Performance4"; -// break; + goto cp0_unimplemented; case 5: // gen_helper_dmfc0_performance5(arg); rn =3D "Performance5"; -// break; + goto cp0_unimplemented; case 6: // gen_helper_dmfc0_performance6(arg); rn =3D "Performance6"; -// break; + goto cp0_unimplemented; case 7: // gen_helper_dmfc0_performance7(arg); rn =3D "Performance7"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -7417,25 +7417,25 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, = int reg, int sel) /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; rn =3D "TraceControl"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mtc0_tracecontrol2(cpu_env, arg); /* PDtrace supp= ort */ /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; rn =3D "TraceControl2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_mtc0_usertracedata(cpu_env, arg); /* PDtrace supp= ort */ /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; rn =3D "UserTraceData"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mtc0_tracebpc(cpu_env, arg); /* PDtrace support */ /* Stop translation as we may have switched the execution mode= */ ctx->bstate =3D BS_STOP; rn =3D "TraceBPC"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } @@ -7460,31 +7460,31 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, = int reg, int sel) case 1: // gen_helper_mtc0_performance1(cpu_env, arg); rn =3D "Performance1"; -// break; + goto cp0_unimplemented; case 2: // gen_helper_mtc0_performance2(cpu_env, arg); rn =3D "Performance2"; -// break; + goto cp0_unimplemented; case 3: // gen_helper_mtc0_performance3(cpu_env, arg); rn =3D "Performance3"; -// break; + goto cp0_unimplemented; case 4: // gen_helper_mtc0_performance4(cpu_env, arg); rn =3D "Performance4"; -// break; + goto cp0_unimplemented; case 5: // gen_helper_mtc0_performance5(cpu_env, arg); rn =3D "Performance5"; -// break; + goto cp0_unimplemented; case 6: // gen_helper_mtc0_performance6(cpu_env, arg); rn =3D "Performance6"; -// break; + goto cp0_unimplemented; case 7: // gen_helper_mtc0_performance7(cpu_env, arg); rn =3D "Performance7"; -// break; + goto cp0_unimplemented; default: goto cp0_unimplemented; } --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015110694601.5960801870281; Mon, 20 Mar 2017 06:05:10 -0700 (PDT) Received: from localhost ([::1]:32890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwzl-0006Oo-8x for importer@patchew.org; Mon, 20 Mar 2017 09:05:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0003uf-N1 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvS-00070z-Uc for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:46339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvS-00070W-M3 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:42 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id BDABB9FA0E1C5; Mon, 20 Mar 2017 13:00:37 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:40 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:21 +0000 Message-ID: <1490014826-4472-6-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 05/10] target-mips: replace few LOG_DISAS() with trace points 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- Makefile.objs | 1 + target/mips/trace-events | 5 +++++ target/mips/translate.c | 25 +++++++++++-------------- 3 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 target/mips/trace-events diff --git a/Makefile.objs b/Makefile.objs index e740500..6167e7b 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -157,6 +157,7 @@ trace-events-subdirs +=3D audio trace-events-subdirs +=3D net trace-events-subdirs +=3D target/arm trace-events-subdirs +=3D target/i386 +trace-events-subdirs +=3D target/mips trace-events-subdirs +=3D target/sparc trace-events-subdirs +=3D target/s390x trace-events-subdirs +=3D target/ppc diff --git a/target/mips/trace-events b/target/mips/trace-events new file mode 100644 index 0000000..4382408 --- /dev/null +++ b/target/mips/trace-events @@ -0,0 +1,5 @@ +# See docs/tracing.txt for syntax documentation. + +# target/mips/translate.c +mips_translate_c0(const char *instr, const char *rn, int reg, int sel) "%s= %s (reg %d sel %d)" +mips_translate_tr(const char *instr, int rt, int u, int sel, int h) "%s (r= eg %d u %d sel %d h %d)" diff --git a/target/mips/translate.c b/target/mips/translate.c index fc11e15..78b7264 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -33,6 +33,7 @@ #include "sysemu/kvm.h" #include "exec/semihost.h" =20 +#include "target/mips/trace.h" #include "trace-tcg.h" #include "exec/log.h" =20 @@ -4866,9 +4867,7 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) default: goto cp0_unimplemented; } - - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mfhc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mfhc0", rn, reg, sel); return; =20 cp0_unimplemented: @@ -4941,8 +4940,8 @@ static void gen_mthc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) default: goto cp0_unimplemented; } + trace_mips_translate_c0("mthc0", rn, reg, sel); =20 - (void)rn; /* avoid a compiler warning */ cp0_unimplemented: qemu_log_mask(LOG_UNIMP, "mthc0 %s (reg %d sel %d)\n", rn, reg, sel); } @@ -5622,8 +5621,7 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int= reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mfc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mfc0", rn, reg, sel); return; =20 cp0_unimplemented: @@ -6284,8 +6282,8 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int= reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("mtc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("mtc0", rn, reg, sel); + /* For simplicity assume that all writes can cause interrupts. */ if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); @@ -6923,8 +6921,7 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("dmfc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("dmfc0", rn, reg, sel); return; =20 cp0_unimplemented: @@ -7583,8 +7580,8 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, in= t reg, int sel) default: goto cp0_unimplemented; } - (void)rn; /* avoid a compiler warning */ - LOG_DISAS("dmtc0 %s (reg %d sel %d)\n", rn, reg, sel); + trace_mips_translate_c0("dmtc0", rn, reg, sel); + /* For simplicity assume that all writes can cause interrupts. */ if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); @@ -7803,7 +7800,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext = *ctx, int rt, int rd, default: goto die; } - LOG_DISAS("mftr (reg %d u %d sel %d h %d)\n", rt, u, sel, h); + trace_mips_translate_tr("mftr", rt, u, sel, h); gen_store_gpr(t0, rd); tcg_temp_free(t0); return; @@ -8008,7 +8005,7 @@ static void gen_mttr(CPUMIPSState *env, DisasContext = *ctx, int rd, int rt, default: goto die; } - LOG_DISAS("mttr (reg %d u %d sel %d h %d)\n", rd, u, sel, h); + trace_mips_translate_tr("mttr", rd, u, sel, h); tcg_temp_free(t0); return; =20 --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015243470974.5925222746398; Mon, 20 Mar 2017 06:07:23 -0700 (PDT) Received: from localhost ([::1]:32905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx1u-0008Iz-3n for importer@patchew.org; Mon, 20 Mar 2017 09:07:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvW-0003va-Tc for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvS-00070t-SU for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:47 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:59221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvS-00070a-Mx for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:42 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 5E9DE64595B23 for ; Mon, 20 Mar 2017 13:00:38 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:41 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:22 +0000 Message-ID: <1490014826-4472-7-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 06/10] target/mips: fix delay slot detection in gen_msa_branch() 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is unnecessary to test R6 from delay/forbidden slot check in gen_msa_branch(). https://bugs.launchpad.net/qemu/+bug/1663287 Reported-by: Brian Campbell Signed-off-by: Yongbok Kim --- target/mips/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 78b7264..3022f34 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -18162,7 +18162,7 @@ static void gen_msa_branch(CPUMIPSState *env, Disas= Context *ctx, uint32_t op1) =20 check_msa_access(ctx); =20 - if (ctx->insn_flags & ISA_MIPS32R6 && ctx->hflags & MIPS_HFLAG_BMASK) { + if (ctx->hflags & MIPS_HFLAG_BMASK) { generate_exception_end(ctx, EXCP_RI); return; } --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490014960341108.00206290874632; Mon, 20 Mar 2017 06:02:40 -0700 (PDT) Received: from localhost ([::1]:32867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwxK-0004PY-Ub for importer@patchew.org; Mon, 20 Mar 2017 09:02:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvZ-0003wy-9i for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvT-00071M-Bc for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:49 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:28683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvT-000715-5c for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:43 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id D2C0DE9C6D6CB; Mon, 20 Mar 2017 13:00:38 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:41 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:23 +0000 Message-ID: <1490014826-4472-8-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 07/10] dma: rc4030: limit interval timer reload value 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: Prasad J Pandit Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit The JAZZ RC4030 chipset emulator has a periodic timer and associated interval reload register. The reload value is used as divider when computing timer's next tick value. If reload value is large, it could lead to divide by zero error. Limit the interval reload value to avoid it. Reported-by: Huawei PSIRT Signed-off-by: Prasad J Pandit Tested-by: Herv=C3=A9 Poussineau Signed-off-by: Yongbok Kim --- hw/dma/rc4030.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 17c8518..41fc043 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -460,7 +460,7 @@ static void rc4030_write(void *opaque, hwaddr addr, uin= t64_t data, break; /* Interval timer reload */ case 0x0228: - s->itr =3D val; + s->itr =3D val & 0x01FF; qemu_irq_lower(s->timer_irq); set_next_tick(s); break; --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015336135957.5788386598324; Mon, 20 Mar 2017 06:08:56 -0700 (PDT) Received: from localhost ([::1]:32912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx3O-000138-Re for importer@patchew.org; Mon, 20 Mar 2017 09:08:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvX-0003vw-7h for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvV-00072G-Dy for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:47 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:52026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-00071u-5F for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 749FF6AF80DC7; Mon, 20 Mar 2017 13:00:39 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:42 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:24 +0000 Message-ID: <1490014826-4472-9-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 08/10] dma/rc4030: translate memory accesses only when they occur 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: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Herv=C3=A9 Poussineau This simplifies the code a lot, and this fixes big memory leaks introduced in a3d586f704609a45b6037534cb2f34da5dfd8895 Windows NT is now able to boot without using gigabytes of ram on the host. Signed-off-by: Herv=C3=A9 Poussineau Reviewed-by: Yongbok Kim Signed-off-by: Yongbok Kim --- hw/dma/rc4030.c | 158 +++++++++++++---------------------------------------= ---- 1 file changed, 36 insertions(+), 122 deletions(-) diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 41fc043..5f10b9d 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -34,8 +34,6 @@ /********************************************************/ /* rc4030 emulation */ =20 -#define MAX_TL_ENTRIES 512 - typedef struct dma_pagetable_entry { int32_t frame; int32_t owner; @@ -91,14 +89,8 @@ typedef struct rc4030State qemu_irq timer_irq; qemu_irq jazz_bus_irq; =20 - /* biggest translation table */ - MemoryRegion dma_tt; - /* translation table memory region alias, added to system RAM */ - MemoryRegion dma_tt_alias; /* whole DMA memory region, root of DMA address space */ MemoryRegion dma_mr; - /* translation table entry aliases, added to DMA memory region */ - MemoryRegion dma_mrs[MAX_TL_ENTRIES]; AddressSpace dma_as; =20 MemoryRegion iomem_chipset; @@ -256,96 +248,6 @@ static uint64_t rc4030_read(void *opaque, hwaddr addr,= unsigned int size) return val; } =20 -static void rc4030_dma_as_update_one(rc4030State *s, int index, uint32_t f= rame) -{ - if (index < MAX_TL_ENTRIES) { - memory_region_set_enabled(&s->dma_mrs[index], false); - } - - if (!frame) { - return; - } - - if (index >=3D MAX_TL_ENTRIES) { - qemu_log_mask(LOG_UNIMP, - "rc4030: trying to use too high " - "translation table entry %d (max allowed=3D%d)", - index, MAX_TL_ENTRIES); - return; - } - memory_region_set_alias_offset(&s->dma_mrs[index], frame); - memory_region_set_enabled(&s->dma_mrs[index], true); -} - -static void rc4030_dma_tt_write(void *opaque, hwaddr addr, uint64_t data, - unsigned int size) -{ - rc4030State *s =3D opaque; - - /* write memory */ - memcpy(memory_region_get_ram_ptr(&s->dma_tt) + addr, &data, size); - - /* update dma address space (only if frame field has been written) */ - if (addr % sizeof(dma_pagetable_entry) =3D=3D 0) { - int index =3D addr / sizeof(dma_pagetable_entry); - memory_region_transaction_begin(); - rc4030_dma_as_update_one(s, index, (uint32_t)data); - memory_region_transaction_commit(); - } -} - -static const MemoryRegionOps rc4030_dma_tt_ops =3D { - .write =3D rc4030_dma_tt_write, - .impl.min_access_size =3D 4, - .impl.max_access_size =3D 4, -}; - -static void rc4030_dma_tt_update(rc4030State *s, uint32_t new_tl_base, - uint32_t new_tl_limit) -{ - int entries, i; - dma_pagetable_entry *dma_tl_contents; - - if (s->dma_tl_limit) { - /* write old dma tl table to physical memory */ - memory_region_del_subregion(get_system_memory(), &s->dma_tt_alias); - cpu_physical_memory_write(s->dma_tl_limit & 0x7fffffff, - memory_region_get_ram_ptr(&s->dma_tt), - memory_region_size(&s->dma_tt_alias)); - } - object_unparent(OBJECT(&s->dma_tt_alias)); - - s->dma_tl_base =3D new_tl_base; - s->dma_tl_limit =3D new_tl_limit; - new_tl_base &=3D 0x7fffffff; - - if (s->dma_tl_limit) { - uint64_t dma_tt_size; - if (s->dma_tl_limit <=3D memory_region_size(&s->dma_tt)) { - dma_tt_size =3D s->dma_tl_limit; - } else { - dma_tt_size =3D memory_region_size(&s->dma_tt); - } - memory_region_init_alias(&s->dma_tt_alias, OBJECT(s), - "dma-table-alias", - &s->dma_tt, 0, dma_tt_size); - dma_tl_contents =3D memory_region_get_ram_ptr(&s->dma_tt); - cpu_physical_memory_read(new_tl_base, dma_tl_contents, dma_tt_size= ); - - memory_region_transaction_begin(); - entries =3D dma_tt_size / sizeof(dma_pagetable_entry); - for (i =3D 0; i < entries; i++) { - rc4030_dma_as_update_one(s, i, dma_tl_contents[i].frame); - } - memory_region_add_subregion(get_system_memory(), new_tl_base, - &s->dma_tt_alias); - memory_region_transaction_commit(); - } else { - memory_region_init(&s->dma_tt_alias, OBJECT(s), - "dma-table-alias", 0); - } -} - static void rc4030_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { @@ -362,11 +264,11 @@ static void rc4030_write(void *opaque, hwaddr addr, u= int64_t data, break; /* DMA transl. table base */ case 0x0018: - rc4030_dma_tt_update(s, val, s->dma_tl_limit); + s->dma_tl_base =3D val; break; /* DMA transl. table limit */ case 0x0020: - rc4030_dma_tt_update(s, s->dma_tl_base, val); + s->dma_tl_limit =3D val; break; /* DMA transl. table invalidated */ case 0x0028: @@ -586,6 +488,38 @@ static const MemoryRegionOps jazzio_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 +static IOMMUTLBEntry rc4030_dma_translate(MemoryRegion *iommu, hwaddr addr, + bool is_write) +{ + rc4030State *s =3D container_of(iommu, rc4030State, dma_mr); + IOMMUTLBEntry ret =3D { + .target_as =3D &address_space_memory, + .iova =3D addr & ~(DMA_PAGESIZE - 1), + .translated_addr =3D 0, + .addr_mask =3D DMA_PAGESIZE - 1, + .perm =3D IOMMU_NONE, + }; + uint64_t i, entry_address; + dma_pagetable_entry entry; + + i =3D addr / DMA_PAGESIZE; + if (i < s->dma_tl_limit / sizeof(entry)) { + entry_address =3D (s->dma_tl_base & 0x7fffffff) + i * sizeof(entry= ); + if (address_space_read(ret.target_as, entry_address, + MEMTXATTRS_UNSPECIFIED, (unsigned char *)&e= ntry, + sizeof(entry)) =3D=3D MEMTX_OK) { + ret.translated_addr =3D entry.frame & ~(DMA_PAGESIZE - 1); + ret.perm =3D IOMMU_RW; + } + } + + return ret; +} + +static const MemoryRegionIOMMUOps rc4030_dma_ops =3D { + .translate =3D rc4030_dma_translate, +}; + static void rc4030_reset(DeviceState *dev) { rc4030State *s =3D RC4030(dev); @@ -596,7 +530,6 @@ static void rc4030_reset(DeviceState *dev) s->invalid_address_register =3D 0; =20 memset(s->dma_regs, 0, sizeof(s->dma_regs)); - rc4030_dma_tt_update(s, 0, 0); =20 s->remote_failed_address =3D s->memory_failed_address =3D 0; s->cache_maint =3D 0; @@ -735,7 +668,6 @@ static void rc4030_realize(DeviceState *dev, Error **er= rp) { rc4030State *s =3D RC4030(dev); Object *o =3D OBJECT(dev); - int i; =20 s->periodic_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, rc4030_periodic_timer, s); @@ -745,37 +677,19 @@ static void rc4030_realize(DeviceState *dev, Error **= errp) memory_region_init_io(&s->iomem_jazzio, NULL, &jazzio_ops, s, "rc4030.jazzio", 0x00001000); =20 - memory_region_init_rom_device(&s->dma_tt, o, - &rc4030_dma_tt_ops, s, "dma-table", - MAX_TL_ENTRIES * sizeof(dma_pagetable_en= try), - NULL); - memory_region_init(&s->dma_tt_alias, o, "dma-table-alias", 0); - memory_region_init(&s->dma_mr, o, "dma", INT32_MAX); - for (i =3D 0; i < MAX_TL_ENTRIES; ++i) { - memory_region_init_alias(&s->dma_mrs[i], o, "dma-alias", - get_system_memory(), 0, DMA_PAGESIZE); - memory_region_set_enabled(&s->dma_mrs[i], false); - memory_region_add_subregion(&s->dma_mr, i * DMA_PAGESIZE, - &s->dma_mrs[i]); - } + memory_region_init_iommu(&s->dma_mr, o, &rc4030_dma_ops, + "rc4030.dma", UINT32_MAX); address_space_init(&s->dma_as, &s->dma_mr, "rc4030-dma"); } =20 static void rc4030_unrealize(DeviceState *dev, Error **errp) { rc4030State *s =3D RC4030(dev); - int i; =20 timer_free(s->periodic_timer); =20 address_space_destroy(&s->dma_as); - object_unparent(OBJECT(&s->dma_tt)); - object_unparent(OBJECT(&s->dma_tt_alias)); object_unparent(OBJECT(&s->dma_mr)); - for (i =3D 0; i < MAX_TL_ENTRIES; ++i) { - memory_region_del_subregion(&s->dma_mr, &s->dma_mrs[i]); - object_unparent(OBJECT(&s->dma_mrs[i])); - } } =20 static void rc4030_class_init(ObjectClass *klass, void *class_data) --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015362695454.8529394428033; Mon, 20 Mar 2017 06:09:22 -0700 (PDT) Received: from localhost ([::1]:32915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx3p-0001Pa-F2 for importer@patchew.org; Mon, 20 Mar 2017 09:09:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvV-0003uh-ON for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvU-00071f-A0 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:59221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvU-00070a-3g for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:44 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 0EE59110D882B for ; Mon, 20 Mar 2017 13:00:40 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:42 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:25 +0000 Message-ID: <1490014826-4472-10-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 09/10] dma/rc4030: fix a mixed declarations and code warning 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Yongbok Kim Reviewed-by: Herv=C3=A9 Poussineau --- hw/dma/rc4030.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 5f10b9d..0080141 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -99,8 +99,8 @@ typedef struct rc4030State =20 static void set_next_tick(rc4030State *s) { - qemu_irq_lower(s->timer_irq); uint32_t tm_hz; + qemu_irq_lower(s->timer_irq); =20 tm_hz =3D 1000 / (s->itr + 1); =20 --=20 2.7.4 From nobody Sun Apr 28 22:47:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490015442690872.6595756979638; Mon, 20 Mar 2017 06:10:42 -0700 (PDT) Received: from localhost ([::1]:32928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpx56-0002aO-EG for importer@patchew.org; Mon, 20 Mar 2017 09:10:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvb-0003yE-DH for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpwvV-000721-3u for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:51 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:59221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpwvU-00070a-V9 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 09:00:45 -0400 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id CCBAA5E32C367 for ; Mon, 20 Mar 2017 13:00:40 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 20 Mar 2017 13:00:43 +0000 From: Yongbok Kim To: QEMU Developers Date: Mon, 20 Mar 2017 13:00:26 +0000 Message-ID: <1490014826-4472-11-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> References: <1490014826-4472-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL for v2.9 10/10] MAINTAINERS: update for MIPS devices 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: Paul Burton Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add myself to MIPSSIM and new entry for Fulong 2E. Add an entry for Boston machine (Paul Burton). cc: Paul Burton Signed-off-by: Yongbok Kim Reviewed-by: Thomas Huth --- MAINTAINERS | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index bf1aafb..779c429 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -600,15 +600,28 @@ S: Maintained F: hw/mips/mips_malta.c =20 Mipssim -L: qemu-devel@nongnu.org -S: Orphan +M: Yongbok Kim +S: Odd Fixes F: hw/mips/mips_mipssim.c +F: hw/net/mipsnet.c =20 R4000 M: Aurelien Jarno S: Maintained F: hw/mips/mips_r4k.c =20 +Fulong 2E +M: Yongbok Kim +S: Odd Fixes +F: hw/mips/mips_fulong2e.c + +Boston +M: Paul Burton +S: Maintained +F: hw/core/loader-fit.c +F: hw/mips/boston.c +F: hw/pci-host/xilinx-pcie.c + OpenRISC Machines ----------------- or1k-sim --=20 2.7.4