From owner-svn-src-head@freebsd.org Thu Jan 18 07:38:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E49F3EBA67F; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06FE7DF10; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CFCC1B642; Thu, 18 Jan 2018 07:38:55 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0I7csUq054485; Thu, 18 Jan 2018 07:38:54 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0I7cswv054484; Thu, 18 Jan 2018 07:38:54 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201801180738.w0I7cswv054484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 18 Jan 2018 07:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328110 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 07:38:56 -0000 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 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);