WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH] xen: fix off-by-one error in find_unbound_ir

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] xen: fix off-by-one error in find_unbound_irq
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Fri, 26 Feb 2010 12:13:38 -0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Fri, 26 Feb 2010 12:14:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1267183329.11737.12225.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1267181975-14348-1-git-send-email-ian.campbell@xxxxxxxxxx> <1267183329.11737.12225.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1
On 02/26/2010 03:22 AM, Ian Campbell wrote:
BTW, this is against xen/master, the original patch isn't in xen/next.

Looks like it came from the pcifront branch which isn't in xen/next yet.

    J

On Fri, 2010-02-26 at 10:59 +0000, Ian Campbell wrote:
e459de95 "Find an unbound irq number in reverse order (high to low)" introduced
an off by one error which would cause repeated allocations of the nr_irq'th IRQ
if there are no spare interrupts (i.e. get_nr_hw_irqs() == nr_irqs).

Signed-off-by: Ian Campbell<ian.campbell@xxxxxxxxxx>
Cc: Konrad Rzeszutek Wilk<konrad.wilk@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge<jeremy.fitzhardinge@xxxxxxxxxx>
---
  drivers/xen/events.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 99f2b2a..5c64e1d 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -377,7 +377,7 @@ static int find_unbound_irq(void)
                if (irq_info[irq].type == IRQT_UNBOUND)
                        break;

-       if (irq == start || irq == nr_irqs)
+       if (irq == start || irq == nr_irqs - 1)
                panic("No available IRQ to bind to: increase nr_irqs!\n");

        desc = irq_to_desc_alloc_node(irq, 0);


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>