Skip to content

Commit 3100073

Browse files
Jon Pan-Dohwilldeacon
authored andcommitted
iommu/vt-d: Fix identity map bounds in si_domain_init()
Intel IOMMU operates on inclusive bounds (both generally aas well as iommu_domain_identity_map()). Meanwhile, for_each_mem_pfn_range() uses exclusive bounds for end_pfn. This creates an off-by-one error when switching between the two. Fixes: c5395d5 ("intel-iommu: Clean up iommu_domain_identity_map()") Signed-off-by: Jon Pan-Doh <[email protected]> Tested-by: Sudheer Dantuluri <[email protected]> Suggested-by: Gary Zibrat <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 0a3f6b3 commit 3100073

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ static int __init si_domain_init(int hw)
20412041
for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) {
20422042
ret = iommu_domain_identity_map(si_domain,
20432043
mm_to_dma_pfn_start(start_pfn),
2044-
mm_to_dma_pfn_end(end_pfn));
2044+
mm_to_dma_pfn_end(end_pfn-1));
20452045
if (ret)
20462046
return ret;
20472047
}

0 commit comments

Comments
 (0)