xref: /linux/drivers/iommu/iommufd/Kconfig (revision 79d2e1919a2728ef49d938eb20ebd5903c14dfb0)
1# SPDX-License-Identifier: GPL-2.0-only
2config IOMMUFD_DRIVER_CORE
3	tristate
4	default (IOMMUFD_DRIVER || IOMMUFD) if IOMMUFD!=n
5
6config 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
18if IOMMUFD
19config 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
39config 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	select IOMMUFD_DRIVER
45	default n
46	help
47	  This is dangerous, do not enable unless running
48	  tools/testing/selftests/iommu
49endif
50