xref: /openbmc/linux/drivers/vfio/Kconfig (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
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
7*c1cce6d0SYi Liu	select VFIO_GROUP if SPAPR_TCE_IOMMU || IOMMUFD=n
8*c1cce6d0SYi 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
20*c1cce6d0SYi 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
30*c1cce6d0SYi Liuconfig VFIO_GROUP
31*c1cce6d0SYi Liu	bool "Support for the VFIO group /dev/vfio/$group_id"
32*c1cce6d0SYi Liu	default y
33*c1cce6d0SYi Liu	help
34*c1cce6d0SYi Liu	   VFIO group support provides the traditional model for accessing
35*c1cce6d0SYi Liu	   devices through VFIO and is used by the majority of userspace
36*c1cce6d0SYi Liu	   applications and drivers making use of VFIO.
37*c1cce6d0SYi Liu
38*c1cce6d0SYi Liu	   If you don't know what to do here, say Y.
39*c1cce6d0SYi 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)
43*c1cce6d0SYi 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"
65*c1cce6d0SYi 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
8389e1f7d4SAlex Williamsonsource "drivers/vfio/pci/Kconfig"
8453161532SAntonios Motakissource "drivers/vfio/platform/Kconfig"
857b96953bSKirti Wankhedesource "drivers/vfio/mdev/Kconfig"
86fb1ff4c1SBharat Bhushansource "drivers/vfio/fsl-mc/Kconfig"
87234489acSNipun Guptasource "drivers/vfio/cdx/Kconfig"
8885c94dcfSJason Gunthorpeendif
8985c94dcfSJason Gunthorpe
906d7425f1SFeng Wusource "virt/lib/Kconfig"
91