]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/alternatives: Rename 'text_poke_queue()' to 'smp_text_poke_batch_add()'
authorIngo Molnar <mingo@kernel.org>
Fri, 11 Apr 2025 05:40:28 +0000 (07:40 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 11 Apr 2025 09:01:33 +0000 (11:01 +0200)
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
arch/x86/include/asm/text-patching.h
arch/x86/kernel/alternative.c
arch/x86/kernel/ftrace.c
arch/x86/kernel/jump_label.c

index f27d29042f8cfc04b248bb0ef39421ffc4dd251d..f3c9b70afb0c8385c3eae6758f9ac0bca20772c0 100644 (file)
@@ -41,7 +41,7 @@ extern void *text_poke_set(void *addr, int c, size_t len);
 extern int smp_text_poke_int3_handler(struct pt_regs *regs);
 extern void smp_text_poke_single(void *addr, const void *opcode, size_t len, const void *emulate);
 
-extern void text_poke_queue(void *addr, const void *opcode, size_t len, const void *emulate);
+extern void smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate);
 extern void smp_text_poke_batch_finish(void);
 
 #define INT3_INSN_SIZE         1
index 0589c051fe83f920f98fa8a59de5c9f12c4bcaab..6865296920d59956d999d3fd07b1c789830e49aa 100644 (file)
@@ -2871,7 +2871,7 @@ void smp_text_poke_batch_finish(void)
        smp_text_poke_batch_flush(NULL);
 }
 
-void __ref text_poke_queue(void *addr, const void *opcode, size_t len, const void *emulate)
+void __ref smp_text_poke_batch_add(void *addr, const void *opcode, size_t len, const void *emulate)
 {
        struct text_poke_loc *tp;
 
index c35a928364b9d518181bd18982eaa992e8b3f7be..0853ba3fd04aa8f234f09b7ce16eea22922e5509 100644 (file)
@@ -55,7 +55,7 @@ void ftrace_arch_code_modify_post_process(void)
 {
        /*
         * ftrace_make_{call,nop}() may be called during
-        * module load, and we need to finish the text_poke_queue()
+        * module load, and we need to finish the smp_text_poke_batch_add()
         * that they do, here.
         */
        smp_text_poke_batch_finish();
@@ -119,7 +119,7 @@ ftrace_modify_code_direct(unsigned long ip, const char *old_code,
 
        /* replace the text with the new text */
        if (ftrace_poke_late)
-               text_poke_queue((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL);
+               smp_text_poke_batch_add((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL);
        else
                text_poke_early((void *)ip, new_code, MCOUNT_INSN_SIZE);
        return 0;
@@ -247,7 +247,7 @@ void ftrace_replace_code(int enable)
                        break;
                }
 
-               text_poke_queue((void *)rec->ip, new, MCOUNT_INSN_SIZE, NULL);
+               smp_text_poke_batch_add((void *)rec->ip, new, MCOUNT_INSN_SIZE, NULL);
                ftrace_update_record(rec, enable);
        }
        smp_text_poke_batch_finish();
index 28be6eb6cb3dd4ed5714904eb3917e740000384e..a7949a54a0ffb186232ba7ffc3dd33e1dcf8cede 100644 (file)
@@ -135,7 +135,7 @@ bool arch_jump_label_transform_queue(struct jump_entry *entry,
 
        mutex_lock(&text_mutex);
        jlp = __jump_label_patch(entry, type);
-       text_poke_queue((void *)jump_entry_code(entry), jlp.code, jlp.size, NULL);
+       smp_text_poke_batch_add((void *)jump_entry_code(entry), jlp.code, jlp.size, NULL);
        mutex_unlock(&text_mutex);
        return true;
 }