| 1 |
# SPDX-License-Identifier: GPL-2.0-only |
| 2 |
config IOMMUFD_DRIVER_CORE |
| 3 |
bool |
| 4 |
default (IOMMUFD_DRIVER || IOMMUFD) if IOMMUFD!=n |
| 5 |
|
| 6 |
config IOMMUFD |
| 7 |
tristate "IOMMU Userspace API" |
| 8 |
select INTERVAL_TREE |
| 9 |
select INTERVAL_TREE_SPAN_ITER |
| 10 |
select IOMMU_API |
| 11 |
default n |
| 12 |
help |
| 13 |
Provides /dev/iommu, the user API to control the IOMMU subsystem as |
| 14 |
it relates to managing IO page tables that point at user space memory. |
| 15 |
|
| 16 |
If you don't know what to do here, say N. |
| 17 |
|
| 18 |
if IOMMUFD |
| 19 |
config IOMMUFD_VFIO_CONTAINER |
| 20 |
bool "IOMMUFD provides the VFIO container /dev/vfio/vfio" |
| 21 |
depends on VFIO_GROUP && !VFIO_CONTAINER |
| 22 |
default VFIO_GROUP && !VFIO_CONTAINER |
| 23 |
help |
| 24 |
IOMMUFD will provide /dev/vfio/vfio instead of VFIO. This relies on |
| 25 |
IOMMUFD providing compatibility emulation to give the same ioctls. |
| 26 |
It provides an option to build a kernel with legacy VFIO components |
| 27 |
removed. |
| 28 |
|
| 29 |
IOMMUFD VFIO container emulation is known to lack certain features |
| 30 |
of the native VFIO container, such as peer-to-peer |
| 31 |
DMA mapping, PPC IOMMU support, as well as other potentially |
| 32 |
undiscovered gaps. This option is currently intended for the |
| 33 |
purpose of testing IOMMUFD with unmodified userspace supporting VFIO |
| 34 |
and making use of the Type1 VFIO IOMMU backend. General purpose |
| 35 |
enabling of this option is currently discouraged. |
| 36 |
|
| 37 |
Unless testing IOMMUFD, say N here. |
| 38 |
|
| 39 |
config IOMMUFD_TEST |
| 40 |
bool "IOMMU Userspace API Test support" |
| 41 |
depends on DEBUG_KERNEL |
| 42 |
depends on FAULT_INJECTION |
| 43 |
depends on RUNTIME_TESTING_MENU |
| 44 |
depends on IOMMU_PT_AMDV1=y || IOMMUFD=IOMMU_PT_AMDV1 |
| 45 |
select DMA_SHARED_BUFFER |
| 46 |
select IOMMUFD_DRIVER |
| 47 |
default n |
| 48 |
help |
| 49 |
This is dangerous, do not enable unless running |
| 50 |
tools/testing/selftests/iommu |
| 51 |
endif |