diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2011-11-11 17:26:44 -0700 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-09-18 16:17:31 +0200 |
commit | 2e12bc29fc5a12242d68e11875db3dd58efad9ff (patch) | |
tree | 58eb9ec98346b857787a45d206d9e75d3aaab72a /arch/mips/mti-malta/malta-int.c | |
parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
download | lwn-2e12bc29fc5a12242d68e11875db3dd58efad9ff.tar.gz lwn-2e12bc29fc5a12242d68e11875db3dd58efad9ff.zip |
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>
Diffstat (limited to 'arch/mips/mti-malta/malta-int.c')
0 files changed, 0 insertions, 0 deletions