From: Bharata B Rao Date: Thu, 27 Apr 2017 05:18:22 +0000 (+0530) Subject: cpus: Fix CPU unplug for MTTCG X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a3e53273ad52551b61c0cdb8f48a19eb22c05831;p=qemu.git cpus: Fix CPU unplug for MTTCG Ensure that the unplugged CPU thread is destroyed and the waiting thread is notified about it. This is needed for CPU unplug to work correctly in MTTCG mode. Signed-off-by: Bharata B Rao Signed-off-by: Nikunj A Dadhania Signed-off-by: David Gibson --- diff --git a/cpus.c b/cpus.c index 740b8dc3f8..79f780b654 100644 --- a/cpus.c +++ b/cpus.c @@ -1483,6 +1483,12 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) /* Ignore everything else? */ break; } + } else if (cpu->unplug) { + qemu_tcg_destroy_vcpu(cpu); + cpu->created = false; + qemu_cond_signal(&qemu_cpu_cond); + qemu_mutex_unlock_iothread(); + return NULL; } atomic_mb_set(&cpu->exit_request, 0);