From: Paul Durrant Date: Fri, 7 Dec 2018 13:13:02 +0000 (+0000) Subject: x86/hvm: remove duplicate vlapic_find_highest_isr() calls X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=032c2208ece1774b6b176330d144edc697e2ce61;p=people%2Fpauldu%2Fxen.git x86/hvm: remove duplicate vlapic_find_highest_isr() calls 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 Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index 1f58b36499..d318f3441a 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -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