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

Laszlo Ersek posted 16 patches 5 years, 11 months ago
[edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
Posted by Laszlo Ersek 5 years, 11 months ago
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@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@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)) {
-- 
2.19.1.3.g30247aa5d201



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

View/Reply Online (#54943): https://edk2.groups.io/g/devel/message/54943
Mute This Topic: https://groups.io/mt/71575164/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
Posted by Laszlo Ersek 5 years, 11 months ago
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@linaro.org>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Acked-by: Ard Biesheuvel <ard.biesheuvel@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 (#55171): https://edk2.groups.io/g/devel/message/55171
Mute This Topic: https://groups.io/mt/71575164/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
Posted by Liming Gao 5 years, 11 months ago
Laszlo:
  The change refers to the same logic in DxeMain logic. So, it makes sense. Reviewed-by: Liming Gao <liming.gao@intel.com>

Thanks
Liming
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Laszlo Ersek
> Sent: Monday, March 2, 2020 8:47 PM
> To: Dong, Eric <eric.dong@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray
> <ray.ni@intel.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Ard Biesheuvel <ard.biesheuvel@linaro.org>; Igor Mammedov
> <imammedo@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Philippe Mathieu-Daudé <philmd@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@linaro.org>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Igor Mammedov <imammedo@redhat.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > Cc: Michael Kinney <michael.d.kinney@intel.com>
> > Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> > Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> > Acked-by: Ard Biesheuvel <ard.biesheuvel@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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
Posted by Philippe Mathieu-Daudé 5 years, 11 months ago
On 2/26/20 11:11 PM, 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@linaro.org>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Acked-by: Ard Biesheuvel <ard.biesheuvel@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)) {
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>


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

View/Reply Online (#55200): https://edk2.groups.io/g/devel/message/55200
Mute This Topic: https://groups.io/mt/71575164/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure
Posted by Dong, Eric 5 years, 11 months ago
Hi Laszlo,

Reviewed-by: Eric Dong <eric.dong@intel.com>

Thanks,
Eric
> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Thursday, February 27, 2020 6:12 AM
> To: edk2-devel-groups-io <devel@edk2.groups.io>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Dong, Eric
> <eric.dong@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Igor Mammedov
> <imammedo@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>; Yao,
> Jiewen <jiewen.yao@intel.com>; Justen, Jordan L
> <jordan.l.justen@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Philippe Mathieu-Daudé
> <philmd@redhat.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start
> failure
> 
> 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@linaro.org>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Acked-by: Ard Biesheuvel <ard.biesheuvel@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)) {
> --
> 2.19.1.3.g30247aa5d201
> 


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

View/Reply Online (#55281): https://edk2.groups.io/g/devel/message/55281
Mute This Topic: https://groups.io/mt/71575164/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-