diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-03-09 22:52:45 -0600 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-06-11 09:27:08 -0700 |
commit | 43b972b7ebe9b8e84aa535031de7e605f6bf2cb2 (patch) | |
tree | cc1d8a122b43510682c1430134cafccbabe0edaf /accel/tcg | |
parent | efba8ae9f6f4df011b0441ae2b634be6152026a4 (diff) | |
download | qemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.zip qemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.tar.gz qemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.tar.bz2 |
accel/tcg: Pass down max_cpus to tcg_init
Start removing the include of hw/boards.h from tcg/.
Pass down the max_cpus value from tcg_init_machine,
where we have the MachineState already.
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel/tcg')
-rw-r--r-- | accel/tcg/tcg-all.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 1ee8990..00803f7 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -33,6 +33,9 @@ #include "qemu/accel.h" #include "qapi/qapi-builtin-visit.h" #include "qemu/units.h" +#if !defined(CONFIG_USER_ONLY) +#include "hw/boards.h" +#endif #include "internal.h" struct TCGState { @@ -110,13 +113,18 @@ bool mttcg_enabled; static int tcg_init_machine(MachineState *ms) { TCGState *s = TCG_STATE(current_accel()); +#ifdef CONFIG_USER_ONLY + unsigned max_cpus = 1; +#else + unsigned max_cpus = ms->smp.max_cpus; +#endif tcg_allowed = true; mttcg_enabled = s->mttcg_enabled; page_init(); tb_htable_init(); - tcg_init(s->tb_size * MiB, s->splitwx_enabled); + tcg_init(s->tb_size * MiB, s->splitwx_enabled, max_cpus); #if defined(CONFIG_SOFTMMU) /* |