generic_handle_domain_nmi(9)
π
generic_handle_domain_nmi β Kernel API Manual, bestie edition β¨
Okay so picture this: you're deep in the kernel, you've got a hardware NMI that belongs to a domain, and somebody's gotta actually invoke the handler for it. That's this function. It's giving "middle management for interrupts" and honestly it ate. π
πΈ NAME πΈ
generic_handle_domain_nmi β invoke the handler for a HW nmi belonging to a domain. That's it, that's the whole vibe. π¦
β¨ SYNOPSIS β¨
int generic_handle_domain_nmi (struct irq_domain *domain ,
irq_hw_number_t hwirq );
Like, look at her. Two args, one int return, no drama. π₯
π«Ά ARGUMENTS π«Ά
domainβ the domain where to perform the lookup. This is your "where am I even" parameter. πhwirqβ the HW irq number to convert to a logical one. It's the hardware's raw little number, and we're translating it into something the kernel can actually work with. No cap. π
π RETURN π
0 on success (slay), or -EINVAL if conversion has failed π β which, lowkey, means the lookup didn't work out. It's not you, it's the numbers.
π DESCRIPTION π
So here's the important part, and I need you to listen: this function must be called from an NMI context with irq regs initialized. Not optional. Not "if you feel like it." It's a whole requirement, periodt. π
No fr fr, if you're not in NMI context with the irq regs initialized, this is not the function for you. Read the room.
π§ SEE ALSO π§
Kernel file ./kernel/irq/irqdesc.c β go read it, bestie, it's iconic:
irq_get_nr_irqs(9)irq_set_nr_irqs(9)generic_handle_irq(9)generic_handle_irq_safe(9)generic_handle_domain_irq(9)generic_handle_demux_domain_irq(9)irq_free_descs(9)__irq_alloc_descs(9)irq_get_next_irq(9)kstat_irqs_cpu(9)kstat_irqs_usr(9)
And that's the whole page! Mwah π β this gem lives in ./kernel/irq and the docs are stamped October 2026, so if you're reading this from the future, hi, hope the irq regs are initialized. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms