X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FCpuMpPei%2FCpuMpPei.c;h=8e35f288fe3c64fd235a84658a851671f6317029;hp=d5bc0c9b806af5672826c648c34dc580887081b1;hb=944f45ae2f7ecbff2c66622d15d52ffbc3455bfb;hpb=368002a31c7998d8f00f5e77acee14d49afc2b2d;ds=inline diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index d5bc0c9b80..8e35f288fe 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -357,22 +357,28 @@ CountProcessorNumber ( // Store BSP's MTRR setting // MtrrGetAllMtrrs (&PeiCpuMpData->MtrrTable); + // - // Send broadcast IPI to APs to wakeup APs - // - PeiCpuMpData->InitFlag = 1; - WakeUpAP (PeiCpuMpData, TRUE, 0, NULL, NULL); - // - // Wait for AP task to complete and then exit. - // - MicroSecondDelay (PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds)); - PeiCpuMpData->InitFlag = 0; - PeiCpuMpData->CpuCount += (UINT32) PeiCpuMpData->MpCpuExchangeInfo->NumApsExecuting; - ASSERT (PeiCpuMpData->CpuCount <= PcdGet32(PcdCpuMaxLogicalProcessorNumber)); - // - // Sort BSP/Aps by CPU APIC ID in ascending order + // Only perform AP detection if PcdCpuMaxLogicalProcessorNumber is greater than 1 // - SortApicId (PeiCpuMpData); + if (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 1) { + // + // Send broadcast IPI to APs to wakeup APs + // + PeiCpuMpData->InitFlag = 1; + WakeUpAP (PeiCpuMpData, TRUE, 0, NULL, NULL); + // + // Wait for AP task to complete and then exit. + // + MicroSecondDelay (PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds)); + PeiCpuMpData->InitFlag = 0; + PeiCpuMpData->CpuCount += (UINT32)PeiCpuMpData->MpCpuExchangeInfo->NumApsExecuting; + ASSERT (PeiCpuMpData->CpuCount <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber)); + // + // Sort BSP/Aps by CPU APIC ID in ascending order + // + SortApicId (PeiCpuMpData); + } DEBUG ((EFI_D_INFO, "CpuMpPei: Find %d processors in system.\n", PeiCpuMpData->CpuCount)); return PeiCpuMpData->CpuCount;