X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FCpuMpPei%2FPeiMpServices.c;h=5dd2c153f46a0399c56cc9fe72bca67b824d6add;hp=503778fd9350df55ccef2f9164cc2d3e0478373b;hb=944f45ae2f7ecbff2c66622d15d52ffbc3455bfb;hpb=ea0f431cec51247658901a4f65ae76d6bbdd96e9 diff --git a/UefiCpuPkg/CpuMpPei/PeiMpServices.c b/UefiCpuPkg/CpuMpPei/PeiMpServices.c index 503778fd93..5dd2c153f4 100644 --- a/UefiCpuPkg/CpuMpPei/PeiMpServices.c +++ b/UefiCpuPkg/CpuMpPei/PeiMpServices.c @@ -334,7 +334,7 @@ PeiGetProcessorInfo ( if (PeiCpuMpData->CpuData[ProcessorNumber].ApicId == GetInitialApicId()) { ProcessorInfoBuffer->StatusFlag |= PROCESSOR_AS_BSP_BIT; } - if (PeiCpuMpData->CpuData[ProcessorNumber].Health.Uint32 == 0) { + if (PeiCpuMpData->CpuData[ProcessorNumber].CpuHealthy) { ProcessorInfoBuffer->StatusFlag |= PROCESSOR_HEALTH_STATUS_BIT; } if (PeiCpuMpData->CpuData[ProcessorNumber].State == CpuStateDisabled) { @@ -441,6 +441,10 @@ PeiStartupAllAPs ( return EFI_NOT_FOUND; } + if (Procedure == NULL) { + return EFI_INVALID_PARAMETER; + } + // // Check whether caller processor is BSP // @@ -804,6 +808,16 @@ PeiSwitchBSP ( ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE_ADDRESS); ApicBaseMsr.Bits.Bsp = 1; AsmWriteMsr64 (MSR_IA32_APIC_BASE_ADDRESS, ApicBaseMsr.Uint64); + // + // Set old BSP enable state + // + if (!EnableOldBSP) { + PeiCpuMpData->CpuData[PeiCpuMpData->BspNumber].State = CpuStateDisabled; + } + // + // Save new BSP number + // + PeiCpuMpData->BspNumber = (UINT32) ProcessorNumber; return EFI_SUCCESS; }