summary refs log tree commit diff stats
path: root/system/cpus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-08-01 13:50:04 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:55 +0200
commitf8217ae54e4c44a7f0d20d56a5368ec1818f1cc2 (patch)
treeee2fe1ada00d338c8f5de57263ed0aa03debdeee /system/cpus.c
parentdcb46ecb2e90d532fcdc04702c92e732a0ef77e8 (diff)
downloadfocaccia-qemu-f8217ae54e4c44a7f0d20d56a5368ec1818f1cc2.tar.gz
focaccia-qemu-f8217ae54e4c44a7f0d20d56a5368ec1818f1cc2.zip
cpus: properly kick CPUs out of inner execution loop
Now that cpu_exit() actually kicks all accelerators, use it whenever
the message to another thread is processed in qemu_wait_io_event().

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'system/cpus.c')
-rw-r--r--system/cpus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/cpus.c b/system/cpus.c
index 9bfbe2b060..bb13942cbb 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -604,7 +604,7 @@ void cpu_pause(CPUState *cpu)
         qemu_cpu_stop(cpu, true);
     } else {
         cpu->stop = true;
-        qemu_cpu_kick(cpu);
+        cpu_exit(cpu);
     }
 }
 
@@ -644,6 +644,7 @@ void pause_all_vcpus(void)
 
     while (!all_vcpus_paused()) {
         qemu_cond_wait(&qemu_pause_cond, &bql);
+        /* FIXME: is this needed? */
         CPU_FOREACH(cpu) {
             qemu_cpu_kick(cpu);
         }
@@ -672,7 +673,7 @@ void cpu_remove_sync(CPUState *cpu)
 {
     cpu->stop = true;
     cpu->unplug = true;
-    qemu_cpu_kick(cpu);
+    cpu_exit(cpu);
     bql_unlock();
     qemu_thread_join(cpu->thread);
     bql_lock();