CVS commit: src

2020-02-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Feb 11 07:03:16 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/dev/audio: Makefile
Added Files:
src/tests/dev/audio: audiotest.c t_audio.awk

Log Message:
Add ATF tests for audio(4).

91 passed test cases
0 failed test cases.
0 expected failed test cases.
62 skipped test cases.

There are many skipped tests, because the test itself supports full-
duplex, half-duplex and uni-directional devices but pad(4) used in ATF
tests is uni-directional device.


To generate a diff of this commit:
cvs rdiff -u -r1.829 -r1.830 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/audio/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/dev/audio/audiotest.c \
src/tests/dev/audio/t_audio.awk

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



CVS commit: src/sys/compat/netbsd32

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Feb 11 06:33:51 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
Where did the +1 came from ?


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/netbsd32/netbsd32_ioctl.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.108 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.109
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.108	Mon Feb 10 22:33:28 2020
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Tue Feb 11 06:33:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.108 2020/02/10 22:33:28 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.109 2020/02/11 06:33:51 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.108 2020/02/10 22:33:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.109 2020/02/11 06:33:51 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -147,7 +147,7 @@ netbsd32_to_if_addrprefreq(const struct 
 struct if_addrprefreq *ifap, u_long cmd)
 {
 
-	memcpy(ifap->ifap_name, ifap32->ifap_name, IFNAMSIZ+1);
+	memcpy(ifap->ifap_name, ifap32->ifap_name, IFNAMSIZ);
 	ifap->ifap_preference = ifap32->ifap_preference;
 	memcpy(>ifap_addr, >ifap_addr,
 	uimin(ifap32->ifap_addr.ss_len, _SS_MAXSIZE));



CVS commit: src/sys/compat/netbsd32

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Feb 11 06:33:51 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
Where did the +1 came from ?


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/netbsd32/netbsd32_ioctl.c

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



CVS commit: src/tests/usr.bin

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 06:26:19 UTC 2020

Modified Files:
src/tests/usr.bin/c++: t_call_once.sh t_cxxruntime.sh t_hello.sh
t_pthread_once.sh t_static_destructor.sh
src/tests/usr.bin/cc: t_hello.sh

Log Message:
Mark compilation with -pg as xfail on aarch64.

XXX file a PR to xref


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_call_once.sh \
src/tests/usr.bin/c++/t_pthread_once.sh \
src/tests/usr.bin/c++/t_static_destructor.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/c++/t_cxxruntime.sh \
src/tests/usr.bin/c++/t_hello.sh
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/cc/t_hello.sh

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



CVS commit: src/tests/usr.bin

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 06:26:19 UTC 2020

Modified Files:
src/tests/usr.bin/c++: t_call_once.sh t_cxxruntime.sh t_hello.sh
t_pthread_once.sh t_static_destructor.sh
src/tests/usr.bin/cc: t_hello.sh

Log Message:
Mark compilation with -pg as xfail on aarch64.

XXX file a PR to xref


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_call_once.sh \
src/tests/usr.bin/c++/t_pthread_once.sh \
src/tests/usr.bin/c++/t_static_destructor.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/c++/t_cxxruntime.sh \
src/tests/usr.bin/c++/t_hello.sh
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/cc/t_hello.sh

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

Modified files:

Index: src/tests/usr.bin/c++/t_call_once.sh
diff -u src/tests/usr.bin/c++/t_call_once.sh:1.2 src/tests/usr.bin/c++/t_call_once.sh:1.3
--- src/tests/usr.bin/c++/t_call_once.sh:1.2	Tue Jan  8 00:21:19 2019
+++ src/tests/usr.bin/c++/t_call_once.sh	Tue Feb 11 06:26:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_call_once.sh,v 1.2 2019/01/08 00:21:19 christos Exp $
+#	$NetBSD: t_call_once.sh,v 1.3 2020/02/11 06:26:19 riastradh Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -112,6 +112,11 @@ int main(void) {
 }
 EOF
 	atf_check -s exit:0 -o ignore -e ignore c++ -pg -o call_once test.cpp -pthread
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once
 }
 
@@ -228,6 +233,11 @@ EOF
 	atf_check -s exit:0 -o ignore -e ignore \
 	c++ -pg -o call_once test.cpp -L. -ltest -pthread
 
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	export LD_LIBRARY_PATH=.
 	atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once
 }
Index: src/tests/usr.bin/c++/t_pthread_once.sh
diff -u src/tests/usr.bin/c++/t_pthread_once.sh:1.2 src/tests/usr.bin/c++/t_pthread_once.sh:1.3
--- src/tests/usr.bin/c++/t_pthread_once.sh:1.2	Tue Jan  8 00:22:11 2019
+++ src/tests/usr.bin/c++/t_pthread_once.sh	Tue Feb 11 06:26:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pthread_once.sh,v 1.2 2019/01/08 00:22:11 christos Exp $
+#	$NetBSD: t_pthread_once.sh,v 1.3 2020/02/11 06:26:19 riastradh Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -110,6 +110,11 @@ int main(void) {
 }
 EOF
 	atf_check -s exit:0 -o ignore -e ignore c++ -pg -o pthread_once test.cpp -pthread
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	atf_check -s exit:0 -o inline:"hello, world!\n" ./pthread_once
 }
 
@@ -222,6 +227,11 @@ EOF
 	atf_check -s exit:0 -o ignore -e ignore \
 	c++ -pg -o pthread_once test.cpp -L. -ltest -pthread
 
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	export LD_LIBRARY_PATH=.
 	atf_check -s exit:0 -o inline:"hello, world!\n" ./pthread_once
 }
Index: src/tests/usr.bin/c++/t_static_destructor.sh
diff -u src/tests/usr.bin/c++/t_static_destructor.sh:1.2 src/tests/usr.bin/c++/t_static_destructor.sh:1.3
--- src/tests/usr.bin/c++/t_static_destructor.sh:1.2	Sat Mar 24 00:26:51 2018
+++ src/tests/usr.bin/c++/t_static_destructor.sh	Tue Feb 11 06:26:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_static_destructor.sh,v 1.2 2018/03/24 00:26:51 kamil Exp $
+#	$NetBSD: t_static_destructor.sh,v 1.3 2020/02/11 06:26:19 riastradh Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -123,6 +123,11 @@ struct B {
 int main(void) {struct B b;return 0;}
 EOF
 	atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	atf_check -s exit:0 -o inline:"CTOR A\nCTOR B\nDTOR B:10\nDTOR A:20\n" ./hello
 }
 
@@ -275,6 +280,11 @@ EOF
 	atf_check -s exit:0 -o ignore -e ignore \
 	c++ -pg -o hello test.cpp -L. -ltest
 
+	case `uname -p` in
+	aarch64)
+		atf_expect_fail 'cc -pg is busted on aarch64'
+		;;
+	esac
 	export LD_LIBRARY_PATH=.
 	atf_check -s exit:0 -o inline:"CTOR A\nCTOR B\nDTOR B:10\nDTOR A:20\n" ./hello
 }

Index: src/tests/usr.bin/c++/t_cxxruntime.sh
diff -u src/tests/usr.bin/c++/t_cxxruntime.sh:1.3 src/tests/usr.bin/c++/t_cxxruntime.sh:1.4
--- src/tests/usr.bin/c++/t_cxxruntime.sh:1.3	Sat Mar 24 00:26:51 2018
+++ src/tests/usr.bin/c++/t_cxxruntime.sh	Tue Feb 11 06:26:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: t_cxxruntime.sh,v 1.3 2018/03/24 00:26:51 kamil Exp $
+#	$NetBSD: t_cxxruntime.sh,v 1.4 2020/02/11 06:26:19 riastradh Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -105,6 +105,11 @@ cxxruntime_profile_body() {
 int main(void) {std::cout << "hello world" << std::endl;exit(0);}
 EOF
 	atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
+	case `uname -p` in
+	

CVS commit: src/sys/kern

2020-02-10 Thread Tom Spindler
Module Name:src
Committed By:   dogcow
Date:   Tue Feb 11 06:09:48 UTC 2020

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

Log Message:
fix compilation failure for arches without l_pcu_valid
ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/kern/kern_lwp.c

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



CVS commit: src/sys/kern

2020-02-10 Thread Tom Spindler
Module Name:src
Committed By:   dogcow
Date:   Tue Feb 11 06:09:48 UTC 2020

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

Log Message:
fix compilation failure for arches without l_pcu_valid
ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/kern/kern_lwp.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_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.224 src/sys/kern/kern_lwp.c:1.225
--- src/sys/kern/kern_lwp.c:1.224	Tue Feb 11 03:14:49 2020
+++ src/sys/kern/kern_lwp.c	Tue Feb 11 06:09:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.224 2020/02/11 03:14:49 riastradh Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.225 2020/02/11 06:09:48 dogcow Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.224 2020/02/11 03:14:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.225 2020/02/11 06:09:48 dogcow Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -890,7 +890,9 @@ lwp_create(lwp_t *l1, proc_t *p2, vaddr_
 	 * the MD cpu_lwp_fork() can copy the saved state to the new LWP.
 	 */
 	pcu_save_all(l1);
+#if PCU_UNIT_COUNT > 0
 	l2->l_pcu_valid = l1->l_pcu_valid;
+#endif
 
 	uvm_lwp_setuarea(l2, uaddr);
 	uvm_lwp_fork(l1, l2, stack, stacksize, func, (arg != NULL) ? arg : l2);



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Kimihiro Nonaka
Hi,

Hyper-V Gen.2 VM has only 1024x768 GOP entry.
https://twitter.com/nonakap/status/1227076603470942208

kernel will be booted in text mode. no output to the console.
If execute "gop 0" command before booting a kernel, it works fine.

On Sat, Feb 8, 2020 at 11:35 PM Jared D. McNeill  wrote:
>
> Module Name:src
> Committed By:   jmcneill
> Date:   Sat Feb  8 14:35:47 UTC 2020
>
> Modified Files:
> src/sys/arch/i386/stand/efiboot: eficons.c
>
> Log Message:
> Fix a few bugs related to the framebuffer:
>  - If a GOP mode wasn't explicitly requested, the bootloader was passing
>fb info to the kernel even if the console was in text mode! This
>results in garbled console output on at least ThinkPad T420 and
>likely many others. If a mode isn't specified, default to 800x600.
>  - The "gop" command was incorrectly parsing video modes in the form
>WxHxD as WxWxD.
>  - Allow a short form WxH for the "gop" command to select any mode with
>the target dimensions.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/efiboot/eficons.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>


CVS commit: src

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:15:10 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: h_fpufork.c t_fpufork.sh

Log Message:
Test that fpu state is preserved by fork.


To generate a diff of this commit:
cvs rdiff -u -r1.828 -r1.829 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.64 -r1.65 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/h_fpufork.c \
src/tests/kernel/t_fpufork.sh

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.828 src/distrib/sets/lists/tests/mi:1.829
--- src/distrib/sets/lists/tests/mi:1.828	Sat Jan 18 17:18:41 2020
+++ src/distrib/sets/lists/tests/mi	Tue Feb 11 03:15:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.828 2020/01/18 17:18:41 kre Exp $
+# $NetBSD: mi,v 1.829 2020/02/11 03:15:10 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2142,6 +2142,7 @@
 ./usr/tests/kernel/arch/i386/t_ptrace_waitpid	tests-obsolete		obsolete
 ./usr/tests/kernel/arch/x86			tests-obsolete		obsolete
 ./usr/tests/kernel/h_fexecve			tests-kernel-tests	compattestfile,atf
+./usr/tests/kernel/h_fpufork			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/h_getprocpath		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/h_interpreter		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/h_ps_strings1		tests-kernel-tests	compattestfile,atf
@@ -2185,6 +2186,7 @@
 ./usr/tests/kernel/t_fcntl			tests-kernel-tests	atf
 ./usr/tests/kernel/t_fexecve			tests-kernel-tests	atf
 ./usr/tests/kernel/t_filedesc			tests-kernel-tests	atf,rump
+./usr/tests/kernel/t_fpufork			tests-kernel-tests	atf
 ./usr/tests/kernel/t_interp			tests-kernel-tests	atf
 ./usr/tests/kernel/t_kauth_pr_47598		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_ksem			tests-kernel-tests	atf

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.64 src/tests/kernel/Makefile:1.65
--- src/tests/kernel/Makefile:1.64	Sun Sep 29 23:45:00 2019
+++ src/tests/kernel/Makefile	Tue Feb 11 03:15:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.64 2019/09/29 23:45:00 mrg Exp $
+# $NetBSD: Makefile,v 1.65 2020/02/11 03:15:10 riastradh Exp $
 
 NOMAN=		# defined
 
@@ -29,6 +29,7 @@ TESTS_SH+=	t_interp
 TESTS_SH+=	t_origin
 TESTS_SH+=	t_procpath
 TESTS_SH+=	t_fexecve
+TESTS_SH+=	t_fpufork
 
 BINDIR=		${TESTSDIR}
 PROGS=		h_fexecve
@@ -36,6 +37,7 @@ PROGS+=		h_ps_strings1
 PROGS+=		h_ps_strings2
 PROGS+=		h_segv
 PROGS+=		h_getprocpath
+PROGS+=		h_fpufork
 
 SCRIPTSDIR=	${TESTSDIR}
 SCRIPTS=	h_interpreter.sh

Added files:

Index: src/tests/kernel/h_fpufork.c
diff -u /dev/null src/tests/kernel/h_fpufork.c:1.1
--- /dev/null	Tue Feb 11 03:15:11 2020
+++ src/tests/kernel/h_fpufork.c	Tue Feb 11 03:15:10 2020
@@ -0,0 +1,64 @@
+/*	$NetBSD: h_fpufork.c,v 1.1 2020/02/11 03:15:10 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__RCSID("$NetBSD: h_fpufork.c,v 1.1 2020/02/11 03:15:10 riastradh Exp $");
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+int
+main(void)
+{
+	pid_t child, pid;
+	volatile double x = 1;
+	register double y = 2*x;
+	int status;
+
+	pid = fork();
+	switch (pid) {
+	case -1:		/* error */
+		err(1, "fork");
+	case 0:			/* child */
+		_exit(y == 2 ? 0 : 1);
+	default:		/* parent */
+		break;
+	}
+
+	if ((child = wait()) == -1)
+		err(1, "wait");
+	if 

CVS commit: src

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:15:10 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: h_fpufork.c t_fpufork.sh

Log Message:
Test that fpu state is preserved by fork.


To generate a diff of this commit:
cvs rdiff -u -r1.828 -r1.829 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.64 -r1.65 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/h_fpufork.c \
src/tests/kernel/t_fpufork.sh

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



CVS commit: src/sys/kern

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:14:49 UTC 2020

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

Log Message:
Preserve pcu(9) state in fork.

There should perhaps be a pcu_fork operation to keep this factored
neatly but this will be simpler to pull up.

In practical terms, this may not affect most architecture that use
pcu(9) -- alpha, arm32, mips, powerpc, riscv -- but it does affect
aarch64, in which v8-v15 are callee-saves, and GCC actually takes
advantage of them, and for more than just floating-point data too.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/kern/kern_lwp.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_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.223 src/sys/kern/kern_lwp.c:1.224
--- src/sys/kern/kern_lwp.c:1.223	Wed Jan 29 15:47:52 2020
+++ src/sys/kern/kern_lwp.c	Tue Feb 11 03:14:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.223 2020/01/29 15:47:52 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.224 2020/02/11 03:14:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.223 2020/01/29 15:47:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.224 2020/02/11 03:14:49 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -890,6 +890,7 @@ lwp_create(lwp_t *l1, proc_t *p2, vaddr_
 	 * the MD cpu_lwp_fork() can copy the saved state to the new LWP.
 	 */
 	pcu_save_all(l1);
+	l2->l_pcu_valid = l1->l_pcu_valid;
 
 	uvm_lwp_setuarea(l2, uaddr);
 	uvm_lwp_fork(l1, l2, stack, stacksize, func, (arg != NULL) ? arg : l2);



CVS commit: src/sys/kern

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:14:49 UTC 2020

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

Log Message:
Preserve pcu(9) state in fork.

There should perhaps be a pcu_fork operation to keep this factored
neatly but this will be simpler to pull up.

In practical terms, this may not affect most architecture that use
pcu(9) -- alpha, arm32, mips, powerpc, riscv -- but it does affect
aarch64, in which v8-v15 are callee-saves, and GCC actually takes
advantage of them, and for more than just floating-point data too.

XXX pullup


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

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:12:06 UTC 2020

Removed Files:
src/sys/arch/aarch64/aarch64: cpu_in_cksum.S

Log Message:
Delete aarch64 cpu_in_cksum.S draft.

This isn't actually used in the kernel; it is only used to cause the
in_cksum tests to fail.

If you want to revive it and make it work, you can pull it out of the
attic.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/aarch64/aarch64/cpu_in_cksum.S

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



CVS commit: src/tests/lib/libc/gen

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:11:43 UTC 2020

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
aarch64 doesn't trap integer division by zero either.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/tests/lib/libc/gen/t_siginfo.c

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

Modified files:

Index: src/tests/lib/libc/gen/t_siginfo.c
diff -u src/tests/lib/libc/gen/t_siginfo.c:1.36 src/tests/lib/libc/gen/t_siginfo.c:1.37
--- src/tests/lib/libc/gen/t_siginfo.c:1.36	Thu Apr 25 20:48:54 2019
+++ src/tests/lib/libc/gen/t_siginfo.c	Tue Feb 11 03:11:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.36 2019/04/25 20:48:54 kamil Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.37 2020/02/11 03:11:42 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -366,8 +366,8 @@ ATF_TC_BODY(sigfpe_int, tc)
 	struct sigaction sa;
 	long l = strtol("0", NULL, 10);
 
-#if defined(__powerpc__)
-	atf_tc_skip("Test not valid on powerpc");
+#if defined(__powerpc__) || defined(__aarch64__)
+	atf_tc_skip("Integer division by zero doesn't trap");
 #endif
 	if (sigsetjmp(sigfpe_int_env, 0) == 0) {
 		sa.sa_flags = SA_SIGINFO;



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

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:12:06 UTC 2020

Removed Files:
src/sys/arch/aarch64/aarch64: cpu_in_cksum.S

Log Message:
Delete aarch64 cpu_in_cksum.S draft.

This isn't actually used in the kernel; it is only used to cause the
in_cksum tests to fail.

If you want to revive it and make it work, you can pull it out of the
attic.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/aarch64/aarch64/cpu_in_cksum.S

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



CVS commit: src/tests/lib/libc/gen

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Feb 11 03:11:43 UTC 2020

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
aarch64 doesn't trap integer division by zero either.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/tests/lib/libc/gen/t_siginfo.c

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



CVS commit: src/tests/lib/libc/sys

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Feb 11 00:41:37 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c t_ptrace_wait.h

Log Message:
Rewrite the t_ptrace_wait resume1 test

Switch to pthread functions.
Rename to 'resume'.
Synchronize the threads with pthread barriers.
Avoid race in the test.

Test passes correctly.

Fixes PR bin/54893 by Andreas Gustafsson


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/tests/lib/libc/sys/t_ptrace_wait.c
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/libc/sys/t_ptrace_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.154 src/tests/lib/libc/sys/t_ptrace_wait.c:1.155
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.154	Mon Feb 10 11:42:41 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Tue Feb 11 00:41:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.154 2020/02/10 11:42:41 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.155 2020/02/11 00:41:37 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.154 2020/02/10 11:42:41 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.155 2020/02/11 00:41:37 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -7317,44 +7317,44 @@ ATF_TC_BODY(suspend_no_deadlock, tc)
 
 /// 
 
-volatile lwpid_t the_lwp_id = 0;
+static pthread_barrier_t barrier1_resume;
+static pthread_barrier_t barrier2_resume;
 
-static void
-lwp_main_stop(void *arg)
+static void *
+resume_thread(void *arg)
 {
-	the_lwp_id = _lwp_self();
 
-	raise(SIGTRAP);
+	raise(SIGUSR1);
+
+	pthread_barrier_wait(_resume);
+
+	/* Debugger will suspend the process here */
+
+	pthread_barrier_wait(_resume);
+
+	raise(SIGUSR2);
 
-	_lwp_exit();
+	return infinite_thread(arg);
 }
 
-ATF_TC(resume1);
-ATF_TC_HEAD(resume1, tc)
+ATF_TC(resume);
+ATF_TC_HEAD(resume, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
 	"Verify that a thread can be suspended by a debugger and later "
 	"resumed by the debugger");
 }
 
-ATF_TC_BODY(resume1, tc)
+ATF_TC_BODY(resume, tc)
 {
-	struct msg_fds fds;
-	const int exitval = 5;
 	const int sigval = SIGSTOP;
 	pid_t child, wpid;
-	uint8_t msg = 0xde; /* dummy message for IPC based on pipe(2) */
 #if defined(TWAIT_HAVE_STATUS)
 	int status;
 #endif
-	ucontext_t uc;
 	lwpid_t lid;
-	static const size_t ssize = 16*1024;
-	void *stack;
-	struct ptrace_lwpinfo pl;
 	struct ptrace_siginfo psi;
-
-	SYSCALL_REQUIRE(msg_open() == 0);
+	pthread_t t;
 
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
@@ -7362,31 +7362,20 @@ ATF_TC_BODY(resume1, tc)
 		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
 		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
+		pthread_barrier_init(_resume, NULL, 2);
+		pthread_barrier_init(_resume, NULL, 2);
+
 		DPRINTF("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
-		DPRINTF("Before allocating memory for stack in child\n");
-		FORKEE_ASSERT((stack = malloc(ssize)) != NULL);
-
-		DPRINTF("Before making context for new lwp in child\n");
-		_lwp_makecontext(, lwp_main_stop, NULL, NULL, stack, ssize);
+		DPRINTF("Before creating new thread in child\n");
+		FORKEE_ASSERT(pthread_create(, NULL, resume_thread, NULL) == 0);
 
-		DPRINTF("Before creating new in child\n");
-		FORKEE_ASSERT(_lwp_create(, 0, ) == 0);
+		pthread_barrier_wait(_resume);
 
-		CHILD_TO_PARENT("Message", fds, msg);
+		pthread_barrier_wait(_resume);
 
-		raise(SIGINT);
-
-		DPRINTF("Before waiting for lwp %d to exit\n", lid);
-		FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0);
-
-		DPRINTF("Before verifying that reported %d and running lid %d "
-		"are the same\n", lid, the_lwp_id);
-		FORKEE_ASSERT_EQ(lid, the_lwp_id);
-
-		DPRINTF("Before exiting of the child process\n");
-		_exit(exitval);
+		infinite_thread(NULL);
 	}
 	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
 
@@ -7400,10 +7389,10 @@ ATF_TC_BODY(resume1, tc)
 	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
 
 	DPRINTF("Before calling %s() for the child - expected stopped "
-	"SIGTRAP\n", TWAIT_FNAME);
+	"SIGUSR1\n", TWAIT_FNAME);
 	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
 
-	validate_status_stopped(status, SIGTRAP);
+	validate_status_stopped(status, SIGUSR1);
 
 	DPRINTF("Before reading siginfo and lwpid_t\n");
 	SYSCALL_REQUIRE(ptrace(PT_GET_SIGINFO, child, , sizeof(psi)) != -1);
@@ -7411,53 +7400,61 @@ ATF_TC_BODY(resume1, tc)
 	DPRINTF("Before suspending LWP %d\n", psi.psi_lwpid);
 	SYSCALL_REQUIRE(ptrace(PT_SUSPEND, child, NULL, psi.psi_lwpid) != -1);
 
-	PARENT_FROM_CHILD("Message", fds, 

CVS commit: src/tests/lib/libc/sys

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Feb 11 00:41:37 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c t_ptrace_wait.h

Log Message:
Rewrite the t_ptrace_wait resume1 test

Switch to pthread functions.
Rename to 'resume'.
Synchronize the threads with pthread barriers.
Avoid race in the test.

Test passes correctly.

Fixes PR bin/54893 by Andreas Gustafsson


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/tests/lib/libc/sys/t_ptrace_wait.c
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/libc/sys/t_ptrace_wait.h

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



CVS commit: src/lib/librumphijack

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 23:21:42 UTC 2020

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Change types of DUP2ALIAS and DUP2FDMASK bit masks to unsigned

This is for consistency with the DUP2BIT change.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.129 src/lib/librumphijack/hijack.c:1.130
--- src/lib/librumphijack/hijack.c:1.129	Mon Feb 10 09:10:58 2020
+++ src/lib/librumphijack/hijack.c	Mon Feb 10 23:21:42 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.129 2020/02/10 09:10:58 kamil Exp $	*/
+/*  $NetBSD: hijack.c,v 1.130 2020/02/10 23:21:42 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.129 2020/02/10 09:10:58 kamil Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.130 2020/02/10 23:21:42 kamil Exp $");
 #endif
 
 #include 
@@ -441,8 +441,8 @@ static int hijack_fdoff = FD_SETSIZE/2;
 #define DUP2HIGH 2
 static uint32_t dup2vec[DUP2HIGH+1];
 #define DUP2BIT (1U<<31)
-#define DUP2ALIAS (1<<30)
-#define DUP2FDMASK ((1<<30)-1)
+#define DUP2ALIAS (1U<<30)
+#define DUP2FDMASK ((1U<<30)-1)
 
 static bool
 isdup2d(int fd)



CVS commit: src/lib/librumphijack

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 23:21:42 UTC 2020

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Change types of DUP2ALIAS and DUP2FDMASK bit masks to unsigned

This is for consistency with the DUP2BIT change.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/lib/librumphijack/hijack.c

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



CVS commit: src/sys/net

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 22:38:10 UTC 2020

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

Log Message:
safely extract character sequences from packet for printing.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/net/if_pppoe.c

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



CVS commit: src/sys/net

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 22:38:10 UTC 2020

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

Log Message:
safely extract character sequences from packet for printing.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/net/if_pppoe.c

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

Modified files:

Index: src/sys/net/if_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.148 src/sys/net/if_pppoe.c:1.149
--- src/sys/net/if_pppoe.c:1.148	Wed Jan 29 04:28:27 2020
+++ src/sys/net/if_pppoe.c	Mon Feb 10 22:38:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.148 2020/01/29 04:28:27 thorpej Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.149 2020/02/10 22:38:10 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.148 2020/01/29 04:28:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.149 2020/02/10 22:38:10 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -558,6 +558,7 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 	const char *err_msg;
 	char devname[IF_NAMESIZE];
 	char *error;
+	size_t dlen;
 	uint8_t *ac_cookie;
 	size_t ac_cookie_len;
 	uint8_t *relay_sid;
@@ -631,7 +632,8 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 			break;	/* ignored */
 		case PPPOE_TAG_ACNAME:
 			if (len > 0) {
-error = malloc(len + 1, M_TEMP, M_NOWAIT);
+dlen = 4 * len + 1;
+error = malloc(dlen, M_TEMP, M_NOWAIT);
 if (error == NULL)
 	break;
 
@@ -643,7 +645,9 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 	goto done;
 }
 
-strlcpy(error, mtod(n, char*) + noff, len + 1);
+strnvisx(error, dlen,
+mtod(n, char*) + noff, len,
+VIS_SAFE | VIS_OCTAL);
 printf("pppoe: connected to %s\n", error);
 free(error, M_TEMP);
 			}
@@ -704,15 +708,17 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 		if (err_msg) {
 			error = NULL;
 			if (errortag && len) {
-error = malloc(len + 1, M_TEMP,
+dlen = 4 * len + 1;
+error = malloc(dlen, M_TEMP,
 M_NOWAIT|M_ZERO);
 n = m_pulldown(m, off + sizeof(*pt), len,
 );
 if (!n) {
 	m = NULL;
 } else if (error) {
-	strlcpy(error, mtod(n, char *) + noff,
-	len + 1);
+	strnvisx(error, dlen,
+	mtod(n, char*) + noff, len,
+	VIS_SAFE | VIS_OCTAL);
 }
 			}
 			if (error) {



CVS commit: src/sys/compat/netbsd32

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 22:33:28 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
Don't use strlcpy to copy untrusted input, it may not be NUL-terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/compat/netbsd32/netbsd32_ioctl.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.107 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.108
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.107	Sat Feb  1 02:23:03 2020
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Feb 10 22:33:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.107 2020/02/01 02:23:03 riastradh Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.108 2020/02/10 22:33:28 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.107 2020/02/01 02:23:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.108 2020/02/10 22:33:28 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -147,7 +147,7 @@ netbsd32_to_if_addrprefreq(const struct 
 struct if_addrprefreq *ifap, u_long cmd)
 {
 
-	strlcpy(ifap->ifap_name, ifap32->ifap_name, sizeof(ifap->ifap_name));
+	memcpy(ifap->ifap_name, ifap32->ifap_name, IFNAMSIZ+1);
 	ifap->ifap_preference = ifap32->ifap_preference;
 	memcpy(>ifap_addr, >ifap_addr,
 	uimin(ifap32->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -386,7 +386,7 @@ netbsd32_to_ieee80211req(struct netbsd32
 struct ieee80211req *ireq, u_long cmd)
 {
 
-	strlcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
+	memcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
 	ireq->i_type = ireq32->i_type;
 	ireq->i_val = ireq32->i_val;
 	ireq->i_len = ireq32->i_len;
@@ -399,7 +399,7 @@ netbsd32_to_ieee80211_nwkey(struct netbs
 {
 	int i;
 
-	strlcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
+	memcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
 	nwk->i_wepon = nwk32->i_wepon;
 	nwk->i_defkid = nwk32->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {
@@ -630,7 +630,7 @@ netbsd32_from_if_addrprefreq(const struc
 struct netbsd32_if_addrprefreq *ifap32, u_long cmd)
 {
 
-	strlcpy(ifap32->ifap_name, ifap->ifap_name, sizeof(ifap32->ifap_name));
+	memcpy(ifap32->ifap_name, ifap->ifap_name, IFNAMSIZ);
 	ifap32->ifap_preference = ifap->ifap_preference;
 	memcpy(>ifap_addr, >ifap_addr,
 	uimin(ifap->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -865,7 +865,7 @@ netbsd32_from_ieee80211req(struct ieee80
 struct netbsd32_ieee80211req *ireq32, u_long cmd)
 {
 
-	strlcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
+	memcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
 	ireq32->i_type = ireq->i_type;
 	ireq32->i_val = ireq->i_val;
 	ireq32->i_len = ireq->i_len;
@@ -878,7 +878,7 @@ netbsd32_from_ieee80211_nwkey(struct iee
 {
 	int i;
 
-	strlcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
+	memcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
 	nwk32->i_wepon = nwk->i_wepon;
 	nwk32->i_defkid = nwk->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {



CVS commit: src/sys/compat/netbsd32

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 22:33:28 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
Don't use strlcpy to copy untrusted input, it may not be NUL-terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/compat/netbsd32/netbsd32_ioctl.c

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



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

2020-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 10 22:13:50 UTC 2020

Modified Files:
src/sys/arch/i386/i386: locore.S

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/i386/i386/locore.S

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



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

2020-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 10 22:13:50 UTC 2020

Modified Files:
src/sys/arch/i386/i386: locore.S

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/i386/i386/locore.S

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

Modified files:

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.177 src/sys/arch/i386/i386/locore.S:1.178
--- src/sys/arch/i386/i386/locore.S:1.177	Wed Jan 15 18:47:23 2020
+++ src/sys/arch/i386/i386/locore.S	Mon Feb 10 22:13:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.177 2020/01/15 18:47:23 ad Exp $	*/
+/*	$NetBSD: locore.S,v 1.178 2020/02/10 22:13:50 skrll Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.177 2020/01/15 18:47:23 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.178 2020/02/10 22:13:50 skrll Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1289,8 +1289,8 @@ END(dumpsys)
  * struct lwp *cpu_switchto(struct lwp *oldlwp, struct lwp *newlwp,
  * bool returning)
  *
- *	1. if (oldlwp != NULL), save its context.
- *	2. then, restore context of newlwp.
+ *	1. save context of oldlwp.
+ *	2. restore context of newlwp.
  *
  * Note that the stack frame layout is known to "struct switchframe" in
  *  and to the code in cpu_lwp_fork() which initializes



CVS commit: src/sys/kern

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 22:13:01 UTC 2020

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

Log Message:
- check for errors in exec_resolvename() and fail
- put back the compat_linux modules in the exec array (commented out)
- remove extra parens


To generate a diff of this commit:
cvs rdiff -u -r1.490 -r1.491 src/sys/kern/kern_exec.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.490 src/sys/kern/kern_exec.c:1.491
--- src/sys/kern/kern_exec.c:1.490	Wed Jan 29 10:47:52 2020
+++ src/sys/kern/kern_exec.c	Mon Feb 10 17:13:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.490 2020/01/29 15:47:52 ad Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.491 2020/02/10 22:13:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.490 2020/01/29 15:47:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.491 2020/02/10 22:13:01 christos Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -316,7 +316,7 @@ exec_path_free(struct execve_data *data)
 		PNBUF_PUT(data->ed_resolvedname);
 }
 
-static void
+static int
 exec_resolvename(struct lwp *l, struct exec_package *epp, struct vnode *vp,
 char **rpath)
 {
@@ -328,13 +328,16 @@ exec_resolvename(struct lwp *l, struct e
 	*rpath = PNBUF_GET();
 	error = vnode_to_path(*rpath, MAXPATHLEN, vp, l, l->l_proc);
 	if (error) {
+		DPRINTF(("%s: can't resolve name for %s, error %d\n",
+		__func__, epp->ep_kname, error));
 		PNBUF_PUT(*rpath);
 		*rpath = NULL;
-		return;
+		return error;
 	}
 	epp->ep_resolvedname = *rpath;
 	if ((p = strrchr(*rpath, '/')) != NULL)
 		epp->ep_kname = p + 1;
+	return 0;
 }
 
 
@@ -396,7 +399,8 @@ check_exec(struct lwp *l, struct exec_pa
 		epp->ep_vp = vp = fp->f_vnode;
 		vref(vp);
 		fd_putfile(epp->ep_xfd);
-		exec_resolvename(l, epp, vp, rpath);
+		if ((error = exec_resolvename(l, epp, vp, rpath)) != 0)
+			return error;
 		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	}
 
@@ -633,6 +637,10 @@ exec_autoload(void)
 		"exec_ecoff",
 		"compat_aoutm68k",
 		"compat_netbsd32",
+#if 0
+		"compat_linux",
+		"compat_linux32",
+#endif
 		"compat_sunos",
 		"compat_sunos32",
 		"compat_ultrix",
@@ -641,7 +649,7 @@ exec_autoload(void)
 	char const * const *list;
 	int i;
 
-	list = (nexecs == 0 ? native : compat);
+	list = nexecs == 0 ? native : compat;
 	for (i = 0; list[i] != NULL; i++) {
 		if (module_autoload(list[i], MODULE_CLASS_EXEC) != 0) {
 			continue;



CVS commit: src/sys/kern

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 22:13:01 UTC 2020

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

Log Message:
- check for errors in exec_resolvename() and fail
- put back the compat_linux modules in the exec array (commented out)
- remove extra parens


To generate a diff of this commit:
cvs rdiff -u -r1.490 -r1.491 src/sys/kern/kern_exec.c

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



CVS commit: src/sys/kern

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 22:11:09 UTC 2020

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

Log Message:
Put back the delay hooks which were deleted before. Without them VirtualBox
spins out.


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

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

Modified files:

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.168 src/sys/kern/kern_lock.c:1.169
--- src/sys/kern/kern_lock.c:1.168	Mon Jan 27 16:05:43 2020
+++ src/sys/kern/kern_lock.c	Mon Feb 10 17:11:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.168 2020/01/27 21:05:43 ad Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.169 2020/02/10 22:11:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.168 2020/01/27 21:05:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.169 2020/02/10 22:11:09 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -243,6 +243,8 @@ _kernel_lock(int nlocks)
 if (!start_init_exec)
 	_KERNEL_LOCK_ABORT("spinout");
 			}
+			SPINLOCK_BACKOFF_HOOK;
+			SPINLOCK_SPIN_HOOK;
 #endif
 		}
 		s = splvm();



CVS commit: src/sys/kern

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 22:11:09 UTC 2020

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

Log Message:
Put back the delay hooks which were deleted before. Without them VirtualBox
spins out.


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

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-02-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Feb 10 21:54:26 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_opregion.c

Log Message:
Use a closer equivalent to MEMREMAP_WB: BUS_SPACE_MAP_CACHEABLE

Not a fix for PR port-amd64/54808


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-02-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Feb 10 21:54:26 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_opregion.c

Log Message:
Use a closer equivalent to MEMREMAP_WB: BUS_SPACE_MAP_CACHEABLE

Not a fix for PR port-amd64/54808


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.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/i915/intel_opregion.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.14 src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.14	Mon Aug 27 13:54:48 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c	Mon Feb 10 21:54:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_opregion.c,v 1.14 2018/08/27 13:54:48 riastradh Exp $	*/
+/*	$NetBSD: intel_opregion.c,v 1.15 2020/02/10 21:54:26 maya Exp $	*/
 
 /*
  * Copyright 2008 Intel Corporation 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.14 2018/08/27 13:54:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.15 2020/02/10 21:54:26 maya Exp $");
 
 #include 
 #include 
@@ -997,7 +997,7 @@ int intel_opregion_setup(struct drm_devi
 #ifdef __NetBSD__
 	opregion->bst = dev->pdev->pd_pa.pa_memt;
 	err = -bus_space_map(opregion->bst, asls, OPREGION_SIZE,
-	BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, >bsh);
+	BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_CACHEABLE, >bsh);
 	if (err) {
 		DRM_DEBUG_DRIVER("Failed to map opregion: %d\n", err);
 		return err;



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

2020-02-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Feb 10 21:39:38 UTC 2020

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c defs.h disklabel.c
disks.c mbr.c msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
partman.c target.c txtwalk.c upgrade.c
src/usr.sbin/sysinst/arch/hp300 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mac68k [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mvme68k [netbsd-9]: md.c msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c msg.md.en

Log Message:
Pull up following revision(s) (requested by martin in ticket #693):
usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.c: revision 1.10
usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.2
usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.3
usr.sbin/sysinst/msg.mi.en: revision 1.28
usr.sbin/sysinst/arch/hp300/md.c: revision 1.10
usr.sbin/sysinst/msg.mi.es: revision 1.22
usr.sbin/sysinst/target.c: revision 1.12
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.10
usr.sbin/sysinst/arch/i386/md.c: revision 1.30
usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.3
usr.sbin/sysinst/bsddisklabel.c: revision 1.39
usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.9
usr.sbin/sysinst/disklabel.c: revision 1.35
usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.3
usr.sbin/sysinst/defs.h: revision 1.55
usr.sbin/sysinst/disks.c: revision 1.63
usr.sbin/sysinst/disks.c: revision 1.64
usr.sbin/sysinst/mbr.c: revision 1.31
usr.sbin/sysinst/disks.c: revision 1.65
usr.sbin/sysinst/txtwalk.c: revision 1.3
usr.sbin/sysinst/txtwalk.c: revision 1.4
usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.2
usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.3
usr.sbin/sysinst/msg.mi.fr: revision 1.26
usr.sbin/sysinst/msg.mi.pl: revision 1.29
usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.2
usr.sbin/sysinst/upgrade.c: revision 1.15
usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.3
usr.sbin/sysinst/upgrade.c: revision 1.16
usr.sbin/sysinst/partman.c: revision 1.50
usr.sbin/sysinst/msg.mi.de: revision 1.21
remove unused "emptypart" message (or moved to ifdef notyet area)
PR install/54921: message "ordering" takes a %s argument.
PR install/54921: skip non-user partitions when checking for overlaps
bootxx_name() - fix oversight in previous change (do not assume first
partition is the root partition)
PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).
Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.
Deal with partitioning schemes having no inner counterpart.
Avoid NULL derefs.
Do not assum a partitioning scheme that supports innner partitions always
needs to actually have such partitions defined.
PR bin/54944: deal with escaped spaces in NAME= syntax in /etc/fstab.
PR bin/54944: explicitly reject GPT protective MBRs.
PR bin/54944: make the "explicit single wedge" selection also work for
upgrades.
Reformat a query to add an automatically detected swap partition
so it fits on narrow screens.
Make re-install sets also work for an explicit selected root wedge
Fix copy in previous - from kre.
Only a single partition can ever have the "extend" flag (grow to available
size).
Do not use -P for tar extractions - the in tree tar has been fixed.
Finish conversion to generic partitioning backend


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.9 -r1.23.2.10 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.42.2.6 -r1.42.2.7 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.8 -r1.10.2.9 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.13 -r1.44.2.14 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.7 -r1.19.2.8 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.6 -r1.14.2.7 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.7 -r1.17.2.8 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.7 -r1.20.2.8 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.41.2.4 -r1.41.2.5 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 

CVS commit: [netbsd-9] src/doc

2020-02-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Feb 10 21:40:19 UTC 2020

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

Log Message:
ticket 693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.174 -r1.1.2.175 src/doc/CHANGES-9.0

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



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

2020-02-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Feb 10 21:39:38 UTC 2020

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: bsddisklabel.c defs.h disklabel.c
disks.c mbr.c msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
partman.c target.c txtwalk.c upgrade.c
src/usr.sbin/sysinst/arch/hp300 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mac68k [netbsd-9]: md.c
src/usr.sbin/sysinst/arch/mvme68k [netbsd-9]: md.c msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/x68k [netbsd-9]: md.c msg.md.en

Log Message:
Pull up following revision(s) (requested by martin in ticket #693):
usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.c: revision 1.10
usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.2
usr.sbin/sysinst/arch/x68k/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/mvme68k/msg.md.fr: revision 1.3
usr.sbin/sysinst/msg.mi.en: revision 1.28
usr.sbin/sysinst/arch/hp300/md.c: revision 1.10
usr.sbin/sysinst/msg.mi.es: revision 1.22
usr.sbin/sysinst/target.c: revision 1.12
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.10
usr.sbin/sysinst/arch/i386/md.c: revision 1.30
usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/mvme68k/msg.md.pl: revision 1.3
usr.sbin/sysinst/bsddisklabel.c: revision 1.39
usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.9
usr.sbin/sysinst/disklabel.c: revision 1.35
usr.sbin/sysinst/arch/mvme68k/msg.md.de: revision 1.3
usr.sbin/sysinst/defs.h: revision 1.55
usr.sbin/sysinst/disks.c: revision 1.63
usr.sbin/sysinst/disks.c: revision 1.64
usr.sbin/sysinst/mbr.c: revision 1.31
usr.sbin/sysinst/disks.c: revision 1.65
usr.sbin/sysinst/txtwalk.c: revision 1.3
usr.sbin/sysinst/txtwalk.c: revision 1.4
usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.2
usr.sbin/sysinst/arch/mvme68k/msg.md.en: revision 1.3
usr.sbin/sysinst/msg.mi.fr: revision 1.26
usr.sbin/sysinst/msg.mi.pl: revision 1.29
usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.2
usr.sbin/sysinst/upgrade.c: revision 1.15
usr.sbin/sysinst/arch/mvme68k/msg.md.es: revision 1.3
usr.sbin/sysinst/upgrade.c: revision 1.16
usr.sbin/sysinst/partman.c: revision 1.50
usr.sbin/sysinst/msg.mi.de: revision 1.21
remove unused "emptypart" message (or moved to ifdef notyet area)
PR install/54921: message "ordering" takes a %s argument.
PR install/54921: skip non-user partitions when checking for overlaps
bootxx_name() - fix oversight in previous change (do not assume first
partition is the root partition)
PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).
Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.
Deal with partitioning schemes having no inner counterpart.
Avoid NULL derefs.
Do not assum a partitioning scheme that supports innner partitions always
needs to actually have such partitions defined.
PR bin/54944: deal with escaped spaces in NAME= syntax in /etc/fstab.
PR bin/54944: explicitly reject GPT protective MBRs.
PR bin/54944: make the "explicit single wedge" selection also work for
upgrades.
Reformat a query to add an automatically detected swap partition
so it fits on narrow screens.
Make re-install sets also work for an explicit selected root wedge
Fix copy in previous - from kre.
Only a single partition can ever have the "extend" flag (grow to available
size).
Do not use -P for tar extractions - the in tree tar has been fixed.
Finish conversion to generic partitioning backend


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.9 -r1.23.2.10 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.42.2.6 -r1.42.2.7 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.10.2.8 -r1.10.2.9 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.44.2.13 -r1.44.2.14 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.19.2.7 -r1.19.2.8 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.14.2.6 -r1.14.2.7 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.17.2.7 -r1.17.2.8 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.20.2.7 -r1.20.2.8 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.41.2.4 -r1.41.2.5 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 

CVS commit: [netbsd-9] src/doc

2020-02-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Feb 10 21:40:19 UTC 2020

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

Log Message:
ticket 693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.174 -r1.1.2.175 src/doc/CHANGES-9.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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.174 src/doc/CHANGES-9.0:1.1.2.175
--- src/doc/CHANGES-9.0:1.1.2.174	Mon Feb 10 19:32:47 2020
+++ src/doc/CHANGES-9.0	Mon Feb 10 21:40:19 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.174 2020/02/10 19:32:47 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.175 2020/02/10 21:40:19 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -8738,3 +8738,43 @@ external/bsd/libarchive/dist/libarchive/
 	hard links.
 	[christos, ticket #692]
 
+usr.sbin/sysinst/arch/hp300/md.c		1.10
+usr.sbin/sysinst/arch/i386/md.c			1.30
+usr.sbin/sysinst/arch/mac68k/md.c		1.9
+usr.sbin/sysinst/arch/mvme68k/md.c		1.10
+usr.sbin/sysinst/arch/mvme68k/msg.md.de		1.2, 1.3
+usr.sbin/sysinst/arch/mvme68k/msg.md.en		1.2, 1.3
+usr.sbin/sysinst/arch/mvme68k/msg.md.es		1.2, 1.3
+usr.sbin/sysinst/arch/mvme68k/msg.md.fr		1.2, 1.3
+usr.sbin/sysinst/arch/mvme68k/msg.md.pl		1.2, 1.3
+usr.sbin/sysinst/arch/x68k/md.c			1.10
+usr.sbin/sysinst/arch/x68k/msg.md.en		1.2, 1.3
+usr.sbin/sysinst/bsddisklabel.c			1.39
+usr.sbin/sysinst/defs.h1.55
+usr.sbin/sysinst/disklabel.c			1.35
+usr.sbin/sysinst/disks.c			1.63, 1.64, 1.65
+usr.sbin/sysinst/mbr.c1.31
+usr.sbin/sysinst/msg.mi.de			1.21
+usr.sbin/sysinst/msg.mi.en			1.28
+usr.sbin/sysinst/msg.mi.es			1.22
+usr.sbin/sysinst/msg.mi.fr			1.26
+usr.sbin/sysinst/msg.mi.pl			1.29
+usr.sbin/sysinst/partman.c			1.50
+usr.sbin/sysinst/target.c			1.12
+usr.sbin/sysinst/txtwalk.c			1.3, 1.4
+usr.sbin/sysinst/upgrade.c			1.15, 1.16
+
+	Fix various issues with the installer reported in RC2: 
+	 - PR 54921: broken diagnostic message
+	 - PR 54921: fix partition overlap check on some architectures
+	 - fix first stage bootloader name in some install setups
+	 - PR 54934: always use installboot -f
+	 - Avoid crashes when MBR partitions exist but there are no
+	   "inner" disklabel partitions
+	 - in upgrades deal with NAME= entries in /etc/fstab
+	 - PR 54944: explicitly reject GPT protective MBRs, make explicit
+	   root wedge selection work for upgrades and re-install sets.
+	 - Fix mac68k installations.
+	Miscelaneous minor cleanup and message reformatting.
+	[martin, ticket #693]
+



CVS commit: src/sys/dev/ic

2020-02-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Feb 10 20:11:48 UTC 2020

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

Log Message:
use wdc_maxdrives for atabus_alloc_drives() also in wdc_sataprobe()
instead of magic 1; no functional change, all wdc_sataprobe() users
actually set wdc_maxdrives to 1


To generate a diff of this commit:
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/ic/wdc.c

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



CVS commit: src/sys/dev/ic

2020-02-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Feb 10 20:11:48 UTC 2020

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

Log Message:
use wdc_maxdrives for atabus_alloc_drives() also in wdc_sataprobe()
instead of magic 1; no functional change, all wdc_sataprobe() users
actually set wdc_maxdrives to 1


To generate a diff of this commit:
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/ic/wdc.c

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

Modified files:

Index: src/sys/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.296 src/sys/dev/ic/wdc.c:1.297
--- src/sys/dev/ic/wdc.c:1.296	Fri Dec 27 09:41:50 2019
+++ src/sys/dev/ic/wdc.c	Mon Feb 10 20:11:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.296 2019/12/27 09:41:50 msaitoh Exp $ */
+/*	$NetBSD: wdc.c,v 1.297 2020/02/10 20:11:48 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.296 2019/12/27 09:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.297 2020/02/10 20:11:48 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -203,6 +203,7 @@ wdc_allocate_regs(struct wdc_softc *wdc)
 void
 wdc_sataprobe(struct ata_channel *chp)
 {
+	struct wdc_softc *wdc = CHAN_TO_WDC(chp);
 	struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
 	uint8_t st = 0, sc __unused, sn __unused, cl, ch;
 	int i;
@@ -243,7 +244,7 @@ wdc_sataprobe(struct ata_channel *chp)
 		"cl=0x%x ch=0x%x\n",
 		device_xname(chp->ch_atac->atac_dev), chp->ch_channel,
 		sc, sn, cl, ch), DEBUG_PROBE);
-		if (atabus_alloc_drives(chp, 1) != 0)
+		if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0)
 			return;
 		/*
 		 * sc and sn are supposed to be 0x1 for ATAPI, but in some



CVS commit: [netbsd-9] src/doc

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:32:47 UTC 2020

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

Log Message:
Tickets #680 - #686, #688 - #692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.173 -r1.1.2.174 src/doc/CHANGES-9.0

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

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:32:47 UTC 2020

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

Log Message:
Tickets #680 - #686, #688 - #692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.173 -r1.1.2.174 src/doc/CHANGES-9.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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.173 src/doc/CHANGES-9.0:1.1.2.174
--- src/doc/CHANGES-9.0:1.1.2.173	Fri Jan 31 12:19:17 2020
+++ src/doc/CHANGES-9.0	Mon Feb 10 19:32:47 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.173 2020/01/31 12:19:17 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.174 2020/02/10 19:32:47 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -8657,3 +8657,84 @@ sys/sys/param.h	(edited manually)
 
 	Welcome to 9.0_RC2 !
 
+sys/arch/arm/cortex/gicv3_its.c			1.25
+
+	Avoid crash if a driver tries to set affinity before a CPU is online.
+	[jmcneill, ticket #680]
+
+distrib/news68k/floppies/ramdisk/Makefile	1.38
+sys/arch/news68k/conf/INSTALL			1.66
+
+	Add and enable dhcpcd for news68k installation.
+	[tsutsui, ticket #681]
+
+distrib/sets/lists/comp/ad.m68k			1.63
+sys/arch/amiga/include/vmparam.h		1.48
+sys/arch/atari/include/vmparam.h		1.34
+sys/arch/cesfic/include/vmparam.h		1.19
+sys/arch/hp300/include/vmparam.h		1.41
+sys/arch/luna68k/include/vmparam.h		1.23
+sys/arch/m68k/include/Makefile			1.32
+sys/arch/m68k/include/vmparam.h			1.1
+sys/arch/mac68k/include/vmparam.h		1.46
+sys/arch/mvme68k/include/vmparam.h		1.38
+sys/arch/news68k/include/vmparam.h		1.23
+sys/arch/next68k/include/vmparam.h		1.27
+sys/arch/sun3/include/vmparam.h			1.38
+sys/arch/x68k/include/vmparam.h			1.40
+
+	Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for
+	jemalloc(3).
+	[tsutsui, ticket #682]
+
+sys/dev/usb/ehci.c1.269
+
+	Do not call usb_syncmem() for zero-length packets.
+	[mrg, ticket #683]
+
+bin/sh/jobs.c	1.107
+bin/sh/main.c	1.83-1.85
+
+	Make sure SIGCHLD is unblocked as well as SIG_DFL.
+	[kre, ticket #684]
+
+sys/arch/i386/stand/efiboot/eficons.c		1.8
+
+	Fix a few bugs related to the framebuffer and the "gop" command.
+	[jmcneill, ticket #685]
+
+sys/arch/i386/stand/efiboot/efiboot.c		1.12
+
+	Do not clear the screen before exiting boot services as this
+	may cause an undesired display mode switch.
+	[jmcneill, ticket #686]
+
+lib/libnvmm/libnvmm.31.26
+share/man/man4/nvmm.41.5
+sys/dev/nvmm/x86/nvmm_x86_vmx.c			1.47
+
+	PR 54847: fix harmless type issue.
+	Reference nvmmctl(8).
+	[maxv, ticket #688]
+
+share/mk/sys.mk	1.143
+
+	Do not special case aarch64 and add -fomit-frame-pointer to builds.
+	[maya, ticket #689]
+
+usr.bin/mkubootimage/mkubootimage.c		1.30
+
+	Fix image header size calculation.
+	[ryo, ticket #690]
+
+sys/arch/arm/arm32/pmap.c			1.374-1.379,1.383,1.385-1.387
+
+	Fix pmap_grow() and various cleanup.
+	[skrll, ticket #691]
+
+external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c 1.5
+
+	When extracting symlinks atomically remove them like we do for
+	hard links.
+	[christos, ticket #692]
+



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

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:30:00 UTC 2020

Modified Files:
src/external/bsd/libarchive/dist/libarchive [netbsd-9]:
archive_write_disk_posix.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #692):

external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c: 
revision 1.5

When extracting symlinks atomically remove them like we do for hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.2.1 -r1.1.1.2.2.2 \
src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.1.1.2.2.1 src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.1.1.2.2.2
--- src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.1.1.2.2.1	Tue Jan 21 15:48:51 2020
+++ src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c	Mon Feb 10 19:30:00 2020
@@ -2301,6 +2301,11 @@ create_filesystem_object(struct archive_
 		}
 		free(linkname_copy);
 		archive_string_free(_string);
+		/*
+		 * Unlinking and linking here is really not atomic,
+		 * but doing it right, would require us to construct
+		 * an mktemplink() function, and then use rename(2).
+		 */
 		if (a->flags & ARCHIVE_EXTRACT_ATOMIC)
 			unlink(a->name);
 		r = link(linkname, a->name) ? errno : 0;
@@ -2341,7 +2346,15 @@ create_filesystem_object(struct archive_
 	linkname = archive_entry_symlink(a->entry);
 	if (linkname != NULL) {
 #if HAVE_SYMLINK
-		int error = symlink(linkname, a->name) ? errno : 0;
+		int error;
+		/*
+		 * Unlinking and linking here is really not atomic,
+		 * but doing it right, would require us to construct
+		 * an mktempsymlink() function, and then use rename(2).
+		 */
+		if (a->flags & ARCHIVE_EXTRACT_ATOMIC)
+			unlink(a->name);
+		error = symlink(linkname, a->name) ? errno : 0;
 		if (error == 0) {
 #ifdef HAVE_LSTAT
 			r = lstat(a->name, );



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

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:30:00 UTC 2020

Modified Files:
src/external/bsd/libarchive/dist/libarchive [netbsd-9]:
archive_write_disk_posix.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #692):

external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c: 
revision 1.5

When extracting symlinks atomically remove them like we do for hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.2.1 -r1.1.1.2.2.2 \
src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c

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



CVS commit: [netbsd-9] src/sys/arch/arm/arm32

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:20:01 UTC 2020

Modified Files:
src/sys/arch/arm/arm32 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #691):

sys/arch/arm/arm32/pmap.c: revision 1.383
sys/arch/arm/arm32/pmap.c: revision 1.385
sys/arch/arm/arm32/pmap.c: revision 1.386
sys/arch/arm/arm32/pmap.c: revision 1.387
sys/arch/arm/arm32/pmap.c: revision 1.374
sys/arch/arm/arm32/pmap.c: revision 1.375
sys/arch/arm/arm32/pmap.c: revision 1.376
sys/arch/arm/arm32/pmap.c: revision 1.377
sys/arch/arm/arm32/pmap.c: revision 1.378
sys/arch/arm/arm32/pmap.c: revision 1.379

Convert a __CTASSERT into a KASSERT as L1_S_CACHE_MASK may not be a
compile time constant if ARM_NMMUS > 1

Improve a comment

Update PMAP_STEAL_MEMORY code to uvm_hotplug

Typo in comment

Fix a bug introduced in 1.271 where pmap_grow_map would no longer map
the allocated page for the uvm.page_init_done == false case when
PMAP_STEAL_MEMORY is not defined.

Trailing whitespace

Fix comment

Always pmap_kenter_pa the page in pmap_grow_map regardless of how we got
it.

Always call pmap_grow_map with a page aligned new VA.  KASSERT that this
happenes.

More KNF


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.373.2.1 src/sys/arch/arm/arm32/pmap.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/sys/arch/arm/arm32

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:20:01 UTC 2020

Modified Files:
src/sys/arch/arm/arm32 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #691):

sys/arch/arm/arm32/pmap.c: revision 1.383
sys/arch/arm/arm32/pmap.c: revision 1.385
sys/arch/arm/arm32/pmap.c: revision 1.386
sys/arch/arm/arm32/pmap.c: revision 1.387
sys/arch/arm/arm32/pmap.c: revision 1.374
sys/arch/arm/arm32/pmap.c: revision 1.375
sys/arch/arm/arm32/pmap.c: revision 1.376
sys/arch/arm/arm32/pmap.c: revision 1.377
sys/arch/arm/arm32/pmap.c: revision 1.378
sys/arch/arm/arm32/pmap.c: revision 1.379

Convert a __CTASSERT into a KASSERT as L1_S_CACHE_MASK may not be a
compile time constant if ARM_NMMUS > 1

Improve a comment

Update PMAP_STEAL_MEMORY code to uvm_hotplug

Typo in comment

Fix a bug introduced in 1.271 where pmap_grow_map would no longer map
the allocated page for the uvm.page_init_done == false case when
PMAP_STEAL_MEMORY is not defined.

Trailing whitespace

Fix comment

Always pmap_kenter_pa the page in pmap_grow_map regardless of how we got
it.

Always call pmap_grow_map with a page aligned new VA.  KASSERT that this
happenes.

More KNF


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.373.2.1 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.373 src/sys/arch/arm/arm32/pmap.c:1.373.2.1
--- src/sys/arch/arm/arm32/pmap.c:1.373	Tue Apr 23 11:21:21 2019
+++ src/sys/arch/arm/arm32/pmap.c	Mon Feb 10 19:20:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.373 2019/04/23 11:21:21 bouyer Exp $	*/
+/*	$NetBSD: pmap.c,v 1.373.2.1 2020/02/10 19:20:01 martin Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.373 2019/04/23 11:21:21 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.373.2.1 2020/02/10 19:20:01 martin Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -547,7 +547,7 @@ pmap_acquire_pmap_lock(pmap_t pm)
 	if (__predict_false(db_onproc != NULL))
 		return;
 #endif
-	
+
 	mutex_enter(pm->pm_lock);
 }
 
@@ -614,7 +614,7 @@ struct l1_ttable {
 /*
  * L1 Page Tables are tracked using a Least Recently Used list.
  *  - New L1s are allocated from the HEAD.
- *  - Freed L1s are added to the TAIl.
+ *  - Freed L1s are added to the TAIL.
  *  - Recently accessed L1s (where an 'access' is some change to one of
  *the userland pmaps which owns this L1) are moved to the TAIL.
  */
@@ -1096,7 +1096,7 @@ pmap_find_pv(struct vm_page_md *md, pmap
 			break;
 	}
 
-	return (pv);
+	return pv;
 }
 
 /*
@@ -1213,7 +1213,7 @@ pmap_modify_pv(struct vm_page_md *md, pa
 	KASSERT(!PV_IS_KENTRY_P(set_mask));
 
 	if ((npv = pmap_find_pv(md, pm, va)) == NULL)
-		return (0);
+		return 0;
 
 	NPDEBUG(PDB_PVDUMP,
 	printf("pmap_modify_pv: pm %p, md %p, clr 0x%x, set 0x%x, flags 0x%x\n", pm, md, clr_mask, set_mask, npv->pv_flags));
@@ -1287,7 +1287,7 @@ pmap_modify_pv(struct vm_page_md *md, pa
 
 	PMAPCOUNT(remappings);
 
-	return (oflags);
+	return oflags;
 }
 
 /*
@@ -1495,9 +1495,9 @@ pmap_get_l2_bucket(pmap_t pm, vaddr_t va
 
 	if ((l2 = pm->pm_l2[L2_IDX(l1slot)]) == NULL ||
 	(l2b = >l2_bucket[L2_BUCKET(l1slot)])->l2b_kva == NULL)
-		return (NULL);
+		return NULL;
 
-	return (l2b);
+	return l2b;
 }
 
 /*
@@ -1525,7 +1525,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vaddr_t 
 		 * Need to allocate a new l2_dtable.
 		 */
 		if ((l2 = pmap_alloc_l2_dtable()) == NULL)
-			return (NULL);
+			return NULL;
 
 		/*
 		 * Link it into the parent pmap
@@ -1555,7 +1555,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vaddr_t 
 pm->pm_l2[L2_IDX(l1slot)] = NULL;
 pmap_free_l2_dtable(l2);
 			}
-			return (NULL);
+			return NULL;
 		}
 
 		l2->l2_occupancy++;
@@ -1576,7 +1576,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vaddr_t 
 #endif
 	}
 
-	return (l2b);
+	return l2b;
 }
 
 /*
@@ -1712,7 +1712,7 @@ pmap_l2ptp_ctor(void *arg, void *v, int 
 
 	memset(v, 0, L2_TABLE_SIZE_REAL);
 	PTE_SYNC_RANGE(v, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t));
-	return (0);
+	return 0;
 }
 
 static int
@@ -1720,7 +1720,7 @@ pmap_l2dtable_ctor(void *arg, void *v, i
 {
 
 	memset(v, 0, sizeof(struct l2_dtable));
-	return (0);
+	return 0;
 }
 
 static int
@@ -1728,7 +1728,7 @@ pmap_pmap_ctor(void *arg, void *v, int f
 {
 
 	memset(v, 0, sizeof(struct pmap));
-	return (0);
+	return 0;
 }
 
 static void
@@ -1807,7 +1807,7 @@ pmap_get_vac_flags(const struct vm_page_
 	if (md->urw_mappings)
 		uidx |= 2;
 
-	return (pmap_vac_flags[uidx][kidx]);
+	return pmap_vac_flags[uidx][kidx];
 }
 
 static inline void
@@ -3021,7 +3021,7 @@ pmap_create(void)
 
 	pmap_pinit(pm);
 
-	return (pm);
+	return pm;
 }
 
 u_int
@@ -3251,7 +3251,7 @@ pmap_enter(pmap_t pm, 

CVS commit: [netbsd-9] src/usr.bin/mkubootimage

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:14:03 UTC 2020

Modified Files:
src/usr.bin/mkubootimage [netbsd-9]: mkubootimage.c

Log Message:
Pull up following revision(s) (requested by ryo in ticket #690):

usr.bin/mkubootimage/mkubootimage.c: revision 1.30

arm64_image_header->image_size must be included size of arm64_image_header.

with -u option, image_size should be binary (file) size (header included).
without -u option, image_size should be binary (file) size + header size.


To generate a diff of this commit:
cvs rdiff -u -r1.24.6.2 -r1.24.6.3 src/usr.bin/mkubootimage/mkubootimage.c

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

Modified files:

Index: src/usr.bin/mkubootimage/mkubootimage.c
diff -u src/usr.bin/mkubootimage/mkubootimage.c:1.24.6.2 src/usr.bin/mkubootimage/mkubootimage.c:1.24.6.3
--- src/usr.bin/mkubootimage/mkubootimage.c:1.24.6.2	Thu Jan  2 09:47:05 2020
+++ src/usr.bin/mkubootimage/mkubootimage.c	Mon Feb 10 19:14:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.24.6.2 2020/01/02 09:47:05 martin Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.24.6.3 2020/02/10 19:14:03 martin Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkubootimage.c,v 1.24.6.2 2020/01/02 09:47:05 martin Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.24.6.3 2020/02/10 19:14:03 martin Exp $");
 
 #include 
 #include 
@@ -391,7 +391,7 @@ generate_header_arm64(struct arm64_image
 #endif
 
 	const uint64_t dsize = update_image ?
-	   (uint64_t)st.st_size - sizeof(*hdr) : (uint64_t)st.st_size;
+	(uint64_t)st.st_size : (uint64_t)st.st_size + sizeof(*hdr);
 
 	memset(hdr, 0, sizeof(*hdr));
 	hdr->code0 = htole32(ARM64_CODE0);



CVS commit: [netbsd-9] src/usr.bin/mkubootimage

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:14:03 UTC 2020

Modified Files:
src/usr.bin/mkubootimage [netbsd-9]: mkubootimage.c

Log Message:
Pull up following revision(s) (requested by ryo in ticket #690):

usr.bin/mkubootimage/mkubootimage.c: revision 1.30

arm64_image_header->image_size must be included size of arm64_image_header.

with -u option, image_size should be binary (file) size (header included).
without -u option, image_size should be binary (file) size + header size.


To generate a diff of this commit:
cvs rdiff -u -r1.24.6.2 -r1.24.6.3 src/usr.bin/mkubootimage/mkubootimage.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/share/mk

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:07:22 UTC 2020

Modified Files:
src/share/mk [netbsd-9]: sys.mk

Log Message:
Pull up following revision(s) (requested by maya in ticket #689):

share/mk/sys.mk: revision 1.143

Don't special case aarch64 and add -fomit-frame-pointer to builds.

This behaviour is probably due to a past behaviour of clang, where it
always emitted frame pointer code.

This is no longer true for clang on netbsd, and I don't think it was true
for GCC.

Meanwhile, this flag bleeds into pkgsrc where it breaks random packages,
requiring workarounds like lang/ruby*-base/hacks.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/share/mk/sys.mk

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

Modified files:

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.139.2.1 src/share/mk/sys.mk:1.139.2.2
--- src/share/mk/sys.mk:1.139.2.1	Tue Dec 24 17:32:20 2019
+++ src/share/mk/sys.mk	Mon Feb 10 19:07:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.139.2.1 2019/12/24 17:32:20 martin Exp $
+#	$NetBSD: sys.mk,v 1.139.2.2 2020/02/10 19:07:22 martin Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -33,8 +33,6 @@ DBG?=	-Os -freorder-blocks
 DBG?=	-O2 -fno-reorder-blocks
 .elif ${MACHINE_ARCH} == "coldfire"
 DBG?=	-O1
-.elif !empty(MACHINE_ARCH:Maarch64*)
-DBG?=	-O2 ${"${.TARGET:M*.po}" == "":? -fomit-frame-pointer:}
 .else
 DBG?=	-O2
 .endif



CVS commit: [netbsd-9] src/share/mk

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:07:22 UTC 2020

Modified Files:
src/share/mk [netbsd-9]: sys.mk

Log Message:
Pull up following revision(s) (requested by maya in ticket #689):

share/mk/sys.mk: revision 1.143

Don't special case aarch64 and add -fomit-frame-pointer to builds.

This behaviour is probably due to a past behaviour of clang, where it
always emitted frame pointer code.

This is no longer true for clang on netbsd, and I don't think it was true
for GCC.

Meanwhile, this flag bleeds into pkgsrc where it breaks random packages,
requiring workarounds like lang/ruby*-base/hacks.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/share/mk/sys.mk

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



CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:05:05 UTC 2020

Modified Files:
src/lib/libnvmm [netbsd-9]: libnvmm.3
src/share/man/man4 [netbsd-9]: nvmm.4
src/sys/dev/nvmm/x86 [netbsd-9]: nvmm_x86_vmx.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #688):

share/man/man4/nvmm.4: revision 1.5
lib/libnvmm/libnvmm.3: revision 1.26
sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.47

Mmh, as noted in PR/54847, this should be uint64_t, not uint16_t. Harmless
because we use only the two lowest bits anyway.

I believe this could be caught by KUBSAN; time to do another round of
NVMM+K_SAN testing.

Reference nvmmctl(8).


To generate a diff of this commit:
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 src/lib/libnvmm/libnvmm.3
cvs rdiff -u -r1.4 -r1.4.4.1 src/share/man/man4/nvmm.4
cvs rdiff -u -r1.36.2.4 -r1.36.2.5 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

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

Modified files:

Index: src/lib/libnvmm/libnvmm.3
diff -u src/lib/libnvmm/libnvmm.3:1.19.4.1 src/lib/libnvmm/libnvmm.3:1.19.4.2
--- src/lib/libnvmm/libnvmm.3:1.19.4.1	Sun Nov 10 12:58:30 2019
+++ src/lib/libnvmm/libnvmm.3	Mon Feb 10 19:05:05 2020
@@ -1,6 +1,6 @@
-.\"	$NetBSD: libnvmm.3,v 1.19.4.1 2019/11/10 12:58:30 martin Exp $
+.\"	$NetBSD: libnvmm.3,v 1.19.4.2 2020/02/10 19:05:05 martin Exp $
 .\"
-.\" Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 28, 2019
+.Dd February 9, 2020
 .Dt LIBNVMM 3
 .Os
 .Sh NAME
@@ -733,7 +733,8 @@ A query was made on a machine or a VCPU 
 An attempt was made to access a machine that does not belong to the process.
 .El
 .Sh SEE ALSO
-.Xr nvmm 4
+.Xr nvmm 4 ,
+.Xr nvmmctl 8
 .Sh AUTHORS
 NVMM was designed and implemented by
 .An Maxime Villard .

Index: src/share/man/man4/nvmm.4
diff -u src/share/man/man4/nvmm.4:1.4 src/share/man/man4/nvmm.4:1.4.4.1
--- src/share/man/man4/nvmm.4:1.4	Thu Mar 28 19:00:40 2019
+++ src/share/man/man4/nvmm.4	Mon Feb 10 19:05:05 2020
@@ -1,6 +1,6 @@
-.\"	$NetBSD: nvmm.4,v 1.4 2019/03/28 19:00:40 maxv Exp $
+.\"	$NetBSD: nvmm.4,v 1.4.4.1 2020/02/10 19:05:05 martin Exp $
 .\"
-.\" Copyright (c) 2018 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 28, 2019
+.Dd February 9, 2020
 .Dt NVMM 4
 .Os
 .Sh NAME
@@ -54,7 +54,8 @@ x86-SVM, for x86 AMD CPUs
 x86-VMX, for x86 Intel CPUs
 .El
 .Sh SEE ALSO
-.Xr libnvmm 3
+.Xr libnvmm 3 ,
+.Xr nvmmctl 8
 .Sh AUTHORS
 The
 .Nm

Index: src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36.2.4 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36.2.5
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36.2.4	Mon Nov 25 16:39:30 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Mon Feb 10 19:05:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.36.2.4 2019/11/25 16:39:30 martin Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.36.2.5 2020/02/10 19:05:05 martin Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36.2.4 2019/11/25 16:39:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36.2.5 2020/02/10 19:05:05 martin Exp $");
 
 #include 
 #include 
@@ -1690,7 +1690,7 @@ vmx_exit_xsetbv(struct nvmm_machine *mac
 struct nvmm_vcpu_exit *exit)
 {
 	struct vmx_cpudata *cpudata = vcpu->cpudata;
-	uint16_t val;
+	uint64_t val;
 
 	exit->reason = NVMM_VCPU_EXIT_NONE;
 



CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 19:05:05 UTC 2020

Modified Files:
src/lib/libnvmm [netbsd-9]: libnvmm.3
src/share/man/man4 [netbsd-9]: nvmm.4
src/sys/dev/nvmm/x86 [netbsd-9]: nvmm_x86_vmx.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #688):

share/man/man4/nvmm.4: revision 1.5
lib/libnvmm/libnvmm.3: revision 1.26
sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.47

Mmh, as noted in PR/54847, this should be uint64_t, not uint16_t. Harmless
because we use only the two lowest bits anyway.

I believe this could be caught by KUBSAN; time to do another round of
NVMM+K_SAN testing.

Reference nvmmctl(8).


To generate a diff of this commit:
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 src/lib/libnvmm/libnvmm.3
cvs rdiff -u -r1.4 -r1.4.4.1 src/share/man/man4/nvmm.4
cvs rdiff -u -r1.36.2.4 -r1.36.2.5 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/aarch64

2020-02-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Feb 10 19:04:02 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
use LIST(3) instead of TAILQ(3) to save one word in struct vm_page and struct 
pmap.

pointed out by riastradh@. thanks


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/include/pmap.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/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.63 src/sys/arch/aarch64/aarch64/pmap.c:1.64
--- src/sys/arch/aarch64/aarch64/pmap.c:1.63	Mon Feb  3 13:37:01 2020
+++ src/sys/arch/aarch64/aarch64/pmap.c	Mon Feb 10 19:04:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.63 2020/02/03 13:37:01 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.64 2020/02/10 19:04:01 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63 2020/02/03 13:37:01 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.64 2020/02/10 19:04:01 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -189,13 +189,13 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
 #define VM_PAGE_TO_PP(pg)	(&(pg)->mdpage.mdpg_pp)
 
 struct pv_entry {
-	TAILQ_ENTRY(pv_entry) pv_link;
+	LIST_ENTRY(pv_entry) pv_link;
 	struct pmap *pv_pmap;
 	vaddr_t pv_va;
 	paddr_t pv_pa;		/* debug */
 	pt_entry_t *pv_ptep;	/* for fast pte lookup */
 };
-#define pv_next	pv_link.tqe_next
+#define pv_next	pv_link.le_next
 
 #define L3INDEXMASK	(L3_SIZE * Ln_ENTRIES - 1)
 #define PDPSWEEP_TRIGGER	512
@@ -496,7 +496,7 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 	kpm->pm_l0table = l0;
 	kpm->pm_l0table_pa = l0pa;
 	kpm->pm_activated = true;
-	TAILQ_INIT(>pm_vmlist);
+	LIST_INIT(>pm_vmlist);
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_VM);
 
 	CTASSERT(sizeof(kpm->pm_stats.wired_count) == sizeof(long));
@@ -639,7 +639,7 @@ pmap_alloc_pdp(struct pmap *pm, struct v
 			return POOL_PADDR_INVALID;
 		}
 
-		TAILQ_INSERT_HEAD(>pm_vmlist, pg, mdpage.mdpg_vmlist);
+		LIST_INSERT_HEAD(>pm_vmlist, pg, mdpage.mdpg_vmlist);
 		pg->flags &= ~PG_BUSY;	/* never busy */
 		pg->wire_count = 1;	/* max = 1 + Ln_ENTRIES = 513 */
 		pa = VM_PAGE_TO_PHYS(pg);
@@ -666,7 +666,7 @@ pmap_alloc_pdp(struct pmap *pm, struct v
 static void
 pmap_free_pdp(struct pmap *pm, struct vm_page *pg)
 {
-	TAILQ_REMOVE(>pm_vmlist, pg, mdpage.mdpg_vmlist);
+	LIST_REMOVE(pg, mdpage.mdpg_vmlist);
 	pg->flags |= PG_BUSY;
 	pg->wire_count = 0;
 	VM_MDPAGE_INIT(pg);
@@ -686,7 +686,7 @@ _pmap_sweep_pdp(struct pmap *pm)
 	uint16_t wirecount __diagused;
 
 	nsweep = 0;
-	TAILQ_FOREACH_SAFE(pg, >pm_vmlist, mdpage.mdpg_vmlist, tmp) {
+	LIST_FOREACH_SAFE(pg, >pm_vmlist, mdpage.mdpg_vmlist, tmp) {
 		if (pg->wire_count != 1)
 			continue;
 
@@ -735,7 +735,7 @@ _pmap_free_pdp_all(struct pmap *pm)
 {
 	struct vm_page *pg, *tmp;
 
-	TAILQ_FOREACH_SAFE(pg, >pm_vmlist, mdpage.mdpg_vmlist, tmp) {
+	LIST_FOREACH_SAFE(pg, >pm_vmlist, mdpage.mdpg_vmlist, tmp) {
 		pmap_free_pdp(pm, pg);
 	}
 }
@@ -1037,9 +1037,9 @@ _pmap_remove_pv(struct pmap_page *pp, st
 	UVMHIST_LOG(pmaphist, "pp=%p, pm=%p, va=%llx, pte=%llx",
 	pp, pm, va, pte);
 
-	TAILQ_FOREACH(pv, >pp_pvhead, pv_link) {
+	LIST_FOREACH(pv, >pp_pvhead, pv_link) {
 		if ((pm == pv->pv_pmap) && (va == pv->pv_va)) {
-			TAILQ_REMOVE(>pp_pvhead, pv, pv_link);
+			LIST_REMOVE(pv, pv_link);
 			PMAP_COUNT(pv_remove);
 			break;
 		}
@@ -1102,7 +1102,7 @@ pv_dump(struct pmap_page *pp, void (*pr)
 	pr(" pp->pp_flags=%08x %s\n", pp->pp_flags,
 	str_vmflags(pp->pp_flags));
 
-	TAILQ_FOREACH(pv, >pp_pvhead, pv_link) {
+	LIST_FOREACH(pv, >pp_pvhead, pv_link) {
 		pr("  pv[%d] pv=%p\n",
 		i, pv);
 		pr("pv[%d].pv_pmap = %p (asid=%d)\n",
@@ -1131,7 +1131,7 @@ _pmap_enter_pv(struct pmap_page *pp, str
 	UVMHIST_LOG(pmaphist, "ptep=%p, flags=%08x", ptep, flags, 0, 0);
 
 	/* pv is already registered? */
-	TAILQ_FOREACH(pv, >pp_pvhead, pv_link) {
+	LIST_FOREACH(pv, >pp_pvhead, pv_link) {
 		if ((pm == pv->pv_pmap) && (va == pv->pv_va)) {
 			break;
 		}
@@ -1152,11 +1152,11 @@ _pmap_enter_pv(struct pmap_page *pp, str
 		pv->pv_pa = pa;
 		pv->pv_ptep = ptep;
 
-		TAILQ_INSERT_HEAD(>pp_pvhead, pv, pv_link);
+		LIST_INSERT_HEAD(>pp_pvhead, pv, pv_link);
 		PMAP_COUNT(pv_enter);
 
 #ifdef PMAP_PV_DEBUG
-		if (!TAILQ_EMPTY(>pp_pvhead)){
+		if (!LIST_EMPTY(>pp_pvhead)){
 			printf("pv %p alias added va=%016lx -> pa=%016lx\n",
 			pv, va, pa);
 			pv_dump(pp, printf);
@@ -1433,7 +1433,7 @@ pmap_create(void)
 	pm->pm_refcnt = 1;
 	pm->pm_idlepdp = 0;
 	pm->pm_asid = -1;
-	TAILQ_INIT(>pm_vmlist);
+	LIST_INIT(>pm_vmlist);
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_VM);
 
 	pm->pm_l0table_pa = pmap_alloc_pdp(pm, NULL, 0, true);
@@ -2043,7 +2043,7 @@ pmap_page_remove(struct 

CVS commit: src/sys/arch/aarch64

2020-02-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Feb 10 19:04:02 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
use LIST(3) instead of TAILQ(3) to save one word in struct vm_page and struct 
pmap.

pointed out by riastradh@. thanks


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/include/pmap.h

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



CVS commit: [netbsd-9] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:59:49 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-9]: efiboot.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #686):

sys/arch/i386/stand/efiboot/efiboot.c: revision 1.12

Do not clear the screen before exiting boot services as this may cause an
undesired display mode switch. PR# 54615


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/sys/arch/i386/stand/efiboot/efiboot.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/i386/stand/efiboot/efiboot.c
diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.10.2.1 src/sys/arch/i386/stand/efiboot/efiboot.c:1.10.2.2
--- src/sys/arch/i386/stand/efiboot/efiboot.c:1.10.2.1	Tue Sep 17 19:32:00 2019
+++ src/sys/arch/i386/stand/efiboot/efiboot.c	Mon Feb 10 18:59:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.c,v 1.10.2.1 2019/09/17 19:32:00 martin Exp $	*/
+/*	$NetBSD: efiboot.c,v 1.10.2.2 2020/02/10 18:59:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -112,8 +112,6 @@ efi_cleanup(void)
 	UINT32 DescriptorVersion;
 	size_t allocsz;
 
-	clearit();
-
 	memset(_efi, 0, sizeof(btinfo_efi));
 	btinfo_efi.systblpa = (intptr_t)ST;
 #ifdef	__i386__	/* bootia32.efi */



CVS commit: [netbsd-9] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:59:49 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-9]: efiboot.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #686):

sys/arch/i386/stand/efiboot/efiboot.c: revision 1.12

Do not clear the screen before exiting boot services as this may cause an
undesired display mode switch. PR# 54615


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/sys/arch/i386/stand/efiboot/efiboot.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/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:57:06 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-9]: eficons.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #685):

sys/arch/i386/stand/efiboot/eficons.c: revision 1.8

Fix a few bugs related to the framebuffer:
  - If a GOP mode wasn't explicitly requested, the bootloader was passing
fb info to the kernel even if the console was in text mode! This
results in garbled console output on at least ThinkPad T420 and
likely many others. If a mode isn't specified, default to 800x600.
  - The "gop" command was incorrectly parsing video modes in the form
WxHxD as WxWxD.
  - Allow a short form WxH for the "gop" command to select any mode with
the target dimensions.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.1 -r1.6.6.2 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.6.6.1 src/sys/arch/i386/stand/efiboot/eficons.c:1.6.6.2
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.6.6.1	Tue Sep 17 19:32:00 2019
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Mon Feb 10 18:57:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.6.6.1 2019/09/17 19:32:00 martin Exp $	*/
+/*	$NetBSD: eficons.c,v 1.6.6.2 2020/02/10 18:57:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -34,6 +34,10 @@
 #include "bootinfo.h"
 #include "vbe.h"
 
+#ifndef DEFAULT_GOP_MODE
+#define DEFAULT_GOP_MODE	"800x600"
+#endif
+
 extern struct x86_boot_params boot_params;
 
 struct btinfo_console btinfo_console;
@@ -71,6 +75,8 @@ static int efi_com_putc(int);
 static int efi_com_status(int);
 static int efi_com_waitforinputevent(uint64_t);
 
+static int efi_find_gop_mode(char *);
+
 static int iodev;
 static int (*internal_getchar)(void) = efi_cons_getc;
 static int (*internal_putchar)(int) = efi_cons_putc;
@@ -415,46 +421,36 @@ bi_framebuffer(void)
 	EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
 	struct btinfo_framebuffer fb;
 	INT32 bestmode = -1;
+	UINTN sz;
 
-	if (efi_gop == NULL) {
-		framebuffer_configure(NULL);
-		return;
-	}
+	if (efi_gop == NULL)
+		goto nofb;
 
 	if (efi_gop_mode >= 0) {
 		bestmode = efi_gop_mode;
 	} else {
-#if 0
-		UINT64 res, bestres = 0;
-		UINTN sz;
-		UINT32 i;
-
-		/* XXX EDID? EFI_EDID_DISCOVERED_PROTOCOL */
-		for (i = 0; i < efi_gop->Mode->MaxMode; i++) {
-			status = uefi_call_wrapper(efi_gop->QueryMode, 4,
-			efi_gop, i, , );
-			if (EFI_ERROR(status))
-continue;
+		/* If a mode has not been selected, choose a default */
+		bestmode = efi_find_gop_mode(DEFAULT_GOP_MODE);
+	}
+	if (bestmode == -1)
+		goto nofb;
 
-			res = (UINT64)info->HorizontalResolution *
-			(UINT64)info->VerticalResolution *
-			(UINT64)getdepth(info);
-			if (res > bestres) {
-bestmode = i;
-bestres = res;
-			}
-		}
-#endif
+	status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop,
+	bestmode);
+	if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode) {
+		printf("GOP setmode failed: %" PRIxMAX "\n",
+		(uintmax_t)status);
+		goto nofb;
 	}
-	if (bestmode >= 0) {
-		status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop,
-		bestmode);
-		if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode)
-			printf("GOP setmode failed: %" PRIxMAX "\n",
-			(uintmax_t)status);
+
+	status = uefi_call_wrapper(efi_gop->QueryMode, 4,
+	efi_gop, bestmode, , );
+	if (EFI_ERROR(status)) {
+		printf("GOP querymode failed: %" PRIxMAX "\n",
+		(uintmax_t)status);
+		goto nofb;
 	}
 
-	info = efi_gop->Mode->Info;
 	memset(, 0, sizeof(fb));
 	fb.physaddr = efi_gop->Mode->FrameBufferBase;
 	fb.flags = 0;
@@ -499,6 +495,10 @@ bi_framebuffer(void)
 	}
 
 	framebuffer_configure();
+	return;
+
+nofb:
+	framebuffer_configure(NULL);
 }
 
 int
@@ -658,10 +658,16 @@ efi_find_gop_mode(char *arg)
 
 		snprintf(mode, sizeof(mode), "%lux%lux%u",
 		(long)info->HorizontalResolution,
-		(long)info->HorizontalResolution,
+		(long)info->VerticalResolution,
 		depth);
 		if (strcmp(arg, mode) == 0)
 			return i;
+
+		snprintf(mode, sizeof(mode), "%lux%lu",
+		(long)info->HorizontalResolution,
+		(long)info->VerticalResolution);
+		if (strcmp(arg, mode) == 0)
+			return i;
 	}
 	return -1;
 }



CVS commit: [netbsd-9] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:57:06 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-9]: eficons.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #685):

sys/arch/i386/stand/efiboot/eficons.c: revision 1.8

Fix a few bugs related to the framebuffer:
  - If a GOP mode wasn't explicitly requested, the bootloader was passing
fb info to the kernel even if the console was in text mode! This
results in garbled console output on at least ThinkPad T420 and
likely many others. If a mode isn't specified, default to 800x600.
  - The "gop" command was incorrectly parsing video modes in the form
WxHxD as WxWxD.
  - Allow a short form WxH for the "gop" command to select any mode with
the target dimensions.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.1 -r1.6.6.2 src/sys/arch/i386/stand/efiboot/eficons.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/bin/sh

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:54:14 UTC 2020

Modified Files:
src/bin/sh [netbsd-9]: jobs.c main.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #684):

bin/sh/jobs.c: revision 1.107
bin/sh/main.c: revision 1.83
bin/sh/main.c: revision 1.84
bin/sh/main.c: revision 1.85

If we are invoked with SIGCHLD ignored, we fail badly, as we assume
that we can always wait(2) for our children, and an ignored SIGCHLD
prevents that.   Recent versions of bash can be convinced (due to a
bug most likely) to invoke us that way.   Always return SIGCHLD to
SIG_DFL during init - we already prevent scripts from fiddling it.

All ash derived shells apparently have this problem (observed by
Martijn Dekker, and notified on the bash-bug list).  Actual issue
diagnosed by Harald van Dijk (same list).

Actually, the issue with bash (in previous) is more likely that the
SIGCHLD is blocked rather than ignored.   We want neither.   Make sure
SIGCHLD is unblocked as well as SIG_DFL.

XXX pullup -9

bin/sh: Fixes -Werror=shadow causing build breaks.
Conflicting variable name, sigset_t sigs has been renamed to sigset_t mask

Reviewed by: kamil@

Avoid a core dump if a child process that is not one of our
children happens to exit while we are waiting for another child
to exit.

This can happen with code like
sh -c '
sleep 5 &
exec sh -c "sleep 10 & wait !$"
  '

when the inner "sh" is waiting for the 10 second sleep to be
done, the 5 second sleep started earlier terminates.   It is
a child of our process, as the inner shell is the same process
as the outer one, but not a known child (the inner shell has no
idea what the outer one did before it started).

This was observed in the wild by Martijn Dekker (where the outer
shell was bash but that's irrelevant).

XXX pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.106.2.1 src/bin/sh/jobs.c
cvs rdiff -u -r1.82 -r1.82.2.1 src/bin/sh/main.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/bin/sh

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:54:14 UTC 2020

Modified Files:
src/bin/sh [netbsd-9]: jobs.c main.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #684):

bin/sh/jobs.c: revision 1.107
bin/sh/main.c: revision 1.83
bin/sh/main.c: revision 1.84
bin/sh/main.c: revision 1.85

If we are invoked with SIGCHLD ignored, we fail badly, as we assume
that we can always wait(2) for our children, and an ignored SIGCHLD
prevents that.   Recent versions of bash can be convinced (due to a
bug most likely) to invoke us that way.   Always return SIGCHLD to
SIG_DFL during init - we already prevent scripts from fiddling it.

All ash derived shells apparently have this problem (observed by
Martijn Dekker, and notified on the bash-bug list).  Actual issue
diagnosed by Harald van Dijk (same list).

Actually, the issue with bash (in previous) is more likely that the
SIGCHLD is blocked rather than ignored.   We want neither.   Make sure
SIGCHLD is unblocked as well as SIG_DFL.

XXX pullup -9

bin/sh: Fixes -Werror=shadow causing build breaks.
Conflicting variable name, sigset_t sigs has been renamed to sigset_t mask

Reviewed by: kamil@

Avoid a core dump if a child process that is not one of our
children happens to exit while we are waiting for another child
to exit.

This can happen with code like
sh -c '
sleep 5 &
exec sh -c "sleep 10 & wait !$"
  '

when the inner "sh" is waiting for the 10 second sleep to be
done, the 5 second sleep started earlier terminates.   It is
a child of our process, as the inner shell is the same process
as the outer one, but not a known child (the inner shell has no
idea what the outer one did before it started).

This was observed in the wild by Martijn Dekker (where the outer
shell was bash but that's irrelevant).

XXX pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.106.2.1 src/bin/sh/jobs.c
cvs rdiff -u -r1.82 -r1.82.2.1 src/bin/sh/main.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/jobs.c
diff -u src/bin/sh/jobs.c:1.106 src/bin/sh/jobs.c:1.106.2.1
--- src/bin/sh/jobs.c:1.106	Tue Mar 26 13:32:26 2019
+++ src/bin/sh/jobs.c	Mon Feb 10 18:54:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.106 2019/03/26 13:32:26 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.106.2.1 2020/02/10 18:54:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.106 2019/03/26 13:32:26 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.106.2.1 2020/02/10 18:54:14 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -820,6 +820,9 @@ waitcmd(int argc, char **argv)
 			if ((i = dowait(WBLOCK|WNOFREE, NULL, )) == -1)
 			   return 128 + lastsig();
 
+			if (job == NULL)	/* an interloper */
+continue;
+
 			/*
 			 * one of the job's processes exited,
 			 * but there are more

Index: src/bin/sh/main.c
diff -u src/bin/sh/main.c:1.82 src/bin/sh/main.c:1.82.2.1
--- src/bin/sh/main.c:1.82	Sat Feb  9 09:33:20 2019
+++ src/bin/sh/main.c	Mon Feb 10 18:54:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.82 2019/02/09 09:33:20 kre Exp $	*/
+/*	$NetBSD: main.c,v 1.82.2.1 2020/02/10 18:54:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.7 (Berkeley) 7/19/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.82 2019/02/09 09:33:20 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.82.2.1 2020/02/10 18:54:14 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -108,6 +108,22 @@ main(int argc, char **argv)
 	char *shinit;
 	uid_t uid;
 	gid_t gid;
+	sigset_t mask;
+
+	/*
+	 * If we happen to be invoked with SIGCHLD ignored, we cannot
+	 * successfully do almost anything.   Perhaps we should remember
+	 * its state and pass it on ignored to children if it was ignored
+	 * on entry, but that seems like just leaving the shit on the
+	 * footpath for someone else to fall into...
+	 */
+	(void)signal(SIGCHLD, SIG_DFL);
+	/*
+	 * Similarly, SIGCHLD must not be blocked
+	 */
+	sigemptyset();
+	sigaddset(, SIGCHLD);
+	sigprocmask(SIG_UNBLOCK, , NULL);
 
 	uid = getuid();
 	gid = getgid();



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

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:50:29 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #683):

sys/dev/usb/ehci.c: revision 1.269

don't call usb_syncmem() for zero-length packets.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.267.2.1 src/sys/dev/usb/ehci.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/sys/dev/usb

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:50:29 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #683):

sys/dev/usb/ehci.c: revision 1.269

don't call usb_syncmem() for zero-length packets.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.267.2.1 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.267 src/sys/dev/usb/ehci.c:1.267.2.1
--- src/sys/dev/usb/ehci.c:1.267	Thu Jun 13 17:20:25 2019
+++ src/sys/dev/usb/ehci.c	Mon Feb 10 18:50:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.267 2019/06/13 17:20:25 maxv Exp $ */
+/*	$NetBSD: ehci.c,v 1.267.2.1 2020/02/10 18:50:29 martin Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267 2019/06/13 17:20:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.1 2020/02/10 18:50:29 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3946,8 +3946,9 @@ ehci_device_bulk_start(struct usbd_xfer 
 	DPRINTFN(5, "--- dump end ---", 0, 0, 0, 0);
 #endif
 
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
+	if (xfer->ux_length)
+		usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
+		isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
 
 	/* also does usb_syncmem(sqh) */
 	ehci_set_qh_qtd(sqh, exfer->ex_sqtdstart);
@@ -4020,8 +4021,9 @@ ehci_device_bulk_done(struct usbd_xfer *
 
 	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(>sc_lock));
 
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	rd ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+	if (xfer->ux_length)
+		usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
+		rd ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
 
 	DPRINTF("length=%jd", xfer->ux_actlen, 0, 0, 0);
 }
@@ -4163,8 +4165,9 @@ ehci_device_intr_start(struct usbd_xfer 
 	DPRINTFN(5, "--- dump end ---", 0, 0, 0, 0);
 #endif
 
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
+	if (xfer->ux_length)
+		usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
+		isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
 
 	/* also does usb_syncmem(sqh) */
 	ehci_set_qh_qtd(sqh, exfer->ex_sqtdstart);
@@ -4226,7 +4229,6 @@ ehci_device_intr_done(struct usbd_xfer *
 {
 	ehci_softc_t *sc __diagused = EHCI_XFER2SC(xfer);
 	struct ehci_pipe *epipe = EHCI_XFER2EPIPE(xfer);
-	int isread, endpt;
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
@@ -4234,10 +4236,14 @@ ehci_device_intr_done(struct usbd_xfer *
 
 	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(>sc_lock));
 
-	endpt = epipe->pipe.up_endpoint->ue_edesc->bEndpointAddress;
-	isread = UE_GET_DIR(endpt) == UE_DIR_IN;
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	isread ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+	if (xfer->ux_length) {
+		int isread, endpt;
+
+		endpt = epipe->pipe.up_endpoint->ue_edesc->bEndpointAddress;
+		isread = UE_GET_DIR(endpt) == UE_DIR_IN;
+		usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
+		isread ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+	}
 }
 
 //
@@ -4493,8 +4499,9 @@ ehci_device_fs_isoc_transfer(struct usbd
 	sizeof(sitd->sitd.sitd_trans),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
-	usb_syncmem(>ex_xfer.ux_dmabuf, 0, total_length,
-	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	if (total_length)
+		usb_syncmem(>ex_xfer.ux_dmabuf, 0, total_length,
+		BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
 	/*
 	 * Part 2: Transfer descriptors have now been set up, now they must
@@ -4601,8 +4608,9 @@ ehci_device_fs_isoc_done(struct usbd_xfe
 	epipe->isoc.cur_xfers--;
 	ehci_remove_sitd_chain(sc, exfer->ex_itdstart);
 
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
+	if (xfer->ux_length)
+		usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
+		BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 }
 
 /* -- */
@@ -4879,8 +4887,9 @@ ehci_device_isoc_transfer(struct usbd_xf
 		prev = itd;
 	} /* End of frame */
 
-	usb_syncmem(>ex_xfer.ux_dmabuf, 0, total_length,
-	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+	if (total_length)
+		usb_syncmem(>ex_xfer.ux_dmabuf, 0, total_length,
+		BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
 	/*
 	 * Part 2: Transfer descriptors have now been set up, now they must
@@ -4991,6 +5000,7 @@ ehci_device_isoc_done(struct usbd_xfer *
 
 	epipe->isoc.cur_xfers--;
 	ehci_remove_itd_chain(sc, exfer->ex_sitdstart);
-	usb_syncmem(>ux_dmabuf, 0, xfer->ux_length,
-	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
+	if (xfer->ux_length)
+		usb_syncmem(>ux_dmabuf, 0, 

CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:46:41 UTC 2020

Modified Files:
src/distrib/sets/lists/comp [netbsd-9]: ad.m68k
src/sys/arch/amiga/include [netbsd-9]: vmparam.h
src/sys/arch/atari/include [netbsd-9]: vmparam.h
src/sys/arch/cesfic/include [netbsd-9]: vmparam.h
src/sys/arch/hp300/include [netbsd-9]: vmparam.h
src/sys/arch/luna68k/include [netbsd-9]: vmparam.h
src/sys/arch/m68k/include [netbsd-9]: Makefile
src/sys/arch/mac68k/include [netbsd-9]: vmparam.h
src/sys/arch/mvme68k/include [netbsd-9]: vmparam.h
src/sys/arch/news68k/include [netbsd-9]: vmparam.h
src/sys/arch/next68k/include [netbsd-9]: vmparam.h
src/sys/arch/sun3/include [netbsd-9]: vmparam.h
src/sys/arch/x68k/include [netbsd-9]: vmparam.h
Added Files:
src/sys/arch/m68k/include [netbsd-9]: vmparam.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #682):

sys/arch/next68k/include/vmparam.h: revision 1.27
sys/arch/mac68k/include/vmparam.h: revision 1.46
sys/arch/sun3/include/vmparam.h: revision 1.38
sys/arch/m68k/include/vmparam.h: revision 1.1
sys/arch/hp300/include/vmparam.h: revision 1.41
sys/arch/m68k/include/Makefile: revision 1.32
sys/arch/amiga/include/vmparam.h: revision 1.48
distrib/sets/lists/comp/ad.m68k: revision 1.63
sys/arch/x68k/include/vmparam.h: revision 1.40
sys/arch/mvme68k/include/vmparam.h: revision 1.38
sys/arch/luna68k/include/vmparam.h: revision 1.23
sys/arch/news68k/include/vmparam.h: revision 1.23
sys/arch/atari/include/vmparam.h: revision 1.34
sys/arch/cesfic/include/vmparam.h: revision 1.19

Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
  but each port uses different PAGE_SIZE value (4096 or 8192)
  due to historical reasons.
- Currently module(7) binaries are built per each port so
  all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI  assumes that the port supports a variable
  PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
  are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
  src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
  among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
  support m68k ports where PAGE_SIZE==8192.
  (though this would affect only if static binaries built on
   4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.

For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in  only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
 https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.2.1 src/distrib/sets/lists/comp/ad.m68k
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/amiga/include/vmparam.h
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/arch/cesfic/include/vmparam.h
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/hp300/include/vmparam.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/luna68k/include/vmparam.h
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/arch/m68k/include/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/m68k/include/vmparam.h
cvs rdiff -u -r1.45 -r1.45.2.1 src/sys/arch/mac68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/next68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.37.42.1 src/sys/arch/sun3/include/vmparam.h
cvs rdiff -u -r1.39 -r1.39.2.1 src/sys/arch/x68k/include/vmparam.h

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



CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:46:41 UTC 2020

Modified Files:
src/distrib/sets/lists/comp [netbsd-9]: ad.m68k
src/sys/arch/amiga/include [netbsd-9]: vmparam.h
src/sys/arch/atari/include [netbsd-9]: vmparam.h
src/sys/arch/cesfic/include [netbsd-9]: vmparam.h
src/sys/arch/hp300/include [netbsd-9]: vmparam.h
src/sys/arch/luna68k/include [netbsd-9]: vmparam.h
src/sys/arch/m68k/include [netbsd-9]: Makefile
src/sys/arch/mac68k/include [netbsd-9]: vmparam.h
src/sys/arch/mvme68k/include [netbsd-9]: vmparam.h
src/sys/arch/news68k/include [netbsd-9]: vmparam.h
src/sys/arch/next68k/include [netbsd-9]: vmparam.h
src/sys/arch/sun3/include [netbsd-9]: vmparam.h
src/sys/arch/x68k/include [netbsd-9]: vmparam.h
Added Files:
src/sys/arch/m68k/include [netbsd-9]: vmparam.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #682):

sys/arch/next68k/include/vmparam.h: revision 1.27
sys/arch/mac68k/include/vmparam.h: revision 1.46
sys/arch/sun3/include/vmparam.h: revision 1.38
sys/arch/m68k/include/vmparam.h: revision 1.1
sys/arch/hp300/include/vmparam.h: revision 1.41
sys/arch/m68k/include/Makefile: revision 1.32
sys/arch/amiga/include/vmparam.h: revision 1.48
distrib/sets/lists/comp/ad.m68k: revision 1.63
sys/arch/x68k/include/vmparam.h: revision 1.40
sys/arch/mvme68k/include/vmparam.h: revision 1.38
sys/arch/luna68k/include/vmparam.h: revision 1.23
sys/arch/news68k/include/vmparam.h: revision 1.23
sys/arch/atari/include/vmparam.h: revision 1.34
sys/arch/cesfic/include/vmparam.h: revision 1.19

Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).

Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
  but each port uses different PAGE_SIZE value (4096 or 8192)
  due to historical reasons.
- Currently module(7) binaries are built per each port so
  all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI  assumes that the port supports a variable
  PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
  are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
  src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
  among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
  support m68k ports where PAGE_SIZE==8192.
  (though this would affect only if static binaries built on
   4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.

For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in  only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
 https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.2.1 src/distrib/sets/lists/comp/ad.m68k
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/amiga/include/vmparam.h
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/arch/cesfic/include/vmparam.h
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/hp300/include/vmparam.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/luna68k/include/vmparam.h
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/arch/m68k/include/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/m68k/include/vmparam.h
cvs rdiff -u -r1.45 -r1.45.2.1 src/sys/arch/mac68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/next68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.37.42.1 src/sys/arch/sun3/include/vmparam.h
cvs rdiff -u -r1.39 -r1.39.2.1 src/sys/arch/x68k/include/vmparam.h

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.m68k
diff -u src/distrib/sets/lists/comp/ad.m68k:1.61 src/distrib/sets/lists/comp/ad.m68k:1.61.2.1
--- src/distrib/sets/lists/comp/ad.m68k:1.61	Sat Jan 19 13:06:50 2019
+++ src/distrib/sets/lists/comp/ad.m68k	Mon Feb 10 18:46:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ad.m68k,v 1.61 2019/01/19 13:06:50 mrg Exp $
+# $NetBSD: ad.m68k,v 1.61.2.1 2020/02/10 18:46:40 martin Exp $
 ./usr/bin/elf2aoutcomp-sysutil-bin
 ./usr/include/gcc-4.5/math-68881.h		comp-c-include		obsolete
 ./usr/include/gcc-4.5/tgmath.h			comp-c-include		

CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:28:33 UTC 2020

Modified Files:
src/distrib/news68k/floppies/ramdisk [netbsd-9]: Makefile
src/sys/arch/news68k/conf [netbsd-9]: INSTALL

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #681):

distrib/news68k/floppies/ramdisk/Makefile: revision 1.38
sys/arch/news68k/conf/INSTALL: revision 1.66

Add and enable dhcpcd for news68k installation.
news68k has already required two floppies since 9.0
so there is no popular demand to shrink ramdisk.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/distrib/news68k/floppies/ramdisk/Makefile
cvs rdiff -u -r1.65 -r1.65.4.1 src/sys/arch/news68k/conf/INSTALL

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

Modified files:

Index: src/distrib/news68k/floppies/ramdisk/Makefile
diff -u src/distrib/news68k/floppies/ramdisk/Makefile:1.37 src/distrib/news68k/floppies/ramdisk/Makefile:1.37.2.1
--- src/distrib/news68k/floppies/ramdisk/Makefile:1.37	Fri Nov 16 17:07:42 2018
+++ src/distrib/news68k/floppies/ramdisk/Makefile	Mon Feb 10 18:28:33 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.37 2018/11/16 17:07:42 martin Exp $
+#	$NetBSD: Makefile,v 1.37.2.1 2020/02/10 18:28:33 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	1800k
+IMAGESIZE=	1856k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1
@@ -29,6 +29,7 @@ HACKSRC=	${DISTRIBDIR}/utils/libhack
 ${CRUNCHBIN}:	libhack.o
 
 .include "${DISTRIBDIR}/common/Makefile.crunch"
+.include "${DISTRIBDIR}/common/Makefile.dhcpcd"
 .include "${DISTRIBDIR}/common/Makefile.makedev"
 .include "${DISTRIBDIR}/common/Makefile.image"
 

Index: src/sys/arch/news68k/conf/INSTALL
diff -u src/sys/arch/news68k/conf/INSTALL:1.65 src/sys/arch/news68k/conf/INSTALL:1.65.4.1
--- src/sys/arch/news68k/conf/INSTALL:1.65	Fri Nov 16 17:07:10 2018
+++ src/sys/arch/news68k/conf/INSTALL	Mon Feb 10 18:28:33 2020
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.65 2018/11/16 17:07:10 martin Exp $
+# 	$NetBSD: INSTALL,v 1.65.4.1 2020/02/10 18:28:33 martin Exp $
 
 #	config for bootable floppy kernel
 #
@@ -18,7 +18,7 @@ options 	CPU_SINGLE		# Will IOP be suppo
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=3600	# 1.80 Megabytes
+options 	MEMORY_DISK_ROOT_SIZE=3712	# 1.85 Megabytes
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 # Standard system options
@@ -137,6 +137,7 @@ cd*	at scsibus? target ? lun ?		# SCSI C
 #romcons0 at mainbus0
 
 # Misc.
+pseudo-device	bpfilter		# Berkeley Packet Filter
 pseudo-device	loop			# loopback interface; required
 pseudo-device	pty			# pseudo-terminals
 pseudo-device	md			# memory disk device



CVS commit: [netbsd-9] src

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:28:33 UTC 2020

Modified Files:
src/distrib/news68k/floppies/ramdisk [netbsd-9]: Makefile
src/sys/arch/news68k/conf [netbsd-9]: INSTALL

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #681):

distrib/news68k/floppies/ramdisk/Makefile: revision 1.38
sys/arch/news68k/conf/INSTALL: revision 1.66

Add and enable dhcpcd for news68k installation.
news68k has already required two floppies since 9.0
so there is no popular demand to shrink ramdisk.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/distrib/news68k/floppies/ramdisk/Makefile
cvs rdiff -u -r1.65 -r1.65.4.1 src/sys/arch/news68k/conf/INSTALL

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



CVS commit: [netbsd-9] src/sys/arch/arm/cortex

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:17:57 UTC 2020

Modified Files:
src/sys/arch/arm/cortex [netbsd-9]: gicv3_its.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #680):

sys/arch/arm/cortex/gicv3_its.c: revision 1.25

Use kmem_zalloc for its state, fixes possible crash if a driver tries to
set affinity before a CPU is online.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.21 src/sys/arch/arm/cortex/gicv3_its.c:1.21.2.1
--- src/sys/arch/arm/cortex/gicv3_its.c:1.21	Sun Jun 30 17:33:59 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Mon Feb 10 18:17:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.21 2019/06/30 17:33:59 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.21.2.1 2020/02/10 18:17:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.21 2019/06/30 17:33:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.21.2.1 2020/02/10 18:17:57 martin Exp $");
 
 #include 
 #include 
@@ -846,7 +846,7 @@ gicv3_its_init(struct gicv3_softc *sc, b
 	if ((typer & GITS_TYPER_Physical) == 0)
 		return ENXIO;
 
-	its = kmem_alloc(sizeof(*its), KM_SLEEP);
+	its = kmem_zalloc(sizeof(*its), KM_SLEEP);
 	its->its_id = its_id;
 	its->its_bst = sc->sc_bst;
 	its->its_bsh = bsh;



CVS commit: [netbsd-9] src/sys/arch/arm/cortex

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 18:17:57 UTC 2020

Modified Files:
src/sys/arch/arm/cortex [netbsd-9]: gicv3_its.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #680):

sys/arch/arm/cortex/gicv3_its.c: revision 1.25

Use kmem_zalloc for its state, fixes possible crash if a driver tries to
set affinity before a CPU is online.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/arch/arm/cortex/gicv3_its.c

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

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:51:59 UTC 2020

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

Log Message:
Tickets #1498 and #1499


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-8.2

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.2
diff -u src/doc/CHANGES-8.2:1.1.2.93 src/doc/CHANGES-8.2:1.1.2.94
--- src/doc/CHANGES-8.2:1.1.2.93	Fri Jan 31 11:02:56 2020
+++ src/doc/CHANGES-8.2	Mon Feb 10 16:51:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.93 2020/01/31 11:02:56 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.94 2020/02/10 16:51:59 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -2004,3 +2004,14 @@ sys/netipsec/ipsecif.c1.19
 	Fix IPv6 over IPv4 ipsecif(4) uses wrong SP.
 	[knakahara, ticket #1497]
 
+sys/arch/i386/stand/efiboot/eficons.c		1.8
+
+	Fix a few bugs related to the framebuffer and the "gop" command.
+	[nonaka, ticket #1498]
+
+sys/arch/i386/stand/efiboot/efiboot.c		1.12
+
+	Do not clear the screen before exiting boot services,
+	as this may cause an undesired display mode switch.
+	[nonaka, ticket #1499]
+



CVS commit: [netbsd-8] src/doc

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:51:59 UTC 2020

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

Log Message:
Tickets #1498 and #1499


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-8.2

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



CVS commit: src/tests/kernel

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 10 16:51:49 UTC 2020

Modified Files:
src/tests/kernel: t_kauth_pr_47598.c

Log Message:
Show errno on failure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/t_kauth_pr_47598.c

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



CVS commit: src/tests/kernel

2020-02-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 10 16:51:49 UTC 2020

Modified Files:
src/tests/kernel: t_kauth_pr_47598.c

Log Message:
Show errno on failure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/t_kauth_pr_47598.c

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

Modified files:

Index: src/tests/kernel/t_kauth_pr_47598.c
diff -u src/tests/kernel/t_kauth_pr_47598.c:1.3 src/tests/kernel/t_kauth_pr_47598.c:1.4
--- src/tests/kernel/t_kauth_pr_47598.c:1.3	Mon Apr 28 08:34:16 2014
+++ src/tests/kernel/t_kauth_pr_47598.c	Mon Feb 10 16:51:48 2020
@@ -27,7 +27,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2013\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_kauth_pr_47598.c,v 1.3 2014/04/28 08:34:16 martin Exp $");
+__RCSID("$NetBSD: t_kauth_pr_47598.c,v 1.4 2020/02/10 16:51:48 riastradh Exp $");
 
 #include 
 #include 
@@ -120,21 +120,23 @@ ATF_TC_BODY(kauth_curtain, tc)
 	 * create a socket and bind it to some arbitray free port
 	 */
 	s = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
-	ATF_REQUIRE(s != -1);
+	ATF_REQUIRE_MSG(s != -1, "socket: %d", errno);
 	memset(, 0, sizeof(sa));
 	sa.sin_family = AF_INET;
 	sa.sin_len = sizeof(sa);
 	sa.sin_addr.s_addr = inet_addr("127.0.0.1");
-	ATF_REQUIRE(bind(s, (struct sockaddr *), sizeof(sa))==0);
-	ATF_REQUIRE(listen(s, 16)==0);
+	ATF_REQUIRE_MSG(bind(s, (struct sockaddr *), sizeof(sa)) == 0,
+	"bind: %d", errno);
+	ATF_REQUIRE_MSG(listen(s, 16) == 0, "listen: %d", errno);
 
 	/*
 	 * extract address and open a connection to the port
 	 */
 	slen = sizeof(sa);
-	ATF_REQUIRE(getsockname(s, (struct sockaddr *), )==0);
+	ATF_REQUIRE_MSG(getsockname(s, (struct sockaddr *), ) == 0,
+	"getsockname: %d", errno);
 	s2 = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
-	ATF_REQUIRE(s2 != -1);
+	ATF_REQUIRE_MSG(s2 != -1, "socket: %d", errno);
 	printf("port is %d\n", ntohs(sa.sin_port));
 	err = connect(s2, (struct sockaddr *), sizeof(sa));
 	ATF_REQUIRE_MSG(err == -1 && errno == EINPROGRESS,



CVS commit: [netbsd-8] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:49:48 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-8]: efiboot.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1499):

sys/arch/i386/stand/efiboot/efiboot.c: revision 1.12

Do not clear the screen before exiting boot services as this may cause an
undesired display mode switch. PR# 54615


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.5 -r1.4.10.6 src/sys/arch/i386/stand/efiboot/efiboot.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/i386/stand/efiboot/efiboot.c
diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.4.10.5 src/sys/arch/i386/stand/efiboot/efiboot.c:1.4.10.6
--- src/sys/arch/i386/stand/efiboot/efiboot.c:1.4.10.5	Wed Sep 18 17:30:05 2019
+++ src/sys/arch/i386/stand/efiboot/efiboot.c	Mon Feb 10 16:49:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.c,v 1.4.10.5 2019/09/18 17:30:05 martin Exp $	*/
+/*	$NetBSD: efiboot.c,v 1.4.10.6 2020/02/10 16:49:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -113,8 +113,6 @@ efi_cleanup(void)
 	UINT32 DescriptorVersion;
 	size_t allocsz;
 
-	clearit();
-
 	memset(_efi, 0, sizeof(btinfo_efi));
 	btinfo_efi.systblpa = (intptr_t)ST;
 #ifdef	__i386__	/* bootia32.efi */



CVS commit: [netbsd-8] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:49:48 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-8]: efiboot.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1499):

sys/arch/i386/stand/efiboot/efiboot.c: revision 1.12

Do not clear the screen before exiting boot services as this may cause an
undesired display mode switch. PR# 54615


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.5 -r1.4.10.6 src/sys/arch/i386/stand/efiboot/efiboot.c

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/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:47:30 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-8]: eficons.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1498):

sys/arch/i386/stand/efiboot/eficons.c: revision 1.8

Fix a few bugs related to the framebuffer:
 - If a GOP mode wasn't explicitly requested, the bootloader was passing
   fb info to the kernel even if the console was in text mode! This
   results in garbled console output on at least ThinkPad T420 and
   likely many others. If a mode isn't specified, default to 800x600.
 - The "gop" command was incorrectly parsing video modes in the form
   WxHxD as WxWxD.
 - Allow a short form WxH for the "gop" command to select any mode with
   the target dimensions.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.3 -r1.4.2.4 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.3 src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.4
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.3	Wed Sep 18 17:30:05 2019
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Mon Feb 10 16:47:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.4.2.3 2019/09/18 17:30:05 martin Exp $	*/
+/*	$NetBSD: eficons.c,v 1.4.2.4 2020/02/10 16:47:29 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -34,6 +34,10 @@
 #include "bootinfo.h"
 #include "vbe.h"
 
+#ifndef DEFAULT_GOP_MODE
+#define DEFAULT_GOP_MODE	"800x600"
+#endif
+
 extern struct x86_boot_params boot_params;
 
 struct btinfo_console btinfo_console;
@@ -71,6 +75,8 @@ static int efi_com_putc(int);
 static int efi_com_status(int);
 static int efi_com_waitforinputevent(uint64_t);
 
+static int efi_find_gop_mode(char *);
+
 static int iodev;
 static int (*internal_getchar)(void) = efi_cons_getc;
 static int (*internal_putchar)(int) = efi_cons_putc;
@@ -415,46 +421,36 @@ bi_framebuffer(void)
 	EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
 	struct btinfo_framebuffer fb;
 	INT32 bestmode = -1;
+	UINTN sz;
 
-	if (efi_gop == NULL) {
-		framebuffer_configure(NULL);
-		return;
-	}
+	if (efi_gop == NULL)
+		goto nofb;
 
 	if (efi_gop_mode >= 0) {
 		bestmode = efi_gop_mode;
 	} else {
-#if 0
-		UINT64 res, bestres = 0;
-		UINTN sz;
-		UINT32 i;
-
-		/* XXX EDID? EFI_EDID_DISCOVERED_PROTOCOL */
-		for (i = 0; i < efi_gop->Mode->MaxMode; i++) {
-			status = uefi_call_wrapper(efi_gop->QueryMode, 4,
-			efi_gop, i, , );
-			if (EFI_ERROR(status))
-continue;
+		/* If a mode has not been selected, choose a default */
+		bestmode = efi_find_gop_mode(DEFAULT_GOP_MODE);
+	}
+	if (bestmode == -1)
+		goto nofb;
 
-			res = (UINT64)info->HorizontalResolution *
-			(UINT64)info->VerticalResolution *
-			(UINT64)getdepth(info);
-			if (res > bestres) {
-bestmode = i;
-bestres = res;
-			}
-		}
-#endif
+	status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop,
+	bestmode);
+	if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode) {
+		printf("GOP setmode failed: %" PRIxMAX "\n",
+		(uintmax_t)status);
+		goto nofb;
 	}
-	if (bestmode >= 0) {
-		status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop,
-		bestmode);
-		if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode)
-			printf("GOP setmode failed: %" PRIxMAX "\n",
-			(uintmax_t)status);
+
+	status = uefi_call_wrapper(efi_gop->QueryMode, 4,
+	efi_gop, bestmode, , );
+	if (EFI_ERROR(status)) {
+		printf("GOP querymode failed: %" PRIxMAX "\n",
+		(uintmax_t)status);
+		goto nofb;
 	}
 
-	info = efi_gop->Mode->Info;
 	memset(, 0, sizeof(fb));
 	fb.physaddr = efi_gop->Mode->FrameBufferBase;
 	fb.flags = 0;
@@ -499,6 +495,10 @@ bi_framebuffer(void)
 	}
 
 	framebuffer_configure();
+	return;
+
+nofb:
+	framebuffer_configure(NULL);
 }
 
 int
@@ -658,10 +658,16 @@ efi_find_gop_mode(char *arg)
 
 		snprintf(mode, sizeof(mode), "%lux%lux%u",
 		(long)info->HorizontalResolution,
-		(long)info->HorizontalResolution,
+		(long)info->VerticalResolution,
 		depth);
 		if (strcmp(arg, mode) == 0)
 			return i;
+
+		snprintf(mode, sizeof(mode), "%lux%lu",
+		(long)info->HorizontalResolution,
+		(long)info->VerticalResolution);
+		if (strcmp(arg, mode) == 0)
+			return i;
 	}
 	return -1;
 }



CVS commit: [netbsd-8] src/sys/arch/i386/stand/efiboot

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:47:30 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-8]: eficons.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1498):

sys/arch/i386/stand/efiboot/eficons.c: revision 1.8

Fix a few bugs related to the framebuffer:
 - If a GOP mode wasn't explicitly requested, the bootloader was passing
   fb info to the kernel even if the console was in text mode! This
   results in garbled console output on at least ThinkPad T420 and
   likely many others. If a mode isn't specified, default to 800x600.
 - The "gop" command was incorrectly parsing video modes in the form
   WxHxD as WxWxD.
 - Allow a short form WxH for the "gop" command to select any mode with
   the target dimensions.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.3 -r1.4.2.4 src/sys/arch/i386/stand/efiboot/eficons.c

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



Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-02-10 Thread Roy Marples

On 09/02/2020 19:21, Joerg Sonnenberger wrote:

On Sat, Feb 08, 2020 at 12:17:16PM +, Santhosh Raju wrote:

Module Name:src
Committed By:   fox
Date:   Sat Feb  8 12:17:16 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c

Log Message:
external/bsd/dhcpcd: Fix a -Wconversion warning.

Type cast uint16_t to size_t to prevent implicit type conversion.


Seriously? That should not warn and no cast should be used either.


What fix would you recommend then?

Roy


CVS commit: src/share/man/man4

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 16:13:48 UTC 2020

Modified Files:
src/share/man/man4: pms.4

Log Message:
Add description on hw.alps.touchpad_movement_threshold


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/pms.4

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

Modified files:

Index: src/share/man/man4/pms.4
diff -u src/share/man/man4/pms.4:1.33 src/share/man/man4/pms.4:1.34
--- src/share/man/man4/pms.4:1.33	Mon Feb 10 15:30:33 2020
+++ src/share/man/man4/pms.4	Mon Feb 10 16:13:48 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.33 2020/02/10 15:30:33 ryoon Exp $
+.\" $NetBSD: pms.4,v 1.34 2020/02/10 16:13:48 ryoon Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -226,6 +226,9 @@ variables control behavior of ALPS touch
 Decreased values improve the accuracy of X and Y-axis reporting
 at the expense of slower mouse movement (default 2 for touchpad
 and 1 for TrackStick).
+.It Dv hw.alps.touchpad_movement_threshold
+Movements of less than this value (in ALPS coordinates) are
+ignored (default 4).
 .El
 .Sh SEE ALSO
 .Xr pckbc 4 ,



CVS commit: src/sys/dev/pckbport

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 16:12:59 UTC 2020

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Introduce hw.alps.touchpad_movement_threshold to better button area clicks


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/alps.c

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



CVS commit: src/sys/dev/pckbport

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 16:12:59 UTC 2020

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Introduce hw.alps.touchpad_movement_threshold to better button area clicks


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/alps.c

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

Modified files:

Index: src/sys/dev/pckbport/alps.c
diff -u src/sys/dev/pckbport/alps.c:1.13 src/sys/dev/pckbport/alps.c:1.14
--- src/sys/dev/pckbport/alps.c:1.13	Mon Feb 10 15:29:05 2020
+++ src/sys/dev/pckbport/alps.c	Mon Feb 10 16:12:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $ */
+/* $NetBSD: alps.c,v 1.14 2020/02/10 16:12:58 ryoon Exp $ */
 
 /*-
  * Copyright (c) 2017 Ryo ONODERA 
@@ -30,7 +30,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.14 2020/02/10 16:12:58 ryoon Exp $");
 
 #include 
 #include 
@@ -51,9 +51,11 @@ __KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.1
 
 /* #define ALPS_DEBUG */
 
+static int alps_touchpad_movement_threshold_nodenum;
 static int alps_touchpad_xy_unprecision_nodenum;
 static int alps_trackstick_xy_precision_nodenum;
 
+static int alps_touchpad_movement_threshold = 4;
 static int alps_touchpad_xy_unprecision = 2;
 static int alps_trackstick_xy_precision = 1;
 
@@ -77,6 +79,9 @@ pms_sysctl_alps_verify(SYSCTLFN_ARGS)
 		node.sysctl_num == alps_trackstick_xy_precision_nodenum) {
 		if (t < 0 || t > 7)
 			return EINVAL;
+	} else if (node.sysctl_num == alps_touchpad_movement_threshold_nodenum) {
+		if (t < 0)
+			return EINVAL;
 	} else
 		return EINVAL;
 
@@ -122,6 +127,17 @@ pms_sysctl_alps(struct sysctllog **clog)
 			goto err;
 	alps_trackstick_xy_precision_nodenum = node->sysctl_num;
 
+	if ((rc = sysctl_createv(clog, 0, NULL, ,
+		CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
+		CTLTYPE_INT, "touchpad_movement_threshold",
+		SYSCTL_DESCR("Minimum reported movement threshold"),
+		pms_sysctl_alps_verify, 0,
+		_touchpad_movement_threshold,
+		0, CTL_HW, root_num, CTL_CREATE,
+		CTL_EOL)) != 0)
+			goto err;
+	alps_touchpad_movement_threshold_nodenum = node->sysctl_num;
+
 	return;
 
 err:
@@ -967,6 +983,13 @@ pms_alps_decode_touchpad_packet_v7(struc
 		dy1 = dy1 >> alps_touchpad_xy_unprecision;
 	}
 
+	if (abs(dx1) < alps_touchpad_movement_threshold) {
+		dx1 = 0;
+	}
+	if (abs(dy1) < alps_touchpad_movement_threshold) {
+		dy1 = 0;
+	}
+
 	/* Allow finger detouch during drag and drop */
 	if ((sc->nfingers < sc->last_nfingers)
 		&& (cur_x2 == sc->last_x1) && (cur_y2 == sc->last_y1)) {



CVS commit: src/share/man/man4

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 16:13:48 UTC 2020

Modified Files:
src/share/man/man4: pms.4

Log Message:
Add description on hw.alps.touchpad_movement_threshold


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/pms.4

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



CVS commit: src/usr.sbin/sysinst/arch/mac68k

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:08:59 UTC 2020

Modified Files:
src/usr.sbin/sysinst/arch/mac68k: md.c

Log Message:
Finish conversion to generic partitioning backend


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/mac68k/md.c

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

Modified files:

Index: src/usr.sbin/sysinst/arch/mac68k/md.c
diff -u src/usr.sbin/sysinst/arch/mac68k/md.c:1.8 src/usr.sbin/sysinst/arch/mac68k/md.c:1.9
--- src/usr.sbin/sysinst/arch/mac68k/md.c:1.8	Sat Jul 13 17:13:38 2019
+++ src/usr.sbin/sysinst/arch/mac68k/md.c	Mon Feb 10 16:08:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.8 2019/07/13 17:13:38 martin Exp $ */
+/*	$NetBSD: md.c,v 1.9 2020/02/10 16:08:58 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -247,12 +247,13 @@ md_get_info(struct install_partition_des
 bool
 md_make_bsd_partitions(struct install_partition_desc *install)
 {
-	int rv;
-#if 0	// XXX
-	FILE *f;
-	int i, j, pl;
+	int i, j, rv;
 	EBZB *bzb;
-#endif
+	struct disk_part_info info;
+	uint fs_type;
+	const char *mountpoint;
+	part_id pid;
+	size_t ndx;
 
 	/*
 	 * Scan for any problems and report them before continuing.
@@ -272,16 +273,10 @@ md_make_bsd_partitions(struct install_pa
 		break;
 	}
 
-#if 0	// XXX
-	/* Build standard partitions */
-	memset(>bsdlabel, 0, sizeof pm->bsdlabel);
+	/* Start with empty fake disklabel partitions */
+	pm->parts->pscheme->delete_all_partitions(pm->parts);
 
 	/*
-	 * The mac68k port has a predefined partition for "c" which
-	 *  is the size of the disk, everything else is unused.
-	 */
-	pm->bsdlabel[RAW_PART].pi_size = pm->dlsize;
-	/*
 	 * Now, scan through the Disk Partition Map and transfer the
 	 *  information into the incore disklabel.
 	 */
@@ -289,80 +284,63 @@ md_make_bsd_partitions(struct install_pa
 	j = map.mblk[i];
 	bzb = (EBZB *)[j].pmBootArgs[0];
 	if (bzb->flags.part) {
-		pl = bzb->flags.part - 'a';
+		mountpoint = NULL;
+		fs_type = FS_UNUSED;
 		switch (whichType([j])) {
 		case HFS_PART:
-			pm->bsdlabel[pl].pi_fstype = FS_HFS;
-			strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
+			fs_type = FS_HFS;
+			mountpoint = (const char*)bzb->mount_point;
 			break;
 		case ROOT_PART:
 		case UFS_PART:
-			pm->bsdlabel[pl].pi_fstype = FS_BSDFFS;
-			strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
-			pm->bsdlabel[pl].pi_flags |= PIF_NEWFS | PIF_MOUNT;
+			fs_type = FS_BSDFFS;
+			mountpoint = (const char*)bzb->mount_point;
 			break;
 		case SWAP_PART:
-			pm->bsdlabel[pl].pi_fstype = FS_SWAP;
+			fs_type = FS_SWAP;
 			break;
 		case SCRATCH_PART:
-			pm->bsdlabel[pl].pi_fstype = FS_OTHER;
-			strcpy (pm->bsdlabel[pl].pi_mount, (char *)bzb->mount_point);
-		default:
+			fs_type = FS_OTHER;
+			mountpoint = (const char*)bzb->mount_point;
 			break;
+		default:
+			continue;
 		}
-	if (pm->bsdlabel[pl].pi_fstype != FS_UNUSED) {
-		pm->bsdlabel[pl].pi_size = map.blk[j].pmPartBlkCnt;
-		pm->bsdlabel[pl].pi_offset = map.blk[j].pmPyPartStart;
-		if (pm->bsdlabel[pl].pi_fstype != FS_SWAP) {
-		pm->bsdlabel[pl].pi_frag = 8;
-		pm->bsdlabel[pl].pi_fsize = 1024;
-		}
+		if (fs_type != FS_UNUSED) {
+			memset(, 0, sizeof info);
+			info.start = map.blk[j].pmPyPartStart;
+			info.size = map.blk[j].pmPartBlkCnt;
+			info.fs_type = fs_type;
+			info.last_mounted = mountpoint;
+			info.nat_type = pm->parts->pscheme->get_fs_part_type(
+			PT_root, fs_type, 0);
+			pid = pm->parts->pscheme->add_outer_partition(pm->parts,
+			, NULL);
+			if (pid == NO_PART)
+return false;
 		}
 	}
 	}
 
 	/* Disk name  - don't bother asking, just use the physical name*/
-	strcpy (pm->bsddiskname, pm->diskdev);
+	pm->parts->pscheme->set_disk_pack_name(pm->parts, pm->diskdev);
 
-#ifdef DEBUG
-	f = fopen ("/tmp/disktab", "w");
-#else
-	f = fopen ("/etc/disktab", "w");
-#endif
-	if (f == NULL) {
-		endwin();
-		(void) fprintf (stderr, "Could not open /etc/disktab");
-		exit (1);
+	/* Write the converted partitions */
+	if (!pm->parts->pscheme->write_to_disk(pm->parts))
+		return false;
+
+	/* now convert to install info */
+	if (!install_desc_from_parts(install, pm->parts))
+		return false;
+
+	/* set newfs flag for all FFS partitions */
+	for (ndx = 0; ndx < install->num; ndx++) {
+		if (install->infos[ndx].fs_type == FS_BSDFFS &&
+		install->infos[ndx].size > 0 &&
+		(install->infos[ndx].instflags & PUIINST_MOUNT))
+			install->infos[ndx].instflags |= PUIINST_NEWFS;
 	}
-	(void)fprintf (f, "%s|NetBSD installation generated:\\\n", pm->bsddiskname);
-	(void)fprintf (f, "\t:dt=%s:ty=winchester:\\\n", pm->disktype);
-	(void)fprintf (f, "\t:nc#%d:nt#%d:ns#%d:\\\n", pm->dlcyl, pm->dlhead, pm->dlsec);
-	(void)fprintf (f, "\t:sc#%d:su#%" PRIu32 ":\\\n", pm->dlhead*pm->dlsec, 

CVS commit: src/usr.sbin/sysinst/arch/mac68k

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 16:08:59 UTC 2020

Modified Files:
src/usr.sbin/sysinst/arch/mac68k: md.c

Log Message:
Finish conversion to generic partitioning backend


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/arch/mac68k/md.c

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



CVS commit: src/share/man/man4

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 15:30:33 UTC 2020

Modified Files:
src/share/man/man4: pms.4

Log Message:
Reflect typo fix, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/pms.4

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

Modified files:

Index: src/share/man/man4/pms.4
diff -u src/share/man/man4/pms.4:1.32 src/share/man/man4/pms.4:1.33
--- src/share/man/man4/pms.4:1.32	Tue Nov  6 09:14:08 2018
+++ src/share/man/man4/pms.4	Mon Feb 10 15:30:33 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.32 2018/11/06 09:14:08 blymn Exp $
+.\" $NetBSD: pms.4,v 1.33 2020/02/10 15:30:33 ryoon Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd February 4, 2018
+.Dd February 11, 2020
 .Dt PMS 4
 .Os
 .Sh NAME
@@ -222,7 +222,7 @@ The following
 variables control behavior of ALPS touchpads:
 .Bl -tag -width 8n
 .It Dv hw.alps.touchpad_xy_precision_shift
-.It Dv hw.alps.tackstick_xy_precision_shift
+.It Dv hw.alps.trackstick_xy_precision_shift
 Decreased values improve the accuracy of X and Y-axis reporting
 at the expense of slower mouse movement (default 2 for touchpad
 and 1 for TrackStick).



CVS commit: src/share/man/man4

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 15:30:33 UTC 2020

Modified Files:
src/share/man/man4: pms.4

Log Message:
Reflect typo fix, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/pms.4

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



CVS commit: src/sys/dev/pckbport

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 15:29:05 UTC 2020

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Fix typo in sysctl node name


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

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

Modified files:

Index: src/sys/dev/pckbport/alps.c
diff -u src/sys/dev/pckbport/alps.c:1.12 src/sys/dev/pckbport/alps.c:1.13
--- src/sys/dev/pckbport/alps.c:1.12	Tue May 28 08:59:35 2019
+++ src/sys/dev/pckbport/alps.c	Mon Feb 10 15:29:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.12 2019/05/28 08:59:35 msaitoh Exp $ */
+/* $NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $ */
 
 /*-
  * Copyright (c) 2017 Ryo ONODERA 
@@ -30,7 +30,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.12 2019/05/28 08:59:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.13 2020/02/10 15:29:05 ryoon Exp $");
 
 #include 
 #include 
@@ -113,7 +113,7 @@ pms_sysctl_alps(struct sysctllog **clog)
 
 	if ((rc = sysctl_createv(clog, 0, NULL, ,
 		CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
-		CTLTYPE_INT, "tackstick_xy_precision_shift",
+		CTLTYPE_INT, "trackstick_xy_precision_shift",
 		SYSCTL_DESCR("Trackstick X/Y-axis precision value"),
 		pms_sysctl_alps_verify, 0,
 		_trackstick_xy_precision,



CVS commit: src/sys/dev/pckbport

2020-02-10 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Mon Feb 10 15:29:05 UTC 2020

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Fix typo in sysctl node name


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

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



CVS commit: src/external/bsd/libarchive/dist/libarchive

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 15:24:21 UTC 2020

Modified Files:
src/external/bsd/libarchive/dist/libarchive: archive_write_disk_posix.c

Log Message:
When extracting symlinks atomically remove them like we do for hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.4 src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.5
--- src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c:1.4	Tue Jan 14 14:29:45 2020
+++ src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c	Mon Feb 10 10:24:21 2020
@@ -2301,6 +2301,11 @@ create_filesystem_object(struct archive_
 		}
 		free(linkname_copy);
 		archive_string_free(_string);
+		/*
+		 * Unlinking and linking here is really not atomic,
+		 * but doing it right, would require us to construct
+		 * an mktemplink() function, and then use rename(2).
+		 */
 		if (a->flags & ARCHIVE_EXTRACT_ATOMIC)
 			unlink(a->name);
 		r = link(linkname, a->name) ? errno : 0;
@@ -2341,7 +2346,15 @@ create_filesystem_object(struct archive_
 	linkname = archive_entry_symlink(a->entry);
 	if (linkname != NULL) {
 #if HAVE_SYMLINK
-		int error = symlink(linkname, a->name) ? errno : 0;
+		int error;
+		/*
+		 * Unlinking and linking here is really not atomic,
+		 * but doing it right, would require us to construct
+		 * an mktempsymlink() function, and then use rename(2).
+		 */
+		if (a->flags & ARCHIVE_EXTRACT_ATOMIC)
+			unlink(a->name);
+		error = symlink(linkname, a->name) ? errno : 0;
 		if (error == 0) {
 #ifdef HAVE_LSTAT
 			r = lstat(a->name, );



CVS commit: src/external/bsd/libarchive/dist/libarchive

2020-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 10 15:24:21 UTC 2020

Modified Files:
src/external/bsd/libarchive/dist/libarchive: archive_write_disk_posix.c

Log Message:
When extracting symlinks atomically remove them like we do for hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c

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



CVS commit: src/usr.sbin/sysinst

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 14:55:53 UTC 2020

Modified Files:
src/usr.sbin/sysinst: defs.h

Log Message:
Do not use -P for tar extractions - the in tree tar has been fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/sysinst/defs.h

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

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.54 src/usr.sbin/sysinst/defs.h:1.55
--- src/usr.sbin/sysinst/defs.h:1.54	Mon Jan 27 21:21:22 2020
+++ src/usr.sbin/sysinst/defs.h	Mon Feb 10 14:55:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.54 2020/01/27 21:21:22 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.55 2020/02/10 14:55:53 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -527,7 +527,7 @@ int  clean_xfer_dir;
 #ifdef	USING_PAXASTAR
 #define	TAR_EXTRACT_FLAGS	"-xhepf"
 #else
-#define	TAR_EXTRACT_FLAGS	"-xpPf"
+#define	TAR_EXTRACT_FLAGS	"-xpf"
 #endif
 
 /* Abs. path we extract binary sets from */



CVS commit: src/usr.sbin/sysinst

2020-02-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 10 14:55:53 UTC 2020

Modified Files:
src/usr.sbin/sysinst: defs.h

Log Message:
Do not use -P for tar extractions - the in tree tar has been fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/sysinst/defs.h

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



CVS commit: src/tests/lib/libc/sys

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 11:42:41 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Rename suspend2 to suspend_no_deadlock


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/tests/lib/libc/sys

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 11:42:41 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Rename suspend2 to suspend_no_deadlock


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.153 src/tests/lib/libc/sys/t_ptrace_wait.c:1.154
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.153	Wed Feb  5 23:43:18 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Mon Feb 10 11:42:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.153 2020/02/05 23:43:18 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.154 2020/02/10 11:42:41 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.153 2020/02/05 23:43:18 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.154 2020/02/10 11:42:41 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -7249,27 +7249,15 @@ ATF_TC_BODY(threads_and_exec, tc)
 
 /// 
 
-volatile lwpid_t the_lwp_id = 0;
-
-static void
-lwp_main_stop(void *arg)
-{
-	the_lwp_id = _lwp_self();
-
-	raise(SIGTRAP);
-
-	_lwp_exit();
-}
-
-ATF_TC(suspend2);
-ATF_TC_HEAD(suspend2, tc)
+ATF_TC(suspend_no_deadlock);
+ATF_TC_HEAD(suspend_no_deadlock, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
 	"Verify that the while the only thread within a process is "
 	"suspended, the whole process cannot be unstopped");
 }
 
-ATF_TC_BODY(suspend2, tc)
+ATF_TC_BODY(suspend_no_deadlock, tc)
 {
 	const int exitval = 5;
 	const int sigval = SIGSTOP;
@@ -7327,6 +7315,20 @@ ATF_TC_BODY(suspend2, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+/// 
+
+volatile lwpid_t the_lwp_id = 0;
+
+static void
+lwp_main_stop(void *arg)
+{
+	the_lwp_id = _lwp_self();
+
+	raise(SIGTRAP);
+
+	_lwp_exit();
+}
+
 ATF_TC(resume1);
 ATF_TC_HEAD(resume1, tc)
 {
@@ -9257,7 +9259,7 @@ ATF_TP_ADD_TCS(tp)
 
 	ATF_TP_ADD_TC(tp, threads_and_exec);
 
-	ATF_TP_ADD_TC(tp, suspend2);
+	ATF_TP_ADD_TC(tp, suspend_no_deadlock);
 
 	ATF_TP_ADD_TC(tp, resume1);
 



CVS commit: src/sys/dev

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 10:05:55 UTC 2020

Modified Files:
src/sys/dev: ld.c

Log Message:
Reject open when attach didn't complete successfully.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ld.c

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



CVS commit: src/sys/dev

2020-02-10 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Feb 10 10:05:55 UTC 2020

Modified Files:
src/sys/dev: ld.c

Log Message:
Reject open when attach didn't complete successfully.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ld.c

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

Modified files:

Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.107 src/sys/dev/ld.c:1.108
--- src/sys/dev/ld.c:1.107	Sun Oct  6 06:10:44 2019
+++ src/sys/dev/ld.c	Mon Feb 10 10:05:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld.c,v 1.107 2019/10/06 06:10:44 mlelstv Exp $	*/
+/*	$NetBSD: ld.c,v 1.108 2020/02/10 10:05:55 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.107 2019/10/06 06:10:44 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.108 2020/02/10 10:05:55 mlelstv Exp $");
 
 #include 
 #include 
@@ -296,6 +296,10 @@ ldopen(dev_t dev, int flags, int fmt, st
 	unit = DISKUNIT(dev);
 	if ((sc = device_lookup_private(_cd, unit)) == NULL)
 		return (ENXIO);
+
+	if ((sc->sc_flags & LDF_ENABLED) == 0)
+		return (ENODEV);
+
 	dksc = >sc_dksc;
 
 	return dk_open(dksc, dev, flags, fmt, l);



CVS commit: src/sys/dev/usb

2020-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 10 09:15:28 UTC 2020

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

Log Message:
Fix USB_DEBUG build


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/usbdi_util.c

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



CVS commit: src/sys/dev/usb

2020-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 10 09:15:28 UTC 2020

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

Log Message:
Fix USB_DEBUG build


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/usbdi_util.c

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

Modified files:

Index: src/sys/dev/usb/usbdi_util.c
diff -u src/sys/dev/usb/usbdi_util.c:1.78 src/sys/dev/usb/usbdi_util.c:1.79
--- src/sys/dev/usb/usbdi_util.c:1.78	Sat Feb  8 08:47:27 2020
+++ src/sys/dev/usb/usbdi_util.c	Mon Feb 10 09:15:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi_util.c,v 1.78 2020/02/08 08:47:27 maxv Exp $	*/
+/*	$NetBSD: usbdi_util.c,v 1.79 2020/02/10 09:15:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.78 2020/02/08 08:47:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.79 2020/02/10 09:15:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -396,6 +396,8 @@ usbd_status
 usbd_clear_endpoint_feature(struct usbd_device *dev, int epaddr, int sel)
 {
 	USBHIST_FUNC();
+	USBHIST_CALLARGS(usbdebug, "dev %#jx epaddr %jd sel %jd",
+	(uintptr_t)dev, epaddr, sel, 0);
 	usb_device_request_t req;
 
 	req.bmRequestType = UT_WRITE_ENDPOINT;



CVS commit: src/lib/librumphijack

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 09:10:58 UTC 2020

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Avoid unportable bit shift semantics

hijack.c:451:52, left shift of 1 by 31 places cannot be represented in type 'int


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/lib/librumphijack/hijack.c

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



CVS commit: src/lib/librumphijack

2020-02-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 10 09:10:58 UTC 2020

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Avoid unportable bit shift semantics

hijack.c:451:52, left shift of 1 by 31 places cannot be represented in type 'int


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.128 src/lib/librumphijack/hijack.c:1.129
--- src/lib/librumphijack/hijack.c:1.128	Wed Sep 25 20:19:59 2019
+++ src/lib/librumphijack/hijack.c	Mon Feb 10 09:10:58 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.128 2019/09/25 20:19:59 christos Exp $	*/
+/*  $NetBSD: hijack.c,v 1.129 2020/02/10 09:10:58 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.128 2019/09/25 20:19:59 christos Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.129 2020/02/10 09:10:58 kamil Exp $");
 #endif
 
 #include 
@@ -440,7 +440,7 @@ static int hijack_fdoff = FD_SETSIZE/2;
 /* note: you cannot change this without editing the env-passing code */
 #define DUP2HIGH 2
 static uint32_t dup2vec[DUP2HIGH+1];
-#define DUP2BIT (1<<31)
+#define DUP2BIT (1U<<31)
 #define DUP2ALIAS (1<<30)
 #define DUP2FDMASK ((1<<30)-1)