]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: hyperv: avoid livelock in oneshot SynIC timers
authorRoman Kagan <rkagan@virtuozzo.com>
Thu, 20 Jul 2017 14:26:40 +0000 (17:26 +0300)
committerRadim Krčmář <rkrcmar@redhat.com>
Thu, 20 Jul 2017 15:00:00 +0000 (17:00 +0200)
commit2a94050bc1fbc0e58f53b3f7c0192e269a03e754
tree63d4bf5301a833733d77cc55a560f76015320047
parent09f2b79863a97ee92090a935f5b6c4c5ac1b00d3
kvm: x86: hyperv: avoid livelock in oneshot SynIC timers

If the SynIC timer message delivery fails due to SINT message slot being
busy, there's no point to attempt starting the timer again until we're
notified of the slot being released by the guest (via EOM or EOI).

Even worse, when a oneshot timer fails to deliver its message, its
re-arming with an expiration time in the past leads to immediate retry
of the delivery, and so on, without ever letting the guest vcpu to run
and release the slot, which results in a livelock.

To avoid that, only start the timer when there's no timer message
pending delivery.  When there is, meaning the slot is busy, the
processing will be restarted upon notification from the guest that the
slot is released.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/hyperv.c