From patchwork Tue Oct 30 16:55:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 990975 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kyKs2c3Pz9s3T for ; Wed, 31 Oct 2018 03:56:33 +1100 (AEDT) Received: from localhost ([::1]:54467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHXJe-00026s-K4 for incoming@patchwork.ozlabs.org; Tue, 30 Oct 2018 12:56:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHXJF-00025r-IC for qemu-devel@nongnu.org; Tue, 30 Oct 2018 12:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHXJB-0000s2-Er for qemu-devel@nongnu.org; Tue, 30 Oct 2018 12:56:05 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:51217) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHXJA-0000pv-Vs for qemu-devel@nongnu.org; Tue, 30 Oct 2018 12:56:01 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MJEIl-1fyck80v5n-00KgP6; Tue, 30 Oct 2018 17:55:59 +0100 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MJEIl-1fyck80v5n-00KgP6; Tue, 30 Oct 2018 17:55:59 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 17:55:54 +0100 Message-Id: <20181030165554.5761-1-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 X-Provags-ID: V03:K1:YNxKJULqIo5k8OCvYMfYI5E1IsNn9zRKU71plWTPl375TBni+VE nHbuQqOzOXhpQvvOf9lSkyDXPs5eebhQHYc9oyZvsdHYkDLeiy3Bq5gJJW0lC9ln8yXA2BX 3fEhhT1j4O7oE9JAaS9sgKVV/n1XowrjO8c9zZDF+xqAbsJoVGF79MUB5g5jZKmam58SLQj C+5HbFbDl6taSEpFycAnQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:cQz8xoo5fr8=:1+cBJgkQFxt5jhevhwU7Pr TTJYNXFm2NEBP2BHFP6AzrcyXQ0r2KLA0hh8oEhENsPVoIQAP86cOSJENgoujFqQ3GP5zYeit BIdrXsErmC4mjgxE+qaK1Ay6ok//HrsAgajKIAEObxznnv1U6Uri8ioQ2pMtlFsfIQJu101jH +M+9ebeTXcMB/Tx8BNYLnYgL9K4LgoAHYkYCac7+PTtrGa7IzY3L58Ee7YpaF4EzkGXDsqUHM B8RFvPoHm9Iack2xyS3GnQSGxvkoFXany+so1M/kX63qEOxwV/QY7JwbrNIyicCiAr8AZqSLY B3stxue6CjZnqZfb0LdPgoIwKOq8jmK3o0CUkXKP0rjwHso5XYq2I6BATUEAB12UZCaGcpt4+ VpoOyx+X8htXdRLyXDIQs0d1GaRb+B2owNmyK/wQSXrRqkDzNbuBydwMPYoHDSsJ853D+0EJv JJ3waNvnx0B4L05QHwbmq3Brq7wkvD9wtRiPVkEg6/1Pyk5/hNSEJqi6B10WbJNjf2nU+wfVZ V0d7PBu6OyhikNWDiKG3kHyCoauque0/YThf6a4V+ytqsQVVse0pZSbTQg+ZD2cZhvlrvN229 JR+Tfu/tTgcn7F7Nh4gHbF2nwopV7EeedEq9wiAThMfJ4JYjd9jmgsbcMO+7uOr4U0C+Sez/D seCb4bkbzbfELp9xL69cEYBPgZHX9ZOSL7+xKg/+ACb6VPfJHkyD+pGw4dngKEZU9+y06lYYt SiKqq9UZALBkWpOZyl+XyxaQVut5KltDgwTsfHPfXCdmMKclUSaf5s/aPTye6dpUKEzYzw7Km A4jrhM/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PATCH] 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: Mark Cave-Ayland , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 = TARGET_SIGILL; info.si_errno = 0; diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 45e87deaef..d3980e5b9a 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 #define EXCP_RTE 0x100 #define EXCP_HALT_INSN 0x101 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 795c88e52f..3a00ac36b4 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1552,7 +1552,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); } DISAS_INSN(mulw) @@ -2799,7 +2799,7 @@ DISAS_INSN(mull) 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; } @@ -4509,7 +4509,7 @@ DISAS_INSN(strldsr) addr = s->pc - 2; ext = read_im16(env, s); if (ext != 0x46FC) { - gen_exception(s, addr, EXCP_UNSUPPORTED); + gen_exception(s, addr, EXCP_ILLEGAL); return; } ext = read_im16(env, s);