text_poke_kgdb(9)
π text_poke_kgdb β like, the kgdb edition of kernel API manual, bestie π«Ά
okay so picture this: it's text_poke_kgdb(9), and she's the one who updates instructions on a live kernel β but only when kgdb is the one driving. main character energy, but make it β¨debuggerβ¨.
πΈ NAME πΈ
text_poke_kgdb β update instructions on a live kernel, but specifically by kgdb π
β¨ SYNOPSIS β¨
void * text_poke_kgdb (void *addr , const void *opcode , size_t len );
like yes, that's the whole vibe. no cap.
π ARGUMENTS π
addrβ the address you're gonna modify, bestie. that's the spot πopcodeβ the source of the copy, i.e. where the bytes come from πlenβ length to copy. how many bytes we're moving, periodt.
π¦ DESCRIPTION π¦
okay so here's the tea β β when you're not doing early patching, the only thing allowed is an atomic text poke/set. literally only atomic. π«Ά
what does that mean in practice, you ask? two things, and they're both non-negotiable:
- the size must be writable atomically β so the byte count has to be something the CPU can slam in one shot π
- the address must be aligned in a way that permits an atomic write β alignment is not optional, she's a whole requirement π
and on top of all that, it also makes sure we fit on a single page. one page. that's the budget. don't go over it π
π₯ CONTEXT π₯
this one's important, so like, listen β this should only be used by kgdb, because kgdb ensures no other core is running. π
and yeah, that's true despite the fact that it does not hold the text_mutex. like, no mutex, no problem, because kgdb already made sure everyone else is sitting down and behaving. iykyk π
fr fr: don't go calling this from anywhere else. it's kgdb's function, and kgdb's function only. π
π SEE ALSO π
- Kernel file
./arch/x86/kernel/alternative.c text_poke_early(9)text_poke(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)
like, the whole poke squad. obsessed. π
and that's the page, bestie π§ β brought to you straight out of ./arch/x86/kernel, dated October 2026, and it's literally called text_poke_kgdb(9). slay, go patch something. π
β¨
π¦ 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