From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v2 2/4] xen/arm: do not use is_running to decide whether we can write directly to the LR registers Date: Fri, 19 Apr 2013 18:11:44 +0100 Message-ID: References: <1361203349-24689-2-git-send-email-stefano.stabellini@eu.citrix.com> <1365606212.27868.77.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1365606212.27868.77.camel@zakaz.uk.xensource.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.xensource.com" , "Tim (Xen.org)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, 10 Apr 2013, Ian Campbell wrote: > > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c > > index ac1f939..2d0b052 100644 > > --- a/xen/arch/arm/gic.c > > +++ b/xen/arch/arm/gic.c > > @@ -65,11 +65,9 @@ void gic_save_state(struct vcpu *v) > > { > > int i; > > > > - spin_lock_irq(&gic.lock); > > for ( i=0; i > v->arch.gic_lr[i] = GICH[GICH_LR + i]; > > v->arch.lr_mask = this_cpu(lr_mask); > > - spin_unlock_irq(&gic.lock); > > Why does this lock become unnecessary? Just because interrupts are now > disabled around this call and it only accesses v->foo which cannot be > accessed simultaneously on some other pCPU (e.g. one which is trying to > inject an event to this vCPU)? That's right. > Would be good to describe in the changelog or perhaps a comment. Maybe > even ASSERT(irqs_disbled()) Good idea.