From a8363bce367c872b5de52fa2257508fbcea20d84 Mon Sep 17 00:00:00 2001 From: Khor Swee Aun Date: Mon, 16 Dec 2024 16:32:52 -0800 Subject: [PATCH] Add SmmCpuPlatformHookLib IsCpuSyncAlwaysNeeded interface This patch adds the IsCpuSyncAlwaysNeeded interface to the SmmCpuPlatformHookLib. This interface will determine whether the first CPU Synchronization should be executed unconditionally when a SMI occurs. If the function returns true, it indicates that there is no need to check the system configuration and status, and the first CPU Synchronization should be executed unconditionally. If the function returns false, it indicates that the first CPU Synchronization is not executed unconditionally, and the decision to synchronize should be based on the system configuration and status. Signed-off-by: Khor Swee Aun --- .../Include/Library/SmmCpuPlatformHookLib.h | 20 ++++++++++++++++ .../SmmCpuPlatformHookLibNull.c | 23 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h b/UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h index 149a694891..5bc9ba2b86 100644 --- a/UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h +++ b/UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h @@ -115,4 +115,24 @@ SmmCpuPlatformHookBeforeMmiHandler ( VOID ); +/** + This function determines whether the first CPU Synchronization should be executed unconditionally + when a SMI occurs. + + If the function returns true, it indicates that there is no need to check the system configuration + and status, and the first CPU Synchronization should be executed unconditionally. + + If the function returns false, it indicates that the first CPU Synchronization is not executed + unconditionally, and the decision to synchronize should be based on the system configuration and status. + + @retval TRUE The first CPU Synchronization is executed unconditionally. + @retval FALSE The first CPU Synchronization is not executed unconditionally. + +**/ +BOOLEAN +EFIAPI +IsCpuSyncAlwaysNeeded ( + VOID + ); + #endif diff --git a/UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c b/UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c index b03a72d177..beca8aa6b2 100644 --- a/UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c +++ b/UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c @@ -118,3 +118,26 @@ SmmCpuPlatformHookBeforeMmiHandler ( { return EFI_UNSUPPORTED; } + +/** + This function determines whether the first CPU Synchronization should be executed unconditionally + when a SMI occurs. + + If the function returns true, it indicates that there is no need to check the system configuration + and status, and the first CPU Synchronization should be executed unconditionally. + + If the function returns false, it indicates that the first CPU Synchronization is not executed + unconditionally, and the decision to synchronize should be based on the system configuration and status. + + @retval TRUE The first CPU Synchronization is executed unconditionally. + @retval FALSE The first CPU Synchronization is not executed unconditionally. + +**/ +BOOLEAN +EFIAPI +IsCpuSyncAlwaysNeeded ( + VOID + ) +{ + return FALSE; +}