diff options
author | Paul Mackerras <paulus@samba.org> | 2015-03-27 23:21:05 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-04-21 09:21:32 -0400 |
commit | 25fedfca94cfbf2461314c6c34ef58e74a31b025 (patch) | |
tree | f97e12748bccd2e1f9da93f98a4727542d6b132c /arch/powerpc/include | |
parent | 1f09c3ed86287d40fef90611cbbee055313f52cf (diff) |
KVM: PPC: Book3S HV: Move vcore preemption point up into kvmppc_run_vcpu
Rather than calling cond_resched() in kvmppc_run_core() before doing
the post-processing for the vcpus that we have just run (that is,
calling kvmppc_handle_exit_hv(), kvmppc_set_timer(), etc.), we now do
that post-processing before calling cond_resched(), and that post-
processing is moved out into its own function, post_guest_process().
The reschedule point is now in kvmppc_run_vcpu() and we define a new
vcore state, VCORE_PREEMPT, to indicate that that the vcore's runner
task is runnable but not running. (Doing the reschedule with the
vcore in VCORE_INACTIVE state would be bad because there are potentially
other vcpus waiting for the runner in kvmppc_wait_for_exec() which
then wouldn't get woken up.)
Also, we make use of the handy cond_resched_lock() function, which
unlocks and relocks vc->lock for us around the reschedule.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 3eecd8868b01..83c44257b005 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -304,8 +304,9 @@ struct kvmppc_vcore { | |||
304 | /* Values for vcore_state */ | 304 | /* Values for vcore_state */ |
305 | #define VCORE_INACTIVE 0 | 305 | #define VCORE_INACTIVE 0 |
306 | #define VCORE_SLEEPING 1 | 306 | #define VCORE_SLEEPING 1 |
307 | #define VCORE_RUNNING 2 | 307 | #define VCORE_PREEMPT 2 |
308 | #define VCORE_EXITING 3 | 308 | #define VCORE_RUNNING 3 |
309 | #define VCORE_EXITING 4 | ||
309 | 310 | ||
310 | /* | 311 | /* |
311 | * Struct used to manage memory for a virtual processor area | 312 | * Struct used to manage memory for a virtual processor area |