From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 C4EF621BBC43A for ; Wed, 21 Jun 2017 05:10:56 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2017 05:12:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,369,1493708400"; d="scan'208";a="117034780" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 21 Jun 2017 05:12:20 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 21 Jun 2017 05:12:19 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Wed, 21 Jun 2017 20:12:18 +0800 From: "Gao, Liming" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg: Enhance the debug message for InstallProtocolInterface Thread-Index: AQHS6lAfhD9Q0nLwNUa3SFLhQXQLlaIvOpIg Date: Wed, 21 Jun 2017 12:12:16 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D74CDEE@shsmsx102.ccr.corp.intel.com> References: <1498023293-145392-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1498023293-145392-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg: Enhance the debug message for InstallProtocolInterface 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: Wed, 21 Jun 2017 12:10:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, June 21, 2017 1:35 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Gao, Liming > Subject: [PATCH] MdeModulePkg: Enhance the debug message for InstallProto= colInterface >=20 > Current code is using debug message like below for > InstallProtocolInterface. > InstallProtocolInterface: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX XXX >=20 > User could not know whether the installation is failed or not by the > debug message, for example, the code below does not initialize Handle > before calling InstallProtocolInterface, EFI_INVALID_PARAMETER will be > returned. > EFI_HANDLE Handle; > Status =3D gBS->InstallProtocolInterface ( > &Handle, > &XXX, > EFI_NATIVE_INTERFACE, > XXX > ); >=20 > This patch is to add additional debug message if the installation > is failed and specific debug message for the case that the input > handle is invalid. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Core/Dxe/Hand/Handle.c | 14 ++++++++------ > MdeModulePkg/Core/PiSmmCore/Handle.c | 14 ++++++++------ > 2 files changed, 16 insertions(+), 12 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/= Hand/Handle.c > index 1c25521672ba..59b89148c8f0 100644 > --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c > +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c > @@ -1,7 +1,7 @@ > /** @file > UEFI handle & protocol handling. >=20 > -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D License > which accompanies this distribution. The full text of the license may b= e found at > @@ -428,11 +428,12 @@ CoreInstallProtocolInterfaceNotify ( > // in the system > // > InsertTailList (&gHandleList, &Handle->AllHandles); > - } > - > - Status =3D CoreValidateHandle (Handle); > - if (EFI_ERROR (Status)) { > - goto Done; > + } else { > + Status =3D CoreValidateHandle (Handle); > + if (EFI_ERROR (Status)) { > + DEBUG((DEBUG_ERROR, "InstallProtocolInterface: input handle at 0x%= x is invalid\n", Handle)); > + goto Done; > + } > } >=20 > // > @@ -491,6 +492,7 @@ Done: > if (Prot !=3D NULL) { > CoreFreePool (Prot); > } > + DEBUG((DEBUG_ERROR, "InstallProtocolInterface: %g %p failed with %r\= n", Protocol, Interface, Status)); > } >=20 > return Status; > diff --git a/MdeModulePkg/Core/PiSmmCore/Handle.c b/MdeModulePkg/Core/PiS= mmCore/Handle.c > index 9cedb2aeb5ee..19faac844414 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Handle.c > +++ b/MdeModulePkg/Core/PiSmmCore/Handle.c > @@ -1,7 +1,7 @@ > /** @file > SMM handle & protocol handling. >=20 > - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made avai= lable > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -287,11 +287,12 @@ SmmInstallProtocolInterfaceNotify ( > // in the system > // > InsertTailList (&gHandleList, &Handle->AllHandles); > - } > - > - Status =3D SmmValidateHandle (Handle); > - if (EFI_ERROR (Status)) { > - goto Done; > + } else { > + Status =3D SmmValidateHandle (Handle); > + if (EFI_ERROR (Status)) { > + DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: input handle at = 0x%x is invalid\n", Handle)); > + goto Done; > + } > } >=20 > // > @@ -340,6 +341,7 @@ Done: > if (Prot !=3D NULL) { > FreePool (Prot); > } > + DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: %g %p failed with = %r\n", Protocol, Interface, Status)); > } > return Status; > } > -- > 2.7.0.windows.1