Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3129375rwo; Mon, 24 Jul 2023 06:45:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGj6cmQh7cfeqNWFRtMPlKialr6pqazjvWHkxBAmasG8iX3TZK/Vgkv4pXvz9vf71QvjbCj X-Received: by 2002:a05:6512:39ca:b0:4fb:8b78:4a93 with SMTP id k10-20020a05651239ca00b004fb8b784a93mr5767851lfu.7.1690206334022; Mon, 24 Jul 2023 06:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690206333; cv=none; d=google.com; s=arc-20160816; b=pTmqqpIgWgYUMchxnx90afqSPHoFA4aIdia1+r4TeZUGjJ+hgNXdflYMtwK0RwZuwq qptbrrDFAwDL4j3hdf7TW9IzafwGpLJr9EtEn30WG3GTlFhCHEOXLkADFmTPn4+lCpBA 2abyYZ28JPkRK3J0tcXh/pb+4V3COV37MvQwhOfBd/v1p9Ch0Q6V/brtVPjf2/eZW2zt SLv5ojZsaeEQlm8CwhskBCqqYfEyx+qvboh4rhpv3uVN1vrD9zQsqBIY+OeZUqI2kmc2 sFzvoQ20Ym2KRYelCL9/kZCtGMJcWe7+SoFsVWoEyu7qvscKbSbqvY01hbcI8YLpbd2E i/sQ== 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=Fur2MYcjwG+kKe1RtThBHG7Ea2Bvm6lkExJ+ZubmnJg=; fh=mE3iieUIZLcDfOLIULj9X6/p0bMDPZGFSVRsnyRUnTc=; b=siIDZ93vfXZ5x07YGY50sWgDae/rcSOPuKdT56ouxVW8gd1qhMrcOz2ZimKGnb8mzq KeJMT/Aui/KFYY4TuKqM7rAty/BuLo3qbyejlr0duEtZ2M84qqkSXzXj7BZTcbhd9GUn X/I/zBxQKjOFlfMoznozJ5P+/0RXXxUb3xRLXf25LD9SSf1+ABEuXvcX619cHwD/N5bm fkZHmngfo0K4LmBH6GOIG4IBH//INfc/+y4ZuqPknczj/IzE/TNPqVtQ8mzv/CwCutjx QvYLxRiTkq6N0GGV1Hd6GlE1LnR2K4P27dprKBT5cBb9o9AwwQNs4GJ1UBaOcUn9hicl SZng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fgZLvl8v; dkim=neutral (no key) header.i=@linutronix.de header.b=k6VZXFlg; 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 q18-20020a056402033200b00522298f70ffsi1993181edw.182.2023.07.24.06.44.56; Mon, 24 Jul 2023 06:45:33 -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=fgZLvl8v; dkim=neutral (no key) header.i=@linutronix.de header.b=k6VZXFlg; 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 S230005AbjGXNef (ORCPT + 99 others); Mon, 24 Jul 2023 09:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230422AbjGXNeT (ORCPT ); Mon, 24 Jul 2023 09:34:19 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49A2199B for ; Mon, 24 Jul 2023 06:34:05 -0700 (PDT) Message-ID: <20230724132045.242775204@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690205643; 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=Fur2MYcjwG+kKe1RtThBHG7Ea2Bvm6lkExJ+ZubmnJg=; b=fgZLvl8vHcuLGC1PX+3zzGjQxP948eMa0UrSmx3TfvQKWTrxpFr+Gr8J3pmKlJhvEZf2kp epmi7YHW5E5VXSqhYne8cPVwWMUQcTSnOjCV6WlMbq+ZvfFjFHw+mM8W8NjiyB5HvI1JXB KQKAJmc7YVE13XBzg/JUHrICVx6j7xOGGoX/YDTZTXRtw0oZnysFlraMCy7WL6h4YopTHF de2ExKU/OT1ciqV5JkNMQCj+nP37zHwk9PRwZEuDZe803odskoVl6Ji97fEDP+AHflK4an YfYyV2Pm3Be+j+C8x8D35rzO1NY4qVHtmW2cnWEnfLzSddWYlgarLMKuATaGNg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690205643; 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=Fur2MYcjwG+kKe1RtThBHG7Ea2Bvm6lkExJ+ZubmnJg=; b=k6VZXFlgLIOrdb0mZ6bLe6eTtOxBey+zy2LCCxDPxekoS7FYB/yDuLhYSQs+BW9l2CTmw/ j6z/0oVGCkL96yDA== 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 11/58] x86/apic: Remove the pointless APIC version check References: <20230724131206.500814398@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 24 Jul 2023 15:34:03 +0200 (CEST) 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,T_SCC_BODY_TEXT_LINE 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 This historical leftover is really uninteresting today. Whatever MPTABLE or MADT delivers we only trust the hardware anyway. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/mpspec.h | 2 +- arch/x86/kernel/acpi/boot.c | 6 +----- arch/x86/kernel/apic/apic.c | 19 ++++--------------- arch/x86/kernel/devicetree.c | 5 ++--- arch/x86/kernel/jailhouse.c | 6 ++---- arch/x86/kernel/mpparse.c | 2 +- arch/x86/kernel/smpboot.c | 4 ++-- 7 files changed, 13 insertions(+), 31 deletions(-) --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -76,7 +76,7 @@ static inline void e820__memblock_alloc_ #define default_get_smp_config x86_init_uint_noop #endif -int generic_processor_info(int apicid, int version); +int generic_processor_info(int apicid); #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -169,7 +169,6 @@ static int __init acpi_parse_madt(struct */ static int acpi_register_lapic(int id, u32 acpiid, u8 enabled) { - unsigned int ver = 0; int cpu; if (id >= MAX_LOCAL_APIC) { @@ -182,10 +181,7 @@ static int acpi_register_lapic(int id, u return -EINVAL; } - if (boot_cpu_physical_apicid != -1U) - ver = boot_cpu_apic_version; - - cpu = generic_processor_info(id, ver); + cpu = generic_processor_info(id); if (cpu >= 0) early_per_cpu(x86_cpu_to_acpiid, cpu) = acpiid; --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2428,19 +2428,8 @@ static int allocate_logical_cpuid(int ap return nr_logical_cpuids++; } -static void cpu_update_apic(int cpu, int apicid, int version) +static void cpu_update_apic(int cpu, int apicid) { - if (version == 0x0) { - pr_warn("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n", - cpu, apicid); - version = 0x10; - } - - if (version != boot_cpu_apic_version) { - pr_warn("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n", - boot_cpu_apic_version, cpu, version); - } - #if defined(CONFIG_SMP) || defined(CONFIG_X86_64) early_per_cpu(x86_cpu_to_apicid, cpu) = apicid; #endif @@ -2460,10 +2449,10 @@ static void cpu_update_apic(int cpu, int static __init void cpu_set_boot_apic(void) { cpuid_to_apicid[0] = boot_cpu_physical_apicid; - cpu_update_apic(0, boot_cpu_physical_apicid, boot_cpu_apic_version); + cpu_update_apic(0, boot_cpu_physical_apicid); } -int generic_processor_info(int apicid, int version) +int generic_processor_info(int apicid) { int cpu, max = nr_cpu_ids; @@ -2500,7 +2489,7 @@ int generic_processor_info(int apicid, i return -EINVAL; } - cpu_update_apic(cpu, apicid, version); + cpu_update_apic(cpu, apicid); return cpu; } --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -128,16 +128,15 @@ static void __init dtb_setup_hpet(void) static void __init dtb_cpu_setup(void) { struct device_node *dn; - u32 apic_id, version; + u32 apic_id; - version = GET_APIC_VERSION(apic_read(APIC_LVR)); for_each_of_cpu_node(dn) { apic_id = of_get_cpu_hwid(dn, 0); if (apic_id == ~0U) { pr_warn("%pOF: missing local APIC ID\n", dn); continue; } - generic_processor_info(apic_id, version); + generic_processor_info(apic_id); } } --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -101,10 +101,8 @@ static void __init jailhouse_get_smp_con register_lapic_address(0xfee00000); - for (cpu = 0; cpu < setup_data.v1.num_cpus; cpu++) { - generic_processor_info(setup_data.v1.cpu_ids[cpu], - boot_cpu_apic_version); - } + for (cpu = 0; cpu < setup_data.v1.num_cpus; cpu++) + generic_processor_info(setup_data.v1.cpu_ids[cpu]); smp_found_config = 1; --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -62,7 +62,7 @@ static void __init MP_processor_info(str bootup_cpu = " (Bootup-CPU)"; pr_info("Processor #%d%s\n", m->apicid, bootup_cpu); - generic_processor_info(apicid, m->apicver); + generic_processor_info(apicid); } #ifdef CONFIG_X86_IO_APIC --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1389,7 +1389,7 @@ early_param("possible_cpus", _setup_poss { int i, possible; - /* No boot processor was found in mptable or ACPI MADT */ + /* No processor was found in mptable or ACPI MADT */ if (!num_processors) { if (boot_cpu_has(X86_FEATURE_APIC)) { int apicid = boot_cpu_physical_apicid; @@ -1400,7 +1400,7 @@ early_param("possible_cpus", _setup_poss /* Make sure boot cpu is enumerated */ if (apic->cpu_present_to_apicid(0) == BAD_APICID && apic->apic_id_valid(apicid)) - generic_processor_info(apicid, boot_cpu_apic_version); + generic_processor_info(apicid); } if (!num_processors)