Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5575502rwb; Tue, 1 Aug 2023 05:04:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQ8FglRS/1vW8V9nSub+mrJ/HDr5ywBIuP1suown13n28ZY/hklwd/BVtLCvse6TI2GaD2 X-Received: by 2002:a17:90a:d48d:b0:267:fe4e:392f with SMTP id s13-20020a17090ad48d00b00267fe4e392fmr12302687pju.39.1690891470944; Tue, 01 Aug 2023 05:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690891470; cv=none; d=google.com; s=arc-20160816; b=1A+2FSi8FKzjK1B4zDv6B5DxR4KmBMo0FZfVqAL1xwR0sTzjR/wrct5ktmNlIDk6Yv SdSlDC6X4OtCMX39Dfd/B3/h25mpLcT38BEt4qoAwMte1v4wmVbb7iIIrJdprkFq2tzq yNFHKQkvy4VIIZt/xs/ihkj2KVP6O2UQvA4tUk+VoHfzN0zYjMajZdNZboNAGN3U7XBh gfQaLq8aEJIOyMc6de6QuBytj1ZhJQpOUmY5Lu//jS1fBslydeXDsD/LtMTgnvmfqLi2 I2R2qPTfboCMZGUri+VC7iatxVjWbVDPR6Pe8OYcPdmGw8htZNdy7MljfCWxXhBB2AwK WryA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=1p6M+HuhFutrVv6xarMScHVasdihs8aPDhQcOtKs0Y8=; fh=mE3iieUIZLcDfOLIULj9X6/p0bMDPZGFSVRsnyRUnTc=; b=jkFwxDyHYGBjWJjxGSPR/C+qTbv9mnGWkevVne5eJMjRuwddD1BCN9bLjrGJjQ65Be wjR6m/ZQVG51WhumTKikVEk+xqHGDI+NYRnixjGlc5JCLHCKeaGx95qP+lcKIr5VnZru v0sx+XVFj8L+YUZapxZMom8ll3sp1qlkpZmtJPsxfkhaJeyEJ+VAJm67n/j48snHVfQs Ow6p+KdNUtLIi8Y159gNquKoaoRjq43/6jRJJlI8/ck7TUqeXe7PTpn8nYTI9XYSIcE7 OCFBbVjZkGFLuf/6Q5HvY0Oex5dyF9tnuvZTsNqEbAn1tYWo4rP0OB5bElw0CvwEVfmu yzxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L2VnB2bW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Zq4hg45u; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a17090a560700b00262e1adb2c7si5047153pjf.51.2023.08.01.05.04.18; Tue, 01 Aug 2023 05:04:30 -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=L2VnB2bW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Zq4hg45u; 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 S233218AbjHAKt5 (ORCPT + 99 others); Tue, 1 Aug 2023 06:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbjHAKtL (ORCPT ); Tue, 1 Aug 2023 06:49:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 557AC3ABA for ; Tue, 1 Aug 2023 03:47:45 -0700 (PDT) Message-ID: <20230801103817.079672072@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690886844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=1p6M+HuhFutrVv6xarMScHVasdihs8aPDhQcOtKs0Y8=; b=L2VnB2bWVDToPq/sHERaiQL9m+S544m04dbw6ZcpksNGvjmkIBqnS9sa2l2p5qqgzeqry8 NqgoKldNSXWGF1vV4vS0ENt2c3KrzKN8n8LUmkTDQSvABNy6QPUuTEmJKz2EW2ert5ElDH kT9lh91caWM1h4lvgbZW2HTzknmbMDAO7RVWmplRA95utw15UL4RKxVY0hdi2XRGvBdY1P 2r6x4cqwJVHvRa09sKYAm932FLLuYr3cuzAfMOsx8heF/GjwUaSzn+8EySgw8945rFGXEA mjqABGDLqLi9UdnTO+VKmmuiALCjNHaUUQG5tilrHh4f79Go1zaVSjeZjvR1xg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690886844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=1p6M+HuhFutrVv6xarMScHVasdihs8aPDhQcOtKs0Y8=; b=Zq4hg45uWsKnwNdFk4opDhUwOHSqmSyRD5HRCj5o9c6NJB58Ds12XzEcHEu6N7Fwmat1Nu yl/gleBkobULV9Aw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Andrew Cooper , Tom Lendacky , Paolo Bonzini , Wei Liu , Arjan van de Ven , Juergen Gross , Michael Kelley , Peter Keresztes Schmidt , "Peter Zijlstra (Intel)" Subject: [patch V3 35/60] x86/apic: Allow apic::wait_icr_idle() to be NULL References: <20230801103042.936020332@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 1 Aug 2023 12:47:24 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,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 Nuke more NOOP callbacks and make the invocation conditional. Will be replaced with a static call later. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/apic.h | 9 ++------- arch/x86/kernel/apic/apic_noop.c | 2 -- arch/x86/kernel/apic/apic_numachip.c | 7 ------- arch/x86/kernel/apic/x2apic_cluster.c | 1 - arch/x86/kernel/apic/x2apic_phys.c | 1 - arch/x86/kernel/apic/x2apic_uv_x.c | 1 - arch/x86/xen/apic.c | 5 ----- 7 files changed, 2 insertions(+), 24 deletions(-) --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -206,12 +206,6 @@ static inline u32 native_apic_msr_read(u return (u32)msr; } -static inline void native_x2apic_wait_icr_idle(void) -{ - /* no need to wait for icr idle in x2apic */ - return; -} - static inline u32 native_safe_x2apic_wait_icr_idle(void) { /* no need to wait for icr idle in x2apic */ @@ -376,7 +370,8 @@ static inline void apic_icr_write(u32 lo static inline void apic_wait_icr_idle(void) { - apic->wait_icr_idle(); + if (apic->wait_icr_idle) + apic->wait_icr_idle(); } static inline u32 safe_apic_wait_icr_idle(void) --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c @@ -20,7 +20,6 @@ static void noop_send_IPI_mask_allbutsel static void noop_send_IPI_allbutself(int vector) { } static void noop_send_IPI_all(int vector) { } static void noop_send_IPI_self(int vector) { } -static void noop_apic_wait_icr_idle(void) { } static void noop_apic_icr_write(u32 low, u32 id) { } static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip) @@ -105,6 +104,5 @@ struct apic apic_noop __ro_after_init = .eoi_write = noop_apic_write, .icr_read = noop_apic_icr_read, .icr_write = noop_apic_icr_write, - .wait_icr_idle = noop_apic_wait_icr_idle, .safe_wait_icr_idle = noop_safe_apic_wait_icr_idle, }; --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c @@ -223,11 +223,6 @@ static int numachip2_acpi_madt_oem_check return 1; } -/* APIC IPIs are queued */ -static void numachip_apic_wait_icr_idle(void) -{ -} - /* APIC NMI IPIs are queued */ static u32 numachip_safe_apic_wait_icr_idle(void) { @@ -269,7 +264,6 @@ static const struct apic apic_numachip1 .eoi_write = native_apic_mem_write, .icr_read = native_apic_icr_read, .icr_write = native_apic_icr_write, - .wait_icr_idle = numachip_apic_wait_icr_idle, .safe_wait_icr_idle = numachip_safe_apic_wait_icr_idle, }; @@ -310,7 +304,6 @@ static const struct apic apic_numachip2 .eoi_write = native_apic_mem_write, .icr_read = native_apic_icr_read, .icr_write = native_apic_icr_write, - .wait_icr_idle = numachip_apic_wait_icr_idle, .safe_wait_icr_idle = numachip_safe_apic_wait_icr_idle, }; --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -266,7 +266,6 @@ static struct apic apic_x2apic_cluster _ .eoi_write = native_apic_msr_eoi_write, .icr_read = native_x2apic_icr_read, .icr_write = native_x2apic_icr_write, - .wait_icr_idle = native_x2apic_wait_icr_idle, .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, }; --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c @@ -180,7 +180,6 @@ static struct apic apic_x2apic_phys __ro .eoi_write = native_apic_msr_eoi_write, .icr_read = native_x2apic_icr_read, .icr_write = native_x2apic_icr_write, - .wait_icr_idle = native_x2apic_wait_icr_idle, .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, }; --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -854,7 +854,6 @@ static struct apic apic_x2apic_uv_x __ro .eoi_write = native_apic_msr_eoi_write, .icr_read = native_x2apic_icr_read, .icr_write = native_x2apic_icr_write, - .wait_icr_idle = native_x2apic_wait_icr_idle, .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle, }; --- a/arch/x86/xen/apic.c +++ b/arch/x86/xen/apic.c @@ -120,10 +120,6 @@ static int xen_phys_pkg_id(int initial_a return initial_apic_id >> index_msb; } -static void xen_noop(void) -{ -} - static int xen_cpu_present_to_apicid(int cpu) { if (cpu_present(cpu)) @@ -165,7 +161,6 @@ static struct apic xen_pv_apic = { .icr_read = xen_apic_icr_read, .icr_write = xen_apic_icr_write, - .wait_icr_idle = xen_noop, .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle, };