Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Sebastien Marie
On Sat, Aug 06, 2022 at 02:19:31AM +0200, Jeremie Courreges-Anglas wrote: > On Fri, Aug 05 2022, Sebastien Marie wrote: > > Hi, > > > > When initially ported blist from DragonFlyBSD, we used custom type bsblk_t > > and > > bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t).

Re: powerpc64: retrigger deferred DEC interrupts from splx(9)

2022-08-05 Thread George Koehler
On Tue, 2 Aug 2022 19:55:02 +0200 (CEST) Mark Kettenis wrote: > > Date: Tue, 2 Aug 2022 11:56:59 -0500 > > From: Scott Cheloha > > > > At what point do we consider the patch safe? Have you seen any hangs? > > > > Wanna run with it another week? > > Sorry. I'm not set up to run my powerpc64

Re: match recent Intel CPUs in fw_update(8)

2022-08-05 Thread Jonathan Gray
On Fri, Aug 05, 2022 at 11:06:06AM -0700, Andrew Hewus Fresh wrote: > On Tue, Jun 21, 2022 at 02:58:46PM +1000, Jonathan Gray wrote: > > Intel CPUs used to have strings like > > cpu0: Intel(R) Pentium(R) M processor 1200MHz ("GenuineIntel" 686-class) > > 1.20 GHz > > cpu0: Intel(R) Core(TM) i7-560

Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Theo de Raadt
Todd C. Miller wrote: > On Sat, 06 Aug 2022 02:19:31 +0200, Jeremie Courreges-Anglas wrote: > > > This seems fair, but maybe we should just zap the type from sys/types.h and > > define it only in sys/blist.h, as done in DragonflyBSD? > > Fine with me. It is a non-standard type not used by base

Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Todd C . Miller
On Sat, 06 Aug 2022 02:19:31 +0200, Jeremie Courreges-Anglas wrote: > This seems fair, but maybe we should just zap the type from sys/types.h and > define it only in sys/blist.h, as done in DragonflyBSD? Fine with me. It is a non-standard type not used by base. - todd

Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Jeremie Courreges-Anglas
On Fri, Aug 05 2022, Sebastien Marie wrote: > Hi, > > When initially ported blist from DragonFlyBSD, we used custom type bsblk_t > and > bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t). > > The reason was swblk_t is already defined on OpenBSD, and was incompatible > with

Re: rmt(8): add unveil and remove limitation on slashes/symlinks

2022-08-05 Thread Andre Stoebe
Hi Theo, > ?: could be used here: > > if (unveil("/", rflag ? "r" : "rwc") == -1) > err(1, "unveil /"); Right, I find it a bit verbose too. >> -/* Don't allow directory traversal. */ >> -if (strchr(devp, '/')) { >> -

net lock macros

2022-08-05 Thread Alexander Bluhm
Hi, Why do we need NET_RLOCK_IN_SOFTNET and NET_RLOCK_IN_IOCTL macros which do the same? I would prefer to call both of them _SHARED. Also the W and R are hard to see, I think NET_ASSERT_LOCKED_EXCLUSIVE is more obvious. Some comments were pretty outdated. ok? bluhm Index: net/if.c =

Re: parallel divert packet soreceive

2022-08-05 Thread Alexander Bluhm
On Sat, Aug 06, 2022 at 01:07:31AM +0300, Vitaliy Makkoveev wrote: > I thought you will introduce something like below. This does the > same but it has no heuristic under the hood. > > int > sbwait_shared(struct socket *so, struct sockbuf *sb) > { > int error; > > i

Re: parallel divert packet soreceive

2022-08-05 Thread Vitaliy Makkoveev
> On 6 Aug 2022, at 01:07, Vitaliy Makkoveev wrote: > > I thought you will introduce something like below. This does the > same but it has no heuristic under the hood. > > int > sbwait_shared(struct socket *so, struct sockbuf *sb) > { >int error; > >if (so->so_proto->pr_u

Re: parallel divert packet soreceive

2022-08-05 Thread Vitaliy Makkoveev
> On 6 Aug 2022, at 00:36, Alexander Bluhm wrote: > > On Sat, Aug 06, 2022 at 12:20:48AM +0300, Vitaliy Makkoveev wrote: >>> On 5 Aug 2022, at 23:50, Alexander Bluhm wrote: >>> >>> On Thu, Aug 04, 2022 at 06:07:49PM +0300, Vitaliy Makkoveev wrote: Yes please. Also I like (*pr_usrreq)() be

Re: nd6: Constify in6_addr pointer arguments in nd6_*() functions

2022-08-05 Thread Alexander Bluhm
On Fri, Aug 05, 2022 at 07:10:24AM +, Klemens Nanni wrote: > All of them are passed to inspect/copy out fields, none of the functions > writes to the struct. > > This makes it easier to argue about code (in MP context) and syncs ND6 code > with NetBSD and FreeBSD. > > Builds and runs fine on

Re: parallel divert packet soreceive

2022-08-05 Thread Alexander Bluhm
On Sat, Aug 06, 2022 at 12:20:48AM +0300, Vitaliy Makkoveev wrote: > > On 5 Aug 2022, at 23:50, Alexander Bluhm wrote: > > > > On Thu, Aug 04, 2022 at 06:07:49PM +0300, Vitaliy Makkoveev wrote: > >> Yes please. Also I like (*pr_usrreq)() be splitted to multiple handlers. > > > > With all you fee

Re: parallel divert packet soreceive

2022-08-05 Thread Vitaliy Makkoveev
> On 5 Aug 2022, at 23:50, Alexander Bluhm wrote: > > On Thu, Aug 04, 2022 at 06:07:49PM +0300, Vitaliy Makkoveev wrote: >> Yes please. Also I like (*pr_usrreq)() be splitted to multiple handlers. > > With all you feedback diff looks like this now. > Did you missed sbwait() modification? I als

Re: random(6): undefined cast and error checking

2022-08-05 Thread Theo Buehler
On Fri, Aug 05, 2022 at 02:12:35PM -0500, luci...@bronze.ctrl-c.club wrote: > So this is the final verison of the patch solving the following > problems: > > >The program is broken in multiple ways: return value clamping, casting > >from double to uint32_t, wrong error checking for putchar, lack o

Re: parallel divert packet soreceive

2022-08-05 Thread Alexander Bluhm
On Thu, Aug 04, 2022 at 06:07:49PM +0300, Vitaliy Makkoveev wrote: > Yes please. Also I like (*pr_usrreq)() be splitted to multiple handlers. With all you feedback diff looks like this now. bluhm Index: kern/uipc_socket.c === RCS fi

Re: random(6): undefined cast and error checking

2022-08-05 Thread lucic71
So this is the final verison of the patch solving the following problems: >The program is broken in multiple ways: return value clamping, casting >from double to uint32_t, wrong error checking for putchar, lack of >warnings when compiling. Now the program is more pedantic and complicated, but at

Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Martin Pieuchot
On 05/08/22(Fri) 18:10, Sebastien Marie wrote: > Hi, > > When initially ported blist from DragonFlyBSD, we used custom type bsblk_t > and > bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t). > > The reason was swblk_t is already defined on OpenBSD, and was incompatible >

Re: match recent Intel CPUs in fw_update(8)

2022-08-05 Thread Andrew Hewus Fresh
On Tue, Jun 21, 2022 at 02:58:46PM +1000, Jonathan Gray wrote: > Intel CPUs used to have strings like > cpu0: Intel(R) Pentium(R) M processor 1200MHz ("GenuineIntel" 686-class) 1.20 > GHz > cpu0: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.61 MHz, 06-3d-04 > recent CPUs use > cpu0: 11th Gen Int

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Alexander Bluhm
On Fri, Aug 05, 2022 at 10:00:26AM -0600, Theo de Raadt wrote: > For it to be an advantage, it must have actually helped at least once. > Did it find any pieces of code casting a struct mbuf * to a sockaddr *, > or similar? I started to care about satosin with this bug: https://marc.info/?l=openb

patch: change swblk_t type and use it in blist

2022-08-05 Thread Sebastien Marie
Hi, When initially ported blist from DragonFlyBSD, we used custom type bsblk_t and bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t). The reason was swblk_t is already defined on OpenBSD, and was incompatible with blist (int32_t). It is defined, but not used (outside some

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Theo de Raadt
Alexander Bluhm wrote: > On Fri, Aug 05, 2022 at 09:03:03AM -0600, Theo de Raadt wrote: > > But I also disagree with the idea of wrapping a trivial piece of C into > > a function located in another header file > > I added many of them a few years ago. We have them for all sockaddr > derivates.

Re: netinet6: Call getuptime() just once per function

2022-08-05 Thread Alexander Bluhm
On Thu, Aug 04, 2022 at 02:19:58PM +, Klemens Nanni wrote: > IPv6 pendant to bluhm's sys/netinet/if_ether.c r1.249: > Instead of calling getuptime() all the time in ARP code, do it only > once per function. This gives a more consistent time value. > OK claudio@ miod@ mvs@ > > Feed

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Alexander Bluhm
On Fri, Aug 05, 2022 at 09:03:03AM -0600, Theo de Raadt wrote: > But I also disagree with the idea of wrapping a trivial piece of C into > a function located in another header file I added many of them a few years ago. We have them for all sockaddr derivates. They are handy when doing network pr

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Claudio Jeker
On Fri, Aug 05, 2022 at 02:51:14PM +, Klemens Nanni wrote: > On Fri, Aug 05, 2022 at 08:08:17AM -0600, Theo de Raadt wrote: > > I struggle to see any value of this concept: If you put a cast in-line > > in the code, as a coder you can know what it means. But if you abstract > > the typecast t

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Theo de Raadt
Klemens Nanni wrote: > satosin(), sin6tosa(), etc. are convenient helpers to avoid manually > casting all over the place. > > struct sockaddr aka. sa, struct sockaddr_in6 aka. sin6, etc. are well > known abbreviations in networking code. Your diff does not touch satosin. You are mentioning the

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Klemens Nanni
On Fri, Aug 05, 2022 at 08:08:17AM -0600, Theo de Raadt wrote: > I struggle to see any value of this concept: If you put a cast in-line > in the code, as a coder you can know what it means. But if you abstract > the typecast to some function in a header file, how do you remember > that it only do

Re: rmt(8): add unveil and remove limitation on slashes/symlinks

2022-08-05 Thread Theo de Raadt
Andre Stoebe wrote: > So I added unveil and removed the limitation on forward slashes as well > as symbolic links when using the -d option. I believe (please correct me > if I'm wrong) these limitations were added to prevent breaking out of > the directory while keeping the code simple. With unve

inpcb lookup ref counting

2022-08-05 Thread Alexander Bluhm
Hi, To make protocol input functions MP safe, internet PCB need protection. Let's use their reference counter in more places. The in_pcb lookup functions hold the PCBs in hash tables protected by table->inpt_mtx mutex. Whenever a result is returned, increment the ref count before releasing the m

Re: net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Theo de Raadt
I struggle to see any value of this concept: If you put a cast in-line in the code, as a coder you can know what it means. But if you abstract the typecast to some function in a header file, how do you remember that it only does a typecast, and doesn't do something else? I think this is a foolis

net*: Add *toc*() helpers to const-convert between AF specific and generic structs

2022-08-05 Thread Klemens Nanni
satosin() gets a satocin() sibling, satosdl() gets satocsdl(), etc. These inline functions are identical except the const version expects and returns a pointer to a const struct. This only adds unused inline functions be used in upcoming commits, where we can then more easily add const to functio

Re: softraid(4) RAID 1C boot support on amd64

2022-08-05 Thread Klemens Nanni
On Thu, Aug 04, 2022 at 07:26:23PM +0200, Stefan Sperling wrote: > This adds support for booting from RAID 1C volumes on amd64. > Only boot-loader changes are needed. Both installboot(8) and > the kernel already do what is required to make this work. > > I have tested with biosboot in vmm. The cha

nd6: Constify in6_addr pointer arguments in nd6_*() functions

2022-08-05 Thread Klemens Nanni
All of them are passed to inspect/copy out fields, none of the functions writes to the struct. This makes it easier to argue about code (in MP context) and syncs ND6 code with NetBSD and FreeBSD. Builds and runs fine on sparc64. Feedback? OK? diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c

Re: remove games from PATHs provided by /etc/skel

2022-08-05 Thread Klemens Nanni
On Fri, Aug 05, 2022 at 03:37:41AM +0200, Theo Buehler wrote: > On Fri, Aug 05, 2022 at 03:34:57AM +0200, Theo Buehler wrote: > > If you want games, opt into it. They are very old, full of bugs and not > > really maintained. It's very easy to get a PATH containing games via > > /etc/skel. I think t