From f0eade598462400380cdd191e0b4b5aeade6ec68 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Thu, 22 Jan 2026 07:31:58 -0800 Subject: [PATCH] StandaloneMmPkg: StandaloneMmCore: Log MM Entry/Exit Protocol at Verbose Currently, StandaloneMmCore prints for every MM entry and exit as well as producing protocols for MM entry and exit that get logged. So there are four logs for every MM entry/exit pair. In a sample OVMF run with StMM enabled, this produced 6800 logs to log MM entry/exit out of 16,400 logs. In other words, > 1/3 of logs were for these prints. Protocol install notifications are useful, but not for these ones that are just entry and exit notifies. This commit only logs at verbose level if the protocol installed is the entry or exit protocol. Signed-off-by: Oliver Smith-Denny --- StandaloneMmPkg/Core/Handle.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/StandaloneMmPkg/Core/Handle.c b/StandaloneMmPkg/Core/Handle.c index 7df4629cf2..31d6731876 100644 --- a/StandaloneMmPkg/Core/Handle.c +++ b/StandaloneMmPkg/Core/Handle.c @@ -233,9 +233,15 @@ MmInstallProtocolInterfaceNotify ( } // - // Print debug message + // Print debug message unless installing MM entry/exit notify protocol as that spams the log // - DEBUG ((DEBUG_LOAD | DEBUG_INFO, "MmInstallProtocolInterface: %g %p\n", Protocol, Interface)); + if (!CompareGuid (Protocol, &gEfiMmEntryNotifyProtocolGuid) && + !CompareGuid (Protocol, &gEfiMmExitNotifyProtocolGuid)) + { + DEBUG ((DEBUG_LOAD | DEBUG_INFO, "MmInstallProtocolInterface: Installing non-entry/exit protocol %g %p\n", Protocol, Interface)); + } else { + DEBUG ((DEBUG_VERBOSE, "MmInstallProtocolInterface: Installing entry/exit protocol %g %p\n", Protocol, Interface)); + } Status = EFI_OUT_OF_RESOURCES; Prot = NULL;