From nobody Sat Sep 6 17:34:48 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=1757019273; cv=none; d=zohomail.com; s=zohoarc; b=cLkOSeppmh066bJj8bMw/EtVK45Gd9em/OpIIW8nQ+IrpT3MdA0MbpkCpaRIQshT2nvt/Ux9IkXx/0l92fKMg5ZKDNwRYgTISUH2/jaK1XPVcVZkyZ3h1ZoCRBQ2BUFEUBot/3hZX5w+zbjvvxs6oQHqrna1w9J1gKICfDptEiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757019273; 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=4jyOeyTiiwSHsjXv4AoM9jGT1DfS70YuVzWnnrYikCA=; b=nnrc4de6AVJwIQdJJNhmX7DjMcHKBQ+oZ+iQS5p1KA4WiFuHIAzEIC5FScuN+WiUZvCwqJr69yBXtzkcqoxO6NiEMn5DGZmdUhbo08Yl+5tMvhqAwJERoPC2eOcsiKL6nc5vhcQ4+G+bczUfhvuwsBPdaHMlIespGZ1px6Ydjbw= 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 175701927390343.90628701971707; Thu, 4 Sep 2025 13:54:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuGsD-0003Yy-Mz; Thu, 04 Sep 2025 16:48:01 -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 1uuGs8-0003Vu-Be for qemu-devel@nongnu.org; Thu, 04 Sep 2025 16:47:57 -0400 Received: from mailgate01.uberspace.is ([2001:1a50:11:0:c83f:a8ff:fea6:c8da]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uuGrx-0000ki-Qj for qemu-devel@nongnu.org; Thu, 04 Sep 2025 16:47:56 -0400 Received: from skiff.uberspace.de (skiff.uberspace.de [185.26.156.131]) by mailgate01.uberspace.is (Postfix) with ESMTPS id 2DC2560C55 for ; Thu, 4 Sep 2025 22:47:24 +0200 (CEST) Received: (qmail 32755 invoked by uid 990); 4 Sep 2025 20:47:24 -0000 Received: from unknown (HELO unkown) (::1) by skiff.uberspace.de (Haraka/3.0.1) with ESMTPSA; Thu, 04 Sep 2025 22:47:24 +0200 Authentication-Results: skiff.uberspace.de; auth=pass (plain) From: Julian Ganz To: qemu-devel@nongnu.org Cc: Julian Ganz , Richard Henderson , Yoshinori Sato Subject: [PATCH v6 17/25] target/rx: call plugin trap callbacks Date: Thu, 4 Sep 2025 22:46:54 +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.995166) MID_CONTAINS_FROM(1) MIME_GOOD(-0.1) R_MISSING_CHARSET(0.5) X-Rspamd-Score: -5.595166 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nut.email; s=uberspace; h=from:to:cc:subject:date; bh=O2XE4lw8lRTZO91tPzs5hLNcmDOO/lAMqHonY1qYSvs=; b=dLUk+7bquaq6c/x9RvBJ8aMGAblc1xmRBg00+54bdP8TY++k7Xcl+P6hmD8A0RH9cGcITfjBGR qJNcR4kz4oQlBC55OG1uqP05EjBlK2mmweF274ruK/vS2vxMcorFDnkf6N8AyJMelLsurZzKf2Qq aUZrhuT+wWNETSIkr6F+R1V+TpFlgD0TrvuEf0Fwd7XKNABMBw6loHXTOFdtfAJaNdGCPjqKlS42 dn+uCkl/O1FO1TtsWXgDZlBUkjVksj6VgPVbMNYg2X+K8yGSmgU/8/3xQA8YwR4KFXN7SJ2Pe5pv jrJZU+8H2ptHhvJiqfLeKnzatmZ1P2l/KLwwZQZI2FlToFSJiopw7e+s1ATITbYczW+c3UtV37Ne 2Hu7KXMP6yX0trgP5fiNK+KbCajSzzSbsTeVyGt8iOjs5EaLFmFNtxxe17YH7tGpS5SsJ1xaPsQ+ WxSYYo84Crtipa8UtmrlyGu6iWero1iu5yGpUeD//nUA/u4ruoS6mAVFDZCjgbV/pOzjy7JU9Mue lpKKEDYO7QruohUF0PwJPeSXyRbuQi14lO/Hbi7RNmJH/GhOTY3iVWmB0elu6U1TZJu5fvPaM7CB PYxH2p+X2XtTyGhaxkmEDjJ8MbZn/8OGkT59co3npZGVKaXaaNbY/dqqqVVN1Zjqt8sDfqmpomar A= 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=2001:1a50:11:0:c83f:a8ff:fea6:c8da; 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, 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: 1757019275815124100 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 hooks for Renesas Xtreme targets. Reviewed-by: Richard Henderson Signed-off-by: Julian Ganz --- target/rx/helper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/rx/helper.c b/target/rx/helper.c index ce003af421..054bfdff57 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -22,6 +22,7 @@ #include "exec/log.h" #include "accel/tcg/cpu-ldst.h" #include "hw/irq.h" +#include "qemu/plugin.h" =20 void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte) { @@ -46,6 +47,7 @@ void rx_cpu_do_interrupt(CPUState *cs) CPURXState *env =3D cpu_env(cs); int do_irq =3D cpu_test_interrupt(cs, INT_FLAGS); uint32_t save_psw; + uint64_t last_pc =3D env->pc; =20 env->in_sleep =3D 0; =20 @@ -65,6 +67,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl =3D 15; cs->interrupt_request &=3D ~CPU_INTERRUPT_FIR; qemu_set_irq(env->ack, env->ack_irq); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); qemu_log_mask(CPU_LOG_INT, "fast interrupt raised\n"); } else if (do_irq & CPU_INTERRUPT_HARD) { env->isp -=3D 4; @@ -75,6 +78,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl =3D env->ack_ipl; cs->interrupt_request &=3D ~CPU_INTERRUPT_HARD; qemu_set_irq(env->ack, env->ack_irq); + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); qemu_log_mask(CPU_LOG_INT, "interrupt 0x%02x raised\n", env->ack_irq); } @@ -92,6 +96,14 @@ void rx_cpu_do_interrupt(CPUState *cs) } else { env->pc =3D cpu_ldl_data(env, env->intb + (vec & 0xff) * 4); } + + if (vec =3D=3D 30) { + /* Non-maskable interrupt */ + qemu_plugin_vcpu_interrupt_cb(cs, last_pc); + } else { + qemu_plugin_vcpu_exception_cb(cs, last_pc); + } + switch (vec) { case 20: expname =3D "privilege violation"; --=20 2.49.1