]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: LAPIC: Accurately guarantee busy wait for timer to expire when using hv_timer
authorWanpeng Li <wanpengli@tencent.com>
Wed, 28 Apr 2021 11:08:02 +0000 (19:08 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 May 2021 15:25:35 +0000 (11:25 -0400)
commit36272b5b029e530ec9f926c1418cd7d0d29fc5f7
tree449a9fab29eefb9997130f34620e0ce0fd418698
parentd7d4c8c13ecb236b5b182b8e44a13dd005f63be3
KVM: LAPIC: Accurately guarantee busy wait for timer to expire when using hv_timer

Commit e35e05f20eec1 (KVM: lapic: Busy wait for timer to expire when
using hv_timer) tries to set ktime->expired_tscdeadline by checking
ktime->hv_timer_in_use since lapic timer oneshot/periodic modes which
are emulated by vmx preemption timer also get advanced, they leverage
the same vmx preemption timer logic with tsc-deadline mode. However,
ktime->hv_timer_in_use is cleared before apic_timer_expired() handling,
let's delay this clearing in preemption-disabled region.

Fixes: e35e05f20eec1 ("KVM: lapic: Busy wait for timer to expire when using hv_timer")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1619608082-4187-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c