From: "Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
To: devel@edk2.groups.io
Cc: Sami Mujawar <sami.mujawar@arm.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Leif Lindholm <quic_llindhol@quicinc.com>,
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [PATCH v2 3/8] ArmPkg: add functions to read SVE/SME info
Date: Mon, 5 Jun 2023 08:37:38 +0200 [thread overview]
Message-ID: <20230605063743.405487-5-marcin.juszkiewicz@linaro.org> (raw)
In-Reply-To: <20230605063743.405487-1-marcin.juszkiewicz@linaro.org>
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 <marcin.juszkiewicz@linaro.org>
---
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]
[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 = -march=armv8-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
);
+UINTN
+EFIAPI
+ArmReadIdAA64Smfr0 (
+ VOID
+ );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Zfr0 (
+ VOID
+ );
+
#endif // AARCH64_LIB_H_
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/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
+
+ASM_FUNC(ArmReadIdAA64Smfr0)
+ mrs x0, ID_AA64SMFR0_EL1
+ ret
+
+
+ASM_FUNC(ArmReadIdAA64Zfr0)
+ mrs x0, ID_AA64ZFR0_EL1
+ ret
+
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
--
2.40.1
next prev parent reply other threads:[~2023-06-05 6:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 6:37 [PATCH v2 0/8] ArmCpuInfo improvements Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 1/1] ArmPkg: add SMC defines for SiP service calls Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 1/8] ArmPkg: fix reading of first nibbles in ArmCpuInfo Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 2/8] ArmPkg: shorten register field " Marcin Juszkiewicz
2023-06-05 6:37 ` Marcin Juszkiewicz [this message]
2023-06-05 6:37 ` [PATCH v2 4/8] ArmPkg: skip empty system registers " Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 5/8] ArmPkg: format output in one place " Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 6/8] ArmPkg: handle SVE/SME " Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 7/8] ArmPkg: cleaning output of ArmCpuInfo Marcin Juszkiewicz
2023-06-05 6:37 ` [PATCH v2 8/8] ArmPkg: show stage2 granule support on Neoverse-N1 Marcin Juszkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230605063743.405487-5-marcin.juszkiewicz@linaro.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox