From patchwork Wed Apr 2 21:23:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 877736 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp2966968wrs; Wed, 2 Apr 2025 14:24:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdhLaNBu3BQp7ZQq5jfG2ug6YzLF3kQSv0t7/yUYFmhCdpar8Z4/PJNpvV5TDltubljq2cUQ==@linaro.org X-Google-Smtp-Source: AGHT+IHE0aZnCvRuaHxK8m+lB6iwwoNAjIRHkOK5/O9+NN/HV0j//j/3854btOuvrW/DKeCTKrFv X-Received: by 2002:a05:622a:594:b0:476:980c:10a9 with SMTP id d75a77b69052e-47909f79ed2mr67711331cf.21.1743629040687; Wed, 02 Apr 2025 14:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743629040; cv=none; d=google.com; s=arc-20240605; b=UZrZN5YwaR/mUu8OrCKZVrYDDyL5rJBA3yJ03mKtWTg5RaMoDR/YK57/pI7taNErVA e2bdY+0H0UNx5vZNJFPeiYDWvIlHArQDu1okf9Ot94aj9I09JHxHZ3H9sfMzIe75GkVq wC5+3QVaNTj3pZbPpqWNnHCbUu3zA978A07TTq8y/yFvYxSoKWwYUsCpELHyrTzSVivk L+Iqrd/N2x1eI0v+DLQ+YC5Q4A/dfer1dJJRKWd4YUlvw4LFtFW9j/2PirkQbUjfsBnL Y4PzwSzEhLD3bdXmCROyU0g/+YKT8MzHwN6LhuKkqSi+JwyT19lgxSp8MrsuLbFt5pTc maXg== 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=bkCr362ZjamcjiYyXQYAVlRzEd6wzep8CllaznGqzgQ=; fh=2WsjhQWI4lQgYgc4VV8bbFA9ixJvTm6B39az9SeRSzU=; b=gcL/3MZir9KBXiswr1HOpMZzxiGsXdfSdYlpQxWoQxJelDbLrxo56xu7TZC7M9epd3 LN/zFZl1EYczEQZFWm0KABuJ7dUJ5P2l52IJ5fAO+PKkaBPMd71os6T8Y1okjdznkljS v/VhuUPBBAEGiDMvND+5h2PYrQmOKOg0vC8ZOfW5Fvttt+0MGrQ4YWMp11Un3BFKPIm0 HwXN9XuxbcUfaMX097YKp2yLF+lB4xORq8yQoXU8kpx3SzV/vQZ0QB/561FtxoretafD NrrM7hAi29kDB+IJ0n0vVDI5r+ZBm85BC0BCtxQzRKtlsRSBgV7u0ZcOkAt6NZZlLQb/ MkPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SFOHWnhh; 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 d75a77b69052e-47788a665bfsi106778901cf.210.2025.04.02.14.24.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Apr 2025 14:24:00 -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=SFOHWnhh; 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 1u05Ys-0007jh-C8; Wed, 02 Apr 2025 17:23:50 -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 1u05Yn-0007gW-DB for qemu-devel@nongnu.org; Wed, 02 Apr 2025 17:23:45 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u05Yk-00047r-OC for qemu-devel@nongnu.org; Wed, 02 Apr 2025 17:23:45 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-39ac8e7688aso177859f8f.2 for ; Wed, 02 Apr 2025 14:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743629020; x=1744233820; 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=bkCr362ZjamcjiYyXQYAVlRzEd6wzep8CllaznGqzgQ=; b=SFOHWnhhm5zfPW2EUZeXYn3qEAF+inwXm26ZmGi8jPosLx4MElKaKASRJTk4ns/s5Y j3dBe30CFiv+YEl2dfjy7pGRdpUfWcZbfusR7LLffVEidUknL4EL1J+Y3yEr5xA73mty VuR5bo63jeTX+eU5lB0gYFKanZ1DZHceFAgLQL08Eh2oqAfMr3O4BR3lR5eDp/X5UJhH QROIjhJaEKJQiaojEzAaSy1VAVA5fTpyPnAiaT5CoEBmwUuPMW7gXCsSgNydpnnYhjcH XZ7hTPrldOKiaNxq5x96pkJTtxR7FcL3Xnew3fyDFkPV186saw5lvrtE4jF1KonwQa1l n+yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743629020; x=1744233820; 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=bkCr362ZjamcjiYyXQYAVlRzEd6wzep8CllaznGqzgQ=; b=VdWaPuKovAhDM76xkJAP4xxkNPYBQROqhQvfiFd2B45ZDTzvrZ1WbD8zDpSuMFOFU4 h1fpbBm7w5Xha5k8PjmjAnANNY/PDvnH65WLbfKXOV3znSUZJNvf23XGqeuMq728oZzK xEtH4+rUlSbmU3YVPeBGaIJnJeZQpxNwCZdERTlzfMmHK36lIbT+pnITVo0DzNVYjzrp WHdoBKBnpFP+lUC1LauDhELaBaRNCDIiBoL+pfpl9FevmojLVKOeLW3ZieuPTYhxNRh/ 0H2X6HHuXovL2H2rY63oyJpIO8pYlA4rwX1YqwIIDjtPR27z896rQ2oLnGmgU0z4i2nD 18cA== X-Gm-Message-State: AOJu0Ywz4gqOeE4TJ6ZjNWHAQrEwCODbQvXZPq0lMn3rPzphPkP5WlNl luEw4+6ajUXMhMpf4Pzkf43E/MtoVGDJrdpqZWIcj3Us1xMKLZGFJvh8FNVBzT+lnFJEgpoVkvl x X-Gm-Gg: ASbGncuZheR306RmWTxAFnS3NOwegb18D9VWfR6DkAFLDmKF7A2ZWcFPTjnZ6YVFd/Q FZEPYQ4ylc0d9garx1yEtzkZPMS1s9aMl3biQJEglHe7x+kn4TNYvbtceIr+82mu7BxIx+fXIet skoM+qKT4r1px4pp2SeUgzcN75q1Gzz7AOp7T6EgjstHF9mg1GRxeV+T6PQT5Bg9o75KiA9HExy 9b7fQzNM826nl3f/UtVkG/7lMWXF4UQtfhQZpiEIm5OTC1kz61kLG6w7QoZAlyN4gf5pwyAVBov gmYCIOPVVe/vjCOuU2+X1J8DugYYzU7pp8JsPrKnvfMrfXaOm9gUxQFg6UNH1+6KspbUY2AG84e xvDy1usGqFxjvEml+UBO3ZLZRjLD07A== X-Received: by 2002:a05:6000:1449:b0:390:e48a:3869 with SMTP id ffacd0b85a97d-39c29737d42mr3796057f8f.11.1743629020586; Wed, 02 Apr 2025 14:23:40 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec256e727sm280355e9.29.2025.04.02.14.23.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 02 Apr 2025 14:23:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Richard Henderson Subject: [PATCH-for-10.1 v2 41/43] tcg: Factor mttcg_init() out Date: Wed, 2 Apr 2025 23:23:17 +0200 Message-ID: <20250402212319.58349-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250402212319.58349-1-philmd@linaro.org> References: <20250402212319.58349-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Keep MTTCG initialization code out of tcg_init_machine(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/tcg-all.c | 50 +++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 15d4e9232ae..267830658ca 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -69,29 +69,8 @@ bool qemu_tcg_mttcg_enabled(void) return mttcg_enabled; } -#endif /* !CONFIG_USER_ONLY */ - -static void tcg_accel_instance_init(Object *obj) +static void mttcg_init(TCGState *s) { - TCGState *s = TCG_STATE(obj); - - /* If debugging enabled, default "auto on", otherwise off. */ -#if defined(CONFIG_DEBUG_TCG) && !defined(CONFIG_USER_ONLY) - s->splitwx_enabled = -1; -#else - s->splitwx_enabled = 0; -#endif -} - -bool one_insn_per_tb; - -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; #ifdef TARGET_SUPPORTS_MTTCG bool mttcg_supported = true; #else @@ -118,6 +97,33 @@ static int tcg_init_machine(MachineState *ms) } } mttcg_enabled = s->mttcg_enabled; +} + +#endif /* !CONFIG_USER_ONLY */ + +static void tcg_accel_instance_init(Object *obj) +{ + TCGState *s = TCG_STATE(obj); + + /* If debugging enabled, default "auto on", otherwise off. */ +#if defined(CONFIG_DEBUG_TCG) && !defined(CONFIG_USER_ONLY) + s->splitwx_enabled = -1; +#else + s->splitwx_enabled = 0; +#endif +} + +bool one_insn_per_tb; + +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; + + mttcg_init(s); #endif tcg_allowed = true;