2019-05-19 13:07:45 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2012-07-31 08:16:22 -06:00
|
|
|
menuconfig VFIO
|
|
|
|
|
tristate "VFIO Non-Privileged userspace driver framework"
|
2021-02-23 15:17:46 -04:00
|
|
|
select IOMMU_API
|
2022-11-29 16:31:50 -04:00
|
|
|
depends on IOMMUFD || !IOMMUFD
|
2022-09-08 21:34:43 +03:00
|
|
|
select INTERVAL_TREE
|
2023-07-18 06:55:50 -07:00
|
|
|
select VFIO_GROUP if SPAPR_TCE_IOMMU || IOMMUFD=n
|
|
|
|
|
select VFIO_DEVICE_CDEV if !VFIO_GROUP
|
2022-11-29 16:31:54 -04:00
|
|
|
select VFIO_CONTAINER if IOMMUFD=n
|
2012-07-31 08:16:22 -06:00
|
|
|
help
|
|
|
|
|
VFIO provides a framework for secure userspace device drivers.
|
2019-06-27 15:39:22 -03:00
|
|
|
See Documentation/driver-api/vfio.rst for more details.
|
2012-07-31 08:16:22 -06:00
|
|
|
|
|
|
|
|
If you don't know what to do here, say N.
|
2012-07-31 08:16:24 -06:00
|
|
|
|
2021-08-26 13:39:11 +03:00
|
|
|
if VFIO
|
2023-07-18 06:55:43 -07:00
|
|
|
config VFIO_DEVICE_CDEV
|
|
|
|
|
bool "Support for the VFIO cdev /dev/vfio/devices/vfioX"
|
|
|
|
|
depends on IOMMUFD && !SPAPR_TCE_IOMMU
|
2023-07-18 06:55:50 -07:00
|
|
|
default !VFIO_GROUP
|
2023-07-18 06:55:43 -07:00
|
|
|
help
|
|
|
|
|
The VFIO device cdev is another way for userspace to get device
|
|
|
|
|
access. Userspace gets device fd by opening device cdev under
|
|
|
|
|
/dev/vfio/devices/vfioX, and then bind the device fd with an iommufd
|
|
|
|
|
to set up secure DMA context for device access. This interface does
|
|
|
|
|
not support noiommu.
|
|
|
|
|
|
|
|
|
|
If you don't know what to do here, say N.
|
|
|
|
|
|
2023-07-18 06:55:50 -07:00
|
|
|
config VFIO_GROUP
|
|
|
|
|
bool "Support for the VFIO group /dev/vfio/$group_id"
|
|
|
|
|
default y
|
|
|
|
|
help
|
|
|
|
|
VFIO group support provides the traditional model for accessing
|
|
|
|
|
devices through VFIO and is used by the majority of userspace
|
|
|
|
|
applications and drivers making use of VFIO.
|
|
|
|
|
|
|
|
|
|
If you don't know what to do here, say Y.
|
|
|
|
|
|
2022-11-29 16:31:54 -04:00
|
|
|
config VFIO_CONTAINER
|
|
|
|
|
bool "Support for the VFIO container /dev/vfio/vfio"
|
|
|
|
|
select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
|
2023-07-18 06:55:50 -07:00
|
|
|
depends on VFIO_GROUP
|
2022-11-29 16:31:54 -04:00
|
|
|
default y
|
|
|
|
|
help
|
|
|
|
|
The VFIO container is the classic interface to VFIO for establishing
|
|
|
|
|
IOMMU mappings. If N is selected here then IOMMUFD must be used to
|
|
|
|
|
manage the mappings.
|
|
|
|
|
|
|
|
|
|
Unless testing IOMMUFD say Y here.
|
|
|
|
|
|
|
|
|
|
if VFIO_CONTAINER
|
2021-08-26 13:39:11 +03:00
|
|
|
config VFIO_IOMMU_TYPE1
|
|
|
|
|
tristate
|
|
|
|
|
default n
|
|
|
|
|
|
|
|
|
|
config VFIO_IOMMU_SPAPR_TCE
|
|
|
|
|
tristate
|
|
|
|
|
depends on SPAPR_TCE_IOMMU
|
|
|
|
|
default VFIO
|
2023-01-18 13:50:28 -04:00
|
|
|
endif
|
2021-08-26 13:39:11 +03:00
|
|
|
|
2021-07-16 15:39:12 -03:00
|
|
|
config VFIO_NOIOMMU
|
2015-12-21 15:13:33 -07:00
|
|
|
bool "VFIO No-IOMMU support"
|
2023-07-18 06:55:50 -07:00
|
|
|
depends on VFIO_GROUP
|
2015-12-21 15:13:33 -07:00
|
|
|
help
|
|
|
|
|
VFIO is built on the ability to isolate devices using the IOMMU.
|
|
|
|
|
Only with an IOMMU can userspace access to DMA capable devices be
|
|
|
|
|
considered secure. VFIO No-IOMMU mode enables IOMMU groups for
|
|
|
|
|
devices without IOMMU backing for the purpose of re-using the VFIO
|
|
|
|
|
infrastructure in a non-secure mode. Use of this mode will result
|
|
|
|
|
in an unsupportable kernel and will therefore taint the kernel.
|
|
|
|
|
Device assignment to virtual machines is also not possible with
|
|
|
|
|
this mode since there is no IOMMU to provide DMA translation.
|
|
|
|
|
|
|
|
|
|
If you don't know what to do here, say N.
|
2022-11-29 16:31:54 -04:00
|
|
|
|
|
|
|
|
config VFIO_VIRQFD
|
2022-12-15 13:12:15 -08:00
|
|
|
bool
|
2022-11-29 16:31:54 -04:00
|
|
|
select EVENTFD
|
|
|
|
|
default n
|
2015-12-21 15:13:33 -07:00
|
|
|
|
2023-11-06 15:22:23 +08:00
|
|
|
config VFIO_DEBUGFS
|
|
|
|
|
bool "Export VFIO internals in DebugFS"
|
|
|
|
|
depends on DEBUG_FS
|
|
|
|
|
help
|
|
|
|
|
Allows exposure of VFIO device internals. This option enables
|
|
|
|
|
the use of debugfs by VFIO drivers as required. The device can
|
|
|
|
|
cause the VFIO code create a top-level debug/vfio directory
|
|
|
|
|
during initialization, and then populate a subdirectory with
|
|
|
|
|
entries as required.
|
|
|
|
|
|
2012-07-31 08:16:24 -06:00
|
|
|
source "drivers/vfio/pci/Kconfig"
|
2015-03-16 14:08:44 -06:00
|
|
|
source "drivers/vfio/platform/Kconfig"
|
2016-11-17 02:16:13 +05:30
|
|
|
source "drivers/vfio/mdev/Kconfig"
|
2020-10-05 20:36:45 +03:00
|
|
|
source "drivers/vfio/fsl-mc/Kconfig"
|
2023-05-31 18:15:57 +05:30
|
|
|
source "drivers/vfio/cdx/Kconfig"
|
2021-08-26 13:39:11 +03:00
|
|
|
endif
|
|
|
|
|
|
2015-09-18 22:29:50 +08:00
|
|
|
source "virt/lib/Kconfig"
|