]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: lapic: Explicitly cancel the hv timer if it's pre-expired
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 16 Apr 2019 20:32:45 +0000 (13:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 30 Apr 2019 19:32:16 +0000 (21:32 +0200)
commit56b5733cd423bb64a7a4af0f047eced55f89a4e9
treefda2f6b1a015bc44490c27f6a0f3f61ff9c38831
parent4048e9160c55545cb8d88a455067ef07ec89146a
KVM: lapic: Explicitly cancel the hv timer if it's pre-expired

Explicitly call cancel_hv_timer() instead of returning %false to coerce
restart_apic_timer() into canceling it by way of start_sw_timer().

Functionally, the existing code is correct in the sense that it doesn't
doing anything visibily wrong, e.g. generate spurious interrupts or miss
an interrupt.  But it's extremely confusing and inefficient, e.g. there
are multiple extraneous calls to apic_timer_expired() that effectively
get dropped due to @timer_pending being %true.

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