Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/ia64: intel-iommu: move to drivers/iommu/

This should ease finding similarities with different platforms,
with the intention of solving problems once in a generic framework
which everyone can use.

Note: to move intel-iommu.c, the declaration of pci_find_upstream_pcie_bridge()
has to move from drivers/pci/pci.h to include/linux/pci.h. This is handled
in this patch, too.

As suggested, also drop DMAR's EXPERIMENTAL tag while we're at it.

Compile-tested on x86_64.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

Ohad Ben-Cohen and committed by
Joerg Roedel
166e9278 29b68415

+62 -80
-21
arch/ia64/Kconfig
··· 627 627 628 628 source "drivers/pcmcia/Kconfig" 629 629 630 - config DMAR 631 - bool "Support for DMA Remapping Devices (EXPERIMENTAL)" 632 - depends on IA64_GENERIC && ACPI && EXPERIMENTAL 633 - help 634 - DMA remapping (DMAR) devices support enables independent address 635 - translations for Direct Memory Access (DMA) from devices. 636 - These DMA remapping devices are reported via ACPI tables 637 - and include PCI device scope covered by these DMA 638 - remapping devices. 639 - 640 - config DMAR_DEFAULT_ON 641 - def_bool y 642 - prompt "Enable DMA Remapping Devices by default" 643 - depends on DMAR 644 - help 645 - Selecting this option will enable a DMAR device at boot time if 646 - one is found. If this option is not selected, DMAR support can 647 - be enabled by passing intel_iommu=on to the kernel. It is 648 - recommended you say N here while the DMAR code remains 649 - experimental. 650 - 651 630 endmenu 652 631 653 632 endif
-50
arch/x86/Kconfig
··· 1912 1912 1913 1913 You should say N unless you know you need this. 1914 1914 1915 - config DMAR 1916 - bool "Support for DMA Remapping Devices (EXPERIMENTAL)" 1917 - depends on PCI_MSI && ACPI && EXPERIMENTAL 1918 - select IOMMU_API 1919 - help 1920 - DMA remapping (DMAR) devices support enables independent address 1921 - translations for Direct Memory Access (DMA) from devices. 1922 - These DMA remapping devices are reported via ACPI tables 1923 - and include PCI device scope covered by these DMA 1924 - remapping devices. 1925 - 1926 - config DMAR_DEFAULT_ON 1927 - def_bool y 1928 - prompt "Enable DMA Remapping Devices by default" 1929 - depends on DMAR 1930 - help 1931 - Selecting this option will enable a DMAR device at boot time if 1932 - one is found. If this option is not selected, DMAR support can 1933 - be enabled by passing intel_iommu=on to the kernel. It is 1934 - recommended you say N here while the DMAR code remains 1935 - experimental. 1936 - 1937 - config DMAR_BROKEN_GFX_WA 1938 - bool "Workaround broken graphics drivers (going away soon)" 1939 - depends on DMAR && BROKEN 1940 - ---help--- 1941 - Current Graphics drivers tend to use physical address 1942 - for DMA and avoid using DMA APIs. Setting this config 1943 - option permits the IOMMU driver to set a unity map for 1944 - all the OS-visible memory. Hence the driver can continue 1945 - to use physical addresses for DMA, at least until this 1946 - option is removed in the 2.6.32 kernel. 1947 - 1948 - config DMAR_FLOPPY_WA 1949 - def_bool y 1950 - depends on DMAR 1951 - ---help--- 1952 - Floppy disk drivers are known to bypass DMA API calls 1953 - thereby failing to work when IOMMU is enabled. This 1954 - workaround will setup a 1:1 mapping for the first 1955 - 16MiB to make floppy (an ISA device) work. 1956 - 1957 - config INTR_REMAP 1958 - bool "Support for Interrupt Remapping (EXPERIMENTAL)" 1959 - depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL 1960 - ---help--- 1961 - Supports Interrupt remapping for IO-APIC and MSI devices. 1962 - To use x2apic mode in the CPU's which support x2APIC enhancements or 1963 - to support platforms with CPU's having > 8 bit APIC ID, say Y. 1964 - 1965 1915 source "drivers/pci/pcie/Kconfig" 1966 1916 1967 1917 source "drivers/pci/Kconfig"
+49
drivers/iommu/Kconfig
··· 46 46 statistics about whats happening in the driver and exports that 47 47 information to userspace via debugfs. 48 48 If unsure, say N. 49 + 50 + # Intel IOMMU support 51 + config DMAR 52 + bool "Support for DMA Remapping Devices" 53 + depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC) 54 + select IOMMU_API 55 + help 56 + DMA remapping (DMAR) devices support enables independent address 57 + translations for Direct Memory Access (DMA) from devices. 58 + These DMA remapping devices are reported via ACPI tables 59 + and include PCI device scope covered by these DMA 60 + remapping devices. 61 + 62 + config DMAR_DEFAULT_ON 63 + def_bool y 64 + prompt "Enable DMA Remapping Devices by default" 65 + depends on DMAR 66 + help 67 + Selecting this option will enable a DMAR device at boot time if 68 + one is found. If this option is not selected, DMAR support can 69 + be enabled by passing intel_iommu=on to the kernel. 70 + 71 + config DMAR_BROKEN_GFX_WA 72 + bool "Workaround broken graphics drivers (going away soon)" 73 + depends on DMAR && BROKEN && X86 74 + ---help--- 75 + Current Graphics drivers tend to use physical address 76 + for DMA and avoid using DMA APIs. Setting this config 77 + option permits the IOMMU driver to set a unity map for 78 + all the OS-visible memory. Hence the driver can continue 79 + to use physical addresses for DMA, at least until this 80 + option is removed in the 2.6.32 kernel. 81 + 82 + config DMAR_FLOPPY_WA 83 + def_bool y 84 + depends on DMAR && X86 85 + ---help--- 86 + Floppy disk drivers are known to bypass DMA API calls 87 + thereby failing to work when IOMMU is enabled. This 88 + workaround will setup a 1:1 mapping for the first 89 + 16MiB to make floppy (an ISA device) work. 90 + 91 + config INTR_REMAP 92 + bool "Support for Interrupt Remapping (EXPERIMENTAL)" 93 + depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL 94 + ---help--- 95 + Supports Interrupt remapping for IO-APIC and MSI devices. 96 + To use x2apic mode in the CPU's which support x2APIC enhancements or 97 + to support platforms with CPU's having > 8 bit APIC ID, say Y.
+2
drivers/iommu/Makefile
··· 1 1 obj-$(CONFIG_IOMMU_API) += iommu.o 2 2 obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o msm_iommu_dev.o 3 3 obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o 4 + obj-$(CONFIG_DMAR) += dmar.o iova.o intel-iommu.o 5 + obj-$(CONFIG_INTR_REMAP) += dmar.o intr_remapping.o
-5
drivers/pci/Makefile
··· 29 29 # Build the Hypertransport interrupt support 30 30 obj-$(CONFIG_HT_IRQ) += htirq.o 31 31 32 - # Build Intel IOMMU support 33 - obj-$(CONFIG_DMAR) += dmar.o iova.o intel-iommu.o 34 - 35 - obj-$(CONFIG_INTR_REMAP) += dmar.o intr_remapping.o 36 - 37 32 obj-$(CONFIG_PCI_IOV) += iov.o 38 33 39 34 #
drivers/pci/dmar.c drivers/iommu/dmar.c
-1
drivers/pci/intel-iommu.c drivers/iommu/intel-iommu.c
··· 42 42 #include <linux/pci-ats.h> 43 43 #include <asm/cacheflush.h> 44 44 #include <asm/iommu.h> 45 - #include "pci.h" 46 45 47 46 #define ROOT_SIZE VTD_PAGE_SIZE 48 47 #define CONTEXT_SIZE VTD_PAGE_SIZE
-1
drivers/pci/intr_remapping.c drivers/iommu/intr_remapping.c
··· 13 13 #include "intr_remapping.h" 14 14 #include <acpi/acpi.h> 15 15 #include <asm/pci-direct.h> 16 - #include "pci.h" 17 16 18 17 static struct ioapic_scope ir_ioapic[MAX_IO_APICS]; 19 18 static struct hpet_scope ir_hpet[MAX_HPET_TBS];
drivers/pci/intr_remapping.h drivers/iommu/intr_remapping.h
drivers/pci/iova.c drivers/iommu/iova.c
-2
drivers/pci/pci.h
··· 184 184 return NULL; 185 185 } 186 186 187 - struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev); 188 - 189 187 /* PCI slot sysfs helper code */ 190 188 #define to_pci_slot(s) container_of(s, struct pci_slot, kobj) 191 189
+11
include/linux/pci.h
··· 1589 1589 int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1590 1590 unsigned int len, const char *kw); 1591 1591 1592 + /** 1593 + * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device 1594 + * @pdev: the PCI device 1595 + * 1596 + * if the device is PCIE, return NULL 1597 + * if the device isn't connected to a PCIe bridge (that is its parent is a 1598 + * legacy PCI bridge and the bridge is directly connected to bus 0), return its 1599 + * parent 1600 + */ 1601 + struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev); 1602 + 1592 1603 #endif /* __KERNEL__ */ 1593 1604 #endif /* LINUX_PCI_H */