diff options
author | 2023-08-08 15:03:50 -0700 | |
---|---|---|
committer | 2023-08-09 11:58:21 -0700 | |
commit | e8122513ff9e92cdc514ad6cbb5c25d551ac3629 (patch) | |
tree | daad96d520a2b933220c8045cbcabb4d2f3b0438 /arch/x86/kernel/smpboot.c | |
parent | x86/xen/pv: Pretend that it found SMP configuration (diff) | |
download | wireguard-linux-e8122513ff9e92cdc514ad6cbb5c25d551ac3629.tar.xz wireguard-linux-e8122513ff9e92cdc514ad6cbb5c25d551ac3629.zip |
x86/apic: Sanitize num_processors handling
num_processors is 0 by default and only gets incremented when local APICs
are registered.
Make init_apic_mappings(), which tries to enable the local APIC in the case
that no SMP configuration was found set num_processors to 1.
This allows to remove yet another check for the local APIC and yet another
place which registers the boot CPUs local APIC ID.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 5467c58827f5..fc2173b7dc89 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1397,24 +1397,6 @@ __init void prefill_possible_map(void) { int i, possible; - /* No processor was found in mptable or ACPI MADT */ - if (!num_processors) { - if (boot_cpu_has(X86_FEATURE_APIC)) { - int apicid = boot_cpu_physical_apicid; - int cpu = read_apic_id(); - - pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu); - - /* Make sure boot cpu is enumerated */ - if (apic->cpu_present_to_apicid(0) == BAD_APICID && - apic->apic_id_valid(apicid)) - generic_processor_info(apicid); - } - - if (!num_processors) - num_processors = 1; - } - i = setup_max_cpus ?: 1; if (setup_possible_cpus == -1) { possible = num_processors; |