It does not guarantee that the data has not been modified.\r
CPU has its own mechanism to verify Microcode Binary part.\r
\r
- @param[in] CpuMpData The pointer to CPU MP Data structure.\r
- @param[in] IsBspCallIn Indicate whether the caller is BSP or not.\r
+ @param[in] CpuMpData The pointer to CPU MP Data structure.\r
+ @param[in] ProcessorNumber The handle number of the processor. The range is\r
+ from 0 to the total number of logical processors\r
+ minus 1.\r
**/\r
VOID\r
MicrocodeDetect (\r
IN CPU_MP_DATA *CpuMpData,\r
- IN BOOLEAN IsBspCallIn\r
+ IN UINTN ProcessorNumber\r
)\r
{\r
UINT32 ExtendedTableLength;\r
MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr;\r
UINT32 ProcessorFlags;\r
UINT32 ThreadId;\r
+ BOOLEAN IsBspCallIn;\r
\r
//\r
// set ProcessorFlags to suppress incorrect compiler/analyzer warnings\r
}\r
\r
CurrentRevision = GetCurrentMicrocodeSignature ();\r
+ IsBspCallIn = (ProcessorNumber == (UINTN)CpuMpData->BspNumber) ? TRUE : FALSE;\r
if (CurrentRevision != 0 && !IsBspCallIn) {\r
//\r
// Skip loading microcode if it has been loaded successfully\r
} while (((UINTN) MicrocodeEntryPoint < MicrocodeEnd));\r
\r
Done:\r
+ if (LatestRevision != 0) {\r
+ //\r
+ // Save the detected microcode patch entry address (including the\r
+ // microcode patch header) for each processor.\r
+ // It will be used when building the microcode patch cache HOB.\r
+ //\r
+ CpuMpData->CpuData[ProcessorNumber].MicrocodeEntryAddr =\r
+ (UINTN) MicrocodeData - sizeof (CPU_MICROCODE_HEADER);\r
+ }\r
+\r
if (LatestRevision > CurrentRevision) {\r
//\r
// BIOS only authenticate updates that contain a numerically larger revision\r