From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.92.18.13]) by mx.groups.io with SMTP id smtpd.web10.1277.1614032116940908073 for ; Mon, 22 Feb 2021 14:15:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=VGoHVxNd; spf=pass (domain: outlook.com, ip: 40.92.18.13, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S/yMLnh8g3Y0HC8RZCg52M2IW2n78LolztgxBrJv4qF9duroB6cKQdZCbeyZGWGHFAc8J5jViB/iO5joJQEW6k1orC7qNo5k3QzK5V7D+As11Naoc81qH/ggIFkkG9Q9gOTjZ9Agp4hEJARHMd4siU4LH0mPg5scR2SoO+vpVnWb0kTvi7qcFcnqEKc/nNrPRnpweyqLsawK6CfD6OEsakVDVx/sIc3O+fk7AwqMxlnaGIVbZ+JCJ+gipg1DrMeIMuKo5Oxq02nT8Hfb2wx84Vw4EJji9Yai6hPF/xVaM1cvtKvsUrrjC7r6jAewV/3czhjI93pVOx5sPehBL8xNvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uHfyjlUTXIn68P1dvVzwyrwnbSuvQoSD1+6pNi5sWYs=; b=PM4RbmRIHri/W79rkax1MecMSNfV3QwrrroHCWW/1nwZoMZi2IE7x1k4NBvPt/i76UgtXrjuGgioCS3h5TTRHatXT1q5yvbnU05Irk+UqVtM2vUtJIamyHcABN0MUPJlAbI9BI7oqjM7XWaZskhfn0tgjySIP12GiFtyoVbCITBQamxQWsieEao89ActUTU5Ulg201cAa+43dVTyJXqG8w4SQ6wWCuYLcayHH47j5t6BZ2XD+0BM8OIdSMmIvkceMGGGQlOf/HRf1P4Xjhq6+hxLXjsRsKZsdfrrT029sZkONzV74V0NiafGhE6LHbz+KJG8y5Gx1zoePa4dRQw5eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uHfyjlUTXIn68P1dvVzwyrwnbSuvQoSD1+6pNi5sWYs=; b=VGoHVxNdLOfDMUUbV+GjDMdriHF4rBzCndzJ4Cwsk0C7uxx2RyzJmvMzFD6ymGbgBwbyDtMmI/3TV/Nj6fOM7+R41dL6S1MFHyaGjgsOaeUhziIcgDpm23bC22bAFp8zoZja5HS6npUwSVbWQR8pr11+GkNOGaMIynF4aAXqhvxRQRagUandL02E7Z5wzSk3Hv3a9n2p5jsBHPS9sCc6KbfLr3WeQW7bf3MXAszRW8relL5UJ/ItHicSA6AyjjGzpg6iOTskWa2UCGDc6pF3bQsAwyfr1+oGXITv7pI9ztMCIEgeTbqi5bddNZucfoTcFILUV2WwruQLuHeU+E9nag== Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::51) by DM6NAM11HT173.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::371) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Mon, 22 Feb 2021 22:15:15 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:fc4d::44) by DM6NAM11FT031.mail.protection.outlook.com (2a01:111:e400:fc4d::203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Mon, 22 Feb 2021 22:15:15 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b%7]) with mapi id 15.20.3868.032; Mon, 22 Feb 2021 22:15:09 +0000 From: "Kun Qin" To: "devel@edk2.groups.io" , "Wu, Hao A" CC: Jian J Wang , Eric Dong , Ray Ni , Jiewen Yao Subject: Re: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance Thread-Topic: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance Thread-Index: AQHW/0uUyofdi3a8+UuCoenhRzNoH6pk0TcG Date: Mon, 22 Feb 2021 22:15:09 +0000 Message-ID: References: <20210210012457.315-1-kun.q@outlook.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:22C4D94CD44669FD3545EB70BC7852EF6FD5B2CFC908487B843AED357161B817;UpperCasedChecksum:994D174A9661238E673270B60EBEAF6C7F1D37019651DB71A96C78749ADA8077;SizeAsReceived:7125;Count:44 x-tmn: [Plieu/TgxY9h6TD7GYJv0jJMha/nLYz1] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: b42b8e66-4a1f-409f-04cb-08d8d77f510a x-ms-traffictypediagnostic: DM6NAM11HT173: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GCGfDD/wfCxUjKUaQgJsCkjMMZLHK6AfgB8PEPvdksrjtj7BWaf7Ic2X9y75mCBNZZtWqqi/TUts6eY4d0vcvdC9vq9NMaiiwEslxGkCR5Y4eIiYmMGZrGJPV6qZmuNmbv2VTAfaJwknY4hjXkvj10VoiPVSb6wQlCnXBIRUNrxiTllotq/Ay4NFbSJfbBlSzObDfor5yTMMSL0QDSuINCzgFAB3a0Em9oqFDnmaVabkCtwExcNjXcmLNXwSrCbPUXhfSixol7zR9Fje6n3Hd+lqX4yLJ4wzpsSrKxWlej60sTAF0zCiZkKlYnxFKS9sPklIGR1DSK4RGx78nPbmHNISTRykZGke2Wj+0RsPCyrEakKj+zE2OMR1M7di0k5LgVYSm88QmkG2/mI61+D/kbF46tCAwe2/tLTjbqpJCY0UBUw7lp6dyhfKZNeFIcCe x-ms-exchange-antispam-messagedata: XYYeplFmaKsncRiEIq6gccIQ0trxQwojgKEHnYyQcb94BWqczT+JADvj+NRt5DOh6xaqcsygrOGDvfK4vr0TNPAF2RmmUojtO/mLLGfhnz++fcvlFrxApad+lLtUEp7hwfPnuYnsJxTyKAXegugrEw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b42b8e66-4a1f-409f-04cb-08d8d77f510a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2021 22:15:09.2391 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT173 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR06MB31020796B513205371AA1036F3819MWHPR06MB3102namp_" --_000_MWHPR06MB31020796B513205371AA1036F3819MWHPR06MB3102namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Hao, The patch series was resent with intended usage in VariableRuntime and Tcg2= drivers. Could you please provide feedback on them? Any input is appreciat= ed. Regards, Kun From: Kun Qin Sent: Tuesday, February 9, 2021 17:25 To: devel@edk2.groups.io Cc: Jian J Wang; Hao A Wu; Eric Dong; Ray Ni; Jiewen Yao Subject: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definiti= on and null instance REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3168 This interface definition provides an abstraction layer for DXE drivers to request certain memory blocks to be mapped/unblocked for accessibility inside MM environment. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Jiewen Yao Signed-off-by: Kun Qin --- Notes: v2: - Resend with practical usage. No change [Hao] MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.c |= 40 ++++++++++++++++++++ MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h |= 40 ++++++++++++++++++++ MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf |= 29 ++++++++++++++ MdeModulePkg/MdeModulePkg.dec |= 5 +++ MdeModulePkg/MdeModulePkg.dsc |= 2 + 5 files changed, 116 insertions(+) diff --git a/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.c b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLib= Null.c new file mode 100644 index 000000000000..774a7e41cfb0 --- /dev/null +++ b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= c @@ -0,0 +1,40 @@ +/** @file + Null instance of MM Unblock Page Library. + + This library provides an abstraction layer of requesting certain page ac= cess to be unblocked + by MM environment if applicable. + + Copyright (c), Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/** + This API provides a way to unblock certain data pages to be accessible i= nside MM environment. + + @param UnblockAddress The address of buffer caller requests to= unblock, the address + has to be page aligned. + @param NumberOfPages The number of pages requested to be unbl= ocked from MM + environment. + + @return EFI_SUCCESS The request goes through successfully. + @return EFI_NOT_AVAILABLE_YET The requested functionality is not produ= ced yet. + @return EFI_UNSUPPORTED The requested functionality is not suppo= rted on current platform. + @return EFI_SECURITY_VIOLATION The requested address failed to pass sec= urity check for + unblocking. + @return EFI_INVALID_PARAMETER Input address either NULL pointer or not= page aligned. + @return EFI_ACCESS_DENIED The request is rejected due to system ha= s passed certain boot + phase. + +**/ +EFI_STATUS +EFIAPI +DxeMmUnblockMemoryRequest ( + IN EFI_PHYSICAL_ADDRESS UnblockAddress, + IN UINT64 NumberOfPages + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h b/MdeModu= lePkg/Include/Library/DxeMmUnblockMemoryLib.h new file mode 100644 index 000000000000..8b63eb74a078 --- /dev/null +++ b/MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h @@ -0,0 +1,40 @@ +/** @file + MM Unblock Memory Library Interface. + + This library provides an abstraction layer of requesting certain page ac= cess to be unblocked + by MM environment if applicable. + + Copyright (c), Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _DXE_MM_UNBLOCK_MEMORY_LIB_H_ +#define _DXE_MM_UNBLOCK_MEMORY_LIB_H_ + +/** + This API provides a way to unblock certain data pages to be accessible i= nside MM environment. + + @param UnblockAddress The address of buffer caller requests to= unblock, the address + has to be page aligned. + @param NumberOfPages The number of pages requested to be unbl= ocked from MM + environment. + + @return EFI_SUCCESS The request goes through successfully. + @return EFI_NOT_AVAILABLE_YET The requested functionality is not produ= ced yet. + @return EFI_UNSUPPORTED The requested functionality is not suppo= rted on current platform. + @return EFI_SECURITY_VIOLATION The requested address failed to pass sec= urity check for + unblocking. + @return EFI_INVALID_PARAMETER Input address either NULL pointer or not= page aligned. + @return EFI_ACCESS_DENIED The request is rejected due to system ha= s passed certain boot + phase. + +**/ +EFI_STATUS +EFIAPI +DxeMmUnblockMemoryRequest ( + IN EFI_PHYSICAL_ADDRESS UnblockAddress, + IN UINT64 NumberOfPages +); + +#endif // _DXE_MM_UNBLOCK_MEMORY_LIB_H_ diff --git a/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.inf b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.inf new file mode 100644 index 000000000000..e40462e5ab81 --- /dev/null +++ b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= inf @@ -0,0 +1,29 @@ +## @file +# Null instance of MM Unblock Page Library. +# +# This library provides an abstraction layer of requesting certain page a= ccess to be unblocked +# by MM environment if applicable. +# +# Copyright (c), Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D DxeMmUnblockMemoryLibNull + FILE_GUID =3D 9E890F68-5C95-4C31-95DD-59E6286F85EA + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DxeMmUnblockMemoryLib + +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + DxeMmUnblockMemoryLibNull.c + +[Packages] + MdePkg/MdePkg.dec diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 148395511034..1bb5017da2c5 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -154,6 +154,11 @@ [LibraryClasses] # VariablePolicyHelperLib|Include/Library/VariablePolicyHelperLib.h + ## @libraryclass This library provides an interface for DXE drivers to= request MM environment + # to map/unblock a memory region for accessibility inside MM. + # + DxeMmUnblockMemoryLib|Include/Library/DxeMmUnblockMemoryLib.h + [Guids] ## MdeModule package token space guid # Include/Guid/MdeModulePkgTokenSpace.h diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 7ca4a1bb3080..2bc6b8730b8b 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -100,6 +100,7 @@ [LibraryClasses] SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGr= aphics/DisplayUpdateProgressLibGraphics.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + DxeMmUnblockMemoryLib|MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUn= blockMemoryLibNull.inf [LibraryClasses.EBC.PEIM] IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf @@ -332,6 +333,7 @@ [Components] MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgr= essLibGraphics.inf MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgressL= ibText.inf + MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf MdeModulePkg/Universal/BdsDxe/BdsDxe.inf MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf -- 2.30.0.windows.1 --_000_MWHPR06MB31020796B513205371AA1036F3819MWHPR06MB3102namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Hao,

 

The patch series was resent with intended usage in V= ariableRuntime and Tcg2 drivers. Could you please provide feedback on them?= Any input is appreciated.

 

Regards,

Kun

 

From: Kun Qin
Sent: Tuesday, February 9, 2021 17:25
To: devel@edk2.groups.io=
Cc: Jian J Wang; Hao A Wu; Eric Dong; Ray Ni; Jiewen Yao
Subject: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added d= efinition and null instance

 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3168

This interface definition provides an abstraction layer for DXE drivers
to request certain memory blocks to be mapped/unblocked for accessibility inside MM environment.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>

Signed-off-by: Kun Qin <kun.q@outlook.com>
---

Notes:
    v2:
    - Resend with practical usage. No change [Hao]

 MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= c   | 40 ++++++++++++++++++++
 MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h   = ;            &n= bsp;     | 40 ++++++++++++++++++++
 MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= inf | 29 ++++++++++++++
 MdeModulePkg/MdeModulePkg.dec      &nbs= p;            &= nbsp;           &nbs= p;            | = ; 5 +++
 MdeModulePkg/MdeModulePkg.dsc      &nbs= p;            &= nbsp;           &nbs= p;            | = ; 2 +
 5 files changed, 116 insertions(+)

diff --git a/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.c b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLib= Null.c
new file mode 100644
index 000000000000..774a7e41cfb0
--- /dev/null
+++ b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= c
@@ -0,0 +1,40 @@
+/** @file
+  Null instance of MM Unblock Page Library.
+
+  This library provides an abstraction layer of requesting certain pa= ge access to be unblocked
+  by MM environment if applicable.
+
+  Copyright (c), Microsoft Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Uefi.h>
+
+/**
+  This API provides a way to unblock certain data pages to be accessi= ble inside MM environment.
+
+  @param  UnblockAddress      &nbs= p;   The address of buffer caller requests to unblock, the addres= s
+            &n= bsp;            = ;         has to be page aligned. +  @param  NumberOfPages       = ;    The number of pages requested to be unblocked from MM +            &n= bsp;            = ;         environment.
+
+  @return EFI_SUCCESS        =      The request goes through successfully.
+  @return EFI_NOT_AVAILABLE_YET   The requested functionali= ty is not produced yet.
+  @return EFI_UNSUPPORTED       &n= bsp; The requested functionality is not supported on current platform.
+  @return EFI_SECURITY_VIOLATION  The requested address failed t= o pass security check for
+            &n= bsp;            = ;         unblocking.
+  @return EFI_INVALID_PARAMETER   Input address either NULL= pointer or not page aligned.
+  @return EFI_ACCESS_DENIED       The r= equest is rejected due to system has passed certain boot
+            &n= bsp;            = ;         phase.
+
+**/
+EFI_STATUS
+EFIAPI
+DxeMmUnblockMemoryRequest (
+  IN EFI_PHYSICAL_ADDRESS   UnblockAddress,
+  IN UINT64         &nbs= p;       NumberOfPages
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h b/MdeModu= lePkg/Include/Library/DxeMmUnblockMemoryLib.h
new file mode 100644
index 000000000000..8b63eb74a078
--- /dev/null
+++ b/MdeModulePkg/Include/Library/DxeMmUnblockMemoryLib.h
@@ -0,0 +1,40 @@
+/** @file
+  MM Unblock Memory Library Interface.
+
+  This library provides an abstraction layer of requesting certain pa= ge access to be unblocked
+  by MM environment if applicable.
+
+  Copyright (c), Microsoft Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _DXE_MM_UNBLOCK_MEMORY_LIB_H_
+#define _DXE_MM_UNBLOCK_MEMORY_LIB_H_
+
+/**
+  This API provides a way to unblock certain data pages to be accessi= ble inside MM environment.
+
+  @param  UnblockAddress      &nbs= p;   The address of buffer caller requests to unblock, the addres= s
+            &n= bsp;            = ;         has to be page aligned. +  @param  NumberOfPages       = ;    The number of pages requested to be unblocked from MM +            &n= bsp;            = ;         environment.
+
+  @return EFI_SUCCESS        =      The request goes through successfully.
+  @return EFI_NOT_AVAILABLE_YET   The requested functionali= ty is not produced yet.
+  @return EFI_UNSUPPORTED       &n= bsp; The requested functionality is not supported on current platform.
+  @return EFI_SECURITY_VIOLATION  The requested address failed t= o pass security check for
+            &n= bsp;            = ;         unblocking.
+  @return EFI_INVALID_PARAMETER   Input address either NULL= pointer or not page aligned.
+  @return EFI_ACCESS_DENIED       The r= equest is rejected due to system has passed certain boot
+            &n= bsp;            = ;         phase.
+
+**/
+EFI_STATUS
+EFIAPI
+DxeMmUnblockMemoryRequest (
+  IN EFI_PHYSICAL_ADDRESS   UnblockAddress,
+  IN UINT64         &nbs= p;       NumberOfPages
+);
+
+#endif // _DXE_MM_UNBLOCK_MEMORY_LIB_H_
diff --git a/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.inf b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryL= ibNull.inf
new file mode 100644
index 000000000000..e40462e5ab81
--- /dev/null
+++ b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.= inf
@@ -0,0 +1,29 @@
+## @file
+#  Null instance of MM Unblock Page Library.
+#
+#  This library provides an abstraction layer of requesting certain p= age access to be unblocked
+#  by MM environment if applicable.
+#
+#  Copyright (c), Microsoft Corporation.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+  INF_VERSION         &n= bsp;          =3D 0x0001001B +  BASE_NAME         &nbs= p;            =3D Dx= eMmUnblockMemoryLibNull
+  FILE_GUID         &nbs= p;            =3D 9E= 890F68-5C95-4C31-95DD-59E6286F85EA
+  MODULE_TYPE         &n= bsp;          =3D BASE
+  VERSION_STRING         = ;        =3D 1.0
+  LIBRARY_CLASS         =          =3D DxeMmUnblockMemoryLib<= br> +
+#
+#  VALID_ARCHITECTURES        = ;   =3D IA32 X64
+#
+
+[Sources]
+  DxeMmUnblockMemoryLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec<= br> index 148395511034..1bb5017da2c5 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -154,6 +154,11 @@ [LibraryClasses]
   #
   VariablePolicyHelperLib|Include/Library/VariablePolicyHelperLi= b.h
 
+  ##  @libraryclass  This library provides an interface for= DXE drivers to request MM environment
+  #   to map/unblock a memory region for accessibility insi= de MM.
+  #
+  DxeMmUnblockMemoryLib|Include/Library/DxeMmUnblockMemoryLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc<= br> index 7ca4a1bb3080..2bc6b8730b8b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -100,6 +100,7 @@ [LibraryClasses]
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf    DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdatePro= gressLibGraphics/DisplayUpdateProgressLibGraphics.inf
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHel= perLib/VariablePolicyHelperLib.inf
+  DxeMmUnblockMemoryLib|MdeModulePkg/Library/DxeMmUnblockMemoryLib/Dx= eMmUnblockMemoryLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -332,6 +333,7 @@ [Components]
   MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf    MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayU= pdateProgressLibGraphics.inf
   MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdat= eProgressLibText.inf
+  MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNul= l.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp= .inf
--
2.30.0.windows.1

 

--_000_MWHPR06MB31020796B513205371AA1036F3819MWHPR06MB3102namp_--