]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PiSmmIpl: Do not reset SMRAM to UC when CPU driver runs
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 22 Oct 2018 09:03:07 +0000 (17:03 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 1 Nov 2018 02:06:30 +0000 (10:06 +0800)
Today's PiSmmIpl implementation initially sets SMRAM to WB to speed
up the SMM core/modules loading before SMM CPU driver runs.
When SMM CPU driver runs, PiSmmIpl resets the SMRAM to UC. It's done
in SmmIplDxeDispatchEventNotify(). COMM_BUFFER_SMM_DISPATCH_RESTART
is returned from SMM core that SMM CPU driver is just dispatched.

Since now the SMRR is widely used to control the SMRAM cache setting.
It's not needed to reset the SMRAM to UC anymore.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c

index f8cbe1704bfd78e715c42b983456fa25b1a1efbc..2fb877127b3a9552aadcdbf559c33e3b54843d40 100644 (file)
@@ -672,21 +672,10 @@ SmmIplDxeDispatchEventNotify (
       return;\r
     }\r
 \r
-    //\r
-    // Attempt to reset SMRAM cacheability to UC\r
-    // Assume CPU AP is available at this time\r
-    //\r
-    Status = gDS->SetMemorySpaceAttributes(\r
-                    mSmramCacheBase,\r
-                    mSmramCacheSize,\r
-                    EFI_MEMORY_UC\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_WARN, "SMM IPL failed to reset SMRAM window to EFI_MEMORY_UC\n"));\r
-    }\r
-\r
     //\r
     // Close all SMRAM ranges to protect SMRAM\r
+    // NOTE: SMRR is enabled by CPU SMM driver by calling SmmCpuFeaturesInitializeProcessor() from SmmCpuFeaturesLib\r
+    //       so no need to reset the SMRAM to UC in MTRR.\r
     //\r
     Status = mSmmAccess->Close (mSmmAccess);\r
     ASSERT_EFI_ERROR (Status);\r