public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Pierre.Gondois@arm.com" <Pierre.Gondois@arm.com>,
	"devel@edk2.groups.io" <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>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Wang, Jian J" <jian.j.wang@intel.com>
Subject: Re: [PATCH v3 14/22] SecurityPkg/RngDxe: Replace Pcd with Sp80090Ctr256Guid
Date: Thu, 21 Jul 2022 10:51:07 +0000	[thread overview]
Message-ID: <MW4PR11MB58728F9CABCF111473F5FEAA8C919@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220629150241.2597898-18-Pierre.Gondois@arm.com>

+  CopyMem (&RNGAlgorithmList[0], gEfiRngAlgorithmSp80090Ctr256Guid, sizeof (EFI_RNG_ALGORITHM));

Should it be &gEfiRngAlgorithmSp80090Ctr256Guid ? The dereference is missing.

Thank you
Yao Jiewen



> -----Original Message-----
> From: Pierre.Gondois@arm.com <Pierre.Gondois@arm.com>
> Sent: Wednesday, June 29, 2022 11:02 PM
> 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>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Yao,
> Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>
> Subject: [PATCH v3 14/22] SecurityPkg/RngDxe: Replace Pcd with
> Sp80090Ctr256Guid
> 
> From: Pierre Gondois <pierre.gondois@arm.com>
> 
> gEfiRngAlgorithmSp80090Ctr256Guid was used as the default algorithm
> in RngGetRNG(). The commit below set the default algorithm to
> PcdCpuRngSupportedAlgorithm, which is a zero GUID by default.
> 
> As the Pcd value is not defined for any platform in the edk2-platfoms
> repository, assume it was an error and go back to the first version,
> using gEfiRngAlgorithmSp80090Ctr256Guid.
> 
> Fixes 4e5ecdbac8bd ("SecurityPkg: Add support for RngDxe on AARCH64")
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>  SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
> b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
> index 8d44f0636c3d..8cfe6b471192 100644
> --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
> +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
> @@ -126,8 +126,7 @@ ArchGetSupportedRngAlgorithms (
>    OUT    EFI_RNG_ALGORITHM  *RNGAlgorithmList
>    )
>  {
> -  UINTN              RequiredSize;
> -  EFI_RNG_ALGORITHM  *CpuRngSupportedAlgorithm;
> +  UINTN  RequiredSize;
> 
>    RequiredSize = 2 * sizeof (EFI_RNG_ALGORITHM);
> 
> @@ -136,9 +135,7 @@ ArchGetSupportedRngAlgorithms (
>      return EFI_BUFFER_TOO_SMALL;
>    }
> 
> -  CpuRngSupportedAlgorithm = PcdGetPtr (PcdCpuRngSupportedAlgorithm);
> -
> -  CopyMem (&RNGAlgorithmList[0], CpuRngSupportedAlgorithm, sizeof
> (EFI_RNG_ALGORITHM));
> +  CopyMem (&RNGAlgorithmList[0], gEfiRngAlgorithmSp80090Ctr256Guid,
> sizeof (EFI_RNG_ALGORITHM));
> 
>    // x86 platforms also support EFI_RNG_ALGORITHM_RAW via RDSEED
>    CopyMem (&RNGAlgorithmList[1], &gEfiRngAlgorithmRaw, sizeof
> (EFI_RNG_ALGORITHM));
> --
> 2.25.1


  reply	other threads:[~2022-07-21 10:51 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 ` [PATCH v3 09/22] MdePkg/BaseRngLib: Rename ArmReadIdIsar0() to ArmGetFeatRng() PierreGondois
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 [this message]
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=MW4PR11MB58728F9CABCF111473F5FEAA8C919@MW4PR11MB5872.namprd11.prod.outlook.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