aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreeti U Murthy <preeti@linux.vnet.ibm.com>2014-04-10 09:15:30 +0530
committerEli Qiao <taget@linux.vnet.ibm.com>2014-04-10 12:28:27 +0800
commitd9d7d57a6fd38d23d12a309166426dca7e23ad59 (patch)
tree0f0b3d1f15a87bae0fa2d6eeeda49d7750257351
parentcf05d568d7b8bda30561d86976df73c16c17b42a (diff)
downloadpowerkvm-d9d7d57a6fd38d23d12a309166426dca7e23ad59.tar.gz
kvm: Set the runlatch bit of a CPU just before starting guest
The secondary threads in the core have their runlatch bits cleared since they are offline. When the secondary threads are called in to start a guest their runlatch bits need to be set to indicate that they are busy. The primary thread has its runlatch bit set though, but there is no harm in setting this bit once again. Hence set the runlatch bit for all threads before they start guest. Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index e8beaf9814422..a49994cfe5833 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -249,6 +249,12 @@ kvm_novcpu_exit:
*/
.globl kvm_start_guest
kvm_start_guest:
+
+ /* Set runlatch bit the minute you wake up from nap */
+ mfspr r1, SPRN_CTRLF
+ ori r1, r1, 1
+ mtspr SPRN_CTRLT, r1
+
ld r2,PACATOC(r13)
li r0,KVM_HWTHREAD_IN_KVM