dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Make the rest of the VFIO driver interface use vfio_device
@ 2022-04-12 15:53 Jason Gunthorpe
  2022-04-12 15:53 ` [PATCH 1/9] vfio: Make vfio_(un)register_notifier accept a vfio_device Jason Gunthorpe
                   ` (8 more replies)
  0 siblings, 9 replies; 38+ messages in thread
From: Jason Gunthorpe @ 2022-04-12 15:53 UTC (permalink / raw)
  To: Alexander Gordeev, David Airlie, Tony Krowiak, Alex Williamson,
	Christian Borntraeger, Cornelia Huck, Jonathan Corbet,
	Daniel Vetter, dri-devel, Eric Farman, Harald Freudenberger,
	Vasily Gorbik, Heiko Carstens, intel-gfx, intel-gvt-dev,
	Jani Nikula, Jason Herne, Joonas Lahtinen, kvm, Kirti Wankhede,
	linux-doc, linux-s390, Matthew Rosato, Peter Oberparleiter,
	Halil Pasic, Rodrigo Vivi, Sven Schnelle, Tvrtko Ursulin,
	Vineeth Vijayan, Zhenyu Wang, Zhi Wang
  Cc: Tian, Kevin, Liu, Yi L, Christoph Hellwig

Prior series have transformed other parts of VFIO from working on struct
device or struct vfio_group into working directly on struct
vfio_device. Based on that work we now have vfio_device's readily
available in all the drivers.

Update the rest of the driver facing API to use vfio_device as an input.

The following are switched from struct device to struct vfio_device:
  vfio_register_notifier()
  vfio_unregister_notifier()
  vfio_pin_pages()
  vfio_unpin_pages()
  vfio_dma_rw()

The following group APIs are obsoleted and removed by just using struct
vfio_device with the above:
  vfio_group_pin_pages()
  vfio_group_unpin_pages()
  vfio_group_iommu_domain()
  vfio_group_get_external_user_from_dev()

To retain the performance of the new device APIs relative to their group
versions optimize how vfio_group_add_container_user() is used to avoid
calling it when the driver must already guarantee the device is open and
the container_users incrd.

The remaining exported VFIO group interfaces are only used by kvm, and are
addressed by a parallel series.

There is a conflict with Christoph's gvt rework here:

 https://lore.kernel.org/all/20220411141403.86980-1-hch@lst.de/

I've organized this so it is independent of Christoph's series, by adding
the temporary mdev_legacy_get_vfio_device(), however it is easy for me to
rebase. We can decide what to do as we see what becomes mergable. My
preference would be to see Christoph's series merged into the drm&vfio
trees and we do both series this cycle.

I have a followup series that needs this.

This is also part of the iommufd work - moving the driver facing interface
to vfio_device provides a much cleaner path to integrate with iommufd.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Jason Gunthorpe (9):
  vfio: Make vfio_(un)register_notifier accept a vfio_device
  vfio/ccw: Remove mdev from struct channel_program
  vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()
  drm/i915/gvt: Change from vfio_group_(un)pin_pages to
    vfio_(un)pin_pages
  vfio: Pass in a struct vfio_device * to vfio_dma_rw()
  drm/i915/gvt: Add missing module_put() in error unwind
  drm/i915/gvt: Delete kvmgt_vdev::vfio_group
  vfio: Remove dead code
  vfio: Remove calls to vfio_group_add_container_user()

 .../driver-api/vfio-mediated-device.rst       |   4 +-
 drivers/gpu/drm/i915/gvt/kvmgt.c              |  48 ++-
 drivers/s390/cio/vfio_ccw_cp.c                |  44 +--
 drivers/s390/cio/vfio_ccw_cp.h                |   4 +-
 drivers/s390/cio/vfio_ccw_fsm.c               |   3 +-
 drivers/s390/cio/vfio_ccw_ops.c               |   7 +-
 drivers/s390/crypto/vfio_ap_ops.c             |  22 +-
 drivers/vfio/mdev/vfio_mdev.c                 |  12 +
 drivers/vfio/vfio.c                           | 283 ++----------------
 include/linux/mdev.h                          |   1 +
 include/linux/vfio.h                          |  21 +-
 11 files changed, 115 insertions(+), 334 deletions(-)


base-commit: ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
-- 
2.35.1


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

end of thread, other threads:[~2022-04-19 17:00 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 15:53 [PATCH 0/9] Make the rest of the VFIO driver interface use vfio_device Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 1/9] vfio: Make vfio_(un)register_notifier accept a vfio_device Jason Gunthorpe
     [not found]   ` <20220413055524.GB32092@lst.de>
2022-04-13 11:39     ` Jason Gunthorpe
     [not found]       ` <20220413160601.GA29631@lst.de>
2022-04-13 16:18         ` Jason Gunthorpe
     [not found]           ` <20220413162946.GB31053@lst.de>
2022-04-13 17:37             ` Jason Gunthorpe
2022-04-13 19:17               ` Wang, Zhi A
2022-04-13 20:04                 ` Jason Gunthorpe
2022-04-13 21:08                   ` Wang, Zhi A
2022-04-13 23:12                     ` Jason Gunthorpe
2022-04-14  2:04                       ` Tian, Kevin
2022-04-14  2:15                     ` Tian, Kevin
2022-04-14 19:25   ` Eric Farman
2022-04-18 15:28   ` Tony Krowiak
2022-04-18 15:44     ` Jason Gunthorpe
2022-04-18 15:52       ` Tony Krowiak
2022-04-18 15:29   ` Jason J. Herne
2022-04-12 15:53 ` [PATCH 2/9] vfio/ccw: Remove mdev from struct channel_program Jason Gunthorpe
2022-04-14 19:25   ` Eric Farman
2022-04-12 15:53 ` [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages() Jason Gunthorpe
     [not found]   ` <20220413055717.GC32092@lst.de>
2022-04-13 11:40     ` Jason Gunthorpe
2022-04-14 19:26   ` Eric Farman
2022-04-18 15:25   ` Jason J. Herne
2022-04-19 17:00     ` Jason Gunthorpe
2022-04-18 15:56   ` Tony Krowiak
2022-04-12 15:53 ` [PATCH 4/9] drm/i915/gvt: Change from vfio_group_(un)pin_pages to vfio_(un)pin_pages Jason Gunthorpe
     [not found]   ` <20220413060110.GF32092@lst.de>
2022-04-13 13:39     ` Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 5/9] vfio: Pass in a struct vfio_device * to vfio_dma_rw() Jason Gunthorpe
     [not found]   ` <20220413060008.GE32092@lst.de>
2022-04-13 13:39     ` Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 6/9] drm/i915/gvt: Add missing module_put() in error unwind Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 7/9] drm/i915/gvt: Delete kvmgt_vdev::vfio_group Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 8/9] vfio: Remove dead code Jason Gunthorpe
2022-04-12 15:53 ` [PATCH 9/9] vfio: Remove calls to vfio_group_add_container_user() Jason Gunthorpe
     [not found]   ` <20220413061105.GA32701@lst.de>
2022-04-13 14:03     ` Jason Gunthorpe
2022-04-14 13:51   ` Matthew Rosato
2022-04-14 14:22     ` Jason Gunthorpe
2022-04-15  2:32       ` Tian, Kevin
2022-04-15 12:07         ` Jason Gunthorpe
2022-04-15 23:45           ` Tian, Kevin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).