Commit 58d16928 authored by Thomas Gleixner's avatar Thomas Gleixner

x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid

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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarMichael Kelley <mhklinux@outlook.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20240212154640.055288922@linutronix.de

parent 350b5e27
......@@ -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);
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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);
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment