Date: Thu, 16 Nov 2017 07:25:12 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> 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 Message-ID: <201711160725.vAG7PCZd029895@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711160725.vAG7PCZd029895>