From: Arnd Bergmann <arnd@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: [PATCH] x86: mark some mpspec inline functions as __init
Date: Thu, 25 Feb 2021 12:22:41 +0100 [thread overview]
Message-ID: <20210225112247.2240389-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
clang-13 sometimes decides to not inline early_get_smp_config(),
which leads to a link-time warning:
WARNING: modpost: vmlinux.o(.text+0x838cc): Section mismatch in reference from the function early_get_smp_config() to the variable .init.data:x86_init
The function early_get_smp_config() references
the variable __initdata x86_init.
This is often because early_get_smp_config lacks a __initdata
annotation or the annotation of x86_init is wrong.
There are two other functions which may run into the same issue,
so mark all three as __init.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/include/asm/mpspec.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index e90ac7e9ae2c..b41066dbf5c2 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -49,17 +49,17 @@ extern int smp_found_config;
# define smp_found_config 0
#endif
-static inline void get_smp_config(void)
+static inline __init void get_smp_config(void)
{
x86_init.mpparse.get_smp_config(0);
}
-static inline void early_get_smp_config(void)
+static inline __init void early_get_smp_config(void)
{
x86_init.mpparse.get_smp_config(1);
}
-static inline void find_smp_config(void)
+static inline __init void find_smp_config(void)
{
x86_init.mpparse.find_smp_config();
}
--
2.29.2
next reply other threads:[~2021-02-25 11:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 11:22 Arnd Bergmann [this message]
2021-02-25 11:45 ` [PATCH] x86: mark some mpspec inline functions as __init Borislav Petkov
2021-02-25 12:18 ` Arnd Bergmann
2021-02-25 12:42 ` Borislav Petkov
2021-02-25 13:20 ` Arnd Bergmann
2021-02-25 20:31 ` Nick Desaulniers
2021-02-25 21:33 ` Borislav Petkov
2021-02-25 21:58 ` Nick Desaulniers
2021-02-25 22:16 ` Arnd Bergmann
2021-02-26 8:13 ` Borislav Petkov
2021-02-26 13:24 ` Arnd Bergmann
2021-02-27 15:11 ` Arnd Bergmann
2021-02-25 22:54 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210225112247.2240389-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox