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.51099.1683210293023057284 for ; Thu, 04 May 2023 07:24:53 -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 997C0260840; Thu, 4 May 2023 16:24:51 +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 gW3WBQco66pE; Thu, 4 May 2023 16:24:49 +0200 (CEST) Received: from applejack.lan (83.11.34.59.ipv4.supernova.orange.pl [83.11.34.59]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 9257D260891; Thu, 4 May 2023 16:24:48 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Rebecca Cran , Sami Mujawar , Marcin Juszkiewicz Subject: [PATCH 3/7] ArmPkg: add functions to read SVE/SME info Date: Thu, 4 May 2023 15:24:36 +0100 Message-Id: <20230504142440.827531-4-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230504142440.827531-1-marcin.juszkiewicz@linaro.org> References: <20230504142440.827531-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