From bcd8509640aa067d01fccc5fbdc021c149b64ebe Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Mon, 21 Jul 2025 14:57:04 -0700 Subject: [PATCH] StandaloneMmPkg: Always Print Driver Load Messages Today, StandaloneMM Core's image loader only prints driver load messages if debug code is enabled. However, these are some of the most important prints in the codebase: on a given system even if you have nothing else to debug with, you can see the last driver executed. Debug code blocks are used to skip logic that only exists for debug purposes and wastes time on a release build. However, the logic to print a line and determine the filename from the PDB is not extensive and provides critical information, so it is inappropriate to wrap in a debug code section. Platforms can still choose to disable logging at DEBUG_INFO/DEBUG_LOAD and will not see the error messages. Signed-off-by: Oliver Smith-Denny --- StandaloneMmPkg/Core/Dispatcher.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core/Dispatcher.c index 821d9d6f45..4bb74d3474 100644 --- a/StandaloneMmPkg/Core/Dispatcher.c +++ b/StandaloneMmPkg/Core/Dispatcher.c @@ -143,6 +143,9 @@ MmLoadImage ( UINTN PageCount; EFI_STATUS Status; EFI_PHYSICAL_ADDRESS DstBuffer; + UINTN Index; + UINTN StartIndex; + CHAR8 EfiFileName[256]; DEBUG ((DEBUG_INFO, "MmLoadImage - %g\n", &DriverEntry->FileName)); @@ -254,11 +257,6 @@ MmLoadImage ( // // Print the load address and the PDB file name if it is available // - DEBUG_CODE_BEGIN (); - - UINTN Index; - UINTN StartIndex; - CHAR8 EfiFileName[256]; DEBUG (( DEBUG_INFO | DEBUG_LOAD, @@ -308,8 +306,6 @@ MmLoadImage ( DEBUG ((DEBUG_INFO | DEBUG_LOAD, "\n")); - DEBUG_CODE_END (); - return Status; }