|
TianoCore EDK2 master
|
#include "SmmCorePerformanceLibInternal.h"#include <Library/DxeServicesLib.h>#include <Library/SmmMemLib.h>#include <Library/SmmServicesTableLib.h>#include <Library/UefiBootServicesTableLib.h>#include <Library/UefiLib.h>#include <Protocol/SmmBase2.h>#include <Protocol/SmmExitBootServices.h>Go to the source code of this file.
Functions | |
| BOOLEAN | MmCorePerformanceIsNonPrimaryBufferValid (IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length) |
| BOOLEAN | MmCorePerformanceIsPrimaryBufferValid (IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length) |
| EFI_LOADED_IMAGE_PROTOCOL * | GetLoadedImageProtocol (IN EFI_HANDLE Handle) |
| EFI_STATUS | GetNameFromUiSection (IN EFI_GUID *ModuleGuid, OUT CHAR8 *NameString, IN UINTN BufferSize) |
| VOID EFIAPI | InitializeSmmCorePerformanceLib (IN EFI_EVENT Event, IN VOID *Context) |
| EFI_STATUS EFIAPI | SmmCorePerformanceLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
| PERFORMANCE_PROPERTY | mPerformanceProperty |
| SPIN_LOCK | mSmmFpdtLock |
| EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL | mPerformanceMeasurementInterface |
Performance library instance used by SMM Core.
This library provides the performance measurement interfaces and initializes performance logging for the SMM phase. It initializes SMM phase performance logging by publishing the SMM Performance and PerformanceEx Protocol, which is consumed by SmmPerformanceLib to logging performance data in SMM phase.
This library is mainly used by SMM Core to start performance logging to ensure that SMM Performance and PerformanceEx Protocol are installed at the very beginning of SMM phase.
Caution: This module requires additional review when modified. This driver will have external input - performance data and communicate buffer in SMM mode. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.
SmmPerformanceHandlerEx(), SmmPerformanceHandler() will receive untrusted input and do basic validation.
Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SmmCorePerformanceLib.c.
| EFI_LOADED_IMAGE_PROTOCOL * GetLoadedImageProtocol | ( | IN EFI_HANDLE | Handle | ) |
Return a pointer to the loaded image protocol for the given handle.
| [in] | Handle | A handle to query for the loaded image protocol. |
Definition at line 93 of file SmmCorePerformanceLib.c.
| EFI_STATUS GetNameFromUiSection | ( | IN EFI_GUID * | ModuleGuid, |
| OUT CHAR8 * | NameString, | ||
| IN UINTN | BufferSize | ||
| ) |
Get the module name from the user interface section.
| [in] | ModuleGuid | The GUID of the module. |
| [out] | NameString | The buffer to store the name string. |
| [in] | BufferSize | The size of the buffer in bytes. |
| EFI_SUCCESS | The name string is successfully retrieved. |
| EFI_NOT_FOUND | The module name was not found. |
Definition at line 154 of file SmmCorePerformanceLib.c.
Initializes the MM Core Performance library after MM services are available.
| [in] | Event | The event of notify protocol. |
| [in] | Context | Notify event context. |
Definition at line 195 of file SmmCorePerformanceLib.c.
| BOOLEAN MmCorePerformanceIsNonPrimaryBufferValid | ( | IN EFI_PHYSICAL_ADDRESS | Buffer, |
| IN UINT64 | Length | ||
| ) |
A library internal MM-instance specific implementation to check if a buffer outside MM is valid.
This function is provided so Standalone MM and Traditional MM may use a different implementation of data buffer check logic.
| [in] | Buffer | The buffer start address to be checked. |
| [in] | Length | The buffer length to be checked. |
| TRUE | This buffer is valid per processor architecture. |
| FALSE | This buffer is not valid per processor architecture. |
Definition at line 56 of file SmmCorePerformanceLib.c.
| BOOLEAN MmCorePerformanceIsPrimaryBufferValid | ( | IN EFI_PHYSICAL_ADDRESS | Buffer, |
| IN UINT64 | Length | ||
| ) |
A library internal MM-instance specific implementation to check if a comm buffer is valid.
This function is provided so Standalone MM and Traditional MM may use a different implementation of comm buffer check logic.
| [in] | Buffer | The buffer start address to be checked. |
| [in] | Length | The buffer length to be checked. |
| TRUE | This communicate buffer is valid per processor architecture. |
| FALSE | This communicate buffer is not valid per processor architecture. |
Definition at line 77 of file SmmCorePerformanceLib.c.
| EFI_STATUS EFIAPI SmmCorePerformanceLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
| IN EFI_SYSTEM_TABLE * | SystemTable | ||
| ) |
The constructor function initializes the Performance Measurement Enable flag and registers SmmBase2 protocol notify callback. It will ASSERT() if one of these operations fails and it will always return EFI_SUCCESS.
| ImageHandle | The firmware allocated handle for the EFI image. |
| SystemTable | A pointer to the EFI System Table. |
| EFI_SUCCESS | The constructor always returns EFI_SUCCESS. |
Definition at line 268 of file SmmCorePerformanceLib.c.
| EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL mPerformanceMeasurementInterface |
Definition at line 39 of file SmmCorePerformanceLib.c.
| PERFORMANCE_PROPERTY mPerformanceProperty |
Definition at line 35 of file SmmCorePerformanceLib.c.
|
extern |
Definition at line 40 of file MmCorePerformanceLib.c.