From: Ian Campbell Subject: Re: [PATCH v4 6/6] xen/arm: disable a physical IRQ when the guest disables the corresponding IRQ Date: Thu, 12 Dec 2013 16:06:41 +0000 Message-ID: <1386864401.20076.11.camel@kazak.uk.xensource.com> References: <1386788841-32471-6-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-6-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: > Signed-off-by: Stefano Stabellini > Acked-by: Ian Campbell > Acked-by: Julien Grall > > --- > Changes in v2: > - disable IRQs that were previously disabled. > --- > xen/arch/arm/vgic.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c > index ad17d1d..9022658 100644 > --- a/xen/arch/arm/vgic.c > +++ b/xen/arch/arm/vgic.c > @@ -360,6 +360,22 @@ read_as_zero: > return 1; > } > > +static void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n) > +{ > + struct pending_irq *p; > + unsigned int irq; > + int i = 0; > + > + while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32 ) { > + irq = i + (32 * n); > + p = irq_to_pending(v, irq); > + clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status); Do we need to remove from some queues, like lr_pending? In case it is already pending when it gets masked we don't want to pick it off the queue in the maint interrupt do we? Ian.