1 // SPDX-License-Identifier: GPL-2.0
3 * Dynamic DMA mapping support.
6 #include <linux/types.h>
8 #include <linux/string.h>
10 #include <linux/module.h>
11 #include <linux/dmar.h>
12 #include <asm/iommu.h>
13 #include <asm/machvec.h>
14 #include <linux/dma-mapping.h>
15 #include <linux/kernel.h>
18 int no_iommu __read_mostly;
19 #ifdef CONFIG_IOMMU_DEBUG
20 int force_iommu __read_mostly = 1;
22 int force_iommu __read_mostly;
25 int iommu_pass_through;
27 static int __init pci_iommu_init(void)
35 /* Must execute after PCI subsystem */
36 fs_initcall(pci_iommu_init);
38 void __init pci_iommu_alloc(void)
41 * The order of these functions is important for
42 * fall-back/fail-over reasons
47 if (!iommu_detected) {
48 #ifdef CONFIG_IA64_GENERIC
49 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
53 panic("Unable to find Intel IOMMU");
54 #endif /* CONFIG_IA64_GENERIC */
56 #endif /* CONFIG_SWIOTLB */