audk/UefiCpuPkg/PiSmmCpuDxeSmm
Jeff Fan e78a2a49ee UefiCpuPkg/PiSmmCpuDxeSmm: SMM_CPU_DATA_BLOCK is not cleared
The commit 8b9311 changed the zeroing of mSmmMpSyncData of type
SMM_DISPATCHER_MP_SYNC_DATA by the following patch.
 -    ZeroMem (mSmmMpSyncData, mSmmMpSyncDataSize);
 +    mSmmMpSyncData->SwitchBsp = FALSE;

mSmmMpSyncDataSize not only includes SMM_DISPATCHER_MP_SYNC_DATA, but
also includes the SMM_CPU_DATA_BLOCK array and one BOOLEAN variable
array as shown here:

  mSmmMpSyncDataSize = sizeof (SMM_DISPATCHER_MP_SYNC_DATA) +
       (sizeof (SMM_CPU_DATA_BLOCK) + sizeof (BOOLEAN)) *
       gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus;

This patch restores the original ZeroMem() to clear all CPU Sync data.
The commit 8b9311 may cause unexpected behavior.

v2:
  Mentioned CandidateBsp array in comments to make it more accurate.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-07-20 18:50:53 -07:00
..
Ia32 UefiCpuPkg/PiSmmCpuDxeSmm: remove superfluous ENDs from NASM source 2016-07-18 19:23:01 +02:00
X64 UefiCpuPkg: fix ASSERT_EFI_ERROR() typos 2016-06-30 17:27:38 +02:00
CpuS3.c UefiCpuPkg/PiSmmCpuDxeSmm: Add MemoryMapped in SetProcessorRegister() 2016-07-14 08:57:47 -07:00
CpuService.c UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
CpuService.h UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
MpService.c UefiCpuPkg/PiSmmCpuDxeSmm: SMM_CPU_DATA_BLOCK is not cleared 2016-07-20 18:50:53 -07:00
PiSmmCpuDxeSmm.c UefiCpuPkg/PiSmmCpuDxeSmm: Clean up CheckFeatureSupported() 2016-07-14 08:58:04 -07:00
PiSmmCpuDxeSmm.h UefiCpuPkg/PiSmmCpuDxeSmm: Add MemoryMapped in SetProcessorRegister() 2016-07-14 08:57:47 -07:00
PiSmmCpuDxeSmm.inf UefiCpuPkg PiSmmCpuDxeSmm: Add nasm source file into INF file. 2016-06-28 09:52:19 +08:00
PiSmmCpuDxeSmm.uni UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00
PiSmmCpuDxeSmmExtra.uni UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00
SmmProfile.c UefiCpuPkg/PiSmmCpuDxeSmm: Clean up CheckFeatureSupported() 2016-07-14 08:58:04 -07:00
SmmProfile.h UefiCpuPkg/PiSmmCpuDxeSmm: Clean up CheckFeatureSupported() 2016-07-14 08:58:04 -07:00
SmmProfileInternal.h UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile: Remove unnecessary BTS MSRs 2016-05-16 10:40:18 -07:00
SmramSaveState.c UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
SyncTimer.c UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00