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

[Xen-changelog] [xen master] xen/arm: gic: Defer the decision to unmask interrupts to do_{LPI, IRQ}()



commit 3455cd598c5f57c3f6c10a9b1bb471ea6857a115
Author:     Andrii Anisov <andrii_anisov@xxxxxxxx>
AuthorDate: Mon May 27 12:29:30 2019 +0300
Commit:     Julien Grall <julien.grall@xxxxxxx>
CommitDate: Mon Jun 10 20:48:53 2019 +0100

    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 <andrii_anisov@xxxxxxxx>
    [julien: Reword the commit message]
    Acked-by: Julien Grall <julien.grall@xxxxxxx>
---
 xen/arch/arm/gic.c | 4 ----
 1 file changed, 4 deletions(-)

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) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.