The vGIC relies on having a pending_irq available for every IRQs
described in the ranks. As each rank describes 32 interrupts, we need to
make sure the number of SPIs is a multiple of 32.
Reported-by: Jeff Kubascik <Jeff.Kubascik@dornerworks.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Cc: Jarvis Roach <Jarvis.Roach@dornerworks.com>
d->arch.vgic.ctlr = 0;
+ /*
+ * The vGIC relies on having a pending_irq available for every IRQ
+ * described in the ranks. As each rank describes 32 interrupts, we
+ * need to make sure the number of SPIs is a multiple of 32.
+ */
+ nr_spis = ROUNDUP(nr_spis, 32);
+
/* Limit the number of virtual SPIs supported to (1020 - 32) = 988 */
if ( nr_spis > (1020 - NR_LOCAL_IRQS) )
return -EINVAL;