Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2017 13:34:10 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319942 - head/sys/x86/x86
Message-ID:  <201706141334.v5EDYAjG094466@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jun 14 13:34:09 2017
New Revision: 319942
URL: https://svnweb.freebsd.org/changeset/base/319942

Log:
  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

Modified:
  head/sys/x86/x86/intr_machdep.c

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c	Wed Jun 14 13:23:40 2017	(r319941)
+++ head/sys/x86/x86/intr_machdep.c	Wed Jun 14 13:34:09 2017	(r319942)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706141334.v5EDYAjG094466>