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