^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # Intel IOMMU support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) config DMAR_TABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) config INTEL_IOMMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) bool "Support for Intel IOMMU using DMA Remapping Devices"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) depends on PCI_MSI && ACPI && (X86 || IA64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) select DMA_OPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) select IOMMU_API
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) select IOMMU_IOVA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) select NEED_DMA_MAP_STATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) select DMAR_TABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) select SWIOTLB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) select IOASID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) DMA remapping (DMAR) devices support enables independent address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) translations for Direct Memory Access (DMA) from devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) These DMA remapping devices are reported via ACPI tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) and include PCI device scope covered by these DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) remapping devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) config INTEL_IOMMU_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) bool "Export Intel IOMMU internals in Debugfs"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) depends on INTEL_IOMMU && IOMMU_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) !!!WARNING!!!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Expose Intel IOMMU internals in Debugfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) This option is -NOT- intended for production environments, and should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) only be enabled for debugging Intel IOMMU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) config INTEL_IOMMU_SVM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) bool "Support for Shared Virtual Memory with Intel IOMMU"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) depends on INTEL_IOMMU && X86_64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) select PCI_PASID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) select PCI_PRI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) select MMU_NOTIFIER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) select IOASID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Shared Virtual Memory (SVM) provides a facility for devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) to access DMA resources through process address space by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) means of a Process Address Space ID (PASID).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) config INTEL_IOMMU_DEFAULT_ON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) prompt "Enable Intel DMA Remapping Devices by default"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) depends on INTEL_IOMMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Selecting this option will enable a DMAR device at boot time if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) one is found. If this option is not selected, DMAR support can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) be enabled by passing intel_iommu=on to the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) config INTEL_IOMMU_BROKEN_GFX_WA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) bool "Workaround broken graphics drivers (going away soon)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) depends on INTEL_IOMMU && BROKEN && X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) Current Graphics drivers tend to use physical address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) for DMA and avoid using DMA APIs. Setting this config
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) option permits the IOMMU driver to set a unity map for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) all the OS-visible memory. Hence the driver can continue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) to use physical addresses for DMA, at least until this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) option is removed in the 2.6.32 kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) config INTEL_IOMMU_FLOPPY_WA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) def_bool y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) depends on INTEL_IOMMU && X86
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) Floppy disk drivers are known to bypass DMA API calls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) thereby failing to work when IOMMU is enabled. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) workaround will setup a 1:1 mapping for the first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 16MiB to make floppy (an ISA device) work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) config INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) bool "Enable Intel IOMMU scalable mode by default"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) depends on INTEL_IOMMU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Selecting this option will enable by default the scalable mode if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) hardware presents the capability. The scalable mode is defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) VT-d 3.0. The scalable mode capability could be checked by reading
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) /sys/devices/virtual/iommu/dmar*/intel-iommu/ecap. If this option
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) is not selected, scalable mode support could also be enabled by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) passing intel_iommu=sm_on to the kernel. If not sure, please use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) the default value.