prepare_percpu_nmi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… prepare_percpu_nmi(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this one lives in the Kernel API Manual (that's the manual name, iykyk) and it's genuinely one of those tiny functions that does so much. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

prepare_percpu_nmi β€” performs CPU local setup for NMI delivery


πŸ¦‹ SYNOPSIS πŸ¦‹

int prepare_percpu_nmi (unsigned int irq );

🌸 ARGUMENTS 🌸

  • irq β€” Interrupt line to prepare for NMI delivery. like, the actual line you're getting all set up. the main character of this whole operation, honestly πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So this call prepares an interrupt line to deliver NMI on the current CPU β€” and the timing matters, bestie: it has to happen before that interrupt line gets enabled with enable_percpu_nmi. order of operations is real πŸ’…

It's a CPU local operation, so it should be called from non-preemptible context. no cap, don't be cute with preemption here.

And if the interrupt line genuinely cannot be used to deliver NMIs? the function will fail, returning a negative value. that's your cue, not to keep going πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/irq/manage.c β€” go read it, it's giving main character energy:

that's the whole friend group right there 🫢


πŸ’« and that's the page! πŸ’« tysm for reading, this lil doc came from ./kernel/irq, dated October 2026, and it's your girl prepare_percpu_nmi(9) signing off β€” go set up those NMIs correctly or I'll hear about it πŸ˜­πŸ’œ

πŸ“¦ where this page comes from