All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Remove vfio_group from the struct file facing VFIO API
@ 2022-04-20 19:23 Jason Gunthorpe
  2022-04-20 19:23 ` [PATCH v2 1/8] kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions Jason Gunthorpe
                   ` (8 more replies)
  0 siblings, 9 replies; 33+ messages in thread
From: Jason Gunthorpe @ 2022-04-20 19:23 UTC (permalink / raw)
  To: Alex Williamson, Cornelia Huck, kvm, Paolo Bonzini
  Cc: Eric Auger, Christoph Hellwig, Kevin Tian, Yi Liu

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

v2:
- s/filp/file/ s/filep/file/
- Drop patch to allow ppc to be compile tested
- Keep symbol_get's Christoph has an alternative approach
v1: https://lore.kernel.org/r/0-v1-33906a626da1+16b0-vfio_kvm_no_group_jgg@nvidia.com

Jason Gunthorpe (8):
  kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions
  kvm/vfio: Store the struct file in the kvm_vfio_group
  vfio: Change vfio_external_user_iommu_id() to vfio_file_iommu_group()
  vfio: Remove vfio_external_group_match_file()
  vfio: Change vfio_external_check_extension() to
    vfio_file_enforced_coherent()
  vfio: Change vfio_group_set_kvm() to vfio_file_set_kvm()
  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 |  42 ++--
 drivers/vfio/vfio.c              | 146 ++++++------
 include/linux/vfio.h             |  14 +-
 virt/kvm/vfio.c                  | 377 ++++++++++++++-----------------
 4 files changed, 270 insertions(+), 309 deletions(-)


base-commit: ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
-- 
2.36.0


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2022-04-24  5:51 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 19:23 [PATCH v2 0/8] Remove vfio_group from the struct file facing VFIO API Jason Gunthorpe
2022-04-20 19:23 ` [PATCH v2 1/8] kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions Jason Gunthorpe
2022-04-21 13:22   ` Cornelia Huck
2022-04-21 14:46   ` Yi Liu
2022-04-21 14:51   ` Jason Gunthorpe
2022-04-20 19:23 ` [PATCH v2 2/8] kvm/vfio: Store the struct file in the kvm_vfio_group Jason Gunthorpe
2022-04-21 14:46   ` Yi Liu
2022-04-20 19:23 ` [PATCH v2 3/8] vfio: Change vfio_external_user_iommu_id() to vfio_file_iommu_group() Jason Gunthorpe
2022-04-20 23:38   ` Tian, Kevin
2022-04-21  5:39   ` Christoph Hellwig
2022-04-21 14:57   ` Yi Liu
2022-04-22 17:05     ` Jason Gunthorpe
2022-04-23 12:53       ` Yi Liu
2022-04-20 19:23 ` [PATCH v2 4/8] vfio: Remove vfio_external_group_match_file() Jason Gunthorpe
2022-04-21  5:39   ` Christoph Hellwig
2022-04-21 14:50   ` Yi Liu
2022-04-20 19:23 ` [PATCH v2 5/8] vfio: Change vfio_external_check_extension() to vfio_file_enforced_coherent() Jason Gunthorpe
2022-04-20 23:49   ` Tian, Kevin
2022-04-21  5:41   ` Christoph Hellwig
2022-04-22  0:12     ` Tian, Kevin
     [not found]     ` <BN9PR11MB5276CFD31471D4EE85DD705A8CF79@BN9PR11MB5276.namprd11.prod.outlook.com>
2022-04-22  0:32       ` Tian, Kevin
2022-04-22 16:58         ` Jason Gunthorpe
2022-04-24  5:51           ` Tian, Kevin
2022-04-20 19:23 ` [PATCH v2 6/8] vfio: Change vfio_group_set_kvm() to vfio_file_set_kvm() Jason Gunthorpe
2022-04-20 23:51   ` Tian, Kevin
2022-04-21  5:41   ` Christoph Hellwig
2022-04-20 19:23 ` [PATCH v2 7/8] kvm/vfio: Remove vfio_group from kvm Jason Gunthorpe
2022-04-20 23:55   ` Tian, Kevin
2022-04-21  5:42   ` Christoph Hellwig
2022-04-20 19:23 ` [PATCH v2 8/8] vfio/pci: Use the struct file as the handle not the vfio_group Jason Gunthorpe
2022-04-21  0:05   ` Tian, Kevin
2022-04-21  5:43   ` Christoph Hellwig
2022-04-21 14:51 ` [PATCH v2 0/8] Remove vfio_group from the struct file facing VFIO API Yi Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.