On 3/7/23 18:15, PierreGondois via groups.io wrote:
From: Pierre Gondois <pierre.gond...@arm.com> v1: - https://edk2.groups.io/g/devel/message/96356 v2: - https://edk2.groups.io/g/devel/message/96434 - Reformulate commit message. - Do not warn if no algorithm is found as the message would be printed on non-Arm platforms. v3: - https://edk2.groups.io/g/devel/topic/95240503 - Add the following patches: 1. ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor() Requested by Ard. Cf https://edk2.groups.io/g/devel/message/96495 2. SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL Do not install EFI_RNG_PROTOCOL if no RNG algorithm is available. Cf. https://edk2.groups.io/g/devel/message/96494 3. SecurityPkg/RngDxe: Fix Rng algo selection for Arm Coming from v2 patch being split. v4: - Change description of: 'SecurityPkg/RngDxe: Fix Rng algo selection for Arm' to: 'SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm' - Add patch: 'SecurityPkg/RngDxe: Check for NULL PcdCpuRngSupportedAlgorithm' - Remove as merged: SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount When adding support for the Firmware Trng interface, it was made available through in the RngDxe module. In RngDxe, the algorithm associated with PcdCpuRngSupportedAlgorithm (implemented by the RngLib) was always advertised by default. It was assumed that support for RngLib and RNDR instructions should be kept in ArmVirtPkg. However this support did not exist as all ArmVirtPkg use the BaseRngLibTimerLib.inf implementation of the RngLib. Do not advertise the RngLib and PcdCpuRngSupportedAlgorithm if PcdCpuRngSupportedAlgorithm is NULL.
Please also note that PcdCpuRngSupportedAlgorithm is not defined for almost all platforms. So their RngDxe would most probably have no Rng algorithm to advertise anymore. In addition to this patchset, PcdCpuRngSupportedAlgorithm should be defined for all edk2-platforms platforms aswell. Maybe advertising a NULL Guid is a better solution when advertising an non-trusted Rng algorithm, plus it would allow avoiding to define PcdCpuRngSupportedAlgorithm for these platforms ? Regards, Pierre
Also simplify the selection of the default algorithm. Pierre Gondois (2): SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm SecurityPkg/RngDxe: Check for NULL PcdCpuRngSupportedAlgorithm .../RngDxe/AArch64/AArch64Algo.c | 14 +++----------- .../RandomNumberGenerator/RngDxe/ArmRngDxe.c | 17 ++++------------- 2 files changed, 7 insertions(+), 24 deletions(-)
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101095): https://edk2.groups.io/g/devel/message/101095 Mute This Topic: https://groups.io/mt/97454014/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-