CVS commit: src/usr.bin/make/unit-tests

2023-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 06:54:08 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-makeflags.exp
varname-dot-makeflags.mk varname-dot-makeoverrides.exp
varname-dot-makeoverrides.mk

Log Message:
tests/make: reproduce and explain '$' in MAKEFLAGS

https://mail-index.netbsd.org/current-users/2023/02/24/msg043633.html


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-makeflags.exp \
src/usr.bin/make/unit-tests/varname-dot-makeflags.mk
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp
cvs rdiff -u -r1.4 -r1.5 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk

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/unit-tests/varname-dot-makeflags.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-makeflags.exp:1.1 src/usr.bin/make/unit-tests/varname-dot-makeflags.exp:1.2
--- src/usr.bin/make/unit-tests/varname-dot-makeflags.exp:1.1	Tue Dec  1 20:37:30 2020
+++ src/usr.bin/make/unit-tests/varname-dot-makeflags.exp	Sat Feb 25 06:54:08 2023
@@ -1,3 +1,11 @@
-echo "$MAKEFLAGS"
- -r -k -d 0 -D VARNAME WITH SPACES 
+dollars_stage_0: MAKEFLAGS=< -r -k >
+dollars_stage_1: env MAKEFLAGS=< -r -k DOLLARS=\$\{varname\}>
+dollars_stage_1: MAKEFLAGS=< -r -k DOLLARS=\{varname\}>
+dollars_stage_1: MAKEFLAGS:q=< -r -k DOLLARS=\{varname\}>
+dollars_stage_2: env MAKEFLAGS=< -r -k DOLLARS=>
+dollars_stage_2: dollars=<>
+dollars_stage_2: MAKEFLAGS=< -r -k DOLLARS=>
+dollars_stage_3: env MAKEFLAGS=< -r -k DOLLARS=>
+dollars_stage_3: dollars=<>
+dollars_stage_3: MAKEFLAGS=< -r -k DOLLARS=>
 exit status 0
Index: src/usr.bin/make/unit-tests/varname-dot-makeflags.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-makeflags.mk:1.1 src/usr.bin/make/unit-tests/varname-dot-makeflags.mk:1.2
--- src/usr.bin/make/unit-tests/varname-dot-makeflags.mk:1.1	Tue Dec  1 20:37:30 2020
+++ src/usr.bin/make/unit-tests/varname-dot-makeflags.mk	Sat Feb 25 06:54:08 2023
@@ -1,15 +1,107 @@
-# $NetBSD: varname-dot-makeflags.mk,v 1.1 2020/12/01 20:37:30 rillig Exp $
+# $NetBSD: varname-dot-makeflags.mk,v 1.2 2023/02/25 06:54:08 rillig Exp $
 #
 # Tests for the special .MAKEFLAGS variable, which collects almost all
 # command line arguments and passes them on to any child processes via
 # the environment variable MAKEFLAGS (without leading '.').
+#
+# See also:
+#	varname-dot-makeoverrides.mk
+
+all: dollars_stage_0 #spaces_stage_0 dollars_stage_0 append_stage_0
+
 
 # When options are parsed, the option and its argument are appended as
 # separate words to .MAKEFLAGS.  Special characters in the option argument
-# are not quoted though.  It seems to have not been necessary at least from
-# 1993 until 2020.
-.MAKEFLAGS: -d0 -D"VARNAME WITH SPACES"
-
-all:
-	echo "$$MAKEFLAGS"
-	@:;
+# are not quoted though.  It seems to have not been necessary since at least
+# 1993.
+spaces_stage_0:
+	@echo '$@: MAKEFLAGS=<'${MAKEFLAGS:Q}'>'
+	@echo "$@: env MAKEFLAGS=<$$MAKEFLAGS>"
+	@${MAKE} -f ${MAKEFILE} spaces_stage_1 -d0 -D"VARNAME WITH SPACES"
+
+# At this point, the 'VARNAME WITH SPACES' is no longer recognizable as a
+# single command line argument.  In practice, variable names don't contain
+# spaces.
+spaces_stage_1:
+	@echo '$@: MAKEFLAGS=<'${MAKEFLAGS:Q}'>'
+	@echo "$@: env MAKEFLAGS=<$$MAKEFLAGS>"
+
+# Demonstrate that '$' characters are altered when they are passed on to child
+# make processes via MAKEFLAGS.
+dollars_stage_0:
+	@echo '$@: MAKEFLAGS=<'${MAKEFLAGS:Q}'>'
+	# The '' gets parsed as a literal '$$', making the actual variable
+	# value '$${varname}'.
+	#
+	# When Main_ExportMAKEFLAGS adds the variable DOLLARS to MAKEFLAGS, it
+	# first evaluates the variable value, resulting in '${varname}'.
+	#
+	# This value is then escaped as '\$\{varname\}', to ensure that the
+	# variable is later interpreted as a single shell word.
+	@${MAKE} -f ${MAKEFILE} dollars_stage_1 DOLLARS='{varname}'
+
+# The environment variable 'MAKEFLAGS' now contains the variable assignment
+# 'DOLLARS=\$\{varname\}', including the backslashes.
+#
+# expect: dollars_stage_1: env MAKEFLAGS=< -r -k DOLLARS=\$\{varname\}>
+#
+# When Main_ParseArgLine calls Str_Words to parse the flags from MAKEFLAGS, it
+# removes the backslashes, resulting in the plain variable assignment
+# 'DOLLARS=${varname}'.
+dollars_stage_1:
+	@echo "$@: env MAKEFLAGS=<$$MAKEFLAGS>"
+
+	# At this point, evaluating the environment variable 'MAKEFLAGS' has
+	# strange side effects, as the string '\$\{varname\}' is interpreted
+	# as:
+	#
+	#	\		a single backslash
+	#	$\		the value of the variable named '\'
+	#	{varname\}	a literal string
+	#
+	# Since the variable name '\' is not defined, the resulting value is
+	# '\{varname\}'.
+	@echo '$@: MAKEFLAGS=<'${MAKEFLAGS:Q}'>'
+
+	# The modifier 

CVS commit: src/usr.bin/make/unit-tests

2023-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 06:54:08 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-makeflags.exp
varname-dot-makeflags.mk varname-dot-makeoverrides.exp
varname-dot-makeoverrides.mk

Log Message:
tests/make: reproduce and explain '$' in MAKEFLAGS

https://mail-index.netbsd.org/current-users/2023/02/24/msg043633.html


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-makeflags.exp \
src/usr.bin/make/unit-tests/varname-dot-makeflags.mk
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp
cvs rdiff -u -r1.4 -r1.5 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk

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



CVS commit: src/sys/arch/aarch64

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:40:22 UTC 2023

Modified Files:
src/sys/arch/aarch64/aarch64: aarch32_syscall.c cpu_machdep.c cpufunc.c
fault.c pmap_machdep.c syscall.c trap.c
src/sys/arch/aarch64/include: cpu.h

Log Message:
aarch64: curcpu() audit.

Sprinkle KASSERT (or KDASSERT in hot paths) for kpreempt_disabled()
when we use curcpu() and it's not immediately obvious that the caller
has preemption disabled but closer scrutiny suggests the caller has.

Note unsafe curcpu()s for syscall event counting.  Not sure this is
worth changing.

Possible bugs fixed:

- cpu_irq and cpu_fiq could be preempted while trying to run softints
  on this CPU.

- data_abort_handler might incorrectly think it was invoked in
  interrupt context when it was only preempted and migrated to
  another CPU.

- pmap_fault_fixup might report the wrong CPU logs.

(However, we don't currently run with kpreemption on aarch64, so
these are not yet real bugs fixed except if you patch it to build
with __HAVE_PREEMPTION.)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/aarch32_syscall.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/aarch64/fault.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/pmap_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/syscall.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/aarch64/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/aarch64/aarch64/aarch32_syscall.c
diff -u src/sys/arch/aarch64/aarch64/aarch32_syscall.c:1.6 src/sys/arch/aarch64/aarch64/aarch32_syscall.c:1.7
--- src/sys/arch/aarch64/aarch64/aarch32_syscall.c:1.6	Thu Nov 25 03:08:04 2021
+++ src/sys/arch/aarch64/aarch64/aarch32_syscall.c	Sat Feb 25 00:40:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarch32_syscall.c,v 1.6 2021/11/25 03:08:04 ryo Exp $	*/
+/*	$NetBSD: aarch32_syscall.c,v 1.7 2023/02/25 00:40:22 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aarch32_syscall.c,v 1.6 2021/11/25 03:08:04 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarch32_syscall.c,v 1.7 2023/02/25 00:40:22 riastradh Exp $");
 
 #include 
 #include 
@@ -69,7 +69,7 @@ EMULNAME(syscall)(struct trapframe *tf)
 
 	LWP_CACHE_CREDS(l, p);
 
-	curcpu()->ci_data.cpu_nsyscall++;
+	curcpu()->ci_data.cpu_nsyscall++; /* XXX unsafe curcpu() */
 
 	thumbmode = (tf->tf_spsr & SPSR_A32_T) ? true : false;
 #ifdef SYSCALL_CODE_REG

Index: src/sys/arch/aarch64/aarch64/cpu_machdep.c
diff -u src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.13 src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.14
--- src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.13	Thu Jul 28 09:14:12 2022
+++ src/sys/arch/aarch64/aarch64/cpu_machdep.c	Sat Feb 25 00:40:22 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_machdep.c,v 1.13 2022/07/28 09:14:12 riastradh Exp $ */
+/* $NetBSD: cpu_machdep.c,v 1.14 2023/02/25 00:40:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.13 2022/07/28 09:14:12 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.14 2023/02/25 00:40:22 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -116,6 +116,8 @@ dosoftints(void)
 	const uint32_t softiplmask = SOFTIPLMASK(opl);
 	int s;
 
+	KDASSERT(kpreempt_disabled());
+
 	s = splhigh();
 	KASSERT(s == opl);
 	for (;;) {

Index: src/sys/arch/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.33 src/sys/arch/aarch64/aarch64/cpufunc.c:1.34
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.33	Mon Jan 31 09:16:09 2022
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Sat Feb 25 00:40:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.33 2022/01/31 09:16:09 ryo Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.34 2023/02/25 00:40:22 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.33 2022/01/31 09:16:09 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.34 2023/02/25 00:40:22 riastradh Exp $");
 
 #include 
 #include 
@@ -369,6 +369,8 @@ aarch64_dcache_wbinv_all(void)
 	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
+	KASSERT(kpreempt_disabled());
+
 	for (level = 0; level < MAX_CACHE_LEVEL; level++) {
 		if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
 			break;
@@ -386,6 +388,8 @@ aarch64_dcache_inv_all(void)
 	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
+	KASSERT(kpreempt_disabled());
+
 	for (level = 0; level < MAX_CACHE_LEVEL; level++) {
 		if 

CVS commit: src/sys/arch/aarch64

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:40:22 UTC 2023

Modified Files:
src/sys/arch/aarch64/aarch64: aarch32_syscall.c cpu_machdep.c cpufunc.c
fault.c pmap_machdep.c syscall.c trap.c
src/sys/arch/aarch64/include: cpu.h

Log Message:
aarch64: curcpu() audit.

Sprinkle KASSERT (or KDASSERT in hot paths) for kpreempt_disabled()
when we use curcpu() and it's not immediately obvious that the caller
has preemption disabled but closer scrutiny suggests the caller has.

Note unsafe curcpu()s for syscall event counting.  Not sure this is
worth changing.

Possible bugs fixed:

- cpu_irq and cpu_fiq could be preempted while trying to run softints
  on this CPU.

- data_abort_handler might incorrectly think it was invoked in
  interrupt context when it was only preempted and migrated to
  another CPU.

- pmap_fault_fixup might report the wrong CPU logs.

(However, we don't currently run with kpreemption on aarch64, so
these are not yet real bugs fixed except if you patch it to build
with __HAVE_PREEMPTION.)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/aarch32_syscall.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/aarch64/fault.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/pmap_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/syscall.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/aarch64/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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:37:47 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.111 src/sys/arch/xen/xen/xennetback_xenbus.c:1.112
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.111	Sat Feb 25 00:34:36 2023
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Feb 25 00:37:47 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.111 2023/02/25 00:34:36 riastradh Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.112 2023/02/25 00:37:47 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.111 2023/02/25 00:34:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.112 2023/02/25 00:37:47 riastradh Exp $");
 
 #include 
 #include 
@@ -117,7 +117,7 @@ struct xnetback_instance {
 	grant_handle_t xni_tx_ring_handle; /* to unmap the ring */
 	grant_handle_t xni_rx_ring_handle;
 	vaddr_t xni_tx_ring_va; /* to unmap the ring */
-	vaddr_t xni_rx_ring_va; 
+	vaddr_t xni_rx_ring_va;
 
 	/* arrays used in xennetback_ifstart(), used for both Rx and Tx */
 	gnttab_copy_t 	xni_gop_copy[NB_XMIT_PAGES_BATCH];
@@ -782,7 +782,7 @@ xennetback_tx_m0len_fragment(struct xnet
 {
 	netif_tx_request_t *txreq;
 
-	/* This assumes all the requests are already pushed into the ring */ 
+	/* This assumes all the requests are already pushed into the ring */
 	*cntp = 1;
 	do {
 		txreq = RING_GET_REQUEST(>xni_txring, req_cons);
@@ -1269,7 +1269,7 @@ again:
 		 * here, as the frontend doesn't notify when adding
 		 * requests anyway
 		 */
-		if (__predict_false(abort || 
+		if (__predict_false(abort ||
 		!RING_HAS_UNCONSUMED_REQUESTS(>xni_rxring))) {
 			/* ring full */
 			ifp->if_timer = 1;



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:37:47 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xenbus

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:37:34 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
xenbus_comms.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/xenbus/xenbus_comms.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/xen/xenbus

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:37:34 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
xenbus_comms.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/xenbus/xenbus_comms.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/xen/xenbus/xenbus_comms.c
diff -u src/sys/arch/xen/xenbus/xenbus_comms.c:1.25 src/sys/arch/xen/xenbus/xenbus_comms.c:1.26
--- src/sys/arch/xen/xenbus/xenbus_comms.c:1.25	Sat Feb 25 00:34:01 2023
+++ src/sys/arch/xen/xenbus/xenbus_comms.c	Sat Feb 25 00:37:34 2023
@@ -1,24 +1,24 @@
-/* $NetBSD: xenbus_comms.c,v 1.25 2023/02/25 00:34:01 riastradh Exp $ */
+/* $NetBSD: xenbus_comms.c,v 1.26 2023/02/25 00:37:34 riastradh Exp $ */
 /**
  * xenbus_comms.c
  *
  * Low level code to talks to Xen Store: ringbuffer and event channel.
  *
  * Copyright (C) 2005 Rusty Russell, IBM Corporation
- * 
+ *
  * This file may be distributed separately from the Linux kernel, or
  * incorporated into other software packages, subject to the following license:
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
  * restriction, including without limitation the rights to use, copy, modify,
  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  * and to permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -29,11 +29,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.25 2023/02/25 00:34:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.26 2023/02/25 00:37:34 riastradh Exp $");
 
 #include 
-#include  
-#include  
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -80,7 +80,7 @@ wake_waiting(void *arg)
 {
 	if (__predict_false(xenstored_ready == 0 && xendomain_is_dom0())) {
 		xb_xenstored_make_ready();
-	} 
+	}
 
 	mutex_enter(_lock);
 	cv_broadcast(_cv);



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:52 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
xengnt(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/xen/xengnt.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/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.40 src/sys/arch/xen/xen/xengnt.c:1.41
--- src/sys/arch/xen/xen/xengnt.c:1.40	Sat Feb 25 00:33:50 2023
+++ src/sys/arch/xen/xen/xengnt.c	Sat Feb 25 00:35:52 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.40 2023/02/25 00:33:50 riastradh Exp $  */
+/*  $NetBSD: xengnt.c,v 1.41 2023/02/25 00:35:52 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.40 2023/02/25 00:33:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.41 2023/02/25 00:35:52 riastradh Exp $");
 
 #include 
 #include 
@@ -212,7 +212,7 @@ xengnt_suspend(void) {
 		/* invalidate all grant entries (necessary for resume) */
 		gnt_entries[i] = XENGNT_NO_ENTRY;
 	}
-	
+
 	/* Remove virtual => machine mapping for grant table */
 	pmap_kremove((vaddr_t)grant_table.gntt, gnt_nr_grant_frames * PAGE_SIZE);
 
@@ -450,7 +450,7 @@ xengnt_grant_access(domid_t dom, paddr_t
 		grant_table.gntt_v2[*entryp].full_page.frame = ma >> PAGE_SHIFT;
 		grant_table.gntt_v2[*entryp].hdr.domid = dom;
 		/*
-		 * ensure that the above values reach global visibility 
+		 * ensure that the above values reach global visibility
 		 * before permitting frame's access (done when we set flags)
 		 */
 		xen_wmb();
@@ -459,9 +459,9 @@ xengnt_grant_access(domid_t dom, paddr_t
 	} else {
 		grant_table.gntt_v1[*entryp].frame = ma >> PAGE_SHIFT;
 		grant_table.gntt_v1[*entryp].domid = dom;
-		/*  
+		/*
 		* ensure that the above values reach global visibility
-		* before permitting frame's access (done when we set flags)
+		* before permitting frame's access (done when we set flags)
 		*/
 		xen_wmb();
 		grant_table.gntt_v1[*entryp].flags =
@@ -472,7 +472,7 @@ xengnt_grant_access(domid_t dom, paddr_t
 }
 
 static inline uint16_t
-xen_atomic_cmpxchg16(volatile uint16_t *ptr, uint16_t  val, uint16_t newval) 
+xen_atomic_cmpxchg16(volatile uint16_t *ptr, uint16_t  val, uint16_t newval)
 {
 	unsigned long result;
 



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:52 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
xengnt(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/xen/xengnt.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:40 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/xen/xen/xencons.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/xen/xen/xencons.c
diff -u src/sys/arch/xen/xen/xencons.c:1.52 src/sys/arch/xen/xen/xencons.c:1.53
--- src/sys/arch/xen/xen/xencons.c:1.52	Sat Feb 25 00:33:38 2023
+++ src/sys/arch/xen/xen/xencons.c	Sat Feb 25 00:35:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xencons.c,v 1.52 2023/02/25 00:33:38 riastradh Exp $	*/
+/*	$NetBSD: xencons.c,v 1.53 2023/02/25 00:35:40 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.52 2023/02/25 00:33:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.53 2023/02/25 00:35:40 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -82,10 +82,10 @@ __KERNEL_RCSID(0, "$NetBSD: xencons.c,v 
 #endif
 
 #undef XENDEBUG
- 
+
 #ifdef XENDEBUG
 #define XENPRINTK(x) printk x
-#else 
+#else
 #define XENPRINTK(x)
 #endif
 
@@ -127,7 +127,7 @@ const struct cdevsw xencons_cdevsw = {
 	.d_close = xencons_close,
 	.d_read = xencons_read,
 	.d_write = xencons_write,
-	.d_ioctl = xencons_ioctl, 
+	.d_ioctl = xencons_ioctl,
 	.d_stop = xencons_stop,
 	.d_tty = xencons_tty,
 	.d_poll = xencons_poll,
@@ -328,7 +328,7 @@ xencons_poll(dev_t dev, int events, stru
 	struct xencons_softc *sc = device_lookup_private(_cd,
 	XENCONS_UNIT(dev));
 	struct tty *tp = sc->sc_tty;
- 
+
 	return ((*tp->t_linesw->l_poll)(tp, events, l));
 }
 
@@ -442,7 +442,7 @@ xencons_stop(struct tty *tp, int flag)
 }
 
 /* Non-privileged console interrupt routine */
-static int 
+static int
 xencons_handler(void *arg)
 {
 	struct xencons_softc *sc = arg;
@@ -453,7 +453,7 @@ xencons_handler(void *arg)
 		splx(s);
 		return 1;
 	}
-		
+
 
 #define XNC_IN (xencons_interface->in)
 



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:40 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/xen/xen/xencons.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:28 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
xbdback(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.102 src/sys/arch/xen/xen/xbdback_xenbus.c:1.103
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.102	Sat Feb 25 00:33:15 2023
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sat Feb 25 00:35:28 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.102 2023/02/25 00:33:15 riastradh Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.103 2023/02/25 00:35:28 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.102 2023/02/25 00:33:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.103 2023/02/25 00:35:28 riastradh Exp $");
 
 #include 
 #include 
@@ -105,7 +105,7 @@ typedef enum {WAITING, RUN, DISCONNECTIN
  * event channels, biointr() soft interrupts, xenbus commands), the xbdi_lock
  * mutex is used to protect specific elements of the xbdback instance from
  * concurrent access: thread status and ring access (when pushing responses).
- * 
+ *
  * Here's how the call graph is supposed to be for a single I/O:
  *
  * xbdback_co_main()
@@ -125,7 +125,7 @@ typedef enum {WAITING, RUN, DISCONNECTIN
  *| |
  *| xbdback_co_main_incr() -> xbdback_co_main_loop()
  *|
- * xbdback_co_do_io() 
+ * xbdback_co_do_io()
  *|
  * xbdback_co_main_incr() -> xbdback_co_main_loop()
  */
@@ -210,7 +210,7 @@ struct xbdback_instance {
 	vaddr_t xbdi_ring_va; /* to unmap the ring */
 	/* disconnection must be postponed until all I/O is done */
 	int xbdi_refcnt;
-	/* 
+	/*
 	 * State for I/O processing/coalescing follows; this has to
 	 * live here instead of on the stack because of the
 	 * continuation-ness (see above).
@@ -361,7 +361,7 @@ xbdback_xenbus_create(struct xenbus_devi
 	mutex_init(>xbdi_lock, MUTEX_DEFAULT, IPL_BIO);
 	cv_init(>xbdi_cv, xbdi->xbdi_name);
 
-	xbusd->xbusd_u.b.b_cookie = xbdi;	
+	xbusd->xbusd_u.b.b_cookie = xbdi;
 	xbusd->xbusd_u.b.b_detach = xbdback_xenbus_destroy;
 	xbusd->xbusd_otherend_changed = xbdback_frontend_changed;
 	xbdi->xbdi_xbusd = xbusd;
@@ -615,7 +615,7 @@ err1:
 static void
 xbdback_disconnect(struct xbdback_instance *xbdi)
 {
-	
+
 	mutex_enter(>xbdi_lock);
 	if (xbdi->xbdi_status == DISCONNECTED) {
 		mutex_exit(>xbdi_lock);
@@ -759,7 +759,7 @@ xbdback_backend_changed(struct xenbus_wa
 		/* If both Ioctls failed set device size to 0 and return */
 		printf("xbdback %s: can't DIOCGWEDGEINFO device "
 		"0x%"PRIx64": %d\n", xbusd->xbusd_path,
-		xbdi->xbdi_dev, err);		
+		xbdi->xbdi_dev, err);
 		xbdi->xbdi_size = xbdi->xbdi_dev = 0;
 		vn_close(xbdi->xbdi_vp, FREAD, NOCRED);
 		xbdi->xbdi_vp = NULL;
@@ -901,7 +901,7 @@ xbdback_thread(void *arg)
 cv_wait(>xbdi_cv, >xbdi_lock);
 continue;
 			}
-			
+
 			/* All I/Os should have been processed by now,
 			 * xbdi_refcnt should drop to 0 */
 			xbdi_put(xbdi);
@@ -941,7 +941,7 @@ xbdback_co_main(struct xbdback_instance 
  * the ring.
  */
 static void *
-xbdback_co_main_loop(struct xbdback_instance *xbdi, void *obj __unused) 
+xbdback_co_main_loop(struct xbdback_instance *xbdi, void *obj __unused)
 {
 	blkif_request_t *req, *reqn;
 	blkif_x86_32_request_t *req32;
@@ -1115,7 +1115,7 @@ xbdback_co_cache_doflush(struct xbdback_
  */
 static void *
 xbdback_co_io(struct xbdback_instance *xbdi, void *obj __unused)
-{	
+{
 	int i, error;
 	blkif_request_t *req, *reqn;
 	blkif_x86_32_request_t *req32;
@@ -1242,7 +1242,7 @@ xbdback_co_io_gotio(struct xbdback_insta
 
 	xbdi_get(xbdi);
 	xbdi->xbdi_pendingreqs++;
-	
+
 	req = >xbdi_xen_req;
 	xbd_io = obj;
 	memset(xbd_io, 0, sizeof(*xbd_io));
@@ -1432,7 +1432,7 @@ xbdback_iodone_locked(struct xbdback_ins
 		status = BLKIF_RSP_ERROR;
 	} else
 		status = BLKIF_RSP_OKAY;
-	
+
 	xbdback_send_reply(xbdi, xbd_io->xio_id, xbd_io->xio_operation, status);
 
 	xbdi_put(xbdi);
@@ -1536,7 +1536,7 @@ xbdback_map_shm(struct xbdback_io *xbd_i
 	xbd_io->xio_vaddr = xbd_io->xio_xv->xv_vaddr;
 
 	error = xen_shm_map(xbd_io->xio_nrma, xbdi->xbdi_domid,
-	xbd_io->xio_gref, xbd_io->xio_vaddr, xbd_io->xio_gh, 
+	xbd_io->xio_gref, xbd_io->xio_vaddr, xbd_io->xio_gh,
 	(xbd_io->xio_operation == BLKIF_OP_WRITE) ? XSHM_RO : 0);
 
 	switch(error) {



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:28 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
xbdback(4): Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:15 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
xbd(4): Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.130 src/sys/arch/xen/xen/xbd_xenbus.c:1.131
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.130	Sat Feb 25 00:33:03 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Feb 25 00:35:15 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.130 2023/02/25 00:33:03 riastradh Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.130 2023/02/25 00:33:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -99,7 +99,7 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c
 #define XBD_XFER_LIMIT	(2*XBD_MAX_XFER)
 
 #define XEN_BSHIFT  9   /* log2(XEN_BSIZE) */
-#define XEN_BSIZE   (1 << XEN_BSHIFT) 
+#define XEN_BSIZE   (1 << XEN_BSHIFT)
 
 CTASSERT((MAXPHYS <= 2*XBD_MAX_CHUNK));
 CTASSERT(XEN_BSIZE == DEV_BSIZE);
@@ -676,7 +676,7 @@ xbd_backend_changed(void *arg, XenbusSta
 		sc->sc_xbdsize =
 		sc->sc_sectors * (uint64_t)sc->sc_secsize / DEV_BSIZE;
 		dg = >sc_dksc.sc_dkdev.dk_geom;
-		memset(dg, 0, sizeof(*dg));	
+		memset(dg, 0, sizeof(*dg));
 
 		dg->dg_secperunit = sc->sc_xbdsize;
 		dg->dg_secsize = DEV_BSIZE;
@@ -736,13 +736,13 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 	err = xenbus_read_ul(NULL,
 	sc->sc_xbusd->xbusd_path, "virtual-device", >sc_handle, 10);
 	if (err)
-		panic("%s: can't read number from %s/virtual-device\n", 
+		panic("%s: can't read number from %s/virtual-device\n",
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
 	err = xenbus_read_ull(NULL,
 	sc->sc_xbusd->xbusd_otherend, "sectors", , 10);
 	if (err)
-		panic("%s: can't read number from %s/sectors\n", 
+		panic("%s: can't read number from %s/sectors\n",
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
 	sc->sc_sectors = sectors;
@@ -750,13 +750,13 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 	err = xenbus_read_ul(NULL,
 	sc->sc_xbusd->xbusd_otherend, "info", >sc_info, 10);
 	if (err)
-		panic("%s: can't read number from %s/info\n", 
+		panic("%s: can't read number from %s/info\n",
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
 	err = xenbus_read_ul(NULL,
 	sc->sc_xbusd->xbusd_otherend, "sector-size", >sc_secsize, 10);
 	if (err)
-		panic("%s: can't read number from %s/sector-size\n", 
+		panic("%s: can't read number from %s/sector-size\n",
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
 
@@ -934,7 +934,7 @@ xbd_iosize(device_t dev, int *maxxfer)
 {
 	/*
 	 * Always restrict dumps to XBD_MAX_XFER to avoid indirect segments,
-	 * so that it uses as little memory as possible. 
+	 * so that it uses as little memory as possible.
 	 */
 	if (*maxxfer > XBD_MAX_XFER)
 		*maxxfer = XBD_MAX_XFER;
@@ -1008,7 +1008,7 @@ xbdsize(dev_t dev)
 static int
 xbdread(dev_t dev, struct uio *uio, int flags)
 {
-	struct xbd_xenbus_softc *sc = 
+	struct xbd_xenbus_softc *sc =
 	device_lookup_private(_cd, DISKUNIT(dev));
 	struct  dk_softc *dksc = >sc_dksc;
 
@@ -1277,7 +1277,7 @@ xbd_diskstart_submit(struct xbd_xenbus_s
 	req->sector_number = bp->b_rawblkno + (start >> XEN_BSHIFT);
 	req->handle = sc->sc_handle;
 
-	size = uimin(bp->b_bcount - start, XBD_MAX_CHUNK); 
+	size = uimin(bp->b_bcount - start, XBD_MAX_CHUNK);
 	for (dmaseg = 0; dmaseg < dmamap->dm_nsegs && size > 0; dmaseg++) {
 		bus_dma_segment_t *ds = >dm_segs[dmaseg];
 



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:15 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
xbd(4): Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/xen/xen/xbd_xenbus.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/xen/x86

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:01 UTC 2023

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
xen/x86/cpu.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/xen/x86/cpu.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/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.144 src/sys/arch/xen/x86/cpu.c:1.145
--- src/sys/arch/xen/x86/cpu.c:1.144	Sat Feb 25 00:32:38 2023
+++ src/sys/arch/xen/x86/cpu.c	Sat Feb 25 00:35:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.144 2023/02/25 00:32:38 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.145 2023/02/25 00:35:01 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.144 2023/02/25 00:32:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.145 2023/02/25 00:35:01 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -521,7 +521,7 @@ cpu_attach_common(device_t parent, devic
 		(void *)pcb->pcb_rsp
 #endif
 		);
-		
+
 	}
 #endif /* MPVERBOSE */
 }
@@ -690,10 +690,10 @@ cpu_boot_secondary(struct cpu_info *ci)
 
 /*
  * APs end up here immediately after initialisation and VCPUOP_up in
- * mp_cpu_start(). 
+ * mp_cpu_start().
  * At this point, we are running in the idle pcb/idle stack of the new
  * CPU.  This function jumps to the idle loop and starts looking for
- * work. 
+ * work.
  */
 extern void x86_64_tls_switch(struct lwp *);
 void
@@ -931,8 +931,8 @@ xen_init_i386_vcpuctxt(struct cpu_info *
 
 	gdt_prepframes(frames, (vaddr_t)ci->ci_gdt, gdt_ents);
 
-	/* 
-	 * Initialise the vcpu context: 
+	/*
+	 * Initialise the vcpu context:
 	 * We use this cpu's idle_loop() pcb context.
 	 */
 
@@ -1160,7 +1160,7 @@ cpu_load_pmap(struct pmap *pmap, struct 
 
 /*
  * pmap_cpu_init_late: perform late per-CPU initialization.
- * 
+ *
  * Short note about percpu PDIR pages. Both the PAE and __x86_64__ architectures
  * have per-cpu PDIR tables, for two different reasons:
  *  - on PAE, this is to get around Xen's pagetable setup constraints (multiple
@@ -1170,7 +1170,7 @@ cpu_load_pmap(struct pmap *pmap, struct 
  *(see cpu_load_pmap()).
  *
  * What this means for us is that the PDIR of the pmap_kernel() is considered
- * to be a canonical "SHADOW" PDIR with the following properties: 
+ * to be a canonical "SHADOW" PDIR with the following properties:
  *  - its recursive mapping points to itself
  *  - per-cpu recursive mappings point to themselves on __x86_64__
  *  - per-cpu L4 pages' kernel entries are expected to be in sync with



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:35:01 UTC 2023

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
xen/x86/cpu.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/xen/x86/cpu.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/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:49 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
xen/hypervisor.h: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/include/hypervisor.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/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.56 src/sys/arch/xen/include/hypervisor.h:1.57
--- src/sys/arch/xen/include/hypervisor.h:1.56	Sat Feb 25 00:32:26 2023
+++ src/sys/arch/xen/include/hypervisor.h	Sat Feb 25 00:34:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.56 2023/02/25 00:32:26 riastradh Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.57 2023/02/25 00:34:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,21 +26,21 @@
  */
 
 /*
- * 
+ *
  * Communication to/from hypervisor.
- * 
+ *
  * Copyright (c) 2002-2004, K A Fraser
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
  * restriction, including without limitation the rights to use, copy, modify,
  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  * and to permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -187,10 +187,10 @@ void hypervisor_set_ipending(uint64_t, i
 void hypervisor_machdep_attach(void);
 void hypervisor_machdep_resume(void);
 
-/* 
+/*
  * Force a proper event-channel callback from Xen after clearing the
  * callback mask. We do this in a very simple manner, by making a call
- * down into Xen. The pending flag will be checked by Xen on return. 
+ * down into Xen. The pending flag will be checked by Xen on return.
  */
 static __inline void hypervisor_force_callback(void)
 {



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:49 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
xen/hypervisor.h: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/include/hypervisor.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:36 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Omit needless membars in xennetback_connect.

xneti is a private data structure to which we have exclusive access
here; ordering the stores doesn't make sense.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.110 src/sys/arch/xen/xen/xennetback_xenbus.c:1.111
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.110	Sat Feb 25 00:34:25 2023
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Feb 25 00:34:36 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.111 2023/02/25 00:34:36 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.111 2023/02/25 00:34:36 riastradh Exp $");
 
 #include 
 #include 
@@ -497,9 +497,7 @@ xennetback_connect(struct xnetback_insta
 		goto err2;
 	}
 	xneti->xni_evtchn = evop.u.bind_interdomain.local_port;
-	xen_wmb();
 	xneti->xni_status = CONNECTED;
-	xen_wmb();
 
 	xneti->xni_ih = xen_intr_establish_xname(-1, _pic,
 	xneti->xni_evtchn, IST_LEVEL, IPL_NET, xennetback_evthandler,



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:36 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Omit needless membars in xennetback_connect.

xneti is a private data structure to which we have exclusive access
here; ordering the stores doesn't make sense.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:25 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Fix membars in xennetback_rx_copy_process.

- No need for barrier around touching req_cons and rsp_prod_pvt,
  which are private.

- RING_PUSH_RESPONSES_AND_CHECK_NOTIFY already issues xen_wmb, no
  need to add one explicitly.

- After pushing responses, must issue xen_wmb (not xen_rmb) before
  hypervisor_notify_via_evtchn.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.109 src/sys/arch/xen/xen/xennetback_xenbus.c:1.110
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.109	Sat Feb 25 00:34:13 2023
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Feb 25 00:34:25 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $");
 
 #include 
 #include 
@@ -1022,14 +1022,13 @@ xennetback_rx_copy_process(struct ifnet 
 	}
 
 	/* update pointer */
-	xen_rmb();
 	xneti->xni_rxring.req_cons += queued;
 	xneti->xni_rxring.rsp_prod_pvt += queued;
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(>xni_rxring, notify);
 
 	/* send event */
 	if (notify) {
-		xen_rmb();
+		xen_wmb();
 		XENPRINTF(("%s receive event\n",
 		xneti->xni_if.if_xname));
 		hypervisor_notify_via_evtchn(xneti->xni_evtchn);



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:25 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Fix membars in xennetback_rx_copy_process.

- No need for barrier around touching req_cons and rsp_prod_pvt,
  which are private.

- RING_PUSH_RESPONSES_AND_CHECK_NOTIFY already issues xen_wmb, no
  need to add one explicitly.

- After pushing responses, must issue xen_wmb (not xen_rmb) before
  hypervisor_notify_via_evtchn.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:13 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Fix xennetback_evthandler loop.

- After observing the other side has produced pending tx requests by
  reading sring->req_prod, must issue xen_rmb before touching them.

  Despite all the effort to use the heavy-weight
  RING_FINAL_CHECK_FOR_REQUESTS on each request in the loop, this
  barrier was missing.

- No need to update req_cons at each iteration in the loop.  It's
  private.  Just update it once at the end.

- After consuming requests, must issue xen_wmb before releasing the
  slots with RING_FINAL_CHECK_FOR_REQUEST for the other side to
  reuse.

XXX pullup-8 (requires patch; at least add xen_rmb between
RING_FINAL_CHECK_FOR_REQUESTS and RING_COPY_REQUEST)
XXX pullup-9 (requires patch; at least add xen_rmb between
RING_FINAL_CHECK_FOR_REQUESTS and RING_COPY_REQUEST)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.108 src/sys/arch/xen/xen/xennetback_xenbus.c:1.109
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.108	Fri Sep  2 23:48:10 2022
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Feb 25 00:34:13 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.108 2022/09/02 23:48:10 thorpej Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.108 2022/09/02 23:48:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $");
 
 #include 
 #include 
@@ -805,7 +805,7 @@ xennetback_evthandler(void *arg)
 	netif_tx_request_t txreq;
 	struct mbuf *m, *m0 = NULL, *mlast = NULL;
 	int receive_pending;
-	RING_IDX req_cons;
+	RING_IDX req_cons, req_prod;
 	int queued = 0, m0_len = 0;
 	struct xnetback_xstate *xst;
 	const bool discard = ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
@@ -813,17 +813,12 @@ xennetback_evthandler(void *arg)
 
 	XENPRINTF(("xennetback_evthandler "));
 	req_cons = xneti->xni_txring.req_cons;
-	while (1) {
-		xen_rmb(); /* be sure to read the request before updating */
-		xneti->xni_txring.req_cons = req_cons;
-		xen_wmb();
-		RING_FINAL_CHECK_FOR_REQUESTS(>xni_txring,
-		receive_pending);
-		if (receive_pending == 0)
-			break;
+again:
+	req_prod = xneti->xni_txring.sring->req_prod;
+	xen_rmb();
+	while (req_cons != req_prod) {
 		RING_COPY_REQUEST(>xni_txring, req_cons,
 		);
-		xen_rmb();
 		XENPRINTF(("%s pkt size %d\n", xneti->xni_if.if_xname,
 		txreq.size));
 		req_cons++;
@@ -962,6 +957,12 @@ mbuf_fail:
 			queued = 0;
 		}
 	}
+	xen_wmb();
+	RING_FINAL_CHECK_FOR_REQUESTS(>xni_txring, receive_pending);
+	if (receive_pending)
+		goto again;
+	xneti->xni_txring.req_cons = req_cons;
+
 	if (m0) {
 		/* Queue empty, and still unfinished multi-fragment request */
 		printf("%s: dropped unfinished multi-fragment\n",



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:13 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xennetback(4): Fix xennetback_evthandler loop.

- After observing the other side has produced pending tx requests by
  reading sring->req_prod, must issue xen_rmb before touching them.

  Despite all the effort to use the heavy-weight
  RING_FINAL_CHECK_FOR_REQUESTS on each request in the loop, this
  barrier was missing.

- No need to update req_cons at each iteration in the loop.  It's
  private.  Just update it once at the end.

- After consuming requests, must issue xen_wmb before releasing the
  slots with RING_FINAL_CHECK_FOR_REQUEST for the other side to
  reuse.

XXX pullup-8 (requires patch; at least add xen_rmb between
RING_FINAL_CHECK_FOR_REQUESTS and RING_COPY_REQUEST)
XXX pullup-9 (requires patch; at least add xen_rmb between
RING_FINAL_CHECK_FOR_REQUESTS and RING_COPY_REQUEST)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xenbus

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:01 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
xenbus_comms.c: Membar audit.

This had the sense of membars reversed, presumably because xen_rmb
and xen_wmb had gotten reversed at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/xenbus/xenbus_comms.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/xen/xenbus/xenbus_comms.c
diff -u src/sys/arch/xen/xenbus/xenbus_comms.c:1.24 src/sys/arch/xen/xenbus/xenbus_comms.c:1.25
--- src/sys/arch/xen/xenbus/xenbus_comms.c:1.24	Wed May 13 13:19:38 2020
+++ src/sys/arch/xen/xenbus/xenbus_comms.c	Sat Feb 25 00:34:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_comms.c,v 1.24 2020/05/13 13:19:38 jdolecek Exp $ */
+/* $NetBSD: xenbus_comms.c,v 1.25 2023/02/25 00:34:01 riastradh Exp $ */
 /**
  * xenbus_comms.c
  *
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.24 2020/05/13 13:19:38 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.25 2023/02/25 00:34:01 riastradh Exp $");
 
 #include 
 #include  
@@ -153,9 +153,9 @@ xb_write(const void *data, unsigned len)
 		len -= avail;
 
 		/* Other side must not see new header until data is there. */
-		xen_rmb();
+		xen_wmb();
 		intf->req_prod += avail;
-		xen_rmb();
+		xen_wmb();
 
 		hypervisor_notify_via_evtchn(xen_start_info.store_evtchn);
 	}
@@ -202,9 +202,9 @@ xb_read(void *data, unsigned len)
 		len -= avail;
 
 		/* Other side must not see free space until we've copied out */
-		xen_rmb();
+		xen_wmb();
 		intf->rsp_cons += avail;
-		xen_rmb();
+		xen_wmb();
 
 		XENPRINTF(("Finished read of %i bytes (%i to go)\n",
 		avail, len));



CVS commit: src/sys/arch/xen/xenbus

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:34:01 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
xenbus_comms.c: Membar audit.

This had the sense of membars reversed, presumably because xen_rmb
and xen_wmb had gotten reversed at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/xenbus/xenbus_comms.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:50 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
xengnt(4): Membar audit.

This had the sense of membars reversed, presumably because xen_rmb
and xen_wmb had gotten reversed at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/xen/xengnt.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/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.39 src/sys/arch/xen/xen/xengnt.c:1.40
--- src/sys/arch/xen/xen/xengnt.c:1.39	Fri Jun  3 10:42:17 2022
+++ src/sys/arch/xen/xen/xengnt.c	Sat Feb 25 00:33:50 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.39 2022/06/03 10:42:17 bouyer Exp $  */
+/*  $NetBSD: xengnt.c,v 1.40 2023/02/25 00:33:50 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.39 2022/06/03 10:42:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.40 2023/02/25 00:33:50 riastradh Exp $");
 
 #include 
 #include 
@@ -453,7 +453,7 @@ xengnt_grant_access(domid_t dom, paddr_t
 		 * ensure that the above values reach global visibility 
 		 * before permitting frame's access (done when we set flags)
 		 */
-		xen_rmb();
+		xen_wmb();
 		grant_table.gntt_v2[*entryp].hdr.flags =
 		GTF_permit_access | (ro ? GTF_readonly : 0);
 	} else {
@@ -463,8 +463,8 @@ xengnt_grant_access(domid_t dom, paddr_t
 		* ensure that the above values reach global visibility
 		* before permitting frame's access (done when we set flags)
 		*/
-		xen_rmb();
-		grant_table.gntt_v1[*entryp].flags =  
+		xen_wmb();
+		grant_table.gntt_v1[*entryp].flags =
 		   GTF_permit_access | (ro ? GTF_readonly : 0);
 	}
 	mutex_exit(_lock);



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:50 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
xengnt(4): Membar audit.

This had the sense of membars reversed, presumably because xen_rmb
and xen_wmb had gotten reversed at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/xen/xengnt.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:39 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Reduce unnecessary membars.

- xencons_handler: After advancing in_cons, only need one xen_wmb
  before notifying the hypervisor that we're ready for more.

  (XXX Should this do xen_mb and re-check in_prod at that point, or
  does hypervisor_notify_via_evtchn obviate the need for this?)

- xenvonscn_getc: After reading in_prod, only need one xen_rmb before
  using the slots it is telling us are now ready.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/xencons.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:39 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Reduce unnecessary membars.

- xencons_handler: After advancing in_cons, only need one xen_wmb
  before notifying the hypervisor that we're ready for more.

  (XXX Should this do xen_mb and re-check in_prod at that point, or
  does hypervisor_notify_via_evtchn obviate the need for this?)

- xenvonscn_getc: After reading in_prod, only need one xen_rmb before
  using the slots it is telling us are now ready.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/xencons.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/xen/xen/xencons.c
diff -u src/sys/arch/xen/xen/xencons.c:1.51 src/sys/arch/xen/xen/xencons.c:1.52
--- src/sys/arch/xen/xen/xencons.c:1.51	Sat Feb 25 00:33:27 2023
+++ src/sys/arch/xen/xen/xencons.c	Sat Feb 25 00:33:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xencons.c,v 1.51 2023/02/25 00:33:27 riastradh Exp $	*/
+/*	$NetBSD: xencons.c,v 1.52 2023/02/25 00:33:38 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.51 2023/02/25 00:33:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.52 2023/02/25 00:33:38 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -479,9 +479,9 @@ xencons_handler(void *arg)
 			cons += len;
 			xen_wmb();
 			xencons_interface->in_cons = cons;
-			xen_wmb();
 		}
 	}
+	xen_wmb();
 	hypervisor_notify_via_evtchn(xen_start_info.console.domU.evtchn);
 	splx(s);
 	return 1;
@@ -575,7 +575,6 @@ xenconscn_getc(dev_t dev)
 
 	cons = xencons_interface->in_cons;
 	prod = xencons_interface->in_prod;
-	xen_rmb();
 	while (cons == prod) {
 		HYPERVISOR_yield();
 		prod = xencons_interface->in_prod;



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:27 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Membar audit.

- xenconscn_getc: Once we have consumed an input slot, it is clearer
  to issue xen_wmb (release, i.e., load/store-before-store) before
  advancing in_cons so that the update becomes a store-release
  freeing the input slot for the other side to reuse.

- xenconscn_putc: After filling an output slot, must issue xen_wmb
  (release, i.e., load/store-before-store) before advancing out_prod,
  and another one before notifying the other side of the advance.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/xen/xen/xencons.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:27 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xencons.c

Log Message:
xencons(4): Membar audit.

- xenconscn_getc: Once we have consumed an input slot, it is clearer
  to issue xen_wmb (release, i.e., load/store-before-store) before
  advancing in_cons so that the update becomes a store-release
  freeing the input slot for the other side to reuse.

- xenconscn_putc: After filling an output slot, must issue xen_wmb
  (release, i.e., load/store-before-store) before advancing out_prod,
  and another one before notifying the other side of the advance.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/xen/xen/xencons.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/xen/xen/xencons.c
diff -u src/sys/arch/xen/xen/xencons.c:1.50 src/sys/arch/xen/xen/xencons.c:1.51
--- src/sys/arch/xen/xen/xencons.c:1.50	Thu May  7 19:25:57 2020
+++ src/sys/arch/xen/xen/xencons.c	Sat Feb 25 00:33:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xencons.c,v 1.50 2020/05/07 19:25:57 maxv Exp $	*/
+/*	$NetBSD: xencons.c,v 1.51 2023/02/25 00:33:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.50 2020/05/07 19:25:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.51 2023/02/25 00:33:27 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -583,7 +583,7 @@ xenconscn_getc(dev_t dev)
 	xen_rmb();
 	c = xencons_interface->in[MASK_XENCONS_IDX(xencons_interface->in_cons,
 	xencons_interface->in)];
-	xen_rmb();
+	xen_wmb();
 	xencons_interface->in_cons = cons + 1;
 	cn_check_magic(dev, c, xencons_cnm_state);
 	splx(s);
@@ -614,9 +614,9 @@ xenconscn_putc(dev_t dev, int c)
 		}
 		xencons_interface->out[MASK_XENCONS_IDX(xencons_interface->out_prod,
 		xencons_interface->out)] = c;
-		xen_rmb();
+		xen_wmb();
 		xencons_interface->out_prod++;
-		xen_rmb();
+		xen_wmb();
 		hypervisor_notify_via_evtchn(xen_start_info.console.domU.evtchn);
 		splx(s);
 	}



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:15 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
xbdback(4): Membar audit.

After consuming request slots, must issue xen_wmb notifying the other
side that we've consumed them in RING_FINAL_CHECK_FOR_REQUESTS.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:15 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
xbdback(4): Membar audit.

After consuming request slots, must issue xen_wmb notifying the other
side that we've consumed them in RING_FINAL_CHECK_FOR_REQUESTS.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.101 src/sys/arch/xen/xen/xbdback_xenbus.c:1.102
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.101	Thu Sep  1 15:33:23 2022
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sat Feb 25 00:33:15 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.101 2022/09/01 15:33:23 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.102 2023/02/25 00:33:15 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.101 2022/09/01 15:33:23 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.102 2023/02/25 00:33:15 riastradh Exp $");
 
 #include 
 #include 
@@ -1065,6 +1065,7 @@ xbdback_co_main_done2(struct xbdback_ins
 {
 	int work_to_do;
 
+	xen_wmb();
 	RING_FINAL_CHECK_FOR_REQUESTS(>xbdi_ring.ring_n, work_to_do);
 	if (work_to_do)
 		xbdi->xbdi_cont = xbdback_co_main;



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:04 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
xbd(4): Membar audit.

After consuming slots, must issue xen_wmb before notifying the other
side that we've consumed them in RING_FINAL_CHECK_FOR_RESPONSES.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.129 src/sys/arch/xen/xen/xbd_xenbus.c:1.130
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.129	Mon Jul 13 21:21:56 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Feb 25 00:33:03 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.129 2020/07/13 21:21:56 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.130 2023/02/25 00:33:03 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.129 2020/07/13 21:21:56 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.130 2023/02/25 00:33:03 riastradh Exp $");
 
 #include "opt_xen.h"
 
@@ -905,10 +905,9 @@ again:
 		}
 		SLIST_INSERT_HEAD(>sc_xbdreq_head, xbdreq, req_next);
 	}
-
-	xen_rmb();
 	sc->sc_ring.rsp_cons = i;
 
+	xen_wmb();
 	RING_FINAL_CHECK_FOR_RESPONSES(>sc_ring, more_to_do);
 	if (more_to_do)
 		goto again;



CVS commit: src/sys/arch/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:33:04 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
xbd(4): Membar audit.

After consuming slots, must issue xen_wmb before notifying the other
side that we've consumed them in RING_FINAL_CHECK_FOR_RESPONSES.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:49 UTC 2023

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
xennet(4): Membar audit.

- xennet_tx_complete: Other side owns rsp_prod, giving us responses
  to tx commands.  We own rsp_cons, recording which responess we've
  processed already.

  1. Other side initializes responses before advancing rsp_prod, so
 we must observe rsp_prod before trying to examine the responses.
 Hence load from rsp_prod must be followed by xen_rmb.

 (Can this just use atomic_load_acquire?)

  2. As soon as other side observes rsp_event, it may start to
 overwrite now-unused response slots, so we must finish using the
 response before advancing rsp_cons.  Hence we must issue xen_wmb
 before store to rsp_event.

 (Can this just use atomic_store_release?)

 (Should this use RING_FINAL_CHECK_FOR_RESPONSES?)

  3. When loop is done and we set rsp_event, we must ensure the other
 side has had a chance to see that we want more before we check
 whether there is more to consume; otherwise the other side might
 not bother to send us an interrupt.  Hence after setting
 rsp_event, we must issue xen_mb (store-before-load) before
 re-checking rsp_prod.

- xennet_handler (rx): Same deal, except the xen_mb is buried in
  RING_FINAL_CHECK_FOR_RESPONSES.  Unclear why xennet_tx_complete has
  this open-coded while xennet_handler (rx) uses the macro.

XXX pullup-8 (at least the xen_mb part; requires patch)
XXX pullup-9 (at least the xen_mb part; requires patch)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:49 UTC 2023

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
xennet(4): Membar audit.

- xennet_tx_complete: Other side owns rsp_prod, giving us responses
  to tx commands.  We own rsp_cons, recording which responess we've
  processed already.

  1. Other side initializes responses before advancing rsp_prod, so
 we must observe rsp_prod before trying to examine the responses.
 Hence load from rsp_prod must be followed by xen_rmb.

 (Can this just use atomic_load_acquire?)

  2. As soon as other side observes rsp_event, it may start to
 overwrite now-unused response slots, so we must finish using the
 response before advancing rsp_cons.  Hence we must issue xen_wmb
 before store to rsp_event.

 (Can this just use atomic_store_release?)

 (Should this use RING_FINAL_CHECK_FOR_RESPONSES?)

  3. When loop is done and we set rsp_event, we must ensure the other
 side has had a chance to see that we want more before we check
 whether there is more to consume; otherwise the other side might
 not bother to send us an interrupt.  Hence after setting
 rsp_event, we must issue xen_mb (store-before-load) before
 re-checking rsp_prod.

- xennet_handler (rx): Same deal, except the xen_mb is buried in
  RING_FINAL_CHECK_FOR_RESPONSES.  Unclear why xennet_tx_complete has
  this open-coded while xennet_handler (rx) uses the macro.

XXX pullup-8 (at least the xen_mb part; requires patch)
XXX pullup-9 (at least the xen_mb part; requires patch)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.128 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.129
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.128	Wed Aug 26 15:54:10 2020
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Sat Feb 25 00:32:49 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.128 2020/08/26 15:54:10 riastradh Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.129 2023/02/25 00:32:49 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.128 2020/08/26 15:54:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.129 2023/02/25 00:32:49 riastradh Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -951,12 +951,12 @@ again:
 		SLIST_INSERT_HEAD(>sc_txreq_head, req, txreq_next);
 		sc->sc_free_txreql++;
 	}
-
 	sc->sc_tx_ring.rsp_cons = resp_prod;
 	/* set new event and check for race with rsp_cons update */
+	xen_wmb();
 	sc->sc_tx_ring.sring->rsp_event =
 	resp_prod + ((sc->sc_tx_ring.sring->req_prod - resp_prod) >> 1) + 1;
-	xen_wmb();
+	xen_mb();
 	if (resp_prod != sc->sc_tx_ring.sring->rsp_prod)
 		goto again;
 }
@@ -1060,8 +1060,8 @@ again:
 		if_statinc(ifp, if_iqdrops);
 		m_freem(m0);
 	}
-	xen_rmb();
 	sc->sc_rx_ring.rsp_cons = i;
+	xen_wmb();
 	RING_FINAL_CHECK_FOR_RESPONSES(>sc_rx_ring, more_to_do);
 	mutex_exit(>sc_rx_lock);
 



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:38 UTC 2023

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
xen/x86/cpu.c: Membar audit.

I see no reason for store-before-load ordering here; as far as I'm
aware, evtchn_upcall_mask is only shared between a (v)CPU and its
(hypervisor) interrupts, not other (v)CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/xen/x86/cpu.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/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.143 src/sys/arch/xen/x86/cpu.c:1.144
--- src/sys/arch/xen/x86/cpu.c:1.143	Sat Feb 25 00:31:40 2023
+++ src/sys/arch/xen/x86/cpu.c	Sat Feb 25 00:32:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.143 2023/02/25 00:31:40 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.144 2023/02/25 00:32:38 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.143 2023/02/25 00:31:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.144 2023/02/25 00:32:38 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -848,7 +848,7 @@ xen_init_amd64_vcpuctxt(struct cpu_info 
 	/* resume with interrupts off */
 	vci = ci->ci_vcpu;
 	vci->evtchn_upcall_mask = 1;
-	xen_mb();
+	__insn_barrier();
 
 	/* resume in kernel-mode */
 	initctx->flags = VGCF_in_kernel | VGCF_online;
@@ -945,7 +945,7 @@ xen_init_i386_vcpuctxt(struct cpu_info *
 	/* resume with interrupts off */
 	vci = ci->ci_vcpu;
 	vci->evtchn_upcall_mask = 1;
-	xen_mb();
+	__insn_barrier();
 
 	/* resume in kernel-mode */
 	initctx->flags = VGCF_in_kernel | VGCF_online;



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:38 UTC 2023

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
xen/x86/cpu.c: Membar audit.

I see no reason for store-before-load ordering here; as far as I'm
aware, evtchn_upcall_mask is only shared between a (v)CPU and its
(hypervisor) interrupts, not other (v)CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/xen/x86/cpu.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/xen/include

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:26 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
xen: Fix sense of xen_rmb/wmb to make sense.

Use membar_acquire and membar_release, not membar_consumer and
membar_producer, out of paranoia -- that better matches Linux's
rmb/wmb (at least for non-I/O loads and stores).

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010248.html


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenring.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/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.55 src/sys/arch/xen/include/hypervisor.h:1.56
--- src/sys/arch/xen/include/hypervisor.h:1.55	Wed Sep  7 00:40:19 2022
+++ src/sys/arch/xen/include/hypervisor.h	Sat Feb 25 00:32:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.55 2022/09/07 00:40:19 knakahara Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.56 2023/02/25 00:32:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -111,8 +111,8 @@ struct xen_npx_attach_args {
 #undef xen_wmb
 
 #define xen_mb()  membar_sync()
-#define xen_rmb() membar_producer()
-#define xen_wmb() membar_consumer()
+#define xen_rmb() membar_acquire()
+#define xen_wmb() membar_release()
 #endif /* __XEN_INTERFACE_VERSION */
 
 #include 

Index: src/sys/arch/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.6 src/sys/arch/xen/include/xenring.h:1.7
--- src/sys/arch/xen/include/xenring.h:1.6	Sat Apr 25 15:26:17 2020
+++ src/sys/arch/xen/include/xenring.h	Sat Feb 25 00:32:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.6 2020/04/25 15:26:17 bouyer Exp $ */
+/* $NetBSD: xenring.h,v 1.7 2023/02/25 00:32:26 riastradh Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -25,8 +25,8 @@
 #undef xen_wmb
 
 #define xen_mb()  membar_sync()
-#define xen_rmb() membar_producer()
-#define xen_wmb() membar_consumer()
+#define xen_rmb() membar_acquire()
+#define xen_wmb() membar_release()
 
 /*
  * Define ring types. These were previously part of the public API.



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:26 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h xenring.h

Log Message:
xen: Fix sense of xen_rmb/wmb to make sense.

Use membar_acquire and membar_release, not membar_consumer and
membar_producer, out of paranoia -- that better matches Linux's
rmb/wmb (at least for non-I/O loads and stores).

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010248.html


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenring.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/xen/x86

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:13 UTC 2023

Modified Files:
src/sys/arch/xen/x86: xen_intr.c

Log Message:
xen_intr.c: Use kpreempt_disable/enable around access to curcpu().

curcpu() is not otherwise guaranteed to be stable at these points.

While here, nix nonsensical membars.  This need only be synchronized
with interrupts on the same CPU.

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010250.html

XXX pullup-8 (in __sti/__cli, __save/restore_flags in include/xen.h)
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/xen/x86/xen_intr.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/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.30 src/sys/arch/xen/x86/xen_intr.c:1.31
--- src/sys/arch/xen/x86/xen_intr.c:1.30	Tue May 24 14:00:23 2022
+++ src/sys/arch/xen/x86/xen_intr.c	Sat Feb 25 00:32:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_intr.c,v 1.30 2022/05/24 14:00:23 bouyer Exp $	*/
+/*	$NetBSD: xen_intr.c,v 1.31 2023/02/25 00:32:13 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.30 2022/05/24 14:00:23 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.31 2023/02/25 00:32:13 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_pci.h"
@@ -83,19 +83,28 @@ static const char *xen_ipi_names[XEN_NIP
 void
 x86_disable_intr(void)
 {
+
+	kpreempt_disable();
 	curcpu()->ci_vcpu->evtchn_upcall_mask = 1;
-	x86_lfence();
+	kpreempt_enable();
+
+	__insn_barrier();
 }
 
 void
 x86_enable_intr(void)
 {
-	volatile struct vcpu_info *_vci = curcpu()->ci_vcpu;
+	struct cpu_info *ci;
+
 	__insn_barrier();
-	_vci->evtchn_upcall_mask = 0;
-	x86_lfence(); /* unmask then check (avoid races) */
-	if (__predict_false(_vci->evtchn_upcall_pending))
+
+	kpreempt_disable();
+	ci = curcpu();
+	ci->ci_vcpu->evtchn_upcall_mask = 0;
+	__insn_barrier();
+	if (__predict_false(ci->ci_vcpu->evtchn_upcall_pending))
 		hypervisor_force_callback();
+	kpreempt_enable();
 }
 
 #endif /* !XENPVHVM */
@@ -103,20 +112,27 @@ x86_enable_intr(void)
 u_long
 xen_read_psl(void)
 {
+	u_long psl;
+
+	kpreempt_disable();
+	psl = curcpu()->ci_vcpu->evtchn_upcall_mask;
+	kpreempt_enable();
 
-	return (curcpu()->ci_vcpu->evtchn_upcall_mask);
+	return psl;
 }
 
 void
 xen_write_psl(u_long psl)
 {
-	struct cpu_info *ci = curcpu();
+	struct cpu_info *ci;
 
+	kpreempt_disable();
+	ci = curcpu();
 	ci->ci_vcpu->evtchn_upcall_mask = psl;
-	xen_rmb();
-	if (ci->ci_vcpu->evtchn_upcall_pending && psl == 0) {
+	__insn_barrier();
+	if (__predict_false(ci->ci_vcpu->evtchn_upcall_pending) && psl == 0)
 		hypervisor_force_callback();
-	}
+	kpreempt_enable();
 }
 
 void *



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

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:32:13 UTC 2023

Modified Files:
src/sys/arch/xen/x86: xen_intr.c

Log Message:
xen_intr.c: Use kpreempt_disable/enable around access to curcpu().

curcpu() is not otherwise guaranteed to be stable at these points.

While here, nix nonsensical membars.  This need only be synchronized
with interrupts on the same CPU.

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010250.html

XXX pullup-8 (in __sti/__cli, __save/restore_flags in include/xen.h)
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/xen/x86/xen_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/arch

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:31:40 UTC 2023

Modified Files:
src/sys/arch/x86/x86: cpu.c
src/sys/arch/xen/x86: cpu.c

Log Message:
x86: Assert kpreempt_disabled() in cpu_load_pmap.

No functional change intended.  Just makes it easier to audit
curcpu() usage.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/xen/x86/cpu.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/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.206 src/sys/arch/x86/x86/cpu.c:1.207
--- src/sys/arch/x86/x86/cpu.c:1.206	Sat Sep 24 11:05:18 2022
+++ src/sys/arch/x86/x86/cpu.c	Sat Feb 25 00:31:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.206 2022/09/24 11:05:18 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000-2020 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.206 2022/09/24 11:05:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -1433,6 +1433,9 @@ x86_cpu_idle_halt(void)
 void
 cpu_load_pmap(struct pmap *pmap, struct pmap *oldpmap)
 {
+
+	KASSERT(kpreempt_disabled());
+
 #ifdef SVS
 	if (svs_enabled && pmap_is_user(pmap)) {
 		svs_pdir_switch(pmap);

Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.142 src/sys/arch/xen/x86/cpu.c:1.143
--- src/sys/arch/xen/x86/cpu.c:1.142	Sat Aug 20 23:48:51 2022
+++ src/sys/arch/xen/x86/cpu.c	Sat Feb 25 00:31:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.142 2022/08/20 23:48:51 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.143 2023/02/25 00:31:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.142 2022/08/20 23:48:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.143 2023/02/25 00:31:40 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1109,6 +1109,7 @@ cpu_load_pmap(struct pmap *pmap, struct 
 	cpuid_t cid = cpu_index(ci);
 	int i;
 
+	KASSERT(kpreempt_disabled());
 	KASSERT(pmap != pmap_kernel());
 
 	mutex_enter(>ci_kpm_mtx);



CVS commit: src/sys/arch

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 25 00:31:40 UTC 2023

Modified Files:
src/sys/arch/x86/x86: cpu.c
src/sys/arch/xen/x86: cpu.c

Log Message:
x86: Assert kpreempt_disabled() in cpu_load_pmap.

No functional change intended.  Just makes it easier to audit
curcpu() usage.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/xen/x86/cpu.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-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 00:07:08 UTC 2023

Modified Files:
src/usr.bin/make: main.c
src/usr.bin/make/unit-tests: opt.mk

Log Message:
make: rename function for parsing command line options

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.591 -r1.592 src/usr.bin/make/main.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt.mk

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/unit-tests

2023-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 00:09:52 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-makeoverrides.exp
varname-dot-makeoverrides.mk

Log Message:
tests/make: test how '$' behaves in .MAKEOVERRIDES and MAKEFLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp
cvs rdiff -u -r1.3 -r1.4 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk

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/unit-tests/varname-dot-makeoverrides.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.1 src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.2
--- src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.1	Sun Aug 16 12:07:52 2020
+++ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp	Sat Feb 25 00:09:52 2023
@@ -1 +1,5 @@
+make -r -f varname-dot-makeoverrides.mk dollars_stage_2 DOLLARS='$${varname}'
+stage 2: dollars=<${varname}>
+make -r -f varname-dot-makeoverrides.mk dollars_stage_3
+stage 3: dollars=<>
 exit status 0

Index: src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.3 src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.4
--- src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.3	Wed Feb 15 06:52:59 2023
+++ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk	Sat Feb 25 00:09:52 2023
@@ -1,8 +1,18 @@
-# $NetBSD: varname-dot-makeoverrides.mk,v 1.3 2023/02/15 06:52:59 rillig Exp $
+# $NetBSD: varname-dot-makeoverrides.mk,v 1.4 2023/02/25 00:09:52 rillig Exp $
 #
 # Tests for the special .MAKEOVERRIDES variable.
 
-# TODO: Implementation
-
 all:
-	@:;
+	@${MAKE} -r -f ${MAKEFILE} dollars_stage_1
+
+# Demonstrate that '$' characters are altered when they are passed on to child
+# make processes via .MAKEOVERRIDES and MAKEFLAGS.
+dollars_stage_1:
+	${MAKE} -r -f ${MAKEFILE} dollars_stage_2 DOLLARS='{varname}'
+
+dollars_stage_2:
+	@echo 'stage 2: dollars=<${DOLLARS}>'
+	${MAKE} -r -f ${MAKEFILE} dollars_stage_3
+
+dollars_stage_3:
+	@echo 'stage 3: dollars=<${DOLLARS}>'



CVS commit: src/usr.bin/make

2023-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 00:07:08 UTC 2023

Modified Files:
src/usr.bin/make: main.c
src/usr.bin/make/unit-tests: opt.mk

Log Message:
make: rename function for parsing command line options

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.591 -r1.592 src/usr.bin/make/main.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt.mk

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.591 src/usr.bin/make/main.c:1.592
--- src/usr.bin/make/main.c:1.591	Wed Feb 15 06:52:58 2023
+++ src/usr.bin/make/main.c	Sat Feb 25 00:07:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.591 2023/02/15 06:52:58 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.592 2023/02/25 00:07:08 rillig 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.591 2023/02/15 06:52:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.592 2023/02/25 00:07:08 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -432,7 +432,7 @@ MainParseArgSysInc(const char *argvalue)
 }
 
 static bool
-MainParseArg(char c, const char *argvalue)
+MainParseOption(char c, const char *argvalue)
 {
 	switch (c) {
 	case '\0':
@@ -624,7 +624,7 @@ rearg:
 			dashDash = true;
 			break;
 		default:
-			if (!MainParseArg(c, argvalue))
+			if (!MainParseOption(c, argvalue))
 goto noarg;
 		}
 		argv += arginc;

Index: src/usr.bin/make/unit-tests/opt.mk
diff -u src/usr.bin/make/unit-tests/opt.mk:1.6 src/usr.bin/make/unit-tests/opt.mk:1.7
--- src/usr.bin/make/unit-tests/opt.mk:1.6	Wed Nov 18 01:06:59 2020
+++ src/usr.bin/make/unit-tests/opt.mk	Sat Feb 25 00:07:08 2023
@@ -1,4 +1,4 @@
-# $NetBSD: opt.mk,v 1.6 2020/11/18 01:06:59 sjg Exp $
+# $NetBSD: opt.mk,v 1.7 2023/02/25 00:07:08 rillig Exp $
 #
 # Tests for the command line options.
 
@@ -7,7 +7,7 @@
 all: .IGNORE
 	# The options from the top-level make are passed to the sub-makes via
 	# the environment variable MAKEFLAGS.  This is where the " -r -k -d 0"
-	# comes from.  See MainParseArg.
+	# comes from.  See MainParseOption.
 	${MAKE} -r -f /dev/null -V MAKEFLAGS
 	@echo
 



CVS commit: src/usr.bin/make/unit-tests

2023-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 25 00:09:52 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-makeoverrides.exp
varname-dot-makeoverrides.mk

Log Message:
tests/make: test how '$' behaves in .MAKEOVERRIDES and MAKEFLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp
cvs rdiff -u -r1.3 -r1.4 \
src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk

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



CVS commit: othersrc/external/bsd/elex

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 23:08:17 UTC 2023

Modified Files:
othersrc/external/bsd/elex: README

Log Message:
document the "namespace" action in the README file


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/elex/README

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

Modified files:

Index: othersrc/external/bsd/elex/README
diff -u othersrc/external/bsd/elex/README:1.2 othersrc/external/bsd/elex/README:1.3
--- othersrc/external/bsd/elex/README:1.2	Thu Feb 23 19:16:31 2023
+++ othersrc/external/bsd/elex/README	Fri Feb 24 23:08:17 2023
@@ -285,6 +285,7 @@ elex_exec_str:
 	allocated space
 "get-yystate" - get the name of the current state in allocated space
 "get-yytext" - get the full text of the current match in allocated space
+"namespace" - return the name space of the embedded library used (if any)
 
 Designing elex definition files
 ===



CVS commit: othersrc/external/bsd/elex

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 23:08:17 UTC 2023

Modified Files:
othersrc/external/bsd/elex: README

Log Message:
document the "namespace" action in the README file


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/elex/README

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



CVS commit: othersrc/external/bsd/elex

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 23:07:54 UTC 2023

Modified Files:
othersrc/external/bsd/elex/bin: Makefile
othersrc/external/bsd/elex/lib: Makefile

Log Message:
add inclusion of any lib namespace (if there is oneChanges missed from 
yesterday's commit

include the library namespace, if there is one


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/bin/Makefile
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/lib/Makefile

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

Modified files:

Index: othersrc/external/bsd/elex/bin/Makefile
diff -u othersrc/external/bsd/elex/bin/Makefile:1.1 othersrc/external/bsd/elex/bin/Makefile:1.2
--- othersrc/external/bsd/elex/bin/Makefile:1.1	Thu Dec  9 04:15:25 2021
+++ othersrc/external/bsd/elex/bin/Makefile	Fri Feb 24 23:07:54 2023
@@ -12,6 +12,8 @@ CPPFLAGS+=	-g -O0
 LDFLAGS+=	-g -O0
 .endif
 
+.sinclude "../namespace.mk"
+
 LIB_ELEX_DIR!=	cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
 
 DIST=	${.CURDIR}/../dist

Index: othersrc/external/bsd/elex/lib/Makefile
diff -u othersrc/external/bsd/elex/lib/Makefile:1.1 othersrc/external/bsd/elex/lib/Makefile:1.2
--- othersrc/external/bsd/elex/lib/Makefile:1.1	Thu Dec  9 04:15:26 2021
+++ othersrc/external/bsd/elex/lib/Makefile	Fri Feb 24 23:07:54 2023
@@ -6,6 +6,8 @@ CPPFLAGS+=	-I${DIST}
 MKMAN=	no
 WARNS=	5
 
+.sinclude "../namespace.mk"
+
 # set symbol visibility for .so
 CPPFLAGS+=	-DHIDE_AGCRE=1
 CPPFLAGS+=	-DHIDE_STRITER=1



CVS commit: othersrc/external/bsd/elex

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 23:07:54 UTC 2023

Modified Files:
othersrc/external/bsd/elex/bin: Makefile
othersrc/external/bsd/elex/lib: Makefile

Log Message:
add inclusion of any lib namespace (if there is oneChanges missed from 
yesterday's commit

include the library namespace, if there is one


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/bin/Makefile
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/lib/Makefile

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-02-24 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Feb 24 19:18:50 UTC 2023

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

Log Message:
lint: order functions to to reduce forward declarations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.505 -r1.506 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/bin/sh

2023-02-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Feb 24 19:04:54 UTC 2023

Modified Files:
src/bin/sh: alias.c

Log Message:
Allow (but do not require) the magic '--' option terminator in
the builtin 'alias' command.   This allows portability (not that
anyone should really care with aliases) for scripts from other
shells in which the alias command has options, and the -- is
required to allow the first alias name to begin with a '-'.

That is, for us, alias -x='echo x'  works fine, always has,
and still does.   But other shells treat that as an attempt
to use the -x option (and maybe -= etc), and require
alias -- -x='echo x'.   For us that variant used to complain
about the alias -- not existing (as an arg with no '=' is
treated as a request to extract the value of the alias).

Posix also generally requires all standard commands (or
which "alias" is one, unfortunately) to support '--' even
if they have no options, for precisely this reason.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/alias.c

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

Modified files:

Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.21 src/bin/sh/alias.c:1.22
--- src/bin/sh/alias.c:1.21	Sat Feb  9 09:11:07 2019
+++ src/bin/sh/alias.c	Fri Feb 24 19:04:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: alias.c,v 1.21 2019/02/09 09:11:07 kre Exp $	*/
+/*	$NetBSD: alias.c,v 1.22 2023/02/24 19:04:54 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.21 2019/02/09 09:11:07 kre Exp $");
+__RCSID("$NetBSD: alias.c,v 1.22 2023/02/24 19:04:54 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -253,18 +253,20 @@ countaliases(void)
 }
 
 int
-aliascmd(int argc, char **argv)
+aliascmd(int argc, char **argv)	/* ARGSUSED */
 {
 	char *n, *v;
 	int ret = 0;
 	struct alias *ap;
 
-	if (argc == 1) {
+	(void) nextopt(NULL);	/* consume possible "--" */
+
+	if (*argptr == NULL) {
 		list_aliases();
 		return 0;
 	}
 
-	while ((n = *++argv) != NULL) {
+	while ((n = *argptr++) != NULL) {
 		if ((v = strchr(n+1, '=')) == NULL) { /* n+1: funny ksh stuff */
 			if ((ap = lookupalias(n, 0)) == NULL) {
 outfmt(out2, "alias: %s not found\n", n);



CVS commit: src/bin/sh

2023-02-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Feb 24 19:04:54 UTC 2023

Modified Files:
src/bin/sh: alias.c

Log Message:
Allow (but do not require) the magic '--' option terminator in
the builtin 'alias' command.   This allows portability (not that
anyone should really care with aliases) for scripts from other
shells in which the alias command has options, and the -- is
required to allow the first alias name to begin with a '-'.

That is, for us, alias -x='echo x'  works fine, always has,
and still does.   But other shells treat that as an attempt
to use the -x option (and maybe -= etc), and require
alias -- -x='echo x'.   For us that variant used to complain
about the alias -- not existing (as an arg with no '=' is
treated as a request to extract the value of the alias).

Posix also generally requires all standard commands (or
which "alias" is one, unfortunately) to support '--' even
if they have no options, for precisely this reason.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/alias.c

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



CVS commit: othersrc/external/bsd/agcre

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 19:01:11 UTC 2023

Modified Files:
othersrc/external/bsd/agcre/bin: Makefile
othersrc/external/bsd/agcre/dist: agcre.c agcre.h
othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected
othersrc/external/bsd/agcre/lib: Makefile
Added Files:
othersrc/external/bsd/agcre: namespace.mk

Log Message:
Update agcre (yet another regexp library) to version 20230224

+ revamp the reverse searching functionality
+ bug fixes
+ don't terminate searches too early
+ update namespace protection to just use simple definitions
+ bump version to 20230224


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/namespace.mk
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/bin/Makefile
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.c
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/agcre.h
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/54.expected
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/62.expected
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/lib/Makefile

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

Modified files:

Index: othersrc/external/bsd/agcre/bin/Makefile
diff -u othersrc/external/bsd/agcre/bin/Makefile:1.1 othersrc/external/bsd/agcre/bin/Makefile:1.2
--- othersrc/external/bsd/agcre/bin/Makefile:1.1	Wed Aug 16 23:38:13 2017
+++ othersrc/external/bsd/agcre/bin/Makefile	Fri Feb 24 19:01:10 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2017/08/16 23:38:13 agc Exp $
+# $NetBSD: Makefile,v 1.2 2023/02/24 19:01:10 agc Exp $
 
 .include 
 
@@ -9,6 +9,8 @@ CPPFLAGS+=	-I${DIST}
 MAN=	agcre.1
 WARNS=	5
 
+.sinclude "../namespace.mk"
+
 DIST=	${.CURDIR}/../dist
 .PATH: ${DIST}
 

Index: othersrc/external/bsd/agcre/dist/agcre.c
diff -u othersrc/external/bsd/agcre/dist/agcre.c:1.2 othersrc/external/bsd/agcre/dist/agcre.c:1.3
--- othersrc/external/bsd/agcre/dist/agcre.c:1.2	Sat Dec  4 01:54:51 2021
+++ othersrc/external/bsd/agcre/dist/agcre.c	Fri Feb 24 19:01:10 2023
@@ -223,6 +223,7 @@ static int unicode_isOther_Uppercase(uin
 static int unicode_isPattern_White_Space(uint32_t /*ch*/);
 static int unicode_isalnum(uint32_t /*ch*/);
 static int unicode_isalpha(uint32_t /*ch*/);
+static int unicode_ispunct2(uint32_t /*ch*/);
 static int unicode_isblank(uint32_t /*ch*/);
 static int unicode_iscntrl(uint32_t /*ch*/);
 static int unicode_isdigit(uint32_t /*ch*/);
@@ -233,7 +234,7 @@ static int unicode_ispunct(uint32_t /*ch
 static int unicode_isspace(uint32_t /*ch*/);
 static int unicode_isupper(uint32_t /*ch*/);
 static int unicode_isxdigit(uint32_t /*ch*/);
-static int unicode_isident(uint32_t /*ch*/);
+static int unicode_isword(uint32_t /*ch*/);
 static uint32_t unicode_tolower(uint32_t /*ch*/);
 static uint32_t unicode_toupper(uint32_t /*ch*/);
 
@@ -417,7 +418,7 @@ emit(re_t *re, retoken_t *tok)
 			(tok->ch == 'd' || tok->ch == 'D') ? unicode_isdigit :
 			(tok->ch == 'p' || tok->ch == 'P') ? unicode_isprint :
 			(tok->ch == 's' || tok->ch == 'S') ? unicode_isspace :
-unicode_isident,
+unicode_isword,
 			unicode_isupper(tok->ch));
 		re->pc++;
 		return 1;
@@ -1169,16 +1170,16 @@ isendline(re_t *re, input_t *in)
 static inline int
 isbegword(re_t *re, input_t *in)
 {
-	return (isbegline(re, in) || !unicode_isident(in->prevch)) &&
-		unicode_isident(in->ch);
+	return (isbegline(re, in) || !unicode_isword(in->prevch)) &&
+		unicode_isword(in->ch);
 }
 
 /* return 1 at end of words */
 static inline int
 isendword(re_t *re, input_t *in)
 {
-	return (isendline(re, in) || (in->c > in->so && unicode_isident(in->prevch))) &&
-		(!unicode_isident(in->ch));
+	return (isendline(re, in) || (in->c > in->so && unicode_isword(in->prevch))) &&
+		(!unicode_isword(in->ch));
 }
 
 /* do the chars match? */
@@ -1577,10 +1578,6 @@ rec_posix_class(input_t *in, set_t *set)
 		set_add_callback(set, unicode_isgraph, 0);
 		in->c += 8;
 		return 1;
-	case /* ":ident:]" */ 0x8a1572f1:
-		set_add_callback(set, unicode_isident, 0);
-		in->c += 8;
-		return 1;
 	case /* ":lower:]" */ 0x8bfc6af8:
 		set_add_callback(set, unicode_islower, 0);
 		in->c += 8;
@@ -1593,6 +1590,10 @@ rec_posix_class(input_t *in, set_t *set)
 		set_add_callback(set, unicode_ispunct, 0);
 		in->c += 8;
 		return 1;
+	case /* ":punct2:]" */ 0xf09af6aa:
+		set_add_callback(set, unicode_ispunct2, 0);
+		in->c += 9;
+		return 1;
 	case /* ":space:]" */ 0xa876bcf2:
 		set_add_callback(set, unicode_isspace, 0);
 		in->c += 8;
@@ -1605,6 +1606,10 @@ rec_posix_class(input_t *in, set_t *set)
 		set_add_callback(set, unicode_isxdigit, 0);
 		in->c += 9;
 		return 1;
+	case /* "

CVS commit: othersrc/external/bsd/agcre

2023-02-24 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Feb 24 19:01:11 UTC 2023

Modified Files:
othersrc/external/bsd/agcre/bin: Makefile
othersrc/external/bsd/agcre/dist: agcre.c agcre.h
othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected
othersrc/external/bsd/agcre/lib: Makefile
Added Files:
othersrc/external/bsd/agcre: namespace.mk

Log Message:
Update agcre (yet another regexp library) to version 20230224

+ revamp the reverse searching functionality
+ bug fixes
+ don't terminate searches too early
+ update namespace protection to just use simple definitions
+ bump version to 20230224


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/namespace.mk
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/bin/Makefile
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.c
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/agcre.h
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/54.expected
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/62.expected
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/lib/Makefile

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



CVS commit: xsrc/external/mit/freetype/dist/include/freetype/config

2023-02-24 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Feb 24 17:08:51 UTC 2023

Modified Files:
xsrc/external/mit/freetype/dist/include/freetype/config: ftoption.h

Log Message:
arrange for ftoption.h to define FT_CONFIG_OPTION_USE_BROTLI but not for tools

guard the definition in ftoption.h with #ifndef TOOL_FCCACHE, and build the
tools portions with this defined if not already set.

this fixes building pkgsrc blender with native x11.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h

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

Modified files:

Index: xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h
diff -u xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h:1.9 xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h:1.10
--- xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h:1.9	Wed Oct 21 14:55:03 2020
+++ xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h	Fri Feb 24 17:08:50 2023
@@ -304,6 +304,9 @@ FT_BEGIN_HEADER
*   here with the configured one.
*/
 /* #define FT_CONFIG_OPTION_USE_BROTLI */
+#ifndef TOOL_FCCACHE
+#define FT_CONFIG_OPTION_USE_BROTLI 1
+#endif
 
 
   /**



CVS commit: xsrc/external/mit/freetype/dist/include/freetype/config

2023-02-24 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Feb 24 17:08:51 UTC 2023

Modified Files:
xsrc/external/mit/freetype/dist/include/freetype/config: ftoption.h

Log Message:
arrange for ftoption.h to define FT_CONFIG_OPTION_USE_BROTLI but not for tools

guard the definition in ftoption.h with #ifndef TOOL_FCCACHE, and build the
tools portions with this defined if not already set.

this fixes building pkgsrc blender with native x11.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h

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



CVS commit: src/external/mit/xorg

2023-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb 24 17:08:31 UTC 2023

Modified Files:
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/tools/fc-cache: Makefile
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
arrange for ftoption.h to define FT_CONFIG_OPTION_USE_BROTLI but not for tools

guard the definition in ftoption.h with #ifndef TOOL_FCCACHE, and build the
tools portions with this defined if not already set.

this fixes building pkgsrc blender with native x11.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.21 -r1.22 src/external/mit/xorg/tools/fc-cache/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/mit/xorg/tools/mkfontscale/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/freetype/Makefile
diff -u src/external/mit/xorg/lib/freetype/Makefile:1.23 src/external/mit/xorg/lib/freetype/Makefile:1.24
--- src/external/mit/xorg/lib/freetype/Makefile:1.23	Tue Nov 16 09:25:51 2021
+++ src/external/mit/xorg/lib/freetype/Makefile	Fri Feb 24 17:08:31 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2021/11/16 09:25:51 nia Exp $
+#	$NetBSD: Makefile,v 1.24 2023/02/24 17:08:31 mrg Exp $
 
 USE_FORT?=	yes # data-driven bugs?
 
@@ -103,6 +103,9 @@ LIBDPLIBS= \
 	z ${.CURDIR}/../../../../../lib/libz \
 	bz2 ${.CURDIR}/../../../../../lib/libbz2
 
+.include "../brotli/brotli.mk"
+CPPFLAGS+= -I${X11SRCDIR.brotli}/c/include
+
 PKGCONFIG=	freetype2
 PKGDIST.freetype2=	${.CURDIR}
 PKGCONFIG_VERSION.freetype2=	23:0:17

Index: src/external/mit/xorg/tools/fc-cache/Makefile
diff -u src/external/mit/xorg/tools/fc-cache/Makefile:1.21 src/external/mit/xorg/tools/fc-cache/Makefile:1.22
--- src/external/mit/xorg/tools/fc-cache/Makefile:1.21	Thu Jan 19 17:07:38 2023
+++ src/external/mit/xorg/tools/fc-cache/Makefile	Fri Feb 24 17:08:31 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2023/01/19 17:07:38 martin Exp $
+#	$NetBSD: Makefile,v 1.22 2023/02/24 17:08:31 mrg Exp $
 
 .include 
 
@@ -122,7 +122,6 @@ HOST_CPPFLAGS+=	-I${FONTCONFIG} -I${FREE
 		-I${FONTCONFIG}/../include
 
 HOST_CPPFLAGS+=	-DXML_POOR_ENTROPY
-
 HOST_CPPFLAGS+=	-DTOOL_FCCACHE
 
 LDADD=	-lz

Index: src/external/mit/xorg/tools/mkfontscale/Makefile
diff -u src/external/mit/xorg/tools/mkfontscale/Makefile:1.16 src/external/mit/xorg/tools/mkfontscale/Makefile:1.17
--- src/external/mit/xorg/tools/mkfontscale/Makefile:1.16	Fri Sep  9 19:15:20 2022
+++ src/external/mit/xorg/tools/mkfontscale/Makefile	Fri Feb 24 17:08:31 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2022/09/09 19:15:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.17 2023/02/24 17:08:31 mrg Exp $
 
 .include 
 
@@ -94,5 +94,7 @@ HOST_CPPFLAGS+=	-I${FREETYPE}/include -I
 		-I${DESTDIR}${X11INCDIR} \
 		-I${DESTDIR}${X11INCDIR}/freetype2
 
+HOST_CPPFLAGS+=	-DTOOL_FCCACHE
+
 .include 
 .include 



CVS commit: src/external/mit/xorg

2023-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb 24 17:08:31 UTC 2023

Modified Files:
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/tools/fc-cache: Makefile
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
arrange for ftoption.h to define FT_CONFIG_OPTION_USE_BROTLI but not for tools

guard the definition in ftoption.h with #ifndef TOOL_FCCACHE, and build the
tools portions with this defined if not already set.

this fixes building pkgsrc blender with native x11.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.21 -r1.22 src/external/mit/xorg/tools/fc-cache/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/mit/xorg/tools/mkfontscale/Makefile

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



CVS commit: [netbsd-8] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:21:23 UTC 2023

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

Log Message:
Tickets #1803 - #1805


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

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.166 src/doc/CHANGES-8.3:1.1.2.167
--- src/doc/CHANGES-8.3:1.1.2.166	Wed Feb 22 19:57:50 2023
+++ src/doc/CHANGES-8.3	Fri Feb 24 14:21:22 2023
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.166 2023/02/22 19:57:50 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.167 2023/02/24 14:21:22 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -3194,3 +3194,23 @@ sys/net/bpf.c	1.247 (merged)
 	bpf(4): Reject bogus timeout values before arithmetic overflows.
 	[riastradh, ticket #1802]
 
+distrib/amiga/stand/loadbsd.uue			1.3
+sys/arch/amiga/stand/loadbsd/Makefile		1.4
+sys/arch/amiga/stand/loadbsd/README		1.5
+sys/arch/amiga/stand/loadbsd/loadbsd.c		1.37
+
+	Update loadbsd source and distribution binary to version 3.2.
+	[abs, ticket #1803]
+
+sys/kern/subr_prf.c1.171
+
+	Make identification of accounted aprint_error()s possible by putting a
+	big ugly "autoconfiguration error: " in the log when they occur.
+	[msaitoh, ticket #1804]
+
+sys/dev/ata/sata_subr.c1.24
+sys/dev/ata/satavar.h1.10
+
+	sata: do not consider "PHY offline" conditions an error.
+	[msaitoh, ticket #1805]
+



CVS commit: [netbsd-8] src/sys/dev/ata

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:19:56 UTC 2023

Modified Files:
src/sys/dev/ata [netbsd-8]: sata_subr.c satavar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1805):

sys/dev/ata/satavar.h: revision 1.10
sys/dev/ata/sata_subr.c: revision 1.24

split the port status reporting to new function sata_interpret_det()
so it can be called separately from sata_reset_interface()

do not treat PHY offline as an error, it's pretty normal when there
is no device actually connected

debugging aid for PR kern/52372


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/dev/ata/sata_subr.c
cvs rdiff -u -r1.9 -r1.9.28.1 src/sys/dev/ata/satavar.h

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



CVS commit: [netbsd-8] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:21:23 UTC 2023

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

Log Message:
Tickets #1803 - #1805


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

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



CVS commit: [netbsd-8] src/sys/dev/ata

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:19:56 UTC 2023

Modified Files:
src/sys/dev/ata [netbsd-8]: sata_subr.c satavar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1805):

sys/dev/ata/satavar.h: revision 1.10
sys/dev/ata/sata_subr.c: revision 1.24

split the port status reporting to new function sata_interpret_det()
so it can be called separately from sata_reset_interface()

do not treat PHY offline as an error, it's pretty normal when there
is no device actually connected

debugging aid for PR kern/52372


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/dev/ata/sata_subr.c
cvs rdiff -u -r1.9 -r1.9.28.1 src/sys/dev/ata/satavar.h

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

Modified files:

Index: src/sys/dev/ata/sata_subr.c
diff -u src/sys/dev/ata/sata_subr.c:1.22 src/sys/dev/ata/sata_subr.c:1.22.2.1
--- src/sys/dev/ata/sata_subr.c:1.22	Wed May 10 08:46:39 2017
+++ src/sys/dev/ata/sata_subr.c	Fri Feb 24 14:19:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sata_subr.c,v 1.22 2017/05/10 08:46:39 msaitoh Exp $	*/
+/*	$NetBSD: sata_subr.c,v 1.22.2.1 2023/02/24 14:19:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * Common functions for Serial ATA.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sata_subr.c,v 1.22 2017/05/10 08:46:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sata_subr.c,v 1.22.2.1 2023/02/24 14:19:55 martin Exp $");
 
 #include 
 #include 
@@ -120,6 +120,14 @@ sata_reset_interface(struct ata_channel 
 		}
 	}
 
+	sata_interpret_det(chp, sstatus);
+
+	return (sstatus & SStatus_DET_mask);
+}
+
+void
+sata_interpret_det(struct ata_channel *chp, uint32_t sstatus)
+{ 
 	switch (sstatus & SStatus_DET_mask) {
 	case SStatus_DET_NODEV:
 		/* No Device; be silent.  */
@@ -132,7 +140,7 @@ sata_reset_interface(struct ata_channel 
 		break;
 
 	case SStatus_DET_OFFLINE:
-		aprint_error("%s port %d: PHY offline\n",
+		aprint_normal("%s port %d: PHY offline\n",
 		device_xname(chp->ch_atac->atac_dev), chp->ch_channel);
 		break;
 
@@ -146,7 +154,6 @@ sata_reset_interface(struct ata_channel 
 		device_xname(chp->ch_atac->atac_dev), chp->ch_channel,
 		sstatus);
 	}
-	return(sstatus & SStatus_DET_mask);
 }
 
 void

Index: src/sys/dev/ata/satavar.h
diff -u src/sys/dev/ata/satavar.h:1.9 src/sys/dev/ata/satavar.h:1.9.28.1
--- src/sys/dev/ata/satavar.h:1.9	Wed Apr  3 17:15:07 2013
+++ src/sys/dev/ata/satavar.h	Fri Feb 24 14:19:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: satavar.h,v 1.9 2013/04/03 17:15:07 bouyer Exp $	*/
+/*	$NetBSD: satavar.h,v 1.9.28.1 2023/02/24 14:19:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@
 const char *sata_speed(uint32_t);
 uint32_t sata_reset_interface(struct ata_channel *, bus_space_tag_t,
 bus_space_handle_t, bus_space_handle_t, int);
+void	sata_interpret_det(struct ata_channel *, uint32_t);
 void	sata_interpret_sig(struct ata_channel *, int, uint32_t);
 
 #endif /* _DEV_ATA_SATAVAR_H_ */



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:17:18 UTC 2023

Modified Files:
src/sys/kern [netbsd-8]: subr_prf.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1804):

sys/kern/subr_prf.c: revision 1.171

Make identification of accounted aprint_error()s possible by putting a
big ugly "autoconfiguration error: " in the log when they occur.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.160.8.1 src/sys/kern/subr_prf.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_prf.c
diff -u src/sys/kern/subr_prf.c:1.160 src/sys/kern/subr_prf.c:1.160.8.1
--- src/sys/kern/subr_prf.c:1.160	Wed Jul 27 09:57:26 2016
+++ src/sys/kern/subr_prf.c	Fri Feb 24 14:17:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.160 2016/07/27 09:57:26 skrll Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.160.8.1 2023/02/24 14:17:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.160 2016/07/27 09:57:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.160.8.1 2023/02/24 14:17:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -907,6 +907,7 @@ aprint_verbose_internal(const char *pref
 
 	if (prefix)
 		kprintf_internal("%s: ", flags, NULL, NULL, prefix);
+	kprintf_internal("autoconfiguration error: ", TOLOG, NULL, NULL);
 	kprintf(fmt, flags, NULL, NULL, ap);
 
 	kprintf_unlock();



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:17:18 UTC 2023

Modified Files:
src/sys/kern [netbsd-8]: subr_prf.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1804):

sys/kern/subr_prf.c: revision 1.171

Make identification of accounted aprint_error()s possible by putting a
big ugly "autoconfiguration error: " in the log when they occur.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.160.8.1 src/sys/kern/subr_prf.c

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



CVS commit: [netbsd-10] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:16:10 UTC 2023

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

Log Message:
Tickets #102 - #108


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 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.37 src/doc/CHANGES-10.0:1.1.2.38
--- src/doc/CHANGES-10.0:1.1.2.37	Thu Feb 23 11:49:18 2023
+++ src/doc/CHANGES-10.0	Fri Feb 24 14:16:10 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.37 2023/02/23 11:49:18 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.38 2023/02/24 14:16:10 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -1192,3 +1192,221 @@ sys/kern/kern_time.c1.219
 	In itimer_arm_real(), KASSERT that it->it_dying is false.
 	[thorpej, ticket #101]
 
+external/bsd/nvi/dist/common/search.c		1.5
+
+	vi(1): PR 57106: correctly handle escaped backslashes.
+	[gutteridge, ticket #102]
+
+sys/net/bpf.c	1.251
+
+	bpf(4): support writes on loopback interfaces when BIOCSHDRCMPLT
+	is set.
+	[gutteridge, ticket #103]
+
+crypto/external/bsd/openssl/dist/crypto/bn/rsa_sup_mul.c up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/embeddedSCTs1_issuer-key.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/smime-certs/badrsa.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/30-supported-groups.conf up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/30-supported-groups.conf.in up to 1.1.1.1
+crypto/external/bsd/openssl/dist/util/perl/OpenSSL/copyright.pm up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/16-certstatus.conf delete
+crypto/external/bsd/openssl/dist/CHANGESup to 1.30
+crypto/external/bsd/openssl/dist/Configure  up to 1.31
+crypto/external/bsd/openssl/dist/NEWS   up to 1.30
+crypto/external/bsd/openssl/dist/README up to 1.30
+crypto/external/bsd/openssl/dist/config up to 1.1.1.14
+crypto/external/bsd/openssl/dist/Configurations/10-main.conf up to 1.1.1.12
+crypto/external/bsd/openssl/dist/apps/apps.cup to 1.1.1.23
+crypto/external/bsd/openssl/dist/apps/apps.hup to 1.1.1.16
+crypto/external/bsd/openssl/dist/apps/ca.c  up to 1.22
+crypto/external/bsd/openssl/dist/apps/ocsp.cup to 1.23
+crypto/external/bsd/openssl/dist/apps/s_cb.cup to 1.1.1.21
+crypto/external/bsd/openssl/dist/apps/s_server.c up to 1.25
+crypto/external/bsd/openssl/dist/apps/x509.cup to 1.1.1.17
+crypto/external/bsd/openssl/dist/crypto/init.c  up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/s390x_arch.h up to 1.1.1.3
+crypto/external/bsd/openssl/dist/crypto/s390xcap.c up to 1.1.1.8
+crypto/external/bsd/openssl/dist/crypto/aes/asm/aesni-x86.pl up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/aes/asm/aesv8-armx.pl up to 1.1.1.7
+crypto/external/bsd/openssl/dist/crypto/asn1/asn_mime.c up to 1.13
+crypto/external/bsd/openssl/dist/crypto/asn1/bio_asn1.c up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/asn1/bio_ndef.c up to 1.1.1.10
+crypto/external/bsd/openssl/dist/crypto/asn1/charmap.pl up to 1.1.1.7
+crypto/external/bsd/openssl/dist/crypto/bio/b_print.c up to 1.1.1.11
+crypto/external/bsd/openssl/dist/crypto/bn/bn_blind.c up to 1.1.1.7
+crypto/external/bsd/openssl/dist/crypto/bn/bn_div.c up to 1.1.1.15
+crypto/external/bsd/openssl/dist/crypto/bn/bn_err.c up to 1.1.1.6
+crypto/external/bsd/openssl/dist/crypto/bn/bn_exp.c up to 1.21
+crypto/external/bsd/openssl/dist/crypto/bn/bn_gcd.c up to 1.1.1.10
+crypto/external/bsd/openssl/dist/crypto/bn/bn_local.h up to 1.1.1.3
+crypto/external/bsd/openssl/dist/crypto/bn/bn_mont.c up to 1.13
+crypto/external/bsd/openssl/dist/crypto/bn/bn_nist.c up to 1.7
+crypto/external/bsd/openssl/dist/crypto/bn/bn_prime.pl up to 1.1.1.5
+crypto/external/bsd/openssl/dist/crypto/bn/build.info up to 1.1.1.4
+crypto/external/bsd/openssl/dist/crypto/bn/rsaz_exp.c up to 1.1.1.4
+crypto/external/bsd/openssl/dist/crypto/bn/rsaz_exp.h up to 1.1.1.5
+crypto/external/bsd/openssl/dist/crypto/bn/asm/x86_64-mont5.pl up to 1.1.1.14
+crypto/external/bsd/openssl/dist/crypto/cms/cms_enc.c up to 1.1.1.10
+crypto/external/bsd/openssl/dist/crypto/cms/cms_err.c up to 1.1.1.10
+crypto/external/bsd/openssl/dist/crypto/conf/keysets.pl up to 1.1.1.6
+crypto/external/bsd/openssl/dist/crypto/ec/ec_asn1.c up to 1.13
+crypto/external/bsd/openssl/dist/crypto/ec/ec_key.c up to 1.7
+crypto/external/bsd/openssl/dist/crypto/ec/ecp_nistz256.c up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/ec/curve448/curve448.c up to 1.1.1.4
+crypto/external/bsd/openssl/dist/crypto/engine/eng_dyn.c up to 1.1.1.10
+crypto/external/bsd/openssl/dist/crypto/err/err.c up to 1.1.1.14
+crypto/external/bsd/openssl/dist/crypto/err/openssl.txt up to 1.1.1.10

CVS commit: [netbsd-10] src/sys/external/bsd/drm2/linux

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:14:16 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/linux [netbsd-10]: linux_dma_buf.c

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

sys/external/bsd/drm2/linux/linux_dma_buf.c: revision 1.16

drm: Teach dmabuf to handle lseek.

Needed by libdrm_amdgpu.

Based on patch from Jeff Frasca -- thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 \
src/sys/external/bsd/drm2/linux/linux_dma_buf.c

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

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_dma_buf.c
diff -u src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.15 src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.15.4.1
--- src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.15	Sat Apr  9 23:44:44 2022
+++ src/sys/external/bsd/drm2/linux/linux_dma_buf.c	Fri Feb 24 14:14:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $	*/
+/*	$NetBSD: linux_dma_buf.c,v 1.15.4.1 2023/02/24 14:14:16 martin Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.15 2022/04/09 23:44:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.15.4.1 2023/02/24 14:14:16 martin Exp $");
 
 #include 
 #include 
@@ -48,6 +48,8 @@ static int	dmabuf_fop_close(struct file 
 static int	dmabuf_fop_kqfilter(struct file *, struct knote *);
 static int	dmabuf_fop_mmap(struct file *, off_t *, size_t, int, int *,
 		int *, struct uvm_object **, int *);
+static int	dmabuf_fop_seek(struct file *fp, off_t delta, int whence,
+		off_t *newoffp, int flags);
 
 static const struct fileops dmabuf_fileops = {
 	.fo_name = "dmabuf",
@@ -61,6 +63,7 @@ static const struct fileops dmabuf_fileo
 	.fo_kqfilter = dmabuf_fop_kqfilter,
 	.fo_restart = fnullop_restart,
 	.fo_mmap = dmabuf_fop_mmap,
+	.fo_seek = dmabuf_fop_seek,
 };
 
 struct dma_buf *
@@ -288,3 +291,54 @@ dmabuf_fop_mmap(struct file *file, off_t
 	return dmabuf->ops->mmap(dmabuf, offp, size, prot, flagsp, advicep,
 	uobjp, maxprotp);
 }
+
+/*
+ * We don't actually do anything with the file offset; this is just how
+ * libdrm_amdgpu expects to find the size of the DMA buf.  (Why it
+ * doesn't use fstat is unclear, but it doesn't really matter.)
+ */
+static int
+dmabuf_fop_seek(struct file *fp, off_t delta, int whence, off_t *newoffp,
+int flags)
+{
+	const off_t OFF_MAX = __type_max(off_t);
+	struct dma_buf *dmabuf = fp->f_data;
+	off_t base, newoff;
+	int error;
+
+	mutex_enter(>f_lock);
+
+	switch (whence) {
+	case SEEK_CUR:
+		base = fp->f_offset;
+		break;
+	case SEEK_END:
+		base = dmabuf->size;
+		break;
+	case SEEK_SET:
+		base = 0;
+		break;
+	default:
+		error = EINVAL;
+		goto out;
+	}
+
+	/* Check for arithmetic overflow and reject negative offsets.  */
+	if (base < 0 || delta > OFF_MAX - base || base + delta < 0) {
+		error = EINVAL;
+		goto out;
+	}
+
+	/* Compute the new offset.  */
+	newoff = base + delta;
+
+	/* Success!  */
+	if (newoffp)
+		*newoffp = newoff;
+	if (flags & FOF_UPDATE_OFFSET)
+		fp->f_offset = newoff;
+	error = 0;
+
+out:	mutex_exit(>f_lock);
+	return error;
+}



CVS commit: [netbsd-10] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:16:10 UTC 2023

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

Log Message:
Tickets #102 - #108


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 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/external/bsd/drm2/linux

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:14:16 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/linux [netbsd-10]: linux_dma_buf.c

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

sys/external/bsd/drm2/linux/linux_dma_buf.c: revision 1.16

drm: Teach dmabuf to handle lseek.

Needed by libdrm_amdgpu.

Based on patch from Jeff Frasca -- thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 \
src/sys/external/bsd/drm2/linux/linux_dma_buf.c

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



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:12:51 UTC 2023

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

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

sys/kern/kern_ksyms.c: revision 1.108

ksyms(4): Reject negative offsets earlier in lseek.

Avoid arithmetic overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/kern/kern_ksyms.c

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

Modified files:

Index: src/sys/kern/kern_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.107 src/sys/kern/kern_ksyms.c:1.107.4.1
--- src/sys/kern/kern_ksyms.c:1.107	Fri Jul 15 06:40:24 2022
+++ src/sys/kern/kern_ksyms.c	Fri Feb 24 14:12:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.107 2022/07/15 06:40:24 mrg Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.107.4.1 2023/02/24 14:12:51 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.107 2022/07/15 06:40:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.107.4.1 2023/02/24 14:12:51 martin Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_copy_symtab.h"
@@ -1417,6 +1417,7 @@ ksymsmmap(struct file *fp, off_t *offp, 
 static int
 ksymsseek(struct file *fp, off_t delta, int whence, off_t *newoffp, int flags)
 {
+	const off_t OFF_MAX = __type_max(off_t);
 	struct ksyms_snapshot *ks = fp->f_data;
 	off_t base, newoff;
 	int error;
@@ -1438,13 +1439,15 @@ ksymsseek(struct file *fp, off_t delta, 
 		goto out;
 	}
 
-	/* Compute the new offset and validate it.  */
-	newoff = base + delta;	/* XXX arithmetic overflow */
-	if (newoff < 0) {
+	/* Check for arithmetic overflow and reject negative offsets.  */
+	if (base < 0 || delta > OFF_MAX - base || base + delta < 0) {
 		error = EINVAL;
 		goto out;
 	}
 
+	/* Compute the new offset.  */
+	newoff = base + delta;
+
 	/* Success!  */
 	if (newoffp)
 		*newoffp = newoff;



CVS commit: [netbsd-10] src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:11:29 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu [netbsd-10]:
amdgpu_device.c

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

sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.18

amdgpu: Fix scale factor for 64-bit doorbell indexing.

The register is 64 bits wide, but the indexing is for 32-bit
quantities (and presumably index must be even here).

Found by Jeff Frasca -- thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.17 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.17.4.1
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.17	Tue Sep 20 23:01:42 2022
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c	Fri Feb 24 14:11:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_device.c,v 1.17 2022/09/20 23:01:42 mrg Exp $	*/
+/*	$NetBSD: amdgpu_device.c,v 1.17.4.1 2023/02/24 14:11:29 martin Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.17 2022/09/20 23:01:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.17.4.1 2023/02/24 14:11:29 martin Exp $");
 
 #include 
 #include 
@@ -483,19 +483,19 @@ u64 amdgpu_mm_rdoorbell64(struct amdgpu_
 #ifdef __NetBSD__
 #ifdef _LP64
 		return bus_space_read_8(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index);
+		4*index);
 #else
 		uint64_t lo, hi;
 #if _BYTE_ORDER == _LITTLE_ENDIAN
 		lo = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index);
+		4*index);
 		hi = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index + 4);
+		4*index + 4);
 #else
 		hi = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index);
+		4*index);
 		lo = bus_space_read_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index + 4);
+		4*index + 4);
 #endif
 		return lo | (hi << 32);
 #endif
@@ -524,21 +524,21 @@ void amdgpu_mm_wdoorbell64(struct amdgpu
 #ifdef __NetBSD__
 #ifdef _LP64
 		bus_space_write_8(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index, v);
+		4*index, v);
 #else
 		/*
 		 * XXX This might not be as atomic as one might hope...
 		 */
 #if _BYTE_ORDER == _LITTLE_ENDIAN
 		bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index, v & 0xU);
+		4*index, v & 0xU);
 		bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index + 4, v >> 32);
+		4*index + 4, v >> 32);
 #else
 		bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index, v >> 32);
+		4*index, v >> 32);
 		bus_space_write_4(adev->doorbell.bst, adev->doorbell.bsh,
-		8*index + 4, v & 0xU);
+		4*index + 4, v & 0xU);
 #endif
 #endif
 #else



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:12:51 UTC 2023

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

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

sys/kern/kern_ksyms.c: revision 1.108

ksyms(4): Reject negative offsets earlier in lseek.

Avoid arithmetic overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/kern/kern_ksyms.c

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



CVS commit: [netbsd-9] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:10:25 UTC 2023

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

Log Message:
Tickets #1606 - #1608


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 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.53 src/doc/CHANGES-9.4:1.1.2.54
--- src/doc/CHANGES-9.4:1.1.2.53	Wed Feb 22 19:57:11 2023
+++ src/doc/CHANGES-9.4	Fri Feb 24 14:10:25 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.53 2023/02/22 19:57:11 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.54 2023/02/24 14:10:25 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -900,3 +900,363 @@ sys/net/bpf.c	1.247 (merged)
 	bpf(4): Reject bogus timeout values before arithmetic overflows.
 	[riastradh, ticket #1605]
 
+external/bsd/nvi/dist/common/search.c		1.5
+
+	vi(1): PR 57106: correctly handle escaped backslashes.
+	[gutteridge, ticket #1606]
+
+distrib/amiga/stand/loadbsd.uue			1.3
+sys/arch/amiga/stand/loadbsd/Makefile		1.4
+sys/arch/amiga/stand/loadbsd/README		1.5
+sys/arch/amiga/stand/loadbsd/loadbsd.c		1.37
+
+	Update loadbsd source and distribution binary to version 3.2.
+	[abs, ticket #1607]
+
+crypto/external/bsd/openssl/dist/apps/vms_decc_argv.c up to 1.1.1.1
+crypto/external/bsd/openssl/dist/crypto/bn/rsa_sup_mul.c up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/cross-key.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/cross-root.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/root-cross-cert.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/embeddedSCTs1_issuer-key.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/smime-certs/badrsa.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/30-supported-groups.conf up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/30-supported-groups.conf.in up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/dane-cross.in up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/data.bin  up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/testrsa_withattrs.der up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/testrsa_withattrs.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/util/perl/OpenSSL/copyright.pm up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/ssl-tests/16-certstatus.conf delete
+crypto/external/bsd/openssl/dist/CHANGESup to 1.30
+crypto/external/bsd/openssl/dist/Configure  up to 1.31
+crypto/external/bsd/openssl/dist/NEWS   up to 1.30
+crypto/external/bsd/openssl/dist/README up to 1.30
+crypto/external/bsd/openssl/dist/config up to 1.1.1.14
+crypto/external/bsd/openssl/dist/Configurations/10-main.conf up to 1.1.1.12
+crypto/external/bsd/openssl/dist/Configurations/15-android.conf up to 1.1.1.5
+crypto/external/bsd/openssl/dist/Configurations/descrip.mms.tmpl up to 1.1.1.8
+crypto/external/bsd/openssl/dist/Configurations/unix-Makefile.tmpl up to 1.1.1.12
+crypto/external/bsd/openssl/dist/Configurations/windows-makefile.tmpl up to 1.1.1.8
+crypto/external/bsd/openssl/dist/apps/apps.cup to 1.1.1.23
+crypto/external/bsd/openssl/dist/apps/apps.hup to 1.1.1.16
+crypto/external/bsd/openssl/dist/apps/ca.c  up to 1.22
+crypto/external/bsd/openssl/dist/apps/ciphers.c up to 1.1.1.9
+crypto/external/bsd/openssl/dist/apps/crl2p7.c  up to 1.1.1.7
+crypto/external/bsd/openssl/dist/apps/dgst.cup to 1.1.1.16
+crypto/external/bsd/openssl/dist/apps/enc.c up to 1.1.1.17
+crypto/external/bsd/openssl/dist/apps/ocsp.cup to 1.23
+crypto/external/bsd/openssl/dist/apps/openssl.c up to 1.7
+crypto/external/bsd/openssl/dist/apps/openssl.cnf up to 1.9
+crypto/external/bsd/openssl/dist/apps/passwd.c  up to 1.1.1.8
+crypto/external/bsd/openssl/dist/apps/s_cb.cup to 1.1.1.21
+crypto/external/bsd/openssl/dist/apps/s_client.c up to 1.25
+crypto/external/bsd/openssl/dist/apps/s_server.c up to 1.25
+crypto/external/bsd/openssl/dist/apps/s_socket.c up to 1.1.1.11
+crypto/external/bsd/openssl/dist/apps/speed.c   up to 1.21
+crypto/external/bsd/openssl/dist/apps/vms_decc_init.c up to 1.1.1.4
+crypto/external/bsd/openssl/dist/apps/x509.cup to 1.1.1.17
+crypto/external/bsd/openssl/dist/crypto/armcap.c up to 1.14
+crypto/external/bsd/openssl/dist/crypto/init.c  up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/ppccap.c up to 1.20
+crypto/external/bsd/openssl/dist/crypto/s390x_arch.h up to 1.1.1.3
+crypto/external/bsd/openssl/dist/crypto/s390xcap.c up to 1.1.1.8
+crypto/external/bsd/openssl/dist/crypto/sparcv9cap.c up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/uid.c   up to 1.8
+crypto/external/bsd/openssl/dist/crypto/aes/asm/aesni-x86.pl up to 1.1.1.9
+crypto/external/bsd/openssl/dist/crypto/aes/asm/aesv8-armx.pl up to 1.1.1.7

CVS commit: [netbsd-10] src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:11:29 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu [netbsd-10]:
amdgpu_device.c

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

sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.18

amdgpu: Fix scale factor for 64-bit doorbell indexing.

The register is 64 bits wide, but the indexing is for 32-bit
quantities (and presumably index must be even here).

Found by Jeff Frasca -- thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c

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



CVS commit: [netbsd-9] src/doc

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:10:25 UTC 2023

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

Log Message:
Tickets #1606 - #1608


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 14:07:57 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/dist [netbsd-9]: CHANGES Configure NEWS
README config
src/crypto/external/bsd/openssl/dist/Configurations [netbsd-9]:
10-main.conf 15-android.conf descrip.mms.tmpl unix-Makefile.tmpl
windows-makefile.tmpl
src/crypto/external/bsd/openssl/dist/apps [netbsd-9]: apps.c apps.h
ca.c ciphers.c crl2p7.c dgst.c enc.c ocsp.c openssl.c openssl.cnf
passwd.c s_cb.c s_client.c s_server.c s_socket.c speed.c
vms_decc_init.c x509.c
src/crypto/external/bsd/openssl/dist/crypto [netbsd-9]: armcap.c init.c
ppccap.c s390x_arch.h s390xcap.c sparcv9cap.c uid.c
src/crypto/external/bsd/openssl/dist/crypto/aes/asm [netbsd-9]:
aesni-x86.pl aesv8-armx.pl
src/crypto/external/bsd/openssl/dist/crypto/asn1 [netbsd-9]: a_object.c
a_print.c a_strex.c asn1_lib.c asn_mime.c bio_asn1.c bio_ndef.c
charmap.h charmap.pl d2i_pr.c t_spki.c
src/crypto/external/bsd/openssl/dist/crypto/bio [netbsd-9]: b_addr.c
b_print.c b_sock2.c bss_dgram.c bss_mem.c
src/crypto/external/bsd/openssl/dist/crypto/bn [netbsd-9]: bn_blind.c
bn_div.c bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_local.h bn_mont.c
bn_nist.c bn_prime.h bn_prime.pl bn_print.c bn_sqrt.c build.info
rsaz_exp.c rsaz_exp.h
src/crypto/external/bsd/openssl/dist/crypto/bn/asm [netbsd-9]: mips.pl
x86_64-mont5.pl
src/crypto/external/bsd/openssl/dist/crypto/chacha/asm [netbsd-9]:
chacha-x86_64.pl
src/crypto/external/bsd/openssl/dist/crypto/cms [netbsd-9]: cms_enc.c
cms_env.c cms_err.c
src/crypto/external/bsd/openssl/dist/crypto/conf [netbsd-9]: conf_def.h
keysets.pl
src/crypto/external/bsd/openssl/dist/crypto/dh [netbsd-9]: dh_ameth.c
src/crypto/external/bsd/openssl/dist/crypto/dsa [netbsd-9]: dsa_prn.c
src/crypto/external/bsd/openssl/dist/crypto/ec [netbsd-9]: ec2_oct.c
ec_asn1.c ec_curve.c ec_key.c ecp_nistz256.c
src/crypto/external/bsd/openssl/dist/crypto/ec/curve448 [netbsd-9]:
curve448.c field.h
src/crypto/external/bsd/openssl/dist/crypto/engine [netbsd-9]:
eng_all.c eng_dyn.c eng_lib.c eng_list.c eng_local.h
src/crypto/external/bsd/openssl/dist/crypto/err [netbsd-9]: err.c
openssl.txt
src/crypto/external/bsd/openssl/dist/crypto/evp [netbsd-9]: bio_enc.c
digest.c e_aes.c e_camellia.c evp_enc.c evp_local.h p_lib.c
src/crypto/external/bsd/openssl/dist/crypto/hmac [netbsd-9]: hm_ameth.c
src/crypto/external/bsd/openssl/dist/crypto/lhash [netbsd-9]: lhash.c
src/crypto/external/bsd/openssl/dist/crypto/objects [netbsd-9]:
o_names.c obj_dat.c obj_dat.h obj_dat.pl obj_xref.h objects.pl
objxref.pl
src/crypto/external/bsd/openssl/dist/crypto/pem [netbsd-9]: pem_lib.c
src/crypto/external/bsd/openssl/dist/crypto/pkcs12 [netbsd-9]:
p12_key.c
src/crypto/external/bsd/openssl/dist/crypto/poly1305 [netbsd-9]:
poly1305_ameth.c
src/crypto/external/bsd/openssl/dist/crypto/rand [netbsd-9]: drbg_lib.c
rand_lib.c rand_unix.c rand_vms.c rand_win.c
src/crypto/external/bsd/openssl/dist/crypto/rsa [netbsd-9]: rsa_ameth.c
rsa_ossl.c rsa_prn.c
src/crypto/external/bsd/openssl/dist/crypto/siphash [netbsd-9]:
siphash_ameth.c
src/crypto/external/bsd/openssl/dist/crypto/sm2 [netbsd-9]: sm2_crypt.c
sm2_pmeth.c
src/crypto/external/bsd/openssl/dist/crypto/srp [netbsd-9]: srp_vfy.c
src/crypto/external/bsd/openssl/dist/crypto/store [netbsd-9]:
loader_file.c
src/crypto/external/bsd/openssl/dist/crypto/ts [netbsd-9]:
ts_rsp_verify.c ts_verify_ctx.c
src/crypto/external/bsd/openssl/dist/crypto/txt_db [netbsd-9]: txt_db.c
src/crypto/external/bsd/openssl/dist/crypto/ui [netbsd-9]: ui_openssl.c
src/crypto/external/bsd/openssl/dist/crypto/x509 [netbsd-9]: by_dir.c
t_x509.c x509_cmp.c x509_req.c x509_vfy.c x509_vpm.c x_all.c
x_crl.c x_name.c
src/crypto/external/bsd/openssl/dist/crypto/x509v3 [netbsd-9]:
v3_addr.c v3_akey.c v3_alt.c v3_asid.c v3_cpols.c v3_genn.c
v3_lib.c v3_ncons.c v3_pci.c v3_sxnet.c v3_utl.c v3err.c
src/crypto/external/bsd/openssl/dist/demos/bio [netbsd-9]: client-arg.c
client-conf.c
src/crypto/external/bsd/openssl/dist/doc [netbsd-9]: fingerprints.txt
src/crypto/external/bsd/openssl/dist/doc/man1 [netbsd-9]: cms.pod
enc.pod passwd.pod pkeyutl.pod s_client.pod s_server.pod x509.pod

CVS commit: [netbsd-8] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:57:19 UTC 2023

Modified Files:
src/distrib/amiga/stand [netbsd-8]: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd [netbsd-8]: Makefile README loadbsd.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1803):

sys/arch/amiga/stand/loadbsd/loadbsd.c: revision 1.37
distrib/amiga/stand/loadbsd.uue: revision 1.3
sys/arch/amiga/stand/loadbsd/Makefile: revision 1.4
sys/arch/amiga/stand/loadbsd/README: revision 1.5

Update loadbsd source and distribution binary to version 3.2.

Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.3.10.1 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.35 -r1.35.46.1 src/sys/arch/amiga/stand/loadbsd/loadbsd.c

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

Modified files:

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.2 src/distrib/amiga/stand/loadbsd.uue:1.2.8.1
--- src/distrib/amiga/stand/loadbsd.uue:1.2	Wed Nov 11 16:13:55 2015
+++ src/distrib/amiga/stand/loadbsd.uue	Fri Feb 24 13:57:19 2023
@@ -1,484 +1,611 @@
 begin 755 loadbsd
-M```#\P`"``$``!"D```!70```^D``!"D,CP!0$GY``!_
-M_F<*0^R$-D*964%F^BE(A&8I0(1N*4^%2BQX``0I3H1JD\E.KO[:)D!*JP"L
-M9A1!ZP!<3J[^@$'K`%Q.KOZ,*4"$8D7L@]8D<<)EHB:P`$("R#TDZN_=@F
-M@&8&2'@`%&$B4X)FY$7L@^982G3_850O+(5"+RR$2B\LA%IA``3Z+T``!$7L
-MA`982G0`838L;(1J1>R#UB0:9Q`B6B`19P8B0$ZN_F)3@F;P)"R$8F<*3J[_
-M?")"3J[^AB`O``0N;(5*3G4F2DOLA#8@0!E>'!A;G-I;VXN;
-M0!C86XG="!O<&5N(&5X<&%N"!A='1R:6)U=&4])3`T;'@@<')I
-M/25D"@!K97)N96P@"P@)6QD32!#2$E0345-
-M"@!N97=E6]U('-H;W5L9`HJ*BH@=7!D871E('1O(&$@;F5W97(@=F5R`H`2V5R;F5L(&%T("4P.+"!&87-T;65M('5S
-M960@870@)3`X;'@*`$-A;B=T(&-O<'D@=7!W87)D6]U2!A9V%I;B!/4B!T2!T:&4@+5H@;W!T:6]N"!T
-M;R!&87-T;65M("4P.("HJ*@H`2V5R;F5L('-I>F4@)6QD(&5X8V5E9',@
-M0VAI<"!-96UO`)8CW`!L(-M!&$`#+9%[(`*+$:D/Z^Y1"@$ZN
-M_=@D@&8,2'K[ETAX`!1A`!-.1>R`!BQLA#^ON?0H!.KOW8)(!F``%\2'K[
-MH4AX`!1A`!,JR%1B\LA6YA`"Y4<@KCJ&!0<`*(@&```*@(Q``08```H`C$`!%@``"8
-M2'KZ)$AZ^NT@;(!&+R@`"&$`(F)/[P`,8'QR`2E!A59@='!`B(!@;D7LA6(O
-M+(5N80`N`DA`0D`D@%B/8%AR`8.LA6I@4"\LA6YA`"WH)`!8CW`#L()E"B`"
-MT("!K(5J8#1(>OJ32'@`%&$`$>1(>``00JR`$I:0
-M(!!'\PP`<`@V<$80`*U"X380`'S$AM_^A(;?_D2_X&$`!'9A``D880`)
-M2D*&0H5/[P`,+`!B!&OEI2'@`%&$`$!P@+?_\5H!R_,*`*T'__$JLA3YG
-M$`:M`$```/_@!JW_P```_^1![(5&2I!G#")0L^W_Y&($*TG_Y`@$``!G"DAZ
-M^4IA`"6&6(\@+?_HOD580`E1B!M__`T*/_^3^\`%`Q"3G-F`D)"
-M#$(`"6,0/P)"9TAZ^1M(>``480`/;`Q"``-C'$AZ^25A`"4.6(]*K(5>9@PL
-M;(.V9@HL;(.VOF[80`D=%"/("H`(`:``P```"5``"!*K(5>9PPO`$AZ^;UA`"144(]%
-MZ@!$8)0I2H520>R$=B(())"7R[?09")#\[H`(`GEB"1!0_((!"!LA5+1P%B(
-M(-D@V2"14HNWTF7>#$(``F,``(9*K(5F9GY![(4Z)%"U[?_@9!HO+?_@+PI(
-M>OEC80`C\$AZ^8-(>``480`.-$?LA3H@;?_4T=,K2/_OF?80`CHD_O``Q*
-MK(5>9D0L;(.VOG"
-M2'@`%&$`#;AP`2E`A68O+(4Z2'KYT&$`(U90CTJLA5YG!D*G80#T\BQL@`J3
-MR4ZN_R)*K(5F5\!)P$2`+P`O+(1R+RR%:B\LA%(O+(5B+P,O!"\M_^@O+?_D
-M+RW_X"(M__"2K?_L+P$O+?_4+RR%.B!M_]Q.D$*`3^\`-$SM3/S_L$Y=3G54
-M"!T;R`E,#AX('-Z("4P.'@*`'IK:6-K
-M(6]R>0!/[__L2.<_-I?+'WP`@``S(&\`1""+(F\`2"*+1>R$:BQ23J[_
-M?"!2)&@!0BI22HUG``)N0>R$=EB(+T@`*B@J`!0J*@`8FH0O10`T+$:B!$
-M0^\`-$*`3J[]!B0`FJ\`--BO`#1*KP`T9P`"*D'LA'9!Z``,+T@`+D'LA'9^
-M#MZ(+`A0ADJLA5YG(B\O`#0O`B`%T*\`/"\`(@22KP!`+P%(>O\F80`B"D_O
-M`!0F`M:O`#0,+`!]A6)F``"4("\`-%.``(``#___4H`O0``T)`.4@`R"0```
-M`&6((&\`+C``X(`!(J``E(@2!',8$(`")&([P`
-M(```"``@;P`J(8((`%*+!H(`(```!J__X#1![(1V0_.Z`"`)(@#EB2)O
-M`"XSJ@`.&``0*@`)2(`B1S.`&`!#Z``((Z\`-!@`6(@A@A@`,"H`#@)```8,
-M0``"9C!"L!@`("\`-`:```?__P*`__@``"]``#0C@!@`(F\`-"!O`$BST&,`
-M`+0@B6```*X"0N``!H,``!__`D/@``R#!_@``&8&)CP(#((`*```9B`@
-M:@`*0_K^!T*!0H`0&!(9D(%F#$H!9O)*@&8$="!(0B`"`H#_\```#(`1
-M9@(D`):"+T,`-$'SN@`@".6((F\`*B.""``@1B`#0(``RO`!___P`T8RY!
-M[(5.2I!G#&``480`)ED'LA6(@$$)`2H!G>"`0
-M#!``?6<``1Y"0$A`#(2P9P`!$&(D#()89P`!!&(,#('T9P``
-M^&`N#(/H9P``[&`B#(NX9P``X&(,#(?09P``U&`*#(^@
-M9P``R$*`,"R%8B\`2'K^Y&$`'LI(>``!80#P;$7LA/Z_O-.KO^@2H!F
-M'"Q20_K^\4ZN_Z!*@&8.+%)#^O[O3J[_H$J`9PH`K`^@``"%8F!H1>R$:BQ2
-M0_K^WTZN_Z!*@&8.+%)#^O[=3J[_H$J`9PH`K`NX``"%8F`^+$:D/Z_L].
-MKOX.2H!G"@"L!+```(5B8"0L;(1J0_K^PTZN_@Y*@&<4(#P``'T`@#D"```)
-M2$!"0()![(5B2E!F!@"0!]```"1?+%].=2!LA,:``D`!1C""EH`CB$
-M4DYU0^R$4B!L@`H@/``*[(4(*``"`,]G!B`\``K3`R*`3G5.<4YU3G$F3RQX
-M``1+^@`&3N[_XD;\)P!/^O_L(FL`!"0K``@L:P`,(`$"`K`!0B*P`8+BL`
-M'"AK`"`J*P`D*"L`*"8K`"PD:P`P+"L`-)O-#"L`?0`D9U0S_`(``-_PE@@%
-M``-G()?+3GNP`TY[N`9.>[@'3GNP!$Y[L`5.>[`&3GNP!V`F1_H`C/`30`!'
-M^@"`\!-,`/`32``(!0`"9PQ'^@!R\!,(`/`3#`!*AF<$*DC=R"K968)D^D/Z

CVS commit: [netbsd-8] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:57:19 UTC 2023

Modified Files:
src/distrib/amiga/stand [netbsd-8]: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd [netbsd-8]: Makefile README loadbsd.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1803):

sys/arch/amiga/stand/loadbsd/loadbsd.c: revision 1.37
distrib/amiga/stand/loadbsd.uue: revision 1.3
sys/arch/amiga/stand/loadbsd/Makefile: revision 1.4
sys/arch/amiga/stand/loadbsd/README: revision 1.5

Update loadbsd source and distribution binary to version 3.2.

Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.3.10.1 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.35 -r1.35.46.1 src/sys/arch/amiga/stand/loadbsd/loadbsd.c

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



CVS commit: [netbsd-9] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:51:44 UTC 2023

Modified Files:
src/distrib/amiga/stand [netbsd-9]: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd [netbsd-9]: Makefile README loadbsd.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1607):

sys/arch/amiga/stand/loadbsd/loadbsd.c: revision 1.37
distrib/amiga/stand/loadbsd.uue: revision 1.3
sys/arch/amiga/stand/loadbsd/Makefile: revision 1.4
sys/arch/amiga/stand/loadbsd/README: revision 1.5

Update loadbsd source and distribution binary to version 3.2.

Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.18.1 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.3.22.1 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.36 -r1.36.2.1 src/sys/arch/amiga/stand/loadbsd/loadbsd.c

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

Modified files:

Index: src/distrib/amiga/stand/loadbsd.uue
diff -u src/distrib/amiga/stand/loadbsd.uue:1.2 src/distrib/amiga/stand/loadbsd.uue:1.2.18.1
--- src/distrib/amiga/stand/loadbsd.uue:1.2	Wed Nov 11 16:13:55 2015
+++ src/distrib/amiga/stand/loadbsd.uue	Fri Feb 24 13:51:44 2023
@@ -1,484 +1,611 @@
 begin 755 loadbsd
-M```#\P`"``$``!"D```!70```^D``!"D,CP!0$GY``!_
-M_F<*0^R$-D*964%F^BE(A&8I0(1N*4^%2BQX``0I3H1JD\E.KO[:)D!*JP"L
-M9A1!ZP!<3J[^@$'K`%Q.KOZ,*4"$8D7L@]8D<<)EHB:P`$("R#TDZN_=@F
-M@&8&2'@`%&$B4X)FY$7L@^982G3_850O+(5"+RR$2B\LA%IA``3Z+T``!$7L
-MA`982G0`838L;(1J1>R#UB0:9Q`B6B`19P8B0$ZN_F)3@F;P)"R$8F<*3J[_
-M?")"3J[^AB`O``0N;(5*3G4F2DOLA#8@0!E>'!A;G-I;VXN;
-M0!C86XG="!O<&5N(&5X<&%N"!A='1R:6)U=&4])3`T;'@@<')I
-M/25D"@!K97)N96P@"P@)6QD32!#2$E0345-
-M"@!N97=E6]U('-H;W5L9`HJ*BH@=7!D871E('1O(&$@;F5W97(@=F5R`H`2V5R;F5L(&%T("4P.+"!&87-T;65M('5S
-M960@870@)3`X;'@*`$-A;B=T(&-O<'D@=7!W87)D6]U2!A9V%I;B!/4B!T2!T:&4@+5H@;W!T:6]N"!T
-M;R!&87-T;65M("4P.("HJ*@H`2V5R;F5L('-I>F4@)6QD(&5X8V5E9',@
-M0VAI<"!-96UO`)8CW`!L(-M!&$`#+9%[(`*+$:D/Z^Y1"@$ZN
-M_=@D@&8,2'K[ETAX`!1A`!-.1>R`!BQLA#^ON?0H!.KOW8)(!F``%\2'K[
-MH4AX`!1A`!,JR%1B\LA6YA`"Y4<@KCJ&!0<`*(@&```*@(Q``08```H`C$`!%@``"8
-M2'KZ)$AZ^NT@;(!&+R@`"&$`(F)/[P`,8'QR`2E!A59@='!`B(!@;D7LA6(O
-M+(5N80`N`DA`0D`D@%B/8%AR`8.LA6I@4"\LA6YA`"WH)`!8CW`#L()E"B`"
-MT("!K(5J8#1(>OJ32'@`%&$`$>1(>``00JR`$I:0
-M(!!'\PP`<`@V<$80`*U"X380`'S$AM_^A(;?_D2_X&$`!'9A``D880`)
-M2D*&0H5/[P`,+`!B!&OEI2'@`%&$`$!P@+?_\5H!R_,*`*T'__$JLA3YG
-M$`:M`$```/_@!JW_P```_^1![(5&2I!G#")0L^W_Y&($*TG_Y`@$``!G"DAZ
-M^4IA`"6&6(\@+?_HOD580`E1B!M__`T*/_^3^\`%`Q"3G-F`D)"
-M#$(`"6,0/P)"9TAZ^1M(>``480`/;`Q"``-C'$AZ^25A`"4.6(]*K(5>9@PL
-M;(.V9@HL;(.VOF[80`D=%"/("H`(`:``P```"5``"!*K(5>9PPO`$AZ^;UA`"144(]%
-MZ@!$8)0I2H520>R$=B(())"7R[?09")#\[H`(`GEB"1!0_((!"!LA5+1P%B(
-M(-D@V2"14HNWTF7>#$(``F,``(9*K(5F9GY![(4Z)%"U[?_@9!HO+?_@+PI(
-M>OEC80`C\$AZ^8-(>``480`.-$?LA3H@;?_4T=,K2/_OF?80`CHD_O``Q*
-MK(5>9D0L;(.VOG"
-M2'@`%&$`#;AP`2E`A68O+(4Z2'KYT&$`(U90CTJLA5YG!D*G80#T\BQL@`J3
-MR4ZN_R)*K(5F5\!)P$2`+P`O+(1R+RR%:B\LA%(O+(5B+P,O!"\M_^@O+?_D
-M+RW_X"(M__"2K?_L+P$O+?_4+RR%.B!M_]Q.D$*`3^\`-$SM3/S_L$Y=3G54
-M"!T;R`E,#AX('-Z("4P.'@*`'IK:6-K
-M(6]R>0!/[__L2.<_-I?+'WP`@``S(&\`1""+(F\`2"*+1>R$:BQ23J[_
-M?"!2)&@!0BI22HUG``)N0>R$=EB(+T@`*B@J`!0J*@`8FH0O10`T+$:B!$
-M0^\`-$*`3J[]!B0`FJ\`--BO`#1*KP`T9P`"*D'LA'9!Z``,+T@`+D'LA'9^
-M#MZ(+`A0ADJLA5YG(B\O`#0O`B`%T*\`/"\`(@22KP!`+P%(>O\F80`B"D_O
-M`!0F`M:O`#0,+`!]A6)F``"4("\`-%.``(``#___4H`O0``T)`.4@`R"0```
-M`&6((&\`+C``X(`!(J``E(@2!',8$(`")&([P`
-M(```"``@;P`J(8((`%*+!H(`(```!J__X#1![(1V0_.Z`"`)(@#EB2)O
-M`"XSJ@`.&``0*@`)2(`B1S.`&`!#Z``((Z\`-!@`6(@A@A@`,"H`#@)```8,
-M0``"9C!"L!@`("\`-`:```?__P*`__@``"]``#0C@!@`(F\`-"!O`$BST&,`
-M`+0@B6```*X"0N``!H,``!__`D/@``R#!_@``&8&)CP(#((`*```9B`@
-M:@`*0_K^!T*!0H`0&!(9D(%F#$H!9O)*@&8$="!(0B`"`H#_\```#(`1
-M9@(D`):"+T,`-$'SN@`@".6((F\`*B.""``@1B`#0(``RO`!___P`T8RY!
-M[(5.2I!G#&``480`)ED'LA6(@$$)`2H!G>"`0
-M#!``?6<``1Y"0$A`#(2P9P`!$&(D#()89P`!!&(,#('T9P``
-M^&`N#(/H9P``[&`B#(NX9P``X&(,#(?09P``U&`*#(^@
-M9P``R$*`,"R%8B\`2'K^Y&$`'LI(>``!80#P;$7LA/Z_O-.KO^@2H!F
-M'"Q20_K^\4ZN_Z!*@&8.+%)#^O[O3J[_H$J`9PH`K`^@``"%8F!H1>R$:BQ2
-M0_K^WTZN_Z!*@&8.+%)#^O[=3J[_H$J`9PH`K`NX``"%8F`^+$:D/Z_L].
-MKOX.2H!G"@"L!+```(5B8"0L;(1J0_K^PTZN_@Y*@&<4(#P``'T`@#D"```)
-M2$!"0()![(5B2E!F!@"0!]```"1?+%].=2!LA,:``D`!1C""EH`CB$
-M4DYU0^R$4B!L@`H@/``*[(4(*``"`,]G!B`\``K3`R*`3G5.<4YU3G$F3RQX
-M``1+^@`&3N[_XD;\)P!/^O_L(FL`!"0K``@L:P`,(`$"`K`!0B*P`8+BL`
-M'"AK`"`J*P`D*"L`*"8K`"PD:P`P+"L`-)O-#"L`?0`D9U0S_`(``-_PE@@%
-M``-G()?+3GNP`TY[N`9.>[@'3GNP!$Y[L`5.>[`&3GNP!V`F1_H`C/`30`!'
-M^@"`\!-,`/`32``(!0`"9PQ'^@!R\!,(`/`3#`!*AF<$*DC=R"K968)D^D/Z

CVS commit: [netbsd-10] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:48:28 UTC 2023

Modified Files:
src/distrib/amd64/cdroms [netbsd-10]: install.sh
src/distrib/amd64/installimage [netbsd-10]: install.sh
src/distrib/amd64/installimage-bios [netbsd-10]: install.sh
src/distrib/evbarm/installimage [netbsd-10]: install.sh
src/distrib/i386/cdroms [netbsd-10]: install.sh
src/distrib/i386/installimage [netbsd-10]: install.sh
src/distrib/sparc64/cdroms/installcd [netbsd-10]: install.sh
src/distrib/vax/cdroms/installcd [netbsd-10]: install.sh
src/usr.sbin/sysinst [netbsd-10]: menus.mi

Log Message:
Pull up following revision(s) (requested by abs in ticket #105):

distrib/amd64/installimage-bios/install.sh: revision 1.3
distrib/i386/cdroms/install.sh: revision 1.5
distrib/vax/cdroms/installcd/install.sh: revision 1.3
distrib/amd64/cdroms/install.sh: revision 1.5
distrib/sparc64/cdroms/installcd/install.sh: revision 1.5
distrib/i386/installimage/install.sh: revision 1.3
distrib/i386/installimage/install.sh: revision 1.4
distrib/evbarm/installimage/install.sh: revision 1.2
distrib/amd64/installimage/install.sh: revision 1.4
usr.sbin/sysinst/menus.mi: revision 1.28

Enable basic command line editing in amd64 installer shells

When a user selects "exist installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

At this point this is only on amd64, as this is the port which is
least likely to be installing on particularly esoteric terminal
hardware, and is also likely to have the highest proportion of less
experienced users

Enable basic command line editing in i386 installer shells
(Following the pattern in amd64)

When a user selects "exit installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

Switch install.sh to use /usr/sbin/sysinst for sysinst rather than ./sysinst
Matches i386/cdroms/install.sh and amd64/installimage/install.sh
resultant install image verified to still run sysinst correctly

Enable basic command line editing in evbarm, sparc64 and vax installer shells
(Following the pattern in amd64)

When a user selects "exit installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

With the change of all the install.sh scripts in amd64, evbarm,
i386, sparc64 and vax are identical apart from NetBSD RCD tags and
the sysctl -nx kern.consdev check (some of the latter are definitely
either wrong, or have an incorrect comment attached. Will return
to later)

Add "-i -E" to /bin/sh called from sysinst

This enables command line editing (primarily for arrow keys, but basic
emacs sequences will also work)

In the event that the shell has been compiled without command line
editing features (for memory contrained install environments) the
-E is ignored


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/amd64/cdroms/install.sh
cvs rdiff -u -r1.3 -r1.3.2.1 src/distrib/amd64/installimage/install.sh
cvs rdiff -u -r1.2 -r1.2.2.1 src/distrib/amd64/installimage-bios/install.sh
cvs rdiff -u -r1.1 -r1.1.6.1 src/distrib/evbarm/installimage/install.sh
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/i386/cdroms/install.sh
cvs rdiff -u -r1.2 -r1.2.44.1 src/distrib/i386/installimage/install.sh
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/sparc64/cdroms/installcd/install.sh
cvs rdiff -u -r1.2 -r1.2.26.1 src/distrib/vax/cdroms/installcd/install.sh
cvs rdiff -u -r1.27 -r1.27.2.1 src/usr.sbin/sysinst/menus.mi

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

Modified files:

Index: src/distrib/amd64/cdroms/install.sh
diff -u src/distrib/amd64/cdroms/install.sh:1.4 src/distrib/amd64/cdroms/install.sh:1.4.26.1
--- src/distrib/amd64/cdroms/install.sh:1.4	Thu May 28 09:51:31 2015
+++ src/distrib/amd64/cdroms/install.sh	Fri Feb 24 13:48:27 2023
@@ -1,5 +1,5 @@
 #! /bin/sh -m
-# $NetBSD: install.sh,v 1.4 2015/05/28 09:51:31 martin Exp $
+# $NetBSD: install.sh,v 1.4.26.1 2023/02/24 13:48:27 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@ do
 			tput clear
 			echo "You have stopped sysinst, return to it by" \
 "typing 'exit' or ^D."
-			${SHELL} -i
+			${SHELL} -i -E
 	

CVS commit: [netbsd-9] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:51:44 UTC 2023

Modified Files:
src/distrib/amiga/stand [netbsd-9]: loadbsd.uue
src/sys/arch/amiga/stand/loadbsd [netbsd-9]: Makefile README loadbsd.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1607):

sys/arch/amiga/stand/loadbsd/loadbsd.c: revision 1.37
distrib/amiga/stand/loadbsd.uue: revision 1.3
sys/arch/amiga/stand/loadbsd/Makefile: revision 1.4
sys/arch/amiga/stand/loadbsd/README: revision 1.5

Update loadbsd source and distribution binary to version 3.2.

Including the following changes by Gunther Nikl:
- Added detection of A600.
- Fix handling of multiple -n options.
Make it compile with recent AmigaOS gcc ports (for example gcc6), as
older ports no longer work with current NetBSD header files.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.18.1 src/distrib/amiga/stand/loadbsd.uue
cvs rdiff -u -r1.3 -r1.3.22.1 src/sys/arch/amiga/stand/loadbsd/Makefile \
src/sys/arch/amiga/stand/loadbsd/README
cvs rdiff -u -r1.36 -r1.36.2.1 src/sys/arch/amiga/stand/loadbsd/loadbsd.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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:48:28 UTC 2023

Modified Files:
src/distrib/amd64/cdroms [netbsd-10]: install.sh
src/distrib/amd64/installimage [netbsd-10]: install.sh
src/distrib/amd64/installimage-bios [netbsd-10]: install.sh
src/distrib/evbarm/installimage [netbsd-10]: install.sh
src/distrib/i386/cdroms [netbsd-10]: install.sh
src/distrib/i386/installimage [netbsd-10]: install.sh
src/distrib/sparc64/cdroms/installcd [netbsd-10]: install.sh
src/distrib/vax/cdroms/installcd [netbsd-10]: install.sh
src/usr.sbin/sysinst [netbsd-10]: menus.mi

Log Message:
Pull up following revision(s) (requested by abs in ticket #105):

distrib/amd64/installimage-bios/install.sh: revision 1.3
distrib/i386/cdroms/install.sh: revision 1.5
distrib/vax/cdroms/installcd/install.sh: revision 1.3
distrib/amd64/cdroms/install.sh: revision 1.5
distrib/sparc64/cdroms/installcd/install.sh: revision 1.5
distrib/i386/installimage/install.sh: revision 1.3
distrib/i386/installimage/install.sh: revision 1.4
distrib/evbarm/installimage/install.sh: revision 1.2
distrib/amd64/installimage/install.sh: revision 1.4
usr.sbin/sysinst/menus.mi: revision 1.28

Enable basic command line editing in amd64 installer shells

When a user selects "exist installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

At this point this is only on amd64, as this is the port which is
least likely to be installing on particularly esoteric terminal
hardware, and is also likely to have the highest proportion of less
experienced users

Enable basic command line editing in i386 installer shells
(Following the pattern in amd64)

When a user selects "exit installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

Switch install.sh to use /usr/sbin/sysinst for sysinst rather than ./sysinst
Matches i386/cdroms/install.sh and amd64/installimage/install.sh
resultant install image verified to still run sysinst correctly

Enable basic command line editing in evbarm, sparc64 and vax installer shells
(Following the pattern in amd64)

When a user selects "exit installer" or hits ^Z in sysinst, the
calling install.sh runs a shell, plus shows a message indicating
they can type "exit" to return to the installer.

Add -E to the arguments to this shell, to enable command line editing,
(primarily for arrow keys, but basic emacs sequences will also work)

With the change of all the install.sh scripts in amd64, evbarm,
i386, sparc64 and vax are identical apart from NetBSD RCD tags and
the sysctl -nx kern.consdev check (some of the latter are definitely
either wrong, or have an incorrect comment attached. Will return
to later)

Add "-i -E" to /bin/sh called from sysinst

This enables command line editing (primarily for arrow keys, but basic
emacs sequences will also work)

In the event that the shell has been compiled without command line
editing features (for memory contrained install environments) the
-E is ignored


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/amd64/cdroms/install.sh
cvs rdiff -u -r1.3 -r1.3.2.1 src/distrib/amd64/installimage/install.sh
cvs rdiff -u -r1.2 -r1.2.2.1 src/distrib/amd64/installimage-bios/install.sh
cvs rdiff -u -r1.1 -r1.1.6.1 src/distrib/evbarm/installimage/install.sh
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/i386/cdroms/install.sh
cvs rdiff -u -r1.2 -r1.2.44.1 src/distrib/i386/installimage/install.sh
cvs rdiff -u -r1.4 -r1.4.26.1 src/distrib/sparc64/cdroms/installcd/install.sh
cvs rdiff -u -r1.2 -r1.2.26.1 src/distrib/vax/cdroms/installcd/install.sh
cvs rdiff -u -r1.27 -r1.27.2.1 src/usr.sbin/sysinst/menus.mi

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



CVS commit: [netbsd-10] src

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:42:13 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/dist [netbsd-10]: CHANGES Configure
NEWS README config
src/crypto/external/bsd/openssl/dist/Configurations [netbsd-10]:
10-main.conf
src/crypto/external/bsd/openssl/dist/apps [netbsd-10]: apps.c apps.h
ca.c ocsp.c s_cb.c s_server.c x509.c
src/crypto/external/bsd/openssl/dist/crypto [netbsd-10]: init.c
s390x_arch.h s390xcap.c
src/crypto/external/bsd/openssl/dist/crypto/aes/asm [netbsd-10]:
aesni-x86.pl aesv8-armx.pl
src/crypto/external/bsd/openssl/dist/crypto/asn1 [netbsd-10]:
asn_mime.c bio_asn1.c bio_ndef.c charmap.pl
src/crypto/external/bsd/openssl/dist/crypto/bio [netbsd-10]: b_print.c
src/crypto/external/bsd/openssl/dist/crypto/bn [netbsd-10]: bn_blind.c
bn_div.c bn_err.c bn_exp.c bn_gcd.c bn_local.h bn_mont.c bn_nist.c
bn_prime.pl build.info rsaz_exp.c rsaz_exp.h
src/crypto/external/bsd/openssl/dist/crypto/bn/asm [netbsd-10]:
x86_64-mont5.pl
src/crypto/external/bsd/openssl/dist/crypto/cms [netbsd-10]: cms_enc.c
cms_err.c
src/crypto/external/bsd/openssl/dist/crypto/conf [netbsd-10]:
keysets.pl
src/crypto/external/bsd/openssl/dist/crypto/ec [netbsd-10]: ec_asn1.c
ec_key.c ecp_nistz256.c
src/crypto/external/bsd/openssl/dist/crypto/ec/curve448 [netbsd-10]:
curve448.c
src/crypto/external/bsd/openssl/dist/crypto/engine [netbsd-10]:
eng_dyn.c
src/crypto/external/bsd/openssl/dist/crypto/err [netbsd-10]: err.c
openssl.txt
src/crypto/external/bsd/openssl/dist/crypto/evp [netbsd-10]: bio_enc.c
evp_enc.c evp_local.h
src/crypto/external/bsd/openssl/dist/crypto/objects [netbsd-10]:
obj_dat.pl objects.pl objxref.pl
src/crypto/external/bsd/openssl/dist/crypto/pem [netbsd-10]: pem_lib.c
src/crypto/external/bsd/openssl/dist/crypto/rand [netbsd-10]:
drbg_lib.c rand_lib.c rand_vms.c rand_win.c
src/crypto/external/bsd/openssl/dist/crypto/rsa [netbsd-10]:
rsa_ameth.c rsa_ossl.c
src/crypto/external/bsd/openssl/dist/crypto/txt_db [netbsd-10]:
txt_db.c
src/crypto/external/bsd/openssl/dist/crypto/x509 [netbsd-10]: by_dir.c
x509_cmp.c x509_req.c x509_vfy.c x_all.c x_crl.c x_name.c
src/crypto/external/bsd/openssl/dist/crypto/x509v3 [netbsd-10]:
v3_addr.c v3_asid.c v3_genn.c v3_lib.c v3_sxnet.c v3_utl.c
src/crypto/external/bsd/openssl/dist/doc [netbsd-10]: fingerprints.txt
src/crypto/external/bsd/openssl/dist/doc/man1 [netbsd-10]: x509.pod
src/crypto/external/bsd/openssl/dist/doc/man3 [netbsd-10]:
BIO_f_base64.pod CMS_add0_cert.pod CMS_verify.pod EC_KEY_new.pod
EVP_EncryptInit.pod OPENSSL_LH_COMPFUNC.pod OPENSSL_init_crypto.pod
PKCS7_sign.pod PKCS7_sign_add_signer.pod PKCS7_verify.pod
SSL_CTX_set1_verify_cert_store.pod SSL_CTX_set_timeout.pod
SSL_get_current_cipher.pod X509_STORE_CTX_new.pod
src/crypto/external/bsd/openssl/dist/engines/asm [netbsd-10]:
e_padlock-x86.pl e_padlock-x86_64.pl
src/crypto/external/bsd/openssl/dist/include/crypto [netbsd-10]: bn.h
src/crypto/external/bsd/openssl/dist/include/openssl [netbsd-10]:
bnerr.h cmserr.h opensslv.h ssl.h x509v3.h
src/crypto/external/bsd/openssl/dist/ssl [netbsd-10]: packet.c
packet_local.h s3_enc.c s3_lib.c ssl_cert.c ssl_ciph.c ssl_init.c
ssl_lib.c ssl_local.h ssl_rsa.c ssl_txt.c t1_enc.c t1_lib.c
tls13_enc.c
src/crypto/external/bsd/openssl/dist/ssl/record [netbsd-10]:
rec_layer_s3.c ssl3_buffer.c ssl3_record.c
src/crypto/external/bsd/openssl/dist/ssl/statem [netbsd-10]:
extensions_clnt.c extensions_srvr.c statem_clnt.c statem_dtls.c
statem_srvr.c
src/crypto/external/bsd/openssl/dist/test [netbsd-10]: ct_test.c
dtls_mtu_test.c dtlstest.c ec_internal_test.c exptest.c pemtest.c
sslapitest.c ssltestlib.c ssltestlib.h test_test.c v3ext.c
v3nametest.c x509_internal_test.c
src/crypto/external/bsd/openssl/dist/test/certs [netbsd-10]:
ee-ed25519.pem embeddedSCTs1-key.pem embeddedSCTs1.pem
embeddedSCTs1.sct embeddedSCTs1_issuer.pem root-ed25519.pem
rootCA.pem
src/crypto/external/bsd/openssl/dist/test/recipes [netbsd-10]:
25-test_x509.t 70-test_tls13hrr.t 80-test_cms.t 80-test_ssl_new.t
src/crypto/external/bsd/openssl/dist/test/recipes/10-test_bn_data 
[netbsd-10]:
bnmod.txt
src/crypto/external/bsd/openssl/dist/test/recipes/30-test_evp_data 
[netbsd-10]:
  

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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:10:53 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #103):

sys/net/bpf.c: revision 1.251

bpf.c: support loopback writes when BIOCSHDRCMPLT is set

Following changes in r. 1.249 "bpf: support sending packets on loopback
interfaces", also allow for this to succeed when the "header complete"
flag is set, which is the practice of some tools, e.g., tcpreplay and
Scapy. With this change, both of those example tools now work, e.g.,
Scapy passes "L3bpfSocket - send and sniff on loopback" in its test
suite.

There are several ways of addressing this issue; this commit is
intended to be the most conservative and consistent with the previous
changes. (E.g., FreeBSD instead has special handling of this condition
in its if_loop.c.)


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.2.1 src/sys/net/bpf.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/bpf.c
diff -u src/sys/net/bpf.c:1.249 src/sys/net/bpf.c:1.249.2.1
--- src/sys/net/bpf.c:1.249	Wed Nov 30 06:02:37 2022
+++ src/sys/net/bpf.c	Fri Feb 24 13:10:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.249 2022/11/30 06:02:37 ozaki-r Exp $	*/
+/*	$NetBSD: bpf.c,v 1.249.2.1 2023/02/24 13:10:53 martin Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.249 2022/11/30 06:02:37 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.249.2.1 2023/02/24 13:10:53 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -876,7 +876,12 @@ bpf_write(struct file *fp, off_t *offp, 
 		goto out;
 	}
 
-	if (d->bd_hdrcmplt)
+	/*
+	 * If writing to a loopback interface, the address family has
+	 * already been specially computed in bpf_movein(), so don't
+	 * clobber it, or the loopback will reject it in looutput().
+	 */
+	if (d->bd_hdrcmplt && ifp->if_type != IFT_LOOP)
 		dst.ss_family = pseudo_AF_HDRCMPLT;
 
 	if (d->bd_feedback) {



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:10:53 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #103):

sys/net/bpf.c: revision 1.251

bpf.c: support loopback writes when BIOCSHDRCMPLT is set

Following changes in r. 1.249 "bpf: support sending packets on loopback
interfaces", also allow for this to succeed when the "header complete"
flag is set, which is the practice of some tools, e.g., tcpreplay and
Scapy. With this change, both of those example tools now work, e.g.,
Scapy passes "L3bpfSocket - send and sniff on loopback" in its test
suite.

There are several ways of addressing this issue; this commit is
intended to be the most conservative and consistent with the previous
changes. (E.g., FreeBSD instead has special handling of this condition
in its if_loop.c.)


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.2.1 src/sys/net/bpf.c

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



CVS commit: [netbsd-9] src/external/bsd/nvi/dist/common

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:06:48 UTC 2023

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-9]: search.c

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #1606):

external/bsd/nvi/dist/common/search.c: revision 1.5

search.c: correctly handle escaped backslashes

Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

(This was also committed in the nvi2 sources:
https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/external/bsd/nvi/dist/common/search.c

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

Modified files:

Index: src/external/bsd/nvi/dist/common/search.c
diff -u src/external/bsd/nvi/dist/common/search.c:1.4 src/external/bsd/nvi/dist/common/search.c:1.4.6.1
--- src/external/bsd/nvi/dist/common/search.c:1.4	Wed Nov 22 16:17:30 2017
+++ src/external/bsd/nvi/dist/common/search.c	Fri Feb 24 13:06:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $ */
+/*	$NetBSD: search.c,v 1.4.6.1 2023/02/24 13:06:48 martin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: search.c,v 10.31 2001/06/25 15:19:12 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:12 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $");
+__RCSID("$NetBSD: search.c,v 1.4.6.1 2023/02/24 13:06:48 martin Exp $");
 #endif
 
 #include 
@@ -110,9 +110,14 @@ prev:			if (sp->re == NULL) {
 	++p;
 break;
 			}
-			if (plen > 1 && p[0] == '\\' && p[1] == delim) {
-++p;
---plen;
+			if (plen > 1 && p[0] == '\\') {
+if(p[1] == delim) {
+	++p;
+	--plen;
+} else if(p[1] == '\\') {
+	*t++ = *p++;
+	--plen;
+}
 			}
 		}
 		if (epp != NULL)



CVS commit: [netbsd-9] src/external/bsd/nvi/dist/common

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:06:48 UTC 2023

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-9]: search.c

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #1606):

external/bsd/nvi/dist/common/search.c: revision 1.5

search.c: correctly handle escaped backslashes

Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

(This was also committed in the nvi2 sources:
https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/external/bsd/nvi/dist/common/search.c

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



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:05:24 UTC 2023

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-10]: search.c

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #102):

external/bsd/nvi/dist/common/search.c: revision 1.5

search.c: correctly handle escaped backslashes

Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

(This was also committed in the nvi2 sources:
https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.14.1 src/external/bsd/nvi/dist/common/search.c

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

Modified files:

Index: src/external/bsd/nvi/dist/common/search.c
diff -u src/external/bsd/nvi/dist/common/search.c:1.4 src/external/bsd/nvi/dist/common/search.c:1.4.14.1
--- src/external/bsd/nvi/dist/common/search.c:1.4	Wed Nov 22 16:17:30 2017
+++ src/external/bsd/nvi/dist/common/search.c	Fri Feb 24 13:05:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $ */
+/*	$NetBSD: search.c,v 1.4.14.1 2023/02/24 13:05:24 martin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: search.c,v 10.31 2001/06/25 15:19:12 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:12 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: search.c,v 1.4 2017/11/22 16:17:30 rin Exp $");
+__RCSID("$NetBSD: search.c,v 1.4.14.1 2023/02/24 13:05:24 martin Exp $");
 #endif
 
 #include 
@@ -110,9 +110,14 @@ prev:			if (sp->re == NULL) {
 	++p;
 break;
 			}
-			if (plen > 1 && p[0] == '\\' && p[1] == delim) {
-++p;
---plen;
+			if (plen > 1 && p[0] == '\\') {
+if(p[1] == delim) {
+	++p;
+	--plen;
+} else if(p[1] == '\\') {
+	*t++ = *p++;
+	--plen;
+}
 			}
 		}
 		if (epp != NULL)



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 13:05:24 UTC 2023

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-10]: search.c

Log Message:
Pull up following revision(s) (requested by gutteridge in ticket #102):

external/bsd/nvi/dist/common/search.c: revision 1.5

search.c: correctly handle escaped backslashes

Addresses PR bin/57106 from Bosco G. G., who supplied the patch.

(This was also committed in the nvi2 sources:
https://github.com/lichray/nvi2/commit/e7054267a371d5caa81edb218f5c8388e11b5197)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.14.1 src/external/bsd/nvi/dist/common/search.c

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



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 12:47:23 UTC 2023

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

Log Message:
Add mew file make/unit-tests/meta-ignore.inc


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

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



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

2023-02-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 24 12:47:23 UTC 2023

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

Log Message:
Add mew file make/unit-tests/meta-ignore.inc


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

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1252 src/distrib/sets/lists/tests/mi:1.1253
--- src/distrib/sets/lists/tests/mi:1.1252	Sun Feb  5 13:01:28 2023
+++ src/distrib/sets/lists/tests/mi	Fri Feb 24 12:47:23 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1252 2023/02/05 13:01:28 rillig Exp $
+# $NetBSD: mi,v 1.1253 2023/02/24 12:47:23 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5785,6 +5785,7 @@
 ./usr/tests/usr.bin/make/unit-tests/make-exported.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/meta-cmd-cmp.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/meta-cmd-cmp.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/meta-ignore.inctests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/misc.exp	tests-obsolete		obsolete
 ./usr/tests/usr.bin/make/unit-tests/misc.mk	tests-obsolete		obsolete
 ./usr/tests/usr.bin/make/unit-tests/moderrs.exp	tests-usr.bin-tests	compattestfile,atf



CVS commit: src/sys/kern

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 24 11:21:29 UTC 2023

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

Log Message:
mutex(9): Simplify membars.

- Elide macro indirection for membar_acquire.
- Use atomic_store_release instead of membar_release and store.

No functional change intended.  Possible very very very very minor
performance gain on architectures with a native store-release
instruction.

Note: It is possible there are some code paths that worked by
accident with this change which could, in theory, break now, such as
the logic I recently fixed in kern_descrip.c that assumed a
mutex_enter/exit cycle would serve as a store-before-store barrier:

fp->f_... = ...;// A

/* fd_affix */
mutex_enter(>f_lock);
fp->f_count++;
mutex_exit(>f_lock);
...
ff->ff_file = fp;   // B

This logic was never correct, and is likely already broken in
practice on aarch64 because the mutex_exit stub already uses STLXR
instead of DMB ISH(ST); STXR.  This change only affects the slow path
of mutex_exit, so it doesn't change even the accidental guarantees
mutex_exit makes in all paths.


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

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

Modified files:

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.103 src/sys/kern/kern_mutex.c:1.104
--- src/sys/kern/kern_mutex.c:1.103	Thu Feb 23 14:57:29 2023
+++ src/sys/kern/kern_mutex.c	Fri Feb 24 11:21:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.103 2023/02/23 14:57:29 riastradh Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.104 2023/02/24 11:21:28 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.103 2023/02/23 14:57:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.104 2023/02/24 11:21:28 riastradh Exp $");
 
 #include 
 #include 
@@ -167,12 +167,8 @@ do {	\
  */
 #ifdef __HAVE_ATOMIC_AS_MEMBAR
 #define	MUTEX_MEMBAR_ENTER()
-#define	MUTEX_MEMBAR_ACQUIRE()
-#define	MUTEX_MEMBAR_RELEASE()
 #else
 #define	MUTEX_MEMBAR_ENTER()		membar_enter()
-#define	MUTEX_MEMBAR_ACQUIRE()		membar_acquire()
-#define	MUTEX_MEMBAR_RELEASE()		membar_release()
 #endif
 
 /*
@@ -238,7 +234,7 @@ MUTEX_ACQUIRE(kmutex_t *mtx, uintptr_t c
 	MUTEX_INHERITDEBUG(oldown, mtx->mtx_owner);
 	MUTEX_INHERITDEBUG(newown, oldown);
 	rv = MUTEX_CAS(>mtx_owner, oldown, newown);
-	MUTEX_MEMBAR_ACQUIRE();
+	membar_acquire();
 	return rv;
 }
 
@@ -256,10 +252,9 @@ MUTEX_RELEASE(kmutex_t *mtx)
 {
 	uintptr_t newown;
 
-	MUTEX_MEMBAR_RELEASE();
 	newown = 0;
 	MUTEX_INHERITDEBUG(newown, mtx->mtx_owner);
-	mtx->mtx_owner = newown;
+	atomic_store_release(>mtx_owner, newown);
 }
 #endif	/* __HAVE_SIMPLE_MUTEXES */
 



CVS commit: src/sys/kern

2023-02-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 24 11:21:29 UTC 2023

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

Log Message:
mutex(9): Simplify membars.

- Elide macro indirection for membar_acquire.
- Use atomic_store_release instead of membar_release and store.

No functional change intended.  Possible very very very very minor
performance gain on architectures with a native store-release
instruction.

Note: It is possible there are some code paths that worked by
accident with this change which could, in theory, break now, such as
the logic I recently fixed in kern_descrip.c that assumed a
mutex_enter/exit cycle would serve as a store-before-store barrier:

fp->f_... = ...;// A

/* fd_affix */
mutex_enter(>f_lock);
fp->f_count++;
mutex_exit(>f_lock);
...
ff->ff_file = fp;   // B

This logic was never correct, and is likely already broken in
practice on aarch64 because the mutex_exit stub already uses STLXR
instead of DMB ISH(ST); STXR.  This change only affects the slow path
of mutex_exit, so it doesn't change even the accidental guarantees
mutex_exit makes in all paths.


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

2023-02-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Feb 24 11:19:15 UTC 2023

Modified Files:
src/sys/arch/arm/apple: apple_dart.c

Log Message:
#define for consistency with the rest of the file


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/apple/apple_dart.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/apple/apple_dart.c
diff -u src/sys/arch/arm/apple/apple_dart.c:1.4 src/sys/arch/arm/apple/apple_dart.c:1.5
--- src/sys/arch/arm/apple/apple_dart.c:1.4	Wed Apr 27 07:53:24 2022
+++ src/sys/arch/arm/apple/apple_dart.c	Fri Feb 24 11:19:15 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: apple_dart.c,v 1.4 2022/04/27 07:53:24 skrll Exp $ */
+/* $NetBSD: apple_dart.c,v 1.5 2023/02/24 11:19:15 jmcneill Exp $ */
 /*	$OpenBSD: apldart.c,v 1.10 2022/02/27 17:36:52 kettenis Exp $	*/
 
 /*-
@@ -21,7 +21,7 @@
 //#define APPLE_DART_DEBUG
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apple_dart.c,v 1.4 2022/04/27 07:53:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apple_dart.c,v 1.5 2023/02/24 11:19:15 jmcneill Exp $");
 
 #include 
 #include 
@@ -86,7 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: apple_dart.c
  * access.  To make sure this doesn't fault, round the subpage limits
  * down and up accordingly.
  */
-#define DART_OFFSET_MASK	7
+#define	DART_OFFSET_MASK	7
 
 #define	DART_L1_TABLE		0x3
 #define	DART_L2_INVAL		0x0



  1   2   >