summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-01 04:29:21 +0000
committerhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-01 04:29:21 +0000
commit3c5963cf299e0abd4c2ce7156b171fa66546dc85 (patch)
tree4f7501ad827b58781787b952d936406c128f07da /MdeModulePkg
parent26a76fbcb2762826523bba325400e302bf346859 (diff)
downloadedk2-platforms-3c5963cf299e0abd4c2ce7156b171fa66546dc85.tar.xz
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/PiSmmCore/PiSmmCore.c8
-rw-r--r--MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
index 0a50b5b70e..e49661a006 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
@@ -245,7 +245,6 @@ SmmEntryPoint (
{
EFI_STATUS Status;
EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;
- BOOLEAN OldInSmm;
//
// 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;
//
@@ -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;
}
/**
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
index c3c2afaec8..e372e7ecf1 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -398,6 +398,13 @@ SmmCommunicationCommunicate (
}
//
+ // 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
//
OldInSmm = gSmmCorePrivate->InSmm;