]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/alternatives: Document the text_poke_bp_batch() synchronization rules a bit more
authorPeter Zijlstra <peterz@infradead.org>
Fri, 11 Apr 2025 05:40:14 +0000 (07:40 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 11 Apr 2025 09:01:33 +0000 (11:01 +0200)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20250411054105.2341982-3-mingo@kernel.org
arch/x86/kernel/alternative.c

index 85089c79a828ef66f126e5e2b9b25e57c4fb0933..5f448142aa99372331276e7963715ae5118affdf 100644 (file)
@@ -2751,6 +2751,13 @@ static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries
 
        /*
         * Remove and wait for refs to be zero.
+        *
+        * Notably, if after step-3 above the INT3 got removed, then the
+        * text_poke_sync() will have serialized against any running INT3
+        * handlers and the below spin-wait will not happen.
+        *
+        * IOW. unless the replacement instruction is INT3, this case goes
+        * unused.
         */
        for_each_possible_cpu(i) {
                atomic_t *refs = per_cpu_ptr(&bp_refs, i);