@@ -1329,3 +1329,8 @@ bool cpu_thread_is_idle(CPUState *cpu)
return ret == -1 ? true : ret;
}
+
+bool cpu_is_paused(CPUState *cpu)
+{
+ return cpu->stopped || cpu->in_syscall;
+}
@@ -233,6 +233,7 @@ void cpu_exit_syscall(CPUState *cs);
int cpu_thread_is_idle_common(CPUState *cpu);
bool cpu_thread_is_idle(CPUState *cpu);
+bool cpu_is_paused(CPUState *cpu);
/**
* env_archcpu(env)
@@ -530,12 +530,17 @@ void cpu_resume(CPUState *cpu)
qemu_cpu_kick(cpu);
}
+bool cpu_is_paused(CPUState *cpu)
+{
+ return cpu->stopped;
+}
+
static bool all_vcpus_paused(void)
{
CPUState *cpu;
CPU_FOREACH(cpu) {
- if (!cpu->stopped) {
+ if (!cpu_is_paused(cpu)) {
return false;
}
}
A qemu-system CPU is considered paused as a result of an external request. A qemu-user CPU, in addition to that, should be considered paused when it's executing a syscall. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- accel/tcg/user-exec.c | 5 +++++ include/exec/cpu-common.h | 1 + system/cpus.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-)