On Fri, Sep 17, 2021 at 01:25:59AM +0530, Kirti Wankhede wrote: > > > On 9/13/2021 12:46 PM, Christoph Hellwig wrote: > > Pass the group flags to ->attach_group and remove the messy check for > > the bus type. > > > > I like the way vfio_group_type is used in this patch, that removes messy way > to call symbol_get(mdev_bus_type). > > Any thoughts on how VFIO_IOMMU, i.e. IOMMU backed mdev, can be implemented? > > For IOMMU backed mdev, mdev->dev->iommu_group should be same as > mdev->type->parent->dev->iommu_group or in other words, parent device would > be DMA alias for the mdev device with the restriction - single mdev device > can be created for the physical device. Is it possible to link iommu_group > of these two devices some way? You just use the new style mdev API and directly call vfio_register_group_dev and it will pick up the parent->dev->iommu_group naturally like everything else using physical iommu groups. Jason