]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
x86/hvm: remove duplicate vlapic_find_highest_isr() calls
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 7 Dec 2018 13:13:02 +0000 (13:13 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Dec 2018 11:27:37 +0000 (11:27 +0000)
When viridian APIC assist is active, the code in vlapic_has_pending_irq()
may end up re-calling vlapic_find_highest_isr() after emulating an EOI
whereas simply moving the call after the EOI emulation removes the need
for this duplication.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/vlapic.c

index 1f58b364994d655363046aa2f94ec209d2edff30..d318f3441a203aaaff7465f33b15370215076961 100644 (file)
@@ -1257,18 +1257,15 @@ int vlapic_has_pending_irq(struct vcpu *v)
          !nestedhvm_vcpu_in_guestmode(v) )
         return irr;
 
-    isr = vlapic_find_highest_isr(vlapic);
-
     /*
      * If APIC assist was set then an EOI may have been avoided.
      * If so, we need to emulate the EOI here before comparing ISR
      * with IRR.
      */
     if ( viridian_apic_assist_completed(v) )
-    {
         vlapic_EOI_set(vlapic);
-        isr = vlapic_find_highest_isr(vlapic);
-    }
+
+    isr = vlapic_find_highest_isr(vlapic);
 
     /*
      * The specification says that if APIC assist is set and a