From: Andrii Anisov Date: Mon, 27 May 2019 09:29:30 +0000 (+0300) Subject: xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2082 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3455cd598c5f57c3f6c10a9b1bb471ea6857a115;p=xen.git xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}() At the moment, interrupts are unmasked by gic_interrupt() before calling do_{IRQ, LPI}(). In the case of handling an interrupt routed to guests, its priority will be dropped, via desc->handler->end() called from do_irq(), with interrupt unmasked. In other words: - Until the priority is dropped, only higher priority interrupt can be received. Today, only Xen interrupts have higher priority. - As soon as priority is dropped, any interrupt can be received. This means the purpose of the loop in gic_interrupt() is defeated as all interrupts may get trapped earlier. To reinstate the purpose of the loop (and prevent the trap), interrupts should be masked when dropping the priority. For interrupts routed to Xen, priority will always be dropped with interrupts masked. So the issue is not present. However, it means that we are pointless try to mask the interrupts. To avoid conflicting behavior between interrupt handling, gic_interrupt() is now keeping interrupts masked and defer the decision to do_{LPI, IRQ}. Signed-off-by: Andrii Anisov [julien: Reword the commit message] Acked-by: Julien Grall --- diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 6cc7dec706..113655a789 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -386,17 +386,13 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq) if ( likely(irq >= 16 && irq < 1020) ) { - local_irq_enable(); isb(); do_IRQ(regs, irq, is_fiq); - local_irq_disable(); } else if ( is_lpi(irq) ) { - local_irq_enable(); isb(); gic_hw_ops->do_LPI(irq); - local_irq_disable(); } else if ( unlikely(irq < 16) ) {