From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Kun Qin <kun.q@outlook.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
"Bi, Dandan" <dandan.bi@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>
Subject: Re: [PATCH v2 08/16] MdeModulePkg: FirmwarePerformanceDataTable: Added StandaloneMm support
Date: Wed, 6 Jan 2021 03:24:35 +0000 [thread overview]
Message-ID: <BN8PR11MB36662E50536B0C5E067366A6CAD00@BN8PR11MB3666.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR06MB310225587EEB7605ABC392C2F3D10@MWHPR06MB3102.namprd06.prod.outlook.com>
> -----Original Message-----
> From: Kun Qin <kun.q@outlook.com>
> Sent: Wednesday, January 6, 2021 2:59 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Bi, Dandan <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
> Subject: [PATCH v2 08/16] MdeModulePkg: FirmwarePerformanceDataTable:
> Added StandaloneMm support
>
> This change added support of FPDT driver under StandaloneMm. It replaces
> SMM version ReportStatusCode protocol with MM version. This patch also
> abstracts standalone and traditional MM interfaces into separate files to
> support each corresponding function prototypes and implementations.
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Signed-off-by: Kun Qin <kun.q@outlook.com>
> ---
>
> Notes:
> v2:
> - Removed "EFIAPI" for internally abstracted functions [Hao]
> - Support driver for both IA32 and X64 in dsc file [Hao]
>
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/{Firm
> warePerformanceSmm.c => FirmwarePerformanceCommon.c} | 76
> +++++++++-----------
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceStandaloneMm.c | 61
> ++++++++++++++++
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceTraditional.c | 61 ++++++++++++++++
> MdeModulePkg/MdeModulePkg.dsc
> | 2 +
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceCommon.h | 50 +++++++++++++
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceSmm.inf | 11 +--
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/{Firm
> warePerformanceSmm.inf => FirmwarePerformanceStandaloneMm.inf} | 31
> ++++----
> 7 files changed, 230 insertions(+), 62 deletions(-)
>
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.c
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceCommon.c
> similarity index 75%
> rename from
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceSmm.c
> rename to
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceCommon.c
> index d6c6e7693e4d..ecadef8711ed 100644
> ---
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.c
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceCommon.c
> @@ -1,11 +1,11 @@
> /** @file
> - This module collects performance data for SMM driver boot records and S3
> Suspend Performance Record.
> + This module collects performance data for MM driver boot records and S3
> Suspend Performance Record.
>
> This module registers report status code listener to collect performance
> data
> - for SMM driver boot records and S3 Suspend Performance Record.
> + for MM driver boot records and S3 Suspend Performance Record.
>
> Caution: This module requires additional review when modified.
> - This driver will have external input - communicate buffer in SMM mode.
> + This driver will have external input - communicate buffer in MM mode.
> This external input must be validated carefully to avoid security issue like
> buffer overflow, integer overflow.
>
> @@ -16,13 +16,13 @@
>
> **/
>
> -#include <PiSmm.h>
> +#include <PiMm.h>
>
> -#include <Protocol/SmmReportStatusCodeHandler.h>
> +#include <Protocol/MmReportStatusCodeHandler.h>
>
> #include <Guid/FirmwarePerformance.h>
>
> -#include <Library/SmmServicesTableLib.h>
> +#include <Library/MmServicesTableLib.h>
> #include <Library/BaseLib.h>
> #include <Library/DebugLib.h>
> #include <Library/TimerLib.h>
> @@ -30,23 +30,22 @@
> #include <Library/PcdLib.h>
> #include <Library/BaseMemoryLib.h>
> #include <Library/MemoryAllocationLib.h> -#include
> <Library/UefiBootServicesTableLib.h>
> #include <Library/SynchronizationLib.h> -#include <Library/SmmMemLib.h>
> +#include "FirmwarePerformanceCommon.h"
>
> -SMM_BOOT_PERFORMANCE_TABLE *mSmmBootPerformanceTable =
> NULL;
> +SMM_BOOT_PERFORMANCE_TABLE *mMmBootPerformanceTable =
> NULL;
>
> -EFI_SMM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL;
> +EFI_MM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL;
> UINT64 mSuspendStartTime = 0;
> BOOLEAN mS3SuspendLockBoxSaved = FALSE;
> UINT32 mBootRecordSize = 0;
> UINT8 *mBootRecordBuffer = NULL;
>
> -SPIN_LOCK mSmmFpdtLock;
> -BOOLEAN mSmramIsOutOfResource = FALSE;
> +SPIN_LOCK mMmFpdtLock;
> +BOOLEAN mMmramIsOutOfResource = FALSE;
>
> /**
> - Report status code listener for SMM. This is used to record the
> performance
> + Report status code listener for MM. This is used to record the
> + performance
> data for S3 Suspend Start and S3 Suspend End in FPDT.
>
> @param[in] CodeType Indicates the type of status code being
> reported.
> @@ -66,7 +65,7 @@ BOOLEAN mSmramIsOutOfResource = FALSE;
> **/
> EFI_STATUS
> EFIAPI
> -FpdtStatusCodeListenerSmm (
> +FpdtStatusCodeListenerMm (
> IN EFI_STATUS_CODE_TYPE CodeType,
> IN EFI_STATUS_CODE_VALUE Value,
> IN UINT32 Instance,
> @@ -89,19 +88,19 @@ FpdtStatusCodeListenerSmm (
> // Collect one or more Boot records in boot time
> //
> if (Data != NULL && CompareGuid (&Data->Type,
> &gEdkiiFpdtExtendedFirmwarePerformanceGuid)) {
> - AcquireSpinLock (&mSmmFpdtLock);
> + AcquireSpinLock (&mMmFpdtLock);
> //
> // Get the boot performance data.
> //
> - CopyMem (&mSmmBootPerformanceTable, Data + 1, Data->Size);
> - mBootRecordBuffer = ((UINT8 *) (mSmmBootPerformanceTable)) +
> sizeof (SMM_BOOT_PERFORMANCE_TABLE);
> + CopyMem (&mMmBootPerformanceTable, Data + 1, Data->Size);
> + mBootRecordBuffer = ((UINT8 *) (mMmBootPerformanceTable)) + sizeof
> + (SMM_BOOT_PERFORMANCE_TABLE);
>
> - ReleaseSpinLock (&mSmmFpdtLock);
> + ReleaseSpinLock (&mMmFpdtLock);
> return EFI_SUCCESS;
> }
>
> if (Data != NULL && CompareGuid (&Data->Type,
> &gEfiFirmwarePerformanceGuid)) {
> - DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerSmm: Performance
> data reported through gEfiFirmwarePerformanceGuid will not be collected
> by FirmwarePerformanceDataTableSmm\n"));
> + DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerMm: Performance
> data
> + reported through gEfiFirmwarePerformanceGuid will not be collected by
> + FirmwarePerformanceDataTableMm\n"));
> return EFI_UNSUPPORTED;
> }
>
> @@ -157,7 +156,7 @@ FpdtStatusCodeListenerSmm (
> /**
> Communication service SMI Handler entry.
>
> - This SMI handler provides services for report SMM boot records.
> + This SMI handler provides services for report MM boot records.
>
> Caution: This function may receive untrusted input.
> Communicate buffer and buffer size are external input, so this function will
> do basic validation.
> @@ -166,7 +165,7 @@ FpdtStatusCodeListenerSmm (
> @param[in] RegisterContext Points to an optional handler context which
> was specified when the
> handler was registered.
> @param[in, out] CommBuffer A pointer to a collection of data in memory
> that will
> - be conveyed from a non-SMM environment into an SMM
> environment.
> + be conveyed from a non-MM environment into an MM
> environment.
> @param[in, out] CommBufferSize The size of the CommBuffer.
>
> @retval EFI_SUCCESS The interrupt was handled and quiesced.
> No other handlers
> @@ -207,8 +206,8 @@ FpdtSmiHandler (
> return EFI_SUCCESS;
> }
>
> - if (!SmmIsBufferOutsideSmmValid ((UINTN)CommBuffer,
> TempCommBufferSize)) {
> - DEBUG ((EFI_D_ERROR, "FpdtSmiHandler: SMM communication data
> buffer in SMRAM or overflow!\n"));
> + if (!IsBufferOutsideMmValid ((UINTN)CommBuffer,
> TempCommBufferSize)) {
> + DEBUG ((DEBUG_ERROR, "FpdtSmiHandler: MM communication data
> buffer
> + in MMRAM or overflow!\n"));
> return EFI_SUCCESS;
> }
>
> @@ -218,8 +217,8 @@ FpdtSmiHandler (
>
> switch (SmmCommData->Function) {
> case SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE :
> - if (mSmmBootPerformanceTable != NULL) {
> - mBootRecordSize = mSmmBootPerformanceTable->Header.Length -
> sizeof (SMM_BOOT_PERFORMANCE_TABLE);
> + if (mMmBootPerformanceTable != NULL) {
> + mBootRecordSize = mMmBootPerformanceTable->Header.Length -
> + sizeof (SMM_BOOT_PERFORMANCE_TABLE);
> }
> SmmCommData->BootRecordSize = mBootRecordSize;
> break;
> @@ -244,8 +243,8 @@ FpdtSmiHandler (
> BootRecordSize = mBootRecordSize - BootRecordOffset;
> }
> SmmCommData->BootRecordSize = BootRecordSize;
> - if (!SmmIsBufferOutsideSmmValid ((UINTN)BootRecordData,
> BootRecordSize)) {
> - DEBUG ((EFI_D_ERROR, "FpdtSmiHandler: SMM Data buffer in SMRAM
> or overflow!\n"));
> + if (!IsBufferOutsideMmValid ((UINTN)BootRecordData, BootRecordSize))
> {
> + DEBUG ((DEBUG_ERROR, "FpdtSmiHandler: MM Data buffer in
> MMRAM
> + or overflow!\n"));
> Status = EFI_ACCESS_DENIED;
> break;
> }
> @@ -267,20 +266,15 @@ FpdtSmiHandler (
> }
>
> /**
> - The module Entry Point of the Firmware Performance Data Table SMM
> driver.
> -
> - @param[in] ImageHandle The firmware allocated handle for the EFI
> image.
> - @param[in] SystemTable A pointer to the EFI System Table.
> + The module Entry Point of the Firmware Performance Data Table MM
> driver.
>
> @retval EFI_SUCCESS The entry point is executed successfully.
> @retval Other Some error occurs when executing this entry point.
>
> **/
> EFI_STATUS
> -EFIAPI
> -FirmwarePerformanceSmmEntryPoint (
> - IN EFI_HANDLE ImageHandle,
> - IN EFI_SYSTEM_TABLE *SystemTable
> +FirmwarePerformanceCommonEntryPoint (
> + VOID
> )
> {
> EFI_STATUS Status;
> @@ -289,13 +283,13 @@ FirmwarePerformanceSmmEntryPoint (
> //
> // Initialize spin lock
> //
> - InitializeSpinLock (&mSmmFpdtLock);
> + InitializeSpinLock (&mMmFpdtLock);
>
> //
> - // Get SMM Report Status Code Handler Protocol.
> + // Get MM Report Status Code Handler Protocol.
> //
> - Status = gSmst->SmmLocateProtocol (
> - &gEfiSmmRscHandlerProtocolGuid,
> + Status = gMmst->MmLocateProtocol (
> + &gEfiMmRscHandlerProtocolGuid,
> NULL,
> (VOID **) &mRscHandlerProtocol
> );
> @@ -304,14 +298,14 @@ FirmwarePerformanceSmmEntryPoint (
> //
> // Register report status code listener for BootRecords and S3 Suspend
> Start and End.
> //
> - Status = mRscHandlerProtocol->Register (FpdtStatusCodeListenerSmm);
> + Status = mRscHandlerProtocol->Register (FpdtStatusCodeListenerMm);
> ASSERT_EFI_ERROR (Status);
>
> //
> // Register SMI handler.
> //
> Handle = NULL;
> - Status = gSmst->SmiHandlerRegister (FpdtSmiHandler,
> &gEfiFirmwarePerformanceGuid, &Handle);
> + Status = gMmst->MmiHandlerRegister (FpdtSmiHandler,
> + &gEfiFirmwarePerformanceGuid, &Handle);
> ASSERT_EFI_ERROR (Status);
>
> return Status;
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceStandaloneMm.c
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceStandaloneMm.c
> new file mode 100644
> index 000000000000..d7da61c98c66
> --- /dev/null
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceStandaloneMm.c
> @@ -0,0 +1,61 @@
> +/** @file
> + This module collects performance data for MM driver boot records and S3
> Suspend Performance Record.
> +
> + This module registers report status code listener to collect
> + performance data for MM driver boot records and S3 Suspend
> Performance Record.
> +
> + Caution: This module requires additional review when modified.
> + This driver will have external input - communicate buffer in MM mode.
> + This external input must be validated carefully to avoid security
> + issue like buffer overflow, integer overflow.
> +
> + FpdtSmiHandler() will receive untrusted input and do basic validation.
> +
> + Copyright (c) 2011 - 2018, Intel Corporation. All rights
> + reserved.<BR> Copyright (c), Microsoft Corporation.
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <PiMm.h>
> +
> +#include <Library/StandaloneMmMemLib.h> #include
> +"FirmwarePerformanceCommon.h"
> +
> +/**
> + This function is an abstraction layer for implementation specific Mm buffer
> validation routine.
> +
> + @param Buffer The buffer start address to be checked.
> + @param Length The buffer length to be checked.
> +
> + @retval TRUE This buffer is valid per processor architecture and not
> overlap with SMRAM.
> + @retval FALSE This buffer is not valid per processor architecture or overlap
> with SMRAM.
> +**/
> +BOOLEAN
> +IsBufferOutsideMmValid (
> + IN EFI_PHYSICAL_ADDRESS Buffer,
> + IN UINT64 Length
> + )
> +{
> + return MmIsBufferOutsideMmValid (Buffer, Length); }
> +
> +/**
> + The module Entry Point of the Firmware Performance Data Table MM
> driver.
> +
> + @param[in] ImageHandle The firmware allocated handle for the EFI
> image.
> + @param[in] SystemTable A pointer to the EFI MM System Table.
> +
> + @retval EFI_SUCCESS The entry point is executed successfully.
> + @retval Other Some error occurs when executing this entry point.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +FirmwarePerformanceStandaloneMmEntryPoint (
> + IN EFI_HANDLE ImageHandle,
> + IN EFI_MM_SYSTEM_TABLE *SystemTable
> + )
> +{
> + return FirmwarePerformanceCommonEntryPoint (); }
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceTraditional.c
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceTraditional.c
> new file mode 100644
> index 000000000000..43c050d6b516
> --- /dev/null
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceTraditional.c
> @@ -0,0 +1,61 @@
> +/** @file
> + This module collects performance data for MM driver boot records and S3
> Suspend Performance Record.
> +
> + This module registers report status code listener to collect
> + performance data for MM driver boot records and S3 Suspend
> Performance Record.
> +
> + Caution: This module requires additional review when modified.
> + This driver will have external input - communicate buffer in MM mode.
> + This external input must be validated carefully to avoid security
> + issue like buffer overflow, integer overflow.
> +
> + FpdtSmiHandler() will receive untrusted input and do basic validation.
> +
> + Copyright (c) 2011 - 2018, Intel Corporation. All rights
> + reserved.<BR> Copyright (c), Microsoft Corporation.
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <PiSmm.h>
> +
> +#include <Library/SmmMemLib.h>
> +#include "FirmwarePerformanceCommon.h"
> +
> +/**
> + This function is an abstraction layer for implementation specific Mm buffer
> validation routine.
> +
> + @param Buffer The buffer start address to be checked.
> + @param Length The buffer length to be checked.
> +
> + @retval TRUE This buffer is valid per processor architecture and not
> overlap with SMRAM.
> + @retval FALSE This buffer is not valid per processor architecture or overlap
> with SMRAM.
> +**/
> +BOOLEAN
> +IsBufferOutsideMmValid (
> + IN EFI_PHYSICAL_ADDRESS Buffer,
> + IN UINT64 Length
> + )
> +{
> + return SmmIsBufferOutsideSmmValid (Buffer, Length); }
> +
> +/**
> + The module Entry Point of the Firmware Performance Data Table MM
> driver.
> +
> + @param[in] ImageHandle The firmware allocated handle for the EFI
> image.
> + @param[in] SystemTable A pointer to the EFI System Table.
> +
> + @retval EFI_SUCCESS The entry point is executed successfully.
> + @retval Other Some error occurs when executing this entry point.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +FirmwarePerformanceSmmEntryPoint (
> + IN EFI_HANDLE ImageHandle,
> + IN EFI_SYSTEM_TABLE *SystemTable
> + )
> +{
> + return FirmwarePerformanceCommonEntryPoint (); }
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc index 098909490095..34ca571ca662
> 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -168,6 +168,7 @@ [LibraryClasses.common.MM_STANDALONE]
>
> StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntry
> Point/StandaloneMmDriverEntryPoint.inf
>
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Stan
> daloneMmServicesTableLib.inf
>
> LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxStandalo
> neMmLib.inf
> +
> +
> MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMm
> MemLib.i
> + nf
>
> [LibraryClasses.ARM, LibraryClasses.AARCH64]
> ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
> @@ -495,6 +496,7 @@ [Components.IA32, Components.X64]
> MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
> MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf
>
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceSmm.inf
> +
> +
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePe
> + rformanceStandaloneMm.inf
>
> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.i
> nf
>
> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmD
> xe.inf
>
> MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceCommon.h
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceCommon.h
> new file mode 100644
> index 000000000000..0fbdac02de4c
> --- /dev/null
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceCommon.h
> @@ -0,0 +1,50 @@
> +/** @file
> + This module collects performance data for SMM driver boot records and S3
> Suspend Performance Record.
> +
> + This module registers report status code listener to collect
> + performance data for SMM driver boot records and S3 Suspend
> Performance Record.
> +
> + Caution: This module requires additional review when modified.
> + This driver will have external input - communicate buffer in SMM mode.
> + This external input must be validated carefully to avoid security
> + issue like buffer overflow, integer overflow.
> +
> + FpdtSmiHandler() will receive untrusted input and do basic validation.
> +
> + Copyright (c) 2011 - 2018, Intel Corporation. All rights
> + reserved.<BR> Copyright (c), Microsoft Corporation.
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef _FW_PERF_COMMON_H_
> +#define _FW_PERF_COMMON_H_
> +
> +/**
> + This function is an abstraction layer for implementation specific Mm buffer
> validation routine.
> +
> + @param Buffer The buffer start address to be checked.
> + @param Length The buffer length to be checked.
> +
> + @retval TRUE This buffer is valid per processor architecture and not
> overlap with SMRAM.
> + @retval FALSE This buffer is not valid per processor architecture or overlap
> with SMRAM.
> +**/
> +BOOLEAN
> +IsBufferOutsideMmValid (
> + IN EFI_PHYSICAL_ADDRESS Buffer,
> + IN UINT64 Length
> + );
> +
> +/**
> + The module Entry Point of the Firmware Performance Data Table MM
> driver.
> +
> + @retval EFI_SUCCESS The entry point is executed successfully.
> + @retval Other Some error occurs when executing this entry point.
> +
> +**/
> +EFI_STATUS
> +FirmwarePerformanceCommonEntryPoint (
> + VOID
> + );
> +
> +#endif // _FW_PERF_COMMON_H_
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.inf
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.inf
> index 618cbd56ca59..b7194bd899dd 100644
> ---
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.inf
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceSmm.inf
> @@ -26,7 +26,9 @@ [Defines]
> #
>
> [Sources]
> - FirmwarePerformanceSmm.c
> + FirmwarePerformanceCommon.c
> + FirmwarePerformanceCommon.h
> + FirmwarePerformanceTraditional.c
>
> [Packages]
> MdePkg/MdePkg.dec
> @@ -34,7 +36,7 @@ [Packages]
>
> [LibraryClasses]
> UefiDriverEntryPoint
> - SmmServicesTableLib
> + MmServicesTableLib
> BaseLib
> DebugLib
> TimerLib
> @@ -42,12 +44,11 @@ [LibraryClasses]
> PcdLib
> BaseMemoryLib
> MemoryAllocationLib
> - UefiBootServicesTableLib
> SynchronizationLib
> SmmMemLib
>
> [Protocols]
> - gEfiSmmRscHandlerProtocolGuid ## CONSUMES
> + gEfiMmRscHandlerProtocolGuid ## CONSUMES
>
> [Guids]
> ## SOMETIMES_PRODUCES ## UNDEFINED # SaveLockBox
> @@ -61,7 +62,7 @@ [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd ##
> CONSUMES
>
> [Depex]
> - gEfiSmmRscHandlerProtocolGuid
> + gEfiMmRscHandlerProtocolGuid
>
> [UserExtensions.TianoCore."ExtraFiles"]
> FirmwarePerformanceSmmExtra.uni
> diff --git
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.inf
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceStandaloneMm.inf
> similarity index 65%
> copy from
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceSmm.inf
> copy to
> MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Firm
> warePerformanceStandaloneMm.inf
> index 618cbd56ca59..e6aad88be0ef 100644
> ---
> a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwarePerformanceSmm.inf
> +++
> b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/Fir
> mwa
> +++ rePerformanceStandaloneMm.inf
> @@ -5,19 +5,19 @@
> # for SMM boot performance records and S3 Suspend Performance Record.
> #
> # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) Microsoft Corporation.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
>
> [Defines]
> INF_VERSION = 0x00010005
> - BASE_NAME = FirmwarePerformanceSmm
> - MODULE_UNI_FILE = FirmwarePerformanceSmm.uni
> - FILE_GUID = 044310AB-77FD-402a-AF1A-87D4120E7329
> - MODULE_TYPE = DXE_SMM_DRIVER
> + BASE_NAME = FirmwarePerformanceStandaloneMm
> + FILE_GUID = 827AC29D-E52D-4B1A-874A-C6577E0699CF
> + MODULE_TYPE = MM_STANDALONE
> VERSION_STRING = 1.0
> - PI_SPECIFICATION_VERSION = 0x0001000A
> - ENTRY_POINT = FirmwarePerformanceSmmEntryPoint
> + PI_SPECIFICATION_VERSION = 0x00010032
> + ENTRY_POINT = FirmwarePerformanceStandaloneMmEntryPoint
>
> #
> # The following information is for reference only and not required by the
> build tools.
> @@ -26,15 +26,18 @@ [Defines]
> #
>
> [Sources]
> - FirmwarePerformanceSmm.c
> + FirmwarePerformanceCommon.c
> + FirmwarePerformanceCommon.h
> + FirmwarePerformanceStandaloneMm.c
>
> [Packages]
> MdePkg/MdePkg.dec
> MdeModulePkg/MdeModulePkg.dec
> + StandaloneMmPkg/StandaloneMmPkg.dec
>
> [LibraryClasses]
> - UefiDriverEntryPoint
> - SmmServicesTableLib
> + StandaloneMmDriverEntryPoint
> + MmServicesTableLib
> BaseLib
> DebugLib
> TimerLib
> @@ -42,12 +45,11 @@ [LibraryClasses]
> PcdLib
> BaseMemoryLib
> MemoryAllocationLib
> - UefiBootServicesTableLib
> SynchronizationLib
> - SmmMemLib
> + MemLib
>
> [Protocols]
> - gEfiSmmRscHandlerProtocolGuid ## CONSUMES
> + gEfiMmRscHandlerProtocolGuid ## CONSUMES
>
> [Guids]
> ## SOMETIMES_PRODUCES ## UNDEFINED # SaveLockBox
> @@ -61,7 +63,4 @@ [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd ##
> CONSUMES
>
> [Depex]
> - gEfiSmmRscHandlerProtocolGuid
> -
> -[UserExtensions.TianoCore."ExtraFiles"]
> - FirmwarePerformanceSmmExtra.uni
> + gEfiMmRscHandlerProtocolGuid
> --
> 2.30.0.windows.1
next prev parent reply other threads:[~2021-01-06 3:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210105185935.3769-1-kun.q@outlook.com>
2021-01-05 18:59 ` [PATCH v2 01/16] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Kun Qin
2021-01-05 18:59 ` [PATCH v2 02/16] StandaloneMmPkg: StandaloneMmCoreHobLib: Extend support for x64 Mm Core Kun Qin
2021-01-05 18:59 ` [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Kun Qin
2021-01-06 3:33 ` Yao, Jiewen
2021-01-05 18:59 ` [PATCH v2 04/16] StandaloneMmPkg: StandaloneMmMemLib: Extends support for X64 architecture Kun Qin
2021-01-06 3:38 ` Yao, Jiewen
2021-01-06 6:37 ` [edk2-devel] " Kun Qin
2021-01-05 18:59 ` [PATCH v2 05/16] MdeModulePkg: SmmLockBoxSmmLib: Support StandaloneMm for SmmLockBoxLib Kun Qin
2021-01-05 18:59 ` [PATCH v2 06/16] MdeModulePkg: SmmReportStatusCodeLib: ReportStatusCodeLib in StandaloneMm Kun Qin
2021-01-06 3:24 ` [edk2-devel] " Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 07/16] MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver " Kun Qin
2021-01-06 3:24 ` Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 08/16] MdeModulePkg: FirmwarePerformanceDataTable: Added StandaloneMm support Kun Qin
2021-01-06 3:24 ` Wu, Hao A [this message]
2021-01-05 18:59 ` [PATCH v2 09/16] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Kun Qin
2021-01-06 3:24 ` Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under StandaloneMm Kun Qin
2021-01-05 18:59 ` [PATCH v2 11/16] PcAtChipsetPkg: AcpiTimerLib: Added StandaloneMm instance of AcpiTimerLib Kun Qin
2021-01-13 6:50 ` [edk2-devel] " Ni, Ray
2021-01-13 18:38 ` Kun Qin
2021-01-05 18:59 ` [PATCH v2 12/16] SecurityPkg: Tcg2PhysicalPresenceLib: Introduce StandaloneMm instance Kun Qin
2021-01-05 18:59 ` [PATCH v2 13/16] SecurityPkg: Tcg2PpVendorLibNull: Added support for MM_STANDALONE type Kun Qin
2021-01-05 18:59 ` [PATCH v2 14/16] SecurityPkg: Tpm2DeviceLibDTpm: Introduce StandaloneMm instance Kun Qin
2021-01-05 18:59 ` [PATCH v2 15/16] UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm Kun Qin
2021-01-06 15:46 ` Laszlo Ersek
2021-01-06 15:51 ` Laszlo Ersek
2021-01-06 19:02 ` [edk2-devel] " Kun Qin
2021-01-06 19:07 ` Laszlo Ersek
2021-01-07 19:05 ` Leif Lindholm
2021-01-05 18:59 ` [PATCH v2 16/16] UefiCpuPkg: SmmCpuExceptionHandlerLib: Added StandaloneMm module support Kun Qin
2021-01-06 15:48 ` Laszlo Ersek
[not found] ` <16576B257D31F1E6.24224@groups.io>
2021-01-12 3:24 ` [edk2-devel] [PATCH v2 11/16] PcAtChipsetPkg: AcpiTimerLib: Added StandaloneMm instance of AcpiTimerLib Kun Qin
[not found] ` <16576B256B69BE5C.24224@groups.io>
2021-01-12 3:26 ` [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under StandaloneMm Kun Qin
2021-01-13 1:14 ` 回复: " gaoliming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN8PR11MB36662E50536B0C5E067366A6CAD00@BN8PR11MB3666.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox