From: Ian Campbell Subject: Re: [PATCH v3 1/2] xen/arm : Adding helper function for WFI Date: Wed, 9 Jul 2014 13:46:18 +0100 Message-ID: <1404909978.16789.26.camel@kazak.uk.xensource.com> References: <1404390158-21542-1-git-send-email-parth.dixit@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404390158-21542-1-git-send-email-parth.dixit@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Parth Dixit Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, christoffer.dall@linaro.org, julien.grall@linaro.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-07-03 at 17:52 +0530, Parth Dixit wrote: > WFI functionality is required at different places in xen. > Moving it to seperate helper function so that it is easier > to call WFI function and avoid duplication of code > > Signed-off-by: Parth Dixit > --- > Changelog v3 : > - new patch for helper function, this functionality existed in same patch in v2 > xen/arch/arm/domain.c | 13 +++++++++++++ > xen/arch/arm/traps.c | 10 +--------- > xen/include/asm-arm/event.h | 1 + > 3 files changed, 15 insertions(+), 9 deletions(-) > > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c > index 2ae6941..bc5e56d 100644 > --- a/xen/arch/arm/domain.c > +++ b/xen/arch/arm/domain.c > @@ -779,6 +779,19 @@ void vcpu_mark_events_pending(struct vcpu *v) > vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq, 1); > } > > +/* The ARM spec declares that even if local irqs are masked in > +* the CPSR register, an irq should wake up a cpu from WFI anyway. > +* For this reason we need to check for irqs that need delivery, > +* ignoring the CPSR register, *after* calling SCHEDOP_block to > +* avoid races with vgic_vcpu_inject_irq. There should be a space before each of the continuation lines' *. > +*/ > +void vcpu_block_event(struct vcpu *v) Can anyone think of a more descriptive name for this function? vcpu_block_unless_event_pending() is a bit of a mouthful. Ian.