public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
To: edk2-devel@lists.01.org, liming.gao@intel.com,
	chao.b.zhang@intel.com, leif.lindholm@linaro.org,
	ard.biesheuvel@linaro.org
Subject: [RFC PATCH v3 04/11] ArmPlatformPkg/NorFlashDxe: allow reusability as a MM driver
Date: Wed, 28 Nov 2018 15:05:02 +0530	[thread overview]
Message-ID: <1543397709-31847-5-git-send-email-jagadeesh.ujja@arm.com> (raw)
In-Reply-To: <1543397709-31847-1-git-send-email-jagadeesh.ujja@arm.com>

Adapt the NorFlashDxe driver to be used as a MM_STANDALONE driver to
allow access to NOR flash for code executing in MM_STANDALONE mode.
This allows storing of EFI variables on NOR flash which is accessible
only via the MM STANDALONE mode software.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
---
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf                               |   3 +
 ArmPlatformPkg/Drivers/NorFlashDxe/{NorFlashDxe.inf => NorFlashStandaloneMm.inf} |  28 +--
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h                                 |   5 +-
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c                          |   2 +-
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c                                 | 211 ++++++++++++++++----
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c                              |  88 ++++----
 6 files changed, 240 insertions(+), 97 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
index a59a21a03e0a..a704f69ef3aa 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
@@ -32,6 +32,7 @@ [Packages]
   MdeModulePkg/MdeModulePkg.dec
   ArmPlatformPkg/ArmPlatformPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
+  StandaloneMmPkg/StandaloneMmPkg.dec
 
 [LibraryClasses]
   IoLib
@@ -44,6 +45,7 @@ [LibraryClasses]
   UefiBootServicesTableLib
   UefiRuntimeLib
   DxeServicesTableLib
+  StandaloneMmRuntimeDxe
 
 [Guids]
   gEfiSystemNvDataFvGuid
@@ -57,6 +59,7 @@ [Protocols]
   gEfiDevicePathProtocolGuid
   gEfiFirmwareVolumeBlockProtocolGuid
   gEfiDiskIoProtocolGuid
+  gEfiSmmFirmwareVolumeBlockProtocolGuid
 
 [Pcd.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf
similarity index 71%
copy from ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
copy to ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf
index a59a21a03e0a..a6d0581b799c 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf
@@ -2,7 +2,7 @@
 #
 #  Component description file for NorFlashDxe module
 #
-#  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -16,11 +16,12 @@
 
 [Defines]
   INF_VERSION                    = 0x00010005
-  BASE_NAME                      = ArmVeNorFlashDxe
-  FILE_GUID                      = 93E34C7E-B50E-11DF-9223-2443DFD72085
-  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
+  BASE_NAME                      = StandaloneMmNorFlash
+  FILE_GUID                      = 166F677B-DAC9-4AE4-AD34-2FF2504B0637
+  MODULE_TYPE                    = MM_STANDALONE
   VERSION_STRING                 = 1.0
-  ENTRY_POINT                    = NorFlashInitialise
+  PI_SPECIFICATION_VERSION       = 0x00010032
+  ENTRY_POINT                    = StandaloneMmNorFlashInitialise
 
 [Sources.common]
   NorFlashDxe.c
@@ -32,18 +33,21 @@ [Packages]
   MdeModulePkg/MdeModulePkg.dec
   ArmPlatformPkg/ArmPlatformPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
+  ArmPkg/ArmPkg.dec
+  StandaloneMmPkg/StandaloneMmPkg.dec
 
 [LibraryClasses]
+  StandaloneMmDriverEntryPoint
+  BaseMemoryLib
+  ArmSvcLib
+  ArmLib
   IoLib
   BaseLib
   DebugLib
   HobLib
+  MemoryAllocationLib
   NorFlashPlatformLib
-  UefiLib
-  UefiDriverEntryPoint
-  UefiBootServicesTableLib
-  UefiRuntimeLib
-  DxeServicesTableLib
+  MmServicesTableLib
 
 [Guids]
   gEfiSystemNvDataFvGuid
@@ -55,7 +59,7 @@ [Guids]
 [Protocols]
   gEfiBlockIoProtocolGuid
   gEfiDevicePathProtocolGuid
-  gEfiFirmwareVolumeBlockProtocolGuid
+  gEfiSmmFirmwareVolumeBlockProtocolGuid
   gEfiDiskIoProtocolGuid
 
 [Pcd.common]
@@ -69,4 +73,4 @@ [Pcd.common]
   gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked
 
 [Depex]
-  gEfiCpuArchProtocolGuid
+  TRUE
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
index 5c07694fbfaa..e3932a190b27 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
@@ -1,6 +1,6 @@
 /** @file  NorFlashDxe.h
 
-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -19,6 +19,7 @@
 #include <Base.h>
 #include <PiDxe.h>
 
+#include <PiMm.h>
 #include <Guid/EventGroup.h>
 
 #include <Protocol/BlockIo.h>
@@ -30,6 +31,8 @@
 #include <Library/NorFlashPlatformLib.h>
 #include <Library/UefiLib.h>
 #include <Library/UefiRuntimeLib.h>
+#include <Library/StandaloneMmServicesTableLib.h>
+#include <Library/StandaloneMmRuntimeDxe.h>
 
 #define NOR_FLASH_ERASE_RETRY                     10
 
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c
index 279b77c75ee1..4c002c7d65d3 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c
@@ -1,6 +1,6 @@
 /** @file  NorFlashBlockIoDxe.c
 
-  Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index 46e815beb343..706906a974a3 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -1,6 +1,6 @@
 /** @file  NorFlashDxe.c
 
-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -134,29 +134,102 @@ NorFlashCreateInstance (
 
   if (SupportFvb) {
     NorFlashFvbInitialize (Instance);
+    if (!InMm ()) {
+        Status = gBS->InstallMultipleProtocolInterfaces (
+                        &Instance->Handle,
+                        &gEfiDevicePathProtocolGuid, &Instance->DevicePath,
+                        &gEfiBlockIoProtocolGuid,  &Instance->BlockIoProtocol,
+                        &gEfiFirmwareVolumeBlockProtocolGuid, &Instance->FvbProtocol,
+                        NULL
+                        );
+        if (EFI_ERROR(Status)) {
+          FreePool (Instance);
+          return Status;
+        }
+    } else {
+      //Install DevicePath Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiDevicePathProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->DevicePath
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
+      //Install BlockIo Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiBlockIoProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->BlockIoProtocol
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
 
-    Status = gBS->InstallMultipleProtocolInterfaces (
-                  &Instance->Handle,
-                  &gEfiDevicePathProtocolGuid, &Instance->DevicePath,
-                  &gEfiBlockIoProtocolGuid,  &Instance->BlockIoProtocol,
-                  &gEfiFirmwareVolumeBlockProtocolGuid, &Instance->FvbProtocol,
-                  NULL
-                  );
-    if (EFI_ERROR(Status)) {
-      FreePool (Instance);
-      return Status;
+      //Install FirmwareVolumeBlock Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiSmmFirmwareVolumeBlockProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->FvbProtocol
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
     }
   } else {
-    Status = gBS->InstallMultipleProtocolInterfaces (
-                    &Instance->Handle,
-                    &gEfiDevicePathProtocolGuid, &Instance->DevicePath,
-                    &gEfiBlockIoProtocolGuid,  &Instance->BlockIoProtocol,
-                    &gEfiDiskIoProtocolGuid, &Instance->DiskIoProtocol,
-                    NULL
-                    );
-    if (EFI_ERROR(Status)) {
-      FreePool (Instance);
-      return Status;
+    if (!InMm ()) {
+      Status = gBS->InstallMultipleProtocolInterfaces (
+                      &Instance->Handle,
+                      &gEfiDevicePathProtocolGuid, &Instance->DevicePath,
+                      &gEfiBlockIoProtocolGuid,  &Instance->BlockIoProtocol,
+                      &gEfiDiskIoProtocolGuid, &Instance->DiskIoProtocol,
+                      NULL
+                      );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
+    } else {
+      //Install DevicePath Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiDevicePathProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->DevicePath
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
+      //Install BlockIo Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiBlockIoProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->BlockIoProtocol
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
+
+      //Install DiskIO Protocol
+      Status = gMmst->MmInstallProtocolInterface (
+                        &Instance->Handle,
+                        &gEfiDiskIoProtocolGuid,
+                        EFI_NATIVE_INTERFACE,
+                        &Instance->DiskIoProtocol
+                        );
+      if (EFI_ERROR(Status)) {
+        FreePool (Instance);
+        return Status;
+      }
     }
   }
 
@@ -338,13 +411,15 @@ NorFlashUnlockAndEraseSingleBlock (
   UINTN           Index;
   EFI_TPL         OriginalTPL;
 
-  if (!EfiAtRuntime ()) {
-    // Raise TPL to TPL_HIGH to stop anyone from interrupting us.
-    OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-  } else {
-    // This initialization is only to prevent the compiler to complain about the
-    // use of uninitialized variables
-    OriginalTPL = TPL_HIGH_LEVEL;
+  if (!InMm ()) {
+    if (!EfiAtRuntime ()) {
+      // Raise TPL to TPL_HIGH to stop anyone from interrupting us.
+      OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+    } else {
+      // This initialization is only to prevent the compiler to complain about the
+      // use of uninitialized variables
+      OriginalTPL = TPL_HIGH_LEVEL;
+    }
   }
 
   Index = 0;
@@ -363,9 +438,11 @@ NorFlashUnlockAndEraseSingleBlock (
     DEBUG((EFI_D_ERROR,"EraseSingleBlock(BlockAddress=0x%08x: Block Locked Error (try to erase %d times)\n", BlockAddress,Index));
   }
 
-  if (!EfiAtRuntime ()) {
-    // Interruptions can resume.
-    gBS->RestoreTPL (OriginalTPL);
+  if (!InMm ()) {
+    if (!EfiAtRuntime ()) {
+      // Interruptions can resume.
+      gBS->RestoreTPL (OriginalTPL);
+    }
   }
 
   return Status;
@@ -591,13 +668,15 @@ NorFlashWriteFullBlock (
   // Start writing from the first address at the start of the block
   WordAddress = BlockAddress;
 
-  if (!EfiAtRuntime ()) {
-    // Raise TPL to TPL_HIGH to stop anyone from interrupting us.
-    OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-  } else {
-    // This initialization is only to prevent the compiler to complain about the
-    // use of uninitialized variables
-    OriginalTPL = TPL_HIGH_LEVEL;
+  if (!InMm ()) {
+    if (!EfiAtRuntime ()) {
+      // Raise TPL to TPL_HIGH to stop anyone from interrupting us.
+      OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+    } else {
+      // This initialization is only to prevent the compiler to complain about the
+      // use of uninitialized variables
+      OriginalTPL = TPL_HIGH_LEVEL;
+    }
   }
 
   Status = NorFlashUnlockAndEraseSingleBlock (Instance, BlockAddress);
@@ -657,9 +736,11 @@ NorFlashWriteFullBlock (
   }
 
 EXIT:
-  if (!EfiAtRuntime ()) {
-    // Interruptions can resume.
-    gBS->RestoreTPL (OriginalTPL);
+  if (!InMm ()) {
+    if (!EfiAtRuntime ()) {
+      // Interruptions can resume.
+      gBS->RestoreTPL (OriginalTPL);
+    }
   }
 
   if (EFI_ERROR(Status)) {
@@ -1331,6 +1412,54 @@ NorFlashInitialise (
                   &mNorFlashVirtualAddrChangeEvent
                   );
   ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+EFI_STATUS
+EFIAPI
+StandaloneMmNorFlashInitialise (
+  IN EFI_HANDLE         ImageHandle,
+  IN EFI_MM_SYSTEM_TABLE   *SystemTable
+  )
+{
+  EFI_STATUS              Status;
+  UINT32                  Index;
+  NOR_FLASH_DESCRIPTION*  NorFlashDevices;
+  BOOLEAN                 ContainVariableStorage;
+
+  Status = NorFlashPlatformInitialization ();
+  if (EFI_ERROR(Status)) {
+    DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to initialize Nor Flash devices\n"));
+    return Status;
+  }
+
+  Status = NorFlashPlatformGetDevices (&NorFlashDevices, &mNorFlashDeviceCount);
+  if (EFI_ERROR(Status)) {
+    DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to get Nor Flash devices\n"));
+    return Status;
+  }
+
+  mNorFlashInstances = AllocateRuntimePool (sizeof(NOR_FLASH_INSTANCE*) * mNorFlashDeviceCount);
+
+  for (Index = 0; Index < mNorFlashDeviceCount; Index++) {
+    // Check if this NOR Flash device contain the variable storage region
+    ContainVariableStorage =
+        (NorFlashDevices[Index].RegionBaseAddress <= PcdGet32 (PcdFlashNvStorageVariableBase)) &&
+        (PcdGet32 (PcdFlashNvStorageVariableBase) + PcdGet32 (PcdFlashNvStorageVariableSize) <= NorFlashDevices[Index].RegionBaseAddress + NorFlashDevices[Index].Size);
 
+    Status = NorFlashCreateInstance (
+      NorFlashDevices[Index].DeviceBaseAddress,
+      NorFlashDevices[Index].RegionBaseAddress,
+      NorFlashDevices[Index].Size,
+      Index,
+      NorFlashDevices[Index].BlockSize,
+      ContainVariableStorage,
+      &NorFlashDevices[Index].Guid,
+      &mNorFlashInstances[Index]
+    );
+    if (EFI_ERROR(Status)) {
+      DEBUG((EFI_D_ERROR,"NorFlashInitialise: Fail to create instance for NorFlash[%d]\n",Index));
+    }
+  }
   return Status;
 }
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
index e62ffbb433d0..e4d7100ee17e 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
@@ -1,6 +1,6 @@
 /*++ @file  NorFlashFvbDxe.c
 
- Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
 
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
@@ -720,27 +720,29 @@ NorFlashFvbInitialize (
   DEBUG((DEBUG_BLKIO,"NorFlashFvbInitialize\n"));
   ASSERT((Instance != NULL));
 
-  //
-  // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME
-  //
+  if (!InMm ()) {
+    //
+    // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME
+    //
 
-  // Note: all the NOR Flash region needs to be reserved into the UEFI Runtime memory;
-  //       even if we only use the small block region at the top of the NOR Flash.
-  //       The reason is when the NOR Flash memory is set into program mode, the command
-  //       is written as the base of the flash region (ie: Instance->DeviceBaseAddress)
-  RuntimeMmioRegionSize = (Instance->RegionBaseAddress - Instance->DeviceBaseAddress) + Instance->Size;
+    // Note: all the NOR Flash region needs to be reserved into the UEFI Runtime memory;
+    //       even if we only use the small block region at the top of the NOR Flash.
+    //       The reason is when the NOR Flash memory is set into program mode, the command
+    //       is written as the base of the flash region (ie: Instance->DeviceBaseAddress)
+    RuntimeMmioRegionSize = (Instance->RegionBaseAddress - Instance->DeviceBaseAddress) + Instance->Size;
 
-  Status = gDS->AddMemorySpace (
-      EfiGcdMemoryTypeMemoryMappedIo,
-      Instance->DeviceBaseAddress, RuntimeMmioRegionSize,
-      EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
-      );
-  ASSERT_EFI_ERROR (Status);
+    Status = gDS->AddMemorySpace (
+        EfiGcdMemoryTypeMemoryMappedIo,
+        Instance->DeviceBaseAddress, RuntimeMmioRegionSize,
+        EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
+        );
+    ASSERT_EFI_ERROR (Status);
 
-  Status = gDS->SetMemorySpaceAttributes (
-      Instance->DeviceBaseAddress, RuntimeMmioRegionSize,
-      EFI_MEMORY_UC | EFI_MEMORY_RUNTIME);
-  ASSERT_EFI_ERROR (Status);
+    Status = gDS->SetMemorySpaceAttributes (
+        Instance->DeviceBaseAddress, RuntimeMmioRegionSize,
+        EFI_MEMORY_UC | EFI_MEMORY_RUNTIME);
+    ASSERT_EFI_ERROR (Status);
+  }
 
   mFlashNvStorageVariableBase = FixedPcdGet32 (PcdFlashNvStorageVariableBase);
 
@@ -777,30 +779,32 @@ NorFlashFvbInitialize (
     }
   }
 
-  //
-  // The driver implementing the variable read service can now be dispatched;
-  // the varstore headers are in place.
-  //
-  Status = gBS->InstallProtocolInterface (
-                  &gImageHandle,
-                  &gEdkiiNvVarStoreFormattedGuid,
-                  EFI_NATIVE_INTERFACE,
-                  NULL
-                  );
-  ASSERT_EFI_ERROR (Status);
+  if (!InMm ()) {
+    //
+    // The driver implementing the variable read service can now be dispatched;
+    // the varstore headers are in place.
+    //
+    Status = gBS->InstallProtocolInterface (
+                    &gImageHandle,
+                    &gEdkiiNvVarStoreFormattedGuid,
+                    EFI_NATIVE_INTERFACE,
+                    NULL
+                    );
+    ASSERT_EFI_ERROR (Status);
 
-  //
-  // Register for the virtual address change event
-  //
-  Status = gBS->CreateEventEx (
-                  EVT_NOTIFY_SIGNAL,
-                  TPL_NOTIFY,
-                  FvbVirtualNotifyEvent,
-                  NULL,
-                  &gEfiEventVirtualAddressChangeGuid,
-                  &mFvbVirtualAddrChangeEvent
-                  );
-  ASSERT_EFI_ERROR (Status);
+    //
+    // Register for the virtual address change event
+    //
+    Status = gBS->CreateEventEx (
+                    EVT_NOTIFY_SIGNAL,
+                    TPL_NOTIFY,
+                    FvbVirtualNotifyEvent,
+                    NULL,
+                    &gEfiEventVirtualAddressChangeGuid,
+                    &mFvbVirtualAddrChangeEvent
+                    );
+    ASSERT_EFI_ERROR (Status);
+  }
 
   return Status;
 }
-- 
2.7.4



  parent reply	other threads:[~2018-11-28  9:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  9:34 [RFC PATCH v3 00/11] Extend secure variable service to be usable from Standalone MM Jagadeesh Ujja
2018-11-28  9:34 ` [RFC PATCH v3 01/11] MdeModulePkg/Variable: replace all uses of AsmLfence with MemoryFence Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 02/11] StandaloneMmPkg: Pull in additonal libraries from staging branch Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 03/11] MdeModulePkg/Library: Add StandaloneMmRuntimeDxe library Jagadeesh Ujja
2018-11-28  9:35 ` Jagadeesh Ujja [this message]
2018-11-28  9:35 ` [RFC PATCH v3 05/11] MdeModulePkg/FaultTolerantWriteDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 06/11] MdeModulePkg/Variable/RuntimeDxe: adapt for usability with MM Standalone Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 07/11] MdeModulePkg/Variable/RuntimeDxe: adapt as a MM Standalone driver Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 08/11] SecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 09/11] MdeModulePkg/VarCheckLib: " Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 10/11] CryptoPkg/BaseCryptLib: " Jagadeesh Ujja
2018-11-28  9:35 ` [RFC PATCH v3 11/11] CryptoPkg/BaseCryptLib: Hack to get time in MM Standalone mode Jagadeesh Ujja
2018-11-30  8:15   ` Ye, Ting
2018-11-29 15:57 ` [RFC PATCH v3 00/11] Extend secure variable service to be usable from Standalone MM Gao, Liming
2018-12-11  5:28   ` jagadeesh ujja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543397709-31847-5-git-send-email-jagadeesh.ujja@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox