Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/edk2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c182ca6b6b692d79e6e622131a7c07fa2a881039
Choose a base ref
..
head repository: qemu/edk2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a865d01b2d6b20bed771003e7002d6e7bb62eca
Choose a head ref
Showing with 606 additions and 199 deletions.
  1. +21 −2 .azurepipelines/templates/pr-gate-build-job.yml
  2. +2 −2 EmulatorPkg/Unix/Host/Host.c
  3. +11 −0 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
  4. +2 −1 IntelFsp2Pkg/FspSecCore/SecFsp.c
  5. +8 −2 IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
  6. +12 −11 StandaloneMmPkg/Core/StandaloneMmCore.c
  7. +2 −0 StandaloneMmPkg/Core/StandaloneMmCore.h
  8. +1 −0 StandaloneMmPkg/Core/StandaloneMmCore.inf
  9. +1 −82 StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c
  10. +0 −7 StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
  11. +0 −30 ...aloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h
  12. +30 −0 UefiCpuPkg/Include/Library/BaseArchLibSupport.h
  13. +27 −0 UefiCpuPkg/Library/BaseArchSupportLib/AArch64/AArch64LibSupport.c
  14. +29 −0 UefiCpuPkg/Library/BaseArchSupportLib/BaseArchSupportLib.inf
  15. +26 −0 UefiCpuPkg/Library/BaseArchSupportLib/X86/X86LibSupport.c
  16. +5 −0 UefiCpuPkg/UefiCpuPkg.dec
  17. +4 −0 UefiCpuPkg/UefiCpuPkg.dsc
  18. +1 −0 UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAcpiBoardInfo.inf
  19. +4 −0 UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
  20. +68 −0 UefiPayloadPkg/UefiPayloadEntry/AArch64/DxeHandoff.c
  21. +26 −0 UefiPayloadPkg/UefiPayloadEntry/AArch64/DxeLoadFuncFit.c
  22. +7 −2 UefiPayloadPkg/UefiPayloadEntry/FitUniversalPayloadEntry.inf
  23. +2 −0 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
  24. +2 −12 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
  25. +6 −0 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
  26. +7 −2 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
  27. +6 −2 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
  28. +5 −0 UefiPayloadPkg/UefiPayloadPkg.dec
  29. +251 −29 UefiPayloadPkg/UefiPayloadPkg.dsc
  30. +36 −14 UefiPayloadPkg/UefiPayloadPkg.fdf
  31. +4 −1 UefiPayloadPkg/UniversalPayloadBuild.py
23 changes: 21 additions & 2 deletions .azurepipelines/templates/pr-gate-build-job.yml
Original file line number Diff line number Diff line change
@@ -28,47 +28,66 @@ jobs:
TARGET_GCC_ONLY:
Build.Pkgs: 'EmbeddedPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_ARM_ARMPLATFORM:
Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_MDE_CPU:
Build.Pkgs: 'MdePkg,UefiCpuPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_MDEMODULE_DEBUG:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'DEBUG,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_MDEMODULE_RELEASE:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'RELEASE,NO-TARGET'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_NETWORK:
Build.Pkgs: 'NetworkPkg,RedfishPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_OTHER:
Build.Pkgs: 'PcAtChipsetPkg,PrmPkg,ShellPkg,SourceLevelDebugPkg,StandaloneMmPkg,SignedCapsulePkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_FMP_FAT_TEST:
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_CRYPTO_DEBUG:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'DEBUG,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_CRYPTO_RELEASE:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'RELEASE,NO-TARGET'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_FSP:
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}
TARGET_SECURITY:
Build.Pkgs: 'SecurityPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_UEFIPAYLOAD:
Build.Archlist: ${{ parameters.arch_list }}
TARGET_UEFIPAYLOAD_IA32_X64:
Build.Pkgs: 'UefiPayloadPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: 'IA32,X64'
${{ if eq(parameters.tool_chain_tag, 'GCC5') }}:
TARGET_UEFIPAYLOAD_AARCH64_GCC_ONLY:
Build.Pkgs: 'UefiPayloadPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Build.Archlist: 'AARCH64'
TARGET_PLATFORMS:
# For Platforms only check code. Leave it to Platform CI
# to build them.
Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
Build.Targets: 'NO-TARGET,NOOPT'
Build.Archlist: ${{ parameters.arch_list }}

workspace:
clean: all
@@ -85,7 +104,7 @@ jobs:
tool_chain_tag: ${{ parameters.tool_chain_tag }}
build_pkgs: $(Build.Pkgs)
build_targets: $(Build.Targets)
build_archs: ${{ parameters.arch_list }}
build_archs: $(Build.Archlist)
usePythonVersion: ${{ parameters.usePythonVersion }}
extra_install_step: ${{ parameters.extra_install_step }}

4 changes: 2 additions & 2 deletions EmulatorPkg/Unix/Host/Host.c
Original file line number Diff line number Diff line change
@@ -1217,9 +1217,9 @@ GdbScriptRemoveImage (
FILE *GdbTempFile;

//
// Need to skip .PDB files created from VC++
// Need to skip images which dont have pdb area and .PDB files created from VC++
//
if (IsPdbFile (ImageContext->PdbPointer)) {
if ((ImageContext->PdbPointer == NULL) || (IsPdbFile (ImageContext->PdbPointer))) {
return;
}

11 changes: 11 additions & 0 deletions IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
Original file line number Diff line number Diff line change
@@ -185,6 +185,16 @@ endstruc
global ASM_PFX(LoadUpdPointerToECX)
ASM_PFX(LoadUpdPointerToECX):
;
; Inputs:
; esp -> stack with FsptUpdDataPtr parameter
; Outputs:
; eax -> Address of FspInfoHeader
; ecx -> Address of FSP-T UPD structure
; Register Usage:
; ebp is used for return address.
; All others reserved.
;

; esp + 4 is input UPD parameter
; If esp + 4 is NULL the default UPD should be used
; ecx will be the UPD region that should be used
@@ -600,6 +610,7 @@ ASM_PFX(TempRamInitApi):
SAVE_EDX

CALL_EBP ASM_PFX(LoadUpdPointerToECX) ; ECX for UPD param
mov esi, eax ; eax contains FspInfoHeader address after previous call
SAVE_ECX ; save UPD param to slot 3 in xmm6

mov edx, ASM_PFX(PcdGet32 (PcdTemporaryRamSize))
3 changes: 2 additions & 1 deletion IntelFsp2Pkg/FspSecCore/SecFsp.c
Original file line number Diff line number Diff line change
@@ -133,14 +133,15 @@ FspGlobalDataInit (
UINTN Idx;

//
// Set FSP Global Data pointer
// Set FSP Global Data pointer when FSP runs in API mode
//
SetFspGlobalDataPointer (PeiFspData);
ZeroMem ((VOID *)PeiFspData, sizeof (FSP_GLOBAL_DATA));

PeiFspData->Signature = FSP_GLOBAL_DATA_SIGNATURE;
PeiFspData->Version = FSP_GLOBAL_DATA_VERSION;
PeiFspData->CoreStack = BootLoaderStack;
PeiFspData->FspMode = FSP_IN_API_MODE;
PeiFspData->PerfIdx = 2;
PeiFspData->PerfSig = FSP_PERFORMANCE_DATA_SIGNATURE;
//
10 changes: 8 additions & 2 deletions IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
Original file line number Diff line number Diff line change
@@ -451,19 +451,25 @@ ASM_PFX(TempRamInitApi):
;
; Save Input Parameter in YMM10
;
SAVE_RCX
;
; Get FspInfoHeader address
;
CALL_RDI ASM_PFX(AsmGetFspInfoHeaderNoStack)
mov rsi, rax
LOAD_RCX
cmp rcx, 0
jnz ParamValid

;
; Fall back to default UPD
;
CALL_RDI ASM_PFX(AsmGetFspInfoHeaderNoStack)
xor rcx, rcx
mov ecx, DWORD [rax + 01Ch] ; Read FsptImageBaseAddress
add ecx, DWORD [rax + 024h] ; Get Cfg Region base address = FsptImageBaseAddress + CfgRegionOffset
ParamValid:
SAVE_RCX

ParamValid:
mov rdx, ASM_PFX(PcdGet32 (PcdTemporaryRamSize))
mov edx, DWORD [rdx]
;
23 changes: 12 additions & 11 deletions StandaloneMmPkg/Core/StandaloneMmCore.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
MM Core Main Entry Point
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2025, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -797,14 +797,8 @@ StandaloneMmMain (
EFI_MMRAM_DESCRIPTOR *MmramRanges;
UINTN MmramRangeCount;

ProcessLibraryConstructorList (HobStart, &gMmCoreMmst);

DEBUG ((DEBUG_INFO, "MmMain - 0x%x\n", HobStart));

DEBUG_CODE (
PrintHobList (HobStart, NULL);
);

//
// Extract the MMRAM ranges from the MMRAM descriptor HOB
//
@@ -838,16 +832,23 @@ StandaloneMmMain (
}

//
// No need to initialize memory service.
// It is done in the constructor of StandaloneMmCoreMemoryAllocationLib(),
// so that the library linked with StandaloneMmCore can use AllocatePool() in
// the constructor.
// Initialize memory service using free MMRAM
//
DEBUG ((DEBUG_INFO, "MmInitializeMemoryServices\n"));
MmInitializeMemoryServices (MmramRangeCount, MmramRanges);
mMemoryAllocationMmst = &gMmCoreMmst;

//
// Install HobList
//
gHobList = InitializeMmHobList (HobStart, MmramRanges, MmramRangeCount);

ProcessLibraryConstructorList (gHobList, &gMmCoreMmst);

DEBUG_CODE (
PrintHobList (gHobList, NULL);
);

//
// Register notification for EFI_MM_CONFIGURATION_PROTOCOL registration and
// use it to register the MM Foundation entrypoint
2 changes: 2 additions & 0 deletions StandaloneMmPkg/Core/StandaloneMmCore.h
Original file line number Diff line number Diff line change
@@ -50,6 +50,8 @@

#include "StandaloneMmCorePrivateData.h"

extern EFI_MM_SYSTEM_TABLE *mMemoryAllocationMmst;

//
// Used to build a table of MMI Handlers that the MM Core registers
//
1 change: 1 addition & 0 deletions StandaloneMmPkg/Core/StandaloneMmCore.inf
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@
gMmCommBufferHobGuid
gEfiSmmSmramMemoryGuid
gEdkiiPiSmmMemoryAttributesTableGuid
gEfiMmPeiMmramMemoryReserveGuid

[Pcd]
gStandaloneMmPkgTokenSpaceGuid.PcdFwVolMmMaxEncapsulationDepth ##CONSUMES
Original file line number Diff line number Diff line change
@@ -10,14 +10,11 @@

#include <PiMm.h>

#include <Guid/MmramMemoryReserve.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include "StandaloneMmCoreMemoryAllocationServices.h"

static EFI_MM_SYSTEM_TABLE *mMemoryAllocationMmst = NULL;
EFI_MM_SYSTEM_TABLE *mMemoryAllocationMmst = NULL;

/**
Allocates one or more 4KB pages of a certain memory type.
@@ -827,81 +824,3 @@ FreePool (
Status = mMemoryAllocationMmst->MmFreePool (Buffer);
ASSERT_EFI_ERROR (Status);
}

/**
The constructor function calls MmInitializeMemoryServices to initialize
memory in MMRAM and caches EFI_MM_SYSTEM_TABLE pointer.
@param [in] ImageHandle The firmware allocated handle for the EFI image.
@param [in] MmSystemTable A pointer to the Management mode System Table.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
MemoryAllocationLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_MM_SYSTEM_TABLE *MmSystemTable
)
{
VOID *HobStart;
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
EFI_MMRAM_DESCRIPTOR *MmramRanges;
UINTN MmramRangeCount;
EFI_HOB_GUID_TYPE *MmramRangesHob;

HobStart = GetHobList ();
DEBUG ((DEBUG_INFO, "StandaloneMmCoreMemoryAllocationLibConstructor - 0x%x\n", HobStart));

//
// Search for a Hob containing the MMRAM ranges
//
MmramRangesHob = GetNextGuidHob (&gEfiSmmSmramMemoryGuid, HobStart);
if (MmramRangesHob == NULL) {
MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart);
if (MmramRangesHob == NULL) {
return EFI_UNSUPPORTED;
}
}

MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
if (MmramRangesHobData == NULL) {
return EFI_UNSUPPORTED;
}

MmramRanges = MmramRangesHobData->Descriptor;
if (MmramRanges == NULL) {
return EFI_UNSUPPORTED;
}

MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
if (MmramRanges == NULL) {
return EFI_UNSUPPORTED;
}

{
UINTN Index;

DEBUG ((DEBUG_INFO, "MmramRangeCount - 0x%x\n", MmramRangeCount));
for (Index = 0; Index < MmramRangeCount; Index++) {
DEBUG ((
DEBUG_INFO,
"MmramRanges[%d]: 0x%016lx - 0x%016lx\n",
Index,
MmramRanges[Index].CpuStart,
MmramRanges[Index].PhysicalSize
));
}
}

//
// Initialize memory service using free MMRAM
//
DEBUG ((DEBUG_INFO, "MmInitializeMemoryServices\n"));
MmInitializeMemoryServices ((UINTN)MmramRangeCount, (VOID *)(UINTN)MmramRanges);

// Initialize MM Services Table
mMemoryAllocationMmst = MmSystemTable;
return EFI_SUCCESS;
}
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
VERSION_STRING = 1.0
PI_SPECIFICATION_VERSION = 0x00010032
LIBRARY_CLASS = MemoryAllocationLib|MM_CORE_STANDALONE
CONSTRUCTOR = MemoryAllocationLibConstructor

#
# The following information is for reference only and not required by the build tools.
@@ -29,7 +28,6 @@

[Sources]
StandaloneMmCoreMemoryAllocationLib.c
StandaloneMmCoreMemoryAllocationServices.h

[Packages]
MdePkg/MdePkg.dec
@@ -38,8 +36,3 @@
[LibraryClasses]
BaseMemoryLib
DebugLib
HobLib

[Guids]
gEfiMmPeiMmramMemoryReserveGuid
gEfiSmmSmramMemoryGuid

This file was deleted.

Loading