iommu/dma: Reserve IOVA for PCIe inaccessible DMA address
authorSrinath Mannam <srinath.mannam@broadcom.com>
Fri, 3 May 2019 14:05:33 +0000 (19:35 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 6 May 2019 21:03:07 +0000 (16:03 -0500)
commitaadad097cd46f783b75c235cffa5c21fcffbf189
treeabb3d5b5097f9b778e7f7206f617a87c3006d73b
parente80a91ad302b3b66822756afc61f9f9c1658b9c9
iommu/dma: Reserve IOVA for PCIe inaccessible DMA address

The dma_ranges list field of PCI host bridge structure has resource entries
in sorted order representing address ranges allowed for DMA transfers.

Process the list and reserve IOVA addresses that are not present in its
resource entries (ie DMA memory holes) to prevent allocating IOVA addresses
that cannot be accessed by PCI devices.

Based-on-a-patch-by: Oza Pawandeep <oza.oza@broadcom.com>
Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Oza Pawandeep <poza@codeaurora.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
drivers/iommu/dma-iommu.c