From: Jon Derrick Date: Wed, 27 May 2020 16:56:17 +0000 (-0600) Subject: iommu/vt-d: Remove real DMA lookup in find_domain X-Git-Tag: v5.7.6~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94621ff43f69c71876bc0a4bade550ea996d6cb2;p=thirdparty%2Fkernel%2Fstable.git iommu/vt-d: Remove real DMA lookup in find_domain commit bba9cc2cf82840bd3c9b3f4f7edac2dc8329c241 upstream. By removing the real DMA indirection in find_domain(), we can allow sub-devices of a real DMA device to have their own valid device_domain_info. The dmar lookup and context entry removal paths have been fixed to account for sub-devices. Fixes: 2b0140c69637 ("iommu/vt-d: Use pci_real_dma_dev() for mapping") Signed-off-by: Jon Derrick Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20200527165617.297470-4-jonathan.derrick@intel.com Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207575 Signed-off-by: Joerg Roedel Signed-off-by: Sushma Kalakota Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 11ed871dd2552..fde7aba49b746 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -2518,9 +2518,6 @@ struct dmar_domain *find_domain(struct device *dev) if (unlikely(attach_deferred(dev) || iommu_dummy(dev))) return NULL; - if (dev_is_pci(dev)) - dev = &pci_real_dma_dev(to_pci_dev(dev))->dev; - /* No lock here, assumes no domain exit in normal case */ info = dev->archdata.iommu; if (likely(info))