Skip to content

Commit 0da188c

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu: Split out and tidy up Arm Kconfig
There are quite a lot of options for the Arm drivers, still all buried in the top-level Kconfig. For ease of use and consistency with all the other subdirectories, break these out into drivers/arm. For similar clarity and self-consistency, also tweak the ARM_SMMU sub-options to use "if" instead of "depends", to match ARM_SMMU_V3. Lastly also clean up the slightly messy description of ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT as highlighted by Geert - by now we really shouldn't need commentary on v4.x kernel behaviour anyway - and downgrade it to EXPERT as the first step in the 6-year-old threat to remove it entirely. Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Reviewed-by: Pranjal Shrivastava <[email protected]> Link: https://lore.kernel.org/r/a614ec86ba78c09cd16e348f633f6bb38793391f.1742480488.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 0c8e9c1 commit 0da188c

File tree

2 files changed

+145
-156
lines changed

2 files changed

+145
-156
lines changed

drivers/iommu/Kconfig

Lines changed: 1 addition & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ config MSM_IOMMU
192192
If unsure, say N here.
193193

194194
source "drivers/iommu/amd/Kconfig"
195+
source "drivers/iommu/arm/Kconfig"
195196
source "drivers/iommu/intel/Kconfig"
196197
source "drivers/iommu/iommufd/Kconfig"
197198
source "drivers/iommu/riscv/Kconfig"
@@ -314,150 +315,6 @@ config APPLE_DART
314315

315316
Say Y here if you are using an Apple SoC.
316317

317-
# ARM IOMMU support
318-
config ARM_SMMU
319-
tristate "ARM Ltd. System MMU (SMMU) Support"
320-
depends on ARM64 || ARM || COMPILE_TEST
321-
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
322-
select IOMMU_API
323-
select IOMMU_IO_PGTABLE_LPAE
324-
select ARM_DMA_USE_IOMMU if ARM
325-
help
326-
Support for implementations of the ARM System MMU architecture
327-
versions 1 and 2.
328-
329-
Say Y here if your SoC includes an IOMMU device implementing
330-
the ARM SMMU architecture.
331-
332-
config ARM_SMMU_LEGACY_DT_BINDINGS
333-
bool "Support the legacy \"mmu-masters\" devicetree bindings"
334-
depends on ARM_SMMU=y && OF
335-
help
336-
Support for the badly designed and deprecated "mmu-masters"
337-
devicetree bindings. This allows some DMA masters to attach
338-
to the SMMU but does not provide any support via the DMA API.
339-
If you're lucky, you might be able to get VFIO up and running.
340-
341-
If you say Y here then you'll make me very sad. Instead, say N
342-
and move your firmware to the utopian future that was 2016.
343-
344-
config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
345-
bool "Default to disabling bypass on ARM SMMU v1 and v2"
346-
depends on ARM_SMMU
347-
default y
348-
help
349-
Say Y here to (by default) disable bypass streams such that
350-
incoming transactions from devices that are not attached to
351-
an iommu domain will report an abort back to the device and
352-
will not be allowed to pass through the SMMU.
353-
354-
Any old kernels that existed before this KConfig was
355-
introduced would default to _allowing_ bypass (AKA the
356-
equivalent of NO for this config). However the default for
357-
this option is YES because the old behavior is insecure.
358-
359-
There are few reasons to allow unmatched stream bypass, and
360-
even fewer good ones. If saying YES here breaks your board
361-
you should work on fixing your board. This KConfig option
362-
is expected to be removed in the future and we'll simply
363-
hardcode the bypass disable in the code.
364-
365-
NOTE: the kernel command line parameter
366-
'arm-smmu.disable_bypass' will continue to override this
367-
config.
368-
369-
config ARM_SMMU_MMU_500_CPRE_ERRATA
370-
bool "Enable errata workaround for CPRE in SMMU reset path"
371-
depends on ARM_SMMU
372-
default y
373-
help
374-
Say Y here (by default) to apply workaround to disable
375-
MMU-500's next-page prefetcher for sake of 4 known errata.
376-
377-
Say N here only when it is sure that any errata related to
378-
prefetch enablement are not applicable on the platform.
379-
Refer silicon-errata.rst for info on errata IDs.
380-
381-
config ARM_SMMU_QCOM
382-
def_tristate y
383-
depends on ARM_SMMU && ARCH_QCOM
384-
select QCOM_SCM
385-
help
386-
When running on a Qualcomm platform that has the custom variant
387-
of the ARM SMMU, this needs to be built into the SMMU driver.
388-
389-
config ARM_SMMU_QCOM_DEBUG
390-
bool "ARM SMMU QCOM implementation defined debug support"
391-
depends on ARM_SMMU_QCOM=y
392-
help
393-
Support for implementation specific debug features in ARM SMMU
394-
hardware found in QTI platforms. This include support for
395-
the Translation Buffer Units (TBU) that can be used to obtain
396-
additional information when debugging memory management issues
397-
like context faults.
398-
399-
Say Y here to enable debug for issues such as context faults
400-
or TLB sync timeouts which requires implementation defined
401-
register dumps.
402-
403-
config ARM_SMMU_V3
404-
tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
405-
depends on ARM64
406-
select IOMMU_API
407-
select IOMMU_IO_PGTABLE_LPAE
408-
select GENERIC_MSI_IRQ
409-
select IOMMUFD_DRIVER if IOMMUFD
410-
help
411-
Support for implementations of the ARM System MMU architecture
412-
version 3 providing translation support to a PCIe root complex.
413-
414-
Say Y here if your system includes an IOMMU device implementing
415-
the ARM SMMUv3 architecture.
416-
417-
if ARM_SMMU_V3
418-
config ARM_SMMU_V3_SVA
419-
bool "Shared Virtual Addressing support for the ARM SMMUv3"
420-
select IOMMU_SVA
421-
select IOMMU_IOPF
422-
select MMU_NOTIFIER
423-
help
424-
Support for sharing process address spaces with devices using the
425-
SMMUv3.
426-
427-
Say Y here if your system supports SVA extensions such as PCIe PASID
428-
and PRI.
429-
430-
config ARM_SMMU_V3_IOMMUFD
431-
bool "Enable IOMMUFD features for ARM SMMUv3 (EXPERIMENTAL)"
432-
depends on IOMMUFD
433-
help
434-
Support for IOMMUFD features intended to support virtual machines
435-
with accelerated virtual IOMMUs.
436-
437-
Say Y here if you are doing development and testing on this feature.
438-
439-
config ARM_SMMU_V3_KUNIT_TEST
440-
tristate "KUnit tests for arm-smmu-v3 driver" if !KUNIT_ALL_TESTS
441-
depends on KUNIT
442-
depends on ARM_SMMU_V3_SVA
443-
default KUNIT_ALL_TESTS
444-
help
445-
Enable this option to unit-test arm-smmu-v3 driver functions.
446-
447-
If unsure, say N.
448-
449-
config TEGRA241_CMDQV
450-
bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
451-
depends on ACPI
452-
help
453-
Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
454-
CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
455-
support, except with virtualization capabilities.
456-
457-
Say Y here if your system is NVIDIA Tegra241 (Grace) or it has the same
458-
CMDQ-V extension.
459-
endif
460-
461318
config S390_IOMMU
462319
def_bool y if S390 && PCI
463320
depends on S390 && PCI
@@ -494,18 +351,6 @@ config MTK_IOMMU_V1
494351

495352
if unsure, say N here.
496353

497-
config QCOM_IOMMU
498-
# Note: iommu drivers cannot (yet?) be built as modules
499-
bool "Qualcomm IOMMU Support"
500-
depends on ARCH_QCOM || COMPILE_TEST
501-
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
502-
select QCOM_SCM
503-
select IOMMU_API
504-
select IOMMU_IO_PGTABLE_LPAE
505-
select ARM_DMA_USE_IOMMU
506-
help
507-
Support for IOMMU on certain Qualcomm SoCs.
508-
509354
config HYPERV_IOMMU
510355
bool "Hyper-V IRQ Handling"
511356
depends on HYPERV && X86

drivers/iommu/arm/Kconfig

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# ARM IOMMU support
3+
config ARM_SMMU
4+
tristate "ARM Ltd. System MMU (SMMU) Support"
5+
depends on ARM64 || ARM || COMPILE_TEST
6+
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
7+
select IOMMU_API
8+
select IOMMU_IO_PGTABLE_LPAE
9+
select ARM_DMA_USE_IOMMU if ARM
10+
help
11+
Support for implementations of the ARM System MMU architecture
12+
versions 1 and 2.
13+
14+
Say Y here if your SoC includes an IOMMU device implementing
15+
the ARM SMMU architecture.
16+
17+
if ARM_SMMU
18+
config ARM_SMMU_LEGACY_DT_BINDINGS
19+
bool "Support the legacy \"mmu-masters\" devicetree bindings"
20+
depends on ARM_SMMU=y && OF
21+
help
22+
Support for the badly designed and deprecated "mmu-masters"
23+
devicetree bindings. This allows some DMA masters to attach
24+
to the SMMU but does not provide any support via the DMA API.
25+
If you're lucky, you might be able to get VFIO up and running.
26+
27+
If you say Y here then you'll make me very sad. Instead, say N
28+
and move your firmware to the utopian future that was 2016.
29+
30+
config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
31+
bool "Disable unmatched stream bypass by default" if EXPERT
32+
default y
33+
help
34+
If your firmware is broken and fails to describe StreamIDs which
35+
Linux should know about in order to manage the SMMU correctly and
36+
securely, and you don't want to boot with the 'arm-smmu.disable_bypass=0'
37+
command line parameter, then as a last resort you can turn it off
38+
by default here. But don't. This option may be removed at any time.
39+
40+
Note that 'arm-smmu.disable_bypass=1' will still take precedence.
41+
42+
config ARM_SMMU_MMU_500_CPRE_ERRATA
43+
bool "Enable errata workaround for CPRE in SMMU reset path"
44+
default y
45+
help
46+
Say Y here (by default) to apply workaround to disable
47+
MMU-500's next-page prefetcher for sake of 4 known errata.
48+
49+
Say N here only when it is sure that any errata related to
50+
prefetch enablement are not applicable on the platform.
51+
Refer silicon-errata.rst for info on errata IDs.
52+
53+
config ARM_SMMU_QCOM
54+
def_tristate y
55+
depends on ARCH_QCOM
56+
select QCOM_SCM
57+
help
58+
When running on a Qualcomm platform that has the custom variant
59+
of the ARM SMMU, this needs to be built into the SMMU driver.
60+
61+
config ARM_SMMU_QCOM_DEBUG
62+
bool "ARM SMMU QCOM implementation defined debug support"
63+
depends on ARM_SMMU_QCOM=y
64+
help
65+
Support for implementation specific debug features in ARM SMMU
66+
hardware found in QTI platforms. This include support for
67+
the Translation Buffer Units (TBU) that can be used to obtain
68+
additional information when debugging memory management issues
69+
like context faults.
70+
71+
Say Y here to enable debug for issues such as context faults
72+
or TLB sync timeouts which requires implementation defined
73+
register dumps.
74+
endif
75+
76+
config ARM_SMMU_V3
77+
tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
78+
depends on ARM64
79+
select IOMMU_API
80+
select IOMMU_IO_PGTABLE_LPAE
81+
select GENERIC_MSI_IRQ
82+
select IOMMUFD_DRIVER if IOMMUFD
83+
help
84+
Support for implementations of the ARM System MMU architecture
85+
version 3 providing translation support to a PCIe root complex.
86+
87+
Say Y here if your system includes an IOMMU device implementing
88+
the ARM SMMUv3 architecture.
89+
90+
if ARM_SMMU_V3
91+
config ARM_SMMU_V3_SVA
92+
bool "Shared Virtual Addressing support for the ARM SMMUv3"
93+
select IOMMU_SVA
94+
select IOMMU_IOPF
95+
select MMU_NOTIFIER
96+
help
97+
Support for sharing process address spaces with devices using the
98+
SMMUv3.
99+
100+
Say Y here if your system supports SVA extensions such as PCIe PASID
101+
and PRI.
102+
103+
config ARM_SMMU_V3_IOMMUFD
104+
bool "Enable IOMMUFD features for ARM SMMUv3 (EXPERIMENTAL)"
105+
depends on IOMMUFD
106+
help
107+
Support for IOMMUFD features intended to support virtual machines
108+
with accelerated virtual IOMMUs.
109+
110+
Say Y here if you are doing development and testing on this feature.
111+
112+
config ARM_SMMU_V3_KUNIT_TEST
113+
tristate "KUnit tests for arm-smmu-v3 driver" if !KUNIT_ALL_TESTS
114+
depends on KUNIT
115+
depends on ARM_SMMU_V3_SVA
116+
default KUNIT_ALL_TESTS
117+
help
118+
Enable this option to unit-test arm-smmu-v3 driver functions.
119+
120+
If unsure, say N.
121+
122+
config TEGRA241_CMDQV
123+
bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
124+
depends on ACPI
125+
help
126+
Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
127+
CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
128+
support, except with virtualization capabilities.
129+
130+
Say Y here if your system is NVIDIA Tegra241 (Grace) or it has the same
131+
CMDQ-V extension.
132+
endif
133+
134+
config QCOM_IOMMU
135+
# Note: iommu drivers cannot (yet?) be built as modules
136+
bool "Qualcomm IOMMU Support"
137+
depends on ARCH_QCOM || COMPILE_TEST
138+
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
139+
select QCOM_SCM
140+
select IOMMU_API
141+
select IOMMU_IO_PGTABLE_LPAE
142+
select ARM_DMA_USE_IOMMU
143+
help
144+
Support for IOMMU on certain Qualcomm SoCs.

0 commit comments

Comments
 (0)