OvmfPkg/PlatformDxe: register log buffer as efi config table

If a memory debug log buffer is present, register the buffer location as
config table so the OS can find and show it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann
2025-06-23 22:32:51 +02:00
committed by mergify[bot]
parent 7f756db37a
commit 5090c39a59
2 changed files with 28 additions and 0 deletions

View File

@@ -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>
@@ -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.
@@ -1030,6 +1054,8 @@ PlatformInit (
Status = gBS->SignalEvent (mGopEvent);
ASSERT_EFI_ERROR (Status);
MemDebugLogInstallTable ();
return EFI_SUCCESS;
CloseGopEvent:

View File

@@ -36,6 +36,7 @@
DebugLib
DevicePathLib
HiiLib
HobLib
MemoryAllocationLib
PrintLib
UefiBootServicesTableLib
@@ -59,6 +60,7 @@
[Guids]
gEfiIfrTianoGuid
gOvmfPlatformConfigGuid
gMemDebugLogHobGuid
[Depex]
gEfiHiiConfigRoutingProtocolGuid AND