summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorWanpeng Li <wanpengli@tencent.com>2020-09-10 11:50:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-28 13:57:08 +0200
commita970e9b216a28b81c0417ab978ff2e248880b86d (patch)
tree9fc83fd4538f24f1049fda7ba50dc2680b9ae157 /arch/x86/kvm/lapic.c
parentKVM: LAPIC: Fix updating DFR missing apic map recalculation (diff)
downloadlinux-a970e9b216a28b81c0417ab978ff2e248880b86d.tar.xz
linux-a970e9b216a28b81c0417ab978ff2e248880b86d.zip
KVM: LAPIC: Return 0 when getting the tscdeadline timer if the lapic is hw disabled
Return 0 when getting the tscdeadline timer if the lapic is hw disabled. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Wanpeng Li <wanpengli@tencent.com> Message-Id: <1599731444-3525-2-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 43aab8a84d6d..5af7d03b0ecc 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2188,8 +2188,7 @@ u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu)
{
struct kvm_lapic *apic = vcpu->arch.apic;
- if (!lapic_in_kernel(vcpu) ||
- !apic_lvtt_tscdeadline(apic))
+ if (!kvm_apic_present(vcpu) || !apic_lvtt_tscdeadline(apic))
return 0;
return apic->lapic_timer.tscdeadline;