Skip to content

OvmfPkg/PlatformDxe: register log buffer as efi config table #11223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions OvmfPkg/PlatformDxe/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HiiLib.h>
#include <Library/HobLib.h>
#include <Library/MemDebugLogLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
Expand Down Expand Up @@ -943,6 +945,28 @@ GopInstalled (
mGopTracker = NULL;
}

/**
If a memory debug log buffer is present, register the buffer location as
config table so the OS can find and show it.
**/
VOID
EFIAPI
MemDebugLogInstallTable (
VOID
)
{
EFI_HOB_GUID_TYPE *GuidHob;
MEM_DEBUG_LOG_HOB_DATA *HobData;
VOID *LogBuffer;

GuidHob = GetFirstGuidHob (&gMemDebugLogHobGuid);
if (GuidHob != NULL) {
HobData = (MEM_DEBUG_LOG_HOB_DATA *)GET_GUID_HOB_DATA (GuidHob);
LogBuffer = (VOID *)(UINTN)HobData->MemDebugLogBufAddr;
gBS->InstallConfigurationTable (&gMemDebugLogHobGuid, LogBuffer);
}
}

/**
Entry point for this driver.

Expand Down Expand Up @@ -1030,6 +1054,8 @@ PlatformInit (
Status = gBS->SignalEvent (mGopEvent);
ASSERT_EFI_ERROR (Status);

MemDebugLogInstallTable ();

return EFI_SUCCESS;

CloseGopEvent:
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/PlatformDxe/Platform.inf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
DebugLib
DevicePathLib
HiiLib
HobLib
MemoryAllocationLib
PrintLib
UefiBootServicesTableLib
Expand All @@ -59,6 +60,7 @@
[Guids]
gEfiIfrTianoGuid
gOvmfPlatformConfigGuid
gMemDebugLogHobGuid

[Depex]
gEfiHiiConfigRoutingProtocolGuid AND
Expand Down
Loading