]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c
SecurityPkg OpalPasswordSmm: Consume SmmIoLib.
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPasswordSmm / OpalPasswordSmm.c
index 2f2a1d9c13e44f4ee289cd2c1679f4a3e44de777..0ea92b15c067720cee0c94bb5a05d186dac36e7d 100644 (file)
@@ -61,9 +61,6 @@ VOID                 *mBuffer = NULL; // DMA can not read/write Data to smram, s
 // NVME\r
 NVME_CONTEXT         mNvmeContext;\r
 \r
-EFI_GCD_MEMORY_SPACE_DESCRIPTOR   *mGcdMemSpace        = NULL;\r
-UINTN                             mNumberOfDescriptors = 0;\r
-\r
 /**\r
   Add new bridge node or nvme device info to the device list.\r
 \r
@@ -647,44 +644,6 @@ S3SleepEntryCallBack (
   return Status;\r
 }\r
 \r
-/**\r
-  OpalPassword Notification for SMM EndOfDxe protocol.\r
-\r
-  @param[in] Protocol   Points to the protocol's unique identifier.\r
-  @param[in] Interface  Points to the interface instance.\r
-  @param[in] Handle     The handle on which the interface was installed.\r
-\r
-  @retval EFI_SUCCESS   Notification runs successfully.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OpalPasswordEndOfDxeNotification (\r
-  IN CONST EFI_GUID  *Protocol,\r
-  IN VOID            *Interface,\r
-  IN EFI_HANDLE      Handle\r
-  )\r
-{\r
-  UINTN                            NumberOfDescriptors;\r
-  EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *MemSpaceMap;\r
-  EFI_STATUS                       Status;\r
-\r
-  Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemSpaceMap);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  mGcdMemSpace = AllocateCopyPool (NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap);\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (MemSpaceMap);\r
-    return Status;\r
-  }\r
-\r
-  mNumberOfDescriptors = NumberOfDescriptors;\r
-  gBS->FreePool (MemSpaceMap);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   Main entry for this driver.\r
 \r
@@ -711,7 +670,6 @@ OpalPasswordSmmInit (
   EFI_SMM_VARIABLE_PROTOCOL             *SmmVariable;\r
   OPAL_EXTRA_INFO_VAR                   OpalExtraInfo;\r
   UINTN                                 DataSize;\r
-  EFI_EVENT                             EndOfDxeEvent;\r
   EFI_PHYSICAL_ADDRESS                  Address;\r
 \r
   mBuffer            = NULL;\r
@@ -820,15 +778,6 @@ OpalPasswordSmmInit (
   //\r
   mSwSmiValue = (UINT8) Context.SwSmiInputValue;\r
 \r
-  //\r
-  // Create event to record GCD descriptors at end of dxe for judging AHCI/NVMe PCI Bar\r
-  // is in MMIO space to avoid attack.\r
-  //\r
-  Status = gSmst->SmmRegisterProtocolNotify (&gEfiSmmEndOfDxeProtocolGuid, OpalPasswordEndOfDxeNotification, &EndOfDxeEvent);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG((DEBUG_ERROR, "OpalPasswordSmm: Register SmmEndOfDxe fail, Status: %r\n", Status));\r
-    goto EXIT;\r
-  }\r
   Status = gSmst->SmmLocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID**)&SmmVariable);\r
   if (!EFI_ERROR (Status)) {\r
     DataSize = sizeof (OPAL_EXTRA_INFO_VAR);\r