[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cp
From: |
Robert Foley |
Subject: |
[PATCH v10 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle |
Date: |
Wed, 17 Jun 2020 17:02:27 -0400 |
From: "Emilio G. Cota" <cota@braap.org>
This function is only called from TCG rr mode, so add
a prefix to mark this as well as an assertion.
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>
---
cpus.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/cpus.c b/cpus.c
index e070bffbff..2e9c19ae36 100644
--- a/cpus.c
+++ b/cpus.c
@@ -230,10 +230,12 @@ static bool cpu_thread_is_idle(CPUState *cpu)
return true;
}
-static bool all_cpu_threads_idle(void)
+static bool qemu_tcg_rr_all_cpu_threads_idle(void)
{
CPUState *cpu;
+ g_assert(qemu_is_tcg_rr());
+
CPU_FOREACH(cpu) {
if (!cpu_thread_is_idle(cpu)) {
return false;
@@ -642,7 +644,7 @@ void qemu_start_warp_timer(void)
}
if (replay_mode != REPLAY_MODE_PLAY) {
- if (!all_cpu_threads_idle()) {
+ if (!qemu_tcg_rr_all_cpu_threads_idle()) {
return;
}
@@ -1320,7 +1322,7 @@ static void qemu_tcg_rr_wait_io_event(void)
{
CPUState *cpu;
- while (all_cpu_threads_idle()) {
+ while (qemu_tcg_rr_all_cpu_threads_idle()) {
stop_tcg_kick_timer();
qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex);
}
@@ -1676,7 +1678,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
atomic_mb_set(&cpu->exit_request, 0);
}
- if (use_icount && all_cpu_threads_idle()) {
+ if (use_icount && qemu_tcg_rr_all_cpu_threads_idle()) {
/*
* When all cpus are sleeping (e.g in WFI), to avoid a deadlock
* in the main_loop, wake it up in order to start the warp timer.
--
2.17.1
- [PATCH v10 56/73] openrisc: convert to cpu_interrupt_request, (continued)
- [PATCH v10 56/73] openrisc: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 58/73] microblaze: convert to cpu_interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 60/73] cpu: convert to interrupt_request, Robert Foley, 2020/06/17
- [PATCH v10 62/73] cpu: introduce cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 63/73] ppc: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 61/73] cpu: call .cpu_has_work with the CPU lock held, Robert Foley, 2020/06/17
- [PATCH v10 64/73] mips: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 66/73] riscv: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 68/73] xtensa: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 65/73] s390x: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle,
Robert Foley <=
- [PATCH v10 70/73] cpu: protect CPU state with cpu->lock instead of the BQL, Robert Foley, 2020/06/17
- [PATCH v10 73/73] cputlb: queue async flush jobs without the BQL, Robert Foley, 2020/06/17
- [PATCH v10 72/73] cpu: add async_run_on_cpu_no_bql, Robert Foley, 2020/06/17
- [PATCH v10 67/73] sparc: convert to cpu_has_work_with_iothread_lock, Robert Foley, 2020/06/17
- [PATCH v10 71/73] cpus-common: release BQL earlier in run_on_cpu, Robert Foley, 2020/06/17
- Re: [PATCH v10 00/73] per-CPU locks, no-reply, 2020/06/17