From owner-svn-src-head@freebsd.org Mon Apr 2 07:45:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390EDF79CAD; Mon, 2 Apr 2018 07:45:14 +0000 (UTC) (envelope-from avg@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 DE63C72B1D; Mon, 2 Apr 2018 07:45:13 +0000 (UTC) (envelope-from avg@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 D54F212D54; Mon, 2 Apr 2018 07:45:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w327jDEA089793; Mon, 2 Apr 2018 07:45:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w327jDOO089791; Mon, 2 Apr 2018 07:45:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804020745.w327jDOO089791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Apr 2018 07:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331874 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 331874 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: Mon, 02 Apr 2018 07:45:14 -0000 Author: avg Date: Mon Apr 2 07:45:13 2018 New Revision: 331874 URL: https://svnweb.freebsd.org/changeset/base/331874 Log: x86 cpu_reset_proxy: no need to stop_cpus() the original processor The processor is "parked" in a spin-loop already and that's sufficient for the reset. There is nothing that stop_cpus() would add here, only extra complexity and fragility. The original processor does not need to enable interrupts now, in fact, it must not do that. MFC after: 2 weeks Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873) +++ head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) @@ -569,14 +569,11 @@ cpu_set_user_tls(struct thread *td, void *tls_base) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -616,7 +613,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1) Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873) +++ head/sys/i386/i386/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) @@ -581,14 +581,11 @@ kvtop(void *addr) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -628,7 +625,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1)