Update PiSmmCore:

1. Update PiSmmIpl.c DoCommunicate() to prevent exception in case call SmiManage directly if SMRAM is closed or locked. That case causes exception.
2. Update PiSmmCore.c SmmEntryPoint(). It is not required to save/restore InSmm. Because SMM is non-reentrant.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10131 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hhuan13 2010-03-01 04:29:21 +00:00
parent 26a76fbcb2
commit 3c5963cf29
2 changed files with 10 additions and 5 deletions

View File

@ -245,7 +245,6 @@ SmmEntryPoint (
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader; EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;
BOOLEAN OldInSmm;
// //
// Update SMST using the context // Update SMST using the context
@ -264,9 +263,8 @@ SmmEntryPoint (
} }
// //
// Save current InSmm state and set InSmm state to TRUE, it will be used by SmmBase2 protocol // Mark the InSmm flag as TRUE, it will be used by SmmBase2 protocol
// //
OldInSmm = gSmmCorePrivate->InSmm;
gSmmCorePrivate->InSmm = TRUE; gSmmCorePrivate->InSmm = TRUE;
// //
@ -301,9 +299,9 @@ SmmEntryPoint (
} }
// //
// Restore original InSmm state as we are going to leave SMM // Clear the InSmm flag as we are going to leave SMM
// //
gSmmCorePrivate->InSmm = OldInSmm; gSmmCorePrivate->InSmm = FALSE;
} }
/** /**

View File

@ -397,6 +397,13 @@ SmmCommunicationCommunicate (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
//
// Don't allow call SmiManage() directly when SMRAM is closed or locked.
//
if (!mSmmAccess->OpenState || mSmmAccess->LockState) {
return EFI_INVALID_PARAMETER;
}
// //
// Save current InSmm state and set InSmm state to TRUE // Save current InSmm state and set InSmm state to TRUE
// //