From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC 05/19] xen/arm: Release IRQ routed to a domain when it's destroying Date: Wed, 18 Jun 2014 19:26:24 +0100 Message-ID: <53A1D9D0.4070303@linaro.org> References: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> <1402935486-29136-6-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1WxKZ2-0006yV-5A for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 18:26:28 +0000 Received: by mail-wg0-f52.google.com with SMTP id b13so1228609wgh.11 for ; Wed, 18 Jun 2014 11:26:26 -0700 (PDT) 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: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On 18/06/14 19:08, Stefano Stabellini wrote: >> +/* The guest may not have EOIed the IRQ. >> + * Be sure to reset correctly the IRQ. >> + */ >> +void gic_reset_guest_irq(struct irq_desc *desc) >> +{ >> + ASSERT(spin_is_locked(&desc->lock)); >> + ASSERT(desc->status & IRQ_GUEST); >> + >> + if ( desc->status & IRQ_INPROGRESS ) >> + GICC[GICC_DIR] = desc->irq; >> +} > > You should call gic_update_one_lr first, then check IRQ_INPROGRESS. > You should also call gic_remove_from_queues, remove the irq from the > inflight queue and clear the GIC_IRQ_GUEST_* status bits. Are you sure? This function is only called when the domain is dying, so the guest is already unscheduled. Therefore gic_update_one_lr won't work. I can add an ASSERT(irq_get_domain(desc)->is_dying) here... Regards, -- Julien Grall