> -----Original Message----- > From: Eric Auger <[email protected]> > Sent: 02 February 2026 10:48 > To: Shameer Kolothum Thodi <[email protected]>; qemu- > [email protected]; [email protected] > Cc: [email protected]; Nicolin Chen <[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 v3 2/4] hw/arm/smmuv3-accel: Allocate vEVENTQ for > accelerated SMMUv3 devices > > External email: Use caution opening links or attachments > > > On 1/27/26 11:33 AM, Shameer Kolothum wrote: > > From: Nicolin Chen <[email protected]> > > > > When the guest enables the Event Queue and a vIOMMU is present, > > allocate a vEVENTQ object so that host-side events related to the > > vIOMMU can be received and propagated back to the guest. > > > > For cold-plugged devices using SMMUv3 acceleration, the vIOMMU is > > created before the guest boots. In this case, the vEVENTQ is allocated > > when the guest writes to SMMU_CR0 and sets EVENTQEN = 1. > > > > If no cold-plugged device exists at boot (i.e. no vIOMMU initially), > > the vEVENTQ is allocated when a vIOMMU is created, i.e. during the > > first device hot-plug. > > > > Event read and propagation will be added in a later patch. > > > > Signed-off-by: Nicolin Chen <[email protected]> > > Tested-by: Nicolin Chen <[email protected]> > > Signed-off-by: Shameer Kolothum <[email protected]> > > --- > > hw/arm/smmuv3-accel.c | 65 > > +++++++++++++++++++++++++++++++++++++++++-- > > hw/arm/smmuv3-accel.h | 6 ++++ > > hw/arm/smmuv3.c | 4 +++ > > 3 files changed, 73 insertions(+), 2 deletions(-) > > > > diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c index > > f5cd4df336..e8028d4be5 100644 > > --- a/hw/arm/smmuv3-accel.c > > +++ b/hw/arm/smmuv3-accel.c > > @@ -390,6 +390,58 @@ bool > smmuv3_accel_issue_inv_cmd(SMMUv3State *bs, void *cmd, SMMUDevice > *sdev, > > sizeof(Cmd), &entry_num, cmd, errp); } > > > > +static void smmuv3_accel_free_veventq(SMMUv3AccelState *accel) { > > + IOMMUFDVeventq *veventq = accel->veventq; > > + > > + if (!veventq) { > > + return; > > + } > I guess the close(fd) should already be here, no?
Right. I will add that. Thanks, Shameer
