All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] Remove vfio_group from the struct file facing VFIO API
@ 2022-05-04 19:14 Jason Gunthorpe
  2022-05-04 19:14 ` [PATCH v3 1/8] kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions Jason Gunthorpe
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Jason Gunthorpe @ 2022-05-04 19:14 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

v3:
 - Use u64_to_user_ptr() to cast attr->addr to a void __user * to avoid
   compiler warnings on 32 bit
 - Rebase on top of
   https://lore.kernel.org/all/0-v2-0f36bcf6ec1e+64d-vfio_get_from_dev_jgg@nvidia.com/
 - Update commit messages
v2: https://lore.kernel.org/r/0-v2-6a528653a750+1578a-vfio_kvm_no_group_jgg@nvidia.com
- 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

Cc: Eric Auger <eric.auger@redhat.com>
Cc: Yi Liu <yi.l.liu@intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <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              | 131 +++++------
 include/linux/vfio.h             |  15 +-
 virt/kvm/vfio.c                  | 381 ++++++++++++++-----------------
 4 files changed, 262 insertions(+), 307 deletions(-)


base-commit: 0f36bcf6ec1e0c95725cdaf9cf3b0fed6f697494
-- 
2.36.0


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

end of thread, other threads:[~2022-05-13 17:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 19:14 [PATCH v3 0/8] Remove vfio_group from the struct file facing VFIO API Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 1/8] kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 2/8] kvm/vfio: Store the struct file in the kvm_vfio_group Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 3/8] vfio: Change vfio_external_user_iommu_id() to vfio_file_iommu_group() Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 4/8] vfio: Remove vfio_external_group_match_file() Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 5/8] vfio: Change vfio_external_check_extension() to vfio_file_enforced_coherent() Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 6/8] vfio: Change vfio_group_set_kvm() to vfio_file_set_kvm() Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 7/8] kvm/vfio: Remove vfio_group from kvm Jason Gunthorpe
2022-05-04 19:14 ` [PATCH v3 8/8] vfio/pci: Use the struct file as the handle not the vfio_group Jason Gunthorpe
2022-05-06 22:25 ` [PATCH v3 0/8] Remove vfio_group from the struct file facing VFIO API Alex Williamson
2022-05-12 18:24   ` Alex Williamson
2022-05-13 17:23 ` Alex Williamson

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.