summaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-06-25 16:56:52 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-07-22 05:52:09 +0200
commitc629a4bc9725a1ec64c4c89894ef27c758024516 (patch)
tree9957c5dc4794068d6028e6c264d24b58f86b2e9f /cpu-exec.c
parentf8ca7b43a547e7900e4731c5ab29cebe208eb299 (diff)
downloadqemu-c629a4bc9725a1ec64c4c89894ef27c758024516.tar.gz
qemu-c629a4bc9725a1ec64c4c89894ef27c758024516.tar.bz2
qemu-c629a4bc9725a1ec64c4c89894ef27c758024516.zip
Fix cpu_exit for tcp_cpu_exec
If a cpu_exit request is pending, ensure that we leave the CPU loop quickly. For this purpose, keep the global exit_request pending until we are about to leave tcg_cpu_exec. Also, immediately break out of the SMP loop if the request is set, do not run till the end of the chain. This preserves the VCPU scheduling order in SMP mode. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 5f88f3fa89..d170566cfd 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -237,9 +237,8 @@ int cpu_exec(CPUState *env1)
barrier();
env = env1;
- if (exit_request) {
+ if (unlikely(exit_request)) {
env->exit_request = 1;
- exit_request = 0;
}
#if defined(TARGET_I386)