x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:05:19 +0000 (22:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:41 +0000 (22:07 +0100)
There is absolutely no point to write the APIC ID which was read from the
local APIC earlier, back into the local APIC for the 64-bit UP case.

Remove that along with the apic callback which is solely there for this
pointless exercise.

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.055288922@linutronix.de
arch/x86/include/asm/apic.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/local.h
arch/x86/kernel/apic/x2apic_cluster.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/xen/apic.c

index 16e5e0071f1c7e9c011711730a28a72f13db729a..89eae0c1e5528ff4f790002e815a108b3ca24b29 100644 (file)
@@ -294,7 +294,6 @@ struct apic {
        u32     (*cpu_present_to_apicid)(int mps_cpu);
 
        u32     (*get_apic_id)(u32 id);
-       u32     (*set_apic_id)(u32 apicid);
 
        /* wakeup_secondary_cpu */
        int     (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip);
index ce6d31bfc6e3f0f0a934b4706d21d8ae6921f135..e3cebd45526be7d0f5a7db5705b145ae1e792e38 100644 (file)
@@ -2485,9 +2485,6 @@ EXPORT_SYMBOL_GPL(x86_msi_msg_get_destid);
 
 static void __init apic_bsp_up_setup(void)
 {
-#ifdef CONFIG_X86_64
-       apic_write(APIC_ID, apic->set_apic_id(boot_cpu_physical_apicid));
-#endif
        reset_phys_cpu_present_map(boot_cpu_physical_apicid);
 }
 
index fe9b728799f2c86d3465815070bab1aa6d1a55f3..f6ef12126ba1941461a1282b162554cfd56a4369 100644 (file)
@@ -61,11 +61,6 @@ static u32 flat_get_apic_id(u32 x)
        return (x >> 24) & 0xFF;
 }
 
-static u32 set_apic_id(u32 id)
-{
-       return (id & 0xFF) << 24;
-}
-
 static int flat_probe(void)
 {
        return 1;
@@ -86,7 +81,6 @@ static struct apic apic_flat __ro_after_init = {
 
        .max_apic_id                    = 0xFE,
        .get_apic_id                    = flat_get_apic_id,
-       .set_apic_id                    = set_apic_id,
 
        .calc_dest_apicid               = apic_flat_calc_apicid,
 
@@ -155,7 +149,6 @@ static struct apic apic_physflat __ro_after_init = {
 
        .max_apic_id                    = 0xFE,
        .get_apic_id                    = flat_get_apic_id,
-       .set_apic_id                    = set_apic_id,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
index f7591dc656d3374431e79c698c449750a8f0d803..16410f087b7af4f8390ee4973d9ee4bbd5679827 100644 (file)
@@ -38,11 +38,6 @@ static u32 numachip1_get_apic_id(u32 x)
        return id;
 }
 
-static u32 numachip1_set_apic_id(u32 id)
-{
-       return (id & 0xff) << 24;
-}
-
 static u32 numachip2_get_apic_id(u32 x)
 {
        u64 mcfg;
@@ -51,11 +46,6 @@ static u32 numachip2_get_apic_id(u32 x)
        return ((mcfg >> (28 - 8)) & 0xfff00) | (x >> 24);
 }
 
-static u32 numachip2_set_apic_id(u32 id)
-{
-       return id << 24;
-}
-
 static void numachip1_apic_icr_write(int apicid, unsigned int val)
 {
        write_lcsr(CSR_G3_EXT_IRQ_GEN, (apicid << 16) | val);
@@ -225,7 +215,6 @@ static const struct apic apic_numachip1 __refconst = {
 
        .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = numachip1_get_apic_id,
-       .set_apic_id                    = numachip1_set_apic_id,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
@@ -260,7 +249,6 @@ static const struct apic apic_numachip2 __refconst = {
 
        .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = numachip2_get_apic_id,
-       .set_apic_id                    = numachip2_set_apic_id,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
index 29f354a699d50258a82a7960bdc4ee9676f0fdab..9285d500d5b44d9059f4ebdf38f8ece6492973ed 100644 (file)
@@ -72,7 +72,6 @@ static struct apic apic_bigsmp __ro_after_init = {
 
        .max_apic_id                    = 0xFE,
        .get_apic_id                    = bigsmp_get_apic_id,
-       .set_apic_id                    = NULL,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
index a77c23e624593dedd05f2f6b921a88d620edbc1d..f8a87f9e72e676a0462530e8434c2c0d2531e8ed 100644 (file)
@@ -16,7 +16,6 @@
 /* X2APIC */
 void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
 u32 x2apic_get_apic_id(u32 id);
-u32 x2apic_set_apic_id(u32 id);
 
 void x2apic_send_IPI_all(int vector);
 void x2apic_send_IPI_allbutself(int vector);
index 4926b127b230b25a13b081cfa320b779f35dc45b..567dbd2fe4b6978c0ffda146aa59e957bfb43919 100644 (file)
@@ -237,7 +237,6 @@ static struct apic apic_x2apic_cluster __ro_after_init = {
        .max_apic_id                    = UINT_MAX,
        .x2apic_set_max_apicid          = true,
        .get_apic_id                    = x2apic_get_apic_id,
-       .set_apic_id                    = x2apic_set_apic_id,
 
        .calc_dest_apicid               = x2apic_calc_apicid,
 
index 8f1c39fa81211c280e8f1bbea03c1dde93d339e1..12d4c35547a6f928d14df005dbcbffb71eab4641 100644 (file)
@@ -129,11 +129,6 @@ u32 x2apic_get_apic_id(u32 id)
        return id;
 }
 
-u32 x2apic_set_apic_id(u32 id)
-{
-       return id;
-}
-
 static struct apic apic_x2apic_phys __ro_after_init = {
 
        .name                           = "physical x2apic",
@@ -149,7 +144,6 @@ static struct apic apic_x2apic_phys __ro_after_init = {
        .max_apic_id                    = UINT_MAX,
        .x2apic_set_max_apicid          = true,
        .get_apic_id                    = x2apic_get_apic_id,
-       .set_apic_id                    = x2apic_set_apic_id,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
index 3ae696f072bb3b1d3e5ff7fe82ce407e7c246959..7fef504ca508b7829b89a3ca2dad9be1e22860e9 100644 (file)
@@ -745,11 +745,6 @@ static void uv_send_IPI_all(int vector)
        uv_send_IPI_mask(cpu_online_mask, vector);
 }
 
-static u32 set_apic_id(u32 id)
-{
-       return id;
-}
-
 static int uv_probe(void)
 {
        return apic == &apic_x2apic_uv_x;
@@ -769,7 +764,6 @@ static struct apic apic_x2apic_uv_x __ro_after_init = {
 
        .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = x2apic_get_apic_id,
-       .set_apic_id                    = set_apic_id,
 
        .calc_dest_apicid               = apic_default_calc_apicid,
 
index d4752382b60034b0b20e78cc087e88e543d7cc0e..8835d1cc961d8a7a07ca757db6683a6be9893a16 100644 (file)
@@ -33,12 +33,6 @@ static unsigned int xen_io_apic_read(unsigned apic, unsigned reg)
        return 0xfd;
 }
 
-static u32 xen_set_apic_id(u32 x)
-{
-       WARN_ON(1);
-       return x;
-}
-
 static u32 xen_get_apic_id(u32 x)
 {
        return ((x)>>24) & 0xFFu;
@@ -131,7 +125,6 @@ static struct apic xen_pv_apic __ro_after_init = {
 
        .max_apic_id                    = UINT_MAX,
        .get_apic_id                    = xen_get_apic_id,
-       .set_apic_id                    = xen_set_apic_id,
 
        .calc_dest_apicid               = apic_flat_calc_apicid,