From patchwork Wed Aug 9 19:12:19 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: 133506 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:9d8d:b0:139:fa0d:b2d with SMTP id d13csp136521rwo; Wed, 9 Aug 2023 13:51:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEz2geZrf11ffNDuqLGlwMbzXS9Uyw4SF8tyjZ77HBd5/Z7ddjcwIR6Ba4rWZRyW3TwsY+I X-Received: by 2002:a17:902:bc46:b0:1b8:63c6:84ab with SMTP id t6-20020a170902bc4600b001b863c684abmr261396plz.61.1691614290125; Wed, 09 Aug 2023 13:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691614290; cv=none; d=google.com; s=arc-20160816; b=avCgWxxODtlwyOPe+EGth9hWU89hYzc4Y8rWlrpn7ldHpo/1wLUFHlYrxbV3rsC5XH uhSpzZB6v8sJj/SJEiJZ0pZkdA+L2aAiVroVyeZ825EQzYyXdcWh4WkXWFR8D3aW9KKV JMznkIRzplHHyLkKWHgUV2aP3u+MSRLXFRYWhS1kgdroUjIQ62ixT8Pe8N4vnPY5F+ca JzDAFVxAa8W71LkMTZKSlesSeNS1L5ob3cs3w6IvIoXq9GbXjj7HcedFiERqCNultJKE UkyUAVkiFiO1ODd4V+Pldh7t+eWkl4XB9c6r7GHhLscg0XLURmP2z00y0vqLcuFh9pet /6Wg== 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=fzti2xQUly3b/kP3Xg8CC36cxRJZCss877lxRX7bCuk=; fh=jBwjuriIPWA1lnCf5oMMiNAPpgGE0iGPmBzZMsd85oQ=; b=ThSnYUV33nvvf7vvFtsSgJWPdWppnz55gohnCOR4fpPT7urRMjjuWgMjq+TzK4bSXL 8KVvPejqikj7W1sywZif4QeJ/Y32aukIgLNQ7kHqfcVSM/eTBnmfnjOoH2wDb5z1J6CJ 2bhi1RtCtrP+BCr4GQyhn2xXqSOQlRhyGmDVKCrS6XOk2nzq+ecrShxUM20zb6ck7ZC6 U//p+7hmf6k0xcD6aYstAeyDsZRVaT20ywYa9eUJ+ixziqVt1qZjQAwtREsfh/Qg5W+N 6RiaDFjdOIf0N+P8bRIrJ7+lCnvuSM8oz2HQ4KVUg+mdOPn2eSOH0y/9zNXFAvHAfjpK 1PYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rnmi5GGX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=tB8WQ958; 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 t6-20020a170902bc4600b001bbbbb61c71si10067746plz.399.2023.08.09.13.51.16; Wed, 09 Aug 2023 13:51: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=rnmi5GGX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=tB8WQ958; 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 S233530AbjHITNB (ORCPT + 99 others); Wed, 9 Aug 2023 15:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233374AbjHITMf (ORCPT ); Wed, 9 Aug 2023 15:12:35 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D50B2717; Wed, 9 Aug 2023 12:12:25 -0700 (PDT) Date: Wed, 09 Aug 2023 19:12:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691608340; 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=fzti2xQUly3b/kP3Xg8CC36cxRJZCss877lxRX7bCuk=; b=rnmi5GGXTCuNkEGUNd2uThVt9ywtUlHrILRYVR30cr/jy3gAJGXVmif6/+v5VlcDF64c++ OESD9PQn51H6GtGIxE0JIDMz5x3zRypuRKwn3T6mcRtD+9K1/63m55Z+YHG+5E6wVJLwCV d7QajkJqeC2QkTdDkiJckrzJzwy3ZXfaR3OfjH69uT7v74eLIh9YKlr4/SOzjA54R9J0lW 5RZ8Wdum5xATi843xx/VhWB05+HRxhm9SL2kCR5g+yPeOa43ai7fbFFY844cELH7XCD/2H +yNtec51WbXgJpuGDQ11tHoXkTZyvXuPnJUNTONEn7MRuEwlwE6C55NtzBppXw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691608340; 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=fzti2xQUly3b/kP3Xg8CC36cxRJZCss877lxRX7bCuk=; b=tB8WQ9584Anm9izw/CeiGCFQBMzRe7a8sqCFPSySDP3I9LMo/zI0VBKElKHndqjPRXc1fp UAZyqv2iCE+1qgBQ== 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/32: Remove pointless default_acpi_madt_oem_check() Cc: Thomas Gleixner , Dave Hansen , "Peter Zijlstra (Intel)" , Michael Kelley , Sohil Mehta , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169160833993.27769.566734109101233603.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: 1773773077868937878 X-GMAIL-MSGID: 1773786146163345979 The following commit has been merged into the x86/apic branch of tip: Commit-ID: d75baa260c850b3d184b1e3cceeff450d65e5603 Gitweb: https://git.kernel.org/tip/d75baa260c850b3d184b1e3cceeff450d65e5603 Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:03:55 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 11:58:24 -07:00 x86/apic/32: Remove pointless default_acpi_madt_oem_check() On 32bit there is no APIC implementing the acpi_madt_oem_check() except XEN PV, but that does not matter at all. generic_apic_probe() runs before ACPI tables are parsed. This selects the XEN APIC if there is no command line override because the XEN APIC driver is the first to be probed. If there is a command line override then the XEN PV driver won't be selected in the MADT OEM check either. As there is no other MADT check implemented for 32bit APICs, this whole excercise is a NOOP and can be removed. Signed-off-by: Thomas Gleixner Signed-off-by: Dave Hansen Acked-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Sohil Mehta Tested-by: Juergen Gross # Xen PV (dom0 and unpriv. guest) --- arch/x86/include/asm/apic.h | 4 +++- arch/x86/kernel/apic/bigsmp_32.c | 1 - arch/x86/kernel/apic/probe_32.c | 22 ---------------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index daef681..f6541a2 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -459,10 +459,12 @@ static inline unsigned int read_apic_id(void) #ifdef CONFIG_X86_64 typedef int (*wakeup_cpu_handler)(int apicid, unsigned long start_eip); extern void acpi_wake_cpu_handler_update(wakeup_cpu_handler handler); +extern int default_acpi_madt_oem_check(char *, char *); +#else +static inline int default_acpi_madt_oem_check(char *a, char *b) { return 0; } #endif extern int default_apic_id_valid(u32 apicid); -extern int default_acpi_madt_oem_check(char *, char *); extern void default_setup_apic_routing(void); extern u32 apic_default_calc_apicid(unsigned int cpu); diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index b649048..d19dcf9 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c @@ -112,7 +112,6 @@ static struct apic apic_bigsmp __ro_after_init = { .name = "bigsmp", .probe = probe_bigsmp, - .acpi_madt_oem_check = NULL, .apic_id_valid = default_apic_id_valid, .apic_id_registered = bigsmp_apic_id_registered, diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 3ee0211..20d7f57 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c @@ -60,7 +60,6 @@ static struct apic apic_default __ro_after_init = { .name = "default", .probe = probe_default, - .acpi_madt_oem_check = NULL, .apic_id_valid = default_apic_id_valid, .apic_id_registered = default_apic_id_registered, @@ -176,24 +175,3 @@ void __init generic_apic_probe(void) } printk(KERN_INFO "Using APIC driver %s\n", apic->name); } - -/* This function can switch the APIC even after the initial ->probe() */ -int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ - struct apic **drv; - - for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { - if (!(*drv)->acpi_madt_oem_check) - continue; - if (!(*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) - continue; - - if (!cmdline_apic) { - apic = *drv; - printk(KERN_INFO "Switched to APIC driver `%s'.\n", - apic->name); - } - return 1; - } - return 0; -}