[edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure

Liming Gao liming.gao at intel.com
Mon Mar 2 12:55:34 UTC 2020


Laszlo:
  The change refers to the same logic in DxeMain logic. So, it makes sense. Reviewed-by: Liming Gao <liming.gao at intel.com>

Thanks
Liming
> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Laszlo Ersek
> Sent: Monday, March 2, 2020 8:47 PM
> To: Dong, Eric <eric.dong at intel.com>; Wu, Hao A <hao.a.wu at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Ni, Ray
> <ray.ni at intel.com>
> Cc: edk2-devel-groups-io <devel at edk2.groups.io>; Ard Biesheuvel <ard.biesheuvel at linaro.org>; Igor Mammedov
> <imammedo at redhat.com>; Yao, Jiewen <jiewen.yao at intel.com>; Justen, Jordan L <jordan.l.justen at intel.com>; Kinney, Michael D
> <michael.d.kinney at intel.com>; Philippe Mathieu-Daudé <philmd at redhat.com>
> Subject: Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
> 
> Jian, Hao, Eric, Ray,
> 
> this patch is trivial; can one of you please ACK it?
> 
> Thanks
> Laszlo
> 
> On 02/26/20 23:11, Laszlo Ersek wrote:
> > 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 <ard.biesheuvel at linaro.org>
> > Cc: Eric Dong <eric.dong at intel.com>
> > Cc: Hao A Wu <hao.a.wu at intel.com>
> > Cc: Igor Mammedov <imammedo at redhat.com>
> > Cc: Jian J Wang <jian.j.wang at intel.com>
> > Cc: Jiewen Yao <jiewen.yao at intel.com>
> > Cc: Jordan Justen <jordan.l.justen at intel.com>
> > Cc: Michael Kinney <michael.d.kinney at intel.com>
> > Cc: Philippe Mathieu-Daudé <philmd at redhat.com>
> > Cc: Ray Ni <ray.ni at intel.com>
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> > Signed-off-by: Laszlo Ersek <lersek at redhat.com>
> > Acked-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> > ---
> >
> > Notes:
> >     v2:
> >
> >     - Pick up Ard's Acked-by, which is conditional on approval from Intel
> >       reviewers on Cc. (I'd like to save Ard the churn of re-acking
> >       unmodified patches.)
> >
> >  MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
> > index 9bec731e5312..76ee9e0b89cc 100644
> > --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
> > +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
> > @@ -883,44 +883,50 @@ SmmDispatcher (
> >        RemoveEntryList (&DriverEntry->ScheduledLink);
> >
> >        REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
> >          EFI_PROGRESS_CODE,
> >          EFI_SOFTWARE_SMM_DRIVER | EFI_SW_PC_INIT_BEGIN,
> >          &DriverEntry->ImageHandle,
> >          sizeof (DriverEntry->ImageHandle)
> >          );
> >
> >        //
> >        // Cache state of SmmEntryPointRegistered before calling entry point
> >        //
> >        PreviousSmmEntryPointRegistered = gSmmCorePrivate->SmmEntryPointRegistered;
> >
> >        //
> >        // For each SMM driver, pass NULL as ImageHandle
> >        //
> >        RegisterSmramProfileImage (DriverEntry, TRUE);
> >        PERF_START_IMAGE_BEGIN (DriverEntry->ImageHandle);
> >        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);
> >          //
> >          // Uninstall LoadedImage
> >          //
> >          Status = gBS->UninstallProtocolInterface (
> >                          DriverEntry->ImageHandle,
> >                          &gEfiLoadedImageProtocolGuid,
> >                          DriverEntry->LoadedImage
> >                          );
> >          if (!EFI_ERROR (Status)) {
> >            if (DriverEntry->LoadedImage->FilePath != NULL) {
> >              gBS->FreePool (DriverEntry->LoadedImage->FilePath);
> >            }
> >            gBS->FreePool (DriverEntry->LoadedImage);
> >          }
> >          Status = SmmUninstallProtocolInterface (
> >                     DriverEntry->SmmImageHandle,
> >                     &gEfiLoadedImageProtocolGuid,
> >                     &DriverEntry->SmmLoadedImage
> >                     );
> >          if (!EFI_ERROR(Status)) {
> >
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55172): https://edk2.groups.io/g/devel/message/55172
Mute This Topic: https://groups.io/mt/71575164/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list