xref: /linux/drivers/vfio/Kconfig (revision 06d07429858317ded2db7986113a9e0129cd599b)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2cba3345cSAlex Williamsonmenuconfig VFIO
3cba3345cSAlex Williamson	tristate "VFIO Non-Privileged userspace driver framework"
4179209faSJason Gunthorpe	select IOMMU_API
52a3dab19SJason Gunthorpe	depends on IOMMUFD || !IOMMUFD
680c4b92aSYishai Hadas	select INTERVAL_TREE
7c1cce6d0SYi Liu	select VFIO_GROUP if SPAPR_TCE_IOMMU || IOMMUFD=n
8c1cce6d0SYi Liu	select VFIO_DEVICE_CDEV if !VFIO_GROUP
9e5a9ec7eSJason Gunthorpe	select VFIO_CONTAINER if IOMMUFD=n
10cba3345cSAlex Williamson	help
11cba3345cSAlex Williamson	  VFIO provides a framework for secure userspace device drivers.
12baa293e9SMauro Carvalho Chehab	  See Documentation/driver-api/vfio.rst for more details.
13cba3345cSAlex Williamson
14cba3345cSAlex Williamson	  If you don't know what to do here, say N.
1589e1f7d4SAlex Williamson
1685c94dcfSJason Gunthorpeif VFIO
178b6f173aSYi Liuconfig VFIO_DEVICE_CDEV
188b6f173aSYi Liu	bool "Support for the VFIO cdev /dev/vfio/devices/vfioX"
198b6f173aSYi Liu	depends on IOMMUFD && !SPAPR_TCE_IOMMU
20c1cce6d0SYi Liu	default !VFIO_GROUP
218b6f173aSYi Liu	help
228b6f173aSYi Liu	  The VFIO device cdev is another way for userspace to get device
238b6f173aSYi Liu	  access. Userspace gets device fd by opening device cdev under
248b6f173aSYi Liu	  /dev/vfio/devices/vfioX, and then bind the device fd with an iommufd
258b6f173aSYi Liu	  to set up secure DMA context for device access.  This interface does
268b6f173aSYi Liu	  not support noiommu.
278b6f173aSYi Liu
288b6f173aSYi Liu	  If you don't know what to do here, say N.
298b6f173aSYi Liu
30c1cce6d0SYi Liuconfig VFIO_GROUP
31c1cce6d0SYi Liu	bool "Support for the VFIO group /dev/vfio/$group_id"
32c1cce6d0SYi Liu	default y
33c1cce6d0SYi Liu	help
34c1cce6d0SYi Liu	   VFIO group support provides the traditional model for accessing
35c1cce6d0SYi Liu	   devices through VFIO and is used by the majority of userspace
36c1cce6d0SYi Liu	   applications and drivers making use of VFIO.
37c1cce6d0SYi Liu
38c1cce6d0SYi Liu	   If you don't know what to do here, say Y.
39c1cce6d0SYi Liu
40e5a9ec7eSJason Gunthorpeconfig VFIO_CONTAINER
41e5a9ec7eSJason Gunthorpe	bool "Support for the VFIO container /dev/vfio/vfio"
42e5a9ec7eSJason Gunthorpe	select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
43c1cce6d0SYi Liu	depends on VFIO_GROUP
44e5a9ec7eSJason Gunthorpe	default y
45e5a9ec7eSJason Gunthorpe	help
46e5a9ec7eSJason Gunthorpe	  The VFIO container is the classic interface to VFIO for establishing
47e5a9ec7eSJason Gunthorpe	  IOMMU mappings. If N is selected here then IOMMUFD must be used to
48e5a9ec7eSJason Gunthorpe	  manage the mappings.
49e5a9ec7eSJason Gunthorpe
50e5a9ec7eSJason Gunthorpe	  Unless testing IOMMUFD say Y here.
51e5a9ec7eSJason Gunthorpe
52e5a9ec7eSJason Gunthorpeif VFIO_CONTAINER
5385c94dcfSJason Gunthorpeconfig VFIO_IOMMU_TYPE1
5485c94dcfSJason Gunthorpe	tristate
5585c94dcfSJason Gunthorpe	default n
5685c94dcfSJason Gunthorpe
5785c94dcfSJason Gunthorpeconfig VFIO_IOMMU_SPAPR_TCE
5885c94dcfSJason Gunthorpe	tristate
5985c94dcfSJason Gunthorpe	depends on SPAPR_TCE_IOMMU
6085c94dcfSJason Gunthorpe	default VFIO
61c9a397ceSJason Gunthorpeendif
6285c94dcfSJason Gunthorpe
6326c22cfdSJason Gunthorpeconfig VFIO_NOIOMMU
6403a76b60SAlex Williamson	bool "VFIO No-IOMMU support"
65c1cce6d0SYi Liu	depends on VFIO_GROUP
6603a76b60SAlex Williamson	help
6703a76b60SAlex Williamson	  VFIO is built on the ability to isolate devices using the IOMMU.
6803a76b60SAlex Williamson	  Only with an IOMMU can userspace access to DMA capable devices be
6903a76b60SAlex Williamson	  considered secure.  VFIO No-IOMMU mode enables IOMMU groups for
7003a76b60SAlex Williamson	  devices without IOMMU backing for the purpose of re-using the VFIO
7103a76b60SAlex Williamson	  infrastructure in a non-secure mode.  Use of this mode will result
7203a76b60SAlex Williamson	  in an unsupportable kernel and will therefore taint the kernel.
7303a76b60SAlex Williamson	  Device assignment to virtual machines is also not possible with
7403a76b60SAlex Williamson	  this mode since there is no IOMMU to provide DMA translation.
7503a76b60SAlex Williamson
7603a76b60SAlex Williamson	  If you don't know what to do here, say N.
77e5a9ec7eSJason Gunthorpe
78e5a9ec7eSJason Gunthorpeconfig VFIO_VIRQFD
79785d21baSLinus Torvalds	bool
80e5a9ec7eSJason Gunthorpe	select EVENTFD
81e5a9ec7eSJason Gunthorpe	default n
8203a76b60SAlex Williamson
83*2202844eSLongfang Liuconfig VFIO_DEBUGFS
84*2202844eSLongfang Liu	bool "Export VFIO internals in DebugFS"
85*2202844eSLongfang Liu	depends on DEBUG_FS
86*2202844eSLongfang Liu	help
87*2202844eSLongfang Liu	  Allows exposure of VFIO device internals. This option enables
88*2202844eSLongfang Liu	  the use of debugfs by VFIO drivers as required. The device can
89*2202844eSLongfang Liu	  cause the VFIO code create a top-level debug/vfio directory
90*2202844eSLongfang Liu	  during initialization, and then populate a subdirectory with
91*2202844eSLongfang Liu	  entries as required.
92*2202844eSLongfang Liu
9389e1f7d4SAlex Williamsonsource "drivers/vfio/pci/Kconfig"
9453161532SAntonios Motakissource "drivers/vfio/platform/Kconfig"
957b96953bSKirti Wankhedesource "drivers/vfio/mdev/Kconfig"
96fb1ff4c1SBharat Bhushansource "drivers/vfio/fsl-mc/Kconfig"
97234489acSNipun Guptasource "drivers/vfio/cdx/Kconfig"
9885c94dcfSJason Gunthorpeendif
9985c94dcfSJason Gunthorpe
1006d7425f1SFeng Wusource "virt/lib/Kconfig"
101