Re: lfence for rdtsc

2020-06-21 Thread Robert Nagy
it definitely got better: cpu0: TSC skew=0 observed drift=0 cpu0: TSC skew=0 observed drift=0 cpu1: TSC skew=51 observed drift=0 cpu2: TSC skew=68 observed drift=0 cpu3: TSC skew=68 observed drift=0 cpu4: TSC skew=0 observed drift=0 cpu5: TSC skew=0 observed drift=0 cpu6: TSC skew=85 observed

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
This also handles negative skew values that my prevoius diff did not. For the last coulpe of weeks people told me that this thread is hard to follow sometimes. You can always get the latest changes here where the actual development takes place. (PR's accepted.)

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Matthieu Herrb
On Fri, Jun 19, 2020 at 06:46:00PM +1000, Matt Dunwoodie wrote: > Hi all, > > After the previous submission of WireGuard, we've again been through a > number of improvements. Thank you everyone for your feedback. Hi, I was wondering if there is a way to specify a routing domain/table for

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
Hi, New iteration that addresses the issues raised by Scott and Mark. a) Use sys/time.h defs by adding _LIBC b) Revert _timekeep init (breaks naddy@'s machine) c) Add TSC_SKEW_MAX thresholding when enabling tc_user d) uint->u_int Item c) adds the code needed for what Mark requested. The

Re: lfence for rdtsc

2020-06-21 Thread Theo de Raadt
Paul Irofti wrote: > If you change the name to rdtsc_ordered(), OK. That is a weaker name. Ordered in what way, at what level; ordered against what? This is using a specific pipeline ordering known as lfence. So it might as well say lfence. That is the technical name for that type of

Re: lfence for rdtsc

2020-06-21 Thread Paul Irofti
On Sat, Jun 20, 2020 at 10:02:19PM +0200, Mark Kettenis wrote: > RDTSC is not a serializing instruction; to make sure we get the TSC > value corresponding to the position of RDTSC in te instruction stream > we need a barrier. Linux uses LFENCE on machines where it is > available. FreeBSD seems

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
> b) Revert _timekeep init (breaks naddy@'s machine) Robert helped properly track down this issue to a silly null-ref. This new diff addresses this and also does not initialize _timekeep as Mark wanted. diff --git lib/libc/arch/aarch64/gen/Makefile.inc lib/libc/arch/aarch64/gen/Makefile.inc

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Matthieu Herrb
On Fri, Jun 19, 2020 at 06:46:00PM +1000, Matt Dunwoodie wrote: > Hi all, > > After the previous submission of WireGuard, we've again been through a > number of improvements. Thank you everyone for your feedback. Hi, While giving wireguard a try, I found that this patch is needed to fix

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread David Gwynne
On Sun, Jun 21, 2020 at 12:52:53PM +0200, Matthieu Herrb wrote: > On Fri, Jun 19, 2020 at 06:46:00PM +1000, Matt Dunwoodie wrote: > > Hi all, > > > > After the previous submission of WireGuard, we've again been through a > > number of improvements. Thank you everyone for your feedback. > > Hi, >

fsck_ffs: faster with lots of cylinder groups

2020-06-21 Thread Otto Moerbeek
Hi, both phase 1 and phase 5 need cylinder group metadata. This diff keeps the cg data read in phase 1 in memory to be used by phase 5 if possible. From FreeBSD. -Otto On an empty 30T fileystem: $ time obj/fsck_ffs -f /dev/sd3a 2m44.10s real 0m13.21s user 0m07.38s system

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Sonic
Along that line, does wireguard have any problems using alias addresses? It's not a problem with IKEv1 but it is with IKEv2. Thanks! Chris

Re: userland clock_gettime proof of concept

2020-06-21 Thread Christian Weisgerber
Paul Irofti: > This also handles negative skew values that my prevoius diff did not. > --- sys/arch/amd64/amd64/tsc.c > +++ sys/arch/amd64/amd64/tsc.c > @@ -216,6 +217,8 @@ tsc_get_timecount(struct timecounter *tc) > void > tsc_timecounter_init(struct cpu_info *ci, uint64_t cpufreq) > { > +

Re: lfence for rdtsc

2020-06-21 Thread Mark Kettenis
> Date: Sun, 21 Jun 2020 16:55:56 +0100 > From: Stuart Henderson > > On 2020/06/21 18:46, Paul Irofti wrote: > > > > > > În 21 iunie 2020 16:30:43 EEST, Theo de Raadt a scris: > > >Paul Irofti wrote: > > > > > >> If you change the name to rdtsc_ordered(), OK. > > > > > >That is a weaker

Re: sample unbound.conf tweak

2020-06-21 Thread Klemens Nanni
On Sun, Jun 21, 2020 at 04:47:22PM +0100, Stuart Henderson wrote: > An "uncomment" was left in when we reenabled dnssec by default, > and it seems a bit pointless to say "comment out to disable". ok? Reads better, yes. > Index: unbound.conf >

Re: userland clock_gettime proof of concept

2020-06-21 Thread Christian Weisgerber
Paul Irofti: > > b) Revert _timekeep init (breaks naddy@'s machine) > > Robert helped properly track down this issue to a silly null-ref. If that was indeed the problem... > --- lib/libc/dlfcn/init.c > +++ lib/libc/dlfcn/init.c > @@ -105,6 +107,14 @@ _libc_preinit(int argc, char **argv, char

vlan and bridge panic with latest snapshot

2020-06-21 Thread Hrvoje Popovski
Hi all, with today's snapshot from 21-Jun-2020 09:34 OpenBSD 6.7-current (GENERIC.MP) #286: Sun Jun 21 08:51:29 MDT 2020 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP if i do "ifconfig vlan" i'm getting assert x3550m4# ifconfig vlan vlan100: flags=8splassert:

Re: sample unbound.conf tweak

2020-06-21 Thread Stuart Henderson
On 2020/06/21 18:29, Klemens Nanni wrote: > On Sun, Jun 21, 2020 at 04:47:22PM +0100, Stuart Henderson wrote: > > An "uncomment" was left in when we reenabled dnssec by default, > > and it seems a bit pointless to say "comment out to disable". ok? > Reads better, yes. > > > Index: unbound.conf

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
On Sun, Jun 21, 2020 at 08:18:57PM +0200, Christian Weisgerber wrote: > Paul Irofti: > > > Can't test right now, but if you enable the TSC_DEBUG in cpu.c or if you > > put a printf in the CPU_INFO_FOREACH you will probably see the correct > > skew values. > > It's worse: CPU_INFO_FOREACH() only

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Patrick Wildt
On Sun, Jun 21, 2020 at 10:06:52AM -0400, Sonic wrote: > Along that line, does wireguard have any problems using alias > addresses? It's not a problem with IKEv1 but it is with IKEv2. > > Thanks! > > Chris I still don't see how this is a problem with IKEv2, so don't spread any rumours and

Re: userland clock_gettime proof of concept

2020-06-21 Thread Christian Weisgerber
Paul Irofti: [Unrelated, just to mark where we're at] > Right. Just reproduced it here. This moves the check at the top so that > each CPU checks its own skew and disables tc_user if necessary. I tweaked the patch locally to make _timekeep a visible global symbol in libc. Printing its value has

sample unbound.conf tweak

2020-06-21 Thread Stuart Henderson
An "uncomment" was left in when we reenabled dnssec by default, and it seems a bit pointless to say "comment out to disable". ok? Index: unbound.conf === RCS file: /cvs/src/etc/unbound.conf,v retrieving revision 1.19 diff -u -p

Re: lfence for rdtsc

2020-06-21 Thread Paul Irofti
În 21 iunie 2020 16:30:43 EEST, Theo de Raadt a scris: >Paul Irofti wrote: > >> If you change the name to rdtsc_ordered(), OK. > >That is a weaker name. > >Ordered in what way, at what level; ordered against what? > >This is using a specific pipeline ordering known as lfence. >So it might as

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
On Sun, Jun 21, 2020 at 05:44:36PM +0200, Christian Weisgerber wrote: > Paul Irofti: > > > This also handles negative skew values that my prevoius diff did not. > > > --- sys/arch/amd64/amd64/tsc.c > > +++ sys/arch/amd64/amd64/tsc.c > > @@ -216,6 +217,8 @@ tsc_get_timecount(struct timecounter

Re: sample unbound.conf tweak

2020-06-21 Thread Gleydson Soares
On Sun, Jun 21, 2020 at 04:47:22PM +0100, Stuart Henderson wrote: > An "uncomment" was left in when we reenabled dnssec by default, > and it seems a bit pointless to say "comment out to disable". ok? > makes sense, ok with me. > > Index: unbound.conf >

Re: lfence for rdtsc

2020-06-21 Thread Paul Irofti
On Sun, Jun 21, 2020 at 04:55:56PM +0100, Stuart Henderson wrote: > On 2020/06/21 18:46, Paul Irofti wrote: > > > > > > În 21 iunie 2020 16:30:43 EEST, Theo de Raadt a scris: > > >Paul Irofti wrote: > > > > > >> If you change the name to rdtsc_ordered(), OK. > > > > > >That is a weaker name. >

install npppd.conf with mode 0600

2020-06-21 Thread Vitaliy Makkoveev
We installing `npppd-users' with uid:gid root:wheel and mode 0600 because it consists sensitive data but mode for npppd.conf is 0640. npppd.conf can also have radius passwords and nothing requires to allow it be readable by group. So set it's permissions to 0600. Index: usr.sbin/npppd/Makefile

Re: lfence for rdtsc

2020-06-21 Thread Mark Kettenis
> From: "Theo de Raadt" > Date: Sun, 21 Jun 2020 07:30:43 -0600 > > Paul Irofti wrote: > > > If you change the name to rdtsc_ordered(), OK. > > That is a weaker name. > > Ordered in what way, at what level; ordered against what? > > This is using a specific pipeline ordering known as

Re: lfence for rdtsc

2020-06-21 Thread Stuart Henderson
On 2020/06/21 18:46, Paul Irofti wrote: > > > În 21 iunie 2020 16:30:43 EEST, Theo de Raadt a scris: > >Paul Irofti wrote: > > > >> If you change the name to rdtsc_ordered(), OK. > > > >That is a weaker name. > > > >Ordered in what way, at what level; ordered against what? > > > >This is using

Re: userland clock_gettime proof of concept

2020-06-21 Thread Theo de Raadt
Paul Irofti wrote: > > > > În 22 iunie 2020 01:26:16 EEST, Christian Weisgerber a > scris: > >Christian Weisgerber: > > > >> I tweaked the patch locally to make _timekeep a visible global > >> symbol in libc. > >> > >> Printing its value has revealed two issues: > >> > >> * The timekeep

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread Todd C . Miller
On Mon, 22 Jun 2020 11:01:05 +1000, David Gwynne wrote: > libc has undocumented base64 encoding and decoding funtionality. this > cuts ifconfig over to using it instead of the code in libcrypto. > > whether the libc functionality should be "blessed" and documented is a > separate issue. OK

Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Matt Dunwoodie
On Sun, 21 Jun 2020 15:54:00 +0200 Matthieu Herrb wrote: > Hi, > > I was wondering if there is a way to specify a routing domain/table > for wgendpoint in ifconfig(8). > > In a VPN client setup (roadwarrior style) I'd like to keep wg0 in > rdomain 0 and put the actual physical interface in

systat.1: Trim ":" description, support line kill character

2020-06-21 Thread Klemens Nanni
The manual's wording is untouched since import in 1995, engine.c however came to be in 2008 as "New display engine for systat" from canacar. While characte erase (^h) works, word erase (^w) is not implemented and line kill (^u) is supported but as ^g instead. I see no value in documenting this

systat.1: Remove ^z mention

2020-06-21 Thread Klemens Nanni
Suspending systat with ^Z is done by the shell iff job control is enabled, not systat itself. Try `set +m' to disable job control or start systat in a terminal without a shell, e.g. `xterm -e systat', to confirm that ^z does nothing in these cases. Feedback? OK? Index: systat.1

Re: install npppd.conf with mode 0600

2020-06-21 Thread YASUOKA Masahiko
The line in etc/mtree/special should be updated as well. npppd.conf type=file mode=0640 uname=root gname=wheel other than that, ok yasuoka On Sun, 21 Jun 2020 16:48:44 +0300 Vitaliy Makkoveev wrote: > We installing `npppd-users' with uid:gid root:wheel and mode 0600 > because it

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
În 22 iunie 2020 01:26:16 EEST, Christian Weisgerber a scris: >Christian Weisgerber: > >> I tweaked the patch locally to make _timekeep a visible global >> symbol in libc. >> >> Printing its value has revealed two issues: >> >> * The timekeep page is mapped to the same address for every

use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread David Gwynne
libc has undocumented base64 encoding and decoding funtionality. this cuts ifconfig over to using it instead of the code in libcrypto. whether the libc functionality should be "blessed" and documented is a separate issue. ok? Index: Makefile

mailwrapper: hostsat and purgestat symlinks

2020-06-21 Thread Klemens Nanni
Doing "*stat " in my shell I came across those two entries under /usr/bin/ which are undocumented: $ man -k any~'^(host|purge)stat$' man: nothing appropriate /etc/mailer.conf has no entries for them but mailer.conf(5)' EXAMPLES section demonstrates using them with the

systat.1: document "s" command

2020-06-21 Thread Klemens Nanni
Feedback? OK? Index: systat.1 === RCS file: /cvs/src/usr.bin/systat/systat.1,v retrieving revision 1.117 diff -u -p -r1.117 systat.1 --- systat.123 Apr 2020 07:57:27 - 1.117 +++ systat.122 Jun 2020 03:53:15 - @@

Re: userland clock_gettime proof of concept

2020-06-21 Thread Mark Kettenis
> Date: Mon, 22 Jun 2020 02:06:39 +0300 > From: Paul Irofti > > În 22 iunie 2020 00:15:59 EEST, Christian Weisgerber a > scris: > >Paul Irofti: > > > >[Unrelated, just to mark where we're at] > >> Right. Just reproduced it here. This moves the check at the top so > >that > >> each CPU checks

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread Matt Dunwoodie
On Mon, 22 Jun 2020 11:01:05 +1000 David Gwynne wrote: > libc has undocumented base64 encoding and decoding funtionality. this > cuts ifconfig over to using it instead of the code in libcrypto. > > whether the libc functionality should be "blessed" and documented is a > separate issue. > > ok?

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread Theo de Raadt
In that case you can also delete: ifconfig.c:#include

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread Jason A. Donenfeld
On Sun, Jun 21, 2020 at 7:01 PM David Gwynne wrote: > > libc has undocumented base64 encoding and decoding funtionality. this > cuts ifconfig over to using it instead of the code in libcrypto. > > whether the libc functionality should be "blessed" and documented is a > separate issue. > > ok? OK

Re: userland clock_gettime proof of concept

2020-06-21 Thread Christian Weisgerber
Christian Weisgerber: > I tweaked the patch locally to make _timekeep a visible global > symbol in libc. > > Printing its value has revealed two issues: > > * The timekeep page is mapped to the same address for every process. > It changes across reboots, but once running, it's always the

Re: userland clock_gettime proof of concept

2020-06-21 Thread Paul Irofti
În 22 iunie 2020 00:15:59 EEST, Christian Weisgerber a scris: >Paul Irofti: > >[Unrelated, just to mark where we're at] >> Right. Just reproduced it here. This moves the check at the top so >that >> each CPU checks its own skew and disables tc_user if necessary. > >I tweaked the patch locally

Re: lfence for rdtsc

2020-06-21 Thread Theo de Raadt
Mark Kettenis wrote: > But maybe the default rdtsc() should include the lfence. And then we > could have rdtsc_unordered() for this cases that don't care about > ordering. Right. But I don't like the word 'order', because it is too vague. There are layers of ordering, speculation,

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread David Gwynne
On Sun, Jun 21, 2020 at 07:15:15PM -0600, Theo de Raadt wrote: > In that case you can also delete: > > ifconfig.c:#include indeed i can. Index: Makefile === RCS file: /cvs/src/sbin/ifconfig/Makefile,v retrieving revision 1.16 diff

Re: userland clock_gettime proof of concept

2020-06-21 Thread Christian Weisgerber
Paul Irofti: > Can't test right now, but if you enable the TSC_DEBUG in cpu.c or if you > put a printf in the CPU_INFO_FOREACH you will probably see the correct > skew values. It's worse: CPU_INFO_FOREACH() only sees cpu0. The others aren't attached yet. -- Christian "naddy" Weisgerber

Re: Retire

2020-06-21 Thread Christian Weisgerber
On 2020-06-20, Christian Weisgerber wrote: >> Well... they something in ports might still look at them in >> >> >> Can someone from ports speak about this? > > I have started an amd64 bulk build without . There were no build failures attributable to this. The header can be removed. --