From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 6C71922361E63 for ; Thu, 8 Feb 2018 01:24:51 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC4578AE45; Thu, 8 Feb 2018 09:30:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-94.phx2.redhat.com [10.3.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21FE45D9C8; Thu, 8 Feb 2018 09:30:34 +0000 (UTC) To: Liming Gao , edk2-devel@lists.01.org Cc: Star Zeng References: <1518077919-10176-1-git-send-email-liming.gao@intel.com> From: Laszlo Ersek Message-ID: Date: Thu, 8 Feb 2018 10:30:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1518077919-10176-1-git-send-email-liming.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 08 Feb 2018 09:30:36 +0000 (UTC) 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 09:24:51 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 02/08/18 09:18, Liming Gao wrote: > 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/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.
> +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 = 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)); > + } Just curious, is there any particular reason for the 11 chars field width? Personally I would print ImageContext.ImageAddress (which has type PHYSICAL_ADDRESS, i.e. UINT64), without any type conversion, and with the following format string: 0x%Lx or maybe 0x%16Lx ... There's no need to resubmit the patch because of my question; I'm just curious if I'm missing something. Thanks! Laszlo > return Status; > } > // > @@ -612,6 +615,8 @@ PeiLoadImageLoadImage ( > } > } > > + DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle)); > + > // > // If memory is installed, perform the shadow operations > // > I'