IRQ stacks

Historically, for most architectures, interrupt handlers shared the kernel stack of the running process that was interrupted. As discussed in the first chapter, the process kernel stack is typically 8 KB for 32-bit architectures and 16 KB for 64-bit architectures. A fixed kernel stack might not always be enough for kernel work and IRQ processing routines, resulting in judicious allocation of data both by kernel code and interrupt handlers. To address this, the kernel build (for a few architectures) is configured by default to set up an additional per-CPU hard IRQ stack for use by interrupt handlers, and a per-CPU soft IRQ stack for use by software interrupt code. Following are the x86-64 bit architecture-specific stack declarations in kernel header <arch/x86/include/asm/processor.h>:

/*
 * per-CPU IRQ handling stacks
 */
struct irq_stack {
        u32                     stack[THREAD_SIZE/sizeof(u32)];
} __aligned(THREAD_SIZE);

DECLARE_PER_CPU(struct irq_stack *, hardirq_stack);
DECLARE_PER_CPU(struct irq_stack *, softirq_stack);

Apart from these, x86-64-bit builds also include special stacks; more details can be found in the kernel source documentation <x86/kernel-stacks>:

  • Double fault stack
  • Debug stack
  • NMI stack
  • Mce stack
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.127.232