Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MmSupervisorPkg: Add MmSupervisorRing3Performance #390

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pytool/CISettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def GetDependencies(self):
{
"Path": "MU_BASECORE",
"Url": "https://github.com/microsoft/mu_basecore.git",
"Branch": "dev/202405"
"Branch": "feature/add_standalonemm_perf_lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is just a reminder to restore the basecore.

},
{
"Path": "Common/MU_PLUS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ flash drivers, SW MMI dispatcher drivers, etc.
IoLib|MmSupervisorPkg/Library/BaseIoLibIntrinsicSysCall/BaseIoLibIntrinsic.inf
SysCallLib|MmSupervisorPkg/Library/SysCallLib/SysCallLib.inf

# This library instance is only necessary if performance tracing is enabled in MM code.
PerformanceLib|MdeModulePkg/Library/SmmPerformanceLib/StandaloneMmPerformanceLib.inf

[Components.IA32]
MmSupervisorPkg/Drivers/StandaloneMmHob/StandaloneMmHob.inf
MmSupervisorPkg/Drivers/MmCommunicationBuffer/MmCommunicationBufferPei.inf
Expand Down Expand Up @@ -312,7 +315,19 @@ flash drivers, SW MMI dispatcher drivers, etc.
# Note that this should be whatever suits the target platform + MM standalone conversion for constructor input arguments
SmmCpuFeaturesLib|$(PLATFORM_SI_PACKAGE)/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
}
MmSupervisorPkg/Drivers/MmSupervisorRing3Broker/MmSupervisorRing3Broker.inf
MmSupervisorPkg/Drivers/MmSupervisorRing3Broker/MmSupervisorRing3Broker.inf {
apop5 marked this conversation as resolved.
Show resolved Hide resolved
<LibraryClasses>
# Because the Ring 3 Broker is the first MM_STANDALONE driver to load. The MM Performance protocol will
# not be installed yet.
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
}
# Note: The following driver is only necessary if performance tracing is enabled in MM code.
MmSupervisorPkg/Drivers/MmSupervisorRing3Performance/MmSupervisorRing3Performance.inf {
<LibraryClasses>
# It is recommended to link this instance of the Standalone MM Core performance library against this
# driver.
PerformanceLib|MdeModulePkg/Library/SmmCorePerformanceLib/StandaloneMmCorePerformanceLib.inf
}

MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterStandaloneMm.inf
UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ For more general background about the steps necessary to integrate the MM Superv

| MM Driver | Location |
| ---| ---|
| MmSupervisorRing3Broker | MmSupervisorPkg/Drivers/MmSupervisorRing3Broker/MmSupervisorRing3Broker.inf |
| MmSupervisorErrorReport | MmSupervisorPkg/Drivers/MmSupervisorErrorReport/MmSupervisorErrorReport.inf |
| MmSupervisorRing3Broker | MmSupervisorPkg/Drivers/MmSupervisorRing3Broker/MmSupervisorRing3Broker.inf |
| MmSupervisorRing3Performance | MmSupervisorPkg/Drivers/MmSupervisorRing3Performance/MmSupervisorRing3Performance.inf |
| MmSupervisorErrorReport | MmSupervisorPkg/Drivers/MmSupervisorErrorReport/MmSupervisorErrorReport.inf |

## MM Standalone User Mode Libraries

Expand Down
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 PerformanceLib 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;
}
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 PerformanceLib 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
1 change: 1 addition & 0 deletions MmSupervisorPkg/MmSupervisorPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@

MmSupervisorPkg/Drivers/MmSupervisorErrorReport/MmSupervisorErrorReport.inf
MmSupervisorPkg/Drivers/MmSupervisorRing3Broker/MmSupervisorRing3Broker.inf
MmSupervisorPkg/Drivers/MmSupervisorRing3Performance/MmSupervisorRing3Performance.inf
MmSupervisorPkg/Drivers/StandaloneMmUnblockMem/StandaloneMmUnblockMem.inf
MmSupervisorPkg/Drivers/MmPeiLaunchers/MmIplX64Relay.inf
MmSupervisorPkg/Drivers/MmPeiLaunchers/MmDxeSupport.inf
Expand Down