From patchwork Fri Feb 4 16:55:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 539872 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp3419478imr; Fri, 4 Feb 2022 09:11:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJztKVt+T69Qlk5bbiaq3/L+uqX1OBKYFonVqBrt5RD5t500MRPsH0gSrMtilVHA0oWH00+m X-Received: by 2002:a05:6902:725:: with SMTP id l5mr93530ybt.502.1643994677791; Fri, 04 Feb 2022 09:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643994677; cv=none; d=google.com; s=arc-20160816; b=ZnpZcdO92wjnSD5gBM5CYb+kOp9zFEsCAR330S2Ao+tS5GIGpIjhVK86tQPz/fKwUX +PojStTDeNziv6fPJyfKi15tkX8YkzrM7rFJjP8tp8ohiV7UIFnJ4e3h4xlnnhQoZz1n XgXLiDNF5Kt5QhwpgWK+p4c1i6sL7v6jNHw2uDJkELvd93AoTn5wK09pQLRa67mGV5TZ wfyzyS/cezT9trXlba/xQYt7b9B2jVX2ivwdUS/BCr9A08+rhKCNC0yAIK17uFWlr8rb Iz1vB/WCUSkueg/UNn+Yhe33WpGR/2LHt0lRaD0CQ1St10eY33UFqyiA1p7qlovS000h sicA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=q3lEtc5flDNZqu3pjs5Zh2F0vIL0PpXE6vU56vUELAY=; b=f7XejUR78jtSIBN/h1hg3UjsWXFyQ5ysP0WQNuwiVScVXBJKawgRdxBlQSlOFJIjES PGZWt7Q2UQCAdFwp+o9Zp6jHVxAPRe2GMTJ6jzJf9cdnVTZfkP7CroDnY4Ok6VILNZ98 aAKGn1YjopHZi5uECA9rEkr1SOdczT11h7IOhizJDfraMmTVTxZJiuNtB3Z+W/fZhOvd TAiRZVkhwenFvb3fF4A+pe/XZg8dLJzJFcKtC+t1s7pI23gk3f1fKmrdKyVSAu9NPm+s JCAt4/Zce5U1KXcCg/8fXdS850PQZsOw41akvtW2SpPQGJxxC6OK3iyjs5QG/VTOiygJ 0M/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qMiNaxDC; 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=fail (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 r11si2067851ybu.299.2022.02.04.09.11.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Feb 2022 09:11:17 -0800 (PST) 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=fail header.i=@linaro.org header.s=google header.b=qMiNaxDC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nG27B-0002zx-6v for patch@linaro.org; Fri, 04 Feb 2022 12:11:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG1sH-0002y5-Lt for qemu-devel@nongnu.org; Fri, 04 Feb 2022 11:55:53 -0500 Received: from [2a00:1450:4864:20::431] (port=45626 helo=mail-wr1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nG1rr-0003Cg-Hk for qemu-devel@nongnu.org; Fri, 04 Feb 2022 11:55:39 -0500 Received: by mail-wr1-x431.google.com with SMTP id m14so12416793wrg.12 for ; Fri, 04 Feb 2022 08:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q3lEtc5flDNZqu3pjs5Zh2F0vIL0PpXE6vU56vUELAY=; b=qMiNaxDCdLYY+0bp2GFATzDbwVh9oh4no7rnM4RUGCQf9bqIOrLdiRabeI7iSA6RUY l21pkwzUHwxks9whV8LWWGDO/mcW94f7WkW+cG4ny82IFsweX6il0f3ZiuJfAQzgUQ25 rSyK1QNlCgao38UCh55GmWx3KuSjJwjD48EWkm8CBirFdgnIbglwbe1PVLjLM8gj7BjN L80gq5T8/4chIVC4iG7wYcMvgZGOaokWygDxKeOrBhWHEPVObG9to7eqNuVW+FrVkuWr oPy63lppSGJEbzQHJUG0gynqExMBsU0PpmtLS+vNFYA+RK5DN27xKyrIA5uk/OTo/2BX mCUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q3lEtc5flDNZqu3pjs5Zh2F0vIL0PpXE6vU56vUELAY=; b=Pqg2GmfaTEJI0gmKME388shhda8fBK/4ECeUjPABk+RzPHFPxsqjc4SOqX8dMYD486 KRvRI+SOCMSPOYXLjt+zQPz0AhWHeePeHKegCR+naXPV7+qdohqkXlBOP7jSNvH2kNg0 kV29BPmKrIuWf8tTsk9P/ObgGWyn2cDKU3f9P77Iz4PnrNwlGwmGghRKIQ/PSfmtDt4B LbXJlk3wsLCJU1gjaDkvZh4dznjPAXw63gOpOPaprDq7oLHigV+PFUhUcYmE/p7j1KYg HRlMRVC9RRhbtwJBZ48hR6hJf+DQomOqPoLtlGrtANQZAlpzZTH4+7uWL1XbaU+v+cy6 0aXw== X-Gm-Message-State: AOAM5337Z5cjaUr7JbxdhkGYfFRQwSpd9QaZNr5w5Qux4DMP/56sKS6B jgdeLNYBZz/uS/9dYnI4onJ/N8vluEBbKQ== X-Received: by 2002:a05:6000:184f:: with SMTP id c15mr3204888wri.218.1643993710666; Fri, 04 Feb 2022 08:55:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id f12sm2486254wrs.1.2022.02.04.08.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 08:55:10 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/6] target/arm: Make KVM -cpu max exactly like -cpu host Date: Fri, 4 Feb 2022 16:55:03 +0000 Message-Id: <20220204165506.2846058-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204165506.2846058-1-peter.maydell@linaro.org> References: <20220204165506.2846058-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::431 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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.001, 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: , Cc: Andrew Jones , Alexander Graf Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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: Richard Henderson --- 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) } } -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) static void aarch64_host_initfn(Object *obj) { +#if defined(CONFIG_KVM) ARMCPU *cpu = 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 = ARM_CPU(obj); hvf_arm_set_cpu_features_from_host(cpu); +#else + g_assert_not_reached(); #endif } -#endif /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. @@ -709,7 +709,9 @@ static void aarch64_max_initfn(Object *obj) ARMCPU *cpu = ARM_CPU(obj); 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;