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.web12.30212.1615166599367621297 for ; Sun, 07 Mar 2021 17:23:20 -0800 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 ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 08 Mar 2021 09:23:15 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Chasel Chiu'" , "'Nate DeSimone'" , "'Eric Dong'" References: <20210306013825.8976-1-mikuback@linux.microsoft.com> In-Reply-To: <20210306013825.8976-1-mikuback@linux.microsoft.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW2VkazItcGxhdGZvcm1zXVtQQVRDSCB2MSAxLzFdIE1pblBsYXRmb3JtUGtnL0FjcGkvQWNwaVNtbTogQWRkIFN0YW5kYWxvbmUgTU0gc3VwcG9ydA==?= Date: Mon, 8 Mar 2021 09:23:17 +0800 Message-ID: <006b01d713b9$9e9bb100$dbd31300$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJj503i3cuLCL4piKKAnqTHMWbUNalfpFkg Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Michael: Can you submit one BZ to track this change? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io = =B4=FA=B1=ED Michael > Kubacki > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA3=D4=C26=C8=D5 9:38 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Chasel Chiu ; Nate DeSimone > ; Liming Gao = ; > Eric Dong > =D6=F7=CC=E2: [edk2-devel] [edk2-platforms][PATCH v1 1/1] > MinPlatformPkg/Acpi/AcpiSmm: Add Standalone MM support >=20 > From: Michael Kubacki >=20 > Adds a new module called AcpiStandaloneMm that serves the same role > as AcpiSmm but in a Standalone MM environment. >=20 > This change follows a similar pattern to other changes that have > added Standalone MM support to a SMM module. The SMM INF name and > file path remain unaltered to allow backward compatibility and much > of the code is shared between the driver instances with unique entry > points for each respective module type. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Cc: Eric Dong > Signed-off-by: Michael Kubacki > --- > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/{AcpiSmm.c =3D> AcpiMm.c} > | 33 +++++++++---------- > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.c > | 34 ++++++++++++++++++++ > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiTraditionalMm.c > | 34 ++++++++++++++++++++ > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.h > | 23 +++++++++++++ > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.h > | 24 -------------- > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > | 21 ++++++------ > Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/{AcpiSmm.inf =3D> > AcpiStandaloneMm.inf} | 32 +++++++++--------- > Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc > | 2 ++ > 8 files changed, 133 insertions(+), 70 deletions(-) >=20 > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.c > similarity index 81% > rename from Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.c > rename to Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.c > index 809f75d3c588..2cf559f3fe09 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.c > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.c > @@ -1,12 +1,20 @@ > /** @file > - Acpi Smm driver. > + Functions shared between driver instances. >=20 > Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ >=20 > -#include "AcpiSmm.h" > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "AcpiMm.h" >=20 > /** > Enable SCI > @@ -53,20 +61,13 @@ DisableAcpiCallback ( > } >=20 > /** > - Initializes the Acpi Smm Driver > - > - @param[in] ImageHandle - Pointer to the loaded image protocol for > this driver > - @param[in] SystemTable - Pointer to the EFI System Table > - > - @retval Status - EFI_SUCCESS > - @retval Assert, otherwise. > + ACPI initialization logic shared between the Traditional MM and > + Standalone MM driver instances. >=20 > **/ > -EFI_STATUS > -EFIAPI > -InitializeAcpiSmm ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > +VOID > +InitializeAcpiMm ( > + VOID > ) > { > EFI_STATUS Status; > @@ -77,7 +78,7 @@ InitializeAcpiSmm ( > // > // Locate the ICH SMM SW dispatch protocol > // > - Status =3D gSmst->SmmLocateProtocol = (&gEfiSmmSwDispatch2ProtocolGuid, > NULL, (VOID**)&SwDispatch); > + Status =3D gMmst->MmLocateProtocol = (&gEfiSmmSwDispatch2ProtocolGuid, > NULL, (VOID**) &SwDispatch); > ASSERT_EFI_ERROR (Status); >=20 > // > @@ -103,6 +104,4 @@ InitializeAcpiSmm ( > &SwHandle > ); > ASSERT_EFI_ERROR (Status); > - > - return EFI_SUCCESS; > } > diff --git > a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.c > new file mode 100644 > index 000000000000..f378942fdc07 > --- /dev/null > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.c > @@ -0,0 +1,34 @@ > +/** @file > + Standalone MM driver for ACPI initialization. > + > +Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +#include "AcpiMm.h" > + > +/** > + The Standalone MM driver entry point. > + > + @param[in] ImageHandle - Pointer to the loaded image protocol for > this driver > + @param[in] SystemTable - Pointer to the EFI MM System Table > + > + @retval Status - EFI_SUCCESS > + @retval Assert, otherwise. > + > +**/ > +EFI_STATUS > +EFIAPI > +AcpiStandaloneMmEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_MM_SYSTEM_TABLE *MmSystemTable > + ) > +{ > + InitializeAcpiMm (); > + > + return EFI_SUCCESS; > +} > diff --git > a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiTraditionalMm.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiTraditionalMm.c > new file mode 100644 > index 000000000000..9512926b9e2e > --- /dev/null > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiTraditionalMm.c > @@ -0,0 +1,34 @@ > +/** @file > + Traditional MM driver for ACPI initialization. > + > +Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +#include "AcpiMm.h" > + > +/** > + The Traditional MM driver entry point. > + > + @param[in] ImageHandle - Pointer to the loaded image protocol for > this driver > + @param[in] SystemTable - Pointer to the EFI System Table > + > + @retval Status - EFI_SUCCESS > + @retval Assert, otherwise. > + > +**/ > +EFI_STATUS > +EFIAPI > +AcpiTraditionalMmEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + InitializeAcpiMm (); > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.h > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.h > new file mode 100644 > index 000000000000..051474b0e833 > --- /dev/null > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiMm.h > @@ -0,0 +1,23 @@ > +/** @file > + Internal header file for the ACPI MM driver. > + > +Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _ACPI_MM_H_ > +#define _ACPI_MM_H_ > + > +/** > + ACPI initialization logic shared between the Traditional MM and > + Standalone MM driver instances. > + > +**/ > +VOID > +InitializeAcpiMm ( > + VOID > + ); > + > +#endif > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.h > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.h > deleted file mode 100644 > index e34ffb1b755b..000000000000 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.h > +++ /dev/null > @@ -1,24 +0,0 @@ > -/** @file > - Header file for the Smm platform driver. > - > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> -SPDX-License-Identifier: BSD-2-Clause-Patent > - > -**/ > - > -#ifndef _ACPI_SMM_H_ > -#define _ACPI_SMM_H_ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#endif > - > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > index fbaf46752563..651d4a293e9b 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > @@ -1,7 +1,8 @@ > ### @file > -# Component information file for ACPI SMM module. > +# Component information file for ACPI Traditional MM module. > # > # Copyright (c) 2017, Intel Corporation. All rights reserved.
> +# Copyright (c) Microsoft Corporation.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -14,18 +15,15 @@ [Defines] > VERSION_STRING =3D 1.0 > MODULE_TYPE =3D DXE_SMM_DRIVER > PI_SPECIFICATION_VERSION =3D 1.20 > - ENTRY_POINT =3D InitializeAcpiSmm > + ENTRY_POINT =3D AcpiTraditionalMmEntryPoint >=20 > [LibraryClasses] > - UefiDriverEntryPoint > - UefiBootServicesTableLib > + BoardAcpiEnableLib > DebugLib > - HobLib > - IoLib > + MmServicesTableLib > PcdLib > + UefiDriverEntryPoint > UefiLib > - SmmServicesTableLib > - BoardAcpiEnableLib >=20 > [Packages] > MdePkg/MdePkg.dec > @@ -36,13 +34,12 @@ [Pcd] > gMinPlatformPkgTokenSpaceGuid.PcdAcpiDisableSwSmi ## > CONSUMES >=20 > [Sources] > - AcpiSmm.h > - AcpiSmm.c > + AcpiMm.h > + AcpiMm.c > + AcpiTraditionalMm.c >=20 > [Protocols] > gEfiSmmSwDispatch2ProtocolGuid ## > CONSUMES >=20 > -[Guids] > - > [Depex] > gEfiSmmSwDispatch2ProtocolGuid > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.inf > similarity index 50% > copy from Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > copy to = Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.inf > index fbaf46752563..f7d0861b512d 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.inf > @@ -1,7 +1,8 @@ > ### @file > -# Component information file for ACPI SMM module. > +# Component information file for ACPI Standalone MM module. > # > # Copyright (c) 2017, Intel Corporation. All rights reserved.
> +# Copyright (c) Microsoft Corporation.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -9,40 +10,37 @@ >=20 > [Defines] > INF_VERSION =3D 0x00010017 > - BASE_NAME =3D AcpiSmm > - FILE_GUID =3D > DF9A9FFC-A075-4867-A0B2-5E7540BB023E > + BASE_NAME =3D AcpiStandaloneMm > + FILE_GUID =3D > F113611F-DEE7-4137-8623-0168675E9F6D > VERSION_STRING =3D 1.0 > - MODULE_TYPE =3D DXE_SMM_DRIVER > - PI_SPECIFICATION_VERSION =3D 1.20 > - ENTRY_POINT =3D InitializeAcpiSmm > + MODULE_TYPE =3D MM_STANDALONE > + PI_SPECIFICATION_VERSION =3D 0x00010032 > + ENTRY_POINT =3D AcpiStandaloneMmEntryPoint >=20 > [LibraryClasses] > - UefiDriverEntryPoint > - UefiBootServicesTableLib > + BoardAcpiEnableLib > DebugLib > - HobLib > - IoLib > + MmServicesTableLib > PcdLib > - UefiLib > - SmmServicesTableLib > - BoardAcpiEnableLib > + StandaloneMmDriverEntryPoint >=20 > [Packages] > MdePkg/MdePkg.dec > MinPlatformPkg/MinPlatformPkg.dec >=20 > +# Note: All PCDs consumed in the Standalone MM instance must be = either > FixedAtBuild > +# or PatchableInModule > [Pcd] > gMinPlatformPkgTokenSpaceGuid.PcdAcpiEnableSwSmi ## > CONSUMES > gMinPlatformPkgTokenSpaceGuid.PcdAcpiDisableSwSmi ## > CONSUMES >=20 > [Sources] > - AcpiSmm.h > - AcpiSmm.c > + AcpiMm.h > + AcpiMm.c > + AcpiStandaloneMm.c >=20 > [Protocols] > gEfiSmmSwDispatch2ProtocolGuid ## > CONSUMES >=20 > -[Guids] > - > [Depex] > gEfiSmmSwDispatch2ProtocolGuid > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc > index 0460fd5a3206..998ee7909568 100644 > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc > @@ -117,6 +117,7 @@ [LibraryClasses.common.MM_STANDALONE] > DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf >=20 > MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllo > cationLib/StandaloneMmMemoryAllocationLib.inf >=20 > MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Stand > aloneMmServicesTableLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf >=20 > SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/ > SpiFlashCommonLibNull.inf >=20 > StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryP > oint/StandaloneMmDriverEntryPoint.inf >=20 > @@ -147,6 +148,7 @@ [Components] >=20 > MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf > MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf > + MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.inf > MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf >=20 > = MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiEnableLibNull.inf > = MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf > -- > 2.28.0.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#72510): = https://edk2.groups.io/g/devel/message/72510 > Mute This Topic: https://groups.io/mt/81119075/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20