]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/apic: Remove the pointless APIC version check
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:03:46 +0000 (15:03 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:19 +0000 (11:58 -0700)
This historical leftover is really uninteresting today. Whatever MPTABLE or
MADT delivers we only trust the hardware anyway.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
arch/x86/include/asm/mpspec.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/devicetree.c
arch/x86/kernel/jailhouse.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/smpboot.c

index fa5e24a58595706677dc2579c34caf6c90d245b3..190d30685facb531c4831002a73515595f33b238 100644 (file)
@@ -76,7 +76,7 @@ static inline void e820__memblock_alloc_reserved_mpc_new(void) { }
 #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)
 
index 38a52983082907c5e52b8887b685caa3ce585af9..cca1a07096054ef0ed791dc30a8c75434da6685b 100644 (file)
@@ -169,7 +169,6 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
  */
 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, u32 acpiid, u8 enabled)
                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;
 
index b7ffae46101da2cdf501537bf209ad7e2aff385c..32275ca6129f1e1903f14f5cbc168281ebc244e6 100644 (file)
@@ -2428,19 +2428,8 @@ static int allocate_logical_cpuid(int apicid)
        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 apicid, int version)
 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, int version)
                return -EINVAL;
        }
 
-       cpu_update_apic(cpu, apicid, version);
+       cpu_update_apic(cpu, apicid);
        return cpu;
 }
 
index 28da5dd83fc0c08470dbafe54dd9f4e6daa836cf..56f6d591d0df83d4a93e5f96fa4095ee01c9a84b 100644 (file)
@@ -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);
        }
 }
 
index 4eb8f2d19a872f7bce16e680c7600ab9708b59c6..578d16fc040fa1eadf31344b81877c1ed343b2cf 100644 (file)
@@ -101,10 +101,8 @@ static void __init jailhouse_get_smp_config(unsigned int early)
 
        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;
 
index fe9a7f63d2d930a158bddd82e1475f7740468bdf..82518c1aff8dcede6296ec31b42c9ee65e400eaf 100644 (file)
@@ -62,7 +62,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
                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
index a33fc505ca7b5b2861d2833ecbcdaefdeae04859..5467c58827f59cecb6ed48b4bec32fa65a98f0d4 100644 (file)
@@ -1397,7 +1397,7 @@ __init void prefill_possible_map(void)
 {
        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;
@@ -1408,7 +1408,7 @@ __init void prefill_possible_map(void)
                        /* 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)