From 516cd737330a9b4d90a66136ebf738c4653b4e78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 22 Jun 2023 19:33:54 +1000 Subject: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Although the PPC target only supports the TCG and KVM accelerators, QEMU supports more. We can not assume that '!kvm == tcg', so test for the correct accelerator. This also eases code review, because here we don't care about KVM, we really want to test for TCG. Reviewed-by: Greg Kurz Reviewed-by: Harsh Prateek Bora Reviewed-by: Cédric Le Goater Reviewed-by: David Gibson Signed-off-by: Philippe Mathieu-Daudé [np: Fix changelog typo noticed by Zoltan] Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e55905a1f0..8e7d497f25 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2525,7 +2525,7 @@ static void spapr_set_vsmt_mode(SpaprMachineState *spapr, Error **errp) int ret; unsigned int smp_threads = ms->smp.threads; - if (!kvm_enabled() && (smp_threads > 1)) { + if (tcg_enabled() && (smp_threads > 1)) { error_setg(errp, "TCG cannot support more than 1 thread/core " "on a pseries machine"); return; -- 2.11.0