[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/9] accel/tcg: Init TCG cflags in vCPU thread handler
From: |
Richard Henderson |
Subject: |
[PULL 3/9] accel/tcg: Init TCG cflags in vCPU thread handler |
Date: |
Tue, 21 Jun 2022 13:46:37 -0700 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Move TCG cflags initialization to thread handler.
Remove the duplicated assert checks.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220323171751.78612-6-philippe.mathieu.daude@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/tcg-accel-ops-mttcg.c | 5 ++---
accel/tcg/tcg-accel-ops-rr.c | 7 +++----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c
index d50239e0e2..ba997f6cfe 100644
--- a/accel/tcg/tcg-accel-ops-mttcg.c
+++ b/accel/tcg/tcg-accel-ops-mttcg.c
@@ -70,6 +70,8 @@ static void *mttcg_cpu_thread_fn(void *arg)
assert(tcg_enabled());
g_assert(!icount_enabled());
+ tcg_cpu_init_cflags(cpu, current_machine->smp.max_cpus > 1);
+
rcu_register_thread();
force_rcu.notifier.notify = mttcg_force_rcu;
force_rcu.cpu = cpu;
@@ -139,9 +141,6 @@ void mttcg_start_vcpu_thread(CPUState *cpu)
{
char thread_name[VCPU_THREAD_NAME_SIZE];
- g_assert(tcg_enabled());
- tcg_cpu_init_cflags(cpu, current_machine->smp.max_cpus > 1);
-
cpu->thread = g_new0(QemuThread, 1);
cpu->halt_cond = g_malloc0(sizeof(QemuCond));
qemu_cond_init(cpu->halt_cond);
diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c
index 1a72149f0e..cc8adc2380 100644
--- a/accel/tcg/tcg-accel-ops-rr.c
+++ b/accel/tcg/tcg-accel-ops-rr.c
@@ -152,7 +152,9 @@ static void *rr_cpu_thread_fn(void *arg)
Notifier force_rcu;
CPUState *cpu = arg;
- assert(tcg_enabled());
+ g_assert(tcg_enabled());
+ tcg_cpu_init_cflags(cpu, false);
+
rcu_register_thread();
force_rcu.notify = rr_force_rcu;
rcu_add_force_rcu_notifier(&force_rcu);
@@ -275,9 +277,6 @@ void rr_start_vcpu_thread(CPUState *cpu)
static QemuCond *single_tcg_halt_cond;
static QemuThread *single_tcg_cpu_thread;
- g_assert(tcg_enabled());
- tcg_cpu_init_cflags(cpu, false);
-
if (!single_tcg_cpu_thread) {
cpu->thread = g_new0(QemuThread, 1);
cpu->halt_cond = g_new0(QemuCond, 1);
--
2.34.1
- [PULL 0/9] tcg patch queue for 2022-06-21, Richard Henderson, 2022/06/21
- [PULL 6/9] softmmu: Always initialize xlat in address_space_translate_for_iotlb, Richard Henderson, 2022/06/21
- [PULL 4/9] accel/tcg: Reorganize tcg_accel_ops_init(), Richard Henderson, 2022/06/21
- [PULL 8/9] util/cacheflush: Merge aarch64 ctr_el0 usage, Richard Henderson, 2022/06/21
- [PULL 5/9] qemu-timer: Skip empty timer lists before locking in qemu_clock_deadline_ns_all, Richard Henderson, 2022/06/21
- [PULL 2/9] target/avr: Drop avr_cpu_memory_rw_debug(), Richard Henderson, 2022/06/21
- [PULL 1/9] tcg/ppc: implement rem[u]_i{32,64} with mod[su][wd], Richard Henderson, 2022/06/21
- [PULL 7/9] util: Merge cacheflush.c and cacheinfo.c, Richard Henderson, 2022/06/21
- [PULL 9/9] util/cacheflush: Optimize flushing when ppc host has coherent icache, Richard Henderson, 2022/06/21
- [PULL 3/9] accel/tcg: Init TCG cflags in vCPU thread handler,
Richard Henderson <=
- Re: [PULL 0/9] tcg patch queue for 2022-06-21, Richard Henderson, 2022/06/21