[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176859852127.510.14673879450025915501.tip-bot2@tip-bot2>
Date: Fri, 16 Jan 2026 21:22:01 -0000
From: "tip-bot2 for Eric Dumazet" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Eric Dumazet <edumazet@...gle.com>, "Borislav Petkov (AMD)" <bp@...en8.de>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/core] x86/smp: Use static_call for
arch_send_call_function_single_ipi()
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 7c76769ce0d985597c189ff9a6194e3151396ee7
Gitweb: https://git.kernel.org/tip/7c76769ce0d985597c189ff9a6194e3151396ee7
Author: Eric Dumazet <edumazet@...gle.com>
AuthorDate: Mon, 22 Dec 2025 20:14:04
Committer: Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Fri, 16 Jan 2026 20:26:52 +01:00
x86/smp: Use static_call for arch_send_call_function_single_ipi()
Use static_call to avoid an indirect call, especially expensive
with retpoline.
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://patch.msgid.link/20251222201406.3725665-2-edumazet@google.com
---
arch/x86/include/asm/smp.h | 10 ++++++++--
arch/x86/kernel/smp.c | 10 ++++++++++
arch/x86/xen/smp_hvm.c | 1 +
arch/x86/xen/smp_pv.c | 1 +
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 8495157..891a5d1 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -4,6 +4,7 @@
#ifndef __ASSEMBLER__
#include <linux/cpumask.h>
#include <linux/thread_info.h>
+#include <linux/static_call_types.h>
#include <asm/cpumask.h>
@@ -42,6 +43,12 @@ struct smp_ops {
void (*send_call_func_single_ipi)(int cpu);
};
+void x86_smp_ops_static_call_update(void);
+
+void native_send_call_func_single_ipi(int cpu);
+DECLARE_STATIC_CALL(x86_send_call_func_single_ipi,
+ native_send_call_func_single_ipi);
+
/* Globals due to paravirt */
extern void set_cpu_sibling_map(int cpu);
@@ -92,7 +99,7 @@ static inline void arch_smp_send_reschedule(int cpu)
static inline void arch_send_call_function_single_ipi(int cpu)
{
- smp_ops.send_call_func_single_ipi(cpu);
+ static_call(x86_send_call_func_single_ipi)(cpu);
}
static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
@@ -122,7 +129,6 @@ void __noreturn mwait_play_dead(unsigned int eax_hint);
void native_smp_send_reschedule(int cpu);
void native_send_call_func_ipi(const struct cpumask *mask);
-void native_send_call_func_single_ipi(int cpu);
asmlinkage __visible void smp_reboot_interrupt(void);
__visible void smp_reschedule_interrupt(struct pt_regs *regs);
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index b014e6d..2c8fdf1 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -300,6 +300,16 @@ struct smp_ops smp_ops = {
};
EXPORT_SYMBOL_GPL(smp_ops);
+DEFINE_STATIC_CALL(x86_send_call_func_single_ipi,
+ native_send_call_func_single_ipi);
+
+void x86_smp_ops_static_call_update(void)
+{
+ static_call_update(x86_send_call_func_single_ipi,
+ smp_ops.send_call_func_single_ipi);
+}
+EXPORT_SYMBOL_GPL(x86_smp_ops_static_call_update);
+
int arch_cpu_rescan_dead_smt_siblings(void)
{
enum cpuhp_smt_control old = cpu_smt_control;
diff --git a/arch/x86/xen/smp_hvm.c b/arch/x86/xen/smp_hvm.c
index 485c1d8..5ea0f53 100644
--- a/arch/x86/xen/smp_hvm.c
+++ b/arch/x86/xen/smp_hvm.c
@@ -85,4 +85,5 @@ void __init xen_hvm_smp_init(void)
smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
+ x86_smp_ops_static_call_update();
}
diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c
index 9bb8ff8..91f9d68 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -442,6 +442,7 @@ static const struct smp_ops xen_smp_ops __initconst = {
void __init xen_smp_init(void)
{
smp_ops = xen_smp_ops;
+ x86_smp_ops_static_call_update();
/* Avoid searching for BIOS MP tables */
x86_init.mpparse.find_mptable = x86_init_noop;
Powered by blists - more mailing lists