Skip to contentSkip to conversation

xen/arm: Zeroed vgic ranks during the initialization

PATCH In review Julien Grall 3 participants 3 messages Jun 27, 2013 – Jun 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Zeroed vgic ranks during the initialization

vgic_rank contains data which inform the guest if an IRQ is enabled/actived/pending...

The structure must be zeroed otherwise the guest can retrieve wrong GIC state.

---
 xen/arch/arm/vgic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vgic.c +1 -1
index 7eaccb7..2e4b11f 100644
@@ -88,7 +88,7 @@ int domain_vgic_init(struct domain *d)
         d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */
 
     d->arch.vgic.shared_irqs =
-        xmalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
+        xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
     d->arch.vgic.pending_irqs =
         xzalloc_array(struct pending_irq, d->arch.vgic.nr_lines);
     for (i=0; i<d->arch.vgic.nr_lines; i++)
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Julien Grall

vgic_rank contains data which inform the guest if an IRQ is enabled/actived/pending...

The structure must be zeroed otherwise the guest can retrieve wrong GIC state.

Quoted 19 lines
 xen/arch/arm/vgic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/vgic.c +1 -1
index 7eaccb7..2e4b11f 100644
@@ -88,7 +88,7 @@ int domain_vgic_init(struct domain *d)
         d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */
 
     d->arch.vgic.shared_irqs =
-        xmalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
+        xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d));
     d->arch.vgic.pending_irqs =
         xzalloc_array(struct pending_irq, d->arch.vgic.nr_lines);
     for (i=0; i<d->arch.vgic.nr_lines; i++)
Signature · 1 line
1.7.10.4