aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_asm.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2012-10-15 01:16:48 +0000
committerAlexander Graf <agraf@suse.de>2012-10-30 10:54:55 +0100
commit913d3ff9a3c3a13c3115eb4b3265aa35a9e0a7ad (patch)
tree93e66d12f6b475919ecc567dce9fc81313138d98 /arch/powerpc/include/asm/kvm_asm.h
parentKVM: PPC: Book3S HV: Fix some races in starting secondary threads (diff)
downloadlinux-dev-913d3ff9a3c3a13c3115eb4b3265aa35a9e0a7ad.tar.xz
linux-dev-913d3ff9a3c3a13c3115eb4b3265aa35a9e0a7ad.zip
KVM: PPC: Book3s HV: Don't access runnable threads list without vcore lock
There were a few places where we were traversing the list of runnable threads in a virtual core, i.e. vc->runnable_threads, without holding the vcore spinlock. This extends the places where we hold the vcore spinlock to cover everywhere that we traverse that list. Since we possibly need to sleep inside kvmppc_book3s_hv_page_fault, this moves the call of it from kvmppc_handle_exit out to kvmppc_vcpu_run, where we don't hold the vcore lock. In kvmppc_vcore_blocked, we don't actually need to check whether all vcpus are ceded and don't have any pending exceptions, since the caller has already done that. The caller (kvmppc_run_vcpu) wasn't actually checking for pending exceptions, so we add that. The change of if to while in kvmppc_run_vcpu is to make sure that we never call kvmppc_remove_runnable() when the vcore state is RUNNING or EXITING. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_asm.h')
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index 76fdcfef0889..aabcdba8f6b0 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -118,6 +118,7 @@
#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */
#define RESUME_FLAG_HOST (1<<1) /* Resume host? */
+#define RESUME_FLAG_ARCH1 (1<<2)
#define RESUME_GUEST 0
#define RESUME_GUEST_NV RESUME_FLAG_NV