x86/apic: Remove yet another dubious callback
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:05:20 +0000 (22:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:41 +0000 (22:07 +0100)
Paranoia is not wrong, but having an APIC callback which is in most
implementations a complete NOOP and in one actually looking whether the
APICID of an upcoming CPU has been registered. The same APICID which was
used to bring the CPU out of wait for startup.

That's paranoia for the paranoia sake. Remove the voodoo.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20240212154640.116510935@linutronix.de
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/apic_common.c
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/local.h
arch/x86/kernel/apic/probe_32.c

index 89eae0c1e5528ff4f790002e815a108b3ca24b29..ba219d6c851e9ed63aeed4bfba8428166132e17b 100644 (file)
@@ -288,7 +288,6 @@ struct apic {
        /* Probe, setup and smpboot functions */
        int     (*probe)(void);
        int     (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
-       bool    (*apic_id_registered)(void);
 
        void    (*init_apic_ldr)(void);
        u32     (*cpu_present_to_apicid)(int mps_cpu);
index e3cebd45526be7d0f5a7db5705b145ae1e792e38..68767a9dd3d149b9704a98a8bd0b1ba9b5f2f5b7 100644 (file)
@@ -1538,9 +1538,6 @@ static void setup_local_APIC(void)
                apic_write(APIC_ESR, 0);
        }
 #endif
-       /* Validate that the APIC is registered if required */
-       BUG_ON(apic->apic_id_registered && !apic->apic_id_registered());
-
        /*
         * Intel recommends to set DFR, LDR and TPR before enabling
         * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
index d4dfa437081a92a77cab4af97735326766ce4a3e..9ef3be866832cf2c9b96613a832c0eda1dbba547 100644 (file)
@@ -27,11 +27,6 @@ u32 default_cpu_present_to_apicid(int mps_cpu)
 }
 EXPORT_SYMBOL_GPL(default_cpu_present_to_apicid);
 
-bool default_apic_id_registered(void)
-{
-       return test_bit(read_apic_id(), phys_cpu_present_map);
-}
-
 /*
  * Set up the logical destination ID when the APIC operates in logical
  * destination mode.
index f6ef12126ba1941461a1282b162554cfd56a4369..f37ad3392fec91d8c88022b26d555c84747702ac 100644 (file)
@@ -70,7 +70,6 @@ static struct apic apic_flat __ro_after_init = {
        .name                           = "flat",
        .probe                          = flat_probe,
        .acpi_madt_oem_check            = flat_acpi_madt_oem_check,
-       .apic_id_registered             = default_apic_id_registered,
 
        .dest_mode_logical              = true,
 
@@ -139,7 +138,6 @@ static struct apic apic_physflat __ro_after_init = {
        .name                           = "physical flat",
        .probe                          = physflat_probe,
        .acpi_madt_oem_check            = physflat_acpi_madt_oem_check,
-       .apic_id_registered             = default_apic_id_registered,
 
        .dest_mode_logical              = false,
 
index f8a87f9e72e676a0462530e8434c2c0d2531e8ed..842fe28496beeb38e2628c622a8ec804851085a3 100644 (file)
@@ -61,8 +61,6 @@ void default_send_IPI_allbutself(int vector);
 void default_send_IPI_all(int vector);
 void default_send_IPI_self(int vector);
 
-bool default_apic_id_registered(void);
-
 #ifdef CONFIG_X86_32
 void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector);
 void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask, int vector);
index cdf4047d88e1794feaa135942b30d04db69cf64d..f75ee345c02d080ab95b2f55639249f8d3237d26 100644 (file)
@@ -38,7 +38,6 @@ static struct apic apic_default __ro_after_init = {
 
        .name                           = "default",
        .probe                          = probe_default,
-       .apic_id_registered             = default_apic_id_registered,
 
        .dest_mode_logical              = true,