From nobody Fri May 17 04:49:47 2024 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=1654445636; cv=none; d=zohomail.com; s=zohoarc; b=oHXRqJLqMuimeJefq7ihzepvpEIzlOZqd7UFfrodSPJJYFC3oVlTz+p7MQpLDgG9wNjddbTclNgvjoW6qbMHH4Xe2kHr6yZ5qMP6Co30Bds/U/KmLICd56xKD5VgLaOYPzWi1Sb5gelFRuGe01HecX43ErwGHRYaNVs+dBRKyyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654445636; h=Content-Transfer-Encoding:Cc: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=iqQPbLsPrzF0qGrl4axrKNTY+phxkKEzhj1J8cCkxoQ=; b=Pne5wKxLHHhmqnCr8FNdHnCx3jEmjqWmlHu3WzLSK45yYb+oNW3lRhgacKnSa3UYaYnzao+BOcPtRG9RuAa/aNwOs9zCc2waUCaS1seotmxOxnc87d4c7p7h2njj6YVF88XU9hEIBXaWyR2P6OeErMQ3h6aE0fypdqw60hOit2M= 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 1654445636080967.8624860609; Sun, 5 Jun 2022 09:13:56 -0700 (PDT) Received: from localhost ([::1]:34276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxst0-0006Fr-UX for importer@patchew.org; Sun, 05 Jun 2022 12:13:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxsqH-0004Wg-Ei for qemu-devel@nongnu.org; Sun, 05 Jun 2022 12:11:07 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:35436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxsqD-0000TZ-Hp for qemu-devel@nongnu.org; Sun, 05 Jun 2022 12:11:03 -0400 Received: by mail-pf1-x42d.google.com with SMTP id u2so10946682pfc.2 for ; Sun, 05 Jun 2022 09:11:01 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3fb8:a3e1:bf34:75a2]) by smtp.gmail.com with ESMTPSA id q133-20020a632a8b000000b003c14af505fesm8932165pgq.22.2022.06.05.09.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 09:10:59 -0700 (PDT) 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=iqQPbLsPrzF0qGrl4axrKNTY+phxkKEzhj1J8cCkxoQ=; b=eX2ihOlpOZu2KHa9CebndWbYptvAxmnxluUuul5a1H+CBTyEj7R5y0Wy33/ky2nlkX zZFJ/TZ6evTjSsdXLHzUv6/osP/rPvnYA5ZGO0peiP1tVzNavCfxkMFzbWyX32V2sDKW JoKr012LKKcSCEuEroC05m6rV/FvhvSC9ysPLpQ4+ODk6navvTkxZvrA+YVO2luJ7E0t vXh9UXt+fBNBWW5yeKXSq/TSn1XrVK+TNxNFX71i0N8817mJnuktX29+2LnGlPdFkTLM +9KA4WXtibk+NIhXlGKQtQBIZLKQ/s2kdCl+bayFZ8zw0OQdGtBmwD3JfaLGG0EsyhFx VsfQ== 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=iqQPbLsPrzF0qGrl4axrKNTY+phxkKEzhj1J8cCkxoQ=; b=u5yqGS54QuEcE6usVfMjTt08u3d4rPx9OOH6rV0wOI432u8aNbrMw7yQ+vPOplERdi DO5Cn3yB1NGB68/FTIhzFZCF9kEeLyvlDQLTqTH+YQrFid+PRh91bx6cDnSDMznaWfyD wVJdgZRE4JdPC6c7PlQIxRP2EkzFg09DLisa7ctIAq2jdi6RpgFLFxboN7A3wAeeOT1g 2Vj4Dfr2/HmgWGdG/YvpRosWBlySAX2AtP+XnvMZqCC3tyL9MYJACVdkgRUWJS9mgWQO 5XDUmVfdrwCbTL4NwS0uGGWezX83x+iyGQGAa9TE+LZodfWdBYI7tOfFju/+ciEDID8D U5Zg== X-Gm-Message-State: AOAM533xQWbUs/50qD5F4JdFtjHk68O9kwo9pXDpwB8D6ZEfdA8+7wzg 3LnmiTzXNAP1TywI06qntYKHeApzNDWTUw== X-Google-Smtp-Source: ABdhPJy0sMqKT2fS8zPHBhUCzkraaccYKVBwPXztlqICxeSM1e8iG0oxX5wQakHGSUzVB756yIDeTw== X-Received: by 2002:a63:4723:0:b0:3fa:c20d:2e26 with SMTP id u35-20020a634723000000b003fac20d2e26mr17564033pga.278.1654445460234; Sun, 05 Jun 2022 09:11:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 1/2] target/arm: SCR_EL3 bits 4,5 are always res0 Date: Sun, 5 Jun 2022 09:10:55 -0700 Message-Id: <20220605161056.293920-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220605161056.293920-1-richard.henderson@linaro.org> References: <20220605161056.293920-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1654445637571100002 Content-Type: text/plain; charset="utf-8" These bits do not depend on whether or not el1 supports aa32. Signed-off-by: Richard Henderson --- target/arm/helper.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 40da63913c..c262b00c3c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1752,11 +1752,8 @@ static void scr_write(CPUARMState *env, const ARMCPR= egInfo *ri, uint64_t value) ARMCPU *cpu =3D env_archcpu(env); =20 if (ri->state =3D=3D ARM_CP_STATE_AA64) { - if (arm_feature(env, ARM_FEATURE_AARCH64) && - !cpu_isar_feature(aa64_aa32_el1, cpu)) { - value |=3D SCR_FW | SCR_AW; /* these two bits are RES1. = */ - } - valid_mask &=3D ~SCR_NET; + value |=3D SCR_FW | SCR_AW; /* RES1 */ + valid_mask &=3D ~SCR_NET; /* RES0 */ =20 if (cpu_isar_feature(aa64_ras, cpu)) { valid_mask |=3D SCR_TERR; --=20 2.34.1 From nobody Fri May 17 04:49:47 2024 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=1654445876; cv=none; d=zohomail.com; s=zohoarc; b=Bvly34CgQA5VZQGoOVxkSV0sIYy7qKw4sSbCpOd3HB5wQNi2tANqPVxlM7XHhRcZJymmL1wgT5slx4yaorrNqeK8Tycv0boI3zANWI9Tv7ZHm+AvvWrWG9LDlFdYsQ+JQT+Ncu73eafkX3Hf6yFnp5o7ppVyHElDMKqXRTOFRsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654445876; h=Content-Transfer-Encoding:Cc: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=BiCy+cPE5Fp9O9R0zWpEP/6dC1PqcMNp2AcNLHCUCp0=; b=V/SoryNHtKo/fh8kZmjEbw8eSYb07wUkapjEEO5qNqAI/IfNL0EtcT5OYUCF+iIuazh3JQFjqzwj/iplIa5+a6f/BtqHlswoL09V4iWV6omVj3odGCQxmggXxvpGYRhZsRpY5kZ1wg3+K1ynt0CtJW2y1eoU1QfwyccIdpKQY5s= 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 1654445876475425.95610815948817; Sun, 5 Jun 2022 09:17:56 -0700 (PDT) Received: from localhost ([::1]:39088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxswt-0001Dw-2M for importer@patchew.org; Sun, 05 Jun 2022 12:17:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxsqH-0004Wj-Es for qemu-devel@nongnu.org; Sun, 05 Jun 2022 12:11:07 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxsqE-0000Ti-Qw for qemu-devel@nongnu.org; Sun, 05 Jun 2022 12:11:04 -0400 Received: by mail-pj1-x1032.google.com with SMTP id j7so10999479pjn.4 for ; Sun, 05 Jun 2022 09:11:02 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3fb8:a3e1:bf34:75a2]) by smtp.gmail.com with ESMTPSA id q133-20020a632a8b000000b003c14af505fesm8932165pgq.22.2022.06.05.09.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 09:11:00 -0700 (PDT) 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=BiCy+cPE5Fp9O9R0zWpEP/6dC1PqcMNp2AcNLHCUCp0=; b=d1L4lCEgThGbpoyUeAz9yp1S+/oerstTHGDhWx2Fq+NQlyb6TXlBrhXjv2WBdBeP5o /tb9QHIGIKdZfaoRlsqzhOM3UEnq0W4zq8bXa2YUWxuFch6P4KyBwHOy7vSHGj+jjFxS eqDnFqWmBFV00krWPbRTJ/K2zLt23WcaeYo32YirjITkdTHBydlRYfs49vnNOtpBia7e m85QVjTAaNa9KKPaVJjMyL4zkj9IWdu5s/ABy17AeUfqIrw2WnYRWK8h2J8xrH1FLy+2 lYnjuY3Rhx+ccMKRcJY2e3X9nllmqJfT70Jt35zfBPiahJSMbxKX80Kmlra1ceBJcTCZ l0NA== 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=BiCy+cPE5Fp9O9R0zWpEP/6dC1PqcMNp2AcNLHCUCp0=; b=C8XO7icHIvfqujU/2JUi6tmaicUWSjb+PPV8uOKhE8Ov46Itposeg4jg6TEmDVnGNO 9jeLRhifPr9XPw1gZPrg7SR3yIi88BnI0x3KHjz523mjUvQg8WqqC44UgL53OTEpxnRs /OviNmXqMDgLTcy3I61om4kuihIMn2J4jGqHQYgGdpfiLcyp8FROD6b/tWQCx1SMe/aN SH1Bb2uYn/f4L/XDDFN1Q1x8JkAOWZ9vfxLZ9JKvGKc/DulggvO/ONLVcqw1GtD6MjdP eOdr7xi5XZmicJ/9jRVw8JUWMQH1Ldv+sekEGyh6oHjpUm83WrBfrJthbCHmTalessDI t2Tw== X-Gm-Message-State: AOAM530lrU4YV3+AznFu5qsMwFGQf68ioX//XHY+O6qke7zoKFZUf8Oz Y2n9vZJAuZryLo/F5Kg2FzKWiNjwhNH8Rg== X-Google-Smtp-Source: ABdhPJxhAlqTLLpDEKftTxcvQ9saGLIkkboPPZm0BfuXxaHljz5KlRy8me0328bZ+MW/drDFIMH/Og== X-Received: by 2002:a17:902:ef45:b0:155:cede:5a9d with SMTP id e5-20020a170902ef4500b00155cede5a9dmr20010175plx.93.1654445461455; Sun, 05 Jun 2022 09:11:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 2/2] target/arm: SCR_EL3.RW is RAO/WI without AArch32 EL[12] Date: Sun, 5 Jun 2022 09:10:56 -0700 Message-Id: <20220605161056.293920-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220605161056.293920-1-richard.henderson@linaro.org> References: <20220605161056.293920-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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=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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1654445878445100001 Content-Type: text/plain; charset="utf-8" Since DDI0487F.a, the RW bit is RAO/WI. When specifically targeting such a cpu, e.g. cortex-a76, it is legitimate to ignore the bit within the secure monitor. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1062 Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 +++++ target/arm/helper.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c1865ad5da..a7c45d0d66 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3947,6 +3947,11 @@ static inline bool isar_feature_aa64_aa32_el1(const = ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL1) >=3D 2; } =20 +static inline bool isar_feature_aa64_aa32_el2(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL2) >=3D 2; +} + static inline bool isar_feature_aa64_ras(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RAS) !=3D 0; diff --git a/target/arm/helper.c b/target/arm/helper.c index c262b00c3c..84232a6437 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1755,6 +1755,10 @@ static void scr_write(CPUARMState *env, const ARMCPR= egInfo *ri, uint64_t value) value |=3D SCR_FW | SCR_AW; /* RES1 */ valid_mask &=3D ~SCR_NET; /* RES0 */ =20 + if (!cpu_isar_feature(aa64_aa32_el1, cpu) && + !cpu_isar_feature(aa64_aa32_el2, cpu)) { + value |=3D SCR_RW; /* RAO/WI*/ + } if (cpu_isar_feature(aa64_ras, cpu)) { valid_mask |=3D SCR_TERR; } --=20 2.34.1