> -----Original Message-----
> From: Nicolin Chen <[email protected]>
> Sent: 31 October 2025 23:58
> To: Shameer Kolothum <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; Jason Gunthorpe
> <[email protected]>; [email protected]; [email protected]; Nathan
> Chen <[email protected]>; Matt Ochs <[email protected]>;
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> Krishnakant Jaju <[email protected]>
> Subject: Re: [PATCH v5 16/32] hw/arm/smmuv3-accel: Make use of
> get_msi_address_space() callback
>
> On Fri, Oct 31, 2025 at 10:49:49AM +0000, Shameer Kolothum wrote:
> > +static AddressSpace *smmuv3_accel_get_msi_as(PCIBus *bus, void
> *opaque,
> > + int devfn)
> > +{
> > + SMMUState *bs = opaque;
> > + SMMUPciBus *sbus = smmu_get_sbus(bs, bus);
> > + SMMUv3AccelDevice *accel_dev = smmuv3_accel_get_dev(bs, sbus, bus,
> devfn);
> > + SMMUDevice *sdev = &accel_dev->sdev;
> > +
> > + /*
> > + * If the assigned vfio-pci dev has S1 translation enabled by Guest,
> > + * return IOMMU address space for MSI translation. Otherwise, return
> > + * system address space.
> > + */
> > + if (accel_dev->s1_hwpt) {
> > + return &sdev->as;
> > + } else {
> > + return &address_space_memory;
>
> Should we use the global shared_as? Or is this on purpose to align
> with the "&address_space_memory" in kvm_arch_fixup_msi_route()?
Yes, that's on purpose.
Another way to handle is, if "address_space_memory" is complete no-no,
to return NULL here and handle it in pci_device_iommu_msi_address_space().
I like the current approach. Possibly can update the doc for
get_msi_address_space()
In previous patch to make it clear that "&address_space_memory" should be
returned if no msi translation is required.
Thanks,
Shameer