From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web08.13853.1620408514019098709 for ; Fri, 07 May 2021 10:28:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KogHYtCN; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id F0EA961466 for ; Fri, 7 May 2021 17:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620408513; bh=Irfr7pvXPO+yfy36y7XrdGSu0nHJ5pBB5scFIXB1ruU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KogHYtCNd30AbLRIiLT654YwAcMSFqLPfQbniKF/PLwwy9XOVjFx4yCM3lP7JZR3i 35+YG86kxiBiuf1ssP0wWwbQNX8KRBsV6lLejlOJnxlZVUnSBZQCZejZ0KgoKfncma +CFLLObfd3LrXZZBhDMgAw+mTELhHqWwgwaYEdy2EA46T3LigwqW6mGxgfe7DFXwVN iIYckJVJDqGOPIJVlgMJi8xNZt84D+OPzx+QzE/Ae+5UZ7Ee6rHBnsXHhv4ylZM1l3 nRNWOpETAgfUMW8JirU5fjLzcOa2dCne01a2kmIfbdPWpNMcZAnYqifiPh/AVRc6Fh dW8WdZZ8Uyzag== Received: by mail-ot1-f47.google.com with SMTP id q7-20020a9d57870000b02902a5c2bd8c17so8556872oth.5 for ; Fri, 07 May 2021 10:28:32 -0700 (PDT) X-Gm-Message-State: AOAM530OVq1DCwWUt0NWX815Id+FYh2BGWvBcWh9zBCWNEVQxmyXYnMB s3XhYAUCQKgocum3nNly76F3aQ5lTKwYudBOsc8= X-Google-Smtp-Source: ABdhPJySAro4+crpFFOHTfHWbVwH9SnH6p7vvb9N4Fdz7slNH9OTgkC8xJeTpPi2J36j3JJoH5K8l5zBWxlUyDkNmE4= X-Received: by 2002:a9d:69c5:: with SMTP id v5mr8944852oto.108.1620408512163; Fri, 07 May 2021 10:28:32 -0700 (PDT) MIME-Version: 1.0 References: <20210507142315.679-1-rebecca@nuviainc.com> In-Reply-To: <20210507142315.679-1-rebecca@nuviainc.com> From: "Ard Biesheuvel" Date: Fri, 7 May 2021 19:28:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] MdePkg,SecurityPkg: Add support to RngDxe and BaseRngLib for AARCH64 RNDR To: Rebecca Cran Cc: edk2-devel-groups-io , Jiewen Yao , Jian J Wang , Michael D Kinney , Liming Gao , Zhiguang Liu , Ard Biesheuvel , Sami Mujawar Content-Type: text/plain; charset="UTF-8" On Fri, 7 May 2021 at 16:23, Rebecca Cran wrote: > > Update MdePkg BaseRngLib and SecurityPkg RngDxe to add support for > the AARCH64 RNDR instruction. > > Changes from v1 to v2: > > o Added a PCD, gEfiSecurityPkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm to > specify which algorighm the platform supports. > o Moved ArmRndr() and ArmRndrrs() into BaseRngLib. > o Added Doxygen headers. > o Merged X64 and AARCH64 *GetBytes functions into a single RngGetBytes > function. > o Updated constructors to return EFI_STATUS instead of RETURN_STATUS. > o Added ArchIsRngSupported function that gets called before each call to > ArchGetRandomNumber*. > > Rebecca Cran (2): > MdePkg/BaseRngLib: Add support for ARMv8.5 RNG instructions > SecurityPkg: Add support for RngDxe on AARCH64 > I don't maintain any of the packages involved, but the changes look fine to me. Acked-by: Ard Biesheuvel > MdePkg/MdePkg.dec | 9 +- > SecurityPkg/SecurityPkg.dec | 2 + > MdePkg/MdePkg.dsc | 4 +- > SecurityPkg/SecurityPkg.dsc | 11 +- > MdePkg/Library/BaseRngLib/BaseRngLib.inf | 23 ++- > SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf | 24 ++- > MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 59 +++++++ > MdePkg/Library/BaseRngLib/BaseRngLibInternals.h | 79 +++++++++ > SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.h | 0 > SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.h | 17 -- > SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h | 117 ++++++++++++++ > MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 139 ++++++++++++++++ > MdePkg/Library/BaseRngLib/BaseRng.c | 87 +++++----- > MdePkg/Library/BaseRngLib/Rand/RdRand.c | 131 +++++++++++++++ > SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c | 127 +++++++++++++++ > SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.c | 0 > SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.c | 45 +----- > SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c | 146 +++++++++++++++++ > SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c | 170 ++++++++------------ > MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S | 31 ++++ > MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm | 30 ++++ > MdePkg/Library/BaseRngLib/AArch64/ArmRng.S | 61 +++++++ > MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm | 64 ++++++++ > MdePkg/Library/BaseRngLib/BaseRngLib.uni | 6 +- > 24 files changed, 1152 insertions(+), 230 deletions(-) > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.h > create mode 100644 MdePkg/Library/BaseRngLib/BaseRngLibInternals.h > rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.h (100%) > rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.h (72%) > create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/Rndr.c > create mode 100644 MdePkg/Library/BaseRngLib/Rand/RdRand.c > create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c > rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.c (100%) > rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.c (71%) > create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.S > create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm > > -- > 2.26.2 >