From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 07F3C203B8CB6 for ; Thu, 3 May 2018 05:28:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E2B176FBA; Thu, 3 May 2018 12:28:07 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-12.rdu2.redhat.com [10.10.120.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E204711166E0; Thu, 3 May 2018 12:28:03 +0000 (UTC) To: Ard Biesheuvel , Alexei Fedorov Cc: "edk2-devel@lists.01.org" , Arvind Chauhan , Daniil Egranov , Thomas Panakamattam Abraham , Leif Lindholm , Matteo Carlini , Stephanie Hughes-Fitt , nd , Evan Lloyd , Sami Mujawar , Jeremy Linton , Alan Ott References: <1525339461-12432-1-git-send-email-alexei.fedorov@arm.com> From: Laszlo Ersek Message-ID: <7306e255-6659-dbd8-c09e-5c5296d44d98@redhat.com> Date: Thu, 3 May 2018 14:28:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 03 May 2018 12:28:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 03 May 2018 12:28:07 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH edk2-platforms v1] Platform/ARM: Add PeiReportStatusCodeLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 12:28:09 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/03/18 13:44, Ard Biesheuvel wrote: > (add some potentially interested parties to cc) > > On 3 May 2018 at 11:24, Alexei Fedorov wrote: >> From: Alexei Fedorov >> >> UEFI build fails for ArmVExpress-FVP-AArch64 when using >> "-D ARM_FVP_RUN_NORFLASH" build option, which prevents >> EDK2_SKIP_PEICORE macro from being defined in >> ArmVExpress-FVP-AArch64.dsc: >> >> !ifndef ARM_FVP_RUN_NORFLASH >> DEFINE EDK2_SKIP_PEICORE=1 >> !endif >> >> When EDK2_SKIP_PEICORE macro is not defined, build fails with >> errors 1001: >> Module type [PEI_CORE] is not supported by library instance >> [MdeModulePkg\Library\DxeReportStatusCodeLib\DxeReportStatusCodeLib.inf] >> consumed by [n:\edk2\MdeModulePkg\Core\Pei\PeiMain.inf] >> and >> Module type [PEIM] is not supported by library instance >> [MdeModulePkg\Library\DxeReportStatusCodeLib\DxeReportStatusCodeLib.inf] >> consumed by [n:\edk2\MdeModulePkg\Core\DxeIplPeim\DxeIpl.inf] >> >> This patch fixes the above build errors by adding >> MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf >> in [LibraryClasses.common.PEI_CORE] and [LibraryClasses.common.PEIM] >> sections of ArmVExpress.dsc.inc. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Alexei Fedorov >> Reviewed-by: Evan Lloyd >> --- >> All the changes can be reviewed at: >> https://github.com/AlexeiFedorov/edk2-platforms/tree/237_add_peireportstatuscodelib_v1 >> >> Notes: >> v1: >> - Add PeiReportStatusCodeLib in PEI_CORE and PEIM sections [Alexei] >> >> Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 2 ++ >> 1 file changed, 2 insertions(+) >> > > Just for my understanding: is anyone using these status codes on ARM, > and if so, how exactly? (on a wild tangent) Earlier I tried to use status codes (in VMs) for the following purpose: the UEFI boot manager emits status codes about gBS->LoadImage() and gBS->StartImage(), but I didn't find them detailed enough. So I attempted to extend them, with the intent to catch *and print* them in BdsDxe / PlatformBootManagerLib, to the console. This would have provided the end-user with some insight into the boot option processing. Alas, the status codes weren't possible to extend in edk2 without UEFI spec development. I did start on that, but clearly we couldn't wait for it to complete, so we solved our issue differently. Now back to the question whether status codes are helpful in practice on ARM. The vendor-provided firmware on my Mustang uses them, in that the status codes are printed to the serial port. They tell me exactly nothing. :) For a while I had built the firmware for the Mustang myself. I'd always enable full logs (DEBUG_VERBOSE). Now that serial log was helpful. I guess status codes can be useful if there are other machines that read them and act upon them -- but that likely occurs through a different representation and/or hardware interface, not through hex codes printed to the serial port. Thanks Laszlo > > >> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc >> index de201b0c81d020e1e06ee320cf0f14f186723657..bb899b91c525ee821b9506cca75224f4bc41e3ae 100644 >> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc >> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc >> @@ -166,6 +166,7 @@ [LibraryClasses.common.PEI_CORE] >> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf >> PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf >> PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf >> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf >> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf >> ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf >> @@ -179,6 +180,7 @@ [LibraryClasses.common.PEIM] >> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf >> PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf >> PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf >> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf >> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf >> PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf >> -- >> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >> >>