]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/alternatives: Rename 'apply_relocation()' to 'text_poke_apply_relocation()'
authorIngo Molnar <mingo@kernel.org>
Fri, 11 Apr 2025 05:41:03 +0000 (07:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 11 Apr 2025 09:01:35 +0000 (11:01 +0200)
Join the text_poke_*() API namespace.

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-52-mingo@kernel.org
arch/x86/include/asm/text-patching.h
arch/x86/kernel/alternative.c
arch/x86/kernel/callthunks.c

index a45ac8a223f3c1e8abe4c88743fd4110c010bb4d..5337f1be18f6e43687580ea1204fb0b102e17485 100644 (file)
@@ -15,7 +15,7 @@
 
 extern void text_poke_early(void *addr, const void *opcode, size_t len);
 
-extern void apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len);
+extern void text_poke_apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len);
 
 /*
  * Clear and restore the kernel write-protection flag on the local CPU.
index 9ee6f879bce5c5eea5ec3c005e99e9ca78b56e87..231b2acbe3601140eac99f5e2f730d1a100223db 100644 (file)
@@ -340,7 +340,7 @@ static void __apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen,
        }
 }
 
-void apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len)
+void text_poke_apply_relocation(u8 *buf, const u8 * const instr, size_t instrlen, u8 *repl, size_t repl_len)
 {
        __apply_relocation(buf, instr, instrlen, repl, repl_len);
        optimize_nops(instr, buf, instrlen);
@@ -496,7 +496,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start,
                for (; insn_buff_sz < a->instrlen; insn_buff_sz++)
                        insn_buff[insn_buff_sz] = 0x90;
 
-               apply_relocation(insn_buff, instr, a->instrlen, replacement, a->replacementlen);
+               text_poke_apply_relocation(insn_buff, instr, a->instrlen, replacement, a->replacementlen);
 
                DUMP_BYTES(ALT, instr, a->instrlen, "%px:   old_insn: ", instr);
                DUMP_BYTES(ALT, replacement, a->replacementlen, "%px:   rpl_insn: ", replacement);
@@ -1981,7 +1981,7 @@ __visible noinline void __init __alt_reloc_selftest(void *arg)
 static noinline void __init alt_reloc_selftest(void)
 {
        /*
-        * Tests apply_relocation().
+        * Tests text_poke_apply_relocation().
         *
         * This has a relative immediate (CALL) in a place other than the first
         * instruction and additionally on x86_64 we get a RIP-relative LEA:
index d86d7d6e750ccaf2584eead7177574f4b88f7cab..a951333c5995d5d3c1133296497cf28ce72f0bda 100644 (file)
@@ -185,7 +185,7 @@ static void *patch_dest(void *dest, bool direct)
        u8 *pad = dest - tsize;
 
        memcpy(insn_buff, skl_call_thunk_template, tsize);
-       apply_relocation(insn_buff, pad, tsize, skl_call_thunk_template, tsize);
+       text_poke_apply_relocation(insn_buff, pad, tsize, skl_call_thunk_template, tsize);
 
        /* Already patched? */
        if (!bcmp(pad, insn_buff, tsize))
@@ -294,7 +294,7 @@ static bool is_callthunk(void *addr)
        pad = (void *)(dest - tmpl_size);
 
        memcpy(insn_buff, skl_call_thunk_template, tmpl_size);
-       apply_relocation(insn_buff, pad, tmpl_size, skl_call_thunk_template, tmpl_size);
+       text_poke_apply_relocation(insn_buff, pad, tmpl_size, skl_call_thunk_template, tmpl_size);
 
        return !bcmp(pad, insn_buff, tmpl_size);
 }
@@ -312,7 +312,7 @@ int x86_call_depth_emit_accounting(u8 **pprog, void *func, void *ip)
                return 0;
 
        memcpy(insn_buff, skl_call_thunk_template, tmpl_size);
-       apply_relocation(insn_buff, ip, tmpl_size, skl_call_thunk_template, tmpl_size);
+       text_poke_apply_relocation(insn_buff, ip, tmpl_size, skl_call_thunk_template, tmpl_size);
 
        memcpy(*pprog, insn_buff, tmpl_size);
        *pprog += tmpl_size;