From a3e53273ad52551b61c0cdb8f48a19eb22c05831 Mon Sep 17 00:00:00 2001 From: Bharata B Rao Date: Thu, 27 Apr 2017 10:48:22 +0530 Subject: 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 --- cpus.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpus.c') 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); -- cgit v1.2.1