From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Sami Mujawar <sami.mujawar@arm.com>,
Leif Lindholm <quic_llindhol@quicinc.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Rebecca Cran <rebecca@bsdio.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>
Subject: [PATCH v3 09/22] MdePkg/BaseRngLib: Rename ArmReadIdIsar0() to ArmGetFeatRng()
Date: Wed, 29 Jun 2022 17:02:18 +0200 [thread overview]
Message-ID: <20220629150241.2597898-10-Pierre.Gondois@arm.com> (raw)
In-Reply-To: <20220629150241.2597898-1-Pierre.Gondois@arm.com>
From: Pierre Gondois <pierre.gondois@arm.com>
The MdePkg must be self contained and not have external dependencies.
ArmReadIdIsar0() is defined in MdePkg/Library/BaseRngLib and is
limited to the scope of this library.
The same function will be required to check the FEAT_AES and FEAT_RNG
extensions in other libraries. As this function is Arm specific, it
cannot be added to a library interface in MdePkg. It should be part of
ArmPkg/ArmLib.
To avoid having mutiple definitions/prototypes of ArmReadIdIsar0(),
and as BaseRngLib only requires to check the RNG capability bits,
rename the MdePkg/Library/BaseRngLib implementation to ArmGetFeatRng().
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
.../AArch64/{ArmReadIdIsar0.S => ArmGetFeatRng.S} | 8 ++++----
.../AArch64/{ArmReadIdIsar0.asm => ArmGetFeatRng.asm} | 8 ++++----
MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 2 +-
MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 2 +-
MdePkg/Library/BaseRngLib/BaseRngLib.inf | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
rename MdePkg/Library/BaseRngLib/AArch64/{ArmReadIdIsar0.S => ArmGetFeatRng.S} (78%)
rename MdePkg/Library/BaseRngLib/AArch64/{ArmReadIdIsar0.asm => ArmGetFeatRng.asm} (81%)
diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S b/MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.S
similarity index 78%
rename from MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
rename to MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.S
index 82a00d362212..c42d60513077 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
+++ b/MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# ArmReadIdIsar0() for AArch64
+# ArmGetFeatRng() for AArch64
#
# Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
#
@@ -10,7 +10,7 @@
.text
.p2align 2
-GCC_ASM_EXPORT(ArmReadIdIsar0)
+GCC_ASM_EXPORT(ArmGetFeatRng)
#/**
# Reads the ID_AA64ISAR0 Register.
@@ -20,11 +20,11 @@ GCC_ASM_EXPORT(ArmReadIdIsar0)
#**/
#UINT64
#EFIAPI
-#ArmReadIdIsar0 (
+#ArmGetFeatRng (
# VOID
# );
#
-ASM_PFX(ArmReadIdIsar0):
+ASM_PFX(ArmGetFeatRng):
mrs x0, id_aa64isar0_el1 // Read ID_AA64ISAR0 Register
ret
diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm b/MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.asm
similarity index 81%
rename from MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm
rename to MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.asm
index 1d9f9a808c0c..947adfcd2749 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm
+++ b/MdePkg/Library/BaseRngLib/AArch64/ArmGetFeatRng.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; ArmReadIdIsar0() for AArch64
+; ArmGetFeatRng() for AArch64
;
; Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
;
@@ -8,7 +8,7 @@
;
;------------------------------------------------------------------------------
- EXPORT ArmReadIdIsar0
+ EXPORT ArmGetFeatRng
AREA BaseLib_LowLevel, CODE, READONLY
;/**
@@ -19,11 +19,11 @@
;**/
;UINT64
;EFIAPI
-;ArmReadIdIsar0 (
+;ArmGetFeatRng (
; VOID
; );
;
-ArmReadIdIsar0
+ArmGetFeatRng
mrs x0, id_aa64isar0_el1 // Read ID_AA64ISAR0 Register
ret
diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h
index 2d6ef48ab941..b35cba3c063a 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h
+++ b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h
@@ -35,7 +35,7 @@ ArmRndr (
**/
UINT64
EFIAPI
-ArmReadIdIsar0 (
+ArmGetFeatRng (
VOID
);
diff --git a/MdePkg/Library/BaseRngLib/AArch64/Rndr.c b/MdePkg/Library/BaseRngLib/AArch64/Rndr.c
index 20811bf3ebf3..0cfdf4c37149 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/Rndr.c
+++ b/MdePkg/Library/BaseRngLib/AArch64/Rndr.c
@@ -47,7 +47,7 @@ BaseRngLibConstructor (
// Determine RNDR support by examining bits 63:60 of the ISAR0 register returned by
// MSR. A non-zero value indicates that the processor supports the RNDR instruction.
//
- Isar0 = ArmReadIdIsar0 ();
+ Isar0 = ArmGetFeatRng ();
ASSERT ((Isar0 & RNDR_MASK) != 0);
mRndrSupported = ((Isar0 & RNDR_MASK) != 0);
diff --git a/MdePkg/Library/BaseRngLib/BaseRngLib.inf b/MdePkg/Library/BaseRngLib/BaseRngLib.inf
index 1fcceb941495..d6eccb07d469 100644
--- a/MdePkg/Library/BaseRngLib/BaseRngLib.inf
+++ b/MdePkg/Library/BaseRngLib/BaseRngLib.inf
@@ -37,10 +37,10 @@ [Sources.AARCH64]
AArch64/Rndr.c
AArch64/ArmRng.h
- AArch64/ArmReadIdIsar0.S | GCC
+ AArch64/ArmGetFeatRng.S | GCC
AArch64/ArmRng.S | GCC
- AArch64/ArmReadIdIsar0.asm | MSFT
+ AArch64/ArmGetFeatRng.asm | MSFT
AArch64/ArmRng.asm | MSFT
[Packages]
--
2.25.1
next prev parent reply other threads:[~2022-06-29 15:04 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 15:02 [PATCH v3 00/22] Add Raw algorithm support using Arm FW-TRNG interface PierreGondois
2022-06-29 15:02 ` [PATCH v3 01/22] ArmPkg: PCD to select conduit for monitor calls PierreGondois
2022-06-29 15:02 ` [PATCH v3 02/22] ArmPkg/ArmMonitorLib: Definition for ArmMonitorLib library class PierreGondois
2022-06-29 15:02 ` [PATCH v3 03/22] ArmPkg/ArmMonitorLib: Add ArmMonitorLib PierreGondois
2022-06-29 15:02 ` [PATCH v3 04/22] ArmPkg/ArmHvcNullLib: Add NULL instance of ArmHvcLib PierreGondois
2022-06-29 15:02 ` [PATCH v3 05/22] MdePkg/TrngLib: Definition for TRNG library class interface PierreGondois
2022-06-29 15:02 ` [PATCH v3 06/22] MdePkg/TrngLib: Add NULL instance of TRNG Library PierreGondois
2022-06-29 15:02 ` [PATCH v3 07/22] ArmPkg: Add FID definitions for Firmware TRNG PierreGondois
2022-06-29 15:02 ` [PATCH v3 08/22] ArmPkg/TrngLib: Add Arm Firmware TRNG library PierreGondois
2022-06-29 15:02 ` PierreGondois [this message]
2022-06-29 15:02 ` [PATCH v3 10/22] ArmPkg/ArmLib: Add ArmReadIdIsar0() helper PierreGondois
2022-06-29 15:02 ` [PATCH v3 11/22] ArmPkg/ArmLib: Add ArmHasRngExt() PierreGondois
2022-06-29 15:02 ` [PATCH v3 12/21] SecurityPkg/RngDxe: Rename RdRandGenerateEntropy to generic name PierreGondois
2022-06-29 15:02 ` [PATCH v3 12/22] SecurityPkg: Update Securitypkg.ci.yaml PierreGondois
2022-06-29 15:02 ` [PATCH v3 13/22] SecurityPkg/RngDxe: Rename RdRandGenerateEntropy to generic name PierreGondois
2022-06-29 15:02 ` [PATCH v3 13/21] SecurityPkg/RngDxe: Replace Pcd with Sp80090Ctr256Guid PierreGondois
2022-06-29 15:02 ` [PATCH v3 14/21] SecurityPkg/RngDxe: Remove ArchGetSupportedRngAlgorithms() PierreGondois
2022-06-29 15:02 ` [PATCH v3 14/22] SecurityPkg/RngDxe: Replace Pcd with Sp80090Ctr256Guid PierreGondois
2022-07-21 10:51 ` Yao, Jiewen
2022-06-29 15:02 ` [PATCH v3 15/21] SecurityPkg/RngDxe: Documentation/include/parameter cleanup PierreGondois
2022-06-29 15:02 ` [PATCH v3 15/22] SecurityPkg/RngDxe: Remove ArchGetSupportedRngAlgorithms() PierreGondois
2022-06-29 15:02 ` [PATCH v3 16/21] SecurityPkg/RngDxe: Check before advertising Cpu Rng algo PierreGondois
2022-06-29 15:02 ` [PATCH v3 16/22] SecurityPkg/RngDxe: Documentation/include/parameter cleanup PierreGondois
2022-06-29 15:02 ` [PATCH v3 17/21] SecurityPkg/RngDxe: Add AArch64 RawAlgorithm support through TrngLib PierreGondois
2022-06-29 15:02 ` [PATCH v3 17/22] SecurityPkg/RngDxe: Check before advertising Cpu Rng algo PierreGondois
2022-06-29 15:02 ` [PATCH v3 18/22] SecurityPkg/RngDxe: Add AArch64 RawAlgorithm support through TrngLib PierreGondois
2022-06-29 15:02 ` [PATCH v3 18/21] SecurityPkg/RngDxe: Add debug warning for NULL PcdCpuRngSupportedAlgorithm PierreGondois
2022-06-29 15:02 ` [PATCH v3 19/22] " PierreGondois
2022-06-29 15:02 ` [PATCH v3 19/21] SecurityPkg/RngDxe: Rename AArch64/RngDxe.c PierreGondois
2022-06-29 15:02 ` [PATCH v3 20/21] SecurityPkg/RngDxe: Add Arm support of RngDxe PierreGondois
2022-07-21 10:47 ` Yao, Jiewen
2022-06-29 15:02 ` [PATCH v3 20/22] SecurityPkg/RngDxe: Rename AArch64/RngDxe.c PierreGondois
2022-06-29 15:02 ` [PATCH v3 21/21] ArmVirtPkg: Kvmtool: Add RNG support using FW-TRNG interface PierreGondois
2022-06-29 15:02 ` [PATCH v3 21/22] SecurityPkg/RngDxe: Add Arm support of RngDxe PierreGondois
2022-06-29 15:02 ` [PATCH v3 22/22] ArmVirtPkg: Kvmtool: Add RNG support using FW-TRNG interface PierreGondois
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=20220629150241.2597898-10-Pierre.Gondois@arm.com \
--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