From patchwork Mon Sep 18 16:02:47 2023 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: 724167 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1774627wro; Mon, 18 Sep 2023 09:07:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFh1YAutIuznu4Jj54kTEj3TpFK3ZyAqPtpUuaepdIi2K2Or76f5uvqNbvkvuA8hQGYpTeb X-Received: by 2002:a0c:c20e:0:b0:649:cbd0:8124 with SMTP id l14-20020a0cc20e000000b00649cbd08124mr8543123qvh.36.1695053230719; Mon, 18 Sep 2023 09:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695053230; cv=none; d=google.com; s=arc-20160816; b=kocVNckGtdQGOJJ9/ul1/Utmk/1oBQfCRuOxbuu2ptzx3NqSgCivrwO4eCIcynRMo6 ZLBJARa+yVnuXf/JXsTwG5OfQGEJa1dwhLC63o7Zfo90wKeT0dUaYciVZ72usfxGf8Bu DstO7nhlrw50hPR+EnSetCeQevmWfmOb2iv42tQAg7Y25s/bL4SVGRi7bqnqNdFBYAj9 sDz8LcjUF6AW1qLb7GtoHTX5RZlPbE8hrl5f9jWnbFlt5z7nS6vWTVgbuBrHx9Fi/mID tkVDZOyQ7WyY7ilCsC04tUb9w75D6DnQFbq7cE6axp8sPdH15VXaIplr0tt4yQ8T52SE /7hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=wbLvVhCdjkLoKVSI3XlIe8h3b/C8JwK6Lt4fUZyBeQw=; fh=AIYNAcrfQPdTp+tiOBYg2bCy2NfWRbXD73JV9SLWbpM=; b=Hpiei233RaIpFMh/sLj6UKaItxqe/5qJmeRpQh6MMg6jRuJjGwL4SZDVEPoCWd6kgo p4dwqbfSuLA82TkoTOmrEkIhx6t7aa3MALJpQAYcrxkD6hGe+vbStbND3wO/WDYKLU9S 3BYtv4Lbkb/LrvBpNfbTaAnj7LXL+Q+4/Zwitdz1rNxOBuNAkFJ+Hr/2of/Qf9fF68Qm M3tu34AMqGfAW9/lYAs7eHEsN0hTxKYqqFGrSH40LUQf7drK9iNOBxdMmMYc28y1TuRa BnCUxCBwh7+pDxmHQ02oh1e9R1Mmxupu9IYvWDAhM0KSzGTXAH93vsmtxHNKWtKpXUdS kZWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V0iqI4zg; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 27-20020a05620a041b00b0076ca9e2bb02si1744052qkp.653.2023.09.18.09.07.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2023 09:07:10 -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=V0iqI4zg; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiGjf-00007j-RZ; Mon, 18 Sep 2023 12:04:31 -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 1qiGjS-0007PC-PS for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:04:19 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiGjQ-0004I9-U4 for qemu-devel@nongnu.org; Mon, 18 Sep 2023 12:04:18 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-99c93638322so1017463666b.1 for ; Mon, 18 Sep 2023 09:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695053053; x=1695657853; 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=wbLvVhCdjkLoKVSI3XlIe8h3b/C8JwK6Lt4fUZyBeQw=; b=V0iqI4zgmbH3azcccW0GIBj6HlM8i22KIzHbm6K6rumEG0oY1GY87AlRETOl4XTytf OtiQvPsn9DhLapD6rn4emW4CQBu0fM3uc6pRvZjBoUOC0ruZsJvTH5nEGf/ovgajk1xS mMikm/hUbXwMWaN1G76D3zqkZd0GJOQw9R2mxRXXY93NIlpkIk0mTM8tPqAotly7HdSK GFeQtpnlb+ehlhJoTVRbCDPaTe2IDMyphu87WQlxwtu6+5b0zCLBUbwnqIJl9+rC2ST2 YlBO9FvMdhUI0TTGqyJUSK+x79QQAS24DL+aN344kD7FB5t1EDPO5EJQ7yKuRCPCAcVV BjjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695053053; x=1695657853; 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=wbLvVhCdjkLoKVSI3XlIe8h3b/C8JwK6Lt4fUZyBeQw=; b=bxyiMwGsv7K0fAlr2g/BkZllruQD+2FfsfVwTx7zlBLL+xEF8ZI1cu+pRaiPdlgLgf gv4GRtNwb/1TJvwWEUTaY0ZvYcKkc3nOsv6/H+oS8rPK0zc1ZN8Vt1BbDeiwf7co0vtr VCysifFYoWyKxnNm1U9JAX2Iba6tebdA9Rugq758A49Fubx59mRLnk5ThKXCNjQUssa1 tkdGbk9XrAgAqBYdkV2rVSagh7RWlWEC6S9hq9uNCyqIYIbEvhQkY5iUBL3ZkxOdx8kC rv9sbQ1EXsqqNmcZ6kMlNaZ5ZgKSHsc53j3U18UHfC7jyvxsEUMk2ZKAvv6AV8nY6wWW UAuw== X-Gm-Message-State: AOJu0YyPmQMgGudU099IjDxGVR1Mc0j0KDFO8Yuuo7lhnoN/C4p/yltK J25Upn4vgcXzMXUX01vWxdDbEITp4H8xZv96alz7COfq X-Received: by 2002:a17:906:311a:b0:9a9:f0e6:904e with SMTP id 26-20020a170906311a00b009a9f0e6904emr154241ejx.16.1695053053645; Mon, 18 Sep 2023 09:04:13 -0700 (PDT) Received: from localhost.localdomain (static-212-193-78-212.thenetworkfactory.nl. [212.78.193.212]) by smtp.gmail.com with ESMTPSA id n26-20020a170906119a00b00997cce73cc7sm6586020eja.29.2023.09.18.09.04.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 09:04:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Paolo Bonzini , Max Filippov , David Hildenbrand , Peter Xu , Anton Johansson , Peter Maydell , kvm@vger.kernel.org, Marek Vasut , David Gibson , Brian Cain , Yoshinori Sato , "Edgar E . Iglesias" , Claudio Fontana , Daniel Henrique Barboza , Artyom Tarasenko , Marcelo Tosatti , qemu-ppc@nongnu.org, Liu Zhiwei , Aurelien Jarno , Ilya Leoshkevich , Daniel Henrique Barboza , Bastian Koppelmann , =?utf-8?q?C=C3=A9dric_?= =?utf-8?q?Le_Goater?= , Alistair Francis , Alessandro Di Federico , Song Gao , Marcel Apfelbaum , Chris Wulff , "Michael S. Tsirkin" , Alistair Francis , Fabiano Rosas , qemu-s390x@nongnu.org, Yanan Wang , Luc Michel , Weiwei Li , Bin Meng , Stafford Horne , Xiaojuan Yang , "Daniel P . Berrange" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Jiaxun Yang , Richard Henderson , Aleksandar Rikalo , Bernhard Beschow , Mark Cave-Ayland , qemu-riscv@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Greg Kurz , Michael Rolnik , Eduardo Habkost , Markus Armbruster , Palmer Dabbelt Subject: [PATCH 14/22] target/sparc: Init CPU environment *after* accelerator vCPU is realized Date: Mon, 18 Sep 2023 18:02:47 +0200 Message-ID: <20230918160257.30127-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918160257.30127-1-philmd@linaro.org> References: <20230918160257.30127-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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=unavailable 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 These fields from the environment don't affect how accelerators create their vCPU thread. We can safely reorder them *after* the cpu_exec_realizefn() call. Doing so allows further generic API simplification (in the next commit). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sparc/cpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 2fdc95eda9..88157fcd33 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -756,6 +756,12 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) SPARCCPU *cpu = SPARC_CPU(dev); CPUSPARCState *env = &cpu->env; + cpu_exec_realizefn(cs, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + return; + } + #if defined(CONFIG_USER_ONLY) if ((env->def.features & CPU_FEATURE_FLOAT)) { env->def.features |= CPU_FEATURE_FLOAT128; @@ -776,12 +782,6 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) env->version |= env->def.nwindows - 1; #endif - cpu_exec_realizefn(cs, &local_err); - if (local_err != NULL) { - error_propagate(errp, local_err); - return; - } - scc->parent_realize(dev, errp); }