From: Ian Campbell Subject: Re: [PATCH v4 2/6] xen/arm: track the state of guest IRQs Date: Thu, 12 Dec 2013 15:56:18 +0000 Message-ID: <1386863778.20076.10.camel@kazak.uk.xensource.com> References: <1386788841-32471-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: <1386788841-32471-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@citrix.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, 2013-12-11 at 19:07 +0000, Stefano Stabellini wrote: > @@ -916,6 +910,36 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r > cpu = p->desc->arch.eoi_cpu; > pirq = p->desc->irq; > } > + if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) && > + test_bit(GIC_IRQ_GUEST_ENABLED, &p->status)) > + { > + BUG_ON(!list_empty(&p->lr_queue)); > + > + list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue ) > + { > + if ( iter->priority > p->priority ) > + { > + list_add_tail(&p->lr_queue, &iter->lr_queue); > + goto out; > + } > + } > + list_add_tail(&p->lr_queue, &v->arch.vgic.lr_pending); > +out: > + set_int = 1; > + } > + > + clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status); > + > + if ( !list_empty(&v->arch.vgic.lr_pending) ) { > + p2 = list_entry(v->arch.vgic.lr_pending.next, typeof(*p2), lr_queue); > + gic_set_lr(i, p2->irq, GICH_LR_PENDING, p2->priority); > + list_del_init(&p2->lr_queue); > + set_bit(i, &this_cpu(lr_mask)); > + set_int = 1; > + } > + spin_unlock_irq(&gic.lock); > + > + spin_lock_irq(&v->arch.vgic.lock); > list_del_init(&p->inflight); Is it correct that we remove the IRQ from the inflight list here even in the case where we have reinjected it above? Ian.