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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to