xref: /openbmc/linux/drivers/iommu/iommufd/Kconfig (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
12ff4bed7SJason Gunthorpe# SPDX-License-Identifier: GPL-2.0-only
22ff4bed7SJason Gunthorpeconfig IOMMUFD
32ff4bed7SJason Gunthorpe	tristate "IOMMU Userspace API"
42ff4bed7SJason Gunthorpe	select INTERVAL_TREE
52ff4bed7SJason Gunthorpe	select INTERVAL_TREE_SPAN_ITER
62ff4bed7SJason Gunthorpe	select IOMMU_API
72ff4bed7SJason Gunthorpe	default n
82ff4bed7SJason Gunthorpe	help
92ff4bed7SJason Gunthorpe	  Provides /dev/iommu, the user API to control the IOMMU subsystem as
102ff4bed7SJason Gunthorpe	  it relates to managing IO page tables that point at user space memory.
112ff4bed7SJason Gunthorpe
122ff4bed7SJason Gunthorpe	  If you don't know what to do here, say N.
13f4b20bb3SJason Gunthorpe
14f4b20bb3SJason Gunthorpeif IOMMUFD
1501f70cbbSJason Gunthorpeconfig IOMMUFD_VFIO_CONTAINER
1601f70cbbSJason Gunthorpe	bool "IOMMUFD provides the VFIO container /dev/vfio/vfio"
17*c1cce6d0SYi Liu	depends on VFIO_GROUP && !VFIO_CONTAINER
18*c1cce6d0SYi Liu	default VFIO_GROUP && !VFIO_CONTAINER
1901f70cbbSJason Gunthorpe	help
2001f70cbbSJason Gunthorpe	  IOMMUFD will provide /dev/vfio/vfio instead of VFIO. This relies on
2101f70cbbSJason Gunthorpe	  IOMMUFD providing compatibility emulation to give the same ioctls.
2201f70cbbSJason Gunthorpe	  It provides an option to build a kernel with legacy VFIO components
2301f70cbbSJason Gunthorpe	  removed.
2401f70cbbSJason Gunthorpe
2501f70cbbSJason Gunthorpe	  IOMMUFD VFIO container emulation is known to lack certain features
26c9a397ceSJason Gunthorpe	  of the native VFIO container, such as peer-to-peer
2701f70cbbSJason Gunthorpe	  DMA mapping, PPC IOMMU support, as well as other potentially
2801f70cbbSJason Gunthorpe	  undiscovered gaps.  This option is currently intended for the
2901f70cbbSJason Gunthorpe	  purpose of testing IOMMUFD with unmodified userspace supporting VFIO
3001f70cbbSJason Gunthorpe	  and making use of the Type1 VFIO IOMMU backend.  General purpose
3101f70cbbSJason Gunthorpe	  enabling of this option is currently discouraged.
3201f70cbbSJason Gunthorpe
3301f70cbbSJason Gunthorpe	  Unless testing IOMMUFD, say N here.
3401f70cbbSJason Gunthorpe
35f4b20bb3SJason Gunthorpeconfig IOMMUFD_TEST
36f4b20bb3SJason Gunthorpe	bool "IOMMU Userspace API Test support"
37f4b20bb3SJason Gunthorpe	depends on DEBUG_KERNEL
38f4b20bb3SJason Gunthorpe	depends on FAULT_INJECTION
39f4b20bb3SJason Gunthorpe	depends on RUNTIME_TESTING_MENU
40f4b20bb3SJason Gunthorpe	default n
41f4b20bb3SJason Gunthorpe	help
42f4b20bb3SJason Gunthorpe	  This is dangerous, do not enable unless running
43f4b20bb3SJason Gunthorpe	  tools/testing/selftests/iommu
44f4b20bb3SJason Gunthorpeendif
45