x86/apic: Sanitize num_processors handling
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:03:50 +0000 (15:03 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:21 +0000 (11:58 -0700)
commite8122513ff9e92cdc514ad6cbb5c25d551ac3629
treedaad96d520a2b933220c8045cbcabb4d2f3b0438
parent24889a3a5314f71e7bca586b607882d87c71799c
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)
arch/x86/kernel/apic/apic.c
arch/x86/kernel/smpboot.c