This is the other half of removing the vfio_group from the externally facing VFIO API. VFIO provides an API to manipulate its struct file *'s for use by KVM and VFIO PCI. Instead of converting the struct file into a ref counted struct vfio_group simply use the struct file as the handle throughout the API. Along the way some of the APIs are simplified to be more direct about what they are trying to do with an eye to making future iommufd implementations for all of them. This also simplifies the container_users ref counting by not holding a users refcount while KVM holds the group file. Removing vfio_group from the external facing API is part of the iommufd work to modualize and compartmentalize the VFIO container and group object to be entirely internal to VFIO itself. This is on github: https://github.com/jgunthorpe/linux/commits/vfio_kvm_no_group Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Jason Gunthorpe (10): kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions kvm/vfio: Reduce the scope of PPC #ifdefs kvm/vfio: Store the struct file in the kvm_vfio_group vfio: Use a struct of function pointers instead of a many symbol_get()'s vfio: Move vfio_external_user_iommu_id() to vfio_file_ops vfio: Remove vfio_external_group_match_file() vfio: Move vfio_external_check_extension() to vfio_file_ops vfio: Move vfio_group_set_kvm() into vfio_file_ops kvm/vfio: Remove vfio_group from kvm vfio/pci: Use the struct file as the handle not the vfio_group drivers/vfio/pci/vfio_pci_core.c | 43 ++-- drivers/vfio/vfio.c | 156 ++++++------ include/linux/vfio.h | 17 +- virt/kvm/vfio.c | 405 ++++++++++++------------------- 4 files changed, 278 insertions(+), 343 deletions(-) base-commit: ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e -- 2.35.1