From nobody Sat May 4 21:48:48 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.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541072359030451.765399485492; Thu, 1 Nov 2018 04:39:19 -0700 (PDT) Received: from localhost ([::1]:41522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIBJg-0003Jc-Qr for importer@patchew.org; Thu, 01 Nov 2018 07:39:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIBI6-0002HD-Lu for qemu-devel@nongnu.org; Thu, 01 Nov 2018 07:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIBI2-0003g8-Td for qemu-devel@nongnu.org; Thu, 01 Nov 2018 07:37:34 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:34513) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIBI0-0003da-Qo for qemu-devel@nongnu.org; Thu, 01 Nov 2018 07:37:29 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MWAWq-1g29lJ3Rfu-00Xdo5; Thu, 01 Nov 2018 12:37:24 +0100 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MWAWq-1g29lJ3Rfu-00Xdo5; Thu, 01 Nov 2018 12:37:24 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 1 Nov 2018 12:37:11 +0100 Message-Id: <20181101113711.28074-2-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181101113711.28074-1-laurent@vivier.eu> References: <20181101113711.28074-1-laurent@vivier.eu> X-Provags-ID: V03:K1:vQgBD4R+diUOel0bEvpj16wATQjPp22VEqb46yA/hdP1QN6WsXv tUZ082eKddaneTXSTP7iIuF0hBxXtUHSpqisARnZb9qTtfCB72JQpi3cI5arOQledPo0jiS k9P57O7jRdbE2JHmD6vDIj+MEFt6AqkEhjPMRaG1lIW9y0LEgdh8ujuMPAMXjJLHsrRhU99 OqnyiHuWgpEmKCxHzM2/Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:qjKzlrH9Kd4=:ldKPQv8oeIjip8GshUrSPd 4teFPbWSY+JJgCP0SYvw09595/imDjRMzzgyKI2oSPKJH2MmVx9njrJL8QV16WzQeawPFU5/K kNrLFcR7Uit6iF2QqtbZgru1ETh6GBvRXa6Lc0ANKbiq6UmeHSmul2Z+RivJkA6Zav4hQhYSO ekPRBSNxtXLnwWcQpaTBXtMVSf75rL15jXFfqMt0ZUTc0r4LN0qBSowJzkMUfHEiD0N87zi+d E+4cRuJJbOumuEK6ty5dIJNeQSsTIVqV68HCJrAV6VGwEKyNjSIs3BZXoS6jkCERK00IMB6fP 2V5d85QUugMbTo/wxJOX+JQ0F8t9cun6cHvaUIAOS+jnEtA+xkEzMckvCY15jvsqjzpbOvXcv lcGNUAVP8K7QHsi5RlEYKUFTPe88/mcUSk9+baHIVpgXIhMV7vsHlbVLVhqqtoMA1dbuRrcPP MRSXuDBcE7kFEJ4Xnefkv5YbPMRitPZKBjzsaSccvDw8KKd6HBWu+D2EwbetZhXBU4BZHrpeg 8v6ywdzF+K3rGv8vvqTyMpp5ZMN1hk8QNVz16CyZTL4v+/SDIMv7p4BnKV0kK1s8/btGmQEtj s2pvuLUV1yzUis63yl1/vaWnAu4H1D/XqwEv+VYhNAm7l7AsPFQEIE7NnuOfINhz81aIMdmFU dKFyax+muZQdcJ+/Jqc4b7Yq65wpDk0dY/KMObdEGvp0ob4Mjdxa5OjnhOdvjFUNNEMnIZh97 Ho+W9Vs3YZfJEHFe2D7Wke4vS69kFh19JQxL2Unr3TZgkGuY5TTZwntixC3h7JtvWru+kEcDy hT4TRqM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 1/1] target/m68k: use EXCP_ILLEGAL instead of EXCP_UNSUPPORTED 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Coldfire defines an "Unsupported instruction" exception if execution of a valid instruction is attempted but the required hardware is not present in the processor. We use it with instructions that are in fact undefined or illegal, and the exception expected in this case by the kernel is the illegal exception, so this patch fixes that. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <20181030165554.5761-1-laurent@vivier.eu> --- linux-user/m68k/cpu_loop.c | 1 - target/m68k/cpu.h | 1 - target/m68k/translate.c | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index b4d3d8af3d..30c3332af4 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -55,7 +55,6 @@ void cpu_loop(CPUM68KState *env) break; case EXCP_LINEA: case EXCP_LINEF: - case EXCP_UNSUPPORTED: do_sigill: info.si_signo =3D TARGET_SIGILL; info.si_errno =3D 0; diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index c63adf772f..b288a3864e 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -70,7 +70,6 @@ #define EXCP_MMU_CONF 56 /* MMU Configuration Error */ #define EXCP_MMU_ILLEGAL 57 /* MMU Illegal Operation Error */ #define EXCP_MMU_ACCESS 58 /* MMU Access Level Violation Error */ -#define EXCP_UNSUPPORTED 61 =20 #define EXCP_RTE 0x100 #define EXCP_HALT_INSN 0x101 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index ae3651b867..752e46ef63 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1553,7 +1553,7 @@ DISAS_INSN(undef) but actually illegal for CPU32 or pre-68020. */ qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x\n", insn, s->base.pc_next); - gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); } =20 DISAS_INSN(mulw) @@ -2800,7 +2800,7 @@ DISAS_INSN(mull) =20 if (ext & 0x400) { if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { - gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } =20 @@ -4510,7 +4510,7 @@ DISAS_INSN(strldsr) addr =3D s->pc - 2; ext =3D read_im16(env, s); if (ext !=3D 0x46FC) { - gen_exception(s, addr, EXCP_UNSUPPORTED); + gen_exception(s, addr, EXCP_ILLEGAL); return; } ext =3D read_im16(env, s); --=20 2.17.2