]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Use decrementer to wake napping threads
authorPaul Mackerras <paulus@samba.org>
Sat, 28 Mar 2015 03:21:08 +0000 (14:21 +1100)
committerAlexander Graf <agraf@suse.de>
Tue, 21 Apr 2015 13:21:33 +0000 (15:21 +0200)
commit95108626ed10f39941f9e7b23e0ae274221d8ccc
tree30cfe656f5eda6adf02fa36d9bc65fca7ef4a4d0
parent152f04b7985806931760797f49bc04e2ef1c6fbc
KVM: PPC: Book3S HV: Use decrementer to wake napping threads

This arranges for threads that are napping due to their vcpu having
ceded or due to not having a vcpu to wake up at the end of the guest's
timeslice without having to be poked with an IPI.  We do that by
arranging for the decrementer to contain a value no greater than the
number of timebase ticks remaining until the end of the timeslice.
In the case of a thread with no vcpu, this number is in the hypervisor
decrementer already.  In the case of a ceded vcpu, we use the smaller
of the HDEC value and the DEC value.

Using the DEC like this when ceded means we need to save and restore
the guest decrementer value around the nap.

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