From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 7EB5181FDC for ; Mon, 5 Dec 2016 19:56:46 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 05 Dec 2016 19:56:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,751,1477983600"; d="scan'208";a="39359914" Received: from mdkinney-mobl.amr.corp.intel.com ([10.252.200.33]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2016 19:56:45 -0800 From: Michael Kinney To: edk2-devel@lists.01.org Cc: Jiewen Yao , Jeff Fan , Feng Tian Date: Mon, 5 Dec 2016 19:56:43 -0800 Message-Id: <1480996603-33304-1-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 Subject: [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 03:56:46 -0000 The following commit moved the initialization of the default PROCESSOR_SMM_DESCRIPTOR from MpService.c to SmramSaveState.c and made this initialization conditional on the value returned by the SmmCpuFeaturesGetSmiHandlerSize() library function. https://github.com/tianocore/edk2/commit/f12367a0b1de7838f1cb8e0839e168ed7b862333 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/PiSmmCpuDxeSmm/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; + // + // Initialize PROCESSOR_SMM_DESCRIPTOR + // + Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET); + CopyMem (Psd, &gcPsd, sizeof (gcPsd)); + Psd->SmmGdtPtr = (UINT64)GdtBase; + Psd->SmmGdtSize = (UINT32)GdtSize; + if (SmmCpuFeaturesGetSmiHandlerSize () != 0) { // // Install SMI handler provided by library @@ -706,14 +714,6 @@ InstallSmiHandler ( } // - // Initialize PROCESSOR_SMM_DESCRIPTOR - // - Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET); - CopyMem (Psd, &gcPsd, sizeof (gcPsd)); - Psd->SmmGdtPtr = (UINT64)GdtBase; - Psd->SmmGdtSize = (UINT32)GdtSize; - - // // Initialize values in template before copy // gSmiStack = (UINT32)((UINTN)SmiStack + StackSize - sizeof (UINTN)); -- 2.6.3.windows.1