kernel-ark/drivers/iommu
Alex Williamson f096c061f5 iommu: Rework iommu_group_get_for_pci_dev()
It turns out that our assumption that aliases are always to the same
slot isn't true.  One particular platform reports an IVRS alias of the
SATA controller (00:11.0) for the legacy IDE controller (00:14.1).
When we hit this, we attempt to use a single IOMMU group for
everything on the same bus, which in this case is the root complex.
We already have multiple groups defined for the root complex by this
point, resulting in multiple WARN_ON hits.

This patch makes these sorts of aliases work again with IOMMU groups
by reworking how we search through the PCI address space to find
existing groups.  This should also now handle looped dependencies and
all sorts of crazy inter-dependencies that we'll likely never see.

The recursion used here should never be very deep.  It's unlikely to
have individual aliases and only theoretical that we'd ever see a
chain where one alias causes us to search through to yet another
alias.  We're also only dealing with PCIe device on a single bus,
which means we'll typically only see multiple slots in use on the root
complex.  Loops are also a theoretically possibility, which I've
tested using fake DMA alias quirks and prevent from causing problems
using a bitmap of the devfn space that's been visited.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2014-09-25 16:39:06 +02:00
..
amd_iommu_init.c iommu/amd: Add sysfs support 2014-07-04 12:35:59 +02:00
amd_iommu_proto.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_types.h Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
amd_iommu_v2.c iommu/amd: Fix 2 typos in comments 2014-07-30 16:07:50 +02:00
amd_iommu.c iommu/amd: Convert to iommu_capable() API function 2014-09-25 15:44:49 +02:00
arm-smmu.c iommu: Make of_device_id array const 2014-09-25 16:01:03 +02:00
dmar.c iommu/vt-d: Check return value of acpi_bus_get_device() 2014-08-26 11:15:17 +02:00
exynos-iommu.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
fsl_pamu_domain.c iommu/fsl: Convert to iommu_capable() API function 2014-09-25 15:47:37 +02:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
fsl_pamu.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
fsl_pamu.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel_irq_remapping.c iommu/vt-d: Fix race setting IRQ CPU affinity while freeing IRQ 2014-07-31 13:45:05 +02:00
intel-iommu.c iommu/vt-d: Convert to iommu_capable() API function 2014-09-25 15:47:37 +02:00
iommu-sysfs.c iommu: Fix compile error in iommu-sysfs.c 2014-07-07 12:01:21 +02:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c iommu: Rework iommu_group_get_for_pci_dev() 2014-09-25 16:39:06 +02:00
iova.c iommu/vt-d: Update IOMMU state when memory hotplug happens 2014-03-04 17:51:06 +01:00
ipmmu-vmsa.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
irq_remapping.c x86: irq_remapping: Use irq_alloc/free_hwirq() 2014-05-16 14:05:18 +02:00
irq_remapping.h iommu/vt-d: add quirk for broken interrupt remapping on 55XX chipsets 2013-04-18 17:00:47 +02:00
Kconfig Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
Makefile Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
msm_iommu_dev.c iommu/msm: Use devm_ioremap_resource to simplify code 2014-05-30 20:20:12 +02:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu.c iommu/msm: Convert to iommu_capable() API function 2014-09-25 15:47:38 +02:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: add missing include 2014-01-07 15:16:27 +01:00
omap-iommu2.c iommu/omap: Enable bus-error back on supported iommus 2014-03-04 17:02:08 +01:00
omap-iommu-debug.c iommu/omap: Remove virtual memory manager 2014-07-29 12:38:07 +02:00
omap-iommu.c iommu: Make of_device_id array const 2014-09-25 16:01:03 +02:00
omap-iommu.h iommu/omap: Remove virtual memory manager 2014-07-29 12:38:07 +02:00
omap-iopgtable.h iommu/omap: Move to_iommu definition from omap-iopgtable.h 2014-04-16 16:30:15 +02:00
shmobile-iommu.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
shmobile-ipmmu.c iommu/shmobile: Use devm_ioremap_resource() 2014-04-17 12:16:12 +02:00
shmobile-ipmmu.h iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
tegra-gart.c iommu: Make of_device_id array const 2014-09-25 16:01:03 +02:00
tegra-smmu.c iommu: Make of_device_id array const 2014-09-25 16:01:03 +02:00