CVS commit: src/usr.sbin/tprof/arch

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 12 02:15:51 UTC 2023

Modified Files:
src/usr.sbin/tprof/arch: tprof_x86.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/tprof/arch/tprof_x86.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/tprof/arch/tprof_x86.c
diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.16 src/usr.sbin/tprof/arch/tprof_x86.c:1.17
--- src/usr.sbin/tprof/arch/tprof_x86.c:1.16	Mon Apr 10 06:08:56 2023
+++ src/usr.sbin/tprof/arch/tprof_x86.c	Wed Apr 12 02:15:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86.c,v 1.16 2023/04/10 06:08:56 msaitoh Exp $	*/
+/*	$NetBSD: tprof_x86.c,v 1.17 2023/04/12 02:15:51 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,8 @@ struct event_table {
 
 static struct event_table *cpuevents = NULL;
 
-static void x86_cpuid(unsigned int *eax, unsigned int *ebx,
+static void
+x86_cpuid(unsigned int *eax, unsigned int *ebx,
 unsigned int *ecx, unsigned int *edx)
 {
 	asm volatile("cpuid"
@@ -429,7 +430,7 @@ static struct name_to_event intel_skylak
 	{ "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO",	0x60, 0x04, true },
 	{ "OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD",	0x60, 0x08, true },
 	{ "OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD",
-	  		0x60, 0x10, true },
+			0x60, 0x10, true },
 	{ "IDQ.MITE_UOPS",0x79, 0x04, true },
 	{ "IDQ.DSB_UOPS",0x79, 0x08, true },
 	{ "IDQ.MS_MITE_UOPS",0x79, 0x20, true },



CVS commit: src/usr.sbin/tprof/arch

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 12 02:15:51 UTC 2023

Modified Files:
src/usr.sbin/tprof/arch: tprof_x86.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/tprof/arch/tprof_x86.c

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



Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Michael van Elst
On Wed, Apr 12, 2023 at 01:10:40AM +0700, Robert Elz wrote:
> 
>   | In that state then decrementing dk_rawopens beyond zero will make
>   | dklastclose do the right thing: nothing.
> 
> Except that if that happens, dk_rawopens will be left == ~0 and the next
> open attempt will then increment it, back to 0 again, which is almost
> certainly not what was wanted.
> 
> dklastclose() used to have code in it like
> 
>   if (...->dk_rawopens > 0) {
>   if (--...->dk_rawopens == 0)


Indeed, that part was simplified away.


-- 
Michael van Elst
Internet: mlel...@serpens.de
"A potential Snark may lurk in every tree."


CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:40:05 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix converting a complex floating-point constant

The complex '+' in msg_142 line 27 led to an invalid floating point
value when converting from 'double' to '_Complex double'.


To generate a diff of this commit:
cvs rdiff -u -r1.510 -r1.511 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.510 src/usr.bin/xlint/lint1/tree.c:1.511
--- src/usr.bin/xlint/lint1/tree.c:1.510	Tue Apr 11 19:07:08 2023
+++ src/usr.bin/xlint/lint1/tree.c	Tue Apr 11 19:40:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.510 2023/04/11 19:07:08 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.511 2023/04/11 19:40:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.510 2023/04/11 19:07:08 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.511 2023/04/11 19:40:04 rillig Exp $");
 #endif
 
 #include 
@@ -3646,11 +3646,11 @@ convert_constant_floating(op_t op, int a
 		v->v_ldbl = v->v_ldbl > 0 ? max : min;
 	}
 
-	if (nt == FLOAT) {
+	if (nt == FLOAT || nt == FCOMPLEX) {
 		nv->v_ldbl = (float)v->v_ldbl;
-	} else if (nt == DOUBLE) {
+	} else if (nt == DOUBLE || nt == DCOMPLEX) {
 		nv->v_ldbl = (double)v->v_ldbl;
-	} else if (nt == LDOUBLE) {
+	} else if (nt == LDOUBLE || nt == LCOMPLEX) {
 		nv->v_ldbl = v->v_ldbl;
 	} else {
 		nv->v_quad = (int64_t)v->v_ldbl;



CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:40:05 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix converting a complex floating-point constant

The complex '+' in msg_142 line 27 led to an invalid floating point
value when converting from 'double' to '_Complex double'.


To generate a diff of this commit:
cvs rdiff -u -r1.510 -r1.511 src/usr.bin/xlint/lint1/tree.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/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:07:08 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix wrong warning about overflow in floating constant expressions


To generate a diff of this commit:
cvs rdiff -u -r1.509 -r1.510 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.509 src/usr.bin/xlint/lint1/tree.c:1.510
--- src/usr.bin/xlint/lint1/tree.c:1.509	Tue Apr 11 19:02:19 2023
+++ src/usr.bin/xlint/lint1/tree.c	Tue Apr 11 19:07:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.509 2023/04/11 19:02:19 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.510 2023/04/11 19:07:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.509 2023/04/11 19:02:19 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.510 2023/04/11 19:07:08 rillig Exp $");
 #endif
 
 #include 
@@ -1507,12 +1507,7 @@ floating_error_value(tspec_t t, ldbl_t l
 		return lv < 0 ? -FLT_MAX : FLT_MAX;
 	if (t == DOUBLE)
 		return lv < 0 ? -DBL_MAX : DBL_MAX;
-
-	/* FIXME: Remove the '(double)' cast near 'isfinite'. */
-	/* FIXME: Inlining the variable 'max' produces a wrong warning. */
-	/* LINTED 248: floating-point constant out of range */
-	ldbl_t max = LDBL_MAX;
-	return lv < 0 ? -max : max;
+	return lv < 0 ? -LDBL_MAX : LDBL_MAX;
 }
 
 /*
@@ -1584,14 +1579,14 @@ fold_float(tnode_t *tn)
 		lint_assert(/*CONSTCOND*/false);
 	}
 
-	lint_assert(fpe != 0 || isnan((double)v->v_ldbl) == 0);
+	lint_assert(fpe != 0 || isnan(v->v_ldbl) == 0);
 	if (is_complex(v->v_tspec)) {
 		/*
 		 * Don't warn, as lint doesn't model the imaginary part of
 		 * complex numbers.
 		 */
 		fpe = 0;
-	} else if (fpe != 0 || isfinite((double)v->v_ldbl) == 0 ||
+	} else if (fpe != 0 || isfinite(v->v_ldbl) == 0 ||
 	(t == FLOAT &&
 	 (v->v_ldbl > FLT_MAX || v->v_ldbl < -FLT_MAX)) ||
 	(t == DOUBLE &&



CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:07:08 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix wrong warning about overflow in floating constant expressions


To generate a diff of this commit:
cvs rdiff -u -r1.509 -r1.510 src/usr.bin/xlint/lint1/tree.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/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:02:19 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: mem1.c tree.c

Log Message:
lint: condense code

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.508 -r1.509 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.64 src/usr.bin/xlint/lint1/mem1.c:1.65
--- src/usr.bin/xlint/lint1/mem1.c:1.64	Fri Jan 13 19:41:50 2023
+++ src/usr.bin/xlint/lint1/mem1.c	Tue Apr 11 19:02:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.64 2023/01/13 19:41:50 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.65 2023/04/11 19:02:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: mem1.c,v 1.64 2023/01/13 19:41:50 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.65 2023/04/11 19:02:19 rillig Exp $");
 #endif
 
 #include 
@@ -122,18 +122,16 @@ transform_filename(const char *name, siz
 const char *
 record_filename(const char *s, size_t slen)
 {
-	const struct filename *existing_fn;
-	struct filename *fn;
-	char *name;
 
-	if ((existing_fn = search_filename(s, slen)) != NULL)
+	const struct filename *existing_fn = search_filename(s, slen);
+	if (existing_fn != NULL)
 		return existing_fn->fn_name;
 
-	name = xmalloc(slen + 1);
+	char *name = xmalloc(slen + 1);
 	(void)memcpy(name, s, slen);
 	name[slen] = '\0';
 
-	fn = xmalloc(sizeof(*fn));
+	struct filename *fn = xmalloc(sizeof(*fn));
 	fn->fn_name = name;
 	fn->fn_len = slen;
 	fn->fn_id = next_filename_id++;
@@ -160,12 +158,12 @@ get_filename_id(const char *s)
 	return fn->fn_id;
 }
 
-/* Array of memory pools, indexed by mem_block_level. */
 typedef struct memory_pools {
 	struct memory_pool *pools;
 	size_t	cap;
 } memory_pools;
 
+/* Array of memory pools, indexed by mem_block_level. */
 static memory_pools mpools;
 
 /* The pool for the current expression is independent of any block level. */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.508 src/usr.bin/xlint/lint1/tree.c:1.509
--- src/usr.bin/xlint/lint1/tree.c:1.508	Tue Apr 11 00:03:42 2023
+++ src/usr.bin/xlint/lint1/tree.c	Tue Apr 11 19:02:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.508 2023/04/11 00:03:42 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.509 2023/04/11 19:02:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.508 2023/04/11 00:03:42 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.509 2023/04/11 19:02:19 rillig Exp $");
 #endif
 
 #include 
@@ -1503,15 +1503,16 @@ fold_bool(tnode_t *tn)
 static ldbl_t
 floating_error_value(tspec_t t, ldbl_t lv)
 {
-	if (t == FLOAT) {
+	if (t == FLOAT)
 		return lv < 0 ? -FLT_MAX : FLT_MAX;
-	} else if (t == DOUBLE) {
+	if (t == DOUBLE)
 		return lv < 0 ? -DBL_MAX : DBL_MAX;
-	} else {
-		/* LINTED 248: floating-point constant out of range */
-		ldbl_t max = LDBL_MAX;
-		return lv < 0 ? -max : max;
-	}
+
+	/* FIXME: Remove the '(double)' cast near 'isfinite'. */
+	/* FIXME: Inlining the variable 'max' produces a wrong warning. */
+	/* LINTED 248: floating-point constant out of range */
+	ldbl_t max = LDBL_MAX;
+	return lv < 0 ? -max : max;
 }
 
 /*
@@ -1885,13 +1886,10 @@ struct_or_union_member(tnode_t *tn, op_t
 	if (str != NULL) {
 		for (sym_t *sym = msym;
 		 sym != NULL; sym = sym->s_symtab_next) {
-			if (!is_member(sym))
-continue;
-			if (sym->u.s_member.sm_sou_type != str)
-continue;
-			if (strcmp(sym->s_name, msym->s_name) != 0)
-continue;
-			return sym;
+			if (is_member(sym) &&
+			sym->u.s_member.sm_sou_type == str &&
+			strcmp(sym->s_name, msym->s_name) == 0)
+return sym;
 		}
 	}
 
@@ -1977,8 +1975,6 @@ build_member_access(tnode_t *ln, op_t op
 tnode_t *
 cconv(tnode_t *tn)
 {
-	type_t	*tp;
-
 	/*
 	 * Array-lvalue (array of type T) is converted into rvalue
 	 * (pointer to type T)
@@ -2003,7 +1999,7 @@ cconv(tnode_t *tn)
 
 	/* lvalue to rvalue */
 	if (tn->tn_lvalue) {
-		tp = expr_dup_type(tn->tn_type);
+		type_t *tp = expr_dup_type(tn->tn_type);
 		/* C99 6.3.2.1p2 sentence 2 says to remove the qualifiers. */
 		tp->t_const = tp->t_volatile = false;
 		tn = new_tnode(LOAD, tn->tn_sys, tp, tn, NULL);
@@ -2083,10 +2079,10 @@ typeok_incdec(op_t op, const tnode_t *tn
 		/* %soperand of '%s' must be lvalue */
 		error(114, "", op_name(op));
 		return false;
-	} else if (tp->t_const) {
-		if (allow_c90)
-			/* %soperand of '%s' must be modifiable lvalue */
-			warning(115, "", op_name(op));
+	}
+	if (tp->t_const && allow_c90) {
+		/* %soperand of '%s' must be modifiable lvalue */
+		warning(115, "", op_name(op));
 	}
 	return true;
 }
@@ -2137,18 +2133,12 @@ typeok_indir(const type_t 

CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 19:02:19 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: mem1.c tree.c

Log Message:
lint: condense code

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.508 -r1.509 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/tests/rump/rumpkern

2023-04-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Apr 11 18:23:42 UTC 2023

Modified Files:
src/tests/rump/rumpkern: t_vm.c

Log Message:
PR misc/57343 (Jim Spath) - fixed a typo in atf_tc_skip message.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/rumpkern/t_vm.c

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

Modified files:

Index: src/tests/rump/rumpkern/t_vm.c
diff -u src/tests/rump/rumpkern/t_vm.c:1.6 src/tests/rump/rumpkern/t_vm.c:1.7
--- src/tests/rump/rumpkern/t_vm.c:1.6	Fri Jan 22 22:03:01 2021
+++ src/tests/rump/rumpkern/t_vm.c	Tue Apr 11 18:23:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_vm.c,v 1.6 2021/01/22 22:03:01 chs Exp $	*/
+/*	$NetBSD: t_vm.c,v 1.7 2023/04/11 18:23:42 kre Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@ ATF_TC_BODY(busypage, tc)
 #if 0
 	atf_tc_expect_fail("test bug: unbusies an uninitialized page");
 #endif
-	atf_tc_skip("this test is buggy and hits an assertion, but atf doesn't provide any way to expect that a test program crashes, this all we can do is skip");
+	atf_tc_skip("this test is buggy and hits an assertion, but atf doesn't provide any way to expect that a test program crashes, thus all we can do is skip");
 	rump_init();
 
 	rump_schedule();



CVS commit: src/tests/rump/rumpkern

2023-04-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Apr 11 18:23:42 UTC 2023

Modified Files:
src/tests/rump/rumpkern: t_vm.c

Log Message:
PR misc/57343 (Jim Spath) - fixed a typo in atf_tc_skip message.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/rumpkern/t_vm.c

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



Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Robert Elz
Date:Tue, 11 Apr 2023 17:21:17 +0200
From:Michael van Elst 
Message-ID:  

  | In that state then decrementing dk_rawopens beyond zero will make
  | dklastclose do the right thing: nothing.

Except that if that happens, dk_rawopens will be left == ~0 and the next
open attempt will then increment it, back to 0 again, which is almost
certainly not what was wanted.

dklastclose() used to have code in it like

if (...->dk_rawopens > 0) {
if (--...->dk_rawopens == 0)

so that the -- would never be performed if rawopens was 0 when entered.

  | When you want to check for overflows of dk_rawopens (which is difficult
  | to overflow as you had to create 2^32 wedges)

It wasn't the overflow that Taylor meant, but this underflow (from 0 -> ~0)
which might be a problem.

(Not really relevant, but it wouldn't be 2^32 wedges, but 2^32 simultaneous
opens of any single wedge, right ... but that's not the real issue, that one
probably can't happen on any normal system, the file table could never get
big enough to allow 2^32 simultaneous opens of everything, let alone one
device).

Either dklastclose() can be called when dk_rawopens == 0 (in which case
the current code is broken) or it cannot, in which case the assertion would
have just verified that.

kre



CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 17:52:11 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: debug.c externs1.h

Log Message:
lint: in debug mode, use different names for macro and function

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/xlint/lint1/externs1.h

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/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.27 src/usr.bin/xlint/lint1/debug.c:1.28
--- src/usr.bin/xlint/lint1/debug.c:1.27	Mon Apr 10 23:56:30 2023
+++ src/usr.bin/xlint/lint1/debug.c	Tue Apr 11 17:52:11 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.27 2023/04/10 23:56:30 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.28 2023/04/11 17:52:11 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.27 2023/04/10 23:56:30 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.28 2023/04/11 17:52:11 rillig Exp $");
 #endif
 
 #include 
@@ -81,7 +81,7 @@ debug_indent_dec(void)
 }
 
 void
-(debug_enter)(const char *func)
+debug_enter_func(const char *func)
 {
 
 	printf("%*s+ %s\n", 2 * debug_indentation++, "", func);
@@ -100,7 +100,7 @@ debug_step(const char *fmt, ...)
 }
 
 void
-(debug_leave)(const char *func)
+debug_leave_func(const char *func)
 {
 
 	printf("%*s- %s\n", 2 * --debug_indentation, "", func);

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.175 src/usr.bin/xlint/lint1/externs1.h:1.176
--- src/usr.bin/xlint/lint1/externs1.h:1.175	Tue Mar 28 14:44:35 2023
+++ src/usr.bin/xlint/lint1/externs1.h	Tue Apr 11 17:52:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.175 2023/03/28 14:44:35 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.176 2023/04/11 17:52:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -131,11 +131,11 @@ void	debug_printf(const char *fmt, ...) 
 void	debug_print_indent(void);
 void	debug_indent_inc(void);
 void	debug_indent_dec(void);
-void	debug_enter(const char *);
+void	debug_enter_func(const char *);
 void	debug_step(const char *fmt, ...) __printflike(1, 2);
-void	debug_leave(const char *);
-#define	debug_enter()		(debug_enter)(__func__)
-#define	debug_leave()		(debug_leave)(__func__)
+void	debug_leave_func(const char *);
+#define	debug_enter()		debug_enter_func(__func__)
+#define	debug_leave()		debug_leave_func(__func__)
 #else
 #define	debug_noop()		do { } while (false)
 #define	debug_dinfo(d)		debug_noop()



CVS commit: src/usr.bin/xlint/lint1

2023-04-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr 11 17:52:11 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: debug.c externs1.h

Log Message:
lint: in debug mode, use different names for macro and function

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/xlint/lint1/externs1.h

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



Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Michael van Elst
On Tue, Apr 11, 2023 at 09:07:49AM +, Taylor R Campbell wrote:
> 
> (a) how we can legitimately enter a state where the assertions are
> violated, and

dklastclose is called when the close operation ends in no more openers.
There is nothing that guarantees that any open was successful before
with the effect that dk_rawopens is > 0 and dk_rawvp is not NULL.

In that state then decrementing dk_rawopens beyond zero will make
dklastclose do the right thing: nothing.

When you want to check for overflows of dk_rawopens (which is difficult
to overflow as you had to create 2^32 wedges) you need to watch it being
incremented (also temporarily). Crashing after the fact with an assertion
in dklastclose doesn't help.

-- 
Michael van Elst
Internet: mlel...@serpens.de
"A potential Snark may lurk in every tree."


CVS commit: src/sys/ufs/lfs

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 14:50:47 UTC 2023

Modified Files:
src/sys/ufs/lfs: lfs_pages.c

Log Message:
lfs: Assert page identity doesn't change.

Forgot what I was debugging when I inserted a relookup in my local
tree months or years ago, but whatever it was, if that solved a
problem, this KDASSERT will make the problem more obvious.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/ufs/lfs/lfs_pages.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/ufs/lfs/lfs_pages.c
diff -u src/sys/ufs/lfs/lfs_pages.c:1.26 src/sys/ufs/lfs/lfs_pages.c:1.27
--- src/sys/ufs/lfs/lfs_pages.c:1.26	Sat Sep  5 16:30:13 2020
+++ src/sys/ufs/lfs/lfs_pages.c	Tue Apr 11 14:50:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_pages.c,v 1.26 2020/09/05 16:30:13 riastradh Exp $	*/
+/*	$NetBSD: lfs_pages.c,v 1.27 2023/04/11 14:50:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.26 2020/09/05 16:30:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.27 2023/04/11 14:50:47 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -499,6 +499,9 @@ retry:
 			while (pg->flags & PG_BUSY) {
 uvm_pagewait(pg, vp->v_uobj.vmobjlock, "lfsput2");
 rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
+/* XXX Page can't change identity here? */
+KDASSERT(pg ==
+uvm_pagelookup(>v_uobj, off));
 			}
 			uvm_pagelock(pg);
 			uvm_pageactivate(pg);



CVS commit: src/sys/ufs/lfs

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 14:50:47 UTC 2023

Modified Files:
src/sys/ufs/lfs: lfs_pages.c

Log Message:
lfs: Assert page identity doesn't change.

Forgot what I was debugging when I inserted a relookup in my local
tree months or years ago, but whatever it was, if that solved a
problem, this KDASSERT will make the problem more obvious.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/ufs/lfs/lfs_pages.c

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



CVS commit: src/share/misc

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 14:22:10 UTC 2023

Modified Files:
src/share/misc: style

Log Message:
style(5): Omit redundant proscription against .c externs in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/share/misc/style

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

Modified files:

Index: src/share/misc/style
diff -u src/share/misc/style:1.69 src/share/misc/style:1.70
--- src/share/misc/style:1.69	Thu Mar 30 10:39:30 2023
+++ src/share/misc/style	Tue Apr 11 14:22:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: style,v 1.69 2023/03/30 10:39:30 riastradh Exp $ */
+/* $NetBSD: style,v 1.70 2023/04/11 14:22:10 riastradh Exp $ */
 
 /*
  * The revision control tag appears first, with a blank line after it.
@@ -30,7 +30,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: style,v 1.69 2023/03/30 10:39:30 riastradh Exp $");
+__RCSID("$NetBSD: style,v 1.70 2023/04/11 14:22:10 riastradh Exp $");
 
 /*
  * VERY important single-line comments look like this.
@@ -362,10 +362,6 @@ function(int a1, int a2, float fl, int a
 	 * declarations next to their first use, and initialize
 	 * opportunistically. This avoids over-initialization and
 	 * accidental bugs caused by declaration reordering.
-	 *
-	 * Never declare extern variables in .c files.  Declare them in the
-	 * appropriate .h file shared by the .c file where they are defined
-	 * and the .c file where they are used.
 	 */
 	struct foo three, *four;
 	double five;



CVS commit: src/share/misc

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 14:22:10 UTC 2023

Modified Files:
src/share/misc: style

Log Message:
style(5): Omit redundant proscription against .c externs in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/share/misc/style

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



CVS commit: src/sys/net

2023-04-11 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Apr 11 14:03:46 UTC 2023

Modified Files:
src/sys/net: if_wg.c

Log Message:
Give scope and additional details to wg(4) diagnostic messages.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_wg.c

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

Modified files:

Index: src/sys/net/if_wg.c
diff -u src/sys/net/if_wg.c:1.75 src/sys/net/if_wg.c:1.76
--- src/sys/net/if_wg.c:1.75	Wed Apr  5 19:56:27 2023
+++ src/sys/net/if_wg.c	Tue Apr 11 14:03:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wg.c,v 1.75 2023/04/05 19:56:27 andvar Exp $	*/
+/*	$NetBSD: if_wg.c,v 1.76 2023/04/11 14:03:46 jakllsch Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki 
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.75 2023/04/05 19:56:27 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.76 2023/04/11 14:03:46 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq_enabled.h"
@@ -1477,7 +1477,8 @@ wg_handle_msg_init(struct wg_softc *wg, 
 	wgmi->wgmi_static, sizeof(wgmi->wgmi_static), hash, sizeof(hash));
 	if (error != 0) {
 		WG_LOG_RATECHECK(>wg_ppsratecheck, LOG_DEBUG,
-		"wg_algo_aead_dec for secret key failed\n");
+		"%s: wg_algo_aead_dec for secret key failed\n",
+		if_name(>wg_if));
 		return;
 	}
 	/* Hi := HASH(Hi || msg.static) */
@@ -1542,7 +1543,8 @@ wg_handle_msg_init(struct wg_softc *wg, 
 	hash, sizeof(hash));
 	if (error != 0) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"wg_algo_aead_dec for timestamp failed\n");
+		"%s: peer %s: wg_algo_aead_dec for timestamp failed\n",
+		if_name(>wg_if), wgp->wgp_name);
 		goto out;
 	}
 	/* Hi := HASH(Hi || msg.timestamp) */
@@ -1557,7 +1559,8 @@ wg_handle_msg_init(struct wg_softc *wg, 
 	sizeof(timestamp));
 	if (ret <= 0) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"invalid init msg: timestamp is old\n");
+		"%s: peer %s: invalid init msg: timestamp is old\n",
+		if_name(>wg_if), wgp->wgp_name);
 		goto out;
 	}
 	memcpy(wgp->wgp_timestamp_latest_init, timestamp, sizeof(timestamp));
@@ -1975,7 +1978,8 @@ wg_handle_msg_resp(struct wg_softc *wg, 
 	WG_DUMP_HASH("wgmr_empty", wgmr->wgmr_empty);
 	if (error != 0) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"wg_algo_aead_dec for empty message failed\n");
+		"%s: peer %s: wg_algo_aead_dec for empty message failed\n",
+		if_name(>wg_if), wgp->wgp_name);
 		goto out;
 	}
 	/* Hr := HASH(Hr || msg.empty) */
@@ -2020,7 +2024,8 @@ wg_handle_msg_resp(struct wg_softc *wg, 
 		const uint32_t h = curcpu()->ci_index; // pktq_rps_hash(m)
 		M_SETCTX(m, wgp);
 		if (__predict_false(!pktq_enqueue(wg_pktq, m, h))) {
-			WGLOG(LOG_ERR, "pktq full, dropping\n");
+			WGLOG(LOG_ERR, "%s: pktq full, dropping\n",
+			if_name(>wg_if));
 			m_freem(m);
 		}
 		kpreempt_enable();
@@ -2575,7 +2580,8 @@ wg_handle_msg_data(struct wg_softc *wg, 
 	le64toh(wgmd->wgmd_counter));
 	if (error) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"out-of-window packet: %"PRIu64"\n",
+		"%s: peer %s: out-of-window packet: %"PRIu64"\n",
+		if_name(>wg_if), wgp->wgp_name,
 		le64toh(wgmd->wgmd_counter));
 		goto out;
 	}
@@ -2629,7 +2635,8 @@ wg_handle_msg_data(struct wg_softc *wg, 
 	encrypted_len, NULL, 0);
 	if (error != 0) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"failed to wg_algo_aead_dec\n");
+		"%s: peer %s: failed to wg_algo_aead_dec\n",
+		if_name(>wg_if), wgp->wgp_name);
 		m_freem(n);
 		goto out;
 	}
@@ -2642,7 +2649,8 @@ wg_handle_msg_data(struct wg_softc *wg, 
 	mutex_exit(>wgs_recvwin->lock);
 	if (error) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"replay or out-of-window packet: %"PRIu64"\n",
+		"%s: peer %s: replay or out-of-window packet: %"PRIu64"\n",
+		if_name(>wg_if), wgp->wgp_name,
 		le64toh(wgmd->wgmd_counter));
 		m_freem(n);
 		goto out;
@@ -2677,8 +2685,21 @@ wg_handle_msg_data(struct wg_softc *wg, 
 	if (ok) {
 		wg->wg_ops->input(>wg_if, n, af);
 	} else {
+		char addrstr[INET6_ADDRSTRLEN];
+		memset(addrstr, 0, sizeof(addrstr));
+		if (af == AF_INET) {
+			const struct ip *ip = (const struct ip *)decrypted_buf;
+			IN_PRINT(addrstr, >ip_src);
+#ifdef INET6
+		} else if (af == AF_INET6) {
+			const struct ip6_hdr *ip6 =
+			(const struct ip6_hdr *)decrypted_buf;
+			IN6_PRINT(addrstr, >ip6_src);
+#endif
+		}
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"invalid source address\n");
+		"%s: peer %s: invalid source address (%s)\n",
+		if_name(>wg_if), wgp->wgp_name, addrstr);
 		m_freem(n);
 		/*
 		 * The inner address is invalid however the session is valid
@@ -2766,7 +2787,8 @@ wg_handle_msg_cookie(struct wg_softc *wg
 	wgmc->wgmc_salt);
 	if (error != 0) {
 		WG_LOG_RATECHECK(>wgp_ppsratecheck, LOG_DEBUG,
-		"wg_algo_aead_dec for cookie failed: 

CVS commit: src/sys/net

2023-04-11 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Apr 11 14:03:46 UTC 2023

Modified Files:
src/sys/net: if_wg.c

Log Message:
Give scope and additional details to wg(4) diagnostic messages.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_wg.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/luna68k/conf

2023-04-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 11 13:26:19 UTC 2023

Modified Files:
src/sys/arch/luna68k/conf: Makefile.luna68k

Log Message:
Fix missing locore.d dependency output on make depend.

Reported from isaki@.  Looks missed in rev 1.13 (22 years ago):
 
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/luna68k/conf/Makefile.luna68k#rev1.13

Should be pulled up to netbsd-8, netbsd-9, and netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/luna68k/conf/Makefile.luna68k

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/luna68k/conf/Makefile.luna68k
diff -u src/sys/arch/luna68k/conf/Makefile.luna68k:1.29 src/sys/arch/luna68k/conf/Makefile.luna68k:1.30
--- src/sys/arch/luna68k/conf/Makefile.luna68k:1.29	Sat Sep 22 12:24:02 2018
+++ src/sys/arch/luna68k/conf/Makefile.luna68k	Tue Apr 11 13:26:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.luna68k,v 1.29 2018/09/22 12:24:02 rin Exp $
+#	$NetBSD: Makefile.luna68k,v 1.30 2023/04/11 13:26:19 tsutsui Exp $
 
 # Makefile for NetBSD
 #
@@ -48,7 +48,7 @@ OPT_MODULAR=	%MODULAR%
 MD_OBJS=	locore.o
 MD_LIBS=	${FPSP}
 MD_CFILES=
-MD_SFILES=	
+MD_SFILES=	${LUNA68K}/luna68k/locore.s
 
 locore.o: ${LUNA68K}/luna68k/locore.s assym.h
 	${NORMAL_S}



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

2023-04-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 11 13:26:19 UTC 2023

Modified Files:
src/sys/arch/luna68k/conf: Makefile.luna68k

Log Message:
Fix missing locore.d dependency output on make depend.

Reported from isaki@.  Looks missed in rev 1.13 (22 years ago):
 
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/luna68k/conf/Makefile.luna68k#rev1.13

Should be pulled up to netbsd-8, netbsd-9, and netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/luna68k/conf/Makefile.luna68k

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



CVS commit: src/sbin/rndctl

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:17:32 UTC 2023

Modified Files:
src/sbin/rndctl: rndctl.c

Log Message:
rndctl(8): Take omitted name/type as empty device name.

This can now be used to change flags for all sources at once.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/rndctl/rndctl.c

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

Modified files:

Index: src/sbin/rndctl/rndctl.c
diff -u src/sbin/rndctl/rndctl.c:1.40 src/sbin/rndctl/rndctl.c:1.41
--- src/sbin/rndctl/rndctl.c:1.40	Sun Apr  4 13:37:17 2021
+++ src/sbin/rndctl/rndctl.c	Tue Apr 11 13:17:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndctl.c,v 1.40 2021/04/04 13:37:17 nia Exp $	*/
+/*	$NetBSD: rndctl.c,v 1.41 2023/04/11 13:17:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 Michael Graff.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rndctl.c,v 1.40 2021/04/04 13:37:17 nia Exp $");
+__RCSID("$NetBSD: rndctl.c,v 1.41 2023/04/11 13:17:32 riastradh Exp $");
 #endif
 
 #include 
@@ -570,7 +570,7 @@ main(int argc, char **argv)
 	rndctl_t rctl;
 	int ch, cmd, lflag, mflag, sflag;
 	u_int32_t type;
-	char name[16];
+	char name[16] = "";
 	const char *filename = NULL;
 
 	if (SHA3_Selftest() != 0)
@@ -695,12 +695,6 @@ main(int argc, char **argv)
 		usage();
 
 	/*
-	 * If not listing, we need a device name or a type.
-	 */
-	if (lflag == 0 && cmd == 0 && sflag == 0)
-		usage();
-
-	/*
 	 * Modify request.
 	 */
 	if (mflag != 0) {



CVS commit: src/sbin/rndctl

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:17:32 UTC 2023

Modified Files:
src/sbin/rndctl: rndctl.c

Log Message:
rndctl(8): Take omitted name/type as empty device name.

This can now be used to change flags for all sources at once.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/rndctl/rndctl.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-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:11:01 UTC 2023

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

Log Message:
x86: Omit needless membar_sync in intr_disestablish_xcall.

Details in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/x86/x86/intr.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-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:06:21 UTC 2023

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

Log Message:
thmap(9): kmem_zalloc(KM_SLEEP) never fails.  Prune dead branch.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/subr_thmap.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_thmap.c
diff -u src/sys/kern/subr_thmap.c:1.12 src/sys/kern/subr_thmap.c:1.13
--- src/sys/kern/subr_thmap.c:1.12	Sat Apr  9 23:51:57 2022
+++ src/sys/kern/subr_thmap.c	Tue Apr 11 13:06:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_thmap.c,v 1.12 2022/04/09 23:51:57 riastradh Exp $	*/
+/*	$NetBSD: subr_thmap.c,v 1.13 2023/04/11 13:06:21 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 Mindaugas Rasiukevicius 
@@ -112,7 +112,7 @@
 #include "utils.h"
 #endif
 
-THMAP_RCSID("$NetBSD: subr_thmap.c,v 1.12 2022/04/09 23:51:57 riastradh Exp $");
+THMAP_RCSID("$NetBSD: subr_thmap.c,v 1.13 2023/04/11 13:06:21 riastradh Exp $");
 
 #include 
 
@@ -980,9 +980,6 @@ thmap_create(uintptr_t baseptr, const th
 		return NULL;
 	}
 	thmap = kmem_zalloc(sizeof(thmap_t), KM_SLEEP);
-	if (!thmap) {
-		return NULL;
-	}
 	thmap->baseptr = baseptr;
 	thmap->ops = ops ? ops : _default_ops;
 	thmap->flags = flags;



CVS commit: src/sys/kern

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:06:21 UTC 2023

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

Log Message:
thmap(9): kmem_zalloc(KM_SLEEP) never fails.  Prune dead branch.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/subr_thmap.c

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



CVS commit: src/sys/dev/ic

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:01:42 UTC 2023

Modified Files:
src/sys/dev/ic: com.c

Log Message:
com(4): Note ttylock in comment, not tty_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.383 -r1.384 src/sys/dev/ic/com.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/ic/com.c
diff -u src/sys/dev/ic/com.c:1.383 src/sys/dev/ic/com.c:1.384
--- src/sys/dev/ic/com.c:1.383	Tue Apr 11 12:55:59 2023
+++ src/sys/dev/ic/com.c	Tue Apr 11 13:01:41 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.383 2023/04/11 12:55:59 riastradh Exp $ */
+/* $NetBSD: com.c,v 1.384 2023/04/11 13:01:41 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -65,13 +65,13 @@
  * Supports automatic hardware flow control on StarTech ST16C650A UART
  *
  * Lock order:
- *	tty_lock (IPL_VM)
+ *	ttylock (IPL_VM)
  *	-> sc->sc_lock (IPL_HIGH)
  *	-> timecounter_lock (IPL_HIGH)
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.383 2023/04/11 12:55:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.384 2023/04/11 13:01:41 riastradh Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"



CVS commit: src/sys/dev/ic

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 13:01:42 UTC 2023

Modified Files:
src/sys/dev/ic: com.c

Log Message:
com(4): Note ttylock in comment, not tty_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.383 -r1.384 src/sys/dev/ic/com.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/evbarm/dev

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:58:03 UTC 2023

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
evbarm/plcom(4): Note ttylock in comment, not tty_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.68 src/sys/arch/evbarm/dev/plcom.c:1.69
--- src/sys/arch/evbarm/dev/plcom.c:1.68	Tue Apr 11 12:56:07 2023
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Apr 11 12:58:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.68 2023/04/11 12:56:07 riastradh Exp $	*/
+/*	$NetBSD: plcom.c,v 1.69 2023/04/11 12:58:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -93,13 +93,13 @@
  * Derived from the NS16550AF com driver.
  *
  * Lock order:
- *	tty_lock (IPL_VM)
+ *	ttylock (IPL_VM)
  *	-> sc->sc_lock (IPL_HIGH)
  *	-> timecounter_lock (IPL_HIGH)
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.68 2023/04/11 12:56:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.69 2023/04/11 12:58:03 riastradh Exp $");
 
 #include "opt_plcom.h"
 #include "opt_kgdb.h"



CVS commit: src/sys/arch/evbarm/dev

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:58:03 UTC 2023

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
evbarm/plcom(4): Note ttylock in comment, not tty_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:56:08 UTC 2023

Modified Files:
src/sys/arch/evbarm/dev: plcom.c plcomreg.h plcomvar.h

Log Message:
evbarm/plcom(4): Sync some recent changes from com(4).

- Nix quirky `integrate' macro.
- Omit needless spltty in plcomstart.
- Comment on lock order.
- Update confusing comment about hangup delay.
- Add include guards.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/dev/plcomreg.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/dev/plcomvar.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.67 src/sys/arch/evbarm/dev/plcom.c:1.68
--- src/sys/arch/evbarm/dev/plcom.c:1.67	Tue Jan 24 06:56:40 2023
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Apr 11 12:56:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.67 2023/01/24 06:56:40 mlelstv Exp $	*/
+/*	$NetBSD: plcom.c,v 1.68 2023/04/11 12:56:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -91,10 +91,15 @@
  * COM driver for the Prime Cell PL010 and PL011 UARTs. Both are is similar to
  * the 16C550, but have a completely different programmer's model.
  * Derived from the NS16550AF com driver.
+ *
+ * Lock order:
+ *	tty_lock (IPL_VM)
+ *	-> sc->sc_lock (IPL_HIGH)
+ *	-> timecounter_lock (IPL_HIGH)
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.67 2023/01/24 06:56:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.68 2023/04/11 12:56:07 riastradh Exp $");
 
 #include "opt_plcom.h"
 #include "opt_kgdb.h"
@@ -181,12 +186,11 @@ void	plcomcnputc	(dev_t, int);
 void	plcomcnpollc	(dev_t, int);
 void	plcomcnhalt	(dev_t);
 
-#define	integrate	static inline
 void 	plcomsoft	(void *);
-integrate void plcom_rxsoft	(struct plcom_softc *, struct tty *);
-integrate void plcom_txsoft	(struct plcom_softc *, struct tty *);
-integrate void plcom_stsoft	(struct plcom_softc *, struct tty *);
-integrate void plcom_schedrx	(struct plcom_softc *);
+static inline void plcom_rxsoft	(struct plcom_softc *, struct tty *);
+static inline void plcom_txsoft	(struct plcom_softc *, struct tty *);
+static inline void plcom_stsoft	(struct plcom_softc *, struct tty *);
+static inline void plcom_schedrx	(struct plcom_softc *);
 void	plcomdiag		(void *);
 
 bool	plcom_intstatus(struct plcom_instance *, u_int *);
@@ -745,9 +749,9 @@ plcom_shutdown(struct plcom_softc *sc)
 	mutex_spin_exit(_lock);
 
 	/*
-	 * Hang up if necessary.  Wait a bit, so the other side has time to
-	 * notice even if we immediately open the port again.
-	 * Avoid tsleeping above splhigh().
+	 * Hang up if necessary.  Record when we hung up, so if we
+	 * immediately open the port again, we will wait a bit until
+	 * the other side has had time to notice that we hung up.
 	 */
 	if (ISSET(tp->t_cflag, HUPCL)) {
 		plcom_modem(sc, 0);
@@ -1249,7 +1253,7 @@ plcomioctl(dev_t dev, u_long cmd, void *
 	return error;
 }
 
-integrate void
+static inline void
 plcom_schedrx(struct plcom_softc *sc)
 {
 
@@ -1765,19 +1769,17 @@ plcomstart(struct tty *tp)
 	struct plcom_softc *sc =
 		device_lookup_private(_cd, PLCOMUNIT(tp->t_dev));
 	struct plcom_instance *pi = >sc_pi;
-	int s;
 
 	if (PLCOM_ISALIVE(sc) == 0)
 		return;
 
-	s = spltty();
 	if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
-		goto out;
+		return;
 	if (sc->sc_tx_stopped)
-		goto out;
+		return;
 
 	if (!ttypull(tp))
-		goto out;
+		return;
 
 	/* Grab the first contiguous region of buffer space. */
 	{
@@ -1825,9 +1827,6 @@ plcomstart(struct tty *tp)
 		sc->sc_tba += n;
 	}
 	mutex_spin_exit(>sc_lock);
-out:
-	splx(s);
-	return;
 }
 
 /*
@@ -1870,7 +1869,7 @@ plcomdiag(void *arg)
 	floods, floods == 1 ? "" : "s");
 }
 
-integrate void
+static inline void
 plcom_rxsoft(struct plcom_softc *sc, struct tty *tp)
 {
 	int (*rint) (int, struct tty *) = tp->t_linesw->l_rint;
@@ -1971,7 +1970,7 @@ plcom_rxsoft(struct plcom_softc *sc, str
 	}
 }
 
-integrate void
+static inline void
 plcom_txsoft(struct plcom_softc *sc, struct tty *tp)
 {
 
@@ -1983,7 +1982,7 @@ plcom_txsoft(struct plcom_softc *sc, str
 	(*tp->t_linesw->l_start)(tp);
 }
 
-integrate void
+static inline void
 plcom_stsoft(struct plcom_softc *sc, struct tty *tp)
 {
 	u_char msr, delta;

Index: src/sys/arch/evbarm/dev/plcomreg.h
diff -u src/sys/arch/evbarm/dev/plcomreg.h:1.7 src/sys/arch/evbarm/dev/plcomreg.h:1.8
--- src/sys/arch/evbarm/dev/plcomreg.h:1.7	Tue Jan 24 06:56:40 2023
+++ src/sys/arch/evbarm/dev/plcomreg.h	Tue Apr 11 12:56:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcomreg.h,v 1.7 2023/01/24 06:56:40 mlelstv Exp $	*/
+/*	$NetBSD: plcomreg.h,v 1.8 2023/04/11 12:56:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -29,6 +29,8 @@
  * SUCH DAMAGE.
 */
 
+#ifndef	_SYS_ARCH_EVBARM_DEV_PLCOMREG_H_
+#define	

CVS commit: src/sys/arch/evbarm/dev

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:56:08 UTC 2023

Modified Files:
src/sys/arch/evbarm/dev: plcom.c plcomreg.h plcomvar.h

Log Message:
evbarm/plcom(4): Sync some recent changes from com(4).

- Nix quirky `integrate' macro.
- Omit needless spltty in plcomstart.
- Comment on lock order.
- Update confusing comment about hangup delay.
- Add include guards.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/dev/plcomreg.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/dev/plcomvar.h

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



CVS commit: src/sys/dev/ic

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:55:59 UTC 2023

Modified Files:
src/sys/dev/ic: com.c

Log Message:
com(4): Note timecounter_lock in lock order comments.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/dev/ic/com.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/ic/com.c
diff -u src/sys/dev/ic/com.c:1.382 src/sys/dev/ic/com.c:1.383
--- src/sys/dev/ic/com.c:1.382	Fri Dec  9 00:35:58 2022
+++ src/sys/dev/ic/com.c	Tue Apr 11 12:55:59 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.382 2022/12/09 00:35:58 knakahara Exp $ */
+/* $NetBSD: com.c,v 1.383 2023/04/11 12:55:59 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -67,10 +67,11 @@
  * Lock order:
  *	tty_lock (IPL_VM)
  *	-> sc->sc_lock (IPL_HIGH)
+ *	-> timecounter_lock (IPL_HIGH)
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.382 2022/12/09 00:35:58 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.383 2023/04/11 12:55:59 riastradh Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"



CVS commit: src/sys/dev/ic

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 12:55:59 UTC 2023

Modified Files:
src/sys/dev/ic: com.c

Log Message:
com(4): Note timecounter_lock in lock order comments.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/dev/ic/com.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/vacation

2023-04-11 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Tue Apr 11 10:34:52 UTC 2023

Modified Files:
src/usr.bin/vacation: vacation.1 vacation.c

Log Message:
Make vacation(1) check 'Auto-Submitted:' (RFC 3834) in addition to
'Precedence:' (RFC 2076), and set 'Precedence:' in addition to
'Auto-Submitted:'.

Update the man page accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/vacation/vacation.1
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/vacation/vacation.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/vacation/vacation.1
diff -u src/usr.bin/vacation/vacation.1:1.32 src/usr.bin/vacation/vacation.1:1.33
--- src/usr.bin/vacation/vacation.1:1.32	Mon May  6 06:56:07 2019
+++ src/usr.bin/vacation/vacation.1	Tue Apr 11 10:34:52 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vacation.1,v 1.32 2019/05/06 06:56:07 wiz Exp $
+.\"	$NetBSD: vacation.1,v 1.33 2023/04/11 10:34:52 hauke Exp $
 .\"
 .\" Copyright (c) 1985, 1987, 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -172,6 +172,7 @@ option) is part of either the
 or
 .Dq Cc:
 headers of the mail.
+.Pp
 No messages from
 .Dq ???-REQUEST ,
 .Dq Postmaster ,
@@ -180,12 +181,20 @@ No messages from
 or
 .Dq MAILER-DAEMON
 will be replied to (where these strings are
-case insensitive) nor is a notification sent if a
+case insensitive).
+.Pp
+No notification is sent if a
 .Dq Precedence: bulk
 .Dq Precedence: list
-or
 .Dq Precedence: junk
-line is included in the mail headers.
+line or an
+.Dq Auto-Submitted:
+line with any qualifier except
+.Dq no
+are included in the mail headers.
+.Nm
+will include these headers in its response to avoid auto-responder loops.
+.Pp
 The people who have sent you messages are maintained as a
 .Xr db 3
 database in the file
@@ -195,7 +204,7 @@ in your home directory.
 .Nm
 expects a file
 .Pa .vacation.msg ,
-in your home directory, containing a message to be sent back to each
+in your home directory containing a message to be sent back to each
 sender.
 It should be an entire message (including headers).
 If the message contains the string
@@ -207,7 +216,6 @@ For example, it might contain:
 From: e...@cs.berkeley.edu (Eric Allman)
 Subject: I am on vacation
 Delivered-By-The-Graces-Of: The Vacation program
-Precedence: bulk
 
 I am on vacation until July 22.
 Your mail regarding "$SUBJECT" will be read when I return.
@@ -242,6 +250,9 @@ message to send
 .Sh SEE ALSO
 .Xr sendmail 1 ,
 .Xr syslog 3
+.Pp
+RFC 2076 ,
+RFC 3834
 .Sh HISTORY
 The
 .Nm

Index: src/usr.bin/vacation/vacation.c
diff -u src/usr.bin/vacation/vacation.c:1.37 src/usr.bin/vacation/vacation.c:1.38
--- src/usr.bin/vacation/vacation.c:1.37	Sun May  5 23:08:37 2019
+++ src/usr.bin/vacation/vacation.c	Tue Apr 11 10:34:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vacation.c,v 1.37 2019/05/05 23:08:37 pgoyette Exp $	*/
+/*	$NetBSD: vacation.c,v 1.38 2023/04/11 10:34:52 hauke Exp $	*/
 
 /*
  * Copyright (c) 1983, 1987, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)vacation.c	8.2 (Berkeley) 1/26/94";
 #endif
-__RCSID("$NetBSD: vacation.c,v 1.37 2019/05/05 23:08:37 pgoyette Exp $");
+__RCSID("$NetBSD: vacation.c,v 1.38 2023/04/11 10:34:52 hauke Exp $");
 #endif /* not lint */
 
 /*
@@ -325,7 +325,7 @@ readheaders(void)
 			COMPARE(buf, "From:") == 0)
 getfrom(buf + sizeof("From:") - 1);
 			break;
-		case 'P':		/* "Precedence:" */
+		case 'P':		/* "Precedence:" rfc 2076 ch 3.9 */
 			cont = 0;
 			if (CASECOMPARE(buf, "Precedence") != 0 ||
 			(buf[10] != ':' && buf[10] != ' ' &&
@@ -352,12 +352,26 @@ readheaders(void)
 break;
 			cont = 1;
 			goto findme;
-		case 'A':		/* "Apparently-To:" */
-			if ((tflag & APPARENTLY_TO) == 0 ||
-			COMPARE(buf, "Apparently-To:") != 0)
+		case 'A':
+/* "Apparently-To:" */
+			if ((tflag & APPARENTLY_TO) != 0 &&
+			COMPARE(buf, "Apparently-To:") == 0) {
+cont = 1;
+goto findme;
+			}
+			/* "Auto-Submitted:" rfc 3834 ch 5 */
+			cont = 0;
+			if (CASECOMPARE(buf, "Auto-Submitted") != 0 ||
+			(buf[14] != ':' && buf[14] != ' ' &&
+			buf[14] != '\t'))
 break;
-			cont = 1;
-			goto findme;
+			if ((p = strchr(buf, ':')) == NULL)
+break;
+			while (*++p && isspace((unsigned char)*p))
+continue;
+			if (CASECOMPARE(p, "no") != 0 )
+exit(0);
+			break;
 		case 'D':		/* "Delivered-To:" */
 			if ((tflag & DELIVERED_TO) == 0 ||
 			COMPARE(buf, "Delivered-To:") != 0)
@@ -628,6 +642,7 @@ sendmessage(const char *myname)
 	} 
 	(void)fprintf(sfp, "To: %s\n", from);
 	(void)fputs("Auto-Submitted: auto-replied\n", sfp);
+	(void)fputs("Precedence: bulk\n", sfp);
 	while (fgets(buf, sizeof buf, mfp) != NULL) {
 		char *p;
 		if ((p = strstr(buf, "$SUBJECT")) != NULL) {



CVS commit: src/usr.bin/vacation

2023-04-11 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Tue Apr 11 10:34:52 UTC 2023

Modified Files:
src/usr.bin/vacation: vacation.1 vacation.c

Log Message:
Make vacation(1) check 'Auto-Submitted:' (RFC 3834) in addition to
'Precedence:' (RFC 2076), and set 'Precedence:' in addition to
'Auto-Submitted:'.

Update the man page accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/vacation/vacation.1
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/vacation/vacation.c

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



CVS commit: src

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:30:41 UTC 2023

Modified Files:
src/distrib/sets/lists/debug: module.ad.aarch64
src/distrib/sets/lists/modules: ad.aarch64
src/sys/modules: Makefile

Log Message:
aarch64: Build drm modules.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/sets/lists/debug/module.ad.aarch64
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/modules/ad.aarch64
cvs rdiff -u -r1.275 -r1.276 src/sys/modules/Makefile

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

Modified files:

Index: src/distrib/sets/lists/debug/module.ad.aarch64
diff -u src/distrib/sets/lists/debug/module.ad.aarch64:1.5 src/distrib/sets/lists/debug/module.ad.aarch64:1.6
--- src/distrib/sets/lists/debug/module.ad.aarch64:1.5	Tue Dec 20 04:10:11 2022
+++ src/distrib/sets/lists/debug/module.ad.aarch64	Tue Apr 11 10:30:41 2023
@@ -1,4 +1,6 @@
-# $NetBSD: module.ad.aarch64,v 1.5 2022/12/20 04:10:11 pgoyette Exp $
+# $NetBSD: module.ad.aarch64,v 1.6 2023/04/11 10:30:41 riastradh Exp $
+./usr/libdata/debug/@MODULEDIR@/amdgpumodules-base-kernel kmod,debug
+./usr/libdata/debug/@MODULEDIR@/amdgpu/amdgpu.kmod.debug	modules-base-kernel kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpfjitmodules-base-kernel	kmod,sljit,debug
 ./usr/libdata/debug/@MODULEDIR@/bpfjit/bpfjit.kmod.debug		modules-base-kernel	kmod,sljit,debug
 ./usr/libdata/debug/@MODULEDIR@/compat_linux			modules-base-kernel	kmod,debug
@@ -55,6 +57,16 @@
 ./usr/libdata/debug/@MODULEDIR@/compat_netbsd32_sysvipc_14/compat_netbsd32_sysvipc_14.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/compat_netbsd32_sysvipc_50	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/compat_netbsd32_sysvipc_50/compat_netbsd32_sysvipc_50.kmod.debug	modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkmsmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms/drmkms.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_linux			modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_linux/drmkms_linux.kmod.debug	modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_pci			modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_pci/drmkms_pci.kmod.debug	modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_sched			modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_sched/drmkms_sched.kmod.debug	modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_ttm			modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/drmkms_ttm/drmkms_ttm.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/exec_elf32			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/exec_elf32/exec_elf32.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/exec_elf64			modules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/modules/ad.aarch64
diff -u src/distrib/sets/lists/modules/ad.aarch64:1.11 src/distrib/sets/lists/modules/ad.aarch64:1.12
--- src/distrib/sets/lists/modules/ad.aarch64:1.11	Tue Dec 20 04:10:11 2022
+++ src/distrib/sets/lists/modules/ad.aarch64	Tue Apr 11 10:30:41 2023
@@ -1,4 +1,6 @@
-# $NetBSD: ad.aarch64,v 1.11 2022/12/20 04:10:11 pgoyette Exp $
+# $NetBSD: ad.aarch64,v 1.12 2023/04/11 10:30:41 riastradh Exp $
+./@MODULEDIR@/amdgpumodules-base-kernel	kmod
+./@MODULEDIR@/amdgpu/amdgpu.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/bpfjitmodules-base-kernel	kmod,sljit
 ./@MODULEDIR@/bpfjit/bpfjit.kmod		modules-base-kernel	kmod,sljit
 ./@MODULEDIR@/compat_linux			modules-base-kernel	kmod
@@ -59,6 +61,16 @@
 ./@MODULEDIR@/compat_netbsd32_sysvipc_14/compat_netbsd32_sysvipc_14.kmod	modules-base-kernel	kmod
 ./@MODULEDIR@/compat_netbsd32_sysvipc_50	modules-base-kernel	kmod
 ./@MODULEDIR@/compat_netbsd32_sysvipc_50/compat_netbsd32_sysvipc_50.kmod	modules-base-kernel	kmod
+./@MODULEDIR@/drmkmsmodules-base-kernel	kmod
+./@MODULEDIR@/drmkms/drmkms.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_linux			modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_linux/drmkms_linux.kmod	modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_pci			modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_pci/drmkms_pci.kmod	modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_sched			modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_sched/drmkms_sched.kmod	modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_ttm			modules-base-kernel	kmod
+./@MODULEDIR@/drmkms_ttm/drmkms_ttm.kmod	modules-base-kernel	kmod
 ./@MODULEDIR@/exec_elf32			modules-base-kernel	kmod
 ./@MODULEDIR@/exec_elf32/exec_elf32.kmod	modules-base-kernel	kmod
 ./@MODULEDIR@/exec_elf64			modules-base-kernel	kmod

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.275 src/sys/modules/Makefile:1.276
--- src/sys/modules/Makefile:1.275	Mon Dec 19 23:19:51 

CVS commit: src

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:30:41 UTC 2023

Modified Files:
src/distrib/sets/lists/debug: module.ad.aarch64
src/distrib/sets/lists/modules: ad.aarch64
src/sys/modules: Makefile

Log Message:
aarch64: Build drm modules.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/sets/lists/debug/module.ad.aarch64
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/modules/ad.aarch64
cvs rdiff -u -r1.275 -r1.276 src/sys/modules/Makefile

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



CVS commit: src/sys/kern

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:23:47 UTC 2023

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

Log Message:
ttwrite(9): Assert we mangle uio_resid only if we also return error.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/tty.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/tty.c
diff -u src/sys/kern/tty.c:1.308 src/sys/kern/tty.c:1.309
--- src/sys/kern/tty.c:1.308	Fri Feb 17 23:13:01 2023
+++ src/sys/kern/tty.c	Tue Apr 11 10:23:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.308 2023/02/17 23:13:01 riastradh Exp $	*/
+/*	$NetBSD: tty.c,v 1.309 2023/04/11 10:23:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.308 2023/02/17 23:13:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.309 2023/04/11 10:23:47 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2380,6 +2380,7 @@ ttwrite(struct tty *tp, struct uio *uio,
 	 * offset and iov pointers have moved forward, but it doesn't matter
 	 * (the call will either return short or restart with a new uio).
 	 */
+	KASSERTMSG(error || cc == 0, "error=%d cc=%d", error, cc);
 	uio->uio_resid += cc;
 	return (error);
 



CVS commit: src/sys/kern

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:23:47 UTC 2023

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

Log Message:
ttwrite(9): Assert we mangle uio_resid only if we also return error.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/tty.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-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:22:04 UTC 2023

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

Log Message:
uiomove(9): Stronger assertions about iov array.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_copy.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_copy.c
diff -u src/sys/kern/subr_copy.c:1.17 src/sys/kern/subr_copy.c:1.18
--- src/sys/kern/subr_copy.c:1.17	Fri Feb 24 11:02:27 2023
+++ src/sys/kern/subr_copy.c	Tue Apr 11 10:22:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_copy.c,v 1.17 2023/02/24 11:02:27 riastradh Exp $	*/
+/*	$NetBSD: subr_copy.c,v 1.18 2023/04/11 10:22:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008, 2019
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.17 2023/02/24 11:02:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.18 2023/04/11 10:22:04 riastradh Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 #define	__UCAS_PRIVATE
@@ -112,10 +112,11 @@ uiomove(void *buf, size_t n, struct uio 
 
 	KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE);
 	while (n > 0 && uio->uio_resid) {
+		KASSERT(uio->uio_iovcnt > 0);
 		iov = uio->uio_iov;
 		cnt = iov->iov_len;
 		if (cnt == 0) {
-			KASSERT(uio->uio_iovcnt > 0);
+			KASSERT(uio->uio_iovcnt > 1);
 			uio->uio_iov++;
 			uio->uio_iovcnt--;
 			continue;



CVS commit: src/sys/kern

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:22:04 UTC 2023

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

Log Message:
uiomove(9): Stronger assertions about iov array.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_copy.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-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:19:56 UTC 2023

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

Log Message:
kmsan: Format exact instruction addresses relative to symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/kern/subr_msan.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_msan.c
diff -u src/sys/kern/subr_msan.c:1.18 src/sys/kern/subr_msan.c:1.19
--- src/sys/kern/subr_msan.c:1.18	Wed Oct 26 23:38:09 2022
+++ src/sys/kern/subr_msan.c	Tue Apr 11 10:19:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_msan.c,v 1.18 2022/10/26 23:38:09 riastradh Exp $	*/
+/*	$NetBSD: subr_msan.c,v 1.19 2023/04/11 10:19:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019-2020 Maxime Villard, m00nbsd.net
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.18 2022/10/26 23:38:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.19 2023/04/11 10:19:56 riastradh Exp $");
 
 #include 
 #include 
@@ -146,6 +146,7 @@ kmsan_orig_name(int type)
 static void
 kmsan_report_hook(const void *addr, size_t size, size_t off, const char *hook)
 {
+	unsigned long symstart;
 	const char *mod, *sym;
 	msan_orig_t *orig;
 	const char *typename;
@@ -175,14 +176,29 @@ kmsan_report_hook(const void *addr, size
 
 	if (kmsan_md_is_pc(ptr)) {
 		s = pserialize_read_enter();
-		if (ksyms_getname(, , (vaddr_t)ptr, KSYMS_PROC)) {
+		if (ksyms_getname(, , (vaddr_t)ptr, KSYMS_PROC) ||
+		ksyms_getval(mod, sym, , KSYMS_PROC)) {
 			REPORT("MSan: Uninitialized %s Memory In %s "
 			"At Offset %zu/%zu, IP %p\n", typename, hook, off,
 			size, (void *)ptr);
 		} else {
+			char soff[16] = "";
+
+			if ((vaddr_t)ptr < symstart) {
+snprintf(soff, sizeof(soff), "-0x%"PRIxVADDR,
+symstart - (vaddr_t)ptr);
+			} else if ((vaddr_t)ptr > symstart) {
+snprintf(soff, sizeof(soff), "+0x%"PRIxVADDR,
+(vaddr_t)ptr - symstart);
+			}
 			REPORT("MSan: Uninitialized %s Memory In %s "
-			"At Offset %zu/%zu, From %s()\n", typename, hook,
-			off, size, sym);
+			"At Offset %zu/%zu, From %s%s%lx\n",
+			typename, hook,
+			off, size, sym,
+			((unsigned long)ptr < symstart ? "-" :
+(unsigned long)ptr > symstart ? "+" :
+""),
+			(unsigned long)ptr - symstart);
 		}
 		pserialize_read_exit(s);
 	} else {



CVS commit: src/sys/kern

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 10:19:56 UTC 2023

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

Log Message:
kmsan: Format exact instruction addresses relative to symbols.


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

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



CVS commit: src/sys/dev/tprof

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 10:07:12 UTC 2023

Modified Files:
src/sys/dev/tprof: tprof.c tprof_armv7.c tprof_armv8.c tprof_types.h
tprof_x86_amd.c tprof_x86_intel.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/tprof/tprof.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/tprof/tprof_armv7.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/tprof/tprof_armv8.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/tprof/tprof_types.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/tprof/tprof_x86_amd.c \
src/sys/dev/tprof/tprof_x86_intel.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/tprof/tprof.c
diff -u src/sys/dev/tprof/tprof.c:1.22 src/sys/dev/tprof/tprof.c:1.23
--- src/sys/dev/tprof/tprof.c:1.22	Fri Dec 16 17:38:56 2022
+++ src/sys/dev/tprof/tprof.c	Tue Apr 11 10:07:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof.c,v 1.22 2022/12/16 17:38:56 ryo Exp $	*/
+/*	$NetBSD: tprof.c,v 1.23 2023/04/11 10:07:12 msaitoh Exp $	*/
 
 /*-
  * Copyright (c)2008,2009,2010 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.22 2022/12/16 17:38:56 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.23 2023/04/11 10:07:12 msaitoh Exp $");
 
 #include 
 #include 
@@ -213,7 +213,7 @@ tprof_worker(struct work *wk, void *dumm
 	KASSERT(dummy == NULL);
 
 	/*
-	 * get a per cpu buffer.
+	 * Get a per cpu buffer.
 	 */
 	buf = tprof_buf_refresh();
 
@@ -245,12 +245,11 @@ tprof_worker(struct work *wk, void *dumm
 		tprof_stat.ts_dropbuf++;
 	}
 	mutex_exit(_lock);
-	if (buf) {
+	if (buf)
 		tprof_buf_free(buf);
-	}
-	if (!shouldstop) {
+
+	if (!shouldstop)
 		callout_schedule(>c_callout, hz / 8);
-	}
 }
 
 static void
@@ -276,9 +275,9 @@ tprof_stop1(void)
 		tprof_buf_t *old;
 
 		old = tprof_buf_switch(c, NULL);
-		if (old != NULL) {
+		if (old != NULL)
 			tprof_buf_free(old);
-		}
+
 		callout_destroy(>c_callout);
 	}
 	workqueue_destroy(tprof_wq);
@@ -293,9 +292,8 @@ tprof_getinfo(struct tprof_info *info)
 
 	memset(info, 0, sizeof(*info));
 	info->ti_version = TPROF_VERSION;
-	if ((tb = tprof_backend) != NULL) {
+	if ((tb = tprof_backend) != NULL)
 		info->ti_ident = tb->tb_ops->tbo_ident();
-	}
 }
 
 static int
@@ -351,8 +349,8 @@ tprof_start(tprof_countermask_t runmask)
 	runmask &= tb->tb_softc.sc_ctr_configured_mask;
 	if (runmask == 0) {
 		/*
-		 * targets are already running.
-		 * unconfigured counters are ignored.
+		 * Targets are already running.
+		 * Unconfigured counters are ignored.
 		 */
 		error = 0;
 		goto done;
@@ -427,7 +425,7 @@ tprof_stop(tprof_countermask_t stopmask)
 	KASSERT(mutex_owned(_startstop_lock));
 	stopmask &= tb->tb_softc.sc_ctr_running_mask;
 	if (stopmask == 0) {
-		/* targets are not running */
+		/* Targets are not running */
 		goto done;
 	}
 
@@ -437,13 +435,13 @@ tprof_stop(tprof_countermask_t stopmask)
 	tb->tb_softc.sc_ctr_running_mask &= ~stopmask;
 	mutex_exit(_lock);
 
-	/* all counters have stopped? */
+	/* All counters have stopped? */
 	if (tb->tb_softc.sc_ctr_running_mask == 0) {
 		mutex_enter(_lock);
 		cv_broadcast(_reader_cv);
-		while (tprof_nworker > 0) {
+		while (tprof_nworker > 0)
 			cv_wait(_cv, _lock);
-		}
+
 		mutex_exit(_lock);
 
 		tprof_stop1();
@@ -516,7 +514,7 @@ tprof_configure_event(const tprof_param_
 	tb->tb_ops->tbo_counter_bitwidth(param->p_counter);
 
 	sc_param = >sc_count[c].ctr_param;
-	memcpy(sc_param, param, sizeof(*sc_param));	/* save copy of param */
+	memcpy(sc_param, param, sizeof(*sc_param)); /* save copy of param */
 
 	if (ISSET(param->p_flags, TPROF_PARAM_PROFILE)) {
 		uint64_t freq, inum, dnum;
@@ -618,9 +616,8 @@ tprof_getcounts_cpu(void *arg1, void *ar
 			counters[c] = counters_offset[c] +
 			((ctr - sc->sc_count[c].ctr_counter_reset_val) &
 			__BITS(sc->sc_count[c].ctr_bitwidth - 1, 0));
-		} else {
+		} else
 			counters[c] = 0;
-		}
 	}
 	percpu_putref(sc->sc_ctr_offset_percpu);
 }
@@ -741,9 +738,8 @@ tprof_backend_register(const char *name,
 {
 	tprof_backend_t *tb;
 
-	if (vers != TPROF_BACKEND_VERSION) {
+	if (vers != TPROF_BACKEND_VERSION)
 		return EINVAL;
-	}
 
 	mutex_enter(_startstop_lock);
 	tb = tprof_backend_lookup(name);
@@ -768,7 +764,7 @@ tprof_backend_register(const char *name,
 #endif
 	mutex_exit(_startstop_lock);
 
-	/* init backend softc */
+	/* Init backend softc */
 	tb->tb_softc.sc_ncounters = tb->tb_ops->tbo_ncounters();
 	tb->tb_softc.sc_ctr_offset_percpu_size =
 	sizeof(uint64_t) * tb->tb_softc.sc_ncounters;
@@ -800,9 +796,8 @@ tprof_backend_unregister(const char *nam
 		return EBUSY;
 	}
 #if 1 /* XXX for now */
-	if (tprof_backend == tb) {
+	if (tprof_backend == tb)
 		tprof_backend = NULL;
-	}
 #endif
 	LIST_REMOVE(tb, tb_list);
 	mutex_exit(_startstop_lock);
@@ -811,7 +806,7 @@ tprof_backend_unregister(const char *nam
 	

CVS commit: src/sys/dev/tprof

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 10:07:12 UTC 2023

Modified Files:
src/sys/dev/tprof: tprof.c tprof_armv7.c tprof_armv8.c tprof_types.h
tprof_x86_amd.c tprof_x86_intel.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/tprof/tprof.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/tprof/tprof_armv7.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/tprof/tprof_armv8.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/tprof/tprof_types.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/tprof/tprof_x86_amd.c \
src/sys/dev/tprof/tprof_x86_intel.c

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



CVS commit: src/sys/dev/tprof

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 09:53:28 UTC 2023

Modified Files:
src/sys/dev/tprof: tprof_x86_intel.c

Log Message:
Test cpuid_level in tprof_intel_ncounters().

This function is called before tprof_intel_ident().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/tprof/tprof_x86_intel.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/tprof/tprof_x86_intel.c
diff -u src/sys/dev/tprof/tprof_x86_intel.c:1.6 src/sys/dev/tprof/tprof_x86_intel.c:1.7
--- src/sys/dev/tprof/tprof_x86_intel.c:1.6	Tue Apr 11 02:47:01 2023
+++ src/sys/dev/tprof/tprof_x86_intel.c	Tue Apr 11 09:53:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_intel.c,v 1.6 2023/04/11 02:47:01 msaitoh Exp $	*/
+/*	$NetBSD: tprof_x86_intel.c,v 1.7 2023/04/11 09:53:28 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.6 2023/04/11 02:47:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.7 2023/04/11 09:53:28 msaitoh Exp $");
 
 #include 
 #include 
@@ -103,6 +103,9 @@ tprof_intel_ncounters(void)
 {
 	uint32_t descs[4];
 
+	if (cpuid_level < 0x0a)
+		return 0;
+
 	x86_cpuid(0x0a, descs);
 
 	return __SHIFTOUT(descs[0], CPUID_PERF_NGPPC);



CVS commit: src/sys/dev/tprof

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 09:53:28 UTC 2023

Modified Files:
src/sys/dev/tprof: tprof_x86_intel.c

Log Message:
Test cpuid_level in tprof_intel_ncounters().

This function is called before tprof_intel_ident().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/tprof/tprof_x86_intel.c

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



Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Taylor R Campbell
> Module Name:src
> Committed By:   mlelstv
> Date:   Tue Sep 27 17:04:52 UTC 2022
> 
> Modified Files:
> src/sys/dev/dkwedge: dk.c
> 
> Log Message:
> Remove bogus assertions.
> 
> @@ -1221,8 +1221,6 @@ dklastclose(struct dkwedge_softc *sc)
>  
> KASSERT(mutex_owned(>sc_dk.dk_openlock));
> KASSERT(mutex_owned(>sc_parent->dk_rawlock));
> -   KASSERT(sc->sc_parent->dk_rawopens > 0);
> -   KASSERT(sc->sc_parent->dk_rawvp != NULL);
>  
> if (--sc->sc_parent->dk_rawopens == 0) {
> struct vnode *const vp = sc->sc_parent->dk_rawvp;

If these assertions are bogus, please add a comment explaining:

(a) how we can legitimately enter a state where the assertions are
violated, and

(b) how this logic is supposed to work when dk_rawopens wraps around
from 0 to UINT_MAX and we try to dk_close_parent(NULL, ...).

Otherwise, please restore these assertions.


CVS commit: src/sys/dev/usb

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 08:50:07 UTC 2023

Modified Files:
src/sys/dev/usb: usb_subr.c

Log Message:
usb(9): Assert ud_ifaces is null before we clobber it.


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/sys/dev/usb/usb_subr.c

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

Modified files:

Index: src/sys/dev/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.277 src/sys/dev/usb/usb_subr.c:1.278
--- src/sys/dev/usb/usb_subr.c:1.277	Wed Apr  6 22:01:45 2022
+++ src/sys/dev/usb/usb_subr.c	Tue Apr 11 08:50:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -867,6 +867,8 @@ usbd_set_config_index(struct usbd_device
 		goto bad;
 	}
 
+	KASSERTMSG(dev->ud_ifaces == NULL, "ud_ifaces=%p", dev->ud_ifaces);
+
 	/* Allocate and fill interface data. */
 	nifc = cdp->bNumInterface;
 	if (nifc == 0) {



CVS commit: src/sys/dev/usb

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 08:50:07 UTC 2023

Modified Files:
src/sys/dev/usb: usb_subr.c

Log Message:
usb(9): Assert ud_ifaces is null before we clobber it.


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/sys/dev/usb/usb_subr.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/arm/rockchip

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 08:40:20 UTC 2023

Modified Files:
src/sys/arch/arm/rockchip: rk_dwhdmi.c

Log Message:
arm/rockchip: Omit needless functions.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/rockchip/rk_dwhdmi.c

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

Modified files:

Index: src/sys/arch/arm/rockchip/rk_dwhdmi.c
diff -u src/sys/arch/arm/rockchip/rk_dwhdmi.c:1.7 src/sys/arch/arm/rockchip/rk_dwhdmi.c:1.8
--- src/sys/arch/arm/rockchip/rk_dwhdmi.c:1.7	Sun Dec 19 11:01:10 2021
+++ src/sys/arch/arm/rockchip/rk_dwhdmi.c	Tue Apr 11 08:40:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_dwhdmi.c,v 1.7 2021/12/19 11:01:10 riastradh Exp $ */
+/* $NetBSD: rk_dwhdmi.c,v 1.8 2023/04/11 08:40:19 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.7 2021/12/19 11:01:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.8 2023/04/11 08:40:19 riastradh Exp $");
 
 #include 
 #include 
@@ -106,54 +106,21 @@ rk_dwhdmi_select_input(struct rk_dwhdmi_
 	syscon_unlock(sc->sc_grf);
 }
 
-static bool
-rk_dwhdmi_encoder_mode_fixup(struct drm_encoder *encoder,
-const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
-{
-	return true;
-}
-
-static void
-rk_dwhdmi_encoder_mode_set(struct drm_encoder *encoder,
-struct drm_display_mode *mode, struct drm_display_mode *adjusted)
-{
-}
-
 static void
 rk_dwhdmi_encoder_enable(struct drm_encoder *encoder)
 {
-}
-
-static void
-rk_dwhdmi_encoder_disable(struct drm_encoder *encoder)
-{
-}
-
-static void
-rk_dwhdmi_encoder_prepare(struct drm_encoder *encoder)
-{
 	struct rk_dwhdmi_softc * const sc = to_rk_dwhdmi_encoder(encoder);
 	const u_int crtc_index = drm_crtc_index(encoder->crtc);
 
 	rk_dwhdmi_select_input(sc, crtc_index);
 }
 
-static void
-rk_dwhdmi_encoder_commit(struct drm_encoder *encoder)
-{
-}
-
 static const struct drm_encoder_funcs rk_dwhdmi_encoder_funcs = {
 	.destroy = drm_encoder_cleanup,
 };
 
 static const struct drm_encoder_helper_funcs rk_dwhdmi_encoder_helper_funcs = {
-	.prepare = rk_dwhdmi_encoder_prepare,
-	.mode_fixup = rk_dwhdmi_encoder_mode_fixup,
-	.mode_set = rk_dwhdmi_encoder_mode_set,
 	.enable = rk_dwhdmi_encoder_enable,
-	.disable = rk_dwhdmi_encoder_disable,
-	.commit = rk_dwhdmi_encoder_commit,
 };
 
 static int



CVS commit: src/sys/arch/arm/rockchip

2023-04-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 08:40:20 UTC 2023

Modified Files:
src/sys/arch/arm/rockchip: rk_dwhdmi.c

Log Message:
arm/rockchip: Omit needless functions.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/rockchip/rk_dwhdmi.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/include

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 06:42:30 UTC 2023

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.205 src/sys/arch/x86/include/specialreg.h:1.206
--- src/sys/arch/x86/include/specialreg.h:1.205	Tue Apr 11 02:44:06 2023
+++ src/sys/arch/x86/include/specialreg.h	Tue Apr 11 06:42:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.205 2023/04/11 02:44:06 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.206 2023/04/11 06:42:30 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -481,7 +481,7 @@
 	"b\14AVX512_BITALG\0" "b\15TME_EN\0" "b\16AVX512_VPOPCNTDQ\0"	  \
 	"b\20LA57\0"			  \
 	"f\21\5MAWAU\0"			"b\26RDPID\0"	"b\27KL\0"	  \
-	"b\30\BUS_LOCK_DETECT" "b\31CLDEMOTE\0"		"b\33MOVDIRI\0"	  \
+	"b\30BUS_LOCK_DETECT" "b\31CLDEMOTE\0"		"b\33MOVDIRI\0"	  \
 	"b\34MOVDIR64B\0" "b\35ENQCMD\0" "b\36SGXLC\0"	"b\37PKS\0"
 
 /* %ecx = 0, %edx */



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

2023-04-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 11 06:42:30 UTC 2023

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/sys/arch/x86/include/specialreg.h

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