]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/dma: Handle MSI mappings separately
authorRobin Murphy <robin.murphy@arm.com>
Mon, 29 Jul 2019 15:32:38 +0000 (16:32 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 6 Aug 2019 15:22:49 +0000 (17:22 +0200)
commit74832eb91562e742fa9bf0544cd6b0a9ac164c9e
tree33b648afb7bc141828ed9382dd5d0f13a8ab362e
parent1b1e3f6d5a6ff25a6613c83a142ba0d73a10c16d
iommu/dma: Handle MSI mappings separately

MSI pages must always be mapped into a device's *current* domain, which
*might* be the default DMA domain, but might instead be a VFIO domain
with its own MSI cookie. This subtlety got accidentally lost in the
streamlining of __iommu_dma_map(), but rather than reintroduce more
complexity and/or special-casing, it turns out neater to just split this
path out entirely.

Since iommu_dma_get_msi_page() already duplicates much of what
__iommu_dma_map() does, it can easily just make the allocation and
mapping calls directly as well. That way we can further streamline the
helper back to exclusively operating on DMA domains.

Fixes: 8715b42fa715 ("iommu/dma: Move domain lookup into __iommu_dma_{map,unmap}")
Reported-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Marc Zyngier <maz@kernel.org>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c