xen/arm: Fix under-mapping in map_range_to_domain()

If the memory region to be mapped does not start at the page boundary
and its end spans over the page boundary, map_range_to_domain() passes
a number of pages that is short by one to map_regions_p2mt(). Domain's
attempt to access memory within that page will fail. Fix it by calculating
the number of pages to be mapped taking into account the start offset.

Fixes: 88c10b0d6e ("arch/arm: let map_mmio_regions() use start and count")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Julien Grall <julien@xen.org>
This commit is contained in:
Michal Orzel committed 2026-10-22 07:47:48 +02:00
1 parent 81e823f1e9
commit 9a6cc49b44
1 file changed
+1 -1
+1 -1
View File
@@ -89,7 +89,7 @@ int __overlay_init map_range_to_domain(const struct dt_device_node *dev,
{ {
res = map_regions_p2mt(d, res = map_regions_p2mt(d,
gaddr_to_gfn(addr), gaddr_to_gfn(addr),
PFN_UP(len), PFN_UP(addr + len) - PFN_DOWN(addr),
maddr_to_mfn(addr), maddr_to_mfn(addr),
mr_data->p2mt); mr_data->p2mt);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.