Permalink
Browse files

MdeModulePkg/Variable/RuntimeDxe: introduce MorLockInitAtEndOfDxe() hook

Introduce the MorLockInitAtEndOfDxe() hook, in order to allow
MorLockInit() to delay / queue operations until EndOfDxe. (Or, if the
platform never signals EndOfDxe, until ReadyToBoot.)

Call MorLockInitAtEndOfDxe() whenever we set "mEndOfDxe" to TRUE:

- in VariableRuntimeDxe:
  - in the OnReadyToBoot() function,
  - in the OnEndOfDxe() function;

- in VariableSmm:
  - on the SMM_VARIABLE_FUNCTION_READY_TO_BOOT SMI request,
  - in the SmmEndOfDxeCallback() function.

For now, implement MorLockInitAtEndOfDxe() as a no-op in both
VariableRuntimeDxe and VariableSmm.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ladi Prosek <lprosek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Ladi Prosek <lprosek@redhat.com>
  • Loading branch information...
lersek committed Sep 30, 2017
1 parent 0387737 commit f1304280435fa3385f1d52f37ac4a562e16f8c89
@@ -46,6 +46,16 @@ MorLockInit (
VOID
);
/**
Delayed initialization for MOR Control Lock at EndOfDxe.
This function performs any operations queued by MorLockInit().
**/
VOID
MorLockInitAtEndOfDxe (
VOID
);
/**
This service is an MOR/MorLock checker handler for the SetVariable().
@@ -89,3 +89,18 @@ MorLockInit (
VariableLockRequestToLock (&mVariableLock, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, &gEfiMemoryOverwriteRequestControlLockGuid);
return EFI_SUCCESS;
}
/**
Delayed initialization for MOR Control Lock at EndOfDxe.
This function performs any operations queued by MorLockInit().
**/
VOID
MorLockInitAtEndOfDxe (
VOID
)
{
//
// Do nothing.
//
}
@@ -394,3 +394,18 @@ MorLockInit (
//
return SetMorLockVariable (0);
}
/**
Delayed initialization for MOR Control Lock at EndOfDxe.
This function performs any operations queued by MorLockInit().
**/
VOID
MorLockInitAtEndOfDxe (
VOID
)
{
//
// Do nothing.
//
}
@@ -291,6 +291,7 @@ OnReadyToBoot (
)
{
if (!mEndOfDxe) {
MorLockInitAtEndOfDxe ();
//
// Set the End Of DXE bit in case the EFI_END_OF_DXE_EVENT_GROUP_GUID event is not signaled.
//
@@ -330,6 +331,7 @@ OnEndOfDxe (
)
{
DEBUG ((EFI_D_INFO, "[Variable]END_OF_DXE is signaled\n"));
MorLockInitAtEndOfDxe ();
mEndOfDxe = TRUE;
mVarCheckAddressPointer = VarCheckLibInitializeAtEndOfDxe (&mVarCheckAddressPointerCount);
//
@@ -679,6 +679,7 @@ SmmVariableHandler (
break;
}
if (!mEndOfDxe) {
MorLockInitAtEndOfDxe ();
mEndOfDxe = TRUE;
VarCheckLibInitializeAtEndOfDxe (NULL);
//
@@ -811,6 +812,7 @@ SmmEndOfDxeCallback (
)
{
DEBUG ((EFI_D_INFO, "[Variable]SMM_END_OF_DXE is signaled\n"));
MorLockInitAtEndOfDxe ();
mEndOfDxe = TRUE;
VarCheckLibInitializeAtEndOfDxe (NULL);
//

0 comments on commit f130428

Please sign in to comment.