smp_text_poke_batch_finish(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 INT3 trap to the address that will be patched
    • SMP sync all CPUs
  • 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

πŸ”₯ 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