From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.24530.1650848650627811107 for ; Sun, 24 Apr 2022 18:04:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([101.224.116.119]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 25 Apr 2022 09:04:06 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 101.224.116.119 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Zhihao Li'" , Cc: "'Michael D Kinney'" , "'Eric Dong'" , "'Ray Ni'" , "'Michael Kubacki'" , "'Siyuan Fu'" References: <20220422100656.1184-1-zhihao.li@intel.com> In-Reply-To: <20220422100656.1184-1-zhihao.li@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggdjEgMS8xXSBNZGVQa2c6IGFkZCBTbW1DcHVSZW5kZXp2b3VzTGliLmggYW5kIFNtbUNwdVJlbmRlenZvdXNMaWJOdWxsIGltcGxlbWVudC4=?= Date: Mon, 25 Apr 2022 09:04:06 +0800 Message-ID: <010e01d85840$5d3b53b0$17b1fb10$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKGuL8EuUGCPS5ujNm+6aiNmyT1squjDtgQ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Zhihao: To be compatible, you can also add the default SmmCpuRendezvousLib = library instance (SmmCpuRendezvousLibNull) into MdeLibs.dsc.inc. Then, = this change is compatible.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Zhihao Li > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = 2022=E5=B9=B44=E6=9C=8822=E6=97=A5 18:07 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > =E6=8A=84=E9=80=81: Michael D Kinney ; = Liming Gao > ; Eric Dong ; Ray Ni > ; Michael Kubacki ; > Siyuan Fu > =E4=B8=BB=E9=A2=98: [PATCH v1 1/1] MdePkg: add SmmCpuRendezvousLib.h = and > SmmCpuRendezvousLibNull implement. >=20 > REF=EF=BC=9A https://bugzilla.tianocore.org/show_bug.cgi?id=3D3912 >=20 > UefiCpuPkg 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. >=20 > VariableSmm and VariableStandaloneMM driver in MdeModulePkg need > to use this services but MdeModulePkg can't depend on UefiCpuPkg. >=20 > Thus, the solution is moving SmmCpuRendezvouslib.h from UefiCpuPkg > to MdePkg and creating SmmCpuRendezvousLib NullLib version > implementation in MdePkg as dependency for the pkg that can't > depend on UefiCpuPkg. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Eric Dong > Cc: Ray Ni > Cc: Michael Kubacki > Cc: Siyuan Fu >=20 > Signed-off-by: Zhihao Li > --- > MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c > | 29 ++++++++++++++++++++ > {UefiCpuPkg =3D> MdePkg}/Include/Library/SmmCpuRendezvousLib.h > | 0 > MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf > | 26 ++++++++++++++++++ > MdePkg/MdePkg.dec > | 3 ++ > MdePkg/MdePkg.dsc > | 1 + > UefiCpuPkg/UefiCpuPkg.dec > | 3 -- > 6 files changed, 59 insertions(+), 3 deletions(-) >=20 > diff --git > a/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c > b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c > new file mode 100644 > index 000000000000..474195bbb374 > --- /dev/null > +++ > b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c > @@ -0,0 +1,29 @@ > +/** @file >=20 > + SMM CPU Rendezvous sevice implement. >=20 > + >=20 > + Copyright (c) 2022, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > + >=20 > +/** >=20 > + This routine wait for all AP processors to arrive in SMM. >=20 > + >=20 > + @param[in] BlockingMode Blocking mode or non-blocking mode. >=20 > + >=20 > + @retval EFI_SUCCESS All avaiable APs arrived. >=20 > + @retval EFI_TIMEOUT Wait for all APs until timeout. >=20 > + @retval OTHER Fail to register SMM CPU Rendezvous service > Protocol. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +SmmWaitForAllProcessor ( >=20 > + IN BOOLEAN BlockingMode >=20 > + ) >=20 > +{ >=20 > + ASSERT (FALSE); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > diff --git a/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h > b/MdePkg/Include/Library/SmmCpuRendezvousLib.h > similarity index 100% > rename from UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h > rename to MdePkg/Include/Library/SmmCpuRendezvousLib.h > diff --git > a/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.i > nf > b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.i > nf > new file mode 100644 > index 000000000000..7c9bac9af2ff > --- /dev/null > +++ > b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.i > nf > @@ -0,0 +1,26 @@ > +## @file >=20 > +# SMM CPU Rendezvous service lib. >=20 > +# >=20 > +# This is SMM CPU rendezvous service lib that wait for all >=20 > +# APs to enter SMM mode. >=20 > +# >=20 > +# Copyright (c) 2022, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010005 >=20 > + BASE_NAME =3D SmmCpuRendezvousLibNull >=20 > + FILE_GUID =3D > 1e5790ea-d013-4d7b-9047-b4342a762027 >=20 > + MODULE_TYPE =3D DXE_SMM_DRIVER >=20 > + LIBRARY_CLASS =3D > SmmCpuRendezvousLib|MM_STANDALONE DXE_SMM_DRIVER >=20 > + >=20 > +[Sources] >=20 > + SmmCpuRendezvousLibNull.c >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + DebugLib >=20 > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index faeb28c80cbd..85a4398e8f65 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -272,6 +272,9 @@ > # >=20 > CcProbeLib|Include/Library/CcProbeLib.h >=20 >=20 >=20 > + ## @libraryclass Provides function for SMM CPU Rendezvous Library. >=20 > + SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h >=20 > + >=20 > [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64] >=20 > ## @libraryclass Provides services to generate random number. >=20 > # >=20 > diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc > index c8d282882ec1..5e2ea32088fa 100644 > --- a/MdePkg/MdePkg.dsc > +++ b/MdePkg/MdePkg.dsc > @@ -131,6 +131,7 @@ >=20 >=20 > MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf >=20 > MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf >=20 > + > MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf >=20 >=20 >=20 > [Components.IA32, Components.X64, Components.ARM, > Components.AARCH64] >=20 > # >=20 > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index 525cde463435..1951eb294c6c 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -62,9 +62,6 @@ > ## @libraryclass Provides function for loading microcode. >=20 > MicrocodeLib|Include/Library/MicrocodeLib.h >=20 >=20 >=20 > - ## @libraryclass Provides function for SMM CPU Rendezvous Library. >=20 > - SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h >=20 > - >=20 > [Guids] >=20 > gUefiCpuPkgTokenSpaceGuid =3D { 0xac05bf33, 0x995a, 0x4ed4, > { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} >=20 > gMsegSmramGuid =3D { 0x5802bce4, 0xeeee, 0x4e33, > { 0xa1, 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }} >=20 > -- > 2.26.2.windows.1