Commit 7cdcdab1 authored by Thomas Gleixner's avatar Thomas Gleixner

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: 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/20240213210252.462231229@linutronix.de

parent f1f758a8
......@@ -272,6 +272,10 @@ int topology_hotplug_apic(u32 apic_id, u32 acpi_id)
if (apic_id >= MAX_LOCAL_APIC)
return -EINVAL;
/* Reject if the APIC ID was not registered during enumeration. */
if (!test_bit(apic_id, apic_maps[TOPO_SMT_DOMAIN].map))
return -ENODEV;
cpu = topo_lookup_cpuid(apic_id);
if (cpu < 0) {
if (topo_info.nr_assigned_cpus >= nr_cpu_ids)
......
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