From patchwork Wed Aug 9 16:49:35 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: 133361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2957615vqr; Wed, 9 Aug 2023 10:23:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoUb1DO327icvYn561NifBMaGWIzJjx1X4pqkGNtOkXS5K5grHamkYiAoOt4pJIQH04UWM X-Received: by 2002:a05:6a20:13c2:b0:137:a9e8:1422 with SMTP id ho2-20020a056a2013c200b00137a9e81422mr2372570pzc.42.1691601827392; Wed, 09 Aug 2023 10:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601827; cv=none; d=google.com; s=arc-20160816; b=LkOOd/IqSBwAOIPXYmfwklnsaDEWwTCeQMHKoGoeVgR1wm4CgHLZ3ekg6m9ErCDWYB HaqdW/Tyt6fAjF7VXPlAJvjt2Fj9VxX+6IeM2553c/Ca9dPInuF23qVxoTH5tbxgkmts V5Jk7jkswMOB1bJEJ6/gCc92qdjRtX7WUVYXFzNC9AaEgOu2uVOBYiEQu1DUzrjrXfoJ pM3wLbBKjmM8IeXtiKml37YVn+9dptDQEvwsFYmMloggLd1NsBzuslxITeoruR16nJjk G20lgYOlzVWz8U0cRF32ivL3oCrMIyrFxrp3OTx9CK4vJiDKyQg6jAlLWubdVaggEfks mNzQ== 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=DFmH501DpZEoPD+wgAkXug+itjo9DUkCazk4SMnh0GY=; fh=xeBNGOuZM5vy4okdFvBNsMTGHQ6tdBlFPaNKCUScG5A=; b=cKu90Digz5yejkOD/Eyw6i52mQ5dZ9C08p9SJ8W7wHeTNwtkvXkejbaP/jbOUQPnUa 1AIlOVRJhO2FmLsarBLDkKbRZdzF7Afb8y+VX6QPHzMWa13S5mYRc0vPxShcqaDT6taF AMGgRuTuFptixGBI5/+irHElhMFroiyFclDi8Jct4nCu+ApkksTRMiCB01WUp9vUYiox iHQSTza2xXycakuRs8ESx4vPD8XAsYiHvWrypHUTdcCVpF0sz4s7FRNcjda8v4KURjkn PKceJeFwYEx7AuqxYFZ1V5iuihS88RCjQihW/5RkhtG2irNnnoHVWVYD+Od8mYL3LyXK kefg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tz3pngus; 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 ei6-20020a056a0080c600b00682ad23bb40si9400734pfb.251.2023.08.09.10.23.34; Wed, 09 Aug 2023 10:23:47 -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=tz3pngus; 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 S231472AbjHIQuV (ORCPT + 99 others); Wed, 9 Aug 2023 12:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231371AbjHIQth (ORCPT ); Wed, 9 Aug 2023 12:49:37 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537DC1FEE; Wed, 9 Aug 2023 09:49:37 -0700 (PDT) Date: Wed, 09 Aug 2023 16:49:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691599776; 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=DFmH501DpZEoPD+wgAkXug+itjo9DUkCazk4SMnh0GY=; b=tz3pngus4ODJ/87RPakNlJSmlcZAv0srEbLt2M8lMRhJU2B1kIDvtCmVYo2ftEQ7XJiWEY yAi7tyavGXHCxtOZXyGyl1oGJi1a1dcuTgwtG89er0pCMIaZwap5ajnIV3M1wf8CH2iRVf bskXQMD44ZuiJHyw3HTI+USIVEE9jR/hWcOD/BM/UUhYp7C9Ml2yNcC647GvdEzed8qzQp CaGfP8qWSQjqVd5Al8gG0WIPBJOsI6/7YnjfA2eRt1YcX8gtRU9NfCNfACq1vAThu/o/n+ xk7UxStZDgF5RMGEj/N0AEldHGKzDw0si474XZOBsYfjbTjliAL4p61/wUyZvw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691599776; 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=DFmH501DpZEoPD+wgAkXug+itjo9DUkCazk4SMnh0GY=; b=DuXBpWYRtIcYhL40SrU8V0fhfOlqkguQVsBW4TH8kxvoQZUL+WH5FaZUZMnU2EGsxWgzRv sgL5wARR7jUuNnAA== 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)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <169159977545.27769.16011214663204260889.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: 1773773077868937878 The following commit has been merged into the x86/apic branch of tip: Commit-ID: b74e35c4320500465f3280f4fa35f73f06cfd7cf Gitweb: https://git.kernel.org/tip/b74e35c4320500465f3280f4fa35f73f06cfd7cf Author: Thomas Gleixner AuthorDate: Tue, 08 Aug 2023 15:03:55 -07:00 Committer: Dave Hansen CommitterDate: Wed, 09 Aug 2023 08:10:11 -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) --- 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; -}