Skip to content

Commit 7d4da67

Browse files
Jiaxin Wumergify[bot]
authored andcommitted
UefiCpuPkg: Add SmmCpuPlatformHookBeforeMmiHandler
This patch is to add SmmCpuPlatformHookBeforeMmiHandler interface in SmmCpuPlatformHookLib. The new API can be used to perform the platform specific items before executing MMI Handler. For example, Intel can leverage this API to clear the pending SMI bit after all CPUs finish the sync and before the MMI handlers. If so, the the redundant SMI can be avoided after CPU exit from current SMI. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
1 parent 2351165 commit 7d4da67

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @file
22
Public include file for the SMM CPU Platform Hook Library.
33
4-
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
4+
Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
77
**/
@@ -100,4 +100,19 @@ GetPlatformPageTableAttribute (
100100
OUT UINTN *PageAttribute
101101
);
102102

103+
/**
104+
SMM CPU Platform Hook before executing MMI Handler.
105+
106+
This function can be used to perform the platform specific items before executing MMI Handler.
107+
108+
@retval EFI_SUCCESS The smm cpu platform hook before executing MMI Handler is executed successfully.
109+
@retval EFI_UNSUPPORTED The smm cpu platform hook before executing MMI Handler is unsupported.
110+
111+
**/
112+
EFI_STATUS
113+
EFIAPI
114+
SmmCpuPlatformHookBeforeMmiHandler (
115+
VOID
116+
);
117+
103118
#endif

UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @file
22
SMM CPU Platform Hook NULL library instance.
33
4-
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
4+
Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.<BR>
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
77
**/
@@ -100,3 +100,21 @@ GetPlatformPageTableAttribute (
100100
{
101101
return EFI_UNSUPPORTED;
102102
}
103+
104+
/**
105+
SMM CPU Platform Hook before executing MMI Handler.
106+
107+
This function can be used to perform the platform specific items before executing MMI Handler.
108+
109+
@retval EFI_SUCCESS The smm cpu platform hook before executing MMI Handler is executed successfully.
110+
@retval EFI_UNSUPPORTED The smm cpu platform hook before executing MMI Handler is unsupported.
111+
112+
**/
113+
EFI_STATUS
114+
EFIAPI
115+
SmmCpuPlatformHookBeforeMmiHandler (
116+
VOID
117+
)
118+
{
119+
return EFI_UNSUPPORTED;
120+
}

0 commit comments

Comments
 (0)