From: Keir Fraser Date: Fri, 5 Dec 2008 10:59:41 +0000 (+0000) Subject: VT-d code cleanup X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14026^2~71 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=112495f91da6147d1c65169bd63540dc1a6511ec;p=xen.git VT-d code cleanup This patch narrow context caching flush range from the domain-selective to the device-selective, when unmapping a device. Signed-off-by: Yu Zhao --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index ba0ec4d205..aa07b52827 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -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);