void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
{
struct irq_desc *desc = irq_to_desc(irq);
+ struct irqaction *action;
perfc_incr(irqs);
goto out_no_end;
}
- set_bit(_IRQ_PENDING, &desc->status);
-
- /*
- * Since we set PENDING, if another processor is handling a different
- * instance of this same irq, the other processor will take care of it.
- */
- if ( test_bit(_IRQ_DISABLED, &desc->status) ||
- test_bit(_IRQ_INPROGRESS, &desc->status) )
+ if ( test_bit(_IRQ_DISABLED, &desc->status) )
goto out;
set_bit(_IRQ_INPROGRESS, &desc->status);
- while ( test_bit(_IRQ_PENDING, &desc->status) )
- {
- struct irqaction *action;
+ action = desc->action;
- clear_bit(_IRQ_PENDING, &desc->status);
- action = desc->action;
+ spin_unlock_irq(&desc->lock);
- spin_unlock_irq(&desc->lock);
-
- do
- {
- action->handler(irq, action->dev_id, regs);
- action = action->next;
- } while ( action );
+ do
+ {
+ action->handler(irq, action->dev_id, regs);
+ action = action->next;
+ } while ( action );
- spin_lock_irq(&desc->lock);
- }
+ spin_lock_irq(&desc->lock);
clear_bit(_IRQ_INPROGRESS, &desc->status);
* Set the active state of an IRQ. This should be used with care, as this
* directly forces the active bit, without considering the GIC state machine.
* For private IRQs this only works for those of the current CPU.
+ *
+ * This function should only be called for interrupts routed to the
+ * guest. The flow of interrupts routed to Xen is not able cope with
+ * software changes to the active state.
*/
static inline void gic_set_active_state(struct irq_desc *irqd, bool state)
{
+ ASSERT(test_bit(_IRQ_GUEST, &irqd->status));
gic_hw_ops->set_active_state(irqd, state);
}