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

[Xen-changelog] [xen master] x86/IRQ: bail early from irq_guest_eoi_timer_fn() when nothing is in flight



commit a646da4a3d96b7666a3ed99521f1e64dbedf19f9
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jun 6 16:04:53 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 6 16:04:53 2019 +0200

    x86/IRQ: bail early from irq_guest_eoi_timer_fn() when nothing is in flight
    
    There's no point entering the loop in the function in this case. Instead
    there still being something in flight _after_ the loop would be an
    actual problem: No timer would be running anymore for issuing the EOI
    eventually, and hence this IRQ (and possibly lower priority ones) would
    be blocked, perhaps indefinitely.
    
    Issue a warning instead and prefer breaking some (presumably
    misbehaving) guest over stalling perhaps the entire system.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/irq.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 335c8ffb67..be486a6ce4 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1118,10 +1118,10 @@ static void irq_guest_eoi_timer_fn(void *data)
     action = (irq_guest_action_t *)desc->action;
 
     /*
-     * Is another instance of this timer already running? Skip everything
-     * to avoid forcing an EOI early.
+     * Is no IRQ in flight at all, or another instance of this timer already
+     * running? Skip everything to avoid forcing an EOI early.
      */
-    if ( timer_is_active(&action->eoi_timer) )
+    if ( !action->in_flight || timer_is_active(&action->eoi_timer) )
         goto out;
 
     if ( action->ack_type != ACKTYPE_NONE )
@@ -1136,8 +1136,13 @@ static void irq_guest_eoi_timer_fn(void *data)
         }
     }
 
-    if ( action->in_flight != 0 )
-        goto out;
+    if ( action->in_flight )
+    {
+        printk(XENLOG_G_WARNING
+               "IRQ%u: %d/%d handler(s) still in flight at forced EOI\n",
+               irq, action->in_flight, action->nr_guests);
+        ASSERT_UNREACHABLE();
+    }
 
     switch ( action->ack_type )
     {
--
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®.