Julien Grall
2013-Jun-27 19:58 UTC
[PATCH] 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. Signed-off-by: Julien Grall <julien.grall@linaro.org> --- xen/arch/arm/vgic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 7eaccb7..2e4b11f 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -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++) -- 1.7.10.4
Stefano Stabellini
2013-Jun-28 10:43 UTC
Re: [PATCH] xen/arm: Zeroed vgic ranks during the initialization
On Thu, 27 Jun 2013, Julien Grall wrote:> 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. > > Signed-off-by: Julien Grall <julien.grall@linaro.org>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>> xen/arch/arm/vgic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > index 7eaccb7..2e4b11f 100644 > --- a/xen/arch/arm/vgic.c > +++ b/xen/arch/arm/vgic.c > @@ -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++) > -- > 1.7.10.4 >
Ian Campbell
2013-Jun-28 11:59 UTC
Re: [PATCH] xen/arm: Zeroed vgic ranks during the initialization
On Fri, 2013-06-28 at 11:43 +0100, Stefano Stabellini wrote:> On Thu, 27 Jun 2013, Julien Grall wrote: > > 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. > > > > Signed-off-by: Julien Grall <julien.grall@linaro.org> > > Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Likewise + applied.