Intel 64 and IA-32 Architectures Software Developers Manual Volume 3A, System Programming Guide, Part 1
Vol. 3A 14-23
MACHINE-CHECK ARCHITECTURE
Example 14-2. Machine-Check Exception Handler Pseudocode
IF CPU supports MCE
THEN
IF CPU supports MCA
THEN
call errorlogging routine; (* returns restartability *)
FI;
ELSE (* Pentium(R) processor compatible *)
READ P5_MC_ADDR
READ P5_MC_TYPE;
report RESTARTABILITY to console;
FI;
IF error is not restartable
THEN
report RESTARTABILITY to console;
abort system;
FI;
CLEAR MCIP flag in IA32_MCG_STATUS;
14.8.3 Pentium
Processor Machine-Check Exception Handling
To make the machine-check exception handler portable to the Pentium 4, Intel
Xeon, P6 family, and Pentium processors, checks can be made (using CPUID) to
determine the processor type. Then based on the processor type, machine-check
exceptions can be handled specifically for Pentium 4, Intel Xeon, P6 family, or
Pentium processors.
When machine-check exceptions are enabled for the Pentium processor (MCE flag is
set in control register CR4), the machine-check exception handler uses the RDMSR
instruction to read the error type from the P5_MC_TYPE register and the machine
check address from the P5_MC_ADDR register. The handler then normally reports
these register values to the system console before aborting execution (see Example
14-2).
14.8.4 Logging Correctable Machine-Check Errors
If a machine-check error is correctable, the processor does not generate a machine-
check exception for it. To detect correctable machine-check errors, a utility program
must be written that reads each of the machine-check error-reporting register banks
and logs the results in an accounting file or data structure. This utility can be imple-
mented in either of the following ways.
• A system daemon that polls the register banks on an infrequent basis, such as
hourly or daily.