diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-05-12 01:48:34 +0000 |
---|---|---|
committer | erictian <erictian@Edk2> | 2015-05-12 01:48:34 +0000 |
commit | b07ea4c198a4c2e095541902a0119cd384f8491a (patch) | |
tree | 8d94fd197e0a2a10ee6b1e8ae005861745a49814 | |
parent | c1b9129c3c1f09a4847c7ff3179ef2edc475cf56 (diff) | |
download | edk2-platforms-b07ea4c198a4c2e095541902a0119cd384f8491a.tar.xz |
MdeModulePkg: SmmIplEntry(): don't suppress SMM core startup failure
When the ExecuteSmmCoreFromSmram() function fails, SmmIplEntry()
restores the SMRAM range to EFI_MEMORY_UC. However, it saves the
return value of gDS->SetMemorySpaceAttributes() in the same Status
variable that gDS->contains the return value of ExecuteSmmCoreFromSmram().
Therefore, if gDS->SetMemorySpaceAttributes() succeeds, the failure
of ExecuteSmmCoreFromSmram() is masked, and Bad Things Happen (TM).
Introduce a temporary variable just for the return value of
gDS->SetMemorySpaceAttributes().
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17417 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c index 4759579cab..64565e937d 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -1042,6 +1042,7 @@ SmmIplEntry ( UINT64 SmmCodeSize;
EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *LMFAConfigurationTable;
EFI_CPU_ARCH_PROTOCOL *CpuArch;
+ EFI_STATUS SetAttrStatus;
//
// Fill in the image handle of the SMM IPL so the SMM Core can use this as the
@@ -1213,12 +1214,12 @@ SmmIplEntry ( // Attempt to reset SMRAM cacheability to UC
//
if (CpuArch != NULL) {
- Status = gDS->SetMemorySpaceAttributes(
- mSmramCacheBase,
- mSmramCacheSize,
- EFI_MEMORY_UC
- );
- if (EFI_ERROR (Status)) {
+ SetAttrStatus = gDS->SetMemorySpaceAttributes(
+ mSmramCacheBase,
+ mSmramCacheSize,
+ EFI_MEMORY_UC
+ );
+ if (EFI_ERROR (SetAttrStatus)) {
DEBUG ((DEBUG_WARN, "SMM IPL failed to reset SMRAM window to EFI_MEMORY_UC\n"));
}
}
|