Re: Undefined Behavior at jsmn.c

2020-07-12 Thread Otto Moerbeek
On Sun, Jul 12, 2020 at 09:57:02AM +0430, Ali Farzanrad wrote: > Hi @tech, > > I was comparing jsmn.c in acme-client with jsmn.c in FreeBSD [1]. > I found a switch without a default case which is an undefined behavior: > > @@ -69,6 +69,8 @@ > case '\t' : case '\r' : case

Re: fsck_ffs: faster with lots of cylinder groups

2020-07-12 Thread Otto Moerbeek
On Mon, Jun 29, 2020 at 02:30:41PM +0200, Otto Moerbeek wrote: > On Sun, Jun 21, 2020 at 03:35:21PM +0200, Otto Moerbeek wrote: > > > 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 > >

Re: arm64 usertc

2020-07-12 Thread Mark Kettenis
> Date: Sun, 12 Jul 2020 00:06:21 +0200 > From: Christian Weisgerber > > Mark Kettenis: > > > Nevertheless, here is a different take on the problem. Since the > > timecounter only uses the low 32 bits we don't need the double read. > > This version also changes the timecounter mask from

Re: Undefined Behavior at jsmn.c

2020-07-12 Thread Florian Obser
On Sun, Jul 12, 2020 at 09:10:57AM +0200, Otto Moerbeek wrote: > On Sun, Jul 12, 2020 at 09:57:02AM +0430, Ali Farzanrad wrote: > > > Hi @tech, > > > > I was comparing jsmn.c in acme-client with jsmn.c in FreeBSD [1]. > > I found a switch without a default case which is an undefined behavior: >

macppc G5 pmap fix

2020-07-12 Thread Mark Kettenis
While working on the OpenBSD/powerpc64 pmap I noticed that the code we use for the G5 machines has a bug and doesn't remove execute permission from mappings when it should. Since I don't have a G5 machine readily available, can somebody test this diff for me? Index: arch/powerpc/powerpc/pmap.c

Re: Undefined Behavior at jsmn.c

2020-07-12 Thread Ali Farzanrad
Florian Obser wrote: > On Sun, Jul 12, 2020 at 09:10:57AM +0200, Otto Moerbeek wrote: > > On Sun, Jul 12, 2020 at 09:57:02AM +0430, Ali Farzanrad wrote: > > > > > Hi @tech, > > > > > > I was comparing jsmn.c in acme-client with jsmn.c in FreeBSD [1]. > > > I found a switch without a default case

Re: fsck_ffs: faster with lots of cylinder groups

2020-07-12 Thread Otto Moerbeek
On Sun, Jul 12, 2020 at 11:07:05AM +0200, Solene Rapenne wrote: > On Sun, 12 Jul 2020 09:13:47 +0200 > Otto Moerbeek : > > > On Mon, Jun 29, 2020 at 02:30:41PM +0200, Otto Moerbeek wrote: > > > > > On Sun, Jun 21, 2020 at 03:35:21PM +0200, Otto Moerbeek wrote: > > > > > > > Hi, > > > > > >

Re: fsck_ffs: faster with lots of cylinder groups

2020-07-12 Thread Solene Rapenne
On Sun, 12 Jul 2020 09:13:47 +0200 Otto Moerbeek : > On Mon, Jun 29, 2020 at 02:30:41PM +0200, Otto Moerbeek wrote: > > > On Sun, Jun 21, 2020 at 03:35:21PM +0200, Otto Moerbeek wrote: > > > > > Hi, > > > > > > both phase 1 and phase 5 need cylinder group metadata. This diff > > > keeps the

Re: powerpc(64): tweak timecounter mask

2020-07-12 Thread Mark Kettenis
> Date: Sun, 12 Jul 2020 19:30:38 +0200 > From: Christian Weisgerber > > Mark Kettenis: > > > > Date: Sun, 12 Jul 2020 18:12:39 +0200 > > > From: Christian Weisgerber > > > > > > The PowerPC/Power ISA Time Base is a 64-bit register. We can use > > > the full lower 32 bits. > > > > > > OK? >

Re: fix build without pf

2020-07-12 Thread Jason A. Donenfeld
ok zx2c4

Re: wg: fix build without pf

2020-07-12 Thread Vitaliy Makkoveev
On Sun, Jul 12, 2020 at 07:44:47PM +0200, Klemens Nanni wrote: OK mvs@ > Feedback? OK? > > > Index: sys/net/if_wg.c > === > RCS file: /cvs/src/sys/net/if_wg.c,v > retrieving revision 1.9 > diff -u -p -r1.9 if_wg.c > ---

softraid_crypto: add size to free call

2020-07-12 Thread Klemens Nanni
While omi->omi_som seems variable in size, omi is only ever allocated with one size and softraid.c uses the same size for free(9) as well. Tested with cryto softraid and keydisk. Feedback? OK? Index: dev/softraid_crypto.c === RCS

Re: armv7: tweak timercounter mask

2020-07-12 Thread Mark Kettenis
> Date: Sun, 12 Jul 2020 18:21:48 +0200 > From: Christian Weisgerber > > There is the strong suspicion that the 0x7fff mask in the various > armv7 timecounters was simply copied from powerpc, and that these really > are full 32-bit counters. > > I wanted to verify this from the data sheets,

Re: [PATCH} Optimized rasops32 putchar

2020-07-12 Thread Frederic Cambus
On Fri, Jun 26, 2020 at 07:42:50AM -0700, jo...@armadilloaerospace.com wrote: > Optimized 32 bit character rendering with unrolled rows and pairwise > foreground / background pixel rendering. > > If it weren't for the 5x8 font, I would have just assumed everything > was an even width and made the

softraid: fix malloc size

2020-07-12 Thread Klemens Nanni
We overallocate by quite a bit for bootable disks; spotted while reading the code and tested by installboot(8)ing onto vnd(4) backed softraid disks (after booting a kernel with this diff). $ egdb --quiet obj/bsd.gdb Reading symbols from obj/bsd.gdb...done. (gdb) p

armv7: tweak timercounter mask

2020-07-12 Thread Christian Weisgerber
There is the strong suspicion that the 0x7fff mask in the various armv7 timecounters was simply copied from powerpc, and that these really are full 32-bit counters. I wanted to verify this from the data sheets, but I'm insufficiently familiar with the ARM ecosystem to locate those. Back in

Re: powerpc(64): tweak timecounter mask

2020-07-12 Thread Christian Weisgerber
Christian Weisgerber: > - tb_get_timecount, NULL, 0x7fff, 0, "tb", 0, NULL, 0 > + tb_get_timecount, NULL, 0x, 0, "tb", 0, NULL, 0 PS: Do we prefer ~0u over 0x? -- Christian "naddy" Weisgerber na...@mips.inka.de

Re: powerpc(64): tweak timecounter mask

2020-07-12 Thread Mark Kettenis
> Date: Sun, 12 Jul 2020 18:12:39 +0200 > From: Christian Weisgerber > > The PowerPC/Power ISA Time Base is a 64-bit register. We can use > the full lower 32 bits. > > OK? Sure, but this needs to be coordinated with the userland diff. And we'd better change it quick because doing it later is

Re: powerpc(64): tweak timecounter mask

2020-07-12 Thread Mark Kettenis
> Date: Sun, 12 Jul 2020 18:23:09 +0200 > From: Christian Weisgerber > > Christian Weisgerber: > > > - tb_get_timecount, NULL, 0x7fff, 0, "tb", 0, NULL, 0 > > + tb_get_timecount, NULL, 0x, 0, "tb", 0, NULL, 0 > > PS: Do we prefer ~0u over 0x? I prefer 0x. We

Re: powerpc(64): tweak timecounter mask

2020-07-12 Thread Christian Weisgerber
Mark Kettenis: > > Date: Sun, 12 Jul 2020 18:12:39 +0200 > > From: Christian Weisgerber > > > > The PowerPC/Power ISA Time Base is a 64-bit register. We can use > > the full lower 32 bits. > > > > OK? > > Sure, but this needs to be coordinated with the userland diff. No.

Re: softraid_crypto: add size to free call

2020-07-12 Thread Vitaliy Makkoveev
On Sun, Jul 12, 2020 at 08:51:08PM +0200, Klemens Nanni wrote: > While omi->omi_som seems variable in size, omi is only ever allocated > with one size and softraid.c uses the same size for free(9) as well. > > Tested with cryto softraid and keydisk. > > Feedback? OK? > > > Index:

powerpc(64): tweak timecounter mask

2020-07-12 Thread Christian Weisgerber
The PowerPC/Power ISA Time Base is a 64-bit register. We can use the full lower 32 bits. OK? Index: arch/macppc/macppc/clock.c === RCS file: /cvs/src/sys/arch/macppc/macppc/clock.c,v retrieving revision 1.44 diff -u -p -r1.44

wg: fix build without pf

2020-07-12 Thread Klemens Nanni
Feedback? OK? Index: sys/net/if_wg.c === RCS file: /cvs/src/sys/net/if_wg.c,v retrieving revision 1.9 diff -u -p -r1.9 if_wg.c --- sys/net/if_wg.c 10 Jul 2020 13:26:42 - 1.9 +++ sys/net/if_wg.c 12 Jul 2020 16:31:03

Re: armv7: tweak timercounter mask

2020-07-12 Thread Christian Weisgerber
Mark Kettenis: > > There is the strong suspicion that the 0x7fff mask in the various > > armv7 timecounters was simply copied from powerpc, and that these really > > are full 32-bit counters. > > > > I wanted to verify this from the data sheets, but I'm insufficiently > > familiar with the

Re: softraid_crypto: add size to free call

2020-07-12 Thread Vitaliy Makkoveev
ok mvs@ > On 13 Jul 2020, at 01:22, Klemens Nanni wrote: > > On Sun, Jul 12, 2020 at 10:31:49PM +0300, Vitaliy Makkoveev wrote: >> I like to have "sizeof(*omi)" in corresponding malloc(9) too. >> >> cut begin >> 827 omi = malloc(sizeof(struct sr_meta_opt_item),

Re: softraid_crypto: add size to free call

2020-07-12 Thread Klemens Nanni
On Sun, Jul 12, 2020 at 10:31:49PM +0300, Vitaliy Makkoveev wrote: > I like to have "sizeof(*omi)" in corresponding malloc(9) too. > > cut begin > 827 omi = malloc(sizeof(struct sr_meta_opt_item), M_DEVBUF, > 828 M_WAITOK | M_ZERO); > cut end

timekeep: tk_generation problem

2020-07-12 Thread George Koehler
Hello tech list, My CLOCK_MONOTONIC can jump backwards. It looks like a problem with tk_generation in the user timekeep page. If tk_offset_count and tk_offset change but tk_generation doesn't change, then libc can mix old and new values and calculate a bogus time. This diff tries to fix it.