On Thu, May 22, 2025 at 09:21:04AM +0000, Duan, Zhenzhong wrote: > > > >-----Original Message----- > >From: Nicolin Chen <nicol...@nvidia.com> > >Subject: Re: [PATCH rfcv3 05/21] vfio/iommufd: Save vendor specific device > >info > > > >On Wed, May 21, 2025 at 07:14:35PM +0800, Zhenzhong Duan wrote: > >> @@ -852,6 +853,17 @@ static bool > >hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque, > >> caps->type = type; > >> caps->hw_caps = hw_caps; > >> > >> + switch (type) { > >> + case IOMMU_HW_INFO_TYPE_INTEL_VTD: > >> + vendor_caps->vtd.flags = data.vtd.flags; > >> + vendor_caps->vtd.cap_reg = data.vtd.cap_reg; > >> + vendor_caps->vtd.ecap_reg = data.vtd.ecap_reg; > >> + break; > >> + case IOMMU_HW_INFO_TYPE_ARM_SMMUV3: > >> + case IOMMU_HW_INFO_TYPE_NONE: > > > >Should this be a part of hiod_iommufd_get_vendor_cap() in backends? > > Made following adjustments which save raw data in VendorCaps, > let me know if it matches your thought.
Yea, LGTM. Point is that we keep all vendor structure decoding inside the backend, so VFIO wouldn't need to care about types nor what's inside the data. Thanks Nicolin