Commit d42a2a89 authored by Borislav Petkov (AMD)'s avatar Borislav Petkov (AMD)

x86/alternatives: Fix section mismatch warnings

Fix stuff like:

  WARNING: modpost: vmlinux.o: section mismatch in reference: \
  __optimize_nops (section: .text) -> debug_alternative (section: .init.data)
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230513160146.16039-1-bp@alien8.de
parent d2408e04
...@@ -193,8 +193,8 @@ static int skip_nops(u8 *instr, int offset, int len) ...@@ -193,8 +193,8 @@ static int skip_nops(u8 *instr, int offset, int len)
* Optimize a sequence of NOPs, possibly preceded by an unconditional jump * Optimize a sequence of NOPs, possibly preceded by an unconditional jump
* to the end of the NOP sequence into a single NOP. * to the end of the NOP sequence into a single NOP.
*/ */
static bool __optimize_nops(u8 *instr, size_t len, struct insn *insn, static bool __init_or_module
int *next, int *prev, int *target) __optimize_nops(u8 *instr, size_t len, struct insn *insn, int *next, int *prev, int *target)
{ {
int i = *next - insn->length; int i = *next - insn->length;
...@@ -765,7 +765,7 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) { } ...@@ -765,7 +765,7 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
#ifdef CONFIG_X86_KERNEL_IBT #ifdef CONFIG_X86_KERNEL_IBT
static void poison_endbr(void *addr, bool warn) static void __init_or_module poison_endbr(void *addr, bool warn)
{ {
u32 endbr, poison = gen_endbr_poison(); u32 endbr, poison = gen_endbr_poison();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment