x86/topology: Don't update cpu_possible_map in topo_set_cpuids()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 8 Apr 2024 13:22:01 +0000 (15:22 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 10 Apr 2024 13:31:38 +0000 (15:31 +0200)
commita9025cd1c673a8d6eefc79d911075b8b452eba8f
tree8c4efc2151ed13d080156f9e4917b0180a6716eb
parent04f4230e2f86a4e961ea5466eda3db8c1762004d
x86/topology: Don't update cpu_possible_map in topo_set_cpuids()

topo_set_cpuids() updates cpu_present_map and cpu_possible map. It is
invoked during enumeration and "physical hotplug" operations. In the
latter case this results in a kernel crash because cpu_possible_map is
marked read only after init completes.

There is no reason to update cpu_possible_map in that function. During
enumeration cpu_possible_map is not relevant and gets fully initialized
after enumeration completed. On "physical hotplug" the bit is already set
because the kernel allows only CPUs to be plugged which have been
enumerated and associated to a CPU number during early boot.

Remove the bogus update of cpu_possible_map.

Fixes: 0e53e7b656cf ("x86/cpu/topology: Sanitize the APIC admission logic")
Reported-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/87ttkc6kwx.ffs@tglx
arch/x86/kernel/cpu/topology.c