Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b984e2d
EmulatorPkg: Add RngDxe to EmulatorPkg
May 20, 2024
8acea85
EmulatorPkg: Add Hash2DxeCrypto to EmulatorPkg
Flickdm May 9, 2024
7e1a589
OvmfPkg PlatformCI: Support virtio-rng-pci
May 20, 2024
f44d74f
OvmfPkg: Add Hash2DxeCrypto to OvmfPkg
Flickdm May 9, 2024
836db9a
ArmVirtPkg PlatformCI: Support virtio-rng-pci
May 20, 2024
2e0c3b6
ArmVirtPkg: Add Hash2DxeCrypto to ArmVirtPkg
May 20, 2024
f9cd9da
SecurityPkg RngDxe: Remove incorrect limitation on GetRng
May 20, 2024
b2669f1
NetworkPkg: SECURITY PATCH CVE-2023-45237
Flickdm May 9, 2024
e722631
NetworkPkg TcpDxe: SECURITY PATCH CVE-2023-45236
Flickdm May 9, 2024
03739bb
MdePkg: Add MockUefiBootServicesTableLib
Flickdm May 9, 2024
a58ee05
MdePkg: Adds Protocol for MockRng
Flickdm May 9, 2024
5ee8e26
MdePkg: Add MockHash2 Protocol for testing
Flickdm May 9, 2024
1c7c76d
NetworkPkg: Update the PxeBcDhcp6GoogleTest due to underlying changes
Flickdm May 9, 2024
d6ad577
ArmPkg: Allow SMC/HVC monitor conduit to be specified at runtime
ardbiesheuvel May 13, 2024
04329a7
ArmVirtPkg: Move PcdMonitorConduitHvc
May 20, 2024
8d2fc9a
MdePkg/BaseRngLib AARCH64: Remove overzealous ASSERT()
ardbiesheuvel May 13, 2024
9259930
ArmVirtPkg/ArmVirtQemu: Permit the use of dynamic PCDs in PEI
ardbiesheuvel May 13, 2024
432d6b7
ArmVirtPkg: Use dynamic PCD to set the SMCCC conduit
ardbiesheuvel May 13, 2024
1ceaa1c
ArmVirtPkg: Reverse inclusion order of MdeLibs.inc and ArmVirt.dsc.inc
ardbiesheuvel May 13, 2024
30b237f
ArmVirtPkg/ArmVirtQemu: Add RngDxe driver
ardbiesheuvel May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ArmPkg/ArmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@
# Define if the GICv3 controller should use the GICv2 legacy
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042

## Define the conduit to use for monitor calls.
# Default PcdMonitorConduitHvc = FALSE, conduit = SMC
# If PcdMonitorConduitHvc = TRUE, conduit = HVC
gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047

# Whether to remap all unused memory NX before installing the CPU arch
# protocol driver. This is needed on platforms that map all DRAM with RWX
# attributes initially, and can be disabled otherwise.
Expand Down Expand Up @@ -317,6 +312,11 @@
gArmTokenSpaceGuid.PcdSystemBiosRelease|0xFFFF|UINT16|0x30000058
gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease|0xFFFF|UINT16|0x30000059

## Define the conduit to use for monitor calls.
# Default PcdMonitorConduitHvc = FALSE, conduit = SMC
# If PcdMonitorConduitHvc = TRUE, conduit = HVC
gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047

[PcdsFixedAtBuild.common, PcdsDynamic.common]
#
# ARM Architectural Timer
Expand Down
2 changes: 1 addition & 1 deletion ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ArmMonitorCall (
IN OUT ARM_MONITOR_ARGS *Args
)
{
if (FeaturePcdGet (PcdMonitorConduitHvc)) {
if (PcdGetBool (PcdMonitorConduitHvc)) {
ArmCallHvc ((ARM_HVC_ARGS *)Args);
} else {
ArmCallSmc ((ARM_SMC_ARGS *)Args);
Expand Down
5 changes: 4 additions & 1 deletion ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
!endif
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
ArmTrngLib|ArmPkg/Library/ArmTrngLib/ArmTrngLib.inf
ArmMonitorLib|ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf

#
# Secure Boot dependencies
Expand Down Expand Up @@ -266,6 +268,7 @@

[LibraryClasses.ARM]
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf

[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
Expand Down
3 changes: 3 additions & 0 deletions ArmVirtPkg/ArmVirtCloudHv.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
[PcdsDynamicHii]
gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gOvmfVariableGuid|0x0|FALSE|NV,BS

[PcdsPatchableInModule.common]
gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform
Expand Down
4 changes: 2 additions & 2 deletions ArmVirtPkg/ArmVirtKvmTool.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@
# Use MMIO for accessing RTC controller registers.
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcUseMmio|TRUE

gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F

Expand Down Expand Up @@ -167,6 +165,8 @@
#
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|16

gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

[PcdsPatchableInModule.common]
#
# This will be overridden in the code
Expand Down
20 changes: 13 additions & 7 deletions ArmVirtPkg/ArmVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@

!include NetworkPkg/NetworkDefines.dsc.inc

!include ArmVirtPkg/ArmVirt.dsc.inc

!include MdePkg/MdeLibs.dsc.inc

!include ArmVirtPkg/ArmVirt.dsc.inc

[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
Expand Down Expand Up @@ -293,6 +293,10 @@
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01

# whether to use HVC or SMC to issue monitor calls - this typically depends
# on the exception level at which the UEFI system firmware executes
gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

#
# TPM2 support
#
Expand All @@ -318,11 +322,7 @@
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5

[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM]
!if $(TPM2_ENABLE) == TRUE
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
!else
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
!endif

################################################################################
#
Expand All @@ -339,11 +339,11 @@
ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf
ArmPkg/Drivers/CpuPei/CpuPei.inf

!if $(TPM2_ENABLE) == TRUE
MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
<LibraryClasses>
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
}
!if $(TPM2_ENABLE) == TRUE
MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {
<LibraryClasses>
ResetSystemLib|ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf
Expand Down Expand Up @@ -432,6 +432,7 @@
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
}
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf

#
# Status Code Routing
Expand Down Expand Up @@ -554,6 +555,11 @@
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

#
# Hash2 Protocol Support
#
SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf

#
# TPM2 support
#
Expand Down
2 changes: 1 addition & 1 deletion ArmVirtPkg/ArmVirtQemu.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ READ_LOCK_STATUS = TRUE
INF ArmPkg/Drivers/CpuPei/CpuPei.inf
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf

!if $(TPM2_ENABLE) == TRUE
INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
!if $(TPM2_ENABLE) == TRUE
INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf
INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
Expand Down
6 changes: 6 additions & 0 deletions ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ READ_LOCK_STATUS = TRUE
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf

#
# FAT filesystem + GPT/MBR partitioning + UDF filesystem + virtio-fs
Expand Down Expand Up @@ -177,6 +178,11 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

#
# Hash2 Protocol producer
#
INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf

#
# TPM2 support
#
Expand Down
12 changes: 10 additions & 2 deletions ArmVirtPkg/ArmVirtQemuKernel.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

!include NetworkPkg/NetworkDefines.dsc.inc

!include ArmVirtPkg/ArmVirt.dsc.inc

!include MdePkg/MdeLibs.dsc.inc

!include ArmVirtPkg/ArmVirt.dsc.inc

[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
Expand Down Expand Up @@ -203,6 +203,8 @@
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0

gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

[PcdsDynamicDefault.common]
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3

Expand Down Expand Up @@ -339,6 +341,7 @@
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
}
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf

#
# Status Code Routing
Expand Down Expand Up @@ -461,6 +464,11 @@
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

#
# Hash2 Protocol Support
#
SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf

#
# ACPI Support
#
Expand Down
6 changes: 4 additions & 2 deletions ArmVirtPkg/ArmVirtXen.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
SKUID_IDENTIFIER = DEFAULT
FLASH_DEFINITION = ArmVirtPkg/ArmVirtXen.fdf

!include ArmVirtPkg/ArmVirt.dsc.inc

!include MdePkg/MdeLibs.dsc.inc

!include ArmVirtPkg/ArmVirt.dsc.inc

[LibraryClasses]
SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf
!if $(TARGET) != RELEASE
Expand Down Expand Up @@ -120,6 +120,8 @@
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFvBaseAddress|0x0

gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE

[PcdsDynamicDefault.common]

gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0
Expand Down
14 changes: 14 additions & 0 deletions ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <Library/FdtSerialPortAddressLib.h>
#include <libfdt.h>

#include <Chipset/AArch64.h>

#include <Guid/EarlyPL011BaseAddress.h>
#include <Guid/FdtHob.h>

Expand Down Expand Up @@ -224,5 +226,17 @@ PlatformPeim (

BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize));

#ifdef MDE_CPU_AARCH64
//
// Set the SMCCC conduit to SMC if executing at EL2, which is typically the
// exception level that services HVCs rather than the one that invokes them.
//
if (ArmReadCurrentEL () == AARCH64_EL2) {
Status = PcdSetBoolS (PcdMonitorConduitHvc, FALSE);
ASSERT_EFI_ERROR (Status);
}

#endif

return EFI_SUCCESS;
}
1 change: 1 addition & 0 deletions ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

[Pcd]
gArmTokenSpaceGuid.PcdFvBaseAddress
gArmTokenSpaceGuid.PcdMonitorConduitHvc
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOMETIMES_PRODUCES
gUefiOvmfPkgTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress

Expand Down
2 changes: 2 additions & 0 deletions ArmVirtPkg/PlatformCI/PlatformBuildLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def FlashRomImage(self):
args += " -serial stdio"
# Mount disk with startup.nsh
args += f" -drive file=fat:rw:{VirtualDrive},format=raw,media=disk"
# Provides Rng services to the Guest VM
args += " -device virtio-rng-pci"

# Conditional Args
if (self.env.GetValue("QEMU_HEADLESS").upper() == "TRUE"):
Expand Down
14 changes: 12 additions & 2 deletions EmulatorPkg/EmulatorPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
ImagePropertiesRecordLib|MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf

!if $(SECURE_BOOT_ENABLE) == TRUE
RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf

!if $(SECURE_BOOT_ENABLE) == TRUE
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
Expand Down Expand Up @@ -398,6 +399,15 @@
EmulatorPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
EmulatorPkg/TimerDxe/Timer.inf

#
# Rng Protocol producer
#
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
#
# Hash2 Protocol producer
#
SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
!endif
Expand Down
11 changes: 10 additions & 1 deletion EmulatorPkg/EmulatorPkg.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ INF RuleOverride = UI MdeModulePkg/Application/UiApp/UiApp.inf
INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
INF MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf

#
# Rng Protocol producer
#
INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf

#
# Hash2 Protocol producer
#
INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf

#
# Secure Boot Key Enroll
#
Expand Down Expand Up @@ -320,4 +330,3 @@ INF ShellPkg/Application/Shell/Shell.inf
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}

1 change: 0 additions & 1 deletion MdePkg/Library/BaseRngLib/AArch64/Rndr.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ BaseRngLibConstructor (
// MSR. A non-zero value indicates that the processor supports the RNDR instruction.
//
Isar0 = ArmReadIdIsar0 ();
ASSERT ((Isar0 & RNDR_MASK) != 0);

mRndrSupported = ((Isar0 & RNDR_MASK) != 0);

Expand Down
1 change: 1 addition & 0 deletions MdePkg/Test/MdePkgHostTest.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/MockUefiRuntimeServicesTableLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockUefiBootServicesTableLib/MockUefiBootServicesTableLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiServicesLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockFdtLib/MockFdtLib.inf
Loading