public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Gao, Liming" <liming.gao@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure
Date: Thu, 8 Feb 2018 10:11:39 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA3DB37@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1518077919-10176-1-git-send-email-liming.gao@intel.com>

Hi Liming,

Because of new added "+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));", the debug message will have two "Loading PEIM XXX" for one PEIM, that is very confusing.
Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50
Loading PEIM at 0x00002353000 EntryPoint=0x000003C10C5 PcdPeim.efi

How about like below change?
1. Also print FFS GUID when section alignment error.
2. Print FFS GUID when PDB not found.


fb0030045fe4ae561177d9cff01f32088ae9975e
 MdeModulePkg/Core/Pei/Image/Image.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index 198541128512..179c77ef2194 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
   //
   Status = PeCoffLoaderLoadImage (&ImageContext);
   if (EFI_ERROR (Status)) {
+    if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
+      DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't meet with section alignment 0x%x.\n", FileHandle, (VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment));
+    }
     return Status;
   }
   //
@@ -707,6 +710,11 @@ PeiLoadImageLoadImage (
       }
 
       DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName));
+    } else {
+      //
+      // Print FFS GUID when PDB not found.
+      //
+      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%g", FileHandle));
     }
 
   DEBUG_CODE_END ();


Thanks,
Star
-----Original Message-----
From: Gao, Liming 
Sent: Thursday, February 8, 2018 4:19 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure

If PEIM image address doesn't meet with its section alignment, it will load fail. PeiCore adds more debug message to report it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Core/Pei/Image/Image.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index 1985411..f41d3ac 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at @@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
   //
   Status = PeCoffLoaderLoadImage (&ImageContext);
   if (EFI_ERROR (Status)) {
+    if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {
+      DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment));
+    }
     return Status;
   }
   //
@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
     }
   }
 
+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));
+
   //
   // If memory is installed, perform the shadow operations
   //
--
2.8.0.windows.1



  parent reply	other threads:[~2018-02-08 10:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08  8:18 [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure Liming Gao
2018-02-08  9:30 ` Laszlo Ersek
2018-02-08 10:24   ` Gao, Liming
2018-02-08 10:31     ` Laszlo Ersek
2018-02-15 20:20       ` Brian J. Johnson
2018-02-08 10:11 ` Zeng, Star [this message]
2018-02-08 10:24   ` Gao, Liming
2018-02-08 10:30     ` Zeng, Star
2018-02-08 10:39       ` Gao, Liming
2018-02-09  2:03         ` Zeng, Star

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103BA3DB37@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox