From: Tom Lendacky <thomas.lenda...@amd.com> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
Provide support for the MP finalization routine within DXE. This finalization function will invoke the MpInitLib MpLibFinalize() function to perform the steps necessary to park an AP and be able to successfully boot it under an OS. Cc: Eric Dong <eric.d...@intel.com> Cc: Ray Ni <ray...@intel.com> Cc: Laszlo Ersek <ler...@redhat.com> Signed-off-by: Tom Lendacky <thomas.lenda...@amd.com> --- UefiCpuPkg/CpuDxe/CpuDxe.h | 12 ++++++++++++ UefiCpuPkg/CpuDxe/CpuDxe.c | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h index a6762f1a0b78..d071a32135b2 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.h +++ b/UefiCpuPkg/CpuDxe/CpuDxe.h @@ -232,6 +232,18 @@ CpuSetMemoryAttributes ( IN UINT64 Attributes ); +/** + Perform any MpLib final actions before transitioning out of UEFI. + + @param This Protocol instance structure + +**/ +VOID +EFIAPI +CpuFinalize ( + IN EFI_CPU_ARCH_PROTOCOL *This + ); + /** Initialize Global Descriptor Table. diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index 7d7270e10b4a..bee44c0dd488 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -93,7 +93,8 @@ EFI_CPU_ARCH_PROTOCOL gCpu = { CpuGetTimerValue, CpuSetMemoryAttributes, 1, // NumberOfTimers - 4 // DmaBufferAlignment + 4, // DmaBufferAlignment + CpuFinalize }; // @@ -499,6 +500,24 @@ CpuSetMemoryAttributes ( return AssignMemoryPageAttributes (NULL, BaseAddress, Length, MemoryAttributes, NULL); } +/** + Implementation of CpuFinalize() service of CPU Architecture Protocol. + + This function performs any MpLib library finalization to perform required + actions before exiting boot services. + + @param This The EFI_CPU_ARCH_PROTOCOL instance. + +**/ +VOID +EFIAPI +CpuFinalize ( + IN EFI_CPU_ARCH_PROTOCOL *This + ) +{ + MpLibFinalize (); +} + /** Initializes the valid bits mask and valid address mask for MTRRs. -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47720): https://edk2.groups.io/g/devel/message/47720 Mute This Topic: https://groups.io/mt/34230276/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-