x86: callthunks: fix incorrect init section references
PATCH 1/1 x86: callthunks: fix incorrect init section references
From: Arnd Bergmann <[email protected]>
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.
--- arch/x86/kernel/callthunks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/callthunks.c +2 -2
@@ -119,7 +119,7 @@ static bool is_coretext(const struct core_text *ct, void *addr)return within_module_coretext (addr); } -static __init_or_module bool skip_addr(void *dest) +static bool skip_addr (void *dest) {if (dest == error_entry)return true;
@@ -181,7 +181,7 @@ static const u8 nops[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, }; -static __init_or_module void *patch_dest(void *dest, bool direct) +static void *patch_dest (void *dest,bool direct) {unsigned int tsize =SKL_TMPL_SIZE ;u8 *pad = dest - tsize;
Signature · 1 line
2.35.1
Quoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The addition of
callthunks_translate_call_destmeans thatskip_addr()andpatch_dest()can no longer be discarded as part of the__initsection freeing:
Quoted 8 lines
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.
SetCONFIG_SECTION_MISMATCH_WARN_ONLY=yto allow them.Fixes b2e9dfe54be4 ("x86/bpf: Emit call depth accounting if required")Signed-off-by Arnd Bergmann <[email protected]>
Thanks!
[tip: x86/urgent] x86/calldepth: Fix incorrect init section references
In reply to Arnd BergmannThe following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: ade8c20847fcc3f4de08b35f730ec04ef29ddbdc Gitweb: https://git.kernel.org/tip/ade8c20847fcc3f4de08b35f730ec04ef29ddbdc Author: Arnd Bergmann <[email protected]> AuthorDate: Thu, 15 Dec 2022 17:43:23 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 27 Dec 2022 12:51:58 +01:00
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.
--- arch/x86/kernel/callthunks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/callthunks.c +2 -2
@@ -119,7 +119,7 @@ static bool is_coretext(const struct core_text *ct, void *addr)return within_module_coretext (addr); } -static __init_or_module bool skip_addr(void *dest) +static bool skip_addr (void *dest) {if (dest == error_entry)return true;
@@ -181,7 +181,7 @@ static const u8 nops[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, }; -static __init_or_module void *patch_dest(void *dest, bool direct) +static void *patch_dest (void *dest,bool direct) {unsigned int tsize =SKL_TMPL_SIZE ;u8 *pad = dest - tsize;