diff options
author | Bharata B Rao <bharata@linux.vnet.ibm.com> | 2017-04-27 10:48:22 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-05-11 09:45:15 +1000 |
commit | a3e53273ad52551b61c0cdb8f48a19eb22c05831 (patch) | |
tree | e4202766811964ceae4b40e1a04f8035bbe89dd1 /cpus.c | |
parent | 4771df23ed6a2b13927030d5933147d85785f5d5 (diff) |
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 <bharata@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpus.c')
-rw-r--r-- | cpus.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |