Stefano Stabellini
2013-Feb-14 16:37 UTC
[PATCH 4/7] xen/arm: drain all the outstanding interrupts before returning from gic_interrupt
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- xen/arch/arm/gic.c | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index ff186d2..1c8219d 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -592,16 +592,22 @@ out: /* Accept an interrupt from the GIC and dispatch its handler */ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq) { - uint32_t intack = GICC[GICC_IAR]; - unsigned int irq = intack & GICC_IA_IRQ; + uint32_t intack; + unsigned int irq; - local_irq_enable(); - if ( irq == 1023 ) - /* Spurious interrupt */ - return; + do { + intack = GICC[GICC_IAR]; + irq = intack & GICC_IA_IRQ; + local_irq_enable(); + + if (likely(irq < 1021)) + do_IRQ(regs, irq, is_fiq); + else + break; - do_IRQ(regs, irq, is_fiq); + local_irq_disable(); + } while (1); } int gicv_setup(struct domain *d) -- 1.7.2.5