vmm: Call for testing: Expose TSC to guest

2017-07-22 Thread Pratik Vyas
Hello tech@, The following diff should expose TSC to guest vm and OpenBSD guests should be able to choose tsc as a preferred timecounter if the host machine is >= skylake. This should improve the guest clock drift situation significantly. I am aware that this breaks received vms and am workin

Re: getdelim(3): perror -> err in example

2017-07-22 Thread Jeremie Courreges-Anglas
On Sun, Jul 23 2017, Ingo Schwarze wrote: > Hi Jeremie, > > Jeremie Courreges-Anglas wrote on Sun, Jul 23, 2017 at 12:43:14AM +0200: > >> getline(3) and perror(3) are in posix, but fgetln(3) and err(3) come >> from 4.4BSD (according to their manpage). We should probably keep the >> example code p

Re: getdelim(3): perror -> err in example

2017-07-22 Thread Ingo Schwarze
Hi Jeremie, Jeremie Courreges-Anglas wrote on Sun, Jul 23, 2017 at 12:43:14AM +0200: > getline(3) and perror(3) are in posix, but fgetln(3) and err(3) come > from 4.4BSD (according to their manpage). We should probably keep the > example code posix-compliant. Paul Janzen asked me the same quest

Re: simple ifstated pledge

2017-07-22 Thread Jeremie Courreges-Anglas
On Sat, Jul 22 2017, Rob Pierce wrote: > On Sun, Jul 23, 2017 at 12:26:53AM +0200, Jeremie Courreges-Anglas wrote: >> On Sat, Jul 22 2017, Rob Pierce wrote: >> > With the most recent commit ifstated can now be pledged in a straight >> > forward >> > manner. A better pledge is possible with more

Re: simple ifstated pledge

2017-07-22 Thread Rob Pierce
On Sun, Jul 23, 2017 at 12:26:53AM +0200, Jeremie Courreges-Anglas wrote: > On Sat, Jul 22 2017, Rob Pierce wrote: > > With the most recent commit ifstated can now be pledged in a straight > > forward > > manner. A better pledge is possible with more work. > > > > Does it make sense to get this o

Re: getdelim(3): perror -> err in example

2017-07-22 Thread Jeremie Courreges-Anglas
On Sat, Jul 22 2017, Anton Lindqvist wrote: > Hi, > This changes the behavior of the example but makes it consistent with > the example in fgetln(3) and many other manuals. > > Comments? OK? getline(3) and perror(3) are in posix, but fgetln(3) and err(3) come from 4.4BSD (according to their manpa

Re: simple ifstated pledge

2017-07-22 Thread Jeremie Courreges-Anglas
On Sat, Jul 22 2017, Rob Pierce wrote: > With the most recent commit ifstated can now be pledged in a straight forward > manner. A better pledge is possible with more work. > > Does it make sense to get this one in now? Regress tests pass. I think this is the way to go. ok jca@ > Rob > > Index

pflogd: cope with interface departure

2017-07-22 Thread Jeremie Courreges-Anglas
If you destroy the interface pflogd(8) listens on, you get killed because socket(2) is denied by the current pledge(2) restrictions: pflogd(15868): syscall 97 "inet" The ioctl(SIOCGIFDATA) call would be fatal too. The diff below just uses if_nametoindex(3), which is always allowed. The if_exi

newsyslog: simplify mail sending

2017-07-22 Thread Jeremie Courreges-Anglas
I have nothing against asprintf(3), but the openmail function looks needlessly complicated. ok? Index: newsyslog.c === RCS file: /d/cvs/src/usr.bin/newsyslog/newsyslog.c,v retrieving revision 1.107 diff -u -p -p -u -r1.107 newsyslo

Re: acpibat: add _BIX support

2017-07-22 Thread Theo de Raadt
Converting bif into a bix; that makes my brain a lot happier!

Re: acpibat: add _BIX support

2017-07-22 Thread joshua stein
On Sat, 22 Jul 2017 at 18:07:56 +0200, Mark Kettenis wrote: > > Date: Fri, 21 Jul 2017 23:31:28 -0500 > > From: joshua stein > > > > ACPI 4.0 deprecated _BIF for battery status, so some newer machines > > have _BIX instead which provides the same info plus some extra > > fields. > > > > I used s

Re: time(1): perror(3) -> err(3) and friends

2017-07-22 Thread Ingo Schwarze
Hi, Scott Cheloha wrote on Thu, Jul 13, 2017 at 07:30:26PM -0500: > We currently use a mix of perror(3) and err(3). > > In one case you can merge perror + exit into err, which is nice. > > The warns, though, are not equivalent (you get a "time: " prefix), > so maybe this is too risky. > > Putt

Re: time(1): make global flags local

2017-07-22 Thread Ingo Schwarze
Hi, Scott Cheloha wrote on Thu, Jul 13, 2017 at 07:14:08PM -0500: > The flags don't need to be global, and there are more obvious > ways to zero a variable. > > While here, order the stack structures and variables by size. Committed with tweaks. Ingo > Index: usr.bin/time/time.c > =

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Ingo Schwarze
Hi Scott, Scott Cheloha wrote on Sat, Jul 22, 2017 at 11:27:17AM -0500: > Okay, going back and rereading, it appears he meant specifically to not > (void) stuff like printf or fprintf, e.g. > > (void)fprintf(stderr, "usage: prog [args]\n"); /* don't do this */ Even on printf(3), (void) m

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Scott Cheloha
> Date: Sat, 22 Jul 2017 15:29:17 +0200 > From: Ingo Schwarze > > Hi Scott, > > Scott Cheloha wrote on Fri, Jul 21, 2017 at 05:03:11PM -0500: > >> Per encouragement from deraadt@, > > Not sure what exactly he said, but i'm quite sure you misunderstood him. Okay, going back and rereading, it

Re: time(1): kill some lint-era voids, switch to getprogname(3)

2017-07-22 Thread Ingo Schwarze
Hi Scott, Scott Cheloha wrote on Thu, Jul 13, 2017 at 07:37:46PM -0500: > The (void) casts are going out of style. While here, > switch from __progname to getprogname(3) Committed. Ingo > Index: usr.bin/time/time.c > === > RCS

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Mark Kettenis
> Date: Sat, 22 Jul 2017 17:49:19 +0200 > From: Ingo Schwarze > > Hi Mark, > > Mark Kettenis wrote on Sat, Jul 22, 2017 at 04:11:03PM +0200: > > > int foo(void) __attribute__((warn_unused_result)); > > > > I think it would be good if you started using that > > in our system headers for some f

Re: acpibat: add _BIX support

2017-07-22 Thread Mark Kettenis
> Date: Fri, 21 Jul 2017 23:31:28 -0500 > From: joshua stein > > ACPI 4.0 deprecated _BIF for battery status, so some newer machines > have _BIX instead which provides the same info plus some extra > fields. > > I used some macro magic to make the diff less painful, and added a > sensor for the

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Ingo Schwarze
Hi Mark, Mark Kettenis wrote on Sat, Jul 22, 2017 at 04:11:03PM +0200: > int foo(void) __attribute__((warn_unused_result)); > > I think it would be good if you started using that > in our system headers for some functions. Sounds worth considering, ... > clang allows one to suppress the warni

Re: net80211: panic on invalid state transitions

2017-07-22 Thread Kevin Lo
On Fri, Jul 21, 2017 at 06:55:42PM +0200, Stefan Sperling wrote: > > The rsu(4) driver got subtly broken in -current because it did an > invalid state transition in net80211 and hence didn't actually run > some of the net80211 setup code after association. > > To make diagnosing such bugs easier

Tolerate imprecise fault address in siginfo-fault regress

2017-07-22 Thread Mark Kettenis
This makes the tests pass on sparc64 where the hardware doesn't give us the low bits of the faulting address. ok? Index: regress/sys/kern/siginfo-fault/siginfo-fault.c === RCS file: /cvs/src/regress/sys/kern/siginfo-fault/siginfo-fa

Re: llvm - xor return pointers

2017-07-22 Thread Theo de Raadt
> Cool stuff. The downside is that this probably kills doing > backtraces, making debugging stuff hard. Unless this also changes the > DWARF debugging information to reflect the xor operation. But I'm not > sure that's possible. I think it is possible, but some help is probably needed in gdb.

Re: llvm - xor return pointers

2017-07-22 Thread Mark Kettenis
> Date: Sat, 22 Jul 2017 02:25:29 -0400 > From: Todd Mortimer > > Hello tech, > > I've been working on llvm/clang some lately, and am experimenting with > the llvm Pass infrastructure. Passes essentially let you perform > arbitrary transforms on the program at various points in the compilation >

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Mark Kettenis
> Date: Sat, 22 Jul 2017 15:29:17 +0200 > From: Ingo Schwarze > > Hi Scott, > > Scott Cheloha wrote on Fri, Jul 21, 2017 at 05:03:11PM -0500: > > > Per encouragement from deraadt@, > > Not sure what exactly he said, but i'm quite sure you misunderstood him. > > I have both removed and added (

macppc: initialize brightness

2017-07-22 Thread Anton Lindqvist
Hi, The brightness on my PowerBook6,4 prior pressing either the brightness down/up key looks odd: $ wsconsctl display.brightness display.brightness=4294967271.4294967235% Since cons_brightness is initialized to 0 and MIN_BRIGHTNESS is greater than 0, the percentage calculation performed by ws

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Ingo Schwarze
Hi Scott, Scott Cheloha wrote on Fri, Jul 21, 2017 at 05:03:11PM -0500: > Per encouragement from deraadt@, Not sure what exactly he said, but i'm quite sure you misunderstood him. I have both removed and added (void) casts in the past. Removed from functions like close(3) where they are usuall

Re: crypt_checkpass.3: mention additional failure case for crypt_newhash

2017-07-22 Thread Scott Cheloha
> On Jul 21, 2017, at 10:24 PM, Ted Unangst wrote: > > Scott Cheloha wrote: >> crypt_newhash(3) will return -1 and set errno to EINVAL if hashsize is >> too small to accommodate bcrypt's hash space. I imagine this would >> also be the case if anything other than bcrypt were supported. > > i wen

sparc64 SIGBUS/SIGTRAP fixes

2017-07-22 Thread Mark Kettenis
This one is a bit bigger since sparc64 has many trap handlers. This doesn't completely fix the regression test since the hardware always sets the lower two bits to zero when reporting the address for alignment traps. I'll submit a separate diff to handle that in the regress test. ok? Index: ar

pfkeyv2 rename struct keycb pointer

2017-07-22 Thread Claudio Jeker
Suggested by bluhm@, switch from struct keycb *pk to struct keycb *kp. OK? -- :wq Claudio Index: net/pfkeyv2.c === RCS file: /cvs/src/sys/net/pfkeyv2.c,v retrieving revision 1.163 diff -u -p -r1.163 pfkeyv2.c --- net/pfkeyv2.c

Re: time(1): use monotonic clock for computing elapsed time

2017-07-22 Thread Anton Lindqvist
On Sat, Jul 22, 2017 at 10:19:22AM +0200, Anton Lindqvist wrote: > On Fri, Jul 21, 2017 at 04:34:53PM -0500, Scott Cheloha wrote: > > ~1 week bump. Changes to time(1) were committed by tedu@. > > > > Any feedback on the ksh/csh portions of the patch? > > Looks good. I'm willing to commit this di

getdelim(3): perror -> err in example

2017-07-22 Thread Anton Lindqvist
Hi, This changes the behavior of the example but makes it consistent with the example in fgetln(3) and many other manuals. Comments? OK? Index: getdelim.3 === RCS file: /cvs/src/lib/libc/stdio/getdelim.3,v retrieving revision 1.4 dif

Re: time(1): use monotonic clock for computing elapsed time

2017-07-22 Thread Anton Lindqvist
On Fri, Jul 21, 2017 at 04:34:53PM -0500, Scott Cheloha wrote: > ~1 week bump. Changes to time(1) were committed by tedu@. > > Any feedback on the ksh/csh portions of the patch? Looks good. I'm willing to commit this diff if I can get another ok.