From b14f4ebbb4ea866a5f1206cb3b5679f020e675b1 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 22 Mar 2016 10:08:03 +0800 Subject: UefiCpuPkg/PiSmmCpuDxeSmm: Move forward MP sync data initialization Move MP sync data initialization in front of the place that initialize page table, because the page fault spin lock is allocated in InitializeMpSyncData() while it is initialized in SmmInitPageTable(). Cc: Michael Kinney Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian Reviewed-by: Michael Kinney Regression-tested-by: Laszlo Ersek (cherry picked from commit d67b73cc381219f16f5d120e733efb7ffaa814f0) --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'UefiCpuPkg') diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index f6b40c3f55..b7ce875430 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1279,6 +1279,15 @@ InitializeMpServiceData ( UINT8 *GdtTssTables; UINTN GdtTableStepSize; + // + // Initialize mSmmMpSyncData + // + mSmmMpSyncDataSize = sizeof (SMM_DISPATCHER_MP_SYNC_DATA) + + (sizeof (SMM_CPU_DATA_BLOCK) + sizeof (BOOLEAN)) * gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; + mSmmMpSyncData = (SMM_DISPATCHER_MP_SYNC_DATA*) AllocatePages (EFI_SIZE_TO_PAGES (mSmmMpSyncDataSize)); + ASSERT (mSmmMpSyncData != NULL); + InitializeMpSyncData (); + // // Initialize physical address mask // NOTE: Physical memory above virtual address limit is not supported !!! @@ -1319,15 +1328,6 @@ InitializeMpServiceData ( ); } - // - // Initialize mSmmMpSyncData - // - mSmmMpSyncDataSize = sizeof (SMM_DISPATCHER_MP_SYNC_DATA) + - (sizeof (SMM_CPU_DATA_BLOCK) + sizeof (BOOLEAN)) * gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; - mSmmMpSyncData = (SMM_DISPATCHER_MP_SYNC_DATA*) AllocatePages (EFI_SIZE_TO_PAGES (mSmmMpSyncDataSize)); - ASSERT (mSmmMpSyncData != NULL); - InitializeMpSyncData (); - // // Record current MTRR settings // -- cgit v1.2.3