mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 20:59:37 +02:00
iommu/vt-d: Fix identity map bounds in si_domain_init()
[ Upstream commit31000732d5
] 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:c5395d5c4a
("intel-iommu: Clean up iommu_domain_identity_map()") Signed-off-by: Jon Pan-Doh <pandoh@google.com> Tested-by: Sudheer Dantuluri <dantuluris@google.com> Suggested-by: Gary Zibrat <gzibrat@google.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20240709234913.2749386-1-pandoh@google.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e22ea60d2c
commit
ddeff5d66e
|
@ -2411,7 +2411,7 @@ static int __init si_domain_init(int hw)
|
||||||
for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) {
|
for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) {
|
||||||
ret = iommu_domain_identity_map(si_domain,
|
ret = iommu_domain_identity_map(si_domain,
|
||||||
mm_to_dma_pfn_start(start_pfn),
|
mm_to_dma_pfn_start(start_pfn),
|
||||||
mm_to_dma_pfn_end(end_pfn));
|
mm_to_dma_pfn_end(end_pfn-1));
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user