From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web09.4577.1645598539671392443 for ; Tue, 22 Feb 2022 22:42:19 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=A0rw34M1; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: zhihao.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645598539; x=1677134539; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WnIWJ8bi5z/hHKmMyCNJbIH+30n89V87t67V3toRRdc=; b=A0rw34M1c+aXODAVyyq6qR4jNHEGrOxRHF1iGldJjpYLV28vNEJFgLO+ 859NN8OanyuVd2bXa9y981AtGgZS3pBXas31QbCX2ZLAV0Dc3z6r8M3mD Nw7EGbvl0myoDL93pWVeZNj8XuLPoAxGo8qR9pAGiOh/sc33YTkr0dMAA cOJDMXHfYEb+CmVM5/D2rQM2tXiOkYBABHdZvYhEwdilp3UhYbRqWU+bL +/KMB65VWw9HYntEj9ByB/B/Dn0CPdxA5ZN1AyFfAIXVgctjzJ6N0Xrei 7qdww0WTqVE/c+YwsOoS27oOhgrruk6GldEqv2wCmW0Zd/ZxaRVPJT4/4 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="235406098" X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="235406098" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 22:42:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="548109736" Received: from win_li.ccr.corp.intel.com ([10.239.157.34]) by orsmga008.jf.intel.com with ESMTP; 22 Feb 2022 22:42:16 -0800 From: "Li, Zhihao" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Siyuan Fu Subject: [PATCH v2 1/1] UefiCpuPkg: Extend SMM CPU Service with rendezvous support. Date: Wed, 23 Feb 2022 14:42:15 +0800 Message-Id: <20220223064215.3570-1-zhihao.li@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable REF=EF=BC=9A https://bugzilla.tianocore.org/show_bug.cgi?id=3D3815 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. Patch_v3 modified to pass CI test. (1)Add SmmCpuRendezvousLib.inf into UefiCpuPkg.dsc / (2)Add SmmCpuRendezvousLib.h in UefiCpuPkg.dec [Libraryclasses.IA32, Libraryclasses.x64] (3) Some UncrustifyCheck modifications. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Siyuan Fu Signed-off-by: Zhihao Li --- UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.c | 98 ++++++= ++++++++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 68 ++++++= +++++++- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 15 ++- UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h | 27 ++++++ UefiCpuPkg/Include/Protocol/SmmCpuService.h | 36 ++++++- UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf | 35 +++++++ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 30 +++++- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 5 +- UefiCpuPkg/UefiCpuPkg.dec | 8 +- UefiCpuPkg/UefiCpuPkg.dsc | 2 + 10 files changed, 314 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.c b= /UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.c new file mode 100644 index 000000000000..a53a5a8f301a --- /dev/null +++ b/UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.c @@ -0,0 +1,98 @@ +/** @file=0D + SMM CPU Rendezvous sevice implement.=0D +=0D + Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +STATIC EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *mSmmCpuRendezvous =3D NULL;=0D +STATIC VOID *mRegistration =3D NULL;=0D +=0D +/**=0D + Register status code callback function only when Report Status Code prot= ocol=0D + is installed.=0D +=0D + @param[in] Protocol Points to the protocol's unique identifier.=0D + @param[in] Interface Points to the interface instance.=0D + @param[in] Handle The handle on which the interface was installed.=0D +=0D + @retval EFI_SUCCESS Notification runs successfully.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmCpuRendezvousProtocolNotify (=0D + IN CONST EFI_GUID *Protocol,=0D + IN VOID *Interface,=0D + IN EFI_HANDLE Handle=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + Status =3D gMmst->MmLocateProtocol (=0D + &gEdkiiSmmCpuRendezvousProtocolGuid,=0D + NULL,=0D + (VOID **)&mSmmCpuRendezvous=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + This routine wait for all AP processors to arrive in SMM.=0D +=0D + @param[in] BlockingMode Blocking mode or non-blocking mode.=0D +=0D + @retval EFI_SUCCESS All avaiable APs arrived.=0D + @retval EFI_TIMEOUT Wait for all APs until timeout.=0D + @retval OTHER Fail to register SMM CPU Rendezvous service Protoco= l.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmWaitForAllProcessor (=0D + IN BOOLEAN BlockingMode=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + if ((mRegistration =3D=3D NULL) && (mSmmCpuRendezvous =3D=3D NULL)) {=0D + //=0D + // Locate SMM cpu rendezvous protocol for the first time execute the f= unction.=0D + //=0D + Status =3D gMmst->MmLocateProtocol (=0D + &gEdkiiSmmCpuRendezvousProtocolGuid,=0D + NULL,=0D + (VOID **)&mSmmCpuRendezvous=0D + );=0D + if (EFI_ERROR (Status)) {=0D + Status =3D gMmst->MmRegisterProtocolNotify (=0D + &gEdkiiSmmCpuRendezvousProtocolGuid,=0D + SmmCpuRendezvousProtocolNotify,=0D + &mRegistration=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D + }=0D + }=0D +=0D + if (mSmmCpuRendezvous =3D=3D NULL) {=0D + return EFI_SUCCESS;=0D + }=0D +=0D + Status =3D mSmmCpuRendezvous->WaitForAllProcessor (=0D + mSmmCpuRendezvous,=0D + BlockingMode=0D + );=0D + return Status;=0D +}=0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c b/UefiCpuPkg/PiSmmCpuDx= eSmm/CpuService.c index 5d624f8e9ed6..fceb663fb74f 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c @@ -1,7 +1,7 @@ /** @file=0D Implementation of SMM CPU Services Protocol.=0D =0D -Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -20,6 +20,13 @@ EFI_SMM_CPU_SERVICE_PROTOCOL mSmmCpuService =3D { SmmRegisterExceptionHandler=0D };=0D =0D +//=0D +// EDKII SMM CPU Rendezvous Service Protocol instance=0D +//=0D +EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL mSmmCpuRendezvousService =3D {=0D + SmmWaitForAllProcessor=0D +};=0D +=0D /**=0D Gets processor information on the requested processor at the instant thi= s call is made.=0D =0D @@ -350,6 +357,7 @@ SmmRegisterExceptionHandler ( @param ImageHandle The firmware allocated handle for the EFI image.=0D =0D @retval EFI_SUCCESS EFI SMM CPU Services Protocol was installed succe= ssfully.=0D + @retval OTHER Fail to install Protocol.=0D **/=0D EFI_STATUS=0D InitializeSmmCpuServices (=0D @@ -364,6 +372,64 @@ InitializeSmmCpuServices ( EFI_NATIVE_INTERFACE,=0D &mSmmCpuService=0D );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + Status =3D gSmst->SmmInstallProtocolInterface (=0D + &Handle,=0D + &gEdkiiSmmCpuRendezvousProtocolGuid,=0D + EFI_NATIVE_INTERFACE,=0D + &mSmmCpuRendezvousService=0D + );=0D ASSERT_EFI_ERROR (Status);=0D return Status;=0D }=0D +=0D +/**=0D + Wait for all processors enterring SMM until all CPUs are already synchro= nized or not.=0D +=0D + If BlockingMode is False, timeout value is zero.=0D +=0D + @param This A pointer to the EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL = instance.=0D + @param BlockingMode Blocking mode or non-blocking mode.=0D +=0D + @retval EFI_SUCCESS All avaiable APs arrived.=0D + @retval EFI_TIMEOUT Wait for all APs until timeout.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmWaitForAllProcessor (=0D + IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This,=0D + IN BOOLEAN BlockingMode=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + //=0D + // Return success immediately if all CPUs are already synchronized.=0D + //=0D + if (mSmmMpSyncData->AllApArrivedWithException) {=0D + Status =3D EFI_SUCCESS;=0D + goto ON_EXIT;=0D + }=0D +=0D + if (!BlockingMode) {=0D + Status =3D EFI_TIMEOUT;=0D + goto ON_EXIT;=0D + }=0D +=0D + //=0D + // There are some APs outside SMM, Wait for all avaiable APs to arrive.= =0D + //=0D + SmmWaitForApArrival (BlockingMode);=0D + Status =3D mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : EFI= _TIMEOUT;=0D +=0D +ON_EXIT:=0D + if (!mSmmMpSyncData->AllApArrivedWithException) {=0D + DEBUG ((DEBUG_INFO, "EdkiiSmmWaitForAllApArrival: Timeout to wait all = APs arrival\n"));=0D + }=0D +=0D + return Status;=0D +}=0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index 882dee4fe246..6a8693dae989 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1,7 +1,7 @@ /** @file=0D SMM MP service implementation=0D =0D -Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.
=0D Copyright (c) 2017, AMD Incorporated. All rights reserved.
=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -261,7 +261,7 @@ IsLmceSignaled ( **/=0D VOID=0D SmmWaitForApArrival (=0D - VOID=0D + IN BOOLEAN BlockingMode=0D )=0D {=0D UINT64 Timer;=0D @@ -271,6 +271,13 @@ SmmWaitForApArrival ( =0D ASSERT (*mSmmMpSyncData->Counter <=3D mNumberOfCpus);=0D =0D + //=0D + // If block is False, do not wait and return immediately.=0D + //=0D + if (!BlockingMode) {=0D + return;=0D + }=0D +=0D LmceEn =3D FALSE;=0D LmceSignal =3D FALSE;=0D if (mMachineCheckSupported) {=0D @@ -511,7 +518,7 @@ BSPHandler ( //=0D // Wait for APs to arrive=0D //=0D - SmmWaitForApArrival ();=0D + SmmWaitForApArrival (TRUE);=0D =0D //=0D // Lock the counter down and retrieve the number of APs=0D @@ -1887,6 +1894,8 @@ InitializeMpSyncData ( *mSmmMpSyncData->InsideSmm =3D FALSE;=0D *mSmmMpSyncData->AllCpusInSync =3D FALSE;=0D =0D + mSmmMpSyncData->AllApArrivedWithException =3D FALSE;=0D +=0D for (CpuIndex =3D 0; CpuIndex < gSmmCpuPrivate->SmmCoreEntryContext.Nu= mberOfCpus; CpuIndex++) {=0D mSmmMpSyncData->CpuData[CpuIndex].Busy =3D=0D (SPIN_LOCK *)((UINTN)mSmmCpuSemaphores.SemaphoreCpu.Busy + mSemaph= oreSize * CpuIndex);=0D diff --git a/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h b/UefiCpuPkg/= Include/Library/SmmCpuRendezvousLib.h new file mode 100644 index 000000000000..d0a987dc7d0a --- /dev/null +++ b/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h @@ -0,0 +1,27 @@ +/** @file=0D + SMM CPU Rendezvous library header file.=0D +=0D + Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef SMM_CPU_RENDEZVOUS_H_=0D +#define SMM_CPU_RENDEZVOUS_H_=0D +=0D +/**=0D + This routine wait for all AP processors to arrive in SMM.=0D +=0D + @param[in] BlockingMode Blocking mode or non-blocking mode.=0D +=0D + @retval EFI_SUCCESS All processors checked in to SMM.=0D + @retval EFI_TIMEOUT Wait for all APs until timeout.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmWaitForAllProcessor (=0D + IN BOOLEAN BlockingMode=0D + );=0D +=0D +#endif=0D diff --git a/UefiCpuPkg/Include/Protocol/SmmCpuService.h b/UefiCpuPkg/Inclu= de/Protocol/SmmCpuService.h index 952767afce75..3d93d243409c 100644 --- a/UefiCpuPkg/Include/Protocol/SmmCpuService.h +++ b/UefiCpuPkg/Include/Protocol/SmmCpuService.h @@ -1,7 +1,7 @@ /** @file=0D SMM CPU Service protocol definition.=0D =0D -Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2013 - 2022, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -200,4 +200,38 @@ struct _EFI_SMM_CPU_SERVICE_PROTOCOL { =0D extern EFI_GUID gEfiSmmCpuServiceProtocolGuid;=0D =0D +//=0D +// EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL provide SMM CPU=0D +// rendezvous service support.=0D +//=0D +#define EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL_GUID \=0D + { \=0D + 0xaa00d50b, 0x4911, 0x428f, { 0xb9, 0x1a, 0xa5, 0x9d, 0xdb, 0x13, 0xe2= , 0x4c } \=0D + }=0D +=0D +typedef struct _EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL EDKII_SMM_CPU_RENDEZVOUS= _PROTOCOL;=0D +=0D +/**=0D + Wait for all APs to arrive SMM mode in given timeout constraint.=0D +=0D + @param[in] This A pointer to the EDKII_SMM_CPU_RENDEZV= OUS_PROTOCOL instance.=0D + @param[in] BlockingMode Block or non-block mode.=0D +=0D + @retval EFI_SUCCESS All APs have arrived SMM mode except S= MI disabled APs.=0D + @retval EFI_TIMEOUT There are APs not in SMM mode in given= timeout constraint.=0D +=0D +**/=0D +typedef=0D +EFI_STATUS=0D +(EFIAPI *EDKII_WAIT_FOR_ALL_PROCESSOR)(=0D + IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This,=0D + IN BOOLEAN BlockingMode=0D + );=0D +=0D +struct _EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL {=0D + EDKII_WAIT_FOR_ALL_PROCESSOR WaitForAllProcessor;=0D +};=0D +=0D +extern EFI_GUID gEdkiiSmmCpuRendezvousProtocolGuid;=0D +=0D #endif=0D diff --git a/UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf= b/UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf new file mode 100644 index 000000000000..76896a5b0e1a --- /dev/null +++ b/UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf @@ -0,0 +1,35 @@ +## @file=0D +# SMM CPU Rendezvous service lib.=0D +#=0D +# This is SMM CPU rendezvous service lib that wait for all=0D +# APs to enter SMM mode.=0D +#=0D +# Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D SmmCpuRendezvousLib=0D + FILE_GUID =3D 1509Bb36-9Ba4-438B-B195-Ac5914Db14E2= =0D + MODULE_TYPE =3D DXE_SMM_DRIVER=0D + LIBRARY_CLASS =3D SmmCpuRendezvousLib|MM_STANDALONE DXE= _SMM_DRIVER=0D +=0D +[Sources]=0D + SmmCpuRendezvousLib.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + UefiCpuPkg/UefiCpuPkg.dec=0D +=0D +[LibraryClasses]=0D + BaseLib=0D + DebugLib=0D + MmServicesTableLib=0D +=0D +[Pcd]=0D + gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## CONS= UMES=0D +=0D +[Protocols]=0D + gEdkiiSmmCpuRendezvousProtocolGuid=0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmC= puDxeSmm/PiSmmCpuDxeSmm.h index 26d07c5b5ea0..1960bb4015ef 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -1,7 +1,7 @@ /** @file=0D Agent Module to load other modules to deploy SMM Entry Vector for X86 CPU.= =0D =0D -Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.
=0D Copyright (c) 2017, AMD Incorporated. All rights reserved.
=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -428,6 +428,7 @@ typedef struct { volatile SMM_CPU_SYNC_MODE EffectiveSyncMode;=0D volatile BOOLEAN SwitchBsp;=0D volatile BOOLEAN *CandidateBsp;=0D + volatile BOOLEAN AllApArrivedWithException;=0D EFI_AP_PROCEDURE StartupProcedure;=0D VOID *StartupProcArgs;=0D } SMM_DISPATCHER_MP_SYNC_DATA;=0D @@ -1488,4 +1489,31 @@ IsRestrictedMemoryAccess ( VOID=0D );=0D =0D +/**=0D + Choose blocking or non-blocking mode to Wait for all APs.=0D +=0D + @param[in] This A pointer to the EDKII_SMM_CPU_RENDEZV= OUS_PROTOCOL instance.=0D + @param[in] BlockingMode Blocking or non-blocking mode.=0D +=0D + @retval EFI_SUCCESS All APs have arrived SMM mode except S= MI disabled APs.=0D + @retval EFI_TIMEOUT There are APs not in SMM mode in given= timeout constraint.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +SmmWaitForAllProcessor (=0D + IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This,=0D + IN BOOLEAN BlockingMode=0D + );=0D +=0D +/**=0D + Choose blocking or non-blocking mode to wait for all APs. True for Block= ing and false for not.=0D + Insure when this function returns, no AP will execute normal mode code b= efore entering SMM, except SMI disabled APs.=0D +=0D +**/=0D +VOID=0D +SmmWaitForApArrival (=0D + IN BOOLEAN BlockingMode=0D + );=0D +=0D #endif=0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf b/UefiCpuPkg/PiSm= mCpuDxeSmm/PiSmmCpuDxeSmm.inf index 0e88071c7079..deef00f9c6e9 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf @@ -4,7 +4,7 @@ # This SMM driver performs SMM initialization, deploy SMM Entry Vector,=0D # provides CPU specific services in SMM.=0D #=0D -# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.
=0D # Copyright (c) 2017, AMD Incorporated. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -107,7 +107,8 @@ gEfiSmmReadyToLockProtocolGuid ## NOTIFY=0D gEfiSmmCpuServiceProtocolGuid ## PRODUCES=0D gEdkiiSmmMemoryAttributeProtocolGuid ## PRODUCES=0D - gEfiMmMpProtocolGuid ## PRODUCES=0D + gEfiMmMpProtocolGuid ## PRODUCES=0D + gEdkiiSmmCpuRendezvousProtocolGuid ## PRODUCES=0D =0D [Guids]=0D gEfiAcpiVariableGuid ## SOMETIMES_CONSUMES ## HOB # = it is used for S3 boot.=0D diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 7de66fde674c..525cde463435 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -1,7 +1,7 @@ ## @file UefiCpuPkg.dec=0D # This Package provides UEFI compatible CPU modules and libraries.=0D #=0D -# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -62,6 +62,9 @@ ## @libraryclass Provides function for loading microcode.=0D MicrocodeLib|Include/Library/MicrocodeLib.h=0D =0D + ## @libraryclass Provides function for SMM CPU Rendezvous Library.=0D + SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h=0D +=0D [Guids]=0D gUefiCpuPkgTokenSpaceGuid =3D { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa,= 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }}=0D gMsegSmramGuid =3D { 0x5802bce4, 0xeeee, 0x4e33, { 0xa1,= 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }}=0D @@ -77,7 +80,8 @@ =0D [Protocols]=0D ## Include/Protocol/SmmCpuService.h=0D - gEfiSmmCpuServiceProtocolGuid =3D { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x94,= 0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }}=0D + gEfiSmmCpuServiceProtocolGuid =3D { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x94= , 0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }}=0D + gEdkiiSmmCpuRendezvousProtocolGuid =3D { 0xaa00d50b, 0x4911, 0x428f, { 0= xb9, 0x1a, 0xa5, 0x9d, 0xdb, 0x13, 0xe2, 0x4c }}=0D =0D ## Include/Protocol/SmMonitorInit.h=0D gEfiSmMonitorInitProtocolGuid =3D { 0x228f344d, 0xb3de, 0x43bb, { 0xa4,= 0xd7, 0xea, 0x20, 0xb, 0x1b, 0x14, 0x82 }}=0D diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index d1d61dd6a03b..a0bbde9985d3 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -61,6 +61,7 @@ TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf=0D VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf=0D MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf=0D + SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezv= ousLib.inf=0D =0D [LibraryClasses.common.SEC]=0D PlatformSecLib|UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.= inf=0D @@ -173,6 +174,7 @@ }=0D UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf=0D UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf=0D + UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf=0D =0D [BuildOptions]=0D *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=0D --=20 2.26.2.windows.1