dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] Connect VFIO to IOMMUFD
@ 2022-11-08  0:52 Jason Gunthorpe
  2022-11-08  0:52 ` [PATCH v2 01/11] vfio: Move vfio_device driver open/close code to a function Jason Gunthorpe
                   ` (13 more replies)
  0 siblings, 14 replies; 56+ messages in thread
From: Jason Gunthorpe @ 2022-11-08  0:52 UTC (permalink / raw)
  To: Alexander Gordeev, David Airlie, Tony Krowiak, Alex Williamson,
	Christian Borntraeger, Cornelia Huck, Daniel Vetter,
	Diana Craciun, dri-devel, Eric Auger, Eric Farman,
	Harald Freudenberger, Vasily Gorbik, Heiko Carstens, intel-gfx,
	intel-gvt-dev, iommu, Jani Nikula, Jason Herne, Joonas Lahtinen,
	Joerg Roedel, Kevin Tian, kvm, linux-s390, Longfang Liu,
	Matthew Rosato, Peter Oberparleiter, Halil Pasic, Robin Murphy,
	Rodrigo Vivi, Shameer Kolothum, Sven Schnelle, Tvrtko Ursulin,
	Vineeth Vijayan, Will Deacon, Yishai Hadas, Zhenyu Wang,
	Zhi Wang
  Cc: Liu, Yi L, Nicolin Chen, Lu Baolu

This series provides an alternative container layer for VFIO implemented
using iommufd. This is optional, if CONFIG_IOMMUFD is not set then it will
not be compiled in.

At this point iommufd can be injected by passing in a iommfd FD to
VFIO_GROUP_SET_CONTAINER which will use the VFIO compat layer in iommufd
to obtain the compat IOAS and then connect up all the VFIO drivers as
appropriate.

This is temporary stopping point, a following series will provide a way to
directly open a VFIO device FD and directly connect it to IOMMUFD using
native ioctls that can expose the IOMMUFD features like hwpt, future
vPASID and dynamic attachment.

This series, in compat mode, has passed all the qemu tests we have
available, including the test suites for the Intel GVT mdev. Aside from
the temporary limitation with P2P memory this is belived to be fully
compatible with VFIO.

This is on github: https://github.com/jgunthorpe/linux/commits/vfio_iommufd

It requires the iommufd series:

https://lore.kernel.org/r/0-v4-0de2f6c78ed0+9d1-iommufd_jgg@nvidia.com

v2:
 - Rebase to v6.1-rc3, v4 iommufd series
 - Fixup comments and commit messages from list remarks
 - Fix leaking of the iommufd for mdevs
 - New patch to fix vfio modaliases when vfio container is disabled
 - Add a dmesg once when the iommufd provided /dev/vfio/vfio is opened
   to signal that iommufd is providing this
v1: https://lore.kernel.org/r/0-v1-4991695894d8+211-vfio_iommufd_jgg@nvidia.com

Jason Gunthorpe (11):
  vfio: Move vfio_device driver open/close code to a function
  vfio: Move vfio_device_assign_container() into
    vfio_device_first_open()
  vfio: Rename vfio_device_assign/unassign_container()
  vfio: Move storage of allow_unsafe_interrupts to vfio_main.c
  vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for
    vfio_file_enforced_coherent()
  vfio-iommufd: Allow iommufd to be used in place of a container fd
  vfio-iommufd: Support iommufd for physical VFIO devices
  vfio-iommufd: Support iommufd for emulated VFIO devices
  vfio: Move container related MODULE_ALIAS statements into container.c
  vfio: Make vfio_container optionally compiled
  iommufd: Allow iommufd to supply /dev/vfio/vfio

 drivers/gpu/drm/i915/gvt/kvmgt.c              |   3 +
 drivers/iommu/iommufd/Kconfig                 |  12 +
 drivers/iommu/iommufd/main.c                  |  36 ++
 drivers/s390/cio/vfio_ccw_ops.c               |   3 +
 drivers/s390/crypto/vfio_ap_ops.c             |   3 +
 drivers/vfio/Kconfig                          |  36 +-
 drivers/vfio/Makefile                         |   5 +-
 drivers/vfio/container.c                      | 141 ++------
 drivers/vfio/fsl-mc/vfio_fsl_mc.c             |   3 +
 drivers/vfio/iommufd.c                        | 157 ++++++++
 .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c    |   6 +
 drivers/vfio/pci/mlx5/main.c                  |   3 +
 drivers/vfio/pci/vfio_pci.c                   |   3 +
 drivers/vfio/platform/vfio_amba.c             |   3 +
 drivers/vfio/platform/vfio_platform.c         |   3 +
 drivers/vfio/vfio.h                           | 100 +++++-
 drivers/vfio/vfio_iommu_type1.c               |   5 +-
 drivers/vfio/vfio_main.c                      | 338 ++++++++++++++----
 include/linux/vfio.h                          |  39 ++
 19 files changed, 700 insertions(+), 199 deletions(-)
 create mode 100644 drivers/vfio/iommufd.c


base-commit: ca3067007d4f2aa7f3a5375bd256839e08a09453
-- 
2.38.1


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

end of thread, other threads:[~2022-11-15  5:41 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  0:52 [PATCH v2 00/11] Connect VFIO to IOMMUFD Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 01/11] vfio: Move vfio_device driver open/close code to a function Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 02/11] vfio: Move vfio_device_assign_container() into vfio_device_first_open() Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 03/11] vfio: Rename vfio_device_assign/unassign_container() Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 04/11] vfio: Move storage of allow_unsafe_interrupts to vfio_main.c Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 05/11] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent() Jason Gunthorpe
2022-11-10  2:48   ` Tian, Kevin
2022-11-08  0:52 ` [PATCH v2 06/11] vfio-iommufd: Allow iommufd to be used in place of a container fd Jason Gunthorpe
2022-11-10  2:51   ` Tian, Kevin
2022-11-08  0:52 ` [PATCH v2 07/11] vfio-iommufd: Support iommufd for physical VFIO devices Jason Gunthorpe
2022-11-08  6:10   ` Nicolin Chen
2022-11-08  7:41     ` Yi Liu
2022-11-08 17:51       ` Jason Gunthorpe
2022-11-10  3:12         ` Tian, Kevin
2022-11-08 17:48     ` Jason Gunthorpe
2022-11-10  3:11   ` Tian, Kevin
2022-11-10 17:20     ` Jason Gunthorpe
2022-11-10 23:58       ` Tian, Kevin
2022-11-11  4:12   ` Yi Liu
2022-11-14 14:47     ` Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 08/11] vfio-iommufd: Support iommufd for emulated " Jason Gunthorpe
2022-11-10  5:33   ` Tian, Kevin
2022-11-08  0:52 ` [PATCH v2 09/11] vfio: Move container related MODULE_ALIAS statements into container.c Jason Gunthorpe
2022-11-10  5:34   ` Tian, Kevin
2022-11-11  4:13   ` Yi Liu
2022-11-08  0:52 ` [PATCH v2 10/11] vfio: Make vfio_container optionally compiled Jason Gunthorpe
2022-11-08 22:28   ` Alex Williamson
2022-11-09  0:54     ` Jason Gunthorpe
2022-11-09 17:18       ` Alex Williamson
2022-11-09 19:52         ` Jason Gunthorpe
2022-11-10  6:57           ` Tian, Kevin
2022-11-10 17:10             ` Alex Williamson
2022-11-10 17:52             ` Jason Gunthorpe
2022-11-08  0:52 ` [PATCH v2 11/11] iommufd: Allow iommufd to supply /dev/vfio/vfio Jason Gunthorpe
2022-11-10  7:01   ` Tian, Kevin
2022-11-11  4:16   ` Yi Liu
2022-11-11  6:38     ` Yi Liu
2022-11-14 14:50     ` Jason Gunthorpe
2022-11-08  9:19 ` [PATCH v2 00/11] Connect VFIO to IOMMUFD Nicolin Chen
2022-11-08 15:18   ` Yi Liu
2022-11-09 16:57     ` Jason Gunthorpe
2022-11-14 12:51       ` Yi Liu
2022-11-14 14:37         ` Yang, Lixiao
2022-11-15  5:41           ` He, Yu
2022-11-14 14:38         ` Jason Gunthorpe
2022-11-14 14:42           ` Yi Liu
2022-11-15  1:16       ` Matthew Rosato
2022-11-09  9:03 ` Tian, Kevin
2022-11-09 12:48   ` Jason Gunthorpe
2022-11-10  2:16     ` Tian, Kevin
2022-11-11  3:01 ` Matthew Rosato
2022-11-14 14:23   ` Jason Gunthorpe
2022-11-14 14:55     ` Matthew Rosato
2022-11-14 14:59       ` Jason Gunthorpe
2022-11-14 15:21         ` Matthew Rosato
2022-11-14 19:27           ` Jason Gunthorpe

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