From nobody Wed May 1 06:15:28 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1532934065593387.31828403994007; Mon, 30 Jul 2018 00:01:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 95973210C5153; Mon, 30 Jul 2018 00:01:04 -0700 (PDT) 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 EC662210C0F4C for ; Mon, 30 Jul 2018 00:01:02 -0700 (PDT) Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2018 00:01:02 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga008.jf.intel.com with ESMTP; 30 Jul 2018 00:01:01 -0700 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.65; helo=mga03.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.51,422,1526367600"; d="scan'208";a="60864462" From: Dandan Bi To: edk2-devel@lists.01.org Date: Mon, 30 Jul 2018 15:00:15 +0800 Message-Id: <20180730070016.10396-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180730070016.10396-1-dandan.bi@intel.com> References: <20180730070016.10396-1-dandan.bi@intel.com> Subject: [edk2] [patch 1/2] MdeModulePkg: Add definition of Boot Performance Table protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Dmitry Antipov , 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" Add an internal protocol to get the boot performance data, which is used by driver FirmwarePerformanceDxe to get the performance data from performance library (DxeCorePerformanceLib). Cc: Dmitry Antipov Cc: Michael D Kinney Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao --- .../Include/Guid/FirmwareBootPerformanceTable.h | 47 ++++++++++++++++++= ++++ MdeModulePkg/MdeModulePkg.dec | 4 ++ 2 files changed, 51 insertions(+) create mode 100644 MdeModulePkg/Include/Guid/FirmwareBootPerformanceTable.h diff --git a/MdeModulePkg/Include/Guid/FirmwareBootPerformanceTable.h b/Mde= ModulePkg/Include/Guid/FirmwareBootPerformanceTable.h new file mode 100644 index 0000000000..61a21445c7 --- /dev/null +++ b/MdeModulePkg/Include/Guid/FirmwareBootPerformanceTable.h @@ -0,0 +1,47 @@ +/** @file + +Firmware Boot Performance Table Protocol. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made availabl= e under +the terms and conditions of the BSD License that accompanies this distribu= tion. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#ifndef _FIRMWARE_BOOT_PERFORMANCE_TABLE_H_ +#define _FIRMWARE_BOOT_PERFORMANCE_TABLE_H_ + +// +// GUID for get firmware boot performance table Protocol +// +#define FIRMWARE_BOOT_PERFORMANCE_TABLE_PROTOCOL_GUID \ + { 0xffc182cf, 0xb0da, 0x4e81, {0xaf, 0xf8, 0x45, 0x0d, 0xab, 0x6d, 0xc9,= 0xa7 } } + +typedef struct _EDKII_FIRMWARE_BOOT_PERFORMANCE_TABLE_PROTOCOL EDKII_FIRMW= ARE_BOOT_PERFORMANCE_TABLE_PROTOCOL; + +/** + Get the address of the Firmware Boot Performance Table. + + @param BootPerformanceTable - Pointer to the address of firmware boot = performance table. + + @retval EFI_SUCCESS - Successfully created performance record. + @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records. +**/ +typedef +EFI_STATUS +(EFIAPI *GET_FIRMWARE_BOOT_PERFORMANCE_TABLE)( + OUT VOID **BootPerformanceTable + ); + +struct _EDKII_FIRMWARE_BOOT_PERFORMANCE_TABLE_PROTOCOL { + GET_FIRMWARE_BOOT_PERFORMANCE_TABLE GetFirmwareBootPerformanceTable; +}; + +extern EFI_GUID gEdkiiFirmwareBootPerformanceTableProtocolGuid; + +#endif // _FIRMWARE_BOOT_PERFORMANCE_TABLE_H_ diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 3db97f536e..5faebe5457 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -263,10 +263,14 @@ # Include/Guid/PerformanceMeasurement.h gEdkiiPerformanceMeasurementProtocolGuid =3D { 0xc85d06be, 0x5f75, = 0x48ce, { 0xa8, 0x0f, 0x12, 0x36, 0xba, 0x3b, 0x87, 0xb1 } } gEdkiiSmmPerformanceMeasurementProtocolGuid =3D { 0xd56b6d73, 0x1a7b, = 0x4015, { 0x9b, 0xb4, 0x7b, 0x07, 0x17, 0x29, 0xed, 0x24 } } gEdkiiPerformanceMeasurementPpiGuid =3D { 0x0eca9ae3, 0xa792, = 0x418c, { 0xbd, 0x36, 0X6c, 0x2e, 0xca, 0x5c, 0x59, 0xfc } } =20 + ## Protocol to get firmware boot performance table. + # Include/Guid/FirmwareBootPerformanceTable.h + gEdkiiFirmwareBootPerformanceTableProtocolGuid =3D { 0xffc182cf, 0xb0da,= 0x4e81, { 0xaf, 0xf8, 0x45, 0x0d, 0xab, 0x6d, 0xc9, 0xa7 } } + ## Guid is defined for CRC32 encapsulation scheme. # Include/Guid/Crc32GuidedSectionExtraction.h gEfiCrc32GuidedSectionExtractionGuid =3D { 0xFC1BCDB0, 0x7D31, 0x49aa, {= 0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } } =20 ## Include/Guid/StatusCodeCallbackGuid.h --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 06:15:28 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1532934068710172.4036673174212; Mon, 30 Jul 2018 00:01:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C5169210C5157; Mon, 30 Jul 2018 00:01:07 -0700 (PDT) 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 761E6210C0F4C for ; Mon, 30 Jul 2018 00:01:06 -0700 (PDT) Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2018 00:01:06 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga008.jf.intel.com with ESMTP; 30 Jul 2018 00:01:04 -0700 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.65; helo=mga03.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.51,422,1526367600"; d="scan'208";a="60864501" From: Dandan Bi To: edk2-devel@lists.01.org Date: Mon, 30 Jul 2018 15:00:16 +0800 Message-Id: <20180730070016.10396-3-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180730070016.10396-1-dandan.bi@intel.com> References: <20180730070016.10396-1-dandan.bi@intel.com> Subject: [edk2] [patch 2/2] MdeModulePkg: Implement/use Boot Performance Table protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Dmitry Antipov , 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" 1.Update DxeCorePerformanceLib to implement the Firmware Boot performance Table protocol. 2. Update FirmwarePerformanceDxe to use Boot performance Table protocol get Performance data from DxeCorePerformanceLib Cc: Dmitry Antipov Cc: Michael D Kinney Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao --- .../DxeCorePerformanceLib/DxeCorePerformanceLib.c | 74 ++++++------------= ---- .../DxeCorePerformanceLib.inf | 6 +- .../DxeCorePerformanceLibInternal.h | 15 +++++ .../FirmwarePerformanceDxe.c | 71 ++++++++++++++++--= --- .../FirmwarePerformanceDxe.inf | 5 +- 5 files changed, 93 insertions(+), 78 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 5798c89fff..7a46be5304 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -88,10 +88,17 @@ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathToText = =3D NULL; // EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL mPerformanceMeasurementInterface = =3D { CreatePerformanceMeasurement, }; =20 +// +// Interfaces for Firmware Boot Performance Table Protocol. +// +EDKII_FIRMWARE_BOOT_PERFORMANCE_TABLE_PROTOCOL mBootPerformanceProtocolInt= erface =3D { + GetFirmwareBootPerformanceTable, + }; + PERFORMANCE_PROPERTY mPerformanceProperty; =20 /** Return the pointer to the FPDT record in the allocated memory. =20 @@ -209,17 +216,21 @@ IsKnownID ( return FALSE; } } =20 /** - Allocate buffer for Boot Performance table. + Get the address of the Firmware Boot Performance Table. =20 - @return Status code. + @param BootPerformanceTable - Pointer to the address of firmware boot = performance table. =20 + @retval EFI_SUCCESS - Successfully created performance record. + @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records. **/ EFI_STATUS -AllocateBootPerformanceTable ( +EFIAPI +GetFirmwareBootPerformanceTable ( + OUT VOID **BootPerformanceTable ) { EFI_STATUS Status; UINTN Size; UINT8 *SmmBootRecordCommBuffer; @@ -403,10 +414,12 @@ AllocateBootPerformanceTable ( =20 mBootRecordBuffer =3D (UINT8 *) mAcpiBootPerformanceTable; mBootRecordSize =3D mAcpiBootPerformanceTable->Header.Length; mBootRecordMaxSize =3D mBootRecordSize + PcdGet32 (PcdExtFpdtBootRecordP= adSize); =20 + mFpdtBufferIsReported =3D TRUE; + *BootPerformanceTable =3D mAcpiBootPerformanceTable; return EFI_SUCCESS; } =20 /** Get a human readable module name and module guid for the given image han= dle. @@ -1302,48 +1315,10 @@ InternalGetPeiPerformance ( // GuidHob =3D GetNextGuidHob (&gEdkiiFpdtExtendedFirmwarePerformanceGuid= , GET_NEXT_HOB (GuidHob)); } } =20 -/** - Report Boot Perforamnce table address as report status code. - - @param Event The event of notify protocol. - @param Context Notify event context. - -**/ -VOID -EFIAPI -ReportFpdtRecordBuffer ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - UINT64 BPDTAddr; - - if (!mFpdtBufferIsReported) { - Status =3D AllocateBootPerformanceTable (); - if (!EFI_ERROR(Status)) { - BPDTAddr =3D (UINT64)(UINTN)mAcpiBootPerformanceTable; - REPORT_STATUS_CODE_EX ( - EFI_PROGRESS_CODE, - EFI_SOFTWARE_DXE_BS_DRIVER, - 0, - NULL, - &gEdkiiFpdtExtendedFirmwarePerformanceGuid, - &BPDTAddr, - sizeof (UINT64) - ); - } - // - // Set FPDT report state to TRUE. - // - mFpdtBufferIsReported =3D TRUE; - } -} - /** The constructor function initializes Performance infrastructure for DXE = phase. =20 The constructor function publishes Performance and PerformanceEx protoco= l, allocates memory to log DXE performance and merges PEI performance data to DXE performance log. @@ -1362,11 +1337,10 @@ DxeCorePerformanceLibConstructor ( IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; EFI_HANDLE Handle; - EFI_EVENT ReadyToBootEvent; PERFORMANCE_PROPERTY *PerformanceProperty; =20 if (!PerformanceMeasurementEnabled ()) { // // Do not initialize performance infrastructure if not required. @@ -1385,28 +1359,16 @@ DxeCorePerformanceLibConstructor ( Handle =3D NULL; Status =3D gBS->InstallMultipleProtocolInterfaces ( &Handle, &gEdkiiPerformanceMeasurementProtocolGuid, &mPerformanceMeasurementInterface, + &gEdkiiFirmwareBootPerformanceTableProtocolGuid, + &mBootPerformanceProtocolInterface, NULL ); ASSERT_EFI_ERROR (Status); =20 - // - // Register ReadyToBoot event to report StatusCode data - // - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - ReportFpdtRecordBuffer, - NULL, - &gEfiEventReadyToBootGuid, - &ReadyToBootEvent - ); - - ASSERT_EFI_ERROR (Status); - Status =3D EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (V= OID **) &PerformanceProperty); if (EFI_ERROR (Status)) { // // Install configuration table for performance property. // diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.inf b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.i= nf index 8fab47ff02..85963263f3 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf @@ -71,13 +71,13 @@ ## PRODUCES ## SystemTable gPerformanceProtocolGuid gZeroGuid ## SOMETIMES_CONSUMES ## G= UID gEfiFirmwarePerformanceGuid ## SOMETIMES_PRODUCES ## U= NDEFINED # StatusCode Data gEdkiiFpdtExtendedFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## H= OB # StatusCode Data - gEfiEventReadyToBootGuid ## CONSUMES ## E= vent - gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES #= # SystemTable - gEdkiiPerformanceMeasurementProtocolGuid ## PRODUCES ## U= NDEFINED # Install protocol + gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES = ## SystemTable + gEdkiiPerformanceMeasurementProtocolGuid ## PRODUCES = ## UNDEFINED # Install protocol + gEdkiiFirmwareBootPerformanceTableProtocolGuid ## PRODUCES = ## UNDEFINED # Install protocol =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize ## CO= NSUMES diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ibInternal.h b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanc= eLibInternal.h index 2b214e2e57..767c0f7888 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInter= nal.h +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInter= nal.h @@ -21,10 +21,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. =20 #include =20 #include #include +#include #include #include #include #include #include @@ -49,10 +50,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. #include #include #include #include =20 +/** + Get the address of the Firmware Boot Performance Table. + + @param BootPerformanceTable - Pointer to the address of firmware boot = performance table. + + @retval EFI_SUCCESS - Successfully created performance record. + @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records. +**/ +EFI_STATUS +EFIAPI +GetFirmwareBootPerformanceTable ( + OUT VOID **BootPerformanceTable + ); + /** Create performance record with event description and a timestamp. =20 @param CallerIdentifier - Image handle or pointer to caller ID GUID. @param Guid - Pointer to a GUID. diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/Fi= rmwarePerformanceDxe.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDat= aTableDxe/FirmwarePerformanceDxe.c index 3d8e83250e..1f924fbb37 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwareP= erformanceDxe.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwareP= erformanceDxe.c @@ -23,10 +23,12 @@ #include #include =20 #include #include +#include + #include #include =20 #include #include @@ -284,15 +286,27 @@ FpdtAllocateS3PerformanceTableMemory ( EFI_STATUS InstallFirmwarePerformanceDataTable ( VOID ) { - EFI_STATUS Status; - EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; - UINTN BootPerformanceDataSize; - FIRMWARE_PERFORMANCE_VARIABLE PerformanceVariable; - UINTN Size; + EFI_STATUS Status; + EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; + UINTN BootPerformanceDataSize; + FIRMWARE_PERFORMANCE_VARIABLE PerformanceVariable; + UINTN Size; + EDKII_FIRMWARE_BOOT_PERFORMANCE_TABLE_PROTOCOL *FirmwareBootPerformanc= eTableProtocol; + + // + // Locate FirmwareBootPerformanceTable protocol. + // + Status =3D gBS->LocateProtocol (&gEdkiiFirmwareBootPerformanceTableProt= ocolGuid, NULL, (VOID **) &FirmwareBootPerformanceTableProtocol); + if (!EFI_ERROR (Status)) { + Status =3DFirmwareBootPerformanceTableProtocol->GetFirmwareBootPerfor= manceTable((VOID **)&mReceivedAcpiBootPerformanceTable); + } + if (EFI_ERROR (Status)) { + return Status; + } =20 // // Get AcpiTable Protocol. // Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **) &AcpiTableProtocol); @@ -507,22 +521,10 @@ FpdtStatusCodeListenerDxe ( DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd = =3D %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd)); DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart = =3D 0\n")); DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = =3D %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart)); DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = =3D 0\n")); DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit = =3D 0\n")); - } else if (Value =3D=3D (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_R= EADY_TO_BOOT_EVENT)) { - if (mAcpiBootPerformanceTable =3D=3D NULL) { - // - // ACPI Firmware Performance Data Table not installed yet, install i= t now. - // - InstallFirmwarePerformanceDataTable (); - } - } else if (Data !=3D NULL && CompareGuid (&Data->Type, &gEdkiiFpdtExtend= edFirmwarePerformanceGuid)) { - // - // Get the Boot performance table and then install it to ACPI table. - // - CopyMem (&mReceivedAcpiBootPerformanceTable, Data + 1, Data->Size); } else if (Data !=3D NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerf= ormanceGuid)) { DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerDxe: Performance data repo= rted through gEfiFirmwarePerformanceGuid will not be collected by FirmwareP= erformanceDataTableDxe\n")); Status =3D EFI_UNSUPPORTED; } else { // @@ -532,10 +534,32 @@ FpdtStatusCodeListenerDxe ( } =20 return Status; } =20 +/** + Notify function for event group EFI_EVENT_GROUP_READY_TO_BOOT. This is u= sed to + install the Firmware Performance Data Table. + + @param[in] Event The Event that is being processed. + @param[in] Context The Event Context. + +**/ +VOID +EFIAPI +FpdtReadyToBootEventNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + if (mAcpiBootPerformanceTable =3D=3D NULL) { + // + // ACPI Firmware Performance Data Table not installed yet, install it = now. + // + InstallFirmwarePerformanceDataTable (); + } +} =20 /** Notify function for event EVT_SIGNAL_EXIT_BOOT_SERVICES. This is used to= record performance data for ExitBootServicesEntry in FPDT. =20 @@ -639,10 +663,23 @@ FirmwarePerformanceDxeEntryPoint ( &gEfiEventExitBootServicesGuid, &mExitBootServicesEvent ); ASSERT_EFI_ERROR (Status); =20 + // + // Register the notify function to install firmware performance table. + // + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + FpdtReadyToBootEventNotify, + NULL, + &gEfiEventReadyToBootGuid, + &mReadyToBootEvent + ); + ASSERT_EFI_ERROR (Status); + // // Retrieve GUID HOB data that contains the ResetEnd. // GuidHob =3D GetFirstGuidHob (&gEfiFirmwarePerformanceGuid); if (GuidHob !=3D NULL) { diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/Fi= rmwarePerformanceDxe.inf b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceD= ataTableDxe/FirmwarePerformanceDxe.inf index 843cda7021..6f4e8e85fe 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwareP= erformanceDxe.inf +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwareP= erformanceDxe.inf @@ -67,12 +67,13 @@ ## SOMETIMES_CONSUMES ## Variable:L"FirmwarePerformance" ## PRODUCES ## Variable:L"FirmwarePerformance" ## SOMETIMES_CONSUMES ## UNDEFINED # Used to do smm communication ## SOMETIMES_CONSUMES ## UNDEFINED # StatusCode Data gEfiFirmwarePerformanceGuid - gEdkiiFpdtExtendedFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## U= NDEFINED # StatusCode Data - gFirmwarePerformanceS3PointerGuid ## PRODUCES ## UNDEFINED #= SaveLockBox + gEdkiiFpdtExtendedFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ##= UNDEFINED # StatusCode Data + gFirmwarePerformanceS3PointerGuid ## PRODUCES ## UNDEFINED= # SaveLockBox + gEdkiiFirmwareBootPerformanceTableProtocolGuid ## CONSUMES # Loacte pro= tocol =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize ## CONSUMES --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel