From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 34EAE22361E45 for ; Thu, 8 Feb 2018 02:05:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2018 02:11:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,477,1511856000"; d="scan'208";a="25822558" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 08 Feb 2018 02:11:43 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Feb 2018 02:11:42 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Feb 2018 02:11:42 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Thu, 8 Feb 2018 18:11:41 +0800 From: "Zeng, Star" To: "Gao, Liming" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure Thread-Index: AQHToLV1Axpak8a4FE2RYVM3jyH8bKOaR//A Date: Thu, 8 Feb 2018 10:11:39 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA3DB37@shsmsx102.ccr.corp.intel.com> References: <1518077919-10176-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1518077919-10176-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 10:06:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming, Because of new added "+ DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandl= e));", the debug message will have two "Loading PEIM XXX" for one PEIM, tha= t is very confusing. Loading PEIM 9B3ADA4F-AE56-4C24-8DEA-F03B7558AE50 Loading PEIM at 0x00002353000 EntryPoint=3D0x000003C10C5 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/Im= age/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 =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
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 =3D PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { + if (ImageContext.ImageError =3D=3D IMAGE_ERROR_INVALID_SECTION_ALIGNME= NT) { + DEBUG ((DEBUG_ERROR, "PEIM(%g) Image Address 0x%11p doesn't meet wit= h section alignment 0x%x.\n", FileHandle, (VOID*)(UINTN)ImageContext.ImageA= ddress, ImageContext.SectionAlignment)); + } return Status; } // @@ -707,6 +710,11 @@ PeiLoadImageLoadImage ( } =20 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)); } =20 DEBUG_CODE_END (); Thanks, Star -----Original Message----- From: Gao, Liming=20 Sent: Thursday, February 8, 2018 4:19 PM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM l= oad 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 Cc: Star Zeng --- 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/Im= age/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 =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -506,6 +50= 6,9 @@ LoadAndRelocatePeCoffImage ( // Status =3D PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { + if (ImageContext.ImageError =3D=3D IMAGE_ERROR_INVALID_SECTION_ALIGNME= NT) { + DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with se= ction alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, ImageCon= text.SectionAlignment)); + } return Status; } // @@ -612,6 +615,8 @@ PeiLoadImageLoadImage ( } } =20 + DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle)); + // // If memory is installed, perform the shadow operations // -- 2.8.0.windows.1