From: Jiang Liu Date: Fri, 11 Jul 2014 06:19:25 +0000 (+0800) Subject: iommu/vt-d: Match segment number when searching for dev_iotlb capable devices X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c3b497c6bb51a2be1173cbf1d1ef4ce5e88e722e;p=linux-beck.git iommu/vt-d: Match segment number when searching for dev_iotlb capable devices For virtual machine and static identity domains, there may be devices from different PCI segments associated with the same domain. So function iommu_support_dev_iotlb() should also match PCI segment number (iommu unit) when searching for dev_iotlb capable devices. Signed-off-by: Jiang Liu Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 3664d0d00338..147ab1c0b573 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -1272,7 +1272,8 @@ iommu_support_dev_iotlb (struct dmar_domain *domain, struct intel_iommu *iommu, spin_lock_irqsave(&device_domain_lock, flags); list_for_each_entry(info, &domain->devices, link) - if (info->bus == bus && info->devfn == devfn) { + if (info->iommu == iommu && info->bus == bus && + info->devfn == devfn) { found = 1; break; }