From nobody Tue Oct 28 12:14:03 2025 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.zohomail.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 1514856021501172.61858870080607; Mon, 1 Jan 2018 17:20:21 -0800 (PST) Received: from localhost ([::1]:50836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWBFc-00008j-BJ for importer@patchew.org; Mon, 01 Jan 2018 20:20:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWB6I-0001W4-SU for qemu-devel@nongnu.org; Mon, 01 Jan 2018 20:10:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWB6F-00052a-91 for qemu-devel@nongnu.org; Mon, 01 Jan 2018 20:10:42 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:56374) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWB6E-00051V-Up for qemu-devel@nongnu.org; Mon, 01 Jan 2018 20:10:39 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LnGL0-1f7xcw2XsM-00hiA9; Tue, 02 Jan 2018 02:10:36 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 2 Jan 2018 02:10:19 +0100 Message-Id: <20180102011032.30056-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180102011032.30056-1-laurent@vivier.eu> References: <20180102011032.30056-1-laurent@vivier.eu> X-Provags-ID: V03:K0:MbEOOPbrT531CBmCWbA2Y2hyxx6xuQit7bXFyt6NCIoAyHgf+ju K5KHzRxuNUnFORdtKHafuVlFl28MVooJR2eoxgFSmT5wO6fhLhxWlEiE9wzRtCgLgyVdtFL ifWszlhj8c6BoFryaE0QHAc/qC5pRJ2EC74iaum8vyvQ0I4r4I7elX7WF/IoK5btDvaFW/c IDX466ghwt5NI45pmq3Ag== X-UI-Out-Filterresults: notjunk:1;V01:K0:eTPgZ/nNksg=:K+gf0BOb759su/o/m2SFjC 3JJbjJ3x3qkrIsTxBi59gSuF6HmUzHc5bD3X54qHl0BeBVwTCamwMSngpR0WYlQoxJUt4UZPt 2WQ5rwwuIrlWNGL01muHSZaOEA3/z4c4g6YUjmkBIEOHCjxv48x66r+BqcPJOyM4lGgtiHn5+ +nkklZcvoq8OiiSZymBnBhmIEZj8/BY3AXQfsAf8xbICZJCMftQO1sTFO8J13yXLpzRbBNNSD gSSfDXO2go+o5gw1nNiXXYmbUP8PDk5Oo7mnYTl6QzJ878GU7inO3aczjEZOE7m3QHYIxPzJO UWH6324qe5q66f3zorX+JpMUEGZXpyJ0pNRll9sP89w4lHC+5SN7X226KZTkD8kdq9+FizVcN mM0orxiC0Hk7Xw/g9KUC/44NvicJNE04SMPOsI1RkxWWtvqq+0LeN0AjgJ2fMTlEB9Y5pJvTi AMMr0/EB8ofY7zqwvxwu9Y5v3+5JnpbbLEZtISgxKAG9ChJWunENN2nsRWQ7RFCPNmvdIplhM yHrgXqvJot/r4MbPjryL+WhbmymWkGXYc9LCnXZXIa1UGAH5L9Qv9WxbjydMO4VPaboojkr45 neVaZZb3xdW7eaHw0i0Z+5StR+QFddR2MkwuZrIMo5WE+Ee2FYdRyMFGM2W01EFg0eaACsGkc AxUTvCarGx33FjM3uK6jNHgBGzm6T6PvK9oWZIx2KY1LW2zuWt/3dsOAOBJL9BsHfcqrWLLzj zQIPFVMWgsbZ1SLjahUVPOsyGNIrS8pUcUTeHQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PATCH v5 04/17] target-m68k: use insn_pc to generate instruction fault address 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: Thomas Huth , Laurent Vivier 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/translate.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 1e9fb01252..a1e424e3db 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1509,12 +1509,12 @@ DISAS_INSN(dbcc) =20 DISAS_INSN(undef_mac) { - gen_exception(s, s->pc - 2, EXCP_LINEA); + gen_exception(s, s->insn_pc, EXCP_LINEA); } =20 DISAS_INSN(undef_fpu) { - gen_exception(s, s->pc - 2, EXCP_LINEF); + gen_exception(s, s->insn_pc, EXCP_LINEF); } =20 DISAS_INSN(undef) @@ -1523,8 +1523,8 @@ DISAS_INSN(undef) for the 680x0 series, as well as those that are implemented but actually illegal for CPU32 or pre-68020. */ qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x", - insn, s->pc - 2); - gen_exception(s, s->pc - 2, EXCP_UNSUPPORTED); + insn, s->insn_pc); + gen_exception(s, s->insn_pc, EXCP_UNSUPPORTED); } =20 DISAS_INSN(mulw) @@ -2583,7 +2583,7 @@ DISAS_INSN(swap) =20 DISAS_INSN(bkpt) { - gen_exception(s, s->pc - 2, EXCP_DEBUG); + gen_exception(s, s->insn_pc, EXCP_DEBUG); } =20 DISAS_INSN(pea) @@ -2636,7 +2636,7 @@ DISAS_INSN(pulse) =20 DISAS_INSN(illegal) { - gen_exception(s, s->pc - 2, EXCP_ILLEGAL); + gen_exception(s, s->insn_pc, EXCP_ILLEGAL); } =20 /* ??? This should be atomic. */ @@ -2666,7 +2666,7 @@ DISAS_INSN(mull) =20 if (ext & 0x400) { if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { - gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED); + gen_exception(s, s->insn_pc, EXCP_UNSUPPORTED); return; } =20 @@ -4240,7 +4240,7 @@ DISAS_INSN(move_from_sr) TCGv sr; =20 if (IS_USER(s) && !m68k_feature(env, M68K_FEATURE_M68000)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } sr =3D gen_get_sr(s); @@ -4250,7 +4250,7 @@ DISAS_INSN(move_from_sr) DISAS_INSN(move_to_sr) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } gen_set_sr(env, s, insn, 0); @@ -4260,7 +4260,7 @@ DISAS_INSN(move_to_sr) DISAS_INSN(move_from_usp) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } tcg_gen_ld_i32(AREG(insn, 0), cpu_env, @@ -4270,7 +4270,7 @@ DISAS_INSN(move_from_usp) DISAS_INSN(move_to_usp) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } tcg_gen_st_i32(AREG(insn, 0), cpu_env, @@ -4287,7 +4287,7 @@ DISAS_INSN(stop) uint16_t ext; =20 if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } =20 @@ -4301,10 +4301,10 @@ DISAS_INSN(stop) DISAS_INSN(rte) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } - gen_exception(s, s->pc - 2, EXCP_RTE); + gen_exception(s, s->insn_pc, EXCP_RTE); } =20 DISAS_INSN(movec) @@ -4313,7 +4313,7 @@ DISAS_INSN(movec) TCGv reg; =20 if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } =20 @@ -4331,7 +4331,7 @@ DISAS_INSN(movec) DISAS_INSN(intouch) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } /* ICache fetch. Implement as no-op. */ @@ -4340,7 +4340,7 @@ DISAS_INSN(intouch) DISAS_INSN(cpushl) { if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } /* Cache push/invalidate. Implement as no-op. */ @@ -4348,7 +4348,7 @@ DISAS_INSN(cpushl) =20 DISAS_INSN(wddata) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); } =20 DISAS_INSN(wdebug) @@ -4356,7 +4356,7 @@ DISAS_INSN(wdebug) M68kCPU *cpu =3D m68k_env_get_cpu(env); =20 if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } /* TODO: Implement wdebug. */ @@ -4365,7 +4365,7 @@ DISAS_INSN(wdebug) =20 DISAS_INSN(trap) { - gen_exception(s, s->pc - 2, EXCP_TRAP0 + (insn & 0xf)); + gen_exception(s, s->insn_pc, EXCP_TRAP0 + (insn & 0xf)); } =20 static void gen_load_fcr(DisasContext *s, TCGv res, int reg) --=20 2.14.3