]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
SecurityPkg: Tcg2Acpi: Added unblock memory interface for NVS region
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Acpi / Tcg2Acpi.c
index 924c3b4edda622f37a8b4bdd119dc9cbc497151f..e8844e474a9ba217e71c2d27c886eac777c1441d 100644 (file)
@@ -38,6 +38,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/Tpm2DeviceLib.h>\r
 #include <Library/Tpm2CommandLib.h>\r
 #include <Library/UefiLib.h>\r
+#include <Library/MmUnblockMemoryLib.h>\r
 \r
 //\r
 // Physical Presence Interface Version supported by Platform\r
@@ -147,6 +148,11 @@ AssignOpRegion (
       ZeroMem ((VOID *)(UINTN)MemoryAddress, Size);\r
       OpRegion->RegionOffset = (UINT32) (UINTN) MemoryAddress;\r
       OpRegion->RegionLen    = (UINT8) Size;\r
+      // Request to unblock this region from MM core\r
+      Status = MmUnblockMemoryRequest (MemoryAddress, EFI_SIZE_TO_PAGES (Size));\r
+      if (Status != EFI_UNSUPPORTED && EFI_ERROR (Status)) {\r
+        ASSERT_EFI_ERROR (Status);\r
+      }\r
       break;\r
     }\r
   }\r