[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: check if desc->action is NULL when unbinding guest pirq



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1264158078 0
# Node ID ca0759a08057b7541148987b379cdba5455c240a
# Parent  e1d61c5a008d5127acd864d7eff1cae472f7fe01
x86: check if desc->action is NULL when unbinding guest pirq

Before igb PF driver is unloaded, dom0 doesn't unload igbvf driver
automatically. When igb drver is unloaded, it invokes the
PHYSDEVOP_manage_pci_remove hypercall to remove the VFs and xen frees
the msi irqs by pci_cleanup_msi() -> ... -> dynamic_irq_cleanup() and
sets the desc->action to NULL.  igbvf driver knows the VF is
disappearing via a hook ndo_stop() in dev_close() and tries to unbind
the pirq and xen would crash as the desc->action is NULL now.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/arch/x86/irq.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -r e1d61c5a008d -r ca0759a08057 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Jan 22 11:00:45 2010 +0000
+++ b/xen/arch/x86/irq.c        Fri Jan 22 11:01:18 2010 +0000
@@ -1229,6 +1229,13 @@ static irq_guest_action_t *__pirq_guest_
 
     BUG_ON(!(desc->status & IRQ_GUEST));
 
+    if ( unlikely((desc->status | IRQ_DISABLED) && (desc->action == NULL)) )
+    {
+        dprintk(XENLOG_G_WARNING, "dom%d: pirq %d: desc->action is NULL!\n",
+            d->domain_id, pirq);
+        return NULL;
+    }
+
     action = (irq_guest_action_t *)desc->action;
     irq = desc - irq_desc;
 
@@ -1353,6 +1360,13 @@ static int pirq_guest_force_unbind(struc
         goto out;
 
     action = (irq_guest_action_t *)desc->action;
+    if ( unlikely((desc->status | IRQ_DISABLED) && (desc->action == NULL)) )
+    {
+        dprintk(XENLOG_G_WARNING, "dom%d: pirq %d: desc->action is NULL!\n",
+            d->domain_id, irq);
+        goto out;
+    }
+
     for ( i = 0; (i < action->nr_guests) && (action->guest[i] != d); i++ )
         continue;
     if ( i == action->nr_guests )

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.