From nobody Sat Feb 7 06:13:50 2026 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6868339855 for ; Mon, 22 Dec 2025 20:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434452; cv=none; b=L7nM3omcI1Toc2j50SWoyzPoc7bYMtyrD2myfdmutNoSKXVT0RMmbgxhFKtdHi7LNhnYgxGjmIsLBY6X2/HTY+R1hiN3AhR6RFYwabYDCMrbJOKnWVMpXWOyV81jtWieDqOJiikXrTK6JrNh7o8n94jwdVIqv8Vltz/71IRWpRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434452; c=relaxed/simple; bh=Pz2I4zawA6T3/Om1fTAF7nPVngGvZ2LQ79Ck0d3hwUE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=RwgpHHxpQx1sJS3NCLbCWTXmfMTnj2PJn4WoasKCkE8j3jCFWndADajxuA19RydjZotGYrsCg68qrspoL/sP2UH8SIDlvpaI4a0WjL9E3Chgi0+IwesDivQK1XwwxdTbUl2ridhaGTV5JRYfQofJk8dg8GXy0Z4d5AoXj+n7y6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tCSUd19R; arc=none smtp.client-ip=209.85.222.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tCSUd19R" Received: by mail-qk1-f201.google.com with SMTP id af79cd13be357-8b2de6600c0so1105290085a.1 for ; Mon, 22 Dec 2025 12:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766434450; x=1767039250; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9v/BvE4gdEcBJVpSeZvgTpqOO9wT/iCYZlNytrlEoRI=; b=tCSUd19RIE8qH5FRUUy4iJ0itF/IuZFtY5QXy85VgZbzqDZWNFc73ptb4V90YqVD45 5bqKjLRor1BaWaJmOk4oghMn75iwla+CibRuqTi1FVxig+CVYljuvVCBJnUuofnh769t 2F/Cbl5lt8CwFxNsAeubdekGACZzFGupDOXVpIVlT4eSPVkJjudUPMAqqsv+JFeH9yD+ 48WnbEfQPFRVYXQLc/DlYu88XZ4wofidcOuvdEIRwTlPOOExriIeUqhvBcoSeW/Kvt4V yMXzxJc7RSm0AoHtwuiBcQ5uNeGkcNMbh7cegnoFE3hOtDK2NDcakrpBC4Ij2o3llezV Xmew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766434450; x=1767039250; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9v/BvE4gdEcBJVpSeZvgTpqOO9wT/iCYZlNytrlEoRI=; b=Vg8Mzpy4PotMBHQXDGE8aX/EukKrDQKMIpporrq6vIeV0V6Mfczfd2n10Lf13dAgI+ 2pY45Tfl6W/D3RkQEEwXYWJrLyuPorH43xSqkU62UDCoUIcEtmhqJkbCne5dKjnFi8Dj A98EARO2+GWyP8cr5i6VfKsJUDVjo1msYaG3F77fsHiWa+v8UT3zhmTUPpHVO6E5/GIU GKq2JMs/vT7z9szpN/gP5x/zm2fKE1HHUXe9XxAqXG/uxS93M+MTtM0NpVhl0aXkol6D 5m3LSl8HNkYeC8wtrEHYSyoghGabQNl0Pou7Y2S8G+P/4Hv9wLzJWLC6oV+QcTGDO0FN 7o1A== X-Gm-Message-State: AOJu0Yy8lcjh6edS/SViHUr8NodABRHNXgezGLfXEDM3WYKM1kjwcJwl B8RIEwaBNdvrN9yHXfq7m2Jo3k62KN6nluqw7kkz8HpAV+5/yONVxwREejyinRT2qL6n/0pdM6H 9eKVE0LBM7dqzPg== X-Google-Smtp-Source: AGHT+IFm8Y8nLu0MFvmToYnhaT57dlp2NrwzignjBOGoax/uIgybE8soD6UjwGXP1dsO+6pGrG26w1EWU2MDWQ== X-Received: from qknpa47.prod.google.com ([2002:a05:620a:832f:b0:8b2:e5f1:71c4]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:4009:b0:8b2:e17a:2a with SMTP id af79cd13be357-8c08f651200mr1920146785a.10.1766434449519; Mon, 22 Dec 2025 12:14:09 -0800 (PST) Date: Mon, 22 Dec 2025 20:14:04 +0000 In-Reply-To: <20251222201406.3725665-1-edumazet@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251222201406.3725665-1-edumazet@google.com> X-Mailer: git-send-email 2.52.0.351.gbe84eed79e-goog Message-ID: <20251222201406.3725665-2-edumazet@google.com> Subject: [PATCH 1/3] x86/smp: Use static_call for arch_send_call_function_single_ipi() From: Eric Dumazet To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , x86@kernel.org, "H . Peter Anvin" Cc: linux-kernel , Eric Dumazet , Eric Dumazet Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use static_call to avoid an indirect call, especially expensive with retpoline. Signed-off-by: Eric Dumazet Acked-by: Peter Zijlstra (Intel) --- 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 84951572ab8170578ca5c4a3437c66e9809f34c2..891a5d16bcd52d2da0b71d928d3= 728afe3d15ade 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -4,6 +4,7 @@ #ifndef __ASSEMBLER__ #include #include +#include =20 #include =20 @@ -42,6 +43,12 @@ struct smp_ops { void (*send_call_func_single_ipi)(int cpu); }; =20 +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); =20 @@ -92,7 +99,7 @@ static inline void arch_smp_send_reschedule(int cpu) =20 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); } =20 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); =20 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); =20 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 b014e6d229f9519add6f3fb315f1a2f375675a50..2c8fdf1f59d953e49a6beeba8f7= 6f5fe62bd5db7 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -300,6 +300,16 @@ struct smp_ops smp_ops =3D { }; EXPORT_SYMBOL_GPL(smp_ops); =20 +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 =3D cpu_smt_control; diff --git a/arch/x86/xen/smp_hvm.c b/arch/x86/xen/smp_hvm.c index 485c1d8804f739fbbb7980c98ed56eab59ad8b37..5ea0f53e4ea3f6cd4ad24fedbe2= ef28d2dc444b9 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 =3D xen_smp_send_reschedule; smp_ops.send_call_func_ipi =3D xen_smp_send_call_function_ipi; smp_ops.send_call_func_single_ipi =3D xen_smp_send_call_function_single_i= pi; + x86_smp_ops_static_call_update(); } diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c index 9bb8ff8bff30a6d13a186609e40346203d4feb25..91f9d6854f7448bd1ffcb4e1946= 15ce6336827bb 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 =3D= { void __init xen_smp_init(void) { smp_ops =3D xen_smp_ops; + x86_smp_ops_static_call_update(); =20 /* Avoid searching for BIOS MP tables */ x86_init.mpparse.find_mptable =3D x86_init_noop; --=20 2.52.0.351.gbe84eed79e-goog From nobody Sat Feb 7 06:13:50 2026 Received: from mail-qk1-f202.google.com (mail-qk1-f202.google.com [209.85.222.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E45133E36B for ; Mon, 22 Dec 2025 20:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434453; cv=none; b=gXCjcOUze41/7D5ws19ZyojrqWbfWH/3sAlokplcgMMSPToVkiIKSep1KQsZ0Os/wsKNfdoSm1zH+cdJg/Lr+5KK6fS7gUrvxiETErIGeC4V1sBJNj+GKrBtmVIr0/zt8m4+imJW4vcsOGy8e4nf4FUiOM3TVAGVrd51gXgG17A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434453; c=relaxed/simple; bh=1wWFtK1j5aLC/dB+3nuUFA7j6RKxCmUAp/cdUTU8g00=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DtExamwlYoICFImx+NEz4ggS3fV+py3UjxJbDCorwTmfGaOr/11ECfWWciNEH4A2d/qzjNd2YDj/zm+Nyojj9JJtsYjV3rbMqPfjUOKpCQv6y75Qh6+2nPBFbxQYQWvlZpe6fGhdDOMN4nLeXYgxo4j2+Mzt+lQT8f0gFmZhs4U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=SXGzRd3C; arc=none smtp.client-ip=209.85.222.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SXGzRd3C" Received: by mail-qk1-f202.google.com with SMTP id af79cd13be357-8b4f267ba01so1382106785a.1 for ; Mon, 22 Dec 2025 12:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766434451; x=1767039251; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NNLZsYtyn59Fe1j676r7hqi4cnMKzJGrgkFXHjC+jqQ=; b=SXGzRd3CRtPmtDEvWQlrQDlyeCg+5UUCRvcAjw8UHyz0Z5DBpTlZZyr+UCfRtgyB/S ZFycEd6bXZeUyD+iaLK+ANb+tr0z4bmfzEy0B+X5B8v15uMn3hFykuDQcabXcLob0Jkd 5YlLck4uLVmwx6Nbl73jK49sDN3VDoNsft69Dc7aPjV0s/RMDLExrzUcVB9xG5aczigd U2x/8Ra0dcjO/mChRubQV1cMGBPYJz9YBzhyVSaS6pBBXQjvZMrcIEz3GYl4LevyA9YK uQsQgCUUAbvxhSOYzMlU9vhwmk5jcqu0wrWfwCQ2m3okWrjNtX5Ec2KJG4Y+9rju2/1Z LhbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766434451; x=1767039251; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NNLZsYtyn59Fe1j676r7hqi4cnMKzJGrgkFXHjC+jqQ=; b=OKfztzOtfoeHQ5DvdNCU78gvlTyIGhAFKjNGGy7YRgZaM7SAM3mLWo6zymUvUaZ6WK srLsgpzhk8agd6vOR2z11dpU5FypOrNEEC8YICR71lzB+kHgU3yBuNE7/IlxmvT6Hwhw ij7dFJ/Di6lFhEB0EoS8xh8lhcuhyXYL2zE3PO4WFzy3626ivG2Mgbf7qZgW3inO448O xe4vxRZcy9WVsyfH7vCZibF64YEzMh82flm3a9fcBpIVVA0YNp3/tkFgfCbxrBjq1n/o B2PrGMK5AOIB0EovXuAjd8KcDkzv4dj3OjzFmu6DfEtYL/m/qtrrGV5H0DaU3/lHamI+ 5V3g== X-Gm-Message-State: AOJu0YzTnNZHK5NEbFbLqsfyfjEqf+6F0Tdtqk1m8rJVfRlrJ+gSpj4+ R4ASSwxen7nHNr8WWWYip2mBtoIQTUm6fCgx+eBb7b1/45wtug1Fpa/JQBZ0EZJWKQigYZWKzOz /lmcvJwZZzUMOJA== X-Google-Smtp-Source: AGHT+IH1rjTuxCsxYG6D9mVu3Pg5pO/mB4IDxtX3s8AO6yhcPfzoklII5O0bgKFOurU0kcg+8qZHn9hQHHcLNA== X-Received: from qke7.prod.google.com ([2002:a05:620a:a107:b0:854:410d:7139]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:4055:b0:8b2:eb79:d37d with SMTP id af79cd13be357-8c08fc00228mr1664984385a.4.1766434451091; Mon, 22 Dec 2025 12:14:11 -0800 (PST) Date: Mon, 22 Dec 2025 20:14:05 +0000 In-Reply-To: <20251222201406.3725665-1-edumazet@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251222201406.3725665-1-edumazet@google.com> X-Mailer: git-send-email 2.52.0.351.gbe84eed79e-goog Message-ID: <20251222201406.3725665-3-edumazet@google.com> Subject: [PATCH 2/3] x86/smp: Use static_call for arch_smp_send_reschedule() From: Eric Dumazet To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , x86@kernel.org, "H . Peter Anvin" Cc: linux-kernel , Eric Dumazet , Eric Dumazet Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use static_call to avoid an indirect call, especially expensive with retpoline. Signed-off-by: Eric Dumazet Acked-by: Peter Zijlstra (Intel) --- 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..3b3ff77706fb72c18e66fc1785b= 21896d32c9ac9 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); =20 +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); =20 @@ -94,7 +98,7 @@ static inline void __noreturn play_dead(void) =20 static inline void arch_smp_send_reschedule(int cpu) { - smp_ops.smp_send_reschedule(cpu); + static_call(x86_smp_send_reschedule)(cpu); } =20 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); =20 -void native_smp_send_reschedule(int cpu); void native_send_call_func_ipi(const struct cpumask *mask); =20 asmlinkage __visible void smp_reboot_interrupt(void); diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 2c8fdf1f59d953e49a6beeba8f76f5fe62bd5db7..6e25a86f67faf0a30e9b4920b1d= 4634aa9c64de7 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -302,11 +302,16 @@ EXPORT_SYMBOL_GPL(smp_ops); =20 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); =20 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); =20 --=20 2.52.0.351.gbe84eed79e-goog From nobody Sat Feb 7 06:13:50 2026 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C12512C029D for ; Mon, 22 Dec 2025 20:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434455; cv=none; b=O308mud7VWPiig8KcQ44F9hANTZot7X5tpWvT75igDKfrYxbzTNhf3RSVZgTKZKvhM04uvk9df+u0Mw8b45T0H6AFkKZW9gfwfT1eWa47FWih6tx0PCUdDAjej2V36O5hWzCjUsn0B80yZiFYN4yfhhdseTNF1iZZHPbMmJaFn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766434455; c=relaxed/simple; bh=CCVJzFEW6xA7kbkvdZ2E5i3t1uh7d9Oayiz74009RZI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YHHFgVCUt1maU3nkfuJZYMUo5j/XqKDywhe5Iu/M6Z3YEzJ2dvdZFG/LujTlAGhOodWfAwpM0KHV8seVjHwqinoWqrAWhmZygp3jvKK2y2++XStUr4c6iOXvH3HYE48ypNGFfsOrhCr+LtN1x15sdG+L0vnrdzpIKnEAcVh4vZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=WA+ZesMH; arc=none smtp.client-ip=209.85.222.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WA+ZesMH" Received: by mail-qk1-f201.google.com with SMTP id af79cd13be357-8b4f267ba01so1382111585a.1 for ; Mon, 22 Dec 2025 12:14:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766434453; x=1767039253; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=v5B1QdmI51HIWwW19iiLWw/ZyehdevVLRgA3RKPJXS4=; b=WA+ZesMHGAs+aaruOtqV55/ejF0SeALCIO/kSDnz3zGb07rk0EVEbo2b25piZ81hzv 13/+X1AHK3o1Nf6qZJ1TgHhDYQkWFXqtxjpFfB2tS+T0WPANIrFH48S8zY6L/HNE2NXM cPTAJvgjIBGuP3ctq2G7QYS3JyCii3NT/UrygdG7nP9J0ahVIwpwAJDA5AyBJlAhCoeb Ni0wrWr9mtw+Zkc3gwUBOEGvW6L1AYEJh0zBT7DH2I1YiGVMkcdmkgDCcHWjMf9MmXc+ fBsU75E0ywW+1IfqqcOC6OWiarnlMH9HFMqX7wbY0WG6TETTgSE9DlJiEFI6uD8YaJ0l 0hvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766434453; x=1767039253; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v5B1QdmI51HIWwW19iiLWw/ZyehdevVLRgA3RKPJXS4=; b=wJz9VKkC85VGoB55W8PI4gIgRgWKmLCjRrRXpa7OEUCF6IHPg/1Rt1Ss7ZN5EFxhXN laPOXfYva9D5V+4VbZm+E1GwK8yDGviEsY8yZHnc4+sXexDUg4dbATvxaZLAeYGGQick cbvYs+/Rkjv4RTD01rnd/JZFtO+ycvPVRSHdIyg5VKegfnPHRJXTG6ooNCa2+GVP+d+J FFTeT16tIjCwPE0QCueMiM/B7sFY+T01N9Sd/RiJIXCXgXM16lO/Oyw5OgXR//O4UILN u33BrSNVhG6Q+YR93kMePn/EoC0674gVhLZ1vPjG6oSfJP1ea8uK4WEJ7QRGr9qi7Nht 1D9Q== X-Gm-Message-State: AOJu0YwR2xWTRACj9h2g4Z46400IdwLtlQUmuvVFfeJn6tTGEzcGk5ER HFMqDc31uo0Yo3pm8IZeJbZHDKRyp/Jjdhr2M3XIN2xuOSpW2IP3lV5prGSczLy3iOWviUQIvy1 5A68ZX748fRyklw== X-Google-Smtp-Source: AGHT+IEB966ax1MjbEDnivK/A6OUPr1fRsCrgWDsd9AWsI+G2WB6OdSvynFbPwDswICPHG9oki7j/KP8fmJcfQ== X-Received: from qkas9.prod.google.com ([2002:a05:620a:ab09:b0:8b2:e324:e0c7]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:1999:b0:8b2:e5da:d312 with SMTP id af79cd13be357-8c0906f765dmr2148068585a.39.1766434452592; Mon, 22 Dec 2025 12:14:12 -0800 (PST) Date: Mon, 22 Dec 2025 20:14:06 +0000 In-Reply-To: <20251222201406.3725665-1-edumazet@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251222201406.3725665-1-edumazet@google.com> X-Mailer: git-send-email 2.52.0.351.gbe84eed79e-goog Message-ID: <20251222201406.3725665-4-edumazet@google.com> Subject: [PATCH 3/3] x86/smp: Use static_call for arch_send_call_function_ipi() From: Eric Dumazet To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , x86@kernel.org, "H . Peter Anvin" Cc: linux-kernel , Eric Dumazet , Eric Dumazet Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use static_call to avoid an indirect call, especially expensive with retpoline. Signed-off-by: Eric Dumazet Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/smp.h | 6 ++++-- arch/x86/kernel/smp.c | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 3b3ff77706fb72c18e66fc1785b21896d32c9ac9..f7305c492e6d5b724b0ee3d983a= c1ebf45696294 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -49,6 +49,9 @@ void native_send_call_func_single_ipi(int cpu); DECLARE_STATIC_CALL(x86_send_call_func_single_ipi, native_send_call_func_single_ipi); =20 +void native_send_call_func_ipi(const struct cpumask *mask); +DECLARE_STATIC_CALL(x86_send_call_func_ipi, native_send_call_func_ipi); + void native_smp_send_reschedule(int cpu); DECLARE_STATIC_CALL(x86_smp_send_reschedule, native_smp_send_reschedule); @@ -108,7 +111,7 @@ static inline void arch_send_call_function_single_ipi(i= nt cpu) =20 static inline void arch_send_call_function_ipi_mask(const struct cpumask *= mask) { - smp_ops.send_call_func_ipi(mask); + static_call(x86_send_call_func_ipi)(mask); } =20 void cpu_disable_common(void); @@ -131,7 +134,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); =20 -void native_send_call_func_ipi(const struct cpumask *mask); =20 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 6e25a86f67faf0a30e9b4920b1d4634aa9c64de7..4633ade879938eabfa424d36e78= 35cf3a7192d6a 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -302,6 +302,8 @@ EXPORT_SYMBOL_GPL(smp_ops); =20 DEFINE_STATIC_CALL(x86_send_call_func_single_ipi, native_send_call_func_single_ipi); +DEFINE_STATIC_CALL(x86_send_call_func_ipi, + native_send_call_func_ipi); DEFINE_STATIC_CALL(x86_smp_send_reschedule, native_smp_send_reschedule); EXPORT_STATIC_CALL(x86_smp_send_reschedule); @@ -310,6 +312,8 @@ 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_send_call_func_ipi, + smp_ops.send_call_func_ipi); static_call_update(x86_smp_send_reschedule, smp_ops.smp_send_reschedule); } --=20 2.52.0.351.gbe84eed79e-goog