text_poke_early(9)
π
text_poke_early(9) β straight from the Kernel API Manual β¨
okay bestie, gather round, because this is the little kernel function that updates instructions on a live kernel at boot time π«Ά
πΈ NAME πΈ
text_poke_early β update instructions on a live kernel at boot time π
π SYNOPSIS π
void text_poke_early (void *addr , const void *opcode , size_t len );
π¦ ARGUMENTS π¦
addrβ the address you're modifying, aka the spot getting the glow-up πopcodeβ the source of the copy, the fresh bytes coming in πlenβ length to copy, bestie, how many bytes we're moving β¨
π₯ DESCRIPTION π₯
So here's the vibe check: when you use this code to patch more than one byte of an instruction, you need to make sure that other CPUs cannot execute this code in parallel. No cap. π
Also, no thread must be currently preempted in the middle of these instructions. And on the local CPU, you need to be protected against NMI or MCE handlers seeing an inconsistent instruction while you patch. That part is highkey serious β it's giving "do not skip this" energy π
bestie, this is not a casual little copy-paste situation when you're touching multiple instruction bytes. The safety conditions are literally the whole point π«Ά
π SEE ALSO π
- Kernel file
./arch/x86/kernel/alternative.cβ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)smp_text_poke_single(9)
and that's the whole page, bestie π source/version line says ./arch/x86/kernel, date is October 2026, and the page is text_poke_early(9) β periodt πβ¨
π¦ 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