linux-hardened/drivers/iommu
Alex Williamson 2e12bc29fc intel-iommu: Default to non-coherent for domains unattached to iommus
domain_update_iommu_coherency() currently defaults to setting domains
as coherent when the domain is not attached to any iommus.  This
allows for a window in domain_context_mapping_one() where such a
domain can update context entries non-coherently, and only after
update the domain capability to clear iommu_coherency.

This can be seen using KVM device assignment on VT-d systems that
do not support coherency in the ecap register.  When a device is
added to a guest, a domain is created (iommu_coherency = 0), the
device is attached, and ranges are mapped.  If we then hot unplug
the device, the coherency is updated and set to the default (1)
since no iommus are attached to the domain.  A subsequent attach
of a device makes use of the same dmar domain (now marked coherent)
updates context entries with coherency enabled, and only disables
coherency as the last step in the process.

To fix this, switch domain_update_iommu_coherency() to use the
safer, non-coherent default for domains not attached to iommus.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Tested-by: Donald Dutile <ddutile@redhat.com>
Acked-by: Donald Dutile <ddutile@redhat.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2012-09-18 16:17:31 +02:00
..
amd_iommu.c iommu/amd: Fix ACS path checking 2012-08-06 18:10:04 +02:00
amd_iommu_init.c iommu/amd: Fix wrong check for ARRAY_SIZE() 2012-08-10 11:34:08 +02:00
amd_iommu_proto.h iommu/amd: Add function to get IOMMUv2 domain for pdev 2011-12-12 15:19:05 +01:00
amd_iommu_types.h iommu/amd: Split out PCI related parts of IOMMU initialization 2012-07-17 12:14:57 +02:00
amd_iommu_v2.c IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
dmar.c iommu/dmar: Use pr_format() instead of PREFIX to tidy up pr_*() calls 2012-06-11 10:27:44 +02:00
exynos-iommu.c iommu/exynos: Fix build error 2012-08-03 16:04:45 +02:00
intel-iommu.c intel-iommu: Default to non-coherent for domains unattached to iommus 2012-09-18 16:17:31 +02:00
intel_irq_remapping.c irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU 2012-08-10 11:28:16 +02:00
iommu.c Merge branches 'iommu/fixes', 'x86/amd', 'groups', 'arm/tegra' and 'api/domain-attr' into next 2012-07-23 12:17:00 +02:00
iova.c iommu: Fix typo in iommu 2012-07-24 12:58:49 +02:00
irq_remapping.c IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
irq_remapping.h irq/apic: Use config_enabled(CONFIG_SMP) checks to clean up irq_set_affinity() for UP 2012-06-15 14:17:29 +02:00
Kconfig iommu/tegra: smmu: Add device tree support for SMMU 2012-06-25 13:50:43 +02:00
Makefile iommu: Add DMA window parser, of_get_dma_window() 2012-06-25 13:50:28 +02:00
msm_iommu.c iommu/msm: Implement DOMAIN_ATTR_GEOMETRY attribute 2012-07-11 12:20:05 +02:00
msm_iommu_dev.c msm: iommu: move to drivers/iommu/ 2011-06-21 10:48:50 +02:00
of_iommu.c iommu: Add DMA window parser, of_get_dma_window() 2012-06-25 13:50:28 +02:00
omap-iommu-debug.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
omap-iommu.c iommu/omap: Implement DOMAIN_ATTR_GEOMETRY attribute 2012-07-11 12:15:45 +02:00
omap-iovmm.c Merge branches 'iommu/fixes', 'arm/omap' and 'x86/amd' into next 2012-01-09 13:04:05 +01:00
tegra-gart.c iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attribute 2012-07-11 12:25:57 +02:00
tegra-smmu.c iommu/tegra: smmu: Fix error initial value at domain_init 2012-08-03 16:04:44 +02:00