From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 9380221A070BA for ; Fri, 5 May 2017 08:49:42 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2017 08:49:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,293,1491289200"; d="scan'208";a="98141960" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 05 May 2017 08:49:42 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 5 May 2017 08:49:41 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.193]) by fmsmsx118.amr.corp.intel.com ([169.254.1.144]) with mapi id 14.03.0319.002; Fri, 5 May 2017 08:49:41 -0700 From: "Carsey, Jaben" To: Jeff Westfahl , "Ni, Ruiyu" CC: "edk2-devel@lists.01.org" Thread-Topic: [PATCH 0/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol info Thread-Index: AQHSxSDT/3iSicMzo06Dn5V47fuSkqHlglgAgACd/4D//8OewA== Date: Fri, 5 May 2017 15:49:41 +0000 Message-ID: References: <1493934784-30012-1-git-send-email-jeff.westfahl@ni.com> <734D49CCEBEEF84792F5B80ED585239D5B93E24F@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGExZjc0ODUtYzkwYS00Yjc5LTkwNzgtZGVlNTIyZDBmOGZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImVDQ0pOSnVcL1F6dDlaZ2Q2MnNrZlFNZm0rWjlMU2MrRGpjaHI2dmsza0E4PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [PATCH 0/3] ShellPkg/HandleParsingLib: Show LoadedImageProtocol info X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 15:49:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I agree with Ray's commentary. Good positive changes to UEFI Shell!=20 For the series. Reviewed-by: Jaben Carsey > -----Original Message----- > From: Jeff Westfahl [mailto:jeff.westfahl@ni.com] > Sent: Friday, May 05, 2017 5:25 AM > To: Ni, Ruiyu > Cc: Jeff Westfahl ; edk2-devel@lists.01.org; Carsey= , > Jaben > Subject: RE: [PATCH 0/3] ShellPkg/HandleParsingLib: Show > LoadedImageProtocol info > Importance: High >=20 > Hi Ray, >=20 > Thank you for pointing out the ECC tool. These changes look good to me. >=20 > Reviewed-by: Jeff Westfahl >=20 > On Fri, 5 May 2017, Ni, Ruiyu wrote: >=20 > > Jeff, > > Firstly great thanks for filling the gap between EDK shell and UEFI she= ll. > > There are many behavior differences between the two, and EDK Shell > does carry much more information that > > are very helpful for developer debugging. > > > > Before I check in your patch, could you please kindly review whether th= e > additional change is ok to you. > > One change is to fix the ECC failure: "python > BaseTools\Source\Python\Ecc\Ecc.py -t > ShellPkg\Library\UefiHandleParsingLib -s" > > > > ShellPkg\Library\UefiHandleParsingLib\UefiHandleParsingLib.c(272): > [3002]Non-Boolean comparisons should use a compare operator (=3D=3D, !=3D= , >, < > >=3D, <=3D) Predicate Expression: FileName > > ShellPkg\Library\UefiHandleParsingLib\UefiHandleParsingLib.c(272): > [3003]A comparison of any pointer to zero must be done via the NULL type > Predicate Expression: FileName > > > > =3D=3D=3D=3Dpatch content=3D=3D=3D > > .../UefiHandleParsingLib/UefiHandleParsingLib.c | 39 ++++++++-------= ----- > -- > > 1 file changed, 14 insertions(+), 25 deletions(-) > > > > diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib= .c > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > index 74934f8617..d3ee068eba 100644 > > --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > @@ -16,14 +16,14 @@ > > > > #include "UefiHandleParsingLib.h" > > #include "IndustryStandard/Acpi10.h" > > -#include "Pi/PiFirmwareFile.h" > > -#include "Pi/PiFirmwareVolume.h" > > -#include "Protocol/FirmwareVolume2.h" > > +#include > > +#include > > > > EFI_HANDLE mHandleParsingHiiHandle =3D NULL; > > HANDLE_INDEX_LIST mHandleList =3D {{{NULL,NULL},0,0},0}; > > GUID_INFO_BLOCK *mGuidList; > > UINTN mGuidListCount; > > + > > /** > > Function to find the file name associated with a LoadedImageProtocol. > > > > @@ -44,37 +44,26 @@ FindLoadedImageFileName ( > > UINTN BufferSize; > > UINT32 AuthenticationStatus; > > > > - // > > - // Only subtype MEDIA_PIWG_FW_FILE_DP of type > MEDIA_DEVICE_PATH is supported. > > - // > > - if ( (LoadedImage =3D=3D NULL) > > - || (LoadedImage->FilePath =3D=3D NULL) > > - || (LoadedImage->FilePath->Type !=3D MEDIA_DEVICE_PATH) > > - || (LoadedImage->FilePath->SubType !=3D MEDIA_PIWG_FW_FILE_DP) > > - ) { > > - return (NULL); > > + if ((LoadedImage =3D=3D NULL) || (LoadedImage->FilePath =3D=3D NULL)= ) { > > + return NULL; > > } > > > > NameGuid =3D > EfiGetNameGuidFromFwVolDevicePathNode((MEDIA_FW_VOL_FILEPATH_ > DEVICE_PATH *)LoadedImage->FilePath); > > > > if (NameGuid =3D=3D NULL) { > > - return (NULL); > > + return NULL; > > } > > > > // > > - // Get the FirmwareVolume2Protocol of the device handle that this > image was > > - // loaded from. > > + // Get the FirmwareVolume2Protocol of the device handle that this > image was loaded from. > > // > > - Status =3D gBS->HandleProtocol( > > - LoadedImage->DeviceHandle, > > - &gEfiFirmwareVolume2ProtocolGuid, > > - (VOID**)&Fv); > > + Status =3D gBS->HandleProtocol (LoadedImage->DeviceHandle, > &gEfiFirmwareVolume2ProtocolGuid, (VOID**) &Fv); > > > > // > > // FirmwareVolume2Protocol is PI, and is not required to be available= . > > // > > - if (EFI_ERROR(Status)) { > > - return (NULL); > > + if (EFI_ERROR (Status)) { > > + return NULL; > > } > > > > // > > @@ -83,15 +72,15 @@ FindLoadedImageFileName ( > > Buffer =3D NULL; > > Status =3D Fv->ReadSection(Fv, NameGuid, EFI_SECTION_USER_INTERFACE, > 0, &Buffer, &BufferSize, &AuthenticationStatus); > > > > - if (EFI_ERROR(Status)) { > > - return (NULL); > > + if (EFI_ERROR (Status)) { > > + return NULL; > > } > > > > // > > // ReadSection returns just the section data, without any section hea= der. > For > > // a user interface section, the only data is the file name. > > // > > - return (Buffer); > > + return Buffer; > > } > > > > /** > > @@ -269,7 +258,7 @@ LoadedImageProtocolDumpInformation( > > FileName =3D FindLoadedImageFileName(LoadedImage); > > > > RetVal =3D NULL; > > - if (FileName) { > > + if (FileName !=3D NULL) { > > Temp =3D HiiGetString(mHandleParsingHiiHandle, > STRING_TOKEN(STR_LI_DUMP_NAME), NULL); > > > > if (Temp !=3D NULL) { > > > > Thanks/Ray > > > >> -----Original Message----- > >> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com] > >> Sent: Friday, May 5, 2017 5:53 AM > >> To: edk2-devel@lists.01.org > >> Cc: Jeff Westfahl ; Ni, Ruiyu > ; > >> Carsey, Jaben > >> Subject: [PATCH 0/3] ShellPkg/HandleParsingLib: Show > LoadedImageProtocol > >> info > >> > >> In the old shell, 'dh -v' showed some useful information about the fil= e > path > >> associated with a LoadedImageProtocol that is no longer shown in the > modern > >> shell. > >> > >> For example, with the old shell: > >> > >> Handle D3 (3A552218) > >> Image (3A54C918) File:MicrocodeUpdate > >> ParentHandle..: 3A666398 > >> SystemTable...: 3D2A8F18 > >> DeviceHandle..: 3B1C8098 > >> FilePath......: FvFile(F3331DE6-4A55-44E4-B767-7453F7A1A021) > >> ImageBase.....: 3D650000 - 3D655540 > >> ImageSize.....: 5540 > >> CodeType......: RT_code > >> DataType......: RT_data > >> > >> compared to the new shell: > >> > >> D3: 3A552218 > >> LoadedImage > >> Revision......: 0x00001000 > >> ParentHandle..: 3A666398 > >> SystemTable...: 3D2A8F18 > >> DeviceHandle..: 3B1C8098 > >> FilePath......: 3A552298 > >> OptionsSize...: 0 > >> LoadOptions...: 0 > >> ImageBase.....: 3D650000 > >> ImageSize.....: 5540 > >> CodeType......: EfiRuntimeServicesCode > >> DataType......: EfiRuntimeServicesData > >> Unload........: 0 > >> > >> Here is the output for the same handle with this series applied: > >> > >> D3: 3A552218 > >> LoadedImage > >> Name..........: MicrocodeUpdate > >> Revision......: 0x00001000 > >> ParentHandle..: 3A666398 > >> SystemTable...: 3D2A8F18 > >> DeviceHandle..: 3B1C8098 > >> FilePath......: FvFile(F3331DE6-4A55-44E4-B767-7453F7A1A021) > >> OptionsSize...: 0 > >> LoadOptions...: 0 > >> ImageBase.....: 3D650000 > >> ImageSize.....: 5540 > >> CodeType......: EfiRuntimeServicesCode > >> DataType......: EfiRuntimeServicesData > >> Unload........: 0 > >> > >> Cc: Ruiyu Ni > >> Cc: Jaben Carsey > >> > >> Jeff Westfahl (3): > >> ShellPkg/HandleParsingLib: Show LoadedImageProtocol file path as tex= t > >> ShellPkg/HandleParsingLib: Open LoadedImageProtocol first > >> ShellPkg/HandleParsingLib: Show LoadedImageProtocol file name > >> > >> .../UefiHandleParsingLib/UefiHandleParsingLib.c | 111 > >> +++++++++++++++++++-- > >> .../UefiHandleParsingLib/UefiHandleParsingLib.uni | 4 +- > >> 2 files changed, 104 insertions(+), 11 deletions(-) > >> > >> -- > >> 2.7.4 > > > >