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
106 # Shared Virtual Addressing library
112 bool "Freescale IOMMU support"
114 depends on PHYS_64BIT
115 depends on PPC_E500MC || (COMPILE_TEST && PPC)
117 select GENERIC_ALLOCATOR
119 Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
120 PAMU can authorize memory access, remap the memory address, and remap I/O
125 bool "MSM IOMMU Support"
127 depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
129 select IOMMU_IO_PGTABLE_ARMV7S
131 Support for the IOMMUs found on certain Qualcomm SOCs.
132 These IOMMUs allow virtualization of the address space used by most
133 cores within the multimedia subsystem.
135 If unsure, say N here.
137 source "drivers/iommu/amd/Kconfig"
138 source "drivers/iommu/intel/Kconfig"
141 bool "Support for Interrupt Remapping"
142 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
145 Supports Interrupt remapping for IO-APIC and MSI devices.
146 To use x2apic mode in the CPU's which support x2APIC enhancements or
147 to support platforms with CPU's having > 8 bit APIC ID, say Y.
151 bool "OMAP IOMMU Support"
152 depends on ARCH_OMAP2PLUS || COMPILE_TEST
155 The OMAP3 media platform drivers depend on iommu support,
156 if you need them say Y here.
158 config OMAP_IOMMU_DEBUG
159 bool "Export OMAP IOMMU internals in DebugFS"
160 depends on OMAP_IOMMU && DEBUG_FS
162 Select this to see extensive information about
163 the internal state of OMAP IOMMU in debugfs.
165 Say N unless you know you need this.
167 config ROCKCHIP_IOMMU
168 bool "Rockchip IOMMU Support"
169 depends on ARCH_ROCKCHIP || COMPILE_TEST
171 select ARM_DMA_USE_IOMMU
173 Support for IOMMUs found on Rockchip rk32xx SOCs.
174 These IOMMUs allow virtualization of the address space used by most
175 cores within the multimedia subsystem.
176 Say Y here if you are using a Rockchip SoC that includes an IOMMU
180 bool "Allwinner H6 IOMMU Support"
182 depends on ARCH_SUNXI || COMPILE_TEST
183 select ARM_DMA_USE_IOMMU
186 Support for the IOMMU introduced in the Allwinner H6 SoCs.
188 config TEGRA_IOMMU_GART
189 bool "Tegra GART IOMMU Support"
190 depends on ARCH_TEGRA_2x_SOC
194 Enables support for remapping discontiguous physical memory
195 shared with the operating system into contiguous I/O virtual
196 space through the GART (Graphics Address Relocation Table)
197 hardware included on Tegra SoCs.
199 config TEGRA_IOMMU_SMMU
200 bool "NVIDIA Tegra SMMU Support"
201 depends on ARCH_TEGRA
206 This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
207 SoCs (Tegra30 up to Tegra210).
210 bool "Exynos IOMMU Support"
211 depends on ARCH_EXYNOS || COMPILE_TEST
212 depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
214 select ARM_DMA_USE_IOMMU
216 Support for the IOMMU (System MMU) of Samsung Exynos application
217 processor family. This enables H/W multimedia accelerators to see
218 non-linear physical memory chunks as linear memory in their
221 If unsure, say N here.
223 config EXYNOS_IOMMU_DEBUG
224 bool "Debugging log for Exynos IOMMU"
225 depends on EXYNOS_IOMMU
227 Select this to see the detailed log message that shows what
228 happens in the IOMMU driver.
230 Say N unless you need kernel log message for IOMMU debugging.
233 bool "Renesas VMSA-compatible IPMMU"
234 depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
236 select IOMMU_IO_PGTABLE_LPAE
237 select ARM_DMA_USE_IOMMU
239 Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
240 APE6, R-Car Gen{2,3} and RZ/G{1,2} SoCs.
244 config SPAPR_TCE_IOMMU
245 bool "sPAPR TCE IOMMU Support"
246 depends on PPC_POWERNV || PPC_PSERIES
249 Enables bits of IOMMU API required by VFIO. The iommu_ops
250 is not implemented as it is not necessary for VFIO.
254 tristate "ARM Ltd. System MMU (SMMU) Support"
255 depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
257 select IOMMU_IO_PGTABLE_LPAE
258 select ARM_DMA_USE_IOMMU if ARM
260 Support for implementations of the ARM System MMU architecture
263 Say Y here if your SoC includes an IOMMU device implementing
264 the ARM SMMU architecture.
266 config ARM_SMMU_LEGACY_DT_BINDINGS
267 bool "Support the legacy \"mmu-masters\" devicetree bindings"
268 depends on ARM_SMMU=y && OF
270 Support for the badly designed and deprecated "mmu-masters"
271 devicetree bindings. This allows some DMA masters to attach
272 to the SMMU but does not provide any support via the DMA API.
273 If you're lucky, you might be able to get VFIO up and running.
275 If you say Y here then you'll make me very sad. Instead, say N
276 and move your firmware to the utopian future that was 2016.
278 config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
279 bool "Default to disabling bypass on ARM SMMU v1 and v2"
283 Say Y here to (by default) disable bypass streams such that
284 incoming transactions from devices that are not attached to
285 an iommu domain will report an abort back to the device and
286 will not be allowed to pass through the SMMU.
288 Any old kernels that existed before this KConfig was
289 introduced would default to _allowing_ bypass (AKA the
290 equivalent of NO for this config). However the default for
291 this option is YES because the old behavior is insecure.
293 There are few reasons to allow unmatched stream bypass, and
294 even fewer good ones. If saying YES here breaks your board
295 you should work on fixing your board. This KConfig option
296 is expected to be removed in the future and we'll simply
297 hardcode the bypass disable in the code.
299 NOTE: the kernel command line parameter
300 'arm-smmu.disable_bypass' will continue to override this
304 tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
307 select IOMMU_IO_PGTABLE_LPAE
308 select GENERIC_MSI_IRQ_DOMAIN
310 Support for implementations of the ARM System MMU architecture
311 version 3 providing translation support to a PCIe root complex.
313 Say Y here if your system includes an IOMMU device implementing
314 the ARM SMMUv3 architecture.
316 config ARM_SMMU_V3_SVA
317 bool "Shared Virtual Addressing support for the ARM SMMUv3"
318 depends on ARM_SMMU_V3
322 Support for sharing process address spaces with devices using the
325 Say Y here if your system supports SVA extensions such as PCIe PASID
329 def_bool y if S390 && PCI
330 depends on S390 && PCI
333 Support for the IOMMU API for s390 PCI devices.
335 config S390_CCW_IOMMU
336 bool "S390 CCW IOMMU Support"
337 depends on S390 && CCW || COMPILE_TEST
340 Enables bits of IOMMU API required by VFIO. The iommu_ops
341 is not implemented as it is not necessary for VFIO.
344 bool "S390 AP IOMMU Support"
345 depends on S390 && ZCRYPT || COMPILE_TEST
348 Enables bits of IOMMU API required by VFIO. The iommu_ops
349 is not implemented as it is not necessary for VFIO.
352 bool "MTK IOMMU Support"
353 depends on ARCH_MEDIATEK || COMPILE_TEST
354 select ARM_DMA_USE_IOMMU
356 select IOMMU_IO_PGTABLE_ARMV7S
360 Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
361 Memory Management Unit. This option enables remapping of DMA memory
362 accesses for the multimedia subsystem.
364 If unsure, say N here.
367 bool "MTK IOMMU Version 1 (M4U gen1) Support"
369 depends on ARCH_MEDIATEK || COMPILE_TEST
370 select ARM_DMA_USE_IOMMU
375 Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
376 Multimedia Memory Managememt Unit. This option enables remapping of
377 DMA memory accesses for the multimedia subsystem.
379 if unsure, say N here.
382 # Note: iommu drivers cannot (yet?) be built as modules
383 bool "Qualcomm IOMMU Support"
384 depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
386 select IOMMU_IO_PGTABLE_LPAE
387 select ARM_DMA_USE_IOMMU
389 Support for IOMMU on certain Qualcomm SoCs.
392 bool "Hyper-V x2APIC IRQ Handling"
393 depends on HYPERV && X86
397 Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
398 guests to run with x2APIC mode enabled.
401 tristate "Virtio IOMMU driver"
407 Para-virtualised IOMMU driver with virtio.
409 Say Y here if you intend to run this kernel as a guest.
411 endif # IOMMU_SUPPORT