From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.1407.1685947077440015994 for ; Sun, 04 Jun 2023 23:37:57 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: linaro.org, ip: 213.251.184.221, mailfrom: marcin.juszkiewicz@linaro.org) Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id E53D4260AD9; Mon, 5 Jun 2023 08:37:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fFaUjk3LjStv; Mon, 5 Jun 2023 08:37:54 +0200 (CEST) Received: from applejack.lan (83.21.93.182.ipv4.supernova.orange.pl [83.21.93.182]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 49C2D260B30; Mon, 5 Jun 2023 08:37:51 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Sami Mujawar , Ard Biesheuvel , Leif Lindholm , Marcin Juszkiewicz Subject: [PATCH v2 3/8] ArmPkg: add functions to read SVE/SME info Date: Mon, 5 Jun 2023 08:37:38 +0200 Message-Id: <20230605063743.405487-5-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230605063743.405487-1-marcin.juszkiewicz@linaro.org> References: <20230605063743.405487-1-marcin.juszkiewicz@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ID_AA64ZFR0_EL1 and ID_AA64SMFR0_EL1 system registers are needed for ArmCpuInfo application to show state of SVE/SME support. Signed-off-by: Marcin Juszkiewicz --- ArmPkg/Library/ArmLib/ArmBaseLib.inf | 5 +++++ ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h | 12 ++++++++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 10 ++++++++++ 3 files changed, 27 insertions(+) diff --git a/ArmPkg/Library/ArmLib/ArmBaseLib.inf b/ArmPkg/Library/ArmLib= /ArmBaseLib.inf index e37d85bee471..8b5eda337fe3 100644 --- a/ArmPkg/Library/ArmLib/ArmBaseLib.inf +++ b/ArmPkg/Library/ArmLib/ArmBaseLib.inf @@ -48,3 +48,8 @@ [Packages] =20 [FeaturePcd.ARM] gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride + +# to access ID_AA64ZFR0_EL1 and ID_AA64SMFR0_EL1 system registers +# we need to enable SME +[BuildOptions] + GCC:*_*_AARCH64_ASM_FLAGS =3D -march=3Darmv8-a+sme diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/= ArmLib/AArch64/AArch64Lib.h index 6380a019ddc5..2fd256f4acc8 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h @@ -102,4 +102,16 @@ ArmReadIdAA64Pfr1 ( VOID ); =20 +UINTN +EFIAPI +ArmReadIdAA64Smfr0 ( + VOID + ); + +UINTN +EFIAPI +ArmReadIdAA64Zfr0 ( + VOID + ); + #endif // AARCH64_LIB_H_ diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Libr= ary/ArmLib/AArch64/AArch64Support.S index a7111e51882c..c996fa8dbbc3 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S @@ -524,4 +524,14 @@ ASM_FUNC(ArmReadIdAA64Pfr1) mrs x0, ID_AA64PFR1_EL1 ret =20 + +ASM_FUNC(ArmReadIdAA64Smfr0) + mrs x0, ID_AA64SMFR0_EL1 + ret + + +ASM_FUNC(ArmReadIdAA64Zfr0) + mrs x0, ID_AA64ZFR0_EL1 + ret + ASM_FUNCTION_REMOVE_IF_UNREFERENCED --=20 2.40.1