From a1ddad95933eeb54519e1366c3568c7cac8b25b9 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 26 Feb 2020 23:11:41 +0100 Subject: MdeModulePkg/PiSmmCore: log SMM image start failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the CoreStartImage() function [MdeModulePkg/Core/Dxe/Image/Image.c], if the image entry point returns a failure code, then the DXE Core logs a helpful DEBUG_ERROR message, with the following format string: "Error: Image at %11p start failed: %r\n" Do similarly in the SMM Core (update the message slightly). Cc: Ard Biesheuvel Cc: Eric Dong Cc: Hao A Wu Cc: Igor Mammedov Cc: Jian J Wang Cc: Jiewen Yao Cc: Jordan Justen Cc: Michael Kinney Cc: Philippe Mathieu-Daudé Cc: Ray Ni Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512 Signed-off-by: Laszlo Ersek Message-Id: <20200226221156.29589-2-lersek@redhat.com> Acked-by: Ard Biesheuvel Reviewed-by: Eric Dong Reviewed-by: Liming Gao Reviewed-by: Philippe Mathieu-Daude Tested-by: Boris Ostrovsky --- MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MdeModulePkg/Core') diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c index 9bec731e53..76ee9e0b89 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c @@ -902,6 +902,12 @@ SmmDispatcher ( Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoint)(DriverEntry->ImageHandle, gST); PERF_START_IMAGE_END (DriverEntry->ImageHandle); if (EFI_ERROR(Status)){ + DEBUG (( + DEBUG_ERROR, + "Error: SMM image at %11p start failed: %r\n", + DriverEntry->SmmLoadedImage.ImageBase, + Status + )); UnregisterSmramProfileImage (DriverEntry, TRUE); SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage); // -- cgit v1.2.3