From nobody Tue Oct 28 12:15:22 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 1514936760086212.86912011203185; Tue, 2 Jan 2018 15:46:00 -0800 (PST) Received: from localhost ([::1]:59616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWWFr-0002RJ-8b for importer@patchew.org; Tue, 02 Jan 2018 18:45:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWWBL-00071g-Dm for qemu-devel@nongnu.org; Tue, 02 Jan 2018 18:41:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWWBK-00035t-6z for qemu-devel@nongnu.org; Tue, 02 Jan 2018 18:41:19 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:51465) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWWBJ-00035O-S1 for qemu-devel@nongnu.org; Tue, 02 Jan 2018 18:41:18 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LaHLm-1fBw0r1J1i-00m1oB; Wed, 03 Jan 2018 00:41:15 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 3 Jan 2018 00:40:55 +0100 Message-Id: <20180102234108.32713-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180102234108.32713-1-laurent@vivier.eu> References: <20180102234108.32713-1-laurent@vivier.eu> X-Provags-ID: V03:K0:cb1ChOpqTjVLmWzX93jDdobev5JcRH3M3GXkZHec+t/h7AM/Y9N X+Uu05/Ys8juciADqQE1DMpxxYHHeIr7KlOX6H6Y2TSmW18d/ywAVIosyR1JjhYqpHEkTRF we88NT7hMbl3pCplwdSSvx7e4EpObycL9BqrYNeSu1rNm5l8kuKOMiH4Uhlei+6VjQolQUV qfR+levWD8w9OK6yOBKsg== X-UI-Out-Filterresults: notjunk:1;V01:K0:pQpnc/+j+is=:GsfpFgYmFisfhGWhPrvt9s lWNuevEMFT84FX2RfIMaXAOIeAO+xSghMTTiZOBbkUCCuuTiSKCvGv3A5LvY7ARPn407IjVPY bcsUUc9gN2PnIdTfOKFpkibUWhsD1pPxNMXkGqrs6o3aXeoKdBiiuzWj+cZf1DohKYIFTcRh8 PIhSRlfsDiZyLIjOEOa2/k5sX6SRFMREi/wfbtTK5a4Lb0t+PpdZtg/CSZmZR6opQsuCrqHTS x03MKRp7BG8IjYvkF9STfU1NCd6Fn23XD58AxHFGJclMOXyFuMJUJqDOs2N/6yDSUoTkJLxu2 91m6vJT0vG0hOzG2mUXdmSmONpeEdL2OyeQEG/B8pAyzO3Y2UCyunro9uwn4mGPaWLl5TQk+V XlybgEZEI+sP1P3U15TTUayahgX0BODr6RyyqNCiweSZ1vW+bDpJeKEIpJYPf8zxf6tquT3o8 iuBuJRDUAKqeuhk5ciZN/9pgxGdupT648HG8Y4p2x+/gU81LpfopgnpSRGJRo4OhwlAqlXD3z iPDhQsqCoSBx8QsSBSltmGd8iyi9aYx9MnL/OzMybbLOOm/VZthyX4Re5hO1yPdCufIzverdI mGnSGHA6qjyWKj1AAul1RM0AmunmPBsWvkBKj6nap195jMMgqOyzAtfAE2G8pxwD0tsFPH8Lh TUmnZWQ9pmoOY3xE/J//GrSxxOOt1SCBOC+zInQmnAHmEjGcejp+DERYVEHYW8Q05ABr/e7Z+ rx387MXb3Ut/VvQrgbUyupzZNpIlSpNDlhoM5A== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PATCH v6 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 , Richard Henderson , 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