VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/PiSmmCpuDxeSmm/SmmMpPerf.h@ 105905

Last change on this file since 105905 was 105670, checked in by vboxsync, 8 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1/** @file
2SMM MP perf-logging implementation
3
4Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
5
6SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#ifndef MP_PERF_H_
11#define MP_PERF_H_
12
13//
14// The list of all MP procedures that need to be perf-logged.
15//
16#define SMM_MP_PERF_PROCEDURE_LIST(_) \
17 _(InitializeSmm), \
18 _(SmmRendezvousEntry), \
19 _(PlatformValidSmi), \
20 _(SmmRendezvousExit), \
21 _(SmmMpProcedureMax) // Add new entries above this line
22
23//
24// To perf-log MP procedures, call MpPerfBegin()/MpPerfEnd() with CpuIndex
25// and SMM_MP_PERF_PROCEDURE_ID with entry name defined in the SMM_MP_PERF_PROCEDURE_LIST.
26//
27#define SMM_MP_PERF_PROCEDURE_ID(procedure) SmmMpProcedureId ## procedure
28enum {
29 SMM_MP_PERF_PROCEDURE_LIST (SMM_MP_PERF_PROCEDURE_ID)
30};
31
32typedef struct {
33 UINT64 Begin[SMM_MP_PERF_PROCEDURE_ID (SmmMpProcedureMax)];
34 UINT64 End[SMM_MP_PERF_PROCEDURE_ID (SmmMpProcedureMax)];
35} SMM_PERF_AP_PROCEDURE_PERFORMANCE;
36
37/**
38 Initialize the perf-logging feature for APs.
39
40 @param NumberofCpus Number of processors in the platform.
41**/
42VOID
43InitializeMpPerf (
44 UINTN NumberofCpus
45 );
46
47/**
48 Migrate MP performance data to standardized performance database.
49
50 @param NumberofCpus Number of processors in the platform.
51 @param BspIndex The index of the BSP.
52**/
53VOID
54MigrateMpPerf (
55 UINTN NumberofCpus,
56 UINTN BspIndex
57 );
58
59/**
60 Save the performance counter value before running the MP procedure.
61
62 @param CpuIndex The index of the CPU.
63 @param MpProcedureId The ID of the MP procedure.
64**/
65VOID
66MpPerfBegin (
67 IN UINTN CpuIndex,
68 IN UINTN MpProcedureId
69 );
70
71/**
72 Save the performance counter value after running the MP procedure.
73
74 @param CpuIndex The index of the CPU.
75 @param MpProcedureId The ID of the MP procedure.
76**/
77VOID
78MpPerfEnd (
79 IN UINTN CpuIndex,
80 IN UINTN MpProcedureId
81 );
82
83#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette