From nobody Sun Feb 8 19:58:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33F74C001DE for ; Wed, 9 Aug 2023 20:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234547AbjHIUgL (ORCPT ); Wed, 9 Aug 2023 16:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234460AbjHIUgG (ORCPT ); Wed, 9 Aug 2023 16:36:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190ADB4; Wed, 9 Aug 2023 13:36:05 -0700 (PDT) Date: Wed, 09 Aug 2023 20:36:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691613363; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkphxmPM5tysB4op+m1B+DDZ6LJglMpAWxW9xITodPE=; b=cn20GOZA+83HgU9xYQDT3T7EPnr99AqNbtGHgR1O24P58uPEn8FjVKmepWsDOkM66c4gCH 8MFeI1m5k+mQaTQof8zTkSE9VzCj5J2h5CmhlC9UV4+ucdTEghxL898WzNCYDCnYNI2GhH jgD2UFvbtfpdlwhFtvN0PAiT1i3l91saiZWt/baBl9p61MDKmkKFw/o4kXqX+++VkEU2DU aMQ6dbwMQZELMAXKhPsZDGwe1Aa0t2JrQSMNgKMLpvWnKv7c2kxARvXSL5rIC8YBuSi5dJ p5hXcYI6EsMhthu3irsLEcwPntNVgXGTFyepbWSpWgSNvry+IFvoyILRSnPO5w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691613363; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IkphxmPM5tysB4op+m1B+DDZ6LJglMpAWxW9xITodPE=; b=iIuM8jOGYgfhiElq7CGBFrQIrVpJfNAb0svdW5+aMiD1gHYqpWpA5Dvjrgu/yq0W7mINTv LrdatQ9mK/QgBvBQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/apic: Turn on static calls Cc: Thomas Gleixner , Dave Hansen , "Peter Zijlstra (Intel)" , Juergen Gross , Michael Kelley , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169161336293.27769.2235554939869573461.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/apic branch of tip: Commit-ID: f8542a55499a69a859c84866b66f0df43933e563 Gitweb: https://git.kernel.org/tip/f8542a55499a69a859c84866b66f0df43= 933e563 Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:04:24 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 12:00:55 -07:00 x86/apic: Turn on static calls Convert all the APIC callback inline wrappers from apic->foo() to static_call(apic_call_foo)(), except for the safe_wait_icr_idle() one which is only used during SMP bringup when sending INIT/SIPI. That really can do the conditional callback. The regular wait_icr_idle() matters as it is used in irq_work_raise(), so X2APIC machines spare the conditional. Signed-off-by: Thomas Gleixner Signed-off-by: Dave Hansen Acked-by: Peter Zijlstra (Intel) Tested-by: Juergen Gross # Xen PV (dom0 and unpriv. guest) Tested-by: Michael Kelley Tested-by: Sohil Mehta --- arch/x86/include/asm/apic.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index ddafd14..5af4ec1 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -394,68 +394,67 @@ DECLARE_APIC_CALL(write); =20 static __always_inline u32 apic_read(u32 reg) { - return apic->read(reg); + return static_call(apic_call_read)(reg); } =20 static __always_inline void apic_write(u32 reg, u32 val) { - apic->write(reg, val); + static_call(apic_call_write)(reg, val); } =20 static __always_inline void apic_eoi(void) { - apic->eoi(); + static_call(apic_call_eoi)(); } =20 static __always_inline void apic_native_eoi(void) { - apic->native_eoi(); + static_call(apic_call_native_eoi)(); } =20 static __always_inline u64 apic_icr_read(void) { - return apic->icr_read(); + return static_call(apic_call_icr_read)(); } =20 static __always_inline void apic_icr_write(u32 low, u32 high) { - apic->icr_write(low, high); + static_call(apic_call_icr_write)(low, high); } =20 static __always_inline void __apic_send_IPI(int cpu, int vector) { - apic->send_IPI(cpu, vector); + static_call(apic_call_send_IPI)(cpu, vector); } =20 static __always_inline void __apic_send_IPI_mask(const struct cpumask *mas= k, int vector) { - apic->send_IPI_mask(mask, vector); + static_call_mod(apic_call_send_IPI_mask)(mask, vector); } =20 static __always_inline void __apic_send_IPI_mask_allbutself(const struct c= pumask *mask, int vector) { - apic->send_IPI_mask_allbutself(mask, vector); + static_call(apic_call_send_IPI_mask_allbutself)(mask, vector); } =20 static __always_inline void __apic_send_IPI_allbutself(int vector) { - apic->send_IPI_allbutself(vector); + static_call(apic_call_send_IPI_allbutself)(vector); } =20 static __always_inline void __apic_send_IPI_all(int vector) { - apic->send_IPI_all(vector); + static_call(apic_call_send_IPI_all)(vector); } =20 static __always_inline void __apic_send_IPI_self(int vector) { - apic->send_IPI_self(vector); + static_call_mod(apic_call_send_IPI_self)(vector); } =20 static __always_inline void apic_wait_icr_idle(void) { - if (apic->wait_icr_idle) - apic->wait_icr_idle(); + static_call_cond(apic_call_wait_icr_idle)(); } =20 static __always_inline u32 safe_apic_wait_icr_idle(void)