android_kernel_google_msm/drivers/iommu
Alex Williamson 63b2f08626 intel-iommu: Default to non-coherent for domains unattached to iommus
commit 2e12bc29fc upstream.

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>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-13 05:38:37 +09:00
..
amd_iommu.c iommu/amd: Fix hotplug with iommu=pt 2012-08-09 08:31:32 -07:00
amd_iommu_init.c iommu/amd: Fix missing iommu_shutdown initialization in passthrough mode 2012-07-16 09:03:51 -07: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: Cache pdev pointer to root-bridge 2012-06-10 00:36:18 +09:00
amd_iommu_v2.c iommu/amd: Add missing spin_lock initialization 2012-08-09 08:31:31 -07:00
dmar.c iommu: Fix off by one in dmar_get_fault_reason() 2012-06-01 15:18:27 +08:00
intel-iommu.c intel-iommu: Default to non-coherent for domains unattached to iommus 2012-10-13 05:38:37 +09:00
intr_remapping.c irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU 2012-10-02 10:30:38 -07:00
intr_remapping.h
iommu.c Merge branches 'iommu/page-sizes' and 'iommu/group-id' into next 2012-01-09 13:06:28 +01:00
iova.c
Kconfig ARM: IOMMU: Tegra30: Add iommu_ops for SMMU driver 2012-01-26 13:59:02 +01:00
Makefile ARM: IOMMU: Tegra30: Add iommu_ops for SMMU driver 2012-01-26 13:59:02 +01:00
msm_iommu.c iommu/msm: Fix error handling in msm_iommu_unmap() 2012-01-30 12:53:14 +01:00
msm_iommu_dev.c
omap-iommu-debug.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
omap-iommu.c ARM: OMAP: make iommu subsys_initcall to fix builtin omap3isp 2012-02-27 14:18:42 +01: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-gart: fix spin_unlock in map failure path 2012-03-13 11:17:42 +01:00
tegra-smmu.c iommu/tegra: smmu: Fix unsleepable memory allocation 2012-07-16 09:03:52 -07:00