OSDN Git Service

KVM: PPC: Book3S HV: Don't wake thread with no vcpu on guest IPI
authorPaul Mackerras <paulus@samba.org>
Sat, 28 Mar 2015 03:21:07 +0000 (14:21 +1100)
committerAlexander Graf <agraf@suse.de>
Tue, 21 Apr 2015 13:21:32 +0000 (15:21 +0200)
commitccc07772c99befeda7a7a4b1d05a6f3b762518c2
treec6f47a2039a097c82a0917b211c4e4d325a9ea64
parent5d5b99cd6818bdbea287d23ef055bba1a8a9e648
KVM: PPC: Book3S HV: Don't wake thread with no vcpu on guest IPI

When running a multi-threaded guest and vcpu 0 in a virtual core
is not running in the guest (i.e. it is busy elsewhere in the host),
thread 0 of the physical core will switch the MMU to the guest and
then go to nap mode in the code at kvm_do_nap.  If the guest sends
an IPI to thread 0 using the msgsndp instruction, that will wake
up thread 0 and cause all the threads in the guest to exit to the
host unnecessarily.  To avoid the unnecessary exit, this arranges
for the PECEDP bit to be cleared in this situation.  When napping
due to a H_CEDE from the guest, we still set PECEDP so that the
thread will wake up on an IPI sent using msgsndp.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_hv_rmhandlers.S