@@ -1526,8 +1526,13 @@ void cpu_remove(CPUState *cpu)
void cpu_remove_sync(CPUState *cpu)
{
cpu_remove(cpu);
- while (cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
+ if (!kvm_enabled()) {
+ qemu_tcg_destroy_vcpu(cpu);
+ cpu->created = false;
+ } else {
+ while (cpu->created) {
+ qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
+ }
}
}
@@ -1573,6 +1578,9 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
/* For non-MTTCG cases we share the thread */
cpu->thread = single_tcg_cpu_thread;
cpu->halt_cond = single_tcg_halt_cond;
+ cpu->thread_id = first_cpu->thread_id;
+ cpu->created = true;
+ cpu->can_do_io = 1;
}
}
@@ -244,6 +244,7 @@ static void rtas_stop_self(PowerPCCPU *cpu, sPAPRMachineState *spapr,
CPUPPCState *env = &cpu->env;
cs->halted = 1;
+ cs->stop = true;
qemu_cpu_kick(cs);
/*
* While stopping a CPU, the guest calls H_CPPR which