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.web10.11562.1614261838820394473 for ; Thu, 25 Feb 2021 06:04:02 -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 ([101.86.139.83]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 25 Feb 2021 22:03:53 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 101.86.139.83 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , , "'Wu, Hao A'" , "'Kinney, Michael D'" , "'Liu, Zhiguang'" Cc: "'Wang, Jian J'" , "'Dong, Eric'" , "'Ni, Ray'" References: <20210210012457.315-1-kun.q@outlook.com>, , , In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyIDEvNl0gTWRlTW9kdWxlUGtnOiBEeGVNbVVuYmxvY2tNZW1vcnlMaWI6IEFkZGVkIGRlZmluaXRpb24gYW5kIG51bGwgaW5zdGFuY2U=?= Date: Thu, 25 Feb 2021 22:03:55 +0800 Message-ID: <005901d70b7f$0e320430$2a960c90$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQL+LkUR6bI+GKFGqPsq7A3OiXlynQKi/SvqAc1O1YwB/uI3MwH5575JAmWOXewB2E6B+QIjADisp6RQg/A= Content-Type: multipart/alternative; boundary="----=_NextPart_000_005A_01D70BC2.1C57B530" Content-Language: zh-cn ------=_NextPart_000_005A_01D70BC2.1C57B530 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Kun: I agree to add new library class MmUnblockMemoryLib and its NULL implementation into MdePkg. I want to confirm where is the real implementation for MmUnblockMemoryLib.=20 =20 Thanks Liming =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Kun Qin =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA2=D4=C224=C8=D5 9:49 =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; jiewen.yao@intel.com; Wu, Hao A ; gaoliming ; Kinney, Michae= l D ; Liu, Zhiguang =B3=AD=CB=CD: Wang, Jian J ; Dong, Eric ; Ni, Ray ; Yao, Jiewen =D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMe= moryLib: Added definition and null instance =20 Hi Jiewen, =20 I agree with your assessment that it could have a PEI and potentially MM instance. Will remove the prefix and change them to `MmUnblockMemoryLib` i= n v3 patches. Thanks for the input. =20 Regards, Kun =20 From: Yao, Jiewen =20 Sent: Tuesday, February 23, 2021 17:33 To: Wu, Hao A ; Kun Qin ; devel@edk2.groups.io ; gaoliming ; Kinney, Michael D ; Liu, Zhiguang =20 Cc: Wang, Jian J ; Dong, Eric ; Ni, Ray ; Yao, Jiewen =20 Subject: Re: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 I feel the name is confusing. =20 The class name is DxeMmUnblockMemoryLib. But actually, this is not related to DXE phase. =20 I believe, it is also applicable to PEI phase, if we have a PEI instance. Please correct me if I am wrong. Also, we can have SMM instance, right? =20 If that is true, then I prefer to remove Dxe prefix. =20 From: Wu, Hao A >=20 Sent: Wednesday, February 24, 2021 9:27 AM To: Kun Qin >; devel@edk2.groups.io ; Yao, Jiewen >; gaoliming >; Kinney, Michael D = >; Liu, Zhiguang > Cc: Wang, Jian J >; Dong, Eric >; Ni, Ray > Subject: RE: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 Thanks Kun, =20 For putting the new library in MdePkg, I am not sure whether this is a similar case to SmmMemLib. I looped Jiewen, Liming and Mike to check if they have comments on this. =20 Best Regards, Hao Wu =20 From: Kun Qin >=20 Sent: Wednesday, February 24, 2021 3:30 AM To: devel@edk2.groups.io ; Wu, Hao A >; Yao, Jiewen >; gaoliming >; Kinney, Michael D = >; Liu, Zhiguang > Cc: Wang, Jian J >; Dong, Eric >; Ni, Ray > Subject: RE: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 Hi Hao, =20 Thanks for the suggestion. I can move the library to MdePkg similar to SmmMemLib and add the change for OVMF. =20 Liming/Zhiguang, =20 I am happy to prepare patches to cover the dependency change in ed2-platfo= rm in a separate patch series. But please let me know if you would like to proceed otherwise. =20 Thanks, Kun =20 From: Wu, Hao A =20 Sent: Monday, February 22, 2021 17:42 To: Kun Qin ; devel@edk2.groups.io ; Yao, Jiewen = ; gaoliming ; Kinney, Michael D ; Liu, Zhiguang =20 Cc: Wang, Jian J ; Dong, Eric ; Ni, Ray =20 Subject: Re: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 Hello Kun, =20 Sorry for the delayed response. =20 Except for missing the UNI file for the newly added library, I do not have other comment for the implementation at this moment. But I am wondering if this library can be added into the MdePkg as the cas= e for MdePkg\Library\SmmMemLib\ I have looped in Jiewen, Liming and Mike for comments. =20 Also, since: * New library dependency for VariableSmmRuntimeDxe.inf * INF file separation and new library dependency in Tcg2Smm I think the series needs to prepare the changes for platforms under edk2 (OVMF) and edk2-platforms repositories that consume the above 2 modules. I am not exactly sure on how this should be handled within edk2-platforms, so I added Liming and Zhiguang here for comments. =20 Best Regards, Hao Wu =20 From: Kun Qin >=20 Sent: Tuesday, February 23, 2021 6:15 AM To: devel@edk2.groups.io ; Wu, Hao A > Cc: Wang, Jian J >; Dong, Eric >; Ni, Ray >; Yao, Jiewen > Subject: RE: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 Hi Hao, =20 The patch series was resent with intended usage in VariableRuntime and Tcg= 2 drivers. Could you please provide feedback on them? Any input is appreciated. =20 Regards, Kun =20 From: Kun Qin =20 Sent: Tuesday, February 9, 2021 17:25 To: devel@edk2.groups.io =20 Cc: Jian J Wang ; Hao A Wu ; Eric Dong ; Ray Ni ; Jiewen Yao =20 Subject: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null instance =20 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/DxeMmUnblockMemoryLibNull.c b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.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 access 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 inside MM environment. + + @param UnblockAddress The address of buffer caller requests t= o unblock, the address + has to be page aligned. + @param NumberOfPages The number of pages requested to be unblocked from MM + environment. + + @return EFI_SUCCESS The request goes through successfully. + @return EFI_NOT_AVAILABLE_YET The requested functionality is not produced yet. + @return EFI_UNSUPPORTED The requested functionality is not supported on current platform. + @return EFI_SECURITY_VIOLATION The requested address failed to pass security check for + unblocking. + @return EFI_INVALID_PARAMETER Input address either NULL pointer or no= t page aligned. + @return EFI_ACCESS_DENIED The request is rejected due to system h= as 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/MdeModulePkg/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 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 accessible inside MM environment. + + @param UnblockAddress The address of buffer caller requests t= o unblock, the address + has to be page aligned. + @param NumberOfPages The number of pages requested to be unblocked from MM + environment. + + @return EFI_SUCCESS The request goes through successfully. + @return EFI_NOT_AVAILABLE_YET The requested functionality is not produced yet. + @return EFI_UNSUPPORTED The requested functionality is not supported on current platform. + @return EFI_SECURITY_VIOLATION The requested address failed to pass security check for + unblocking. + @return EFI_INVALID_PARAMETER Input address either NULL pointer or no= t page aligned. + @return EFI_ACCESS_DENIED The request is rejected due to system h= as 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/DxeMmUnblockMemoryLibNull.inf b/MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.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 access 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 =20 + ## @libraryclass This library provides an interface for DXE drivers t= o 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 =20 DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGrap= hi cs/DisplayUpdateProgressLibGraphics.inf =20 VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Varia= bl ePolicyHelperLib.inf + DxeMmUnblockMemoryLib|MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnbl= oc kMemoryLibNull.inf =20 [LibraryClasses.EBC.PEIM] IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf @@ -332,6 +333,7 @@ [Components] MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf =20 MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgres= sL ibGraphics.inf =20 MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgressLib= Te xt.inf + MdeModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.in= f =20 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf --=20 2.30.0.windows.1 =20 =20 =20 ------=_NextPart_000_005A_01D70BC2.1C57B530 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Kun:

 I agree to= add new library class MmUnblockMemoryLib and its= NULL implementation into MdePkg. I want to confirm where is the real imple= mentation for MmUnblockMemoryLib.

 

Thanks

Liming

=B7=A2=BC=FE=C8=CB: devel@edk2.groups.io <devel@edk2.groups.io> =B4=FA=B1=ED Kun Qin
=B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA2=D4=C224=C8=D5 9:49
=CA=D5=BC=FE=C8=CB: = devel@edk2.groups.io; jiewen.yao@intel.com; Wu, Hao A <hao.a.wu@intel.co= m>; gaoliming <gaoliming@byosoft.com.cn>; Kinney, Michael D <mi= chael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com><= br>=B3=AD=CB=CD:= Wang, Jian J <jian.j.wang@intel.com>; Dong, Eric <eric.dong@intel= .com>; Ni, Ray <ray.ni@intel.com>; Yao, Jiewen <jiewen.yao@inte= l.com>
=D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemory= Lib: Added definition and null instance

<= /div>

 

Hi Jiewen,

 

I agree with your  assessment that it coul= d have a PEI and potentially MM instance. Will remove the prefix and change= them to `MmUnblockMemoryLib` in v3 patches. Thanks for the input.

 

Regards,

Kun

 

From: <= a href=3D"mailto:jiewen.yao@intel.com">Yao, Jiewen
Sent: Tues= day, February 23, 2021 17:33
To: Wu, Hao A; Kun Qin; devel@edk2.groups.io; gaoliming; Kinney, Michael D; Liu, Zhiguang
Cc: Wang, Jian J; Dong, Eric; Ni, Ray; Yao, Jiewen
Subject: Re: [edk2-devel] [PATCH= v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Added definition and null ins= tance

 

I feel th= e name is confusing.

 

The class name is DxeMmUnblockMemoryLib. But actually, this is not relat= ed to DXE phase.

 

I be= lieve, it is also applicable to PEI phase, if we have a PEI instance. Pleas= e correct me if I am wrong.

Also, we can have SMM instance, right?

<= p class=3DMsoNormal> 

If that is true, then I prefer to remove D= xe prefix.

 

From: Wu, Hao A <hao.a.wu@intel.com>
Sent: Wedn= esday, February 24, 2021 9:27 AM
To: Kun Qin <kun.q@outlook.com>; devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel.com>; gaoliming <gaoliming@byosoft.com.cn>; Kinney, = Michael D <michael.d.kinne= y@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Dong, Eri= c <eric.dong@intel.com>; N= i, Ray <ray.ni@intel.com>
= Subject: RE: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockM= emoryLib: Added definition and null instance

 

Thanks Kun,

 

For putting the new library in MdePkg, I am not = sure whether this is a similar case to SmmMemLib.

I looped Jiewen, Liming and Mike to che= ck if they have comments on this.

 

<= span lang=3DEN-US>Best Regards,

<= span lang=3DEN-US>Hao Wu

 

From: Kun= Qin <kun.q@outlook.com> Sent: Wednesday, February 24, 2021 3:30 AM
To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>; Yao, Jiewen &l= t;jiewen.yao@intel.com>; gao= liming <gaoliming@byosoft.co= m.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>
Cc: Wa= ng, Jian J <jian.j.wang@intel.c= om>; Dong, Eric <eric.dong= @intel.com>; Ni, Ray <ray.ni@= intel.com>
Subject: RE: [edk2-devel] [PATCH v2 1/6] MdeMod= ulePkg: DxeMmUnblockMemoryLib: Added definition and null instance

 =

Hi Hao,=

 =

Thanks for the suggestion. I ca= n move the library to MdePkg similar to SmmMemLib and add the change for OV= MF.

 = ;

Liming/Zhiguang,<= o:p>

 

I am happy to prepare= patches to cover the dependency change in ed2-platform in a separate patch= series. But please let me know if you would like to proceed otherwise.

 =

Thanks,

Kun

 

=

From: Wu, Hao A
Sent: Mon= day, February 22, 2021 17:42
To: Kun Qin; devel@edk2.groups= .io; Yao, Jiewen; gaoliming; Kinney, Michael D; Liu, Zhiguang
Cc: Wang, Jian J; Dong, = Eric; Ni, Ray
Subject: Re: [edk2-devel] [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Adde= d definition and null instance

 

Hello Kun,

 

Sorry for the delayed response.

 

Except for missing the UNI file for the newly added librar= y, I do not have other comment for the implementation at this moment.<= /o:p>

But I am wondering = if this library can be added into the MdePkg as the case for MdePkg\Library= \SmmMemLib\

I = have looped in Jiewen, Liming and Mike for comments.

<= p class=3DMsoNormal> 

Also, since:

* New library dependency for VariableSmmRu= ntimeDxe.inf

*= INF file separation and new library dependency in Tcg2Smm

I think the series needs to pr= epare the changes for platforms under edk2 (OVMF) and edk2-platforms reposi= tories that consume the above 2 modules.

I am not exactly sure on how this should be hand= led within edk2-platforms, so I added Liming and Zhiguang here for comments= .

 <= /o:p>

Best Regards,<= o:p>

Hao Wu

 

From: Kun Qin <kun.q@outlook.com>
Sent: Tuesday, February 23= , 2021 6:15 AM
To: devel@= edk2.groups.io; Wu, Hao A <hao= .a.wu@intel.com>
Cc: Wang, Jian J <jian.j.wang@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <<= a href=3D"mailto:ray.ni@intel.com">ray.ni@intel.com>; Yao, Jiewen &l= t;jiewen.yao@intel.com>
<= b>Subject:
RE: [PATCH v2 1/6] MdeModulePkg: DxeMmUnblockMemoryLib: Adde= d definition and null instance

 

Hi Hao,

 

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

=  

Regards= ,

Kun

 

From: = Kun Qin
S= ent: 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: D= xeMmUnblockMemoryLib: Added definition and null instance
<= /p>

 

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

This interface d= efinition provides an abstraction layer for DXE drivers
to request certa= in memory blocks to be mapped/unblocked for accessibility
inside MM envi= ronment.

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 Ya= o <jiewen.yao@intel.com><= br>
Signed-off-by: Kun Qin <kun.= q@outlook.com>
---

Notes:
    v2:
&nb= sp;   - Resend with practical usage. No change [Hao]

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

diff --git a/MdeModulePkg/Library/= DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.c b/MdeModulePkg/Library/Dx= eMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.c
new file mode 100644
= index 000000000000..774a7e41cfb0
--- /dev/null
+++ b/MdeModulePkg/Lib= rary/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.c
@@ -0,0 +1,40 @@<= br>+/** @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.
+<= br>+  Copyright (c), Microsoft Corporation.
+  SPDX-License-Id= entifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Uefi.h>=
+
+/**
+  This API provides a way to unblock certain data pa= ges to be accessible inside MM environment.
+
+  @param  Un= blockAddress          The addr= ess of buffer caller requests to unblock, the address
+   = ;            &n= bsp;            = ;      has to be page aligned.
+  @param&n= bsp; NumberOfPages         &nb= sp; The number of pages requested to be unblocked from MM
+  &= nbsp;           &nbs= p;            &= nbsp;      environment.
+
+  @return EF= I_SUCCESS           =   The request goes through successfully.
+  @return EFI_NOT_AV= AILABLE_YET   The requested functionality is not produced yet.+  @return EFI_UNSUPPORTED       &= nbsp; The requested functionality is not supported on current platform.
= +  @return EFI_SECURITY_VIOLATION  The requested address failed t= o pass security check for
+       &nb= sp;            =             &nb= sp; unblocking.
+  @return EFI_INVALID_PARAMETER   Input = address either NULL pointer or not page aligned.
+  @return EFI_ACC= ESS_DENIED       The request is rejected due = to system has passed certain boot
+      &= nbsp;           &nbs= p;            &= nbsp;  phase.
+
+**/
+EFI_STATUS
+EFIAPI
+DxeMmUnblockM= emoryRequest (
+  IN EFI_PHYSICAL_ADDRESS   UnblockAddres= s,
+  IN UINT64        &nbs= p;        NumberOfPages
+  )
= +{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/In= clude/Library/DxeMmUnblockMemoryLib.h b/MdeModulePkg/Include/Library/DxeMmU= nblockMemoryLib.h
new file mode 100644
index 000000000000..8b63eb74a0= 78
--- /dev/null
+++ b/MdeModulePkg/Include/Library/DxeMmUnblockMemor= yLib.h
@@ -0,0 +1,40 @@
+/** @file
+  MM Unblock Memory Libra= ry Interface.
+
+  This library provides an abstraction layer of= requesting certain page access to be unblocked
+  by MM environmen= t 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 inside MM environment.
+
+  @param = UnblockAddress          The a= ddress of buffer caller requests to unblock, the address
+  &n= bsp;            = ;            &n= bsp;      has to be page aligned.
+  @para= m  NumberOfPages         =   The number of pages requested to be unblocked from MM
+ &nbs= p;            &= nbsp;           &nbs= p;       environment.
+
+  @return= EFI_SUCCESS          &nb= sp;  The request goes through successfully.
+  @return EFI_NOT= _AVAILABLE_YET   The requested functionality is not produced yet.=
+  @return EFI_UNSUPPORTED      &nbs= p;  The requested functionality is not supported on current platform.<= br>+  @return EFI_SECURITY_VIOLATION  The requested address faile= d to pass security check for
+       =             &nb= sp;            =   unblocking.
+  @return EFI_INVALID_PARAMETER   Inp= ut address either NULL pointer or not page aligned.
+  @return EFI_= ACCESS_DENIED       The request is rejected d= ue to system has passed certain boot
+     &nbs= p;            &= nbsp;           &nbs= p;   phase.
+
+**/
+EFI_STATUS
+EFIAPI
+DxeMmUnblo= ckMemoryRequest (
+  IN EFI_PHYSICAL_ADDRESS   UnblockAdd= ress,
+  IN UINT64        &= nbsp;        NumberOfPages
+);
++#endif // _DXE_MM_UNBLOCK_MEMORY_LIB_H_
diff --git a/MdeModulePkg/Lib= rary/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf b/MdeModulePkg/Lib= rary/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf
new file mode 1= 00644
index 000000000000..e40462e5ab81
--- /dev/null
+++ b/MdeModu= lePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf
@@ -0,= 0 +1,29 @@
+## @file
+#  Null instance of MM Unblock Page Librar= y.
+#
+#  This library provides an abstraction layer of requesti= ng certain page access to be unblocked
+#  by MM environment if app= licable.
+#
+#  Copyright (c), Microsoft Corporation.
+# = ; SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+= [Defines]
+  INF_VERSION       &= nbsp;            =3D= 0x0001001B
+  BASE_NAME       &= nbsp;           &nbs= p;  =3D DxeMmUnblockMemoryLibNull
+  FILE_GUID  &nbs= p;            &= nbsp;      =3D 9E890F68-5C95-4C31-95DD-59E6286F85E= A
+  MODULE_TYPE        &nb= sp;           =3D BASE+  VERSION_STRING        &nbs= p;        =3D 1.0
+  LIBRARY_CLA= SS            &= nbsp;     =3D DxeMmUnblockMemoryLib
+
+#
+#&nb= sp; VALID_ARCHITECTURES        &nbs= p;  =3D IA32 X64
+#
+
+[Sources]
+  DxeMmUnblockMemor= yLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a= /MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 148= 395511034..1bb5017da2c5 100644
--- a/MdeModulePkg/MdeModulePkg.dec
++= + b/MdeModulePkg/MdeModulePkg.dec
@@ -154,6 +154,11 @@ [LibraryClasses]<= br>   #
   VariablePolicyHelperLib|Include/Library/V= ariablePolicyHelperLib.h
 
+  ##  @libraryclass  = This library provides an interface for DXE drivers to request MM environmen= t
+  #   to map/unblock a memory region for accessibility= inside MM.
+  #
+  DxeMmUnblockMemoryLib|Include/Library/D= xeMmUnblockMemoryLib.h
+
 [Guids]
   ## MdeModule p= ackage token space guid
   # Include/Guid/MdeModulePkgTokenSpa= ce.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModule= Pkg.dsc
index 7ca4a1bb3080..2bc6b8730b8b 100644
--- a/MdeModulePkg/Md= eModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -100,6 +100,7 @= @ [LibraryClasses]
   SafeIntLib|MdePkg/Library/BaseSafeIntLib= /BaseSafeIntLib.inf
   DisplayUpdateProgressLib|MdeModulePkg/L= ibrary/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.in= f
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePoli= cyHelperLib/VariablePolicyHelperLib.inf
+  DxeMmUnblockMemoryLib|Md= eModulePkg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf
&= nbsp;
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Libra= ry/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -332,6 +333,7 @@ [Components]
&= nbsp;  MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf   MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/Display= UpdateProgressLibGraphics.inf
   MdeModulePkg/Library/DisplayU= pdateProgressLibText/DisplayUpdateProgressLibText.inf
+  MdeModuleP= kg/Library/DxeMmUnblockMemoryLib/DxeMmUnblockMemoryLibNull.inf
    MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeM= odulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
--
2.= 30.0.windows.1

 

 

 

------=_NextPart_000_005A_01D70BC2.1C57B530--