[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 31/73] cpu: convert to cpu_halted
From: |
Robert Foley |
Subject: |
[PATCH v10 31/73] cpu: convert to cpu_halted |
Date: |
Wed, 17 Jun 2020 17:01:49 -0400 |
From: "Emilio G. Cota" <cota@braap.org>
This finishes the conversion to cpu_halted.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Robert Foley <robert.foley@linaro.org>
---
accel/tcg/cpu-exec.c | 2 +-
cpus.c | 4 ++--
hw/core/cpu.c | 2 +-
hw/core/machine-qmp-cmds.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index e296894ea1..099dd83ee0 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -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);
diff --git a/cpus.c b/cpus.c
index 8edc9858d6..e070bffbff 100644
--- a/cpus.c
+++ b/cpus.c
@@ -223,7 +223,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;
}
@@ -1865,7 +1865,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();
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index 1d2cafe76c..64a1bf3e92 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -259,7 +259,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);
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 2c5da8413d..a35559b5d8 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -62,7 +62,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)
--
2.17.1
- [PATCH v10 27/73] xtensa: convert to cpu_halted, (continued)
- [PATCH v10 27/73] xtensa: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 25/73] s390x: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 29/73] openrisc: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 32/73] cpu: define cpu_interrupt_request helpers, Robert Foley, 2020/06/17
- [PATCH v10 22/73] m68k: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 23/73] mips: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 28/73] gdbstub: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 34/73] exec: use cpu_reset_interrupt, Robert Foley, 2020/06/17
- [PATCH v10 30/73] cpu-exec: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 33/73] ppc: use cpu_reset_interrupt, Robert Foley, 2020/06/17
- [PATCH v10 31/73] cpu: convert to cpu_halted,
Robert Foley <=
- [PATCH v10 35/73] i386: use cpu_reset_interrupt, Robert Foley, 2020/06/17
- [PATCH v10 37/73] openrisc: use cpu_reset_interrupt, Robert Foley, 2020/06/17
- [PATCH v10 39/73] i386: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 24/73] riscv: convert to cpu_halted, Robert Foley, 2020/06/17
- [PATCH v10 38/73] arm: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 36/73] s390x: use cpu_reset_interrupt, Robert Foley, 2020/06/17
- [PATCH v10 41/73] i386/hax-all: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 42/73] i386/whpx-all: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 40/73] i386/kvm: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 43/73] i386/hvf: convert to cpu_request_interrupt, Robert Foley, 2020/06/17