1 # SPDX-License-Identifier: GPL-2.0-only
2 # The IOVA library may also be used by non-IOMMU_API users
6 # The IOASID library may also be used by non-IOMMU_API users
10 # IOMMU_API always gets selected by whoever wants it.
14 menuconfig IOMMU_SUPPORT
15 bool "IOMMU Hardware Support"
19 Say Y here if you want to compile device drivers for IO Memory
20 Management Units into the kernel. These devices usually allow to
21 remap DMA requests and/or remap interrupts from other devices on the
26 menu "Generic IOMMU Pagetable Support"
28 # Selected by the actual pagetable implementations
29 config IOMMU_IO_PGTABLE
32 config IOMMU_IO_PGTABLE_LPAE
33 bool "ARMv7/v8 Long Descriptor Format"
34 select IOMMU_IO_PGTABLE
35 depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
37 Enable support for the ARM long descriptor pagetable format.
38 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
39 sizes at both stage-1 and stage-2, as well as address spaces
40 up to 48-bits in size.
42 config IOMMU_IO_PGTABLE_LPAE_SELFTEST
44 depends on IOMMU_IO_PGTABLE_LPAE
46 Enable self-tests for LPAE page table allocator. This performs
47 a series of page-table consistency checks during boot.
49 If unsure, say N here.
51 config IOMMU_IO_PGTABLE_ARMV7S
52 bool "ARMv7/v8 Short Descriptor Format"
53 select IOMMU_IO_PGTABLE
54 depends on ARM || ARM64 || COMPILE_TEST
56 Enable support for the ARM Short-descriptor pagetable format.
57 This supports 32-bit virtual and physical addresses mapped using
58 2-level tables with 4KB pages/1MB sections, and contiguous entries
59 for 64KB pages/16MB supersections if indicated by the IOMMU driver.
61 config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
62 bool "ARMv7s selftests"
63 depends on IOMMU_IO_PGTABLE_ARMV7S
65 Enable self-tests for ARMv7s page table allocator. This performs
66 a series of page-table consistency checks during boot.
68 If unsure, say N here.
73 bool "Export IOMMU internals in DebugFS"
76 Allows exposure of IOMMU device internals. This option enables
77 the use of debugfs by IOMMU drivers as required. Devices can,
78 at initialization time, cause the IOMMU code to create a top-level
79 debug/iommu directory, and then populate a subdirectory with
82 config IOMMU_DEFAULT_PASSTHROUGH
83 bool "IOMMU passthrough by default"
86 Enable passthrough by default, removing the need to pass in
87 iommu.passthrough=on or iommu=pt through command line. If this
88 is enabled, you can still disable with iommu.passthrough=off
89 or iommu=nopt depending on the architecture.
91 If unsure, say N here.
95 depends on OF && IOMMU_API
97 # IOMMU-agnostic DMA-mapping layer
104 select NEED_SG_DMA_LENGTH
107 bool "Freescale IOMMU support"
109 depends on PHYS_64BIT
110 depends on PPC_E500MC || (COMPILE_TEST && PPC)
112 select GENERIC_ALLOCATOR
114 Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
115 PAMU can authorize memory access, remap the memory address, and remap I/O
120 bool "MSM IOMMU Support"
122 depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
124 select IOMMU_IO_PGTABLE_ARMV7S
126 Support for the IOMMUs found on certain Qualcomm SOCs.
127 These IOMMUs allow virtualization of the address space used by most
128 cores within the multimedia subsystem.
130 If unsure, say N here.
132 source "drivers/iommu/amd/Kconfig"
133 source "drivers/iommu/intel/Kconfig"
136 bool "Support for Interrupt Remapping"
137 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
140 Supports Interrupt remapping for IO-APIC and MSI devices.
141 To use x2apic mode in the CPU's which support x2APIC enhancements or
142 to support platforms with CPU's having > 8 bit APIC ID, say Y.
146 bool "OMAP IOMMU Support"
147 depends on ARCH_OMAP2PLUS || COMPILE_TEST
150 The OMAP3 media platform drivers depend on iommu support,
151 if you need them say Y here.
153 config OMAP_IOMMU_DEBUG
154 bool "Export OMAP IOMMU internals in DebugFS"
155 depends on OMAP_IOMMU && DEBUG_FS
157 Select this to see extensive information about
158 the internal state of OMAP IOMMU in debugfs.
160 Say N unless you know you need this.
162 config ROCKCHIP_IOMMU
163 bool "Rockchip IOMMU Support"
164 depends on ARCH_ROCKCHIP || COMPILE_TEST
166 select ARM_DMA_USE_IOMMU
168 Support for IOMMUs found on Rockchip rk32xx SOCs.
169 These IOMMUs allow virtualization of the address space used by most
170 cores within the multimedia subsystem.
171 Say Y here if you are using a Rockchip SoC that includes an IOMMU
175 bool "Allwinner H6 IOMMU Support"
177 depends on ARCH_SUNXI || COMPILE_TEST
178 select ARM_DMA_USE_IOMMU
181 Support for the IOMMU introduced in the Allwinner H6 SoCs.
183 config TEGRA_IOMMU_GART
184 bool "Tegra GART IOMMU Support"
185 depends on ARCH_TEGRA_2x_SOC
189 Enables support for remapping discontiguous physical memory
190 shared with the operating system into contiguous I/O virtual
191 space through the GART (Graphics Address Relocation Table)
192 hardware included on Tegra SoCs.
194 config TEGRA_IOMMU_SMMU
195 bool "NVIDIA Tegra SMMU Support"
196 depends on ARCH_TEGRA
201 This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
202 SoCs (Tegra30 up to Tegra210).
205 bool "Exynos IOMMU Support"
206 depends on ARCH_EXYNOS || COMPILE_TEST
207 depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
209 select ARM_DMA_USE_IOMMU
211 Support for the IOMMU (System MMU) of Samsung Exynos application
212 processor family. This enables H/W multimedia accelerators to see
213 non-linear physical memory chunks as linear memory in their
216 If unsure, say N here.
218 config EXYNOS_IOMMU_DEBUG
219 bool "Debugging log for Exynos IOMMU"
220 depends on EXYNOS_IOMMU
222 Select this to see the detailed log message that shows what
223 happens in the IOMMU driver.
225 Say N unless you need kernel log message for IOMMU debugging.
228 bool "Renesas VMSA-compatible IPMMU"
229 depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
231 select IOMMU_IO_PGTABLE_LPAE
232 select ARM_DMA_USE_IOMMU
234 Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
235 APE6, R-Car Gen2, and R-Car Gen3 SoCs.
239 config SPAPR_TCE_IOMMU
240 bool "sPAPR TCE IOMMU Support"
241 depends on PPC_POWERNV || PPC_PSERIES
244 Enables bits of IOMMU API required by VFIO. The iommu_ops
245 is not implemented as it is not necessary for VFIO.
249 tristate "ARM Ltd. System MMU (SMMU) Support"
250 depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
252 select IOMMU_IO_PGTABLE_LPAE
253 select ARM_DMA_USE_IOMMU if ARM
255 Support for implementations of the ARM System MMU architecture
258 Say Y here if your SoC includes an IOMMU device implementing
259 the ARM SMMU architecture.
261 config ARM_SMMU_LEGACY_DT_BINDINGS
262 bool "Support the legacy \"mmu-masters\" devicetree bindings"
263 depends on ARM_SMMU=y && OF
265 Support for the badly designed and deprecated "mmu-masters"
266 devicetree bindings. This allows some DMA masters to attach
267 to the SMMU but does not provide any support via the DMA API.
268 If you're lucky, you might be able to get VFIO up and running.
270 If you say Y here then you'll make me very sad. Instead, say N
271 and move your firmware to the utopian future that was 2016.
273 config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
274 bool "Default to disabling bypass on ARM SMMU v1 and v2"
278 Say Y here to (by default) disable bypass streams such that
279 incoming transactions from devices that are not attached to
280 an iommu domain will report an abort back to the device and
281 will not be allowed to pass through the SMMU.
283 Any old kernels that existed before this KConfig was
284 introduced would default to _allowing_ bypass (AKA the
285 equivalent of NO for this config). However the default for
286 this option is YES because the old behavior is insecure.
288 There are few reasons to allow unmatched stream bypass, and
289 even fewer good ones. If saying YES here breaks your board
290 you should work on fixing your board. This KConfig option
291 is expected to be removed in the future and we'll simply
292 hardcode the bypass disable in the code.
294 NOTE: the kernel command line parameter
295 'arm-smmu.disable_bypass' will continue to override this
299 tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
302 select IOMMU_IO_PGTABLE_LPAE
303 select GENERIC_MSI_IRQ_DOMAIN
305 Support for implementations of the ARM System MMU architecture
306 version 3 providing translation support to a PCIe root complex.
308 Say Y here if your system includes an IOMMU device implementing
309 the ARM SMMUv3 architecture.
312 def_bool y if S390 && PCI
313 depends on S390 && PCI
316 Support for the IOMMU API for s390 PCI devices.
318 config S390_CCW_IOMMU
319 bool "S390 CCW IOMMU Support"
320 depends on S390 && CCW || COMPILE_TEST
323 Enables bits of IOMMU API required by VFIO. The iommu_ops
324 is not implemented as it is not necessary for VFIO.
327 bool "S390 AP IOMMU Support"
328 depends on S390 && ZCRYPT || COMPILE_TEST
331 Enables bits of IOMMU API required by VFIO. The iommu_ops
332 is not implemented as it is not necessary for VFIO.
335 bool "MTK IOMMU Support"
336 depends on ARCH_MEDIATEK || COMPILE_TEST
337 select ARM_DMA_USE_IOMMU
339 select IOMMU_IO_PGTABLE_ARMV7S
343 Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
344 Memory Management Unit. This option enables remapping of DMA memory
345 accesses for the multimedia subsystem.
347 If unsure, say N here.
350 bool "MTK IOMMU Version 1 (M4U gen1) Support"
352 depends on ARCH_MEDIATEK || COMPILE_TEST
353 select ARM_DMA_USE_IOMMU
358 Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
359 Multimedia Memory Managememt Unit. This option enables remapping of
360 DMA memory accesses for the multimedia subsystem.
362 if unsure, say N here.
365 # Note: iommu drivers cannot (yet?) be built as modules
366 bool "Qualcomm IOMMU Support"
367 depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
369 select IOMMU_IO_PGTABLE_LPAE
370 select ARM_DMA_USE_IOMMU
372 Support for IOMMU on certain Qualcomm SoCs.
375 bool "Hyper-V x2APIC IRQ Handling"
376 depends on HYPERV && X86
380 Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
381 guests to run with x2APIC mode enabled.
384 tristate "Virtio IOMMU driver"
390 Para-virtualised IOMMU driver with virtio.
392 Say Y here if you intend to run this kernel as a guest.
394 endif # IOMMU_SUPPORT