On Mon, May 05, 2025 at 06:38:17PM +0200, Eric Auger wrote: > > +/** > > + * struct HostIOMMUDeviceIOMMUFDCaps - Define host IOMMU device > > capabilities. > > + * > > + * @type: host platform IOMMU type. > > + * > > + * @hw_caps: host platform IOMMU capabilities (e.g. on IOMMUFD this > > represents > > + * the @out_capabilities value returned from IOMMU_GET_HW_INFO > > ioctl) > > + */ > > +typedef struct HostIOMMUDeviceIOMMUFDCaps { > > + uint32_t type; > > + uint64_t hw_caps; > > + VendorCaps vendor_caps;
> can't we store the raw data in the caps and let the vIOMMU code > interpret it via a PCIIOMMUOps callback? > > If my understanding is correct this is also Nicolin's initial > suggestion, no? It was, until Cedric suggested to do a further isolation between the iommufd uAPIs/structures and vIOMMU code, so vIOMMU wouldn't need to deal with any iommufd uAPIs/structures. So, what Zhenzhong did is kinda creating another vIOMMU specific iommufd driver(s) in backend/iommufd, which for now only unpacks the hw_caps and vendor_caps, and likely will further forward the caps via another non-iommufd structure (?) to vIOMMU. It's slightly different than what we do in the kernel, where all the vendor data isn't touched by the core, but still makes sense in QEMU world I think? Thanks Nicolin