CVS commit: src/lib/libc/sys

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Apr  7 00:56:14 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Correction in ptrace(2) about operations that emit signals

PT_STEP and PT_DETACH cannot emit signals
PT_CONTINUE and PT_SYSCALL can emit signals

Pointed out by 


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/libc/sys/ptrace.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/opencrypto

2017-04-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr  7 12:15:51 UTC 2017

Modified Files:
src/sys/opencrypto: cryptodev.c cryptodev.h

Log Message:
fix race among crypto_done(), cryptoret(), and {cryptodev_op(), 
cryptodev_key()}.

crypto_op() waited to be set CRYPTO_F_DONE with crp->crp_cv.
However, there is context switch chances between being set CRYPTO_F_DONE in
crypto_done() and done cv_signal(crp->crp_cv) in cryptodev_cb(), that is,
cryptodev_op() thread can run to cv_destroy(crp->crp_cv) before cryptoret()
thread is waken up. As a result, cryptodev_cb() can call invalid(destroyed)
cv_signal(crp->crp_cv).

Furthermore, below two implementations cause other races.
- waiting CRYPTO_F_DONE with crp->crp_cv
- context witch chances between set CRYPTO_F_DONE and cv_signal(crp->crp_cv)

So, use other flag(CRYPTO_F_DQRETQ) for cryptodev_op() and cryptodev_key(),
and then call cv_signal(crp->crp_cv) immediately after set CRYPTO_F_DQRETQ.

Tested concurrent over 20 processes with software and hardware drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.29 -r1.30 src/sys/opencrypto/cryptodev.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/ia64/conf

2017-04-07 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Apr  7 17:07:09 UTC 2017

Modified Files:
src/sys/arch/ia64/conf: GENERIC GENERIC.SKI

Log Message:
Add more options, mainly want "options INET" and "pseudo-device loop" so 
context bug occurs


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/conf/GENERIC
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ia64/conf/GENERIC.SKI

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/sys

2017-04-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  7 07:21:58 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Fix typos and some grammar


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/sys/ptrace.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/opencrypto

2017-04-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr  7 12:17:57 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c cryptodev.c

Log Message:
the processing said "ghastly hacks" is unnecessary now.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/opencrypto/crypto.c
cvs rdiff -u -r1.87 -r1.88 src/sys/opencrypto/cryptodev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 00:25:50 UTC 2017

Modified Files:
src/sys/arch/amd64/include: ptrace.h
src/sys/arch/arc/include: ptrace.h
src/sys/arch/arm/include: ptrace.h
src/sys/arch/hppa/include: ptrace.h
src/sys/arch/ia64/include: ptrace.h
src/sys/arch/m68k/include: ptrace.h
src/sys/arch/mips/include: ptrace.h
src/sys/arch/powerpc/include: ptrace.h
src/sys/arch/sh3/include: ptrace.h
src/sys/arch/vax/include: ptrace.h
src/sys/kern: sys_ptrace_common.c
src/sys/sys: lwp.h
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add new ptrace(2) API: PT_SETSTEP & PT_CLEARSTEP

These operations allow to mark thread as a single-stepping one.

This allows to i.a.:
 - single step and emit a signal (PT_SETSTEP & PT_CONTINUE)
 - single step and trace syscall entry and exit (PT_SETSTEP & PT_SYSCALL)

The former is useful for debuggers like GDB or LLDB. The latter can be used
to singlestep a usermode kernel. These examples don't limit use-cases of
this interface.

Define PT_*STEP only for platforms defining PT_STEP.

Add new ATF tests setstep[1234].

These ptrace(2) operations first appeared in FreeBSD.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/include/ptrace.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arc/include/ptrace.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/ptrace.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hppa/include/ptrace.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/ptrace.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/m68k/include/ptrace.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/include/ptrace.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/ptrace.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sh3/include/ptrace.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/ptrace.h
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.172 -r1.173 src/sys/sys/lwp.h
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_ptrace_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/sys

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 00:56:38 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Document new calls and be more clear about PT_SYSCALL* in ptrace(2)

Document PT_SETSTEP and PT_CLEARSTEP in ptrace(2).

Try to explain more details of PT_SYSCALL and PT_SYSCALLEMU.

The description of PT_*STEP has been obtained from FreeBSD.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libc/sys/ptrace.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/sys

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 00:58:35 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Fix typo in previous (ptrace(2))


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/sys/ptrace.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 01:08:36 UTC 2017

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update TODO.ptrace

Remove entries:
  - research support PT_SYSCALL & PT_STEP combined like in Linux
  - GDB Remote Protocol expects a case with a step with a signal to be sent,
this is currently unsupported on NetBSD

Implemented as PT_SETSTEP and PT_CLEARSTEP.

Remove:
  - support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
stop routing a set of signals to tracer as they are uninteresting - GDB and
LLDB expect this feature

This interface has been abandoned and will be handled on the debugger level.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/doc/TODO.ptrace

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 01:29:31 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
ptrace(2): Add operations to single step specified threads:
   PT_SETSTEP and PT_CLEARSTEP

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.2268 -r1.2269 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/i386/include

2017-04-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  8 02:02:30 UTC 2017

Modified Files:
src/sys/arch/i386/include: ptrace.h

Log Message:
Define PT_SETSTEP and PT_CLEARSTEP for i386 (ptrace(2))

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/include/ptrace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.