Message ID | 20190227191950.12074-3-gpiccoli@canonical.com |
---|---|
State | New |
Headers | show |
Series | Hard lockups due to unrestricted lapic timer delay | expand |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 76e8295517ed..e1edbf9c4033 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1265,7 +1265,8 @@ void wait_lapic_expire(struct kvm_vcpu *vcpu) /* __delay is delay_tsc whenever the hardware has TSC, thus always. */ if (guest_tsc < tsc_deadline) - __delay(tsc_deadline - guest_tsc); + __delay(min(tsc_deadline - guest_tsc, + nsec_to_cycles(vcpu, lapic_timer_advance_ns))); } static void start_apic_timer(struct kvm_lapic *apic)