CVS commit: src/sys/netinet6

2024-04-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Apr 19 05:04:06 UTC 2024

Modified Files:
src/sys/netinet6: frag6.c

Log Message:
frag6: fix calculation of fragment length

Because of the miscalculation, 32 bytes fragmented IPv6 packets
have been wrongly dropped.

See https://mail-index.netbsd.org/tech-net/2024/04/14/msg008741.html
for more details.

Patch from Yasuyuki KOZAKAI (with minor tweaks)


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/netinet6/frag6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/frag6.c
diff -u src/sys/netinet6/frag6.c:1.77 src/sys/netinet6/frag6.c:1.78
--- src/sys/netinet6/frag6.c:1.77	Tue Aug 29 17:01:35 2023
+++ src/sys/netinet6/frag6.c	Fri Apr 19 05:04:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.77 2023/08/29 17:01:35 christos Exp $	*/
+/*	$NetBSD: frag6.c,v 1.78 2024/04/19 05:04:06 ozaki-r Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.77 2023/08/29 17:01:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.78 2024/04/19 05:04:06 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -206,9 +206,10 @@ frag6_input(struct mbuf **mp, int *offp,
 	 * sizeof(struct ip6_frag) == 8
 	 * sizeof(struct ip6_hdr) = 40
 	 */
-	if ((ip6f->ip6f_offlg & IP6F_MORE_FRAG) &&
-	(((ntohs(ip6->ip6_plen) - offset) == 0) ||
-	 ((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
+	frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset
+	- sizeof(struct ip6_frag);
+	if ((frgpartlen == 0) ||
+	((ip6f->ip6f_offlg & IP6F_MORE_FRAG) && (frgpartlen & 0x7) != 0)) {
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 		offsetof(struct ip6_hdr, ip6_plen));
 		in6_ifstat_inc(dstifp, ifs6_reass_fail);
@@ -316,7 +317,6 @@ frag6_input(struct mbuf **mp, int *offp,
 	 * in size. If it would exceed, discard the fragment and return an
 	 * ICMP error.
 	 */
-	frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset;
 	if (q6->ip6q_unfrglen >= 0) {
 		/* The 1st fragment has already arrived. */
 		if (q6->ip6q_unfrglen + fragoff + frgpartlen > IPV6_MAXPACKET) {



CVS commit: src/sys/netinet6

2024-04-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Apr 19 05:04:06 UTC 2024

Modified Files:
src/sys/netinet6: frag6.c

Log Message:
frag6: fix calculation of fragment length

Because of the miscalculation, 32 bytes fragmented IPv6 packets
have been wrongly dropped.

See https://mail-index.netbsd.org/tech-net/2024/04/14/msg008741.html
for more details.

Patch from Yasuyuki KOZAKAI (with minor tweaks)


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/netinet6/frag6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/netinet6

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 19 00:55:35 UTC 2024

Modified Files:
src/sys/netinet6: ip6_output.c

Log Message:
ip6_output: Initialize plen for ip6_hopopts_input.

This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Reported-by: syzbot+587e3b707bdfe5332...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=587e3b707bdfe533283f


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/netinet6/ip6_output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.234 src/sys/netinet6/ip6_output.c:1.235
--- src/sys/netinet6/ip6_output.c:1.234	Thu Aug  3 05:45:36 2023
+++ src/sys/netinet6/ip6_output.c	Fri Apr 19 00:55:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.234 2023/08/03 05:45:36 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.235 2024/04/19 00:55:35 riastradh Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.234 2023/08/03 05:45:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.235 2024/04/19 00:55:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -754,7 +754,7 @@ ip6_output(
 	 * XXX Is this really necessary?
 	 */
 	if (ip6->ip6_nxt == IPPROTO_HOPOPTS) {
-		u_int32_t dummy1; /* XXX unused */
+		u_int32_t dummy1 = 0; /* XXX unused */
 		u_int32_t dummy2; /* XXX unused */
 		int hoff = sizeof(struct ip6_hdr);
 



CVS commit: src/sys/netinet6

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 19 00:55:35 UTC 2024

Modified Files:
src/sys/netinet6: ip6_output.c

Log Message:
ip6_output: Initialize plen for ip6_hopopts_input.

This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Reported-by: syzbot+587e3b707bdfe5332...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=587e3b707bdfe533283f


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/netinet6/ip6_output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 19 00:45:41 UTC 2024

Modified Files:
src/sys/kern: vfs_mount.c

Log Message:
dounmount: Avoid &((struct vnode_impl *)NULL)->vi_vnode.

Member access of a null pointer is undefined, even if the result
should also be null because vi_vnode is at the start of vnode_impl.

Reported-by: syzbot+a4b2d13c0d6d4dac2...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=a4b2d13c0d6d4dac2d07


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/vfs_mount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.104 src/sys/kern/vfs_mount.c:1.105
--- src/sys/kern/vfs_mount.c:1.104	Wed Jan 17 10:17:29 2024
+++ src/sys/kern/vfs_mount.c	Fri Apr 19 00:45:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.104 2024/01/17 10:17:29 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.105 2024/04/19 00:45:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.104 2024/01/17 10:17:29 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.105 2024/04/19 00:45:41 riastradh Exp $");
 
 #include "veriexec.h"
 
@@ -936,7 +936,8 @@ err_mounted:
 int
 dounmount(struct mount *mp, int flags, struct lwp *l)
 {
-	vnode_t *coveredvp, *vp;
+	struct vnode *coveredvp, *vp;
+	struct vnode_impl *vip;
 	int error, async, used_syncer, used_extattr;
 	const bool was_suspended = fstrans_is_owner(mp);
 
@@ -1003,7 +1004,9 @@ dounmount(struct mount *mp, int flags, s
 		vfs_resume(mp);
 
 	mountlist_remove(mp);
-	if ((vp = VIMPL_TO_VNODE(TAILQ_FIRST(>mnt_vnodelist))) != NULL) {
+
+	if ((vip = TAILQ_FIRST(>mnt_vnodelist)) != NULL) {
+		vp = VIMPL_TO_VNODE(vip);
 		vprint("dangling", vp);
 		panic("unmount: dangling vnode");
 	}



CVS commit: src/sys/kern

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 19 00:45:41 UTC 2024

Modified Files:
src/sys/kern: vfs_mount.c

Log Message:
dounmount: Avoid &((struct vnode_impl *)NULL)->vi_vnode.

Member access of a null pointer is undefined, even if the result
should also be null because vi_vnode is at the start of vnode_impl.

Reported-by: syzbot+a4b2d13c0d6d4dac2...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=a4b2d13c0d6d4dac2d07


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/vfs_mount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr 18 23:33:15 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_acpi.c

Log Message:
radeon_acpi.c: ifdef out unused function on NetBSD.

Should fix syzkaller build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c:1.5 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c:1.5	Tue Apr 16 14:34:02 2024
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c	Thu Apr 18 23:33:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_acpi.c,v 1.5 2024/04/16 14:34:02 riastradh Exp $	*/
+/*	$NetBSD: radeon_acpi.c,v 1.6 2024/04/18 23:33:15 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_acpi.c,v 1.5 2024/04/16 14:34:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_acpi.c,v 1.6 2024/04/18 23:33:15 riastradh Exp $");
 
 #include 
 #include 
@@ -50,11 +50,13 @@ ACPI_MODULE_NAME("radeon_acpi")
 #include 
 #endif
 
+#ifndef __NetBSD__		/* XXX radeon acpi */
 #if defined(CONFIG_VGA_SWITCHEROO)
 bool radeon_atpx_dgpu_req_power_for_displays(void);
 #else
 static inline bool radeon_atpx_dgpu_req_power_for_displays(void) { return false; }
 #endif
+#endif
 
 #define ACPI_AC_CLASS   "ac_adapter"
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2024-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr 18 23:33:15 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_acpi.c

Log Message:
radeon_acpi.c: ifdef out unused function on NetBSD.

Should fix syzkaller build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/ntp/lib/libntp

2024-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Apr 18 19:23:54 UTC 2024

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
Format MKREPRO_TIMESTAMP with "%b %d %Y" to correctly substitute __DATE__


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/ntp/lib/libntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.30 src/external/bsd/ntp/lib/libntp/Makefile:1.31
--- src/external/bsd/ntp/lib/libntp/Makefile:1.30	Fri Apr 12 19:06:45 2024
+++ src/external/bsd/ntp/lib/libntp/Makefile	Thu Apr 18 19:23:53 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2024/04/12 19:06:45 jakllsch Exp $
+#	$NetBSD: Makefile,v 1.31 2024/04/18 19:23:53 jakllsch Exp $
 
 LIBISPRIVATE=yes
 
@@ -88,7 +88,7 @@ CPPFLAGS+= -I${IDIST}/sntp/libopts
 # For MKREPRO, avoid using __DATE__ and __TIME__.
 # Instead, use the date and time from ${MKREPRO_TIMESTAMP}
 .if ${MKREPRO:Uno} == "yes"
-MKREPRO_DATE != ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" "+%F"
+MKREPRO_DATE != ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" "+%b %d %Y"
 MKREPRO_TIME != ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" "+%T"
 CPPFLAGS.ntp_calendar.c += -DMKREPRO_DATE=\"${MKREPRO_DATE:Q}\"
 CPPFLAGS.ntp_calendar.c += -DMKREPRO_TIME=\"${MKREPRO_TIME:Q}\"



CVS commit: src/external/bsd/ntp/lib/libntp

2024-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Apr 18 19:23:54 UTC 2024

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
Format MKREPRO_TIMESTAMP with "%b %d %Y" to correctly substitute __DATE__


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/ntp/lib/libntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2024-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Apr 18 19:17:14 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: mi
src/external/mit/xorg/bin/xsetwallpaper: Makefile

Log Message:
Install xsetwallpaper(1) manual page

Should fix PR 58172.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/bin/xsetwallpaper/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.174 src/distrib/sets/lists/xbase/mi:1.175
--- src/distrib/sets/lists/xbase/mi:1.174	Sat Jun  3 19:57:33 2023
+++ src/distrib/sets/lists/xbase/mi	Thu Apr 18 19:17:14 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.174 2023/06/03 19:57:33 andvar Exp $
+# $NetBSD: mi,v 1.175 2024/04/18 19:17:14 jakllsch Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1394,6 +1394,7 @@
 ./usr/X11R7/man/cat1/xsetmode.0xbase-xsetmode-catman	.cat,xorg
 ./usr/X11R7/man/cat1/xsetpointer.0			xbase-xsetpointer-catman	.cat,xorg
 ./usr/X11R7/man/cat1/xsetroot.0xbase-xsetroot-catman	.cat,xorg
+./usr/X11R7/man/cat1/xsetwallpaper.0			xbase-xsetwallpaper-catman	.cat,xorg
 ./usr/X11R7/man/cat1/xsm.0xbase-xsm-catman	.cat,xorg
 ./usr/X11R7/man/cat1/xstdcmap.0xbase-xstdcmap-catman	.cat,xorg
 ./usr/X11R7/man/cat1/xterm.0xbase-xterm-catman	.cat,xorg
@@ -1546,6 +1547,7 @@
 ./usr/X11R7/man/html1/xsetmode.html			xbase-xsetmode-htmlman	html,xorg
 ./usr/X11R7/man/html1/xsetpointer.html			xbase-xsetpointer-htmlman	html,xorg
 ./usr/X11R7/man/html1/xsetroot.html			xbase-xsetroot-htmlman	html,xorg
+./usr/X11R7/man/html1/xsetwallpaper.html		xbase-xsetwallpaper-htmlman	html,xorg
 ./usr/X11R7/man/html1/xsm.htmlxbase-xsm-htmlman	html,xorg
 ./usr/X11R7/man/html1/xstdcmap.html			xbase-xstdcmap-htmlman	html,xorg
 ./usr/X11R7/man/html1/xterm.html			xbase-xterm-htmlman	html,xorg
@@ -1699,6 +1701,7 @@
 ./usr/X11R7/man/man1/xsetmode.1xbase-xsetmode-man	.man,xorg
 ./usr/X11R7/man/man1/xsetpointer.1			xbase-xsetpointer-man	.man,xorg
 ./usr/X11R7/man/man1/xsetroot.1xbase-xsetroot-man	.man,xorg
+./usr/X11R7/man/man1/xsetwallpaper.1			xbase-xsetwallpaper-man	.man,xorg
 ./usr/X11R7/man/man1/xsm.1xbase-xsm-man	.man,xorg
 ./usr/X11R7/man/man1/xstdcmap.1xbase-xstdcmap-man	.man,xorg
 ./usr/X11R7/man/man1/xterm.1xbase-xterm-man	.man,xorg

Index: src/external/mit/xorg/bin/xsetwallpaper/Makefile
diff -u src/external/mit/xorg/bin/xsetwallpaper/Makefile:1.5 src/external/mit/xorg/bin/xsetwallpaper/Makefile:1.6
--- src/external/mit/xorg/bin/xsetwallpaper/Makefile:1.5	Fri Feb 11 01:36:02 2022
+++ src/external/mit/xorg/bin/xsetwallpaper/Makefile	Thu Apr 18 19:17:14 2024
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2022/02/11 01:36:02 uwe Exp $
-
-NOMAN=		# defined
+#	$NetBSD: Makefile,v 1.6 2024/04/18 19:17:14 jakllsch Exp $
 
 .include 
 



CVS commit: src

2024-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Apr 18 19:17:14 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: mi
src/external/mit/xorg/bin/xsetwallpaper: Makefile

Log Message:
Install xsetwallpaper(1) manual page

Should fix PR 58172.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/bin/xsetwallpaper/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:52:56 UTC 2024

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Note dedication of 9.4


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-9.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.145 src/doc/CHANGES-9.4:1.1.2.146
--- src/doc/CHANGES-9.4:1.1.2.145	Thu Apr 18 16:41:58 2024
+++ src/doc/CHANGES-9.4	Thu Apr 18 18:52:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.145 2024/04/18 16:41:58 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.146 2024/04/18 18:52:56 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -13607,3 +13607,9 @@ sys/arch/x86/x86/viac7temp.c			1.10
 	viac7temp(4): PR 58148: fix the kernel module.
 	[andvar, ticket #1835]
 
+distrib/notes/common/main			(edited manually)
+
+	Add dedication to Wayne Knowles.
+	[martin]
+
+



CVS commit: [netbsd-9] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:52:56 UTC 2024

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Note dedication of 9.4


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-9.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/distrib/notes/common

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:50:59 UTC 2024

Modified Files:
src/distrib/notes/common [netbsd-9]: main

Log Message:
Add dedication for the upcoming 9.4 release.


To generate a diff of this commit:
cvs rdiff -u -r1.551.2.12 -r1.551.2.13 src/distrib/notes/common/main

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.551.2.12 src/distrib/notes/common/main:1.551.2.13
--- src/distrib/notes/common/main:1.551.2.12	Tue Jun 14 10:37:05 2022
+++ src/distrib/notes/common/main	Thu Apr 18 18:50:59 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.551.2.12 2022/06/14 10:37:05 martin Exp $
+.\"	$NetBSD: main,v 1.551.2.13 2024/04/18 18:50:59 martin Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -509,28 +509,20 @@ possible,
 would not exist.
 .
 .if \n[FOR_RELEASE] \{\
-.\" .Ss "Dedication"
-.\" .Pp
-.\" .
-.\" .Nx
-.\" 9.0 is dedicated to the memory of Matthias Drochner, who
-.\" passed away in August 2018 and Eric Schnoebelen, who
-.\" passed away in March 2019.
-.\" .Pp
-.\" Matthias' technical contributions are too many to list here in full.
-.\" He was a long term contributor and commited more than 3000 changes all
-.\" over the
-.\" .Nx
-.\" source tree and lately was especially active in keeping some of our most weird
-.\" ancient VME architectures in shape.
-.\" .Pp
-.\" Eric was a long term pkgsrc developer and well known community member.
-.\" .Pp
-.\" Beyond their technical contributions, Eric and Matthias were always
-.\" helpful and friendly.
-.\" Their example encouraged users to contribute to the project and share their
-.\" work with the community.
-.\" .Pp
+.Ss "Dedication"
+.Pp
+.
+.Nx
+9.4 is dedicated to the memory of Wayne Knowles, who
+passed away in December 2022.
+.Pp
+Wayne was a long term contributor, working mostly on low level Mips code.
+.Pp
+Beyond his technical contributions, Wayne was always
+helpful and friendly.
+His example encouraged users to contribute to the project and share their
+work with the community.
+.Pp
 .\} \"  \n[FOR_RELEASE]
 .ie \n[RELEASE_BRANCH] .Ss Changes Between The NetBSD \n[oldvers] \
 and \n[major] Releases



CVS commit: [netbsd-9] src/distrib/notes/common

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:50:59 UTC 2024

Modified Files:
src/distrib/notes/common [netbsd-9]: main

Log Message:
Add dedication for the upcoming 9.4 release.


To generate a diff of this commit:
cvs rdiff -u -r1.551.2.12 -r1.551.2.13 src/distrib/notes/common/main

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:26:43 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.1

Log Message:
Tickets #655 - #662, #664 - #669


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/doc/CHANGES-10.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-10.1
diff -u src/doc/CHANGES-10.1:1.1.2.3 src/doc/CHANGES-10.1:1.1.2.4
--- src/doc/CHANGES-10.1:1.1.2.3	Wed Apr 17 18:03:46 2024
+++ src/doc/CHANGES-10.1	Thu Apr 18 18:26:43 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.3 2024/04/17 18:03:46 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.4 2024/04/18 18:26:43 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -45,3 +45,92 @@ share/mk/bsd.lib.mk1.398,1.399,1.152
 	bsd.x11.mk: PR 58104: use TOOL_AWK, not the build host's awk.
 	[riastradh, ticket #654]
 
+share/mk/bsd.own.mk1.1365,1.1366
+sys/arch/aarch64/include/sljit_machdep.h	1.4
+sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c 1.5
+sys/modules/Makefile1.285
+
+	aarch64: PR 58103: enable SLJIT acceleration.
+	[riastradh, ticket #655]
+
+sys/stand/efiboot/efiboot.c			1.23
+
+	efiboot: PR 58075: avoid invalid memory access with netboot.
+	[riastradh, ticket #656]
+
+distrib/evbarm/instkernel/sshramdisk/Makefile	1.26
+
+	evbarm/sshramdisk: PR 58035: put firmware files in the right
+place.
+	[riastradh, ticket #657]
+
+share/man/man4/wg.41.8,1.9
+
+	wg(4): PR 58015: man page improvements.
+	[riastradh, ticket #658]
+
+sys/netinet/sctp_asconf.c			1.14
+sys/netinet6/in6_ifattach.c			1.122
+sys/netinet6/nd6.c1.282
+
+	ipsecif(4): fix invalid IPv6 route after deletion of a tunnel.
+	[knakahara, ticket #659]
+
+sbin/ifconfig/ifconfig.8			1.126-1.129
+
+	ifconfig(8): PR 58125: document lagg(4) parameters.
+	[andvar, ticket #660]
+
+sys/dev/pci/if_mcx.c1.27
+
+	mcx(4): PR 58124: enforce full-duplex mark in mcx_media_status(),
+	when link is up.
+	[andvar, ticket #661]
+
+sys/arch/x86/x86/viac7temp.c			1.10
+
+	viac7temp(4): PR 58148: fix the kernel module.
+	[andvar, ticket #662]
+
+share/mk/bsd.hostlib.mk1.21
+
+	Fix reproducible toolchain build on host toolchains   
+that do not support -iremap.
+	[jakllsch, ticket #664]
+
+sys/ddb/db_proc.c1.16
+
+	ddb(4): fix alignment of 'ps/[lw]' output.
+	[skrll, ticket #665]
+
+sys/arch/arm/arm32/pmap.c			1.443
+
+	arm: PR 58135: don't unconditionally set XN in pmap_clearbit.
+	[skrll, ticket #666]
+
+sys/arch/aarch64/aarch64/cpu_machdep.c		1.15
+sys/arch/aarch64/aarch64/sig_machdep.c		1.9
+
+	aarch64: PR 58149: cannot return from a signal handler if SP was
+	misaligned when the signal arrived.
+	[skrll, ticket #667]
+
+sys/kern/init_main.c1.547
+sys/kern/kern_hook.c1.15
+sys/kern/vfs_mount.c1.104
+sys/miscfs/procfs/procfs.h			1.83,1.84
+sys/miscfs/procfs/procfs_subr.c			1.117
+sys/miscfs/procfs/procfs_vfsops.c		1.112-1.114
+sys/miscfs/procfs/procfs_vnops.c		1.230
+
+	procfs: PR 39913, PR 57775: make kernel hooks exechook, exithook
+	and forkhook MP-safe and make it safe to remove procfs nodes on
+	exehook or proc exit.
+	[hannken, ticket #668]
+
+sys/dev/ccd.c	1.190
+
+	ccd(4): PR 58043: allocate buffers with PR_NOWAIT and defer to
+	kthread if out of memory. 
+	[hannken, ticket #669]
+



CVS commit: [netbsd-10] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:26:43 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.1

Log Message:
Tickets #655 - #662, #664 - #669


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/doc/CHANGES-10.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/dev

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:24:31 UTC 2024

Modified Files:
src/sys/dev [netbsd-10]: ccd.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #669):

sys/dev/ccd.c: revision 1.190

Using a ccd(4) with GPT (dk* at ccd*) the disk framework will call
ccdstrategy() -> ccdstart() -> ccdbuffer()  from softint context.

Allocating the buffer with PR_WAITOK here is forbidden.

Change ccdstart() / ccdbuffer() to report failure back to caller and
pass PR_WAITOK / PR_NOWAIT as an additional argument.

Call ccdstart() with PR_NOPWAIT from ccdstrategy() and on error defer
to the kthread.  Call ccdstart() with PR_WAITOK from kthread so requests
from kthread always succeed to allocate the buffers.

Remove the (non working) throttling on low memory as it is no longer needed.

Fixes PR kern/58043 "kernel crash in assert_sleepable() in -current,
dk(4) driver?"


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.189.4.1 src/sys/dev/ccd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ccd.c
diff -u src/sys/dev/ccd.c:1.189 src/sys/dev/ccd.c:1.189.4.1
--- src/sys/dev/ccd.c:1.189	Mon Mar 28 12:48:35 2022
+++ src/sys/dev/ccd.c	Thu Apr 18 18:24:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd.c,v 1.189 2022/03/28 12:48:35 riastradh Exp $	*/
+/*	$NetBSD: ccd.c,v 1.189.4.1 2024/04/18 18:24:31 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.189 2022/03/28 12:48:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.189.4.1 2024/04/18 18:24:31 martin Exp $");
 
 #include 
 #include 
@@ -152,7 +152,7 @@ struct ccdbuf {
 /* component buffer pool */
 static pool_cache_t ccd_cache;
 
-#define	CCD_GETBUF()		pool_cache_get(ccd_cache, PR_WAITOK)
+#define	CCD_GETBUF(wait)	pool_cache_get(ccd_cache, wait)
 #define	CCD_PUTBUF(cbp)		pool_cache_put(ccd_cache, cbp)
 
 #define CCDLABELDEV(dev)	\
@@ -168,11 +168,11 @@ static void	ccdinterleave(struct ccd_sof
 static int	ccdinit(struct ccd_softc *, char **, struct vnode **,
 		struct lwp *);
 static struct ccdbuf *ccdbuffer(struct ccd_softc *, struct buf *,
-		daddr_t, void *, long);
+		daddr_t, void *, long, int);
 static void	ccdgetdefaultlabel(struct ccd_softc *, struct disklabel *);
 static void	ccdgetdisklabel(dev_t);
 static void	ccdmakedisklabel(struct ccd_softc *);
-static void	ccdstart(struct ccd_softc *);
+static int	ccdstart(struct ccd_softc *, struct buf *, int);
 static void	ccdthread(void *);
 
 static dev_type_open(ccdopen);
@@ -702,19 +702,12 @@ ccdclose(dev_t dev, int flags, int fmt, 
 	return (0);
 }
 
-static bool
-ccdbackoff(struct ccd_softc *cs)
-{
-
-	/* XXX Arbitrary, should be a uvm call. */
-	return uvm_availmem(true) < (uvmexp.freemin >> 1) &&
-	disk_isbusy(>sc_dkdev);
-}
-
 static void
 ccdthread(void *cookie)
 {
+	int error;
 	struct ccd_softc *cs;
+	struct buf *bp;
 
 	cs = cookie;
 
@@ -725,21 +718,18 @@ ccdthread(void *cookie)
 
 	mutex_enter(cs->sc_iolock);
 	while (__predict_true(!cs->sc_zap)) {
-		if (bufq_peek(cs->sc_bufq) == NULL) {
+		bp = bufq_get(cs->sc_bufq);
+		if (bp == NULL) {
 			/* Nothing to do. */
 			cv_wait(>sc_push, cs->sc_iolock);
 			continue;
 		}
-		if (ccdbackoff(cs)) {
-			/* Wait for memory to become available. */
-			(void)cv_timedwait(>sc_push, cs->sc_iolock, 1);
-			continue;
-		}
 #ifdef DEBUG
  		if (ccddebug & CCDB_FOLLOW)
  			printf("ccdthread: dispatching I/O\n");
 #endif
-		ccdstart(cs);
+		error = ccdstart(cs, bp, PR_WAITOK);
+		KASSERT(error == 0);
 		mutex_enter(cs->sc_iolock);
 	}
 	cs->sc_thread = NULL;
@@ -777,21 +767,16 @@ ccdstrategy(struct buf *bp)
 		return;
 	}
 
-	/* Defer to thread if system is low on memory. */
-	bufq_put(cs->sc_bufq, bp);
-	if (__predict_false(ccdbackoff(cs))) {
+	if (ccdstart(cs, bp, PR_NOWAIT) != 0) {
+		/* Defer to thread if system is low on memory. */
+		bufq_put(cs->sc_bufq, bp);
+		cv_broadcast(>sc_push);
 		mutex_exit(cs->sc_iolock);
-#ifdef DEBUG
- 		if (ccddebug & CCDB_FOLLOW)
- 			printf("ccdstrategy: holding off on I/O\n");
-#endif
-		return;
 	}
-	ccdstart(cs);
 }
 
-static void
-ccdstart(struct ccd_softc *cs)
+static int
+ccdstart(struct ccd_softc *cs, struct buf *bp, int wait)
 {
 	daddr_t blkno;
 	int wlabel;
@@ -801,11 +786,9 @@ ccdstart(struct ccd_softc *cs)
 	char *addr;
 	daddr_t bn;
 	vnode_t *vp;
-	buf_t *bp;
+	SIMPLEQ_HEAD(, ccdbuf) cbufq;
 
 	KASSERT(mutex_owned(cs->sc_iolock));
-
-	bp = bufq_get(cs->sc_bufq);
 	KASSERT(bp != NULL);
 
 	disk_busy(>sc_dkdev);
@@ -836,15 +819,32 @@ ccdstart(struct ccd_softc *cs)
 	mutex_exit(cs->sc_iolock);
 	bp->b_rawblkno = blkno;
 
-	/* Allocate the component buffers and start I/O! */
+	/* Allocate the component buffers. */
+	SIMPLEQ_INIT();
 	bp->b_resid = bp->b_bcount;
 	bn = bp->b_rawblkno;
 	addr = 

CVS commit: [netbsd-10] src/sys/dev

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:24:31 UTC 2024

Modified Files:
src/sys/dev [netbsd-10]: ccd.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #669):

sys/dev/ccd.c: revision 1.190

Using a ccd(4) with GPT (dk* at ccd*) the disk framework will call
ccdstrategy() -> ccdstart() -> ccdbuffer()  from softint context.

Allocating the buffer with PR_WAITOK here is forbidden.

Change ccdstart() / ccdbuffer() to report failure back to caller and
pass PR_WAITOK / PR_NOWAIT as an additional argument.

Call ccdstart() with PR_NOPWAIT from ccdstrategy() and on error defer
to the kthread.  Call ccdstart() with PR_WAITOK from kthread so requests
from kthread always succeed to allocate the buffers.

Remove the (non working) throttling on low memory as it is no longer needed.

Fixes PR kern/58043 "kernel crash in assert_sleepable() in -current,
dk(4) driver?"


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.189.4.1 src/sys/dev/ccd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:22:10 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: init_main.c kern_hook.c vfs_mount.c
src/sys/miscfs/procfs [netbsd-10]: procfs.h procfs_subr.c
procfs_vfsops.c procfs_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #668):

sys/miscfs/procfs/procfs.h: revision 1.83
sys/miscfs/procfs/procfs.h: revision 1.84
sys/kern/vfs_mount.c: revision 1.104
sys/miscfs/procfs/procfs_vnops.c: revision 1.230
sys/kern/init_main.c: revision 1.547
sys/kern/kern_hook.c: revision 1.15
sys/miscfs/procfs/procfs_vfsops.c: revision 1.112
sys/miscfs/procfs/procfs_vfsops.c: revision 1.113
sys/miscfs/procfs/procfs_vfsops.c: revision 1.114
sys/miscfs/procfs/procfs_subr.c: revision 1.117

Print dangling vnode before panic() to help debug.

PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"
Protect kernel hooks exechook, exithook and forkhook with rwlock.

Lock as writer on establish/disestablish and as reader on list traverse.

For exechook ride "exec_lock" as it is already take as reader when
traversing the list.  Add local locks for exithook and forkhook.

Move exec_init before signal_init as signal_init calls exechook_establish()
that needs "exec_lock".

PR kern/39913 "exec, fork, exit hooks need locking"

Add a hashmap to access all procfs nodes by pid.

Using the exechook to revoke procfs nodes is racy and may deadlock:
one thread runs doexechooks() -> procfs_revoke_vnodes() and wants to suspend
the file system for vgone(), while another thread runs a forced unmount,
has the file system suspended, tries to disestablish the exechook and
waits for doexechooks() to complete.

Establish/disestablish the exechook on module load/unload instead
mount/unmount and use the hashmap to access all procfs nodes for this pid.

May fix PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"

Remove all procfs nodes for this process on process exit.


To generate a diff of this commit:
cvs rdiff -u -r1.541 -r1.541.2.1 src/sys/kern/init_main.c
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.101 -r1.101.2.1 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.116 -r1.116.20.1 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.111 -r1.111.4.1 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.229 -r1.229.4.1 src/sys/miscfs/procfs/procfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.541 src/sys/kern/init_main.c:1.541.2.1
--- src/sys/kern/init_main.c:1.541	Wed Oct 26 23:20:47 2022
+++ src/sys/kern/init_main.c	Thu Apr 18 18:22:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.541 2022/10/26 23:20:47 riastradh Exp $	*/
+/*	$NetBSD: init_main.c,v 1.541.2.1 2024/04/18 18:22:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.541 2022/10/26 23:20:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.541.2.1 2024/04/18 18:22:10 martin Exp $");
 
 #include "opt_cnmagic.h"
 #include "opt_ddb.h"
@@ -409,6 +409,9 @@ main(void)
 	/* Must be called after lwpinit (lwpinit_specificdata) */
 	psref_init();
 
+	/* Initialize exec structures */
+	exec_init(1);		/* signal_init calls exechook_establish() */
+
 	/* Initialize signal-related data structures. */
 	signal_init();
 
@@ -578,9 +581,6 @@ main(void)
 
 	vmem_rehash_start();	/* must be before exec_init */
 
-	/* Initialize exec structures */
-	exec_init(1);		/* seminit calls exithook_establish() */
-
 #if NVERIEXEC > 0
 	/*
 	 * Initialise the Veriexec subsystem.

Index: src/sys/kern/kern_hook.c
diff -u src/sys/kern/kern_hook.c:1.14 src/sys/kern/kern_hook.c:1.14.2.1
--- src/sys/kern/kern_hook.c:1.14	Wed Oct 26 23:21:06 2022
+++ src/sys/kern/kern_hook.c	Thu Apr 18 18:22:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_hook.c,v 1.14 2022/10/26 23:21:06 riastradh Exp $	*/
+/*	$NetBSD: kern_hook.c,v 1.14.2.1 2024/04/18 18:22:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.14 2022/10/26 23:21:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.14.2.1 2024/04/18 18:22:10 martin Exp $");
 
 #include 
 
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_hook.c,
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -74,25 +75,48 @@ struct khook_list {
 
 int	powerhook_debug = 0;
 
+static ONCE_DECL(hook_control);
+static krwlock_t exithook_lock;
+static krwlock_t forkhook_lock;
+
+static int
+hook_init(void)
+{
+
+	rw_init(_lock);
+	

CVS commit: [netbsd-10] src/sys

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:22:10 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: init_main.c kern_hook.c vfs_mount.c
src/sys/miscfs/procfs [netbsd-10]: procfs.h procfs_subr.c
procfs_vfsops.c procfs_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #668):

sys/miscfs/procfs/procfs.h: revision 1.83
sys/miscfs/procfs/procfs.h: revision 1.84
sys/kern/vfs_mount.c: revision 1.104
sys/miscfs/procfs/procfs_vnops.c: revision 1.230
sys/kern/init_main.c: revision 1.547
sys/kern/kern_hook.c: revision 1.15
sys/miscfs/procfs/procfs_vfsops.c: revision 1.112
sys/miscfs/procfs/procfs_vfsops.c: revision 1.113
sys/miscfs/procfs/procfs_vfsops.c: revision 1.114
sys/miscfs/procfs/procfs_subr.c: revision 1.117

Print dangling vnode before panic() to help debug.

PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"
Protect kernel hooks exechook, exithook and forkhook with rwlock.

Lock as writer on establish/disestablish and as reader on list traverse.

For exechook ride "exec_lock" as it is already take as reader when
traversing the list.  Add local locks for exithook and forkhook.

Move exec_init before signal_init as signal_init calls exechook_establish()
that needs "exec_lock".

PR kern/39913 "exec, fork, exit hooks need locking"

Add a hashmap to access all procfs nodes by pid.

Using the exechook to revoke procfs nodes is racy and may deadlock:
one thread runs doexechooks() -> procfs_revoke_vnodes() and wants to suspend
the file system for vgone(), while another thread runs a forced unmount,
has the file system suspended, tries to disestablish the exechook and
waits for doexechooks() to complete.

Establish/disestablish the exechook on module load/unload instead
mount/unmount and use the hashmap to access all procfs nodes for this pid.

May fix PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"

Remove all procfs nodes for this process on process exit.


To generate a diff of this commit:
cvs rdiff -u -r1.541 -r1.541.2.1 src/sys/kern/init_main.c
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.101 -r1.101.2.1 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.116 -r1.116.20.1 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.111 -r1.111.4.1 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.229 -r1.229.4.1 src/sys/miscfs/procfs/procfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/arch/aarch64/aarch64

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:17:06 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-10]: cpu_machdep.c sig_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #667):

sys/arch/aarch64/aarch64/sig_machdep.c: revision 1.9
sys/arch/aarch64/aarch64/cpu_machdep.c: revision 1.15

kern/58149: aarch64: Cannot return from a signal handler if SP was
misaligned when the signal arrived

Apply the kernel diff from the PR
1. sendsig_siginfo() previously assumed that user SP was always aligned to
16 bytes and could call signal handlers with SP misaligned. This is a
wrong assumption because aarch64 demands that SP is aligned *only while*
it's being used to access memory. Now it properly aligns it before
pusing anything on the stack.
2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
considered the ucontext invalid otherwise. This meant if a signal was
sent to a process whose SP was misaligned, the signal handler would fail
to return because the ucontext passed from the kernel was an invalid
one. Now setcontext(2) doesn't complain about misaligned SP.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/aarch64/aarch64/sig_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/arch/aarch64/aarch64

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:17:06 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-10]: cpu_machdep.c sig_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #667):

sys/arch/aarch64/aarch64/sig_machdep.c: revision 1.9
sys/arch/aarch64/aarch64/cpu_machdep.c: revision 1.15

kern/58149: aarch64: Cannot return from a signal handler if SP was
misaligned when the signal arrived

Apply the kernel diff from the PR
1. sendsig_siginfo() previously assumed that user SP was always aligned to
16 bytes and could call signal handlers with SP misaligned. This is a
wrong assumption because aarch64 demands that SP is aligned *only while*
it's being used to access memory. Now it properly aligns it before
pusing anything on the stack.
2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
considered the ucontext invalid otherwise. This meant if a signal was
sent to a process whose SP was misaligned, the signal handler would fail
to return because the ucontext passed from the kernel was an invalid
one. Now setcontext(2) doesn't complain about misaligned SP.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/aarch64/aarch64/sig_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpu_machdep.c
diff -u src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.13 src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.13.4.1
--- src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.13	Thu Jul 28 09:14:12 2022
+++ src/sys/arch/aarch64/aarch64/cpu_machdep.c	Thu Apr 18 18:17:06 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_machdep.c,v 1.13 2022/07/28 09:14:12 riastradh Exp $ */
+/* $NetBSD: cpu_machdep.c,v 1.13.4.1 2024/04/18 18:17:06 martin Exp $ */
 
 /*-
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.13 2022/07/28 09:14:12 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.13.4.1 2024/04/18 18:17:06 martin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -156,9 +156,13 @@ dosoftints(void)
 int
 cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp)
 {
+	/*
+	 * We intentionally don't verify that _REG_SP is aligned to
+	 * 16-bytes boundaries because it can be legally misaligned as long
+	 * as it's not used for accessing memory.
+	 */
 	if ((mcp->__gregs[_REG_SPSR] & ~SPSR_NZCV)
-	|| (mcp->__gregs[_REG_PC] & 3)
-	|| (mcp->__gregs[_REG_SP] & 15))
+	|| (mcp->__gregs[_REG_PC] & 3))
 		return EINVAL;
 
 	return 0;

Index: src/sys/arch/aarch64/aarch64/sig_machdep.c
diff -u src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8 src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8.4.1
--- src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8	Mon Nov  1 05:07:15 2021
+++ src/sys/arch/aarch64/aarch64/sig_machdep.c	Thu Apr 18 18:17:06 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.8.4.1 2024/04/18 18:17:06 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.8.4.1 2024/04/18 18:17:06 martin Exp $");
 
 #include 
 #include 
@@ -58,8 +58,14 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 
 	vaddr_t sp;
 
-	sp = onstack_p ? ((vaddr_t)ss->ss_sp + ss->ss_size) & -16 : tf->tf_sp;
+	/*
+	 * The user stack isn't guaranteed to be aligned to 16 bytes. Align
+	 * it before pushing anything onto it.
+	 */
+	sp = onstack_p ? ((vaddr_t)ss->ss_sp + ss->ss_size) : tf->tf_sp;
+	sp &= -16;
 
+	__CTASSERT(sizeof(ucontext_t) % 16 == 0);
 	sp -= sizeof(ucontext_t);
 	const vaddr_t ucp = sp;
 



CVS commit: [netbsd-10] src/sys/arch/arm/arm32

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:14:22 UTC 2024

Modified Files:
src/sys/arch/arm/arm32 [netbsd-10]: pmap.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #666):

sys/arch/arm/arm32/pmap.c: revision 1.443

port-arm/58135: reproducible pmap KASSERT failure for armv7 with NFS root

Don't unconditionally set XN in pmap_clearbit - only set it if a mapping
exists VM_PROT_EXEC is being cleared.

I've simplified the #ifdefs in the patch from the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.437.4.3 -r1.437.4.4 src/sys/arch/arm/arm32/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/arch/arm/arm32

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:14:22 UTC 2024

Modified Files:
src/sys/arch/arm/arm32 [netbsd-10]: pmap.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #666):

sys/arch/arm/arm32/pmap.c: revision 1.443

port-arm/58135: reproducible pmap KASSERT failure for armv7 with NFS root

Don't unconditionally set XN in pmap_clearbit - only set it if a mapping
exists VM_PROT_EXEC is being cleared.

I've simplified the #ifdefs in the patch from the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.437.4.3 -r1.437.4.4 src/sys/arch/arm/arm32/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.437.4.3 src/sys/arch/arm/arm32/pmap.c:1.437.4.4
--- src/sys/arch/arm/arm32/pmap.c:1.437.4.3	Thu Dec 14 17:43:10 2023
+++ src/sys/arch/arm/arm32/pmap.c	Thu Apr 18 18:14:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.437.4.3 2023/12/14 17:43:10 martin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.437.4.4 2024/04/18 18:14:22 martin Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -193,7 +193,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.437.4.3 2023/12/14 17:43:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.437.4.4 2024/04/18 18:14:22 martin Exp $");
 
 #include 
 #include 
@@ -2330,15 +2330,10 @@ pmap_clearbit(struct vm_page_md *md, pad
 #ifdef PMAP_CACHE_VIPT
 	const bool want_syncicache = PV_IS_EXEC_P(md->pvh_attrs);
 	bool need_syncicache = false;
-#ifdef ARM_MMU_EXTENDED
-	const u_int execbits = (maskbits & PVF_EXEC) ? L2_XS_XN : 0;
-#else
-	const u_int execbits = 0;
+#ifndef ARM_MMU_EXTENDED
 	bool need_vac_me_harder = false;
 #endif
-#else
-	const u_int execbits = 0;
-#endif
+#endif /* PMAP_CACHE_VIPT */
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLARGS(maphist, "md %#jx pa %#jx maskbits %#jx",
@@ -2421,9 +2416,14 @@ pmap_clearbit(struct vm_page_md *md, pad
 
 		pt_entry_t * const ptep = >l2b_kva[l2pte_index(va)];
 		const pt_entry_t opte = *ptep;
-		pt_entry_t npte = opte | execbits;
+		pt_entry_t npte = opte;
+
+#if defined(ARM_MMU_EXTENDED)
+		if ((maskbits & PVF_EXEC) != 0 && l2pte_valid_p(opte)) {
+			KASSERT((opte & L2_TYPE_S) != 0);
+			npte |= L2_XS_XN;
+		}
 
-#ifdef ARM_MMU_EXTENDED
 		KASSERT((opte & L2_XS_nG) == (pm == pmap_kernel() ? 0 : L2_XS_nG));
 #endif
 



CVS commit: [netbsd-10] src/sys/ddb

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:06:09 UTC 2024

Modified Files:
src/sys/ddb [netbsd-10]: db_proc.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #665):

sys/ddb/db_proc.c: revision 1.16

Fix alignment of ddb 'ps/[lw]' output. LID matches PID and has more digits.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.18.1 src/sys/ddb/db_proc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ddb/db_proc.c
diff -u src/sys/ddb/db_proc.c:1.14 src/sys/ddb/db_proc.c:1.14.18.1
--- src/sys/ddb/db_proc.c:1.14	Mon Jan 11 07:49:04 2021
+++ src/sys/ddb/db_proc.c	Thu Apr 18 18:06:09 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_proc.c,v 1.14 2021/01/11 07:49:04 simonb Exp $	*/
+/*	$NetBSD: db_proc.c,v 1.14.18.1 2024/04/18 18:06:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2020 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.14 2021/01/11 07:49:04 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.14.18.1 2024/04/18 18:06:09 martin Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -153,7 +153,7 @@ db_show_all_procs(db_expr_t addr, bool h
 		"COMMAND", "STRUCT PROC *", "UAREA *", "VMSPACE/VM_MAP");
 		break;
 	case 'l':
-		db_printf("PID   %4s S %3s %9s %18s %18s %-8s\n",
+		db_printf("PID   %5s S %3s %9s %18s %18s %-8s\n",
 		"LID", "CPU", "FLAGS", "STRUCT LWP *", "NAME", "WAIT");
 		break;
 	case 'n':
@@ -161,7 +161,7 @@ db_show_all_procs(db_expr_t addr, bool h
 		"PPID", "PGRP", "UID", "FLAGS", "LWPS", "COMMAND", "WAIT");
 		break;
 	case 'w':
-		db_printf("PID  %4s %16s %8s %4s %-12s%s\n",
+		db_printf("PID   %5s %16s %8s %4s %-16s %s\n",
 		"LID", "COMMAND", "EMUL", "PRI", "WAIT-MSG",
 		"WAIT-CHANNEL");
 		break;
@@ -210,7 +210,7 @@ db_show_all_procs(db_expr_t addr, bool h
 } else {
 	wbuf[0] = '\0';
 }
-db_printf("%c%4d %d %3d %9x %18lx %18s %-8s\n",
+db_printf("%c%5d %d %3d %9x %18lx %18s %-8s\n",
 (run ? '>' : ' '), l.l_lid,
 l.l_stat, cpuno, l.l_flag, (long)lp,
 db_nbuf, wbuf);
@@ -262,7 +262,7 @@ db_show_all_procs(db_expr_t addr, bool h
 db_nbuf[MAXCOMLEN] = '\0';
 
 db_printf(
-"%c%4d %16s %8s %4d %-12s %-18lx\n",
+"%c%5d %16s %8s %4d %-16s %-18lx\n",
 (run ? '>' : ' '), l.l_lid,
 p.p_comm, db_nbuf,
 l.l_priority, wbuf, (long)l.l_wchan);



CVS commit: [netbsd-10] src/sys/ddb

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 18:06:09 UTC 2024

Modified Files:
src/sys/ddb [netbsd-10]: db_proc.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #665):

sys/ddb/db_proc.c: revision 1.16

Fix alignment of ddb 'ps/[lw]' output. LID matches PID and has more digits.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.18.1 src/sys/ddb/db_proc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/share/mk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 17:57:31 UTC 2024

Modified Files:
src/share/mk [netbsd-10]: bsd.hostlib.mk

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #664):

share/mk/bsd.hostlib.mk: revision 1.21

Filter out -Wp,-iremap,* from CPPFLAGS as is done in hostprog.mk

Seems to fix build of libnbcompat in reproducible mode on host toolchains w/o 
-iremap


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.12.1 src/share/mk/bsd.hostlib.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.hostlib.mk
diff -u src/share/mk/bsd.hostlib.mk:1.20 src/share/mk/bsd.hostlib.mk:1.20.12.1
--- src/share/mk/bsd.hostlib.mk:1.20	Fri May  4 14:50:40 2018
+++ src/share/mk/bsd.hostlib.mk	Thu Apr 18 17:57:31 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.hostlib.mk,v 1.20 2018/05/04 14:50:40 christos Exp $
+#	$NetBSD: bsd.hostlib.mk,v 1.20.12.1 2024/04/18 17:57:31 martin Exp $
 
 .include 
 .include 
@@ -47,7 +47,7 @@ CLEANFILES+= a.out [Ee]rrs mklog core *.
 
 beforedepend:
 CFLAGS:=	${HOST_CFLAGS}
-CPPFLAGS:=	${HOST_CPPFLAGS}
+CPPFLAGS:=	${HOST_CPPFLAGS:N-Wp,-iremap,*}
 
 # Pull in related .mk logic
 .include 



CVS commit: [netbsd-10] src/share/mk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 17:57:31 UTC 2024

Modified Files:
src/share/mk [netbsd-10]: bsd.hostlib.mk

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #664):

share/mk/bsd.hostlib.mk: revision 1.21

Filter out -Wp,-iremap,* from CPPFLAGS as is done in hostprog.mk

Seems to fix build of libnbcompat in reproducible mode on host toolchains w/o 
-iremap


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.12.1 src/share/mk/bsd.hostlib.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pckbport

2024-04-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Apr 18 17:35:53 UTC 2024

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Renamed border/boundary variables to better describe their use.
Fix edge default values, factor out percentage calculation for more consistent
values. Use device_printf/DPRINTF to show errors instead of aprint variants.
Print raw input for debugging.

Correct capability parsing. Old devices were probed with nonexistent
commands and then used undefined boundary values that made them unusuable.

Fixes PR 57874.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pckbport/synaptics.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.82 src/sys/dev/pckbport/synaptics.c:1.83
--- src/sys/dev/pckbport/synaptics.c:1.82	Tue Sep  5 05:55:12 2023
+++ src/sys/dev/pckbport/synaptics.c	Thu Apr 18 17:35:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.82 2023/09/05 05:55:12 mrg Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.83 2024/04/18 17:35:53 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.82 2023/09/05 05:55:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.83 2024/04/18 17:35:53 mlelstv Exp $");
 
 #include 
 #include 
@@ -112,10 +112,10 @@ static int synaptics_edge_bottom = SYNAP
 static int synaptics_edge_motion_delta = 32;
 static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5;
 static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10;
-static int synaptics_horiz_pct = 0;
-static int synaptics_vert_pct = 0;
-static int synaptics_button_pct = 30;
-static int synaptics_button_boundary;
+static int synaptics_hscroll_pct = 0;
+static int synaptics_vscroll_pct = 0;
+static int synaptics_button_pct = 0;
+static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM;
 static int synaptics_button2;
 static int synaptics_button3;
 static int synaptics_two_fingers_emul = 0;
@@ -166,23 +166,26 @@ static int synaptics_movement_threshold_
 static int synaptics_movement_enable_nodenum;
 static int synaptics_button_region_movement_nodenum;
 static int synaptics_aux_mid_button_scroll_nodenum;
-static int synaptics_horiz_pct_nodenum;
-static int synaptics_vert_pct_nodenum;
+static int synaptics_hscroll_pct_nodenum;
+static int synaptics_vscroll_pct_nodenum;
 static int synaptics_button_pct_nodenum;
 
 /*
  * copy of edges so we can recalculate edge limit if there is 
  * vertical scroll region
  */
-static int synaptics_actual_edge_right;
-static int synaptics_actual_edge_bottom;
+static int synaptics_true_edge_right;
+static int synaptics_true_edge_bottom;
 
-static int synaptics_old_vert_pct = 0;
-static int synaptics_old_horiz_pct = 0;
-static int synaptics_old_button_pct = 0;
-static int synaptics_old_button_boundary = SYNAPTICS_EDGE_BOTTOM;
-static int synaptics_old_horiz_edge = SYNAPTICS_EDGE_BOTTOM;
-static int synaptics_old_vert_edge = SYNAPTICS_EDGE_RIGHT;
+/*
+ * invalid old values, recalculate everything
+ */
+static int synaptics_old_vscroll_pct = -1;
+static int synaptics_old_hscroll_pct = -1;
+static int synaptics_old_button_pct = -1;
+static int synaptics_old_button_boundary = -1;
+static int synaptics_old_edge_right = -1;
+static int synaptics_old_edge_bottom = -1;
 
 /*
  * This holds the processed packet data, it is global because multiple
@@ -208,7 +211,7 @@ synaptics_poll_cmd(struct pms_softc *psc
 	int res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, i, 0,
 	NULL, 0);
 	if (res)
-		aprint_error_dev(psc->sc_dev, "command error %#x\n", cmd[0]);
+		device_printf(psc->sc_dev, "command error %#x\n", cmd[0]);
 	return res;
 }
 
@@ -221,7 +224,7 @@ synaptics_poll_reset(struct pms_softc *p
 	u_char cmd[1] = { PMS_RESET };
 	res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2,
 	resp, 1);
-	aprint_debug_dev(psc->sc_dev, "reset %d 0x%02x 0x%02x\n",
+	DPRINTF(10, >u.synaptics, "reset %d 0x%02x 0x%02x\n",
 	res, resp[0], resp[1]);
 	return res;
 }
@@ -251,80 +254,90 @@ synaptics_special_write(struct pms_softc
 	return res;
 }
 
+static int
+synaptics_value(int pct, int low, int high)
+{
+	return low + pct * (high - low) / 100UL;
+}
+
+static int
+synaptics_percentage(int val, int low, int high)
+{
+	return ((val - low) * 100UL + high - low - 1) / (high - low);
+}
+
 static void
 pms_synaptics_set_boundaries(void)
 {
-	if (synaptics_vert_pct != synaptics_old_vert_pct ) {
-		synaptics_edge_right = synaptics_actual_edge_right -
-		((unsigned long) synaptics_vert_pct *
-		(synaptics_actual_edge_right - synaptics_edge_left)) / 100;
-		synaptics_old_vert_pct = synaptics_vert_pct;
-		synaptics_old_vert_edge = synaptics_edge_right;
+	if (synaptics_vscroll_pct != synaptics_old_vscroll_pct ) {
+		

CVS commit: src/sys/dev/pckbport

2024-04-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Apr 18 17:35:53 UTC 2024

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Renamed border/boundary variables to better describe their use.
Fix edge default values, factor out percentage calculation for more consistent
values. Use device_printf/DPRINTF to show errors instead of aprint variants.
Print raw input for debugging.

Correct capability parsing. Old devices were probed with nonexistent
commands and then used undefined boundary values that made them unusuable.

Fixes PR 57874.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pckbport/synaptics.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:45:55 UTC 2024

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1955 - #1959


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.227 -r1.1.2.228 src/doc/CHANGES-8.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:45:55 UTC 2024

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1955 - #1959


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.227 -r1.1.2.228 src/doc/CHANGES-8.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.227 src/doc/CHANGES-8.3:1.1.2.228
--- src/doc/CHANGES-8.3:1.1.2.227	Wed Apr 17 18:09:14 2024
+++ src/doc/CHANGES-8.3	Thu Apr 18 16:45:55 2024
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES-8.3,v 1.1.2.227 2024/04/17 18:09:14 martin Exp $
+$NetBSD: CHANGES-8.3,v 1.1.2.228 2024/04/18 16:45:55 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -4401,3 +4401,32 @@ share/mk/bsd.lib.mk1.398,1.399,1.152
 	bsd.x11.mk: PR 58104: use TOOL_AWK, not the build host's awk.
 	[riastradh, ticket #1954]
 
+distrib/evbarm/instkernel/sshramdisk/Makefile	1.26
+
+	evbarm/sshramdisk: PR 58035: put firmware files in the right
+place.
+	[riastradh, ticket #1955]
+
+external/bsd/am-utils/dist/amd/amq_subr.c	1.4,1.5
+external/bsd/am-utils/dist/amq/amq.c		1.4
+external/bsd/am-utils/dist/amq/amq_xdr.c	1.2
+external/bsd/am-utils/dist/include/amq_defs.h	1.2
+
+	amd(8): PR 56974: fix crash in amq -i.
+	[riastradh, ticket #1956]
+
+external/gpl2/grep/dist/src/grep.c		1.3
+
+	grep(1): PR 56584: don't read FIFOs with -D skip.
+	[riastradh, ticket #1957]
+
+usr.bin/who/utmpentry.c1.22
+
+	who(1): PR 56013: fix utmpentry counting.
+	[riastradh, ticket #1958]
+
+sys/arch/x86/x86/viac7temp.c			1.10
+
+	viac7temp(4): PR 58148: fix the kernel module.
+	[andvar, ticket #1959]
+



CVS commit: [netbsd-8] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:44:21 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-8]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1959):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.20.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/viac7temp.c
diff -u src/sys/arch/x86/x86/viac7temp.c:1.8 src/sys/arch/x86/x86/viac7temp.c:1.8.20.1
--- src/sys/arch/x86/x86/viac7temp.c:1.8	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/x86/x86/viac7temp.c	Thu Apr 18 16:44:20 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $ */
+/* $NetBSD: viac7temp.c,v 1.8.20.1 2024/04/18 16:44:20 martin Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -27,11 +27,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.8.20.1 2024/04/18 16:44:20 martin Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -162,3 +163,32 @@ viac7temp_refresh_xcall(void *arg0, void
 	edata->value_cur += 27315;
 	edata->state = ENVSYS_SVALID;
 }
+
+MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+viac7temp_modcmd(modcmd_t cmd, void *arg __unused)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	case MODULE_CMD_FINI:
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: [netbsd-8] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:44:21 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-8]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1959):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.20.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:41:58 UTC 2024

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1827 - #1835


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-9.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.144 src/doc/CHANGES-9.4:1.1.2.145
--- src/doc/CHANGES-9.4:1.1.2.144	Wed Apr 17 18:06:32 2024
+++ src/doc/CHANGES-9.4	Thu Apr 18 16:41:58 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.144 2024/04/17 18:06:32 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.145 2024/04/18 16:41:58 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -13550,3 +13550,60 @@ share/mk/bsd.lib.mk1.398,1.399,1.152
 	bsd.x11.mk: PR 58104: use TOOL_AWK, not the build host's awk.
 	[riastradh, ticket #1826]
 
+share/mk/bsd.own.mk1.1365,1.1366 (patch)
+sys/arch/aarch64/include/sljit_machdep.h	1.4 (patch)
+sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c 1.5 (patch)
+sys/modules/Makefile1.285 (patch)
+
+	aarch64: PR 58103: enable SLJIT acceleration.
+	[riastradh, ticket #1827]
+
+sys/stand/efiboot/efiboot.c			1.23
+
+	efiboot: PR 58075: avoid invalid memory access with netboot.
+	[riastradh, ticket #1828]
+
+distrib/evbarm/instkernel/sshramdisk/Makefile	1.26
+
+	evbarm/sshramdisk: PR 58035: put firmware files in the right
+place.
+	[riastradh, ticket #1829]
+
+share/man/man9/workqueue.9			1.15 (patch)
+sys/kern/subr_workqueue.c			1.39-1.47 (patch)
+tests/rump/kernspace/kernspace.h		1.9 (patch)
+tests/rump/kernspace/workqueue.c		1.7-1.9 (patch)
+tests/rump/rumpkern/Makefile			1.20 (patch)
+tests/rump/rumpkern/t_workqueue.c		1.3,1.4 (patch)
+
+	workqueue(9): PR 57574: fix use-after-free.
+	[riastradh, ticket #1830]
+
+external/bsd/am-utils/dist/amd/amq_subr.c	1.4,1.5
+external/bsd/am-utils/dist/amq/amq.c		1.4
+external/bsd/am-utils/dist/amq/amq_xdr.c	1.2
+external/bsd/am-utils/dist/include/amq_defs.h	1.2
+
+	amd(8): PR 56974: fix crash in amq -i.
+	[riastradh, ticket #1831]
+
+external/gpl2/grep/dist/src/grep.c		1.3
+
+	grep(1): PR 56584: don't read FIFOs with -D skip.
+	[riastradh, ticket #1832]
+
+usr.bin/who/utmpentry.c1.22
+
+	who(1): PR 56013: fix utmpentry counting.
+	[riastradh, ticket #1833]
+
+share/mk/bsd.own.mk1.1177
+
+	sparc64: PR 55937: enable building zfs by default.
+	[riastradh, ticket #1834]
+
+sys/arch/x86/x86/viac7temp.c			1.10
+
+	viac7temp(4): PR 58148: fix the kernel module.
+	[andvar, ticket #1835]
+



CVS commit: [netbsd-9] src/doc

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:41:58 UTC 2024

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1827 - #1835


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-9.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:40:17 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1835):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.32.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/viac7temp.c
diff -u src/sys/arch/x86/x86/viac7temp.c:1.8 src/sys/arch/x86/x86/viac7temp.c:1.8.32.1
--- src/sys/arch/x86/x86/viac7temp.c:1.8	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/x86/x86/viac7temp.c	Thu Apr 18 16:40:17 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $ */
+/* $NetBSD: viac7temp.c,v 1.8.32.1 2024/04/18 16:40:17 martin Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -27,11 +27,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.8.32.1 2024/04/18 16:40:17 martin Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -162,3 +163,32 @@ viac7temp_refresh_xcall(void *arg0, void
 	edata->value_cur += 27315;
 	edata->state = ENVSYS_SVALID;
 }
+
+MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+viac7temp_modcmd(modcmd_t cmd, void *arg __unused)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	case MODULE_CMD_FINI:
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: [netbsd-9] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:40:17 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1835):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.32.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:39:08 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-10]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #662):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/viac7temp.c
diff -u src/sys/arch/x86/x86/viac7temp.c:1.9 src/sys/arch/x86/x86/viac7temp.c:1.9.4.1
--- src/sys/arch/x86/x86/viac7temp.c:1.9	Thu Oct  7 12:52:27 2021
+++ src/sys/arch/x86/x86/viac7temp.c	Thu Apr 18 16:39:08 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $ */
+/* $NetBSD: viac7temp.c,v 1.9.4.1 2024/04/18 16:39:08 martin Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -27,11 +27,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.9.4.1 2024/04/18 16:39:08 martin Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -162,3 +163,32 @@ viac7temp_refresh_xcall(void *arg0, void
 	edata->value_cur += 27315;
 	edata->state = ENVSYS_SVALID;
 }
+
+MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+viac7temp_modcmd(modcmd_t cmd, void *arg __unused)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	case MODULE_CMD_FINI:
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: [netbsd-10] src/sys/arch/x86/x86

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:39:08 UTC 2024

Modified Files:
src/sys/arch/x86/x86 [netbsd-10]: viac7temp.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #662):

sys/arch/x86/x86/viac7temp.c: revision 1.10

viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/arch/x86/x86/viac7temp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/dev/pci

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:29:48 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-10]: if_mcx.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #661):

sys/dev/pci/if_mcx.c: revision 1.27

mcx(4): enforce full-duplex mark in mcx_media_status(), when link is up.

LACP protocol requires full-duplex to be enabled for lagg(4) to work,
however mcx(4) was not setting this capability making it to fail.

Fixes PR kern/58124.  OK'd by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/sys/dev/pci/if_mcx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/dev/pci

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:29:48 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-10]: if_mcx.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #661):

sys/dev/pci/if_mcx.c: revision 1.27

mcx(4): enforce full-duplex mark in mcx_media_status(), when link is up.

LACP protocol requires full-duplex to be enabled for lagg(4) to work,
however mcx(4) was not setting this capability making it to fail.

Fixes PR kern/58124.  OK'd by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/sys/dev/pci/if_mcx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.25.4.1 src/sys/dev/pci/if_mcx.c:1.25.4.2
--- src/sys/dev/pci/if_mcx.c:1.25.4.1	Fri Nov  3 08:59:29 2023
+++ src/sys/dev/pci/if_mcx.c	Thu Apr 18 16:29:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.25.4.1 2023/11/03 08:59:29 martin Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.25.4.2 2024/04/18 16:29:47 martin Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.101 2021/06/02 19:16:11 patrick Exp $ */
 
 /*
@@ -23,7 +23,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.25.4.1 2023/11/03 08:59:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.25.4.2 2024/04/18 16:29:47 martin Exp $");
 
 #include 
 #include 
@@ -8072,7 +8072,7 @@ mcx_media_status(struct ifnet *ifp, stru
 	ifmr->ifm_status = IFM_AVALID;
 	if (proto_oper != 0) {
 		ifmr->ifm_status |= IFM_ACTIVE;
-		ifmr->ifm_active = IFM_ETHER | IFM_AUTO | media_oper;
+		ifmr->ifm_active = IFM_ETHER | IFM_FDX | IFM_AUTO | media_oper;
 		/* txpause, rxpause, duplex? */
 	}
 }



CVS commit: [netbsd-10] src/sbin/ifconfig

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:26:48 UTC 2024

Modified Files:
src/sbin/ifconfig [netbsd-10]: ifconfig.8

Log Message:
Pull up following revision(s) (requested by andvar in ticket #660):

sbin/ifconfig/ifconfig.8: revision 1.126
sbin/ifconfig/ifconfig.8: revision 1.127
sbin/ifconfig/ifconfig.8: revision 1.128
sbin/ifconfig/ifconfig.8: revision 1.129

Added documents about parameters related to lagg(4)
PR misc/58125

Correct a very minor typo (s/id/is/)

ifconfig(8): move laggportpri next to laggport

Update the date of the documentation to reflect recent changes.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.124.2.1 src/sbin/ifconfig/ifconfig.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.124 src/sbin/ifconfig/ifconfig.8:1.124.2.1
--- src/sbin/ifconfig/ifconfig.8:1.124	Fri Nov 25 08:41:05 2022
+++ src/sbin/ifconfig/ifconfig.8	Thu Apr 18 16:26:47 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.124 2022/11/25 08:41:05 knakahara Exp $
+.\"	$NetBSD: ifconfig.8,v 1.124.2.1 2024/04/18 16:26:47 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)ifconfig.8	8.4 (Berkeley) 6/1/94
 .\"
-.Dd November 25, 2022
+.Dd April 8, 2024
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -614,6 +614,40 @@ Remove
 from the
 .Xr agr 4
 interface.
+.It Cm laggport Ar interface Oo Cm pri Ar n Oc
+Add the interface named by
+.Ar interface
+as a port of the
+.Xr lagg 4
+interface,
+and set the priority of
+.Ar interface
+to
+.Ar n .
+.It Cm -laggport Ar interface
+Remove the interface named by
+.Ar interface
+from the
+.Xr lagg 4
+interface.
+.It Cm laggportpri Ar interface Ar n
+If the interface is a
+.Xr lagg 4
+pseudo-interface, set the priority of
+.Ar interface
+to
+.Ar n
+.It Cm laggproto Ar proto
+Set the aggregation protocol of
+.Xr lagg 4 .
+The default is
+.Li none .
+The available options are
+.Li failover ,
+.Li lacp ,
+.Li loadbalance ,
+and
+.Li none .
 .It Cm eee
 Enable IEEE 802.3az Energy Efficiency Ethernet function.
 .It Cm -eee
@@ -899,6 +933,7 @@ tried to alter an interface's configurat
 .Sh SEE ALSO
 .Xr netstat 1 ,
 .Xr agr 4 ,
+.Xr lagg 4 ,
 .Xr carp 4 ,
 .Xr ifmedia 4 ,
 .Xr netintro 4 ,



CVS commit: [netbsd-10] src/sbin/ifconfig

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:26:48 UTC 2024

Modified Files:
src/sbin/ifconfig [netbsd-10]: ifconfig.8

Log Message:
Pull up following revision(s) (requested by andvar in ticket #660):

sbin/ifconfig/ifconfig.8: revision 1.126
sbin/ifconfig/ifconfig.8: revision 1.127
sbin/ifconfig/ifconfig.8: revision 1.128
sbin/ifconfig/ifconfig.8: revision 1.129

Added documents about parameters related to lagg(4)
PR misc/58125

Correct a very minor typo (s/id/is/)

ifconfig(8): move laggportpri next to laggport

Update the date of the documentation to reflect recent changes.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.124.2.1 src/sbin/ifconfig/ifconfig.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:22:28 UTC 2024

Modified Files:
src/sys/netinet [netbsd-10]: sctp_asconf.c
src/sys/netinet6 [netbsd-10]: in6_ifattach.c nd6.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #659):

sys/netinet6/in6_ifattach.c: revision 1.122
sys/netinet/sctp_asconf.c: revision 1.14
sys/netinet6/nd6.c: revision 1.282

Fix invalid IPv6 route when ipsecif(4) is deleted tunnel.  Pointed out by 
ohishi@IIJ.
The pointed bug is fixed by modification in nd6_need_cache().
Others are similar bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.28.1 src/sys/netinet/sctp_asconf.c
cvs rdiff -u -r1.120 -r1.120.12.1 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.279.4.1 -r1.279.4.2 src/sys/netinet6/nd6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/sctp_asconf.c
diff -u src/sys/netinet/sctp_asconf.c:1.12 src/sys/netinet/sctp_asconf.c:1.12.28.1
--- src/sys/netinet/sctp_asconf.c:1.12	Tue Jun 25 15:33:56 2019
+++ src/sys/netinet/sctp_asconf.c	Thu Apr 18 16:22:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sctp_asconf.c,v 1.12 2019/06/25 15:33:56 rjs Exp $ */
+/*	$NetBSD: sctp_asconf.c,v 1.12.28.1 2024/04/18 16:22:28 martin Exp $ */
 /*	$KAME: sctp_asconf.c,v 1.25 2005/06/16 20:44:24 jinmei Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_asconf.c,v 1.12 2019/06/25 15:33:56 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_asconf.c,v 1.12.28.1 2024/04/18 16:22:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -1540,6 +1540,7 @@ sctp_is_desired_interface_type(struct if
 	case IFT_XETHER:
 	case IFT_SLIP:
 	case IFT_GIF:
+	case IFT_IPSEC:
 		result = 1;
 		break;
 	default:

Index: src/sys/netinet6/in6_ifattach.c
diff -u src/sys/netinet6/in6_ifattach.c:1.120 src/sys/netinet6/in6_ifattach.c:1.120.12.1
--- src/sys/netinet6/in6_ifattach.c:1.120	Mon May 17 04:07:43 2021
+++ src/sys/netinet6/in6_ifattach.c	Thu Apr 18 16:22:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.c,v 1.120 2021/05/17 04:07:43 yamaguchi Exp $	*/
+/*	$NetBSD: in6_ifattach.c,v 1.120.12.1 2024/04/18 16:22:28 martin Exp $	*/
 /*	$KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.120 2021/05/17 04:07:43 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.120.12.1 2024/04/18 16:22:28 martin Exp $");
 
 #include 
 #include 
@@ -262,6 +262,7 @@ in6_get_hw_ifid(struct ifnet *ifp, struc
 		break;
 
 	case IFT_GIF:
+	case IFT_IPSEC:
 #ifdef IFT_STF
 	case IFT_STF:
 #endif

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.279.4.1 src/sys/netinet6/nd6.c:1.279.4.2
--- src/sys/netinet6/nd6.c:1.279.4.1	Sun Dec 10 13:06:16 2023
+++ src/sys/netinet6/nd6.c	Thu Apr 18 16:22:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.279.4.1 2023/12/10 13:06:16 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.279.4.2 2024/04/18 16:22:28 martin Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.279.4.1 2023/12/10 13:06:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.279.4.2 2024/04/18 16:22:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1655,6 +1655,7 @@ nd6_need_cache(struct ifnet *ifp)
 	case IFT_IEEE1394:
 	case IFT_CARP:
 	case IFT_GIF:		/* XXX need more cases? */
+	case IFT_IPSEC:
 	case IFT_PPP:
 	case IFT_TUNNEL:
 		return 1;



CVS commit: [netbsd-10] src/sys

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:22:28 UTC 2024

Modified Files:
src/sys/netinet [netbsd-10]: sctp_asconf.c
src/sys/netinet6 [netbsd-10]: in6_ifattach.c nd6.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #659):

sys/netinet6/in6_ifattach.c: revision 1.122
sys/netinet/sctp_asconf.c: revision 1.14
sys/netinet6/nd6.c: revision 1.282

Fix invalid IPv6 route when ipsecif(4) is deleted tunnel.  Pointed out by 
ohishi@IIJ.
The pointed bug is fixed by modification in nd6_need_cache().
Others are similar bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.28.1 src/sys/netinet/sctp_asconf.c
cvs rdiff -u -r1.120 -r1.120.12.1 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.279.4.1 -r1.279.4.2 src/sys/netinet6/nd6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/share/mk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:12:31 UTC 2024

Modified Files:
src/share/mk [netbsd-9]: bsd.own.mk

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1834):

share/mk/bsd.own.mk: revision 1.1177

ZFS works fine on my v210, so let's enable it for sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1149.2.7 -r1.1149.2.8 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1149.2.7 src/share/mk/bsd.own.mk:1.1149.2.8
--- src/share/mk/bsd.own.mk:1.1149.2.7	Thu Apr 18 15:24:20 2024
+++ src/share/mk/bsd.own.mk	Thu Apr 18 16:12:31 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1149.2.7 2024/04/18 15:24:20 martin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1149.2.8 2024/04/18 16:12:31 martin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -998,9 +998,10 @@ SOFTFLOAT_BITS=	32
 .endif
 
 #
-# We want to build zfs only for amd64 and aarch64 by default for now.
+# We want to build zfs only for amd64, aarch64 and sparc64 by default for now.
 #
-.if ${MACHINE} == "amd64" || ${MACHINE_ARCH} == "aarch64"
+.if ${MACHINE} == "amd64" || ${MACHINE_ARCH} == "aarch64" || \
+${MACHINE} == "sparc64"
 MKZFS?=		yes
 .endif
 



CVS commit: [netbsd-9] src/share/mk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:12:31 UTC 2024

Modified Files:
src/share/mk [netbsd-9]: bsd.own.mk

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1834):

share/mk/bsd.own.mk: revision 1.1177

ZFS works fine on my v210, so let's enable it for sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1149.2.7 -r1.1149.2.8 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/usr.bin/who

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:10:17 UTC 2024

Modified Files:
src/usr.bin/who [netbsd-8]: utmpentry.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1958):

usr.bin/who/utmpentry.c: revision 1.22

PR/56013: Kouichi Hashikawa: Move setutent/setutxent right before the loops.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.8.1 src/usr.bin/who/utmpentry.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/who/utmpentry.c
diff -u src/usr.bin/who/utmpentry.c:1.18 src/usr.bin/who/utmpentry.c:1.18.8.1
--- src/usr.bin/who/utmpentry.c:1.18	Sat Nov 21 15:01:43 2015
+++ src/usr.bin/who/utmpentry.c	Thu Apr 18 16:10:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $	*/
+/*	$NetBSD: utmpentry.c,v 1.18.8.1 2024/04/18 16:10:17 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $");
+__RCSID("$NetBSD: utmpentry.c,v 1.18.8.1 2024/04/18 16:10:17 martin Exp $");
 #endif
 
 #include 
@@ -95,14 +95,7 @@ setup(const char *fname)
 	struct stat st;
 	const char *sfname;
 
-	if (fname == NULL) {
-#ifdef SUPPORT_UTMPX
-		setutxent();
-#endif
-#ifdef SUPPORT_UTMP
-		setutent();
-#endif
-	} else {
+	if (fname != NULL) {
 		size_t len = strlen(fname);
 		if (len == 0)
 			errx(1, "Filename cannot be 0 length.");
@@ -133,9 +126,9 @@ setup(const char *fname)
 			what &= ~1;
 		} else {
 			if (timespeccmp(_mtimespec, , >))
-			utmpxtime = st.st_mtimespec;
+utmpxtime = st.st_mtimespec;
 			else
-			what &= ~1;
+what &= ~1;
 		}
 	}
 #endif
@@ -204,10 +197,11 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMPX
+	setutxent();
 	while ((what & 1) && (utx = getutxent()) != NULL) {
 		if (fname == NULL && ((1 << utx->ut_type) & etype) == 0)
 			continue;
-		if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) {
+		if ((ep = calloc(1, sizeof(*ep))) == NULL) {
 			warn(NULL);
 			return 0;
 		}
@@ -218,6 +212,7 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMP
+	setutent();
 	if ((etype & (1 << USER_PROCESS)) != 0) {
 		while ((what & 2) && (ut = getutent()) != NULL) {
 			if (fname == NULL && (*ut->ut_name == '\0' ||



CVS commit: [netbsd-8] src/usr.bin/who

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:10:17 UTC 2024

Modified Files:
src/usr.bin/who [netbsd-8]: utmpentry.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1958):

usr.bin/who/utmpentry.c: revision 1.22

PR/56013: Kouichi Hashikawa: Move setutent/setutxent right before the loops.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.8.1 src/usr.bin/who/utmpentry.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/usr.bin/who

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:09:09 UTC 2024

Modified Files:
src/usr.bin/who [netbsd-9]: utmpentry.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1833):

usr.bin/who/utmpentry.c: revision 1.22

PR/56013: Kouichi Hashikawa: Move setutent/setutxent right before the loops.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.18.1 src/usr.bin/who/utmpentry.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/who/utmpentry.c
diff -u src/usr.bin/who/utmpentry.c:1.18 src/usr.bin/who/utmpentry.c:1.18.18.1
--- src/usr.bin/who/utmpentry.c:1.18	Sat Nov 21 15:01:43 2015
+++ src/usr.bin/who/utmpentry.c	Thu Apr 18 16:09:09 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $	*/
+/*	$NetBSD: utmpentry.c,v 1.18.18.1 2024/04/18 16:09:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: utmpentry.c,v 1.18 2015/11/21 15:01:43 christos Exp $");
+__RCSID("$NetBSD: utmpentry.c,v 1.18.18.1 2024/04/18 16:09:09 martin Exp $");
 #endif
 
 #include 
@@ -95,14 +95,7 @@ setup(const char *fname)
 	struct stat st;
 	const char *sfname;
 
-	if (fname == NULL) {
-#ifdef SUPPORT_UTMPX
-		setutxent();
-#endif
-#ifdef SUPPORT_UTMP
-		setutent();
-#endif
-	} else {
+	if (fname != NULL) {
 		size_t len = strlen(fname);
 		if (len == 0)
 			errx(1, "Filename cannot be 0 length.");
@@ -133,9 +126,9 @@ setup(const char *fname)
 			what &= ~1;
 		} else {
 			if (timespeccmp(_mtimespec, , >))
-			utmpxtime = st.st_mtimespec;
+utmpxtime = st.st_mtimespec;
 			else
-			what &= ~1;
+what &= ~1;
 		}
 	}
 #endif
@@ -204,10 +197,11 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMPX
+	setutxent();
 	while ((what & 1) && (utx = getutxent()) != NULL) {
 		if (fname == NULL && ((1 << utx->ut_type) & etype) == 0)
 			continue;
-		if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) {
+		if ((ep = calloc(1, sizeof(*ep))) == NULL) {
 			warn(NULL);
 			return 0;
 		}
@@ -218,6 +212,7 @@ getutentries(const char *fname, struct u
 #endif
 
 #ifdef SUPPORT_UTMP
+	setutent();
 	if ((etype & (1 << USER_PROCESS)) != 0) {
 		while ((what & 2) && (ut = getutent()) != NULL) {
 			if (fname == NULL && (*ut->ut_name == '\0' ||



CVS commit: [netbsd-9] src/usr.bin/who

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:09:09 UTC 2024

Modified Files:
src/usr.bin/who [netbsd-9]: utmpentry.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1833):

usr.bin/who/utmpentry.c: revision 1.22

PR/56013: Kouichi Hashikawa: Move setutent/setutxent right before the loops.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.18.1 src/usr.bin/who/utmpentry.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/external/gpl2/grep/dist/src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:06:25 UTC 2024

Modified Files:
src/external/gpl2/grep/dist/src [netbsd-8]: grep.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1957):

external/gpl2/grep/dist/src/grep.c: revision 1.3

PR/56584: Andreas Gustafsson: Skip FIFO's when -D


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/external/gpl2/grep/dist/src/grep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/external/gpl2/grep/dist/src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:06:25 UTC 2024

Modified Files:
src/external/gpl2/grep/dist/src [netbsd-8]: grep.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1957):

external/gpl2/grep/dist/src/grep.c: revision 1.3

PR/56584: Andreas Gustafsson: Skip FIFO's when -D


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/external/gpl2/grep/dist/src/grep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/grep/dist/src/grep.c
diff -u src/external/gpl2/grep/dist/src/grep.c:1.2 src/external/gpl2/grep/dist/src/grep.c:1.2.8.1
--- src/external/gpl2/grep/dist/src/grep.c:1.2	Sun Jan 10 22:16:40 2016
+++ src/external/gpl2/grep/dist/src/grep.c	Thu Apr 18 16:06:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.2 2016/01/10 22:16:40 christos Exp $	*/
+/*	$NetBSD: grep.c,v 1.2.8.1 2024/04/18 16:06:24 martin Exp $	*/
 
 /* grep.c - main driver file for grep.
Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc.
@@ -271,11 +271,15 @@ reset (int fd, char const *file, struct 
 }
   if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
 return 0;
-#ifndef DJGPP
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
-#else
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode)
+  || S_ISBLK(stats->stat.st_mode)
+#ifdef S_ISSOCK
+  || S_ISSOCK(stats->stat.st_mode)
+#endif
+#ifdef S_ISFIFO
+  || S_ISFIFO(stats->stat.st_mode)
 #endif
+  ))
 return 0;
   if (S_ISREG (stats->stat.st_mode))
 {



CVS commit: [netbsd-9] src/external/gpl2/grep/dist/src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:05:24 UTC 2024

Modified Files:
src/external/gpl2/grep/dist/src [netbsd-9]: grep.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1832):

external/gpl2/grep/dist/src/grep.c: revision 1.3

PR/56584: Andreas Gustafsson: Skip FIFO's when -D


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.18.1 src/external/gpl2/grep/dist/src/grep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/grep/dist/src/grep.c
diff -u src/external/gpl2/grep/dist/src/grep.c:1.2 src/external/gpl2/grep/dist/src/grep.c:1.2.18.1
--- src/external/gpl2/grep/dist/src/grep.c:1.2	Sun Jan 10 22:16:40 2016
+++ src/external/gpl2/grep/dist/src/grep.c	Thu Apr 18 16:05:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.2 2016/01/10 22:16:40 christos Exp $	*/
+/*	$NetBSD: grep.c,v 1.2.18.1 2024/04/18 16:05:24 martin Exp $	*/
 
 /* grep.c - main driver file for grep.
Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc.
@@ -271,11 +271,15 @@ reset (int fd, char const *file, struct 
 }
   if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
 return 0;
-#ifndef DJGPP
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
-#else
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode)
+  || S_ISBLK(stats->stat.st_mode)
+#ifdef S_ISSOCK
+  || S_ISSOCK(stats->stat.st_mode)
+#endif
+#ifdef S_ISFIFO
+  || S_ISFIFO(stats->stat.st_mode)
 #endif
+  ))
 return 0;
   if (S_ISREG (stats->stat.st_mode))
 {



CVS commit: [netbsd-9] src/external/gpl2/grep/dist/src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:05:24 UTC 2024

Modified Files:
src/external/gpl2/grep/dist/src [netbsd-9]: grep.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1832):

external/gpl2/grep/dist/src/grep.c: revision 1.3

PR/56584: Andreas Gustafsson: Skip FIFO's when -D


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.18.1 src/external/gpl2/grep/dist/src/grep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/external/bsd/am-utils/dist

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:02:26 UTC 2024

Modified Files:
src/external/bsd/am-utils/dist/amd [netbsd-8]: amq_subr.c
src/external/bsd/am-utils/dist/amq [netbsd-8]: amq.c amq_xdr.c
src/external/bsd/am-utils/dist/include [netbsd-8]: amq_defs.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1956):

external/bsd/am-utils/dist/include/amq_defs.h: revision 1.2
external/bsd/am-utils/dist/amq/amq_xdr.c: revision 1.2
external/bsd/am-utils/dist/amq/amq.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.5

fix pointer bug (thanks RVP) and change to use 64 bit times. Don't bother
with backwards compatibility; too much work for little benefit.

remove long cast (thanks RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.8.1 src/external/bsd/am-utils/dist/amd/amq_subr.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/external/bsd/am-utils/dist/amq/amq.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
src/external/bsd/am-utils/dist/amq/amq_xdr.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
src/external/bsd/am-utils/dist/include/amq_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/amq_subr.c
diff -u src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3 src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3.8.1
--- src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3	Sun Jan 18 16:27:36 2015
+++ src/external/bsd/am-utils/dist/amd/amq_subr.c	Thu Apr 18 16:02:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_subr.c,v 1.3 2015/01/18 16:27:36 christos Exp $	*/
+/*	$NetBSD: amq_subr.c,v 1.3.8.1 2024/04/18 16:02:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -331,7 +331,7 @@ bool_t
 xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp)
 {
   am_node *mp = (am_node *) objp;
-  long mtime;
+  longlong_t mtime;
 
   if (!xdr_amq_string(xdrs, >am_al->al_mnt->mf_info)) {
 return (FALSE);
@@ -346,7 +346,7 @@ xdr_amq_mount_tree_node(XDR *xdrs, amq_m
 return (FALSE);
   }
   mtime = mp->am_stats.s_mtime;
-  if (!xdr_long(xdrs, )) {
+  if (!xdr_longlong_t(xdrs, )) {
 return (FALSE);
   }
   if (!xdr_u_short(xdrs, >am_stats.s_uid)) {
@@ -530,7 +530,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   u_int len = 0;
   int x;
   char *n;
-  long modify;
+  longlong_t modify;
 
   /*
* Compute length of list
@@ -555,8 +555,8 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   return (FALSE);
 }
 
-modify = (long)m->modify;
-if (!xdr_long(xdrs, )) {
+modify = m->modify;
+if (!xdr_longlong_t(xdrs, )) {
   return (FALSE);
 }
 

Index: src/external/bsd/am-utils/dist/amq/amq.c
diff -u src/external/bsd/am-utils/dist/amq/amq.c:1.3 src/external/bsd/am-utils/dist/amq/amq.c:1.3.8.1
--- src/external/bsd/am-utils/dist/amq/amq.c:1.3	Sun Jan 18 15:37:57 2015
+++ src/external/bsd/am-utils/dist/amq/amq.c	Thu Apr 18 16:02:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq.c,v 1.3 2015/01/18 15:37:57 christos Exp $	*/
+/*	$NetBSD: amq.c,v 1.3.8.1 2024/04/18 16:02:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -81,7 +81,7 @@ enum show_opt {
 static void
 time_print(time_type tt)
 {
-  time_t t = (time_t)*tt;
+  time_t t = (time_t)tt;
   struct tm *tp = localtime();
   printf("%02d/%02d/%04d %02d:%02d:%02d",
 	 tp->tm_mon + 1, tp->tm_mday,

Index: src/external/bsd/am-utils/dist/amq/amq_xdr.c
diff -u src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3 src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3.8.1
--- src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3	Sat Jan 17 16:34:15 2015
+++ src/external/bsd/am-utils/dist/amq/amq_xdr.c	Thu Apr 18 16:02:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_xdr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: amq_xdr.c,v 1.1.1.3.8.1 2024/04/18 16:02:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -49,7 +49,7 @@
 bool_t
 xdr_time_type(XDR *xdrs, time_type *objp)
 {
-  if (!xdr_long(xdrs, (long *) objp)) {
+  if (!xdr_longlong_t(xdrs, (longlong_t *) objp)) {
 return (FALSE);
   }
   return (TRUE);

Index: src/external/bsd/am-utils/dist/include/amq_defs.h
diff -u src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3 src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3.8.1
--- src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3	Sat Jan 17 16:34:18 2015
+++ src/external/bsd/am-utils/dist/include/amq_defs.h	Thu Apr 18 16:02:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_defs.h,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $	*/
+/*	$NetBSD: amq_defs.h,v 1.1.1.3.8.1 2024/04/18 16:02:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -68,7 +68,7 @@
 /*
  * TYPEDEFS
  */
-typedef long *time_type;
+typedef long long time_type;
 typedef struct amq_mount_info amq_mount_info;
 typedef struct 

CVS commit: [netbsd-8] src/external/bsd/am-utils/dist

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 16:02:26 UTC 2024

Modified Files:
src/external/bsd/am-utils/dist/amd [netbsd-8]: amq_subr.c
src/external/bsd/am-utils/dist/amq [netbsd-8]: amq.c amq_xdr.c
src/external/bsd/am-utils/dist/include [netbsd-8]: amq_defs.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1956):

external/bsd/am-utils/dist/include/amq_defs.h: revision 1.2
external/bsd/am-utils/dist/amq/amq_xdr.c: revision 1.2
external/bsd/am-utils/dist/amq/amq.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.5

fix pointer bug (thanks RVP) and change to use 64 bit times. Don't bother
with backwards compatibility; too much work for little benefit.

remove long cast (thanks RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.8.1 src/external/bsd/am-utils/dist/amd/amq_subr.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/external/bsd/am-utils/dist/amq/amq.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
src/external/bsd/am-utils/dist/amq/amq_xdr.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
src/external/bsd/am-utils/dist/include/amq_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/external/bsd/am-utils/dist

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:59:59 UTC 2024

Modified Files:
src/external/bsd/am-utils/dist/amd [netbsd-9]: amq_subr.c
src/external/bsd/am-utils/dist/amq [netbsd-9]: amq.c amq_xdr.c
src/external/bsd/am-utils/dist/include [netbsd-9]: amq_defs.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1831):

external/bsd/am-utils/dist/include/amq_defs.h: revision 1.2
external/bsd/am-utils/dist/amq/amq_xdr.c: revision 1.2
external/bsd/am-utils/dist/amq/amq.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.5

fix pointer bug (thanks RVP) and change to use 64 bit times. Don't bother
with backwards compatibility; too much work for little benefit.

remove long cast (thanks RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amd/amq_subr.c
cvs rdiff -u -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amq/amq.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.18.1 \
src/external/bsd/am-utils/dist/amq/amq_xdr.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.18.1 \
src/external/bsd/am-utils/dist/include/amq_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/external/bsd/am-utils/dist

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:59:59 UTC 2024

Modified Files:
src/external/bsd/am-utils/dist/amd [netbsd-9]: amq_subr.c
src/external/bsd/am-utils/dist/amq [netbsd-9]: amq.c amq_xdr.c
src/external/bsd/am-utils/dist/include [netbsd-9]: amq_defs.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1831):

external/bsd/am-utils/dist/include/amq_defs.h: revision 1.2
external/bsd/am-utils/dist/amq/amq_xdr.c: revision 1.2
external/bsd/am-utils/dist/amq/amq.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.4
external/bsd/am-utils/dist/amd/amq_subr.c: revision 1.5

fix pointer bug (thanks RVP) and change to use 64 bit times. Don't bother
with backwards compatibility; too much work for little benefit.

remove long cast (thanks RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amd/amq_subr.c
cvs rdiff -u -r1.3 -r1.3.18.1 src/external/bsd/am-utils/dist/amq/amq.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.18.1 \
src/external/bsd/am-utils/dist/amq/amq_xdr.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.18.1 \
src/external/bsd/am-utils/dist/include/amq_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/amq_subr.c
diff -u src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3 src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3.18.1
--- src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3	Sun Jan 18 16:27:36 2015
+++ src/external/bsd/am-utils/dist/amd/amq_subr.c	Thu Apr 18 15:59:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_subr.c,v 1.3 2015/01/18 16:27:36 christos Exp $	*/
+/*	$NetBSD: amq_subr.c,v 1.3.18.1 2024/04/18 15:59:59 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -331,7 +331,7 @@ bool_t
 xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp)
 {
   am_node *mp = (am_node *) objp;
-  long mtime;
+  longlong_t mtime;
 
   if (!xdr_amq_string(xdrs, >am_al->al_mnt->mf_info)) {
 return (FALSE);
@@ -346,7 +346,7 @@ xdr_amq_mount_tree_node(XDR *xdrs, amq_m
 return (FALSE);
   }
   mtime = mp->am_stats.s_mtime;
-  if (!xdr_long(xdrs, )) {
+  if (!xdr_longlong_t(xdrs, )) {
 return (FALSE);
   }
   if (!xdr_u_short(xdrs, >am_stats.s_uid)) {
@@ -530,7 +530,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   u_int len = 0;
   int x;
   char *n;
-  long modify;
+  longlong_t modify;
 
   /*
* Compute length of list
@@ -555,8 +555,8 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   return (FALSE);
 }
 
-modify = (long)m->modify;
-if (!xdr_long(xdrs, )) {
+modify = m->modify;
+if (!xdr_longlong_t(xdrs, )) {
   return (FALSE);
 }
 

Index: src/external/bsd/am-utils/dist/amq/amq.c
diff -u src/external/bsd/am-utils/dist/amq/amq.c:1.3 src/external/bsd/am-utils/dist/amq/amq.c:1.3.18.1
--- src/external/bsd/am-utils/dist/amq/amq.c:1.3	Sun Jan 18 15:37:57 2015
+++ src/external/bsd/am-utils/dist/amq/amq.c	Thu Apr 18 15:59:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq.c,v 1.3 2015/01/18 15:37:57 christos Exp $	*/
+/*	$NetBSD: amq.c,v 1.3.18.1 2024/04/18 15:59:59 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -81,7 +81,7 @@ enum show_opt {
 static void
 time_print(time_type tt)
 {
-  time_t t = (time_t)*tt;
+  time_t t = (time_t)tt;
   struct tm *tp = localtime();
   printf("%02d/%02d/%04d %02d:%02d:%02d",
 	 tp->tm_mon + 1, tp->tm_mday,

Index: src/external/bsd/am-utils/dist/amq/amq_xdr.c
diff -u src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3 src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3.18.1
--- src/external/bsd/am-utils/dist/amq/amq_xdr.c:1.1.1.3	Sat Jan 17 16:34:15 2015
+++ src/external/bsd/am-utils/dist/amq/amq_xdr.c	Thu Apr 18 15:59:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_xdr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: amq_xdr.c,v 1.1.1.3.18.1 2024/04/18 15:59:59 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -49,7 +49,7 @@
 bool_t
 xdr_time_type(XDR *xdrs, time_type *objp)
 {
-  if (!xdr_long(xdrs, (long *) objp)) {
+  if (!xdr_longlong_t(xdrs, (longlong_t *) objp)) {
 return (FALSE);
   }
   return (TRUE);

Index: src/external/bsd/am-utils/dist/include/amq_defs.h
diff -u src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3 src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3.18.1
--- src/external/bsd/am-utils/dist/include/amq_defs.h:1.1.1.3	Sat Jan 17 16:34:18 2015
+++ src/external/bsd/am-utils/dist/include/amq_defs.h	Thu Apr 18 15:59:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_defs.h,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $	*/
+/*	$NetBSD: amq_defs.h,v 1.1.1.3.18.1 2024/04/18 15:59:59 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -68,7 +68,7 @@
 /*
  * TYPEDEFS
  */
-typedef long *time_type;
+typedef long long time_type;
 typedef struct amq_mount_info amq_mount_info;
 typedef 

CVS commit: [netbsd-9] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:51:36 UTC 2024

Modified Files:
src/share/man/man9 [netbsd-9]: workqueue.9
src/sys/kern [netbsd-9]: subr_workqueue.c
src/tests/rump/kernspace [netbsd-9]: kernspace.h workqueue.c
src/tests/rump/rumpkern [netbsd-9]: Makefile t_workqueue.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1830):

sys/kern/subr_workqueue.c: revision 1.40
sys/kern/subr_workqueue.c: revision 1.41
sys/kern/subr_workqueue.c: revision 1.42
sys/kern/subr_workqueue.c: revision 1.43
sys/kern/subr_workqueue.c: revision 1.44
sys/kern/subr_workqueue.c: revision 1.45
sys/kern/subr_workqueue.c: revision 1.46
tests/rump/kernspace/workqueue.c: revision 1.7
sys/kern/subr_workqueue.c: revision 1.47
tests/rump/kernspace/workqueue.c: revision 1.8
tests/rump/kernspace/workqueue.c: revision 1.9
tests/rump/rumpkern/t_workqueue.c: revision 1.3
tests/rump/rumpkern/t_workqueue.c: revision 1.4
tests/rump/kernspace/kernspace.h: revision 1.9
tests/rump/rumpkern/Makefile: revision 1.20
sys/kern/subr_workqueue.c: revision 1.39
share/man/man9/workqueue.9: revision 1.15
(all via patch)

workqueue: Lift unnecessary restriction on workqueue_wait.

Allow multiple concurrent waits at a time, and allow enqueueing work
at the same time (as long as it's not the work we're waiting for).

This way multiple users can use a shared global workqueue and safely
wait for individual work items concurrently, while the workqueue is
still in use for other items (e.g., wg(4) peers).

This has the side effect of taking away a diagnostic measure, but I
think allowing the diagnostic's false positives instead of rejecting
them is worth it.  We could cheaply add it back with some false
negatives if it's important.
workqueue(9): workqueue_wait and workqueue_destroy may sleep.

But might not, so assert sleepable up front.
workqueue(9): Sprinkle dtrace probes.
tests/rump/rumpkern: Use PROGDPLIBS, not explicit -L/-l.

This way we relink the t_* test programs whenever changes under
tests/rump/kernspace change libkernspace.a.

workqueue(9) tests: Nix trailing whitespace.

workqueue(9) tests: Destroy struct work immediately on entry.

workqueue(9) tests: Add test for PR kern/57574.

workqueue(9): Avoid touching running work items in workqueue_wait.

As soon as the workqueue function has called, it is forbidden to
touch the struct work passed to it -- the function might free or
reuse the data structure it is embedded in.

So workqueue_wait is forbidden to search the queue for the batch of
running work items.  Instead, use a generation number which is odd
while the thread is processing a batch of work and even when not.
There's still a small optimization available with the struct work
pointer to wait for: if we find the work item in one of the per-CPU
_pending_ queues, then after we wait for a batch of work to complete
on that CPU, we don't need to wait for work on any other CPUs.
PR kern/57574

workqueue(9): Sprinkle dtrace probes for workqueue_wait edge cases.

Let's make it easy to find out whether these are hit.

workqueue(9): Stop violating queue(3) internals.

workqueue(9): Avoid unnecessary mutex_exit/enter cycle each loop.

workqueue(9): Sort includes.
No functional change intended.

workqueue(9): Factor out wq->wq_flags & WQ_FPU in workqueue_worker.
No functional change intended.  Makes it clearer that s is
initialized when used.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.6.1 src/share/man/man9/workqueue.9
cvs rdiff -u -r1.37 -r1.37.6.1 src/sys/kern/subr_workqueue.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/tests/rump/kernspace/kernspace.h
cvs rdiff -u -r1.6 -r1.6.8.1 src/tests/rump/kernspace/workqueue.c
cvs rdiff -u -r1.18 -r1.18.2.1 src/tests/rump/rumpkern/Makefile
cvs rdiff -u -r1.2 -r1.2.8.1 src/tests/rump/rumpkern/t_workqueue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/workqueue.9
diff -u src/share/man/man9/workqueue.9:1.12 src/share/man/man9/workqueue.9:1.12.6.1
--- src/share/man/man9/workqueue.9:1.12	Thu Dec 28 07:00:52 2017
+++ src/share/man/man9/workqueue.9	Thu Apr 18 15:51:36 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: workqueue.9,v 1.12 2017/12/28 07:00:52 ozaki-r Exp $
+.\"	$NetBSD: workqueue.9,v 1.12.6.1 2024/04/18 15:51:36 martin Exp $
 .\"
 .\" Copyright (c)2005 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -128,11 +128,11 @@ waits for a specified work
 on the workqueue
 .Fa wq
 to finish.
-The caller must ensure that no new work will be enqueued to the workqueue
-beforehand.
-Note that if the workqueue is
-.Dv WQ_PERCPU ,
-the caller can enqueue a new work to another queue other than the waiting queue.
+The caller must ensure that
+.Fa wk
+will not be enqueued to the workqueue 

CVS commit: [netbsd-9] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:51:36 UTC 2024

Modified Files:
src/share/man/man9 [netbsd-9]: workqueue.9
src/sys/kern [netbsd-9]: subr_workqueue.c
src/tests/rump/kernspace [netbsd-9]: kernspace.h workqueue.c
src/tests/rump/rumpkern [netbsd-9]: Makefile t_workqueue.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1830):

sys/kern/subr_workqueue.c: revision 1.40
sys/kern/subr_workqueue.c: revision 1.41
sys/kern/subr_workqueue.c: revision 1.42
sys/kern/subr_workqueue.c: revision 1.43
sys/kern/subr_workqueue.c: revision 1.44
sys/kern/subr_workqueue.c: revision 1.45
sys/kern/subr_workqueue.c: revision 1.46
tests/rump/kernspace/workqueue.c: revision 1.7
sys/kern/subr_workqueue.c: revision 1.47
tests/rump/kernspace/workqueue.c: revision 1.8
tests/rump/kernspace/workqueue.c: revision 1.9
tests/rump/rumpkern/t_workqueue.c: revision 1.3
tests/rump/rumpkern/t_workqueue.c: revision 1.4
tests/rump/kernspace/kernspace.h: revision 1.9
tests/rump/rumpkern/Makefile: revision 1.20
sys/kern/subr_workqueue.c: revision 1.39
share/man/man9/workqueue.9: revision 1.15
(all via patch)

workqueue: Lift unnecessary restriction on workqueue_wait.

Allow multiple concurrent waits at a time, and allow enqueueing work
at the same time (as long as it's not the work we're waiting for).

This way multiple users can use a shared global workqueue and safely
wait for individual work items concurrently, while the workqueue is
still in use for other items (e.g., wg(4) peers).

This has the side effect of taking away a diagnostic measure, but I
think allowing the diagnostic's false positives instead of rejecting
them is worth it.  We could cheaply add it back with some false
negatives if it's important.
workqueue(9): workqueue_wait and workqueue_destroy may sleep.

But might not, so assert sleepable up front.
workqueue(9): Sprinkle dtrace probes.
tests/rump/rumpkern: Use PROGDPLIBS, not explicit -L/-l.

This way we relink the t_* test programs whenever changes under
tests/rump/kernspace change libkernspace.a.

workqueue(9) tests: Nix trailing whitespace.

workqueue(9) tests: Destroy struct work immediately on entry.

workqueue(9) tests: Add test for PR kern/57574.

workqueue(9): Avoid touching running work items in workqueue_wait.

As soon as the workqueue function has called, it is forbidden to
touch the struct work passed to it -- the function might free or
reuse the data structure it is embedded in.

So workqueue_wait is forbidden to search the queue for the batch of
running work items.  Instead, use a generation number which is odd
while the thread is processing a batch of work and even when not.
There's still a small optimization available with the struct work
pointer to wait for: if we find the work item in one of the per-CPU
_pending_ queues, then after we wait for a batch of work to complete
on that CPU, we don't need to wait for work on any other CPUs.
PR kern/57574

workqueue(9): Sprinkle dtrace probes for workqueue_wait edge cases.

Let's make it easy to find out whether these are hit.

workqueue(9): Stop violating queue(3) internals.

workqueue(9): Avoid unnecessary mutex_exit/enter cycle each loop.

workqueue(9): Sort includes.
No functional change intended.

workqueue(9): Factor out wq->wq_flags & WQ_FPU in workqueue_worker.
No functional change intended.  Makes it clearer that s is
initialized when used.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.6.1 src/share/man/man9/workqueue.9
cvs rdiff -u -r1.37 -r1.37.6.1 src/sys/kern/subr_workqueue.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/tests/rump/kernspace/kernspace.h
cvs rdiff -u -r1.6 -r1.6.8.1 src/tests/rump/kernspace/workqueue.c
cvs rdiff -u -r1.18 -r1.18.2.1 src/tests/rump/rumpkern/Makefile
cvs rdiff -u -r1.2 -r1.2.8.1 src/tests/rump/rumpkern/t_workqueue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/share/man/man4

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:44:37 UTC 2024

Modified Files:
src/share/man/man4 [netbsd-10]: wg.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #658):

share/man/man4/wg.4: revision 1.8
share/man/man4/wg.4: revision 1.9

wg(4): Rework example numbering for clarity and add IPv6.

Let's avoid triggering unease with host number 0.
PR misc/58015

wg(4): Fix IPv6 numbering in example diagram.

This way it matches the configuration suggested below (which avoids
host number zero on the subnet).

PR misc/58015


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.1 -r1.6.6.2 src/share/man/man4/wg.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/wg.4
diff -u src/share/man/man4/wg.4:1.6.6.1 src/share/man/man4/wg.4:1.6.6.2
--- src/share/man/man4/wg.4:1.6.6.1	Mon Mar 11 19:39:23 2024
+++ src/share/man/man4/wg.4	Thu Apr 18 15:44:37 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wg.4,v 1.6.6.1 2024/03/11 19:39:23 martin Exp $
+.\"	$NetBSD: wg.4,v 1.6.6.2 2024/04/18 15:44:37 martin Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -75,21 +75,23 @@ endpoint IP address outside the tunnel.
 .Sh EXAMPLES
 Typical network topology:
 .Bd -literal -offset abcd
-wm0 = 192.0.2.123 bge0 = 198.51.100.45
-
 Stationary server: Roaming client:
 +-++-+
 |A||B|
 |-||-|
-|[wm0]-internet[bge0]|
+| | 192.0.2.123  198.51.100.45 | |
+|[wm0]--internet---[bge0]|
 |[wg0] port 1234 - - - (tunnel) - - - - - - [wg0]|
-|   10.0.1.0  |   10.0.1.1   |
+|   10.2.0.1  |   10.2.0.42  |
+|   fd00:2::1 |  fd00:2::42  |
 | |   || |
 +--[wm1]--+  +-+   +-+
- |   | VPN 10.0.1.0/24 |
+ | 10.1.0.1  | VPN 10.2.0.0/24 |
+ |   | fd00:2::/64 |
  |   +-+
 +-+
-| LAN 10.0.0.0/24 |
+| LAN 10.1.0.0/24 |
+| fd00:1::/64 |
 +-+
 .Ed
 .Pp
@@ -114,40 +116,52 @@ A# (umask 0077; wg-keygen > /etc/wg/wg0.
 .Ed
 .Pp
 Configure A to listen on port 1234 and allow connections from B to
-appear in the 10.0.1.0/24 subnet:
+appear in the 10.2.0.0/24 and fd00:2::/64 subnets:
 .Bd -literal -offset abcd
-A# ifconfig wg0 create 10.0.1.0/24
+A# ifconfig wg0 create
+A# ifconfig wg0 inet 10.2.0.1/24
+A# ifconfig wg0 inet6 fd00:2::1/64
 A# wgconfig wg0 set private-key /etc/wg/wg0
 A# wgconfig wg0 set listen-port 1234
 A# wgconfig wg0 add peer B \e
 X7EGm3T3IfodBcyilkaC89j0SH3XD6+/pwvp7Dgp5SU= \e
 --preshared-key=/etc/wg/wg0.A-B \e
---allowed-ips=10.0.1.1/32
+--allowed-ips=10.2.0.42/32,fd00:2::42/128
 A# ifconfig wg0 up
 A# ifconfig wg0
 wg0: flags=0x8041 mtu 1420
-inet 10.0.1.0/24 flags 0
+status: active
 inet6 fe80::22f7:d6ff:fe3a:1e60%wg0/64 flags 0 scopeid 0x3
+inet6 fd00:2::1/64 flags 0
+inet 10.2.0.1/24 flags 0
 .Ed
 .Pp
 Configure B to connect to A at 192.0.2.123 on port 1234 and the packets
 can begin to flow:
 .Bd -literal -offset abcd
-B# ifconfig wg0 create 10.0.1.1/24
+B# ifconfig wg0 create
+B# ifconfig wg0 inet 10.2.0.42/24
+B# ifconfig wg0 inet6 fd00:2::42/64
 B# wgconfig wg0 set private-key /etc/wg/wg0
 B# wgconfig wg0 add peer A \e
 N+B4Nelg+4ysvbLW3qenxIwrJVE9MdjMyqrIisH7V0Y= \e
 --preshared-key=/etc/wg/wg0.A-B \e
---allowed-ips=10.0.1.0/32 \e
+--allowed-ips=10.2.0.1/32,fd00:2::1/128 \e
 --endpoint=192.0.2.123:1234
 B# ifconfig wg0 up
 B# ifconfig wg0
 wg0: flags=0x8041 mtu 1420
-inet 10.0.1.1/24 flags 0
+status: active
 inet6 fe80::56eb:59ff:fe3d:d413%wg0/64 flags 0 scopeid 0x3
-B# ping -n 10.0.1.0
-PING 10.0.1.0 (10.0.1.0): 56 data bytes
-64 bytes from 10.0.1.0: icmp_seq=0 ttl=255 time=2.721110 ms
+inet6 fd00:2::42/64 flags 0
+inet 10.2.0.42/24 flags 0
+B# ping -n 10.2.0.1
+PING 10.2.0.1 (10.2.0.1): 56 data bytes
+64 bytes from 10.2.0.1: icmp_seq=0 ttl=255 time=2.721110 ms
+\&...
+B# ping6 -n fd00:2::1
+PING6(56=40+8+8 bytes) fd00:2::42 --> fd00:2::1
+16 bytes from fd00:2::1, icmp_seq=0 hlim=64 time=2.634 ms
 \&...
 .Ed
 .\"



CVS commit: [netbsd-10] src/share/man/man4

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:44:37 UTC 2024

Modified Files:
src/share/man/man4 [netbsd-10]: wg.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #658):

share/man/man4/wg.4: revision 1.8
share/man/man4/wg.4: revision 1.9

wg(4): Rework example numbering for clarity and add IPv6.

Let's avoid triggering unease with host number 0.
PR misc/58015

wg(4): Fix IPv6 numbering in example diagram.

This way it matches the configuration suggested below (which avoids
host number zero on the subnet).

PR misc/58015


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.1 -r1.6.6.2 src/share/man/man4/wg.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:42:45 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-8]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1955):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.15.4.1 -r1.15.4.2 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15.4.1 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15.4.2
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15.4.1	Thu Nov  1 07:52:59 2018
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Thu Apr 18 15:42:45 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15.4.1 2018/11/01 07:52:59 martin Exp $
+#	$NetBSD: Makefile,v 1.15.4.2 2024/04/18 15:42:45 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -29,7 +29,9 @@ IMAGEDEPENDS=	${CRUNCHBIN} \
 		${NETBSDSRCDIR}/etc/group \
 		${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \
 		${DISTRIBDIR}/common/services
-IMAGEPREBUILD=	${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR}
+IMAGEPREBUILD= \
+	(cd ${DESTDIR} && ${TOOL_PAX} ${PAX_TIMESTAMP} -w libdata/firmware) \
+	| (cd ${WORKDIR} && ${TOOL_PAX} -r -pp)
 
 # Use stubs to eliminate some large stuff from libc
 HACKSRC=	${DISTRIBDIR}/utils/libhack



CVS commit: [netbsd-8] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:42:45 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-8]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1955):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.15.4.1 -r1.15.4.2 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:41:13 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1829):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.17.4.1 -r1.17.4.2 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17.4.1 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17.4.2
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17.4.1	Fri Aug 23 04:22:49 2019
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Thu Apr 18 15:41:13 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17.4.1 2019/08/23 04:22:49 msaitoh Exp $
+#	$NetBSD: Makefile,v 1.17.4.2 2024/04/18 15:41:13 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -29,7 +29,9 @@ IMAGEDEPENDS=	${CRUNCHBIN} \
 		${NETBSDSRCDIR}/etc/group \
 		${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \
 		${DISTRIBDIR}/common/services
-IMAGEPREBUILD=	${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR}
+IMAGEPREBUILD= \
+	(cd ${DESTDIR} && ${TOOL_PAX} ${PAX_TIMESTAMP} -w libdata/firmware) \
+	| (cd ${WORKDIR} && ${TOOL_PAX} -r -pp)
 
 # Use stubs to eliminate some large stuff from libc
 HACKSRC=	${DISTRIBDIR}/utils/libhack



CVS commit: [netbsd-9] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:41:13 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1829):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.17.4.1 -r1.17.4.2 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:40:17 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #657):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.6.1 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.25 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.25.6.1
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.25	Thu Mar 26 07:44:43 2020
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Thu Apr 18 15:40:16 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2020/03/26 07:44:43 skrll Exp $
+#	$NetBSD: Makefile,v 1.25.6.1 2024/04/18 15:40:16 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -29,7 +29,9 @@ IMAGEDEPENDS=	${CRUNCHBIN} \
 		${NETBSDSRCDIR}/etc/group \
 		${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \
 		${DISTRIBDIR}/common/services
-IMAGEPREBUILD=	${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR}
+IMAGEPREBUILD= \
+	(cd ${DESTDIR} && ${TOOL_PAX} ${PAX_TIMESTAMP} -w libdata/firmware) \
+	| (cd ${WORKDIR} && ${TOOL_PAX} -r -pp)
 
 # Use stubs to eliminate some large stuff from libc
 HACKSRC=	${DISTRIBDIR}/utils/libhack



CVS commit: [netbsd-10] src/distrib/evbarm/instkernel/sshramdisk

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:40:17 UTC 2024

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #657):

distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.26

evbarm/instkernel/sshramdisk: Put firmware in the right paths.

Maybe this should also be wired up to `release' to put the ramdisk in
the releasedir so we detect destdir path leakage like this had.

PR port-evbarm/58035


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.6.1 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/stand/efiboot

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:33:44 UTC 2024

Modified Files:
src/sys/stand/efiboot [netbsd-9]: efiboot.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1828):

sys/stand/efiboot/efiboot.c: revision 1.23

efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075


To generate a diff of this commit:
cvs rdiff -u -r1.16.4.1 -r1.16.4.2 src/sys/stand/efiboot/efiboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efiboot.c
diff -u src/sys/stand/efiboot/efiboot.c:1.16.4.1 src/sys/stand/efiboot/efiboot.c:1.16.4.2
--- src/sys/stand/efiboot/efiboot.c:1.16.4.1	Thu Sep 26 19:15:18 2019
+++ src/sys/stand/efiboot/efiboot.c	Thu Apr 18 15:33:44 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot.c,v 1.16.4.1 2019/09/26 19:15:18 martin Exp $ */
+/* $NetBSD: efiboot.c,v 1.16.4.2 2024/04/18 15:33:44 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -84,6 +84,8 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYS
 	status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, , (void **)_bootdp);
 	if (EFI_ERROR(status))
 		efi_bootdp = NULL;
+	else
+		efi_bootdp = DuplicateDevicePath(efi_bootdp);
 
 #ifdef EFIBOOT_DEBUG
 	Print(L"Loaded image  : 0x%" PRIxEFIPTR "\n", efi_li);



CVS commit: [netbsd-9] src/sys/stand/efiboot

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:33:44 UTC 2024

Modified Files:
src/sys/stand/efiboot [netbsd-9]: efiboot.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1828):

sys/stand/efiboot/efiboot.c: revision 1.23

efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075


To generate a diff of this commit:
cvs rdiff -u -r1.16.4.1 -r1.16.4.2 src/sys/stand/efiboot/efiboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src/sys/stand/efiboot

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:32:36 UTC 2024

Modified Files:
src/sys/stand/efiboot [netbsd-10]: efiboot.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #656):

sys/stand/efiboot/efiboot.c: revision 1.23

efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/stand/efiboot/efiboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/efiboot.c
diff -u src/sys/stand/efiboot/efiboot.c:1.22 src/sys/stand/efiboot/efiboot.c:1.22.4.1
--- src/sys/stand/efiboot/efiboot.c:1.22	Wed Oct  6 10:13:19 2021
+++ src/sys/stand/efiboot/efiboot.c	Thu Apr 18 15:32:36 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot.c,v 1.22 2021/10/06 10:13:19 jmcneill Exp $ */
+/* $NetBSD: efiboot.c,v 1.22.4.1 2024/04/18 15:32:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -86,6 +86,8 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYS
 	status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, , (void **)_bootdp);
 	if (EFI_ERROR(status))
 		efi_bootdp = NULL;
+	else
+		efi_bootdp = DuplicateDevicePath(efi_bootdp);
 
 #ifdef EFIBOOT_DEBUG
 	Print(L"Loaded image  : 0x%" PRIxEFIPTR "\n", efi_li);



CVS commit: [netbsd-10] src/sys/stand/efiboot

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:32:36 UTC 2024

Modified Files:
src/sys/stand/efiboot [netbsd-10]: efiboot.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #656):

sys/stand/efiboot/efiboot.c: revision 1.23

efiboot: Duplicate efi_bootdp before we clobber it in efi_net_probe.

Patch from jakllsch@.  Makes Socionext Synquacer boot considerably
more reliably.

PR kern/58075


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/stand/efiboot/efiboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:24:21 UTC 2024

Modified Files:
src/share/mk [netbsd-9]: bsd.own.mk
src/sys/arch/aarch64/include [netbsd-9]: sljit_machdep.h
src/sys/external/bsd/sljit/dist/sljit_src [netbsd-9]:
sljitNativeARM_64.c
src/sys/modules [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #655):

sys/modules/Makefile: revision 1.285
share/mk/bsd.own.mk: revision 1.1365
share/mk/bsd.own.mk: revision 1.1366
sys/arch/aarch64/include/sljit_machdep.h: revision 1.4
sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c: revision 1.5
(all via patch)

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.
Needed to resolve PR 58103.

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64
bsd.own.mk: No need for MKSLJIT to be set differently from others.
- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.1149.2.6 -r1.1149.2.7 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/sljit_machdep.h
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
cvs rdiff -u -r1.222.2.1 -r1.222.2.2 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1149.2.6 src/share/mk/bsd.own.mk:1.1149.2.7
--- src/share/mk/bsd.own.mk:1.1149.2.6	Thu Feb  4 19:05:00 2021
+++ src/share/mk/bsd.own.mk	Thu Apr 18 15:24:20 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1149.2.6 2021/02/04 19:05:00 martin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1149.2.7 2024/04/18 15:24:20 martin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1169,6 +1169,25 @@ MKLLVMRT.i386=		yes
 MKLLVMRT.aarch64=	yes
 .endif
 
+# Just-in-time compiler for bpf, npf acceleration
+MKSLJIT.aarch64=	yes
+MKSLJIT.i386=		yes
+MKSLJIT.sparc=		yes
+#MKSLJIT.sparc64=	yes	# not suppored in sljit (yet?)
+MKSLJIT.x86_64=		yes
+#MKSLJIT.powerpc=	yes	# XXX
+#MKSLJIT.powerpc64=	yes	# XXX
+#MKSLJIT.mipsel=	yes	# XXX
+#MKSLJIT.mipseb=	yes	# XXX
+#MKSLJIT.mips64el=	yes	# XXX
+#MKSLJIT.mips64eb=	yes	# XXX
+#MKSLJIT.riscv32=	yes	# not until we update sljit
+#MKSLJIT.riscv64=	yes	# not until we update sljit
+
+# compat with old names
+MKDEBUGKERNEL?=${MKKDEBUG:Uno}
+MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
+
 #
 # MK* options which default to "no".  Note that MKZFS has a different
 # default for some platforms, see above.  Please keep alphabetically
@@ -1198,12 +1217,6 @@ _MKVARS.no= \
 ${var}?=	${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
 .endfor
 
-.if ${MACHINE_ARCH} == "i386" || \
-${MACHINE_ARCH} == "x86_64" || \
-${MACHINE_ARCH} == "sparc" 
-MKSLJIT=	yes
-.endif
-
 #
 # Which platforms build the xorg-server drivers (as opposed
 # to just Xnest and Xvfb.)

Index: src/sys/arch/aarch64/include/sljit_machdep.h
diff -u src/sys/arch/aarch64/include/sljit_machdep.h:1.2 src/sys/arch/aarch64/include/sljit_machdep.h:1.2.6.1
--- src/sys/arch/aarch64/include/sljit_machdep.h:1.2	Sun Dec  2 20:54:44 2018
+++ src/sys/arch/aarch64/include/sljit_machdep.h	Thu Apr 18 15:24:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljit_machdep.h,v 1.2 2018/12/02 20:54:44 alnsn Exp $	*/
+/*	$NetBSD: sljit_machdep.h,v 1.2.6.1 2024/04/18 15:24:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 2014 Alexander Nasonov.
@@ -42,7 +42,12 @@
 
 #define SLJIT_CONFIG_ARM_64 1
 
-#ifdef _KERNEL
+#ifdef _HARDKERNEL
+/*
+ * XXX Currently sys/rump/include/machine/cpu.h doesn't have
+ * ci_cpufuncs for cpu_icache_sync_range, so we do this only for
+ * non-rump kernels for now.
+ */
 #define SLJIT_CACHE_FLUSH(from, to) \
 	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
 #else

Index: src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
diff -u src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:1.4 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:1.4.4.1
--- 

CVS commit: [netbsd-9] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:24:21 UTC 2024

Modified Files:
src/share/mk [netbsd-9]: bsd.own.mk
src/sys/arch/aarch64/include [netbsd-9]: sljit_machdep.h
src/sys/external/bsd/sljit/dist/sljit_src [netbsd-9]:
sljitNativeARM_64.c
src/sys/modules [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #655):

sys/modules/Makefile: revision 1.285
share/mk/bsd.own.mk: revision 1.1365
share/mk/bsd.own.mk: revision 1.1366
sys/arch/aarch64/include/sljit_machdep.h: revision 1.4
sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c: revision 1.5
(all via patch)

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.
Needed to resolve PR 58103.

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64
bsd.own.mk: No need for MKSLJIT to be set differently from others.
- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.1149.2.6 -r1.1149.2.7 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/sljit_machdep.h
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
cvs rdiff -u -r1.222.2.1 -r1.222.2.2 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:21:55 UTC 2024

Modified Files:
src/share/mk [netbsd-10]: bsd.own.mk
src/sys/arch/aarch64/include [netbsd-10]: sljit_machdep.h
src/sys/external/bsd/sljit/dist/sljit_src [netbsd-10]:
sljitNativeARM_64.c
src/sys/modules [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #655):

sys/modules/Makefile: revision 1.285
share/mk/bsd.own.mk: revision 1.1365
share/mk/bsd.own.mk: revision 1.1366
sys/arch/aarch64/include/sljit_machdep.h: revision 1.4
sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c: revision 1.5

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.
Needed to resolve PR 58103.

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64
bsd.own.mk: No need for MKSLJIT to be set differently from others.
- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.2 -r1.1289.2.3 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/aarch64/include/sljit_machdep.h
cvs rdiff -u -r1.4 -r1.4.30.1 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
cvs rdiff -u -r1.274.2.2 -r1.274.2.3 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-10] src

2024-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr 18 15:21:55 UTC 2024

Modified Files:
src/share/mk [netbsd-10]: bsd.own.mk
src/sys/arch/aarch64/include [netbsd-10]: sljit_machdep.h
src/sys/external/bsd/sljit/dist/sljit_src [netbsd-10]:
sljitNativeARM_64.c
src/sys/modules [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #655):

sys/modules/Makefile: revision 1.285
share/mk/bsd.own.mk: revision 1.1365
share/mk/bsd.own.mk: revision 1.1366
sys/arch/aarch64/include/sljit_machdep.h: revision 1.4
sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c: revision 1.5

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.
Needed to resolve PR 58103.

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64
bsd.own.mk: No need for MKSLJIT to be set differently from others.
- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.2 -r1.1289.2.3 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/aarch64/include/sljit_machdep.h
cvs rdiff -u -r1.4 -r1.4.30.1 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
cvs rdiff -u -r1.274.2.2 -r1.274.2.3 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1289.2.2 src/share/mk/bsd.own.mk:1.1289.2.3
--- src/share/mk/bsd.own.mk:1.1289.2.2	Fri Oct 20 16:04:59 2023
+++ src/share/mk/bsd.own.mk	Thu Apr 18 15:21:55 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1289.2.2 2023/10/20 16:04:59 martin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1289.2.3 2024/04/18 15:21:55 martin Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1285,6 +1285,21 @@ MKLLVMRT.i386=		yes
 MKLLVMRT.aarch64=	yes
 .endif
 
+# Just-in-time compiler for bpf, npf acceleration
+MKSLJIT.aarch64=	yes
+MKSLJIT.i386=		yes
+MKSLJIT.sparc=		yes
+#MKSLJIT.sparc64=	yes	# not suppored in sljit (yet?)
+MKSLJIT.x86_64=		yes
+#MKSLJIT.powerpc=	yes	# XXX
+#MKSLJIT.powerpc64=	yes	# XXX
+#MKSLJIT.mipsel=	yes	# XXX
+#MKSLJIT.mipseb=	yes	# XXX
+#MKSLJIT.mips64el=	yes	# XXX
+#MKSLJIT.mips64eb=	yes	# XXX
+#MKSLJIT.riscv32=	yes	# not until we update sljit
+#MKSLJIT.riscv64=	yes	# not until we update sljit
+
 # compat with old names
 MKDEBUGKERNEL?=${MKKDEBUG:Uno}
 MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
@@ -1318,12 +1333,6 @@ _MKVARS.no= \
 ${var}?=	${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
 .endfor
 
-.if ${MACHINE_ARCH} == "i386" || \
-${MACHINE_ARCH} == "x86_64" || \
-${MACHINE_ARCH} == "sparc"
-MKSLJIT=	yes
-.endif
-
 #
 # Which platforms build the xorg-server drivers (as opposed
 # to just Xnest and Xvfb.)

Index: src/sys/arch/aarch64/include/sljit_machdep.h
diff -u src/sys/arch/aarch64/include/sljit_machdep.h:1.3 src/sys/arch/aarch64/include/sljit_machdep.h:1.3.18.1
--- src/sys/arch/aarch64/include/sljit_machdep.h:1.3	Fri Dec 11 18:03:33 2020
+++ src/sys/arch/aarch64/include/sljit_machdep.h	Thu Apr 18 15:21:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljit_machdep.h,v 1.3 2020/12/11 18:03:33 skrll Exp $	*/
+/*	$NetBSD: sljit_machdep.h,v 1.3.18.1 2024/04/18 15:21:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 2014 Alexander Nasonov.
@@ -43,7 +43,12 @@
 
 #define SLJIT_CONFIG_ARM_64 1
 
-#ifdef _KERNEL
+#ifdef _HARDKERNEL
+/*
+ * XXX Currently sys/rump/include/machine/cpu.h doesn't have
+ * ci_cpufuncs for cpu_icache_sync_range, so we do this only for
+ * non-rump kernels for now.
+ */
 #define SLJIT_CACHE_FLUSH(from, to) \
 	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
 #else

Index: src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
diff -u src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:1.4 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:1.4.30.1
--- src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:1.4	Sun Jan 20 23:14:16 2019
+++ src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c	Thu Apr 18 15:21:55 2024
@@ -1,4 +1,4 @@
-/*	

CVS commit: src/sys/uvm/pmap

2024-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr 18 12:16:23 UTC 2024

Modified Files:
src/sys/uvm/pmap: pmap.c pmap.h

Log Message:
Fix types in pmap_page_clear_attributes so that the top bits of
the u_long mdpg_attrs aren't dropped giving atomic_cas_ulong no
chance of completing if any of the top bits is set.

Update pmap_page_set_attributes for consistency.

An ATF test run completed for me with this fix.

port-riscv/58006: ATF tests no longer complete on riscv-riscv64


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.26 -r1.27 src/sys/uvm/pmap/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.77 src/sys/uvm/pmap/pmap.c:1.78
--- src/sys/uvm/pmap/pmap.c:1.77	Sat Mar 23 08:31:15 2024
+++ src/sys/uvm/pmap/pmap.c	Thu Apr 18 12:16:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.77 2024/03/23 08:31:15 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.78 2024/04/18 12:16:23 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2024/03/23 08:31:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2024/04/18 12:16:23 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -415,21 +415,21 @@ pmap_addr_range_check(pmap_t pmap, vaddr
  */
 
 bool
-pmap_page_clear_attributes(struct vm_page_md *mdpg, u_int clear_attributes)
+pmap_page_clear_attributes(struct vm_page_md *mdpg, u_long clear_attributes)
 {
-	volatile unsigned long * const attrp = >mdpg_attrs;
+	volatile u_long * const attrp = >mdpg_attrs;
 
 #ifdef MULTIPROCESSOR
 	for (;;) {
-		u_int old_attr = *attrp;
+		u_long old_attr = *attrp;
 		if ((old_attr & clear_attributes) == 0)
 			return false;
-		u_int new_attr = old_attr & ~clear_attributes;
+		u_long new_attr = old_attr & ~clear_attributes;
 		if (old_attr == atomic_cas_ulong(attrp, old_attr, new_attr))
 			return true;
 	}
 #else
-	unsigned long old_attr = *attrp;
+	u_long old_attr = *attrp;
 	if ((old_attr & clear_attributes) == 0)
 		return false;
 	*attrp &= ~clear_attributes;
@@ -438,7 +438,7 @@ pmap_page_clear_attributes(struct vm_pag
 }
 
 void
-pmap_page_set_attributes(struct vm_page_md *mdpg, u_int set_attributes)
+pmap_page_set_attributes(struct vm_page_md *mdpg, u_long set_attributes)
 {
 #ifdef MULTIPROCESSOR
 	atomic_or_ulong(>mdpg_attrs, set_attributes);

Index: src/sys/uvm/pmap/pmap.h
diff -u src/sys/uvm/pmap/pmap.h:1.26 src/sys/uvm/pmap/pmap.h:1.27
--- src/sys/uvm/pmap/pmap.h:1.26	Thu Nov  3 18:55:07 2022
+++ src/sys/uvm/pmap/pmap.h	Thu Apr 18 12:16:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.26 2022/11/03 18:55:07 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.27 2024/04/18 12:16:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -296,8 +296,8 @@ extern pmap_segtab_t pmap_kern_segtab;
 
 bool	pmap_remove_all(pmap_t);
 void	pmap_set_modified(paddr_t);
-bool	pmap_page_clear_attributes(struct vm_page_md *, u_int);
-void	pmap_page_set_attributes(struct vm_page_md *, u_int);
+bool	pmap_page_clear_attributes(struct vm_page_md *, u_long);
+void	pmap_page_set_attributes(struct vm_page_md *, u_long);
 void	pmap_pvlist_lock_init(size_t);
 #ifdef PMAP_VIRTUAL_CACHE_ALIASES
 void	pmap_page_cache(struct vm_page_md *, bool);



CVS commit: src/sys/uvm/pmap

2024-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr 18 12:16:23 UTC 2024

Modified Files:
src/sys/uvm/pmap: pmap.c pmap.h

Log Message:
Fix types in pmap_page_clear_attributes so that the top bits of
the u_long mdpg_attrs aren't dropped giving atomic_cas_ulong no
chance of completing if any of the top bits is set.

Update pmap_page_set_attributes for consistency.

An ATF test run completed for me with this fix.

port-riscv/58006: ATF tests no longer complete on riscv-riscv64


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.26 -r1.27 src/sys/uvm/pmap/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys

2024-04-18 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 18 10:32:03 UTC 2024

Modified Files:
src/sys/arch/mac68k/mac68k: macrom.h
src/sys/net: if_media.h

Log Message:
s/resoure/resource/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mac68k/mac68k/macrom.h
cvs rdiff -u -r1.71 -r1.72 src/sys/net/if_media.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/mac68k/macrom.h
diff -u src/sys/arch/mac68k/mac68k/macrom.h:1.19 src/sys/arch/mac68k/mac68k/macrom.h:1.20
--- src/sys/arch/mac68k/mac68k/macrom.h:1.19	Sun Nov  1 01:51:35 2009
+++ src/sys/arch/mac68k/mac68k/macrom.h	Thu Apr 18 10:32:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: macrom.h,v 1.19 2009/11/01 01:51:35 snj Exp $	*/
+/*	$NetBSD: macrom.h,v 1.20 2024/04/18 10:32:03 andvar Exp $	*/
 
 /*-
  * Copyright (C) 1994	Bradley A. Grantham
@@ -153,7 +153,7 @@ void	dumptrace(void);
 	/* Stuff for configuring ROM Glue */
 typedef struct rsrc_s {
 	u_int16_t unknown[4];	/*  */
-	u_int32_t next;		/* pointer to next resoure in list */
+	u_int32_t next;		/* pointer to next resource in list */
 	u_int32_t body;		/* pointer to resource body? */
 	u_int32_t name;		/* resource name */
 	u_int16_t index;	/*  */

Index: src/sys/net/if_media.h
diff -u src/sys/net/if_media.h:1.71 src/sys/net/if_media.h:1.72
--- src/sys/net/if_media.h:1.71	Sun Mar 15 23:04:51 2020
+++ src/sys/net/if_media.h	Thu Apr 18 10:32:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.h,v 1.71 2020/03/15 23:04:51 thorpej Exp $	*/
+/*	$NetBSD: if_media.h,v 1.72 2024/04/18 10:32:03 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2020 The NetBSD Foundation, Inc.
@@ -981,7 +981,7 @@ void	ifmedia_init(struct ifmedia *, int,
 void	ifmedia_init_with_lock(struct ifmedia *, int, ifm_change_cb_t,
 	ifm_stat_cb_t, kmutex_t *);
 
-/* Release resourecs associated with an ifmedia. */
+/* Release resources associated with an ifmedia. */
 void	ifmedia_fini(struct ifmedia *);
 
 



CVS commit: src/sys

2024-04-18 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 18 10:32:03 UTC 2024

Modified Files:
src/sys/arch/mac68k/mac68k: macrom.h
src/sys/net: if_media.h

Log Message:
s/resoure/resource/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mac68k/mac68k/macrom.h
cvs rdiff -u -r1.71 -r1.72 src/sys/net/if_media.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.