Skip to content

Commit a10388e

Browse files
Wanpeng Libonzini
authored andcommitted
KVM: LAPIC: guarantee the timer is in tsc-deadline mode
Check apic_lvtt_tscdeadline() mode directly instead of apic_lvtt_oneshot() and apic_lvtt_period() to guarantee the timer is in tsc-deadline mode when rdmsr MSR_IA32_TSCDEADLINE. Suggested-by: Radim Krčmář <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Radim Krčmář <[email protected]> Cc: Yunhong Jiang <[email protected]> Signed-off-by: Wanpeng Li <[email protected]> Signed-off-by: Radim Krčmář <[email protected]>
1 parent 7d7f7da commit a10388e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/lapic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,8 +1711,8 @@ u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu)
17111711
{
17121712
struct kvm_lapic *apic = vcpu->arch.apic;
17131713

1714-
if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) ||
1715-
apic_lvtt_period(apic))
1714+
if (!lapic_in_kernel(vcpu) ||
1715+
!apic_lvtt_tscdeadline(apic))
17161716
return 0;
17171717

17181718
return apic->lapic_timer.tscdeadline;

0 commit comments

Comments
 (0)