From nobody Mon Feb 9 06:25:37 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 --- 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