From owner-svn-src-head@freebsd.org Thu Nov 16 07:25:13 2017 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 E0DA6DC1014; Thu, 16 Nov 2017 07:25:13 +0000 (UTC) (envelope-from markj@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 mx1.freebsd.org (Postfix) with ESMTPS id A94F770883; Thu, 16 Nov 2017 07:25:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAG7PCUZ029897; Thu, 16 Nov 2017 07:25:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAG7PCZd029895; Thu, 16 Nov 2017 07:25:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711160725.vAG7PCZd029895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Nov 2017 07:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325887 - in head/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 325887 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, 16 Nov 2017 07:25:14 -0000 Author: markj Date: Thu Nov 16 07:25:12 2017 New Revision: 325887 URL: https://svnweb.freebsd.org/changeset/base/325887 Log: Avoid holding the process in uread() and uwrite(). In general, higher-level code will atomically verify that the process is not exiting and hold the process. In one case, we were using uwrite() to copy a probed instruction to a per-thread scratch space block, but copyout() can be used for this purpose instead; this change effectively reverts r227291. MFC after: 1 week Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c Thu Nov 16 07:14:29 2017 (r325886) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c Thu Nov 16 07:25:12 2017 (r325887) @@ -35,9 +35,7 @@ uread(proc_t *p, void *kaddr, size_t len, uintptr_t ua { ssize_t n; - PHOLD(p); n = proc_readmem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); @@ -48,9 +46,7 @@ uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t u { ssize_t n; - PHOLD(p); n = proc_writemem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 16 07:14:29 2017 (r325886) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 16 07:25:12 2017 (r325887) @@ -1715,11 +1715,7 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); -#ifdef illumos if (fasttrap_copyout(scratch, (char *)addr, i)) { -#else - if (uwrite(p, scratch, i, addr)) { -#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break;