]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PrmPkg: Remove PRM Module Update Lock
authorMichael Kubacki <michael.kubacki@microsoft.com>
Wed, 27 May 2020 19:47:00 +0000 (12:47 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Apr 2022 00:42:38 +0000 (00:42 +0000)
Per latest design direction, we've abandoned treating the PRM Module
Update Lock as an exported object. There was concern sharing the PRM
module address space (where the lock structure resided in a data section)
with the OS kernel mode driver. The lock will now be entirely maintained
in OS context with interaces to control the lock available to ASL
(for _DSM invocation) and OS native code (for direct call).

Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
PrmPkg/Include/PrmModule.h
PrmPkg/Include/PrmModuleUpdate.h [deleted file]
PrmPkg/PrmLoaderDxe/PrmAcpiTable.h
PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
PrmPkg/Readme.md

index f40fb42a2b4f62301ea6e5cddd56df00565c2208..d7047d8eec58e30eff037d8036ca2f04aa911a42 100644 (file)
@@ -15,7 +15,6 @@
 #include <PrmDataBuffer.h>\r
 #include <PrmExportDescriptor.h>\r
 #include <PrmMmio.h>\r
-#include <PrmModuleUpdate.h>\r
 #include <PrmOsServices.h>\r
 \r
 /**\r
     IN PRM_CONTEXT_BUFFER   *ContextBuffer      \\r
     )                                           \\r
 \r
-/**\r
-  A macro that declares the PRM Module Update Lock Descriptor for a PRM Module.\r
-\r
-  This macro is intended to be used once in a PRM Module so the module update lock descriptor is\r
-  exported for the module.\r
-\r
-**/\r
-#define PRM_MODULE_UPDATE_LOCK_EXPORT                                                           \\r
-  PRM_EXPORT_API PRM_MODULE_UPDATE_LOCK_DESCRIPTOR PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_NAME = {   \\r
-    PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_SIGNATURE,                                                \\r
-    PRM_MODULE_UPDATE_LOCK_REVISION,                                                            \\r
-    { 0 }                                                                                       \\r
-  }                                                                                             \\r
-\r
-//\r
-// A PRM module is required to export the PRM Module Update Lock\r
-//\r
-PRM_MODULE_UPDATE_LOCK_EXPORT;\r
-\r
 #endif\r
diff --git a/PrmPkg/Include/PrmModuleUpdate.h b/PrmPkg/Include/PrmModuleUpdate.h
deleted file mode 100644 (file)
index fde97ef..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file\r
-\r
-  Definition for the Platform Runtime Mechanism (PRM) module update structures.\r
-\r
-  Copyright (c) Microsoft Corporation\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#ifndef PRM_MODULE_UPDATE_H_\r
-#define PRM_MODULE_UPDATE_H_\r
-\r
-#include <Uefi.h>\r
-\r
-#define PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_NAME        PrmModuleUpdateLock\r
-#define PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_SIGNATURE   SIGNATURE_64 ('P', 'R', 'M', '_', 'M', 'U', 'L', '_')\r
-#define PRM_MODULE_UPDATE_LOCK_REVISION               0x0\r
-\r
-#pragma pack(push, 1)\r
-\r
-///\r
-/// Maintains the PRM Module Update Lock state\r
-///\r
-typedef union {\r
-  ///\r
-  /// Individual bit fields\r
-  ///\r
-  struct {\r
-    UINT8 Acquired          : 1;  ///< [0] - If 1 lock is acquired. If 0 lock is released.\r
-    UINT8 Reserved          : 7;  ///< [7:1] - Reserved\r
-  } Bits;\r
-  ///\r
-  /// All bit fields as an 8-bit value\r
-  ///\r
-  UINT8 Uint8;\r
-} PRM_MODULE_UPDATE_LOCK;\r
-\r
-typedef struct {\r
-  UINT64                                Signature;\r
-  UINT16                                Revision;\r
-  PRM_MODULE_UPDATE_LOCK                Lock;\r
-} PRM_MODULE_UPDATE_LOCK_DESCRIPTOR;\r
-\r
-#pragma pack(pop)\r
-\r
-#endif\r
index 8a9c82347d93b5df814926ea4c8284a9cba6040d..ca09be389235db2647a52e761b1a2b29b5cdd2e2 100644 (file)
@@ -55,8 +55,6 @@ typedef struct {
   UINT16                              HandlerCount;               ///< Number of entries in the Handler Info array\r
   UINT32                              HandlerInfoOffset;          ///< Offset in bytes from the beginning of this\r
                                                                   ///< structure to the Handler Info array\r
-  UINT64                              ModuleUpdateLock;           ///< Physical address of the PRM Module Update Lock\r
-                                                                  ///< descriptor (PRM_MODULE_UPDATE_LOCK_DESCRIPTOR *)\r
   UINT64                              RuntimeMmioRanges;          ///< Physical address of the PRM MMIO Ranges\r
                                                                   ///< structure (PRM_MODULE_RUNTIME_MMIO_RANGES *)\r
   PRM_HANDLER_INFORMATION_STRUCT      HandlerInfoStructure[1];\r
index e45f8685e81f83bdce30051b0c16ccf39a26ae1c..e2a838ea29bd117d57c04ebc24f26b85362a370f 100644 (file)
@@ -26,7 +26,6 @@
 \r
 #include <PrmContextBuffer.h>\r
 #include <PrmMmio.h>\r
-#include <PrmModuleUpdate.h>\r
 \r
 LIST_ENTRY          mPrmModuleList;\r
 \r
@@ -707,23 +706,6 @@ ProcessPrmModules (
                 );\r
     ASSERT_EFI_ERROR (Status);\r
 \r
-    Status =  GetExportEntryAddress (\r
-                PRM_STRING (PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_NAME),\r
-                CurrentImageAddress,\r
-                CurrentImageExportDirectory,\r
-                (EFI_PHYSICAL_ADDRESS *) &(CurrentModuleInfoStruct->ModuleUpdateLock)\r
-                );\r
-    ASSERT_EFI_ERROR (Status);\r
-    if (!EFI_ERROR (Status)) {\r
-      DEBUG ((\r
-        DEBUG_INFO,\r
-        "    %a %a: Found PRM module update lock physical address at 0x%016x.\n",\r
-        _DBGMSGID_,\r
-        __FUNCTION__,\r
-        CurrentModuleInfoStruct->ModuleUpdateLock\r
-        ));\r
-    }\r
-\r
     // It is currently valid for a PRM module not to use a context buffer\r
     Status = GetModuleContextBuffers (\r
               ByModuleGuid,\r
index 00ef41bc5f42ac0d001fc0be70c517fc1873452b..f430006905c5e244735b0cc441c6f36e0a569bd3 100644 (file)
@@ -153,34 +153,33 @@ motivation behind using PE/COFF export tables to expose PRM module information a
 definition consistent between firmware and OS load.\r
 \r
 ### PRM Module Exports\r
-A PRM module must contain at least three exports: A PRM Module Export Descriptor, a PRM Module Update Lock Descriptor,\r
-and at least one PRM handler. Here's an example of an export table from a PRM module that has a single PRM handler:\r
+A PRM module must contain at least two exports: A PRM Module Export Descriptor and at least one PRM handler. Here's\r
+an example of an export table from a PRM module that has a single PRM handler:\r
 \r
 ```\r
-  0000000000005000: 00 00 00 00 FF FF FF FF 00 00 00 00 46 50 00 00  ....ÿÿÿÿ....FP..\r
-  0000000000005010: 01 00 00 00 03 00 00 00 03 00 00 00 28 50 00 00  ............(P..\r
-  0000000000005020: 34 50 00 00 40 50 00 00 78 13 00 00 30 40 00 00  4P..@P..x...0@..\r
-  0000000000005030: 20 40 00 00 67 50 00 00 86 50 00 00 A0 50 00 00   @..gP...P...P..\r
-  0000000000005040: 00 00 01 00 02 00 50 72 6D 53 61 6D 70 6C 65 43  ......PrmSampleC\r
-  0000000000005050: 6F 6E 74 65 78 74 42 75 66 66 65 72 4D 6F 64 75  ontextBufferModu\r
-  0000000000005060: 6C 65 2E 64 6C 6C 00 44 75 6D 70 53 74 61 74 69  le.dll.DumpStati\r
-  0000000000005070: 63 44 61 74 61 42 75 66 66 65 72 50 72 6D 48 61  cDataBufferPrmHa\r
-  0000000000005080: 6E 64 6C 65 72 00 50 72 6D 4D 6F 64 75 6C 65 45  ndler.PrmModuleE\r
-  0000000000005090: 78 70 6F 72 74 44 65 73 63 72 69 70 74 6F 72 00  xportDescriptor.\r
-  00000000000050A0: 50 72 6D 4D 6F 64 75 6C 65 55 70 64 61 74 65 4C  PrmModuleUpdateL\r
-  00000000000050B0: 6F 63 6B 00                                      ock.\r
+  0000000000005000: 00 00 00 00 FF FF FF FF 00 00 00 00 3C 50 00 00  ............<P..\r
+  0000000000005010: 01 00 00 00 02 00 00 00 02 00 00 00 28 50 00 00  ............(P..\r
+  0000000000005020: 30 50 00 00 38 50 00 00 78 13 00 00 20 40 00 00  0P..8P..x... @..\r
+  0000000000005030: 5D 50 00 00 7C 50 00 00 00 00 01 00 50 72 6D 53  ]P..|P......PrmS\r
+  0000000000005040: 61 6D 70 6C 65 43 6F 6E 74 65 78 74 42 75 66 66  ampleContextBuff\r
+  0000000000005050: 65 72 4D 6F 64 75 6C 65 2E 64 6C 6C 00 44 75 6D  erModule.dll.Dum\r
+  0000000000005060: 70 53 74 61 74 69 63 44 61 74 61 42 75 66 66 65  pStaticDataBuffe\r
+  0000000000005070: 72 50 72 6D 48 61 6E 64 6C 65 72 00 50 72 6D 4D  rPrmHandler.PrmM\r
+  0000000000005080: 6F 64 75 6C 65 45 78 70 6F 72 74 44 65 73 63 72  oduleExportDescr\r
+  0000000000005090: 69 70 74 6F 72 00                                iptor.\r
 \r
     00000000 characteristics\r
     FFFFFFFF time date stamp\r
-        0.10 version\r
+        0.00 version\r
            1 ordinal base\r
-           3 number of functions\r
-           3 number of names\r
+           2 number of functions\r
+           2 number of names\r
 \r
     ordinal hint RVA      name\r
+\r
           1    0 00001378 DumpStaticDataBufferPrmHandler\r
-          2    1 00004030 PrmModuleExportDescriptor\r
-          3    2 00004020 PrmModuleUpdateLock\r
+          2    1 00004020 PrmModuleExportDescriptor\r
+\r
 ```\r
 ### PRM Image Format\r
 PRM modules are ultimately PE/COFF images. However, when packaged in firmware the PE/COFF image is placed into a\r