From nobody Mon Dec 23 06:00:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519888485815843.880191385621; Wed, 28 Feb 2018 23:14:45 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B269222423851; Wed, 28 Feb 2018 23:08:36 -0800 (PST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 821C42242384E for ; Wed, 28 Feb 2018 23:08:34 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 23:14:42 -0800 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2018 23:14:41 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="34582675" From: Dandan Bi To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 15:14:14 +0800 Message-Id: <1519888455-89636-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Star Zeng , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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. Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao --- MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 5 ++-= -- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.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_RECORD_= SIZE; SmmCommData->BootRecordData =3D NULL; Status =3D Communication->Communicate (Communication, SmmBootRecor= dCommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); =20 - if (!EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRec= ordSize !=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_RECOR= D_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 app= ended Boot Records. // BootPerformanceDataSize =3D sizeof (BOOT_PERFORMANCE_TABLE) + mPerforman= ceLength + 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. --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel