smp_text_poke_single(9)
π smp_text_poke_single β a kernel API manual bestie β¨
okay so this is a page from the Kernel API Manual, and honestly? it's giving "one tiny function that does one wildly specific thing" and I'm kind of obsessed. it's called smp_text_poke_single, and no, it's not about poking anyone on social media β it's about patching instructions in a live kernel on SMP, like, immediately. main character energy fr fr πΈ
β¨ NAME β¨
smp_text_poke_single β update instruction on live kernel on SMP immediately π«
like... literally that. update. instruction. live kernel. SMP. immediately. no cap.
π SYNOPSIS π
void __ref smp_text_poke_single (void *addr , const void *opcode ,
size_t len , const void *emulate );
copy it exactly bestie, don't come for me β that's the whole signature, __ref and all π«Ά
π ARGUMENTS π
addrβ address to patch. yeah. that's the spot you're poking πopcodeβ opcode of new instruction. the fresh new fit the instruction's gonna wear πlenβ length to copy. how many bytes we're moving over, exactly, no more no less π§emulateβ instruction to be emulated. the stand-in that holds it down π¦
π₯ DESCRIPTION π₯
so here's the vibe: this updates a single instruction with the vector in the stack, and it does it while avoiding dynamically allocated memory. yes. no malloc era. we simply don't allocate. β¨
the way that this matters is β you should use this function when it is not possible to allocate memory for a vector. like, memory allocation said no? okay, this function said bet. π
and then, the single instruction is patched in immediately. not later. not eventually. immediately. periodt. π₯
ok real talk though β this is kernel-level instruction patching on a live SMP kernel, so treat it with the respect it deserves. the manpage says exactly what it says and nothing more, and I'm not about to invent extra lore for you. facts only, bestie π
π SEE ALSO π
- Kernel file
./arch/x86/kernel/alternative.cβ that's where the lore lives π text_poke_early(9)text_poke(9)text_poke_kgdb(9)text_poke_copy(9)text_poke_set(9)smp_text_poke_batch_finish(9)smp_text_poke_batch_add(9)
basically the whole poke-iverse, go read them all, iykyk π¦
and that's the whole page, bestie!! this one lives in ./arch/x86/kernel, from the Kernel API Manual, dated October 2026. go forth and patch responsibly ππβ¨
π¦ 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