Hello Richard,
October 7, 2025 at 12:38 AM, "Richard Henderson" wrote:
> On 10/6/25 02:57, Julian Ganz wrote:
> > @@ -212,6 +214,48 @@ void hppa_cpu_do_interrupt(CPUState *cs)
> > env->iasq_f = 0;
> > env->iasq_b = 0;
> > > + switch (i) {
> > + case EXCP_HPMC:
> > + case EXCP_POWER_FAIL:
> > + case EXCP_RC:
> > + case EXCP_EXT_INTERRUPT:
> > + case EXCP_LPMC:
> > + case EXCP_PER_INTERRUPT:
> > + case EXCP_TOC:
> > + qemu_plugin_vcpu_interrupt_cb(cs, last_pc);
> > + break;
> > + case EXCP_ITLB_MISS:
> > + case EXCP_IMP:
> > + case EXCP_ILL:
> > + case EXCP_BREAK:
> > + case EXCP_PRIV_OPR:
> > + case EXCP_PRIV_REG:
> > + case EXCP_OVERFLOW:
> > + case EXCP_COND:
> > + case EXCP_ASSIST:
> > + case EXCP_DTLB_MISS:
> > + case EXCP_NA_ITLB_MISS:
> > + case EXCP_NA_DTLB_MISS:
> > + case EXCP_DMP:
> > + case EXCP_DMB:
> > + case EXCP_TLB_DIRTY:
> > + case EXCP_PAGE_REF:
> > + case EXCP_ASSIST_EMU:
> > + case EXCP_HPT:
> > + case EXCP_LPT:
> > + case EXCP_TB:
> > + case EXCP_DMAR:
> > + case EXCP_DMPI:
> > + case EXCP_UNALIGN:
> > + case EXCP_SYSCALL:
> > + case EXCP_SYSCALL_LWS:
> >
> These last two are linux-user syscalls. Don't you want hostcall?
Hostcalls only really exist in system emulation mode. For regular
syscalls, we do want to observe the exception in that mode since the
kernel code we switch to is also emulated. For consistency's sake, we
handle it the same for user mode. And there's already a syscall API for
user mode emulation, so it doesn't make much sense to handle them as
host calls.
>
> >
> > + qemu_plugin_vcpu_exception_cb(cs, last_pc);
> > + break;
> > + default:
> > + qemu_plugin_vcpu_interrupt_cb(cs, last_pc);
> >
> g_assert_not_reached().
So that implies that there are no exceptions or interrupts that are not
represented by a EXCP_* constant/definition? In that case I'll rewrite
this with just the interrupts and a default case for all "proper"
syncroneous exceptions.
Regards,
Julian