mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
d947fbed72
commit
7d17ab47d1
UefiCpuPkg/CpuDxe
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue