aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-04-04 18:10:53 -0700
committerRichard Henderson <richard.henderson@linaro.org>2025-04-23 15:07:32 -0700
commit61fc4c2bfaee8f4da75ce217911f103da7a8a69e (patch)
tree5cf464107e5796ff22805f408dc809f984ab924f
parent60b2c2e66b81c323c0bc70ea4233cdbf8cdae5b2 (diff)
downloadqemu-61fc4c2bfaee8f4da75ce217911f103da7a8a69e.zip
qemu-61fc4c2bfaee8f4da75ce217911f103da7a8a69e.tar.gz
qemu-61fc4c2bfaee8f4da75ce217911f103da7a8a69e.tar.bz2
accel/tcg: Remove mttcg_enabled
In qemu_tcg_mttcg_enabled, read the value from TCGState and eliminate the separate global variable. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--accel/tcg/tcg-all.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index bb759ce..b754f92 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -60,14 +60,11 @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE,
TYPE_TCG_ACCEL)
#ifndef CONFIG_USER_ONLY
-
-static bool mttcg_enabled;
-
bool qemu_tcg_mttcg_enabled(void)
{
- return mttcg_enabled;
+ TCGState *s = TCG_STATE(current_accel());
+ return s->mttcg_enabled;
}
-
#endif /* !CONFIG_USER_ONLY */
/*
@@ -124,7 +121,6 @@ static int tcg_init_machine(MachineState *ms)
#ifndef CONFIG_USER_ONLY
if (s->mttcg_enabled) {
max_threads = ms->smp.max_cpus;
- mttcg_enabled = true;
}
#endif
tcg_init(s->tb_size * MiB, s->splitwx_enabled, max_threads);