From: Ian Campbell Subject: Re: [PATCH 3/5] xen/gic: support injecting IRQs even to VCPUs not currently running Date: Tue, 26 Jun 2012 15:07:37 +0100 Message-ID: <1340719657.3832.125.camel@zakaz.uk.xensource.com> References: <1338981730-14816-1-git-send-email-stefano.stabellini@eu.citrix.com> <1338981730-14816-3-git-send-email-stefano.stabellini@eu.citrix.com> <20120607124606.GT70339@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120607124606.GT70339@ocelot.phlegethon.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: Tim Deegan Cc: David Vrabel , "xen-devel@lists.xensource.com" , "Tim Deegan (3P)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2012-06-07 at 13:46 +0100, Tim Deegan wrote: > At 12:22 +0100 on 06 Jun (1338985328), Stefano Stabellini wrote: > > +static void gic_restore_pending_irqs(struct vcpu *v) > > +{ > > + int i; > > + struct pending_irq *p; > > + > > + /* check for new pending irqs */ > > + if ( list_empty(&v->arch.vgic.lr_pending) ) > > + return; > > + > > + list_for_each_entry ( p, &v->arch.vgic.lr_pending, lr_queue ) Is list_for_each_entry on an empty list somehow wrong/buggy/slow? > > + { > > + i = find_first_zero_bit(&gic.lr_mask, nr_lrs); > > + if ( i < nr_lrs ) > > + { > > + gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority); > > + list_del_init(&p->lr_queue); > > + set_bit(i, &gic.lr_mask); > > + if ( p->irq == VGIC_IRQ_EVTCHN_CALLBACK ) > > + set_bit(i, &gic.event_mask); > > + } else > > + { > > + return; > > + } > > This is a bit ugly - maybe "if ( i >= nr_lrs ) return" above and don't > indent the block? >