From patchwork Wed Aug 9 20:36:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 133562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp34363vqi; Wed, 9 Aug 2023 15:05:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN23GjfrMbKIuvC0FEdKZavQbB8tdzQlIUqgoOBocUjpWyvhhHJ3iX8cmZYU+MDjstp/er X-Received: by 2002:a9d:4d08:0:b0:6b9:4a15:1415 with SMTP id n8-20020a9d4d08000000b006b94a151415mr439035otf.3.1691618703322; Wed, 09 Aug 2023 15:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691618703; cv=none; d=google.com; s=arc-20160816; b=T72jqiT+mIPsZ/TyvfJdhvKR2qh3nS3Q0cHAGW3Bd1bW3j1j6MY2zkECCjmcQ9Aebd /98wDV+wgjRtDs+35z/l1KFq6of6mAxzuSwU7hvZavsPRZo53syPWv3fCQKtDNvcxEZt nh5ZAk7LueCtc7IugsOM4zjFjAfsa6FVrCB3sIsu4bCZe5R1CyWHxSEeKKXBF2/8ACxc ohlfYCXNswIN4hv8PefpL8JnAaDmQlut21BtQH5d38o5O9PkjPLsR0ikbEgOo5btHOKY zb9EB2KBMhz3Z9ucB40UCCTSpgJLNx0eZGdRF1OFEsVfXD3F8IxRpAwJH18C/kaUzWPN G85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=IkphxmPM5tysB4op+m1B+DDZ6LJglMpAWxW9xITodPE=; fh=XGLFTP/sHzb7+L/TByQwuiV1toCQ0sFaX6Bjt3lLxqE=; b=ALP/nVUKROwU6zF5i3SAhtcrFvsRt48/oIVF0ag97sCUYb8Mlz8PzFbL9xkebkvRvn SSWobgsJjYCjN0KEgs1i8hfH4Rn/bH9bXOQpI8Vl3rVYO37fY6HgtMlyupKs+fGamzej V5TF9hqFVauTara/kyLoGiyBQiW5gNibT9yglaJjOUE5QZpE0fE0JPo2bzGxroZG7Mod rL++ODnmTXXUcfrF4hYmTDFE5lff0cOhRtbnsoQ3qqrnTvwNvAHvp4ZoNdxXe4RS5Vdz MssJAQdQm4m51Ol3unkABzoiuVfqkJAAAvuVkw71hkqSpCRIWcHC8Yr/1xBNgKNKvTad yyPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cn20GOZA; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020a633d0e000000b005347fcb7853si160044pga.140.2023.08.09.15.04.24; Wed, 09 Aug 2023 15:05:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cn20GOZA; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234536AbjHIUgJ (ORCPT + 99 others); Wed, 9 Aug 2023 16:36:09 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773790773425980037 X-GMAIL-MSGID: 1773790773425980037 The following commit has been merged into the x86/apic branch of tip: Commit-ID: f8542a55499a69a859c84866b66f0df43933e563 Gitweb: https://git.kernel.org/tip/f8542a55499a69a859c84866b66f0df43933e563 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); static __always_inline u32 apic_read(u32 reg) { - return apic->read(reg); + return static_call(apic_call_read)(reg); } static __always_inline void apic_write(u32 reg, u32 val) { - apic->write(reg, val); + static_call(apic_call_write)(reg, val); } static __always_inline void apic_eoi(void) { - apic->eoi(); + static_call(apic_call_eoi)(); } static __always_inline void apic_native_eoi(void) { - apic->native_eoi(); + static_call(apic_call_native_eoi)(); } static __always_inline u64 apic_icr_read(void) { - return apic->icr_read(); + return static_call(apic_call_icr_read)(); } static __always_inline void apic_icr_write(u32 low, u32 high) { - apic->icr_write(low, high); + static_call(apic_call_icr_write)(low, high); } static __always_inline void __apic_send_IPI(int cpu, int vector) { - apic->send_IPI(cpu, vector); + static_call(apic_call_send_IPI)(cpu, vector); } static __always_inline void __apic_send_IPI_mask(const struct cpumask *mask, int vector) { - apic->send_IPI_mask(mask, vector); + static_call_mod(apic_call_send_IPI_mask)(mask, vector); } static __always_inline void __apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) { - apic->send_IPI_mask_allbutself(mask, vector); + static_call(apic_call_send_IPI_mask_allbutself)(mask, vector); } static __always_inline void __apic_send_IPI_allbutself(int vector) { - apic->send_IPI_allbutself(vector); + static_call(apic_call_send_IPI_allbutself)(vector); } static __always_inline void __apic_send_IPI_all(int vector) { - apic->send_IPI_all(vector); + static_call(apic_call_send_IPI_all)(vector); } static __always_inline void __apic_send_IPI_self(int vector) { - apic->send_IPI_self(vector); + static_call_mod(apic_call_send_IPI_self)(vector); } 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)(); } static __always_inline u32 safe_apic_wait_icr_idle(void)