From patchwork Mon Jul 18 13:59:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 591457 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5817:0:0:0:0 with SMTP id j23csp3039946max; Mon, 18 Jul 2022 07:07:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9OKwqZSw+5D/xOO1X7YK0ZMe9zyGSi4Nz94HPsjM3uttPW/3VLNjeQh+/FEe6UNdhsxY/ X-Received: by 2002:ac8:5f0a:0:b0:31e:b219:1d4b with SMTP id x10-20020ac85f0a000000b0031eb2191d4bmr21274569qta.640.1658153251773; Mon, 18 Jul 2022 07:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658153251; cv=none; d=google.com; s=arc-20160816; b=E2Qen7VAE0L96CSk/pfM9iioLvIzd1Ki1GuPADp1qG2ZAsSZzIt4eC6KIFntKxWP0T tObfJ0RQsLx31LNmmZB6q2slX5dzinqslGOFlXpS/jXsDUNfxqVCDsSSj3tPeFALkERm Rr33xr3EQgOXd6RdD5SKnhYCrTCIcVadBOiO7c6frR90cLOQ7uS1n46EnW7f4ph00jYA vlSBahr0kS58KZu5V1aS6aK8v784PUK7LqzdivEokiJY/W/tbKZqwoZ2f5JMryUiYhko jwEyr6yw127tW82pcD885+kUyxAu0tqVXx1lMjK9FA3TwPIMoCXH5ateg0Z7HWwYz5Gf GX5Q== 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:to:from :dkim-signature; bh=NsboqJpMKAMO89QQrdUhOCnjGLwfFQBesnrYOdMQBAo=; b=Kb5lTHe1Czpg5ub9RifEuPLCXJTe/fOPvzrnkKx+IG6lgAqajLz8L8xmyncXZrvrq2 in+KrDu1tePRhG2vVdwi5ApXu7z5yv9zifLvCmVBUuhSVXPsUkuOS/gxlJBmYfXx8RF4 jFXMBO8y0jnaVESMJcuf5PtiVE7bKa/TL0a+QkKI2kLOHnButUhe91z6f+COqz2l+umd RPnsAefNR1BzusWcoJhAvLVnW85axec0t+AcENYZ4wkRkCNUVIFWhTRgqTGGjFZVRPPv 2Otad0WzI1m/WeSrByIyYagsteyybz4eDwcU7ZddtrRMp4H3MoJdvUym/Gicpz7iJPKT QJ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HkEFlE6T; 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 o14-20020a0562140e4e00b00470bd4031a9si5317576qvc.194.2022.07.18.07.07.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jul 2022 07:07:31 -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=HkEFlE6T; 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]:41976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDRPH-0002ar-Az for patch@linaro.org; Mon, 18 Jul 2022 10:07:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDRHW-00026V-9y for qemu-devel@nongnu.org; Mon, 18 Jul 2022 09:59:33 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDRHT-00039y-Jz for qemu-devel@nongnu.org; Mon, 18 Jul 2022 09:59:29 -0400 Received: by mail-wr1-x42f.google.com with SMTP id r2so16171812wrs.3 for ; Mon, 18 Jul 2022 06:59:26 -0700 (PDT) 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=NsboqJpMKAMO89QQrdUhOCnjGLwfFQBesnrYOdMQBAo=; b=HkEFlE6Txn+bMsrHiVPvLYMTaS5QJUZBXQaX+YjkAH7MHLrqgwejvKkEFdp3xnFzu5 Ch+BgFRgz+ZZZyKLrdanlagQGFgcdRPzQ/I0nzbd3TiFccvr79RcoBIejA5+QN8ChvI/ SP2IL1dTu77fgDcGqVFCjbk9GATZEtlUN0Gn/UJcF+W1UASFz1rlRFCgcNoO6n8BeQdb 9ShR59Q2RJ2dPms/6wWZkGZPv+qFGSoK8HITQPbphxgKGbJ/zKZywvbyrZzygWK5qMEv 1WOlmtIeFQlRDGC8DVvaTPtadRUz9jeJhWKgSAfNv6X3sJ9WsA/vo+9cDZVm+JD1f3v/ n5ew== 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=NsboqJpMKAMO89QQrdUhOCnjGLwfFQBesnrYOdMQBAo=; b=FWpMULss9WDYdEah0t/NF0i5IL74fAMWEQ7GCdAD6llZG4ltGFkqpBq4zCQtppPaUw Q07teAwcHiXG7aZX7egmsXPKgPon64oDDoTAFydvGuesOPqwOoCA9B6BvEIiMr9hFjEf GH0/mQPEbgfQW5dlvzoV/4aeMtLXijN81yYI+fWCyvt1nmxO1S7Vp6xMYfxwIBhOQz65 cPOqc2kSOqvNsJeYGs/7qaQ0uOXgB2Aw2Rml7j5vDUcSvVtO2DJa4D888enjaKBuXjuP YFkHuN+EECc22jO+Z0l+E8cmvwGIY7wmoOeGgaJ98y4tAv/pA89ltGiHSG6kpf+FQif8 7c5Q== X-Gm-Message-State: AJIora/GaXkq+QyO0c/ngRKtKznIL2ZjN7bfaBQMq2bgxCE3h48LkBBm PJaqITHUNVlQiggNcfHpyVwgvxeBmaSEBg== X-Received: by 2002:a5d:4e0f:0:b0:21d:8ca4:2563 with SMTP id p15-20020a5d4e0f000000b0021d8ca42563mr22872447wrt.272.1658152765531; Mon, 18 Jul 2022 06:59:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id id15-20020a05600ca18f00b003a31f1edfa7sm1805798wmb.41.2022.07.18.06.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 06:59:25 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/15] target/arm: Fill in VL for tbflags when SME enabled and SVE disabled Date: Mon, 18 Jul 2022 14:59:07 +0100 Message-Id: <20220718135920.13667-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220718135920.13667-1-peter.maydell@linaro.org> References: <20220718135920.13667-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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" From: Richard Henderson When PSTATE.SM, VL = SVL even if SVE is disabled. This is visible in kselftest ssve-test. Reported-by: Mark Brown Signed-off-by: Richard Henderson Message-id: 20220713045848.217364-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/helper.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index cfcad97ce07..6fff7fc64fd 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10882,13 +10882,19 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, } if (cpu_isar_feature(aa64_sme, env_archcpu(env))) { int sme_el = sme_exception_el(env, el); + bool sm = FIELD_EX64(env->svcr, SVCR, SM); DP_TBFLAG_A64(flags, SMEEXC_EL, sme_el); if (sme_el == 0) { /* Similarly, do not compute SVL if SME is disabled. */ - DP_TBFLAG_A64(flags, SVL, sve_vqm1_for_el_sm(env, el, true)); + int svl = sve_vqm1_for_el_sm(env, el, true); + DP_TBFLAG_A64(flags, SVL, svl); + if (sm) { + /* If SVE is disabled, we will not have set VL above. */ + DP_TBFLAG_A64(flags, VL, svl); + } } - if (FIELD_EX64(env->svcr, SVCR, SM)) { + if (sm) { DP_TBFLAG_A64(flags, PSTATE_SM, 1); DP_TBFLAG_A64(flags, SME_TRAP_NONSTREAMING, !sme_fa64(env, el)); }