@@ -435,7 +435,7 @@ static inline bool cpu_handle_halt_locked(CPUState *cpu)
&& replay_interrupt()) {
X86CPU *x86_cpu = X86_CPU(cpu);
- /* prevent deadlock; cpu_mutex must be acquired _after_ the BQL */
+ /* locking order: cpu_mutex must be acquired _after_ the BQL */
cpu_mutex_unlock(cpu);
qemu_mutex_lock_iothread();
cpu_mutex_lock(cpu);
@@ -225,7 +225,7 @@ static bool cpu_thread_is_idle(CPUState *cpu)
if (cpu_is_stopped(cpu)) {
return true;
}
- if (!cpu->halted || cpu_has_work(cpu) ||
+ if (!cpu_halted(cpu) || cpu_has_work(cpu) ||
kvm_halt_in_kernel()) {
return false;
}
@@ -1840,7 +1840,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
*
* cpu->halted should ensure we sleep in wait_io_event
*/
- g_assert(cpu->halted);
+ g_assert(cpu_halted(cpu));
break;
case EXCP_ATOMIC:
qemu_mutex_unlock_iothread();
@@ -257,7 +257,7 @@ static void cpu_common_reset(DeviceState *dev)
}
cpu->interrupt_request = 0;
- cpu->halted = 0;
+ cpu_halted_set(cpu, 0);
cpu->mem_io_pc = 0;
cpu->icount_extra = 0;
atomic_set(&cpu->icount_decr_ptr->u32, 0);
@@ -58,7 +58,7 @@ CpuInfoList *qmp_query_cpus(Error **errp)
info->value = g_malloc0(sizeof(*info->value));
info->value->CPU = cpu->cpu_index;
info->value->current = (cpu == first_cpu);
- info->value->halted = cpu->halted;
+ info->value->halted = cpu_halted(cpu);
info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
info->value->thread_id = cpu->thread_id;
#if defined(TARGET_I386)