smp_text_poke_batch_finish(9)
π smp_text_poke_batch_finish(9) π
okay bestie, welcome to the Kernel API Manual entry for smp_text_poke_batch_finish(9) β itβs giving βfinish the live-kernel instruction-patching batch on SMPβ energy, and honestly? iconic. π«Άβ¨
πΈ NAME πΈ
<pink>smp_text_poke_batch_finish</pink> β update instructions on live kernel on SMP. π
π SYNOPSIS π
void smp_text_poke_batch_finish (void );
π ARGUMENTS π
voidβ no arguments. literally none, bestie. π«Ά
π¦ DESCRIPTION π¦
Input state, so you know what weβre working with:
text_poke_array.vecβ vector of instructions to patch.text_poke_array.nr_entriesβ number of entries in the vector.
This function modifies multi-byte instructions by using INT3 breakpoints on SMP. We completely avoid using stop_machine here, and achieve the synchronization using INT3 breakpoints and SMP cross-calls. no cap. π₯
The way it is done:
- For each entry in the vector:
- add an
INT3trap to the address that will be patched - SMP sync all CPUs
- add an
- For each entry in the vector:
- update all but the first byte of the patched range
- SMP sync all CPUs
- For each entry in the vector:
- replace the first byte (
INT3) by the first byte of the replacing opcode - SMP sync all CPUs
- replace the first byte (
π₯ SEE ALSO π₯
Kernel file ./arch/x86/kernel/alternative.c β go check out text_poke_early(9), text_poke(9), text_poke_kgdb(9), text_poke_copy(9), text_poke_set(9), smp_text_poke_batch_add(9), and smp_text_poke_single(9). iykyk π
thatβs the whole page, bestie β source/version: ./arch/x86/kernel Β· date: October 2026. mwah πβ¨
π¦ 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