From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH for 4.5] xen/arm: Initialize the domain vgic lock Date: Fri, 19 Dec 2014 09:23:16 -0500 Message-ID: <20141219142316.GB2690@laptop.dumpdata.com> References: <1418830815-4720-1-git-send-email-julien.grall@linaro.org> <1418896057.11882.0.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Y1zOh-0006mf-EH for xen-devel@lists.xenproject.org; Fri, 19 Dec 2014 15:23:19 +0000 Content-Disposition: inline In-Reply-To: <1418896057.11882.0.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, Julien Grall , tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, Dec 18, 2014 at 09:47:37AM +0000, Ian Campbell wrote: > On Wed, 2014-12-17 at 15:40 +0000, Julien Grall wrote: > > The domain vgic lock is used uninitialized. > > > > Signed-off-by: Julien Grall > > Acked-by: Ian Campbell Release-Acked-by: Konrad Rzeszutek Wilk > > > --- > > This is a bug fix for Xen 4.5 and Xen 4.4. The vgic lock is used > > unitialized. Luckily we only use the field "raw" which is reset to 0 > > during the domain allocation. > > > > There is no harm to apply for Xen 4.5 because it will correctly set > > the spin_lock structure for a later usage. > > By your above reasoning there is also no point, is there? That said, I > think we should take this since as you say it is harmless and good > practice to initialise spinlocks even if not strictly necessary. > > > --- > > xen/arch/arm/vgic.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > > index 97061ce..b8bd38b 100644 > > --- a/xen/arch/arm/vgic.c > > +++ b/xen/arch/arm/vgic.c > > @@ -90,6 +90,8 @@ int domain_vgic_init(struct domain *d) > > return -ENODEV; > > } > > > > + spin_lock_init(&d->arch.vgic.lock); > > + > > d->arch.vgic.shared_irqs = > > xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d)); > > if ( d->arch.vgic.shared_irqs == NULL ) > > >