aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Auger <[email protected]>2017-01-19 20:57:50 +0000
committerWill Deacon <[email protected]>2017-01-23 11:48:16 +0000
commit544a25d904cab2ae68bd71b334603ec3a49b60dd (patch)
tree0bd7124f745e85fb861c7e3d5cc6c79f8a6e5ed0
parent2b20cbba3390a55c511acba2f0f517dd27a528b2 (diff)
iommu: Only map direct mapped regions
As we introduced new reserved region types which do not require mapping, let's make sure we only map direct mapped regions. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Tomasz Nowicki <[email protected]> Tested-by: Tomasz Nowicki <[email protected]> Tested-by: Bharat Bhushan <[email protected]> Signed-off-by: Will Deacon <[email protected]>
-rw-r--r--drivers/iommu/iommu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 927878d0a612..41c190695749 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -343,6 +343,9 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
start = ALIGN(entry->start, pg_size);
end = ALIGN(entry->start + entry->length, pg_size);
+ if (entry->type != IOMMU_RESV_DIRECT)
+ continue;
+
for (addr = start; addr < end; addr += pg_size) {
phys_addr_t phys_addr;