KVM: PPC: Book3S HV: Don't let VCPU sleep if it has a doorbell pending
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 19 May 2017 06:26:16 +0000 (16:26 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 19 Jun 2017 04:05:22 +0000 (14:05 +1000)
commit1da4e2f4fbd99f3fbf4275fc89617ffd671af95d
tree68ffaeaa56bb214ae14e21deeca4fad32a3819fd
parent1bc3fe818c9e823248f6ec299b1c518aa2df347c
KVM: PPC: Book3S HV: Don't let VCPU sleep if it has a doorbell pending

It is possible, through a narrow race condition, for a VCPU to exit
the guest with a H_CEDE hypercall while it has a doorbell interrupt
pending.  In this case, the H_CEDE should return immediately, but in
fact it puts the VCPU to sleep until some other interrupt becomes
pending or a prod is received (via another VCPU doing H_PROD).

This fixes it by checking the DPDES (Directed Privileged Doorbell
Exception Status) bit for the thread along with the other interrupt
pending bits.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv.c