Skip to content

Commit ade8c20

Browse files
arndbPeter Zijlstra
authored andcommitted
x86/calldepth: Fix incorrect init section references
The addition of callthunks_translate_call_dest means that skip_addr() and patch_dest() can no longer be discarded as part of the __init section freeing: WARNING: modpost: vmlinux.o: section mismatch in reference: callthunks_translate_call_dest.cold (section: .text.unlikely) -> skip_addr (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: callthunks_translate_call_dest.cold (section: .text.unlikely) -> patch_dest (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: is_callthunk.cold (section: .text.unlikely) -> skip_addr (section: .init.text) ERROR: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. Fixes: b2e9dfe ("x86/bpf: Emit call depth accounting if required") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 1b929c0 commit ade8c20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/callthunks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static bool is_coretext(const struct core_text *ct, void *addr)
119119
return within_module_coretext(addr);
120120
}
121121

122-
static __init_or_module bool skip_addr(void *dest)
122+
static bool skip_addr(void *dest)
123123
{
124124
if (dest == error_entry)
125125
return true;
@@ -181,7 +181,7 @@ static const u8 nops[] = {
181181
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
182182
};
183183

184-
static __init_or_module void *patch_dest(void *dest, bool direct)
184+
static void *patch_dest(void *dest, bool direct)
185185
{
186186
unsigned int tsize = SKL_TMPL_SIZE;
187187
u8 *pad = dest - tsize;

0 commit comments

Comments
 (0)