diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2023-08-08 15:03:50 -0700 |
|---|---|---|
| committer | Dave Hansen <dave.hansen@linux.intel.com> | 2023-08-09 11:58:21 -0700 |
| commit | e8122513ff9e92cdc514ad6cbb5c25d551ac3629 (patch) | |
| tree | daad96d520a2b933220c8045cbcabb4d2f3b0438 /arch/x86/kernel/apic/apic.c | |
| parent | 24889a3a5314f71e7bca586b607882d87c71799c (diff) | |
| download | linux-e8122513ff9e92cdc514ad6cbb5c25d551ac3629.tar.gz linux-e8122513ff9e92cdc514ad6cbb5c25d551ac3629.tar.bz2 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 'arch/x86/kernel/apic/apic.c')
| -rw-r--r-- | arch/x86/kernel/apic/apic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 84ff5b27590b..564d584c8b99 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2130,9 +2130,12 @@ void __init init_apic_mappings(void) if (x2apic_mode) return; - if (!smp_found_config && !detect_init_APIC()) { - pr_info("APIC: disable apic facility\n"); - apic_disable(); + if (!smp_found_config) { + if (!detect_init_APIC()) { + pr_info("APIC: disable apic facility\n"); + apic_disable(); + } + num_processors = 1; } } |
