mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/CpuMpPei: Dump message if microcode signature not matched
Verification microcode signature is one enhancement and not one requirement from IA32 SDM. This update is just to dump debug message instead of ASSERT() if the updated microcode signature does not match the loaded microcode signature. 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: Giri P Mudusuru <giri.p.mudusuru@intel.com>
This commit is contained in:
parent
46fd118219
commit
719ff8cf3e
|
@ -302,7 +302,7 @@ ApCFunction (
|
||||||
// Sync BSP's Mtrr table to all wakeup APs and load microcode on APs.
|
// Sync BSP's Mtrr table to all wakeup APs and load microcode on APs.
|
||||||
//
|
//
|
||||||
MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable);
|
MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable);
|
||||||
MicrocodeDetect ();
|
MicrocodeDetect (PeiCpuMpData);
|
||||||
PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateIdle;
|
PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateIdle;
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -624,7 +624,7 @@ CountProcessorNumber (
|
||||||
//
|
//
|
||||||
// Load Microcode on BSP
|
// Load Microcode on BSP
|
||||||
//
|
//
|
||||||
MicrocodeDetect ();
|
MicrocodeDetect (PeiCpuMpData);
|
||||||
//
|
//
|
||||||
// Store BSP's MTRR setting
|
// Store BSP's MTRR setting
|
||||||
//
|
//
|
||||||
|
|
|
@ -321,4 +321,14 @@ SecPlatformInformation2 (
|
||||||
OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2
|
OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Detect whether specified processor can find matching microcode patch and load it.
|
||||||
|
|
||||||
|
@param PeiCpuMpData Pointer to PEI CPU MP Data
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
MicrocodeDetect (
|
||||||
|
IN PEI_CPU_MP_DATA *PeiCpuMpData
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,10 +36,11 @@ GetCurrentMicrocodeSignature (
|
||||||
/**
|
/**
|
||||||
Detect whether specified processor can find matching microcode patch and load it.
|
Detect whether specified processor can find matching microcode patch and load it.
|
||||||
|
|
||||||
|
@param PeiCpuMpData Pointer to PEI CPU MP Data
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
MicrocodeDetect (
|
MicrocodeDetect (
|
||||||
VOID
|
IN PEI_CPU_MP_DATA *PeiCpuMpData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT64 MicrocodePatchAddress;
|
UINT64 MicrocodePatchAddress;
|
||||||
|
@ -187,25 +188,29 @@ MicrocodeDetect (
|
||||||
MicrocodeEntryPoint = (EFI_CPU_MICROCODE_HEADER *) (((UINTN) MicrocodeEntryPoint) + TotalSize);
|
MicrocodeEntryPoint = (EFI_CPU_MICROCODE_HEADER *) (((UINTN) MicrocodeEntryPoint) + TotalSize);
|
||||||
} while (((UINTN) MicrocodeEntryPoint < MicrocodeEnd));
|
} while (((UINTN) MicrocodeEntryPoint < MicrocodeEnd));
|
||||||
|
|
||||||
if (LatestRevision > 0) {
|
if (LatestRevision > CurrentRevision) {
|
||||||
//
|
//
|
||||||
// BIOS only authenticate updates that contain a numerically larger revision
|
// BIOS only authenticate updates that contain a numerically larger revision
|
||||||
// than the currently loaded revision, where Current Signature < New Update
|
// than the currently loaded revision, where Current Signature < New Update
|
||||||
// Revision. A processor with no loaded update is considered to have a
|
// Revision. A processor with no loaded update is considered to have a
|
||||||
// revision equal to zero.
|
// revision equal to zero.
|
||||||
//
|
//
|
||||||
if (LatestRevision > GetCurrentMicrocodeSignature ()) {
|
|
||||||
AsmWriteMsr64 (
|
AsmWriteMsr64 (
|
||||||
EFI_MSR_IA32_BIOS_UPDT_TRIG,
|
EFI_MSR_IA32_BIOS_UPDT_TRIG,
|
||||||
(UINT64) (UINTN) MicrocodeInfo.MicrocodeData
|
(UINT64) (UINTN) MicrocodeInfo.MicrocodeData
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
// Get and verify new microcode signature
|
// Get and check new microcode signature
|
||||||
//
|
//
|
||||||
ASSERT (LatestRevision == GetCurrentMicrocodeSignature ());
|
CurrentRevision = GetCurrentMicrocodeSignature ();
|
||||||
|
if (CurrentRevision != LatestRevision) {
|
||||||
|
AcquireSpinLock(&PeiCpuMpData->MpLock);
|
||||||
|
DEBUG ((EFI_D_ERROR, "Updated microcode signature [0x%08x] does not match \
|
||||||
|
loaded microcode signature [0x%08x]\n", CurrentRevision, LatestRevision));
|
||||||
|
ReleaseSpinLock(&PeiCpuMpData->MpLock);
|
||||||
|
}
|
||||||
MicrocodeInfo.Load = TRUE;
|
MicrocodeInfo.Load = TRUE;
|
||||||
} else {
|
} else {
|
||||||
MicrocodeInfo.Load = FALSE;
|
MicrocodeInfo.Load = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -56,13 +56,4 @@ typedef struct {
|
||||||
UINT32 ProcessorChecksum;
|
UINT32 ProcessorChecksum;
|
||||||
} EFI_CPU_MICROCODE_EXTENDED_TABLE;
|
} EFI_CPU_MICROCODE_EXTENDED_TABLE;
|
||||||
|
|
||||||
/**
|
|
||||||
Detect whether specified processor can find matching microcode patch and load it.
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
MicrocodeDetect (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue