mirror of https://github.com/xqemu/xqemu.git
iothread: fix vcpu stop with smp tcg
Round robin vcpus in tcg_cpu_next even if the vm stopped. This allows all cpus to enter stopped state. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
5307d7d35e
commit
c37cc7b072
5
vl.c
5
vl.c
|
@ -3876,14 +3876,15 @@ static void tcg_cpu_exec(void)
|
||||||
for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) {
|
for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) {
|
||||||
CPUState *env = cur_cpu = next_cpu;
|
CPUState *env = cur_cpu = next_cpu;
|
||||||
|
|
||||||
if (!vm_running)
|
|
||||||
break;
|
|
||||||
if (timer_alarm_pending) {
|
if (timer_alarm_pending) {
|
||||||
timer_alarm_pending = 0;
|
timer_alarm_pending = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cpu_can_run(env))
|
if (cpu_can_run(env))
|
||||||
ret = qemu_cpu_exec(env);
|
ret = qemu_cpu_exec(env);
|
||||||
|
else if (env->stop)
|
||||||
|
break;
|
||||||
|
|
||||||
if (ret == EXCP_DEBUG) {
|
if (ret == EXCP_DEBUG) {
|
||||||
gdb_set_stop_cpu(env);
|
gdb_set_stop_cpu(env);
|
||||||
debug_requested = 1;
|
debug_requested = 1;
|
||||||
|
|
Loading…
Reference in New Issue