Skip to contentSkip to conversation

Clear IRQ_GUEST in irq_desc->status when setting action to NULL.

PATCH New Igor Mammedov 1 participant 1 message Sep 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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.

Please review.

xen/arch/x86/irq.c +1 -2
@@ -192,6 +192,7 @@ static void dynamic_irq_cleanup(unsigned
 
     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 @@ static irq_guest_action_t *__pirq_guest_
     cpumask_t           cpu_eoi_map;
     int                 i;
 
-    BUG_ON(!(desc->status & IRQ_GUEST));
-
     action = (irq_guest_action_t *)desc->action;
     irq = desc - irq_desc;