Skip to content

Move group specific code into group.c

Yi Liu kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 17 repliesIn review

Changes in v1 from the cover letter

- Keep the iommufd code in vfio_main.c just move group code out (Jason)
- Add r-b from Kevin
- Reorder the patch sequence
- Drop "vfio: Make vfio_device_open() group agnostic"

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10vfio: Simplify vfio_create_group()drivers/vfio/vfio_main.c+10 -230 replies
2/10vfio: Move the sanity check of the group to vfio_create_group()drivers/vfio/vfio_main.c+25 -370 replies
3/10vfio: Create wrappers for group register/unregisterdrivers/vfio/vfio_main.c+16 -70 replies
4/10vfio: Set device->group in helper functiondrivers/vfio/vfio_main.c+26 -151 reply
5/10vfio: Swap order of vfio_device_container_register() and open_device()drivers/vfio/vfio_main.c+9 -80 replies
6/10vfio: Move device open/close code to be helpfersdrivers/vfio/vfio_main.c+29 -172 replies
7/10vfio: Refactor vfio_device open and closedrivers/vfio/vfio_main.c+87 -465 replies
8/10vfio: Wrap vfio group module init/clean code into helpersdrivers/vfio/vfio_main.c+36 -200 replies
9/10vfio: Refactor dma APIs for emulated devicesdrivers/vfio/container.c drivers/vfio/vfio.h drivers/vfio/vfio_main.c+43 -340 replies
10/10vfio: Move vfio group specific code into group.cdrivers/vfio/Makefile drivers/vfio/group.c drivers/vfio/vfio.h +1 more+907 -8701 reply

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKevin TianJason GunthorpeAlex WilliamsonLixiao YangYu He
SeriesR-b R-b T-b T-b
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 00/10] Move group specific code into group.c

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_v1

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/[email protected]/
[2] https://github.com/yiliu1765/iommufd/tree/wip/vfio_device_cdev
[3] https://lore.kernel.org/kvm/[email protected]/
[4] https://lore.kernel.org/kvm/[email protected]/

v1:
- Keep the iommufd code in vfio_main.c just move group code out (Jason)
- Add r-b from Kevin
- Reorder the patch sequence
- Drop "vfio: Make vfio_device_open() group agnostic"

rfcv2: https://lore.kernel.org/kvm/[email protected]/
- 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.

rfcv1: https://lore.kernel.org/kvm/[email protected]/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 (8):
vfio: Create wrappers for group register/unregister
vfio: Set device->group in helper function
vfio: Swap order of vfio_device_container_register() and open_device()
vfio: Move device open/close code to be helpfers
vfio: Refactor vfio_device open and 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     | 877 +++++++++++++++++++++++++++++++++++++
 drivers/vfio/vfio.h      |  54 ++-
 drivers/vfio/vfio_main.c | 909 +++------------------------------------
 5 files changed, 986 insertions(+), 875 deletions(-)
 create mode 100644 drivers/vfio/group.c
Signature · 1 line
2.34.1