Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/alternatives: Rename 'text_poke_queue()' to 'smp_text_poke_batch_add()'

This name is actively confusing as well, because the simple text_poke*()
APIs use MM-switching based code patching, while text_poke_queue()
is part of the INT3 based text_poke_int3_*() machinery that is an
additional layer of functionality on top of regular text_poke*() functionality.

Rename it to smp_text_poke_batch_add() to make it clear which layer
it belongs to.

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: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250411054105.2341982-17-mingo@kernel.org

Ingo Molnar 732c7c33 e8d7b8c2

+6 -6
+1 -1
arch/x86/include/asm/text-patching.h
··· 41 41 extern int smp_text_poke_int3_handler(struct pt_regs *regs); 42 42 extern void smp_text_poke_single(void *addr, const void *opcode, size_t len, const void *emulate); 43 43 44 - extern void text_poke_queue(void *addr, const void *opcode, size_t len, const void *emulate); 44 + extern void smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate); 45 45 extern void smp_text_poke_batch_finish(void); 46 46 47 47 #define INT3_INSN_SIZE 1
+1 -1
arch/x86/kernel/alternative.c
··· 2871 2871 smp_text_poke_batch_flush(NULL); 2872 2872 } 2873 2873 2874 - void __ref text_poke_queue(void *addr, const void *opcode, size_t len, const void *emulate) 2874 + void __ref smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate) 2875 2875 { 2876 2876 struct text_poke_loc *tp; 2877 2877
+3 -3
arch/x86/kernel/ftrace.c
··· 55 55 { 56 56 /* 57 57 * ftrace_make_{call,nop}() may be called during 58 - * module load, and we need to finish the text_poke_queue() 58 + * module load, and we need to finish the smp_text_poke_batch_add() 59 59 * that they do, here. 60 60 */ 61 61 smp_text_poke_batch_finish(); ··· 119 119 120 120 /* replace the text with the new text */ 121 121 if (ftrace_poke_late) 122 - text_poke_queue((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL); 122 + smp_text_poke_batch_add((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL); 123 123 else 124 124 text_poke_early((void *)ip, new_code, MCOUNT_INSN_SIZE); 125 125 return 0; ··· 247 247 break; 248 248 } 249 249 250 - text_poke_queue((void *)rec->ip, new, MCOUNT_INSN_SIZE, NULL); 250 + smp_text_poke_batch_add((void *)rec->ip, new, MCOUNT_INSN_SIZE, NULL); 251 251 ftrace_update_record(rec, enable); 252 252 } 253 253 smp_text_poke_batch_finish();
+1 -1
arch/x86/kernel/jump_label.c
··· 135 135 136 136 mutex_lock(&text_mutex); 137 137 jlp = __jump_label_patch(entry, type); 138 - text_poke_queue((void *)jump_entry_code(entry), jlp.code, jlp.size, NULL); 138 + smp_text_poke_batch_add((void *)jump_entry_code(entry), jlp.code, jlp.size, NULL); 139 139 mutex_unlock(&text_mutex); 140 140 return true; 141 141 }