]>
Commit | Line | Data |
---|---|---|
ec8f24b7 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
bd3c2e66 SA |
2 | # The IOVA library may also be used by non-IOMMU_API users |
3 | config IOMMU_IOVA | |
4 | tristate | |
5 | ||
fa83433c JPB |
6 | # The IOASID library may also be used by non-IOMMU_API users |
7 | config IOASID | |
8 | tristate | |
9 | ||
ab493a0f OBC |
10 | # IOMMU_API always gets selected by whoever wants it. |
11 | config IOMMU_API | |
12 | bool | |
b10f127e | 13 | |
68255b62 JR |
14 | menuconfig IOMMU_SUPPORT |
15 | bool "IOMMU Hardware Support" | |
e5144c93 | 16 | depends on MMU |
68255b62 | 17 | default y |
a7f7f624 | 18 | help |
68255b62 JR |
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 | |
22 | system. | |
23 | ||
24 | if IOMMU_SUPPORT | |
25 | ||
fdb1d7be WD |
26 | menu "Generic IOMMU Pagetable Support" |
27 | ||
28 | # Selected by the actual pagetable implementations | |
29 | config IOMMU_IO_PGTABLE | |
30 | bool | |
31 | ||
e1d3c0fd WD |
32 | config IOMMU_IO_PGTABLE_LPAE |
33 | bool "ARMv7/v8 Long Descriptor Format" | |
34 | select IOMMU_IO_PGTABLE | |
48e6f765 | 35 | depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64) |
e1d3c0fd WD |
36 | help |
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. | |
41 | ||
fe4b991d WD |
42 | config IOMMU_IO_PGTABLE_LPAE_SELFTEST |
43 | bool "LPAE selftests" | |
44 | depends on IOMMU_IO_PGTABLE_LPAE | |
45 | help | |
46 | Enable self-tests for LPAE page table allocator. This performs | |
47 | a series of page-table consistency checks during boot. | |
48 | ||
49 | If unsure, say N here. | |
50 | ||
e5fc9753 RM |
51 | config IOMMU_IO_PGTABLE_ARMV7S |
52 | bool "ARMv7/v8 Short Descriptor Format" | |
53 | select IOMMU_IO_PGTABLE | |
48e6f765 | 54 | depends on ARM || ARM64 || COMPILE_TEST |
e5fc9753 RM |
55 | help |
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. | |
60 | ||
61 | config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST | |
62 | bool "ARMv7s selftests" | |
63 | depends on IOMMU_IO_PGTABLE_ARMV7S | |
64 | help | |
65 | Enable self-tests for ARMv7s page table allocator. This performs | |
66 | a series of page-table consistency checks during boot. | |
67 | ||
68 | If unsure, say N here. | |
69 | ||
fdb1d7be WD |
70 | endmenu |
71 | ||
bad614b2 GH |
72 | config IOMMU_DEBUGFS |
73 | bool "Export IOMMU internals in DebugFS" | |
74 | depends on DEBUG_FS | |
75 | help | |
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 | |
80 | entries as required. | |
81 | ||
58d11317 OJ |
82 | config IOMMU_DEFAULT_PASSTHROUGH |
83 | bool "IOMMU passthrough by default" | |
84 | depends on IOMMU_API | |
d0432345 | 85 | help |
58d11317 OJ |
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. | |
90 | ||
91 | If unsure, say N here. | |
92 | ||
4e0ee78f | 93 | config OF_IOMMU |
d0432345 KK |
94 | def_bool y |
95 | depends on OF && IOMMU_API | |
4e0ee78f | 96 | |
0db2e5d1 RM |
97 | # IOMMU-agnostic DMA-mapping layer |
98 | config IOMMU_DMA | |
99 | bool | |
2f9237d4 | 100 | select DMA_OPS |
0db2e5d1 RM |
101 | select IOMMU_API |
102 | select IOMMU_IOVA | |
ece6e6f0 | 103 | select IRQ_MSI_IOMMU |
59a68eb8 | 104 | select NEED_SG_DMA_LENGTH |
0db2e5d1 | 105 | |
cfc78dfd JPB |
106 | # Shared Virtual Addressing library |
107 | config IOMMU_SVA_LIB | |
108 | bool | |
109 | select IOASID | |
110 | ||
695093e3 VS |
111 | config FSL_PAMU |
112 | bool "Freescale IOMMU support" | |
a4d98fb3 | 113 | depends on PCI |
af29d9fa | 114 | depends on PHYS_64BIT |
a0d284d2 | 115 | depends on PPC_E500MC || (COMPILE_TEST && PPC) |
695093e3 VS |
116 | select IOMMU_API |
117 | select GENERIC_ALLOCATOR | |
118 | help | |
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 | |
121 | transaction types. | |
122 | ||
b10f127e OBC |
123 | # MSM IOMMU support |
124 | config MSM_IOMMU | |
125 | bool "MSM IOMMU Support" | |
477ab7a1 JR |
126 | depends on ARM |
127 | depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST | |
b10f127e | 128 | select IOMMU_API |
c9220fbd | 129 | select IOMMU_IO_PGTABLE_ARMV7S |
b10f127e OBC |
130 | help |
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. | |
134 | ||
135 | If unsure, say N here. | |
136 | ||
cbe94c6e | 137 | source "drivers/iommu/amd/Kconfig" |
ab65ba57 | 138 | source "drivers/iommu/intel/Kconfig" |
04618252 | 139 | |
d3f13810 | 140 | config IRQ_REMAP |
a446e219 KC |
141 | bool "Support for Interrupt Remapping" |
142 | depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI | |
d3f13810 | 143 | select DMAR_TABLE |
a7f7f624 | 144 | help |
166e9278 OBC |
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. | |
68255b62 | 148 | |
fcf3a6ef OBC |
149 | # OMAP IOMMU support |
150 | config OMAP_IOMMU | |
151 | bool "OMAP IOMMU Support" | |
477ab7a1 | 152 | depends on ARCH_OMAP2PLUS || COMPILE_TEST |
fcf3a6ef | 153 | select IOMMU_API |
a7f7f624 | 154 | help |
06b718c0 GH |
155 | The OMAP3 media platform drivers depend on iommu support, |
156 | if you need them say Y here. | |
fcf3a6ef | 157 | |
fcf3a6ef | 158 | config OMAP_IOMMU_DEBUG |
61c75352 SA |
159 | bool "Export OMAP IOMMU internals in DebugFS" |
160 | depends on OMAP_IOMMU && DEBUG_FS | |
a7f7f624 | 161 | help |
61c75352 SA |
162 | Select this to see extensive information about |
163 | the internal state of OMAP IOMMU in debugfs. | |
fcf3a6ef | 164 | |
61c75352 | 165 | Say N unless you know you need this. |
fcf3a6ef | 166 | |
c68a2921 DK |
167 | config ROCKCHIP_IOMMU |
168 | bool "Rockchip IOMMU Support" | |
11175886 | 169 | depends on ARCH_ROCKCHIP || COMPILE_TEST |
c68a2921 DK |
170 | select IOMMU_API |
171 | select ARM_DMA_USE_IOMMU | |
172 | help | |
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 | |
177 | device. | |
fcf3a6ef | 178 | |
4100b8c2 MR |
179 | config SUN50I_IOMMU |
180 | bool "Allwinner H6 IOMMU Support" | |
c7451e49 | 181 | depends on HAS_DMA |
4100b8c2 MR |
182 | depends on ARCH_SUNXI || COMPILE_TEST |
183 | select ARM_DMA_USE_IOMMU | |
184 | select IOMMU_API | |
4100b8c2 MR |
185 | help |
186 | Support for the IOMMU introduced in the Allwinner H6 SoCs. | |
187 | ||
d53e54b4 HD |
188 | config TEGRA_IOMMU_GART |
189 | bool "Tegra GART IOMMU Support" | |
190 | depends on ARCH_TEGRA_2x_SOC | |
ce2785a7 | 191 | depends on TEGRA_MC |
d53e54b4 HD |
192 | select IOMMU_API |
193 | help | |
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. | |
198 | ||
7a31f6f4 | 199 | config TEGRA_IOMMU_SMMU |
89184651 TR |
200 | bool "NVIDIA Tegra SMMU Support" |
201 | depends on ARCH_TEGRA | |
202 | depends on TEGRA_AHB | |
203 | depends on TEGRA_MC | |
7a31f6f4 HD |
204 | select IOMMU_API |
205 | help | |
89184651 | 206 | This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra |
588c43a7 | 207 | SoCs (Tegra30 up to Tegra210). |
7a31f6f4 | 208 | |
2a96536e KC |
209 | config EXYNOS_IOMMU |
210 | bool "Exynos IOMMU Support" | |
b4ceb4a5 | 211 | depends on ARCH_EXYNOS || COMPILE_TEST |
db3a7fd7 | 212 | depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes |
2a96536e | 213 | select IOMMU_API |
4802c1d0 | 214 | select ARM_DMA_USE_IOMMU |
2a96536e | 215 | help |
5455d700 SK |
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 | |
219 | address space. | |
2a96536e KC |
220 | |
221 | If unsure, say N here. | |
222 | ||
223 | config EXYNOS_IOMMU_DEBUG | |
224 | bool "Debugging log for Exynos IOMMU" | |
225 | depends on EXYNOS_IOMMU | |
226 | help | |
227 | Select this to see the detailed log message that shows what | |
5455d700 | 228 | happens in the IOMMU driver. |
2a96536e | 229 | |
5455d700 | 230 | Say N unless you need kernel log message for IOMMU debugging. |
2a96536e | 231 | |
d25a2a16 LP |
232 | config IPMMU_VMSA |
233 | bool "Renesas VMSA-compatible IPMMU" | |
a4aaeccc | 234 | depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64) |
d25a2a16 | 235 | select IOMMU_API |
f20ed39f | 236 | select IOMMU_IO_PGTABLE_LPAE |
d25a2a16 LP |
237 | select ARM_DMA_USE_IOMMU |
238 | help | |
15021d36 | 239 | Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile |
d714aaa7 | 240 | APE6, R-Car Gen{2,3} and RZ/G{1,2} SoCs. |
d25a2a16 LP |
241 | |
242 | If unsure, say N. | |
243 | ||
4e13c1ac AK |
244 | config SPAPR_TCE_IOMMU |
245 | bool "sPAPR TCE IOMMU Support" | |
9dd124b6 | 246 | depends on PPC_POWERNV || PPC_PSERIES |
4e13c1ac AK |
247 | select IOMMU_API |
248 | help | |
249 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
250 | is not implemented as it is not necessary for VFIO. | |
251 | ||
48ec83bc | 252 | # ARM IOMMU support |
45ae7cff | 253 | config ARM_SMMU |
cd221bd2 | 254 | tristate "ARM Ltd. System MMU (SMMU) Support" |
b4ceb4a5 | 255 | depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64) |
45ae7cff | 256 | select IOMMU_API |
518f7136 | 257 | select IOMMU_IO_PGTABLE_LPAE |
45ae7cff WD |
258 | select ARM_DMA_USE_IOMMU if ARM |
259 | help | |
260 | Support for implementations of the ARM System MMU architecture | |
518f7136 | 261 | versions 1 and 2. |
45ae7cff WD |
262 | |
263 | Say Y here if your SoC includes an IOMMU device implementing | |
264 | the ARM SMMU architecture. | |
265 | ||
cd221bd2 WD |
266 | config ARM_SMMU_LEGACY_DT_BINDINGS |
267 | bool "Support the legacy \"mmu-masters\" devicetree bindings" | |
268 | depends on ARM_SMMU=y && OF | |
269 | help | |
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. | |
274 | ||
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. | |
277 | ||
954a03be DA |
278 | config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT |
279 | bool "Default to disabling bypass on ARM SMMU v1 and v2" | |
280 | depends on ARM_SMMU | |
281 | default y | |
282 | help | |
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. | |
287 | ||
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. | |
292 | ||
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. | |
298 | ||
299 | NOTE: the kernel command line parameter | |
300 | 'arm-smmu.disable_bypass' will continue to override this | |
301 | config. | |
302 | ||
48ec83bc | 303 | config ARM_SMMU_V3 |
2852ad05 | 304 | tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support" |
08d4ca2a | 305 | depends on ARM64 |
48ec83bc WD |
306 | select IOMMU_API |
307 | select IOMMU_IO_PGTABLE_LPAE | |
166bdbd2 | 308 | select GENERIC_MSI_IRQ_DOMAIN |
48ec83bc WD |
309 | help |
310 | Support for implementations of the ARM System MMU architecture | |
311 | version 3 providing translation support to a PCIe root complex. | |
312 | ||
313 | Say Y here if your system includes an IOMMU device implementing | |
314 | the ARM SMMUv3 architecture. | |
315 | ||
3f1ce8e8 JPB |
316 | config ARM_SMMU_V3_SVA |
317 | bool "Shared Virtual Addressing support for the ARM SMMUv3" | |
318 | depends on ARM_SMMU_V3 | |
32784a95 JPB |
319 | select IOMMU_SVA_LIB |
320 | select MMU_NOTIFIER | |
3f1ce8e8 JPB |
321 | help |
322 | Support for sharing process address spaces with devices using the | |
323 | SMMUv3. | |
324 | ||
325 | Say Y here if your system supports SVA extensions such as PCIe PASID | |
326 | and PRI. | |
327 | ||
8128f23c GS |
328 | config S390_IOMMU |
329 | def_bool y if S390 && PCI | |
330 | depends on S390 && PCI | |
331 | select IOMMU_API | |
332 | help | |
333 | Support for the IOMMU API for s390 PCI devices. | |
334 | ||
63f1934d DJS |
335 | config S390_CCW_IOMMU |
336 | bool "S390 CCW IOMMU Support" | |
e93a1695 | 337 | depends on S390 && CCW || COMPILE_TEST |
63f1934d DJS |
338 | select IOMMU_API |
339 | help | |
340 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
341 | is not implemented as it is not necessary for VFIO. | |
342 | ||
1fde5734 TK |
343 | config S390_AP_IOMMU |
344 | bool "S390 AP IOMMU Support" | |
e93a1695 | 345 | depends on S390 && ZCRYPT || COMPILE_TEST |
1fde5734 TK |
346 | select IOMMU_API |
347 | help | |
348 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
349 | is not implemented as it is not necessary for VFIO. | |
350 | ||
0df4fabe YW |
351 | config MTK_IOMMU |
352 | bool "MTK IOMMU Support" | |
0df4fabe | 353 | depends on ARCH_MEDIATEK || COMPILE_TEST |
1928832f | 354 | select ARM_DMA_USE_IOMMU |
0df4fabe | 355 | select IOMMU_API |
0df4fabe YW |
356 | select IOMMU_IO_PGTABLE_ARMV7S |
357 | select MEMORY | |
358 | select MTK_SMI | |
359 | help | |
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. | |
363 | ||
364 | If unsure, say N here. | |
365 | ||
b17336c5 HZ |
366 | config MTK_IOMMU_V1 |
367 | bool "MTK IOMMU Version 1 (M4U gen1) Support" | |
368 | depends on ARM | |
369 | depends on ARCH_MEDIATEK || COMPILE_TEST | |
370 | select ARM_DMA_USE_IOMMU | |
371 | select IOMMU_API | |
372 | select MEMORY | |
373 | select MTK_SMI | |
b17336c5 HZ |
374 | help |
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. | |
378 | ||
379 | if unsure, say N here. | |
380 | ||
0ae349a0 RC |
381 | config QCOM_IOMMU |
382 | # Note: iommu drivers cannot (yet?) be built as modules | |
383 | bool "Qualcomm IOMMU Support" | |
a4aaeccc | 384 | depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64) |
0ae349a0 RC |
385 | select IOMMU_API |
386 | select IOMMU_IO_PGTABLE_LPAE | |
387 | select ARM_DMA_USE_IOMMU | |
388 | help | |
389 | Support for IOMMU on certain Qualcomm SoCs. | |
390 | ||
29217a47 LT |
391 | config HYPERV_IOMMU |
392 | bool "Hyper-V x2APIC IRQ Handling" | |
d7f0b2e4 | 393 | depends on HYPERV && X86 |
29217a47 LT |
394 | select IOMMU_API |
395 | default HYPERV | |
396 | help | |
397 | Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux | |
398 | guests to run with x2APIC mode enabled. | |
399 | ||
edcd69ab | 400 | config VIRTIO_IOMMU |
fa4afd78 JPB |
401 | tristate "Virtio IOMMU driver" |
402 | depends on VIRTIO | |
edcd69ab JPB |
403 | depends on ARM64 |
404 | select IOMMU_API | |
405 | select INTERVAL_TREE | |
406 | help | |
407 | Para-virtualised IOMMU driver with virtio. | |
408 | ||
409 | Say Y here if you intend to run this kernel as a guest. | |
410 | ||
68255b62 | 411 | endif # IOMMU_SUPPORT |