-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MmSupervisorPkg: Add MmSupervisorRing3Performance
Adds a new `MM_STANDALONE` driver that is used to link against a `PerformanceLib` core instance for MM user mode drivers. An empty driver is reserved for this use case for the following reasons: 1. Make integration and debug obvious and easy by having a clearly named and designated driver for this purpose. 2. To be among the first MM user mode drivers dispatched to install the performance protocol and make the performance service available to other user mode drivers as early as possible. 3. To avoid linking directly to `MmSupervisorRing3Broker`. The MM Core performance library instance code has functionality that depends on MM services to be available. Since the Ring 3 Broker is reponsible for initializing MM services in user mode, it is complicated and error prone to attempt to defer using those services to install the performance protocol until syscall has been set up with the core and a proper `gMmst` global could be used by the common MM code. This is all much simpler and easier to integrate in a separate MM user mode driver. 4. To avoid linking the library to a pre-existing MM module that may have an unknown number of depdencies in its DEPEX. Since the DEPEX on a given platform aggregates all of the dependencies in linked libraries, it is not safe to assume any given MM module not dedicated exclusively for this purpose will not have unrelated dependencies that unnecessarily prolong installation of the performance protocol. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
- Loading branch information
Showing
5 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
MmSupervisorPkg/Drivers/MmSupervisorRing3Performance/MmSupervisorRing3Performance.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** @file | ||
Driver to initialize and provide user mode performance data in an MM Supervisor environment. | ||
This driver is expected to be linked against a PeformanceLib instance that implements the | ||
code typically in a MM Core for user mode performance data. This includes installing the | ||
performance protocol and registering a MMI to return performance data to the MMI caller. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Uefi.h> | ||
#include <Pi/PiMmCis.h> | ||
|
||
#include <Library/DebugLib.h> | ||
|
||
/** | ||
The MM Supervisor Ring 3 Performance Entry Point. | ||
@param[in] ImageHandle The firmware allocated handle for the EFI image. | ||
@param[in] SystemTable A pointer to the MM System Table. | ||
@retval EFI_SUCCESS The entry point is executed successfully. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
MmSupervisorRing3PerformanceEntryPoint ( | ||
IN EFI_HANDLE ImageHandle, | ||
IN EFI_MM_SYSTEM_TABLE *SystemTable | ||
) | ||
{ | ||
return EFI_SUCCESS; | ||
} |
36 changes: 36 additions & 0 deletions
36
MmSupervisorPkg/Drivers/MmSupervisorRing3Performance/MmSupervisorRing3Performance.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#/** @file | ||
# Driver to initialize and provide user mode performance data in an MM Supervisor environment. | ||
# | ||
# This driver is expected to be linked against a PeformanceLib instance that implements the | ||
# code typically in a MM Core for user mode performance data. This includes installing the | ||
# performance protocol and registering a MMI to return performance data to the MMI caller. | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
#**/ | ||
|
||
[Defines] | ||
INF_VERSION = 0x0001001A | ||
BASE_NAME = MmSupervisorRing3Performance | ||
FILE_GUID = 8B479EAC-C3C8-4A1C-BF58-2BEDAE9E1CFB | ||
MODULE_TYPE = MM_STANDALONE | ||
VERSION_STRING = 1.0 | ||
PI_SPECIFICATION_VERSION = 0x00010032 | ||
ENTRY_POINT = MmSupervisorRing3PerformanceEntryPoint | ||
|
||
[Sources] | ||
MmSupervisorRing3Performance.c | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
MmSupervisorPkg/MmSupervisorPkg.dec | ||
|
||
[LibraryClasses] | ||
DebugLib | ||
StandaloneMmDriverEntryPoint | ||
PerformanceLib | ||
|
||
[Depex] | ||
TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters