From nobody Fri Apr 11 19:28:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1645436934; cv=none; d=zohomail.com; s=zohoarc; b=YtPLtyFmXcRDKLCw0p+l6nctNtSLlEC5X5ZhYqhNEkAi/1HsSw1nF13PgNHZKb1qHuX7LWivCut1VGYbAP8vH7oG9ifSSuUZwaUM53vMBfSIBVAniMvTRYeYy3DS2/UZXT5tOCCW+GHSMLb7wiKX8l+7MFZO88WehDQx8So8R8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645436934; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=W6ZMdIL+a+ZBOq/2iWpxp61i5uO6O53dz60kcds51AP893GJO+w/ik32ZfJNfLXXV9EsiDVOGSyQrF9E0sodcchRyqZ/d/vXJSQVjawhVvPdrT9PMWB39+l4gERt/gPAHqLseBBrmLT0AoeFLoWpzwAeEAmIzDryUXcThLCcQP8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645436934006140.96623011875795; Mon, 21 Feb 2022 01:48:54 -0800 (PST) Received: from localhost ([::1]:40720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5JM-0003R0-Of for importer@patchew.org; Mon, 21 Feb 2022 04:48:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zM-000819-Mm for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: from [2a00:1450:4864:20::42a] (port=36530 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zL-00010b-4j for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:12 -0500 Received: by mail-wr1-x42a.google.com with SMTP id o24so25918831wro.3 for ; Mon, 21 Feb 2022 01:28:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=AobexD8k7xbR6TRSKdWQZQBOrAw+TJC6FuX3QMgKdsSAOQHO1W5+MnQ+aOIV3XPXTP aeYrNkEvXQOrHXi9kJqPR/ZL3CV+9DbguFWvTLbkg+mPK8hA8Kua6YaCbWijEf1AqNN8 2Ke/eMgomD9nTUOp+LUTBPanRWCPeHibgwz4VqVFYMe/PGfdrGMB8hiTQTE2UXE9R0qv pdIJ+cS3GuN0aC+AIByekfpZe/EWNmR+dc6MmL5tM7TFWTKwSt9qtLsIJ/60Oa3tFzWe F9n1xgvfZAIrkqdFu77jXWNcCqr5nFYpAKt2peW2iJWaBR39tBrZ0ORwxg0XwgHqerCJ z+yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FYBsoFS6jYxOCbq7ilPQhdHOnw4wYlKCWIQ28PlrxK8=; b=Szeyupvx+bun9dJeqa0zJHxQ2YPJYEb33P8JZbPCoSjYlpzdyWsJ0/oMcB3FhT2Mn6 Pg1qL5uzVgLrOpCar8uBr8WEJPJJW6BxsaJVcilNOogYZ6T5QT8LDWL4IlVdc8NTtb4j ca1QQI7VVt5zhdtIDgNNvCifQYshx5NXtBkrfFSz+DlWxNYWmclyUQaJwlrUJV4KBsb4 qw6/00xRV/a5xO3eiNNTClNqumXw1Z7qQJfo5JlRERG6VrGoOqijZhLWnCoYfBH0IkPw m9Op8EnIkFp/aFy4Sr3vZx0SihSMIgy/C4DcachWMdVA36FRKBVQzIWG/QjtsAj29V6I AX/A== X-Gm-Message-State: AOAM533XdTb70y2qEPYrcHYqE7WsTZuM9dpOj8GWgHdiGS3tddlPKXmb CR1mNJfRDAPRppCSn5WoRa+ijdIgoY2ycQ== X-Google-Smtp-Source: ABdhPJzHKih4pmsUi/nKpB/Y35vzpoDkUWw/kjgU4Iaa2lOLAbk5hKWrJxRfJoJ2cei8czJEsxTSZA== X-Received: by 2002:a05:6000:12:b0:1dd:f5db:6c0c with SMTP id h18-20020a056000001200b001ddf5db6c0cmr15487429wrx.256.1645435689830; Mon, 21 Feb 2022 01:28:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/26] target/arm: Make KVM -cpu max exactly like -cpu host Date: Mon, 21 Feb 2022 09:27:43 +0000 Message-Id: <20220221092800.404870-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1645436935042100007 Currently for KVM the intention is that '-cpu max' and '-cpu host' are the same thing, but because we did this with two separate pieces of code they have got a little bit out of sync. Specifically, 'max' has a 'sve-max-vq' property, and 'host' does not. Bring the two together by having the initfn for 'max' actually call the initfn for 'host'. This will result in 'max' no longer exposing the 'sve-max-vq' property when using KVM. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Andrew Jones Reviewed-by: Alexander Graf Reviewed-by: Richard Henderson Message-id: 20220204165506.2846058-4-peter.maydell@linaro.org --- target/arm/cpu64.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 590ac562714..ae2e431247f 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -682,22 +682,22 @@ void aarch64_add_pauth_properties(Object *obj) } } =20 -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) static void aarch64_host_initfn(Object *obj) { +#if defined(CONFIG_KVM) ARMCPU *cpu =3D ARM_CPU(obj); - -#ifdef CONFIG_KVM kvm_arm_set_cpu_features_from_host(cpu); if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { aarch64_add_sve_properties(obj); aarch64_add_pauth_properties(obj); } -#else +#elif defined(CONFIG_HVF) + ARMCPU *cpu =3D ARM_CPU(obj); hvf_arm_set_cpu_features_from_host(cpu); +#else + g_assert_not_reached(); #endif } -#endif =20 /* -cpu max: if KVM is enabled, like -cpu host (best possible with this ho= st); * otherwise, a CPU with as many features enabled as our emulation support= s. @@ -709,7 +709,9 @@ static void aarch64_max_initfn(Object *obj) ARMCPU *cpu =3D ARM_CPU(obj); =20 if (kvm_enabled()) { - kvm_arm_set_cpu_features_from_host(cpu); + /* With KVM, '-cpu max' is identical to '-cpu host' */ + aarch64_host_initfn(obj); + return; } else { uint64_t t; uint32_t u; --=20 2.25.1