KVM: lapic: Check for a pending timer intr prior to start_hv_timer()
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 16 Apr 2019 20:32:47 +0000 (13:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Apr 2019 19:32:17 +0000 (21:32 +0200)
commit4ca88b3f86cd03deecd48ca9880a7c2e7c6fb788
tree8f34de9438c5c9c4fa50df89a8c1496d014499bb
parentf99279825ee30b829da9d3b7cf0b9d1b9b2596e6
KVM: lapic: Check for a pending timer intr prior to start_hv_timer()

Checking for a pending non-periodic interrupt in start_hv_timer() leads
to restart_apic_timer() making an unnecessary call to start_sw_timer()
due to start_hv_timer() returning false.

Alternatively, start_hv_timer() could return %true when there is a
pending non-periodic interrupt, but that approach is less intuitive,
i.e. would require a beefy comment to explain an otherwise simple check.

Cc: Liran Alon <liran.alon@oracle.com>
Cc: Wanpeng Li <wanpengli@tencent.com>
Suggested-by: Liran Alon <liran.alon@oracle.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c