]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: Fix SCHEDOP_poll fidelity with Xen poll
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 16 Jul 2025 09:29:32 +0000 (10:29 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 16 Jul 2025 09:37:13 +0000 (10:37 +0100)
commit97459ee3e5fbcaa8a512ef1a60e33cb2ff94868b
tree0712b261905919792a8846bf08da69a478b6261f
parent1ffdb27dd5d13cd0eb9c0c5d1116f2b4cdeaca36
KVM: x86/xen: Fix SCHEDOP_poll fidelity with Xen

There were two (probably unimportant, given that we've run a billion or
two Xen guests on this now without noticing except by code inspection)
ways in which the KVM implementation of SCHEDOP_poll differs from Xen:

 1. Xen allows a vCPU to poll a port which is targeted at another vCPU.
 2. Xen explicitly wakes a polling vCPU even when the event is unmasked.

I can't imagine why the first would ever be used, but the second could
theoretically be important. KVM currently wouldn't actually deliver an
interrupt to the target vCPU if another port was already pending, but
if the poll was being used to handle spinlock contention inside another
interrupt handler, the wakeup might never happen and lead to a deadlock.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kvm/xen.c