kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 00/11] Move group specific code into group.c
@ 2022-11-24 12:26 Yi Liu
  2022-11-24 12:26 ` [RFC v2 01/11] vfio: Simplify vfio_create_group() Yi Liu
                   ` (10 more replies)
  0 siblings, 11 replies; 42+ messages in thread
From: Yi Liu @ 2022-11-24 12:26 UTC (permalink / raw)
  To: alex.williamson, jgg
  Cc: kevin.tian, eric.auger, cohuck, nicolinc, yi.y.sun, chao.p.peng,
	mjrosato, kvm, yi.l.liu

With the introduction of iommufd[1], VFIO is towarding to provide device
centric uAPI after adapting to iommufd. With this trend, existing VFIO
group infrastructure is optional once VFIO converted to device centric.

This series moves the group specific code out of vfio_main.c, prepares
for compiling group infrastructure out after adding vfio device cdev[2]

Complete code in below branch:

https://github.com/yiliu1765/iommufd/commits/vfio_group_split_rfcv2

This is based on Jason's "Connect VFIO to IOMMUFD"[3] and my "Make mdev driver
dma_unmap callback tolerant to unmaps come before device open"[4]

[1] https://lore.kernel.org/all/0-v5-4001c2997bd0+30c-iommufd_jgg@nvidia.com/
[2] https://github.com/yiliu1765/iommufd/tree/wip/vfio_device_cdev
[3] https://lore.kernel.org/kvm/063990c3-c244-1f7f-4e01-348023832066@intel.com/T/#t
[4] https://lore.kernel.org/kvm/20221123134832.429589-1-yi.l.liu@intel.com/T/#t

v2:
 - Remove device->group reference in vfio_main.c suggested by Jason.
 - Cherry-pick the patches in Alex's vfio/next branch, and rebased this
   series on the top.

v1: https://lore.kernel.org/kvm/20221123150113.670399-1-yi.l.liu@intel.com/T/#t

Regards,
	Yi Liu

Jason Gunthorpe (2):
  vfio: Simplify vfio_create_group()
  vfio: Move the sanity check of the group to vfio_create_group()

Yi Liu (9):
  vfio: Set device->group in helper function
  vfio: Wrap group codes to be helpers for __vfio_register_dev() and
    unregister
  vfio: Make vfio_device_open() group agnostic
  vfio: Move device open/close code to be helpfers
  vfio: Swap order of vfio_device_container_register() and open_device()
  vfio: Refactor vfio_device_first_open() and _last_close()
  vfio: Wrap vfio group module init/clean code into helpers
  vfio: Refactor dma APIs for emulated devices
  vfio: Move vfio group specific code into group.c

 drivers/vfio/Makefile    |   1 +
 drivers/vfio/container.c |  20 +-
 drivers/vfio/group.c     | 842 ++++++++++++++++++++++++++++++++++++
 drivers/vfio/vfio.h      |  49 ++-
 drivers/vfio/vfio_main.c | 896 +++------------------------------------
 5 files changed, 959 insertions(+), 849 deletions(-)
 create mode 100644 drivers/vfio/group.c

-- 
2.34.1


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

end of thread, other threads:[~2022-12-01 12:48 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 12:26 [RFC v2 00/11] Move group specific code into group.c Yi Liu
2022-11-24 12:26 ` [RFC v2 01/11] vfio: Simplify vfio_create_group() Yi Liu
2022-11-28  7:57   ` Tian, Kevin
2022-11-24 12:26 ` [RFC v2 02/11] vfio: Move the sanity check of the group to vfio_create_group() Yi Liu
2022-11-28  8:05   ` Tian, Kevin
2022-11-24 12:26 ` [RFC v2 03/11] vfio: Set device->group in helper function Yi Liu
2022-11-24 13:17   ` Jason Gunthorpe
2022-11-24 13:50     ` Yi Liu
2022-11-28  8:08   ` Tian, Kevin
2022-11-28  9:17     ` Yi Liu
2022-11-29  2:04       ` Tian, Kevin
2022-11-29 13:27         ` Jason Gunthorpe
2022-11-30  7:09           ` Yi Liu
2022-11-24 12:26 ` [RFC v2 04/11] vfio: Wrap group codes to be helpers for __vfio_register_dev() and unregister Yi Liu
2022-11-28  8:11   ` Tian, Kevin
2022-11-28  9:17     ` Yi Liu
2022-11-24 12:26 ` [RFC v2 05/11] vfio: Make vfio_device_open() group agnostic Yi Liu
2022-11-28  8:17   ` Tian, Kevin
2022-11-28  9:19     ` Yi Liu
2022-12-01  7:08       ` Yi Liu
2022-12-01 12:48         ` Jason Gunthorpe
2022-11-24 12:26 ` [RFC v2 06/11] vfio: Move device open/close code to be helpfers Yi Liu
2022-11-28  8:21   ` Tian, Kevin
2022-11-28  9:27     ` Yi Liu
2022-11-24 12:26 ` [RFC v2 07/11] vfio: Swap order of vfio_device_container_register() and open_device() Yi Liu
2022-11-28  8:27   ` Tian, Kevin
2022-11-28  9:28     ` Yi Liu
2022-11-24 12:26 ` [RFC v2 08/11] vfio: Refactor vfio_device_first_open() and _last_close() Yi Liu
2022-11-24 14:56   ` Jason Gunthorpe
2022-11-25  8:57     ` Yi Liu
2022-11-25 12:37       ` Jason Gunthorpe
2022-11-25 14:06         ` Yi Liu
2022-11-25 14:15           ` Jason Gunthorpe
2022-11-25 14:33             ` Yi Liu
2022-11-28  8:31   ` Tian, Kevin
2022-11-24 12:27 ` [RFC v2 09/11] vfio: Wrap vfio group module init/clean code into helpers Yi Liu
2022-11-28  8:36   ` Tian, Kevin
2022-11-24 12:27 ` [RFC v2 10/11] vfio: Refactor dma APIs for emulated devices Yi Liu
2022-11-28  8:42   ` Tian, Kevin
2022-11-24 12:27 ` [RFC v2 11/11] vfio: Move vfio group specific code into group.c Yi Liu
2022-11-24 14:36   ` Jason Gunthorpe
2022-11-25  8:45     ` Yi Liu

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).