lkml.org 
[lkml]   [2023]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch 39/53] x86/cpu/topology: Reject unknown APIC IDs on ACPI hotplug
Date
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>
---
arch/x86/kernel/cpu/topology.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/arch/x86/kernel/cpu/topology.c
+++ b/arch/x86/kernel/cpu/topology.c
@@ -237,6 +237,10 @@ int topology_hotplug_apic(u32 apic_id, u
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)
\
 
 \ /
  Last update: 2023-08-07 15:55    [W:0.351 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site