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

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
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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);
+0 −3
Original line number Diff line number Diff line
@@ -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);
}

+0 −7
Original line number Diff line number Diff line
@@ -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,

+0 −12
Original line number Diff line number Diff line
@@ -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,

+0 −1
Original line number Diff line number Diff line
@@ -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,

Loading