From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: kelly.steele@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Thu, 25 Apr 2019 14:40:19 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 14:40:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,394,1549958400"; d="scan'208";a="294596224" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga004.jf.intel.com with ESMTP; 25 Apr 2019 14:40:19 -0700 Received: from orsmsx160.amr.corp.intel.com (10.22.226.43) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 25 Apr 2019 14:40:18 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.50]) by ORSMSX160.amr.corp.intel.com ([169.254.13.110]) with mapi id 14.03.0415.000; Thu, 25 Apr 2019 14:40:18 -0700 From: "Steele, Kelly" To: "Kinney, Michael D" , "devel@edk2.groups.io" Subject: Re: [Patch 3/4] QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close Thread-Topic: [Patch 3/4] QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close Thread-Index: AQHU+4/RKDdQsZUve0idfYxnp9Yp8aZNZ8sA Date: Thu, 25 Apr 2019 21:40:18 +0000 Message-ID: References: <20190425175334.5944-1-michael.d.kinney@intel.com> <20190425175334.5944-4-michael.d.kinney@intel.com> In-Reply-To: <20190425175334.5944-4-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTgyZjBlYTEtZTMzYy00MDUyLWI0ZmQtMGFhZmE5M2IzZDg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRUtYMVBSVUxsbjdNelY3aVMzSXNMTmwwV0tDS2lQZVZRbnVObmJnWW9hcTk0bm9lRkgrTnVORzNRbzlPY3BEcSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Return-Path: kelly.steele@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Kelly Steele > -----Original Message----- > From: Kinney, Michael D > Sent: April 25, 2019 10:54 > To: devel@edk2.groups.io > Cc: Steele, Kelly > Subject: [Patch 3/4] QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM > close >=20 > The following commit removed the unconditional UC setting > just prior to closing the SMRAM region. This is a correct > change for most platforms. >=20 > https://github.com/tianocore/edk2/commit/bfc87aa78e77ed15b09d1b4499c5e > ab63e8842bb >=20 > 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. >=20 > Cc: Kelly Steele > Signed-off-by: Michael D Kinney > --- > .../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(-) >=20 > diff --git > a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccess.inf > 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/SmmAccessDrive > r.c > b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.c > index 6148dea1b4..205f51ddb0 100644 > --- > a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.c > +++ > b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.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[Index].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")); > + } > + } > + > // > // Close TSEG > // > diff --git > a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.h > b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.h > index 80f73ba0e3..aca169d3e2 100644 > --- > a/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.h > +++ > b/QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmAccessDxe/SmmAccessDrive > r.h > @@ -3,7 +3,7 @@ Header file for SMM Access Driver. >=20 > This file includes package header files, library classes and protocol, P= PI & 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 > // > -- > 2.21.0.windows.1