From nobody Sun Feb 8 17:48:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39569+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39569+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556214821; cv=none; d=zoho.com; s=zohoarc; b=OP3A79ODB9Arj23Mq4OuiTklIaVxLkOyy0H4SenX0AkYb6FBygJv7UWuDdjlf2bKf96o0xh8hzryxb8qdHZV+fVosufdMsh2C98DfoCOkm5maxFQ7NDeHTM2u6aeze7YpLbDzFD8WHChl+MMmmg4VkBdljknAd2W45Nxguvt2Wk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556214821; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=AuFsO93OD0Pj+a7g4qeqrpkcGs39ftOgmklhTYGgxPo=; b=CvFA0w/sPhoGH0VlzKnq26OVyaq17Ar875JxGP5VGpI3oMJKcAtQls8q5OoZr3ydNFPM8Ab63OadbFfBLFdVs6MxZGZUMwpFbiF7a51i4idOgmn0yDq6HBNQxwQYt8aszkKbrT586orTY2hYbB6hviyOGCgC5XOcWPsiFtCkASg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39569+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556214821491601.1899519813866; Thu, 25 Apr 2019 10:53:41 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Thu, 25 Apr 2019 10:53:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 10:53:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,394,1549958400"; d="scan'208";a="134369336" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.111.154]) by orsmga007.jf.intel.com with ESMTP; 25 Apr 2019 10:53:38 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Kelly Steele Subject: [edk2-devel] [Patch 3/4] QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close Date: Thu, 25 Apr 2019 10:53:33 -0700 Message-Id: <20190425175334.5944-4-michael.d.kinney@intel.com> In-Reply-To: <20190425175334.5944-1-michael.d.kinney@intel.com> References: <20190425175334.5944-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556214821; bh=TrSf4oyhQ9OkzmVna0utZ593IdLA2ygOB/+5V6wNqLU=; h=Cc:Date:From:Reply-To:Subject:To; b=lqKccuCQ/tLl5Djh9bpTZERKIxUvaE/JlpuygzJKjnJYX1V5wZ5tHpvLsqHlZqKVM+2 rVYNks+wC5rq3fmz73uP7OKiBXcEgKhpB+oQU5hDczijds7NTQqqePoiIsvQKoXdPO9pE qBnrXico37vxWkJNXfX7LriyWuxgJIxvEP8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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/bfc87aa78e77ed15b09d1b4499c5eab63e= 8842bb 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 Signed-off-by: Michael D Kinney Reviewed-by: Kelly Steele --- .../Smm/Dxe/SmmAccessDxe/SmmAccess.inf | 3 ++- .../Smm/Dxe/SmmAccessDxe/SmmAccessDriver.c | 18 +++++++++++++++++- .../Smm/Dxe/SmmAccessDxe/SmmAccessDriver.h | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.i= nf b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.inf index db916f686a..405e9eb7fd 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.inf +++ b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.inf @@ -1,7 +1,7 @@ ## @file # Component description file for SmmAccess module # -# Copyright (c) 2013-2015 Intel Corporation. +# Copyright (c) 2013-2019 Intel Corporation. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -34,6 +34,7 @@ [LibraryClasses] S3BootScriptLib UefiDriverEntryPoint UefiBootServicesTableLib + DxeServicesTableLib PcdLib SmmLib =20 diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDr= iver.c b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver= .c index 6148dea1b4..205f51ddb0 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.c +++ b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.c @@ -2,7 +2,7 @@ This is the driver that publishes the SMM Access Protocol instance for the Tylersburg chipset. =20 -Copyright (c) 2013-2015 Intel Corporation. +Copyright (c) 2013-2019 Intel Corporation. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -221,6 +221,7 @@ Returns: =20 --*/ { + EFI_STATUS Status; SMM_ACCESS_PRIVATE_DATA *SmmAccess; BOOLEAN OpenState; UINTN Index; @@ -239,6 +240,21 @@ Returns: return EFI_DEVICE_ERROR; } =20 + // + // Reset SMRAM cacheability to UC + // + for (Index =3D 0; Index < mSmmAccess.NumberRegions; Index++) { + DEBUG ((DEBUG_INFO, "SmmAccess->Close: Set to UC Base=3D%016lx Size= =3D%016lx\n", SmmAccess->SmramDesc[Index].CpuStart, SmmAccess->SmramDesc[In= dex].PhysicalSize)); + Status =3D gDS->SetMemorySpaceAttributes( + SmmAccess->SmramDesc[Index].CpuStart, + SmmAccess->SmramDesc[Index].PhysicalSize, + EFI_MEMORY_UC + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "SmmAccess: Failed to reset SMRAM window to EFI_= MEMORY_UC\n")); + } + } + =20 // // Close TSEG // diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDr= iver.h b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver= .h index 80f73ba0e3..aca169d3e2 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.h +++ b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDriver.h @@ -3,7 +3,7 @@ Header file for SMM Access Driver. =20 This file includes package header files, library classes and protocol, PPI= & GUID definitions. =20 -Copyright (c) 2013-2015 Intel Corporation. +Copyright (c) 2013-2019 Intel Corporation. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -21,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include =20 // --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39569): https://edk2.groups.io/g/devel/message/39569 Mute This Topic: https://groups.io/mt/31345226/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-