]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Ensure deadline timer has truly expired before posting its IRQ
authorSean Christopherson <seanjc@google.com>
Fri, 5 Mar 2021 02:18:08 +0000 (18:18 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Mar 2021 13:30:21 +0000 (08:30 -0500)
commit8f2850d7957a06594f3cc2d875a47d64ffd1084c
treeb5b2cc9cdf65f3bcd4c83cd33dc735e651f9ba5f
parent8786765f569ee5c61907a6da04689caf8862c695
KVM: x86: Ensure deadline timer has truly expired before posting its IRQ

When posting a deadline timer interrupt, open code the checks guarding
__kvm_wait_lapic_expire() in order to skip the lapic_timer_int_injected()
check in kvm_wait_lapic_expire().  The injection check will always fail
since the interrupt has not yet be injected.  Moving the call after
injection would also be wrong as that wouldn't actually delay delivery
of the IRQ if it is indeed sent via posted interrupt.

Fixes: 512fc2817fa0 ("KVM: LAPIC: Reduce world switch latency caused by timer_advance_ns")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210305021808.3769732-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c