From nobody Fri Nov 14 18:21:22 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 ARC-Seal: i=1; a=rsa-sha256; t=1760887072; cv=none; d=zohomail.com; s=zohoarc; b=Zfqd4Wo+s+3O3mibwgVgclgg/dTZGIrvrA6pLuRPXHwdhOVb4XAHjDSGsh+DIwq9bqA0MIKQdMAPoYmxwUIzXYRJwEXOVRKsE28hWLJLwBUdwDz14AFv5z8j0IPGqZYTre/gJM5UmKJWXJukHoRu7Nvj2tVCBTFnWUfzAnqILTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760887072; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MdX4/q2U7jR2ZTXKlAX920Uyz3pkiNfzBlqq8ZZlLbs=; b=i0IgWZuZ0WPzNpomy96ba1y0/UtqbFawAOMDSy7Cc81sLQI9bHmqtcpsjJLf7gjVh9uZ+LK/XGW5XoFOVAKdwSf/bn7o3auYZ7P95V2UaRD0dL1pl4WG8PkaboEMVFp47QDPakHBr95wQu0ki5REIPNYgJF9t3GEliEoixhdeKc= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760887072874142.91896284781592; Sun, 19 Oct 2025 08:17:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAV9K-0001zq-4h; Sun, 19 Oct 2025 11:16:46 -0400 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 1vAV9I-0001zg-QC for qemu-devel@nongnu.org; Sun, 19 Oct 2025 11:16:45 -0400 Received: from mailgate01.uberspace.is ([95.143.172.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vAV9G-0003Cg-0w for qemu-devel@nongnu.org; Sun, 19 Oct 2025 11:16:44 -0400 Received: from skiff.uberspace.de (skiff.uberspace.de [185.26.156.131]) by mailgate01.uberspace.is (Postfix) with ESMTPS id E1BD060A6C for ; Sun, 19 Oct 2025 17:16:40 +0200 (CEST) Received: (qmail 23263 invoked by uid 990); 19 Oct 2025 15:16:40 -0000 Received: from unknown (HELO unkown) (::1) by skiff.uberspace.de (Haraka/3.0.1) with ESMTPSA; Sun, 19 Oct 2025 17:16:38 +0200 Authentication-Results: skiff.uberspace.de; auth=pass (plain) From: Julian Ganz To: qemu-devel@nongnu.org Cc: Julian Ganz , "Edgar E. Iglesias" Subject: [PATCH v8 12/25] target/microblaze: call plugin trap callbacks Date: Sun, 19 Oct 2025 17:15:01 +0200 Message-ID: X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Bar: ----- X-Rspamd-Report: REPLY(-4) BAYES_HAM(-2.999978) MID_CONTAINS_FROM(1) MIME_GOOD(-0.1) R_MISSING_CHARSET(0.5) X-Rspamd-Score: -5.599978 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nut.email; s=uberspace; h=from:to:cc:subject:date; bh=qFu9MLqW24ZlXSD3Zd1xUyLRQOBol5YAEs1kPkA8RhI=; b=ZshoWq5yrMWVn12vhJxruBbNP01KdAaZPhcVE2qHXcKQ/pwqItXNSJYh4pDi6bfs2EhYcVGhtq apXqgSE7l1OAjnD51bjJsixnsu11dMfbs0O5zFgtW7sYQXRqpHxwtAomfk1CXORWUpRR5L2RekRg mwbvu3w9UtG1nTGNiR4tpX12YB/+QPorePAUw+ba5ilhgRX1bq9buFIiEra+8g1nOBJ4G3HhC9Qq JIEi0QN7CuK7CeV+CLxNz1LOnd5PnW+1bTwozpppzfa4ex9f7KNnyZa8p1kpAhqYuVr178iqX8fG 7WvAonch/wF91/hEPvamr8j32EAs+ZoXy04wLCGmMOdr2ut7tLZLVCJMDxOulwHxQzDAHLwL49X+ j3F0FQikVfshp00Se03gp4jGb9BSg6o/aVUCJ30NgPomYzyR1quqkzr7EChKFPfLnOqHI+fe1+jz mHYefJDAGwfStzb3cmTXrUnyV7ZY5VqMwafl4osPFI3JbzeVfPj/6hzS5I3E60j3zwzjK/8Phdgo SihlyO8DxGH0w0MIHtfseBaLil2qtnYz0UXRalKdJDuvEg+CuogL7Q55jyxpjXkhwS02wu1XOmdl 0e/rLwT6URZ7a+fWYw2JrqsGf4LppZWihEfx39WYkcN8UI9GVIcPsvNDh+kMivs4KGObphij/+Ki U= 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=95.143.172.20; envelope-from=neither@nut.email; helo=mailgate01.uberspace.is X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=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 @nut.email) X-ZM-MESSAGEID: 1760887074549154100 Content-Type: text/plain; charset="utf-8" We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for MicroBlaze targets. This architecture has one special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/helper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index cf577a7226..a1857b7217 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -27,6 +27,7 @@ #include "qemu/host-utils.h" #include "exec/log.h" #include "exec/helper-proto.h" +#include "qemu/plugin.h" =20 =20 G_NORETURN @@ -35,6 +36,7 @@ static void mb_unaligned_access_internal(CPUState *cs, ui= nt64_t addr, { CPUMBState *env =3D cpu_env(cs); uint32_t esr, iflags; + uint64_t last_pc =3D env->pc; =20 /* Recover the pc and iflags from the corresponding insn_start. */ cpu_restore_state(cs, retaddr); @@ -54,6 +56,7 @@ static void mb_unaligned_access_internal(CPUState *cs, ui= nt64_t addr, env->ear =3D addr; env->esr =3D esr; cs->exception_index =3D EXCP_HW_EXCP; + qemu_plugin_vcpu_exception_cb(cs, last_pc); cpu_loop_exit(cs); } =20 @@ -152,6 +155,7 @@ void mb_cpu_do_interrupt(CPUState *cs) CPUMBState *env =3D &cpu->env; uint32_t t, msr =3D mb_cpu_read_msr(env); bool set_esr; + uint64_t last_pc =3D env->pc; =20 /* IMM flag cannot propagate across a branch and into the dslot. */ assert((env->iflags & (D_FLAG | IMM_FLAG)) !=3D (D_FLAG | IMM_FLAG)); @@ -256,6 +260,12 @@ void mb_cpu_do_interrupt(CPUState *cs) env->res_addr =3D RES_ADDR_NONE; env->iflags =3D 0; =20 + if (cs->exception_index =3D=3D EXCP_IRQ) { + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + } else { + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } + if (!set_esr) { qemu_log_mask(CPU_LOG_INT, " to pc=3D%08x msr=3D%08x\n", env->pc, msr); --=20 2.49.1