]> xenbits.xensource.com Git - xen.git/commitdiff
x86/IRQ: relax locking in irq_guest_eoi_timer_fn()
authorJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 09:14:00 +0000 (11:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 09:14:00 +0000 (11:14 +0200)
This is a timer handler, so it gets entered with IRQs enabled. Therefore
there's no need to save/restore the IRQ masking flag.

Additionally the final switch()'es ACKTYPE_EOI case re-acquires the lock
just for it to be dropped again right away. Do away with this.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/irq.c

index 0035174d1f8b00f176e2dc92ba9a003546b8ed11..d6451a903bdc4134bbbda31ced01f4de0a7dc12f 100644 (file)
@@ -1109,9 +1109,8 @@ static void irq_guest_eoi_timer_fn(void *data)
     unsigned int irq = desc - irq_desc;
     irq_guest_action_t *action;
     cpumask_t cpu_eoi_map;
-    unsigned long flags;
 
-    spin_lock_irqsave(&desc->lock, flags);
+    spin_lock_irq(&desc->lock);
     
     if ( !(desc->status & IRQ_GUEST) )
         goto out;
@@ -1143,12 +1142,11 @@ static void irq_guest_eoi_timer_fn(void *data)
         cpumask_copy(&cpu_eoi_map, action->cpu_eoi_map);
         spin_unlock_irq(&desc->lock);
         on_selected_cpus(&cpu_eoi_map, set_eoi_ready, desc, 0);
-        spin_lock_irq(&desc->lock);
-        break;
+        return;
     }
 
  out:
-    spin_unlock_irqrestore(&desc->lock, flags);
+    spin_unlock_irq(&desc->lock);
 }
 
 static void __do_IRQ_guest(int irq)