VT-d code cleanup
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Dec 2008 10:59:41 +0000 (10:59 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Dec 2008 10:59:41 +0000 (10:59 +0000)
This patch narrow context caching flush range from the
domain-selective to the device-selective, when unmapping a device.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
xen/drivers/passthrough/vtd/iommu.c

index ba0ec4d205e29e17856ea52e898781cf9a530455..aa07b528277e9a029ebbb46e49ad566ceedb4e1a 100644 (file)
@@ -1308,7 +1308,9 @@ static int domain_context_unmap_one(
     context_clear_entry(*context);
     iommu_flush_cache_entry(context);
 
-    if ( iommu_flush_context_domain(iommu, domain_iommu_domid(domain), 0) )
+    if ( iommu_flush_context_device(iommu, domain_iommu_domid(domain),
+                                    (((u16)bus) << 8) | devfn,
+                                    DMA_CCMD_MASK_NOBIT, 0) )
         iommu_flush_write_buffer(iommu);
     else
         iommu_flush_iotlb_dsi(iommu, domain_iommu_domid(domain), 0);