xen/riscv: fix MMIO alignment check in imsic_init()

The MMIO alignment check in imsic_init() incorrectly uses cpu as
the index into mmios[]. The loop index should be used instead.
Otherwise, the alignment check may be performed on the wrong MMIO
address.

Fix the index used in the alignment check and corresponding printk.

Fixes: c9bd8b322e ("xen/riscv: imsic_init() implementation")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Oleksii Kurochko authored and Jan Beulich committed 2026-05-07 16:11:03 +02:00
1 parent 54ca0aadc8
commit 2611377cf9
1 file changed
+3 -3
+3 -3
View File
@@ -451,11 +451,11 @@ int __init imsic_init(const struct dt_device_node *node)
continue;
}
if ( !IS_ALIGNED(mmios[cpu].base_addr + reloff,
IMSIC_MMIO_PAGE_SZ) )
if ( !IS_ALIGNED(mmios[index].base_addr + reloff, IMSIC_MMIO_PAGE_SZ) )
{
printk(XENLOG_WARNING "%s: MMIO address %#lx is not aligned on a page\n",
node->name, msi[cpu].base_addr + reloff);
node->name, mmios[index].base_addr + reloff);
continue;
}
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.