From: Qing He Subject: [PATCH] fix get_free_pirq Date: Fri, 28 Aug 2009 16:03:20 +0800 Message-ID: <20090828080320.GA9729@ub-qhe2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: keir.fraser@eu.citrix.com List-Id: xen-devel@lists.xenproject.org GSI should not be allocated for other purpose, so change the hard code limit. Also fix the out of loop checking, it should be '<' instead of '=='. Signed-off-by: Qing He --- diff -r e8004f6c254a xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Thu Aug 27 11:25:34 2009 +0100 +++ b/xen/arch/x86/irq.c Fri Aug 28 14:06:43 2009 +0800 @@ -1254,10 +1254,10 @@ int get_free_pirq(struct domain *d, int } else { - for ( i = d->nr_pirqs - 1; i >= 16; i-- ) + for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- ) if ( !d->arch.pirq_irq[i] ) break; - if ( i == 16 ) + if ( i < nr_irqs_gsi ) return -ENOSPC; }