diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index 42b040531e..abcc3eea05 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1272,7 +1272,6 @@ InitializeSmmCpuSemaphores ( UINTN TotalSize; UINTN GlobalSemaphoresSize; UINTN CpuSemaphoresSize; - UINTN MsrSemahporeSize; UINTN SemaphoreSize; UINTN Pages; UINTN *SemaphoreBlock; @@ -1282,8 +1281,7 @@ InitializeSmmCpuSemaphores ( ProcessorCount = gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; GlobalSemaphoresSize = (sizeof (SMM_CPU_SEMAPHORE_GLOBAL) / sizeof (VOID *)) * SemaphoreSize; CpuSemaphoresSize = (sizeof (SMM_CPU_SEMAPHORE_CPU) / sizeof (VOID *)) * ProcessorCount * SemaphoreSize; - MsrSemahporeSize = MSR_SPIN_LOCK_INIT_NUM * SemaphoreSize; - TotalSize = GlobalSemaphoresSize + CpuSemaphoresSize + MsrSemahporeSize; + TotalSize = GlobalSemaphoresSize + CpuSemaphoresSize; DEBUG((EFI_D_INFO, "One Semaphore Size = 0x%x\n", SemaphoreSize)); DEBUG((EFI_D_INFO, "Total Semaphores Size = 0x%x\n", TotalSize)); Pages = EFI_SIZE_TO_PAGES (TotalSize); @@ -1311,12 +1309,6 @@ InitializeSmmCpuSemaphores ( SemaphoreAddr += ProcessorCount * SemaphoreSize; mSmmCpuSemaphores.SemaphoreCpu.Present = (BOOLEAN *)SemaphoreAddr; - SemaphoreAddr = (UINTN)SemaphoreBlock + GlobalSemaphoresSize + CpuSemaphoresSize; - mSmmCpuSemaphores.SemaphoreMsr.Msr = (SPIN_LOCK *)SemaphoreAddr; - mSmmCpuSemaphores.SemaphoreMsr.AvailableCounter = - ((UINTN)SemaphoreBlock + Pages * SIZE_4KB - SemaphoreAddr) / SemaphoreSize; - ASSERT (mSmmCpuSemaphores.SemaphoreMsr.AvailableCounter >= MSR_SPIN_LOCK_INIT_NUM); - mPFLock = mSmmCpuSemaphores.SemaphoreGlobal.PFLock; mConfigSmmCodeAccessCheckLock = mSmmCpuSemaphores.SemaphoreGlobal.CodeAccessCheckLock; diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h index e2970308fe..61d4bd3085 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -347,13 +347,6 @@ typedef struct { volatile BOOLEAN *CandidateBsp; } SMM_DISPATCHER_MP_SYNC_DATA; -#define MSR_SPIN_LOCK_INIT_NUM 15 - -typedef struct { - SPIN_LOCK *SpinLock; - UINT32 MsrIndex; -} MP_MSR_LOCK; - #define SMM_PSD_OFFSET 0xfb00 /// @@ -376,21 +369,12 @@ typedef struct { volatile BOOLEAN *Present; } SMM_CPU_SEMAPHORE_CPU; -/// -/// All MSRs semaphores' pointer and counter -/// -typedef struct { - SPIN_LOCK *Msr; - UINTN AvailableCounter; -} SMM_CPU_SEMAPHORE_MSR; - /// /// All semaphores' information /// typedef struct { SMM_CPU_SEMAPHORE_GLOBAL SemaphoreGlobal; SMM_CPU_SEMAPHORE_CPU SemaphoreCpu; - SMM_CPU_SEMAPHORE_MSR SemaphoreMsr; } SMM_CPU_SEMAPHORES; extern IA32_DESCRIPTOR gcSmiGdtr;