Skip to contentSkip to conversation

xen/arm: vgic: Make sure the number of SPIs is a multiple of 32

PATCH Superseded Julien Grall 1 participant 2 messages Feb 16, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: vgic: Make sure the number of SPIs is a multiple of 32

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.

---
Jarvis, I don't have Jeff's e-mail address so I put you as the report. Let me know if you want to change that.

This should be backported up to Xen 4.8.

---
 xen/arch/arm/vgic.c | 7 +++++++
 1 file changed, 7 insertions(+)
xen/arch/arm/vgic.c +7 -0
index 9921769b15..34269bcf27 100644
@@ -123,6 +123,13 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
 
     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;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

(+ Jarvis)

Hmmm it looks like my modification in git-send-email to take CC all *-by tags disappeared. So CC jarvis.

Cheers,

Quoted 35 lines · Julien Grall

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.

---
Jarvis, I don't have Jeff's e-mail address so I put you as the report. Let me know if you want to change that.

This should be backported up to Xen 4.8.

---
  xen/arch/arm/vgic.c | 7 +++++++
  1 file changed, 7 insertions(+)
xen/arch/arm/vgic.c +7 -0
index 9921769b15..34269bcf27 100644
@@ -123,6 +123,13 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
 
      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;
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel