]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
iothread: fix vcpu stop with smp tcg
authorMarcelo Tosatti <mtosatti@redhat.com>
Tue, 9 Feb 2010 14:49:04 +0000 (12:49 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 23 Feb 2010 20:07:57 +0000 (14:07 -0600)
Round robin vcpus in tcg_cpu_next even if the vm stopped. This
allows all cpus to enter stopped state.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit c37cc7b072fa4ca8d8d21ac31d26baff5f47f9f9)

vl.c

diff --git a/vl.c b/vl.c
index 007709aafb47895b6aec0fc607e43bf30332f8c9..3b5a8e01bfebcbd4ebf6da5e57c6f160955b00a8 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4042,14 +4042,15 @@ static void tcg_cpu_exec(void)
     for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) {
         CPUState *env = cur_cpu = next_cpu;
 
-        if (!vm_running)
-            break;
         if (timer_alarm_pending) {
             timer_alarm_pending = 0;
             break;
         }
         if (cpu_can_run(env))
             ret = qemu_cpu_exec(env);
+        else if (env->stop)
+            break;
+
         if (ret == EXCP_DEBUG) {
             gdb_set_stop_cpu(env);
             debug_requested = 1;