From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 833DE81FE0 for ; Mon, 5 Dec 2016 20:28:05 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 05 Dec 2016 20:28:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,751,1477983600"; d="scan'208";a="14118020" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 05 Dec 2016 20:28:04 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Dec 2016 20:27:55 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Dec 2016 20:27:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.218]) with mapi id 14.03.0248.002; Tue, 6 Dec 2016 12:27:34 +0800 From: "Fan, Jeff" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Tian, Feng" Thread-Topic: [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Always initialze PSD Thread-Index: AQHST3TMR6b0nxLHxUiScxD6jv4pnKD6Uy1w Date: Tue, 6 Dec 2016 04:27:33 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4A2F4485@shsmsx102.ccr.corp.intel.com> References: <1480996603-33304-1-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1480996603-33304-1-git-send-email-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDhmYzc4NmMtZmM1OS00MGQzLTkxYmEtMzE4MDc0ZTc1M2ZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkwzYTlxWGl1ZjRROHlIRjgwajVyRUpXNTlyVTlLV1FWTExSRlwva0NKVGQwPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Always initialze PSD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:28:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jeff Fan -----Original Message----- From: Kinney, Michael D=20 Sent: Tuesday, December 06, 2016 11:57 AM To: edk2-devel@lists.01.org Cc: Yao, Jiewen; Fan, Jeff; Tian, Feng Subject: [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Always initialze PSD The following commit moved the initialization of the default PROCESSOR_SMM_= DESCRIPTOR from MpService.c to SmramSaveState.c and made this initializatio= n conditional on the value returned by the SmmCpuFeaturesGetSmiHandlerSize() library function. https://github.com/tianocore/edk2/commit/f12367a0b1de7838f1cb8e0839e168ed7b= 862333 This changed the behavior of the PiSmmCpuDxeSmm module. The initialization of the PROCESSOR_SMM_DESCRIPTOR is moved before the call= to SmmCpuFeaturesGetSmiHandlerSize() to preserve the previous behavior. Cc: Jiewen Yao Cc: Jeff Fan Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney Reviewed-by: Jeff Fan --- UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c b/UefiCpuPkg/PiSmmC= puDxeSmm/SmramSaveState.c index c37e9e8..b4bc0ec 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c @@ -687,6 +687,14 @@ InstallSmiHandler ( { PROCESSOR_SMM_DESCRIPTOR *Psd; =20 + // + // Initialize PROCESSOR_SMM_DESCRIPTOR // Psd =3D=20 + (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET); =20 + CopyMem (Psd, &gcPsd, sizeof (gcPsd)); Psd->SmmGdtPtr =3D=20 + (UINT64)GdtBase; Psd->SmmGdtSize =3D (UINT32)GdtSize; + if (SmmCpuFeaturesGetSmiHandlerSize () !=3D 0) { // // Install SMI handler provided by library @@ -706,14 +714,6 @@ Instal= lSmiHandler ( } =20 // - // Initialize PROCESSOR_SMM_DESCRIPTOR - // - Psd =3D (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFF= SET); - CopyMem (Psd, &gcPsd, sizeof (gcPsd)); - Psd->SmmGdtPtr =3D (UINT64)GdtBase; - Psd->SmmGdtSize =3D (UINT32)GdtSize; - - // // Initialize values in template before copy // gSmiStack =3D (UINT32)((UINTN)SmiStack + StackSize - sizeof = (UINTN)); -- 2.6.3.windows.1