#include "qemu/host-utils.h"
#include "exec/log.h"
#include "exec/helper-proto.h"
+#include "qemu/plugin.h"
G_NORETURN
{
CPUMBState *env = cpu_env(cs);
uint32_t esr, iflags;
+ uint64_t last_pc = env->pc;
/* Recover the pc and iflags from the corresponding insn_start. */
cpu_restore_state(cs, retaddr);
env->ear = addr;
env->esr = esr;
cs->exception_index = EXCP_HW_EXCP;
+ qemu_plugin_vcpu_exception_cb(cs, last_pc);
cpu_loop_exit(cs);
}
CPUMBState *env = &cpu->env;
uint32_t t, msr = mb_cpu_read_msr(env);
bool set_esr;
+ uint64_t last_pc = env->pc;
/* IMM flag cannot propagate across a branch and into the dslot. */
assert((env->iflags & (D_FLAG | IMM_FLAG)) != (D_FLAG | IMM_FLAG));
env->res_addr = RES_ADDR_NONE;
env->iflags = 0;
+ if (cs->exception_index == 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=%08x msr=%08x\n", env->pc, msr);