On Thu, Dec 13, 2018 at 00:03:47 -0500, Emilio G. Cota wrote: (snip) > diff --git a/qom/cpu.c b/qom/cpu.c > index aa15ea4af5..2ea5b1da08 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -371,7 +371,6 @@ static void cpu_common_initfn(Object *obj) > cpu->nr_cores = 1; > cpu->nr_threads = 1; > > - qemu_mutex_init(&cpu->lock); > qemu_cond_init(&cpu->cond); > QSIMPLEQ_INIT(&cpu->work_list); > QTAILQ_INIT(&cpu->breakpoints);
*ouch* this breaks user-mode, since we end up with cpu->lock == NULL. I'm surprised that make check-qtest didn't pick this up--guess it's all system-mode tests. I've fixed this commit on github's v5 branch with the appended. Thanks, Emilio --- diff --git a/cpus.c b/cpus.c index d8261903ac..9c6cd9b90f 100644 --- a/cpus.c +++ b/cpus.c @@ -2326,10 +2326,9 @@ void qemu_init_vcpu(CPUState *cpu) * cpu->lock is a standalone per-CPU lock. */ if (qemu_is_tcg_rr()) { + qemu_mutex_destroy(cpu->lock); + g_free(cpu->lock); cpu->lock = &qemu_global_mutex; - } else { - cpu->lock = g_malloc(sizeof(*cpu->lock)); - qemu_mutex_init(cpu->lock); } if (kvm_enabled()) { diff --git a/qom/cpu.c b/qom/cpu.c index 386b1e29dd..c4cb626393 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -367,6 +367,8 @@ static void cpu_common_initfn(Object *obj) cpu->nr_cores = 1; cpu->nr_threads = 1; + cpu->lock = g_new(QemuMutex, 1); + qemu_mutex_init(cpu->lock); qemu_cond_init(&cpu->cond); QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints);