[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



commit 2611377cf9c92b43b04a33810f03fa07bf8ba954
Author:     Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
AuthorDate: Thu May 7 13:27:07 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu May 7 16:11:03 2026 +0200

    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: c9bd8b322ecbb ("xen/riscv: imsic_init() implementation")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/riscv/imsic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index a4460576f6..f7b70a8da0 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -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;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.