> -----Original Message-----
> From: Nicolin Chen <[email protected]>
> Sent: 11 February 2026 18:25
> To: Eric Auger <[email protected]>
> Cc: Shameer Kolothum Thodi <[email protected]>; qemu-
> [email protected]; [email protected]; [email protected];
> Nathan Chen <[email protected]>; Matt Ochs <[email protected]>;
> Jiandi An <[email protected]>; Jason Gunthorpe <[email protected]>;
> [email protected]; [email protected];
> [email protected]; Krishnakant Jaju <[email protected]>
> Subject: Re: [PATCH v5 3/5] hw/arm/smmuv3-accel: Allocate vEVENTQ for
> accelerated SMMUv3 devices
>
> On Wed, Feb 11, 2026 at 07:14:40PM +0100, Eric Auger wrote:
> > On 2/11/26 7:07 PM, Nicolin Chen wrote:
> > > On Wed, Feb 11, 2026 at 08:34:13AM +0000, Shameer Kolothum wrote:
> > >> 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.
> > > [...]
> > >> @@ -1605,6 +1605,10 @@ static MemTxResult
> smmu_writel(SMMUv3State *s, hwaddr offset,
> > >> s->cr0ack = data & ~SMMU_CR0_RESERVED;
> > >> /* in case the command queue has been enabled */
> > >> smmuv3_cmdq_consume(s, &local_err);
> > >> + /* Allocate vEVENTQ if EventQ is enabled and a vIOMMU is
> > >> + available */
> > > Nit: though it is just following smmuv3_cmdq_consume(), it'd be
> > > likely clearer to verify the EVENTQEN in the callers.
> > >
> > >> + if (local_err == NULL) {
> > > Does eventq need to rely on !local_err from cmdq?
>
> > if local_err is NULL we can safely use it, no? Or maybe I miss your
> > point. maybe test !local_err directly?
>
> Point is: if local_err isn't NULL, why can't we allocate vEVENTQ?
Technically nothing prevents that I guess.
The only thing is we have to call error_report_err() if local_err != NULL
and then set local_err == NULL before calling alloc_veventq().
Thanks,
Shameer