From patchwork Thu Jan 4 16:42:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 855718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCDMF5rLBz9t34 for ; Fri, 5 Jan 2018 03:50:49 +1100 (AEDT) Received: from localhost ([::1]:50014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eX8j9-0006XV-SG for incoming@patchwork.ozlabs.org; Thu, 04 Jan 2018 11:50:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eX8bb-0007Yu-H1 for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:43:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eX8bY-0003Wb-D0 for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:42:59 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:50937) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eX8bX-0003UX-Tz for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:42:56 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0McAjL-1eE6Jd1w1f-00JakK; Thu, 04 Jan 2018 17:42:54 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 4 Jan 2018 17:42:38 +0100 Message-Id: <20180104164251.26494-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180104164251.26494-1-laurent@vivier.eu> References: <20180104164251.26494-1-laurent@vivier.eu> X-Provags-ID: V03:K0:Er4OhhOkbGJBxI37RYR0LFtBrv0+prQBxDVpX50KaJV47EdpEFe lUvUcvOcswF9DOwEHhxbMPWcp53MsnKmIljvfPn8CpKrBbDUNFzjTlBtAUrriSFCDhC865s c4ol88CK2MTsf/r9rY8LnEG55+Pl0ijDc2J2z2YI7abQ3mmMQ7OGVGcosZsEDzRItM6dPbF azD57W9k/5cVmXLYl+IoA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kMrWIutodUg=:bOHpFLE44tskBX8Eo+l2ba WtPHTsaJCAGOHlJ8Tbu12PWzSIQ3wStsYLNKPYn/cx9Eg0iH5cUNm683xj8ft5lZr6OcUMFOw OMnmKhnZ0OI9I9tsY+4eVyUJ5XxRrWUbQNMsW5uzHnAWMAZzg6Dk8B0hs6TxpI4FM3Ngo+DsF VfO54AvqkRuiaqNpl3vHdHEzQ85v1MTYXxGPMBkooCWFbmKxfVQdS9vs0HbjcHnnhMMv3jzrZ xbofOygeHMJL+8lvpvkjinBmV7HaYxA8a8KqBYsZsjpLjCt8h25ZAbALLsAVqbkZX7E4ci8g+ Rr59dBGgkSTrbipqOWl1/LhLpNh8HTq5sOKdnfY+Zwo1hqHoWdyWVDsSmg3VHA11O7FY0Ll/N vSMeX/yzSjtBkTiGm8GmXBZF0H29+cIVEpS1vcFvpv/JMKg0pRwdfIPR5kBuaSOfg6fBElRwK 41u4+Hus/KRT/n8T67udkyNZPvHnar5Cxs1djLbzDUBS5SRsnSSUULIzLEAcJO8In9ePMpydI ixmVpxPB66HSmi5TGxB68UMONcZgM0xWudvp9B9hviZYa+irMl9w93bPmwrK/p8nr9GeRMI1z gLzjUkAgX1Jhfva8gHbWW9xXEovFOM48cIhc1gBG7FjZKp+mxEPzYqwC1srEaKvn71qjVucCo q/r80cvIou6gw13HkvCyAkhnxQX0+Rmvel5hHv/pqsw7zxCn07FAErFBNKfNVz4rGTmJ1siYg qdb7miOaPWzmxnV7HbPP5maKb1Abt2kzWSIjp5MdGx9+Qu9ajGC/FTMkqOs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL 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: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <20180104012913.30763-5-laurent@vivier.eu> --- 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) DISAS_INSN(undef_mac) { - gen_exception(s, s->pc - 2, EXCP_LINEA); + gen_exception(s, s->insn_pc, EXCP_LINEA); } DISAS_INSN(undef_fpu) { - gen_exception(s, s->pc - 2, EXCP_LINEF); + gen_exception(s, s->insn_pc, EXCP_LINEF); } 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); } DISAS_INSN(mulw) @@ -2583,7 +2583,7 @@ DISAS_INSN(swap) DISAS_INSN(bkpt) { - gen_exception(s, s->pc - 2, EXCP_DEBUG); + gen_exception(s, s->insn_pc, EXCP_DEBUG); } DISAS_INSN(pea) @@ -2636,7 +2636,7 @@ DISAS_INSN(pulse) DISAS_INSN(illegal) { - gen_exception(s, s->pc - 2, EXCP_ILLEGAL); + gen_exception(s, s->insn_pc, EXCP_ILLEGAL); } /* ??? This should be atomic. */ @@ -2666,7 +2666,7 @@ DISAS_INSN(mull) 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; } @@ -4240,7 +4240,7 @@ DISAS_INSN(move_from_sr) TCGv sr; 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 = 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; if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } @@ -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); } DISAS_INSN(movec) @@ -4313,7 +4313,7 @@ DISAS_INSN(movec) TCGv reg; if (IS_USER(s)) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); return; } @@ -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) DISAS_INSN(wddata) { - gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); + gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); } DISAS_INSN(wdebug) @@ -4356,7 +4356,7 @@ DISAS_INSN(wdebug) M68kCPU *cpu = m68k_env_get_cpu(env); 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) DISAS_INSN(trap) { - gen_exception(s, s->pc - 2, EXCP_TRAP0 + (insn & 0xf)); + gen_exception(s, s->insn_pc, EXCP_TRAP0 + (insn & 0xf)); } static void gen_load_fcr(DisasContext *s, TCGv res, int reg)