mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
x86/alternatives: Rename 'apply_relocation()' to 'text_poke_apply_relocation()'
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
This commit is contained in:
parent
dac0d75427
commit
023f42dd59
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user