From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.51.1678209395261075902 for ; Tue, 07 Mar 2023 09:16:35 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B4FE611FB; Tue, 7 Mar 2023 09:17:17 -0800 (PST) Received: from cam-smtp0.cambridge.arm.com (pierre123.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 47E1B3F67D; Tue, 7 Mar 2023 09:16:33 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, leif@nuviainc.com, sami.mujawar@arm.com, Jiewen Yao , Jian J Wang Subject: [PATCH v4 0/2] SecurityPkg: Fixes for RngDxe Date: Tue, 7 Mar 2023 18:15:48 +0100 Message-Id: <20230307171550.555541-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois 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. 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(-) --=20 2.25.1