From patchwork Mon Jun 20 17:52:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583212 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp962655mab; Mon, 20 Jun 2022 12:03:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sn343ehmwuPkdw10H2z3AWDyPZBS2YN6nD0+fLlrXjXp7cUTUjbUiNwb3uWpH+XB9PcniI X-Received: by 2002:a37:c20a:0:b0:6a6:bfa7:ca5a with SMTP id i10-20020a37c20a000000b006a6bfa7ca5amr16629647qkm.283.1655751838219; Mon, 20 Jun 2022 12:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655751838; cv=none; d=google.com; s=arc-20160816; b=Y4MQM5M6mJGuQBhv4aGdw3Klr32NSdCt0Pdea0XLEQstNN4JbaBuqzKzGzOHq8B4bx LkQByCsmcbpbuLrmNCVT33PfXlZXuJVYWQ2OIUEvALpurdp5soX/dsPLY9kr1uHkunSw VPCsvcTBT2lqpEJuqbGQhrwLzX1GREzm1i9VVJwoj8FOXrXa6egu+dxRd9YvV994wSTt nSdz89XNQz7qRMesqa87P3YM//ONj+1Y3COQUsEq75r9H6Fm4z9xfnU3ZvZ1+uKhtf18 ejIadxMTexIGzANOFZmXGWLHucD2j/TLmML1vuAoYMpcipCRypeqpKjZ5S0/rFPAFIKo cfLA== 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:cc:to :from:dkim-signature; bh=3nuS/o5N0jY1sctqPNAwUS/VxwGp/HFm2vpuT3BHgTM=; b=A8Ny/LP+UQTHYp6vIx0aSAr5OJkhCasLPr7fu0z9dVexf5E7BMW77YSZ2Wp6cOqy/O SWOzsw/iMrc4viJnm09181rQccyBzyjb6KL1xupUA+JsF24+YaCUmhf/Rhzja3UkyMCL Ru5btYRciWhYyaJO8n1M2afelXaPtEfqy6MgLPK9X1ES2aSkLRSNCUje7RRDQO+q9Qru QZxJLSsnLeZdyw6MTktxCdgb+T2uJgcy8usQhPa68ygvmiT4Xo+2nqenOmIlJ0v8espT SMY+sm2hLae1KsvLStM07+7W8cxf9K7YM7Y//aPb5fIvZ3BWbREQ2GSmGfDa6ayf6zQx Jkmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gACsrSkE; 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 az39-20020a05620a172700b006ab91fc8f6fsi7933854qkb.523.2022.06.20.12.03.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 12:03:58 -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=gACsrSkE; 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]:57470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Mgl-0001RP-Iq for patch@linaro.org; Mon, 20 Jun 2022 15:03:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3LaO-0006OX-C0 for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:53:18 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:42726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LaI-0001Ws-0f for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:53:13 -0400 Received: by mail-pf1-x434.google.com with SMTP id d17so1903664pfq.9 for ; Mon, 20 Jun 2022 10:53:09 -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=3nuS/o5N0jY1sctqPNAwUS/VxwGp/HFm2vpuT3BHgTM=; b=gACsrSkEIbXBFWUJ0MTV1dinp9/Zho40qd5qjo8gEHGdmZitXiMl8l0LvRS0bU9a6R cJJFlA15xZ9esKRj++CcyoyVAuXpkKrZF0BoJD/6qzZM+kMNeLMZT0OdOKjP459UA4dn aJyl7CytzCEhlCjkNzlW4ToXqKkrtJhqJJ3NBTChm5DWpFBGyxuHf9bpBsPala9Q5Cgf F6Wqy17oW7JJ+CETvVbFDoro5ToWI8ZQ+ml9I783aaOcu00cq42ppZBEUp2zC4Y7tvW0 pLoGwHg6pqqf76kMGPC9T9ab0S17Fv6okV4pbzqhI79sliOPy6G54bNV6cW/q5z7iqVy IYHA== 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=3nuS/o5N0jY1sctqPNAwUS/VxwGp/HFm2vpuT3BHgTM=; b=XoGrjXrmCEQtXzZnB4DLz58lqiRPkwD4TwJEnQyhClgfcjS2d13qWMtXIf90IDAfoQ lxqJ99ladb4jVDmglUSCpJBRggicuH5EELsOPKtrvd0Z6GE8AZsarz8xFBAZpYBdTzoN wI5ldPxRXLfpSOVmFtHY8pnEisdvezXwtnxfOH855GB3AMc149h++kil+Z48OGk3JnRz Sxndh3Jtifmeq81qBqIj+DJf/LpT+u19cJMi1Em30VdAprHuORgjWhqqobBSSUtKjTAV m8h2wb26FKDnAH9I4Tp8PjBk+AY79/urAC614l6yOwAa8aTO33gAx2bufUIKDxfeunV/ kuow== X-Gm-Message-State: AJIora/FTTZrdOJinM6ASAtRNorgtIumOcCoA870ZM0QmvBC405jT1Xm /RizIFilOsP4SiHiGh735WuHfWdgDAWMjg== X-Received: by 2002:a05:6a00:21c8:b0:4c4:4bd:dc17 with SMTP id t8-20020a056a0021c800b004c404bddc17mr25931294pfj.57.1655747589237; Mon, 20 Jun 2022 10:53:09 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:a3e0:8a80:7b85:aea6]) by smtp.gmail.com with ESMTPSA id j14-20020aa7928e000000b00525133f98adsm5138138pfa.146.2022.06.20.10.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:53:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v3 38/51] target/arm: Enable SME for -cpu max Date: Mon, 20 Jun 2022 10:52:22 -0700 Message-Id: <20220620175235.60881-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220620175235.60881-1-richard.henderson@linaro.org> References: <20220620175235.60881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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" Note that SME remains effectively disabled for user-only, because we do not yet set CPACR_EL1.SMEN. This needs to wait until the kernel ABI is implemented. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- docs/system/arm/emulation.rst | 4 ++++ target/arm/cpu64.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 83b4410065..8e494c8bea 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -65,6 +65,10 @@ the following architecture extensions: - FEAT_SHA512 (Advanced SIMD SHA512 instructions) - FEAT_SM3 (Advanced SIMD SM3 instructions) - FEAT_SM4 (Advanced SIMD SM4 instructions) +- FEAT_SME (Scalable Matrix Extension) +- FEAT_SME_FA64 (Full A64 instruction set in Streaming SVE mode) +- FEAT_SME_F64F64 (Double-precision floating-point outer product instructions) +- FEAT_SME_I16I64 (16-bit to 64-bit integer widening outer product instructions) - FEAT_SPECRES (Speculation restriction instructions) - FEAT_SSBS (Speculative Store Bypass Safe) - FEAT_TLBIOS (TLB invalidate instructions in Outer Shareable domain) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 19188d6cc2..40a0f043d0 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -1018,6 +1018,7 @@ static void aarch64_max_initfn(Object *obj) */ t = FIELD_DP64(t, ID_AA64PFR1, MTE, 3); /* FEAT_MTE3 */ t = FIELD_DP64(t, ID_AA64PFR1, RAS_FRAC, 0); /* FEAT_RASv1p1 + FEAT_DoubleFault */ + t = FIELD_DP64(t, ID_AA64PFR1, SME, 1); /* FEAT_SME */ t = FIELD_DP64(t, ID_AA64PFR1, CSV2_FRAC, 0); /* FEAT_CSV2_2 */ cpu->isar.id_aa64pfr1 = t; @@ -1068,6 +1069,16 @@ static void aarch64_max_initfn(Object *obj) t = FIELD_DP64(t, ID_AA64DFR0, PMUVER, 5); /* FEAT_PMUv3p4 */ cpu->isar.id_aa64dfr0 = t; + t = cpu->isar.id_aa64smfr0; + t = FIELD_DP64(t, ID_AA64SMFR0, F32F32, 1); /* FEAT_SME */ + t = FIELD_DP64(t, ID_AA64SMFR0, B16F32, 1); /* FEAT_SME */ + t = FIELD_DP64(t, ID_AA64SMFR0, F16F32, 1); /* FEAT_SME */ + t = FIELD_DP64(t, ID_AA64SMFR0, I8I32, 0xf); /* FEAT_SME */ + t = FIELD_DP64(t, ID_AA64SMFR0, F64F64, 1); /* FEAT_SME_F64F64 */ + t = FIELD_DP64(t, ID_AA64SMFR0, I16I64, 0xf); /* FEAT_SME_I16I64 */ + t = FIELD_DP64(t, ID_AA64SMFR0, FA64, 1); /* FEAT_SME_FA64 */ + cpu->isar.id_aa64smfr0 = t; + /* Replicate the same data to the 32-bit id registers. */ aa32_max_features(cpu);