From nobody Sun Apr 6 22:11:17 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=flygoat.com ARC-Seal: i=1; a=rsa-sha256; t=1735469553; cv=none; d=zohomail.com; s=zohoarc; b=k5l7JPMjU2mayHQqth/Zq1NMjqvosgQWtuxEguxDZGaL5938mmY+IAyqEfZm9X7ZZpN1w6S1BVQLI2Gl1UEGHH442WNDM2Qi0Q2jlbMmrqsUoTT2Lvn9FJovohmuUSlzmKlIRhkmpg+CcI9W7y9NhJZc9ZX328lDyWXD6w+xTd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735469553; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lA+lTMH9Oard6euYIiKDcVpojDs24JntMN83hdsQ7BI=; b=IsSkTNSWDVB+NKTX5vOV7MFwXFFdf9kmmURWRXFJy5woBFDpGTlZBAIx1U0F/Nn7H3dlS02VKuBJfnX8RcL/0W8QzobGVUffnkoLed811NiywaXikKa4k+ehhc3PefsDtBDJxelUE3NE2dcaC3J6C2u7PduwalYdbtz9XnvUnqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1735469553796333.1332573031517; Sun, 29 Dec 2024 02:52:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRqts-0006eN-Oi; Sun, 29 Dec 2024 05:52:00 -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 1tRqtr-0006eB-Ct; Sun, 29 Dec 2024 05:51:59 -0500 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRqtp-0006QF-I0; Sun, 29 Dec 2024 05:51:59 -0500 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 2561813801DF; Sun, 29 Dec 2024 05:51:56 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Sun, 29 Dec 2024 05:51:56 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Dec 2024 05:51:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1735469516; x=1735555916; bh=lA +lTMH9Oard6euYIiKDcVpojDs24JntMN83hdsQ7BI=; b=PuOJ8TIVGf638Msx5N 9HldeBHp7EJ6qP0pMAHLdGGShlJjfM9HGNtPZkc/Td3hevs7kGXux2+6Gv66CPvH 29X4jpRR8yLmTELE6ZcQ6fftsrl8HKswsLlpe7S+c5cv73Wg4HV46bA0atqFV5IA Nrb2nMozAq1faxwH/KEns51IZbwPU3J5we4qon9IazKIN4Txfv2BW+CMEU03b1kj 4CiggperigtC4gG3w0ZAhnc5ZaTJUayPKTv6YDo8n6AfZWrhrdkq05+h1dzMgb9Z lTEADovV/+OcXkvX94Gca2dLiW0vPUrEP1gmC7DqquNrfFrPNPT30wlkvdsggPiP G46w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1735469516; x=1735555916; bh=lA+lTMH9Oard6euYIiKDcVpojDs2 4JntMN83hdsQ7BI=; b=tJ11O3p2av598Nuldxlf3sXBroq0S4Vb/rILl9UP3cns CDZETVTRlbHK7hTD0FIPyjCaWQWQA9dTjLCGOzy8bkzzatJxJvinFdfFY6YLadhq ngq2ojfBhkXUaJUY39r7f6k0cIdSJipdU3L3Y+mv4Y96JbFYPtOXgba36QGLK5bk CcvxLVAKpQ7LRgpIQtr100qKTp6Z1eGfdMXWvZXKKunhiJ9CnRgn07pahbIi1Ru9 9uppk8sqPa4RwaqGgZRMvv/cvq3ZJsVAiPBo9B+5Yg9xeqsq/VXSRrq3bLPGdN9m ORpeIEF7QCJ7Ya6Wmdj59RKHnZw01ywFDGrV28MyrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkffvvefosehtjeertdertdejnecu hfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgoh grthdrtghomheqnecuggftrfgrthhtvghrnhephfffgeejgfejieeugffgudegvdekffev geeuteetgeejveeiteeivedvffehlefgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgr gihunhdrhigrnhhgsehflhihghhorghtrdgtohhmpdhnsggprhgtphhtthhopeehpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhhonhhgnhhu rdhorhhgpdhrtghpthhtoheplhgruhhrvghnthesvhhivhhivghrrdgvuhdprhgtphhtth hopehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmpdhrtghpthhtoheprhhi tghhrghrugdrhhgvnhguvghrshhonheslhhinhgrrhhordhorhhgpdhrtghpthhtohepqh gvmhhuqdhsthgrsghlvgesnhhonhhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ifd894703:Fastmail From: Jiaxun Yang Date: Sun, 29 Dec 2024 10:51:54 +0000 Subject: [PATCH v2] target/m68k: Handle EXCP_SEMIHOSTING for m68k class CPU MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241229-m68k-semihosting-v2-1-8a08b2d199a5@flygoat.com> X-B4-Tracking: v=1; b=H4sIAMkpcWcC/32NQQ6CMBBFr0JmbY0zRQKuvIdhAWWgEy01LWkkh LtbOYDL95L//gaRg3CEW7FB4CRR/JyBTgUY280TKxkyA12oRKJGuap+qshOrI+LzJMiUzamrgb N2kCevQOP8jmSjzazlbj4sB4PCX/2TyyhQjX0qJGpvxLSfXytk++Ws/EO2n3fv3f/r6yyAAAA X-Change-ID: 20241229-m68k-semihosting-2c49c86d3e3c To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , qemu-stable@nongnu.org, Jiaxun Yang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1902; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=6/7auNXlC38Th9tx0PeuJ+H4vruFPeAeFr5ygMCAadw=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhvRCzdNCh5P1+T8unenrfT9N/fGZE66c8rPfnC+IEzoxM 02oR6Wzo5SFQYyLQVZMkSVEQKlvQ+PFBdcfZP2BmcPKBDKEgYtTACYS2MjwV+b9H24BizfWKwKs XyVvj580v/7sudOt3XxfstJfXQ56LsTIcKbx4NbEq89fKcYu0irr/ZR3uqNxgwKXavidnfU/L1j 94AcA X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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: pass client-ip=103.168.172.150; envelope-from=jiaxun.yang@flygoat.com; helo=fout-a7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-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-ZohoMail-DKIM: pass (identity @flygoat.com) X-ZM-MESSAGEID: 1735469556422116600 EXCP_SEMIHOSTING can be generated by m68k class CPU with HALT instruction, but it is never handled properly and cause guest fall into deadlock. Moving EXCE_SEMIHOSTING handling code to common do_interrupt_all routine to ensure it's handled for both CPU classes. Fixes: f161e723fdfd ("target/m68k: Perform the semihosting test during tran= slate") Cc: qemu-stable@nongnu.org Signed-off-by: Jiaxun Yang --- Changes in v2: - hoist both calls to do_interrupt_all (Richard) - Link to v1: https://lore.kernel.org/r/20241229-m68k-semihosting-v1-1-db13= 1e2b5212@flygoat.com --- target/m68k/op_helper.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 15bad5dd46518c6e86b6273d4a2b26b3b6f991de..9dd76f540b4871d3d0ab0e95747= c85434e5d677d 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -202,9 +202,6 @@ static void cf_interrupt_all(CPUM68KState *env, int is_= hw) /* Return from an exception. */ cf_rte(env); return; - case EXCP_SEMIHOSTING: - do_m68k_semihosting(env, env->dregs[0]); - return; } } =20 @@ -422,6 +419,15 @@ static void m68k_interrupt_all(CPUM68KState *env, int = is_hw) =20 static void do_interrupt_all(CPUM68KState *env, int is_hw) { + CPUState *cs =3D env_cpu(env); + + if (!is_hw) { + switch (cs->exception_index) { + case EXCP_SEMIHOSTING: + do_m68k_semihosting(env, env->dregs[0]); + return; + } + } if (m68k_feature(env, M68K_FEATURE_M68K)) { m68k_interrupt_all(env, is_hw); return; --- base-commit: 2b7a80e07a29074530a0ebc8005a418ee07b1faf change-id: 20241229-m68k-semihosting-2c49c86d3e3c Best regards, --=20 Jiaxun Yang