From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id AD26574004E for ; Wed, 20 Dec 2023 17:02:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EWAgj2zrLHrVr0CYBNwe9vYL0Z3gaCVPBWIGmLb2UwM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1703091726; v=1; b=oFuILjb+zUPmGnNn9Qblu60TgwJn89ErKxzbFbIXaezZRRO2qAdcKtAMetJpplLlWgWq9qMC ODbNb02ckNP9+yJ2q0MUlM48XDhgvlBAjO9QfcmLdrWPEUh2AWjHRoTRhFLxVkrkJOKnn3I6U51 TZk9z9zaLs256bq7UtUmBwUk= X-Received: by 127.0.0.2 with SMTP id heP7YY7687511xmYIPbbYByE; Wed, 20 Dec 2023 09:02:06 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mx.groups.io with SMTP id smtpd.web10.26890.1703091715141496173 for ; Wed, 20 Dec 2023 09:02:05 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="2671117" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="2671117" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 09:02:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="920029735" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="920029735" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2023 09:02:04 -0800 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Abner Chang , Nate DeSimone , Lixia Huang Subject: [edk2-devel] [PATCH edk2-platforms 3/4] IpmiFeaturePkg/GenericElog: Support Standalone MM Date: Thu, 21 Dec 2023 01:01:44 +0800 Message-Id: <20d97dad031390ae6019e19b6b0063399b3240f7.1703090380.git.wei6.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oedUjfwvGxanHHixRmDRkg6Ix7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=oFuILjb+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Refactor GenericElog to support Standalone MM. Remove unused function SmElogServiceInitialize. Cc: Abner Chang Cc: Nate DeSimone Signed-off-by: Lixia Huang --- .../GenericElog/Smm/GenericElog.c | 35 +++------------- .../GenericElog/Smm/GenericElog.h | 28 ++++++------- .../GenericElog/Smm/GenericElog.inf | 5 ++- .../GenericElog/Smm/GenericElogStandaloneMm.c | 28 +++++++++++++ .../Smm/GenericElogStandaloneMm.inf | 41 +++++++++++++++++++ .../Smm/GenericElogTraditionalMm.c | 28 +++++++++++++ .../IpmiFeaturePkg/Include/IpmiFeature.dsc | 1 + 7 files changed, 118 insertions(+), 48 deletions(-) create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.c create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.inf create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogTraditionalMm.c diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.c index d6a129a181fb..ce69d36af896 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.c @@ -374,7 +374,7 @@ SetElogRedirInstances ( // // Check for all IPMI Controllers // - Status = gSmst->SmmLocateHandle ( + Status = gMmst->MmLocateHandle ( ByProtocol, &gSmmRedirElogProtocolGuid, NULL, @@ -389,7 +389,7 @@ SetElogRedirInstances ( for (Index = 0; ((Index < NumHandles) && (Index < mElogModuleGlobal->MaxDescriptors)); Index++) { EmptyIndex = mElogModuleGlobal->MaxDescriptors; - Status = gSmst->SmmHandleProtocol ( + Status = gMmst->MmHandleProtocol ( Buffer[Index], &gSmmRedirElogProtocolGuid, (VOID *)&Redir @@ -452,17 +452,12 @@ NotifyElogRedirEventCallback ( /** Initialize the generic Elog driver of server management. - @param ImageHandle - The image handle of this driver - @param SystemTable - The pointer of EFI_SYSTEM_TABLE - @retval EFI_SUCCESS - The driver initialized successfully **/ EFI_STATUS -EFIAPI InitializeSmElogLayer ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { EFI_HANDLE NewHandle; @@ -475,8 +470,6 @@ InitializeSmElogLayer ( return EFI_OUT_OF_RESOURCES; } - SmElogServiceInitialize (ImageHandle, SystemTable); - mElogModuleGlobal->MaxDescriptors = MAX_REDIR_DESCRIPTOR; // @@ -496,7 +489,7 @@ InitializeSmElogLayer ( ElogProtocol->SetEventLogData = (EFI_SET_ELOG_DATA)EfiSetElogData; NewHandle = NULL; - Status = gSmst->SmmInstallProtocolInterface ( + Status = gMmst->MmInstallProtocolInterface ( &NewHandle, &gSmmGenericElogProtocolGuid, EFI_NATIVE_INTERFACE, @@ -512,7 +505,7 @@ InitializeSmElogLayer ( // Register to be notified when the ELOG REDIR protocol has been // produced. // - Status = gSmst->SmmRegisterProtocolNotify ( + Status = gMmst->MmRegisterProtocolNotify ( &gSmmRedirElogProtocolGuid, NULL, &mEfiElogRedirProtocolEvent @@ -538,21 +531,3 @@ EfiSetFunctionEntry ( FunctionPointer->Function = (EFI_PLABEL *)Function; return EFI_SUCCESS; } - -/** - Entry point of SM Elog service Driver - - @param ImageHandle - The Image handle of this driver. - @param SystemTable - The pointer of EFI_SYSTEM_TABLE. - - @retval EFI_SUCCESS - The driver successfully initialized - -**/ -EFI_STATUS -SmElogServiceInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - return EFI_SUCCESS; -} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.h index ad6530616309..71dd247bfe58 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.h +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.h @@ -15,7 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include -#include +#include #include #include "ServerManagement.h" @@ -84,21 +84,6 @@ EfiSetFunctionEntry ( IN VOID *Function ); -/** - Entry point of SM Elog service Driver - - @param ImageHandle - The Image handle of this driver. - @param SystemTable - The pointer of EFI_SYSTEM_TABLE. - - @retval EFI_SUCCESS - The driver successfully initialized - -**/ -EFI_STATUS -SmElogServiceInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - /** Sm Redir Address Change Event. @@ -213,4 +198,15 @@ EfiLibActivateElog ( BOOLEAN Virtual ); +/** + Initialize the generic ELog driver of server management. + + @retval EFI_SUCCESS - The driver initialized successfully + +**/ +EFI_STATUS +InitializeSmElogLayer ( + VOID + ); + #endif //_SMM_GENELOG_H_ diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.inf index ea1cf9d61bbd..2255dfb54a46 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElog.inf @@ -14,11 +14,12 @@ MODULE_TYPE = DXE_SMM_DRIVER PI_SPECIFICATION_VERSION = 0x0001000A VERSION_STRING = 1.0 - ENTRY_POINT = InitializeSmElogLayer + ENTRY_POINT = InitializeSmElogLayerSmm [Sources] GenericElog.c GenericElog.h + GenericElogTraditionalMm.c [Packages] IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -27,7 +28,7 @@ [LibraryClasses] UefiDriverEntryPoint DebugLib - SmmServicesTableLib + MmServicesTableLib MemoryAllocationLib [Protocols] diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.c new file mode 100644 index 000000000000..9c83384819c0 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.c @@ -0,0 +1,28 @@ +/** @file + Generic Event Log functions of StandaloneMm GenericElog driver. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "GenericElog.h" + +/** + The Driver Entry Point. + + @param[in] ImageHandle The image handle of this driver + @param[in] SystemTable The pointer of EFI_MM_SYSTEM_TABLE + + @retval EFI_SUCCESS The driver initialized successfully + +**/ +EFI_STATUS +EFIAPI +InitializeSmElogLayerStandaloneMm ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + return InitializeSmElogLayer (); +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.inf new file mode 100644 index 000000000000..25aecb1920b7 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.inf @@ -0,0 +1,41 @@ +### @file +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = GenericElogStandaloneMm + FILE_GUID = dbc3cc63-3fb9-4314-b87d-caabf75862c4 + MODULE_TYPE = MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeSmElogLayerStandaloneMm + + +[Sources] + GenericElog.c + GenericElog.h + GenericElogStandaloneMm.c + +[Packages] + IpmiFeaturePkg/IpmiFeaturePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + StandaloneMmDriverEntryPoint + DebugLib + MmServicesTableLib + MemoryAllocationLib + +[Protocols] + gSmmGenericElogProtocolGuid # PROTOCOL ALWAYS_PRODUCED + gSmmRedirElogProtocolGuid #PROTOCOL ALWAYS_COMSUMED + +[Depex] + gSmmRedirElogProtocolGuid AND + gSmmIpmiTransportProtocolGuid diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogTraditionalMm.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogTraditionalMm.c new file mode 100644 index 000000000000..5322a49d416d --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericElog/Smm/GenericElogTraditionalMm.c @@ -0,0 +1,28 @@ +/** @file + Generic Event Log functions of SMM GenericElog driver. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "GenericElog.h" + +/** + The Driver Entry Point. + + @param[in] ImageHandle The image handle of this driver + @param[in] SystemTable The pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESS The driver initialized successfully + +**/ +EFI_STATUS +EFIAPI +InitializeSmElogLayerSmm ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return InitializeSmElogLayer (); +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc index 1192c6e9739c..12060d156ef4 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -132,6 +132,7 @@ IpmiFeaturePkg/BmcElog/SmmBmcElog.inf IpmiFeaturePkg/GenericElog/Dxe/GenericElog.inf IpmiFeaturePkg/GenericElog/Smm/GenericElog.inf + IpmiFeaturePkg/GenericElog/Smm/GenericElogStandaloneMm.inf IpmiFeaturePkg/Frb/FrbDxe.inf IpmiFeaturePkg/IpmiRedirFru/IpmiRedirFru.inf IpmiFeaturePkg/GenericFru/GenericFru.inf -- 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112767): https://edk2.groups.io/g/devel/message/112767 Mute This Topic: https://groups.io/mt/103284563/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-