Kconfig 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. menuconfig VFIO
  3. tristate "VFIO Non-Privileged userspace driver framework"
  4. select IOMMU_API
  5. depends on IOMMUFD || !IOMMUFD
  6. select INTERVAL_TREE
  7. select VFIO_GROUP if SPAPR_TCE_IOMMU || IOMMUFD=n
  8. select VFIO_DEVICE_CDEV if !VFIO_GROUP
  9. select VFIO_CONTAINER if IOMMUFD=n
  10. help
  11. VFIO provides a framework for secure userspace device drivers.
  12. See Documentation/driver-api/vfio.rst for more details.
  13. If you don't know what to do here, say N.
  14. if VFIO
  15. config VFIO_DEVICE_CDEV
  16. bool "Support for the VFIO cdev /dev/vfio/devices/vfioX"
  17. depends on IOMMUFD && !SPAPR_TCE_IOMMU
  18. default !VFIO_GROUP
  19. help
  20. The VFIO device cdev is another way for userspace to get device
  21. access. Userspace gets device fd by opening device cdev under
  22. /dev/vfio/devices/vfioX, and then bind the device fd with an iommufd
  23. to set up secure DMA context for device access. This interface does
  24. not support noiommu.
  25. If you don't know what to do here, say N.
  26. config VFIO_GROUP
  27. bool "Support for the VFIO group /dev/vfio/$group_id"
  28. default y
  29. help
  30. VFIO group support provides the traditional model for accessing
  31. devices through VFIO and is used by the majority of userspace
  32. applications and drivers making use of VFIO.
  33. If you don't know what to do here, say Y.
  34. config VFIO_CONTAINER
  35. bool "Support for the VFIO container /dev/vfio/vfio"
  36. select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
  37. depends on VFIO_GROUP
  38. default y
  39. help
  40. The VFIO container is the classic interface to VFIO for establishing
  41. IOMMU mappings. If N is selected here then IOMMUFD must be used to
  42. manage the mappings.
  43. Unless testing IOMMUFD say Y here.
  44. if VFIO_CONTAINER
  45. config VFIO_IOMMU_TYPE1
  46. tristate
  47. default n
  48. config VFIO_IOMMU_SPAPR_TCE
  49. tristate
  50. depends on SPAPR_TCE_IOMMU
  51. default VFIO
  52. endif
  53. config VFIO_NOIOMMU
  54. bool "VFIO No-IOMMU support"
  55. depends on VFIO_GROUP
  56. help
  57. VFIO is built on the ability to isolate devices using the IOMMU.
  58. Only with an IOMMU can userspace access to DMA capable devices be
  59. considered secure. VFIO No-IOMMU mode enables IOMMU groups for
  60. devices without IOMMU backing for the purpose of re-using the VFIO
  61. infrastructure in a non-secure mode. Use of this mode will result
  62. in an unsupportable kernel and will therefore taint the kernel.
  63. Device assignment to virtual machines is also not possible with
  64. this mode since there is no IOMMU to provide DMA translation.
  65. If you don't know what to do here, say N.
  66. config VFIO_VIRQFD
  67. bool
  68. select EVENTFD
  69. default n
  70. config VFIO_DEBUGFS
  71. bool "Export VFIO internals in DebugFS"
  72. depends on DEBUG_FS
  73. help
  74. Allows exposure of VFIO device internals. This option enables
  75. the use of debugfs by VFIO drivers as required. The device can
  76. cause the VFIO code create a top-level debug/vfio directory
  77. during initialization, and then populate a subdirectory with
  78. entries as required.
  79. source "drivers/vfio/pci/Kconfig"
  80. source "drivers/vfio/platform/Kconfig"
  81. source "drivers/vfio/mdev/Kconfig"
  82. source "drivers/vfio/fsl-mc/Kconfig"
  83. source "drivers/vfio/cdx/Kconfig"
  84. endif
  85. source "virt/lib/Kconfig"