From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v8 09/13] xen/arm: second irq injection while the first irq is still inflight Date: Sun, 25 May 2014 19:46:50 +0100 Message-ID: <53823A9A.7050805@linaro.org> References: <1400761950-25035-9-git-send-email-stefano.stabellini@eu.citrix.com> <537E1C67.2020302@linaro.org> <537E3C71.4070203@linaro.org> <537F65DB.5020403@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On 23/05/14 18:24, Stefano Stabellini wrote: > On Fri, 23 May 2014, Julien Grall wrote: >> On 05/23/2014 03:50 PM, Stefano Stabellini wrote: >>> The following change works: >>> >>> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c >>> index 33141e3..2a8456f 100644 >>> --- a/xen/arch/arm/domain.c >>> +++ b/xen/arch/arm/domain.c >>> @@ -644,6 +644,8 @@ int arch_set_info_guest( >>> else >>> set_bit(_VPF_down, &v->pause_flags); >>> >>> + vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq); >>> + >> >> This is racy, we may not clear the _VPF_down bit in this function >> (depending if VGCF_online is set or not). >> >> Hopefully for ARM, libxc is setting this flags by default but it's not >> always true. > > I could change the code to call vgic_vcpu_inject_irq only if VGCF_online > is set, but on second thought, would the code actually be more readable? > Or less error prone? > > I think that the original patch is better. At least the hack is present > in a single very obvious place (vgic_enable_irqs). Hmmm ... right. I know that this code will likely change (with GICv3 support). Can you add a comment in the code explain this issue? With this change: Acked-by: Julien Grall Regards, -- Julien Grall