Skip to contentSkip to conversation

iothread + smp 2 + alt-f4 = lock-up

Qemu-devel Applied Jan Kiszka 3 participants 3 messages Feb 8, 2010 – Feb 10, 2010

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Just a note, maybe someone finds the time to look at this:

Sending ALT-F4 to the SDL window of qemu (stable-0.12 and master) when it was configured with --enable-io-thread and runs -smp 2 or more causes a lock-up of the qemu process.

[I currently trigger way too many bugs...]

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#1 lore raw

PATCH 1/1 iothread: fix vcpu stop with smp tcg

Round robin vcpus in tcg_cpu_next even if the vm stopped. This allows all cpus to enter stopped state.

vl.c +3 -2
index 880bcd5..f61e362 100644
@@ -3855,14 +3855,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;
#2 lore raw

Re: [Qemu-devel] [PATCH] iothread: fix vcpu stop with smp tcg

Quoted 5 lines · Marcelo Tosatti

Round robin vcpus in tcg_cpu_next even if the vm stopped. This allows all cpus to enter stopped state.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 26 lines
vl.c +3 -2
index 880bcd5..f61e362 100644
@@ -3855,14 +3855,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;