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.7314.1689168606700438404 for ; Wed, 12 Jul 2023 06:30:06 -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 A67F912FC; Wed, 12 Jul 2023 06:30:48 -0700 (PDT) Received: from e126645.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 338303F67D; Wed, 12 Jul 2023 06:30:03 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao , Jian J Wang , Ard Biesheuvel , Sami Mujawar , Jose Marinho , Kun Qin , pierre.gondois@arm.com Subject: [PATCH v4 1/8] MdePkg: Move BaseRngLibTimerLib to MdeModulePkg Date: Wed, 12 Jul 2023 15:29:40 +0200 Message-Id: <20230712132947.332643-2-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230712132947.332643-1-pierre.gondois@arm.com> References: <20230712132947.332643-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois The BaseRngLibTimerLib allows to generate number based on a timer. This mechanism allows to have a basic non-secure implementation for non-production platforms. To bind and identify Random Number Generators implementations with a GUID, an unsafe GUID should be added. This GUID cannot be added to the MdePkg unless it is also added to a specification. To keep the MdePkg self-contained, move the BaseRngLibTimerLib to the MdeModulePkg. This will allow to define an unsafe Rng GUID in a later patch in the MdeModulePkg. Signed-off-by: Pierre Gondois --- ArmVirtPkg/ArmVirt.dsc.inc | 2 +- EmulatorPkg/EmulatorPkg.dsc | 2 +- .../Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf | 0 .../Library/BaseRngLibTimerLib/BaseRngLibTimerLib.uni | 0 .../Library/BaseRngLibTimerLib/RngLibTimer.c | 0 MdeModulePkg/MdeModulePkg.dsc | 1 + MdePkg/MdePkg.dsc | 1 - NetworkPkg/NetworkPkg.dsc | 4 ++-- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- OvmfPkg/OvmfXen.dsc | 2 +- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 +- SecurityPkg/SecurityPkg.dsc | 4 ++-- SignedCapsulePkg/SignedCapsulePkg.dsc | 4 ++-- 20 files changed, 19 insertions(+), 19 deletions(-) rename {MdePkg =3D> MdeModulePkg}/Library/BaseRngLibTimerLib/BaseRngLibT= imerLib.inf (100%) rename {MdePkg =3D> MdeModulePkg}/Library/BaseRngLibTimerLib/BaseRngLibT= imerLib.uni (100%) rename {MdePkg =3D> MdeModulePkg}/Library/BaseRngLibTimerLib/RngLibTimer= .c (100%) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 2443e8351c99..3f7bac6bf33a 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -154,7 +154,7 @@ [LibraryClasses.common] OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 # # Secure Boot dependencies diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index b44435d7e6ee..b14654739b54 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -128,7 +128,7 @@ [LibraryClasses] FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSe= cureLibNull.inf diff --git a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf b/M= deModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf similarity index 100% rename from MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf rename to MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf diff --git a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.uni b/M= deModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.uni similarity index 100% rename from MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.uni rename to MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.uni diff --git a/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c b/MdeModuleP= kg/Library/BaseRngLibTimerLib/RngLibTimer.c similarity index 100% rename from MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c rename to MdeModulePkg/Library/BaseRngLibTimerLib/RngLibTimer.c diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.ds= c index 1aedfe280ae1..ca16c7f8d552 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -341,6 +341,7 @@ [Components] MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdatePro= gressLibGraphics.inf MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgres= sLibText.inf + MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 3abd1a1e2310..809d3a09500d 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -68,7 +68,6 @@ [Components] MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull= .inf MdePkg/Library/DxeRngLib/DxeRngLib.inf MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf - MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc index 6c231c97b544..808c6bffce2c 100644 --- a/NetworkPkg/NetworkPkg.dsc +++ b/NetworkPkg/NetworkPkg.dsc @@ -82,10 +82,10 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf =20 [LibraryClasses.ARM] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [LibraryClasses.RISCV64] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [PcdsFeatureFlag] gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 2c6ed7c9745f..022104dfdce6 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -185,7 +185,7 @@ [LibraryClasses] =20 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableL= ibNull.inf VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 7fa40998ae80..cc1f85d1be50 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -196,7 +196,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.= dsc index e000deed9e4d..35942e02df93 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -206,7 +206,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdx= X64.dsc index 193657ff2d61..bbf218488127 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -184,7 +184,7 @@ [LibraryClasses] =20 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.= dsc index 2f7585639374..d5c1a2fe3a91 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -203,7 +203,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index ed36935770f3..c1f1733a483d 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -210,7 +210,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 919315e4cb33..bdd6c3bc96ae 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -215,7 +215,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 823de0d0f9e0..a54e17dd087d 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -231,7 +231,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.= inf diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 210578c1d74d..26d2a6963de5 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -194,7 +194,7 @@ [LibraryClasses] !else OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableL= ibNull.inf VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf diff --git a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc b/OvmfPkg/RiscVVirt/Risc= VVirt.dsc.inc index 731f54f73f81..8da89ef09f62 100644 --- a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc +++ b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc @@ -117,7 +117,7 @@ [LibraryClasses.common] OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf !endif BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 # # Secure Boot dependencies diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index 3c62205162ce..7682066cd9fe 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -92,10 +92,10 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] ArmTrngLib|MdePkg/Library/BaseArmTrngLibNull/BaseArmTrngLibNull.inf =20 [LibraryClasses.ARM] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [LibraryClasses.RISCV64] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [LibraryClasses.X64.SEC] HashLib|SecurityPkg/Library/HashLibTdx/HashLibTdx.inf diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/Sig= nedCapsulePkg.dsc index 8a27207a6f20..4c656666e981 100644 --- a/SignedCapsulePkg/SignedCapsulePkg.dsc +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc @@ -110,10 +110,10 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM] NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf =20 [LibraryClasses.ARM] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [LibraryClasses.RISCV64] - RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf + RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf =20 [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf --=20 2.25.1