//\r
SPIN_LOCK *mMemoryMappedLock = NULL;\r
\r
+//\r
+// Signal that SMM BASE relocation is complete.\r
+//\r
+volatile BOOLEAN mInitApsAfterSmmBaseReloc;\r
+\r
/**\r
Get starting address and size of the rendezvous entry for APs.\r
Information for fixing a jump instruction in the code is also returned.\r
}\r
}\r
\r
+\r
+\r
/**\r
- AP initialization before SMBASE relocation in the S3 boot path.\r
+ AP initialization before then after SMBASE relocation in the S3 boot path.\r
**/\r
VOID\r
-EarlyMPRendezvousProcedure (\r
+MPRendezvousProcedure (\r
VOID\r
)\r
{\r
CPU_REGISTER_TABLE *RegisterTableList;\r
UINT32 InitApicId;\r
UINTN Index;\r
+ UINTN TopOfStack;\r
+ UINT8 Stack[128];\r
\r
LoadMtrrData (mAcpiCpuData.MtrrTable);\r
\r
}\r
}\r
\r
+\r
//\r
// Count down the number with lock mechanism.\r
//\r
InterlockedDecrement (&mNumberToFinish);\r
-}\r
\r
-/**\r
- AP initialization after SMBASE relocation in the S3 boot path.\r
-**/\r
-VOID\r
-MPRendezvousProcedure (\r
- VOID\r
- )\r
-{\r
- CPU_REGISTER_TABLE *RegisterTableList;\r
- UINT32 InitApicId;\r
- UINTN Index;\r
- UINTN TopOfStack;\r
- UINT8 Stack[128];\r
+ //\r
+ // Wait for BSP to signal SMM Base relocation done.\r
+ //\r
+ while (!mInitApsAfterSmmBaseReloc) {\r
+ CpuPause ();\r
+ }\r
\r
ProgramVirtualWireMode ();\r
DisableLvtInterrupts ();\r
PrepareApStartupVector (mAcpiCpuData.StartupVector);\r
\r
mNumberToFinish = mAcpiCpuData.NumberOfCpus - 1;\r
- mExchangeInfo->ApFunction = (VOID *) (UINTN) EarlyMPRendezvousProcedure;\r
+ mExchangeInfo->ApFunction = (VOID *) (UINTN) MPRendezvousProcedure;\r
+\r
+ //\r
+ // Execute code for before SmmBaseReloc. Note: This flag is maintained across S3 boots.\r
+ //\r
+ mInitApsAfterSmmBaseReloc = FALSE;\r
\r
//\r
// Send INIT IPI - SIPI to all APs\r
}\r
\r
mNumberToFinish = mAcpiCpuData.NumberOfCpus - 1;\r
- //\r
- // StackStart was updated when APs were waken up in EarlyInitializeCpu.\r
- // Re-initialize StackAddress to original beginning address.\r
- //\r
- mExchangeInfo->StackStart = (VOID *) (UINTN) mAcpiCpuData.StackAddress;\r
- mExchangeInfo->ApFunction = (VOID *) (UINTN) MPRendezvousProcedure;\r
\r
//\r
- // Send INIT IPI - SIPI to all APs\r
+ // Signal that SMM base relocation is complete and to continue initialization.\r
//\r
- SendInitSipiSipiAllExcludingSelf ((UINT32)mAcpiCpuData.StartupVector);\r
+ mInitApsAfterSmmBaseReloc = TRUE;\r
\r
while (mNumberToFinish > 0) {\r
CpuPause ();\r