From nobody Tue May 14 15:17:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110178+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110178+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698377289; cv=none; d=zohomail.com; s=zohoarc; b=cpe58ApiCDT/nP0Q/Oyfst+4/GrkXgd7AZ3cUqE3W9VJzfwwswvTW+g2rjnH0GNAyyB0QV9CpX3N1HQTjuY2xGkp88t28nt0a28onvBWUcdHMNhkaNz0mB5EgEEMayxfZHe/UJS28nrHEq9yXPo5MGN8kBhyVY/yuaQsNjVJofU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698377289; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=2e08Fp+e6mxyIcSe7XH/NhsGpoqDLZq9mKa+ACgrlxw=; b=kHoMxWDiODr0iUyukkK436CoqhUFfggkaYlJC+ao0ADqSKQnk57888Ah54xsHtaSxLqtXYpRY/ZHU6a32g1SP0sRRHYCGDWcyfuCbmgYXaUufM0LSiXJuXqEvWBQJwOsgpCDrhiewSEyQsRmdUAUumersIprlWD6iT+FrDsbuGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110178+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698377289915487.57555785759234; Thu, 26 Oct 2023 20:28:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=hTpLsmptdmvN07ZIb6naag54UpyeQB86eHlZyEI9noU=; 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=1698377289; v=1; b=TLavH5rtJrnkvPwWAZJjEikLd/C/HWFYi0cGlW4q1sINo/aWiWZlrxBhCw417Ru/oZY8yEbf SFooUveLCLZIwQ9DwphJ/Ul2qt49XEEJwzK5vV1RQY+7z4eu9chdHpExuqLfpZC8gedNmUSrxR0 4zadjZULvVSfjiNglMMa9DRM= X-Received: by 127.0.0.2 with SMTP id lWuGYY1788612xc9vy1XBwZZ; Thu, 26 Oct 2023 20:28:09 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.89154.1698377286242718615 for ; Thu, 26 Oct 2023 20:28:09 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="473943438" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="473943438" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 20:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="829832834" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="829832834" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by fmsmga004.fm.intel.com with ESMTP; 26 Oct 2023 20:28:07 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Ard Biesheuvel , Sami Mujawar , Ray Ni Subject: [edk2-devel] [PATCH 1/2] StandaloneMmPkg: Add Standalone Mm Core platform hook lib. Date: Fri, 27 Oct 2023 11:28:01 +0800 Message-Id: <74ca409bcfbd0041c8ead9f504776d76420c4b03.1698375369.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: eT05ETcPDtAelJqk1rZNX9IIx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698377291210100005 Content-Type: text/plain; charset="utf-8" Add header file for the definition of StandaloneMmCorePlatformHookLib. Add NULL instance for StandaloneMmCorePlatformHookLib. This library class defines a set of platform hooks called by the Standalone Mm Core. With this library, platform can perform specific tasks before and after invoking registered MMI handlers. Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni Signed-off-by: Wei6 Xu --- .../StandaloneMmCorePlatformHookLibNull.c | 45 +++++++++++++++++++ .../Library/StandaloneMmCorePlatformHookLib.h | 44 ++++++++++++++++++ .../StandaloneMmCorePlatformHookLibNull.inf | 30 +++++++++++++ StandaloneMmPkg/StandaloneMmPkg.dec | 4 ++ StandaloneMmPkg/StandaloneMmPkg.dsc | 2 + 5 files changed, 125 insertions(+) create mode 100644 StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLib= Null/StandaloneMmCorePlatformHookLibNull.c create mode 100644 StandaloneMmPkg/Include/Library/StandaloneMmCorePlatfor= mHookLib.h create mode 100644 StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLib= Null/StandaloneMmCorePlatformHookLibNull.inf diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/St= andaloneMmCorePlatformHookLibNull.c b/StandaloneMmPkg/Library/StandaloneMmC= orePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c new file mode 100644 index 000000000000..dfd781e8c947 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/Standalon= eMmCorePlatformHookLibNull.c @@ -0,0 +1,45 @@ +/** @file + NULL instance of StandaloneMmCorePlatformHookLib. + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/** + Performs platform specific tasks before invoking registered SMI handlers. + + This function performs platform specific tasks before invoking registere= d SMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some = error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookBeforeMmDispatch ( + VOID + ) +{ + return EFI_SUCCESS; +} + +/** + Performs platform specific tasks after invoking registered SMI handlers. + + This function performs platform specific tasks after invoking registered= SMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some = error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookAfterMmDispatch ( + VOID + ) +{ + return EFI_SUCCESS; +} diff --git a/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLi= b.h b/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h new file mode 100644 index 000000000000..37eaa4e8946c --- /dev/null +++ b/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h @@ -0,0 +1,44 @@ +/** @file + Standalone Mm Core Platform Hook Library. This library class defines a s= et of platform + hooks called by the Standalone Mm Core. + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_ +#define STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_ + +/** + Performs platform specific tasks before invoking registered MMI handlers. + + This function performs platform specific tasks before invoking registere= d MMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some = error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookBeforeMmDispatch ( + VOID + ); + +/** + Performs platform specific tasks after invoking registered MMI handlers. + + This function performs platform specific tasks after invoking registered= MMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some = error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookAfterMmDispatch ( + VOID + ); + +#endif diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/St= andaloneMmCorePlatformHookLibNull.inf b/StandaloneMmPkg/Library/StandaloneM= mCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf new file mode 100644 index 000000000000..917f2983c938 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/Standalon= eMmCorePlatformHookLibNull.inf @@ -0,0 +1,30 @@ +## @file +# Standalone MM Core Platform Hook NULL Library instance. +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D StandaloneMmCorePlatformHookLibNull + FILE_GUID =3D A5924660-072B-4188-A850-C45FBED9FCE0 + MODULE_TYPE =3D MM_CORE_STANDALONE + VERSION_STRING =3D 1.0 + PI_SPECIFICATION_VERSION =3D 0x00010032 + LIBRARY_CLASS =3D StandaloneMmCorePlatformHookLib|MM_CO= RE_STANDALONE + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + StandaloneMmCorePlatformHookLibNull.c + +[Packages] + MdePkg/MdePkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec diff --git a/StandaloneMmPkg/StandaloneMmPkg.dec b/StandaloneMmPkg/Standalo= neMmPkg.dec index 46784d94e421..1e847ebd0635 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dec +++ b/StandaloneMmPkg/StandaloneMmPkg.dec @@ -29,6 +29,10 @@ [LibraryClasses] ## MM Memory Operation. MemLib|Include/Library/StandaloneMmMemLib.h =20 + ## @libraryclass Defines a set of platform hooks called by the Standal= one + ## Mm Core. + StandaloneMmCorePlatformHookLib|Include/Library/StandaloneMmCorePlatform= HookLib.h + [LibraryClasses.AArch64, LibraryClasses.ARM] ## @libraryclass Defines a set of interfaces for the MM core entrypoin= t for ## AArch64 and ARM. diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/Standalo= neMmPkg.dsc index 8012f93b7dcc..bfa1760f8e6f 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -72,6 +72,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM] =20 [LibraryClasses.common.MM_CORE_STANDALONE] HobLib|StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHo= bLib.inf + StandaloneMmCorePlatformHookLib|StandaloneMmPkg/Library/StandaloneMmCore= PlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf =20 [LibraryClasses.common.MM_STANDALONE] MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocation= Lib/StandaloneMmMemoryAllocationLib.inf @@ -117,6 +118,7 @@ [Components.common] StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemo= ryAllocationLib.inf StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf + StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMm= CorePlatformHookLibNull.inf =20 [Components.AARCH64, Components.ARM] StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110178): https://edk2.groups.io/g/devel/message/110178 Mute This Topic: https://groups.io/mt/102214567/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 15:17:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110179+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110179+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698377292; cv=none; d=zohomail.com; s=zohoarc; b=LJ/pnClNJrdydcVprSCodYZ352VTpYSWEScV/SMqblspLHRZ0ZRyBlMB8epQx6DqUW9E9ynyfkWJl8GbuhnZVvvBtavQtWniy5xrhbeTwONjHMYNPc6owH6jTwWAIlVP0bMwDqSXyXTvCkY++PPn6oz6XBfqvywxYhDo+bjcR7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698377292; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=ey7fEC50/dRTrF8/4Zk8nwksQmUefoHe6fi4rdBdExo=; b=juB0XlzCsk8hlMM/yIUGa2VqSFKObCkz1TzIENGXXHRbLkF5n5GiqEoApA/1W02kqflUx2WuQt8/iMSLJOh56BeRSLkkUrfkSHdJAIAZ2gJ72x7Dc29gq36j8suNYrKVtgY/7072esLOZYVmXtRXb8PayDrNfXr/eyWbE5eJ6N0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110179+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1698377292800669.8018532313502; Thu, 26 Oct 2023 20:28:12 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=QjH5rDEd8AI74bQATPe7ZkI+totozdDiudgo55Y/t/I=; 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=1698377292; v=1; b=mULeT7Zztn8DndyXYlp/tGmHDpEw4zjRgfmOcWd6vqWdU1K5phoNWPGbezFBjWAXFNB6tSFF Dj/XHQlBEytlAqZtS7bJrOsYX2AiieQoO1esvqPv2O6Qo+QUb/I/MHBwL3J3IbkARFMZGjQVBOf k/AdGWO1ka/tFHhgT+DDCvh4= X-Received: by 127.0.0.2 with SMTP id 6bJMYY1788612xfoAqG6vTyB; Thu, 26 Oct 2023 20:28:12 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.89154.1698377286242718615 for ; Thu, 26 Oct 2023 20:28:11 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="473943445" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="473943445" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 20:28:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="829832841" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="829832841" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by fmsmga004.fm.intel.com with ESMTP; 26 Oct 2023 20:28:10 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Ard Biesheuvel , Sami Mujawar , Ray Ni Subject: [edk2-devel] [PATCH 2/2] StandaloneMmPkg/Core: Consumes Standalone Mm Core Platform Hook Lib. Date: Fri, 27 Oct 2023 11:28:02 +0800 Message-Id: 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: KB2405CoVaL5u4lKxvEy9Vnex1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698377293176100006 Content-Type: text/plain; charset="utf-8" Call platform hooks before and after invoking registered MMI handlers. Platform can perform specific tasks in the hooks. Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni Signed-off-by: Wei6 Xu --- StandaloneMmPkg/Core/StandaloneMmCore.c | 7 ++++++- StandaloneMmPkg/Core/StandaloneMmCore.h | 1 + StandaloneMmPkg/Core/StandaloneMmCore.inf | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core= /StandaloneMmCore.c index d221f1d1115d..43d8694fa9ef 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.c +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c @@ -351,7 +351,7 @@ MmEntryPoint ( // // Call platform hook before Mm Dispatch // - // PlatformHookBeforeMmDispatch (); + PlatformHookBeforeMmDispatch (); =20 // // If a legacy boot has occurred, then make sure gMmCorePrivate is not a= ccessed @@ -400,6 +400,11 @@ MmEntryPoint ( // MmiManage (NULL, NULL, NULL, NULL); =20 + // + // Call platform hook after Mm Dispatch + // + PlatformHookAfterMmDispatch (); + // // TBD: Do not use private data structure ? // diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core= /StandaloneMmCore.h index 822d95358c39..08ea178bfe76 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.h +++ b/StandaloneMmPkg/Core/StandaloneMmCore.h @@ -40,6 +40,7 @@ #include #include #include +#include =20 #include #include diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Co= re/StandaloneMmCore.inf index c44b9ff33303..ac2f07610d04 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -52,6 +52,7 @@ [LibraryClasses] PeCoffLib ReportStatusCodeLib StandaloneMmCoreEntryPoint + StandaloneMmCorePlatformHookLib =20 [Protocols] gEfiDxeMmReadyToLockProtocolGuid ## UNDEFINED # SmiHandlerRe= gister --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110179): https://edk2.groups.io/g/devel/message/110179 Mute This Topic: https://groups.io/mt/102214570/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-