beautypg.com

5 microcode update checksum – Intel IA-32 User Manual

Page 417

background image

Vol. 3A 9-43

PROCESSOR MANAGEMENT AND INITIALIZATION

Example 9-6. Pseudo Code Example of Processor Flags Test

Flag

← 1 << IA32_PLATFORM_ID[52:50]

If (Update.HeaderVersion == 00000001h)

{

If (Update.ProcessorFlags & Flag)

{

Load Update

}

Else

{

//

// Assume the Data Size has been used to calculate the

// location of Update.ProcessorSignature[N] and a match

// on Update.ProcessorSignature[N] has already succeeded

//

If (Update.ProcessorFlags[n] & Flag)

{

Load Update

}

}

}

9.11.5

Microcode Update Checksum

Each microcode update contains a DWORD checksum located in the update header. It is soft-
ware’s responsibility to ensure that a microcode update is not corrupt. To check for a corrupt
microcode update, software must perform a unsigned DWORD (32-bit) checksum of the micro-
code update. Even though some fields are signed, the checksum procedure treats all DWORDs
as unsigned. Microcode updates with a header version equal to 00000001H must sum all
DWORDs that comprise the microcode update. A valid checksum check will yield a value of
00000000H. Any other value indicates the microcode update is corrupt and should not be
loaded.

The checksum algorithm shown by the pseudo code in Example 9-7 treats the microcode update
as an array of unsigned DWORDs. If the data size DWORD field at byte offset 32 equals
00000000H, the size of the encrypted data is 2000 bytes, resulting in 500 DWORDs. Otherwise
the microcode update size in DWORDs = (Total Size / 4).