Skip to content

Commit 7cdcdab

Browse files
committed
x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug
The topology bitmaps track all possible APIC IDs which have been registered during enumeration. As sizing and further topology information is going to be derived from these bitmaps, reject attempts to hotplug an APIC ID which was not registered during enumeration. 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/20240213210252.462231229@linutronix.de
1 parent f1f758a commit 7cdcdab

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/x86/kernel/cpu/topology.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ int topology_hotplug_apic(u32 apic_id, u32 acpi_id)
272272
if (apic_id >= MAX_LOCAL_APIC)
273273
return -EINVAL;
274274

275+
/* Reject if the APIC ID was not registered during enumeration. */
276+
if (!test_bit(apic_id, apic_maps[TOPO_SMT_DOMAIN].map))
277+
return -ENODEV;
278+
275279
cpu = topo_lookup_cpuid(apic_id);
276280
if (cpu < 0) {
277281
if (topo_info.nr_assigned_cpus >= nr_cpu_ids)

0 commit comments

Comments
 (0)