From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Xiaoyu Lu <xiaoyu1.lu@intel.com>,
Guomin Jiang <guomin.jiang@intel.com>,
Christopher Zurcher <christopher.zurcher@microsoft.com>
Subject: [Patch v2 10/16] CryptoPkg: Update DSC to improve CI test coverage
Date: Thu, 20 Oct 2022 11:35:04 -0700 [thread overview]
Message-ID: <20221020183510.1799-11-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20221020183510.1799-1-michael.d.kinney@intel.com>
With the addition of EC services and performance optimized versions
of the OpensslLib for IA32/X64, the CryptoPkg.dsc file is updated
to make sure all combinations are covered in CI builds.
* Use different output directory for each CRYPTO_SERVICES profile.
* Add FILE_GUID define names for CryptoPei, CryptoDxe, and CryptoSmm
when they are linked with different OpensslLib instances.
* Update CryptoPei, CryptoDxe, CryptoSmm builds to include all
combinations of OpensslLib library instances supported by each
CPU architecture.
* Add TARGET_UINT_TESTS profile to CryptoPkg.dsc to build only
the target-based unit tests. This reduces the size of CryptoPkg
components not related to unit testing by removing unit test
specific assert handlers. Build target-based unit tests using
OpensslLibFull.inf and OpensslLibFullAccel.inf.
* Remove the PACKAGE profile and instead make the ALL profile
the default for CI testing that enables all services for all
modules.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Christopher Zurcher <christopher.zurcher@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
CryptoPkg/CryptoPkg.dsc | 428 ++++++++++++++++++++++++++++++++--------
1 file changed, 345 insertions(+), 83 deletions(-)
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 032b9e637737..3b245979c34c 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -19,17 +19,14 @@ [Defines]
PLATFORM_GUID = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
PLATFORM_VERSION = 0.98
DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/CryptoPkg
SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64|LOONGARCH64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
#
# Flavor of PEI, DXE, SMM modules to build.
- # Must be one of ALL, NONE, MIN_PEI, MIN_DXE_MIN_SMM.
+ # Must be one of ALL, NONE, MIN_PEI, MIN_DXE_MIN_SMM, TARGET_UINT_TESTS.
# Default is ALL that is used for package build verification.
- # PACKAGE - Package verification build of all components. Null
- # versions of libraries are used to minimize build times.
# ALL - Build PEIM, DXE, and SMM drivers. Protocols and PPIs
# publish all services.
# NONE - Build PEIM, DXE, and SMM drivers. Protocols and PPIs
@@ -39,14 +36,56 @@ [Defines]
# services.
# MIN_DXE_MIN_SMM - Build DXE and SMM drivers with Protocols that publish
# minimum required services.
+ # TARGET_UNIT_TESTS - Build target-based unit tests
#
- DEFINE CRYPTO_SERVICES = PACKAGE
-!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
+ DEFINE CRYPTO_SERVICES = ALL
+!if $(CRYPTO_SERVICES) IN "ALL NONE MIN_PEI MIN_DXE_MIN_SMM TARGET_UNIT_TESTS"
!else
- !error CRYPTO_SERVICES must be set to one of PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM.
+ !error CRYPTO_SERVICES must be set to one of ALL NONE MIN_PEI MIN_DXE_MIN_SMM TARGET_UNIT_TESTS.
!endif
+#
+# Define different OUTPUT_DIRECTORY for each CRYPTO_SERVICES profile
+#
+!if $(CRYPTO_SERVICES) == ALL
+ OUTPUT_DIRECTORY = Build/CryptoPkg/All
+!endif
+!if $(CRYPTO_SERVICES) == NONE
+ OUTPUT_DIRECTORY = Build/CryptoPkg/None
+!endif
+!if $(CRYPTO_SERVICES) == MIN_PEI
+ OUTPUT_DIRECTORY = Build/CryptoPkg/MinPei
+!endif
+!if $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
+ OUTPUT_DIRECTORY = Build/CryptoPkg/MinDxeMinSmm
+!endif
+!if $(CRYPTO_SERVICES) == TARGET_UNIT_TESTS
+ OUTPUT_DIRECTORY = Build/CryptoPkg/TagetUnitTests
+!endif
+
+#
+# Define FILE_GUID names/values for CryptoPei, CryptopDxe, and CryptoSmm
+# drivers that are linked with different OpensslLib instances
+#
+ DEFINE PEI_CRYPTO_GUID = C693A250-6B36-49B9-B7F3-7283F8136A72
+ DEFINE PEI_STD_GUID = EBD49F5C-6D8B-40D1-A56D-9AFA485A8661
+ DEFINE PEI_FULL_GUID = D51FCE59-6860-49C0-9B35-984470735D17
+ DEFINE PEI_STD_ACCEL_GUID = DCC9CB49-7BE2-47C6-864E-6DCC932360F9
+ DEFINE PEI_FULL_ACCEL_GUID = A10827AD-7598-4955-B661-52EE2B62B057
+ DEFINE DXE_CRYPTO_GUID = 31C17C54-325D-47D5-8622-888098F10E44
+ DEFINE DXE_STD_GUID = ADD6D05A-52A2-437B-98E7-DBFDA89352CD
+ DEFINE DXE_FULL_GUID = AA83B296-F6EA-447F-B013-E80E98629CF8
+ DEFINE DXE_STD_ACCEL_GUID = 9FBDAD27-910C-4229-9EFF-A93BB5FE18C6
+ DEFINE DXE_FULL_ACCEL_GUID = 41A491D1-A972-468B-A299-DABF415A43B7
+ DEFINE SMM_CRYPTO_GUID = 1A1C9E13-5722-4636-AB73-31328EDE8BAF
+ DEFINE SMM_STD_GUID = E4D7D1E3-E886-4412-A442-EFD6F2502DD3
+ DEFINE SMM_FULL_GUID = 1930CE7E-6598-48ED-8AB1-EBE7E85EC254
+ DEFINE SMM_STD_ACCEL_GUID = 828959D3-CEA6-4B79-B1FC-5AFA0D7F2144
+ DEFINE SMM_FULL_ACCEL_GUID = C1760694-AB3A-4532-8C6D-52D8F86EB1AA
+
+!if $(CRYPTO_SERVICES) == TARGET_UNIT_TESTS
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+!endif
################################################################################
#
@@ -59,17 +98,24 @@ [Defines]
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
- TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
- HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
- RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+ SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
+ TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+ RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
+ PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+ DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
+ HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+
+[LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
+ RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
[LibraryClasses.ARM, LibraryClasses.AARCH64]
+ ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
#
# It is not possible to prevent the ARM compiler for generic intrinsic functions.
# This library provides the instrinsic functions generate by a given compiler.
@@ -81,41 +127,19 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
# Add support for stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
-[LibraryClasses.common.PEIM]
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
- SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
- MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
- MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
-
-!if $(CRYPTO_SERVICES) IN "ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
-[LibraryClasses]
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf #???
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf #???
- OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
- SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
-
[LibraryClasses.ARM]
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
[LibraryClasses.common.SEC]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
[LibraryClasses.common.PEIM]
+ PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+ PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
+ PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+ MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
+ HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -124,19 +148,34 @@ [LibraryClasses.common.PEIM]
[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
-[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM]
- PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
-
[LibraryClasses.common.DXE_DRIVER]
+ UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+ UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
[LibraryClasses.common.DXE_SMM_DRIVER]
+ UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+ UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+ SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
+ MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
+ MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
-!endif
+
+[LibraryClasses.common.UEFI_APPLICATION]
+ UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
+ UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+ ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
+ PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
################################################################################
#
@@ -148,7 +187,12 @@ [PcdsFixedAtBuild]
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
-!if $(CRYPTO_SERVICES) IN "PACKAGE ALL"
+#
+# For ALL and TARGET_UINT_TESTS profiles, enable all non-deprecated families
+# and services in PcdCryptoServiceFamilyEnable.
+#
+!if $(CRYPTO_SERVICES) IN "ALL TARGET_UINT_TESTS"
+[PcdsFixedAtBuild]
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
@@ -177,7 +221,12 @@ [PcdsFixedAtBuild]
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Ec.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
!endif
+#
+# Enable minimum set of families/services in PcdCryptoServiceFamilyEnable
+# required by typical PEI phase.
+#
!if $(CRYPTO_SERVICES) == MIN_PEI
+[PcdsFixedAtBuild]
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
@@ -192,7 +241,12 @@ [PcdsFixedAtBuild]
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword | TRUE
!endif
+#
+# Enable minimum set of families/services in PcdCryptoServiceFamilyEnable
+# required by typical DXE and SMM phases.
+#
!if $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
+[PcdsFixedAtBuild]
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs1v2Encrypt | TRUE
@@ -244,12 +298,61 @@ [PcdsFixedAtBuild]
# generated for it, but the binary will not be put into any firmware volume.
#
###################################################################################################
-[Components]
- CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
- CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibShell.inf
-!if $(CRYPTO_SERVICES) == PACKAGE
+#
+# If profile is TARGET_UNIT_TESTS, then build target-based unit tests
+# using the OpensslLib, BaseCryptLib, and TlsLib with the largest set of
+# available services.
+#
+!if $(CRYPTO_SERVICES) == TARGET_UNIT_TESTS
+[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
+ #
+ # Target based unit tests
+ #
+ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibShell.inf {
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+ <BuildOptions>
+ MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
+ MSFT:DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ MSFT:DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ MSFT:NOOPT_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ }
+
+[Components.IA32, Components.X64]
+ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibShell.inf {
+ <Defines>
+ FILE_GUID = B91B9A95-4D52-4501-A98F-A1711C14ED93
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+ <BuildOptions>
+ MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
+ MSFT:DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ MSFT:DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ MSFT:NOOPT_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
+ }
+
+[Components.RISCV64]
+ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibShell.inf {
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+ }
+!endif
+
+#
+# If profile is ALL, then do verification build of all library instances.
+#
+!if $(CRYPTO_SERVICES) == ALL
[Components]
+ #
+ # Build verification of all library instances
+ #
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -259,59 +362,218 @@ [Components]
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
CryptoPkg/Library/TlsLib/TlsLib.inf
CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
- CryptoPkg/Library/OpensslLib/OpensslLib.inf
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
-
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf
+ #
+ # Build verification of target-based unit tests
+ #
+ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibShell.inf {
+ <LibraryClasses>
+ UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.inf
+ UnitTestPersistenceLib|UnitTestFrameworkPkg/Library/UnitTestPersistenceLibNull/UnitTestPersistenceLibNull.inf
+ UnitTestResultReportLib|UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibConOut.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+ }
+
+[Components.IA32, Components.X64]
+ #
+ # Build verification of IA32/X64 specific libraries
+ #
+ CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+ CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
!endif
-!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI"
+#
+# If profile is ALL or NONE or MIN_PEI, then build CryptoPei with all supported
+# OpensslLib instances.
+#
+!if $(CRYPTO_SERVICES) in "ALL NONE MIN_PEI"
+[Components]
+ #
+ # CryptoPei with OpensslLib instance without SSL or EC services
+ #
+ CryptoPkg/Driver/CryptoPei.inf {
+ <Defines>
+ FILE_GUID = $(PEI_CRYPTO_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ }
+ #
+ # CryptoPei with OpensslLib instance without EC services
+ #
+ CryptoPkg/Driver/CryptoPei.inf {
+ <Defines>
+ FILE_GUID = $(PEI_STD_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ }
[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
+ #
+ # CryptoPei with OpensslLib instance with all services
+ #
+ CryptoPkg/Driver/CryptoPei.inf {
+ <Defines>
+ FILE_GUID = $(PEI_FULL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
+ }
+
+[Components.IA32, Components.X64]
+ #
+ # CryptoPei with IA32/X64 performance optimized OpensslLib instance without EC services
+ # IA32/X64 assembly optimizations required larger alignments
+ #
CryptoPkg/Driver/CryptoPei.inf {
<Defines>
- !if $(CRYPTO_SERVICES) == ALL
- FILE_GUID = 8DF53C2E-3380-495F-A8B7-370CFE28E1C6
- !elseif $(CRYPTO_SERVICES) == NONE
- FILE_GUID = E5A97EE3-71CC-407F-9DA9-6BE0C8A6C7DF
- !elseif $(CRYPTO_SERVICES) == MIN_PEI
- FILE_GUID = 0F5827A9-35FD-4F41-8D38-9BAFCE594D31
- !endif
+ FILE_GUID = $(PEI_STD_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
+ }
+
+ #
+ # CryptoPei with IA32/X64 performance optimized OpensslLib instance all services
+ # IA32/X64 assembly optimizations required larger alignments
+ #
+ CryptoPkg/Driver/CryptoPei.inf {
+ <Defines>
+ FILE_GUID = $(PEI_FULL_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
}
!endif
-!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_DXE_MIN_SMM"
-[Components.IA32, Components.X64, Components.AARCH64]
+#
+# If profile is ALL or NONE or MIN_DXE_MIN_SMM, then build CryptoDxe and
+# CryptoSmm using all supported OpensslLib instances.
+#
+!if $(CRYPTO_SERVICES) in "ALL NONE MIN_DXE_MIN_SMM"
+[Components]
+ #
+ # CryptoDxe with OpensslLib instance with no SSL or EC services
+ #
CryptoPkg/Driver/CryptoDxe.inf {
<Defines>
- !if $(CRYPTO_SERVICES) == ALL
- FILE_GUID = D9444B06-060D-42C5-9344-F04707BE0169
- !elseif $(CRYPTO_SERVICES) == NONE
- FILE_GUID = C7A340F4-A6CC-4F95-A2DA-42BEA4C3944A
- !elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
- FILE_GUID = DDF5BE9E-159A-4B77-B6D7-82B84B5763A2
- !endif
+ FILE_GUID = $(DXE_CRYPTO_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+ }
+ #
+ # CryptoDxe with OpensslLib instance with no EC services
+ #
+ CryptoPkg/Driver/CryptoDxe.inf {
+ <Defines>
+ FILE_GUID = $(DXE_STD_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ }
+[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
+ #
+ # CryptoDxe with OpensslLib instance with all services
+ #
+ CryptoPkg/Driver/CryptoDxe.inf {
+ <Defines>
+ FILE_GUID = $(DXE_FULL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
}
[Components.IA32, Components.X64]
+ #
+ # CryptoDxe with IA32/X64 performance optimized OpensslLib instance with no EC services
+ # with TLS feature enabled.
+ # IA32/X64 assembly optimizations required larger alignments
+ #
+ CryptoPkg/Driver/CryptoDxe.inf {
+ <Defines>
+ FILE_GUID = $(DXE_STD_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
+ }
+ #
+ # CryptoDxe with IA32/X64 performance optimized OpensslLib instance with all services.
+ # IA32/X64 assembly optimizations required larger alignments
+ #
+ CryptoPkg/Driver/CryptoDxe.inf {
+ <Defines>
+ FILE_GUID = $(DXE_FULL_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
+ }
+ #
+ # CryptoSmm with OpensslLib instance with no SSL or EC services
+ #
+ CryptoPkg/Driver/CryptoSmm.inf {
+ <Defines>
+ FILE_GUID = $(SMM_CRYPTO_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ }
+ #
+ # CryptoSmm with OpensslLib instance with no SSL services
+ #
+ CryptoPkg/Driver/CryptoSmm.inf {
+ <Defines>
+ FILE_GUID = $(SMM_STD_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+ }
+ #
+ # CryptoSmm with OpensslLib instance with no all services
+ #
+ CryptoPkg/Driver/CryptoSmm.inf {
+ <Defines>
+ FILE_GUID = $(SMM_FULL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
+ }
+ #
+ # CryptoSmm with IA32/X64 performance optimized OpensslLib instance with no EC services
+ # IA32/X64 assembly optimizations required larger alignments
+ #
+ CryptoPkg/Driver/CryptoSmm.inf {
+ <Defines>
+ FILE_GUID = $(SMM_STD_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
+ }
+ #
+ # CryptoSmm with IA32/X64 performance optimized OpensslLib instance with all services
+ # IA32/X64 assembly optimizations required larger alignments
+ #
CryptoPkg/Driver/CryptoSmm.inf {
<Defines>
- !if $(CRYPTO_SERVICES) == ALL
- FILE_GUID = A3542CE8-77F7-49DC-A834-45D37D2EC1FA
- !elseif $(CRYPTO_SERVICES) == NONE
- FILE_GUID = 6DCB3127-01E7-4131-A487-DC77A965A541
- !elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
- FILE_GUID = 85F7EA15-3A2B-474A-8875-180542CD6BF3
- !endif
+ FILE_GUID = $(SMM_FULL_ACCEL_GUID)
+ <LibraryClasses>
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
+ <BuildOptions>
+ MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
+ MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
}
!endif
[BuildOptions]
+ RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
-!if $(CRYPTO_SERVICES) IN "PACKAGE ALL"
- MSFT:*_*_*_CC_FLAGS = /D ENABLE_MD5_DEPRECATED_INTERFACES
- INTEL:*_*_*_CC_FLAGS = /D ENABLE_MD5_DEPRECATED_INTERFACES
- GCC:*_*_*_CC_FLAGS = -D ENABLE_MD5_DEPRECATED_INTERFACES
-!endif
--
2.37.1.windows.1
next prev parent reply other threads:[~2022-10-20 18:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 18:34 [Patch v2 00/16] CryptoPkg: Remove EC PCD and merge perf opt OpensslLibs Michael D Kinney
2022-10-20 18:34 ` [Patch v2 01/16] CryptoPkg: Document and disable deprecated crypto services Michael D Kinney
2022-10-20 18:34 ` [Patch v2 02/16] CryptoPkg/Library/BaseCryptLib: Add missing UNI file and fix format Michael D Kinney
2022-10-20 18:34 ` [Patch v2 03/16] CryptoPkg/Library/BaseCryptLib: Update internal functions/variables Michael D Kinney
2022-10-20 18:34 ` [Patch v2 04/16] CryptoPkg/Test/UnitTest/Library/BaseCryptLib: Unit test fixes Michael D Kinney
2022-10-20 18:34 ` [Patch v2 05/16] CryptoPkg/Library: Cleanup BaseCryptLib and TlsLib Michael D Kinney
2022-10-20 18:35 ` [Patch v2 06/16] CryptoPkg/Library/OpensslLib: Combine all performance optimized INFs Michael D Kinney
2022-10-20 18:35 ` [Patch v2 07/16] CryptoPkg/Library/OpensslLib: Produce consistent set of APIs Michael D Kinney
2022-10-20 18:35 ` [Patch v2 08/16] CryptoPkg/Library/OpensslLib: Remove PrintLib from INF files Michael D Kinney
2022-10-20 18:35 ` [Patch v2 09/16] CryptoPkg: Remove PcdOpensslEcEnabled from CryptoPkg.dec Michael D Kinney
2022-10-20 18:35 ` Michael D Kinney [this message]
2022-10-20 18:35 ` [Patch v2 11/16] CryptoPkg: Fixed host-based unit tests Michael D Kinney
2022-10-20 18:35 ` [Patch v2 12/16] CryptoPkg: Add Readme.md Michael D Kinney
2022-10-20 18:35 ` [Patch v2 13/16] Revert "CryptoPkg: Update process_files.pl to auto add PCD config option" Michael D Kinney
2022-10-20 18:35 ` [Patch v2 14/16] CryptoPkg/Library/OpensslLib: Update process_files.pl INF generation Michael D Kinney
2022-10-20 18:35 ` [Patch v2 15/16] CryptoPkg/Library/OpensslLib: Add generated flag to Accel INF Michael D Kinney
2022-10-20 18:35 ` [Patch v2 16/16] CryptoPkg/Library/OpensslLib: update auto-generated files Michael D Kinney
2022-10-24 3:52 ` [Patch v2 00/16] CryptoPkg: Remove EC PCD and merge perf opt OpensslLibs Yao, Jiewen
[not found] ` <1720E4F0EDFC384F.808@groups.io>
2022-10-24 3:54 ` [edk2-devel] " Yao, Jiewen
2022-10-24 5:43 ` Michael D Kinney
2022-10-24 6:24 ` Yao, Jiewen
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=20221020183510.1799-11-michael.d.kinney@intel.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