From: Ian Campbell Subject: Re: [PATCH v6 2/2] xen/arm: trap guest WFI Date: Fri, 19 Apr 2013 08:58:37 +0100 Message-ID: <1366358317.19111.34.camel@zakaz.uk.xensource.com> References: <1366310951-15455-2-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366310951-15455-2-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini Cc: Julien Grall , "xen-devel@lists.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Thu, 2013-04-18 at 19:49 +0100, Stefano Stabellini wrote: > static inline void local_event_delivery_enable(void) > { > - /* TODO current->vcpu_info->evtchn_upcall_mask = 0; */ > + current->vcpu_info->evtchn_upcall_mask = 0; Did you miss my comments re the meaninglessness of evtchn_upcall_mask on ARM? Nothing in the guest ever sets this bit and nothing pays it any attention on the actual interrupt/evtchn delivery path either, so looking at it in the "are events pending" path doesn't make sense. Look at $ rgrep evtchn_upcall_mask xen/arch/arm/ xen/include/asm-arm/ and all you will see is false positives like the above commented out code. The only generic user is the dump_domains() debugkey output (which is therefore wrong on ARM). This logic needs to be based around looking at the I bit in the CPSR. To avoid this confusion reoccuring perhaps we should #define HAVE_PV_INTERRUPT_MASK and use it to turn this field in vcpu_info into a padding field? Ian. > } > > /* No arch specific virq definition now. Default to global. */ > diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h > index 24c0d5c..92711d5 100644 > --- a/xen/include/asm-arm/gic.h > +++ b/xen/include/asm-arm/gic.h > @@ -143,6 +143,7 @@ extern void gic_route_ppis(void); > extern void gic_route_spis(void); > > extern void gic_inject(void); > +extern int gic_events_need_delivery(void); > > extern void __cpuinit init_maintenance_interrupt(void); > extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,