xref: /openbmc/linux/drivers/iommu/Kconfig (revision 46d1fb07)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2bd3c2e66SSakari Ailus# The IOVA library may also be used by non-IOMMU_API users
3bd3c2e66SSakari Ailusconfig IOMMU_IOVA
4bd3c2e66SSakari Ailus	tristate
5bd3c2e66SSakari Ailus
6fa83433cSJean-Philippe Brucker# The IOASID library may also be used by non-IOMMU_API users
7fa83433cSJean-Philippe Bruckerconfig IOASID
8fa83433cSJean-Philippe Brucker	tristate
9fa83433cSJean-Philippe Brucker
10ab493a0fSOhad Ben-Cohen# IOMMU_API always gets selected by whoever wants it.
11ab493a0fSOhad Ben-Cohenconfig IOMMU_API
12ab493a0fSOhad Ben-Cohen	bool
13b10f127eSOhad Ben-Cohen
1468255b62SJoerg Roedelmenuconfig IOMMU_SUPPORT
1568255b62SJoerg Roedel	bool "IOMMU Hardware Support"
16e5144c93SArnd Bergmann	depends on MMU
1768255b62SJoerg Roedel	default y
18a7f7f624SMasahiro Yamada	help
1968255b62SJoerg Roedel	  Say Y here if you want to compile device drivers for IO Memory
2068255b62SJoerg Roedel	  Management Units into the kernel. These devices usually allow to
2168255b62SJoerg Roedel	  remap DMA requests and/or remap interrupts from other devices on the
2268255b62SJoerg Roedel	  system.
2368255b62SJoerg Roedel
2468255b62SJoerg Roedelif IOMMU_SUPPORT
2568255b62SJoerg Roedel
26fdb1d7beSWill Deaconmenu "Generic IOMMU Pagetable Support"
27fdb1d7beSWill Deacon
28fdb1d7beSWill Deacon# Selected by the actual pagetable implementations
29fdb1d7beSWill Deaconconfig IOMMU_IO_PGTABLE
30fdb1d7beSWill Deacon	bool
31fdb1d7beSWill Deacon
32e1d3c0fdSWill Deaconconfig IOMMU_IO_PGTABLE_LPAE
33e1d3c0fdSWill Deacon	bool "ARMv7/v8 Long Descriptor Format"
34e1d3c0fdSWill Deacon	select IOMMU_IO_PGTABLE
3548e6f765SGeert Uytterhoeven	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
36e1d3c0fdSWill Deacon	help
37e1d3c0fdSWill Deacon	  Enable support for the ARM long descriptor pagetable format.
38e1d3c0fdSWill Deacon	  This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
39e1d3c0fdSWill Deacon	  sizes at both stage-1 and stage-2, as well as address spaces
40e1d3c0fdSWill Deacon	  up to 48-bits in size.
41e1d3c0fdSWill Deacon
42fe4b991dSWill Deaconconfig IOMMU_IO_PGTABLE_LPAE_SELFTEST
43fe4b991dSWill Deacon	bool "LPAE selftests"
44fe4b991dSWill Deacon	depends on IOMMU_IO_PGTABLE_LPAE
45fe4b991dSWill Deacon	help
46fe4b991dSWill Deacon	  Enable self-tests for LPAE page table allocator. This performs
47fe4b991dSWill Deacon	  a series of page-table consistency checks during boot.
48fe4b991dSWill Deacon
49fe4b991dSWill Deacon	  If unsure, say N here.
50fe4b991dSWill Deacon
51e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S
52e5fc9753SRobin Murphy	bool "ARMv7/v8 Short Descriptor Format"
53e5fc9753SRobin Murphy	select IOMMU_IO_PGTABLE
5448e6f765SGeert Uytterhoeven	depends on ARM || ARM64 || COMPILE_TEST
55e5fc9753SRobin Murphy	help
56e5fc9753SRobin Murphy	  Enable support for the ARM Short-descriptor pagetable format.
57e5fc9753SRobin Murphy	  This supports 32-bit virtual and physical addresses mapped using
58e5fc9753SRobin Murphy	  2-level tables with 4KB pages/1MB sections, and contiguous entries
59e5fc9753SRobin Murphy	  for 64KB pages/16MB supersections if indicated by the IOMMU driver.
60e5fc9753SRobin Murphy
61e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
62e5fc9753SRobin Murphy	bool "ARMv7s selftests"
63e5fc9753SRobin Murphy	depends on IOMMU_IO_PGTABLE_ARMV7S
64e5fc9753SRobin Murphy	help
65e5fc9753SRobin Murphy	  Enable self-tests for ARMv7s page table allocator. This performs
66e5fc9753SRobin Murphy	  a series of page-table consistency checks during boot.
67e5fc9753SRobin Murphy
68e5fc9753SRobin Murphy	  If unsure, say N here.
69e5fc9753SRobin Murphy
70fdb1d7beSWill Deaconendmenu
71fdb1d7beSWill Deacon
72bad614b2SGary R Hookconfig IOMMU_DEBUGFS
73bad614b2SGary R Hook	bool "Export IOMMU internals in DebugFS"
74bad614b2SGary R Hook	depends on DEBUG_FS
75bad614b2SGary R Hook	help
76bad614b2SGary R Hook	  Allows exposure of IOMMU device internals. This option enables
77bad614b2SGary R Hook	  the use of debugfs by IOMMU drivers as required. Devices can,
78bad614b2SGary R Hook	  at initialization time, cause the IOMMU code to create a top-level
79bad614b2SGary R Hook	  debug/iommu directory, and then populate a subdirectory with
80bad614b2SGary R Hook	  entries as required.
81bad614b2SGary R Hook
8258d11317SOlof Johanssonconfig IOMMU_DEFAULT_PASSTHROUGH
8358d11317SOlof Johansson	bool "IOMMU passthrough by default"
8458d11317SOlof Johansson	depends on IOMMU_API
8558d11317SOlof Johansson	help
8658d11317SOlof Johansson	  Enable passthrough by default, removing the need to pass in
8758d11317SOlof Johansson	  iommu.passthrough=on or iommu=pt through command line. If this
8858d11317SOlof Johansson	  is enabled, you can still disable with iommu.passthrough=off
8958d11317SOlof Johansson	  or iommu=nopt depending on the architecture.
9058d11317SOlof Johansson
9158d11317SOlof Johansson	  If unsure, say N here.
9258d11317SOlof Johansson
93712d8f20SZhen Leichoice
94712d8f20SZhen Lei	prompt "IOMMU default DMA IOTLB invalidation mode"
95712d8f20SZhen Lei	depends on IOMMU_DMA
96712d8f20SZhen Lei
9702252b3bSZhen Lei	default IOMMU_DEFAULT_LAZY if (AMD_IOMMU || INTEL_IOMMU)
98712d8f20SZhen Lei	default IOMMU_DEFAULT_STRICT
99712d8f20SZhen Lei	help
100712d8f20SZhen Lei	  This option allows an IOMMU DMA IOTLB invalidation mode to be
101712d8f20SZhen Lei	  chosen at build time, to override the default mode of each ARCH,
102712d8f20SZhen Lei	  removing the need to pass in kernel parameters through command line.
103712d8f20SZhen Lei	  It is still possible to provide common boot params to override this
104712d8f20SZhen Lei	  config.
105712d8f20SZhen Lei
106712d8f20SZhen Lei	  If unsure, keep the default.
107712d8f20SZhen Lei
108712d8f20SZhen Leiconfig IOMMU_DEFAULT_STRICT
109712d8f20SZhen Lei	bool "strict"
110712d8f20SZhen Lei	help
111712d8f20SZhen Lei	  For every IOMMU DMA unmap operation, the flush operation of IOTLB and
112712d8f20SZhen Lei	  the free operation of IOVA are guaranteed to be done in the unmap
113712d8f20SZhen Lei	  function.
114712d8f20SZhen Lei
115712d8f20SZhen Leiconfig IOMMU_DEFAULT_LAZY
116712d8f20SZhen Lei	bool "lazy"
117712d8f20SZhen Lei	help
118712d8f20SZhen Lei	  Support lazy mode, where for every IOMMU DMA unmap operation, the
119712d8f20SZhen Lei	  flush operation of IOTLB and the free operation of IOVA are deferred.
120712d8f20SZhen Lei	  They are only guaranteed to be done before the related IOVA will be
121712d8f20SZhen Lei	  reused.
122712d8f20SZhen Lei
123712d8f20SZhen Lei	  The isolation provided in this mode is not as secure as STRICT mode,
124712d8f20SZhen Lei	  such that a vulnerable time window may be created between the DMA
125712d8f20SZhen Lei	  unmap and the mappings cached in the IOMMU IOTLB or device TLB
126712d8f20SZhen Lei	  finally being invalidated, where the device could still access the
127712d8f20SZhen Lei	  memory which has already been unmapped by the device driver.
128712d8f20SZhen Lei	  However this mode may provide better performance in high throughput
129712d8f20SZhen Lei	  scenarios, and is still considerably more secure than passthrough
130712d8f20SZhen Lei	  mode or no IOMMU.
131712d8f20SZhen Lei
132712d8f20SZhen Leiendchoice
133712d8f20SZhen Lei
1344e0ee78fSHiroshi Doyuconfig OF_IOMMU
1354e0ee78fSHiroshi Doyu	def_bool y
1367eba1d51SWill Deacon	depends on OF && IOMMU_API
1374e0ee78fSHiroshi Doyu
1380db2e5d1SRobin Murphy# IOMMU-agnostic DMA-mapping layer
1390db2e5d1SRobin Murphyconfig IOMMU_DMA
1400db2e5d1SRobin Murphy	bool
1412f9237d4SChristoph Hellwig	select DMA_OPS
1420db2e5d1SRobin Murphy	select IOMMU_API
1430db2e5d1SRobin Murphy	select IOMMU_IOVA
144ece6e6f0SJulien Grall	select IRQ_MSI_IOMMU
14559a68eb8SRobin Murphy	select NEED_SG_DMA_LENGTH
1460db2e5d1SRobin Murphy
147cfc78dfdSJean-Philippe Brucker# Shared Virtual Addressing library
148cfc78dfdSJean-Philippe Bruckerconfig IOMMU_SVA_LIB
149cfc78dfdSJean-Philippe Brucker	bool
150cfc78dfdSJean-Philippe Brucker	select IOASID
151cfc78dfdSJean-Philippe Brucker
152695093e3SVarun Sethiconfig FSL_PAMU
153695093e3SVarun Sethi	bool "Freescale IOMMU support"
154a4d98fb3SJoerg Roedel	depends on PCI
155af29d9faSJoerg Roedel	depends on PHYS_64BIT
156a0d284d2SAndy Fleming	depends on PPC_E500MC || (COMPILE_TEST && PPC)
157695093e3SVarun Sethi	select IOMMU_API
158695093e3SVarun Sethi	select GENERIC_ALLOCATOR
159695093e3SVarun Sethi	help
160695093e3SVarun Sethi	  Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
161695093e3SVarun Sethi	  PAMU can authorize memory access, remap the memory address, and remap I/O
162695093e3SVarun Sethi	  transaction types.
163695093e3SVarun Sethi
164b10f127eSOhad Ben-Cohen# MSM IOMMU support
165b10f127eSOhad Ben-Cohenconfig MSM_IOMMU
166b10f127eSOhad Ben-Cohen	bool "MSM IOMMU Support"
167477ab7a1SJoerg Roedel	depends on ARM
168477ab7a1SJoerg Roedel	depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
169b10f127eSOhad Ben-Cohen	select IOMMU_API
170c9220fbdSSricharan R	select IOMMU_IO_PGTABLE_ARMV7S
171b10f127eSOhad Ben-Cohen	help
172b10f127eSOhad Ben-Cohen	  Support for the IOMMUs found on certain Qualcomm SOCs.
173b10f127eSOhad Ben-Cohen	  These IOMMUs allow virtualization of the address space used by most
174b10f127eSOhad Ben-Cohen	  cores within the multimedia subsystem.
175b10f127eSOhad Ben-Cohen
176b10f127eSOhad Ben-Cohen	  If unsure, say N here.
177b10f127eSOhad Ben-Cohen
178cbe94c6eSJerry Snitselaarsource "drivers/iommu/amd/Kconfig"
179ab65ba57SJerry Snitselaarsource "drivers/iommu/intel/Kconfig"
18004618252SLu Baolu
181d3f13810SSuresh Siddhaconfig IRQ_REMAP
182a446e219SKees Cook	bool "Support for Interrupt Remapping"
183a446e219SKees Cook	depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
184d3f13810SSuresh Siddha	select DMAR_TABLE
185a7f7f624SMasahiro Yamada	help
186166e9278SOhad Ben-Cohen	  Supports Interrupt remapping for IO-APIC and MSI devices.
187166e9278SOhad Ben-Cohen	  To use x2apic mode in the CPU's which support x2APIC enhancements or
188166e9278SOhad Ben-Cohen	  to support platforms with CPU's having > 8 bit APIC ID, say Y.
18968255b62SJoerg Roedel
190fcf3a6efSOhad Ben-Cohen# OMAP IOMMU support
191fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU
192fcf3a6efSOhad Ben-Cohen	bool "OMAP IOMMU Support"
193477ab7a1SJoerg Roedel	depends on ARCH_OMAP2PLUS || COMPILE_TEST
194fcf3a6efSOhad Ben-Cohen	select IOMMU_API
195a7f7f624SMasahiro Yamada	help
19606b718c0SGerd Hoffmann	  The OMAP3 media platform drivers depend on iommu support,
19706b718c0SGerd Hoffmann	  if you need them say Y here.
198fcf3a6efSOhad Ben-Cohen
199fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU_DEBUG
20061c75352SSuman Anna	bool "Export OMAP IOMMU internals in DebugFS"
201baaa7b5dSLaurent Pinchart	depends on OMAP_IOMMU && DEBUG_FS
202a7f7f624SMasahiro Yamada	help
203fcf3a6efSOhad Ben-Cohen	  Select this to see extensive information about
204baaa7b5dSLaurent Pinchart	  the internal state of OMAP IOMMU in debugfs.
205fcf3a6efSOhad Ben-Cohen
206fcf3a6efSOhad Ben-Cohen	  Say N unless you know you need this.
207fcf3a6efSOhad Ben-Cohen
208c68a2921SDaniel Kurtzconfig ROCKCHIP_IOMMU
209c68a2921SDaniel Kurtz	bool "Rockchip IOMMU Support"
21011175886SJoerg Roedel	depends on ARCH_ROCKCHIP || COMPILE_TEST
211c68a2921SDaniel Kurtz	select IOMMU_API
212c68a2921SDaniel Kurtz	select ARM_DMA_USE_IOMMU
213c68a2921SDaniel Kurtz	help
214c68a2921SDaniel Kurtz	  Support for IOMMUs found on Rockchip rk32xx SOCs.
215c68a2921SDaniel Kurtz	  These IOMMUs allow virtualization of the address space used by most
216c68a2921SDaniel Kurtz	  cores within the multimedia subsystem.
217c68a2921SDaniel Kurtz	  Say Y here if you are using a Rockchip SoC that includes an IOMMU
218c68a2921SDaniel Kurtz	  device.
219c68a2921SDaniel Kurtz
2204100b8c2SMaxime Ripardconfig SUN50I_IOMMU
2214100b8c2SMaxime Ripard	bool "Allwinner H6 IOMMU Support"
222c7451e49SGeert Uytterhoeven	depends on HAS_DMA
2234100b8c2SMaxime Ripard	depends on ARCH_SUNXI || COMPILE_TEST
2244100b8c2SMaxime Ripard	select ARM_DMA_USE_IOMMU
2254100b8c2SMaxime Ripard	select IOMMU_API
2264100b8c2SMaxime Ripard	help
2274100b8c2SMaxime Ripard	  Support for the IOMMU introduced in the Allwinner H6 SoCs.
2284100b8c2SMaxime Ripard
229d53e54b4SHiroshi DOYUconfig TEGRA_IOMMU_GART
230d53e54b4SHiroshi DOYU	bool "Tegra GART IOMMU Support"
231d53e54b4SHiroshi DOYU	depends on ARCH_TEGRA_2x_SOC
232ce2785a7SDmitry Osipenko	depends on TEGRA_MC
233d53e54b4SHiroshi DOYU	select IOMMU_API
234d53e54b4SHiroshi DOYU	help
235d53e54b4SHiroshi DOYU	  Enables support for remapping discontiguous physical memory
236d53e54b4SHiroshi DOYU	  shared with the operating system into contiguous I/O virtual
237d53e54b4SHiroshi DOYU	  space through the GART (Graphics Address Relocation Table)
238d53e54b4SHiroshi DOYU	  hardware included on Tegra SoCs.
239d53e54b4SHiroshi DOYU
2407a31f6f4SHiroshi DOYUconfig TEGRA_IOMMU_SMMU
24189184651SThierry Reding	bool "NVIDIA Tegra SMMU Support"
24289184651SThierry Reding	depends on ARCH_TEGRA
24389184651SThierry Reding	depends on TEGRA_AHB
24489184651SThierry Reding	depends on TEGRA_MC
2457a31f6f4SHiroshi DOYU	select IOMMU_API
2467a31f6f4SHiroshi DOYU	help
24789184651SThierry Reding	  This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
248588c43a7SThierry Reding	  SoCs (Tegra30 up to Tegra210).
2497a31f6f4SHiroshi DOYU
2502a96536eSKyongHo Choconfig EXYNOS_IOMMU
2512a96536eSKyongHo Cho	bool "Exynos IOMMU Support"
252b4ceb4a5SRobin Murphy	depends on ARCH_EXYNOS || COMPILE_TEST
253db3a7fd7SArnd Bergmann	depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
2542a96536eSKyongHo Cho	select IOMMU_API
2554802c1d0STushar Behera	select ARM_DMA_USE_IOMMU
2562a96536eSKyongHo Cho	help
2572a96536eSKyongHo Cho	  Support for the IOMMU (System MMU) of Samsung Exynos application
2585455d700SSachin Kamat	  processor family. This enables H/W multimedia accelerators to see
2595455d700SSachin Kamat	  non-linear physical memory chunks as linear memory in their
2605455d700SSachin Kamat	  address space.
2612a96536eSKyongHo Cho
2622a96536eSKyongHo Cho	  If unsure, say N here.
2632a96536eSKyongHo Cho
2642a96536eSKyongHo Choconfig EXYNOS_IOMMU_DEBUG
2652a96536eSKyongHo Cho	bool "Debugging log for Exynos IOMMU"
2662a96536eSKyongHo Cho	depends on EXYNOS_IOMMU
2672a96536eSKyongHo Cho	help
2682a96536eSKyongHo Cho	  Select this to see the detailed log message that shows what
2695455d700SSachin Kamat	  happens in the IOMMU driver.
2702a96536eSKyongHo Cho
2715455d700SSachin Kamat	  Say N unless you need kernel log message for IOMMU debugging.
2722a96536eSKyongHo Cho
273d25a2a16SLaurent Pinchartconfig IPMMU_VMSA
274d25a2a16SLaurent Pinchart	bool "Renesas VMSA-compatible IPMMU"
275a4aaecccSGuenter Roeck	depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
276d25a2a16SLaurent Pinchart	select IOMMU_API
277f20ed39fSLaurent Pinchart	select IOMMU_IO_PGTABLE_LPAE
278d25a2a16SLaurent Pinchart	select ARM_DMA_USE_IOMMU
279d25a2a16SLaurent Pinchart	help
28015021d36SGeert Uytterhoeven	  Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
281d714aaa7SLad Prabhakar	  APE6, R-Car Gen{2,3} and RZ/G{1,2} SoCs.
282d25a2a16SLaurent Pinchart
283d25a2a16SLaurent Pinchart	  If unsure, say N.
284d25a2a16SLaurent Pinchart
2854e13c1acSAlexey Kardashevskiyconfig SPAPR_TCE_IOMMU
2864e13c1acSAlexey Kardashevskiy	bool "sPAPR TCE IOMMU Support"
2879dd124b6SKrzysztof Kozlowski	depends on PPC_POWERNV || PPC_PSERIES
2884e13c1acSAlexey Kardashevskiy	select IOMMU_API
2894e13c1acSAlexey Kardashevskiy	help
2904e13c1acSAlexey Kardashevskiy	  Enables bits of IOMMU API required by VFIO. The iommu_ops
2914e13c1acSAlexey Kardashevskiy	  is not implemented as it is not necessary for VFIO.
2924e13c1acSAlexey Kardashevskiy
293*46d1fb07SSven Peterconfig APPLE_DART
294*46d1fb07SSven Peter	tristate "Apple DART IOMMU Support"
295*46d1fb07SSven Peter	depends on ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
296*46d1fb07SSven Peter	select IOMMU_API
297*46d1fb07SSven Peter	select IOMMU_IO_PGTABLE_LPAE
298*46d1fb07SSven Peter	default ARCH_APPLE
299*46d1fb07SSven Peter	help
300*46d1fb07SSven Peter	  Support for Apple DART (Device Address Resolution Table) IOMMUs
301*46d1fb07SSven Peter	  found in Apple ARM SoCs like the M1.
302*46d1fb07SSven Peter	  This IOMMU is required for most peripherals using DMA to access
303*46d1fb07SSven Peter	  the main memory.
304*46d1fb07SSven Peter
305*46d1fb07SSven Peter	  Say Y here if you are using an Apple SoC.
306*46d1fb07SSven Peter
30748ec83bcSWill Deacon# ARM IOMMU support
30845ae7cffSWill Deaconconfig ARM_SMMU
309cd221bd2SWill Deacon	tristate "ARM Ltd. System MMU (SMMU) Support"
310b4ceb4a5SRobin Murphy	depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
31145ae7cffSWill Deacon	select IOMMU_API
312518f7136SWill Deacon	select IOMMU_IO_PGTABLE_LPAE
31345ae7cffSWill Deacon	select ARM_DMA_USE_IOMMU if ARM
31445ae7cffSWill Deacon	help
31545ae7cffSWill Deacon	  Support for implementations of the ARM System MMU architecture
316518f7136SWill Deacon	  versions 1 and 2.
31745ae7cffSWill Deacon
31845ae7cffSWill Deacon	  Say Y here if your SoC includes an IOMMU device implementing
31945ae7cffSWill Deacon	  the ARM SMMU architecture.
32045ae7cffSWill Deacon
321cd221bd2SWill Deaconconfig ARM_SMMU_LEGACY_DT_BINDINGS
322cd221bd2SWill Deacon	bool "Support the legacy \"mmu-masters\" devicetree bindings"
323cd221bd2SWill Deacon	depends on ARM_SMMU=y && OF
324cd221bd2SWill Deacon	help
325cd221bd2SWill Deacon	  Support for the badly designed and deprecated "mmu-masters"
326cd221bd2SWill Deacon	  devicetree bindings. This allows some DMA masters to attach
327cd221bd2SWill Deacon	  to the SMMU but does not provide any support via the DMA API.
328cd221bd2SWill Deacon	  If you're lucky, you might be able to get VFIO up and running.
329cd221bd2SWill Deacon
330cd221bd2SWill Deacon	  If you say Y here then you'll make me very sad. Instead, say N
331cd221bd2SWill Deacon	  and move your firmware to the utopian future that was 2016.
332cd221bd2SWill Deacon
333954a03beSDouglas Andersonconfig ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
334954a03beSDouglas Anderson	bool "Default to disabling bypass on ARM SMMU v1 and v2"
335954a03beSDouglas Anderson	depends on ARM_SMMU
336954a03beSDouglas Anderson	default y
337954a03beSDouglas Anderson	help
338954a03beSDouglas Anderson	  Say Y here to (by default) disable bypass streams such that
339954a03beSDouglas Anderson	  incoming transactions from devices that are not attached to
340954a03beSDouglas Anderson	  an iommu domain will report an abort back to the device and
341954a03beSDouglas Anderson	  will not be allowed to pass through the SMMU.
342954a03beSDouglas Anderson
343954a03beSDouglas Anderson	  Any old kernels that existed before this KConfig was
344954a03beSDouglas Anderson	  introduced would default to _allowing_ bypass (AKA the
345954a03beSDouglas Anderson	  equivalent of NO for this config).  However the default for
346954a03beSDouglas Anderson	  this option is YES because the old behavior is insecure.
347954a03beSDouglas Anderson
348954a03beSDouglas Anderson	  There are few reasons to allow unmatched stream bypass, and
349954a03beSDouglas Anderson	  even fewer good ones.  If saying YES here breaks your board
350954a03beSDouglas Anderson	  you should work on fixing your board.  This KConfig option
351954a03beSDouglas Anderson	  is expected to be removed in the future and we'll simply
352954a03beSDouglas Anderson	  hardcode the bypass disable in the code.
353954a03beSDouglas Anderson
354954a03beSDouglas Anderson	  NOTE: the kernel command line parameter
355954a03beSDouglas Anderson	  'arm-smmu.disable_bypass' will continue to override this
356954a03beSDouglas Anderson	  config.
357954a03beSDouglas Anderson
35848ec83bcSWill Deaconconfig ARM_SMMU_V3
3592852ad05SWill Deacon	tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
36008d4ca2aSRobin Murphy	depends on ARM64
36148ec83bcSWill Deacon	select IOMMU_API
36248ec83bcSWill Deacon	select IOMMU_IO_PGTABLE_LPAE
363166bdbd2SMarc Zyngier	select GENERIC_MSI_IRQ_DOMAIN
36448ec83bcSWill Deacon	help
36548ec83bcSWill Deacon	  Support for implementations of the ARM System MMU architecture
36648ec83bcSWill Deacon	  version 3 providing translation support to a PCIe root complex.
36748ec83bcSWill Deacon
36848ec83bcSWill Deacon	  Say Y here if your system includes an IOMMU device implementing
36948ec83bcSWill Deacon	  the ARM SMMUv3 architecture.
37048ec83bcSWill Deacon
3713f1ce8e8SJean-Philippe Bruckerconfig ARM_SMMU_V3_SVA
3723f1ce8e8SJean-Philippe Brucker	bool "Shared Virtual Addressing support for the ARM SMMUv3"
3733f1ce8e8SJean-Philippe Brucker	depends on ARM_SMMU_V3
37432784a95SJean-Philippe Brucker	select IOMMU_SVA_LIB
37532784a95SJean-Philippe Brucker	select MMU_NOTIFIER
3763f1ce8e8SJean-Philippe Brucker	help
3773f1ce8e8SJean-Philippe Brucker	  Support for sharing process address spaces with devices using the
3783f1ce8e8SJean-Philippe Brucker	  SMMUv3.
3793f1ce8e8SJean-Philippe Brucker
3803f1ce8e8SJean-Philippe Brucker	  Say Y here if your system supports SVA extensions such as PCIe PASID
3813f1ce8e8SJean-Philippe Brucker	  and PRI.
3823f1ce8e8SJean-Philippe Brucker
3838128f23cSGerald Schaeferconfig S390_IOMMU
3848128f23cSGerald Schaefer	def_bool y if S390 && PCI
3858128f23cSGerald Schaefer	depends on S390 && PCI
3868128f23cSGerald Schaefer	select IOMMU_API
3878128f23cSGerald Schaefer	help
3888128f23cSGerald Schaefer	  Support for the IOMMU API for s390 PCI devices.
3898128f23cSGerald Schaefer
39063f1934dSDong Jia Shiconfig S390_CCW_IOMMU
39163f1934dSDong Jia Shi	bool "S390 CCW IOMMU Support"
392e93a1695SKrzysztof Kozlowski	depends on S390 && CCW || COMPILE_TEST
39363f1934dSDong Jia Shi	select IOMMU_API
39463f1934dSDong Jia Shi	help
39563f1934dSDong Jia Shi	  Enables bits of IOMMU API required by VFIO. The iommu_ops
39663f1934dSDong Jia Shi	  is not implemented as it is not necessary for VFIO.
39763f1934dSDong Jia Shi
3981fde5734STony Krowiakconfig S390_AP_IOMMU
3991fde5734STony Krowiak	bool "S390 AP IOMMU Support"
400e93a1695SKrzysztof Kozlowski	depends on S390 && ZCRYPT || COMPILE_TEST
4011fde5734STony Krowiak	select IOMMU_API
4021fde5734STony Krowiak	help
4031fde5734STony Krowiak	  Enables bits of IOMMU API required by VFIO. The iommu_ops
4041fde5734STony Krowiak	  is not implemented as it is not necessary for VFIO.
4051fde5734STony Krowiak
4060df4fabeSYong Wuconfig MTK_IOMMU
40718d8c74eSYong Wu	tristate "MediaTek IOMMU Support"
4080df4fabeSYong Wu	depends on ARCH_MEDIATEK || COMPILE_TEST
4091928832fSArnd Bergmann	select ARM_DMA_USE_IOMMU
4100df4fabeSYong Wu	select IOMMU_API
4110df4fabeSYong Wu	select IOMMU_IO_PGTABLE_ARMV7S
4120df4fabeSYong Wu	select MEMORY
4130df4fabeSYong Wu	select MTK_SMI
4140df4fabeSYong Wu	help
4150df4fabeSYong Wu	  Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
4160df4fabeSYong Wu	  Memory Management Unit. This option enables remapping of DMA memory
4170df4fabeSYong Wu	  accesses for the multimedia subsystem.
4180df4fabeSYong Wu
4190df4fabeSYong Wu	  If unsure, say N here.
4200df4fabeSYong Wu
421b17336c5SHonghui Zhangconfig MTK_IOMMU_V1
4228de000cfSYong Wu	tristate "MediaTek IOMMU Version 1 (M4U gen1) Support"
423b17336c5SHonghui Zhang	depends on ARM
424b17336c5SHonghui Zhang	depends on ARCH_MEDIATEK || COMPILE_TEST
425b17336c5SHonghui Zhang	select ARM_DMA_USE_IOMMU
426b17336c5SHonghui Zhang	select IOMMU_API
427b17336c5SHonghui Zhang	select MEMORY
428b17336c5SHonghui Zhang	select MTK_SMI
429b17336c5SHonghui Zhang	help
430b17336c5SHonghui Zhang	  Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
431b17336c5SHonghui Zhang	  Multimedia Memory Managememt Unit. This option enables remapping of
432b17336c5SHonghui Zhang	  DMA memory accesses for the multimedia subsystem.
433b17336c5SHonghui Zhang
434b17336c5SHonghui Zhang	  if unsure, say N here.
435b17336c5SHonghui Zhang
4360ae349a0SRob Clarkconfig QCOM_IOMMU
4370ae349a0SRob Clark	# Note: iommu drivers cannot (yet?) be built as modules
4380ae349a0SRob Clark	bool "Qualcomm IOMMU Support"
439a4aaecccSGuenter Roeck	depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
4400ae349a0SRob Clark	select IOMMU_API
4410ae349a0SRob Clark	select IOMMU_IO_PGTABLE_LPAE
4420ae349a0SRob Clark	select ARM_DMA_USE_IOMMU
4430ae349a0SRob Clark	help
4440ae349a0SRob Clark	  Support for IOMMU on certain Qualcomm SoCs.
4450ae349a0SRob Clark
44629217a47SLan Tianyuconfig HYPERV_IOMMU
44729217a47SLan Tianyu	bool "Hyper-V x2APIC IRQ Handling"
448d7f0b2e4SBoqun Feng	depends on HYPERV && X86
44929217a47SLan Tianyu	select IOMMU_API
45029217a47SLan Tianyu	default HYPERV
45129217a47SLan Tianyu	help
45229217a47SLan Tianyu	  Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
45329217a47SLan Tianyu	  guests to run with x2APIC mode enabled.
45429217a47SLan Tianyu
455edcd69abSJean-Philippe Bruckerconfig VIRTIO_IOMMU
456fa4afd78SJean-Philippe Brucker	tristate "Virtio IOMMU driver"
457fa4afd78SJean-Philippe Brucker	depends on VIRTIO
4588ce4904bSJean-Philippe Brucker	depends on (ARM64 || X86)
459edcd69abSJean-Philippe Brucker	select IOMMU_API
4608ce4904bSJean-Philippe Brucker	select IOMMU_DMA
461edcd69abSJean-Philippe Brucker	select INTERVAL_TREE
4623cf48554SJean-Philippe Brucker	select ACPI_VIOT if ACPI
463edcd69abSJean-Philippe Brucker	help
464edcd69abSJean-Philippe Brucker	  Para-virtualised IOMMU driver with virtio.
465edcd69abSJean-Philippe Brucker
466edcd69abSJean-Philippe Brucker	  Say Y here if you intend to run this kernel as a guest.
467edcd69abSJean-Philippe Brucker
468b23e4fc4SChunyan Zhangconfig SPRD_IOMMU
469b23e4fc4SChunyan Zhang	tristate "Unisoc IOMMU Support"
470b23e4fc4SChunyan Zhang	depends on ARCH_SPRD || COMPILE_TEST
471b23e4fc4SChunyan Zhang	select IOMMU_API
472b23e4fc4SChunyan Zhang	help
473b23e4fc4SChunyan Zhang	  Support for IOMMU on Unisoc's SoCs, this IOMMU can be used by
474b23e4fc4SChunyan Zhang	  Unisoc's multimedia devices, such as display, Image codec(jpeg)
475b23e4fc4SChunyan Zhang	  and a few signal processors, including VSP(video), GSP(graphic),
476b23e4fc4SChunyan Zhang	  ISP(image), and CPP(camera pixel processor), etc.
477b23e4fc4SChunyan Zhang
478b23e4fc4SChunyan Zhang	  Say Y here if you want to use the multimedia devices listed above.
479b23e4fc4SChunyan Zhang
48068255b62SJoerg Roedelendif # IOMMU_SUPPORT
481