Revision: 17417
          http://sourceforge.net/p/edk2/code/17417
Author:   erictian
Date:     2015-05-12 01:48:34 +0000 (Tue, 12 May 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Feng Tian <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c

Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   2015-05-12 00:58:20 UTC 
(rev 17416)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   2015-05-12 01:48:34 UTC 
(rev 17417)
@@ -1042,6 +1042,7 @@
   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 @@
       // 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"));
         }  
       }


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to