CVS commit: src

2024-09-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 14:04:49 UTC 2024

Modified Files:
src: UPDATING

Log Message:
Ammend the libc/jemalloc entry with hints for architectures with
compat libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/UPDATING

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



CVS commit: src

2024-09-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 14:04:49 UTC 2024

Modified Files:
src: UPDATING

Log Message:
Ammend the libc/jemalloc entry with hints for architectures with
compat libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.358 src/UPDATING:1.359
--- src/UPDATING:1.358	Tue Sep 24 13:59:30 2024
+++ src/UPDATING	Tue Sep 24 14:04:49 2024
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.358 2024/09/24 13:59:30 martin Exp $
+$NetBSD: UPDATING,v 1.359 2024/09/24 14:04:49 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -21,8 +21,11 @@ Recent changes:
 
 20240923:
 	Update builds will require cleaning the object directories for
-	jemalloc (like: rm -rf "$OBJ/external/bsd/jemalloc*") and the
-	libc dependency files (like: "rm $OBJ/lib/libc/stdlib/jemalloc.*").
+	jemalloc (like: "rm -rf $OBJ/external/bsd/jemalloc*") and the
+	libc dependency files (like: "rm $OBJ/lib/libc/jemalloc.*").
+	On architectures with COMPAT libs, those also have to be cleaned,
+	e.g. on sparc64: "rm -rf $OBJ/compat/sparc64/sparc/external/bsd/jemalloc*"
+	and "rm $OBJ/compat/sparc64/sparc/lib/libc/jemalloc.*".
 
 20240817:
 	Update builds will require cleaning in src/external/historical/nawk/bin



CVS commit: src

2024-09-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 13:59:30 UTC 2024

Modified Files:
src: UPDATING

Log Message:
Note update build issues with jemalloc vs. jemalloc.old


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.357 src/UPDATING:1.358
--- src/UPDATING:1.357	Sun Aug 18 00:27:18 2024
+++ src/UPDATING	Tue Sep 24 13:59:30 2024
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.357 2024/08/18 00:27:18 christos Exp $
+$NetBSD: UPDATING,v 1.358 2024/09/24 13:59:30 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,10 +19,16 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20240923:
+	Update builds will require cleaning the object directories for
+	jemalloc (like: rm -rf "$OBJ/external/bsd/jemalloc*") and the
+	libc dependency files (like: "rm $OBJ/lib/libc/stdlib/jemalloc.*").
+
 20240817:
 	Update builds will require cleaning in src/external/historical/nawk/bin
 	in order to remove the awk binary since now there is a subdirectory
 	called awk.
+
 20240812:
 	Update builds will require removing the tools objdir for gdb
 	if building with MKCROSSGDB=yes. All architectures use gdb.old



CVS commit: src

2024-09-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 13:59:30 UTC 2024

Modified Files:
src: UPDATING

Log Message:
Note update build issues with jemalloc vs. jemalloc.old


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/UPDATING

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-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:38:37 UTC 2024

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

Log Message:
Tickets #898 - #908


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.35 -r1.1.2.36 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/doc

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:38:37 UTC 2024

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

Log Message:
Tickets #898 - #908


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.35 -r1.1.2.36 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.35 src/doc/CHANGES-10.1:1.1.2.36
--- src/doc/CHANGES-10.1:1.1.2.35	Fri Sep 20 11:36:13 2024
+++ src/doc/CHANGES-10.1	Sat Sep 21 12:38:36 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.35 2024/09/20 11:36:13 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.36 2024/09/21 12:38:36 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -1726,3 +1726,69 @@ sys/arch/evbppc/conf/WII			1.5
 	evbppc/wii: PR 58676: add DKWEDGE_AUTODISCOVER and DKWEDGE_METHOD_GPT.
 	[jakllsch, ticket #897]
 
+sys/stand/efiboot/exec.c			1.26
+
+	efiboot: fix memory deallocation in an error path of efi_rng().
+	[rin, ticket #898]
+
+sys/net/if_tun.c1.177
+
+	tun(4): mark tunread_filtops `FILTEROP_MPSAFE`.
+	[rin, ticket #899]
+
+sys/arch/amd64/amd64/db_interface.c		1.42
+sys/arch/i386/i386/db_interface.c		1.89
+
+	x86: ddb: call x86_pause() when CPUs are paused.
+	[rin, ticket #900]
+
+sys/net/if_gif.c1.159
+
+	if(4): drop locks before freeing unreferenced memory
+	in gif_set_tunnel.
+	[rin, ticket #901]
+
+sbin/ifconfig/carp.c1.15
+sbin/ifconfig/ifconfig.8			1.125
+sys/netinet/ip_carp.c1.118,1.119
+tests/net/carp/t_basic.sh			1.9
+
+	carp(4): various fixes:
+	- fix parser for carp state.
+	- use backing device to send advertisements.
+	- select virtual address as sender if backing interface is anonymous.
+	- use correct scope for IPv6.
+	- fix some tests.
+	[rin, ticket #902]
+
+sys/netinet/ip_output.c1.326
+
+	Allow multicast packets to be sent from unnumbered interfaces.
+	[rin, ticket #903]
+
+sys/dev/pci/if_vmx.c1.12
+
+	vmxnet(4): fix various MP bugs.
+	[rin, ticket #904]
+
+sys/kern/subr_xcall.c1.36
+
+	xcall(9): if !mp_online, raise spl or set LP_BOUND to call func.
+	[rin, ticket #905]
+
+crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c	1.40
+
+	racoon: cast to the correct message structure
+	[rin, ticket #906]
+
+usr.sbin/ifwatchd/ifwatchd.c			1.47
+
+	ifwatchd(8): don't call UP script when an IP address becomes
+	deprecated.
+	[rin, ticket #907]
+
+sys/arch/i386/i386/vector.S			1.90
+
+	i386: PR 58653: fix Hyper-V upcall interrupt handler.
+	[rin, ticket #908]
+



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:37:02 UTC 2024

Modified Files:
src/sys/arch/i386/i386 [netbsd-10]: vector.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #908):

sys/arch/i386/i386/vector.S: revision 1.90

PR/58653: me: Revert btsl of negative value to orl


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.4.1 src/sys/arch/i386/i386/vector.S

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/i386/i386

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:37:02 UTC 2024

Modified Files:
src/sys/arch/i386/i386 [netbsd-10]: vector.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #908):

sys/arch/i386/i386/vector.S: revision 1.90

PR/58653: me: Revert btsl of negative value to orl


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.4.1 src/sys/arch/i386/i386/vector.S

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/i386/i386/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.89 src/sys/arch/i386/i386/vector.S:1.89.4.1
--- src/sys/arch/i386/i386/vector.S:1.89	Wed Sep  7 00:40:18 2022
+++ src/sys/arch/i386/i386/vector.S	Sat Sep 21 12:37:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.89 2022/09/07 00:40:18 knakahara Exp $	*/
+/*	$NetBSD: vector.S,v 1.89.4.1 2024/09/21 12:37:02 martin Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.89 2022/09/07 00:40:18 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.89.4.1 2024/09/21 12:37:02 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -354,7 +354,7 @@ IDTVEC(resume_hyperv_hypercall)
 	cli
 	jmp	_C_LABEL(Xdoreti)
 2:
-	btsl	$(LIR_HV - 32),CPUVAR(IPENDING)+4
+	orl	$(1 << LIR_HV),CPUVAR(IPENDING)
 	INTRFASTEXIT
 IDTVEC_END(resume_hyperv_hypercall)
 #endif	/* NHYPERV > 0 */



CVS commit: [netbsd-10] src/usr.sbin/ifwatchd

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:35:22 UTC 2024

Modified Files:
src/usr.sbin/ifwatchd [netbsd-10]: ifwatchd.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #907):

usr.sbin/ifwatchd/ifwatchd.c: revision 1.47

Don't call UP script when an IP address becomes deprecated.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.6.1 src/usr.sbin/ifwatchd/ifwatchd.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.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.46 src/usr.sbin/ifwatchd/ifwatchd.c:1.46.6.1
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.46	Sun Oct  4 20:36:32 2020
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Sat Sep 21 12:35:22 2024
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.46 2020/10/04 20:36:32 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.46.6.1 2024/09/21 12:35:22 martin Exp $	*/
 #include 
-__RCSID("$NetBSD: ifwatchd.c,v 1.46 2020/10/04 20:36:32 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.46.6.1 2024/09/21 12:35:22 martin Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: ifwatchd.c,v 1.46 2020
 #include 
 
 enum event { ARRIVAL, DEPARTURE, UP, DOWN, CARRIER, NO_CARRIER };
-enum addrflag { NOTREADY, DETACHED, READY };
+enum addrflag { NOTREADY, DETACHED, DEPRECATED, READY };
 
 /* local functions */
 __dead static void usage(void);
@@ -303,6 +303,8 @@ check_addrflags(int af, int addrflags)
 			return NOTREADY;
 		if (addrflags & IN6_IFF_DETACHED)
 			return DETACHED;
+		if (addrflags & IN6_IFF_DEPRECATED)
+			return DEPRECATED;
 		break;
 	}
 	return READY;



CVS commit: [netbsd-10] src/usr.sbin/ifwatchd

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:35:22 UTC 2024

Modified Files:
src/usr.sbin/ifwatchd [netbsd-10]: ifwatchd.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #907):

usr.sbin/ifwatchd/ifwatchd.c: revision 1.47

Don't call UP script when an IP address becomes deprecated.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.6.1 src/usr.sbin/ifwatchd/ifwatchd.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/crypto/dist/ipsec-tools/src/racoon

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:34:07 UTC 2024

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon [netbsd-10]: grabmyaddr.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #906):

crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c: revision 1.40

cast to the correct message structure (rt_msghdr instead of if_msghdr)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.6.1 \
src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39.6.1
--- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.39	Wed Nov 25 14:15:41 2020
+++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c	Sat Sep 21 12:34:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: grabmyaddr.c,v 1.39 2020/11/25 14:15:41 christos Exp $	*/
+/*	$NetBSD: grabmyaddr.c,v 1.39.6.1 2024/09/21 12:34:07 martin Exp $	*/
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * Copyright (C) 2008 Timo Teras .
@@ -849,7 +849,7 @@ kernel_sync()
 {
 	caddr_t ref, buf, end;
 	size_t bufsiz;
-	struct if_msghdr *ifm;
+	struct rt_msghdr *rtm;
 
 #define MIBSIZ 6
 	int mib[MIBSIZ] = {
@@ -871,8 +871,10 @@ kernel_sync()
 
 	if (sysctl(mib, MIBSIZ, buf, &bufsiz, NULL, 0) >= 0) {
 		/* Parse both interfaces and addresses. */
-		for (end = buf + bufsiz; buf < end; buf += ifm->ifm_msglen) {
-			ifm = (struct if_msghdr *) buf;
+		for (end = buf + bufsiz; buf < end; buf += rtm->rtm_msglen) {
+			rtm = (struct rt_msghdr *) buf;
+			if (rtm->rtm_version != RTM_VERSION)
+continue;
 			kernel_handle_message(buf);
 		}
 	} else {



CVS commit: [netbsd-10] src/crypto/dist/ipsec-tools/src/racoon

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:34:07 UTC 2024

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon [netbsd-10]: grabmyaddr.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #906):

crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c: revision 1.40

cast to the correct message structure (rt_msghdr instead of if_msghdr)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.6.1 \
src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.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/kern

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:32:39 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: subr_xcall.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #905):

sys/kern/subr_xcall.c: revision 1.36

xcall(9): If !mp_online, raise spl or set LP_BOUND to call func.

High-priority xcalls may reasonably assume that the spl is raised to
splsoftserial, so make sure to do that in xc_broadcast.

Low-priority xcalls may reasonably enter paths that assume the lwp is
bound to a CPU, so let's make it assertable even if it doesn't have
any other consequences when !mp_online.


To generate a diff of this commit:
cvs rdiff -u -r1.34.18.1 -r1.34.18.2 src/sys/kern/subr_xcall.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/subr_xcall.c
diff -u src/sys/kern/subr_xcall.c:1.34.18.1 src/sys/kern/subr_xcall.c:1.34.18.2
--- src/sys/kern/subr_xcall.c:1.34.18.1	Wed Sep 11 10:09:19 2024
+++ src/sys/kern/subr_xcall.c	Sat Sep 21 12:32:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_xcall.c,v 1.34.18.1 2024/09/11 10:09:19 martin Exp $	*/
+/*	$NetBSD: subr_xcall.c,v 1.34.18.2 2024/09/21 12:32:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 2007-2010, 2019 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.34.18.1 2024/09/11 10:09:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.34.18.2 2024/09/21 12:32:39 martin Exp $");
 
 #include 
 #include 
@@ -261,7 +261,17 @@ xc_broadcast(unsigned int flags, xcfunc_
 	ASSERT_SLEEPABLE();
 
 	if (__predict_false(!mp_online)) {
+		int s, bound;
+
+		if (flags & XC_HIGHPRI)
+			s = splsoftserial();
+		else
+			bound = curlwp_bind();
 		(*func)(arg1, arg2);
+		if (flags & XC_HIGHPRI)
+			splx(s);
+		else
+			curlwp_bindx(bound);
 		return 0;
 	}
 
@@ -301,19 +311,28 @@ xc_barrier(unsigned int flags)
  */
 uint64_t
 xc_unicast(unsigned int flags, xcfunc_t func, void *arg1, void *arg2,
-	   struct cpu_info *ci)
+struct cpu_info *ci)
 {
-	int s;
 
 	KASSERT(ci != NULL);
 	KASSERT(!cpu_intr_p() && !cpu_softintr_p());
 	ASSERT_SLEEPABLE();
 
 	if (__predict_false(!mp_online)) {
+		int s, bound;
+
 		KASSERT(ci == curcpu());
-		s = splsoftserial();
+
+		if (flags & XC_HIGHPRI)
+			s = splsoftserial();
+		else
+			bound = curlwp_bind();
 		(*func)(arg1, arg2);
-		splx(s);
+		if (flags & XC_HIGHPRI)
+			splx(s);
+		else
+			curlwp_bindx(bound);
+
 		return 0;
 	}
 



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:32:39 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: subr_xcall.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #905):

sys/kern/subr_xcall.c: revision 1.36

xcall(9): If !mp_online, raise spl or set LP_BOUND to call func.

High-priority xcalls may reasonably assume that the spl is raised to
splsoftserial, so make sure to do that in xc_broadcast.

Low-priority xcalls may reasonably enter paths that assume the lwp is
bound to a CPU, so let's make it assertable even if it doesn't have
any other consequences when !mp_online.


To generate a diff of this commit:
cvs rdiff -u -r1.34.18.1 -r1.34.18.2 src/sys/kern/subr_xcall.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-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:30:43 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #904):

sys/dev/pci/if_vmx.c: revision 1.12

vmxnet(4): Fix various MP bugs.
- Defer reset to workqueue.
   => vmxnet3_stop_locked is forbidden in softint.
   => XXX Problem: We still take the core lock in softint, and we
  still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
   => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
   => Don't call vmxnet3_set_rxfilter unless up and running; cache
  this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
  instead of calling vmxnet3_set_rxfilter directly.
  . (The cache is currently serialized by the core lock, but it
might reasonably be serialized by an independent lock like in
usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
   => New vxtxq_stopping, vxrxq_stopping variables synchronize with
  Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.11.4.1 -r1.11.4.2 src/sys/dev/pci/if_vmx.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_vmx.c
diff -u src/sys/dev/pci/if_vmx.c:1.11.4.1 src/sys/dev/pci/if_vmx.c:1.11.4.2
--- src/sys/dev/pci/if_vmx.c:1.11.4.1	Sat May 11 14:49:51 2024
+++ src/sys/dev/pci/if_vmx.c	Sat Sep 21 12:30:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.11.4.1 2024/05/11 14:49:51 martin Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.11.4.2 2024/09/21 12:30:43 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.11.4.1 2024/05/11 14:49:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.11.4.2 2024/09/21 12:30:43 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_vmx.h"
@@ -212,6 +212,8 @@ struct vmxnet3_txqueue {
 	struct evcnt vxtxq_watchdogto;
 	struct evcnt vxtxq_defragged;
 	struct evcnt vxtxq_defrag_failed;
+
+	bool vxtxq_stopping;
 };
 
 
@@ -230,6 +232,8 @@ struct vmxnet3_rxqueue {
 	struct evcnt vxrxq_deferreq;
 	struct evcnt vxrxq_mgetcl_failed;
 	struct evcnt vxrxq_mbuf_load_failed;
+
+	bool vxrxq_stopping;
 };
 
 struct vmxnet3_queue {
@@ -291,6 +295,9 @@ struct vmxnet3_softc {
 
 	kmutex_t *vmx_mtx;
 
+	int vmx_if_flags;
+	bool vmx_promisc;
+	bool vmx_mcastactive;
 	uint8_t *vmx_mcast;
 	void *vmx_qs;
 	struct vmxnet3_rss_shared *vmx_rss;
@@ -311,6 +318,10 @@ struct vmxnet3_softc {
 
 	bool vmx_txrx_workqueue;
 	struct workqueue *vmx_queue_wq;
+
+	struct workqueue *vmx_reset_wq;
+	struct work vmx_reset_work;
+	bool vmx_reset_pending;
 };
 
 #define VMXNET3_STAT
@@ -435,6 +446,7 @@ static int vmxnet3_ifflags_cb(struct eth
 static int vmxnet3_watchdog(struct vmxnet3_txqueue *);
 static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *);
 static void vmxnet3_tick(void *);
+static void vmxnet3_reset_work(struct work *, void *);
 static void vmxnet3_if_link_status(struct vmxnet3_softc *);
 static bool vmxnet3_cmd_link_status(struct ifnet *);
 static void vmxnet3_ifmedia_status(struct ifnet *, struct ifmediareq *);
@@ -633,6 +645,18 @@ vmxnet3_attach(device_t parent, device_t
 	if (error)
 		return;
 
+	char buf[128];
+	snprintf(buf, sizeof(buf), "%s_reset", device_xname(sc->vmx_dev));
+	error = workqueue_create(&sc->vmx_reset_wq, "%s_reset",
+	vmxnet3_reset_work, sc, VMXNET3_WORKQUEUE_PRI, IPL_SOFTCLOCK,
+	WQ_MPSAFE);
+	if (error) {
+		aprint_error_dev(sc->vmx_dev,
+		"failed to create reset workqueue: %d\n",
+		error);
+		return;
+	}
+
 	sc->vmx_flags |= VMXNET3_FLAG_ATTACHED;
 }
 
@@ -1124,6 +1148,8 @@ vmxnet3_init_rxq(struct vmxnet3_softc *s
 		rxq->vxrxq_comp_ring.vxcr_ndesc += sc->vmx_nrxdescs;
 	}
 
+	rxq->vxrxq_stopping = true;
+
 	return (0);
 }
 
@@ -1159,6 +1185,8 @@ vmxnet3_init_txq(struct vmxnet3_softc *s
 
 	txq->vxtxq_interq = pcq_create(sc->vmx_ntxdescs, KM_SLEEP);
 
+	txq->vxtxq_stopping = true;
+
 	return (0);
 }
 
@@ -2336,7 +2364,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *
 
 	VMXNET3_RXQ_LOCK_ASSERT(rxq);
 
-	if ((ifp->if_flags & IFF_RUNNING) == 0)
+	if (rxq->vxrxq_stopping)
 		return more;
 
 	m_head = rxq->vxrxq_mhead;
@@ -2442,7 +2470,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *
 			m_head = m_tail = NULL;
 
 			/* Must recheck after dropping the Rx lock. */
-			if ((ifp->if_flags & IFF_RUNNING) == 0)
+			if (rxq->vxrxq_stopping)
 break;
 		}
 
@@ -2711,11 +2739,13 @@ vmxnet3_stop_rendezvous(struct vmxnet3_s
 	for (i = 0; i < sc->vmx_nrxqueues; i++) {
 		rxq = &sc->vmx_queue[i].vxq_rxqueue;
 		VMXNET3_RXQ_LOCK(rxq);
+		rxq->vxrxq_stopping = true;
 		VMXNET3_RXQ_UNLOCK(rxq);
 	}
 	for (i = 0; i < sc->vmx_ntxqueues; i++) {
 		txq = &sc->vmx_queue[i]

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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:30:43 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #904):

sys/dev/pci/if_vmx.c: revision 1.12

vmxnet(4): Fix various MP bugs.
- Defer reset to workqueue.
   => vmxnet3_stop_locked is forbidden in softint.
   => XXX Problem: We still take the core lock in softint, and we
  still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
   => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
   => Don't call vmxnet3_set_rxfilter unless up and running; cache
  this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
  instead of calling vmxnet3_set_rxfilter directly.
  . (The cache is currently serialized by the core lock, but it
might reasonably be serialized by an independent lock like in
usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
   => New vxtxq_stopping, vxrxq_stopping variables synchronize with
  Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.11.4.1 -r1.11.4.2 src/sys/dev/pci/if_vmx.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/netinet

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:28:46 UTC 2024

Modified Files:
src/sys/netinet [netbsd-10]: ip_output.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #903):

sys/netinet/ip_output.c: revision 1.326

Again allow multicast packets to be sent from unnumbered interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.324.2.1 -r1.324.2.2 src/sys/netinet/ip_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/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.324.2.1 src/sys/netinet/ip_output.c:1.324.2.2
--- src/sys/netinet/ip_output.c:1.324.2.1	Tue Apr 25 16:15:14 2023
+++ src/sys/netinet/ip_output.c	Sat Sep 21 12:28:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.324.2.1 2023/04/25 16:15:14 martin Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.324.2.2 2024/09/21 12:28:46 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.324.2.1 2023/04/25 16:15:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.324.2.2 2024/09/21 12:28:46 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -348,11 +348,6 @@ ip_output(struct mbuf *m0, struct mbuf *
 		}
 		mtu = ifp->if_mtu;
 		ia = in_get_ia_from_ifp_psref(ifp, &psref_ia);
-		if (ia == NULL) {
-			IP_STATINC(IP_STAT_IFNOADDR);
-			error = EADDRNOTAVAIL;
-			goto bad;
-		}
 		if (IN_MULTICAST(ip->ip_dst.s_addr) ||
 		ip->ip_dst.s_addr == INADDR_BROADCAST) {
 			isbroadcast = 0;



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:28:46 UTC 2024

Modified Files:
src/sys/netinet [netbsd-10]: ip_output.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #903):

sys/netinet/ip_output.c: revision 1.326

Again allow multicast packets to be sent from unnumbered interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.324.2.1 -r1.324.2.2 src/sys/netinet/ip_output.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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:26:49 UTC 2024

Modified Files:
src/sbin/ifconfig [netbsd-10]: carp.c ifconfig.8
src/sys/netinet [netbsd-10]: ip_carp.c
src/tests/net/carp [netbsd-10]: t_basic.sh

Log Message:
Pull up following revision(s) (requested by rin in ticket #902):

sbin/ifconfig/carp.c: revision 1.15
sbin/ifconfig/ifconfig.8: revision 1.125
tests/net/carp/t_basic.sh: revision 1.9
sys/netinet/ip_carp.c: revision 1.118
sys/netinet/ip_carp.c: revision 1.119

Fix parser for carp state.

The state values are uppercase words INIT, BACKUP and MASTER.

Use backing device to send advertisements. Otherwise the packets originate
from the virtual MAC address, which confuses switches.

Select virtual address as sender if backing interface is anonymous.

Use correct scope for IPv6.

Don't expect the net/carp/t_basic/carp_handover_ipv6_halt_nocarpdevip
and carp_handover_ipv6_ifdown_nocarpdevip test cases to fail.  At
least on the TNF i386 and amd64 testbeds, they pass more often than
not since the commit of src/sys/netinet/ip_carp.c 1.119 by mlelstv on
2023.04.07.06.44.08.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/ifconfig/carp.c
cvs rdiff -u -r1.124.2.2 -r1.124.2.3 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.117 -r1.117.4.1 src/sys/netinet/ip_carp.c
cvs rdiff -u -r1.8 -r1.8.8.1 src/tests/net/carp/t_basic.sh

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-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:26:49 UTC 2024

Modified Files:
src/sbin/ifconfig [netbsd-10]: carp.c ifconfig.8
src/sys/netinet [netbsd-10]: ip_carp.c
src/tests/net/carp [netbsd-10]: t_basic.sh

Log Message:
Pull up following revision(s) (requested by rin in ticket #902):

sbin/ifconfig/carp.c: revision 1.15
sbin/ifconfig/ifconfig.8: revision 1.125
tests/net/carp/t_basic.sh: revision 1.9
sys/netinet/ip_carp.c: revision 1.118
sys/netinet/ip_carp.c: revision 1.119

Fix parser for carp state.

The state values are uppercase words INIT, BACKUP and MASTER.

Use backing device to send advertisements. Otherwise the packets originate
from the virtual MAC address, which confuses switches.

Select virtual address as sender if backing interface is anonymous.

Use correct scope for IPv6.

Don't expect the net/carp/t_basic/carp_handover_ipv6_halt_nocarpdevip
and carp_handover_ipv6_ifdown_nocarpdevip test cases to fail.  At
least on the TNF i386 and amd64 testbeds, they pass more often than
not since the commit of src/sys/netinet/ip_carp.c 1.119 by mlelstv on
2023.04.07.06.44.08.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/ifconfig/carp.c
cvs rdiff -u -r1.124.2.2 -r1.124.2.3 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.117 -r1.117.4.1 src/sys/netinet/ip_carp.c
cvs rdiff -u -r1.8 -r1.8.8.1 src/tests/net/carp/t_basic.sh

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/carp.c
diff -u src/sbin/ifconfig/carp.c:1.14 src/sbin/ifconfig/carp.c:1.14.6.1
--- src/sbin/ifconfig/carp.c:1.14	Sun Jun  7 06:02:58 2020
+++ src/sbin/ifconfig/carp.c	Sat Sep 21 12:26:48 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $ */
+/* $NetBSD: carp.c,v 1.14.6.1 2024/09/21 12:26:48 martin Exp $ */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $");
+__RCSID("$NetBSD: carp.c,v 1.14.6.1 2024/09/21 12:26:48 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -67,10 +67,16 @@ static int setcarpdev(prop_dictionary_t,
 
 static const char *carp_states[] = { CARP_STATES };
 
+/* from if_carp.c */
+enum carpstateval { INIT = 0, BACKUP, MASTER };
+
 struct kwinst carpstatekw[] = {
-	  {.k_word = "INIT", .k_nextparser = &command_root.pb_parser}
-	, {.k_word = "BACKUP", .k_nextparser = &command_root.pb_parser}
-	, {.k_word = "MASTER", .k_nextparser = &command_root.pb_parser}
+	  {.k_word = "INIT", .k_type = KW_T_INT, .k_int = INIT,
+	   .k_nextparser = &command_root.pb_parser}
+	, {.k_word = "BACKUP", .k_type = KW_T_INT, .k_int = BACKUP,
+	   .k_nextparser = &command_root.pb_parser}
+	, {.k_word = "MASTER", .k_type = KW_T_INT, .k_int = MASTER,
+	   .k_nextparser = &command_root.pb_parser}
 };
 
 struct pinteger parse_advbase = PINTEGER_INITIALIZER1(&parse_advbase, "advbase",

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.124.2.2 src/sbin/ifconfig/ifconfig.8:1.124.2.3
--- src/sbin/ifconfig/ifconfig.8:1.124.2.2	Sat Aug 24 16:42:26 2024
+++ src/sbin/ifconfig/ifconfig.8	Sat Sep 21 12:26:48 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.124.2.2 2024/08/24 16:42:26 martin Exp $
+.\"	$NetBSD: ifconfig.8,v 1.124.2.3 2024/09/21 12:26:48 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -315,10 +315,10 @@ Explicitly force the
 .Xr carp 4
 pseudo-device to enter this state.
 Valid states are
-.Ar init ,
-.Ar backup ,
+.Ar INIT ,
+.Ar BACKUP ,
 and
-.Ar master .
+.Ar MASTER .
 .It Cm frag Ar threshold
 .Pq IEEE 802.11 devices only
 Configure the fragmentation threshold for IEEE 802.11-based wireless

Index: src/sys/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.117 src/sys/netinet/ip_carp.c:1.117.4.1
--- src/sys/netinet/ip_carp.c:1.117	Fri Sep  2 23:48:11 2022
+++ src/sys/netinet/ip_carp.c	Sat Sep 21 12:26:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.117 2022/09/02 23:48:11 thorpej Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.117.4.1 2024/09/21 12:26:49 martin Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.117 2022/09/02 23:48:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.117.4.1 2024/09/21 12:26:49 martin Exp $");
 
 /*
  * TODO:
@@ -1091,6 +1091,8 @@ carp_send_ad(void *v)
 		_s = pserialize_read_enter();
 		ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev);
 		if (ifa == NULL)
+			ifa = ifaof_ifpforaddr(&sa, &sc->sc_if);
+		if (ifa == NULL)
 			ip->ip_src.s_addr = 0;
 		else
 			ip->ip_src.s_addr =
@@ -1142,6 +1144,7 @@ carp_send_ad(void *v)
 	if (sc->sc_naddrs6) {
 		struct ip6_hdr *ip6;
 		struct ifaddr *ifa;
+		struct ifne

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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:22:36 UTC 2024

Modified Files:
src/sys/net [netbsd-10]: if_gif.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #901):

sys/net/if_gif.c: revision 1.159

Drop locks before freeing unreferenced memory in gif_set_tunnel


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.157.4.1 src/sys/net/if_gif.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/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.157 src/sys/net/if_gif.c:1.157.4.1
--- src/sys/net/if_gif.c:1.157	Sat Sep  3 02:47:59 2022
+++ src/sys/net/if_gif.c	Sat Sep 21 12:22:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.157 2022/09/03 02:47:59 thorpej Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.157.4.1 2024/09/21 12:22:36 martin Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.157 2022/09/03 02:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.157.4.1 2024/09/21 12:22:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1160,12 +1160,13 @@ gif_set_tunnel(struct ifnet *ifp, struct
 	return 0;
 
  out:
+	mutex_exit(&sc->gif_lock);
+	encap_lock_exit();
+
 	sockaddr_free(nsrc);
 	sockaddr_free(ndst);
 	kmem_free(nvar, sizeof(*nvar));
 
-	mutex_exit(&sc->gif_lock);
-	encap_lock_exit();
 #ifndef GIF_MPSAFE
 	splx(s);
 #endif



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:22:36 UTC 2024

Modified Files:
src/sys/net [netbsd-10]: if_gif.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #901):

sys/net/if_gif.c: revision 1.159

Drop locks before freeing unreferenced memory in gif_set_tunnel


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.157.4.1 src/sys/net/if_gif.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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:20:23 UTC 2024

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-10]: db_interface.c
src/sys/arch/i386/i386 [netbsd-10]: db_interface.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #900):

sys/arch/amd64/amd64/db_interface.c: revision 1.42
sys/arch/i386/i386/db_interface.c: revision 1.89

when cpus are paused (spinning) in DDB, call x86_pause() in the loop,
hopefully this can reduce power usage while doing nothing.

ok chs@
XXX: apply to i386

i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused
as already done for amd64:
https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html

`pause` insn has been introduced to Pentium 4. However, its opcode is
consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore
interpreted as `nop` for older processors. Intel assured this behavior [1].

Also note that we already use `pause` unconditionally for i386.

Briefly tested on QEMU.

[1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and
Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.88 -r1.88.2.1 src/sys/arch/i386/i386/db_interface.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/amd64/amd64/db_interface.c
diff -u src/sys/arch/amd64/amd64/db_interface.c:1.41 src/sys/arch/amd64/amd64/db_interface.c:1.41.2.1
--- src/sys/arch/amd64/amd64/db_interface.c:1.41	Wed Oct 26 23:38:06 2022
+++ src/sys/arch/amd64/amd64/db_interface.c	Sat Sep 21 12:20:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.41 2022/10/26 23:38:06 riastradh Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.41.2.1 2024/09/21 12:20:22 martin Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.41 2022/10/26 23:38:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.41.2.1 2024/09/21 12:20:22 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -303,7 +303,7 @@ ddb_suspend(struct trapframe *frame)
 	atomic_or_32(&ci->ci_flags, CPUF_PAUSE);
 
 	while (ci->ci_flags & CPUF_PAUSE)
-		;
+		x86_pause();
 	ci->ci_ddb_regs = 0;
 	tlbflushg();
 }

Index: src/sys/arch/i386/i386/db_interface.c
diff -u src/sys/arch/i386/i386/db_interface.c:1.88 src/sys/arch/i386/i386/db_interface.c:1.88.2.1
--- src/sys/arch/i386/i386/db_interface.c:1.88	Wed Oct 26 23:38:07 2022
+++ src/sys/arch/i386/i386/db_interface.c	Sat Sep 21 12:20:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.88.2.1 2024/09/21 12:20:23 martin Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.88.2.1 2024/09/21 12:20:23 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -369,7 +369,7 @@ ddb_suspend(struct trapframe *frame)
 	atomic_or_32(&ci->ci_flags, CPUF_PAUSE);
 
 	while (ci->ci_flags & CPUF_PAUSE)
-		;
+		x86_pause();
 	ci->ci_ddb_regs = 0;
 	tlbflushg();
 }



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:20:23 UTC 2024

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-10]: db_interface.c
src/sys/arch/i386/i386 [netbsd-10]: db_interface.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #900):

sys/arch/amd64/amd64/db_interface.c: revision 1.42
sys/arch/i386/i386/db_interface.c: revision 1.89

when cpus are paused (spinning) in DDB, call x86_pause() in the loop,
hopefully this can reduce power usage while doing nothing.

ok chs@
XXX: apply to i386

i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused
as already done for amd64:
https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html

`pause` insn has been introduced to Pentium 4. However, its opcode is
consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore
interpreted as `nop` for older processors. Intel assured this behavior [1].

Also note that we already use `pause` unconditionally for i386.

Briefly tested on QEMU.

[1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and
Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.88 -r1.88.2.1 src/sys/arch/i386/i386/db_interface.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/net

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:17:27 UTC 2024

Modified Files:
src/sys/net [netbsd-10]: if_tun.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #899):

sys/net/if_tun.c: revision 1.177

tun(4): Mark tunread_filtops `FILTEROP_MPSAFE`

Filter handlers have already been MP-safe since 2018:
https://mail-index.netbsd.org/source-changes/2018/08/06/msg097317.html

Note that we do not expect deadlocks similar to bpf(4) (PR kern/58531),
b/w KERNEL_LOCK and spin mutex for TX queue.

For tun(4), filt_tunread() acquires adaptive mutex. This is forbidden
when spin mutex is already held.

Such a path must have already been detected if present.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.173.4.2 -r1.173.4.3 src/sys/net/if_tun.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/net/if_tun.c
diff -u src/sys/net/if_tun.c:1.173.4.2 src/sys/net/if_tun.c:1.173.4.3
--- src/sys/net/if_tun.c:1.173.4.2	Mon Mar 11 19:28:45 2024
+++ src/sys/net/if_tun.c	Sat Sep 21 12:17:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.173.4.2 2024/03/11 19:28:45 martin Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.173.4.3 2024/09/21 12:17:27 martin Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.173.4.2 2024/03/11 19:28:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.173.4.3 2024/09/21 12:17:27 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1098,7 +1098,7 @@ filt_tunread(struct knote *kn, long hint
 }
 
 static const struct filterops tunread_filtops = {
-	.f_flags = FILTEROP_ISFD,
+	.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
 	.f_attach = NULL,
 	.f_detach = filt_tunrdetach,
 	.f_event = filt_tunread,



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:17:27 UTC 2024

Modified Files:
src/sys/net [netbsd-10]: if_tun.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #899):

sys/net/if_tun.c: revision 1.177

tun(4): Mark tunread_filtops `FILTEROP_MPSAFE`

Filter handlers have already been MP-safe since 2018:
https://mail-index.netbsd.org/source-changes/2018/08/06/msg097317.html

Note that we do not expect deadlocks similar to bpf(4) (PR kern/58531),
b/w KERNEL_LOCK and spin mutex for TX queue.

For tun(4), filt_tunread() acquires adaptive mutex. This is forbidden
when spin mutex is already held.

Such a path must have already been detected if present.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.173.4.2 -r1.173.4.3 src/sys/net/if_tun.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-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:13:05 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #898):

sys/stand/efiboot/exec.c: revision 1.26

When freeing pages, pass page count instead of byte count.


To generate a diff of this commit:
cvs rdiff -u -r1.23.4.1 -r1.23.4.2 src/sys/stand/efiboot/exec.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/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.23.4.1 src/sys/stand/efiboot/exec.c:1.23.4.2
--- src/sys/stand/efiboot/exec.c:1.23.4.1	Fri Nov  3 09:59:04 2023
+++ src/sys/stand/efiboot/exec.c	Sat Sep 21 12:13:05 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.23.4.1 2023/11/03 09:59:04 martin Exp $ */
+/* $NetBSD: exec.c,v 1.23.4.2 2024/09/21 12:13:05 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -154,7 +154,8 @@ generate_efirng(void)
 
 	/* Fill the page with whatever the EFI RNG will do.  */
 	if (efi_rng((void *)(uintptr_t)addr, size)) {
-		uefi_call_wrapper(BS->FreePages, 2, addr, size);
+		uefi_call_wrapper(BS->FreePages, 2, addr,
+		EFI_SIZE_TO_PAGES(size));
 		return;
 	}
 



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

2024-09-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 21 12:13:05 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #898):

sys/stand/efiboot/exec.c: revision 1.26

When freeing pages, pass page count instead of byte count.


To generate a diff of this commit:
cvs rdiff -u -r1.23.4.1 -r1.23.4.2 src/sys/stand/efiboot/exec.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/nfs

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:44:58 UTC 2024

Modified Files:
src/sys/nfs [netbsd-10]: nfs_clntsubs.c nfs_iod.c nfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #880):

sys/nfs/nfs_iod.c: revision 1.9
sys/nfs/nfs_vfsops.c: revision 1.245
sys/nfs/nfs_clntsubs.c: revision 1.7

PR/57279: Izumi Tsutsui: Fix some {int,long} -> time_t. Still things will
break eventually because parts of the nfs protocol assume time_t will fit
in 32 bits.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/nfs/nfs_clntsubs.c
cvs rdiff -u -r1.8 -r1.8.30.1 src/sys/nfs/nfs_iod.c
cvs rdiff -u -r1.243.10.1 -r1.243.10.2 src/sys/nfs/nfs_vfsops.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/nfs

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:44:58 UTC 2024

Modified Files:
src/sys/nfs [netbsd-10]: nfs_clntsubs.c nfs_iod.c nfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #880):

sys/nfs/nfs_iod.c: revision 1.9
sys/nfs/nfs_vfsops.c: revision 1.245
sys/nfs/nfs_clntsubs.c: revision 1.7

PR/57279: Izumi Tsutsui: Fix some {int,long} -> time_t. Still things will
break eventually because parts of the nfs protocol assume time_t will fit
in 32 bits.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/nfs/nfs_clntsubs.c
cvs rdiff -u -r1.8 -r1.8.30.1 src/sys/nfs/nfs_iod.c
cvs rdiff -u -r1.243.10.1 -r1.243.10.2 src/sys/nfs/nfs_vfsops.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/nfs/nfs_clntsubs.c
diff -u src/sys/nfs/nfs_clntsubs.c:1.6 src/sys/nfs/nfs_clntsubs.c:1.6.4.1
--- src/sys/nfs/nfs_clntsubs.c:1.6	Mon Feb 28 08:45:36 2022
+++ src/sys/nfs/nfs_clntsubs.c	Fri Sep 20 11:44:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $	*/
+/*	$NetBSD: nfs_clntsubs.c,v 1.6.4.1 2024/09/20 11:44:58 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.6.4.1 2024/09/20 11:44:58 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -390,7 +390,7 @@ nfs_check_wccdata(struct nfsnode *np, co
 	if (docheck) {
 		struct vnode *vp = NFSTOV(np);
 		struct nfsmount *nmp;
-		long now = time_second;
+		time_t now = time_second;
 		const struct timespec *omtime = &np->n_vattr->va_mtime;
 		const struct timespec *octime = &np->n_vattr->va_ctime;
 		const char *reason = NULL; /* XXX: gcc */

Index: src/sys/nfs/nfs_iod.c
diff -u src/sys/nfs/nfs_iod.c:1.8 src/sys/nfs/nfs_iod.c:1.8.30.1
--- src/sys/nfs/nfs_iod.c:1.8	Mon Sep  3 16:29:36 2018
+++ src/sys/nfs/nfs_iod.c	Fri Sep 20 11:44:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_iod.c,v 1.8 2018/09/03 16:29:36 riastradh Exp $	*/
+/*	$NetBSD: nfs_iod.c,v 1.8.30.1 2024/09/20 11:44:58 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_iod.c,v 1.8 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_iod.c,v 1.8.30.1 2024/09/20 11:44:58 martin Exp $");
 
 #include 
 #include 
@@ -409,7 +409,8 @@ nfs_savenickauth(struct nfsmount *nmp, k
 	struct timeval ktvin, ktvout;
 	u_int32_t nick;
 	char *dpos = *dposp, *cp2;
-	int deltasec, error = 0;
+	time_t deltasec;
+	int error = 0;
 
 	memset(&ktvout, 0, sizeof ktvout);	 /* XXX gcc */
 

Index: src/sys/nfs/nfs_vfsops.c
diff -u src/sys/nfs/nfs_vfsops.c:1.243.10.1 src/sys/nfs/nfs_vfsops.c:1.243.10.2
--- src/sys/nfs/nfs_vfsops.c:1.243.10.1	Fri Sep 20 10:29:41 2024
+++ src/sys/nfs/nfs_vfsops.c	Fri Sep 20 11:44:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $	*/
+/*	$NetBSD: nfs_vfsops.c,v 1.243.10.2 2024/09/20 11:44:58 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243.10.2 2024/09/20 11:44:58 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_nfs.h"
@@ -323,7 +323,7 @@ nfs_mountroot(void)
 	struct mount *mp;
 	struct vnode *vp;
 	struct lwp *l;
-	long n;
+	time_t n;
 	int error;
 
 	l = curlwp; /* XXX */
@@ -378,7 +378,7 @@ nfs_mountroot(void)
 		panic("nfs_mountroot: getattr for root");
 	n = attr.va_atime.tv_sec;
 #ifdef	DEBUG
-	printf("root time: 0x%lx\n", n);
+	printf("root time: 0x%jx\n", (intmax_t)n);
 #endif
 	setrootfstime(n);
 



CVS commit: [netbsd-10] src/lib/libc/string

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:22:29 UTC 2024

Modified Files:
src/lib/libc/string [netbsd-10]: Makefile.inc strcpy.3 strlcpy.3
Added Files:
src/lib/libc/string [netbsd-10]: strncpy.3

Log Message:
Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages.  (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.85.6.1 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.23 -r1.23.26.1 src/lib/libc/string/strcpy.3
cvs rdiff -u -r1.14 -r1.14.2.1 src/lib/libc/string/strlcpy.3
cvs rdiff -u -r0 -r1.16.4.2 src/lib/libc/string/strncpy.3

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

Modified files:

Index: src/lib/libc/string/Makefile.inc
diff -u src/lib/libc/string/Makefile.inc:1.85 src/lib/libc/string/Makefile.inc:1.85.6.1
--- src/lib/libc/string/Makefile.inc:1.85	Wed Apr 14 08:07:49 2021
+++ src/lib/libc/string/Makefile.inc	Fri Sep 20 11:22:29 2024
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile.inc	8.1 (Berkeley) 6/4/93
-#	$NetBSD: Makefile.inc,v 1.85 2021/04/14 08:07:49 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.85.6.1 2024/09/20 11:22:29 martin Exp $
 
 # string sour

CVS commit: [netbsd-10] src/doc

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:36:13 UTC 2024

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

Log Message:
Tickets #869 - #894, #897


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 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.34 src/doc/CHANGES-10.1:1.1.2.35
--- src/doc/CHANGES-10.1:1.1.2.34	Mon Sep 16 08:43:12 2024
+++ src/doc/CHANGES-10.1	Fri Sep 20 11:36:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.34 2024/09/16 08:43:12 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.35 2024/09/20 11:36:13 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -1569,3 +1569,160 @@ sys/miscfs/procfs/procfs_vfsops.c		1.120
 	procfs kernel module: define dependencies based on build options.
 	[pgoyette, ticket #868]
 
+sys/arch/aarch64/aarch64/cpu.c			1.73
+usr.sbin/cpuctl/arch/aarch64.c			1.22
+
+	aarch64: correct width of MPIDR.
+	[rin, ticket #869]
+
+sys/kern/kern_sysctl.c1.267,1.268
+
+	Fix SYSCTL_DEBUG_CREATE for non-x86 by using copyin(9) for
+	the user buffer.
+	[rin, ticket #870]
+
+sys/kern/subr_pool.c1.286
+
+	subr_pool: Avoid undefined behavior (left shift of signed value
+	potentialy altering the sign bit)
+	[rin, ticket #871]
+
+external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c 1.15
+
+	Provide pathconf for .zfs control directory.
+	[rin, ticket #872]
+
+sys/fs/union/union_vfsops.c			1.87
+
+	unionfs: set the lower mount only on success.
+	[rin, ticket #873]
+
+sys/arch/sparc64/sparc64/lock_stubs.s		1.12
+
+	sparc64: add missing LoadStore ordering for mutex_enter stub.
+	[rin, ticket #874]
+
+sys/arch/i386/i386/bioscall.S			1.11
+
+	i386/bioscall: disable preemption while we load the kernel pmap.
+	[rin, ticket #875]
+
+sys/arch/amd64/amd64/amd64_trap.S		1.55
+
+	amd64: annotate trap vectors with their mnemonics.
+	[rin, ticket #876]
+
+sys/dev/usb/ucom.c1.138
+
+	ucom(4): PR 57259: simplify logic.
+	[rin, ticket #877]
+
+distrib/sets/lists/comp/mi			1.2426
+share/man/man9/Makefile1.466
+share/man/man9/portfeatures.9			1.1-1.3
+
+	portfeatures(9): new man page for __HAVE* macros.
+	[rin, ticket #878]
+
+sys/nfs/nfs_vfsops.c1.244
+
+	nfs: avoid overflow of nfs_commitsize on machines with > 32GB RAM.
+	[rin, ticket #879]
+
+sys/nfs/nfs_clntsubs.c1.7
+sys/nfs/nfs_iod.c1.9
+sys/nfs/nfs_vfsops.c1.245
+
+	nfs: PR 57279: fix 32 bit time_t leftover in NFS code.
+	[rin, ticket #880]
+
+sys/arch/x86/x86/bus_dma.c			1.90
+
+	x86/bus_dma.c: enhance error diagnostics by using KASSERTMSG.
+	[rin, ticket #881]
+
+sys/kern/uipc_mbuf.c1.249,1.250
+
+	uipc_mbuf: enhance error diagnostics by using KASSERTMSGs.
+	[rin, ticket #882]
+
+sys/arch/sparc64/sparc64/db_trace.c		1.56,1.57
+
+	sparc64: ddb: Use db_read_bytes() instead of pointer
+	dereference to avoid potential crashes.
+	[rin, ticket #883]
+
+sys/dev/md.c	1.87
+
+	md(4): Add constraints check for size given by ioctl(2).
+	[rin, ticket #884]
+
+sys/dev/usb/xhci.c1.178,1.179
+sys/dev/usb/xhcireg.h1.23
+
+	xhci(4): PR 56115: fix clearing of EINT and other transient flags.
+	[rin, ticket #885]
+
+external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c 1.3
+
+	libarchive: PR 56080: fix crash for tar(1) on NFS.
+	[rin, ticket #886]
+
+distrib/sets/lists/comp/mi			1.2435,1.2436
+share/man/man9/Makefile1.467
+share/man/man9/versioningsyscalls.9		1.1-1.7
+
+	versioningsyscalls(9): new man page describing the details of
+	versioning a syscall.
+	[rin, ticket #887]
+
+sys/dev/dksubr.c1.114
+
+	dk(4): call rnd_add_uint32(9) without spin lock held.
+	[rin, ticket #888]
+
+lib/libpthread/Makefile1.97
+lib/librumpuser/configure.ac			1.6
+lib/librumpuser/rumpuser_port.h			1.53
+sys/rump/share/man/man3/rumpuser.3		1.4
+sys/rump/share/man/man7/rumpkernel.7		1.4
+sys/rump/share/man/man7/rumpkernel.7		1.5
+
+	rump: PR 57501: fix URLs for rump.
+	[rin, ticket #889]
+
+sys/arch/x86/x86/fpu.c1.87
+
+	x86/fpu: in kernel mode fpu traps, print the instruction pointer.
+	[rin, ticket #890]
+
+lib/libc/string/Makefile.inc			1.88,1.89
+lib/libc/string/strcpy.3			1.24-1.27
+lib/libc/string/strlcpy.3			1.15-1.21
+lib/libc/string/strncpy.3			1.1-1.16
+
+	Major documentation improvements for strcpy(3) family routines.
+	[rin, ticket #891]
+
+sys/dev/wscons/wsmouse.c			1.73
+
+	wsmouse(4): make wsmouse_input safe to call from MP-safe interrupts.
+	[rin, ticket #892]
+
+sys/arch/i386/stand/Makefile.booters		1.98
+sys/arch/i386/stand/efiboot/Makefile.efiboot	1.23
+sys/arch/i386/stand/libsa/nfs.c			delete
+sys/arch/i386/stand/pxeboot/Makefile		1.29
+sys/lib/libsa/nfs.c1.51-1.53
+sys/lib/libsa/nfsv2.h1.5
+sys/lib/libsa/nfsv3.h1.1
+sys/lib/libsa/rpcv2.h1.4
+
+	libsa: add support for NFSv3 (fallback to N

CVS commit: [netbsd-10] src/doc

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:36:13 UTC 2024

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

Log Message:
Tickets #869 - #894, #897


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 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/arch/evbppc/conf

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:33:52 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf [netbsd-10]: WII

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

sys/arch/evbppc/conf/WII: revision 1.5

Add DKWEDGE_AUTODISCOVER and DKWEDGE_METHOD_GPT to WII
>From Guilherme Janczak in PR 58676


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/arch/evbppc/conf/WII

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/evbppc/conf

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:33:52 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf [netbsd-10]: WII

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

sys/arch/evbppc/conf/WII: revision 1.5

Add DKWEDGE_AUTODISCOVER and DKWEDGE_METHOD_GPT to WII
>From Guilherme Janczak in PR 58676


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/arch/evbppc/conf/WII

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/evbppc/conf/WII
diff -u src/sys/arch/evbppc/conf/WII:1.4.2.2 src/sys/arch/evbppc/conf/WII:1.4.2.3
--- src/sys/arch/evbppc/conf/WII:1.4.2.2	Sat Feb  3 11:47:06 2024
+++ src/sys/arch/evbppc/conf/WII	Fri Sep 20 11:33:51 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: WII,v 1.4.2.2 2024/02/03 11:47:06 martin Exp $
+#	$NetBSD: WII,v 1.4.2.3 2024/09/20 11:33:51 martin Exp $
 #
 #	Nintendo Wii
 #
@@ -46,6 +46,10 @@ makeoptions DEBUG="-g"	# compile full sy
 include 	"conf/compat_netbsd50.config"
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



CVS commit: [netbsd-10] src/sys

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:31:32 UTC 2024

Modified Files:
src/sys/arch/i386/stand [netbsd-10]: Makefile.booters
src/sys/arch/i386/stand/efiboot [netbsd-10]: Makefile.efiboot
src/sys/arch/i386/stand/pxeboot [netbsd-10]: Makefile
src/sys/lib/libsa [netbsd-10]: nfs.c nfsv2.h rpcv2.h
Added Files:
src/sys/lib/libsa [netbsd-10]: nfsv3.h
Removed Files:
src/sys/arch/i386/stand/libsa [netbsd-10]: nfs.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #894):

sys/arch/i386/stand/Makefile.booters: revision 1.98
sys/lib/libsa/nfsv3.h: revision 1.1
sys/lib/libsa/rpcv2.h: revision 1.4
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.23
sys/lib/libsa/nfsv2.h: revision 1.5
sys/lib/libsa/nfs.c: revision 1.51
sys/lib/libsa/nfs.c: revision 1.52
sys/arch/i386/stand/libsa/nfs.c: file removal
sys/lib/libsa/nfs.c: revision 1.53
sys/arch/i386/stand/libsa/nfs.c: revision 1.20
sys/arch/i386/stand/libsa/nfs.c: revision 1.21
sys/arch/i386/stand/pxeboot/Makefile: revision 1.29

Add NFSv3 support. Try NFSv3 and fall back to NFSv2.

Merge with generic libsa NFS code to minimize differences and to learn NFSv3.

libsa: nfs: Fix NFS_NOSYMLINK option for previous
Used only by mvme68k.

Align again with libsa (NFS_NOSYMLINK fix).

libsa/nfs.c: Add `LIBSA_NFS_IMPLICIT_MOUNT` compile-time option
by which nfs_mount() is automatically called from nfs_open(),
as done for nfs.c in i386/stand.

This is only functional difference b/w two copies of nfs.c.
Now, we can safely retire the latter.
XXX
It would be really nice to drop this option also. However,
unfortunately, it is too much for me at the very moment...

i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC


To generate a diff of this commit:
cvs rdiff -u -r1.94.20.1 -r1.94.20.2 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 \
src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/stand/libsa/nfs.c
cvs rdiff -u -r1.28 -r1.28.26.1 src/sys/arch/i386/stand/pxeboot/Makefile
cvs rdiff -u -r1.50 -r1.50.24.1 src/sys/lib/libsa/nfs.c
cvs rdiff -u -r1.4 -r1.4.194.1 src/sys/lib/libsa/nfsv2.h
cvs rdiff -u -r0 -r1.1.4.2 src/sys/lib/libsa/nfsv3.h
cvs rdiff -u -r1.3 -r1.3.194.1 src/sys/lib/libsa/rpcv2.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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.94.20.1 src/sys/arch/i386/stand/Makefile.booters:1.94.20.2
--- src/sys/arch/i386/stand/Makefile.booters:1.94.20.1	Thu Dec 14 17:56:08 2023
+++ src/sys/arch/i386/stand/Makefile.booters	Fri Sep 20 11:31:31 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.94.20.1 2023/12/14 17:56:08 martin Exp $
+#	$NetBSD: Makefile.booters,v 1.94.20.2 2024/09/20 11:31:31 martin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -64,6 +64,7 @@ LIBZ=		${ZLIB}
 ### find out what to use for libsa
 SA_AS=		library
 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
+SAMISCCPPFLAGS+=-DLIBSA_NFS_IMPLICIT_MOUNT
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA=		${SALIB}
 

Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19.4.1 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19.4.2
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19.4.1	Mon Sep 11 13:25:42 2023
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Fri Sep 20 11:31:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.19.4.1 2023/09/11 13:25:42 martin Exp $
+# $NetBSD: Makefile.efiboot,v 1.19.4.2 2024/09/20 11:31:32 martin Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -21,9 +21,7 @@ LIBI386SRCS= biosdisk.c bootinfo.c booti
 LIBI386SRCS+= comio_direct.c
 LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c
 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c
-# use our own nfs implementation
-LIBSASRCS+= nfs.c
-SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} ${LIBSASRCS}
+SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS}
 
 .include 
 
@@ -86,6 +84,7 @@ GNUEFIARCH?= ${MACHINE_CPU}
 CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH}
 CPPFLAGS+= -I${EFIDIR}/inc/protocol
 
+SAMISCCPPFLAGS+= -DLIBSA_NFS_IMPLICIT_MOUNT
 SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT
 SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT
 SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)"

Index: src/sys/arch/i386/stand/pxeboot/Makefile
diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.28 src/sys/arch/i386/stand/pxeboot/Makefile:1.28.26.1
--- src/sys/arch/i386/stand/pxeboot/Makefile:1.28	Fri Sep 27 08:57:10 2019
+++ src/sys/arch/i386/stand/pxeboot/Makefile	Fri Sep 20 11:31:32 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2019/09/27 08:57:10 gson Exp $
+#	$NetBSD: Makefile,v 1.28.26.1 2024/09/20 11:31:32 marti

CVS commit: [netbsd-10] src/sys

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:31:32 UTC 2024

Modified Files:
src/sys/arch/i386/stand [netbsd-10]: Makefile.booters
src/sys/arch/i386/stand/efiboot [netbsd-10]: Makefile.efiboot
src/sys/arch/i386/stand/pxeboot [netbsd-10]: Makefile
src/sys/lib/libsa [netbsd-10]: nfs.c nfsv2.h rpcv2.h
Added Files:
src/sys/lib/libsa [netbsd-10]: nfsv3.h
Removed Files:
src/sys/arch/i386/stand/libsa [netbsd-10]: nfs.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #894):

sys/arch/i386/stand/Makefile.booters: revision 1.98
sys/lib/libsa/nfsv3.h: revision 1.1
sys/lib/libsa/rpcv2.h: revision 1.4
sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.23
sys/lib/libsa/nfsv2.h: revision 1.5
sys/lib/libsa/nfs.c: revision 1.51
sys/lib/libsa/nfs.c: revision 1.52
sys/arch/i386/stand/libsa/nfs.c: file removal
sys/lib/libsa/nfs.c: revision 1.53
sys/arch/i386/stand/libsa/nfs.c: revision 1.20
sys/arch/i386/stand/libsa/nfs.c: revision 1.21
sys/arch/i386/stand/pxeboot/Makefile: revision 1.29

Add NFSv3 support. Try NFSv3 and fall back to NFSv2.

Merge with generic libsa NFS code to minimize differences and to learn NFSv3.

libsa: nfs: Fix NFS_NOSYMLINK option for previous
Used only by mvme68k.

Align again with libsa (NFS_NOSYMLINK fix).

libsa/nfs.c: Add `LIBSA_NFS_IMPLICIT_MOUNT` compile-time option
by which nfs_mount() is automatically called from nfs_open(),
as done for nfs.c in i386/stand.

This is only functional difference b/w two copies of nfs.c.
Now, we can safely retire the latter.
XXX
It would be really nice to drop this option also. However,
unfortunately, it is too much for me at the very moment...

i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC


To generate a diff of this commit:
cvs rdiff -u -r1.94.20.1 -r1.94.20.2 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 \
src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/stand/libsa/nfs.c
cvs rdiff -u -r1.28 -r1.28.26.1 src/sys/arch/i386/stand/pxeboot/Makefile
cvs rdiff -u -r1.50 -r1.50.24.1 src/sys/lib/libsa/nfs.c
cvs rdiff -u -r1.4 -r1.4.194.1 src/sys/lib/libsa/nfsv2.h
cvs rdiff -u -r0 -r1.1.4.2 src/sys/lib/libsa/nfsv3.h
cvs rdiff -u -r1.3 -r1.3.194.1 src/sys/lib/libsa/rpcv2.h

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/wscons

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:24:59 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #892):

sys/dev/wscons/wsmouse.c: revision 1.73

wsmouse(4): Make wsmouse_input safe to call from MP-safe interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.72.4.1 src/sys/dev/wscons/wsmouse.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/wscons/wsmouse.c
diff -u src/sys/dev/wscons/wsmouse.c:1.72 src/sys/dev/wscons/wsmouse.c:1.72.4.1
--- src/sys/dev/wscons/wsmouse.c:1.72	Sun Jul 17 11:44:30 2022
+++ src/sys/dev/wscons/wsmouse.c	Fri Sep 20 11:24:59 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $ */
+/* $NetBSD: wsmouse.c,v 1.72.4.1 2024/09/20 11:24:59 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72.4.1 2024/09/20 11:24:59 martin Exp $");
 
 #include "wsmouse.h"
 #include "wsdisplay.h"
@@ -372,17 +372,19 @@ wsmouse_input(device_t wsmousedev, u_int
 	/* one for each dimension (4) + a bit for each button */
 	struct wscons_event events[4 + sizeof(d) * 8];
 
+	KERNEL_LOCK(1, NULL);
+
 /*
  * Discard input if not open.
  */
 	evar = sc->sc_base.me_evp;
 	if (evar == NULL)
-		return;
+		goto out;
 
 #ifdef DIAGNOSTIC
 	if (evar->q == NULL) {
 		printf("wsmouse_input: evar->q=NULL\n");
-		return;
+		goto out;
 	}
 #endif
 
@@ -528,6 +530,8 @@ wsmouse_input(device_t wsmousedev, u_int
 			device_xname(sc->sc_base.me_dv), evar));
 #endif
 	}
+
+out:	KERNEL_UNLOCK_ONE(NULL);
 }
 
 void



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:24:59 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #892):

sys/dev/wscons/wsmouse.c: revision 1.73

wsmouse(4): Make wsmouse_input safe to call from MP-safe interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.72.4.1 src/sys/dev/wscons/wsmouse.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/lib/libc/string

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:22:29 UTC 2024

Modified Files:
src/lib/libc/string [netbsd-10]: Makefile.inc strcpy.3 strlcpy.3
Added Files:
src/lib/libc/string [netbsd-10]: strncpy.3

Log Message:
Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages.  (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.85.6.1 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.23 -r1.23.26.1 src/lib/libc/string/strcpy.3
cvs rdiff -u -r1.14 -r1.14.2.1 src/lib/libc/string/strlcpy.3
cvs rdiff -u -r0 -r1.16.4.2 src/lib/libc/string/strncpy.3

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-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:00:21 UTC 2024

Modified Files:
src/distrib/sets/lists/comp [netbsd-10]: mi
src/share/man/man9 [netbsd-10]: Makefile
Added Files:
src/share/man/man9 [netbsd-10]: versioningsyscalls.9

Log Message:
Pull up following revision(s) (requested by rin in ticket #887):

share/man/man9/versioningsyscalls.9: revision 1.1
share/man/man9/versioningsyscalls.9: revision 1.2
share/man/man9/versioningsyscalls.9: revision 1.3
share/man/man9/versioningsyscalls.9: revision 1.4
share/man/man9/versioningsyscalls.9: revision 1.5
share/man/man9/versioningsyscalls.9: revision 1.6
share/man/man9/versioningsyscalls.9: revision 1.7
share/man/man9/Makefile: revision 1.467
distrib/sets/lists/comp/mi: revision 1.2435
distrib/sets/lists/comp/mi: revision 1.2436

Document how system call versioning is done. From this summer's compat-linux
GSoC, by Theodore Preduta.

fix typo
versioningsyscalls(9): markup fixes

While here, fix the pasto for the new ino_t and time_t size.

Forgot to commit the expanded userland portion

versioningsyscalls(9): wrap long line in the example

versioningsyscalls.9: fix typo

explain what the current and new numbering practice are.

s/and/an/


To generate a diff of this commit:
cvs rdiff -u -r1.2425.2.7 -r1.2425.2.8 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.465.2.4 -r1.465.2.5 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.7.4.2 src/share/man/man9/versioningsyscalls.9

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-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:08:25 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #890):

sys/arch/x86/x86/fpu.c: revision 1.87

x86/fpu: In kernel mode fpu traps, print the instruction pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.79.4.3 -r1.79.4.4 src/sys/arch/x86/x86/fpu.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-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:08:25 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #890):

sys/arch/x86/x86/fpu.c: revision 1.87

x86/fpu: In kernel mode fpu traps, print the instruction pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.79.4.3 -r1.79.4.4 src/sys/arch/x86/x86/fpu.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/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.79.4.3 src/sys/arch/x86/x86/fpu.c:1.79.4.4
--- src/sys/arch/x86/x86/fpu.c:1.79.4.3	Thu Jun 20 11:02:16 2024
+++ src/sys/arch/x86/x86/fpu.c	Fri Sep 20 11:08:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.79.4.3 2024/06/20 11:02:16 martin Exp $	*/
+/*	$NetBSD: fpu.c,v 1.79.4.4 2024/09/20 11:08:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,8 +96,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.79.4.3 2024/06/20 11:02:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.79.4.4 2024/09/20 11:08:25 martin Exp $");
 
+#include "opt_ddb.h"
 #include "opt_multiprocessor.h"
 
 #include 
@@ -121,6 +122,10 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.79
 #include 
 #include 
 
+#ifdef DDB
+#include 
+#endif
+
 #ifdef XENPV
 #define clts() HYPERVISOR_fpu_taskswitch(0)
 #define stts() HYPERVISOR_fpu_taskswitch(1)
@@ -560,7 +565,16 @@ fputrap(struct trapframe *frame)
 	ksiginfo_t ksi;
 
 	if (__predict_false(!USERMODE(frame->tf_cs))) {
-		panic("fpu trap from kernel, trapframe %p\n", frame);
+		register_t ip = X86_TF_RIP(frame);
+		char where[128];
+
+#ifdef DDB
+		db_symstr(where, sizeof(where), (db_expr_t)ip, DB_STGY_PROC);
+#else
+		snprintf(where, sizeof(where), "%p", (void *)ip);
+#endif
+		panic("fpu trap from kernel at %s, trapframe %p\n", where,
+		frame);
 	}
 
 	KASSERT(curlwp->l_md.md_flags & MDL_FPU_IN_CPU);



CVS commit: [netbsd-10] src

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:05:44 UTC 2024

Modified Files:
src/lib/libpthread [netbsd-10]: Makefile
src/lib/librumpuser [netbsd-10]: configure.ac rumpuser_port.h
src/sys/rump/share/man/man3 [netbsd-10]: rumpuser.3
src/sys/rump/share/man/man7 [netbsd-10]: rumpkernel.7

Log Message:
Pull up following revision(s) (requested by rin in ticket #889):

lib/librumpuser/configure.ac: revision 1.6
lib/librumpuser/rumpuser_port.h: revision 1.53
lib/libpthread/Makefile: revision 1.97
sys/rump/share/man/man3/rumpuser.3: revision 1.4
sys/rump/share/man/man7/rumpkernel.7: revision 1.4
sys/rump/share/man/man7/rumpkernel.7: revision 1.5

fix rump URLs in man pages

Link to https://github.com/rumpkernel/wiki/wiki instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues
with pooka.
PR misc/57501

fix rump URLs
Link to https://github.com/rumpkernel/ instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues with pooka.
PR misc/57501

use rumpkernel.github.io as the entry point


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.8.1 src/lib/libpthread/Makefile
cvs rdiff -u -r1.5 -r1.5.26.1 src/lib/librumpuser/configure.ac
cvs rdiff -u -r1.52 -r1.52.2.1 src/lib/librumpuser/rumpuser_port.h
cvs rdiff -u -r1.3 -r1.3.30.1 src/sys/rump/share/man/man3/rumpuser.3
cvs rdiff -u -r1.3 -r1.3.52.1 src/sys/rump/share/man/man7/rumpkernel.7

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-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:05:44 UTC 2024

Modified Files:
src/lib/libpthread [netbsd-10]: Makefile
src/lib/librumpuser [netbsd-10]: configure.ac rumpuser_port.h
src/sys/rump/share/man/man3 [netbsd-10]: rumpuser.3
src/sys/rump/share/man/man7 [netbsd-10]: rumpkernel.7

Log Message:
Pull up following revision(s) (requested by rin in ticket #889):

lib/librumpuser/configure.ac: revision 1.6
lib/librumpuser/rumpuser_port.h: revision 1.53
lib/libpthread/Makefile: revision 1.97
sys/rump/share/man/man3/rumpuser.3: revision 1.4
sys/rump/share/man/man7/rumpkernel.7: revision 1.4
sys/rump/share/man/man7/rumpkernel.7: revision 1.5

fix rump URLs in man pages

Link to https://github.com/rumpkernel/wiki/wiki instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues
with pooka.
PR misc/57501

fix rump URLs
Link to https://github.com/rumpkernel/ instead of
a site now taken over by an SEO squatter.
Per discussion on github.com/rumpkernel issues with pooka.
PR misc/57501

use rumpkernel.github.io as the entry point


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.8.1 src/lib/libpthread/Makefile
cvs rdiff -u -r1.5 -r1.5.26.1 src/lib/librumpuser/configure.ac
cvs rdiff -u -r1.52 -r1.52.2.1 src/lib/librumpuser/rumpuser_port.h
cvs rdiff -u -r1.3 -r1.3.30.1 src/sys/rump/share/man/man3/rumpuser.3
cvs rdiff -u -r1.3 -r1.3.52.1 src/sys/rump/share/man/man7/rumpkernel.7

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

Modified files:

Index: src/lib/libpthread/Makefile
diff -u src/lib/libpthread/Makefile:1.96 src/lib/libpthread/Makefile:1.96.8.1
--- src/lib/libpthread/Makefile:1.96	Mon Nov 11 22:45:27 2019
+++ src/lib/libpthread/Makefile	Fri Sep 20 11:05:44 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.96 2019/11/11 22:45:27 joerg Exp $
+#	$NetBSD: Makefile,v 1.96.8.1 2024/09/20 11:05:44 martin Exp $
 #
 
 NOSANITIZER=	# defined
@@ -45,7 +45,7 @@ CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CUR
 
 # providing alternative MI implementations for creating an lwp is
 # possible by setting PTHREAD_MAKELWP.  Currently, alternatives are
-# set by the rumprun software stacks (see repo.rumpkernel.org)
+# set by the rumprun software stacks (see https://github.com/rumpkernel/rumprun )
 PTHREAD_MAKELWP?=	pthread_makelwp_netbsd.c
 
 #

Index: src/lib/librumpuser/configure.ac
diff -u src/lib/librumpuser/configure.ac:1.5 src/lib/librumpuser/configure.ac:1.5.26.1
--- src/lib/librumpuser/configure.ac:1.5	Thu Mar  5 00:25:39 2015
+++ src/lib/librumpuser/configure.ac	Fri Sep 20 11:05:44 2024
@@ -5,11 +5,11 @@
 #   1) autoreconf -iv
 #   2) edit rumpuser_port.h (search for RUMPUSER_CONFIG for instructions)
 #   3) rm -rf autom4te.cache
-#   4) commit to NetBSD, pullup to repo.rumpkernel.org
+#   4) commit to NetBSD, pullup to https://github.com/rumpkernel/
 #
 
 AC_PREREQ([2.66])
-AC_INIT([rumpuser-posix], [999], [http://rumpkernel.org/])
+AC_INIT([rumpuser-posix], [999], [https://github.com/rumpkernel/])
 
 AC_CONFIG_HEADERS([rumpuser_config.h])
 AC_CONFIG_AUX_DIR([build-aux])

Index: src/lib/librumpuser/rumpuser_port.h
diff -u src/lib/librumpuser/rumpuser_port.h:1.52 src/lib/librumpuser/rumpuser_port.h:1.52.2.1
--- src/lib/librumpuser/rumpuser_port.h:1.52	Tue Apr 19 20:32:17 2022
+++ src/lib/librumpuser/rumpuser_port.h	Fri Sep 20 11:05:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_port.h,v 1.52 2022/04/19 20:32:17 rillig Exp $	*/
+/*	$NetBSD: rumpuser_port.h,v 1.52.2.1 2024/09/20 11:05:44 martin Exp $	*/
 
 #ifndef _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
 #define _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
@@ -48,7 +48,7 @@
 #define HAVE_UNISTD_H 1
 #define HAVE_UTIMENSAT 1
 #define HAVE___QUOTACTL 1
-#define PACKAGE_BUGREPORT "http://rumpkernel.org/";
+#define PACKAGE_BUGREPORT "https://github.com/rumpkernel/";
 #define PACKAGE_NAME "rumpuser-posix"
 #define PACKAGE_STRING "rumpuser-posix 999"
 #define PACKAGE_TARNAME "rumpuser-posix"

Index: src/sys/rump/share/man/man3/rumpuser.3
diff -u src/sys/rump/share/man/man3/rumpuser.3:1.3 src/sys/rump/share/man/man3/rumpuser.3:1.3.30.1
--- src/sys/rump/share/man/man3/rumpuser.3:1.3	Fri Mar  8 08:24:41 2019
+++ src/sys/rump/share/man/man3/rumpuser.3	Fri Sep 20 11:05:44 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: rumpuser.3,v 1.3 2019/03/08 08:24:41 wiz Exp $
+.\" $NetBSD: rumpuser.3,v 1.3.30.1 2024/09/20 11:05:44 martin Exp $
 .\"
 .\" Copyright (c) 2013 Antti Kantee.  All rights reserved.
 .\"
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 24, 2014
+.Dd July 15, 2023
 .Dt RUMPUSER 3
 .Os
 .Sh NAME
@@ -769,7 +769,7 @@ Routines which do not return an integer 
 For a list of all known implementations of the
 .Nm
 interface, see
-.Lk http://wiki.rumpkernel.org/Platforms .
+.Lk https://github.com/rumpkernel/wiki/wi

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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:02:23 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #888):

sys/dev/dksubr.c: revision 1.114

Move the rnd_add_uint32 outside the lock and get rid of dk_done1() suggested
by riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.16.1 src/sys/dev/dksubr.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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:02:23 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #888):

sys/dev/dksubr.c: revision 1.114

Move the rnd_add_uint32 outside the lock and get rid of dk_done1() suggested
by riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.16.1 src/sys/dev/dksubr.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/dksubr.c
diff -u src/sys/dev/dksubr.c:1.113 src/sys/dev/dksubr.c:1.113.16.1
--- src/sys/dev/dksubr.c:1.113	Thu Apr 15 00:32:50 2021
+++ src/sys/dev/dksubr.c	Fri Sep 20 11:02:23 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.113 2021/04/15 00:32:50 rin Exp $ */
+/* $NetBSD: dksubr.c,v 1.113.16.1 2024/09/20 11:02:23 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.113 2021/04/15 00:32:50 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.113.16.1 2024/09/20 11:02:23 martin Exp $");
 
 #include 
 #include 
@@ -77,7 +77,6 @@ static int dk_subr_modcmd(modcmd_t, void
 
 static void	dk_makedisklabel(struct dk_softc *);
 static int	dk_translate(struct dk_softc *, struct buf *);
-static void	dk_done1(struct dk_softc *, struct buf *, bool);
 
 void
 dk_init(struct dk_softc *dksc, device_t dev, int dtype)
@@ -442,7 +441,9 @@ dk_start(struct dk_softc *dksc, struct b
 			if (error != 0) {
 bp->b_error = error;
 bp->b_resid = bp->b_bcount;
-dk_done1(dksc, bp, false);
+mutex_exit(&dksc->sc_iolock);
+dk_done(dksc, bp);
+mutex_enter(&dksc->sc_iolock);
 			}
 
 			bp = bufq_get(dksc->sc_bufq);
@@ -454,8 +455,8 @@ done:
 	mutex_exit(&dksc->sc_iolock);
 }
 
-static void
-dk_done1(struct dk_softc *dksc, struct buf *bp, bool lock)
+void
+dk_done(struct dk_softc *dksc, struct buf *bp)
 {
 	struct disk *dk = &dksc->sc_dkdev;
 
@@ -467,25 +468,17 @@ dk_done1(struct dk_softc *dksc, struct b
 		printf("\n");
 	}
 
-	if (lock)
-		mutex_enter(&dksc->sc_iolock);
+	mutex_enter(&dksc->sc_iolock);
 	disk_unbusy(dk, bp->b_bcount - bp->b_resid, (bp->b_flags & B_READ));
+	mutex_exit(&dksc->sc_iolock);
 
 	if ((dksc->sc_flags & DKF_NO_RND) == 0)
 		rnd_add_uint32(&dksc->sc_rnd_source, bp->b_rawblkno);
-	if (lock)
-		mutex_exit(&dksc->sc_iolock);
 
 	biodone(bp);
 }
 
 void
-dk_done(struct dk_softc *dksc, struct buf *bp)
-{
-	dk_done1(dksc, bp, true);
-}
-
-void
 dk_drain(struct dk_softc *dksc)
 {
 	struct buf *bp;



CVS commit: [netbsd-10] src

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 11:00:21 UTC 2024

Modified Files:
src/distrib/sets/lists/comp [netbsd-10]: mi
src/share/man/man9 [netbsd-10]: Makefile
Added Files:
src/share/man/man9 [netbsd-10]: versioningsyscalls.9

Log Message:
Pull up following revision(s) (requested by rin in ticket #887):

share/man/man9/versioningsyscalls.9: revision 1.1
share/man/man9/versioningsyscalls.9: revision 1.2
share/man/man9/versioningsyscalls.9: revision 1.3
share/man/man9/versioningsyscalls.9: revision 1.4
share/man/man9/versioningsyscalls.9: revision 1.5
share/man/man9/versioningsyscalls.9: revision 1.6
share/man/man9/versioningsyscalls.9: revision 1.7
share/man/man9/Makefile: revision 1.467
distrib/sets/lists/comp/mi: revision 1.2435
distrib/sets/lists/comp/mi: revision 1.2436

Document how system call versioning is done. From this summer's compat-linux
GSoC, by Theodore Preduta.

fix typo
versioningsyscalls(9): markup fixes

While here, fix the pasto for the new ino_t and time_t size.

Forgot to commit the expanded userland portion

versioningsyscalls(9): wrap long line in the example

versioningsyscalls.9: fix typo

explain what the current and new numbering practice are.

s/and/an/


To generate a diff of this commit:
cvs rdiff -u -r1.2425.2.7 -r1.2425.2.8 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.465.2.4 -r1.465.2.5 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.7.4.2 src/share/man/man9/versioningsyscalls.9

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2425.2.7 src/distrib/sets/lists/comp/mi:1.2425.2.8
--- src/distrib/sets/lists/comp/mi:1.2425.2.7	Fri Sep 20 10:27:10 2024
+++ src/distrib/sets/lists/comp/mi	Fri Sep 20 11:00:20 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2425.2.7 2024/09/20 10:27:10 martin Exp $
+#	$NetBSD: mi,v 1.2425.2.8 2024/09/20 11:00:20 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -12915,6 +12915,7 @@
 ./usr/share/man/cat9/vdead_check.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/vdevgone.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/veriexec.0			comp-sys-catman		.cat
+./usr/share/man/cat9/versioningsyscalls.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/vfinddev.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vflush.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vflushbuf.0		comp-sys-catman		.cat
@@ -21228,6 +21229,7 @@
 ./usr/share/man/html9/vdead_check.html		comp-sys-htmlman	html
 ./usr/share/man/html9/vdevgone.html		comp-sys-htmlman	html
 ./usr/share/man/html9/veriexec.html		comp-sys-htmlman	html
+./usr/share/man/html9/versioningsyscalls.html	comp-sys-htmlman	html
 ./usr/share/man/html9/vfinddev.html		comp-sys-htmlman	html
 ./usr/share/man/html9/vflush.html		comp-sys-htmlman	html
 ./usr/share/man/html9/vflushbuf.html		comp-sys-htmlman	html
@@ -29774,6 +29776,7 @@
 ./usr/share/man/man9/vdead_check.9		comp-sys-man		.man
 ./usr/share/man/man9/vdevgone.9			comp-sys-man		.man
 ./usr/share/man/man9/veriexec.9			comp-sys-man		.man
+./usr/share/man/man9/versioningsyscalls.9	comp-sys-man		.man
 ./usr/share/man/man9/vfinddev.9			comp-sys-man		.man
 ./usr/share/man/man9/vflush.9			comp-sys-man		.man
 ./usr/share/man/man9/vflushbuf.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.465.2.4 src/share/man/man9/Makefile:1.465.2.5
--- src/share/man/man9/Makefile:1.465.2.4	Fri Sep 20 10:27:11 2024
+++ src/share/man/man9/Makefile	Fri Sep 20 11:00:20 2024
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.465.2.4 2024/09/20 10:27:11 martin Exp $
+#   $NetBSD: Makefile,v 1.465.2.5 2024/09/20 11:00:20 martin Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -67,7 +67,8 @@ MAN+=	secmodel_suser.9 \
 	usbd_status.9 usbdi.9 usbnet.9 \
 	userret.9 ustore.9 \
 	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 \
-	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
+	vattr.9 veriexec.9 vcons.9 versioningsyscalls.9 \
+	vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vmem.9  \
 	wapbl.9 wdc.9 workqueue.9 \
 	wsbell.9 wscons.9 wsdisplay.9 wsfont.9 wskbd.9 wsmouse.9 \

Added files:

Index: src/share/man/man9/versioningsyscalls.9
diff -u /dev/null src/share/man/man9/versioningsyscalls.9:1.7.4.2
--- /dev/null	Fri Sep 20 11:00:21 2024
+++ src/share/man/man9/versioningsyscalls.9	Fri Sep 20 11:00:20 2024
@@ -0,0 +1,374 @@
+.\"	$NetBSD: versioningsyscalls.9,v 1.7.4.2 2024/09/20 11:00:20 martin Exp $
+.\"
+.\" Copyright (c) 2023 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Theodore Preduta.
+.\"
+.\" Redistribu

CVS commit: [netbsd-10] src/external/bsd/libarchive/dist/libarchive

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:55:11 UTC 2024

Modified Files:
src/external/bsd/libarchive/dist/libarchive [netbsd-10]:
archive_read_disk_posix.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #886):

external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c: 
revision 1.3

libarchive: fail if name_max is 0

Add error handling to the USE_READDIR_R code paths that set name_max
from struct statfs or statvfs; if the determined name_max == 0
then return an error.

Avoids a crash in tree_dir_next_posix() when the calculation of
dirent_size from name_max is too small for the memory allocated
for struct dirent.

Submitted to upstream in pull request
 https://github.com/libarchive/libarchive/pull/1903

Should fix PR bin/56080


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.6.1 \
src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.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/external/bsd/libarchive/dist/libarchive

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:55:11 UTC 2024

Modified Files:
src/external/bsd/libarchive/dist/libarchive [netbsd-10]:
archive_read_disk_posix.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #886):

external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c: 
revision 1.3

libarchive: fail if name_max is 0

Add error handling to the USE_READDIR_R code paths that set name_max
from struct statfs or statvfs; if the determined name_max == 0
then return an error.

Avoids a crash in tree_dir_next_posix() when the calculation of
dirent_size from name_max is too small for the memory allocated
for struct dirent.

Submitted to upstream in pull request
 https://github.com/libarchive/libarchive/pull/1903

Should fix PR bin/56080


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.6.1 \
src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.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/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.2 src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.2.6.1
--- src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c:1.2	Mon Mar 29 15:31:46 2021
+++ src/external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c	Fri Sep 20 10:55:11 2024
@@ -1653,6 +1653,11 @@ setup_current_filesystem(struct archive_
 	else
 		t->current_filesystem->name_max = nm;
 #endif
+	if (t->current_filesystem->name_max == 0) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		"Cannot determine name_max");
+		return (ARCHIVE_FAILED);
+	}
 #endif /* USE_READDIR_R */
 	return (ARCHIVE_OK);
 }
@@ -1726,6 +1731,11 @@ setup_current_filesystem(struct archive_
 
 	/* Set maximum filename length. */
 	t->current_filesystem->name_max = sfs.f_namemax;
+	if (t->current_filesystem->name_max == 0) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		"Cannot determine name_max");
+		return (ARCHIVE_FAILED);
+	}
 	return (ARCHIVE_OK);
 }
 
@@ -1858,6 +1868,11 @@ setup_current_filesystem(struct archive_
 #if defined(USE_READDIR_R)
 	/* Set maximum filename length. */
 	t->current_filesystem->name_max = sfs.f_namelen;
+	if (t->current_filesystem->name_max == 0) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		"Cannot determine name_max");
+		return (ARCHIVE_FAILED);
+	}
 #endif
 	return (ARCHIVE_OK);
 }
@@ -1939,6 +1954,11 @@ setup_current_filesystem(struct archive_
 #if defined(USE_READDIR_R)
 	/* Set maximum filename length. */
 	t->current_filesystem->name_max = sfs.f_namemax;
+	if (t->current_filesystem->name_max == 0) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		"Cannot determine name_max");
+		return (ARCHIVE_FAILED);
+	}
 #endif
 	return (ARCHIVE_OK);
 }
@@ -1993,6 +2013,11 @@ setup_current_filesystem(struct archive_
 	else
 		t->current_filesystem->name_max = nm;
 #  endif /* _PC_NAME_MAX */
+	if (t->current_filesystem->name_max == 0) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		"Cannot determine name_max");
+		return (ARCHIVE_FAILED);
+	}
 #endif /* USE_READDIR_R */
 	return (ARCHIVE_OK);
 }



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:52:21 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-10]: xhci.c xhcireg.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #885):

sys/dev/usb/xhcireg.h: revision 1.23
sys/dev/usb/xhci.c: revision 1.178
sys/dev/usb/xhci.c: revision 1.179

Remove an unnecessary cast in a KASSERTMSG
- Fix clearing of EINT and other transient flags.

Patches from sc.dying in kern/56115:
- Set proper Max ESIT Payload value for interrupt/isoc endpoint context.
- Set proper Average TRB Length value.
- Not tested on superspeed/superspeedplus isochronous device.
- Add handling of some error paths for isochronous transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.175.2.2 -r1.175.2.3 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/dev/usb/xhcireg.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/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.175.2.2 src/sys/dev/usb/xhci.c:1.175.2.3
--- src/sys/dev/usb/xhci.c:1.175.2.2	Tue Aug  1 16:49:54 2023
+++ src/sys/dev/usb/xhci.c	Fri Sep 20 10:52:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.175.2.2 2023/08/01 16:49:54 martin Exp $	*/
+/*	$NetBSD: xhci.c,v 1.175.2.3 2024/09/20 10:52:21 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.175.2.2 2023/08/01 16:49:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.175.2.3 2024/09/20 10:52:21 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -192,7 +192,7 @@ static void xhci_setup_ctx(struct usbd_p
 static void xhci_setup_route(struct usbd_pipe *, uint32_t *);
 static void xhci_setup_tthub(struct usbd_pipe *, uint32_t *);
 static void xhci_setup_maxburst(struct usbd_pipe *, uint32_t *);
-static uint32_t xhci_bival2ival(uint32_t, uint32_t);
+static uint32_t xhci_bival2ival(uint32_t, uint32_t, uint32_t);
 
 static void xhci_noop(struct usbd_pipe *);
 
@@ -1764,7 +1764,7 @@ xhci_intr1(struct xhci_softc * const sc)
 	 * next shared interrupt. Also, to avoid race, EINT must be cleared
 	 * before XHCI_IMAN_INTR_PEND is cleared.
 	 */
-	xhci_op_write_4(sc, XHCI_USBSTS, usbsts & XHCI_STS_RSVDP0);
+	xhci_op_write_4(sc, XHCI_USBSTS, usbsts & ~XHCI_STS_RSVDP0);
 
 #ifdef XHCI_DEBUG
 	usbsts = xhci_op_read_4(sc, XHCI_USBSTS);
@@ -2496,8 +2496,6 @@ xhci_event_transfer(struct xhci_softc * 
 			xfer->ux_frlengths[xx->xx_isoc_done] -=
 			XHCI_TRB_2_REM_GET(trb_2);
 			xfer->ux_actlen += xfer->ux_frlengths[xx->xx_isoc_done];
-			if (++xx->xx_isoc_done < xfer->ux_nframes)
-return;
 		} else
 		if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0) {
 			if (xfer->ux_actlen == 0)
@@ -2529,6 +2527,22 @@ xhci_event_transfer(struct xhci_softc * 
 		break;
 	}
 
+	if (xfertype == UE_ISOCHRONOUS) {
+		switch (trbcode) {
+		case XHCI_TRB_ERROR_SHORT_PKT:
+		case XHCI_TRB_ERROR_SUCCESS:
+			break;
+		case XHCI_TRB_ERROR_MISSED_SERVICE:
+		case XHCI_TRB_ERROR_RING_UNDERRUN:
+		case XHCI_TRB_ERROR_RING_OVERRUN:
+		default:
+			xfer->ux_frlengths[xx->xx_isoc_done] = 0;
+			break;
+		}
+		if (++xx->xx_isoc_done < xfer->ux_nframes)
+			return;
+	}
+
 	if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0 ||
 	(trb_0 & 0x3) == 0x0) {
 		/*
@@ -3551,9 +3565,7 @@ xhci_setup_ctx(struct usbd_pipe *pipe)
 	const u_int dci = xhci_ep_get_dci(ed);
 	const uint8_t xfertype = UE_GET_XFERTYPE(ed->bmAttributes);
 	uint32_t *cp;
-	uint16_t mps = UGETW(ed->wMaxPacketSize);
 	uint8_t speed = dev->ud_speed;
-	uint8_t ival = ed->bInterval;
 
 	XHCIHIST_FUNC();
 	XHCIHIST_CALLARGS("pipe %#jx: slot %ju dci %ju speed %ju",
@@ -3598,43 +3610,16 @@ xhci_setup_ctx(struct usbd_pipe *pipe)
 	if (xfertype != UE_ISOCHRONOUS)
 		cp[1] |= XHCI_EPCTX_1_CERR_SET(3);
 
-	if (xfertype == UE_CONTROL)
-		cp[4] = XHCI_EPCTX_4_AVG_TRB_LEN_SET(8); /* 6.2.3 */
-	else if (USB_IS_SS(speed))
-		cp[4] = XHCI_EPCTX_4_AVG_TRB_LEN_SET(mps);
-	else
-		cp[4] = XHCI_EPCTX_4_AVG_TRB_LEN_SET(UE_GET_SIZE(mps));
-
 	xhci_setup_maxburst(pipe, cp);
 
-	switch (xfertype) {
-	case UE_CONTROL:
-		break;
-	case UE_BULK:
-		/* XXX Set MaxPStreams, HID, and LSA if streams enabled */
-		break;
-	case UE_INTERRUPT:
-		if (pipe->up_interval != USBD_DEFAULT_INTERVAL)
-			ival = pipe->up_interval;
-
-		ival = xhci_bival2ival(ival, speed);
-		cp[0] |= XHCI_EPCTX_0_IVAL_SET(ival);
-		break;
-	case UE_ISOCHRONOUS:
-		if (pipe->up_interval != USBD_DEFAULT_INTERVAL)
-			ival = pipe->up_interval;
-
-		/* xHCI 6.2.3.6 Table 65, USB 2.0 9.6.6 */
-		if (speed == USB_SPEED_FULL)
-			ival += 3; /* 1ms -> 125us */
-		ival--;
-		cp[0] |= XHCI_EPCTX_0_IVAL_SET(ival);
-		break;
-	default:
-		break;
-	}
-	DPRINTFN(4, "setting ival %ju MaxBurst %#jx",
-	XHCI_EPCTX_0_IVAL_GET(cp[0]), XHCI_EPCTX_1_MAXB_GET(cp[1]), 0, 0);
+	DPRINTFN(4, "setting on dci %ju ival %ju mult %ju mps %#jx",
+	dci, XHCI_EPCTX_0_IVAL_GE

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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:52:21 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-10]: xhci.c xhcireg.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #885):

sys/dev/usb/xhcireg.h: revision 1.23
sys/dev/usb/xhci.c: revision 1.178
sys/dev/usb/xhci.c: revision 1.179

Remove an unnecessary cast in a KASSERTMSG
- Fix clearing of EINT and other transient flags.

Patches from sc.dying in kern/56115:
- Set proper Max ESIT Payload value for interrupt/isoc endpoint context.
- Set proper Average TRB Length value.
- Not tested on superspeed/superspeedplus isochronous device.
- Add handling of some error paths for isochronous transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.175.2.2 -r1.175.2.3 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/dev/usb/xhcireg.h

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/kern

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:50:00 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #882):

sys/kern/uipc_mbuf.c: revision 1.250
sys/kern/uipc_mbuf.c: revision 1.249

mbuf(9): Sprinkle KASSERTMSG.
No functional change intended.

0x%p -> %p in KASSERTMSGs


To generate a diff of this commit:
cvs rdiff -u -r1.247.2.1 -r1.247.2.2 src/sys/kern/uipc_mbuf.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/kern

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:50:00 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #882):

sys/kern/uipc_mbuf.c: revision 1.250
sys/kern/uipc_mbuf.c: revision 1.249

mbuf(9): Sprinkle KASSERTMSG.
No functional change intended.

0x%p -> %p in KASSERTMSGs


To generate a diff of this commit:
cvs rdiff -u -r1.247.2.1 -r1.247.2.2 src/sys/kern/uipc_mbuf.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/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.247.2.1 src/sys/kern/uipc_mbuf.c:1.247.2.2
--- src/sys/kern/uipc_mbuf.c:1.247.2.1	Mon Nov 27 20:00:17 2023
+++ src/sys/kern/uipc_mbuf.c	Fri Sep 20 10:50:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.247.2.1 2023/11/27 20:00:17 martin Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.247.2.2 2024/09/20 10:50:00 martin Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001, 2018 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.247.2.1 2023/11/27 20:00:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.247.2.2 2024/09/20 10:50:00 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -539,7 +539,11 @@ m_get(int how, int type)
 	how == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : PR_NOWAIT);
 	if (m == NULL)
 		return NULL;
-	KASSERT(((vaddr_t)m->m_dat & PAGE_MASK) + MLEN <= PAGE_SIZE);
+	KASSERTMSG(((vaddr_t)m->m_dat & PAGE_MASK) + MLEN <= PAGE_SIZE,
+	"m=%p m->m_dat=%p"
+	" MLEN=%u PAGE_MASK=0x%x PAGE_SIZE=%u",
+	m, m->m_dat,
+	(unsigned)MLEN, (unsigned)PAGE_MASK, (unsigned)PAGE_SIZE);
 
 	mbstat_type_add(type, 1);
 
@@ -593,8 +597,12 @@ m_clget(struct mbuf *m, int how)
 	if (m->m_ext_storage.ext_buf == NULL)
 		return;
 
-	KASSERT(((vaddr_t)m->m_ext_storage.ext_buf & PAGE_MASK) + mclbytes
-	<= PAGE_SIZE);
+	KASSERTMSGvaddr_t)m->m_ext_storage.ext_buf & PAGE_MASK) + mclbytes
+		<= PAGE_SIZE),
+	"m=%p m->m_ext_storage.ext_buf=%p"
+	" mclbytes=%u PAGE_MASK=0x%x PAGE_SIZE=%u",
+	m, m->m_dat,
+	(unsigned)mclbytes, (unsigned)PAGE_MASK, (unsigned)PAGE_SIZE);
 
 	MCLINITREFERENCE(m);
 	m->m_data = m->m_ext.ext_buf;
@@ -691,6 +699,8 @@ m_copylen(int len, int copylen)
 static struct mbuf *
 m_copy_internal(struct mbuf *m, int off0, int len, int wait, bool deep)
 {
+	struct mbuf *m0 __diagused = m;
+	int len0 __diagused = len;
 	struct mbuf *n, **np;
 	int off = off0;
 	struct mbuf *top;
@@ -761,7 +771,9 @@ m_copy_internal(struct mbuf *m, int off0
 			len -= n->m_len;
 		off += n->m_len;
 
-		KASSERT(off <= m->m_len);
+		KASSERTMSG(off <= m->m_len,
+		"m=%p m->m_len=%d off=%d len=%d m0=%p off0=%d len0=%d",
+		m, m->m_len, off, len, m0, off0, len0);
 
 		if (off == m->m_len) {
 			m = m->m_next;
@@ -1117,7 +1129,8 @@ m_pulldown(struct mbuf *m, int off, int 
 			m_freem(m);
 			return NULL;	/* ENOBUFS */
 		}
-		KASSERT(o->m_len >= len);
+		KASSERTMSG(o->m_len >= len, "o=%p o->m_len=%d len=%d",
+		o, o->m_len, len);
 		for (mlast = o; mlast->m_next != NULL; mlast = mlast->m_next)
 			;
 		n->m_len = off;
@@ -1700,7 +1713,9 @@ m_defrag(struct mbuf *m, int how)
 			m0 = m_get(how, MT_DATA);
 			if (m0 == NULL)
 return NULL;
-			KASSERT(m->m_len <= MHLEN);
+			KASSERTMSG(m->m_len <= MHLEN,
+			"m=%p m->m_len=%d MHLEN=%u",
+			m, m->m_len, (unsigned)MHLEN);
 			m_copydata(m, 0, m->m_len, mtod(m0, void *));
 
 			MCLGET(m, how);
@@ -1711,7 +1726,10 @@ m_defrag(struct mbuf *m, int how)
 			memcpy(m->m_data, mtod(m0, void *), m->m_len);
 			m_free(m0);
 		}
-		KASSERT(M_TRAILINGSPACE(m) >= (m->m_pkthdr.len - m->m_len));
+		KASSERTMSG(M_TRAILINGSPACE(m) >= (m->m_pkthdr.len - m->m_len),
+		"m=%p M_TRAILINGSPACE(m)=%zd m->m_pkthdr.len=%d"
+		" m->m_len=%d",
+		m, M_TRAILINGSPACE(m), m->m_pkthdr.len, m->m_len);
 		m_copydata(m->m_next, 0, m->m_pkthdr.len - m->m_len,
 			mtod(m, char *) + m->m_len);
 		m->m_len = m->m_pkthdr.len;
@@ -1814,11 +1832,12 @@ m_align(struct mbuf *m, int len)
 	int buflen, adjust;
 
 	KASSERT(len != M_COPYALL);
-	KASSERT(M_LEADINGSPACE(m) == 0);
+	KASSERTMSG(M_LEADINGSPACE(m) == 0, "m=%p M_LEADINGSPACE(m)=%zd",
+	m, M_LEADINGSPACE(m));
 
 	buflen = M_BUFSIZE(m);
 
-	KASSERT(len <= buflen);
+	KASSERTMSG(len <= buflen, "m=%p len=%d buflen=%d", m, len, buflen);
 	adjust = buflen - len;
 	m->m_data += adjust &~ (sizeof(long)-1);
 }



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:47:52 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #881):

sys/arch/x86/x86/bus_dma.c: revision 1.90

x86/bus_dma.c: Sprinkle KASSERTMSG.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.4.1 src/sys/arch/x86/x86/bus_dma.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/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.89 src/sys/arch/x86/x86/bus_dma.c:1.89.4.1
--- src/sys/arch/x86/x86/bus_dma.c:1.89	Sat Aug 20 23:48:51 2022
+++ src/sys/arch/x86/x86/bus_dma.c	Fri Sep 20 10:47:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.89 2022/08/20 23:48:51 riastradh Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.89.4.1 2024/09/20 10:47:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.89 2022/08/20 23:48:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.89.4.1 2024/09/20 10:47:52 martin Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -207,7 +207,8 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t,
 	/* Always round the size. */
 	size = round_page(size);
 
-	KASSERT(boundary >= PAGE_SIZE || boundary == 0);
+	KASSERTMSG(boundary >= PAGE_SIZE || boundary == 0,
+	"boundary=0x%"PRIxBUSSIZE, boundary);
 
 	/*
 	 * Allocate pages from the VM system.
@@ -389,7 +390,9 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	 */
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"maxsegsz=0x%"PRIxBUSSIZE", maxmaxsegsz=0x%"PRIxBUSSIZE,
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 	if (buflen > map->_dm_size)
 		return EINVAL;
@@ -517,9 +520,12 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 	 */
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"maxsegsz=0x%"PRIxBUSSIZE", maxmaxsegsz=0x%"PRIxBUSSIZE,
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
-	KASSERT(m0->m_flags & M_PKTHDR);
+	KASSERTMSG(m0->m_flags & M_PKTHDR, "m0=%p m_flags=0x%x", m0,
+	m0->m_flags);
 	if (m0->m_pkthdr.len > map->_dm_size)
 		return (EINVAL);
 
@@ -545,9 +551,15 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 			break;
 
 		case M_EXT|M_EXT_PAGES:
-			KASSERT(m->m_ext.ext_buf <= m->m_data);
-			KASSERT(m->m_data <=
-			m->m_ext.ext_buf + m->m_ext.ext_size);
+			KASSERTMSG(m->m_ext.ext_buf <= m->m_data,
+			"m=%p m_ext.ext_buf=%p m_ext.ext_size=%zu"
+			" m_data=%p",
+			m, m->m_ext.ext_buf, m->m_ext.ext_size, m->m_data);
+			KASSERTMSG((m->m_data <=
+m->m_ext.ext_buf + m->m_ext.ext_size),
+			"m=%p m_ext.ext_buf=%p m_ext.ext_size=%zu"
+			" m_data=%p",
+			m, m->m_ext.ext_buf, m->m_ext.ext_size, m->m_data);
 
 			offset = (vaddr_t)m->m_data -
 			trunc_page((vaddr_t)m->m_ext.ext_buf);
@@ -655,7 +667,9 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu
 	 */
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"maxsegsz=0x%"PRIxBUSSIZE", maxmaxsegsz=0x%"PRIxBUSSIZE,
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 	resid = uio->uio_resid;
 	iov = uio->uio_iov;
@@ -732,7 +746,9 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bu
 	 */
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"maxsegsz=0x%"PRIxBUSSIZE", maxmaxsegsz=0x%"PRIxBUSSIZE,
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 	if (size0 > map->_dm_size)
 		return EINVAL;
@@ -811,8 +827,8 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 		"bad offset 0x%"PRIxBUSADDR" >= 0x%"PRIxBUSSIZE,
 		offset, map->dm_mapsize);
 		KASSERTMSG(len <= map->dm_mapsize - offset,
-		"bad length 0x%"PRIxBUSADDR" + %"PRIxBUSSIZE
-		" > %"PRIxBUSSIZE,
+		"bad length 0x%"PRIxBUSADDR" + 0x%"PRIxBUSSIZE
+		" > 0x%"PRIxBUSSIZE,
 		offset, len, map->dm_mapsize);
 	}
 



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:47:52 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #881):

sys/arch/x86/x86/bus_dma.c: revision 1.90

x86/bus_dma.c: Sprinkle KASSERTMSG.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.4.1 src/sys/arch/x86/x86/bus_dma.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/nfs

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:29:41 UTC 2024

Modified Files:
src/sys/nfs [netbsd-10]: nfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #879):

sys/nfs/nfs_vfsops.c: revision 1.244

Avoid overflow of nfs_commitsize on machines with > 32GB RAM.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.243.10.1 src/sys/nfs/nfs_vfsops.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/nfs/nfs_vfsops.c
diff -u src/sys/nfs/nfs_vfsops.c:1.243 src/sys/nfs/nfs_vfsops.c:1.243.10.1
--- src/sys/nfs/nfs_vfsops.c:1.243	Sun Jun 13 10:25:11 2021
+++ src/sys/nfs/nfs_vfsops.c	Fri Sep 20 10:29:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vfsops.c,v 1.243 2021/06/13 10:25:11 mlelstv Exp $	*/
+/*	$NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243 2021/06/13 10:25:11 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_nfs.h"
@@ -1135,6 +1135,7 @@ nfs_start(struct mount *mp, int flags)
 void
 nfs_vfs_init(void)
 {
+	unsigned scale;
 
 	/* Initialize NFS server / client shared data. */
 	nfs_init();
@@ -1145,7 +1146,8 @@ nfs_vfs_init(void)
 	/* Initialize the iod structures */
 	nfs_iodinit();
 
-	nfs_commitsize = uvmexp.npages << (PAGE_SHIFT - 4);
+	scale = PAGE_SHIFT - 4;
+	nfs_commitsize = uimin(uvmexp.npages, INT_MAX >> scale) << scale;
 }
 
 void



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:29:41 UTC 2024

Modified Files:
src/sys/nfs [netbsd-10]: nfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #879):

sys/nfs/nfs_vfsops.c: revision 1.244

Avoid overflow of nfs_commitsize on machines with > 32GB RAM.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.243.10.1 src/sys/nfs/nfs_vfsops.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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:27:11 UTC 2024

Modified Files:
src/distrib/sets/lists/comp [netbsd-10]: mi
src/share/man/man9 [netbsd-10]: Makefile
Added Files:
src/share/man/man9 [netbsd-10]: portfeatures.9

Log Message:
Pull up following revision(s) (requested by rin in ticket #878):

distrib/sets/lists/comp/mi: revision 1.2426
share/man/man9/portfeatures.9: revision 1.1
share/man/man9/portfeatures.9: revision 1.2
share/man/man9/portfeatures.9: revision 1.3
share/man/man9/Makefile: revision 1.466

portfeatures(9): the man page for the __HAVE macros

The man page itself is a skeleton/template for now.  Please add short
descriptions and xrefs.  If the target man page doesn't yet document
relevant __HAVE macros (hi, mutex(9)), please add something there,
possibly in a .Sh IMPLEMENTATION NOTES section.
fix typos

Document __HAVE_UCAS_FULL and __HAVE_UCAS_MP.


To generate a diff of this commit:
cvs rdiff -u -r1.2425.2.6 -r1.2425.2.7 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.465.2.3 -r1.465.2.4 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.3.4.2 src/share/man/man9/portfeatures.9

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2425.2.6 src/distrib/sets/lists/comp/mi:1.2425.2.7
--- src/distrib/sets/lists/comp/mi:1.2425.2.6	Wed Jul 24 09:54:51 2024
+++ src/distrib/sets/lists/comp/mi	Fri Sep 20 10:27:10 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2425.2.6 2024/07/24 09:54:51 martin Exp $
+#	$NetBSD: mi,v 1.2425.2.7 2024/09/20 10:27:10 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -12491,6 +12491,7 @@
 ./usr/share/man/cat9/pool_sethardlimit.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_sethiwat.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/pool_setlowat.0		comp-sys-catman		.cat
+./usr/share/man/cat9/portfeatures.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/postsig.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/powerhook_disestablish.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/powerhook_establish.0	comp-sys-catman		.cat
@@ -20839,6 +20840,7 @@
 ./usr/share/man/html9/pool_sethardlimit.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_sethiwat.html	comp-sys-htmlman	html
 ./usr/share/man/html9/pool_setlowat.html	comp-sys-htmlman	html
+./usr/share/man/html9/portfeatures.html		comp-sys-htmlman	html
 ./usr/share/man/html9/postsig.html		comp-sys-htmlman	html
 ./usr/share/man/html9/powerhook_disestablish.html	comp-sys-htmlman	html
 ./usr/share/man/html9/powerhook_establish.html	comp-sys-htmlman	html
@@ -29348,6 +29350,7 @@
 ./usr/share/man/man9/pool_sethardlimit.9	comp-sys-man		.man
 ./usr/share/man/man9/pool_sethiwat.9		comp-sys-man		.man
 ./usr/share/man/man9/pool_setlowat.9		comp-sys-man		.man
+./usr/share/man/man9/portfeatures.9		comp-sys-man		.man
 ./usr/share/man/man9/postsig.9			comp-sys-man		.man
 ./usr/share/man/man9/powerhook_disestablish.9	comp-sys-man		.man
 ./usr/share/man/man9/powerhook_establish.9	comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.465.2.3 src/share/man/man9/Makefile:1.465.2.4
--- src/share/man/man9/Makefile:1.465.2.3	Wed Jul 24 09:54:51 2024
+++ src/share/man/man9/Makefile	Fri Sep 20 10:27:11 2024
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.465.2.3 2024/07/24 09:54:51 martin Exp $
+#   $NetBSD: Makefile,v 1.465.2.4 2024/09/20 10:27:11 martin Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -44,8 +44,8 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	panic.9 pathbuf.9 pci.9 pci_configure_bus.9 pci_intr.9 \
 	pci_msi.9 pckbport.9 pcmcia.9 pcq.9 pcu.9 \
 	percpu.9 pfil.9 physio.9 pktqueue.9 pmap.9 pmatch.9 pmf.9 pool.9 \
-	pool_cache.9 powerhook_establish.9 ppsratecheck.9 preempt.9 \
-	proc_find.9 pserialize.9 pslist.9 psref.9 putter.9 \
+	pool_cache.9 portfeatures.9 powerhook_establish.9 ppsratecheck.9 \
+	preempt.9 proc_find.9 pserialize.9 pslist.9 psref.9 putter.9 \
 	radio.9 ras.9 rasops.9 ratecheck.9 resettodr.9 rnd.9 \
 	roundup.9 rssadapt.9 rt_timer.9 rwlock.9 RUN_ONCE.9 STACK.9 \
 	scanc.9 \

Added files:

Index: src/share/man/man9/portfeatures.9
diff -u /dev/null src/share/man/man9/portfeatures.9:1.3.4.2
--- /dev/null	Fri Sep 20 10:27:11 2024
+++ src/share/man/man9/portfeatures.9	Fri Sep 20 10:27:11 2024
@@ -0,0 +1,92 @@
+.\"	$NetBSD: portfeatures.9,v 1.3.4.2 2024/09/20 10:27:11 martin Exp $
+.\"
+.\" Copyright (c) The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions a

CVS commit: [netbsd-10] src

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:27:11 UTC 2024

Modified Files:
src/distrib/sets/lists/comp [netbsd-10]: mi
src/share/man/man9 [netbsd-10]: Makefile
Added Files:
src/share/man/man9 [netbsd-10]: portfeatures.9

Log Message:
Pull up following revision(s) (requested by rin in ticket #878):

distrib/sets/lists/comp/mi: revision 1.2426
share/man/man9/portfeatures.9: revision 1.1
share/man/man9/portfeatures.9: revision 1.2
share/man/man9/portfeatures.9: revision 1.3
share/man/man9/Makefile: revision 1.466

portfeatures(9): the man page for the __HAVE macros

The man page itself is a skeleton/template for now.  Please add short
descriptions and xrefs.  If the target man page doesn't yet document
relevant __HAVE macros (hi, mutex(9)), please add something there,
possibly in a .Sh IMPLEMENTATION NOTES section.
fix typos

Document __HAVE_UCAS_FULL and __HAVE_UCAS_MP.


To generate a diff of this commit:
cvs rdiff -u -r1.2425.2.6 -r1.2425.2.7 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.465.2.3 -r1.465.2.4 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.3.4.2 src/share/man/man9/portfeatures.9

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/usb

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:20:56 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #877):

sys/dev/usb/ucom.c: revision 1.138

ucom(4): Simplify logic fixing PR kern/57259.
cv_timedwait only ever returns 0 or EWOULDBLOCK, so this would always
return ERESTART anyway.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.134.2.2 -r1.134.2.3 src/sys/dev/usb/ucom.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/usb/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.134.2.2 src/sys/dev/usb/ucom.c:1.134.2.3
--- src/sys/dev/usb/ucom.c:1.134.2.2	Tue Mar  7 19:52:01 2023
+++ src/sys/dev/usb/ucom.c	Fri Sep 20 10:20:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $	*/
+/*	$NetBSD: ucom.c,v 1.134.2.3 2024/09/20 10:20:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.3 2024/09/20 10:20:56 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -552,14 +552,10 @@ ucomopen(dev_t dev, int flag, int mode, 
 			ms = MIN(INT_MAX - 1000, delta.tv_sec*1000);
 			ms += howmany(delta.tv_usec, 1000);
 			ticks = MAX(1, MIN(INT_MAX, mstohz(ms)));
-			error = cv_timedwait(&sc->sc_statecv, &sc->sc_lock,
+			(void)cv_timedwait(&sc->sc_statecv, &sc->sc_lock,
 			ticks);
 			mutex_exit(&sc->sc_lock);
-			/* The successful passage of time is not an error. */
-			if (error == EWOULDBLOCK) {
-error = 0;
-			}
-			return error ? error : ERESTART;
+			return ERESTART;
 		}
 		timerclear(&sc->sc_hup_time);
 	}



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:20:56 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #877):

sys/dev/usb/ucom.c: revision 1.138

ucom(4): Simplify logic fixing PR kern/57259.
cv_timedwait only ever returns 0 or EWOULDBLOCK, so this would always
return ERESTART anyway.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.134.2.2 -r1.134.2.3 src/sys/dev/usb/ucom.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/amd64/amd64

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:17:22 UTC 2024

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-10]: amd64_trap.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #876):

sys/arch/amd64/amd64/amd64_trap.S: revision 1.55

amd64_trap.S: Annotate trap vectors with their mnemonics.

Derived from Intel and AMD manuals.
Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3
(3A, 3B, 3C, & 3D: System Programming Guide, Order Number:
325384-077US, April 2022.
https://cdrdv2.intel.com/v1/dl/getContent/671447

AMD64 Technology: AMD64 Architecture Programmers' Manual, Volume 2:
System Programming, Publication No. 24953, Revision 3.40, January 2023.
https://www.amd.com/system/files/TechDocs/24593.pdf

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.4.1 src/sys/arch/amd64/amd64/amd64_trap.S

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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.54 src/sys/arch/amd64/amd64/amd64_trap.S:1.54.4.1
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.54	Wed Sep  7 00:40:18 2022
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Fri Sep 20 10:17:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.54 2022/09/07 00:40:18 knakahara Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.54.4.1 2024/09/20 10:17:22 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -159,7 +159,7 @@
 
 	TEXT_USER_BEGIN
 
-IDTVEC(trap00)
+IDTVEC(trap00)		/* #DE - Divide-by-zero error */
 	ZTRAP(T_DIVIDE)
 IDTVEC_END(trap00)
 
@@ -178,7 +178,7 @@ IDTVEC_END(trap00)
  * not a problem, because in this particular case, the frame is known not
  * to contain secrets.
  */
-IDTVEC(trap01)
+IDTVEC(trap01)		/* #DB - Debug */
 #ifndef XENPV
 	subq	$(TF_REGSIZE+16),%rsp
 
@@ -247,7 +247,7 @@ IDTVEC_END(trap01)
  * We need to be careful about %gs too, because it is possible that we were
  * running in kernel mode with a userland %gs.
  */
-IDTVEC(trap02)
+IDTVEC(trap02)		/* NMI - Non-maskable interrupt */
 #if defined(XENPV)
 	ZTRAP(T_NMI)
 #else /* XENPV */
@@ -302,7 +302,7 @@ IDTVEC(trap02)
 #endif /* XENPV */
 IDTVEC_END(trap02)
 
-IDTVEC(trap03)
+IDTVEC(trap03)		/* #BP - Breakpoint */
 #ifndef KDTRACE_HOOKS
 	ZTRAP(T_BPTFLT)
 #else
@@ -331,19 +331,19 @@ IDTVEC(trap03)
 #endif
 IDTVEC_END(trap03)
 
-IDTVEC(trap04)
+IDTVEC(trap04)		/* #OF - Overflow */
 	ZTRAP(T_OFLOW)
 IDTVEC_END(trap04)
 
-IDTVEC(trap05)
+IDTVEC(trap05)		/* #BR - BOUND range exceeded */
 	ZTRAP(T_BOUND)
 IDTVEC_END(trap05)
 
-IDTVEC(trap06)
+IDTVEC(trap06)		/* #UD - Invalid opcode */
 	ZTRAP(T_PRIVINFLT)
 IDTVEC_END(trap06)
 
-IDTVEC(trap07)
+IDTVEC(trap07)		/* #NM - Device not available (x87) */
 	ZTRAP_NJ(T_DNA)
 	INTRENTRY
 #ifdef DIAGNOSTIC
@@ -358,7 +358,7 @@ IDTVEC_END(trap07)
  * Double faults execute on a particular stack, and we must not jump out
  * of it. So don't enable interrupts.
  */
-IDTVEC(trap08)
+IDTVEC(trap08)		/* #DF - Double fault */
 #if defined(XENPV)
 	TRAP(T_DOUBLEFLT)
 #else /* XENPV */
@@ -399,11 +399,11 @@ IDTVEC(trap08)
 #endif /* XENPV */
 IDTVEC_END(trap08)
 
-IDTVEC(trap09)
+IDTVEC(trap09)		/* Coprocessor segment overrun (legacy x87) */
 	ZTRAP(T_FPOPFLT)
 IDTVEC_END(trap09)
 
-IDTVEC(trap10)
+IDTVEC(trap10)		/* #TS - Invalid TSS */
 	TRAP(T_TSSFLT)
 IDTVEC_END(trap10)
 
@@ -416,26 +416,26 @@ IDTVEC_END(trap10)
 #define kernuser_reenter alltraps
 #endif /* XENPV */
 
-IDTVEC(trap11)		/* #NP() Segment not present */
+IDTVEC(trap11)		/* #NP - Segment not present */
 	TRAP_NJ(T_SEGNPFLT)
 	jmp	kernuser_reenter
 IDTVEC_END(trap11)
 
-IDTVEC(trap12)		/* #SS() Stack exception */
+IDTVEC(trap12)		/* #SS - Stack fault */
 	TRAP_NJ(T_STKFLT)
 	jmp	kernuser_reenter
 IDTVEC_END(trap12)
 
-IDTVEC(trap13)		/* #GP() General protection */
+IDTVEC(trap13)		/* #GP - General protection */
 	TRAP_NJ(T_PROTFLT)
 	jmp	kernuser_reenter
 IDTVEC_END(trap13)
 
-IDTVEC(trap14)
+IDTVEC(trap14)		/* #PF - Page fault */
 	TRAP(T_PAGEFLT)
 IDTVEC_END(trap14)
 
-IDTVEC(trap15)
+IDTVEC(trap15)		/* XXX ??? */
 	ZTRAP_NJ(T_ASTFLT)
 	INTRENTRY
 #ifdef DIAGNOSTIC
@@ -444,7 +444,7 @@ IDTVEC(trap15)
 	jmp	.Lalltraps_checkusr
 IDTVEC_END(trap15)
 
-IDTVEC(trap16)
+IDTVEC(trap16)		/* #MF - x87 floating-point exception */
 	ZTRAP_NJ(T_ARITHTRAP)
 .Ldo_fputrap:
 	INTRENTRY
@@ -464,30 +464,30 @@ IDTVEC(trap16)
 	jmp	.Lalltraps_checkusr
 IDTVEC_END(trap16)
 
-IDTVEC(trap17)
+IDTVEC(trap17)		/* #AC - Alignment check */
 	TRAP(T_ALIGNFLT)
 IDTVEC_END(trap17)
 
-IDTVEC(trap18)
+IDTVEC(trap18)		/* #MC - Machine check */
 	ZTRAP(T_MCA)
 IDTVEC_END(trap18)
 
-IDTVEC(trap19)
+IDTVEC(trap19)		/* #XM - SIMD floating-point exception */
 	ZTRAP_NJ(T_XMM)
 	jmp	.Ldo_fputrap
 IDTVEC_END(trap19)
 
-IDTVEC(trap20)
-IDTVEC(trap21)
+IDTVEC(trap20)		/* #VE - Virtualization (Intel) */
+IDTVEC(trap21)		/*

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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:17:22 UTC 2024

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-10]: amd64_trap.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #876):

sys/arch/amd64/amd64/amd64_trap.S: revision 1.55

amd64_trap.S: Annotate trap vectors with their mnemonics.

Derived from Intel and AMD manuals.
Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3
(3A, 3B, 3C, & 3D: System Programming Guide, Order Number:
325384-077US, April 2022.
https://cdrdv2.intel.com/v1/dl/getContent/671447

AMD64 Technology: AMD64 Architecture Programmers' Manual, Volume 2:
System Programming, Publication No. 24953, Revision 3.40, January 2023.
https://www.amd.com/system/files/TechDocs/24593.pdf

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.4.1 src/sys/arch/amd64/amd64/amd64_trap.S

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/i386/i386

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:00:14 UTC 2024

Modified Files:
src/sys/arch/i386/i386 [netbsd-10]: bioscall.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #875):

sys/arch/i386/i386/bioscall.S: revision 1.11

i386/bioscall: Disable preemption while we load the kernel pmap.

Fixes crash on boot in new KASSERT(kpreempt_disabled()) in
cpu_load_pmap.

We could do KASSERT(kpreempt_disabled() || cold), but I don't know if
bioscall is ever reachable after warm boot; this way is safer.

XXX Would be nice if bioscall were a C function, not asm -- I don't
see any reason why we need it to be asm?


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.30.1 src/sys/arch/i386/i386/bioscall.S

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/i386/i386/bioscall.S
diff -u src/sys/arch/i386/i386/bioscall.S:1.10 src/sys/arch/i386/i386/bioscall.S:1.10.30.1
--- src/sys/arch/i386/i386/bioscall.S:1.10	Sat Jul 14 14:29:40 2018
+++ src/sys/arch/i386/i386/bioscall.S	Fri Sep 20 10:00:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bioscall.S,v 1.10 2018/07/14 14:29:40 maxv Exp $ */
+/*	$NetBSD: bioscall.S,v 1.10.30.1 2024/09/20 10:00:14 martin Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bioscall.S,v 1.10 2018/07/14 14:29:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bioscall.S,v 1.10.30.1 2024/09/20 10:00:14 martin Exp $");
 
 #include 
 
@@ -67,6 +67,8 @@ ENTRY(bioscall)
 	pushl	%ebp
 	movl	%esp,%ebp		/* set up frame ptr */
 
+	call	_C_LABEL(kpreempt_disable)
+
 	/* install lwp0 pmap */
 	movl	_C_LABEL(kernel_pmap_ptr),%eax
 	pushl	%eax
@@ -85,5 +87,7 @@ ENTRY(bioscall)
 	call	_C_LABEL(cpu_load_pmap)
 	addl	$4,%esp
 
+	call	_C_LABEL(kpreempt_enable)
+
 	leave
 	ret



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 10:00:14 UTC 2024

Modified Files:
src/sys/arch/i386/i386 [netbsd-10]: bioscall.S

Log Message:
Pull up following revision(s) (requested by rin in ticket #875):

sys/arch/i386/i386/bioscall.S: revision 1.11

i386/bioscall: Disable preemption while we load the kernel pmap.

Fixes crash on boot in new KASSERT(kpreempt_disabled()) in
cpu_load_pmap.

We could do KASSERT(kpreempt_disabled() || cold), but I don't know if
bioscall is ever reachable after warm boot; this way is safer.

XXX Would be nice if bioscall were a C function, not asm -- I don't
see any reason why we need it to be asm?


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.30.1 src/sys/arch/i386/i386/bioscall.S

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/sparc64/sparc64

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:58:19 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-10]: lock_stubs.s

Log Message:
Pull up following revision(s) (requested by rin in ticket #874):

sys/arch/sparc64/sparc64/lock_stubs.s: revision 1.12

sparc64: Add missing LoadStore ordering for mutex_enter stub.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/sparc64/sparc64/lock_stubs.s

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/sparc64/sparc64

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:58:19 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-10]: lock_stubs.s

Log Message:
Pull up following revision(s) (requested by rin in ticket #874):

sys/arch/sparc64/sparc64/lock_stubs.s: revision 1.12

sparc64: Add missing LoadStore ordering for mutex_enter stub.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/sparc64/sparc64/lock_stubs.s

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/sparc64/sparc64/lock_stubs.s
diff -u src/sys/arch/sparc64/sparc64/lock_stubs.s:1.11 src/sys/arch/sparc64/sparc64/lock_stubs.s:1.11.4.1
--- src/sys/arch/sparc64/sparc64/lock_stubs.s:1.11	Wed Apr  6 22:47:57 2022
+++ src/sys/arch/sparc64/sparc64/lock_stubs.s	Fri Sep 20 09:58:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.11 2022/04/06 22:47:57 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.11.4.1 2024/09/20 09:58:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 #define	CURLWP	(CPUINFO_VA+CI_CURLWP)
 
 #if defined(MULTIPROCESSOR)
-#define	MB_READ	membar #LoadLoad
+#define	MB_READ	membar #LoadLoad | #LoadStore
 #define	MB_MEM	membar #LoadStore | #StoreStore
 #else
 #define	MB_READ	/* nothing */



CVS commit: [netbsd-10] src/sys/fs/union

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:51:40 UTC 2024

Modified Files:
src/sys/fs/union [netbsd-10]: union_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #873):

sys/fs/union/union_vfsops.c: revision 1.87

When mounting a union file system set its lower mount only on success.


To generate a diff of this commit:
cvs rdiff -u -r1.85.2.1 -r1.85.2.2 src/sys/fs/union/union_vfsops.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/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.85.2.1 src/sys/fs/union/union_vfsops.c:1.85.2.2
--- src/sys/fs/union/union_vfsops.c:1.85.2.1	Mon Feb  6 16:57:24 2023
+++ src/sys/fs/union/union_vfsops.c	Fri Sep 20 09:51:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.85.2.1 2023/02/06 16:57:24 martin Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.85.2.2 2024/09/20 09:51:40 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.85.2.1 2023/02/06 16:57:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.85.2.2 2024/09/20 09:51:40 martin Exp $");
 
 #include 
 #include 
@@ -255,15 +255,16 @@ union_mount(struct mount *mp, const char
 
 	mp->mnt_data = um;
 	vfs_getnewfsid(mp);
-	error = vfs_set_lowermount(mp, um->um_uppervp->v_mount);
-	if (error)
-		goto bad;
 
 	error = set_statvfs_info(path, UIO_USERSPACE, NULL, UIO_USERSPACE,
 	mp->mnt_op->vfs_name, mp, l);
 	if (error)
 		goto bad;
 
+	error = vfs_set_lowermount(mp, um->um_uppervp->v_mount);
+	if (error)
+		goto bad;
+
 	switch (um->um_op) {
 	case UNMNT_ABOVE:
 		cp = ":";



CVS commit: [netbsd-10] src/sys/fs/union

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:51:40 UTC 2024

Modified Files:
src/sys/fs/union [netbsd-10]: union_vfsops.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #873):

sys/fs/union/union_vfsops.c: revision 1.87

When mounting a union file system set its lower mount only on success.


To generate a diff of this commit:
cvs rdiff -u -r1.85.2.1 -r1.85.2.2 src/sys/fs/union/union_vfsops.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/external/cddl/osnet/dist/uts/common/fs/zfs

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:49:49 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-10]:
zfs_ctldir.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #872):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c: revision 1.15

provide pathconf for .zfs control directory. avoids errors on
ls -l ../.zfs.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.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/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.14 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.14.2.1
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.14	Fri Nov  4 11:20:39 2022
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c	Fri Sep 20 09:49:49 2024
@@ -1842,6 +1842,7 @@ const struct vnodeopv_entry_desc zfs_sfs
 	{ &vop_putpages_desc,		genfs_null_putpages },
 	{ &vop_islocked_desc,		genfs_islocked },
 	{ &vop_print_desc,		sfs_print },
+	{ &vop_pathconf_desc,		genfs_pathconf },
 	{ NULL, NULL }
 };
 



CVS commit: [netbsd-10] src/external/cddl/osnet/dist/uts/common/fs/zfs

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:49:49 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-10]:
zfs_ctldir.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #872):

external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c: revision 1.15

provide pathconf for .zfs control directory. avoids errors on
ls -l ../.zfs.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.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/kern

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:46:54 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: subr_pool.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #871):

sys/kern/subr_pool.c: revision 1.286

Avoid undefined behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.285 -r1.285.4.1 src/sys/kern/subr_pool.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/kern

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:46:54 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: subr_pool.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #871):

sys/kern/subr_pool.c: revision 1.286

Avoid undefined behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.285 -r1.285.4.1 src/sys/kern/subr_pool.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/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.285 src/sys/kern/subr_pool.c:1.285.4.1
--- src/sys/kern/subr_pool.c:1.285	Sat Jul 16 10:20:21 2022
+++ src/sys/kern/subr_pool.c	Fri Sep 20 09:46:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.285 2022/07/16 10:20:21 simonb Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.285.4.1 2024/09/20 09:46:54 martin Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018,
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.285 2022/07/16 10:20:21 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.285.4.1 2024/09/20 09:46:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -3317,7 +3317,7 @@ pool_allocated(struct pool *pp, struct p
 		unsigned int idx = pr_item_bitmap_index(pp, ph, (void *)addr);
 		pool_item_bitmap_t *bitmap =
 		ph->ph_bitmap + (idx / BITMAP_SIZE);
-		pool_item_bitmap_t mask = 1 << (idx & BITMAP_MASK);
+		pool_item_bitmap_t mask = 1U << (idx & BITMAP_MASK);
 
 		return (*bitmap & mask) == 0;
 	} else {



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:36:13 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: kern_sysctl.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #870):

sys/kern/kern_sysctl.c: revision 1.267
sys/kern/kern_sysctl.c: revision 1.268

Trailing whitespace

Fix SYSCTL_DEBUG_CREATE for non-x86 by using copyin


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.266.20.1 src/sys/kern/kern_sysctl.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/kern_sysctl.c
diff -u src/sys/kern/kern_sysctl.c:1.266 src/sys/kern/kern_sysctl.c:1.266.20.1
--- src/sys/kern/kern_sysctl.c:1.266	Thu Aug 27 14:11:57 2020
+++ src/sys/kern/kern_sysctl.c	Fri Sep 20 09:36:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sysctl.c,v 1.266 2020/08/27 14:11:57 riastradh Exp $	*/
+/*	$NetBSD: kern_sysctl.c,v 1.266.20.1 2024/09/20 09:36:13 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #define __COMPAT_SYSCTL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.266 2020/08/27 14:11:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.266.20.1 2024/09/20 09:36:13 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_defcorename.h"
@@ -203,7 +203,7 @@ sysctl_copyout(struct lwp *l, const void
 	} else {
 		error = kcopy(kaddr, uaddr, len);
 	}
-	
+
 	return error;
 }
 
@@ -1228,9 +1228,16 @@ int
 sysctl_create(SYSCTLFN_ARGS)
 {
 	const struct sysctlnode *node;
-	int k, rc, ni, nl = namelen + (name - oname);
+	int k, v, rc, ni, nl = namelen + (name - oname);
+	struct sysctlnode nnode;
+
+	if (newp == NULL)
+		return EINVAL;
+	int error = sysctl_cvt_in(l, &v, newp, newlen, &nnode);
+	if (error)
+		return error;
 
-	node = newp;
+	node = &nnode;
 
 	printf("namelen %d (", nl);
 	for (ni = 0; ni < nl - 1; ni++)
@@ -2147,7 +2154,7 @@ sysctl_createv(struct sysctllog **log, i
 /*
  * allow first caller to *set* a
  * description actually to set it
- * 
+ *
  * discard const here so we can attach
  * the description
  */



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:36:13 UTC 2024

Modified Files:
src/sys/kern [netbsd-10]: kern_sysctl.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #870):

sys/kern/kern_sysctl.c: revision 1.267
sys/kern/kern_sysctl.c: revision 1.268

Trailing whitespace

Fix SYSCTL_DEBUG_CREATE for non-x86 by using copyin


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.266.20.1 src/sys/kern/kern_sysctl.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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:33:48 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-10]: cpu.c
src/usr.sbin/cpuctl/arch [netbsd-10]: aarch64.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #869):

usr.sbin/cpuctl/arch/aarch64.c: revision 1.22
sys/arch/aarch64/aarch64/cpu.c: revision 1.73

Remove useless/harmful casts in debug messages. MPIDR AFF3 would not
be printed before.

MPIDR is 64bits. Without this AFF3 would always be zero.
Spotted by Cyprien.


To generate a diff of this commit:
cvs rdiff -u -r1.70.4.1 -r1.70.4.2 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.21 -r1.21.2.1 src/usr.sbin/cpuctl/arch/aarch64.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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:33:48 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-10]: cpu.c
src/usr.sbin/cpuctl/arch [netbsd-10]: aarch64.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #869):

usr.sbin/cpuctl/arch/aarch64.c: revision 1.22
sys/arch/aarch64/aarch64/cpu.c: revision 1.73

Remove useless/harmful casts in debug messages. MPIDR AFF3 would not
be printed before.

MPIDR is 64bits. Without this AFF3 would always be zero.
Spotted by Cyprien.


To generate a diff of this commit:
cvs rdiff -u -r1.70.4.1 -r1.70.4.2 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.21 -r1.21.2.1 src/usr.sbin/cpuctl/arch/aarch64.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.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.70.4.1 src/sys/arch/aarch64/aarch64/cpu.c:1.70.4.2
--- src/sys/arch/aarch64/aarch64/cpu.c:1.70.4.1	Fri Dec 23 08:09:48 2022
+++ src/sys/arch/aarch64/aarch64/cpu.c	Fri Sep 20 09:33:48 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.70.4.1 2022/12/23 08:09:48 martin Exp $ */
+/* $NetBSD: cpu.c,v 1.70.4.2 2024/09/20 09:33:48 martin Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.70.4.1 2022/12/23 08:09:48 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.70.4.2 2024/09/20 09:33:48 martin Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -329,8 +329,8 @@ cpu_identify2(device_t self, struct cpu_
 {
 	struct aarch64_sysctl_cpu_id * const id = &ci->ci_id;
 
-	aprint_debug_dev(self, "midr=0x%" PRIx32 " mpidr=0x%" PRIx32 "\n",
-	(uint32_t)id->ac_midr, (uint32_t)id->ac_mpidr);
+	aprint_debug_dev(self, "midr=0x%" PRIx64 " mpidr=0x%" PRIx64 "\n",
+	id->ac_midr, id->ac_mpidr);
 	aprint_verbose_dev(self, "revID=0x%" PRIx64, id->ac_revidr);
 
 	/* ID_AA64DFR0_EL1 */

Index: src/usr.sbin/cpuctl/arch/aarch64.c
diff -u src/usr.sbin/cpuctl/arch/aarch64.c:1.21 src/usr.sbin/cpuctl/arch/aarch64.c:1.21.2.1
--- src/usr.sbin/cpuctl/arch/aarch64.c:1.21	Sat Apr 30 14:06:10 2022
+++ src/usr.sbin/cpuctl/arch/aarch64.c	Fri Sep 20 09:33:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarch64.c,v 1.21 2022/04/30 14:06:10 ryo Exp $	*/
+/*	$NetBSD: aarch64.c,v 1.21.2.1 2024/09/20 09:33:48 martin Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -29,7 +29,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: aarch64.c,v 1.21 2022/04/30 14:06:10 ryo Exp $");
+__RCSID("$NetBSD: aarch64.c,v 1.21.2.1 2024/09/20 09:33:48 martin Exp $");
 #endif /* no lint */
 
 #include 
@@ -1073,7 +1073,7 @@ identify_revidr(const char *cpuname, uin
 
 /* MPIDR_EL1 - Multiprocessor Affinity Register */
 static void
-identify_mpidr(const char *cpuname, uint32_t mpidr)
+identify_mpidr(const char *cpuname, uint64_t mpidr)
 {
 	const char *setname = "multiprocessor affinity";
 



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:30:52 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-10]: db_trace.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #883):

sys/arch/sparc64/sparc64/db_trace.c: revision 1.56
sys/arch/sparc64/sparc64/db_trace.c: revision 1.57

sparc64/db_trace.c: Nix trailing whitespace.
No functional change intended.

sparc64/db_trace.c: Don't dereference; use db_read_bytes.

Makes crash(8) and ddb match, and avoids crashing in ddb when you
feed in a bad lwp pointer!


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.20.1 src/sys/arch/sparc64/sparc64/db_trace.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/sparc64/sparc64

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:30:52 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-10]: db_trace.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #883):

sys/arch/sparc64/sparc64/db_trace.c: revision 1.56
sys/arch/sparc64/sparc64/db_trace.c: revision 1.57

sparc64/db_trace.c: Nix trailing whitespace.
No functional change intended.

sparc64/db_trace.c: Don't dereference; use db_read_bytes.

Makes crash(8) and ddb match, and avoids crashing in ddb when you
feed in a bad lwp pointer!


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.20.1 src/sys/arch/sparc64/sparc64/db_trace.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/sparc64/sparc64/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.55 src/sys/arch/sparc64/sparc64/db_trace.c:1.55.20.1
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.55	Sun May 31 11:28:52 2020
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Fri Sep 20 09:30:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.55 2020/05/31 11:28:52 martin Exp $ */
+/*	$NetBSD: db_trace.c,v 1.55.20.1 2024/09/20 09:30:52 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.55 2020/05/31 11:28:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.55.20.1 2024/09/20 09:30:52 martin Exp $");
 
 #include 
 #include 
@@ -57,7 +57,7 @@ void db_print_window(uint64_t);
 #endif
 
 #ifdef _KERNEL
-#define	KLOAD(x)	probeget((paddr_t)(u_long)&(x), ASI_PRIMARY, sizeof(x))	
+#define	KLOAD(x)	probeget((paddr_t)(u_long)&(x), ASI_PRIMARY, sizeof(x))
 #else
 static long
 kload(db_addr_t addr)
@@ -127,12 +127,8 @@ db_stack_trace_print(db_expr_t addr, boo
 			}
 			(*pr)("lid %d ", l.l_lid);
 			pcb = lwp_getpcb(&l);
-#ifndef _KERNEL
 			db_read_bytes((db_addr_t)&pcb->pcb_sp,
 			sizeof(frame), (char *)&frame);
-#else
-			frame = (vaddr_t)pcb->pcb_sp;
-#endif
 			(*pr)("at %p\n", frame);
 		} else {
 			frame = (vaddr_t)addr;
@@ -153,12 +149,12 @@ db_stack_trace_print(db_expr_t addr, boo
 		if (frame & 1) {
 			f64 = (struct frame64 *)(frame + BIAS);
 			pc = (db_addr_t)KLOAD(f64->fr_pc);
-		
+
 			frame = KLOAD(f64->fr_fp);
 		} else {
 			f32 = (struct frame32 *)(frame);
 			pc = (db_addr_t)KLOAD(f32->fr_pc);
-		
+
 			frame = (long)KLOAD(f32->fr_fp);
 		}
 
@@ -175,13 +171,13 @@ db_stack_trace_print(db_expr_t addr, boo
 		if (!INKERNEL(frame))
 			break;
 #endif
-		
+
 		db_find_sym_and_offset(pc, &name, &offset);
 		if (name == NULL)
 			name = "?";
-		
+
 		(*pr)("%s(", name);
-		
+
 		/*
 		 * Print %i0..%i5; hope these still reflect the
 		 * actual arguments somewhat...
@@ -216,7 +212,7 @@ db_dump_window(db_expr_t addr, bool have
 
 	/* Traverse window stack */
 	for (i=0; ifr_fp;
 		else frame = (uint64_t)((struct frame32 *)(u_long)frame)->fr_fp;
 	}
@@ -226,13 +222,13 @@ db_dump_window(db_expr_t addr, bool have
 }
 #endif
 
-void 
+void
 db_print_window(uint64_t frame)
 {
 	if (frame & 1) {
 		struct frame64* f = (struct frame64*)(u_long)(frame + BIAS);
 
-		db_printf("frame64 %p locals, ins:\n", f);		
+		db_printf("frame64 %p locals, ins:\n", f);
 		if (INKERNEL(f)) {
 			db_printf("%llx %llx %llx %llx ",
   (unsigned long long)f->fr_local[0],
@@ -245,12 +241,12 @@ db_print_window(uint64_t frame)
   (unsigned long long)f->fr_local[6],
   (unsigned long long)f->fr_local[7]);
 			db_printf("%llx %llx %llx %llx ",
-  (unsigned long long)f->fr_arg[0],	
+  (unsigned long long)f->fr_arg[0],
   (unsigned long long)f->fr_arg[1],
   (unsigned long long)f->fr_arg[2],
   (unsigned long long)f->fr_arg[3]);
 			db_printf("%llx %llx %llx=sp %llx=pc:",
-  (unsigned long long)f->fr_arg[4],	
+  (unsigned long long)f->fr_arg[4],
   (unsigned long long)f->fr_arg[5],
   (unsigned long long)f->fr_fp,
   (unsigned long long)f->fr_pc);
@@ -276,7 +272,7 @@ db_print_window(uint64_t frame)
   (unsigned long long)f->fr_arg[5],
   (unsigned long long)f->fr_fp,
   (unsigned long long)f->fr_pc);
-			db_printf("\n");	 
+			db_printf("\n");
 		}
 	} else {
 		struct frame32* f = (struct frame32*)(u_long)frame;
@@ -297,14 +293,14 @@ db_print_window(uint64_t frame)
 			if (copyin(f, &fr, sizeof(fr))) return;
 			f = &fr;
 			db_printf("%8x %8x %8x %8x %8x %8x %8x %8x\n",
-  f->fr_local[0], f->fr_local[1], 
+  f->fr_local[0], f->fr_local[1],
   f->fr_local[2], f->fr_local[3],
-  f->fr_local[4], f->fr_local[5], 
+  f->fr_local[4], f->fr_local[5],
   f->fr_local[6], f->fr_local[7]);
 			db_printf("%8x %8x %8x %8x %8x %8x %8x=sp %8x=pc\n",
-  f->fr_arg[0], f->fr_arg[1], 
+  f->fr_arg[0], f->fr_arg[1],
   f->fr_arg[2], f->fr_arg[3],
-  f->fr_arg[4], f->fr_arg[5], 
+  f->fr_arg[4], f->fr_arg[5],
 	

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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:24:12 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #884):

sys/dev/md.c: revision 1.87

It is not sufficient to have a comment /* Sanity check the size. */,
also check the size is greater than zero and a multiple of DEV_BSIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/dev/md.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/md.c
diff -u src/sys/dev/md.c:1.86 src/sys/dev/md.c:1.86.4.1
--- src/sys/dev/md.c:1.86	Sat Sep 24 23:20:13 2022
+++ src/sys/dev/md.c	Fri Sep 20 09:24:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.86 2022/09/24 23:20:13 thorpej Exp $	*/
+/*	$NetBSD: md.c,v 1.86.4.1 2024/09/20 09:24:12 martin Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.86 2022/09/24 23:20:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.86.4.1 2024/09/20 09:24:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_md.h"
@@ -589,10 +589,13 @@ md_ioctl_kalloc(struct md_softc *sc, str
 	vaddr_t addr;
 	vsize_t size;
 
-	mutex_exit(&sc->sc_lock);
-
 	/* Sanity check the size. */
 	size = umd->md_size;
+	if (size < DEV_BSIZE || (size % DEV_BSIZE) != 0)
+		return EINVAL;
+
+	mutex_exit(&sc->sc_lock);
+
 	addr = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_WIRED|UVM_KMF_ZERO);
 
 	mutex_enter(&sc->sc_lock);



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

2024-09-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 20 09:24:12 UTC 2024

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

Log Message:
Pull up following revision(s) (requested by rin in ticket #884):

sys/dev/md.c: revision 1.87

It is not sufficient to have a comment /* Sanity check the size. */,
also check the size is greater than zero and a multiple of DEV_BSIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/dev/md.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/doc

2024-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 16 08:43:12 UTC 2024

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

Log Message:
Ticket #868


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 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/doc

2024-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 16 08:43:12 UTC 2024

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

Log Message:
Ticket #868


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 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.33 src/doc/CHANGES-10.1:1.1.2.34
--- src/doc/CHANGES-10.1:1.1.2.33	Sun Sep 15 10:59:35 2024
+++ src/doc/CHANGES-10.1	Mon Sep 16 08:43:12 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.33 2024/09/15 10:59:35 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.34 2024/09/16 08:43:12 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -1564,3 +1564,8 @@ sys/netinet6/frag6.c1.77
 	reproducible for us.  
 	[ozaki-r, ticket #865]
 
+sys/miscfs/procfs/procfs_vfsops.c		1.120 (patch)
+
+	procfs kernel module: define dependencies based on build options.
+	[pgoyette, ticket #868]
+



CVS commit: [netbsd-10] src/sys/miscfs/procfs

2024-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 16 08:42:20 UTC 2024

Modified Files:
src/sys/miscfs/procfs [netbsd-10]: procfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #868):

sys/miscfs/procfs/procfs_vfsops.c: revision 1.120 (via patch)

Define dependencies based on build options.


To generate a diff of this commit:
cvs rdiff -u -r1.111.4.2 -r1.111.4.3 src/sys/miscfs/procfs/procfs_vfsops.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/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.111.4.2 src/sys/miscfs/procfs/procfs_vfsops.c:1.111.4.3
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.111.4.2	Fri Sep 13 14:09:51 2024
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Mon Sep 16 08:42:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.111.4.2 2024/09/13 14:09:51 martin Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.111.4.3 2024/09/16 08:42:20 martin Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,10 +76,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.111.4.2 2024/09/13 14:09:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.111.4.3 2024/09/16 08:42:20 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
+#include "opt_sysv_ipc.h"
 #endif
 
 #include 
@@ -107,7 +108,11 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_vfsop
 
 #include 			/* for PAGE_SIZE */
 
-MODULE(MODULE_CLASS_VFS, procfs, "ptrace_common,mqueue,sysv_ipc");
+MODULE(MODULE_CLASS_VFS, procfs, "ptrace_common"
+#if defined(SYSVSHM) || defined(SYSVSEM) || defined(SYSVMSG)
+",sysv_ipc"
+#endif
+);
 
 VFS_PROTOS(procfs);
 



CVS commit: [netbsd-10] src/sys/miscfs/procfs

2024-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 16 08:42:20 UTC 2024

Modified Files:
src/sys/miscfs/procfs [netbsd-10]: procfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #868):

sys/miscfs/procfs/procfs_vfsops.c: revision 1.120 (via patch)

Define dependencies based on build options.


To generate a diff of this commit:
cvs rdiff -u -r1.111.4.2 -r1.111.4.3 src/sys/miscfs/procfs/procfs_vfsops.c

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



CVS commit: src/distrib/sets/lists/tests

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 13:57:21 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Mark new if_bridge test files as conditional on RUMP


To generate a diff of this commit:
cvs rdiff -u -r1.1337 -r1.1338 src/distrib/sets/lists/tests/mi

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



CVS commit: src/distrib/sets/lists/tests

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 13:57:21 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Mark new if_bridge test files as conditional on RUMP


To generate a diff of this commit:
cvs rdiff -u -r1.1337 -r1.1338 src/distrib/sets/lists/tests/mi

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1337 src/distrib/sets/lists/tests/mi:1.1338
--- src/distrib/sets/lists/tests/mi:1.1337	Mon Sep  9 15:06:29 2024
+++ src/distrib/sets/lists/tests/mi	Sun Sep 15 13:57:21 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1337 2024/09/09 15:06:29 riastradh Exp $
+# $NetBSD: mi,v 1.1338 2024/09/15 13:57:21 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4307,10 +4307,10 @@
 ./usr/tests/net/if_bridgetests-net-tests		compattestfile,atf
 ./usr/tests/net/if_bridge/Atffile			tests-net-tests		atf,rump
 ./usr/tests/net/if_bridge/Kyuafile			tests-net-tests		atf,rump,kyua
-./usr/tests/net/if_bridge/broadcast.pcap.uue		tests-net-tests		compattestfile,atf
+./usr/tests/net/if_bridge/broadcast.pcap.uue		tests-net-tests		compattestfile,atf,rump
 ./usr/tests/net/if_bridge/t_bridge			tests-net-tests		atf,rump
 ./usr/tests/net/if_bridge/t_rtable			tests-net-tests		atf,rump
-./usr/tests/net/if_bridge/unicast.pcap.uue		tests-net-tests		compattestfile,atf
+./usr/tests/net/if_bridge/unicast.pcap.uue		tests-net-tests		compattestfile,atf,rump
 ./usr/tests/net/if_gif	tests-net-tests		compattestfile,atf
 ./usr/tests/net/if_gif/Atffiletests-net-tests		atf,rump
 ./usr/tests/net/if_gif/Kyuafiletests-net-tests		atf,rump,kyua



CVS commit: [netbsd-10] src/lib/libintl

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 10:58:53 UTC 2024

Modified Files:
src/lib/libintl [netbsd-10]: gettext.c

Log Message:
Additionally pull up the following, requested by riastradh in ticket #842:

lib/libintl/gettext.c   1.33

Avoid undefined behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.31.8.1 -r1.31.8.2 src/lib/libintl/gettext.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/doc

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 10:59:35 UTC 2024

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

Log Message:
Ammend ticket #842 for additional pullups


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.32 -r1.1.2.33 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.32 src/doc/CHANGES-10.1:1.1.2.33
--- src/doc/CHANGES-10.1:1.1.2.32	Fri Sep 13 14:44:56 2024
+++ src/doc/CHANGES-10.1	Sun Sep 15 10:59:35 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.32 2024/09/13 14:44:56 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.33 2024/09/15 10:59:35 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -1446,7 +1446,7 @@ sys/dev/usb/ucycom.c1.57
 	content to userland.
 	[rin, ticket #841]
 
-lib/libintl/gettext.c1.32
+lib/libintl/gettext.c1.32,1.33
 
 	libintl: PR 58136: fix use after free.
 	[rin, ticket #842]



CVS commit: [netbsd-10] src/doc

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 10:59:35 UTC 2024

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

Log Message:
Ammend ticket #842 for additional pullups


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.32 -r1.1.2.33 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/lib/libintl

2024-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 10:58:53 UTC 2024

Modified Files:
src/lib/libintl [netbsd-10]: gettext.c

Log Message:
Additionally pull up the following, requested by riastradh in ticket #842:

lib/libintl/gettext.c   1.33

Avoid undefined behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.31.8.1 -r1.31.8.2 src/lib/libintl/gettext.c

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

Modified files:

Index: src/lib/libintl/gettext.c
diff -u src/lib/libintl/gettext.c:1.31.8.1 src/lib/libintl/gettext.c:1.31.8.2
--- src/lib/libintl/gettext.c:1.31.8.1	Thu Sep 12 19:41:09 2024
+++ src/lib/libintl/gettext.c	Sun Sep 15 10:58:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gettext.c,v 1.31.8.1 2024/09/12 19:41:09 martin Exp $	*/
+/*	$NetBSD: gettext.c,v 1.31.8.2 2024/09/15 10:58:53 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: gettext.c,v 1.31.8.1 2024/09/12 19:41:09 martin Exp $");
+__RCSID("$NetBSD: gettext.c,v 1.31.8.2 2024/09/15 10:58:53 martin Exp $");
 
 #include 
 #include 
@@ -174,11 +174,13 @@ pgettext_impl(const char *domainname, co
 
 	translation = dcngettext(domainname, msgctxt_id,
 		msgid2, n, category);
-	free(msgctxt_id);
 
-	if (translation == msgctxt_id)
+	if (translation == msgctxt_id) {
+		free(msgctxt_id);
 		return msgid1;
+	}
 
+	free(msgctxt_id);
 	p = strchr(translation, '\004');
 	if (p)
 		return p + 1;



CVS commit: [netbsd-9] src/doc

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:47:59 UTC 2024

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

Log Message:
Tickets #1886 and #1888


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/CHANGES-9.5

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.5
diff -u src/doc/CHANGES-9.5:1.1.2.18 src/doc/CHANGES-9.5:1.1.2.19
--- src/doc/CHANGES-9.5:1.1.2.18	Mon Sep  9 17:02:17 2024
+++ src/doc/CHANGES-9.5	Fri Sep 13 14:47:58 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.5,v 1.1.2.18 2024/09/09 17:02:17 martin Exp $
+# $NetBSD: CHANGES-9.5,v 1.1.2.19 2024/09/13 14:47:58 martin Exp $
 
 A complete list of changes from the NetBSD 9.4 release to the NetBSD 9.5
 release:
@@ -349,3 +349,14 @@ sys/external/bsd/libnv/dist/nvpair.c		1.
 	libnv(9), npf(4): PR 58652: fix NUL bounds check.
 	[riastradh, ticket #1885]
 
+sys/net/bpf.c	1.256,1.257
+sys/net/bpfdesc.h1.49,1.50
+
+	bpf(4): PR 58596: fix locking.
+	[ozaki-r, ticket #1886]
+
+sys/kern/subr_localcount.c			1.8
+
+	localcount(9): PR 58610: update per-CPU total at splhigh.
+	[riastradh, ticket #1888]
+



CVS commit: [netbsd-9] src/doc

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:47:59 UTC 2024

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

Log Message:
Tickets #1886 and #1888


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/CHANGES-9.5

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/kern

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:46:27 UTC 2024

Modified Files:
src/sys/kern [netbsd-9]: subr_localcount.c

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

sys/kern/subr_localcount.c: revision 1.8

localcount: Update per-CPU total at splhigh.
Otherwise localcount_acquire/release in interrupt context may lose
counts.

Duration spent at splhigh is very short.

PR kern/58610: localcount(9) races with interrupts


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/sys/kern/subr_localcount.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/subr_localcount.c
diff -u src/sys/kern/subr_localcount.c:1.7 src/sys/kern/subr_localcount.c:1.7.10.1
--- src/sys/kern/subr_localcount.c:1.7	Fri Nov 17 09:26:36 2017
+++ src/sys/kern/subr_localcount.c	Fri Sep 13 14:46:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_localcount.c,v 1.7 2017/11/17 09:26:36 ozaki-r Exp $	*/
+/*	$NetBSD: subr_localcount.c,v 1.7.10.1 2024/09/13 14:46:27 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.7 2017/11/17 09:26:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_localcount.c,v 1.7.10.1 2024/09/13 14:46:27 martin Exp $");
 
 #include 
 #include 
@@ -161,11 +161,14 @@ localcount_xc(void *cookie0, void *cooki
 	struct localcount *lc = cookie0;
 	kmutex_t *interlock = cookie1;
 	int64_t *localp;
+	int s;
 
 	mutex_enter(interlock);
 	localp = percpu_getref(lc->lc_percpu);
+	s = splhigh();
 	*lc->lc_totalp += *localp;
 	*localp -= *localp;		/* ie, *localp = 0; */
+	splx(s);
 	percpu_putref(lc->lc_percpu);
 	mutex_exit(interlock);
 }
@@ -180,9 +183,12 @@ static void
 localcount_adjust(struct localcount *lc, int delta)
 {
 	int64_t *localp;
+	int s;
 
 	localp = percpu_getref(lc->lc_percpu);
+	s = splhigh();
 	*localp += delta;
+	splx(s);
 	percpu_putref(lc->lc_percpu);
 }
 



CVS commit: [netbsd-9] src/sys/kern

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:46:27 UTC 2024

Modified Files:
src/sys/kern [netbsd-9]: subr_localcount.c

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

sys/kern/subr_localcount.c: revision 1.8

localcount: Update per-CPU total at splhigh.
Otherwise localcount_acquire/release in interrupt context may lose
counts.

Duration spent at splhigh is very short.

PR kern/58610: localcount(9) races with interrupts


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/sys/kern/subr_localcount.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/doc

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:44:56 UTC 2024

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

Log Message:
Tickets #855 - #860, #862, #863, #865


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 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.31 src/doc/CHANGES-10.1:1.1.2.32
--- src/doc/CHANGES-10.1:1.1.2.31	Thu Sep 12 20:23:07 2024
+++ src/doc/CHANGES-10.1	Fri Sep 13 14:44:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.1,v 1.1.2.31 2024/09/12 20:23:07 martin Exp $
+# $NetBSD: CHANGES-10.1,v 1.1.2.32 2024/09/13 14:44:56 martin Exp $
 
 A complete list of changes from the NetBSD 10.0 release on 2024-03-28
 until the 10.1 release:
@@ -1515,3 +1515,52 @@ share/misc/dot.clang-format			1.1
 	Add basic clang-format configuration file for NetBSD sources.
 	[rin, ticket #854]
 
+lib/libcurses/get_wch.c1.27
+
+	curses(3): check return value for fgetc(3).
+	[rin, ticket #855]
+
+tests/lib/libc/gen/t_siginfo.c			1.54,1.55
+
+	t_siginfo: skip unsupported sigbus_adraln test for x86
+	[rin, ticket #856]
+
+sys/miscfs/procfs/procfs_vfsops.c		1.118,1.119
+sys/modules/procfs/Makefile			1.8
+
+	procfs kernel module: fix dependencies.
+	[pgoyette, ticket #857]
+
+sys/net/bpf.c	1.256,1.257
+sys/net/bpfdesc.h1.49,1.50
+
+	bpf(4): PR 58596: fix locking.
+	[ozaki-r, ticket #858]
+
+sys/netinet/if_arp.c1.315
+tests/net/arp/t_arp.sh1.47,1.48
+
+	arp: fix cache initial state
+	[ozaki-r, ticket #859]
+
+share/man/man9/bus_dma.9			1.68
+
+	bus_dma(9): documentation improvements for sync operations.
+	[rin, ticket #860]
+
+sys/netinet/dccp_tfrc.c1.11
+
+	DCCP: fix uninitialized variables.
+	[rin, ticket #862]
+
+sys/netinet/sctp_output.c			1.34
+
+	SCTP: Handle EHOSTDOWN the same way as EHOSTUNREACH and ENETDOWN.
+	[rin, ticket #863]
+
+sys/netinet6/frag6.c1.77
+
+	Add a check for FreeBSD-SA-23:06.ipv6, although it is not
+	reproducible for us.  
+	[ozaki-r, ticket #865]
+



CVS commit: [netbsd-10] src/doc

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:44:56 UTC 2024

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

Log Message:
Tickets #855 - #860, #862, #863, #865


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 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/netinet6

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:42:16 UTC 2024

Modified Files:
src/sys/netinet6 [netbsd-10]: frag6.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #865):

sys/netinet6/frag6.c: revision 1.77

Add a check for FreeBSD-SA-23:06.ipv6, although it is not reproducible for us.
factor out code copied 3 times (and now would have been a 4th)


To generate a diff of this commit:
cvs rdiff -u -r1.76.2.1 -r1.76.2.2 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: [netbsd-10] src/sys/netinet6

2024-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 13 14:42:16 UTC 2024

Modified Files:
src/sys/netinet6 [netbsd-10]: frag6.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #865):

sys/netinet6/frag6.c: revision 1.77

Add a check for FreeBSD-SA-23:06.ipv6, although it is not reproducible for us.
factor out code copied 3 times (and now would have been a 4th)


To generate a diff of this commit:
cvs rdiff -u -r1.76.2.1 -r1.76.2.2 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.76.2.1 src/sys/netinet6/frag6.c:1.76.2.2
--- src/sys/netinet6/frag6.c:1.76.2.1	Sun Apr 28 10:07:03 2024
+++ src/sys/netinet6/frag6.c	Fri Sep 13 14:42:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.76.2.1 2024/04/28 10:07:03 martin Exp $	*/
+/*	$NetBSD: frag6.c,v 1.76.2.2 2024/09/13 14:42:16 martin 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.76.2.1 2024/04/28 10:07:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.76.2.2 2024/09/13 14:42:16 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -120,6 +120,15 @@ frag6_init(void)
 	mutex_init(&frag6_lock, MUTEX_DEFAULT, IPL_NONE);
 }
 
+static void
+frag6_dropfrag(struct ip6q *q6)
+{
+	frag6_remque(q6);
+	frag6_nfrags -= q6->ip6q_nfrag;
+	kmem_intr_free(q6, sizeof(*q6));
+	frag6_nfragpackets--;
+}
+
 /*
  * IPv6 fragment input.
  *
@@ -456,8 +465,13 @@ insert:
 	/* adjust offset to point where the original next header starts */
 	offset = ip6af->ip6af_offset - sizeof(struct ip6_frag);
 	kmem_intr_free(ip6af, sizeof(struct ip6asfrag));
+	next += offset - sizeof(struct ip6_hdr);
+	if ((u_int)next > IPV6_MAXPACKET) {
+		frag6_dropfrag(q6);
+		goto dropfrag;
+	}
 	ip6 = mtod(m, struct ip6_hdr *);
-	ip6->ip6_plen = htons(next + offset - sizeof(struct ip6_hdr));
+	ip6->ip6_plen = htons(next);
 	ip6->ip6_src = q6->ip6q_src;
 	ip6->ip6_dst = q6->ip6q_dst;
 	nxt = q6->ip6q_nxt;
@@ -472,20 +486,14 @@ insert:
 	} else {
 		/* this comes with no copy if the boundary is on cluster */
 		if ((t = m_split(m, offset, M_DONTWAIT)) == NULL) {
-			frag6_remque(q6);
-			frag6_nfrags -= q6->ip6q_nfrag;
-			kmem_intr_free(q6, sizeof(struct ip6q));
-			frag6_nfragpackets--;
+			frag6_dropfrag(q6);
 			goto dropfrag;
 		}
 		m_adj(t, sizeof(struct ip6_frag));
 		m_cat(m, t);
 	}
 
-	frag6_remque(q6);
-	frag6_nfrags -= q6->ip6q_nfrag;
-	kmem_intr_free(q6, sizeof(struct ip6q));
-	frag6_nfragpackets--;
+	frag6_dropfrag(q6);
 
 	{
 		KASSERT(m->m_flags & M_PKTHDR);
@@ -585,10 +593,7 @@ frag6_freef(struct ip6q *q6)
 		kmem_intr_free(af6, sizeof(struct ip6asfrag));
 	}
 
-	frag6_remque(q6);
-	frag6_nfrags -= q6->ip6q_nfrag;
-	kmem_intr_free(q6, sizeof(struct ip6q));
-	frag6_nfragpackets--;
+	frag6_dropfrag(q6);
 }
 
 /*



  1   2   3   4   5   6   7   8   9   10   >