]> git.proxmox.com Git - mirror_edk2.git/commitdiff
QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close
authorMichael D Kinney <michael.d.kinney@intel.com>
Wed, 24 Apr 2019 21:07:19 +0000 (14:07 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Tue, 30 Apr 2019 23:39:40 +0000 (16:39 -0700)
The following commit removed the unconditional UC setting
just prior to closing the SMRAM region.  This is a correct
change for most platforms.

https://github.com/tianocore/edk2/commit/bfc87aa78e77ed15b09d1b4499c5eab63e8842bb

The Quark platforms still require this UC setting, so move
the UC setting into the Quark specific SMM Access Protocol
when the Close() service is called.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.inf
QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.c
QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.h

index db916f686a00cadc1aca1abb76ea50323f4b8b01..405e9eb7fd6e1075ae186e22c16e807e1aea78ca 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Component description file for SmmAccess module\r
 #\r
-# Copyright (c) 2013-2015 Intel Corporation.\r
+# Copyright (c) 2013-2019 Intel Corporation.\r
 #\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -34,6 +34,7 @@
   S3BootScriptLib\r
   UefiDriverEntryPoint\r
   UefiBootServicesTableLib\r
+  DxeServicesTableLib\r
   PcdLib\r
   SmmLib\r
 \r
index 6148dea1b457730ae11a2b7ce8c81768b333f616..830f8b83c3934f8e3031859e912597b3938725ba 100644 (file)
@@ -2,7 +2,7 @@
 This is the driver that publishes the SMM Access Protocol\r
 instance for the Tylersburg chipset.\r
 \r
-Copyright (c) 2013-2015 Intel Corporation.\r
+Copyright (c) 2013-2019 Intel Corporation.\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -221,6 +221,7 @@ Returns:
 \r
 --*/\r
 {\r
+  EFI_STATUS              Status;\r
   SMM_ACCESS_PRIVATE_DATA *SmmAccess;\r
   BOOLEAN                 OpenState;\r
   UINTN                   Index;\r
@@ -239,6 +240,21 @@ Returns:
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
+  //\r
+  // Reset SMRAM cacheability to UC\r
+  //\r
+  for (Index = 0; Index < mSmmAccess.NumberRegions; Index++) {\r
+    DEBUG ((DEBUG_INFO, "SmmAccess->Close: Set to UC Base=%016lx  Size=%016lx\n", SmmAccess->SmramDesc[Index].CpuStart, SmmAccess->SmramDesc[Index].PhysicalSize));\r
+    Status = gDS->SetMemorySpaceAttributes(\r
+                    SmmAccess->SmramDesc[Index].CpuStart,\r
+                    SmmAccess->SmramDesc[Index].PhysicalSize,\r
+                    EFI_MEMORY_UC\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG ((DEBUG_WARN, "SmmAccess: Failed to reset SMRAM window to EFI_MEMORY_UC\n"));\r
+    }\r
+  }\r
+\r
   //\r
   // Close TSEG\r
   //\r
index 80f73ba0e39f5e546cd6d7182008bed1f5e2bef2..aca169d3e2fc82b2b7f4dbeaee55261141054baa 100644 (file)
@@ -3,7 +3,7 @@ Header file for SMM Access Driver.
 \r
 This file includes package header files, library classes and protocol, PPI & GUID definitions.\r
 \r
-Copyright (c) 2013-2015 Intel Corporation.\r
+Copyright (c) 2013-2019 Intel Corporation.\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
@@ -21,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DxeServicesTableLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
 //\r