OpenBSD cvs log

created 2020-08-16T08:53:56Z
begin 2020-08-11T00:00:00Z
end 2020-08-12T00:00:00Z
path src/sys
commits 6

date 2020-08-11T14:57:56Z
author cheloha
files src/sys/sys/proc.h log diff annotate
message struct process: annotate locking for getitimer(2), setitimer(2)

The ITIMER_REAL itimerspec (ps_timer[0]) and timeout (ps_realit_to)
are protected by the kernel lock. Annotate them with "K".

The ITIMER_VIRTUAL and ITIMER_PROF itimerspecs (ps_timer[1],
ps_timer[2]) are protected by itimer_mtx. Annotate them with "T",
for "timer".

With input from kettenis@ and anton@.

ok kettenis@, anton@

date 2020-08-11T15:23:57Z
author krw
files src/sys/scsi/cd.c log diff annotate
src/sys/scsi/ch.c log diff annotate
src/sys/scsi/scsi_base.c log diff annotate
src/sys/scsi/scsi_ioctl.c log diff annotate
src/sys/scsi/scsiconf.c log diff annotate
src/sys/scsi/sd.c log diff annotate
src/sys/scsi/st.c log diff annotate
src/sys/scsi/uk.c log diff annotate
message Explicitly #include <scsi/scsi_debug.h> rather than assuming scsiconf.h will do
it.

Prepares for removal of #include <scsi/scsi_debug.h> from scsiconf.h as soon as
the alpha tester digs out from hurricane to compile last untested files.

date 2020-08-11T15:41:50Z
author cheloha
files src/sys/kern/kern_time.c log diff annotate
message getitimer(2): don't enter itimer_mtx to read ITIMER_REAL itimerspec

The ITIMER_REAL per-process interval timer is protected by the kernel
lock. The ITIMER_REAL timeout (ps_realit_to), setitimer(2), and
getitimer(2) all run under the kernel lock. Entering itimer_mtx
during getitimer(2) when reading the ITIMER_REAL ps_timer state is
superfluous and misleading.

date 2020-08-11T18:29:58Z
author cheloha
files src/sys/kern/kern_time.c log diff annotate
message setitimer(2): consolidate copyin(9), input validation, input conversion

For what are probably historical reasons, setitimer(2) does not
validate its input (itv) immediately after copyin(9). Instead, it
waits until after (possibly) performing a getitimer(2) to copy out the
state of the timer.

Consolidating copyin(9), input validation, and input conversion into a
single block before the getitimer(2) operation makes setitimer(2)
itself easier to read. It will also simplify merging the critical
sections of setitimer(2) and getitimer(2) in a subsequent patch.

This changes setitimer(2)'s behavior in the EINVAL case. Currently,
if your input (itv) is invalid, we return EINVAL *after* modifying the
output (olditv). With the patch we will now return EINVAL *before*
modifying the output. However, any code dependent upon this behavior
is broken: the contents of olditv are undefined in all setitimer(2)
error cases.

ok millert@

date 2020-08-11T22:00:51Z
author cheloha
files src/sys/kern/kern_time.c log diff annotate
message setitimer(2): write new timer value in one place

Rearrange the critical section in setitimer(2) to match that of
getitimer(2). This will make it easier to merge the two critical
sections in a subsequent diff.

In particular, we want to write the new timer value in *one* place in
the code, regardless of which timer we're setting.

ok millert@

date 2020-08-11T23:40:54Z
author kn
files src/sys/net/if_pfsync.c log diff annotate
message Run start routing without KERNEL_LOCK()

pfsyncstart() does not require the big lock, make it use the ifq API.

OK mvs