From 81ae98cc176cb6c8be13f7f776663fd99d9ad60a Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Wed, 2 Sep 2015 03:16:05 +0000 Subject: UefiCpuPkg/CpuMpPei: Fix CPU Healthy issue in PeiGetProcessorInfo () CPU Healthy state maybe changed by software. We should return Healthy state from Healthy bit instead of from CPU BIST hardware information. (Sync patch r18374 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18382 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/CpuMpPei/CpuBist.c | 5 ++++- UefiCpuPkg/CpuMpPei/PeiMpServices.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/CpuMpPei/CpuBist.c b/UefiCpuPkg/CpuMpPei/CpuBist.c index 2bee7a4a66..56292452a9 100644 --- a/UefiCpuPkg/CpuMpPei/CpuBist.c +++ b/UefiCpuPkg/CpuMpPei/CpuBist.c @@ -226,7 +226,10 @@ CollectBistDataFromPpi ( CpuData->Health = CpuInstance[CpuIndex].InfoRecord.IA32HealthFlags; } } - if (CpuData->Health.Uint32 != 0) { + if (CpuData->Health.Uint32 == 0) { + CpuData->CpuHealthy = TRUE; + } else { + CpuData->CpuHealthy = FALSE; // // Report Status Code that self test is failed // diff --git a/UefiCpuPkg/CpuMpPei/PeiMpServices.c b/UefiCpuPkg/CpuMpPei/PeiMpServices.c index 4215f9e51b..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) { -- cgit v1.2.3