From nobody Fri Dec 19 07:41:19 2025 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 15BB0C0015E for ; Mon, 24 Jul 2023 13:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231593AbjGXNfr (ORCPT ); Mon, 24 Jul 2023 09:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231442AbjGXNfV (ORCPT ); Mon, 24 Jul 2023 09:35:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CBF21B8 for ; Mon, 24 Jul 2023 06:34:47 -0700 (PDT) Message-ID: <20230724132046.033563977@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690205666; 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=XBWDLku2nyQ5/5bJqq7OR3c/AtCppUf/8w42TtOLQ9Q=; b=Rn1RuI4ok1LNKdo0pSoUsJ8vum8dDf3MJB+pYApITyqT958xUvvroeGHufqwRLSKxfhh1u Pdjp9hDei1bguhaBx4/cPfR1yZbwSPQViCqOgse4llUuagbergyIxZy7MV4evoqlri88Os z35ZOOZlL3jm0jJxibuToAWWurEGpQgOIy55xe3GPcMMZSMq/Fn9ij3feKTHLcQdQ+W3ov bc9BBe7xGuVleG2MwLJvG6DM4bqG9ewg+LHD82lPcXJVjtYsbkT3NXkJ/pmbkfjsoHToeX uW9jqRgjkVQjXyPwjIkfVcoTEyaJO2xgpw6sLYZEbJS7knotbe8bNNdGMYNT+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690205666; 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=XBWDLku2nyQ5/5bJqq7OR3c/AtCppUf/8w42TtOLQ9Q=; b=TjfLjKbPKwED1Fu6tWBWhB/ljvQL/gtk/WYYh2A0OslVlfyEN2Sl+5rSrftEab67kKAs07 HeXhXzsjVSl3O8Bw== 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 V2 24/58] x86/apic/32: Remove pointless default_acpi_madt_oem_check() References: <20230724131206.500814398@linutronix.de> MIME-Version: 1.0 Date: Mon, 24 Jul 2023 15:34:25 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 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(-) --- 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( #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 =20 extern int default_apic_id_valid(u32 apicid); -extern int default_acpi_madt_oem_check(char *, char *); extern void default_setup_apic_routing(void); =20 extern u32 apic_default_calc_apicid(unsigned int cpu); --- 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_afte =20 .name =3D "bigsmp", .probe =3D probe_bigsmp, - .acpi_madt_oem_check =3D NULL, .apic_id_valid =3D default_apic_id_valid, .apic_id_registered =3D bigsmp_apic_id_registered, =20 --- 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_aft =20 .name =3D "default", .probe =3D probe_default, - .acpi_madt_oem_check =3D NULL, .apic_id_valid =3D default_apic_id_valid, .apic_id_registered =3D default_apic_id_registered, =20 @@ -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 =3D __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 =3D *drv; - printk(KERN_INFO "Switched to APIC driver `%s'.\n", - apic->name); - } - return 1; - } - return 0; -}