CVS commit: src/sys/dev/usb

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 20:41:29 UTC 2023

Modified Files:
src/sys/dev/usb: xhci.c xhcivar.h

Log Message:
xhci(4): Avoid crash in suspend/resume/resume if first resume fails.

Rather than try to recover from this, just make new commands fail so
at least we don't deadlock.

XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/xhcivar.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.176 src/sys/dev/usb/xhci.c:1.177
--- src/sys/dev/usb/xhci.c:1.176	Fri Apr  7 09:39:48 2023
+++ src/sys/dev/usb/xhci.c	Sun Apr  9 20:41:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.176 2023/04/07 09:39:48 riastradh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.177 2023/04/09 20:41:28 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.176 2023/04/07 09:39:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.177 2023/04/09 20:41:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -700,6 +700,7 @@ xhci_suspend(device_t self, const pmf_qu
 	 */
 	mutex_enter(>sc_lock);
 	KASSERT(sc->sc_suspender == NULL);
+	KASSERT(!sc->sc_suspendresume_failed);
 	sc->sc_suspender = curlwp;
 	while (sc->sc_command_addr != 0)
 		cv_wait(>sc_cmdbusy_cv, >sc_lock);
@@ -895,11 +896,13 @@ xhci_suspend(device_t self, const pmf_qu
 out:	mutex_exit(>sc_rhlock);
 	if (!ok) {
 		/*
-		 * If suspend failed, resume command issuance.
+		 * If suspend failed, stop holding up command issuance
+		 * and make it fail instead.
 		 */
 		mutex_enter(>sc_lock);
 		KASSERT(sc->sc_suspender == curlwp);
 		sc->sc_suspender = NULL;
+		sc->sc_suspendresume_failed = true;
 		cv_broadcast(>sc_cmdbusy_cv);
 		mutex_exit(>sc_lock);
 	}
@@ -917,7 +920,18 @@ xhci_resume(device_t self, const pmf_qua
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
+	/*
+	 * If resume had previously failed, just try again.  Can't make
+	 * things worse, probably.
+	 */
+	mutex_enter(>sc_lock);
+	if (sc->sc_suspendresume_failed) {
+		KASSERT(sc->sc_suspender == NULL);
+		sc->sc_suspender = curlwp;
+		sc->sc_suspendresume_failed = false;
+	}
 	KASSERT(sc->sc_suspender);
+	mutex_exit(>sc_lock);
 
 	/*
 	 * Block roothub xfers which might touch portsc registers until
@@ -,6 +1125,7 @@ out:	/*
 	mutex_enter(>sc_lock);
 	KASSERT(sc->sc_suspender);
 	sc->sc_suspender = NULL;
+	sc->sc_suspendresume_failed = !ok;
 	cv_broadcast(>sc_cmdbusy_cv);
 	mutex_exit(>sc_lock);
 
@@ -3217,6 +3232,8 @@ xhci_do_command_locked(struct xhci_softc
 	while (sc->sc_command_addr != 0 ||
 	(sc->sc_suspender != NULL && sc->sc_suspender != curlwp))
 		cv_wait(>sc_cmdbusy_cv, >sc_lock);
+	if (sc->sc_suspendresume_failed)
+		return USBD_IOERROR;
 
 	/*
 	 * If enqueue pointer points at last of ring, it's Link TRB,

Index: src/sys/dev/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.23 src/sys/dev/usb/xhcivar.h:1.24
--- src/sys/dev/usb/xhcivar.h:1.23	Fri Apr  7 09:39:48 2023
+++ src/sys/dev/usb/xhcivar.h	Sun Apr  9 20:41:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.23 2023/04/07 09:39:48 riastradh Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.24 2023/04/09 20:41:29 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -140,6 +140,7 @@ struct xhci_softc {
 	bool sc_resultpending;
 
 	bool sc_dying;
+	bool sc_suspendresume_failed;
 	struct lwp *sc_suspender;
 
 	void (*sc_vendor_init)(struct xhci_softc *);



CVS commit: src/sys/dev/usb

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 20:41:29 UTC 2023

Modified Files:
src/sys/dev/usb: xhci.c xhcivar.h

Log Message:
xhci(4): Avoid crash in suspend/resume/resume if first resume fails.

Rather than try to recover from this, just make new commands fail so
at least we don't deadlock.

XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/xhcivar.h

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



CVS commit: src/libexec/ld.elf_so/arch/powerpc

2023-04-09 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Apr  9 17:24:48 UTC 2023

Modified Files:
src/libexec/ld.elf_so/arch/powerpc: Makefile.inc
Removed Files:
src/libexec/ld.elf_so/arch/powerpc: ld.so.script

Log Message:
ld.elf_so powerpc: remove bogus ldscript

This ldscript is not needed and actually makes things worse by putting
everything in one LOAD section, which then needs to have rwx permission.
Remove it so that we get two LOAD sections with better permissions.
Fixes PR 57323.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.4 -r0 src/libexec/ld.elf_so/arch/powerpc/ld.so.script

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

Modified files:

Index: src/libexec/ld.elf_so/arch/powerpc/Makefile.inc
diff -u src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.16 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.17
--- src/libexec/ld.elf_so/arch/powerpc/Makefile.inc:1.16	Tue Apr  3 21:10:27 2018
+++ src/libexec/ld.elf_so/arch/powerpc/Makefile.inc	Sun Apr  9 17:24:48 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.16 2018/04/03 21:10:27 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.17 2023/04/09 17:24:48 chs Exp $
 
 SRCS+=		ppc_reloc.c
 LDFLAGS+=	-Wl,-e,_rtld_start
@@ -12,5 +12,4 @@ CPPFLAGS+=	-DELFSIZE=64
 .else
 SRCS+=		rtld_start.S
 CPPFLAGS+=	-DELFSIZE=32
-LDFLAGS+=	-Wl,--script,${.CURDIR}/arch/powerpc/ld.so.script
 .endif



CVS commit: src/libexec/ld.elf_so/arch/powerpc

2023-04-09 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Apr  9 17:24:48 UTC 2023

Modified Files:
src/libexec/ld.elf_so/arch/powerpc: Makefile.inc
Removed Files:
src/libexec/ld.elf_so/arch/powerpc: ld.so.script

Log Message:
ld.elf_so powerpc: remove bogus ldscript

This ldscript is not needed and actually makes things worse by putting
everything in one LOAD section, which then needs to have rwx permission.
Remove it so that we get two LOAD sections with better permissions.
Fixes PR 57323.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.4 -r0 src/libexec/ld.elf_so/arch/powerpc/ld.so.script

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



CVS commit: src/sys/uvm

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:37:12 UTC 2023

Modified Files:
src/sys/uvm: uvm_vnode.c

Log Message:
uvm: Simplify assertion in uvn_get.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/uvm/uvm_vnode.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/uvm/uvm_vnode.c
diff -u src/sys/uvm/uvm_vnode.c:1.119 src/sys/uvm/uvm_vnode.c:1.120
--- src/sys/uvm/uvm_vnode.c:1.119	Sun Apr  9 09:00:56 2023
+++ src/sys/uvm/uvm_vnode.c	Sun Apr  9 12:37:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_vnode.c,v 1.119 2023/04/09 09:00:56 riastradh Exp $	*/
+/*	$NetBSD: uvm_vnode.c,v 1.120 2023/04/09 12:37:12 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.119 2023/04/09 09:00:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.120 2023/04/09 12:37:12 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_uvmhist.h"
@@ -189,8 +189,8 @@ uvn_get(struct uvm_object *uobj, voff_t 
 	error = VOP_GETPAGES(vp, offset, pps, npagesp, centeridx,
 			 access_type, advice, flags);
 
-	KASSERT(((flags & PGO_LOCKED) != 0 && rw_lock_held(uobj->vmobjlock)) ||
-	(flags & PGO_LOCKED) == 0);
+	if (flags & PGO_LOCKED)
+		KASSERT(rw_lock_held(uobj->vmobjlock));
 	return error;
 }
 



CVS commit: src/sys/uvm

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:37:12 UTC 2023

Modified Files:
src/sys/uvm: uvm_vnode.c

Log Message:
uvm: Simplify assertion in uvn_get.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/uvm/uvm_vnode.c

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



CVS commit: src/sys/nfs

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:33:58 UTC 2023

Modified Files:
src/sys/nfs: nfs_socket.c

Log Message:
nfs: Simplify assertion.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/nfs/nfs_socket.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_socket.c
diff -u src/sys/nfs/nfs_socket.c:1.200 src/sys/nfs/nfs_socket.c:1.201
--- src/sys/nfs/nfs_socket.c:1.200	Mon Sep  3 16:29:36 2018
+++ src/sys/nfs/nfs_socket.c	Sun Apr  9 12:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_socket.c,v 1.200 2018/09/03 16:29:36 riastradh Exp $	*/
+/*	$NetBSD: nfs_socket.c,v 1.201 2023/04/09 12:33:58 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.200 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.201 2023/04/09 12:33:58 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -1229,8 +1229,8 @@ nfs_getreq(struct nfsrv_descript *nd, st
 
 	nd->nd_md = md;
 	nd->nd_dpos = dpos;
-	KASSERT((nd->nd_cr == NULL && (nfsd->nfsd_flag & NFSD_NEEDAUTH) != 0)
-	 || (nd->nd_cr != NULL && (nfsd->nfsd_flag & NFSD_NEEDAUTH) == 0));
+	KASSERT((nd->nd_cr == NULL) ==
+	((nfsd->nfsd_flag & NFSD_NEEDAUTH) != 0));
 	return (0);
 nfsmout:
 errout:



CVS commit: src/sys/nfs

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:33:58 UTC 2023

Modified Files:
src/sys/nfs: nfs_socket.c

Log Message:
nfs: Simplify assertion.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/nfs/nfs_socket.c

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



CVS commit: src/sys/external/bsd/dwc2/dist

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:31:10 UTC 2023

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcdddma.c

Log Message:
dwc2: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.10 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.11
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.10	Tue Dec 21 09:51:22 2021
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c	Sun Apr  9 12:31:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdddma.c,v 1.10 2021/12/21 09:51:22 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdddma.c,v 1.11 2023/04/09 12:31:10 riastradh Exp $	*/
 
 /*
  * hcd_ddma.c - DesignWare HS OTG Controller descriptor DMA routines
@@ -40,7 +40,7 @@
  * This file contains the Descriptor DMA implementation for Host mode
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.10 2021/12/21 09:51:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.11 2023/04/09 12:31:10 riastradh Exp $");
 
 #include 
 #include 
@@ -99,7 +99,8 @@ static int dwc2_desc_list_alloc(struct d
 {
 	int err;
 
-	KASSERT(!cpu_intr_p() && !cpu_softintr_p());
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
 
 	qh->desc_list = NULL;
 	qh->desc_list_sz = sizeof(struct dwc2_hcd_dma_desc) *



CVS commit: src/sys/external/bsd/dwc2/dist

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:31:10 UTC 2023

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_hcdddma.c

Log Message:
dwc2: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c

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



CVS commit: src/sys/compat/linux32/arch/aarch64

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:29:26 UTC 2023

Modified Files:
src/sys/compat/linux32/arch/aarch64: linux32_exec_machdep.c

Log Message:
compat_linux32: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c

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



CVS commit: src/sys/compat/linux32/arch/aarch64

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:29:26 UTC 2023

Modified Files:
src/sys/compat/linux32/arch/aarch64: linux32_exec_machdep.c

Log Message:
compat_linux32: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c

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

Modified files:

Index: src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c
diff -u src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c:1.1 src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c:1.2
--- src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c:1.1	Thu Nov 25 03:08:04 2021
+++ src/sys/compat/linux32/arch/aarch64/linux32_exec_machdep.c	Sun Apr  9 12:29:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_exec_machdep.c,v 1.1 2021/11/25 03:08:04 ryo Exp $	*/
+/*	$NetBSD: linux32_exec_machdep.c,v 1.2 2023/04/09 12:29:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_exec_machdep.c,v 1.1 2021/11/25 03:08:04 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_exec_machdep.c,v 1.2 2023/04/09 12:29:26 riastradh Exp $");
 
 #include 
 #include 
@@ -127,7 +127,8 @@ linux32_exec_setup_stack(struct lwp *l, 
 		NEW_VMCMD2(>ep_vmcmds, vmcmd_map_zero, noaccess_size,
 		noaccess_linear_min, NULLVP, 0, VM_PROT_NONE, VMCMD_STACK);
 	}
-	KASSERT(access_size > 0 && access_size <= max_stack_size);
+	KASSERT(access_size > 0);
+	KASSERT(access_size <= max_stack_size);
 	NEW_VMCMD2(>ep_vmcmds, vmcmd_map_zero, access_size,
 	access_linear_min, NULLVP, 0, VM_PROT_READ | VM_PROT_WRITE,
 	VMCMD_STACK);



CVS commit: src/sys/miscfs/genfs

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:26:36 UTC 2023

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/miscfs/genfs/genfs_io.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/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.102 src/sys/miscfs/genfs/genfs_io.c:1.103
--- src/sys/miscfs/genfs/genfs_io.c:1.102	Fri Jan 14 21:59:50 2022
+++ src/sys/miscfs/genfs/genfs_io.c	Sun Apr  9 12:26:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.102 2022/01/14 21:59:50 riastradh Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.103 2023/04/09 12:26:36 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.102 2022/01/14 21:59:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.103 2023/04/09 12:26:36 riastradh Exp $");
 
 #include 
 #include 
@@ -184,7 +184,8 @@ startover:
 		GOP_SIZE(vp, origvsize, , GOP_SIZE_MEM);
 	}
 	KASSERT(ap->a_centeridx >= 0 || ap->a_centeridx <= orignpages);
-	KASSERT((origoffset & (PAGE_SIZE - 1)) == 0 && origoffset >= 0);
+	KASSERT((origoffset & (PAGE_SIZE - 1)) == 0);
+	KASSERT(origoffset >= 0);
 	KASSERT(orignpages > 0);
 
 	/*
@@ -890,7 +891,8 @@ genfs_do_putpages(struct vnode *vp, off_
 	UVMHIST_FUNC("genfs_putpages"); UVMHIST_CALLED(ubchist);
 
 	KASSERT(origflags & (PGO_CLEANIT|PGO_FREE|PGO_DEACTIVATE));
-	KASSERT((startoff & PAGE_MASK) == 0 && (endoff & PAGE_MASK) == 0);
+	KASSERT((startoff & PAGE_MASK) == 0);
+	KASSERT((endoff & PAGE_MASK) == 0);
 	KASSERT(startoff < endoff || endoff == 0);
 	KASSERT(rw_write_held(slock));
 



CVS commit: src/sys/miscfs/genfs

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:26:36 UTC 2023

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/miscfs/genfs/genfs_io.c

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:22:00 UTC 2023

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

Log Message:
pool(9): Tweak branch prediction in pool_cache_get_paddr assertion.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 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.289 src/sys/kern/subr_pool.c:1.290
--- src/sys/kern/subr_pool.c:1.289	Sun Apr  9 12:16:34 2023
+++ src/sys/kern/subr_pool.c	Sun Apr  9 12:21:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.289 2023/04/09 12:16:34 riastradh Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.290 2023/04/09 12:21:59 riastradh 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.289 2023/04/09 12:16:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.290 2023/04/09 12:21:59 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -2705,10 +2705,17 @@ pool_cache_get_paddr(pool_cache_t pc, in
 	int s;
 
 	KASSERT(!(flags & PR_NOWAIT) != !(flags & PR_WAITOK));
-	KASSERTMSG((!cpu_intr_p() && !cpu_softintr_p()) ||
-	(pc->pc_pool.pr_ipl != IPL_NONE || cold || panicstr != NULL),
-	"%s: [%s] is IPL_NONE, but called from interrupt context",
-	__func__, pc->pc_pool.pr_wchan);
+	if (pc->pc_pool.pr_ipl == IPL_NONE &&
+	__predict_true(!cold) &&
+	__predict_true(panicstr == NULL)) {
+		KASSERTMSG(!cpu_intr_p(),
+		"%s: [%s] is IPL_NONE, but called from interrupt context",
+		__func__, pc->pc_pool.pr_wchan);
+		KASSERTMSG(!cpu_softintr_p(),
+		"%s: [%s] is IPL_NONE,"
+		" but called from soft interrupt context",
+		__func__, pc->pc_pool.pr_wchan);
+	}
 
 	if (flags & PR_WAITOK) {
 		ASSERT_SLEEPABLE();



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:22:00 UTC 2023

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

Log Message:
pool(9): Tweak branch prediction in pool_cache_get_paddr assertion.

No functional change intended.


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

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:16:42 UTC 2023

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

Log Message:
kpause(9): Simplify assertion.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/kern/kern_synch.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_synch.c
diff -u src/sys/kern/kern_synch.c:1.353 src/sys/kern/kern_synch.c:1.354
--- src/sys/kern/kern_synch.c:1.353	Mon Dec  5 15:47:14 2022
+++ src/sys/kern/kern_synch.c	Sun Apr  9 12:16:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.353 2022/12/05 15:47:14 martin Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.354 2023/04/09 12:16:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.353 2022/12/05 15:47:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.354 2023/04/09 12:16:42 riastradh Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -233,7 +233,7 @@ kpause(const char *wmesg, bool intr, int
 	struct lwp *l = curlwp;
 	int error;
 
-	KASSERT(!(timo == 0 && intr == false));
+	KASSERT(timo != 0 || intr);
 
 	if (sleepq_dontsleep(l))
 		return sleepq_abort(NULL, 0);



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:16:42 UTC 2023

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

Log Message:
kpause(9): Simplify assertion.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/kern/kern_synch.c

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:16:34 UTC 2023

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

Log Message:
pool(9): Simplify assertion in pool_update_curpage.

Add message while here.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 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.288 src/sys/kern/subr_pool.c:1.289
--- src/sys/kern/subr_pool.c:1.288	Sun Apr  9 09:18:09 2023
+++ src/sys/kern/subr_pool.c	Sun Apr  9 12:16:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.288 2023/04/09 09:18:09 riastradh Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.289 2023/04/09 12:16:34 riastradh 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.288 2023/04/09 09:18:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.289 2023/04/09 12:16:34 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1573,8 +1573,8 @@ pool_update_curpage(struct pool *pp)
 	if (pp->pr_curpage == NULL) {
 		pp->pr_curpage = LIST_FIRST(>pr_emptypages);
 	}
-	KASSERT((pp->pr_curpage == NULL && pp->pr_nitems == 0) ||
-	(pp->pr_curpage != NULL && pp->pr_nitems > 0));
+	KASSERTMSG((pp->pr_curpage == NULL) == (pp->pr_nitems == 0),
+	"pp=%p curpage=%p nitems=%u", pp, pp->pr_curpage, pp->pr_nitems);
 }
 
 void



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 12:16:34 UTC 2023

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

Log Message:
pool(9): Simplify assertion in pool_update_curpage.

Add message while here.


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

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 09:18:10 UTC 2023

Modified Files:
src/sys/kern: exec_subr.c kern_event.c kern_lwp.c kern_proc.c
kern_sig.c kern_sleepq.c kern_softint.c kern_sysctl.c
kern_turnstile.c kern_veriexec.c subr_asan.c subr_cpufreq.c
subr_kcpuset.c subr_pcu.c subr_pool.c subr_prf.c subr_time.c
subr_vmem.c subr_xcall.c sys_sched.c tty_ptm.c vfs_cache.c
vfs_lookup.c vfs_syscalls.c

Log Message:
kern: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/exec_subr.c
cvs rdiff -u -r1.146 -r1.147 src/sys/kern/kern_event.c
cvs rdiff -u -r1.251 -r1.252 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.269 -r1.270 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.404 -r1.405 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.73 -r1.74 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/kern_softint.c
cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_sysctl.c
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_turnstile.c \
src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/subr_asan.c src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_cpufreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_kcpuset.c
cvs rdiff -u -r1.287 -r1.288 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.198 -r1.199 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/subr_time.c
cvs rdiff -u -r1.108 -r1.109 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/subr_xcall.c
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/sys_sched.c
cvs rdiff -u -r1.152 -r1.153 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.232 -r1.233 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.557 -r1.558 src/sys/kern/vfs_syscalls.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/exec_subr.c
diff -u src/sys/kern/exec_subr.c:1.84 src/sys/kern/exec_subr.c:1.85
--- src/sys/kern/exec_subr.c:1.84	Mon Apr 13 19:23:18 2020
+++ src/sys/kern/exec_subr.c	Sun Apr  9 09:18:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_subr.c,v 1.84 2020/04/13 19:23:18 ad Exp $	*/
+/*	$NetBSD: exec_subr.c,v 1.85 2023/04/09 09:18:09 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.84 2020/04/13 19:23:18 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.85 2023/04/09 09:18:09 riastradh Exp $");
 
 #include "opt_pax.h"
 
@@ -460,7 +460,8 @@ exec_setup_stack(struct lwp *l, struct e
 		NEW_VMCMD2(>ep_vmcmds, vmcmd_map_zero, noaccess_size,
 		noaccess_linear_min, NULL, 0, VM_PROT_NONE, VMCMD_STACK);
 	}
-	KASSERT(access_size > 0 && access_size <= MAXSSIZ);
+	KASSERT(access_size > 0);
+	KASSERT(access_size <= MAXSSIZ);
 	NEW_VMCMD2(>ep_vmcmds, vmcmd_map_zero, access_size,
 	access_linear_min, NULL, 0, VM_PROT_READ | VM_PROT_WRITE,
 	VMCMD_STACK);

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.146 src/sys/kern/kern_event.c:1.147
--- src/sys/kern/kern_event.c:1.146	Sun Jul 24 19:23:44 2022
+++ src/sys/kern/kern_event.c	Sun Apr  9 09:18:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.146 2022/07/24 19:23:44 riastradh Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.147 2023/04/09 09:18:09 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2021 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.146 2022/07/24 19:23:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.147 2023/04/09 09:18:09 riastradh Exp $");
 
 #include 
 #include 
@@ -1400,7 +1400,8 @@ filt_timerexpire(void *knx)
 	kn->kn_data++;
 	knote_activate_locked(kn);
 	if (kn->kn_sdata != FILT_TIMER_NOSCHED) {
-		KASSERT(kn->kn_sdata > 0 && kn->kn_sdata <= INT_MAX);
+		KASSERT(kn->kn_sdata > 0);
+		KASSERT(kn->kn_sdata <= INT_MAX);
 		callout_schedule((callout_t *)kn->kn_hook,
 		(int)kn->kn_sdata);
 	}
@@ -2448,8 +2449,8 @@ relock:
 			kn->kn_status &= ~KN_BUSY;
 			kq->kq_count--;
 			KASSERT(kn_in_flux(kn) == false);
-			KASSERT((kn->kn_status & KN_WILLDETACH) != 0 &&
-kn->kn_kevent.udata == curlwp);
+			KASSERT((kn->kn_status & KN_WILLDETACH) != 0);
+			KASSERT(kn->kn_kevent.udata == curlwp);
 			mutex_spin_exit(>kq_lock);
 			knote_detach(kn, fdp, true);
 			mutex_enter(>fd_lock);

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.251 src/sys/kern/kern_lwp.c:1.252
--- src/sys/kern/kern_lwp.c:1.251	Fri Jul  1 01:06:04 2022
+++ src/sys/kern/kern_lwp.c	Sun Apr  9 09:18:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.251 2022/07/01 01:06:04 riastradh Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.252 2023/04/09 09:18:09 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -217,7 +217,7 @@
  */
 
 #include 

CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 09:18:10 UTC 2023

Modified Files:
src/sys/kern: exec_subr.c kern_event.c kern_lwp.c kern_proc.c
kern_sig.c kern_sleepq.c kern_softint.c kern_sysctl.c
kern_turnstile.c kern_veriexec.c subr_asan.c subr_cpufreq.c
subr_kcpuset.c subr_pcu.c subr_pool.c subr_prf.c subr_time.c
subr_vmem.c subr_xcall.c sys_sched.c tty_ptm.c vfs_cache.c
vfs_lookup.c vfs_syscalls.c

Log Message:
kern: KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/exec_subr.c
cvs rdiff -u -r1.146 -r1.147 src/sys/kern/kern_event.c
cvs rdiff -u -r1.251 -r1.252 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.269 -r1.270 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.404 -r1.405 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.73 -r1.74 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/kern_softint.c
cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_sysctl.c
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_turnstile.c \
src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/subr_asan.c src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_cpufreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_kcpuset.c
cvs rdiff -u -r1.287 -r1.288 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.198 -r1.199 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/subr_time.c
cvs rdiff -u -r1.108 -r1.109 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/subr_xcall.c
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/sys_sched.c
cvs rdiff -u -r1.152 -r1.153 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.232 -r1.233 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.557 -r1.558 src/sys/kern/vfs_syscalls.c

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



CVS commit: src/sys/uvm

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 09:00:56 UTC 2023

Modified Files:
src/sys/uvm: uvm_amap.c uvm_bio.c uvm_fault.c uvm_km.c uvm_page.c
uvm_physseg.c uvm_swap.c uvm_vnode.c

Log Message:
uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/uvm/uvm_amap.c
cvs rdiff -u -r1.127 -r1.128 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.231 -r1.232 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.164 -r1.165 src/sys/uvm/uvm_km.c
cvs rdiff -u -r1.251 -r1.252 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.17 -r1.18 src/sys/uvm/uvm_physseg.c
cvs rdiff -u -r1.207 -r1.208 src/sys/uvm/uvm_swap.c
cvs rdiff -u -r1.118 -r1.119 src/sys/uvm/uvm_vnode.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/uvm/uvm_amap.c
diff -u src/sys/uvm/uvm_amap.c:1.126 src/sys/uvm/uvm_amap.c:1.127
--- src/sys/uvm/uvm_amap.c:1.126	Sat Mar 13 15:29:55 2021
+++ src/sys/uvm/uvm_amap.c	Sun Apr  9 09:00:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_amap.c,v 1.126 2021/03/13 15:29:55 skrll Exp $	*/
+/*	$NetBSD: uvm_amap.c,v 1.127 2023/04/09 09:00:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.126 2021/03/13 15:29:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.127 2023/04/09 09:00:56 riastradh Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -323,7 +323,8 @@ amap_free(struct vm_amap *amap)
 
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
 
-	KASSERT(amap->am_ref == 0 && amap->am_nused == 0);
+	KASSERT(amap->am_ref == 0);
+	KASSERT(amap->am_nused == 0);
 	KASSERT((amap->am_flags & AMAP_SWAPOFF) == 0);
 	slots = amap->am_maxslot;
 	kmem_free(amap->am_slots, slots * sizeof(*amap->am_slots));
@@ -774,7 +775,8 @@ amap_wipeout(struct vm_amap *amap)
 
 		slot = amap->am_slots[lcv];
 		anon = amap->am_anon[slot];
-		KASSERT(anon != NULL && anon->an_ref != 0);
+		KASSERT(anon != NULL);
+		KASSERT(anon->an_ref != 0);
 
 		KASSERT(anon->an_lock == amap->am_lock);
 		UVMHIST_LOG(maphist,"  processing anon %#jx, ref=%jd",
@@ -1069,7 +1071,8 @@ ReStart:
 		if (pg->loan_count != 0) {
 			continue;
 		}
-		KASSERT(pg->uanon == anon && pg->uobject == NULL);
+		KASSERT(pg->uanon == anon);
+		KASSERT(pg->uobject == NULL);
 
 		/*
 		 * If the page is busy, then we have to unlock, wait for

Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.127 src/sys/uvm/uvm_bio.c:1.128
--- src/sys/uvm/uvm_bio.c:1.127	Sun Feb 12 16:28:32 2023
+++ src/sys/uvm/uvm_bio.c	Sun Apr  9 09:00:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.127 2023/02/12 16:28:32 andvar Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.128 2023/04/09 09:00:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.127 2023/02/12 16:28:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.128 2023/04/09 09:00:56 riastradh Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -555,7 +555,9 @@ again:
 	}
 
 	if (flags & UBC_WRITE) {
-		KASSERTMSG(umap->writeoff == 0 && umap->writelen == 0,
+		KASSERTMSG(umap->writeoff == 0,
+		"ubc_alloc: concurrent writes to uobj %p", uobj);
+		KASSERTMSG(umap->writelen == 0,
 		"ubc_alloc: concurrent writes to uobj %p", uobj);
 		umap->writeoff = slot_offset;
 		umap->writelen = *lenp;

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.231 src/sys/uvm/uvm_fault.c:1.232
--- src/sys/uvm/uvm_fault.c:1.231	Wed Oct 26 23:27:32 2022
+++ src/sys/uvm/uvm_fault.c	Sun Apr  9 09:00:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.231 2022/10/26 23:27:32 riastradh Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.232 2023/04/09 09:00:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.231 2022/10/26 23:27:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.232 2023/04/09 09:00:56 riastradh Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -2670,7 +2670,8 @@ uvm_fault_unwire_locked(struct vm_map *m
 	 * find the beginning map entry for the region.
 	 */
 
-	KASSERT(start >= vm_map_min(map) && end <= vm_map_max(map));
+	KASSERT(start >= vm_map_min(map));
+	KASSERT(end <= vm_map_max(map));
 	if (uvm_map_lookup_entry(map, start, ) == false)
 		panic("uvm_fault_unwire_locked: address not in map");
 
@@ -2683,8 +2684,8 @@ uvm_fault_unwire_locked(struct vm_map *m
 
 		KASSERT(va >= entry->start);
 		while (va >= entry->end) {
-			KASSERT(entry->next != >header &&
-entry->next->start <= entry->end);
+			KASSERT(entry->next != >header);
+			KASSERT(entry->next->start <= entry->end);
 			entry = entry->next;
 		}
 

Index: src/sys/uvm/uvm_km.c
diff -u src/sys/uvm/uvm_km.c:1.164 src/sys/uvm/uvm_km.c:1.165
--- 

CVS commit: src/sys/uvm

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 09:00:56 UTC 2023

Modified Files:
src/sys/uvm: uvm_amap.c uvm_bio.c uvm_fault.c uvm_km.c uvm_page.c
uvm_physseg.c uvm_swap.c uvm_vnode.c

Log Message:
uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B)


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/uvm/uvm_amap.c
cvs rdiff -u -r1.127 -r1.128 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.231 -r1.232 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.164 -r1.165 src/sys/uvm/uvm_km.c
cvs rdiff -u -r1.251 -r1.252 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.17 -r1.18 src/sys/uvm/uvm_physseg.c
cvs rdiff -u -r1.207 -r1.208 src/sys/uvm/uvm_swap.c
cvs rdiff -u -r1.118 -r1.119 src/sys/uvm/uvm_vnode.c

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:50:20 UTC 2023

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

Log Message:
kmem(9): Tweak branch predictions in fast paths.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/subr_kmem.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_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.87 src/sys/kern/subr_kmem.c:1.88
--- src/sys/kern/subr_kmem.c:1.87	Mon May 30 23:36:26 2022
+++ src/sys/kern/subr_kmem.c	Sun Apr  9 08:50:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.87 2022/05/30 23:36:26 mrg Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.88 2023/04/09 08:50:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2009-2020 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.87 2022/05/30 23:36:26 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.88 2023/04/09 08:50:20 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kmem.h"
@@ -346,7 +346,7 @@ kmem_intr_zalloc(size_t size, km_flag_t 
 	void *p;
 
 	p = kmem_intr_alloc(size, kmflags);
-	if (p != NULL) {
+	if (__predict_true(p != NULL)) {
 		memset(p, 0, size);
 	}
 	return p;
@@ -406,8 +406,9 @@ kmem_alloc(size_t size, km_flag_t kmflag
 {
 	void *v;
 
-	KASSERTMSG((!cpu_intr_p() && !cpu_softintr_p()),
-	"kmem(9) should not be used from the interrupt context");
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
+
 	v = kmem_intr_alloc(size, kmflags);
 	if (__predict_true(v != NULL)) {
 		kmsan_mark(v, size, KMSAN_STATE_UNINIT);
@@ -426,8 +427,9 @@ kmem_zalloc(size_t size, km_flag_t kmfla
 {
 	void *v;
 
-	KASSERTMSG((!cpu_intr_p() && !cpu_softintr_p()),
-	"kmem(9) should not be used from the interrupt context");
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
+
 	v = kmem_intr_zalloc(size, kmflags);
 	KASSERT(v || (kmflags & KM_NOSLEEP) != 0);
 	return v;
@@ -440,8 +442,10 @@ kmem_zalloc(size_t size, km_flag_t kmfla
 void
 kmem_free(void *p, size_t size)
 {
+
 	KASSERT(!cpu_intr_p());
 	KASSERT(!cpu_softintr_p());
+
 	kmem_intr_free(p, size);
 	kmsan_mark(p, size, KMSAN_STATE_INITED);
 }



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:50:20 UTC 2023

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

Log Message:
kmem(9): Tweak branch predictions in fast paths.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/subr_kmem.c

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:28:25 UTC 2023

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

Log Message:
pserialize(9): Micro-optimize pserialize_read_exit.

Most of the time we're not cold, so let's convince gcc to make that a
statically predicted-not-taken branch.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/subr_pserialize.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_pserialize.c
diff -u src/sys/kern/subr_pserialize.c:1.20 src/sys/kern/subr_pserialize.c:1.21
--- src/sys/kern/subr_pserialize.c:1.20	Sun Apr  9 08:17:45 2023
+++ src/sys/kern/subr_pserialize.c	Sun Apr  9 08:28:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pserialize.c,v 1.20 2023/04/09 08:17:45 riastradh Exp $	*/
+/*	$NetBSD: subr_pserialize.c,v 1.21 2023/04/09 08:28:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.20 2023/04/09 08:17:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.21 2023/04/09 08:28:24 riastradh Exp $");
 
 #include 
 
@@ -138,7 +138,7 @@ void
 pserialize_read_exit(int s)
 {
 
-	KASSERT((cold || kpreempt_disabled()));
+	KASSERT(__predict_false(cold) || kpreempt_disabled());
 
 	__insn_barrier();
 	if (__predict_false(curcpu()->ci_psz_read_depth-- == 0))



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:28:25 UTC 2023

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

Log Message:
pserialize(9): Micro-optimize pserialize_read_exit.

Most of the time we're not cold, so let's convince gcc to make that a
statically predicted-not-taken branch.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/subr_pserialize.c

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



CVS commit: src/sys/arch/i386/include

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:18:03 UTC 2023

Modified Files:
src/sys/arch/i386/include: cpu.h

Log Message:
i386: Make curlwp and curcpu() flushable.

The only effect of the `volatile' qualifier on an asm block with
outputs is to force the instructions to appear in the generated code,
even if the outputs end up being unused.  Since these instructions
have no (architectural) side effects -- provided %fs is set
correctly, which must be the case here -- there's no need for the
volatile qualifier, so nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/i386/include/cpu.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/include/cpu.h
diff -u src/sys/arch/i386/include/cpu.h:1.183 src/sys/arch/i386/include/cpu.h:1.184
--- src/sys/arch/i386/include/cpu.h:1.183	Tue Nov  2 11:26:04 2021
+++ src/sys/arch/i386/include/cpu.h	Sun Apr  9 08:18:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.183 2021/11/02 11:26:04 ryo Exp $	*/
+/*	$NetBSD: cpu.h,v 1.184 2023/04/09 08:18:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -50,7 +50,7 @@ x86_curcpu(void)
 {
 	struct cpu_info *ci;
 
-	__asm volatile("movl %%fs:%1, %0" :
+	__asm("movl %%fs:%1, %0" :
 	"=r" (ci) :
 	"m"
 	(*(struct cpu_info * const *)offsetof(struct cpu_info, ci_self)));
@@ -62,7 +62,7 @@ x86_curlwp(void)
 {
 	lwp_t *l;
 
-	__asm volatile("movl %%fs:%1, %0" :
+	__asm("movl %%fs:%1, %0" :
 	"=r" (l) :
 	"m"
 	(*(struct cpu_info * const *)offsetof(struct cpu_info, ci_curlwp)));



CVS commit: src/sys/arch/amd64/include

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:56 UTC 2023

Modified Files:
src/sys/arch/amd64/include: cpu.h

Log Message:
amd64: Make curlwp and curcpu() flushable.

The only effect of the `volatile' qualifier on an asm block with
outputs is to force the instructions to appear in the generated code,
even if the outputs end up being unused.  Since these instructions
have no (architectural) side effects -- provided %gs is set
correctly, which must be the case here -- there's no need for the
volatile qualifier, so nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/amd64/include/cpu.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/amd64/include/cpu.h
diff -u src/sys/arch/amd64/include/cpu.h:1.70 src/sys/arch/amd64/include/cpu.h:1.71
--- src/sys/arch/amd64/include/cpu.h:1.70	Tue Nov  2 11:26:03 2021
+++ src/sys/arch/amd64/include/cpu.h	Sun Apr  9 08:17:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.70 2021/11/02 11:26:03 ryo Exp $	*/
+/*	$NetBSD: cpu.h,v 1.71 2023/04/09 08:17:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -53,7 +53,7 @@ x86_curcpu(void)
 {
 	struct cpu_info *ci;
 
-	__asm volatile("movq %%gs:%1, %0" :
+	__asm("movq %%gs:%1, %0" :
 	"=r" (ci) :
 	"m"
 	(*(struct cpu_info * const *)offsetof(struct cpu_info, ci_self)));
@@ -65,7 +65,7 @@ x86_curlwp(void)
 {
 	lwp_t *l;
 
-	__asm volatile("movq %%gs:%1, %0" :
+	__asm("movq %%gs:%1, %0" :
 	"=r" (l) :
 	"m"
 	(*(struct cpu_info * const *)offsetof(struct cpu_info, ci_curlwp)));



CVS commit: src/sys/arch/i386/include

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:18:03 UTC 2023

Modified Files:
src/sys/arch/i386/include: cpu.h

Log Message:
i386: Make curlwp and curcpu() flushable.

The only effect of the `volatile' qualifier on an asm block with
outputs is to force the instructions to appear in the generated code,
even if the outputs end up being unused.  Since these instructions
have no (architectural) side effects -- provided %fs is set
correctly, which must be the case here -- there's no need for the
volatile qualifier, so nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/i386/include/cpu.h

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



CVS commit: src/sys/arch/amd64/include

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:56 UTC 2023

Modified Files:
src/sys/arch/amd64/include: cpu.h

Log Message:
amd64: Make curlwp and curcpu() flushable.

The only effect of the `volatile' qualifier on an asm block with
outputs is to force the instructions to appear in the generated code,
even if the outputs end up being unused.  Since these instructions
have no (architectural) side effects -- provided %gs is set
correctly, which must be the case here -- there's no need for the
volatile qualifier, so nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/amd64/include/cpu.h

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:45 UTC 2023

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

Log Message:
pserialize(9): Micro-optimize pserialize_not_in_read_section_p.

Load l_ncsw to test whether we have been preempted, rather than
loading and storing l_nopreempt (via function call) to prevent it.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/kern/subr_pserialize.c

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



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:45 UTC 2023

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

Log Message:
pserialize(9): Micro-optimize pserialize_not_in_read_section_p.

Load l_ncsw to test whether we have been preempted, rather than
loading and storing l_nopreempt (via function call) to prevent it.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/kern/subr_pserialize.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_pserialize.c
diff -u src/sys/kern/subr_pserialize.c:1.19 src/sys/kern/subr_pserialize.c:1.20
--- src/sys/kern/subr_pserialize.c:1.19	Tue Nov 15 10:29:56 2022
+++ src/sys/kern/subr_pserialize.c	Sun Apr  9 08:17:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pserialize.c,v 1.19 2022/11/15 10:29:56 macallan Exp $	*/
+/*	$NetBSD: subr_pserialize.c,v 1.20 2023/04/09 08:17:45 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -31,14 +31,16 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.19 2022/11/15 10:29:56 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.20 2023/04/09 08:17:45 riastradh Exp $");
 
 #include 
+
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -172,11 +174,24 @@ pserialize_in_read_section(void)
 bool
 pserialize_not_in_read_section(void)
 {
+	struct lwp *l = curlwp;
+	uint64_t ncsw;
 	bool notin;
 
-	kpreempt_disable();
-	notin = (curcpu()->ci_psz_read_depth == 0);
-	kpreempt_enable();
+	ncsw = l->l_ncsw;
+	__insn_barrier();
+	notin = __predict_true(l->l_cpu->ci_psz_read_depth == 0);
+	__insn_barrier();
+
+	/*
+	 * If we had a context switch, we're definitely not in a
+	 * pserialize read section because pserialize read sections
+	 * block preemption.
+	 */
+	if (__predict_false(ncsw != l->l_ncsw)) {
+		KDASSERT(notin);
+		notin = true;
+	}
 
 	return notin;
 }



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:36 UTC 2023

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

Log Message:
ASSERT_SLEEPABLE(9): Micro-optimize this a little bit.

This convinces gcc to do less -- make a smaller stack frame, compute
fewer conditional moves in favour of predicted-not-taken branches --
in the fast path where we are sleepable as the caller expects.

Wasn't able to convince it to do the ncsw loop with a
predicted-not-taken branch, but let's leave the __predict_false in
there anyway because it's still a good prediction.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/kern/kern_lock.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_lock.c
diff -u src/sys/kern/kern_lock.c:1.183 src/sys/kern/kern_lock.c:1.184
--- src/sys/kern/kern_lock.c:1.183	Thu Feb 23 14:57:29 2023
+++ src/sys/kern/kern_lock.c	Sun Apr  9 08:17:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.183 2023/02/23 14:57:29 riastradh Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.184 2023/04/09 08:17:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.183 2023/02/23 14:57:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.184 2023/04/09 08:17:36 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -67,8 +67,9 @@ __cpu_simple_lock_t kernel_lock[CACHE_LI
 void
 assert_sleepable(void)
 {
+	struct lwp *l = curlwp;
 	const char *reason;
-	uint64_t pctr;
+	uint64_t ncsw;
 	bool idle;
 
 	if (__predict_false(panicstr != NULL)) {
@@ -82,30 +83,32 @@ assert_sleepable(void)
 	 * routine may be called in delicate situations.
 	 */
 	do {
-		pctr = lwp_pctr();
+		ncsw = l->l_ncsw;
 		__insn_barrier();
 		idle = CURCPU_IDLE_P();
 		__insn_barrier();
-	} while (pctr != lwp_pctr());
+	} while (__predict_false(ncsw != l->l_ncsw));
 
 	reason = NULL;
-	if (idle && !cold) {
+	if (__predict_false(idle) && !cold) {
 		reason = "idle";
+		goto panic;
 	}
-	if (cpu_intr_p()) {
+	if (__predict_false(cpu_intr_p())) {
 		reason = "interrupt";
+		goto panic;
 	}
-	if (cpu_softintr_p()) {
+	if (__predict_false(cpu_softintr_p())) {
 		reason = "softint";
+		goto panic;
 	}
-	if (!pserialize_not_in_read_section()) {
+	if (__predict_false(!pserialize_not_in_read_section())) {
 		reason = "pserialize";
+		goto panic;
 	}
+	return;
 
-	if (reason) {
-		panic("%s: %s caller=%p", __func__, reason,
-		(void *)RETURN_ADDRESS);
-	}
+panic:	panic("%s: %s caller=%p", __func__, reason, (void *)RETURN_ADDRESS);
 }
 
 /*



CVS commit: src/sys/kern

2023-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  9 08:17:36 UTC 2023

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

Log Message:
ASSERT_SLEEPABLE(9): Micro-optimize this a little bit.

This convinces gcc to do less -- make a smaller stack frame, compute
fewer conditional moves in favour of predicted-not-taken branches --
in the fast path where we are sleepable as the caller expects.

Wasn't able to convince it to do the ncsw loop with a
predicted-not-taken branch, but let's leave the __predict_false in
there anyway because it's still a good prediction.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/kern/kern_lock.c

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



CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:57:25 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: Makefile.in configure

Log Message:
regen for tnftp 20230409


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 othersrc/usr.bin/tnftp/Makefile.in
cvs rdiff -u -r1.61 -r1.62 othersrc/usr.bin/tnftp/configure

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

Modified files:

Index: othersrc/usr.bin/tnftp/Makefile.in
diff -u othersrc/usr.bin/tnftp/Makefile.in:1.15 othersrc/usr.bin/tnftp/Makefile.in:1.16
--- othersrc/usr.bin/tnftp/Makefile.in:1.15	Sun Apr  9 06:30:14 2023
+++ othersrc/usr.bin/tnftp/Makefile.in	Sun Apr  9 06:57:25 2023
@@ -172,8 +172,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in 
 	$(top_srcdir)/buildaux/ltmain.sh \
 	$(top_srcdir)/buildaux/missing COPYING ChangeLog INSTALL NEWS \
 	README THANKS buildaux/ar-lib buildaux/compile \
-	buildaux/config.guess buildaux/config.sub buildaux/install-sh \
-	buildaux/ltmain.sh buildaux/missing
+	buildaux/config.guess buildaux/config.sub buildaux/depcomp \
+	buildaux/install-sh buildaux/ltmain.sh buildaux/missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)

Index: othersrc/usr.bin/tnftp/configure
diff -u othersrc/usr.bin/tnftp/configure:1.61 othersrc/usr.bin/tnftp/configure:1.62
--- othersrc/usr.bin/tnftp/configure:1.61	Sun Apr  9 06:30:14 2023
+++ othersrc/usr.bin/tnftp/configure	Sun Apr  9 06:57:25 2023
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.ac Revision: 1.45 .
+# From configure.ac Revision: 1.46 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftp 20210827.
+# Generated by GNU Autoconf 2.69 for tnftp 20230409.
 #
 # Report bugs to .
 #
@@ -596,8 +596,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tnftp'
 PACKAGE_TARNAME='tnftp'
-PACKAGE_VERSION='20210827'
-PACKAGE_STRING='tnftp 20210827'
+PACKAGE_VERSION='20230409'
+PACKAGE_STRING='tnftp 20230409'
 PACKAGE_BUGREPORT='lu...@netbsd.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tnftp 20210827 to adapt to many kinds of systems.
+\`configure' configures tnftp 20230409 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1411,7 +1411,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of tnftp 20210827:";;
+ short | recursive ) echo "Configuration of tnftp 20230409:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tnftp configure 20210827
+tnftp configure 20230409
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tnftp $as_me 20210827, which was
+It was created by tnftp $as_me 20230409, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4493,7 +4493,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tnftp'
- VERSION='20210827'
+ VERSION='20230409'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16748,7 +16748,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tnftp $as_me 20210827, which was
+This file was extended by tnftp $as_me 20230409, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -16814,7 +16814,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-tnftp config.status 20210827
+tnftp config.status 20230409
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 



CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:57:25 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: Makefile.in configure

Log Message:
regen for tnftp 20230409


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 othersrc/usr.bin/tnftp/Makefile.in
cvs rdiff -u -r1.61 -r1.62 othersrc/usr.bin/tnftp/configure

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



CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:49:34 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: ChangeLog NEWS configure.ac

Log Message:
tnftp 20230409 release

Changes since tnftp 20210827
* Validate SSL certificates by default, disabled with
  FTPSSLNOVERIFY=1 in the environment, or option sslnoverify.
* Add netrc processing to fetch-mode (URL on command line)
  to enable options and autologin via netrc.
* Handle relative URLs in fetch.
* Improve formatting of manual page.
* Update to NetBSD-ftp 20230225.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 othersrc/usr.bin/tnftp/ChangeLog
cvs rdiff -u -r1.16 -r1.17 othersrc/usr.bin/tnftp/NEWS
cvs rdiff -u -r1.45 -r1.46 othersrc/usr.bin/tnftp/configure.ac

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

Modified files:

Index: othersrc/usr.bin/tnftp/ChangeLog
diff -u othersrc/usr.bin/tnftp/ChangeLog:1.78 othersrc/usr.bin/tnftp/ChangeLog:1.79
--- othersrc/usr.bin/tnftp/ChangeLog:1.78	Fri Aug 27 02:29:39 2021
+++ othersrc/usr.bin/tnftp/ChangeLog	Sun Apr  9 06:49:34 2023
@@ -1,4 +1,24 @@
-$NetBSD: ChangeLog,v 1.78 2021/08/27 02:29:39 lukem Exp $
+$NetBSD: ChangeLog,v 1.79 2023/04/09 06:49:34 lukem Exp $
+
+Sun Apr  9 06:45:06 UTC 2023
+
+	* Release as "tnftp 20230409".
+
+	* Use better terminology.
+
+	* Merge NetBSD ftp from 20210826 to 20230226:
+		* Add option sslnoverify to control validation of SSL
+		  certificates.
+		* Add netrc processing to fetch-mode (URL on command line)
+		  to enable options and autologin via netrc.
+		* Fix SSL cleanup in some error paths.
+		* Support SSL certificate validation by default.
+		  FTPSSLNOVERIFY=1 in the environment to disable validation.
+		* Handle relative URLs.
+		* Improve ftp(1) markup.
+		* Fix -? in a more portable manner.
+		* Equivalent to "NetBSD-ftp 20230225" with documentation
+		  and portability fixes.
 
 Fri Aug 27 02:06:34 UTC 2021
 
@@ -53,7 +73,7 @@ Sun Jul  5 11:18:52 UTC 2020	lukem
 
 	* Release as "tnftp 20200705".
 
-	* Provide dummy source in libnetbsd to avoid linker errors
+	* Provide placeholder source in libnetbsd to avoid linker errors
 	  if no functions are replaced.
 
 	* Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.

Index: othersrc/usr.bin/tnftp/NEWS
diff -u othersrc/usr.bin/tnftp/NEWS:1.16 othersrc/usr.bin/tnftp/NEWS:1.17
--- othersrc/usr.bin/tnftp/NEWS:1.16	Fri Aug 27 02:29:39 2021
+++ othersrc/usr.bin/tnftp/NEWS	Sun Apr  9 06:49:34 2023
@@ -1,6 +1,20 @@
-$NetBSD: NEWS,v 1.16 2021/08/27 02:29:39 lukem Exp $
+$NetBSD: NEWS,v 1.17 2023/04/09 06:49:34 lukem Exp $
 
-This is tnftp version 20210827.
+This is tnftp version 20230409.
+
+Changes in tnftp 20210827 to 20230409:
+
+	Validate SSL certificates by default, disabled with
+	FTPSSLNOVERIFY=1 in the environment, or option sslnoverify.
+
+	Add netrc processing to fetch-mode (URL on command line)
+	to enable options and autologin via netrc.
+
+	Handle relative URLs in fetch.
+
+	Improve formatting of manual page.
+
+	Update to NetBSD-ftp 20230225.
 
 Changes in tnftp 20200705 to 20210827:
 

Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.45 othersrc/usr.bin/tnftp/configure.ac:1.46
--- othersrc/usr.bin/tnftp/configure.ac:1.45	Sun Apr  9 01:18:28 2023
+++ othersrc/usr.bin/tnftp/configure.ac	Sun Apr  9 06:49:34 2023
@@ -1,15 +1,15 @@
-#   $NetBSD: configure.ac,v 1.45 2023/04/09 01:18:28 lukem Exp $
+#   $NetBSD: configure.ac,v 1.46 2023/04/09 06:49:34 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([tnftp], [20210827], [lu...@netbsd.org])
+AC_INIT([tnftp], [20230409], [lu...@netbsd.org])
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
 Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.45 $])
+AC_REVISION([$Revision: 1.46 $])
 
 AS_SHELL_SANITIZE()
 



CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:49:34 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: ChangeLog NEWS configure.ac

Log Message:
tnftp 20230409 release

Changes since tnftp 20210827
* Validate SSL certificates by default, disabled with
  FTPSSLNOVERIFY=1 in the environment, or option sslnoverify.
* Add netrc processing to fetch-mode (URL on command line)
  to enable options and autologin via netrc.
* Handle relative URLs in fetch.
* Improve formatting of manual page.
* Update to NetBSD-ftp 20230225.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 othersrc/usr.bin/tnftp/ChangeLog
cvs rdiff -u -r1.16 -r1.17 othersrc/usr.bin/tnftp/NEWS
cvs rdiff -u -r1.45 -r1.46 othersrc/usr.bin/tnftp/configure.ac

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



CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:30:14 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: Makefile.in aclocal.m4 configure
tnftp_config.h.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 othersrc/usr.bin/tnftp/Makefile.in
cvs rdiff -u -r1.10 -r1.11 othersrc/usr.bin/tnftp/aclocal.m4 \
othersrc/usr.bin/tnftp/tnftp_config.h.in
cvs rdiff -u -r1.60 -r1.61 othersrc/usr.bin/tnftp/configure

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

Modified files:

Index: othersrc/usr.bin/tnftp/Makefile.in
diff -u othersrc/usr.bin/tnftp/Makefile.in:1.14 othersrc/usr.bin/tnftp/Makefile.in:1.15
--- othersrc/usr.bin/tnftp/Makefile.in:1.14	Wed Aug 25 01:52:07 2021
+++ othersrc/usr.bin/tnftp/Makefile.in	Sun Apr  9 06:30:14 2023
@@ -172,8 +172,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in 
 	$(top_srcdir)/buildaux/ltmain.sh \
 	$(top_srcdir)/buildaux/missing COPYING ChangeLog INSTALL NEWS \
 	README THANKS buildaux/ar-lib buildaux/compile \
-	buildaux/config.guess buildaux/config.sub buildaux/depcomp \
-	buildaux/install-sh buildaux/ltmain.sh buildaux/missing
+	buildaux/config.guess buildaux/config.sub buildaux/install-sh \
+	buildaux/ltmain.sh buildaux/missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)

Index: othersrc/usr.bin/tnftp/aclocal.m4
diff -u othersrc/usr.bin/tnftp/aclocal.m4:1.10 othersrc/usr.bin/tnftp/aclocal.m4:1.11
--- othersrc/usr.bin/tnftp/aclocal.m4:1.10	Wed Aug 25 01:04:38 2021
+++ othersrc/usr.bin/tnftp/aclocal.m4	Sun Apr  9 06:30:14 2023
@@ -20,6 +20,120 @@ You have another version of autoconf.  I
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
+# longlong.m4 serial 17
+dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG_INT if 'long long int' works.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
+
+# Note: If the type 'long long int' exists but is only 32 bits large
+# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
+# defined. In this case you can treat 'long long int' like 'long int'.
+
+AC_DEFUN([AC_TYPE_LONG_LONG_INT],
+[
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
+ [ac_cv_type_long_long_int=yes
+  if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+if test $ac_cv_type_long_long_int = yes; then
+  dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+  dnl If cross compiling, assume the bug is not important, since
+  dnl nobody cross compiles for this platform as far as we know.
+  AC_RUN_IFELSE(
+[AC_LANG_PROGRAM(
+   [[@%:@include 
+ @%:@ifndef LLONG_MAX
+ @%:@ define HALF \
+  (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ @%:@ define LLONG_MAX (HALF - 1 + HALF)
+ @%:@endif]],
+   [[long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+   {
+ long long int m = n << i;
+ if (m >> i != n)
+   return 1;
+ if (LLONG_MAX / 2 < m)
+   break;
+   }
+ return 0;]])],
+[],
+[ac_cv_type_long_long_int=no],
+[:])
+fi
+  fi])
+  if test $ac_cv_type_long_long_int = yes; then
+AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+  [Define to 1 if the system has the type 'long long int'.])
+  fi
+])
+
+# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
+
+# Note: If the type 'unsigned long long int' exists but is only 32 bits
+# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
+# will not be defined. In this case you can treat 'unsigned long long int'
+# like 'unsigned long int'.
+
+AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
+[
+  AC_CACHE_CHECK([for unsigned long long int],
+[ac_cv_type_unsigned_long_long_int],
+[ac_cv_type_unsigned_long_long_int=yes
+ if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+   AC_LINK_IFELSE(
+ [_AC_TYPE_LONG_LONG_SNIPPET],
+ [],
+ [ac_cv_type_unsigned_long_long_int=no])
+ fi])
+  

CVS commit: othersrc/usr.bin/tnftp

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:30:14 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp: Makefile.in aclocal.m4 configure
tnftp_config.h.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 othersrc/usr.bin/tnftp/Makefile.in
cvs rdiff -u -r1.10 -r1.11 othersrc/usr.bin/tnftp/aclocal.m4 \
othersrc/usr.bin/tnftp/tnftp_config.h.in
cvs rdiff -u -r1.60 -r1.61 othersrc/usr.bin/tnftp/configure

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



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:23:20 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: libnetbsd.c

Log Message:
use better terminology


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c
diff -u othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c:1.1 othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c:1.2
--- othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c:1.1	Sun Jul  5 11:11:10 2020
+++ othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c	Sun Apr  9 06:23:20 2023
@@ -1,3 +1,3 @@
-/* $NetBSD: libnetbsd.c,v 1.1 2020/07/05 11:11:10 lukem Exp $ */
+/* $NetBSD: libnetbsd.c,v 1.2 2023/04/09 06:23:20 lukem Exp $ */
 
-const char libnetbsd_dummy[] = "Ensure libnetbsd.la is not empty";
+const char libnetbsd_placeholder[] = "Ensure libnetbsd.la is not empty";



CVS commit: othersrc/usr.bin/tnftp/libnetbsd

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:23:20 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp/libnetbsd: libnetbsd.c

Log Message:
use better terminology


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/usr.bin/tnftp/libnetbsd/libnetbsd.c

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



CVS commit: othersrc/usr.bin/tnftp/src

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:17:55 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp/src: ssl.c

Log Message:
ssl.c: sync from upstream 1.14

Simplify includes
Include "ftp_var.h" instead of various system headers and "extern.h"


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 othersrc/usr.bin/tnftp/src/ssl.c

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

Modified files:

Index: othersrc/usr.bin/tnftp/src/ssl.c
diff -u othersrc/usr.bin/tnftp/src/ssl.c:1.8 othersrc/usr.bin/tnftp/src/ssl.c:1.9
--- othersrc/usr.bin/tnftp/src/ssl.c:1.8	Sun Apr  9 00:56:07 2023
+++ othersrc/usr.bin/tnftp/src/ssl.c	Sun Apr  9 06:17:55 2023
@@ -1,5 +1,5 @@
-/*	$NetBSD: ssl.c,v 1.8 2023/04/09 00:56:07 lukem Exp $	*/
-/*	from	NetBSD: ssl.c,v 1.13 2023/02/25 12:07:25 mlelstv Exp	*/
+/*	$NetBSD: ssl.c,v 1.9 2023/04/09 06:17:55 lukem Exp $	*/
+/*	from	NetBSD: ssl.c,v 1.14 2023/04/09 06:10:03 lukem Exp	*/
 
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID(" NetBSD: ssl.c,v 1.13 2023/02/25 12:07:25 mlelstv Exp  ");
+__RCSID(" NetBSD: ssl.c,v 1.14 2023/04/09 06:10:03 lukem Exp  ");
 #endif
 
 #include 
@@ -70,11 +70,7 @@ __RCSID(" NetBSD: ssl.c,v 1.13 2023/02/2
 #endif
 
 #include "ssl.h"
-
-#include 
-#include 
-#include 
-#include "extern.h"
+#include "ftp_var.h"
 
 extern int quit_time, verbose, ftp_debug;
 extern FILE *ttyout;



CVS commit: othersrc/usr.bin/tnftp/src

2023-04-09 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Sun Apr  9 06:17:55 UTC 2023

Modified Files:
othersrc/usr.bin/tnftp/src: ssl.c

Log Message:
ssl.c: sync from upstream 1.14

Simplify includes
Include "ftp_var.h" instead of various system headers and "extern.h"


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 othersrc/usr.bin/tnftp/src/ssl.c

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



CVS commit: src/usr.bin/ftp

2023-04-09 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Apr  9 06:10:03 UTC 2023

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
Simplify includes

Include "ftp_var.h" instead of various system headers and "extern.h".


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/ftp/ssl.c

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

Modified files:

Index: src/usr.bin/ftp/ssl.c
diff -u src/usr.bin/ftp/ssl.c:1.13 src/usr.bin/ftp/ssl.c:1.14
--- src/usr.bin/ftp/ssl.c:1.13	Sat Feb 25 12:07:25 2023
+++ src/usr.bin/ftp/ssl.c	Sun Apr  9 06:10:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl.c,v 1.13 2023/02/25 12:07:25 mlelstv Exp $	*/
+/*	$NetBSD: ssl.c,v 1.14 2023/04/09 06:10:03 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -35,7 +35,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ssl.c,v 1.13 2023/02/25 12:07:25 mlelstv Exp $");
+__RCSID("$NetBSD: ssl.c,v 1.14 2023/04/09 06:10:03 lukem Exp $");
 #endif
 
 #include 
@@ -63,11 +63,7 @@ __RCSID("$NetBSD: ssl.c,v 1.13 2023/02/2
 #endif
 
 #include "ssl.h"
-
-#include 
-#include 
-#include 
-#include "extern.h"
+#include "ftp_var.h"
 
 extern int quit_time, verbose, ftp_debug;
 extern FILE *ttyout;



CVS commit: src/usr.bin/ftp

2023-04-09 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Apr  9 06:10:03 UTC 2023

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
Simplify includes

Include "ftp_var.h" instead of various system headers and "extern.h".


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/ftp/ssl.c

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