提交 86bbc1e6 编写于 作者: R Radim Krčmář 提交者: Paolo Bonzini

KVM: x86: handle 0 write to TSC_DEADLINE MSR

0 should disable the timer, but start_hv_timer will recognize it as an
expired timer instead.
Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
Reviewed-by: NWanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 46bea48a
...@@ -1549,6 +1549,9 @@ static bool start_hv_timer(struct kvm_lapic *apic) ...@@ -1549,6 +1549,9 @@ static bool start_hv_timer(struct kvm_lapic *apic)
if (!apic_lvtt_period(apic) && atomic_read(&ktimer->pending)) if (!apic_lvtt_period(apic) && atomic_read(&ktimer->pending))
return false; return false;
if (!ktimer->tscdeadline)
return false;
r = kvm_x86_ops->set_hv_timer(apic->vcpu, ktimer->tscdeadline); r = kvm_x86_ops->set_hv_timer(apic->vcpu, ktimer->tscdeadline);
if (r < 0) if (r < 0)
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册