Intel 64 and IA-32 Architectures Software Developers Manual Volume 3A, System Programming Guide, Part 1
Vol. 3A 9-45
PROCESSOR MANAGEMENT AND INITIALIZATION
9.11.5 Microcode Update Checksum
Each microcode update contains a DWORD checksum located in the update header.
It is software’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 microcode 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 micro-
code 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 micro-
code 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),
where the total size is a multiple of 1024 bytes (1 KBytes).
Example 9-7. Pseudo Code Example of Checksum Test
N ← 512
If (Update.DataSize != 00000000H)
N ← Update.TotalSize / 4
ChkSum ← 0
For (I ← 0; I < N; I++)
{
ChkSum ← ChkSum + MicrocodeUpdate[I]
}
If (ChkSum == 00000000H)
Success
Else
Fail
9.11.6 Microcode Update Loader
This section describes an update loader used to load an update into a Pentium 4, Intel
Xeon, or P6 family processor. It also discusses the requirements placed on the BIOS
to ensure proper loading. The update loader described contains the minimal instruc-
tions needed to load an update. The specific instruction sequence that is required to
load an update is dependent upon the loader revision field contained within the
update header. This revision is expected to change infrequently (potentially, only
when new processor models are introduced).
Example 9-8 below represents the update loader with a loader revision of
00000001H. Note that the microcode update must be aligned on a 16-byte boundary
and the size of the microcode update must be 1-KByte granular.