From: Julian Ganz Date: Mon, 27 Oct 2025 11:03:30 +0000 (+0000) Subject: target/rx: call plugin trap callbacks X-Git-Tag: v10.2.0-rc1~36^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dde21df2393a64df083cd8a524994a1ed9fd45dd;p=thirdparty%2Fqemu.git target/rx: call plugin trap callbacks 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 Reviewed-by: Yoshinori Sato Signed-off-by: Julian Ganz Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20251027110344.2289945-24-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- diff --git a/target/rx/helper.c b/target/rx/helper.c index 41c9606fd1..ef47e32add 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" 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 = cpu_env(cs); int do_irq = cpu_test_interrupt(cs, INT_FLAGS); uint32_t save_psw; + uint64_t last_pc = env->pc; env->in_sleep = 0; @@ -65,6 +67,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl = 15; cpu_reset_interrupt(cs, 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 -= 4; @@ -75,6 +78,7 @@ void rx_cpu_do_interrupt(CPUState *cs) env->psw_ipl = env->ack_ipl; cpu_reset_interrupt(cs, 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 = cpu_ldl_data(env, env->intb + (vec & 0xff) * 4); } + + if (vec == 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 = "privilege violation";