How do I decode APIC error codes or APIC error numbers?

Asked by floid

[Intending this as a FAQ:] When noticing errors such as:

[ 20.945703] APIC error on CPU0: 00(08)
[ 20.945711] APIC error on CPU1: 00(08)

It can be helpful to know what the numeric error codes mean. Google is surprisingly unhelpful, try it!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
floid
Solved:
Last query:
Last reply:
Revision history for this message
floid (jkanowitz) said :
#1

The answer is buried in the comment to smp_error_interrupt() in your favorite Linux source tree's arch/x86/kernel/apic.c. Unfortunately I can't find a place to link directly to this file within Launchpad, but by example, kernel.org's apic.c for linux-2.6.29, (copyright to Ingo Molnar, credits to Maciej W. Rozycki, Eric Gilmore, Rolf G. Tews, Mikael Pettersson, Pavel Machek, and anyone I missed) contains the following decoder ring, which is unlikely to change or have been changed in quite a while:

         /*
          * Here is what the APIC error bits mean:
          * 0: Send CS error
          * 1: Receive CS error
          * 2: Send accept error
          * 3: Receive accept error
          * 4: Reserved
          * 5: Send illegal vector
          * 6: Received illegal vector
          * 7: Illegal register address
          */

In the printed error string, the decimal number before the parentheses is the content of the APIC's error register [apic_read(APIC_ESR)] when the function is called, and the number in parentheses is what remains after an attempt to zero ("tickle") it with apic_write(APIC_ESR, 0). You will, of course, have to convert the decimal to binary - for which the GNOME calculator's "Programming" mode is a useful cheat if you have other things (like a crashing system) on your mind.