Skip to content

RFC virtio-pci: iommu support

Michael S. Tsirkin kvm lkml qemu-devel virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3virtio: add features for IOMMU controldrivers/virtio/virtio_ring.c include/uapi/linux/virtio_config.h+26 -20 replies
2/3vfio: report group noiommu statusDocumentation/vfio.txt drivers/vfio/pci/vfio_pci.c drivers/vfio/platform/vfio_platform_common.c +1 more+9 -42 replies
2/3vfio: report group noiommu statusDocumentation/vfio.txt drivers/vfio/pci/vfio_pci.c drivers/vfio/platform/vfio_platform_common.c +1 more+9 -40 replies
3/3vfio: add virtio pci quirkdrivers/vfio/pci/Makefile drivers/vfio/pci/vfio_pci.c drivers/vfio/pci/vfio_pci_private.h +1 more+148 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/3] virtio-pci: iommu support

This is an attempt to allow enabling IOMMU for DMA.
Design:
- new feature bit IOMMU_PLATFORM which means
host won't bypass IOMMU
- virtio core uses DMA API if it sees IOMMU_PLATFORM
- add quirk for vfio to disable device unless IOMMU_PLATFORM is set or the no-iommu mode is enabled
- while I'm not sure how it will be used, it seems like a good idea to also have ability to distinguish between a legacy device and one where iommu is bypassed intentionally. To this end, add another feature bit IOMMU_PASSTHROUGH. We don't acknowledge it if IOMMU_PLATFORM is set.

TODO:
- I'm not sure whether there are setups that mix IOMMU
and no-IOMMU configs. If so, failing on probe might not be the right thing to do, should fail binding to IOMMU group instead.

Michael S. Tsirkin (3):
virtio: add features for IOMMU control
vfio: report group noiommu status
vfio: add virtio pci quirk

 drivers/vfio/pci/vfio_pci_private.h          |   1 +
 include/uapi/linux/virtio_config.h           |  10 +-
 drivers/vfio/pci/vfio_pci.c                  |  13 ++-
 drivers/vfio/pci/vfio_pci_virtio.c           | 142 +++++++++++++++++++++++++++
 drivers/vfio/platform/vfio_platform_common.c |   2 +-
 drivers/vfio/vfio.c                          |   5 +-
 drivers/virtio/virtio_ring.c                 |  18 +++-
 Documentation/vfio.txt                       |   4 +-
 drivers/vfio/pci/Makefile                    |   1 +
 9 files changed, 190 insertions(+), 6 deletions(-)
 create mode 100644 drivers/vfio/pci/vfio_pci_virtio.c
Signature · 1 line
MST