From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.6 3/4] xen/arm: vgic: notice if the vIRQ is not allocated when the guest enable it Date: Tue, 13 Jan 2015 15:55:00 +0000 Message-ID: <1421164500.19103.132.camel@citrix.com> References: <1418395392-30460-1-git-send-email-julien.grall@linaro.org> <1418395392-30460-4-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB3rR-0006Xb-Qw for xen-devel@lists.xenproject.org; Tue, 13 Jan 2015 15:58:29 +0000 In-Reply-To: <1418395392-30460-4-git-send-email-julien.grall@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: Julien Grall Cc: christoffer.dall@linaro.org, xen-devel@lists.xenproject.org, tim@xen.org, parth.dixit@linaro.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-12-12 at 14:43 +0000, Julien Grall wrote: > This help for guest interrupts debugging. If the vIRQ is not allocate, > this means that nothing is wired to it. Should we short circuit the rest of the enable operation for this IRQ then? i.e. implement such writes as ignored, e.g. not reflect it in reads of ISENABLER etc. What (if anything) does the GIC spec have to say on the subject? > Signed-off-by: Julien Grall > --- > xen/arch/arm/vgic.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > index dbfc259..719cb9f 100644 > --- a/xen/arch/arm/vgic.c > +++ b/xen/arch/arm/vgic.c > @@ -282,6 +282,10 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n) > if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) ) > gic_raise_guest_irq(v_target, irq, p->priority); > spin_unlock_irqrestore(&v_target->arch.vgic.lock, flags); > + > + if ( !test_bit(irq, d->arch.vgic.allocated_irqs) ) > + gdprintk(XENLOG_DEBUG, "vIRQ %u is not allocated\n", irq); Should this not be first after the irq= line inside this loop? > + > if ( p->desc != NULL ) > { > irq_set_affinity(p->desc, cpumask_of(v_target->processor));