Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

Jason Gunthorpe
2025-05-05T17:08:14Z

On Wed, Apr 30, 2025 at 12:58:47AM -0700, Nicolin Chen wrote:

> > ... and I just hit a problem with it - this is basically guest BDFn
> > and it works as long as I'm hotplugging the TEE-IO VF into an SNP VM
> > but does not when I pass through via the QEMU cmdline - bus numbers
> > are not assigned yet. So I have to postpone the vdevice allocation
> > till run time, did I miss something here? Thanks,
>
> I have a similar case with QEMU ARM64's VM: so vDEVICE on ARM is
> allocated at runtime as well because the BDF number isn't ready
> at the boot time.

Oh that's ugly then.. So you'll need to add some kind of 'modify
sid/bdf' operation I think.

The bus numbers can be reassigned at any time on the fly by the guest
by reprogramming the PCI hierarchy.

Jason