iommu/vt-d: Use correct domain id to flush virtual machine domains
authorJiang Liu <jiang.liu@linux.intel.com>
Fri, 11 Jul 2014 06:19:26 +0000 (14:19 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 23 Jul 2014 14:04:46 +0000 (16:04 +0200)
For virtual machine domains, domain->id is a virtual id, and the real
domain id written into context entry is dynamically allocated.
So use the real domain id instead of domain->id when flushing iotlbs
for virtual machine domains.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c

index 147ab1c0b573be4a409c5d2a4b523a978d38cb3d..d77009bdade51065b613e3235b5ecdbd135e5e21 100644 (file)
@@ -1822,7 +1822,7 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
                                           (((u16)bus) << 8) | devfn,
                                           DMA_CCMD_MASK_NOBIT,
                                           DMA_CCMD_DEVICE_INVL);
-               iommu->flush.flush_iotlb(iommu, domain->id, 0, 0, DMA_TLB_DSI_FLUSH);
+               iommu->flush.flush_iotlb(iommu, id, 0, 0, DMA_TLB_DSI_FLUSH);
        } else {
                iommu_flush_write_buffer(iommu);
        }