Skip to content

Commit e67e7a8

Browse files
committed
QemuSbsaPkg: Wire up OneCrypto binary drivers
Update QemuSbsaPkg DSC and FDF to use OneCrypto binary drivers instead of autogenerated shared crypto include files. Map BaseCryptLib to BaseCryptLibOnOneCrypto for DXE and StandaloneMM phases, and include OneCrypto loader and binary drivers in the FDF. Signed-off-by: Doug Flick <dougflick@microsoft.com>
1 parent 30c5dc8 commit e67e7a8

File tree

2 files changed

+56
-12
lines changed

2 files changed

+56
-12
lines changed

Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,19 @@
7575
DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
7676
DEFINE NETWORK_ISCSI_ENABLE = FALSE
7777

78+
# PEI uses BaseCrypto (OneCrypto doesn't have PEI support yet)
7879
PEI_CRYPTO_SERVICES = TINY_SHA
79-
DXE_CRYPTO_SERVICES = STANDARD
80-
RUNTIMEDXE_CRYPTO_SERVICES = NONE
81-
STANDALONEMM_CRYPTO_SERVICES = STANDARD
82-
STANDALONEMM_MMSUPV_CRYPTO_SERVICES = NONE
83-
SMM_CRYPTO_SERVICES = NONE
8480
PEI_CRYPTO_ARCH = AARCH64
85-
DXE_CRYPTO_ARCH = AARCH64
81+
# DXE and StandaloneMM use OneCrypto - set to NONE to skip BaseCrypto drivers
82+
DXE_CRYPTO_SERVICES = NONE
83+
DXE_CRYPTO_ARCH = NONE
84+
RUNTIMEDXE_CRYPTO_SERVICES = NONE
8685
RUNTIMEDXE_CRYPTO_ARCH = NONE
87-
STANDALONEMM_CRYPTO_ARCH = AARCH64
86+
STANDALONEMM_CRYPTO_SERVICES = NONE
87+
STANDALONEMM_CRYPTO_ARCH = NONE
88+
STANDALONEMM_MMSUPV_CRYPTO_SERVICES = NONE
8889
STANDALONEMM_MMSUPV_CRYPTO_ARCH = NONE
90+
SMM_CRYPTO_SERVICES = NONE
8991
SMM_CRYPTO_ARCH = NONE
9092

9193
!if $(NETWORK_SNP_ENABLE) == TRUE
@@ -385,6 +387,9 @@
385387

386388
[LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
387389
ArmFfaLib|MdeModulePkg/Library/ArmFfaLib/ArmFfaDxeLib.inf
390+
# OneCrypto library for DXE drivers and UEFI applications
391+
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/DxeCryptLib.inf
392+
TlsLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/DxeCryptLib.inf
388393

389394
[LibraryClasses.common.UEFI_APPLICATION]
390395
CheckHwErrRecHeaderLib|MsWheaPkg/Library/CheckHwErrRecHeaderLib/CheckHwErrRecHeaderLib.inf
@@ -443,6 +448,9 @@
443448
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
444449
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
445450
ResetSystemLib|MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.inf
451+
# OneCrypto library for runtime drivers
452+
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/DxeCryptLib.inf
453+
TlsLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/DxeCryptLib.inf
446454

447455
[LibraryClasses.common.MM_CORE_STANDALONE]
448456
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
@@ -474,6 +482,9 @@
474482
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
475483
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
476484
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
485+
# OneCrypto library for StandaloneMM - uses gOneCryptoProtocolGuid
486+
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/StandaloneMmCryptLib.inf
487+
TlsLib|CryptoPkg/Library/BaseCryptLibOnOneCrypto/StandaloneMmCryptLib.inf
477488

478489
VirtNorFlashPlatformLib|QemuSbsaPkg/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
479490
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
@@ -798,7 +809,7 @@
798809
# below 4 GB needlessly fragment the memory map. So expose the 64-bit entry
799810
# point only, for entry point versions >= 3.0.
800811
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosEntryPointProvideMethod|0x2
801-
812+
802813
# System Memory Size -- 128 MB initially, actual size will be fetched from DT, and installed
803814
# into resource descriptor hobs.
804815
gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000
@@ -902,6 +913,26 @@
902913
[Components]
903914
!include $(SHARED_CRYPTO_PATH)/Driver/Bin/CryptoDriver.inc.dsc
904915

916+
#
917+
# OneCrypto Binary Drivers
918+
#
919+
$(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoLoaders/OneCryptoLoaderDxe.inf {
920+
<PcdsPatchableInModule>
921+
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
922+
}
923+
$(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoLoaders/OneCryptoLoaderStandaloneMm.inf {
924+
<PcdsPatchableInModule>
925+
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
926+
}
927+
$(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoBin/OneCryptoBinStandaloneMm.inf {
928+
<PcdsPatchableInModule>
929+
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
930+
}
931+
$(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoBin/OneCryptoBinDxe.inf {
932+
<PcdsPatchableInModule>
933+
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
934+
}
935+
905936
#
906937
# SEC Phase module
907938
#
@@ -1178,7 +1209,7 @@
11781209
## Where-Object {(Select-String -InputObject $_ -Pattern "MODULE_TYPE\s*=\s*UEFI_APPLICATION")} | ^
11791210
## ForEach-Object {$path = $_.FullName -replace '\\','/'; Write-Output $path}
11801211
!if $(BUILD_UNIT_TESTS) == TRUE
1181-
1212+
CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BaseCryptLibUnitTestApp.inf
11821213
AdvLoggerPkg/UnitTests/LineParser/LineParserTestApp.inf
11831214
DfciPkg/UnitTests/DeviceIdTest/DeviceIdTestApp.inf
11841215
# DfciPkg/UnitTests/DfciVarLockAudit/UEFI/DfciVarLockAuditTestApp.inf # DOESN'T PRODUCE OUTPUT

Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,13 @@ READ_LOCK_STATUS = TRUE
233233
INF UefiTestingPkg/FunctionalSystemTests/MpManagement/Driver/MpManagement.inf
234234
INF UefiTestingPkg/FunctionalSystemTests/MpManagement/App/MpManagementTestApp.inf
235235

236-
!include $(SHARED_CRYPTO_PATH)/Driver/Bin/CryptoDriver.DXE.inc.fdf
237-
236+
#
237+
# OneCrypto DXE Driver
238+
#
239+
!if $(ARCH) == AARCH64
240+
INF $(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoLoaders/OneCryptoLoaderDxe.inf
241+
INF $(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoBin/OneCryptoBinDxe.inf
242+
!endif
238243
#
239244
# Multiple Console IO support
240245
#
@@ -521,7 +526,15 @@ READ_LOCK_CAP = TRUE
521526
READ_LOCK_STATUS = TRUE
522527

523528
INF StandaloneMmPkg/Core/StandaloneMmCore.inf
524-
!include $(SHARED_CRYPTO_PATH)/Driver/Bin/CryptoDriver.STANDALONEMM.inc.fdf
529+
530+
#
531+
# OneCrypto StandaloneMM Drivers
532+
#
533+
!if $(ARCH) == AARCH64
534+
INF $(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoLoaders/OneCryptoLoaderStandaloneMm.inf
535+
INF $(ONE_CRYPTO_PATH)/$(TARGET)/AARCH64/OneCryptoBin/OneCryptoBinStandaloneMm.inf
536+
!endif
537+
525538
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf
526539
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
527540
INF QemuSbsaPkg/VirtNorFlashStandaloneMm/VirtNorFlashStandaloneMm.inf

0 commit comments

Comments
 (0)