From fecabb72e14e7aa94fdd36fee77e21f80e65604d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 14 Jun 2017 13:34:09 +0000 Subject: [PATCH] Don't try to assign interrupts to a CPU on single-CPU systems. All interrupts are routed to the sole CPU in that case implicitly. This is a regression in EARLY_AP_STARTUP. Previously the 'assign_cpu' variable was only set when a multi-CPU system finished booting, so it's value both meant that interrupts could be assigned and that there was more than one CPU. PR: 219882 Reported by: ota@j.email.ne.jp MFC after: 3 days --- sys/x86/x86/intr_machdep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c index bb47a3e9aaa..d8162cedb94 100644 --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -312,7 +312,9 @@ intr_assign_cpu(void *arg, int cpu) #ifdef EARLY_AP_STARTUP MPASS(mp_ncpus == 1 || smp_started); - if (cpu != NOCPU) { + + /* Nothing to do if there is only a single CPU. */ + if (mp_ncpus > 1 && cpu != NOCPU) { #else /* * Don't do anything during early boot. We will pick up the @@ -500,6 +502,8 @@ intr_next_cpu(void) #ifdef EARLY_AP_STARTUP MPASS(mp_ncpus == 1 || smp_started); + if (mp_ncpus == 1) + return (PCPU_GET(apic_id)); #else /* Leave all interrupts on the BSP during boot. */ if (!assign_cpu)