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

2023-09-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep 10 00:15:52 UTC 2023

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

Log Message:
With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/vax/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/vax/include

2023-09-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep 10 00:15:52 UTC 2023

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

Log Message:
With the overhaul of the scheduler code the semantics of
ci_want_resched have changed, and for some reason vax
still requires ci_want_resched set to 1 in order to do
preemption.  This commit contains a workaround for the
preemption issued discussed in PR#55415.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/vax/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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.106 src/sys/arch/vax/include/cpu.h:1.107
--- src/sys/arch/vax/include/cpu.h:1.106	Sun Dec 11 18:02:40 2022
+++ src/sys/arch/vax/include/cpu.h	Sun Sep 10 00:15:52 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.106 2022/12/11 18:02:40 oster Exp $  */
+/*  $NetBSD: cpu.h,v 1.107 2023/09/10 00:15:52 oster Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -156,10 +156,15 @@ extern int cpu_printfataltraps;
 #define	curcpu()		(curlwp->l_cpu + 0)
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
+/* XXX RESCHED_REMOTE isn't the right flag name to be used here,
+but we need to set ci_want_resched to '1' to make things work 
+on vax.  See PR#55415 */
 #define	cpu_need_resched(ci, l, flags)		\
 	do {			\
 		struct pcb *pcb = lwp_getpcb(curlwp);		\
 		__USE(flags);	\
+		/* XXX RESCHED_REMOTE isn't the right flag */   \
+		(ci)->ci_want_resched = RESCHED_REMOTE;		\
 		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
 		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)



CVS commit: src/sys/arch/ews4800mips/stand/common

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 21:04:26 UTC 2023

Modified Files:
src/sys/arch/ews4800mips/stand/common: loader.c

Log Message:
s/reagion/region/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/loader.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/ews4800mips/stand/common/loader.c
diff -u src/sys/arch/ews4800mips/stand/common/loader.c:1.5 src/sys/arch/ews4800mips/stand/common/loader.c:1.6
--- src/sys/arch/ews4800mips/stand/common/loader.c:1.5	Wed Oct  6 20:36:58 2021
+++ src/sys/arch/ews4800mips/stand/common/loader.c	Sat Sep  9 21:04:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: loader.c,v 1.5 2021/10/06 20:36:58 andvar Exp $	*/
+/*	$NetBSD: loader.c,v 1.6 2023/09/09 21:04:26 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@ cmd_load_binary(int argc, char *argp[], 
 	q = (uint8_t *)strtoul(argp[1], 0, 0);
 	p = kernel_binary;
 
-	/* check load reagion */
+	/* check load region */
 	printf("load end=%p loader start=%p\n",
 	q + kernel_binary_size, start);
 	if ((uint32_t)(q + kernel_binary_size) >= (uint32_t)start) {



CVS commit: src/sys/arch/ews4800mips/stand/common

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 21:04:26 UTC 2023

Modified Files:
src/sys/arch/ews4800mips/stand/common: loader.c

Log Message:
s/reagion/region/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/loader.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/hpcmips/hpcmips

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 21:01:57 UTC 2023

Modified Files:
src/sys/arch/hpcmips/hpcmips: bus_space_through.c

Log Message:
s/reagion/region/ in called bus_space_read_region_stream_x method names.

relevant for hpcmips BUS_SPACE_HAS_REAL_STREAM_METHODS enabled build,
however it still fails due to other issues.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcmips/hpcmips/bus_space_through.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/hpcmips/hpcmips

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 21:01:57 UTC 2023

Modified Files:
src/sys/arch/hpcmips/hpcmips: bus_space_through.c

Log Message:
s/reagion/region/ in called bus_space_read_region_stream_x method names.

relevant for hpcmips BUS_SPACE_HAS_REAL_STREAM_METHODS enabled build,
however it still fails due to other issues.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcmips/hpcmips/bus_space_through.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/hpcmips/hpcmips/bus_space_through.c
diff -u src/sys/arch/hpcmips/hpcmips/bus_space_through.c:1.4 src/sys/arch/hpcmips/hpcmips/bus_space_through.c:1.5
--- src/sys/arch/hpcmips/hpcmips/bus_space_through.c:1.4	Sun Dec 11 12:17:33 2005
+++ src/sys/arch/hpcmips/hpcmips/bus_space_through.c	Sat Sep  9 21:01:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space_through.c,v 1.4 2005/12/11 12:17:33 christos Exp $	*/
+/*	$NetBSD: bus_space_through.c,v 1.5 2023/09/09 21:01:57 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 TAKEMRUA Shin. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space_through.c,v 1.4 2005/12/11 12:17:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space_through.c,v 1.5 2023/09/09 21:01:57 andvar Exp $");
 
 #include 
 #include 
@@ -388,28 +388,28 @@ void
 bs_through_bs_rrs_1(bus_space_tag_t t, bus_space_handle_t bsh,
 	bus_size_t offset, u_int8_t *addr, bus_size_t count)
 {
-	bus_space_read_reagion_stream_1(t->bs_base, bsh, offset, addr, count);
+	bus_space_read_region_stream_1(t->bs_base, bsh, offset, addr, count);
 }
 
 void
 bs_through_bs_rrs_2(bus_space_tag_t t, bus_space_handle_t bsh,
 	bus_size_t offset, u_int16_t *addr, bus_size_t count)
 {
-	bus_space_read_reagion_stream_2(t->bs_base, bsh, offset, addr, count);
+	bus_space_read_region_stream_2(t->bs_base, bsh, offset, addr, count);
 }
 
 void
 bs_through_bs_rrs_4(bus_space_tag_t t, bus_space_handle_t bsh,
 	bus_size_t offset, u_int32_t *addr, bus_size_t count)
 {
-	bus_space_read_reagion_stream_4(t->bs_base, bsh, offset, addr, count);
+	bus_space_read_region_stream_4(t->bs_base, bsh, offset, addr, count);
 }
 
 void
 bs_through_bs_rrs_8(bus_space_tag_t t, bus_space_handle_t bsh,
 	bus_size_t offset, u_int64_t *addr, bus_size_t count)
 {
-	bus_space_read_reagion_stream_8(t->bs_base, bsh, offset, addr, count);
+	bus_space_read_region_stream_8(t->bs_base, bsh, offset, addr, count);
 }
 
 



CVS commit: src/sys/arch/hpcmips/hpcmips

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 20:47:29 UTC 2023

Modified Files:
src/sys/arch/hpcmips/hpcmips: bus_space.c

Log Message:
relocate DPRINTF below to make sure that bpa is initialized.

fixes BUS_SPACE_DEBUG enabled build for hpcmips.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcmips/hpcmips/bus_space.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/hpcmips/hpcmips/bus_space.c
diff -u src/sys/arch/hpcmips/hpcmips/bus_space.c:1.32 src/sys/arch/hpcmips/hpcmips/bus_space.c:1.33
--- src/sys/arch/hpcmips/hpcmips/bus_space.c:1.32	Mon Jul 11 16:18:56 2016
+++ src/sys/arch/hpcmips/hpcmips/bus_space.c	Sat Sep  9 20:47:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.32 2016/07/11 16:18:56 matt Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.33 2023/09/09 20:47:29 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.32 2016/07/11 16:18:56 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.33 2023/09/09 20:47:29 andvar Exp $");
 
 #include 
 #include 
@@ -337,9 +337,6 @@ __bs_alloc(bus_space_tag_t tx, bus_addr_
 	if (!t->extent)
 		panic("bus_space_alloc: no extent");
 
-	DPRINTF(("\tbus_space_alloc:%#lx(%#lx)+%#lx\n", bpa,
-	bpa - t->base, size));
-
 	rstart += t->base;
 	rend += t->base;
 	if ((err = extent_alloc_subregion(t->extent, rstart, rend, size,
@@ -347,6 +344,9 @@ __bs_alloc(bus_space_tag_t tx, bus_addr_
 		return (err);
 	}
 
+	DPRINTF(("\tbus_space_alloc:%#lx(%#lx)+%#lx\n", bpa,
+	bpa - t->base, size));
+
 	*bshp = __hpcmips_cacheable(t, bpa, size, cacheable);
 
 	if (bpap) {



CVS commit: src/sys/arch/hpcmips/hpcmips

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 20:47:29 UTC 2023

Modified Files:
src/sys/arch/hpcmips/hpcmips: bus_space.c

Log Message:
relocate DPRINTF below to make sure that bpa is initialized.

fixes BUS_SPACE_DEBUG enabled build for hpcmips.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcmips/hpcmips/bus_space.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/vmstat

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 20:13:54 UTC 2023

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
uidinfo is an SLIST.


To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.258 src/usr.bin/vmstat/vmstat.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/vmstat

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 20:13:54 UTC 2023

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
uidinfo is an SLIST.


To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.258 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.257 src/usr.bin/vmstat/vmstat.c:1.258
--- src/usr.bin/vmstat/vmstat.c:1.257	Tue Aug  1 04:20:14 2023
+++ src/usr.bin/vmstat/vmstat.c	Sat Sep  9 20:13:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.257 2023/08/01 04:20:14 simonb Exp $ */
+/* $NetBSD: vmstat.c,v 1.258 2023/09/09 20:13:54 ad Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.257 2023/08/01 04:20:14 simonb Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.258 2023/09/09 20:13:54 ad Exp $");
 #endif
 #endif /* not lint */
 
@@ -99,6 +99,7 @@ __RCSID("$NetBSD: vmstat.c,v 1.257 2023/
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1885,12 +1886,6 @@ enum hashtype {			/* from  
 	HASH_PSLIST
 };
 
-struct uidinfo {		/* XXX: no kernel header file */
-	LIST_ENTRY(uidinfo) ui_hash;
-	uid_t	ui_uid;
-	long	ui_proccnt;
-};
-
 struct kernel_hash {
 	const char *	description;	/* description */
 	int		hashsize;	/* nlist index for hash size */
@@ -1910,7 +1905,7 @@ struct kernel_hash {
 	}, {
 		"user info (uid -> used processes) hash",
 		X_UIHASH, X_UIHASHTBL,
-		HASH_LIST, offsetof(struct uidinfo, ui_hash),
+		HASH_SLIST, offsetof(struct uidinfo, ui_hash),
 	}, {
 		"vnode cache hash",
 		X_VCACHEHASH, X_VCACHETBL,



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

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 18:49:21 UTC 2023

Modified Files:
src/sys/arch/mips/include: mips3_pte.h

Log Message:
change #define to #error for MIPS3_4100i 8KB page size build protection.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/mips3_pte.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/mips/include/mips3_pte.h
diff -u src/sys/arch/mips/include/mips3_pte.h:1.31 src/sys/arch/mips/include/mips3_pte.h:1.32
--- src/sys/arch/mips/include/mips3_pte.h:1.31	Mon Aug 17 03:19:35 2020
+++ src/sys/arch/mips/include/mips3_pte.h	Sat Sep  9 18:49:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips3_pte.h,v 1.31 2020/08/17 03:19:35 mrg Exp $	*/
+/*	$NetBSD: mips3_pte.h,v 1.32 2023/09/09 18:49:21 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -77,7 +77,7 @@ unsigned int 	pg_g:1,			/* HW: ignore as
 #define	MIPS3_PG_ODDPG	(MIPS3_PG_SVPN ^ MIPS3_PG_HVPN)
 #elif PGSHIFT == 13
 #ifdef MIPS3_4100
-#define	8KB page size is not supported on the MIPS3_4100
+#error	8KB page size is not supported on the MIPS3_4100
 #endif
 #define	MIPS3_PG_SVPN	(~0UL << 13)	/* Software page no mask */
 #define	MIPS3_PG_HVPN	(~0UL << 13)	/* Hardware page no mask */



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

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 18:49:21 UTC 2023

Modified Files:
src/sys/arch/mips/include: mips3_pte.h

Log Message:
change #define to #error for MIPS3_4100i 8KB page size build protection.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mips/include/mips3_pte.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/x86/x86

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:37:03 UTC 2023

Modified Files:
src/sys/arch/x86/x86: tsc.c

Log Message:
tsc_get_timecount(): cover the backwards check by DIAGNOSTIC since it has
proven the point by now.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/x86/tsc.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/x86/x86

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:37:03 UTC 2023

Modified Files:
src/sys/arch/x86/x86: tsc.c

Log Message:
tsc_get_timecount(): cover the backwards check by DIAGNOSTIC since it has
proven the point by now.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/x86/tsc.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/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.57 src/sys/arch/x86/x86/tsc.c:1.58
--- src/sys/arch/x86/x86/tsc.c:1.57	Fri Oct 15 18:12:48 2021
+++ src/sys/arch/x86/x86/tsc.c	Sat Sep  9 18:37:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.57 2021/10/15 18:12:48 jmcneill Exp $	*/
+/*	$NetBSD: tsc.c,v 1.58 2023/09/09 18:37:03 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.57 2021/10/15 18:12:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.58 2023/09/09 18:37:03 ad Exp $");
 
 #include 
 #include 
@@ -406,7 +406,7 @@ tsc_delay(unsigned int us)
 static u_int
 tsc_get_timecount(struct timecounter *tc)
 {
-#ifdef _LP64 /* requires atomic 64-bit store */
+#if defined(_LP64) && defined(DIAGNOSTIC) /* requires atomic 64-bit store */
 	static __cpu_simple_lock_t lock = __SIMPLELOCK_UNLOCKED;
 	static int lastwarn;
 	uint64_t cur, prev;
@@ -421,19 +421,17 @@ tsc_get_timecount(struct timecounter *tc
 	 */
 	prev = l->l_md.md_tsc;
 	cur = cpu_counter();
-	if (__predict_false(cur < prev)) {
-		if ((cur >> 63) == (prev >> 63) &&
-		__cpu_simple_lock_try()) {
-			ticks = getticks();
-			if (ticks - lastwarn >= hz) {
-printf(
-"WARNING: TSC time went backwards by %u - "
-"change sysctl(7) kern.timecounter?\n",
-(unsigned)(prev - cur));
-lastwarn = ticks;
-			}
-			__cpu_simple_unlock();
+	if (__predict_false(cur < prev) && (cur >> 63) == (prev >> 63) &&
+	__cpu_simple_lock_try()) {
+		ticks = getticks();
+		if (ticks - lastwarn >= hz) {
+			printf(
+			"WARNING: %s TSC went backwards by %u - "
+			"change sysctl(7) kern.timecounter?\n",
+			cpu_name(curcpu()), (unsigned)(prev - cur));
+			lastwarn = ticks;
 		}
+		__cpu_simple_unlock();
 	}
 	l->l_md.md_tsc = cur;
 	return (uint32_t)cur;



CVS commit: src/sys/kern

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:34:44 UTC 2023

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

Log Message:
do_sys_accessat(): copy credentials only when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.560 -r1.561 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/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.560 src/sys/kern/vfs_syscalls.c:1.561
--- src/sys/kern/vfs_syscalls.c:1.560	Mon Jul 10 02:31:55 2023
+++ src/sys/kern/vfs_syscalls.c	Sat Sep  9 18:34:44 2023
@@ -1,7 +1,7 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.560 2023/07/10 02:31:55 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.561 2023/09/09 18:34:44 ad Exp $	*/
 
 /*-
- * Copyright (c) 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2009, 2019, 2020, 2023 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.560 2023/07/10 02:31:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.561 2023/09/09 18:34:44 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -3134,11 +3134,12 @@ do_sys_accessat(struct lwp *l, int fdat,
 	NDINIT(, LOOKUP, nd_flag, pb);
 
 	/* Override default credentials */
-	cred = kauth_cred_dup(l->l_cred);
 	if (!(flags & AT_EACCESS)) {
+		cred = kauth_cred_dup(l->l_cred);
 		kauth_cred_seteuid(cred, kauth_cred_getuid(l->l_cred));
 		kauth_cred_setegid(cred, kauth_cred_getgid(l->l_cred));
-	}
+	} else
+		cred = l->l_cred;
 	nd.ni_cnd.cn_cred = cred;
 
 	if ((error = fd_nameiat(l, fdat, )) != 0) {
@@ -3164,7 +3165,8 @@ do_sys_accessat(struct lwp *l, int fdat,
 	}
 	vput(vp);
 out:
-	kauth_cred_free(cred);
+	if (!(flags & AT_EACCESS))
+		kauth_cred_free(cred);
 	return (error);
 }
 



CVS commit: src/sys/kern

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:34:44 UTC 2023

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

Log Message:
do_sys_accessat(): copy credentials only when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.560 -r1.561 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/kern

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:30:56 UTC 2023

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

Log Message:
Fix a ~16 year old perf regression: when accepting a connection, add a
reference to the caller's credentials rather than copying them.


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

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:30:56 UTC 2023

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

Log Message:
Fix a ~16 year old perf regression: when accepting a connection, add a
reference to the caller's credentials rather than copying them.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/kern/uipc_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/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.206 src/sys/kern/uipc_syscalls.c:1.207
--- src/sys/kern/uipc_syscalls.c:1.206	Fri Jul  1 22:30:51 2022
+++ src/sys/kern/uipc_syscalls.c	Sat Sep  9 18:30:56 2023
@@ -1,7 +1,7 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.206 2022/07/01 22:30:51 riastradh Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.207 2023/09/09 18:30:56 ad Exp $	*/
 
 /*-
- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2009, 2023 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.206 2022/07/01 22:30:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.207 2023/09/09 18:30:56 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pipe.h"
@@ -242,7 +242,7 @@ do_sys_accept(struct lwp *l, int sock, s
 	else
 		so2->so_state &= ~SS_NBIO;
 	error = soaccept(so2, name);
-	so2->so_cred = kauth_cred_dup(so->so_cred);
+	kauth_cred_hold(so2->so_cred = so->so_cred);
 	sounlock(so);
 	if (error) {
 		/* an error occurred, free the file descriptor and mbuf */
@@ -1697,7 +1697,7 @@ do_sys_peeloff(struct socket *head, void
 	so->so_state &= ~SS_NOFDREF;
 	so->so_state &= ~SS_ISCONNECTING;
 	so->so_head = NULL;
-	so->so_cred = kauth_cred_dup(head->so_cred);
+	kauth_cred_hold(so->so_cred = head->so_cred);
 	nfp->f_socket = so;
 	nfp->f_flag = FREAD|FWRITE;
 	nfp->f_ops = 



CVS commit: src/doc

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:30:01 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
Note namecache tuning for 32-bit systems.


To generate a diff of this commit:
cvs rdiff -u -r1.2998 -r1.2999 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2998 src/doc/CHANGES:1.2999
--- src/doc/CHANGES:1.2998	Mon Sep  4 17:07:04 2023
+++ src/doc/CHANGES	Sat Sep  9 18:30:00 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2998 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2999 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -224,3 +224,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		Theodore Preduta. [christos 20230819]
 	acpi(4): Updated ACPICA to 20230628. [christos 20230901] 
 	sqlite3(1): Import 3.34.0. [christos 20230904]
+	namecache: Tune the namecache for 32-bit systems [ad 20230909]



CVS commit: src/doc

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:30:01 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
Note namecache tuning for 32-bit systems.


To generate a diff of this commit:
cvs rdiff -u -r1.2998 -r1.2999 src/doc/CHANGES

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



CVS commit: src/sys

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:28:48 UTC 2023

Modified Files:
src/sys/rump/include/rump: rump_namei.h
src/sys/sys: namei.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.115 -r1.116 src/sys/sys/namei.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/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.48 src/sys/rump/include/rump/rump_namei.h:1.49
--- src/sys/rump/include/rump/rump_namei.h:1.48	Tue Jun 29 22:40:06 2021
+++ src/sys/rump/include/rump/rump_namei.h	Sat Sep  9 18:28:48 2023
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.48 2021/06/29 22:40:06 dholland Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.49 2023/09/09 18:28:48 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.60 2021/06/29 22:39:21 dholland Exp 
+ *   from: NetBSD: namei.src,v 1.61 2023/09/09 18:27:59 ad Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.115 src/sys/sys/namei.h:1.116
--- src/sys/sys/namei.h:1.115	Tue Jun 29 22:40:06 2021
+++ src/sys/sys/namei.h	Sat Sep  9 18:28:48 2023
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.115 2021/06/29 22:40:06 dholland Exp $	*/
+/*	$NetBSD: namei.h,v 1.116 2023/09/09 18:28:48 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.60 2021/06/29 22:39:21 dholland Exp 
+ *   from: NetBSD: namei.src,v 1.61 2023/09/09 18:27:59 ad Exp 
  */
 
 /*
@@ -208,12 +208,24 @@ struct nameidata {
 #define	NCHNAMLEN	sizeof(((struct namecache *)NULL)->nc_name)
 
 /*
+ * The uintptr_t-sized key value computed for each name consists of name
+ * length and a hash value.  On 32-bit platforms the top NC_NLEN_BITS of
+ * the 32-bit hash value is lobbed off.
+ */
+
+#define	NC_NLEN_BITS	11
+#define	NC_NLEN_MASK	((1 << NC_NLEN_BITS) - 1)
+#define	NC_NLEN(ncp)	((ncp)->nc_key & NC_NLEN_MASK)
+
+/*
  * Namecache entry.
  *
  * This structure describes the elements in the cache of recent names looked
- * up by namei.  It's carefully sized to take up 128 bytes on _LP64, to make
- * good use of space and the CPU caches.  Items used during RB tree lookup
- * (nc_tree, nc_key) are clustered at the start of the structure.
+ * up by namei.  It's carefully sized to take up 128 bytes on _LP64 and 64
+ * bytes on 32-bit machines, to make good use of space and the CPU caches.
+ *
+ * Items used during RB tree lookup (nc_tree, nc_key) are clustered at the
+ * start of the structure to minimise cache misses during lookup.
  *
  * Field markings and their corresponding locks:
  *
@@ -224,17 +236,20 @@ struct nameidata {
  */
 struct namecache {
 	struct	rb_node nc_tree;	/* d  red-black tree, must be first */
-	uint64_t nc_key;		/* -  hashed key value */
+	uintptr_t nc_key;		/* -  hashed key value */
 	TAILQ_ENTRY(namecache) nc_list;	/* v  nc_vp's list of cache entries */
 	TAILQ_ENTRY(namecache) nc_lru;	/* l  pseudo-lru chain */
 	struct	vnode *nc_dvp;		/* -  vnode of parent of name */
 	struct	vnode *nc_vp;		/* -  vnode the name refers to */
-	int	nc_lrulist;		/* l  which LRU list it's on */
-	u_short	nc_nlen;		/* -  length of the name */
-	char	nc_whiteout;		/* -  true if a whiteout */
-	char	nc_name[41];		/* -  segment name */
-};
+	u_char	nc_lrulist;		/* l  LRU list entry is on */
+	u_char	nc_whiteout;		/* -  whiteout indicator */
+#ifdef _LP64
+	char	nc_name[46];		/* -  segment name */
+#else
+	char	nc_name[22];		/* -  segment name */
 #endif
+};
+#endif /* __NAMECACHE_PRIVATE */
 
 #ifdef _KERNEL
 #include 



CVS commit: src/sys

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:28:48 UTC 2023

Modified Files:
src/sys/rump/include/rump: rump_namei.h
src/sys/sys: namei.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.115 -r1.116 src/sys/sys/namei.h

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



CVS commit: src

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:27:59 UTC 2023

Modified Files:
src/sys/kern: vfs_cache.c
src/sys/sys: namei.src
src/usr.bin/pmap: main.h pmap.c

Log Message:
- Shrink namecache entries to 64 bytes on 32-bit platforms and use 32-bit
  key values there for speed (remains 128 bytes & 64-bits on _LP64).
- Comments.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.60 -r1.61 src/sys/sys/namei.src
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/pmap/main.h
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/pmap/pmap.c

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

Modified files:

Index: src/sys/kern/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.154 src/sys/kern/vfs_cache.c:1.155
--- src/sys/kern/vfs_cache.c:1.154	Sat Apr 29 10:07:22 2023
+++ src/sys/kern/vfs_cache.c	Sat Sep  9 18:27:59 2023
@@ -1,7 +1,7 @@
-/*	$NetBSD: vfs_cache.c,v 1.154 2023/04/29 10:07:22 riastradh Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.155 2023/09/09 18:27:59 ad Exp $	*/
 
 /*-
- * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2019, 2020, 2023 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -79,10 +79,9 @@
  *	we are not sensible, and use a per-directory data structure to index
  *	names, but the cache otherwise functions the same.
  *
- *	The index is a red-black tree.  There are no special concurrency
- *	requirements placed on it, because it's per-directory and protected
- *	by the namecache's per-directory locks.  It should therefore not be
- *	difficult to experiment with other types of index.
+ *	The index is a red-black tree.  It should not be difficult to
+ *	experiment with other types of index, however note that a tree
+ *	can trivially be made to support lockless lookup.
  *
  *	Each cached name is stored in a struct namecache, along with a
  *	pointer to the associated vnode (nc_vp).  Names longer than a
@@ -91,6 +90,19 @@
  *	in struct namecache.  If it is a "negative" entry, (i.e. for a name
  *	that is known NOT to exist) the vnode pointer will be NULL.
  *
+ *	In practice this implementation is not any slower than the hash
+ *	table that preceeded it and in some cases it significantly
+ *	outperforms the hash table.  Some reasons why this might be:
+ *
+ *	- natural partitioning provided by the file system structure, which
+ *	  the prior implementation discarded (global hash table).
+ *	- worst case tree traversal of O(log n), the hash table could have
+ *	  many collisions.
+ *	- minimized cache misses & total L2/L3 CPU cache footprint; struct
+ *	  namecache and vnode_impl_t are laid out to keep cache footprint
+ *	  minimal in the lookup path; no hash table buckets to cache.
+ *	- minimized number of conditionals & string comparisons.
+ *
  *	For a directory with 3 cached names for 3 distinct vnodes, the
  *	various vnodes and namecache structs would be connected like this
  *	(the root is at the bottom of the diagram):
@@ -167,12 +179,10 @@
  * used during reverse lookup)
  *
  *	3) cache_lru_lock	(LRU list direction, used during reclaim)
- *
- *	4) vp->v_interlock	(what the cache entry points to)
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.154 2023/04/29 10:07:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.155 2023/09/09 18:27:59 ad Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -202,6 +212,16 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,
 
 #include 
 
+/*
+ * Assert that data structure layout hasn't changed unintentionally.
+ */
+#ifdef _LP64
+CTASSERT(sizeof(struct namecache) == 128);
+#else
+CTASSERT(sizeof(struct namecache) == 64);
+#endif
+CTASSERT(NC_NLEN_MASK >= MAXPATHLEN);
+
 static void	cache_activate(struct namecache *);
 static void	cache_update_stats(void *);
 static int	cache_compare_nodes(void *, const void *, const void *);
@@ -262,7 +282,7 @@ static kmutex_t cache_stat_lock __cachel
  */
 int cache_lru_maxdeact __read_mostly = 2;	/* max # to deactivate */
 int cache_lru_maxscan __read_mostly = 64;	/* max # to scan/reclaim */
-int cache_maxlen __read_mostly = USHRT_MAX;	/* max name length to cache */
+int cache_maxlen __read_mostly = NC_NLEN_MASK;	/* max name length to cache */
 int cache_stat_interval __read_mostly = 300;	/* in seconds */
 
 /*
@@ -328,8 +348,8 @@ cache_compare_nodes(void *context, const
 	if (nc1->nc_key > nc2->nc_key) {
 		return 1;
 	}
-	KASSERT(nc1->nc_nlen == nc2->nc_nlen);
-	return memcmp(nc1->nc_name, nc2->nc_name, nc1->nc_nlen);
+	KASSERT(NC_NLEN(nc1) == NC_NLEN(nc2));
+	return memcmp(nc1->nc_name, nc2->nc_name, NC_NLEN(nc1));
 }
 
 /*
@@ -337,15 +357,15 @@ cache_compare_nodes(void *context, const
  * the key value to try and improve uniqueness, and so that length doesn't
  * need to be compared separately for string comparisons.
  */

CVS commit: src

2023-09-09 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Sep  9 18:27:59 UTC 2023

Modified Files:
src/sys/kern: vfs_cache.c
src/sys/sys: namei.src
src/usr.bin/pmap: main.h pmap.c

Log Message:
- Shrink namecache entries to 64 bytes on 32-bit platforms and use 32-bit
  key values there for speed (remains 128 bytes & 64-bits on _LP64).
- Comments.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.60 -r1.61 src/sys/sys/namei.src
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/pmap/main.h
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/pmap/pmap.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/make

2023-09-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Sep  9 16:41:04 UTC 2023

Modified Files:
src/usr.bin/make: main.c make.1
src/usr.bin/make/unit-tests: Makefile opt-debug-graph1.exp
opt-debug-graph2.exp opt-debug-graph3.exp suff-main-several.exp
suff-transform-debug.exp

Log Message:
Add .MAKE.JOBS.C to indicate wether -jC is supported


To generate a diff of this commit:
cvs rdiff -u -r1.595 -r1.596 src/usr.bin/make/main.c
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/make.1
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt-debug-graph2.exp \
src/usr.bin/make/unit-tests/opt-debug-graph3.exp \
src/usr.bin/make/unit-tests/suff-transform-debug.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/suff-main-several.exp

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/make/main.c
diff -u src/usr.bin/make/main.c:1.595 src/usr.bin/make/main.c:1.596
--- src/usr.bin/make/main.c:1.595	Sat Sep  9 04:38:48 2023
+++ src/usr.bin/make/main.c	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.595 2023/09/09 04:38:48 mrg Exp $	*/
+/*	$NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.595 2023/09/09 04:38:48 mrg Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1373,6 +1373,12 @@ main_Init(int argc, char **argv)
 #endif
 	Global_Set(".MAKE.MAKEFILE_PREFERENCE", MAKEFILE_PREFERENCE_LIST);
 	Global_Set(".MAKE.DEPENDFILE", ".depend");
+	/* Tell makefiles like jobs.mk wether we support -jC */
+#ifdef _SC_NPROCESSORS_ONLN
+	Global_Set_ReadOnly(".MAKE.JOBS.C", "yes");
+#else
+	Global_Set_ReadOnly(".MAKE.JOBS.C", "no");
+#endif
 
 	CmdOpts_Init();
 	allPrecious = false;	/* Remove targets when interrupted */

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.369 src/usr.bin/make/make.1:1.370
--- src/usr.bin/make/make.1:1.369	Sat Sep  9 01:30:59 2023
+++ src/usr.bin/make/make.1	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.369 2023/09/09 01:30:59 sjg Exp $
+.\"	$NetBSD: make.1,v 1.370 2023/09/09 16:41:04 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -977,6 +977,11 @@ making it easier to track the degree of 
 The argument to the
 .Fl j
 option.
+.It Va .MAKE.JOBS.C
+A read-only boolean that indicates wether the
+.Fl j
+option supports use of
+.Ql C .
 .It Va .MAKE.LEVEL
 The recursion depth of
 .Nm .

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.340 src/usr.bin/make/unit-tests/Makefile:1.341
--- src/usr.bin/make/unit-tests/Makefile:1.340	Thu Aug 17 18:48:32 2023
+++ src/usr.bin/make/unit-tests/Makefile	Sat Sep  9 16:41:04 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.340 2023/08/17 18:48:32 rillig Exp $
+# $NetBSD: Makefile,v 1.341 2023/09/09 16:41:04 sjg Exp $
 #
 # Unit tests for make(1)
 #
@@ -597,6 +597,7 @@ STD_SED_CMDS.dg1=	-e 's,${.CURDIR}$$,,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE *=\) .*,\1 ,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1 ,'
+STD_SED_CMDS.dg1+=	-e 's,^\(\.MAKE\.JOBS\.C *=\) .*,\1 ,'
 STD_SED_CMDS.dg1+=	-e 's,^\(MACHINE[_ARCH]* *=\) .*,\1 ,'
 STD_SED_CMDS.dg1+=	-e 's,^\(MAKE *=\) .*,\1 ,'
 STD_SED_CMDS.dg1+=	-e 's,^\(\.SHELL *=\) .*,\1 ,'

Index: src/usr.bin/make/unit-tests/opt-debug-graph1.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.11 src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.12
--- src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.11	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/opt-debug-graph1.exp	Sat Sep  9 16:41:04 2023
@@ -21,6 +21,7 @@
 .MAKE= 
 .MAKE.DEPENDFILE = 
 .MAKE.GID= 
+.MAKE.JOBS.C = 
 .MAKE.LEVEL  = 
 .MAKE.MAKEFILES  = 
 .MAKE.MAKEFILE_PREFERENCE = 

Index: src/usr.bin/make/unit-tests/opt-debug-graph2.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.6 src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.7
--- src/usr.bin/make/unit-tests/opt-debug-graph2.exp:1.6	Tue Jan 24 00:24:02 2023
+++ src/usr.bin/make/unit-tests/opt-debug-graph2.exp	Sat Sep  9 16:41:04 2023
@@ -55,6 +55,7 @@ all : made-target error-targ
 .MAKE= 
 .MAKE.DEPENDFILE = 
 .MAKE.GID= 
+.MAKE.JOBS.C = 
 .MAKE.LEVEL  = 
 .MAKE.MAKEFILES  = 
 .MAKE.MAKEFILE_PREFERENCE = 
Index: src/usr.bin/make/unit-tests/opt-debug-graph3.exp
diff -u 

CVS commit: src/usr.bin/make

2023-09-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Sep  9 16:41:04 UTC 2023

Modified Files:
src/usr.bin/make: main.c make.1
src/usr.bin/make/unit-tests: Makefile opt-debug-graph1.exp
opt-debug-graph2.exp opt-debug-graph3.exp suff-main-several.exp
suff-transform-debug.exp

Log Message:
Add .MAKE.JOBS.C to indicate wether -jC is supported


To generate a diff of this commit:
cvs rdiff -u -r1.595 -r1.596 src/usr.bin/make/main.c
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/make.1
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt-debug-graph2.exp \
src/usr.bin/make/unit-tests/opt-debug-graph3.exp \
src/usr.bin/make/unit-tests/suff-transform-debug.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/suff-main-several.exp

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



CVS commit: src/sys

2023-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep  9 16:01:09 UTC 2023

Modified Files:
src/sys/kern: init_sysctl.c kern_sysctl.c
src/sys/sys: systm.h

Log Message:
Move the initialization of the random hash for addresses earlier so that
it does not happen under a spin lock context (when it is first used).


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/kern/init_sysctl.c
cvs rdiff -u -r1.269 -r1.270 src/sys/kern/kern_sysctl.c
cvs rdiff -u -r1.304 -r1.305 src/sys/sys/systm.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/kern/init_sysctl.c
diff -u src/sys/kern/init_sysctl.c:1.227 src/sys/kern/init_sysctl.c:1.228
--- src/sys/kern/init_sysctl.c:1.227	Sun Sep 20 08:51:57 2020
+++ src/sys/kern/init_sysctl.c	Sat Sep  9 12:01:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_sysctl.c,v 1.227 2020/09/20 12:51:57 skrll Exp $ */
+/*	$NetBSD: init_sysctl.c,v 1.228 2023/09/09 16:01:09 christos Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.227 2020/09/20 12:51:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.228 2023/09/09 16:01:09 christos Exp $");
 
 #include "opt_sysv.h"
 #include "opt_compat_netbsd.h"
@@ -1065,6 +1065,8 @@ sysctl_kern_lwp(SYSCTLFN_ARGS)
 	int buflen, needed, error;
 	bool gotit;
 
+	hash_value_ensure_initialized();
+
 	if (namelen == 1 && name[0] == CTL_QUERY)
 		return (sysctl_query(SYSCTLFN_CALL(rnode)));
 

Index: src/sys/kern/kern_sysctl.c
diff -u src/sys/kern/kern_sysctl.c:1.269 src/sys/kern/kern_sysctl.c:1.270
--- src/sys/kern/kern_sysctl.c:1.269	Sun Apr  9 05:18:09 2023
+++ src/sys/kern/kern_sysctl.c	Sat Sep  9 12:01:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sysctl.c,v 1.269 2023/04/09 09:18:09 riastradh Exp $	*/
+/*	$NetBSD: kern_sysctl.c,v 1.270 2023/09/09 16:01:09 christos 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.269 2023/04/09 09:18:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.270 2023/09/09 16:01:09 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_defcorename.h"
@@ -2843,9 +2843,15 @@ random_address_init(void)
 }
 
 void
-hash_value(void *d, size_t ds, const void *s, size_t ss)
+hash_value_ensure_initialized(void)
 {
 
 	RUN_ONCE(_inithook, random_address_init);
+}
+
+void
+hash_value(void *d, size_t ds, const void *s, size_t ss)
+{
+
 	blake2s(d, ds, address_key, sizeof(address_key), s, ss);
 }

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.304 src/sys/sys/systm.h:1.305
--- src/sys/sys/systm.h:1.304	Fri Sep  8 20:15:09 2023
+++ src/sys/sys/systm.h	Sat Sep  9 12:01:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.304 2023/09/09 00:15:09 riastradh Exp $	*/
+/*	$NetBSD: systm.h,v 1.305 2023/09/09 16:01:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -235,6 +235,8 @@ enum hashtype {
 	} while (/*CONSTCOND*/0)
 
 void	hash_value(void *, size_t, const void *, size_t);
+void	hash_value_ensure_initialized(void);
+
 bool	get_expose_address(struct proc *);
 void	*hashinit(u_int, enum hashtype, bool, u_long *);
 void	hashdone(void *, enum hashtype, u_long);



CVS commit: src/sys

2023-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep  9 16:01:09 UTC 2023

Modified Files:
src/sys/kern: init_sysctl.c kern_sysctl.c
src/sys/sys: systm.h

Log Message:
Move the initialization of the random hash for addresses earlier so that
it does not happen under a spin lock context (when it is first used).


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/kern/init_sysctl.c
cvs rdiff -u -r1.269 -r1.270 src/sys/kern/kern_sysctl.c
cvs rdiff -u -r1.304 -r1.305 src/sys/sys/systm.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/doc

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 15:02:43 UTC 2023

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

Log Message:
Tickets #358 - #360


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.120 -r1.1.2.121 src/doc/CHANGES-10.0

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.0
diff -u src/doc/CHANGES-10.0:1.1.2.120 src/doc/CHANGES-10.0:1.1.2.121
--- src/doc/CHANGES-10.0:1.1.2.120	Fri Sep  8 09:07:19 2023
+++ src/doc/CHANGES-10.0	Sat Sep  9 15:02:43 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.120 2023/09/08 09:07:19 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.121 2023/09/09 15:02:43 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -11825,3 +11825,22 @@ lib/libpam/modules/pam_ksu/pam_ksu.c		1.
 	pam_ksu(8): allow homedir access during kuserok.
 	[riastradh, ticket #357]
 
+usr.sbin/sysinst/util.c1.73
+
+	sysinst: set up trust anchors on fresh installs.
+	[riastradh, ticket #358]
+
+sys/dev/raidframe/rf_reconstruct.c		1.128
+
+	raidframe: fix memory leaks (prevent diagnostic on shutdown).
+	[oster, ticket #359]
+
+sys/arch/sparc64/dev/fdc.c			1.52
+sys/arch/sparc64/include/intr.h			1.32
+sys/arch/sparc64/include/psl.h			1.64
+sys/arch/sparc64/sparc64/autoconf.c		1.239
+
+	sparc64: fix interrupt level mapping for disk and and parallel devices
+	on SBUS-based machines
+	[jdc, ticket #360]
+



CVS commit: [netbsd-10] src/doc

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 15:02:43 UTC 2023

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

Log Message:
Tickets #358 - #360


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.120 -r1.1.2.121 src/doc/CHANGES-10.0

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

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 15:01:25 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev [netbsd-10]: fdc.c
src/sys/arch/sparc64/include [netbsd-10]: intr.h psl.h
src/sys/arch/sparc64/sparc64 [netbsd-10]: autoconf.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #360):

sys/arch/sparc64/dev/fdc.c: revision 1.52
sys/arch/sparc64/include/intr.h: revision 1.32
sys/arch/sparc64/sparc64/autoconf.c: revision 1.239
sys/arch/sparc64/include/psl.h: revision 1.64

sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines

Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)

Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c

Add "socal" and "SUNW,bpp" to the interrupt map.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.6.1 src/sys/arch/sparc64/dev/fdc.c
cvs rdiff -u -r1.31 -r1.31.70.1 src/sys/arch/sparc64/include/intr.h
cvs rdiff -u -r1.62.4.1 -r1.62.4.2 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.238 -r1.238.4.1 src/sys/arch/sparc64/sparc64/autoconf.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

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 15:01:25 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev [netbsd-10]: fdc.c
src/sys/arch/sparc64/include [netbsd-10]: intr.h psl.h
src/sys/arch/sparc64/sparc64 [netbsd-10]: autoconf.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #360):

sys/arch/sparc64/dev/fdc.c: revision 1.52
sys/arch/sparc64/include/intr.h: revision 1.32
sys/arch/sparc64/sparc64/autoconf.c: revision 1.239
sys/arch/sparc64/include/psl.h: revision 1.64

sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines

Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)

Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c

Add "socal" and "SUNW,bpp" to the interrupt map.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.6.1 src/sys/arch/sparc64/dev/fdc.c
cvs rdiff -u -r1.31 -r1.31.70.1 src/sys/arch/sparc64/include/intr.h
cvs rdiff -u -r1.62.4.1 -r1.62.4.2 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.238 -r1.238.4.1 src/sys/arch/sparc64/sparc64/autoconf.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/dev/fdc.c
diff -u src/sys/arch/sparc64/dev/fdc.c:1.51 src/sys/arch/sparc64/dev/fdc.c:1.51.6.1
--- src/sys/arch/sparc64/dev/fdc.c:1.51	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/fdc.c	Sat Sep  9 15:01:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: fdc.c,v 1.51.6.1 2023/09/09 15:01:24 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.51.6.1 2023/09/09 15:01:24 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -825,7 +825,7 @@ fdcattach(struct fdc_softc *fdc, int pri
 #ifdef SUN4
 	printf(" softpri %d: chip 8207%c\n", IPL_SOFTFDC, code);
 #elif SUN4U
-	printf(" softpri %d: chip 8207%c", PIL_FDSOFT, code);
+	printf(" softpri %d: chip 8207%c", IPL_BIO, code);
 	if (fdc->sc_flags & FDC_NOEJECT)
 		printf(": manual eject");
 	printf("\n");

Index: src/sys/arch/sparc64/include/intr.h
diff -u src/sys/arch/sparc64/include/intr.h:1.31 src/sys/arch/sparc64/include/intr.h:1.31.70.1
--- src/sys/arch/sparc64/include/intr.h:1.31	Fri Jul 27 05:36:12 2012
+++ src/sys/arch/sparc64/include/intr.h	Sat Sep  9 15:01:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.31 2012/07/27 05:36:12 matt Exp $ */
+/*	$NetBSD: intr.h,v 1.31.70.1 2023/09/09 15:01:24 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,6 @@
 #define	IPL_HIGH	PIL_HIGH	/* everything */
 #define	IPL_HALT	5		/* cpu stop-self */
 #define	IPL_PAUSE	13		/* pause cpu */
-#define	IPL_FDSOFT	PIL_FDSOFT	/* floppy */
 
 /*
  * IPL_SAFEPRI is a safe priority for sleep to set for a spin-wait

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.62.4.1 src/sys/arch/sparc64/include/psl.h:1.62.4.2
--- src/sys/arch/sparc64/include/psl.h:1.62.4.1	Wed Aug  9 17:42:03 2023
+++ src/sys/arch/sparc64/include/psl.h	Sat Sep  9 15:01:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.62.4.1 2023/08/09 17:42:03 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.62.4.2 2023/09/09 15:01:24 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -73,9 +73,6 @@
 #define PSR_BITS "\20\16EC\15EF\10S\7PS\6ET"
 
 /* Interesting spl()s */
-#define PIL_SCSI	3
-#define PIL_FDSOFT	4
-#define PIL_AUSOFT	4
 #define PIL_BIO		5
 #define PIL_VIDEO	5
 #define PIL_TTY		6
@@ -514,12 +511,6 @@ SPLHOLD(splsoftint, 1)
 
 SPLHOLD(splsoftserial, 4)
 
-/* audio software interrupts are at software level 4 */
-SPLHOLD(splausoft, PIL_AUSOFT)
-
-/* floppy software interrupts are at software level 4 too */
-SPLHOLD(splfdsoft, PIL_FDSOFT)
-
 /*
  * Memory allocation (must be as high as highest network, tty, or disk device)
  */

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.238 src/sys/arch/sparc64/sparc64/autoconf.c:1.238.4.1
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.238	Sat Jan 22 11:49:17 2022
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sat Sep  9 15:01:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.238.4.1 2023/09/09 15:01:24 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.238.4.1 2023/09/09 15:01:24 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -165,19 +165,22 @@ int kernel_dtlb_slots;
 int kernel_itlb_slots;
 
 /* Global interrupt mappings for all 

CVS commit: [netbsd-9] src/doc

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:57:22 UTC 2023

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

Log Message:
Ticket #1729


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

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

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.98 src/doc/CHANGES-9.4:1.1.2.99
--- src/doc/CHANGES-9.4:1.1.2.98	Fri Sep  8 09:09:08 2023
+++ src/doc/CHANGES-9.4	Sat Sep  9 14:57:22 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.98 2023/09/08 09:09:08 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.99 2023/09/09 14:57:22 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -2111,3 +2111,8 @@ lib/libpam/modules/pam_ksu/pam_ksu.c		1.
 	pam_ksu(8): allow homedir access during kuserok.
 	[riastradh, ticket #1728]
 
+sys/dev/raidframe/rf_reconstruct.c		1.128
+
+	raidframe: fix memory leaks (prevent diagnostic on shutdown).
+	[oster, ticket #1729]
+



CVS commit: [netbsd-9] src/doc

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:57:22 UTC 2023

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

Log Message:
Ticket #1729


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

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



CVS commit: [netbsd-9] src/sys/dev/raidframe

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:56:10 UTC 2023

Modified Files:
src/sys/dev/raidframe [netbsd-9]: rf_reconstruct.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #1729):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.


To generate a diff of this commit:
cvs rdiff -u -r1.122.4.1 -r1.122.4.2 src/sys/dev/raidframe/rf_reconstruct.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/raidframe/rf_reconstruct.c
diff -u src/sys/dev/raidframe/rf_reconstruct.c:1.122.4.1 src/sys/dev/raidframe/rf_reconstruct.c:1.122.4.2
--- src/sys/dev/raidframe/rf_reconstruct.c:1.122.4.1	Wed Feb 17 09:34:20 2021
+++ src/sys/dev/raidframe/rf_reconstruct.c	Sat Sep  9 14:56:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconstruct.c,v 1.122.4.1 2021/02/17 09:34:20 martin Exp $	*/
+/*	$NetBSD: rf_reconstruct.c,v 1.122.4.2 2023/09/09 14:56:10 martin Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  /
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.122.4.1 2021/02/17 09:34:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.122.4.2 2023/09/09 14:56:10 martin Exp $");
 
 #include 
 #include 
@@ -892,24 +892,11 @@ rf_ContinueReconstructFailedDisk(RF_Raid
 
 		rf_DrainReconEventQueue(reconDesc);
 
-		/* XXX  As much as we'd like to free the recon control structure
-		   and the reconDesc, we have no way of knowing if/when those will
-		   be touched by IO that has yet to occur.  It is rather poor to be
-		   basically causing a 'memory leak' here, but there doesn't seem to be
-		   a cleaner alternative at this time.  Perhaps when the reconstruct code
-		   gets a makeover this problem will go away.
-		*/
-#if 0
 		rf_FreeReconControl(raidPtr);
-#endif
-
 #if RF_ACC_TRACE > 0
 		RF_Free(raidPtr->recon_tracerecs, raidPtr->numCol * sizeof(RF_AccTraceEntry_t));
 #endif
-		/* XXX see comment above */
-#if 0
 		FreeReconDesc(reconDesc);
-#endif
 
 		return (1);
 	}



CVS commit: [netbsd-9] src/sys/dev/raidframe

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:56:10 UTC 2023

Modified Files:
src/sys/dev/raidframe [netbsd-9]: rf_reconstruct.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #1729):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.


To generate a diff of this commit:
cvs rdiff -u -r1.122.4.1 -r1.122.4.2 src/sys/dev/raidframe/rf_reconstruct.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/raidframe

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:54:38 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by oster in ticket #359):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.127.10.1 src/sys/dev/raidframe/rf_reconstruct.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/raidframe/rf_reconstruct.c
diff -u src/sys/dev/raidframe/rf_reconstruct.c:1.127 src/sys/dev/raidframe/rf_reconstruct.c:1.127.10.1
--- src/sys/dev/raidframe/rf_reconstruct.c:1.127	Tue Jul 27 03:01:48 2021
+++ src/sys/dev/raidframe/rf_reconstruct.c	Sat Sep  9 14:54:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconstruct.c,v 1.127 2021/07/27 03:01:48 oster Exp $	*/
+/*	$NetBSD: rf_reconstruct.c,v 1.127.10.1 2023/09/09 14:54:38 martin Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  /
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.127 2021/07/27 03:01:48 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.127.10.1 2023/09/09 14:54:38 martin Exp $");
 
 #include 
 #include 
@@ -897,24 +897,11 @@ rf_ContinueReconstructFailedDisk(RF_Raid
 
 		rf_DrainReconEventQueue(reconDesc);
 
-		/* XXX  As much as we'd like to free the recon control structure
-		   and the reconDesc, we have no way of knowing if/when those will
-		   be touched by IO that has yet to occur.  It is rather poor to be
-		   basically causing a 'memory leak' here, but there doesn't seem to be
-		   a cleaner alternative at this time.  Perhaps when the reconstruct code
-		   gets a makeover this problem will go away.
-		*/
-#if 0
 		rf_FreeReconControl(raidPtr);
-#endif
-
 #if RF_ACC_TRACE > 0
 		RF_Free(raidPtr->recon_tracerecs, raidPtr->numCol * sizeof(RF_AccTraceEntry_t));
 #endif
-		/* XXX see comment above */
-#if 0
 		FreeReconDesc(reconDesc);
-#endif
 
 		return (1);
 	}



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

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:54:38 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by oster in ticket #359):

sys/dev/raidframe/rf_reconstruct.c: revision 1.128

Revision 1.104 actually fixed the issues that were preventing
us from freeing the ReconControl structures.  So free them
and thus also prevent a panic on shutdown due to items not
being correctly returned to the pool.

Thanks to manu@ for report of the panic, and for initial testing
of the changes.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.127.10.1 src/sys/dev/raidframe/rf_reconstruct.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/usr.sbin/sysinst

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:50:15 UTC 2023

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

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

usr.sbin/sysinst/util.c: revision 1.73

sysinst(1): Run `certctl rehash' on fresh installs.

It has come to my attention that sysinst does not, in fact, run
postinstall(8) post-install -- only post-upgrade.

Perhaps we should change this so that postinstall serves the purpose
it says on the box -- make postinstall mandatory for new
installations.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.2.1 src/usr.sbin/sysinst/util.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/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.71 src/usr.sbin/sysinst/util.c:1.71.2.1
--- src/usr.sbin/sysinst/util.c:1.71	Thu Dec 15 20:34:46 2022
+++ src/usr.sbin/sysinst/util.c	Sat Sep  9 14:50:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.71 2022/12/15 20:34:46 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.71.2.1 2023/09/09 14:50:15 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1524,8 +1524,13 @@ get_and_unpack_sets(int update, msg setu
 	}
 
 	/* Configure the system */
-	if (set_status[SET_BASE] & SET_INSTALLED)
+	if (set_status[SET_BASE] & SET_INSTALLED) {
 		run_makedev();
+		if (!update) {
+			run_program(RUN_CHROOT|RUN_DISPLAY,
+			"/usr/sbin/certctl rehash");
+		}
+	}
 
 	if (!update) {
 		struct stat sb1, sb2;



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

2023-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  9 14:50:15 UTC 2023

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

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

usr.sbin/sysinst/util.c: revision 1.73

sysinst(1): Run `certctl rehash' on fresh installs.

It has come to my attention that sysinst does not, in fact, run
postinstall(8) post-install -- only post-upgrade.

Perhaps we should change this so that postinstall serves the purpose
it says on the box -- make postinstall mandatory for new
installations.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.2.1 src/usr.sbin/sysinst/util.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/hpcmips/conf

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 09:38:02 UTC 2023

Modified Files:
src/sys/arch/hpcmips/conf: VR41XX

Log Message:
add "midi* at midibus?" to hpmips VR41XX kernel config.
it is needed for umidi to build and makes this config to build as well.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/hpcmips/conf/VR41XX

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/hpcmips/conf/VR41XX
diff -u src/sys/arch/hpcmips/conf/VR41XX:1.76 src/sys/arch/hpcmips/conf/VR41XX:1.77
--- src/sys/arch/hpcmips/conf/VR41XX:1.76	Tue Jun 29 10:22:35 2021
+++ src/sys/arch/hpcmips/conf/VR41XX	Sat Sep  9 09:38:02 2023
@@ -1,4 +1,4 @@
-# $NetBSD: VR41XX,v 1.76 2021/06/29 10:22:35 nia Exp $
+# $NetBSD: VR41XX,v 1.77 2023/09/09 09:38:02 andvar Exp $
 #
 # GENERIC machine description file
 # 
@@ -20,7 +20,7 @@
 
 include		"arch/hpcmips/conf/std.hpcmips"
 include		"arch/hpcmips/conf/std.hpcmips.vr41"
-#ident 		"GENERIC-$Revision: 1.76 $"
+#ident 		"GENERIC-$Revision: 1.77 $"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
@@ -451,6 +451,7 @@ scsibus* at umass? channel ?
 
 # USB audio
 uaudio*	at uhub? port ? configuration ?
+midi*	at midibus?
 
 # USB MIDI
 umidi* at uhub? port ? configuration ?



CVS commit: src/sys/arch/hpcmips/conf

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 09:38:02 UTC 2023

Modified Files:
src/sys/arch/hpcmips/conf: VR41XX

Log Message:
add "midi* at midibus?" to hpmips VR41XX kernel config.
it is needed for umidi to build and makes this config to build as well.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/hpcmips/conf/VR41XX

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



CVS commit: src/sys/arch/hpcarm/hpcarm

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 07:07:03 UTC 2023

Modified Files:
src/sys/arch/hpcarm/hpcarm: netbookpro_machdep.c

Log Message:
fix DEVMAP_ENTRY list termination symbol.

Makes hpcarm NETBOOKPRO config build again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c

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

Modified files:

Index: src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c:1.3 src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c:1.4
--- src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c:1.3	Fri Apr 21 15:00:27 2023
+++ src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c	Sat Sep  9 07:07:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbookpro_machdep.c,v 1.3 2023/04/21 15:00:27 skrll Exp $	*/
+/*	$NetBSD: netbookpro_machdep.c,v 1.4 2023/09/09 07:07:03 andvar Exp $	*/
 /*
  * Copyright (c) 2011 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbookpro_machdep.c,v 1.3 2023/04/21 15:00:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbookpro_machdep.c,v 1.4 2023/09/09 07:07:03 andvar Exp $");
 
 #include 
 #include 
@@ -70,7 +70,7 @@ const struct pmap_devmap machdep_devmap[
 		0x1400,
 		0x1400,
 		0x0040
-	},
+	),
 	DEVMAP_ENTRY_END
 };
 



CVS commit: src/sys/arch/hpcarm/hpcarm

2023-09-09 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep  9 07:07:03 UTC 2023

Modified Files:
src/sys/arch/hpcarm/hpcarm: netbookpro_machdep.c

Log Message:
fix DEVMAP_ENTRY list termination symbol.

Makes hpcarm NETBOOKPRO config build again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hpcarm/hpcarm/netbookpro_machdep.c

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