Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2018 07:38:54 +0000 (UTC)
From:      Wojciech Macek <wma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328110 - head/sys/kern
Message-ID:  <201801180738.w0I7cswv054484@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wma
Date: Thu Jan 18 07:38:54 2018
New Revision: 328110
URL: https://svnweb.freebsd.org/changeset/base/328110

Log:
  KDB: restart only CPUs stopped by KDB
  
  There is a case when not all CPUs went online. In that situation,
  restart only APs which were operational before entering KDB.
  
  Created by:            Wojciech Macek <wma@semihalf.com>
  Obtained from:         Semihalf
  Reviewed by:           nwhitehorn
  Differential revision: https://reviews.freebsd.org/D13949
  Sponsored by:          QCM Technologies

Modified:
  head/sys/kern/subr_kdb.c

Modified: head/sys/kern/subr_kdb.c
==============================================================================
--- head/sys/kern/subr_kdb.c	Thu Jan 18 06:28:21 2018	(r328109)
+++ head/sys/kern/subr_kdb.c	Thu Jan 18 07:38:54 2018	(r328110)
@@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf)
 #ifdef SMP
 	if (!SCHEDULER_STOPPED()) {
 		other_cpus = all_cpus;
+		CPU_NAND(&other_cpus, &stopped_cpus);
 		CPU_CLR(PCPU_GET(cpuid), &other_cpus);
 		stop_cpus_hard(other_cpus);
 		did_stop_cpus = 1;
@@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf)
 	kdb_active--;
 
 #ifdef SMP
+	CPU_AND(&other_cpus, &stopped_cpus);
 	if (did_stop_cpus)
-		restart_cpus(stopped_cpus);
+		restart_cpus(other_cpus);
 #endif
 
 	intr_restore(intr);



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