iommu/dma: Handle IOMMU API reserved regions
commit7c1b058c8b5a310f2f0439aff14e454aa9afe502
authorRobin Murphy <robin.murphy@arm.com>
Thu, 16 Mar 2017 17:00:18 +0000 (16 17:00 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 22 Mar 2017 15:18:59 +0000 (22 16:18 +0100)
treecfd130109d5029b7bd40ef82b61b43326558d531
parent938f1bbe35e3a7cb07e1fa7c512e2ef8bb866bdf
iommu/dma: Handle IOMMU API reserved regions

Now that it's simple to discover the necessary reservations for a given
device/IOMMU combination, let's wire up the appropriate handling. Basic
reserved regions and direct-mapped regions we simply have to carve out
of IOVA space (the IOMMU core having already mapped the latter before
attaching the device). For hardware MSI regions, we also pre-populate
the cookie with matching msi_pages. That way, irqchip drivers which
normally assume MSIs to require mapping at the IOMMU can keep working
without having to special-case their iommu_dma_map_msi_msg() hook, or
indeed be aware at all of quirks preventing the IOMMU from translating
certain addresses.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c