On 02.09.2026 16:16, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/imsic.c
> +++ b/xen/arch/riscv/imsic.c
> @@ -326,6 +326,8 @@ int __init imsic_init(const struct dt_device_node *node)
>      unsigned int nr_parent_irqs, index, nr_handlers = 0;
>      paddr_t base_addr;
>      unsigned int nr_mmios;
> +    /* imsic_cfg.msi[] is indexed by Xen CPU id, so size it accordingly. */
> +    unsigned int nr_msi = nr_cpu_ids;

Since there's no calculation involved anymore, is there a reason this
new variable is still needed? With it dropped, ...

> @@ -405,7 +407,18 @@ int __init imsic_init(const struct dt_device_node *node)
>              continue;
>          }
>  
> +        /*
> +         * hartid_to_cpuid() returns NR_CPUS for a hart Xen doesn't know, so
> +         * the range has to be checked before msi[] is indexed at all.
> +         */
>          cpu = hartid_to_cpuid(hartid);
> +        if ( cpu >= nr_msi )

... this comparison also will end up looking less odd.

Jan

Reply via email to