lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251222201406.3725665-3-edumazet@google.com>
Date: Mon, 22 Dec 2025 20:14:05 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, Peter Zijlstra <peterz@...radead.org>, x86@...nel.org, 
	"H . Peter Anvin" <hpa@...or.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>, Eric Dumazet <eric.dumazet@...il.com>, 
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH 2/3] x86/smp: Use static_call for arch_smp_send_reschedule()

Use static_call to avoid an indirect call, especially expensive
with retpoline.

Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
 arch/x86/include/asm/smp.h | 7 +++++--
 arch/x86/kernel/smp.c      | 5 +++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 891a5d16bcd52d2da0b71d928d3728afe3d15ade..3b3ff77706fb72c18e66fc1785b21896d32c9ac9 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -49,6 +49,10 @@ void native_send_call_func_single_ipi(int cpu);
 DECLARE_STATIC_CALL(x86_send_call_func_single_ipi,
 		    native_send_call_func_single_ipi);
 
+void native_smp_send_reschedule(int cpu);
+DECLARE_STATIC_CALL(x86_smp_send_reschedule,
+		    native_smp_send_reschedule);
+
 /* Globals due to paravirt */
 extern void set_cpu_sibling_map(int cpu);
 
@@ -94,7 +98,7 @@ static inline void __noreturn play_dead(void)
 
 static inline void arch_smp_send_reschedule(int cpu)
 {
-	smp_ops.smp_send_reschedule(cpu);
+	static_call(x86_smp_send_reschedule)(cpu);
 }
 
 static inline void arch_send_call_function_single_ipi(int cpu)
@@ -127,7 +131,6 @@ void wbnoinvd_on_cpus_mask(struct cpumask *cpus);
 void smp_kick_mwait_play_dead(void);
 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);
 
 asmlinkage __visible void smp_reboot_interrupt(void);
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 2c8fdf1f59d953e49a6beeba8f76f5fe62bd5db7..6e25a86f67faf0a30e9b4920b1d4634aa9c64de7 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -302,11 +302,16 @@ EXPORT_SYMBOL_GPL(smp_ops);
 
 DEFINE_STATIC_CALL(x86_send_call_func_single_ipi,
 		   native_send_call_func_single_ipi);
+DEFINE_STATIC_CALL(x86_smp_send_reschedule,
+		   native_smp_send_reschedule);
+EXPORT_STATIC_CALL(x86_smp_send_reschedule);
 
 void x86_smp_ops_static_call_update(void)
 {
 	static_call_update(x86_send_call_func_single_ipi,
 			   smp_ops.send_call_func_single_ipi);
+	static_call_update(x86_smp_send_reschedule,
+			   smp_ops.smp_send_reschedule);
 }
 EXPORT_SYMBOL_GPL(x86_smp_ops_static_call_update);
 
-- 
2.52.0.351.gbe84eed79e-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ