Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 31000732 authored by Jon Pan-Doh's avatar Jon Pan-Doh Committed by Will Deacon
Browse files

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: c5395d5c

 ("intel-iommu: Clean up iommu_domain_identity_map()")
Signed-off-by: default avatarJon Pan-Doh <pandoh@google.com>
Tested-by: default avatarSudheer Dantuluri <dantuluris@google.com>
Suggested-by: default avatarGary Zibrat <gzibrat@google.com>
Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20240709234913.2749386-1-pandoh@google.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 0a3f6b34
Branches
Tags
No related merge requests found
......@@ -2041,7 +2041,7 @@ static int __init si_domain_init(int hw)
for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) {
ret = iommu_domain_identity_map(si_domain,
mm_to_dma_pfn_start(start_pfn),
mm_to_dma_pfn_end(end_pfn));
mm_to_dma_pfn_end(end_pfn-1));
if (ret)
return ret;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment