summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Include
diff options
context:
space:
mode:
authorLi, Zhihao <zhihao.li@intel.com>2022-03-01 19:22:19 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-03-04 05:44:42 +0000
commit4a68176cb548902cad93e6ebb5957d0cac94d297 (patch)
treedb78f666a4d37560383070c2726067ce30be0dd3 /UefiCpuPkg/Include
parentb83d0a6438f24ba3c6234d9b7593be6f2246ec1e (diff)
downloadedk2-4a68176cb548902cad93e6ebb5957d0cac94d297.tar.gz
edk2-4a68176cb548902cad93e6ebb5957d0cac94d297.tar.bz2
edk2-4a68176cb548902cad93e6ebb5957d0cac94d297.zip
UefiCpuPkg: Extend SMM CPU Service with rendezvous support.
REF? https://bugzilla.tianocore.org/show_bug.cgi?id=3815 This patch define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode. A new library SmmCpuRendezvousLib is provided to abstract the service into library API to simple SMI handler code. Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Zhihao Li <zhihao.li@intel.com> Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Diffstat (limited to 'UefiCpuPkg/Include')
-rw-r--r--UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h27
-rw-r--r--UefiCpuPkg/Include/Protocol/SmmCpuService.h36
2 files changed, 62 insertions, 1 deletions
diff --git a/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h b/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h
new file mode 100644
index 0000000000..82e459e910
--- /dev/null
+++ b/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h
@@ -0,0 +1,27 @@
+/** @file
+ SMM CPU Rendezvous library header file.
+
+ Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef SMM_CPU_RENDEZVOUS_H_
+#define SMM_CPU_RENDEZVOUS_H_
+
+/**
+ This routine wait for all AP processors to arrive in SMM.
+
+ @param[in] BlockingMode Blocking mode or non-blocking mode.
+
+ @retval EFI_SUCCESS All processors checked in to SMM.
+ @retval EFI_TIMEOUT Wait for all APs until timeout.
+
+**/
+EFI_STATUS
+EFIAPI
+SmmWaitForAllProcessor (
+ IN BOOLEAN BlockingMode
+ );
+
+#endif
diff --git a/UefiCpuPkg/Include/Protocol/SmmCpuService.h b/UefiCpuPkg/Include/Protocol/SmmCpuService.h
index 952767afce..3d93d24340 100644
--- a/UefiCpuPkg/Include/Protocol/SmmCpuService.h
+++ b/UefiCpuPkg/Include/Protocol/SmmCpuService.h
@@ -1,7 +1,7 @@
/** @file
SMM CPU Service protocol definition.
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -200,4 +200,38 @@ struct _EFI_SMM_CPU_SERVICE_PROTOCOL {
extern EFI_GUID gEfiSmmCpuServiceProtocolGuid;
+//
+// EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL provide SMM CPU
+// rendezvous service support.
+//
+#define EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL_GUID \
+ { \
+ 0xaa00d50b, 0x4911, 0x428f, { 0xb9, 0x1a, 0xa5, 0x9d, 0xdb, 0x13, 0xe2, 0x4c } \
+ }
+
+typedef struct _EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL;
+
+/**
+ Wait for all APs to arrive SMM mode in given timeout constraint.
+
+ @param[in] This A pointer to the EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL instance.
+ @param[in] BlockingMode Block or non-block mode.
+
+ @retval EFI_SUCCESS All APs have arrived SMM mode except SMI disabled APs.
+ @retval EFI_TIMEOUT There are APs not in SMM mode in given timeout constraint.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_WAIT_FOR_ALL_PROCESSOR)(
+ IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This,
+ IN BOOLEAN BlockingMode
+ );
+
+struct _EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL {
+ EDKII_WAIT_FOR_ALL_PROCESSOR WaitForAllProcessor;
+};
+
+extern EFI_GUID gEdkiiSmmCpuRendezvousProtocolGuid;
+
#endif