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

[Xen-devel] [PATCH] xen: if mapping GSIs we run out of pirq < nr_irqs_gs

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 9 Sep 2011 17:14:20 +0100
Cc: Benjamin Schweikert <b.schweikert@xxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>
Delivery-date: Fri, 09 Sep 2011 09:06:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
PV on HVM guests can have more GSIs than the host, in that case we could
run out of pirq < nr_irqs_gsi. When that happens use pirq >=
nr_irqs_gsi rather than returning an error.

This patch should be backported to xen 4.1, the backport is attached.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Tested-by: Benjamin Schweikert <b.schweikert@xxxxxxxxxxxxxx>

diff -r 5260d04148cb xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Sep 09 11:03:38 2011 +0000
+++ b/xen/arch/x86/irq.c        Fri Sep 09 15:06:40 2011 +0000
@@ -1646,15 +1646,12 @@ int get_free_pirq(struct domain *d, int 
                 return i;
             }
     }
-    else
-    {
-        for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- )
-            if ( is_free_pirq(d, pirq_info(d, i)) )
-            {
-                pirq_get_info(d, i);
-                return i;
-            }
-    }
+    for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- )
+        if ( is_free_pirq(d, pirq_info(d, i)) )
+        {
+            pirq_get_info(d, i);
+            return i;
+        }
 
     return -ENOSPC;
 }

Attachment: patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others, Stefano Stabellini <=