Commit edcd69ab authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Michael S. Tsirkin
Browse files

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: default avatarBharat Bhushan <bharat.bhushan@nxp.com>
Tested-by: default avatarEric Auger <eric.auger@redhat.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 59b099a6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -16807,6 +16807,13 @@ S: Maintained
F:	drivers/virtio/virtio_input.c
F:	include/uapi/linux/virtio_input.h

VIRTIO IOMMU DRIVER
M:	Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
L:	virtualization@lists.linux-foundation.org
S:	Maintained
F:	drivers/iommu/virtio-iommu.c
F:	include/uapi/linux/virtio_iommu.h

VIRTUAL BOX GUEST DEVICE DRIVER
M:	Hans de Goede <hdegoede@redhat.com>
M:	Arnd Bergmann <arnd@arndb.de>
+11 −0
Original line number Diff line number Diff line
@@ -473,4 +473,15 @@ config HYPERV_IOMMU
	  Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
	  guests to run with x2APIC mode enabled.

config VIRTIO_IOMMU
	bool "Virtio IOMMU driver"
	depends on VIRTIO=y
	depends on ARM64
	select IOMMU_API
	select INTERVAL_TREE
	help
	  Para-virtualised IOMMU driver with virtio.

	  Say Y here if you intend to run this kernel as a guest.

endif # IOMMU_SUPPORT
+1 −0
Original line number Diff line number Diff line
@@ -33,3 +33,4 @@ obj-$(CONFIG_FSL_PAMU) += fsl_pamu.o fsl_pamu_domain.o
obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
obj-$(CONFIG_QCOM_IOMMU) += qcom_iommu.o
obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
+916 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -43,5 +43,6 @@
#define VIRTIO_ID_INPUT        18 /* virtio input */
#define VIRTIO_ID_VSOCK        19 /* virtio vsock transport */
#define VIRTIO_ID_CRYPTO       20 /* virtio crypto */
#define VIRTIO_ID_IOMMU        23 /* virtio IOMMU */

#endif /* _LINUX_VIRTIO_IDS_H */
Loading