From patchwork Tue Apr 22 19:28:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883120 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2596512wrs; Tue, 22 Apr 2025 13:00:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVS3b9FIV9QxuW7WsPXaJwiwEWmCfVRL3VZuI92M05AWe9J7+RFN6RsZxo9saZS1AFGJHQOHQ==@linaro.org X-Google-Smtp-Source: AGHT+IFXazGsDrXptQYYPvbNZHqkX4rKn7s41TdyqlkPHQjRNS4WrmSGAZTpcqOR4EdiZr4Mdkqh X-Received: by 2002:a05:6122:1811:b0:51f:fc9d:875d with SMTP id 71dfb90a1353d-529254c5035mr13293705e0c.8.1745352037468; Tue, 22 Apr 2025 13:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745352037; cv=none; d=google.com; s=arc-20240605; b=koTUlmQsKegUV2NjQLcIkIMfX4BL4R57rEqsDuciG3E4xjPYYK2WkEcMTWJOqFLokx WpBFM4WFW3/UrbwWCPYbcQsWfu4EtRRzLGmq0yG0YSuP0KhmkpsmdjD1qcySWP8fkuZL 5RXWuZik8c/nvQSp+4pYtaw5YOsM3aZs7AcMmk5xsWF2kc4X3n3yAdkjHFY3UzDPZXX3 nFGTxv3E0Fh2X/5U5ti1g2Dp7Zj9GXEi/0V/lDMxa6B7y+e/Pk+1Omhgl+4i5Y02/jBH xz9oS/ncGrHFtv9y0anvNaYdzjtE+T+227DGa7W3SxEENV8CCN+hN9lq3PW/Fi8g5upb PnNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=TEwojCbipjqc0WV/gEzN3cyq9jAbkGKw7ev6nih1Z3Y=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iFFEs/rNwXYQf61XtIzvOQUJdJkXDja6gbz6IFnQeDuF0UV/um84WsJ+xxMvHUovpa e4FNelLGUsevTmrSzw0VcdZFqyaH8HsHgtP9WLPJcPySG1FOkEs56PCyZQSHRlAd3CGg FPyCkLH/eS99P2k3QAARW3y/dV4DzM/sAPkObicjJKCy+hQSFLmNJee+32RfP9PsrMhD MxtuFkcU0W5fEzTz57ofNhID2nHFGPIjKabUV/LSAAaYgyFyXedZfi4WD8Jvzv+pKhCg ikPUF+6hH/VhliVbstwJD+wa0sLHbtrmjsQfRxAsQGR+pGfiNGOMxzlTjooCmrASkjOH Y4TQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cGCcNQ5Z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-52922d916e2si2701993e0c.178.2025.04.22.13.00.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 13:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cGCcNQ5Z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7JTI-000735-8E; Tue, 22 Apr 2025 15:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7JSO-0004Kp-Hh for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:39:02 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7JSM-0007Nm-3b for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:39:00 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-227a8cdd241so63321705ad.3 for ; Tue, 22 Apr 2025 12:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350736; x=1745955536; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TEwojCbipjqc0WV/gEzN3cyq9jAbkGKw7ev6nih1Z3Y=; b=cGCcNQ5ZosQ8BSQDnn+ON4ntj3J4SXznHI83lPH0IeyFufnwPppAimxZTcSmTRV7Rx Rj2h/vJq2vOlHCvegLAaIuU/AcYECVV1BkFocCnSr9xqSz178gXeJSQhC3txCqwsbbS8 0KCLoJllvkAp6m9pdHGbpxrIu+eqtX0W/mTwcn+wud+gJ3cWtX8vbuGng2jaqJodQ6oI lwGfWbkgxQoTeDNYCutue9Ltr7H0MlxtoddaidtpG8JU/zXAk2BmvwwcCheevFl2Sgs5 +0XGDFN+a0i5WyAINIFobXE4twWNFhlEPTB+f4siNaGc+KzWKtNTYFRXO9d95u3HrRgi sDYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350736; x=1745955536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TEwojCbipjqc0WV/gEzN3cyq9jAbkGKw7ev6nih1Z3Y=; b=iuMd9mlsHK3h7hNcryh6YFWX9WnbXNBE45WBieI8KvXjPiUQ40VmsfqE14iC/cOkNa 589vAaBkvU41+wSoLNHJZpDyeCAXcE+YroaB+CXf9aNziGzztFsWDi6P6Dkl18d6tdwD pDLCuH16mjq8xsUBBEjY7bPkv1bd/imNBpWls/ciutEGEyqlBFBHmx2ZxIoA5eIVLj+C bo7batNoyjCuYDrzcMSmGm0RqHR4HdRxcUG2WM1JixMKOqHYe1yTd+WmvdAPp/ZTpxL2 uQANP9ReYhFEURac8M5MxflKm7sauNjJXJYXqQJO2nXL6sTH48DtG55Iz+FzCV2zesdE cgBg== X-Gm-Message-State: AOJu0YxZ5/6vh/LriSPfTeATZJcQk3zCKrbrTIen8d847zH9jHHyWHR/ H8VVtcMT4Er6JsmxyKXLYmG5wmifSZHnQY1ZJa2t9Nhx2iAO/EbU5W0Ac9cZMuDPPtRDyCb4ATb + X-Gm-Gg: ASbGncut+laKscsXtN81KdQF8yvjFnWGW5uSYH8aUuuPF/m2DHi65bncScuRO+heSHJ zTKdySLmgm8LTAJruvPFXOWoFIr8ZViJMwQlzljDm8gC8Isvv/J4wUi9LkjDAtzyVusWCT/xs+G Pa1m8fAxwKhpQzCfvBgvRjN4zzCfvQSSDQ6XZgLC0jiognlH9VlZML1cBP0t1TzaHmn0H+w5zJy PcHGp7NZ+N4F8gsAPqkFLTqbmn3fTvEx6UtYXNrPTADJqHUZSva7ZfH+T9W6mTrp7WEtzvoaGWT He7oNO0KnsApoyhBmVB81NeGpXD32SgATJwMjYO6Ayms6seCHxX5ipCqrPMYAK5KlTW0PDVgXVE = X-Received: by 2002:a17:903:1b6f:b0:223:90ec:80f0 with SMTP id d9443c01a7336-22c535a6192mr290496325ad.22.1745350736133; Tue, 22 Apr 2025 12:38:56 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50eb484dsm88951765ad.148.2025.04.22.12.38.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:38:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 144/147] accel/tcg: Move mttcg warning to tcg_init_machine Date: Tue, 22 Apr 2025 12:28:13 -0700 Message-ID: <20250422192819.302784-145-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Delay the warning to tcg_init_machine, because we will have resolved the CPUClass at that point. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/tcg-all.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index fa77a4c5a2..ecdd48847c 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -93,7 +93,8 @@ static int tcg_init_machine(MachineState *ms) # else bool mttcg_supported = false; # endif - if (s->mttcg_enabled == ON_OFF_AUTO_AUTO) { + switch (s->mttcg_enabled) { + case ON_OFF_AUTO_AUTO: /* * We default to false if we know other options have been enabled * which are currently incompatible with MTTCG. Otherwise when each @@ -108,12 +109,22 @@ static int tcg_init_machine(MachineState *ms) */ if (mttcg_supported && !icount_enabled()) { s->mttcg_enabled = ON_OFF_AUTO_ON; + max_threads = ms->smp.max_cpus; } else { s->mttcg_enabled = ON_OFF_AUTO_OFF; } - } - if (s->mttcg_enabled == ON_OFF_AUTO_ON) { + break; + case ON_OFF_AUTO_ON: + if (!mttcg_supported) { + warn_report("Guest not yet converted to MTTCG - " + "you may get unexpected results"); + } max_threads = ms->smp.max_cpus; + break; + case ON_OFF_AUTO_OFF: + break; + default: + g_assert_not_reached(); } #endif @@ -153,10 +164,6 @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp) if (icount_enabled()) { error_setg(errp, "No MTTCG when icount is enabled"); } else { -#ifndef TARGET_SUPPORTS_MTTCG - warn_report("Guest not yet converted to MTTCG - " - "you may get unexpected results"); -#endif s->mttcg_enabled = ON_OFF_AUTO_ON; } } else if (strcmp(value, "single") == 0) {