xref: /linux/drivers/iommu/iommufd/Kconfig (revision bbfd5594756011167b8f8de9a00e0c946afda1e6)
12ff4bed7SJason Gunthorpe# SPDX-License-Identifier: GPL-2.0-only
27d4f46c2SNicolin Chenconfig IOMMUFD_DRIVER_CORE
3*ec031e1bSNicolin Chen	bool
47d4f46c2SNicolin Chen	default (IOMMUFD_DRIVER || IOMMUFD) if IOMMUFD!=n
57d4f46c2SNicolin Chen
62ff4bed7SJason Gunthorpeconfig IOMMUFD
72ff4bed7SJason Gunthorpe	tristate "IOMMU Userspace API"
82ff4bed7SJason Gunthorpe	select INTERVAL_TREE
92ff4bed7SJason Gunthorpe	select INTERVAL_TREE_SPAN_ITER
102ff4bed7SJason Gunthorpe	select IOMMU_API
112ff4bed7SJason Gunthorpe	default n
122ff4bed7SJason Gunthorpe	help
132ff4bed7SJason Gunthorpe	  Provides /dev/iommu, the user API to control the IOMMU subsystem as
142ff4bed7SJason Gunthorpe	  it relates to managing IO page tables that point at user space memory.
152ff4bed7SJason Gunthorpe
162ff4bed7SJason Gunthorpe	  If you don't know what to do here, say N.
17f4b20bb3SJason Gunthorpe
18f4b20bb3SJason Gunthorpeif IOMMUFD
1901f70cbbSJason Gunthorpeconfig IOMMUFD_VFIO_CONTAINER
2001f70cbbSJason Gunthorpe	bool "IOMMUFD provides the VFIO container /dev/vfio/vfio"
21c1cce6d0SYi Liu	depends on VFIO_GROUP && !VFIO_CONTAINER
22c1cce6d0SYi Liu	default VFIO_GROUP && !VFIO_CONTAINER
2301f70cbbSJason Gunthorpe	help
2401f70cbbSJason Gunthorpe	  IOMMUFD will provide /dev/vfio/vfio instead of VFIO. This relies on
2501f70cbbSJason Gunthorpe	  IOMMUFD providing compatibility emulation to give the same ioctls.
2601f70cbbSJason Gunthorpe	  It provides an option to build a kernel with legacy VFIO components
2701f70cbbSJason Gunthorpe	  removed.
2801f70cbbSJason Gunthorpe
2901f70cbbSJason Gunthorpe	  IOMMUFD VFIO container emulation is known to lack certain features
30c9a397ceSJason Gunthorpe	  of the native VFIO container, such as peer-to-peer
3101f70cbbSJason Gunthorpe	  DMA mapping, PPC IOMMU support, as well as other potentially
3201f70cbbSJason Gunthorpe	  undiscovered gaps.  This option is currently intended for the
3301f70cbbSJason Gunthorpe	  purpose of testing IOMMUFD with unmodified userspace supporting VFIO
3401f70cbbSJason Gunthorpe	  and making use of the Type1 VFIO IOMMU backend.  General purpose
3501f70cbbSJason Gunthorpe	  enabling of this option is currently discouraged.
3601f70cbbSJason Gunthorpe
3701f70cbbSJason Gunthorpe	  Unless testing IOMMUFD, say N here.
3801f70cbbSJason Gunthorpe
39f4b20bb3SJason Gunthorpeconfig IOMMUFD_TEST
40f4b20bb3SJason Gunthorpe	bool "IOMMU Userspace API Test support"
41f4b20bb3SJason Gunthorpe	depends on DEBUG_KERNEL
42f4b20bb3SJason Gunthorpe	depends on FAULT_INJECTION
43f4b20bb3SJason Gunthorpe	depends on RUNTIME_TESTING_MENU
4485413232SJason Gunthorpe	select IOMMUFD_DRIVER
45f4b20bb3SJason Gunthorpe	default n
46f4b20bb3SJason Gunthorpe	help
47f4b20bb3SJason Gunthorpe	  This is dangerous, do not enable unless running
48f4b20bb3SJason Gunthorpe	  tools/testing/selftests/iommu
49f4b20bb3SJason Gunthorpeendif
50