KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled

Prevent setting the tscdeadline timer if the lapic is hw disabled.

Fixes: bce87cce88 (KVM: x86: consolidate different ways to test for in-kernel LAPIC)
Cc: <stable@vger.kernel.org>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1596165141-28874-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by Wanpeng Li and committed by Paolo Bonzini d2286ba7 d741dcae

Changed files
+1 -1
arch
x86
kvm
+1 -1
arch/x86/kvm/lapic.c
··· 2195 2195 { 2196 2196 struct kvm_lapic *apic = vcpu->arch.apic; 2197 2197 2198 - if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) || 2198 + if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) || 2199 2199 apic_lvtt_period(apic)) 2200 2200 return; 2201 2201