Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UefiCpuPkg/MpInitLib: avoid printing debug messages in AP #1498

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions UefiCpuPkg/Library/MpInitLib/Microcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,8 @@ MicrocodeDetect (
MSR_IA32_BIOS_UPDT_TRIG,
(UINT64) (UINTN) MicrocodeData
);
//
// Get and check new microcode signature
//
CurrentRevision = GetCurrentMicrocodeSignature ();
if (CurrentRevision != LatestRevision) {
AcquireSpinLock(&CpuMpData->MpLock);
DEBUG ((EFI_D_ERROR, "Updated microcode signature [0x%08x] does not match \
loaded microcode signature [0x%08x]\n", CurrentRevision, LatestRevision));
ReleaseSpinLock(&CpuMpData->MpLock);
}
}
CpuMpData->CpuData[ProcessorNumber].MicrocodeRevision = GetCurrentMicrocodeSignature ();
}

/**
Expand Down
25 changes: 25 additions & 0 deletions UefiCpuPkg/Library/MpInitLib/MpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,31 @@ MpInitLibInitialize (
}
}

//
// Dump the microcode revision for each core.
//
DEBUG_CODE (
UINT32 ThreadId;
UINT32 ExpectedMicrocodeRevision;
CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;
for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
GetProcessorLocationByApicId (CpuInfoInHob[Index].InitialApicId, NULL, NULL, &ThreadId);
if (ThreadId == 0) {
//
// MicrocodeDetect() loads microcode in first thread of each core, so,
// CpuMpData->CpuData[Index].MicrocodeEntryAddr is initialized only for first thread of each core.
//
ExpectedMicrocodeRevision = 0;
if (CpuMpData->CpuData[Index].MicrocodeEntryAddr != 0) {
ExpectedMicrocodeRevision = ((CPU_MICROCODE_HEADER *)(UINTN)CpuMpData->CpuData[Index].MicrocodeEntryAddr)->UpdateRevision;
}
DEBUG ((
DEBUG_INFO, "CPU[%04d]: Microcode revision = %08x, expected = %08x\n",
Index, CpuMpData->CpuData[Index].MicrocodeRevision, ExpectedMicrocodeRevision
));
}
}
);
//
// Initialize global data for MP support
//
Expand Down
1 change: 1 addition & 0 deletions UefiCpuPkg/Library/MpInitLib/MpLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ typedef struct {
UINT32 ProcessorSignature;
UINT8 PlatformId;
UINT64 MicrocodeEntryAddr;
UINT32 MicrocodeRevision;
} CPU_AP_DATA;

//
Expand Down