From patchwork Thu Apr 3 22:04:18 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: 877969 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3496092wrs; Thu, 3 Apr 2025 15:07:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUC/7kYF4+Qiws5qODaW6eiyVy9/EQxZLl+xfs0bxqF4l3dsGypgoa50k7rj12kVTi11VFmZg==@linaro.org X-Google-Smtp-Source: AGHT+IGsdggb6l+ztNtSfLOtv3RswD1R9EWvXPU/u2JiuGnkxNX/+idoouh3ssVLp9cTMNdSCSRA X-Received: by 2002:a05:6214:c44:b0:6ed:1095:e9d3 with SMTP id 6a1803df08f44-6ef0bf9c202mr64569606d6.14.1743718021023; Thu, 03 Apr 2025 15:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743718021; cv=none; d=google.com; s=arc-20240605; b=IRbQZGOpULL89kWj3veczLqFKVhvj3wruAkiLUMQfqMbIYSBuMQPW4dQIh/lr0o/FP 6B9EcE6MQofxYMrMzF2nVo7PtnjgpLetUFhZyBKP0tDzU4DU7YP1AUc8whApZ+l65QcQ CPr9rprw7NAHhjWDsJzaYhlpflgm/WPmj9IZG4DsEW/f1jA2riLts1+0ZaEKnTc+I9CA Zc1AF21DUL0PNpGyNi35NoS1ihawclMVruFE4102UeWQKyQKixQWpWFB59s/az4hNtpN wgHxqkwv2TmAYmtpPfQuElxBMGqhfbJj9P1RgPmdQl1oeXe9JTUuoz4R4mrCMeaczhDV z8ZA== 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:cc:to :from:dkim-signature; bh=fLiC832/142ITmF1Yvgl6ilLfBOuUrOH271pHrSjNR0=; fh=rZke+MZrIrDt/hwqaS/+8O6yNmgq91iuHd+wefmqvE4=; b=VgtlLHkXeuDvy9UoFoquX7cvwoE7qnIISiGuGk/kHL7WDbeZX2NKXhY3yjpJjIMmWz w22GZcXRs8/aqjkCEUk0pBTE8bfGTa0RLW/gyvnnvDiKYHQ5xC/eFzzbOeZdtfIlyutt UQ7laNm8QlCB2aY3s8RpG50vC+6iOOUFN18xQe/z6U01GPbFwVIsrqUOrxsaMD/vfJFf 9+gZE1CMZ6F8x7u3jjriusPbZUW+SQtATA0qkYzawjL3Psyox7IufreFoop2mTSHoVrt QqA4RHKq74MeQ9zNna558KWM2jElsvOj9VPqdH1nu+SFjX4NC2zJB4Tg+6CNNRrviabc MnRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NvoLT5R8; 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 6a1803df08f44-6ef0f00f293si19003536d6.130.2025.04.03.15.07.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Apr 2025 15:07:01 -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=NvoLT5R8; 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 1u0ShX-0002sT-9L; Thu, 03 Apr 2025 18:06:20 -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 1u0ShE-00024z-Gz for qemu-devel@nongnu.org; Thu, 03 Apr 2025 18:06:02 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0ShA-000438-Tf for qemu-devel@nongnu.org; Thu, 03 Apr 2025 18:05:59 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3996af42857so1720903f8f.0 for ; Thu, 03 Apr 2025 15:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743717955; x=1744322755; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fLiC832/142ITmF1Yvgl6ilLfBOuUrOH271pHrSjNR0=; b=NvoLT5R8isA25NDIg3hW5UKUZVjZIPzfp4qLrBxwkL50X7FQ5BcD2vnbUuw9PZTzu2 5HnC//AbfpeDcgkSJIF6IQLx1TdEmi5OhiD8qQD+K94GAvTwi7d4DqgYK7x7qJDUmD9C 0nTNPJRO0S5rJB18owJ6i3F4TkCQvH03JpDL/EDT2DQP0Mx0HXSXAun12724prlg5SMd PmcDDnvuwN4fcxoOJHN+ZcJZFf62Zx6NQHPNW3G+V1YB4Q4xaZSww0ZqPEQ+EP+qb2jD z5W3e16sQCeflW2H8Cd6W/TM51qO9TN6BzZFc1NPhEpqySpp6de8+YaFohxcoG+6plxt X8fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743717955; x=1744322755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fLiC832/142ITmF1Yvgl6ilLfBOuUrOH271pHrSjNR0=; b=AWSoRsQM8N8Gw70P2rKaR+bRY5xi04rLgKOGjG9puBStcw/ppt4zQ49TIhMvwOVPUI knJGiZ7Uo7fYM5mHZbKc/u5siHDcBIPe0IwOoevWMizywZYKm+CXgOzcsD+1OBIzs2Cy VikrX7sJrf1qsG4FDQ1PBT3gmFPmRT2lRosaKOHwG5wLSZXY/Mz6mbWcjmOK4QHmENX8 E74Ko4SlMxDTVSQDfKX2Kb/oukcPv8Fn3CzAZwXsuA1Qdo/8eE25h2wfmUBa1wAY87Be XZk3jD2YF33guyZ9R1R8+ghprPyJHmmjvE//lwDPXfdPZz7cFgFpxdvuPVLFEMits4lc 9b/w== X-Gm-Message-State: AOJu0Yxg3dOEEZ1lBGNIfUkW1yxpP1NTIoYuCfFiPKa2Cjd+O75EOSlj f/baiuVuJGQHPC81z/S+go/wKIosFt+Ez1SdvbcWY4cvCPFZ42I1zRmutPDZxxldfBSGaP5scKw 0 X-Gm-Gg: ASbGnct8hkGOrQ3g6+v/Gj1tlXpwE4ZWoA8ns0tTHlS4SfgcwgL3RhYuR8aT1jYAh9R rrb7MPq4CeZyBsUxh54C1L4HmoYKWp2XB2W1DE72KH/MnCbpx0xecFEKjmK8YRaHZEoD5+fJqNQ E8VPAMDZrpm58h5ZtPQ13x5ex1pfmQV1tL14l3W3u3XU5gh2n6xwJSiqJ+QxN+socGab+fGQtnl ePcIgmcm9BLnGmD5h2s8TUCsH+lnTv4yi4pqZu5woFUoQTlXQQTN+eyLXChyd5kz9eoAlDczeal d6Ylxsb8I59QTVAmOMwgkxB4+VZ4jH8CCMc4MQoxWI5MMxjiOL4I77spZsBoIICQqmq80amMsi7 z6YSDeth/t3pVay2r9RLLiRRu X-Received: by 2002:a05:6000:1869:b0:39a:c9ae:a198 with SMTP id ffacd0b85a97d-39c2e5f512fmr4586418f8f.1.1743717954850; Thu, 03 Apr 2025 15:05:54 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c30226ecdsm2910634f8f.99.2025.04.03.15.05.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 15:05:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Pierrick Bouvier Subject: [PATCH-for-10.1 v3 18/19] tcg: Factor mttcg_init() out Date: Fri, 4 Apr 2025 00:04:18 +0200 Message-ID: <20250403220420.78937-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403220420.78937-1-philmd@linaro.org> References: <20250403220420.78937-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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;