]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/PiSmmCpuDxeSmm: Always initialze PSD
authorMichael Kinney <michael.d.kinney@intel.com>
Tue, 6 Dec 2016 00:53:33 +0000 (16:53 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Wed, 7 Dec 2016 07:26:31 +0000 (23:26 -0800)
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 <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c

index c37e9e8302af3c8ce1d9b1dc901dd8b6a602a6d5..b4bc0ec6a53de92c813d01fe7eb1a13b0abfbff9 100644 (file)
@@ -687,6 +687,14 @@ InstallSmiHandler (
 {\r
   PROCESSOR_SMM_DESCRIPTOR  *Psd;\r
 \r
+  //\r
+  // Initialize PROCESSOR_SMM_DESCRIPTOR\r
+  //\r
+  Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET);\r
+  CopyMem (Psd, &gcPsd, sizeof (gcPsd));\r
+  Psd->SmmGdtPtr = (UINT64)GdtBase;\r
+  Psd->SmmGdtSize = (UINT32)GdtSize;\r
+\r
   if (SmmCpuFeaturesGetSmiHandlerSize () != 0) {\r
     //\r
     // Install SMI handler provided by library\r
@@ -705,14 +713,6 @@ InstallSmiHandler (
     return;\r
   }\r
 \r
-  //\r
-  // Initialize PROCESSOR_SMM_DESCRIPTOR\r
-  //\r
-  Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET);\r
-  CopyMem (Psd, &gcPsd, sizeof (gcPsd));\r
-  Psd->SmmGdtPtr = (UINT64)GdtBase;\r
-  Psd->SmmGdtSize = (UINT32)GdtSize;\r
-\r
   //\r
   // Initialize values in template before copy\r
   //\r