summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2017-10-06 19:25:53 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-10-12 14:01:53 +0200
commit86bbc1e6d7ce016f1b2e8c29864cd7b75b00ff96 (patch)
tree2e1e68784b92b9b1b7dc302daa98548ccc7f0170 /arch/x86/kvm
parent46bea48ac241fe0b413805952dda74dd0c09ba8b (diff)
downloadlinux-86bbc1e6d7ce016f1b2e8c29864cd7b75b00ff96.tar.gz
linux-86bbc1e6d7ce016f1b2e8c29864cd7b75b00ff96.tar.bz2
linux-86bbc1e6d7ce016f1b2e8c29864cd7b75b00ff96.zip
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: Radim Krčmář <rkrcmar@redhat.com> Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/lapic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 2c9e88a82738..39c1ae11ce1d 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1549,6 +1549,9 @@ static bool start_hv_timer(struct kvm_lapic *apic)
if (!apic_lvtt_period(apic) && atomic_read(&ktimer->pending))
return false;
+ if (!ktimer->tscdeadline)
+ return false;
+
r = kvm_x86_ops->set_hv_timer(apic->vcpu, ktimer->tscdeadline);
if (r < 0)
return false;