Skip to content

Commit edcd69a

Browse files
Jean-Philippe Bruckermstsirkin
authored andcommitted
iommu: Add virtio-iommu driver
The virtio IOMMU is a para-virtualized device, allowing to send IOMMU requests such as map/unmap over virtio transport without emulating page tables. This implementation handles ATTACH, DETACH, MAP and UNMAP requests. The bulk of the code transforms calls coming from the IOMMU API into corresponding virtio requests. Mappings are kept in an interval tree instead of page tables. A little more work is required for modular and x86 support, so for the moment the driver depends on CONFIG_VIRTIO=y and CONFIG_ARM64. Tested-by: Bharat Bhushan <[email protected]> Tested-by: Eric Auger <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 59b099a commit edcd69a

File tree

6 files changed

+1042
-0
lines changed

6 files changed

+1042
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16807,6 +16807,13 @@ S: Maintained
1680716807
F: drivers/virtio/virtio_input.c
1680816808
F: include/uapi/linux/virtio_input.h
1680916809

16810+
VIRTIO IOMMU DRIVER
16811+
M: Jean-Philippe Brucker <[email protected]>
16812+
16813+
S: Maintained
16814+
F: drivers/iommu/virtio-iommu.c
16815+
F: include/uapi/linux/virtio_iommu.h
16816+
1681016817
VIRTUAL BOX GUEST DEVICE DRIVER
1681116818
M: Hans de Goede <[email protected]>
1681216819
M: Arnd Bergmann <[email protected]>

drivers/iommu/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,4 +473,15 @@ config HYPERV_IOMMU
473473
Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
474474
guests to run with x2APIC mode enabled.
475475

476+
config VIRTIO_IOMMU
477+
bool "Virtio IOMMU driver"
478+
depends on VIRTIO=y
479+
depends on ARM64
480+
select IOMMU_API
481+
select INTERVAL_TREE
482+
help
483+
Para-virtualised IOMMU driver with virtio.
484+
485+
Say Y here if you intend to run this kernel as a guest.
486+
476487
endif # IOMMU_SUPPORT

drivers/iommu/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ obj-$(CONFIG_FSL_PAMU) += fsl_pamu.o fsl_pamu_domain.o
3333
obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
3434
obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o
3535
obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
36+
obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o

0 commit comments

Comments
 (0)