mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/PiSmmIpl: Check order of EndOfDxe and DxeSmmReadyToLock
According to PI specification, EndOfDxe Event should be signaled before DxeSmmReadyToLock protocol installation. This update is ASSERT if EndOfDxe Event is not signaled when DxeSmmReadyToLock protocol installed. And do REPORT_STATUS_CODE() also. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
ebaafbe62c
commit
265fff3948
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
|
||||
|
||||
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at
|
||||
|
@ -38,6 +38,7 @@
|
|||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiRuntimeLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
|
||||
#include "PiSmmCorePrivateData.h"
|
||||
|
||||
|
@ -162,6 +163,20 @@ SmmIplGuidedEventNotify (
|
|||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Event notification that is fired when EndOfDxe Event Group is signaled.
|
||||
|
||||
@param Event The Event that is being processed, not used.
|
||||
@param Context Event Context, not used.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
SmmIplEndOfDxeEventNotify (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
|
||||
|
||||
|
@ -243,6 +258,7 @@ EFI_SMM_CONTROL2_PROTOCOL *mSmmControl2;
|
|||
EFI_SMM_ACCESS2_PROTOCOL *mSmmAccess;
|
||||
EFI_SMRAM_DESCRIPTOR *mCurrentSmramRange;
|
||||
BOOLEAN mSmmLocked = FALSE;
|
||||
BOOLEAN mEndOfDxe = FALSE;
|
||||
EFI_PHYSICAL_ADDRESS mSmramCacheBase;
|
||||
UINT64 mSmramCacheSize;
|
||||
|
||||
|
@ -271,6 +287,10 @@ SMM_IPL_EVENT_NOTIFICATION mSmmIplEvents[] = {
|
|||
//
|
||||
{ FALSE, TRUE, &gEfiEndOfDxeEventGroupGuid, SmmIplGuidedEventNotify, &gEfiEndOfDxeEventGroupGuid, TPL_CALLBACK, NULL },
|
||||
//
|
||||
// Declare event notification on EndOfDxe event. This is used to set EndOfDxe event signaled flag.
|
||||
//
|
||||
{ FALSE, TRUE, &gEfiEndOfDxeEventGroupGuid, SmmIplEndOfDxeEventNotify, &gEfiEndOfDxeEventGroupGuid, TPL_CALLBACK, NULL },
|
||||
//
|
||||
// Declare event notification on the DXE Dispatch Event Group. This event is signaled by the DXE Core
|
||||
// each time the DXE Core dispatcher has completed its work. When this event is signalled, the SMM Core
|
||||
// if notified, so the SMM Core can dispatch SMM drivers.
|
||||
|
@ -556,6 +576,23 @@ SmmIplGuidedEventNotify (
|
|||
SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);
|
||||
}
|
||||
|
||||
/**
|
||||
Event notification that is fired when EndOfDxe Event Group is signaled.
|
||||
|
||||
@param Event The Event that is being processed, not used.
|
||||
@param Context Event Context, not used.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
SmmIplEndOfDxeEventNotify (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
mEndOfDxe = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Event notification that is fired when DxeDispatch Event Group is signaled.
|
||||
|
||||
|
@ -711,6 +748,15 @@ SmmIplReadyToLockEventNotify (
|
|||
DEBUG ((DEBUG_WARN, "SMM IPL! DXE SMM Ready To Lock Protocol not installed before Ready To Boot signal\n"));
|
||||
}
|
||||
|
||||
if (!mEndOfDxe) {
|
||||
DEBUG ((DEBUG_ERROR, "EndOfDxe Event must be signaled before DxeSmmReadyToLock Protocol installation!\n"));
|
||||
REPORT_STATUS_CODE (
|
||||
EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED,
|
||||
(EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)
|
||||
);
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
//
|
||||
// Lock the SMRAM (Note: Locking SMRAM may not be supported on all platforms)
|
||||
//
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## @file
|
||||
# This module provide an SMM CIS compliant implementation of SMM IPL.
|
||||
#
|
||||
# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
|
@ -50,6 +50,7 @@
|
|||
UefiRuntimeLib
|
||||
DxeServicesLib
|
||||
PcdLib
|
||||
ReportStatusCodeLib
|
||||
|
||||
[Protocols]
|
||||
gEfiSmmBase2ProtocolGuid ## PRODUCES
|
||||
|
|
Loading…
Reference in New Issue