> -----Original Message----- > From: Nicolin Chen <[email protected]> > Sent: 04 February 2026 20:13 > To: Shameer Kolothum Thodi <[email protected]> > Cc: [email protected]; [email protected]; > [email protected]; [email protected]; Nathan Chen > <[email protected]>; Matt Ochs <[email protected]>; Jason Gunthorpe > <[email protected]>; [email protected]; > [email protected]; [email protected]; Krishnakant Jaju > <[email protected]> > Subject: Re: [PATCH v4 5/5] hw/arm/smmuv3-accel: Read and propagate host > vIOMMU events > > On Wed, Feb 04, 2026 at 07:00:08PM +0000, Shameer Kolothum wrote: > > Install an event handler on the vEVENTQ fd to read and propagate host > > generated vIOMMU events to the guest. > > > > The handler runs in QEMU’s main loop, using a non-blocking fd > > registered > > s/’s/'s > > > +static void smmuv3_accel_event_read(void *opaque) > > + /* Check sequence in hdr for lost events if any */ > > + if (accel->event_start && (buf.hdr.sequence - last_seq != 1)) { > > + error_report_once("vEVENTQ: detected lost %u event(s)", > > + buf.hdr.sequence - last_seq - 1); > > + } > > + accel->last_event_seq = buf.hdr.sequence; > > + accel->event_start = true; > > + smmuv3_propagate_event(s, (Evt *)&buf.vevent); > [..] > > + /* Set up event handler for veventq fd */ > > + qemu_set_fd_handler(veventq_fd, smmuv3_accel_event_read, NULL, > > + s); > > Are callbacks serialized across threads? Otherwise, we need a mutex?
The qemu_set_fd_handler() callbacks run via the AioContext in QEMU's main loop. AFAICS, the AioContext dispatches handlers one at a time, so the callback is never executed concurrently. Thanks, Shameer
