From nobody Tue Feb 10 20:09:10 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674737628271566.9061658391512; Thu, 26 Jan 2023 04:53:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL1kO-0001xD-Fl; Thu, 26 Jan 2023 07:52:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL1kF-0001sT-R7 for qemu-devel@nongnu.org; Thu, 26 Jan 2023 07:52:50 -0500 Received: from mout.kundenserver.de ([217.72.192.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL1kA-00006x-9h for qemu-devel@nongnu.org; Thu, 26 Jan 2023 07:52:46 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MBE3k-1pWXoD44Le-00CjcE; Thu, 26 Jan 2023 13:52:36 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier Subject: [PATCH] m68k: fix 'bkpt' instruction in softmmu mode Date: Thu, 26 Jan 2023 13:52:34 +0100 Message-Id: <20230126125234.3186042-1-laurent@vivier.eu> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3+zB/cqYLIznoZjkOG8e0ZZRUnhis5b3nviAwodoiOrHI5p/Lcj UbX9OoPJUdNybSrh+YAPUubFqSm6chLcs6N9OO+hdYsFekVNtR/QToFGDiMHs+3/L1R9PB4 hSnxPa1Y7YJXSIQiot51PCQ5jYEs/tS6e/EzHx05B9XkvMh8hA3H46FPHC0PR5ygyNL0GfB gR9Oj0W6u8tXtgYn+sqhQ== UI-OutboundReport: notjunk:1;M01:P0:RsEO8Jk6YNY=;zG/V42vG0YkbPJzao7ujFBTgmSR rk6NKzhra+ktSqmQ1dpFsuTaQ9SQqaLaAvVNfFca16rGQ1ybLyZmfJUgXZJjw1Ra8TCAvUV9I 1NpzmHLYaQ4MMfmLwttbgyF46Nh1a+Uagg9su3Mhiy5JHyLnwDX6id6Q6HYImZnmvYncP+fib 77yznylb0vgDxBAgfQnPAM6SCcIutv9tphJOgo6UuBfnq0n3GubGFmIYhnRROQ4YxSJPXZ0xP Y1L0HZBZfGUGrlAGbn8cLFueVm/swz4F/ebkJxfT7EoNLuldt3m7KngdUpO6T+URmGOSCD6TT NgxPGb/UyXj6jon5li6SDsdI5zca8NWxfnpmFh8zzgAatY4qQqk54rlwGPqxcsLU8mU/lhCAM R7fXjThF5e3o7FBrfT7km/ki60NB0GtEvlRQg6pmOhJrBXON9FKKdBIe0Vcb+s0NCuSINqsom 87uAn3ysJ1/w6t+IYyBkcPFbaOvyt+8ZlE5i7Kqo5CM6tJZ1XF1cU88Yg5CxZcvxlAgcGiEiU mp6fzjS/Zwd9vyWp2NnIXtK5qNolZm55VKUQlocAGo/jH3Ciydi9ydvL4FBAjQkcY40NLlstX FyS2xdY+0qGQbNI4B0jL1B04UUOhPXoF6c85S9TuzSkA/dKQY/rtDTnhAyHnEogkBTvzO8Xyj ATJssrZGVDWhAxtxgYUdZ9bIPs0LukT9qedsYustcg== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1674737630295100003 Content-Type: text/plain; charset="utf-8" In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow QEMU gdb server to intercept and manage the operation with an external debugger. In softmmu mode, the instruction must generate an illegal instruction exception as it is on real hardware to be managed by the kernel. Buglink: https://gitlab.com/qemu-project/qemu/-/issues/146 Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 18418312b14b..31178c3b1d17 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -2774,7 +2774,11 @@ DISAS_INSN(swap) =20 DISAS_INSN(bkpt) { +#if defined(CONFIG_SOFTMMU) + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); +#else gen_exception(s, s->base.pc_next, EXCP_DEBUG); +#endif } =20 DISAS_INSN(pea) --=20 2.38.1