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.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 6743722492725 for ; Thu, 1 Mar 2018 21:37:33 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 21:43:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,409,1515484800"; d="scan'208";a="31835735" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2018 21:43:41 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Mar 2018 21:43:41 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Mar 2018 21:43:41 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Fri, 2 Mar 2018 13:43:39 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT Thread-Index: AQHTsS0CLCB80Ovg+EenagQJwqdrH6O8cACQ Date: Fri, 2 Mar 2018 05:43:38 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D617A@SHSMSX104.ccr.corp.intel.com> References: <1519888455-89636-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1519888455-89636-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT 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: Fri, 02 Mar 2018 05:37:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Da= ndan Bi > Sent: Thursday, March 1, 2018 3:14 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Gao, Liming > Subject: [edk2] [patch] MdeModulePkg/DxeCorePerfLib: Add status check ins= tead of ASSERT >=20 > Currently DxeCorePerformanceLib will get SMM performance data based > on SMM communication handler. If SMM communication handler returns error, > the library will ASSERT. In fact, if SMM perf data is not found. > DXE perf data can still be dumped. So using status check instead of > ASSERT is better. >=20 > Cc: Liming Gao > Cc: Star Zeng > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 5 += +--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanc= eLib.c > b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c > index 9b3224e..71d624f 100644 > --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c > +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c > @@ -281,13 +281,12 @@ AllocateBootPerformanceTable ( > // Get the size of boot records. > // > SmmCommData->Function =3D SMM_FPDT_FUNCTION_GET_BOOT_RECOR= D_SIZE; > SmmCommData->BootRecordData =3D NULL; > Status =3D Communication->Communicate (Communication, SmmBootRec= ordCommBuffer, &CommSize); > - ASSERT_EFI_ERROR (Status); >=20 > - if (!EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootR= ecordSize !=3D 0) { > + if (!EFI_ERROR (Status) && !EFI_ERROR (SmmCommData->ReturnStatus= ) && SmmCommData->BootRecordSize !=3D 0) { > // > // Get all boot records > // > SmmCommData->Function =3D SMM_FPDT_FUNCTION_GET_BOOT_REC= ORD_DATA_BY_OFFSET; > SmmBootRecordDataSize =3D SmmCommData->BootRecordSize; > @@ -315,11 +314,11 @@ AllocateBootPerformanceTable ( > // > // Prepare memory for Boot Performance table. > // Boot Performance table includes BasicBoot record, and one or more a= ppended Boot Records. > // > BootPerformanceDataSize =3D sizeof (BOOT_PERFORMANCE_TABLE) + mPerform= anceLength + PcdGet32 > (PcdExtFpdtBootRecordPadSize); > - if (SmmCommData !=3D NULL) { > + if (SmmCommData !=3D NULL && SmmBootRecordData !=3D NULL) { > BootPerformanceDataSize +=3D SmmBootRecordDataSize; > } >=20 > // > // Try to allocate the same runtime buffer as last time boot. > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel