Commit | Line | Data |
---|---|---|
bd3c2e66 SA |
1 | # The IOVA library may also be used by non-IOMMU_API users |
2 | config IOMMU_IOVA | |
3 | tristate | |
4 | ||
ab493a0f OBC |
5 | # IOMMU_API always gets selected by whoever wants it. |
6 | config IOMMU_API | |
7 | bool | |
b10f127e | 8 | |
68255b62 JR |
9 | menuconfig IOMMU_SUPPORT |
10 | bool "IOMMU Hardware Support" | |
e5144c93 | 11 | depends on MMU |
68255b62 JR |
12 | default y |
13 | ---help--- | |
14 | Say Y here if you want to compile device drivers for IO Memory | |
15 | Management Units into the kernel. These devices usually allow to | |
16 | remap DMA requests and/or remap interrupts from other devices on the | |
17 | system. | |
18 | ||
19 | if IOMMU_SUPPORT | |
20 | ||
fdb1d7be WD |
21 | menu "Generic IOMMU Pagetable Support" |
22 | ||
23 | # Selected by the actual pagetable implementations | |
24 | config IOMMU_IO_PGTABLE | |
25 | bool | |
26 | ||
e1d3c0fd WD |
27 | config IOMMU_IO_PGTABLE_LPAE |
28 | bool "ARMv7/v8 Long Descriptor Format" | |
29 | select IOMMU_IO_PGTABLE | |
48e6f765 | 30 | depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64) |
e1d3c0fd WD |
31 | help |
32 | Enable support for the ARM long descriptor pagetable format. | |
33 | This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page | |
34 | sizes at both stage-1 and stage-2, as well as address spaces | |
35 | up to 48-bits in size. | |
36 | ||
fe4b991d WD |
37 | config IOMMU_IO_PGTABLE_LPAE_SELFTEST |
38 | bool "LPAE selftests" | |
39 | depends on IOMMU_IO_PGTABLE_LPAE | |
40 | help | |
41 | Enable self-tests for LPAE page table allocator. This performs | |
42 | a series of page-table consistency checks during boot. | |
43 | ||
44 | If unsure, say N here. | |
45 | ||
e5fc9753 RM |
46 | config IOMMU_IO_PGTABLE_ARMV7S |
47 | bool "ARMv7/v8 Short Descriptor Format" | |
48 | select IOMMU_IO_PGTABLE | |
48e6f765 | 49 | depends on ARM || ARM64 || COMPILE_TEST |
e5fc9753 RM |
50 | help |
51 | Enable support for the ARM Short-descriptor pagetable format. | |
52 | This supports 32-bit virtual and physical addresses mapped using | |
53 | 2-level tables with 4KB pages/1MB sections, and contiguous entries | |
54 | for 64KB pages/16MB supersections if indicated by the IOMMU driver. | |
55 | ||
56 | config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST | |
57 | bool "ARMv7s selftests" | |
58 | depends on IOMMU_IO_PGTABLE_ARMV7S | |
59 | help | |
60 | Enable self-tests for ARMv7s page table allocator. This performs | |
61 | a series of page-table consistency checks during boot. | |
62 | ||
63 | If unsure, say N here. | |
64 | ||
fdb1d7be WD |
65 | endmenu |
66 | ||
bad614b2 GH |
67 | config IOMMU_DEBUGFS |
68 | bool "Export IOMMU internals in DebugFS" | |
69 | depends on DEBUG_FS | |
70 | help | |
71 | Allows exposure of IOMMU device internals. This option enables | |
72 | the use of debugfs by IOMMU drivers as required. Devices can, | |
73 | at initialization time, cause the IOMMU code to create a top-level | |
74 | debug/iommu directory, and then populate a subdirectory with | |
75 | entries as required. | |
76 | ||
58d11317 OJ |
77 | config IOMMU_DEFAULT_PASSTHROUGH |
78 | bool "IOMMU passthrough by default" | |
79 | depends on IOMMU_API | |
80 | help | |
81 | Enable passthrough by default, removing the need to pass in | |
82 | iommu.passthrough=on or iommu=pt through command line. If this | |
83 | is enabled, you can still disable with iommu.passthrough=off | |
84 | or iommu=nopt depending on the architecture. | |
85 | ||
86 | If unsure, say N here. | |
87 | ||
4e0ee78f HD |
88 | config OF_IOMMU |
89 | def_bool y | |
7eba1d51 | 90 | depends on OF && IOMMU_API |
4e0ee78f | 91 | |
0db2e5d1 RM |
92 | # IOMMU-agnostic DMA-mapping layer |
93 | config IOMMU_DMA | |
94 | bool | |
0db2e5d1 RM |
95 | select IOMMU_API |
96 | select IOMMU_IOVA | |
59a68eb8 | 97 | select NEED_SG_DMA_LENGTH |
0db2e5d1 | 98 | |
695093e3 VS |
99 | config FSL_PAMU |
100 | bool "Freescale IOMMU support" | |
a4d98fb3 | 101 | depends on PCI |
af29d9fa | 102 | depends on PHYS_64BIT |
a0d284d2 | 103 | depends on PPC_E500MC || (COMPILE_TEST && PPC) |
695093e3 VS |
104 | select IOMMU_API |
105 | select GENERIC_ALLOCATOR | |
106 | help | |
107 | Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms. | |
108 | PAMU can authorize memory access, remap the memory address, and remap I/O | |
109 | transaction types. | |
110 | ||
b10f127e OBC |
111 | # MSM IOMMU support |
112 | config MSM_IOMMU | |
113 | bool "MSM IOMMU Support" | |
477ab7a1 JR |
114 | depends on ARM |
115 | depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST | |
b10f127e | 116 | select IOMMU_API |
c9220fbd | 117 | select IOMMU_IO_PGTABLE_ARMV7S |
b10f127e OBC |
118 | help |
119 | Support for the IOMMUs found on certain Qualcomm SOCs. | |
120 | These IOMMUs allow virtualization of the address space used by most | |
121 | cores within the multimedia subsystem. | |
122 | ||
123 | If unsure, say N here. | |
124 | ||
125 | config IOMMU_PGTABLES_L2 | |
126 | def_bool y | |
127 | depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n | |
29b68415 OBC |
128 | |
129 | # AMD IOMMU support | |
130 | config AMD_IOMMU | |
131 | bool "AMD IOMMU support" | |
132 | select SWIOTLB | |
133 | select PCI_MSI | |
52815b75 JR |
134 | select PCI_ATS |
135 | select PCI_PRI | |
136 | select PCI_PASID | |
29b68415 | 137 | select IOMMU_API |
a72c4225 | 138 | select IOMMU_IOVA |
0dbc6078 | 139 | depends on X86_64 && PCI && ACPI |
29b68415 OBC |
140 | ---help--- |
141 | With this option you can enable support for AMD IOMMU hardware in | |
142 | your system. An IOMMU is a hardware component which provides | |
143 | remapping of DMA memory accesses from devices. With an AMD IOMMU you | |
59bf8964 | 144 | can isolate the DMA memory of different devices and protect the |
29b68415 OBC |
145 | system from misbehaving device drivers or hardware. |
146 | ||
147 | You can find out if your system has an AMD IOMMU if you look into | |
148 | your BIOS for an option to enable it or if you have an IVRS ACPI | |
149 | table. | |
150 | ||
e3c495c7 | 151 | config AMD_IOMMU_V2 |
a446e219 | 152 | tristate "AMD IOMMU Version 2 driver" |
e5cac32c | 153 | depends on AMD_IOMMU |
8736b2c3 | 154 | select MMU_NOTIFIER |
e3c495c7 JR |
155 | ---help--- |
156 | This option enables support for the AMD IOMMUv2 features of the IOMMU | |
157 | hardware. Select this option if you want to use devices that support | |
59bf8964 | 158 | the PCI PRI and PASID interface. |
e3c495c7 | 159 | |
7d0f5fd3 GH |
160 | config AMD_IOMMU_DEBUGFS |
161 | bool "Enable AMD IOMMU internals in DebugFS" | |
162 | depends on AMD_IOMMU && IOMMU_DEBUGFS | |
163 | ---help--- | |
164 | !!!WARNING!!! !!!WARNING!!! !!!WARNING!!! !!!WARNING!!! | |
165 | ||
166 | DO NOT ENABLE THIS OPTION UNLESS YOU REALLY, -REALLY- KNOW WHAT YOU ARE DOING!!! | |
167 | Exposes AMD IOMMU device internals in DebugFS. | |
168 | ||
169 | This option is -NOT- intended for production environments, and should | |
170 | not generally be enabled. | |
171 | ||
166e9278 | 172 | # Intel IOMMU support |
d3f13810 SS |
173 | config DMAR_TABLE |
174 | bool | |
175 | ||
176 | config INTEL_IOMMU | |
177 | bool "Support for Intel IOMMU using DMA Remapping Devices" | |
166e9278 OBC |
178 | depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC) |
179 | select IOMMU_API | |
114150d8 | 180 | select IOMMU_IOVA |
f616ab59 | 181 | select NEED_DMA_MAP_STATE |
d3f13810 | 182 | select DMAR_TABLE |
166e9278 OBC |
183 | help |
184 | DMA remapping (DMAR) devices support enables independent address | |
185 | translations for Direct Memory Access (DMA) from devices. | |
186 | These DMA remapping devices are reported via ACPI tables | |
187 | and include PCI device scope covered by these DMA | |
188 | remapping devices. | |
189 | ||
ee2636b8 SM |
190 | config INTEL_IOMMU_DEBUGFS |
191 | bool "Export Intel IOMMU internals in Debugfs" | |
192 | depends on INTEL_IOMMU && IOMMU_DEBUGFS | |
193 | help | |
194 | !!!WARNING!!! | |
195 | ||
196 | DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!! | |
197 | ||
198 | Expose Intel IOMMU internals in Debugfs. | |
199 | ||
200 | This option is -NOT- intended for production environments, and should | |
201 | only be enabled for debugging Intel IOMMU. | |
202 | ||
8a94ade4 DW |
203 | config INTEL_IOMMU_SVM |
204 | bool "Support for Shared Virtual Memory with Intel IOMMU" | |
205 | depends on INTEL_IOMMU && X86 | |
b16d0cb9 | 206 | select PCI_PASID |
2f26e0a9 | 207 | select MMU_NOTIFIER |
8a94ade4 DW |
208 | help |
209 | Shared Virtual Memory (SVM) provides a facility for devices | |
210 | to access DMA resources through process address space by | |
211 | means of a Process Address Space ID (PASID). | |
212 | ||
d3f13810 | 213 | config INTEL_IOMMU_DEFAULT_ON |
166e9278 | 214 | def_bool y |
d3f13810 SS |
215 | prompt "Enable Intel DMA Remapping Devices by default" |
216 | depends on INTEL_IOMMU | |
166e9278 OBC |
217 | help |
218 | Selecting this option will enable a DMAR device at boot time if | |
219 | one is found. If this option is not selected, DMAR support can | |
220 | be enabled by passing intel_iommu=on to the kernel. | |
221 | ||
d3f13810 | 222 | config INTEL_IOMMU_BROKEN_GFX_WA |
166e9278 | 223 | bool "Workaround broken graphics drivers (going away soon)" |
d3f13810 | 224 | depends on INTEL_IOMMU && BROKEN && X86 |
166e9278 OBC |
225 | ---help--- |
226 | Current Graphics drivers tend to use physical address | |
227 | for DMA and avoid using DMA APIs. Setting this config | |
228 | option permits the IOMMU driver to set a unity map for | |
229 | all the OS-visible memory. Hence the driver can continue | |
230 | to use physical addresses for DMA, at least until this | |
231 | option is removed in the 2.6.32 kernel. | |
232 | ||
d3f13810 | 233 | config INTEL_IOMMU_FLOPPY_WA |
166e9278 | 234 | def_bool y |
d3f13810 | 235 | depends on INTEL_IOMMU && X86 |
166e9278 OBC |
236 | ---help--- |
237 | Floppy disk drivers are known to bypass DMA API calls | |
238 | thereby failing to work when IOMMU is enabled. This | |
239 | workaround will setup a 1:1 mapping for the first | |
240 | 16MiB to make floppy (an ISA device) work. | |
241 | ||
d3f13810 | 242 | config IRQ_REMAP |
a446e219 KC |
243 | bool "Support for Interrupt Remapping" |
244 | depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI | |
d3f13810 | 245 | select DMAR_TABLE |
166e9278 OBC |
246 | ---help--- |
247 | Supports Interrupt remapping for IO-APIC and MSI devices. | |
248 | To use x2apic mode in the CPU's which support x2APIC enhancements or | |
249 | to support platforms with CPU's having > 8 bit APIC ID, say Y. | |
68255b62 | 250 | |
fcf3a6ef OBC |
251 | # OMAP IOMMU support |
252 | config OMAP_IOMMU | |
253 | bool "OMAP IOMMU Support" | |
477ab7a1 JR |
254 | depends on ARM && MMU |
255 | depends on ARCH_OMAP2PLUS || COMPILE_TEST | |
fcf3a6ef | 256 | select IOMMU_API |
06b718c0 GH |
257 | ---help--- |
258 | The OMAP3 media platform drivers depend on iommu support, | |
259 | if you need them say Y here. | |
fcf3a6ef | 260 | |
fcf3a6ef | 261 | config OMAP_IOMMU_DEBUG |
61c75352 SA |
262 | bool "Export OMAP IOMMU internals in DebugFS" |
263 | depends on OMAP_IOMMU && DEBUG_FS | |
264 | ---help--- | |
265 | Select this to see extensive information about | |
266 | the internal state of OMAP IOMMU in debugfs. | |
fcf3a6ef | 267 | |
61c75352 | 268 | Say N unless you know you need this. |
fcf3a6ef | 269 | |
c68a2921 DK |
270 | config ROCKCHIP_IOMMU |
271 | bool "Rockchip IOMMU Support" | |
4f1fcfe9 | 272 | depends on ARM || ARM64 |
11175886 | 273 | depends on ARCH_ROCKCHIP || COMPILE_TEST |
c68a2921 DK |
274 | select IOMMU_API |
275 | select ARM_DMA_USE_IOMMU | |
276 | help | |
277 | Support for IOMMUs found on Rockchip rk32xx SOCs. | |
278 | These IOMMUs allow virtualization of the address space used by most | |
279 | cores within the multimedia subsystem. | |
280 | Say Y here if you are using a Rockchip SoC that includes an IOMMU | |
281 | device. | |
fcf3a6ef | 282 | |
d53e54b4 HD |
283 | config TEGRA_IOMMU_GART |
284 | bool "Tegra GART IOMMU Support" | |
285 | depends on ARCH_TEGRA_2x_SOC | |
ce2785a7 | 286 | depends on TEGRA_MC |
d53e54b4 HD |
287 | select IOMMU_API |
288 | help | |
289 | Enables support for remapping discontiguous physical memory | |
290 | shared with the operating system into contiguous I/O virtual | |
291 | space through the GART (Graphics Address Relocation Table) | |
292 | hardware included on Tegra SoCs. | |
293 | ||
7a31f6f4 | 294 | config TEGRA_IOMMU_SMMU |
89184651 TR |
295 | bool "NVIDIA Tegra SMMU Support" |
296 | depends on ARCH_TEGRA | |
297 | depends on TEGRA_AHB | |
298 | depends on TEGRA_MC | |
7a31f6f4 HD |
299 | select IOMMU_API |
300 | help | |
89184651 | 301 | This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra |
588c43a7 | 302 | SoCs (Tegra30 up to Tegra210). |
7a31f6f4 | 303 | |
2a96536e KC |
304 | config EXYNOS_IOMMU |
305 | bool "Exynos IOMMU Support" | |
740a01ee | 306 | depends on ARCH_EXYNOS && MMU |
db3a7fd7 | 307 | depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes |
2a96536e | 308 | select IOMMU_API |
4802c1d0 | 309 | select ARM_DMA_USE_IOMMU |
2a96536e | 310 | help |
5455d700 SK |
311 | Support for the IOMMU (System MMU) of Samsung Exynos application |
312 | processor family. This enables H/W multimedia accelerators to see | |
313 | non-linear physical memory chunks as linear memory in their | |
314 | address space. | |
2a96536e KC |
315 | |
316 | If unsure, say N here. | |
317 | ||
318 | config EXYNOS_IOMMU_DEBUG | |
319 | bool "Debugging log for Exynos IOMMU" | |
320 | depends on EXYNOS_IOMMU | |
321 | help | |
322 | Select this to see the detailed log message that shows what | |
5455d700 | 323 | happens in the IOMMU driver. |
2a96536e | 324 | |
5455d700 | 325 | Say N unless you need kernel log message for IOMMU debugging. |
2a96536e | 326 | |
d25a2a16 LP |
327 | config IPMMU_VMSA |
328 | bool "Renesas VMSA-compatible IPMMU" | |
3ae47292 | 329 | depends on ARM || IOMMU_DMA |
a4aaeccc | 330 | depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64) |
d25a2a16 | 331 | select IOMMU_API |
f20ed39f | 332 | select IOMMU_IO_PGTABLE_LPAE |
d25a2a16 LP |
333 | select ARM_DMA_USE_IOMMU |
334 | help | |
15021d36 GU |
335 | Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile |
336 | APE6, R-Car Gen2, and R-Car Gen3 SoCs. | |
d25a2a16 LP |
337 | |
338 | If unsure, say N. | |
339 | ||
4e13c1ac AK |
340 | config SPAPR_TCE_IOMMU |
341 | bool "sPAPR TCE IOMMU Support" | |
5b25199e | 342 | depends on PPC_POWERNV || PPC_PSERIES |
4e13c1ac AK |
343 | select IOMMU_API |
344 | help | |
345 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
346 | is not implemented as it is not necessary for VFIO. | |
347 | ||
48ec83bc | 348 | # ARM IOMMU support |
45ae7cff WD |
349 | config ARM_SMMU |
350 | bool "ARM Ltd. System MMU (SMMU) Support" | |
a20cc76b | 351 | depends on (ARM64 || ARM) && MMU |
45ae7cff | 352 | select IOMMU_API |
518f7136 | 353 | select IOMMU_IO_PGTABLE_LPAE |
45ae7cff WD |
354 | select ARM_DMA_USE_IOMMU if ARM |
355 | help | |
356 | Support for implementations of the ARM System MMU architecture | |
518f7136 | 357 | versions 1 and 2. |
45ae7cff WD |
358 | |
359 | Say Y here if your SoC includes an IOMMU device implementing | |
360 | the ARM SMMU architecture. | |
361 | ||
48ec83bc WD |
362 | config ARM_SMMU_V3 |
363 | bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support" | |
08d4ca2a | 364 | depends on ARM64 |
48ec83bc WD |
365 | select IOMMU_API |
366 | select IOMMU_IO_PGTABLE_LPAE | |
166bdbd2 | 367 | select GENERIC_MSI_IRQ_DOMAIN |
48ec83bc WD |
368 | help |
369 | Support for implementations of the ARM System MMU architecture | |
370 | version 3 providing translation support to a PCIe root complex. | |
371 | ||
372 | Say Y here if your system includes an IOMMU device implementing | |
373 | the ARM SMMUv3 architecture. | |
374 | ||
8128f23c GS |
375 | config S390_IOMMU |
376 | def_bool y if S390 && PCI | |
377 | depends on S390 && PCI | |
378 | select IOMMU_API | |
379 | help | |
380 | Support for the IOMMU API for s390 PCI devices. | |
381 | ||
63f1934d DJS |
382 | config S390_CCW_IOMMU |
383 | bool "S390 CCW IOMMU Support" | |
384 | depends on S390 && CCW | |
385 | select IOMMU_API | |
386 | help | |
387 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
388 | is not implemented as it is not necessary for VFIO. | |
389 | ||
1fde5734 TK |
390 | config S390_AP_IOMMU |
391 | bool "S390 AP IOMMU Support" | |
392 | depends on S390 && ZCRYPT | |
393 | select IOMMU_API | |
394 | help | |
395 | Enables bits of IOMMU API required by VFIO. The iommu_ops | |
396 | is not implemented as it is not necessary for VFIO. | |
397 | ||
0df4fabe YW |
398 | config MTK_IOMMU |
399 | bool "MTK IOMMU Support" | |
400 | depends on ARM || ARM64 | |
401 | depends on ARCH_MEDIATEK || COMPILE_TEST | |
1928832f | 402 | select ARM_DMA_USE_IOMMU |
0df4fabe YW |
403 | select IOMMU_API |
404 | select IOMMU_DMA | |
405 | select IOMMU_IO_PGTABLE_ARMV7S | |
406 | select MEMORY | |
407 | select MTK_SMI | |
408 | help | |
409 | Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia | |
410 | Memory Management Unit. This option enables remapping of DMA memory | |
411 | accesses for the multimedia subsystem. | |
412 | ||
413 | If unsure, say N here. | |
414 | ||
b17336c5 HZ |
415 | config MTK_IOMMU_V1 |
416 | bool "MTK IOMMU Version 1 (M4U gen1) Support" | |
417 | depends on ARM | |
418 | depends on ARCH_MEDIATEK || COMPILE_TEST | |
419 | select ARM_DMA_USE_IOMMU | |
420 | select IOMMU_API | |
421 | select MEMORY | |
422 | select MTK_SMI | |
b17336c5 HZ |
423 | help |
424 | Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is | |
425 | Multimedia Memory Managememt Unit. This option enables remapping of | |
426 | DMA memory accesses for the multimedia subsystem. | |
427 | ||
428 | if unsure, say N here. | |
429 | ||
0ae349a0 RC |
430 | config QCOM_IOMMU |
431 | # Note: iommu drivers cannot (yet?) be built as modules | |
432 | bool "Qualcomm IOMMU Support" | |
a4aaeccc | 433 | depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64) |
0ae349a0 RC |
434 | select IOMMU_API |
435 | select IOMMU_IO_PGTABLE_LPAE | |
436 | select ARM_DMA_USE_IOMMU | |
437 | help | |
438 | Support for IOMMU on certain Qualcomm SoCs. | |
439 | ||
29217a47 LT |
440 | config HYPERV_IOMMU |
441 | bool "Hyper-V x2APIC IRQ Handling" | |
442 | depends on HYPERV | |
443 | select IOMMU_API | |
444 | default HYPERV | |
445 | help | |
446 | Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux | |
447 | guests to run with x2APIC mode enabled. | |
448 | ||
68255b62 | 449 | endif # IOMMU_SUPPORT |