diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c index be5c935a88..e87e12fc99 100644 --- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -1019,6 +1019,7 @@ VariableSmmRuntimeInitialize ( VOID *SmmVariableWriteRegistration; EFI_EVENT OnReadyToBootEvent; EFI_EVENT ExitBootServiceEvent; + EFI_EVENT LegacyBootEvent; EfiInitializeLock (&mVariableServicesLock, TPL_NOTIFY); @@ -1086,6 +1087,17 @@ VariableSmmRuntimeInitialize ( &ExitBootServiceEvent ); + // + // Register the event to inform SMM variable that it is at runtime for legacy boot. + // Reuse OnExitBootServices() here. + // + EfiCreateEventLegacyBootEx( + TPL_NOTIFY, + OnExitBootServices, + NULL, + &LegacyBootEvent + ); + // // Register the event to convert the pointer for runtime. //