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

[Xen-changelog] [xen-unstable] Clear IRQ_GUEST in irq_desc->status when setting action to NULL.



# HG changeset patch
# User Igor Mammedov <imammedo@xxxxxxxxxx>
# Date 1316300426 -3600
# Node ID c944e82bb092925f31403a129087e9d40e0fa06a
# Parent  994b5b125c31dd243e412aa568a0a6eb0d6436e9
Clear IRQ_GUEST in irq_desc->status when setting action to NULL.

Looking more closely at usage of action field with relation to
IRQ_GUEST flag. It appears that set IRQ_GUEST implies that action
is not NULL. As result it is not safe to set action to NULL and
leave IRQ_GUEST set.

Hence IRQ_GUEST should be cleared in dynamic_irq_cleanup where
action is set to NULL.

An addition remove BUGON at __pirq_guest_unbind that appears to be
bogus and not needed anymore.

Thanks Paolo Bonzini for NACKing previous patch, and pointing at the
correct solution.

Signed-off-by: Igor Mammedov <imammedo@xxxxxxxxxx>

Reinstate the BUG_ON, but after the action==NULL check. Since we then
go and start interpreting action as an irq_guest_action_t, the BUG_ON
is relevant here.

More generally, the brute-force nature of dynamic_irq_cleanup() looks
a bit worrying. Possibly there should be more integratioin with
pirq_guest_unbind() logic, for cleaning up un-acked EOIs and the like.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 994b5b125c31 -r c944e82bb092 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Sat Sep 17 16:44:56 2011 +0100
+++ b/xen/arch/x86/irq.c        Sun Sep 18 00:00:26 2011 +0100
@@ -192,6 +192,7 @@
 
     spin_lock_irqsave(&desc->lock, flags);
     desc->status  |= IRQ_DISABLED;
+    desc->status  &= ~IRQ_GUEST;
     desc->handler->shutdown(irq);
     action = desc->action;
     desc->action  = NULL;
@@ -1465,8 +1466,6 @@
     cpumask_t           cpu_eoi_map;
     int                 i;
 
-    BUG_ON(!(desc->status & IRQ_GUEST));
-
     action = (irq_guest_action_t *)desc->action;
     irq = desc - irq_desc;
 
@@ -1477,6 +1476,8 @@
         return NULL;
     }
 
+    BUG_ON(!(desc->status & IRQ_GUEST));
+
     for ( i = 0; (i < action->nr_guests) && (action->guest[i] != d); i++ )
         continue;
     BUG_ON(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®.