cat /proc/interrupts shows a bunch of IRQs such as NMI and LOC. The per-line comments in the output give clear explanation, but if they do not have a numeric IRQ number, how does the x86 CPU respond to them, in terms of entries in the Interrupt Descriptor Table?


The non-numeric entries in /proc/interrupts correspond to arch-specific, non-device-related interrupts.

On x86, the IDT layout is described in arch/x86/include/asm/irq_vectors.h:

  • Vectors 0 ... 31 : system traps and exceptions - hardcoded events
  • Vectors 32 ... 127 : device interrupts
  • Vector 128 : legacy int80 syscall interface
  • Vectors 129 ... LOCAL_TIMER_VECTOR-1
  • Vectors LOCAL_TIMER_VECTOR ... 255 : special interrupts

The arch-specific interrupts are handled by IDT entries from 0 to 31 and from 129 to 255, with the local timer interrupt the first in the latter range. So when you see 0 in /proc/interrupts, it’s IDT entry 32; when you see NMI, it’s entry 2; etc. The IDT itself is set up in arch/x86/kernel/idt.c.

  • Thanks. I also found this file gives enumeration of system traps and exceptions /arch/x86/include/asm/traps.h. So does that mean that a standard linux on x86 can only support 127 - 31 = 96 external device interrupts? (I peeked into the same file on google's pixelbook and saw IRQs 201 for intel gpio and 207 for iwlwifi) – QnA Sep 10 '19 at 1:15
  • The IDT has been reworked several times; I described the current setup. Your Pixelbook might have been running an older kernel — in the past, fewer special interrupts were reserved, and device interrupts could go up to 200+. There are only 96 device interrupt entries in the IDT now, but that doesn’t limit the external device support much; PCI can share interrupts, the kernel supports hierarchical IRQ domains, etc. – Stephen Kitt Sep 10 '19 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.