aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorClaudio Fontana <cfontana@suse.de>2020-09-08 10:59:07 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-05 16:41:22 +0200
commit20b0a9f4f6bbe41aaadf6681c16ac73d289203e1 (patch)
treed0e554cf1a5c67d6bb2ff07e7512b530e7b7a146 /accel
parentd0a92b353efa2ca3c2847ad38f088b16d1278290 (diff)
accel/tcg: use current_machine as it is always set for softmmu
current_machine is always set before accelerators are initialized, so use that instead of MACHINE(qdev_get_machine()). Signed-off-by: Claudio Fontana <cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/tcg-cpus.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/accel/tcg/tcg-cpus.c b/accel/tcg/tcg-cpus.c
index cedd1e6c4f..da1c63d8f6 100644
--- a/accel/tcg/tcg-cpus.c
+++ b/accel/tcg/tcg-cpus.c
@@ -479,16 +479,7 @@ static void tcg_start_vcpu_thread(CPUState *cpu)
if (!tcg_region_inited) {
tcg_region_inited = 1;
tcg_region_init();
- /*
- * If MTTCG, and we will create multiple cpus,
- * then we will have cpus running in parallel.
- */
- if (qemu_tcg_mttcg_enabled()) {
- MachineState *ms = MACHINE(qdev_get_machine());
- if (ms->smp.max_cpus > 1) {
- parallel_cpus = true;
- }
- }
+ parallel_cpus = qemu_tcg_mttcg_enabled() && current_machine->smp.max_cpus > 1;
}
if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) {