linux-stable/drivers/iommu
Alex Williamson 7168440690 iommu/vt-d: Detach domain *only* from attached iommus
Device domains never span IOMMU hardware units, which allows the
domain ID space for each IOMMU to be an independent address space.
Therefore we can have multiple, independent domains, each with the
same domain->id, but attached to different hardware units.  This is
also why we need to do a heavy-weight search for VM domains since
they can span multiple IOMMUs hardware units and we don't require a
single global ID to use for all hardware units.

Therefore, if we call iommu_detach_domain() across all active IOMMU
hardware units for a non-VM domain, the result is that we clear domain
IDs that are not associated with our domain, allowing them to be
re-allocated and causing apparent coherency issues when the device
cannot access IOVAs for the intended domain.

This bug was introduced in commit fb170fb4c5 ("iommu/vt-d: Introduce
helper functions to make code symmetric for readability"), but is
significantly exacerbated by the more recent commit 62c22167dd
("iommu/vt-d: Fix dmar_domain leak in iommu_attach_device") which calls
domain_exit() more frequently to resolve a domain leak.

Fixes: fb170fb4c5 ("iommu/vt-d: Introduce helper functions to make code symmetric for readability")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2015-03-23 15:22:08 +01:00
..
amd_iommu.c IOMMU Updates for Linux v3.20 2015-02-12 09:16:56 -08:00
amd_iommu_init.c IOMMU Updates for Linux v3.20 2015-02-12 09:16:56 -08:00
amd_iommu_proto.h IOMMU Updates for Linux v3.20 2015-02-12 09:16:56 -08:00
amd_iommu_types.h iommu: Update my email address 2015-02-04 16:14:34 +01:00
amd_iommu_v2.c Merge branches 'arm/renesas', 'arm/smmu', 'arm/omap', 'ppc/pamu', 'x86/amd' and 'core' into next 2015-02-04 16:53:44 +01:00
arm-smmu.c iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition 2015-03-23 15:21:26 +01:00
dmar.c iommu/vt-d: Search for ACPI _DSM method for DMAR hotplug 2014-11-18 11:18:36 +01:00
exynos-iommu.c iommu/exynos: Play nice in multi-platform builds 2015-02-25 13:40:52 +01:00
fsl_pamu.c iommu/fsl: Various cleanups 2015-02-03 18:47:18 +01:00
fsl_pamu.h iommu/fsl: Various cleanups 2015-02-03 18:47:18 +01:00
fsl_pamu_domain.c iommu/fsl: Various cleanups 2015-02-03 18:47:18 +01:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel-iommu.c iommu/vt-d: Detach domain *only* from attached iommus 2015-03-23 15:22:08 +01:00
intel_irq_remapping.c iommu/irq_remapping: Change variable disable_irq_remap to be static 2015-01-15 11:24:24 +01:00
io-pgtable-arm.c iommu/io-pgtable-arm: Fix self-test WARNs on i386 2015-02-25 13:37:32 +01:00
io-pgtable.c iommu: add ARM LPAE page table allocator 2015-01-19 14:46:44 +00:00
io-pgtable.h iommu: io-pgtable-arm: add non-secure quirk 2015-01-19 14:46:45 +00: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: Update my email address 2015-02-04 16:14:34 +01:00
iova.c iommu: Make IOVA domain page size explicit 2015-01-19 14:55:22 +01:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Fix IOMMU lookup when multiple IOMMUs are registered 2015-01-30 13:46:07 +01:00
irq_remapping.c iommu/irq_remapping: Normailize the way to detect whether IR is enabled 2015-01-15 11:24:24 +01:00
irq_remapping.h IOMMU Updates for Linux v3.20 2015-02-12 09:16:56 -08:00
Kconfig iommu/io-pgtable-arm: Add built time dependency 2015-03-03 14:04:12 +01:00
Makefile Merge branches 'arm/renesas', 'arm/smmu', 'arm/omap', 'ppc/pamu', 'x86/amd' and 'core' into next 2015-02-04 16:53:44 +01:00
msm_iommu.c Merge branches 'arm/omap', 'arm/msm', 'arm/rockchip', 'arm/renesas', 'arm/smmu', 'x86/vt-d', 'x86/amd' and 'core' into next 2014-12-02 13:07:13 +01:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu_dev.c iommu/msm: Use dev_get_platdata() 2014-11-04 15:03:39 +01:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: store DT-probed IOMMU data privately 2014-12-05 14:35:52 +00:00
omap-iommu-debug.c iommu/omap: Switch pagetable debugfs entry to use seq_file 2014-10-23 14:33:48 +02:00
omap-iommu.c iommu/omap: Play nice in multi-platform builds 2015-02-25 13:41:33 +01:00
omap-iommu.h iommu/omap: Do not export unneeded functions 2014-10-23 14:33:47 +02:00
omap-iopgtable.h iommu/omap: Move to_iommu definition from omap-iopgtable.h 2014-04-16 16:30:15 +02:00
rockchip-iommu.c iommu/rockchip: Play nice in multi-platform builds 2015-02-25 13:42:25 +01:00
shmobile-iommu.c iommu: Add iommu_map_sg() function 2014-11-04 14:53:36 +01:00
shmobile-ipmmu.c iommu: drop owner assignment from platform_drivers 2014-10-20 16:20:42 +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/tegra: gart: Provide default ->map_sg() callback 2015-01-26 13:41:07 +01:00
tegra-smmu.c memory: Add NVIDIA Tegra memory controller support 2014-12-04 16:11:47 +01:00