From patchwork Thu May 19 17:36:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 574226 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1f0e:0:0:0:0 with SMTP id hs14csp1549294mab; Thu, 19 May 2022 10:49:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOq6lKTgKtHp6qTmBD2rfGBlaWXZMJ4qDdrYtUPGcJTUpBjm5eDxCXH/RNNzJcSH66ENxH X-Received: by 2002:a05:622a:144c:b0:2f3:d8e1:99b4 with SMTP id v12-20020a05622a144c00b002f3d8e199b4mr4924468qtx.160.1652982549667; Thu, 19 May 2022 10:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652982549; cv=none; d=google.com; s=arc-20160816; b=dB6eyZ0GikXVreiQo6ONz21/dIVFKAC4fBc/kuLu2taQjjNPFJddYFtFfmZ1EBNy4b QsM5Yu85U9n1zL2mvFmqCvDnRtlYv9kKpODrDVV3IP2D+Dk/Bg5gSayzH/lE6DrkfwCD cOw4p7GgFYAQkLA8rbfG8jp1M/IOnzdYM4ej6Gb+oNbgr/24WssGmXGS+bsBQVMNNWo7 b2mjvklZbxxieUVavr2NEc8OF8Tazrll5JoFeHFaimoPLzPdhwHtGPmo8kQgW87ST2dp TwX74sNLGHWMwvcni3/z/uLWbS1VtEqOVt6PT9mADvt7WRCDC7kMJFggm8X7bW3HRaz7 yGzA== 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=BL/qXB6/zju0unYgvtD/Wyfgy5SQeOGuUnN/S+CQN+U=; b=FgS9/CP73HndwOF7hhfIVvmJW4/2vxIgmXaP286weRZfEJ5OtVbU+nZk82yHJkkr38 oqHZmxyiyK2QfMj3Xxn91NtiSgInE/Y/XRicIUu26nw2eBC9Lqx34OQ8ZrsUG2KKKwQm eXihWX9L1FxlGrucdJQ2DQ8t+tW0qJSYf5EnlZKCfn6YH1QeFPHsLJMn1tZ7Y9+r3G0G PTp6BinodgG41G24mA1RS+yIVQnDEeK4e/4Anitvy5k+TVcrCo8D39lzdzAjtVA+eUJA SfOy8kNETC7Ngbq3Ltc5xXRlIgOXe4vW9fEloKjTeyM+tzsG5tJ0u0db2q9R8MyWvdCI QlRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G2yHKUZI; 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 i13-20020a05620a27cd00b0069f6a659c49si1423510qkp.351.2022.05.19.10.49.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 May 2022 10:49:09 -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=G2yHKUZI; 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]:54324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrkGr-0002YG-9L for patch@linaro.org; Thu, 19 May 2022 13:49:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrk56-00062t-S0 for qemu-devel@nongnu.org; Thu, 19 May 2022 13:37:01 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:45038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrk55-0000qE-6Y for qemu-devel@nongnu.org; Thu, 19 May 2022 13:37:00 -0400 Received: by mail-wm1-x32d.google.com with SMTP id k126-20020a1ca184000000b003943fd07180so3078067wme.3 for ; Thu, 19 May 2022 10:36:58 -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=BL/qXB6/zju0unYgvtD/Wyfgy5SQeOGuUnN/S+CQN+U=; b=G2yHKUZIPuOHRY4+AAsTXh9rVXfYdP4KAunqZVauxsI9VUyvQbljb7p8AppMQb70WR mJ7HhzHvqmy37YeVQlFdpqjFnjvoe+eXzmdEyki0C1HBubYUk1zqVX+EtW9IUo0DcIDH R2YH/SyvuHSogEkdkcl/Zvw7is65NuQpuNSAme+of4h6W+y5Yt+5VzbspQynPzD2zlIY SvUU+C/1EPVylrkzlbxZwtrQaE+reJQkM0qZLs36zttfq6IlhiHdjm4MYgcs1BbVG8Sb MtuH8uo+kGg4z8wFhSQXWDpBzP5BQdpLWC2XXY1egc9PD3UoUGgOUO3IVgcZEDXsbTMx KdzQ== 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=BL/qXB6/zju0unYgvtD/Wyfgy5SQeOGuUnN/S+CQN+U=; b=gS8dZEqdJYMVfKuVJBdXk6BYRS1djD02POIsulM6mauqFoHOd1ccCsxN/u+NCjmHAC 94/Y5ScIpr/jXQadYeLmlUS3rMf5SMDakV/1sB2d6x4K34k2paK7dPywWfGRaOIx+5Yh zUtuqN6tLaFUY6NfAUjb1zQc83GjV+QaWV25tyI3fJiVyQSPsW4q8Y4mDWiPVhJvXvie U2w5x8+hTHKfdeuZwUdLZ5oFkQSStgCTXumCQbtuJX20j35TIAsNu0/IJizmXDOqNlnR 7D2+UoVMXjU1Nc19h29dRNHUem5aIsYFxcutpDTNOWo9430uYGYLXZiJ4vBDBdRMXRGn ScPQ== X-Gm-Message-State: AOAM530TYF9iMVv1kKRpgdVJNx2+cQa+qwE41ukj4J0LpaWwVmtawJau /1OKKTW9ds/UQgjz4J98pH6VrMCuzTp3BQ== X-Received: by 2002:a05:600c:1e23:b0:394:6133:a746 with SMTP id ay35-20020a05600c1e2300b003946133a746mr4712999wmb.17.1652981817036; Thu, 19 May 2022 10:36:57 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e2-20020adfa742000000b0020c5253d8f2sm180183wrd.62.2022.05.19.10.36.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 10:36:56 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/22] target/arm: Enable FEAT_S2FWB for -cpu max Date: Thu, 19 May 2022 18:36:33 +0100 Message-Id: <20220519173651.399295-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220519173651.399295-1-peter.maydell@linaro.org> References: <20220519173651.399295-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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" Enable the FEAT_S2FWB for -cpu max. Since FEAT_S2FWB requires that CLIDR_EL1.{LoUU,LoUIS} are zero, we explicitly squash these (the inherited CLIDR_EL1 value from the Cortex-A57 has them as 1). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220505183950.2781801-5-peter.maydell@linaro.org --- docs/system/arm/emulation.rst | 1 + target/arm/cpu64.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 8ed466bf68e..8f25502ced7 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -52,6 +52,7 @@ the following architecture extensions: - FEAT_RAS (Reliability, availability, and serviceability) - FEAT_RDM (Advanced SIMD rounding double multiply accumulate instructions) - FEAT_RNG (Random number generator) +- FEAT_S2FWB (Stage 2 forced Write-Back) - FEAT_SB (Speculation Barrier) - FEAT_SEL2 (Secure EL2) - FEAT_SHA1 (SHA1 instructions) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 04427e073f1..e83c013e1fe 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -812,6 +812,7 @@ static void aarch64_max_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); uint64_t t; + uint32_t u; if (kvm_enabled() || hvf_enabled()) { /* With KVM or HVF, '-cpu max' is identical to '-cpu host' */ @@ -842,6 +843,15 @@ static void aarch64_max_initfn(Object *obj) t = FIELD_DP64(t, MIDR_EL1, REVISION, 0); cpu->midr = t; + /* + * We're going to set FEAT_S2FWB, which mandates that CLIDR_EL1.{LoUU,LoUIS} + * are zero. + */ + u = cpu->clidr; + u = FIELD_DP32(u, CLIDR_EL1, LOUIS, 0); + u = FIELD_DP32(u, CLIDR_EL1, LOUU, 0); + cpu->clidr = u; + t = cpu->isar.id_aa64isar0; t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* FEAT_PMULL */ t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); /* FEAT_SHA1 */ @@ -918,6 +928,7 @@ static void aarch64_max_initfn(Object *obj) t = FIELD_DP64(t, ID_AA64MMFR2, IESB, 1); /* FEAT_IESB */ t = FIELD_DP64(t, ID_AA64MMFR2, VARANGE, 1); /* FEAT_LVA */ t = FIELD_DP64(t, ID_AA64MMFR2, ST, 1); /* FEAT_TTST */ + t = FIELD_DP64(t, ID_AA64MMFR2, FWB, 1); /* FEAT_S2FWB */ t = FIELD_DP64(t, ID_AA64MMFR2, TTL, 1); /* FEAT_TTL */ t = FIELD_DP64(t, ID_AA64MMFR2, BBM, 2); /* FEAT_BBM at level 2 */ cpu->isar.id_aa64mmfr2 = t;