Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03bfadfb authored by Gary R Hook's avatar Gary R Hook Committed by Greg Kroah-Hartman
Browse files

iommu/amd: Limit the IOVA page range to the specified addresses




[ Upstream commit b92b4fb5c14257c0e7eae291ecc1f7b1962e1699 ]

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: default avatarGary R Hook <gary.hook@amd.com>
Fixes: 8d54d6c8 ('iommu/amd: Implement apply_dm_region call-back')
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb0acb37
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3211,7 +3211,7 @@ static void amd_iommu_apply_dm_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);
}