On 9/18/23 09:02, Philippe Mathieu-Daudé wrote:
While create_vcpu_thread() creates a vCPU thread, its counterpart
is cpu_remove_sync(), which join and destroy the thread.
create_vcpu_thread() is called in qemu_init_vcpu(), itself called
in cpu_common_realizefn(). Since we don't have qemu_deinit_vcpu()
helper (we probably don't need any), simply destroy the thread in
cpu_common_unrealizefn().
Note: only the PPC and X86 targets were calling cpu_remove_sync(),
meaning all other targets were leaking the thread when the vCPU
was unrealized (mostly when vCPU are hot-unplugged).
Signed-off-by: Philippe Mathieu-Daudé<phi...@linaro.org>
---
hw/core/cpu-common.c | 3 +++
target/i386/cpu.c | 1 -
target/ppc/cpu_init.c | 2 --
3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~