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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <b5e3f1d674af21c1592eab3ce8cc7dc93f9a7dad.1769090885.git.houwenlong.hwl@antgroup.com>
Date: Thu, 22 Jan 2026 22:15:43 +0800
From: Hou Wenlong <houwenlong.hwl@...group.com>
To: linux-kernel@...r.kernel.org
Cc: Hou Wenlong <houwenlong.hwl@...group.com>,
	Thomas Gleixner <tglx@...nel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	Juergen Gross <jgross@...e.com>,
	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	Peter Zijlstra <peterz@...radead.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	K Prateek Nayak <kprateek.nayak@....com>,
	Li Chen <chenl311@...natelecom.cn>,
	Brian Gerst <brgerst@...il.com>,
	Sohil Mehta <sohil.mehta@...el.com>,
	Tim Chen <tim.c.chen@...ux.intel.com>,
	Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>,
	Eric Dumazet <edumazet@...gle.com>,
	xen-devel@...ts.xenproject.org
Subject: [PATCH 1/2] x86/smp: Move the static call update for 'smp_ops' into smp_prepare_boot_cpu()

The commit 1f60230cdc63 ("x86/smp: Use static_call for
arch_send_call_function_ipi()") changed to use a static call for
arch_send_call_function_ipi(), which causes two problems:

First, the KVM guest also changes 'smp_ops.send_call_func_ipi' when the
PV sched yield feature is available. However, the missing
static_call_update() breaks the PV sched yield feature.

Additionally, xen_smp_init() is called before static_call_init() during
the booting of the XENPV guest, which triggers a warning in
__static_call_update().

To simplify, move the static call update for 'smp_ops' into
smp_prepare_boot_cpu() to address these two problems together.

Fixes: 1f60230cdc63 ("x86/smp: Use static_call for arch_send_call_function_ipi()")
Signed-off-by: Hou Wenlong <houwenlong.hwl@...group.com>
---
I'm not sure if the XEN part is okay or not. I think there should be no
IPI before smp_prepare_boot_cpu(), and even if there is, it's okay for
the KVM guest to use the native version before smp_prepare_boot_cpu().
---
 arch/x86/kernel/smpboot.c | 1 +
 arch/x86/xen/smp_hvm.c    | 1 -
 arch/x86/xen/smp_pv.c     | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 5cd6950ab672..84b8a4163ddb 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1088,6 +1088,7 @@ void __init smp_prepare_cpus_common(void)
 
 void __init smp_prepare_boot_cpu(void)
 {
+	x86_smp_ops_static_call_update();
 	smp_ops.smp_prepare_boot_cpu();
 }
 
diff --git a/arch/x86/xen/smp_hvm.c b/arch/x86/xen/smp_hvm.c
index 5ea0f53e4ea3..485c1d8804f7 100644
--- a/arch/x86/xen/smp_hvm.c
+++ b/arch/x86/xen/smp_hvm.c
@@ -85,5 +85,4 @@ 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 72a334b32c32..c40f326f0c3a 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -441,7 +441,6 @@ 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;
-- 
2.31.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ