public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] vfio-ccw parent rework
@ 2022-10-19 16:21 Eric Farman
  2022-10-19 16:21 ` [PATCH v1 1/7] vfio/ccw: create a parent struct Eric Farman
                   ` (7 more replies)
  0 siblings, 8 replies; 24+ messages in thread
From: Eric Farman @ 2022-10-19 16:21 UTC (permalink / raw)
  To: Matthew Rosato, Alex Williamson, Cornelia Huck, Jason Gunthorpe,
	Kevin Tian, Yi Liu
  Cc: Zhenyu Wang, Zhi Wang, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, David Airlie, Daniel Vetter, Halil Pasic,
	Vineeth Vijayan, Peter Oberparleiter, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, Tony Krowiak, Jason Herne, Harald Freudenberger,
	Diana Craciun, Eric Auger, Kirti Wankhede, Abhishek Sahu,
	Yishai Hadas, intel-gvt-dev, intel-gfx, dri-devel, linux-kernel,
	linux-s390, kvm, Eric Farman

Hi all,

There have been discussions and attempts [1][2] to rework the vfio-ccw device
lifecycle to better align with the needs/expectations of vfio and mdev.
While those languished, commit cb9ff3f3b84c ("vfio: Add helpers for unifying
vfio_device life cycle") implemented a couple of tricks that help vfio and the
drivers that interact with it, while keeping vfio-ccw as-is. A handful of
commits titled "vfio/xxx: Use the new device life cycle helpers" implemented
those tricks for each of the drivers.

This series attempts to address the oddities/shortcomings of vfio-ccw, such
that vfio-ccw can use the same helpers as everyone else, and the tricks that
were implemented by the other drivers can be removed. It is built on 6.1-rc1,
and thus includes the various changes [3][4] that have occurred in and around
these parts.

Patches 1-5 rework the behavior of the vfio-ccw driver's private struct.
In summary, the mdev pieces are split out of vfio_ccw_private and into a
new vfio_ccw_parent struct that will continue to follow today's lifecycle.
The remainder (bulk) of the private struct moves to follow the mdev
probe/remove pair. There's opportunity for further separation of the
things in the private struct, which would simplify some of the vfio-ccw
code, but it got too hairy as I started that. Once vfio-ccw is no longer
considered unique, those cleanups can happen at our leisure. 

Patch 6 removes the trickery where vfio-ccw uses vfio_init_device instead of
vfio_alloc_device, and thus removes vfio_init_device from the outside world.

Patch 7 removes vfio_free_device from vfio-ccw and the other drivers (hello,
CC list!), letting it be handled by vfio_device_release directly.

Looking forward to the feedback.

Thanks,
Eric

[1] https://lore.kernel.org/kvm/0-v3-57c1502c62fd+2190-ccw_mdev_jgg@nvidia.com/
[2] https://lore.kernel.org/kvm/20220602171948.2790690-1-farman@linux.ibm.com/
[3] https://lore.kernel.org/kvm/20220923092652.100656-1-hch@lst.de/
[4] https://lore.kernel.org/kvm/20220921104401.38898-1-kevin.tian@intel.com/

Eric Farman (7):
  vfio/ccw: create a parent struct
  vfio/ccw: remove private->sch
  vfio/ccw: move private initialization to callback
  vfio/ccw: move private to mdev lifecycle
  vfio/ccw: remove release completion
  vfio/ccw: replace vfio_init_device with _alloc_
  vfio: Remove vfio_free_device

 drivers/gpu/drm/i915/gvt/kvmgt.c      |   1 -
 drivers/s390/cio/vfio_ccw_chp.c       |   5 +-
 drivers/s390/cio/vfio_ccw_drv.c       | 182 ++++++++++----------------
 drivers/s390/cio/vfio_ccw_fsm.c       |  27 ++--
 drivers/s390/cio/vfio_ccw_ops.c       | 108 ++++++++++-----
 drivers/s390/cio/vfio_ccw_parent.h    |  28 ++++
 drivers/s390/cio/vfio_ccw_private.h   |  22 ++--
 drivers/s390/crypto/vfio_ap_ops.c     |   6 -
 drivers/vfio/fsl-mc/vfio_fsl_mc.c     |   1 -
 drivers/vfio/pci/vfio_pci_core.c      |   1 -
 drivers/vfio/platform/vfio_amba.c     |   1 -
 drivers/vfio/platform/vfio_platform.c |   1 -
 drivers/vfio/vfio_main.c              |  25 +---
 include/linux/vfio.h                  |   1 -
 samples/vfio-mdev/mbochs.c            |   1 -
 samples/vfio-mdev/mdpy.c              |   1 -
 samples/vfio-mdev/mtty.c              |   1 -
 17 files changed, 204 insertions(+), 208 deletions(-)
 create mode 100644 drivers/s390/cio/vfio_ccw_parent.h

-- 
2.34.1


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

end of thread, other threads:[~2022-11-01 14:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 16:21 [PATCH v1 0/7] vfio-ccw parent rework Eric Farman
2022-10-19 16:21 ` [PATCH v1 1/7] vfio/ccw: create a parent struct Eric Farman
2022-10-27 20:32   ` Eric Farman
2022-10-28 16:51   ` Matthew Rosato
2022-10-28 17:21     ` Eric Farman
2022-10-19 16:21 ` [PATCH v1 2/7] vfio/ccw: remove private->sch Eric Farman
2022-10-28 18:43   ` Matthew Rosato
2022-10-19 16:21 ` [PATCH v1 3/7] vfio/ccw: move private initialization to callback Eric Farman
2022-10-28 18:52   ` Matthew Rosato
2022-10-28 19:18     ` Eric Farman
2022-10-19 16:21 ` [PATCH v1 4/7] vfio/ccw: move private to mdev lifecycle Eric Farman
2022-11-01  9:08   ` Tian, Kevin
2022-11-01 14:05     ` Eric Farman
2022-10-19 16:21 ` [PATCH v1 5/7] vfio/ccw: remove release completion Eric Farman
2022-11-01  9:09   ` Tian, Kevin
2022-10-19 16:21 ` [PATCH v1 6/7] vfio/ccw: replace vfio_init_device with _alloc_ Eric Farman
2022-10-19 17:15   ` Jason Gunthorpe
2022-10-19 17:57     ` Eric Farman
2022-10-20 12:26       ` Jason Gunthorpe
2022-11-01  9:10   ` Tian, Kevin
2022-10-19 16:21 ` [PATCH v1 7/7] vfio: Remove vfio_free_device Eric Farman
2022-10-19 17:16   ` Jason Gunthorpe
2022-11-01  9:11   ` Tian, Kevin
2022-10-19 17:18 ` [PATCH v1 0/7] vfio-ccw parent rework Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox