aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/tcg-accel-ops-mttcg.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2022-03-23 18:17:43 +0100
committerRichard Henderson <richard.henderson@linaro.org>2022-06-20 13:11:36 -0700
commita82fd5a4ec24d923ff1e6da128c0fd4a74079d99 (patch)
tree8976193d4afc9b0ddc6126b79d71052a9a6d436a /accel/tcg/tcg-accel-ops-mttcg.c
parentadb5974dcc5ee7fe122c74fb85d3bae331101ec3 (diff)
accel/tcg: Init TCG cflags in vCPU thread handler
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>
Diffstat (limited to 'accel/tcg/tcg-accel-ops-mttcg.c')
-rw-r--r--accel/tcg/tcg-accel-ops-mttcg.c5
1 files changed, 2 insertions, 3 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);