diff options
author | Jeff Fan <jeff.fan@intel.com> | 2016-09-09 13:39:50 +0800 |
---|---|---|
committer | Jeff Fan <jeff.fan@intel.com> | 2016-09-14 08:54:24 +0800 |
commit | 7d17ab47d1d81c8012d8095c1e17412168c1cfc9 (patch) | |
tree | 5a422536145fde160e2b5ae493007570dc950a12 /UefiCpuPkg/CpuDxe/CpuMp.c | |
parent | d947fbed72226011961e5e2691f09baebf128795 (diff) | |
download | edk2-7d17ab47d1d81c8012d8095c1e17412168c1cfc9.tar.gz edk2-7d17ab47d1d81c8012d8095c1e17412168c1cfc9.tar.bz2 edk2-7d17ab47d1d81c8012d8095c1e17412168c1cfc9.zip |
UefiCpuPkg/CpuDxe: Fix duplicated status code report
If CPU Bist data is not zero, we will report Status code. But there is one bug
that will report each processor's status code duplicated with NumberOfData
times. This fix is to exchange the loop order on NumberOfData and
mNumberOfProcessors. It could make sure the report status code only once for
each processor.
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
Diffstat (limited to 'UefiCpuPkg/CpuDxe/CpuMp.c')
-rw-r--r-- | UefiCpuPkg/CpuDxe/CpuMp.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index a619a2b0e3..3e4f83fac2 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -539,6 +539,7 @@ CollectBistDataFromHob ( UINTN ProcessorNumber;
EFI_PROCESSOR_INFORMATION ProcessorInfo;
EFI_HEALTH_FLAGS BistData;
+ UINTN CpuInstanceNumber;
SecPlatformInformation2 = NULL;
SecPlatformInformation = NULL;
@@ -578,25 +579,25 @@ CollectBistDataFromHob ( }
}
- while ((NumberOfData--) > 0) {
- for (ProcessorNumber = 0; ProcessorNumber < mNumberOfProcessors; ProcessorNumber++) {
- MpInitLibGetProcessorInfo (ProcessorNumber, &ProcessorInfo, &BistData);
- if (ProcessorInfo.ProcessorId == CpuInstance[NumberOfData].CpuLocation) {
+ for (ProcessorNumber = 0; ProcessorNumber < mNumberOfProcessors; ProcessorNumber++) {
+ MpInitLibGetProcessorInfo (ProcessorNumber, &ProcessorInfo, &BistData);
+ for (CpuInstanceNumber = 0; CpuInstanceNumber < NumberOfData; CpuInstanceNumber++) {
+ if (ProcessorInfo.ProcessorId == CpuInstance[CpuInstanceNumber].CpuLocation) {
//
// Update CPU health status for MP Services Protocol according to BIST data.
//
- BistData = CpuInstance[NumberOfData].InfoRecord.IA32HealthFlags;
- }
- if (BistData.Uint32 != 0) {
- //
- // Report Status Code that self test is failed
- //
- REPORT_STATUS_CODE (
- EFI_ERROR_CODE | EFI_ERROR_MAJOR,
- (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)
- );
+ BistData = CpuInstance[CpuInstanceNumber].InfoRecord.IA32HealthFlags;
}
}
+ if (BistData.Uint32 != 0) {
+ //
+ // Report Status Code that self test is failed
+ //
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_MAJOR,
+ (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)
+ );
+ }
}
}
|