From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 6B4E681FF9 for ; Mon, 5 Dec 2016 20:51:50 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 05 Dec 2016 20:51:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,751,1477983600"; d="scan'208";a="199418735" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 05 Dec 2016 20:51:49 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Dec 2016 20:51:49 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Dec 2016 20:51:49 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.239]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.96]) with mapi id 14.03.0248.002; Tue, 6 Dec 2016 12:51:47 +0800 From: "Tian, Feng" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Fan, Jeff" , "Tian, Feng" Thread-Topic: [Patch] UefiCpuPkg/PiSmmCpuDxeSmm: Always initialze PSD Thread-Index: AQHST3TMXHwB8xuYGESeBgUqLLOOJKD6WfGw Date: Tue, 6 Dec 2016 04:51:47 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE566E57BBB@SHSMSX101.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-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:51:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian Thanks Feng -----Original Message----- From: Kinney, Michael D=20 Sent: Tuesday, December 6, 2016 11:57 AM To: edk2-devel@lists.01.org Cc: Yao, Jiewen ; Fan, Jeff ; Tia= n, 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