[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251013143444.3999-22-david.kaplan@amd.com>
Date: Mon, 13 Oct 2025 09:34:09 -0500
From: David Kaplan <david.kaplan@....com>
To: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, Ingo Molnar
<mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
<x86@...nel.org>, "H . Peter Anvin" <hpa@...or.com>
CC: Alexander Graf <graf@...zon.com>, Boris Ostrovsky
<boris.ostrovsky@...cle.com>, <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH 21/56] x86/callthunks: Move logic out of .init
With dynamic re-patching, these functions may be called at runtime so
move them out of the .init section.
Signed-off-by: David Kaplan <david.kaplan@....com>
---
arch/x86/kernel/callthunks.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c
index a951333c5995..758e655f36a8 100644
--- a/arch/x86/kernel/callthunks.c
+++ b/arch/x86/kernel/callthunks.c
@@ -56,7 +56,7 @@ struct core_text {
const char *name;
};
-static bool thunks_initialized __ro_after_init;
+static bool thunks_initialized;
static const struct core_text builtin_coretext = {
.base = (unsigned long)_text,
@@ -151,7 +151,7 @@ static bool skip_addr(void *dest)
return false;
}
-static __init_or_module void *call_get_dest(void *addr)
+static void *call_get_dest(void *addr)
{
struct insn insn;
void *dest;
@@ -204,7 +204,7 @@ static void *patch_dest(void *dest, bool direct)
return pad;
}
-static __init_or_module void patch_call(void *addr, const struct core_text *ct)
+static void patch_call(void *addr, const struct core_text *ct)
{
void *pad, *dest;
u8 bytes[8];
@@ -229,7 +229,7 @@ static __init_or_module void patch_call(void *addr, const struct core_text *ct)
text_poke_early(addr, bytes, CALL_INSN_SIZE);
}
-static __init_or_module void
+static void
patch_call_sites(s32 *start, s32 *end, const struct core_text *ct)
{
s32 *s;
@@ -238,7 +238,7 @@ patch_call_sites(s32 *start, s32 *end, const struct core_text *ct)
patch_call((void *)s + *s, ct);
}
-static __init_or_module void
+static void
callthunks_setup(struct callthunk_sites *cs, const struct core_text *ct)
{
prdbg("Patching call sites %s\n", ct->name);
@@ -246,7 +246,7 @@ callthunks_setup(struct callthunk_sites *cs, const struct core_text *ct)
prdbg("Patching call sites done%s\n", ct->name);
}
-void __init callthunks_patch_builtin_calls(void)
+void callthunks_patch_builtin_calls(void)
{
struct callthunk_sites cs = {
.call_start = __call_sites,
--
2.34.1
Powered by blists - more mailing lists