On Tue, Aug 24, 2021 at 09:28:50PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 24, 2021 at 04:46:46PM +0200, Christoph Hellwig wrote: > > Pass the group flags to ->attach_group and remove the messy check for > > the bus type. > > > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > --- > > drivers/vfio/vfio.c | 11 +++++------ > > drivers/vfio/vfio.h | 7 ++++++- > > drivers/vfio/vfio_iommu_spapr_tce.c | 2 +- > > drivers/vfio/vfio_iommu_type1.c | 19 ++----------------- > > 4 files changed, 14 insertions(+), 25 deletions(-) > > Every caller is doing group->iommu_group, maybe change the signature > to > > (*attach_group)(struct vfio_iommu *iommu, struct vfio_iommu_group *group) > > ? s/vfio_iommu/vfio_container/, but yes. I actually have a series that does this (also for a few other methods), but this requires exposing vfio_container and vfio_iommu_group outside of vfio.c. Given that this series is big enough I decided to skip it for now, but that plus a few other changes will eventually simplify the group lookups in vfio_iommu_type1.c.