RE: [PATCH] iommu/vt-d: Fix identity map bounds in si_domain_init()

From: Tian, Kevin
Date: Tue Jul 09 2024 - 20:49:18 EST


> From: Jon Pan-Doh <pandoh@xxxxxxxxxx>
> Sent: Wednesday, July 10, 2024 7:49 AM
>
> Intel IOMMU operates on inclusive bounds (both generally aas well as

s/aas/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: 5dfe8660a3d7 ("bootmem: Replace work_with_active_regions() with
> for_each_mem_pfn_range()")

this doesn't appear to be the original commit introducing this bug.

Even the old work_with_active_regions() way used exclusive end_pfn
while it's not adjusted when calling iommu_domain_identity_map().

> Signed-off-by: Jon Pan-Doh <pandoh@xxxxxxxxxx>
> Tested-by: Sudheer Dantuluri <dantuluris@xxxxxxxxxx>
> Suggested-by: Gary Zibrat <gzibrat@xxxxxxxxxx>

otherwise,

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>