]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: PPC: Book3S HV: Fixes for late-joining threads
authorPaul Mackerras <paulus@samba.org>
Mon, 15 Oct 2012 01:17:17 +0000 (01:17 +0000)
committerAlexander Graf <agraf@suse.de>
Tue, 30 Oct 2012 09:54:15 +0000 (10:54 +0100)
commitad1f9650d9285cfe57701424507aa81c67c882dc
tree258e8b9129fbbe517ab57e1c068d69e0abdeb98d
parentdfd0a0259cb6c9af0793f4e39d80e729563e6db6
KVM: PPC: Book3S HV: Fixes for late-joining threads

If a thread in a virtual core becomes runnable while other threads
in the same virtual core are already running in the guest, it is
possible for the latecomer to join the others on the core without
first pulling them all out of the guest.  Currently this only happens
rarely, when a vcpu is first started.  This fixes some bugs and
omissions in the code in this case.

First, we need to check for VPA updates for the latecomer and make
a DTL entry for it.  Secondly, if it comes along while the master
vcpu is doing a VPA update, we don't need to do anything since the
master will pick it up in kvmppc_run_core.  To handle this correctly
we introduce a new vcore state, VCORE_STARTING.  Thirdly, there is
a race because we currently clear the hardware thread's hwthread_req
before waiting to see it get to nap.  A latecomer thread could have
its hwthread_req cleared before it gets to test it, and therefore
never increment the nap_count, leading to messages about wait_for_nap
timeouts.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv.c