Commit fd17dc7b9a8d57150ee0121c4c83edbb7e26eece

Authored by Preeti U Murthy
Committed by Benjamin Herrenschmidt
1 parent f203891117

ppc/kvm: Set the runlatch bit of a CPU just before starting guest

The secondary threads in the core are kept offline before launching guests
in kvm on powerpc: "371fefd6f2dc4666:KVM: PPC: Allow book3s_hv guests to use
SMT processor modes."

Hence their runlatch bits are cleared. 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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

arch/powerpc/kvm/book3s_hv_rmhandlers.S
... ... @@ -242,6 +242,12 @@
242 242 */
243 243 .globl kvm_start_guest
244 244 kvm_start_guest:
  245 +
  246 + /* Set runlatch bit the minute you wake up from nap */
  247 + mfspr r1, SPRN_CTRLF
  248 + ori r1, r1, 1
  249 + mtspr SPRN_CTRLT, r1
  250 +
245 251 ld r2,PACATOC(r13)
246 252  
247 253 li r0,KVM_HWTHREAD_IN_KVM