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.17786.1661172063787788973 for ; Mon, 22 Aug 2022 05:41:04 -0700 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 EBB9A12FC; Mon, 22 Aug 2022 05:41:05 -0700 (PDT) Received: from [10.57.40.14] (unknown [10.57.40.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB6E93F718; Mon, 22 Aug 2022 05:41:00 -0700 (PDT) Message-ID: Date: Mon, 22 Aug 2022 14:41:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW1BBVENIIHY0IDAwLzIxXSBBZGQgUmF3IGFsZ29yaXRobSBzdXBwb3J0IHVzaW5nIEFybSBGVy1UUk5HIGludGVyZmFjZQ==?= To: gaoliming , devel@edk2.groups.io Cc: 'Sami Mujawar' , 'Leif Lindholm' , 'Ard Biesheuvel' , 'Rebecca Cran' , 'Michael D Kinney' , 'Jiewen Yao' , 'Jian J Wang' References: <20220722143153.913585-1-Pierre.Gondois@arm.com> <002b01d89fdf$3a7466a0$af5d33e0$@byosoft.com.cn> From: "PierreGondois" In-Reply-To: <002b01d89fdf$3a7466a0$af5d33e0$@byosoft.com.cn> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello Ard, Leif, I need to address some comments from Jiewen for the SecurityPkg in a new version. Would you have any comments regarding the ArmPkg ? Regards, Pierre On 7/25/22 06:30, gaoliming wrote: > Pierre: > The change in MdePkg is good to me. Reviewed-by: Liming Gao > >=20 > Thanks > Liming >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- >> =E5=8F=91=E4=BB=B6=E4=BA=BA: Pierre.Gondois@arm.com >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B47=E6=9C=8822=E6=97=A5= 22:32 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io >> =E6=8A=84=E9=80=81: Sami Mujawar ; Leif Lindholm >> ; Ard Biesheuvel ; >> Rebecca Cran ; Michael D Kinney >> ; Liming Gao ; >> Jiewen Yao ; Jian J Wang = ; >> Pierre Gondois >> =E4=B8=BB=E9=A2=98: [PATCH v4 00/21] Add Raw algorithm support using A= rm FW-TRNG >> interface >> >> From: Pierre Gondois >> >> Bugzilla: Bug 3668 (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3= 668) >> >> The Arm True Random Number Generator Firmware, Interface 1.0, >> specification >> defines an interface between an Operating System (OS) executing at EL1= and >> Firmware (FW) exposing a conditioned entropy source that is provided b= y a >> TRNG back end. >> This patch-set: >> - defines a TRNG library class that provides an interface to access th= e >> entropy source on a platform. >> - implements a TRNG library instance that uses the Arm FW-TRNG interfa= ce. >> - Adds RawAlgorithm support to RngDxe for Arm architecture using the A= rm >> FW-TRNG interface. >> - Enables RNG support using FW-TRNG interface for Kvmtool Guest/Virtua= l >> firmware. >> >> This patch-set is based on the v2 from Sami Mujawar: >> [PATCH v2 0/8] Add Raw algorithm support using Arm FW-TRNG interface >> v2: >> https://edk2.groups.io/g/devel/message/83775 >> v3: >> https://edk2.groups.io/g/devel/message/90845 >> https://github.com/PierreARM/edk2/tree/Arm_Trng_v3 >> v4: >> https://github.com/PierreARM/edk2/tree/Arm_Trng_v4 >> >> V4: >> - Removed dependencies on ArmPkg and dropped patch: >> [PATCH v3 12/22] SecurityPkg: Update Securitypkg.ci.yaml >> [Jiewen] >> - Use a dynamically allocated array to hold available algorithms. >> The array is freed in a new UNLOAD_IMAGE function and >> allocated in arch specific implementations of >> GetAvailableAlgorithms(), available in AArch64/AArch64Algo.c >> and Arm/ArmAlgo.c. >> - Correctly reference gEfiRngAlgorithmSp80090Ctr256Guid >> Guid by copying its address (add missing '&'). [Jiewen] >> V3: >> - Address Leif's comment (moving definitions, optimizations, ...) >> - Add ArmMonitorLib to choose Hvc/Smc conduit depending on a Pcd. >> - Re-factor some parts of SecurityPkg/RngDxe/ to ease the addition >> of new algorithms. >> - Add ArmHasRngExt() function to check Arm's FEAT_RNG extension. >> V2: >> - Updates TrngLib definitions to use RETURN_STATUS as the return typ= e >> from the interface functions as TrngLib is base type library. >> - Drops the patch "MdePkg: Add definition for NULL GUID" as there is >> already an equivalent definition provided by gZeroGuid. Thus, the >> use of gNullGuid has been replaced with gZeroGuid. >> >> Pierre Gondois (13): >> ArmPkg/ArmMonitorLib: Definition for ArmMonitorLib library class >> ArmPkg/ArmMonitorLib: Add ArmMonitorLib >> ArmPkg/ArmHvcNullLib: Add NULL instance of ArmHvcLib >> MdePkg/BaseRngLib: Rename ArmReadIdIsar0() to ArmGetFeatRng() >> ArmPkg/ArmLib: Add ArmReadIdIsar0() helper >> ArmPkg/ArmLib: Add ArmHasRngExt() >> SecurityPkg/RngDxe: Replace Pcd with Sp80090Ctr256Guid >> SecurityPkg/RngDxe: Remove ArchGetSupportedRngAlgorithms() >> SecurityPkg/RngDxe: Documentation/include/parameter cleanup >> SecurityPkg/RngDxe: Check before advertising Cpu Rng algo >> SecurityPkg/RngDxe: Add debug warning for NULL >> PcdCpuRngSupportedAlgorithm >> SecurityPkg/RngDxe: Rename AArch64/RngDxe.c >> SecurityPkg/RngDxe: Add Arm support of RngDxe >> >> Sami Mujawar (8): >> ArmPkg: PCD to select conduit for monitor calls >> MdePkg/TrngLib: Definition for TRNG library class interface >> MdePkg/TrngLib: Add NULL instance of TRNG Library >> ArmPkg: Add FID definitions for Firmware TRNG >> ArmPkg/TrngLib: Add Arm Firmware TRNG library >> SecurityPkg/RngDxe: Rename RdRandGenerateEntropy to generic name >> SecurityPkg/RngDxe: Add AArch64 RawAlgorithm support through TrngLi= b >> ArmVirtPkg: Kvmtool: Add RNG support using FW-TRNG interface >> >> ArmPkg/ArmPkg.dec | 12 +- >> ArmPkg/ArmPkg.dsc | 3 + >> ArmPkg/Include/IndustryStandard/ArmStdSmc.h | 109 ++++- >> ArmPkg/Include/Library/ArmLib.h | 12 +- >> ArmPkg/Include/Library/ArmMonitorLib.h | 42 ++ >> ArmPkg/Library/ArmFwTrngLib/ArmFwTrngDefs.h | 50 +++ >> ArmPkg/Library/ArmFwTrngLib/ArmFwTrngLib.c | 403 >> ++++++++++++++++++ >> ArmPkg/Library/ArmFwTrngLib/ArmFwTrngLib.inf | 29 ++ >> ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c | 29 ++ >> .../Library/ArmHvcNullLib/ArmHvcNullLib.inf | 22 + >> ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 15 +- >> ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h | 14 +- >> .../Library/ArmLib/AArch64/AArch64Support.S | 7 +- >> ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 16 +- >> ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c | 34 ++ >> .../Library/ArmMonitorLib/ArmMonitorLib.inf | 29 ++ >> ArmVirtPkg/ArmVirtKvmTool.dsc | 10 + >> ArmVirtPkg/ArmVirtKvmTool.fdf | 5 + >> MdePkg/Include/Library/TrngLib.h | 121 ++++++ >> .../{ArmReadIdIsar0.S =3D> ArmGetFeatRng.S} | 8 +- >> .../{ArmReadIdIsar0.asm =3D> ArmGetFeatRng.asm} | 8 +- >> MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 2 +- >> MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 2 +- >> MdePkg/Library/BaseRngLib/BaseRngLib.inf | 4 +- >> .../Library/BaseTrngLibNull/BaseTrngLibNull.c | 135 ++++++ >> .../BaseTrngLibNull/BaseTrngLibNull.inf | 30 ++ >> .../BaseTrngLibNull/BaseTrngLibNull.uni | 12 + >> MdePkg/MdePkg.dec | 5 + >> MdePkg/MdePkg.dsc | 1 + >> .../RngDxe/AArch64/AArch64Algo.c | 72 ++++ >> .../RngDxe/Arm/ArmAlgo.c | 51 +++ >> .../RngDxe/{AArch64/RngDxe.c =3D> ArmRngDxe.c} | 81 +++- >> .../RandomNumberGenerator/RngDxe/ArmTrng.c | 71 +++ >> .../RngDxe/Rand/RdRand.c | 14 +- >> .../RngDxe/Rand/RdRand.h | 43 -- >> .../RngDxe/Rand/RngDxe.c | 62 ++- >> .../RandomNumberGenerator/RngDxe/RngDxe.c | 90 ++-- >> .../RandomNumberGenerator/RngDxe/RngDxe.inf | 18 +- >> .../RngDxe/RngDxeInternals.h | 71 +-- >> SecurityPkg/SecurityPkg.dsc | 5 +- >> 40 files changed, 1575 insertions(+), 172 deletions(-) >> create mode 100644 ArmPkg/Include/Library/ArmMonitorLib.h >> create mode 100644 ArmPkg/Library/ArmFwTrngLib/ArmFwTrngDefs.h >> create mode 100644 ArmPkg/Library/ArmFwTrngLib/ArmFwTrngLib.c >> create mode 100644 ArmPkg/Library/ArmFwTrngLib/ArmFwTrngLib.inf >> create mode 100644 ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c >> create mode 100644 ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.inf >> create mode 100644 ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c >> create mode 100644 ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf >> create mode 100644 MdePkg/Include/Library/TrngLib.h >> rename MdePkg/Library/BaseRngLib/AArch64/{ArmReadIdIsar0.S =3D> >> ArmGetFeatRng.S} (78%) >> rename MdePkg/Library/BaseRngLib/AArch64/{ArmReadIdIsar0.asm =3D> >> ArmGetFeatRng.asm} (81%) >> create mode 100644 MdePkg/Library/BaseTrngLibNull/BaseTrngLibNull.c >> create mode 100644 MdePkg/Library/BaseTrngLibNull/BaseTrngLibNull.in= f >> create mode 100644 MdePkg/Library/BaseTrngLibNull/BaseTrngLibNull.un= i >> create mode 100644 >> SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/AArch64Algo.c >> create mode 100644 >> SecurityPkg/RandomNumberGenerator/RngDxe/Arm/ArmAlgo.c >> rename SecurityPkg/RandomNumberGenerator/RngDxe/{AArch64/RngDxe.c >> =3D> ArmRngDxe.c} (64%) >> create mode 100644 >> SecurityPkg/RandomNumberGenerator/RngDxe/ArmTrng.c >> delete mode 100644 >> SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h >> >> -- >> 2.25.1 >=20 >=20 >=20