Skip to content

RFC virtio-iommu: Add VT-d IO page table

Tina Zhang linux-iommu lkml virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5iommu/virtio-iommu: Correct the values of granule and nr_pagesdrivers/iommu/virtio-iommu.c+2 -20 replies
2/5iommu/vt-d: Add generic IO page table supportdrivers/iommu/intel/Kconfig drivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h +2 more+107 -03 replies
3/5iommu/io-pgtable: Introduce struct vtd_cfginclude/linux/io-pgtable.h+5 -00 replies
4/5iommu/vt-d: Adapt alloc_pgtable interface to be used by othersdrivers/iommu/intel/iommu.c+66 -30 replies
5/5iommu/virtio-iommu: Support attaching VT-d IO pgtabledrivers/iommu/virtio-iommu.c include/uapi/linux/virtio_iommu.h+49 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/5] virtio-iommu: Add VT-d IO page table

The proposal about virtio-iommu support page tables is being discussed in the virtio-comment mailing list[1]. This patch-set based on Jean's virtio-iommu/pgtables branch[2] tries to follow the proposal and add the basic VT-d IO page table support to virtio-iommu.

On Intel platform with VT-d nested translation enabled, there are two main benefits for enabling virtual IOMMU support VT-d IO page table:
1) Allowing vSVM (aka vSVA) usage. Virtual Shared Virtual Addressing (vSVA) allows the virtual processor and virtual device to use the same virtual addresses.
2) Accelerating DMA buffer map operation for vIOVA usage by removing the context switch on DMA buffer map operation.
(Note: this patch-set doesn't include the whole patch-set for enabling vSVM on virtio-iommu, only includes the part for vIOVA case. However, the vSVM enabling patch-set needs to base on this patch-set.)

There are three changes in this patch-set:
1) The first patch is a bug fixing patch that tries to resolve an issue about IOTLB invalidation request with incorrect page size.
2) The next 3 patches are about adding generic IO page table support to VT-d driver.
3) The last one introduces the VT-d page format table to virtio-iommu driver.

The patch-set is also available at github:
https://github.com/TinaZhangZW/linux/tree/vt-d-pgtable

The QEMU part is available here:
https://github.com/TinaZhangZW/qemu/tree/virtio-iommu/vt-d-pgtable

[1]:https://lists.oasis-open.org/archives/virtio-comment/202310/msg00018.html [2]:https://jpbrucker.net/git/linux/log/?h=virtio-iommu/pgtables

Tina Zhang (5):
iommu/virtio-iommu: Correct the values of granule and nr_pages iommu/vt-d: Add generic IO page table support iommu/io-pgtable: Introduce struct vtd_cfg iommu/vt-d: Adapt alloc_pgtable interface to be used by others iommu/virtio-iommu: Support attaching VT-d IO pgtable

 drivers/iommu/intel/Kconfig       |   1 +
 drivers/iommu/intel/iommu.c       | 157 ++++++++++++++++++++++++++++++
 drivers/iommu/intel/iommu.h       |   7 ++
 drivers/iommu/io-pgtable.c        |   3 +
 drivers/iommu/virtio-iommu.c      |  27 ++++-
 include/linux/io-pgtable.h        |   7 ++
 include/uapi/linux/virtio_iommu.h |  26 +++++
 7 files changed, 226 insertions(+), 2 deletions(-)
Signature · 1 line
2.39.3