summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-08-28StandaloneMmPkg/Core: Install protocol to notify MmEndOfPei eventWei6 Xu3-0/+65
When the EndOfPei event is signaled, installs the MM EndOfPei Protocol so MM Drivers are informed that EndOfPei event is signaled. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg: Support using gEfiSmmSmramMemoryGuid to get MMRAM rangeWei6 Xu6-6/+18
Add the support using gEfiSmmSmramMemoryGuid to get MMRAM ranges. If gEfiSmmSmramMemoryGuid HOB is not found, then try to get MMRAM ranges from gEfiMmPeiMmramMemoryReserveGuid HOB. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Restart dispatcher once MmEntryPoint is registeredWei6 Xu5-1/+82
Defer the dispatch of the remaining MM drivers once the CPU driver has been dispatched. In MmDispatcher, return immediately if the MM Entry Point was registered. Then the MM IPL will reinvoke the MM Core Dispatcher. This is required so MM Mode may be enabled as soon as all the dependent MM Drivers for MM Mode have been dispatched. Introduce a FeatureFlag PCD to control if MmDispatcher returns or not when MmEntryPointPoint is registered. Default value is FALSE. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Remove unused mMmramRanges and mMmramRangeCountWei6 Xu1-15/+3
mMmramRanges and mMmramRangeCount are the global variables that are used to cache the MMRAM Ranges info, but they are not used in MM Core. Therefore, remove mMmramRanges and mMmramRangeCount. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg: Remove definition for MM_CORE_PRIVATE_DATAWei6 Xu2-129/+0
MM_CORE_PRIVATE_DATA is not used as shared structures between MM IPL and MM Core, therefore clean up definition for MM_CORE_PRIVATE_DATA. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmMemLib: Drop MM_CORE_PRIVATE_DATAWei6 Xu2-33/+11
MM_CORE_PRIVATE_DATA is not used as shared structures between MM IPL and MM Core, therefore clean up the code related to gMmCorePrivate. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmCoreMemoryAllocationLib: Drop MM_CORE_PRIVATE_DATAWei6 Xu2-30/+16
MM_CORE_PRIVATE_DATA is not used as shared structures between MM IPL and MM Core, therefore clean up the code related to gMmCorePrivate. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Drop MM_CORE_PRIVATE_DATAWei6 Xu4-97/+30
MM_CORE_PRIVATE_DATA is not used as shared structures between MM IPL and MM Core, therefore clean up the code related to gMmCorePrivate. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Introduce MM Communication BufferWei6 Xu3-24/+120
Get the MM Communication context from the MM Communication Buffer, instead of the pointer inside gMmCorePrivate. In the MmEntryPoint, check IsCommBufferValid from MM_COMM_BUFFER to decide whether the MMI is Synchronous MMI or Asynchronous MMI. If it is a Synchronous MMI, MM Core shadows the communication buffer into a internal copy, then invokes the MMI handlers, lastly copies data back to the MM Communication Buffer and set the return status. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Switch to MM HobList after MM HostList is readyWei6 Xu1-0/+1
Switch to MM HobList as soon as MM HostList is initialized to avoid StandaloneMmCore still using the HobList which is outside of MMRAM. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Install Loaded Image Protocol for MM CoreWei6 Xu1-0/+85
Retrieves the MM Core image info from Memory Allocation HOB reported by MM IPL. Then install Loaded Image Protocol for MM Core with the image info from HOB. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Install Loaded Image Protocol for MM driversWei6 Xu2-1/+33
Install Loaded Image Protocol into MM handle database for each MM driver. Change EFI_MM_DRIVER_ENTRY structure definition to hold the Loaded Image Protocol data directly, instead a pointer to the protocol, to avoid allocating pool for each MM driver. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/Core: Remove traditional MM driver supportWei6 Xu5-88/+14
StandaloneMmCore should not support dispatching traditional MM driver which has dependency on UEFI services. Therefore, remove the related code that supports traditional MM driver. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2024-08-28StandaloneMmPkg/MmIpl: Create memory resource HOBsZhang Hongbin4-0/+313
If PcdCpuSmmRestrictedMemoryAccess is TRUE, only unblocked memory Regions are available, if FALSE, all system memory is available. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Create MM profile data HOBsZhang Hongbin4-6/+182
Create memory allocation and resource HOB for MM profile data Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Create misc HOBs for CPUZhang Hongbin2-1/+136
Create misc HOBs for CPU, it included MM ACPI S3 Enable HOB, MM CPU sync configuration HOB, CPU SMM base HOB, SMRAM memory HOB, MP Information2 HOB and ACPI variable HOB Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Create standalone MM foundation related HOBsHongbin1 Zhang4-1/+494
Create the HobList which included the HOBs Standalone MM foundation needed, it included communication buffer HOB, StandaloneMm Core module HOB and StandaloneMm Core FV HOB Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Dispatch StandaloneMm drivers in MMHongbin1 Zhang2-0/+44
MmIpl will issue a SWSMI by MM communicate to call gEventMmDispatchGuid handler to dispatch all StandaloneMm drivers Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Install end of PEI notify PPIHongbin1 Zhang3-0/+76
Install end of PEI notify PPI for issue gEfiMmEndOfPeiProtocol Handler in MM Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: Install MmCommunicationPpiHongbin1 Zhang3-1/+148
Install MmCommunicationPpi under PEI stage, PEIM could use this PPI to communicate with MM handler Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: load MM Core and execute MM Core in MM RAMHongbin1 Zhang4-0/+350
StandaloneMmIplPei will search the MM Core driver in all FV and relocate it to MM RAM, and enter MM Core entrypoint to run MM Core. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: build MM communication buffer HOBHongbin1 Zhang4-0/+83
MM communication buffer HOB data is for StandaloneMm Core and MM communicate DXE driver. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28StandaloneMmPkg/MmIpl: StandaloneMmIplPei driver entrypointHongbin1 Zhang4-0/+92
StandaloneMmIplPei driver entrypoint for adding StandaloneMm Ipl feature code under PEI stage. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2024-08-28MdeModulePkg/SmmCommunicationBufferDxe: Re-use FixedCommBufferZhang Hongbin2-4/+20
SmmCommunicationBufferDxe need to re-use FixedCommBuffer from MmCommBuffer HOB which created under PEI stage. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
2024-08-28StandaloneMmPkg: Create some notification of protocol and EventDun Tan3-11/+301
Create the notifications of some protocols and event that the Standalone Mm requires in MmCommunicationDxe: gEfiDxeMmReadyToLockProtocolGuid gEfiEventExitBootServicesGuid gEfiEventVirtualAddressChangeGuid gEfiEndOfDxeEventGroupGuid gEfiEventReadyToBootGuid Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-08-28StandaloneMmPkg: Install gEfiMmCommunicationProtocolGuidDun Tan3-1/+83
Install gEfiMmCommunicationProtocolGuid instance in the MmCommunicationDxe driver. Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-08-28StandaloneMmPkg: Install gEfiMmCommunication2ProtocolGuidDun Tan3-0/+260
Install gEfiMmCommunication2ProtocolGuid in the MmCommunicationDxe driver. Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-08-28StandaloneMmPkg: Add a new MmCommunicationDxe driverDun Tan4-0/+89
Add a new MmCommunicationDxe driver. The driver is to: 1.Install gEfiMmCommunication2ProtocolGuid 2.Install gEfiMmCommunicationProtocolGuid 3.Create the notifications of some protocols and event that the Standalone Mm requires Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-08-28StandaloneMmPkg: Create null instance for MmPlatformHobProducerLibDun Tan3-0/+96
Create null instance MmPlatformHobProducerLibNull.inf for MmPlatformHobProducerLib. Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-08-28UefiCpuPkg: Enable MmUnblockMemoryLibxieyuanh1-0/+1
Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28UefiCpuPkg: Add MM Unblock Page Libraryxieyuanh2-0/+128
This library provides an interface to request non-MMRAM pages to be mapped/unblocked from inside MM environment. For MM modules that need to access areas outside of MMRAMs, the agents responsible for setting up these regions must use this API to enable access to these memory areas from within MM. During the IPL, when RestrictedMemoryAccess is enabled, this unblocked memory is specifically used to create a BuildResourceHob, which allocates storage for the SMM accessible DRAM (non-MMIO) range. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28StandaloneMmPkg/StandaloneMmPkg.ci.yaml: Add UefiCpuPkg dependencyJiaxin Wu1-1/+3
StandaloneMmPkg need to use header file defined under UefiCpuPkg to support StandaloneMm features. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Star Zeng <star.zeng@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com> Acked-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-08-28StandaloneMmPkg/StandaloneMmPkg.dec: Add gEventMmDispatchGuidJiaxin Wu1-0/+3
MmIpl shall use gEventMmDispatchGuid to initialize EFI_MM_COMMUNICATE_HEADER structure, and then communicate with MmCore to dispatch all StandaloneMm drivers in SMM environment. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Co-authored-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Co-Authored-by: Ray Ni <ray.ni@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Star Zeng <star.zeng@intel.com> Co-Authored-by: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28StandaloneMmPkg: Add MmPlatformHobProducerLib library classDun Tan2-0/+57
CreateMmPlatformHob() is defined in the MmPlatformHobProducerLib library class. The function is for StandaloneMm IPL to create all Platform specific HOBs that required by the Standalone MM env. Signed-off-by: Dun Tan <dun.tan@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28UefiCpuPkg: Add ACPI S3 Enable HOB definitionJiaxin Wu2-0/+37
This HOB indicates to x86 standalone MM whether S3 is enabled. The value shall match with the PcdAcpiS3Enable. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Co-Authored-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28UefiCpuPkg: Add MM CPU Sync Config definitionsJiaxin Wu2-0/+56
MM CPU Sync Config controls how BSP synchronizes with APs in x86 SMM environment. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28UefiCpuPkg: Add MM Profile related definitionsJiaxin Wu2-0/+38
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28UefiCpuPkg: Add Unblock Region HOB definitionYuanhao Xie2-0/+45
Add Unblock Region HOB which defines the GUIDed HOB that describes the memory region to be unblocked in MM environment. Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com>
2024-08-28MdeModulePkg/MdeModulePkg.dec: Add PcdMmCommBufferPages PCDHongbin1 Zhang1-0/+4
PcdMmCommBufferPages is to specify the page count allocated for the MM communication buffer. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28MdeModulePkg: Add MM Communication Buffer definitionHongbin1 Zhang2-0/+66
The MM communicate buffer facilitates data sharing between non-MM and MM code. The MM IPL code allocates a "fixed" runtime type memory as the MM communication buffer, and communicates its address and size to MM Core via MmCommBuffer GUIDed HOB. Here, "fixed" implies that the buffer's location remains constant throughout the boot process. Data is exchanged between the MM Communication PPI/Protocol and a software MMI handler using this fixed MM communication buffer. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28MdePkg/MdePkg.dec: Add gEfiMmEndOfPeiProtocol definitionJiaxin Wu1-0/+4
This protocol is defined at PI Spec, Vol 4, section 4. It's a MM Protocol published by a standalone MM Foundation code if MM Foundation is loaded in PEI phase. This protocol should be installed immediately after DXE IPL installs EFI_PEI_END_OF_PEI_PHASE_PPI. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
2024-08-28IntelFsp2Pkg: Align FSP global data pointer for X64 buildHongbin1 Zhang2-9/+9
When it used 32 bits for set FSP global data pointer under X64 build, it should get FSP global data pointer with 32 bits data under X64 build. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Ted Kuo <ted.kuo@intel.com> Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
2024-08-28UefiPayloadPkg: Update UefiPayload driver for FDT support.Linus Liu9-258/+325
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Add FDT detection and comsume FDT when needed. Move some x86 specific function in the x86 folder. Create HandOffHob via FDT memory node. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28UefiPayloadPkg: Update PayloadLoader to suport FDT.Linus Liu6-29/+855
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Create FDT nodes (reserved-memory, serial, pci-rb, options) in FdtPpiNotifyCallback function right after gEfiEndOfPeiSignalPpiGuid. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28UefiPayloadPkg: Add FDT Paser relative LIBs.Linus Liu11-0/+2622
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Add FDTParser and CustomFdtNodePaser to retrive all FDT node and create the relate hobs. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28UefiPayloadPkg: Support Debug function when Hob was not available.Linus Liu8-8/+97
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Initialize mUartInfo with PCD for debug message when Hob was not available. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28UefiPayloadPkg: Addd header files for FDT structure and function.Linus Liu7-0/+251
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Add Library header, DeviceTree hob header and PCD definitions. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28MdePkg: Fix build error after enable FDT support.Linus Liu1-2/+5
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4786 Disable some compiling warnings caused by submodule code. Those can be removed later once issues fixed by submodule owner. Signed-off-by: Linus Liu <linus.liu@intel.com>
2024-08-28MdePkg/BaseFdtLib: Add FdtNodeOffsetByCompatible()Nhi Pham2-0/+37
This adds FdtNodeOffsetByCompatible() to support finding the offset of the first node with a given 'compatible' value after an offset. Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2024-08-28OvmfPkg/LoongArchVirt: Clear the PGD series registersChao Li1-0/+6
Since the PGD series registers are in an unknown state when reset, some simulators will hang when restarting if these registers are not cleared, so they are cleared in this patch. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Chao Li <lichao@loongson.cn>