public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Connect VFIO to IOMMUFD
@ 2022-11-29 20:31 Jason Gunthorpe
  2022-11-29 20:31 ` [PATCH v4 01/10] vfio: Move vfio_device driver open/close code to a function Jason Gunthorpe
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Jason Gunthorpe @ 2022-11-29 20:31 UTC (permalink / raw)
  Cc: Alex Williamson, Lu Baolu, Cornelia Huck, Eric Auger, Kevin Tian,
	kvm, Lixiao Yang, Matthew Rosato, Nicolin Chen, Yi Liu, Yu He

[ As with the iommufd series, this will be the last posting unless
something major happens, futher fixes will be in new commits ]

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-v6-a196d26f289e+11787-iommufd_jgg@nvidia.com

v4:
 - Change the assertion in vfio_group_has_iommu to be clearer
 - Use vfio_group_has_iommu()
 - Remove allow_unsafe_interrupts stuff
 - Update IOMMUFD_VFIO_CONTAINER kconfig description
 - Use DEBUG_KERNEL insted of RUNTIME_TESTING_MENU for IOMMUFD_TEST kconfig
v3: https://lore.kernel.org/r/0-v3-50561e12d92b+313-vfio_iommufd_jgg@nvidia.com
 - Fix iommufd_attached to be only used in the vfio_iommufd_physical_*
   funcs
 - Always check for iommufd before invoking a iommufd function
 - Fix mismatch between vfio_pin_pages and iommufd_access when the IOVA
   is not aligned. Resolves problems on S390
v2: https://lore.kernel.org/r/0-v2-65016290f146+33e-vfio_iommufd_jgg@nvidia.com
 - 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

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

Jason Gunthorpe (10):
  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: 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                 |  20 +
 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                        | 158 ++++++++
 .../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                           |  98 ++++-
 drivers/vfio/vfio_main.c                      | 347 ++++++++++++++----
 include/linux/vfio.h                          |  39 ++
 18 files changed, 714 insertions(+), 196 deletions(-)
 create mode 100644 drivers/vfio/iommufd.c


base-commit: d0bc1f9dffb03f939c4fc988e35b9f4bd995683f
-- 
2.38.1


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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29 20:31 [PATCH v4 00/10] Connect VFIO to IOMMUFD Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 01/10] vfio: Move vfio_device driver open/close code to a function Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 02/10] vfio: Move vfio_device_assign_container() into vfio_device_first_open() Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 03/10] vfio: Rename vfio_device_assign/unassign_container() Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 04/10] vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent() Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 05/10] vfio-iommufd: Allow iommufd to be used in place of a container fd Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 06/10] vfio-iommufd: Support iommufd for physical VFIO devices Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 07/10] vfio-iommufd: Support iommufd for emulated " Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 08/10] vfio: Move container related MODULE_ALIAS statements into container.c Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 09/10] vfio: Make vfio_container optionally compiled Jason Gunthorpe
2022-11-29 20:31 ` [PATCH v4 10/10] iommufd: Allow iommufd to supply /dev/vfio/vfio Jason Gunthorpe
2022-11-30 20:34 ` [PATCH v4 00/10] Connect VFIO to IOMMUFD Alex Williamson
2022-12-01  0:44   ` Jason Gunthorpe

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