summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorGary R Hook <gary.hook@amd.com>2017-11-03 10:50:34 -0600
committerAlex Williamson <alex.williamson@redhat.com>2017-11-03 10:50:34 -0600
commitb92b4fb5c14257c0e7eae291ecc1f7b1962e1699 (patch)
tree081cd2b7bed61ba045dc2f7526e3e223ad933416 /drivers/iommu
parent049541e178d5b1d003584aa0ad2a96101f0694d2 (diff)
downloadlinux-stable-b92b4fb5c14257c0e7eae291ecc1f7b1962e1699.tar.gz
linux-stable-b92b4fb5c14257c0e7eae291ecc1f7b1962e1699.tar.bz2
linux-stable-b92b4fb5c14257c0e7eae291ecc1f7b1962e1699.zip
iommu/amd: Limit the IOVA page range to the specified addresses
The extent of pages specified when applying a reserved region should include up to the last page of the range, but not the page following the range. Signed-off-by: Gary R Hook <gary.hook@amd.com> Fixes: 8d54d6c8b8f3 ('iommu/amd: Implement apply_dm_region call-back') Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 797e6454afd5..a8c111e96cc3 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3151,7 +3151,7 @@ static void amd_iommu_apply_resv_region(struct device *dev,
unsigned long start, end;
start = IOVA_PFN(region->start);
- end = IOVA_PFN(region->start + region->length);
+ end = IOVA_PFN(region->start + region->length - 1);
WARN_ON_ONCE(reserve_iova(&dma_dom->iovad, start, end) == NULL);
}