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

2019-07-22 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Jul 23 04:50:05 UTC 2019

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
vmx(4) can be detached now.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x86/pci/if_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/x86/pci

2019-07-22 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Jul 23 04:50:05 UTC 2019

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
vmx(4) can be detached now.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x86/pci/if_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/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.36 src/sys/arch/x86/pci/if_vmx.c:1.37
--- src/sys/arch/x86/pci/if_vmx.c:1.36	Mon Jul 22 06:52:06 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Tue Jul 23 04:50:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.36 2019/07/22 06:52:06 knakahara Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.37 2019/07/23 04:50:05 knakahara Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.36 2019/07/22 06:52:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.37 2019/07/23 04:50:05 knakahara Exp $");
 
 #include 
 #include 
@@ -223,6 +223,7 @@ struct vmxnet3_softc {
 	struct vmxnet3_rxqueue *vmx_rxq;
 
 	struct pci_attach_args *vmx_pa;
+	pci_chipset_tag_t vmx_pc;
 
 	bus_space_tag_t vmx_iot0;
 	bus_space_tag_t vmx_iot1;
@@ -528,6 +529,7 @@ vmxnet3_attach(device_t parent, device_t
 
 	sc->vmx_dev = self;
 	sc->vmx_pa = pa;
+	sc->vmx_pc = pa->pa_pc;
 	if (pci_dma64_available(pa))
 		sc->vmx_dmat = pa->pa_dmat64;
 	else
@@ -802,7 +804,7 @@ vmxnet3_alloc_interrupts(struct vmxnet3_
 void
 vmxnet3_free_interrupts(struct vmxnet3_softc *sc)
 {
-	pci_chipset_tag_t pc = sc->vmx_pa->pa_pc;
+	pci_chipset_tag_t pc = sc->vmx_pc;
 	int i;
 
 	for (i = 0; i < sc->vmx_nintrs; i++) {



CVS commit: src/tests/net/ipsec

2019-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 23 04:31:25 UTC 2019

Modified Files:
src/tests/net/ipsec: t_ipsec_misc.sh

Log Message:
tests: add tests for getspi and udpate


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/net/ipsec/t_ipsec_misc.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/net/ipsec/t_ipsec_misc.sh
diff -u src/tests/net/ipsec/t_ipsec_misc.sh:1.22 src/tests/net/ipsec/t_ipsec_misc.sh:1.23
--- src/tests/net/ipsec/t_ipsec_misc.sh:1.22	Thu Nov  9 04:51:07 2017
+++ src/tests/net/ipsec/t_ipsec_misc.sh	Tue Jul 23 04:31:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec_misc.sh,v 1.22 2017/11/09 04:51:07 ozaki-r Exp $
+#	$NetBSD: t_ipsec_misc.sh,v 1.23 2019/07/23 04:31:25 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -40,9 +40,16 @@ setup_sasp()
 	local lifetime=$5
 	local update=$6
 	local tmpfile=./tmp
+	local saadd=add
+	local saadd_algo_args="$algo_args"
 	local extra=
 
-	if [ "$update" = sa ]; then
+	if [ "$update" = getspi ]; then
+		saadd=getspi
+		saadd_algo_args=
+	fi
+
+	if [ "$update" = sa -o "$update" = getspi ]; then
 		extra="update $ip_local $ip_peer $proto 1 $algo_args;
 		   update $ip_peer $ip_local $proto 10001 $algo_args;"
 	elif [ "$update" = sp ]; then
@@ -51,8 +58,8 @@ setup_sasp()
 
 	export RUMP_SERVER=$SOCK_LOCAL
 	cat > $tmpfile <<-EOF
-	add $ip_local $ip_peer $proto 1 -lh $lifetime -ls $lifetime $algo_args;
-	add $ip_peer $ip_local $proto 10001 -lh $lifetime -ls $lifetime $algo_args;
+	$saadd $ip_local $ip_peer $proto 1 -lh $lifetime -ls $lifetime $saadd_algo_args;
+	$saadd $ip_peer $ip_local $proto 10001 -lh $lifetime -ls $lifetime $saadd_algo_args;
 	spdadd $ip_local $ip_peer any -P out ipsec $proto/transport//require;
 	$extra
 	EOF
@@ -67,8 +74,8 @@ setup_sasp()
 
 	export RUMP_SERVER=$SOCK_PEER
 	cat > $tmpfile <<-EOF
-	add $ip_local $ip_peer $proto 1 -lh $lifetime -ls $lifetime $algo_args;
-	add $ip_peer $ip_local $proto 10001 -lh $lifetime -ls $lifetime $algo_args;
+	$saadd $ip_local $ip_peer $proto 1 -lh $lifetime -ls $lifetime $saadd_algo_args;
+	$saadd $ip_peer $ip_local $proto 10001 -lh $lifetime -ls $lifetime $saadd_algo_args;
 	spdadd $ip_peer $ip_local any -P out ipsec $proto/transport//require;
 	$extra
 	EOF
@@ -370,6 +377,71 @@ add_test_update()
 	atf_add_test_case ${name}
 }
 
+test_getspi_update()
+{
+	local proto=$1
+	local algo=$2
+	local ip_local=10.0.0.1
+	local ip_peer=10.0.0.2
+	local algo_args="$(generate_algo_args $proto $algo)"
+	local proto_cap=$(echo $proto | tr 'a-z' 'A-Z')
+	local outfile=./out
+
+	rump_server_crypto_start $SOCK_LOCAL netipsec
+	rump_server_crypto_start $SOCK_PEER netipsec
+	rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
+	rump_server_add_iface $SOCK_PEER shmif0 $BUS
+
+	export RUMP_SERVER=$SOCK_LOCAL
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.dad_count=0
+	atf_check -s exit:0 rump.ifconfig shmif0 $ip_local/24
+
+	export RUMP_SERVER=$SOCK_PEER
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.dad_count=0
+	atf_check -s exit:0 rump.ifconfig shmif0 $ip_peer/24
+
+	setup_sasp $proto "$algo_args" $ip_local $ip_peer 100 getspi
+
+	extract_new_packets $BUS > $outfile
+
+	export RUMP_SERVER=$SOCK_LOCAL
+	atf_check -s exit:0 -o ignore rump.ping -c 1 -n -w 3 $ip_peer
+
+	extract_new_packets $BUS > $outfile
+	atf_check -s exit:0 -o match:"$ip_local > $ip_peer: $proto_cap" \
+	cat $outfile
+	atf_check -s exit:0 -o match:"$ip_peer > $ip_local: $proto_cap" \
+	cat $outfile
+}
+
+add_test_getspi_update()
+{
+	local proto=$1
+	local algo=$2
+	local _algo=$(echo $algo | sed 's/-//g')
+	local name= desc=
+
+	desc="Tests trying to getspi and udpate SA of $proto ($algo)"
+	name="ipsec_getspi_update_sa_${proto}_${_algo}"
+
+	atf_test_case ${name} cleanup
+	eval "
+	${name}_head() {
+	atf_set descr \"$desc\"
+	atf_set require.progs rump_server setkey
+	}
+	${name}_body() {
+	test_getspi_update $proto $algo
+	rump_server_destroy_ifaces
+	}
+	${name}_cleanup() {
+	\$DEBUG && dump
+	cleanup
+	}
+	"
+	atf_add_test_case ${name}
+}
+
 add_sa()
 {
 	local proto=$1
@@ -809,6 +881,7 @@ atf_init_test_cases()
 		add_test_lifetime ipv6 esp $algo
 		add_test_update esp $algo sa
 		add_test_update esp $algo sp
+		add_test_getspi_update esp $algo
 		add_test_spi esp $algo new delete
 		add_test_spi esp $algo old delete
 		add_test_spi esp $algo new timeout
@@ -821,6 +894,7 @@ atf_init_test_cases()
 		add_test_lifetime ipv6 ah $algo
 		add_test_update ah $algo sa
 		add_test_update ah $algo sp
+		add_test_getspi_update ah $algo
 		add_test_spi ah $algo new delete
 		add_test_spi ah $algo old delete
 		add_test_spi ah $algo new timeout



CVS commit: src/crypto/dist/ipsec-tools/src/setkey

2019-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 23 04:30:32 UTC 2019

Modified Files:
src/crypto/dist/ipsec-tools/src/setkey: parse.y token.l

Log Message:
setkey: enable to use the getspi API

If a specified SPI is not zero, tell the kernel to use the SPI by using
SADB_EXT_SPIRANGE.  Otherwise, the kernel picks a random SPI.

It enables to mimic racoon.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/crypto/dist/ipsec-tools/src/setkey/parse.y \
src/crypto/dist/ipsec-tools/src/setkey/token.l

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/setkey/parse.y
diff -u src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.22 src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.23
--- src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.22	Sun Oct 14 08:27:39 2018
+++ src/crypto/dist/ipsec-tools/src/setkey/parse.y	Tue Jul 23 04:30:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.y,v 1.22 2018/10/14 08:27:39 maxv Exp $	*/
+/*	$NetBSD: parse.y,v 1.23 2019/07/23 04:30:32 ozaki-r Exp $	*/
 /*	$KAME: parse.y,v 1.81 2003/07/01 04:01:48 itojun Exp $	*/
 
 /*
@@ -114,7 +114,7 @@ static int setkeymsg_add(unsigned int, u
 }
 
 %token EOT SLASH BLCL ELCL
-%token ADD UPDATE GET DELETE DELETEALL FLUSH DUMP EXIT
+%token ADD UPDATE GET GETSPI DELETE DELETEALL FLUSH DUMP EXIT
 %token PR_ESP PR_AH PR_IPCOMP PR_ESPUDP PR_TCP
 %token F_PROTOCOL F_AUTH F_ENC F_REPLAY F_COMP F_RAWCPI
 %token F_MODE MODE F_REQID
@@ -161,6 +161,7 @@ command
 	:	add_command
 	|	update_command
 	|	get_command
+	|	getspi_command
 	|	delete_command
 	|	deleteall_command
 	|	flush_command
@@ -260,6 +261,17 @@ get_command
 		}
 	;
 
+	/* getspi command */
+getspi_command
+	:	GETSPI ipaddropts ipandport ipandport protocol_spec spi extension_spec EOT
+		{
+			int status;
+
+			status = setkeymsg_add(SADB_GETSPI, $5, $3, $4);
+			if (status < 0)
+return -1;
+		}
+
 	/* flush */
 flush_command
 	:	FLUSH protocol_spec EOT
@@ -1389,6 +1401,21 @@ setkeymsg_add(unsigned int type, unsigne
 	}
 #endif
 
+	/* SPI == 0 allows the kernel to pick a random SPI */
+	if (type == SADB_GETSPI && p_spi != 0) {
+		struct sadb_spirange spirange;
+		u_int slen = sizeof(struct sadb_spirange);
+
+		memset(, 0, sizeof(spirange));
+		spirange.sadb_spirange_len = PFKEY_UNIT64(slen);
+		spirange.sadb_spirange_exttype = SADB_EXT_SPIRANGE;
+		spirange.sadb_spirange_min = p_spi;
+		spirange.sadb_spirange_max = p_spi;
+
+		memcpy(buf + l, , slen);
+		l += slen;
+	}
+
 	len = sizeof(struct sadb_sa);
 	m_sa.sadb_sa_len = PFKEY_UNIT64(len);
 	m_sa.sadb_sa_exttype = SADB_EXT_SA;
Index: src/crypto/dist/ipsec-tools/src/setkey/token.l
diff -u src/crypto/dist/ipsec-tools/src/setkey/token.l:1.22 src/crypto/dist/ipsec-tools/src/setkey/token.l:1.23
--- src/crypto/dist/ipsec-tools/src/setkey/token.l:1.22	Sun Oct 14 08:27:39 2018
+++ src/crypto/dist/ipsec-tools/src/setkey/token.l	Tue Jul 23 04:30:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: token.l,v 1.22 2018/10/14 08:27:39 maxv Exp $	*/
+/*	$NetBSD: token.l,v 1.23 2019/07/23 04:30:32 ozaki-r Exp $	*/
 /*	$KAME: token.l,v 1.44 2003/10/21 07:20:58 itojun Exp $	*/
 
 /*
@@ -119,6 +119,7 @@ update		{ return(UPDATE); }
 delete		{ return(DELETE); }
 deleteall	{ return(DELETEALL); }
 get		{ return(GET); }
+getspi		{ return(GETSPI); }
 flush		{ return(FLUSH); }
 dump		{ return(DUMP); }
 exit		{ return(EXIT); }



CVS commit: src/crypto/dist/ipsec-tools/src/setkey

2019-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 23 04:30:32 UTC 2019

Modified Files:
src/crypto/dist/ipsec-tools/src/setkey: parse.y token.l

Log Message:
setkey: enable to use the getspi API

If a specified SPI is not zero, tell the kernel to use the SPI by using
SADB_EXT_SPIRANGE.  Otherwise, the kernel picks a random SPI.

It enables to mimic racoon.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/crypto/dist/ipsec-tools/src/setkey/parse.y \
src/crypto/dist/ipsec-tools/src/setkey/token.l

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



CVS commit: src/sys/netipsec

2019-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 23 04:29:27 UTC 2019

Modified Files:
src/sys/netipsec: key.c

Log Message:
ipsec: fix a regression of the update API

The update API updates an SA by creating a new SA and removing an existing SA.
The previous change removed a newly added SA wrongly if an existing SA had been
created by the getspi API.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.264 src/sys/netipsec/key.c:1.265
--- src/sys/netipsec/key.c:1.264	Wed Jul 17 07:07:59 2019
+++ src/sys/netipsec/key.c	Tue Jul 23 04:29:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.264 2019/07/17 07:07:59 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.265 2019/07/23 04:29:26 ozaki-r Exp $	*/
 /*	$FreeBSD: key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.264 2019/07/17 07:07:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.265 2019/07/23 04:29:26 ozaki-r Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -3530,7 +3530,8 @@ out:
  *	others	: found, pointer to a SA.
  */
 static struct secasvar *
-key_lookup_and_remove_sav(struct secashead *sah, u_int32_t spi)
+key_lookup_and_remove_sav(struct secashead *sah, u_int32_t spi,
+const struct secasvar *hint)
 {
 	struct secasvar *sav = NULL;
 	u_int state;
@@ -3542,6 +3543,8 @@ key_lookup_and_remove_sav(struct secashe
 			KASSERT(sav->state == state);
 
 			if (sav->spi == spi) {
+if (hint != NULL && hint != sav)
+	continue;
 sav->state = SADB_SASTATE_DEAD;
 SAVLIST_WRITER_REMOVE(sav);
 SAVLUT_WRITER_REMOVE(sav);
@@ -5807,7 +5810,8 @@ key_api_update(struct socket *so, struct
 	 * We need to lookup and remove the sav atomically, so get it again
 	 * here by a special API while we have a reference to it.
 	 */
-	oldsav = key_lookup_and_remove_sav(sah, sa0->sadb_sa_spi);
+	oldsav = key_lookup_and_remove_sav(sah, sa0->sadb_sa_spi, sav);
+	KASSERT(oldsav == NULL || oldsav == sav);
 	/* We can release the reference because of oldsav */
 	KEY_SA_UNREF();
 	if (oldsav == NULL) {
@@ -6222,7 +6226,7 @@ key_api_delete(struct socket *so, struct
 	sah = key_getsah_ref(, CMP_HEAD);
 	if (sah != NULL) {
 		/* get a SA with SPI. */
-		sav = key_lookup_and_remove_sav(sah, sa0->sadb_sa_spi);
+		sav = key_lookup_and_remove_sav(sah, sa0->sadb_sa_spi, NULL);
 		key_sah_unref(sah);
 	}
 



CVS commit: src/sys/netipsec

2019-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 23 04:29:27 UTC 2019

Modified Files:
src/sys/netipsec: key.c

Log Message:
ipsec: fix a regression of the update API

The update API updates an SA by creating a new SA and removing an existing SA.
The previous change removed a newly added SA wrongly if an existing SA had been
created by the getspi API.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/netipsec/key.c

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



CVS commit: src/usr.bin/kdump

2019-07-22 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 23 01:54:51 UTC 2019

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

Log Message:
kdump(1): Symbolic printing for MALLOC_OPTIONS="U".


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/kdump/kdump.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/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.131 src/usr.bin/kdump/kdump.c:1.132
--- src/usr.bin/kdump/kdump.c:1.131	Mon May  6 19:20:13 2019
+++ src/usr.bin/kdump/kdump.c	Tue Jul 23 01:54:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.132 2019/07/23 01:54:51 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.131 2019/05/06 19:20:13 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.132 2019/07/23 01:54:51 nonaka Exp $");
 #endif
 #endif /* not lint */
 
@@ -1143,6 +1143,27 @@ ktruser_control(const char *name, const 
 }
 
 static void
+ktruser_malloc(const char *name, const void *buf, size_t len)
+{
+	struct ut { void *p; size_t s; void *r; } m;
+
+	if (len != sizeof(m))
+		warnx("%.*s: len %zu != %zu", KTR_USER_MAXIDLEN, name, len,
+		sizeof(m));
+	memcpy(, buf, len < sizeof(m) ? len : sizeof(m));
+	if (m.p == NULL && m.s == 0 && m.r == NULL)
+		printf("%.*s: malloc_init()\n", KTR_USER_MAXIDLEN, name);
+	else if (m.p != NULL && m.s != 0)
+		printf("%.*s: %p = realloc(%p, %zu)\n", KTR_USER_MAXIDLEN, name,
+		m.r, m.p, m.s);
+	else if (m.s == 0)
+		printf("%.*s: free(%p)\n", KTR_USER_MAXIDLEN, name, m.p);
+	else
+		printf("%.*s: %p = malloc(%zu)\n", KTR_USER_MAXIDLEN, name,
+		m.r, m.s);
+}
+
+static void
 ktruser_misc(const char *name, const void *buf, size_t len)
 {
 	size_t i;
@@ -1161,6 +1182,7 @@ static struct {
 	{ "msghdr", ktruser_msghdr },
 	{ "mbsoname", ktruser_soname },
 	{ "mbcontrol", ktruser_control },
+	{ "malloc", ktruser_malloc },
 	{ NULL,	ktruser_misc },
 };
 



CVS commit: src/usr.bin/kdump

2019-07-22 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 23 01:54:51 UTC 2019

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

Log Message:
kdump(1): Symbolic printing for MALLOC_OPTIONS="U".


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/kdump/kdump.c

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



CVS commit: src

2019-07-22 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Jul 23 00:52:02 UTC 2019

Modified Files:
src/lib/libnpf: libnpf.3 npf.c npf.h
src/sys/net/npf: files.npf npf.c npf.h npf_alg.c npf_alg_icmp.c
npf_conf.c npf_conn.c npf_conn.h npf_conndb.c npf_ctl.c
npf_handler.c npf_impl.h npf_inet.c npf_nat.c npf_os.c npf_rproc.c
npf_ruleset.c npf_state.c npf_state_tcp.c npf_tableset.c npfkern.h
src/sys/rump/net/lib/libnpf: Makefile
src/usr.sbin/npf/npfctl: npf.conf.5 npf_bpf_comp.c npf_build.c
npf_parse.y npf_scan.l npf_show.c npfctl.c npfctl.h
src/usr.sbin/npf/npftest: npfstream.c npftest.c npftest.conf
src/usr.sbin/npf/npftest/libnpftest: npf_bpf_test.c npf_conn_test.c
npf_mbuf_subr.c npf_nat_test.c npf_nbuf_test.c npf_perf_test.c
npf_rule_test.c npf_state_test.c npf_table_test.c npf_test.h
npf_test_subr.c
Added Files:
src/sys/net/npf: npf_connkey.c npf_params.c npf_portmap.c
src/usr.sbin/npf: npf-params.7

Log Message:
NPF improvements:
- Add support for dynamic NETMAP algorithm (stateful net-to-net).
- Add most of the support for the dynamic NAT rules; a little bit more
  userland work is needed to finish this up and enable.
- Replace 'stateful-ends' with more permissive 'stateful-all'.
- Add various tunable parameters and document them, see npf-params(7).
- Reduce the memory usage of the connection state table (conndb).
- Portmap rewrite: use memory more efficiently, handle addresses dynamically.
- Bug fix: add splsoftnet()/splx() around the thmap writers and comment.
- npftest: clean up and simplify; fix some memleaks to make ASAN happy.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libnpf/libnpf.3
cvs rdiff -u -r1.45 -r1.46 src/lib/libnpf/npf.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libnpf/npf.h
cvs rdiff -u -r1.21 -r1.22 src/sys/net/npf/files.npf \
src/sys/net/npf/npf_state.c
cvs rdiff -u -r1.37 -r1.38 src/sys/net/npf/npf.c
cvs rdiff -u -r1.59 -r1.60 src/sys/net/npf/npf.h
cvs rdiff -u -r1.19 -r1.20 src/sys/net/npf/npf_alg.c \
src/sys/net/npf/npf_state_tcp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.12 -r1.13 src/sys/net/npf/npf_conf.c
cvs rdiff -u -r1.26 -r1.27 src/sys/net/npf/npf_conn.c
cvs rdiff -u -r1.15 -r1.16 src/sys/net/npf/npf_conn.h
cvs rdiff -u -r1.5 -r1.6 src/sys/net/npf/npf_conndb.c
cvs rdiff -u -r0 -r1.1 src/sys/net/npf/npf_connkey.c \
src/sys/net/npf/npf_params.c src/sys/net/npf/npf_portmap.c
cvs rdiff -u -r1.53 -r1.54 src/sys/net/npf/npf_ctl.c \
src/sys/net/npf/npf_inet.c
cvs rdiff -u -r1.45 -r1.46 src/sys/net/npf/npf_handler.c \
src/sys/net/npf/npf_nat.c
cvs rdiff -u -r1.74 -r1.75 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.11 -r1.12 src/sys/net/npf/npf_os.c
cvs rdiff -u -r1.18 -r1.19 src/sys/net/npf/npf_rproc.c
cvs rdiff -u -r1.47 -r1.48 src/sys/net/npf/npf_ruleset.c
cvs rdiff -u -r1.32 -r1.33 src/sys/net/npf/npf_tableset.c
cvs rdiff -u -r1.2 -r1.3 src/sys/net/npf/npfkern.h
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/net/lib/libnpf/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/npf/npf-params.7
cvs rdiff -u -r1.86 -r1.87 src/usr.sbin/npf/npfctl/npf.conf.5
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/npf/npfctl/npf_bpf_comp.c
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/npf/npfctl/npf_build.c \
src/usr.sbin/npf/npfctl/npf_parse.y
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/npf/npfctl/npf_scan.l
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/npf/npfctl/npf_show.c
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/npf/npfctl/npfctl.c
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/npf/npfctl/npfctl.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/npfstream.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/npf/npftest/npftest.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npftest/npftest.conf
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/npf/npftest/libnpftest/npf_conn_test.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/libnpftest/npf_mbuf_subr.c \
src/usr.sbin/npf/npftest/libnpftest/npf_state_test.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c \
src/usr.sbin/npf/npftest/libnpftest/npf_table_test.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/npf/npftest/libnpftest/npf_nbuf_test.c \
src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c
cvs rdiff -u -r1.16 -r1.17 \
src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/npf/npftest/libnpftest/npf_test.h
cvs rdiff -u -r1.14 -r1.15 \
src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c

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



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

2019-07-22 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Jul 23 00:49:16 UTC 2019

Modified Files:
src/sys/external/bsd/libnv/dist: nv.h nvlist.c nvpair.c

Log Message:
- nvpair_create_stringf: use the in-kernel vasprintf().
- Make nvlist_add_stringf() availabe in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/libnv/dist/nv.h
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/libnv/dist/nvlist.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/libnv/dist/nvpair.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/libnv/dist

2019-07-22 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Jul 23 00:49:16 UTC 2019

Modified Files:
src/sys/external/bsd/libnv/dist: nv.h nvlist.c nvpair.c

Log Message:
- nvpair_create_stringf: use the in-kernel vasprintf().
- Make nvlist_add_stringf() availabe in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/libnv/dist/nv.h
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/libnv/dist/nvlist.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/libnv/dist/nvpair.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/libnv/dist/nv.h
diff -u src/sys/external/bsd/libnv/dist/nv.h:1.2 src/sys/external/bsd/libnv/dist/nv.h:1.3
--- src/sys/external/bsd/libnv/dist/nv.h:1.2	Sat Sep  8 14:02:15 2018
+++ src/sys/external/bsd/libnv/dist/nv.h	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nv.h,v 1.2 2018/09/08 14:02:15 christos Exp $	*/
+/*	$NetBSD: nv.h,v 1.3 2019/07/23 00:49:16 rmind Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -152,9 +152,7 @@ void nvlist_add_bool(nvlist_t *nvl, cons
 void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value);
 void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value);
 void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4);
-#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED)
 void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0);
-#endif
 void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value);
 void nvlist_add_binary(nvlist_t *nvl, const char *name, const void *value, size_t size);
 void nvlist_add_bool_array(nvlist_t *nvl, const char *name, const bool *value, size_t nitems);

Index: src/sys/external/bsd/libnv/dist/nvlist.c
diff -u src/sys/external/bsd/libnv/dist/nvlist.c:1.7 src/sys/external/bsd/libnv/dist/nvlist.c:1.8
--- src/sys/external/bsd/libnv/dist/nvlist.c:1.7	Tue Feb 12 12:49:23 2019
+++ src/sys/external/bsd/libnv/dist/nvlist.c	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvlist.c,v 1.7 2019/02/12 12:49:23 rmind Exp $	*/
+/*	$NetBSD: nvlist.c,v 1.8 2019/07/23 00:49:16 rmind Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvlist.c 335347 2018-06-18 22:57:32Z oshogbo $");
 #else
-__RCSID("$NetBSD: nvlist.c,v 1.7 2019/02/12 12:49:23 rmind Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.8 2019/07/23 00:49:16 rmind Exp $");
 #endif
 
 #include 
@@ -1507,7 +1507,7 @@ nvlist_add_nvpair(nvlist_t *nvl, const n
 	nvpair_insert(>nvl_head, newnvp, nvl);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__NetBSD__)
+#if !defined(_STANDALONE)
 void
 nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...)
 {

Index: src/sys/external/bsd/libnv/dist/nvpair.c
diff -u src/sys/external/bsd/libnv/dist/nvpair.c:1.6 src/sys/external/bsd/libnv/dist/nvpair.c:1.7
--- src/sys/external/bsd/libnv/dist/nvpair.c:1.6	Fri Feb 15 22:49:24 2019
+++ src/sys/external/bsd/libnv/dist/nvpair.c	Tue Jul 23 00:49:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvpair.c,v 1.6 2019/02/15 22:49:24 rmind Exp $	*/
+/*	$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvpair.c 335382 2018-06-19 18:43:02Z lwhsu $");
 #else
-__RCSID("$NetBSD: nvpair.c,v 1.6 2019/02/15 22:49:24 rmind Exp $");
+__RCSID("$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind Exp $");
 #endif
 
 #include 
@@ -1191,7 +1191,7 @@ nvpair_name(const nvpair_t *nvp)
 	return (nvp->nvp_name);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(__NetBSD__)
+#if !defined(_STANDALONE)
 nvpair_t *
 nvpair_create_stringf(const char *name, const char *valuefmt, ...)
 {
@@ -1212,7 +1212,7 @@ nvpair_create_stringv(const char *name, 
 	char *str;
 	int len;
 
-	len = nv_vasprintf(, valuefmt, valueap);
+	len = vasprintf(, valuefmt, valueap);
 	if (len < 0)
 		return (NULL);
 	nvp = nvpair_create_string(name, str);



Re: CVS commit: src

2019-07-22 Thread maya
On Mon, Jul 22, 2019 at 09:48:11PM +0200, Martin Husemann wrote:
> On Tue, Jul 23, 2019 at 04:52:52AM +1000, matthew green wrote:
> > > Deprecate /usr/libdata/firmware.
> > 
> > FWIW, the separation was on purpose.
> > 
> > /libdata/firmware should be for things that are needed during
> > early boot only (eg, firmware that runs between mountroot and
> > init, such as GPU firmware), or network drivers one would use
> > to mount /usr over the network.  one could argue that this
> > driver matches and there's a dozen or more other drivers here
> > so i'm not asking for a revert (and i hope no one is running
> > /usr over wifi!), but /usr/libdata/firmware could come back
> > in the future..
> 
> Besides the "needed early for boot" qualifier, we should also try to
> keep the size of the root partition small. Many systems have firmware
> that can only boot from restricted sized partitions and if you are not
> going for a separate /boot the traditional setup is size restricted /
> plus separately mounted /usr.
> 
> Luckily none of those systems is likely going to need this wifi firmware ;-)
> 
> Martin

It's bluetooth firmware, FWIW.


Re: CVS commit: src

2019-07-22 Thread Martin Husemann
On Tue, Jul 23, 2019 at 04:52:52AM +1000, matthew green wrote:
> > Deprecate /usr/libdata/firmware.
> 
> FWIW, the separation was on purpose.
> 
> /libdata/firmware should be for things that are needed during
> early boot only (eg, firmware that runs between mountroot and
> init, such as GPU firmware), or network drivers one would use
> to mount /usr over the network.  one could argue that this
> driver matches and there's a dozen or more other drivers here
> so i'm not asking for a revert (and i hope no one is running
> /usr over wifi!), but /usr/libdata/firmware could come back
> in the future..

Besides the "needed early for boot" qualifier, we should also try to
keep the size of the root partition small. Many systems have firmware
that can only boot from restricted sized partitions and if you are not
going for a separate /boot the traditional setup is size restricted /
plus separately mounted /usr.

Luckily none of those systems is likely going to need this wifi firmware ;-)

Martin


re: CVS commit: src

2019-07-22 Thread matthew green
"Thomas Klausner" writes:
> Module Name:  src
> Committed By: wiz
> Date: Mon Jul 22 14:47:51 UTC 2019
> 
> Modified Files:
>   src/distrib/sets/lists/base: mi
>   src/etc/mtree: NetBSD.dist.base
>   src/external/broadcom/bcm43xx: Makefile
> 
> Log Message:
> Move bcm43xx to /libdata/firmware, where all the other firmwares live.
> 
> Deprecate /usr/libdata/firmware.

FWIW, the separation was on purpose.

/libdata/firmware should be for things that are needed during
early boot only (eg, firmware that runs between mountroot and
init, such as GPU firmware), or network drivers one would use
to mount /usr over the network.  one could argue that this
driver matches and there's a dozen or more other drivers here
so i'm not asking for a revert (and i hope no one is running
/usr over wifi!), but /usr/libdata/firmware could come back
in the future..


.mrg.


CVS commit: [netbsd-8] src/doc

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:13:23 UTC 2019

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

Log Message:
Tickets #1300 - #1304


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 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.10 src/doc/CHANGES-8.2:1.1.2.11
--- src/doc/CHANGES-8.2:1.1.2.10	Mon Jul 22 16:32:17 2019
+++ src/doc/CHANGES-8.2	Mon Jul 22 18:13:23 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.10 2019/07/22 16:32:17 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.11 2019/07/22 18:13:23 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -247,3 +247,79 @@ sys/compat/netbsd32/netbsd32_ioctl.h		1.
 	Correct misleading macro argument names.
 	[rin, ticket #1054]
 
+sys/arch/x86/pci/if_vmx.c			1.31
+sys/arch/x86/pci/if_vmx.c			1.32 (via patch)
+
+	Eliminate IFF_RUNNING checking code from vmxnet3_init_locked().
+	Fix vmx(4) MTU setting.
+	[knakahara, ticket #1300]
+
+sys/dev/pci/ixgbe/if_sriov.c			1.5-1.6
+sys/dev/pci/ixgbe/ix_txrx.c			1.53-1.54
+sys/dev/pci/ixgbe/ixgbe_x550.h			1.5
+sys/dev/pci/ixgbe/ixgbe.c			1.169-1.170,1.176,1.179,1.181,1.185-1.186,1.188-1.192 via patch
+sys/dev/pci/ixgbe/ixgbe.h			1.53,1.55
+sys/dev/pci/ixgbe/ixgbe_82599.c			1.21
+sys/dev/pci/ixgbe/ixgbe_api.c			1.22-1.23
+sys/dev/pci/ixgbe/ixgbe_api.h			1.14-1.15
+sys/dev/pci/ixgbe/ixgbe_x550.c			1.14-1.15
+sys/dev/pci/ixgbe/ixgbe_common.c		1.23
+sys/dev/pci/ixgbe/ixgbe_common.h		1.14
+sys/dev/pci/ixgbe/ixgbe_mbx.c			1.11
+sys/dev/pci/ixgbe/ixgbe_mbx.h			1.14
+sys/dev/pci/ixgbe/ixgbe_netmap.c		1.2
+sys/dev/pci/ixgbe/ixgbe_features.h		1.2
+sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.9
+sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.9-1.10
+sys/dev/pci/ixgbe/ixgbe_phy.c			1.18
+sys/dev/pci/ixgbe/ixgbe_type.h			1.37,1.39-1.40
+sys/dev/pci/ixgbe/ixgbe_vf.c			1.18
+sys/dev/pci/ixgbe/ixv.c1.112-1.114,1.117,1.119 via patch
+
+	Sync ixgbe up to 20190717 except ETHERCAP or ixv's VLAN stuff:
+	- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM(C3000).
+	- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again.
+	- On X550EMU, use ixgbe_identify_sfp_module_X550em() instead of
+	  ixgbe_identify_module_generic(). ixgbe_identify_sfp_module_X550em()
+	  has extra check (e.g. exclude 1G copper).
+	- It's not required to calculate unused queues' statistics.
+	- Remove ETHERCAP_VLAN_HWFILTER's definition.
+	- Match 82598_BX(0x1508), 82599_KR(0x1517), 82599_SFP_EM(0x1507),
+	  X550EM_X_XFI(0x15b0), X550EM_A_QSFP(0x15ca) and
+	  X550EM_A_QSFP_N(0x15cc)
+	- Add missing XFI support into ixgbe_get_link_capabilities_X550em().
+	- Other than IXGBE_VF_RESET should wait ACK, so use
+	  ixgbevf_write_msg_read_ack() instead of write_posted() in
+	  ixgbe_update_mc_addr_list_vf().
+	- When ixv_check_link() failed in the watchdog function, reset the
+	  interface.
+	- Remove RXCSUM register modification in
+	  ixv_initialize_receive_units(). It seems it's not required.
+	- Remove some debug printf in ixv_print_debug_info().
+	- Calculate vector's bit location correctly when the vector >= 31
+	  in ixgbe_allocate_msix().
+	- Fix hung queue check when the queue number >= 31.
+	- On ENETRESET case, not continue and quit the ifflags_cb() function
+	  because if_init() will do the same thing.
+	- Fix bugs in unused code.
+	- Fix typo in comment.
+	- Fix typo in unused code.
+	- Whitespace fixes. KNF.
+	[msaitoh, ticket #1301]
+
+sys/kern/sys_ptrace_common.c			1.58
+
+	Enhance locking of ptrace_update_lwp.
+	Do not switch lwp for PT_SET_SIGINFO.
+	[kamil, ticket #1302]
+
+sys/netipsec/key.c1.264
+
+	Avoid a race condition between SA (sav) manipulations.
+	[ozaki-r, ticket #1303]
+
+usr.bin/vmstat/vmstat.c1.226
+
+	Fix "vmstat -m" numbers running into each other.
+	[mrg, ticket #1304]
+



CVS commit: [netbsd-8] src/doc

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:13:23 UTC 2019

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

Log Message:
Tickets #1300 - #1304


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 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: [netbsd-8] src/usr.bin/vmstat

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:10:32 UTC 2019

Modified Files:
src/usr.bin/vmstat [netbsd-8]: vmstat.c

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

usr.bin/vmstat/vmstat.c: revision 1.226

Use PRWORD for printing -m/-mW totals so fields don't run in to each other.

While here, update field widths for 'vmstat -mW' for modern machines.


To generate a diff of this commit:
cvs rdiff -u -r1.216.6.4 -r1.216.6.5 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.216.6.4 src/usr.bin/vmstat/vmstat.c:1.216.6.5
--- src/usr.bin/vmstat/vmstat.c:1.216.6.4	Tue Mar  6 11:15:33 2018
+++ src/usr.bin/vmstat/vmstat.c	Mon Jul 22 18:10:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.216.6.4 2018/03/06 11:15:33 martin Exp $ */
+/* $NetBSD: vmstat.c,v 1.216.6.5 2019/07/22 18:10:32 martin Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.216.6.4 2018/03/06 11:15:33 martin Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.216.6.5 2019/07/22 18:10:32 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1414,7 +1414,7 @@ dopool_sysctl(int verbose, int wide)
 	size_t i, len;
 	int name_len, ovflw;
 	struct pool_sysctl *pp, *data;
-	char in_use[8], avail[8], maxp[32];
+	char maxp[32];
 
 	data = asysctlbyname("kern.pool", );
 	if (data == NULL)
@@ -1426,23 +1426,23 @@ dopool_sysctl(int verbose, int wide)
 
 	(void)printf("Memory resource pool statistics\n");
 	(void)printf(
-	"%-*s%*s%*s%5s%*s%s%s%*s%*s%6s%s%6s%6s%6s%5s%s%s\n",
+	"%-*s%*s%*s%*s%*s%s%s%*s%*s%*s%s%*s%6s%*s%5s%s%s\n",
 	wide ? 16 : 11, "Name",
-	wide ? 6 : 5, "Size",
+	wide ? 7 : 5, "Size",
 	wide ? 12 : 9, "Requests",
-	"Fail",
+	wide ? 8 : 5, "Fail",
 	wide ? 12 : 9, "Releases",
-	wide ? "  InUse" : "",
-	wide ? " Avail" : "",
-	wide ? 7 : 6, "Pgreq",
-	wide ? 7 : 6, "Pgrel",
-	"Npage",
+	wide ? "InUse" : "",
+	wide ? "Avail" : "",
+	wide ? 11 : 6, "Pgreq",
+	wide ? 11 : 6, "Pgrel",
+	wide ? 8 : 6, "Npage",
 	wide ? " PageSz" : "",
-	"Hiwat",
+	wide ? 7 : 6, "Hiwat",
 	"Minpg",
-	"Maxpg",
+	wide ? 7 : 6, "Maxpg",
 	"Idle",
-	wide ? " Flags" : "",
+	wide ? "  Flags" : "",
 	wide ? "   Util" : "");
 
 	name_len = MIN((int)sizeof(pp->pr_wchan), wide ? 16 : 11);
@@ -1457,35 +1457,33 @@ dopool_sysctl(int verbose, int wide)
 			pp->pr_maxpages);
 		ovflw = 0;
 		PRWORD(ovflw, "%-*s", name_len, 0, pp->pr_wchan);
-		PRWORD(ovflw, " %*" PRIu64, wide ? 6 : 5, 1, pp->pr_size);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 5, 1, pp->pr_size);
 		PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1, pp->pr_nget);
 		pool_totals.pt_nget += pp->pr_nget;
-		PRWORD(ovflw, " %*" PRIu64, 5, 1, pp->pr_nfail);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 8 : 5, 1, pp->pr_nfail);
 		pool_totals.pt_nfail += pp->pr_nfail;
 		PRWORD(ovflw, " %*" PRIu64, wide ? 12 : 9, 1, pp->pr_nput);
 		pool_totals.pt_nput += pp->pr_nput;
 		if (wide) {
-			PRWORD(ovflw, " %*" PRIu64, 7, 1, pp->pr_nout);
+			PRWORD(ovflw, " %*" PRIu64, 9, 1, pp->pr_nout);
 			pool_totals.pt_nout += pp->pr_nout;
-		}
-		if (wide) {
-			PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_nitems);
+			PRWORD(ovflw, " %*" PRIu64, 9, 1, pp->pr_nitems);
 			pool_totals.pt_nitems += pp->pr_nitems;
 		}
-		PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_npagealloc);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 11 : 6, 1, pp->pr_npagealloc);
 		pool_totals.pt_npagealloc += pp->pr_npagealloc;
-		PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_npagefree);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 11 : 6, 1, pp->pr_npagefree);
 		pool_totals.pt_npagefree += pp->pr_npagefree;
-		PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_npages);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 8 : 6, 1, pp->pr_npages);
 		pool_totals.pt_npages += pp->pr_npages;
 		if (wide)
 			PRWORD(ovflw, " %*" PRIu64, 7, 1, pp->pr_pagesize);
-		PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_hiwat);
+		PRWORD(ovflw, " %*" PRIu64, wide ? 7 : 6, 1, pp->pr_hiwat);
 		PRWORD(ovflw, " %*" PRIu64, 6, 1, pp->pr_minpages);
-		PRWORD(ovflw, " %*s", 6, 1, maxp);
+		PRWORD(ovflw, " %*s", wide ? 7 : 6, 1, maxp);
 		PRWORD(ovflw, " %*" PRIu64, 5, 1, pp->pr_nidle);
 		if (wide)
-			PRWORD(ovflw, " 0x%0*" PRIx64, 4, 1,
+			PRWORD(ovflw, " 0x%0*" PRIx64, 5, 1,
 			pp->pr_flags);
 
 		this_inuse = pp->pr_nout * pp->pr_size;
@@ -1510,25 +1508,20 @@ dopool_sysctl(int verbose, int wide)
 		}
 		(void)printf("\n");
 	}
+	ovflw = 0;
+	PRWORD(ovflw, "%-*s", name_len, 0, "Totals");
+	PRWORD(ovflw, " %*s", wide ? 7 : 5, 1, "");
+	PRWORD(ovflw, " %*" 

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

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:07:07 UTC 2019

Modified Files:
src/sys/netipsec [netbsd-8]: key.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1303):

sys/netipsec/key.c: revision 1.264

Avoid a race condition between SA (sav) manipulations

An sav can be removed from belonging list(s) twice resulting in an assertion
failure of pslist.  It can occur if the following two operations interleave:

(i) a deletion or a update of an SA via the API, and
(ii) a state change (key_sa_chgstate) of the same SA by the timer.

Note that even (ii) removes an sav once from its list(s) on a update.
The cause of the race condition is that the two operations are not serialized
and (i) doesn't get and remove an sav from belonging list(s) atomically.  So
(ii) can be inserted between an acquisition and a removal of (i).

Avoid the race condition by making (i) atomic.


To generate a diff of this commit:
cvs rdiff -u -r1.163.2.10 -r1.163.2.11 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.163.2.10 src/sys/netipsec/key.c:1.163.2.11
--- src/sys/netipsec/key.c:1.163.2.10	Sat Aug 25 14:35:21 2018
+++ src/sys/netipsec/key.c	Mon Jul 22 18:07:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.163.2.10 2018/08/25 14:35:21 martin Exp $	*/
+/*	$NetBSD: key.c,v 1.163.2.11 2019/07/22 18:07:07 martin Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.10 2018/08/25 14:35:21 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.11 2019/07/22 18:07:07 martin Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -699,8 +699,8 @@ static bool key_sah_has_sav(struct secas
 static void key_sah_ref(struct secashead *);
 static void key_sah_unref(struct secashead *);
 static void key_init_sav(struct secasvar *);
+static void key_wait_sav(struct secasvar *);
 static void key_destroy_sav(struct secasvar *);
-static void key_destroy_sav_with_ref(struct secasvar *);
 static struct secasvar *key_newsav(struct mbuf *,
 	const struct sadb_msghdr *, int *, const char*, int);
 #define	KEY_NEWSAV(m, sadb, e)\
@@ -1601,30 +1601,20 @@ key_destroy_sav(struct secasvar *sav)
 }
 
 /*
- * Destroy sav with holding its reference.
+ * Wait for references of a passed sav to go away.
  */
 static void
-key_destroy_sav_with_ref(struct secasvar *sav)
+key_wait_sav(struct secasvar *sav)
 {
 
 	ASSERT_SLEEPABLE();
 
 	mutex_enter(_sad.lock);
-	sav->state = SADB_SASTATE_DEAD;
-	SAVLIST_WRITER_REMOVE(sav);
-	SAVLUT_WRITER_REMOVE(sav);
-	mutex_exit(_sad.lock);
-
-	/* We cannot unref with holding key_sad.lock */
-	KEY_SA_UNREF();
-
-	mutex_enter(_sad.lock);
+	KASSERT(sav->state == SADB_SASTATE_DEAD);
 	KDASSERT(mutex_ownable(softnet_lock));
 	key_sad_pserialize_perform();
 	localcount_drain(>localcount, _sad.cv_lc, _sad.lock);
 	mutex_exit(_sad.lock);
-
-	key_destroy_sav(sav);
 }
 
 /* %%% SPD management */
@@ -3521,6 +3511,38 @@ out:
 }
 
 /*
+ * Search SAD litmited alive SA by an SPI and remove it from a list.
+ * OUT:
+ *	NULL	: not found
+ *	others	: found, pointer to a SA.
+ */
+static struct secasvar *
+key_lookup_and_remove_sav(struct secashead *sah, u_int32_t spi)
+{
+	struct secasvar *sav = NULL;
+	u_int state;
+
+	/* search all status */
+	mutex_enter(_sad.lock);
+	SASTATE_ALIVE_FOREACH(state) {
+		SAVLIST_WRITER_FOREACH(sav, sah, state) {
+			KASSERT(sav->state == state);
+
+			if (sav->spi == spi) {
+sav->state = SADB_SASTATE_DEAD;
+SAVLIST_WRITER_REMOVE(sav);
+SAVLUT_WRITER_REMOVE(sav);
+goto out;
+			}
+		}
+	}
+out:
+	mutex_exit(_sad.lock);
+
+	return sav;
+}
+
+/*
  * Free allocated data to member variables of sav:
  * sav->replay, sav->key_* and sav->lft_*.
  */
@@ -5598,7 +5620,7 @@ key_api_update(struct socket *so, struct
 	const struct sockaddr *src, *dst;
 	struct secasindex saidx;
 	struct secashead *sah;
-	struct secasvar *sav, *newsav;
+	struct secasvar *sav, *newsav, *oldsav;
 	u_int16_t proto;
 	u_int8_t mode;
 	u_int16_t reqid;
@@ -5751,12 +5773,25 @@ key_api_update(struct socket *so, struct
 	mutex_exit(_sad.lock);
 	key_validate_savlist(sah, SADB_SASTATE_MATURE);
 
+	/*
+	 * We need to lookup and remove the sav atomically, so get it again
+	 * here by a special API while we have a reference to it.
+	 */
+	oldsav = key_lookup_and_remove_sav(sah, sa0->sadb_sa_spi);
+	/* We can release the reference because of oldsav */
+	KEY_SA_UNREF();
+	if (oldsav == NULL) {
+		/* Someone has already removed the sav.  Nothing to do. */
+	} else {
+		key_wait_sav(oldsav);
+		key_destroy_sav(oldsav);
+		oldsav = NULL;
+	}
+	sav = NULL;
+
 	key_sah_unref(sah);
 	sah = NULL;
 
-	key_destroy_sav_with_ref(sav);
-	sav 

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

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:02:09 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1302):

sys/kern/sys_ptrace_common.c: revision 1.58

Enhance locking of ptrace_update_lwp

Replace lwp_delref() + mutex_enter() with: mutex_enter() + lwp_delref2().=

This avoids extra taking and exiting from a mutex.

Add missing mutex_exit() for LW_SYSTEM.

Do not switch lwp for PT_SET_SIGINFO. This operation is not needed and
avoids panic for >2 LWPs as p_lock is attempted to be entered again in a
critical section.


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

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 18:02:09 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1302):

sys/kern/sys_ptrace_common.c: revision 1.58

Enhance locking of ptrace_update_lwp

Replace lwp_delref() + mutex_enter() with: mutex_enter() + lwp_delref2().=

This avoids extra taking and exiting from a mutex.

Add missing mutex_exit() for LW_SYSTEM.

Do not switch lwp for PT_SET_SIGINFO. This operation is not needed and
avoids panic for >2 LWPs as p_lock is attempted to be entered again in a
critical section.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.4 -r1.22.2.5 src/sys/kern/sys_ptrace_common.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/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.22.2.4 src/sys/kern/sys_ptrace_common.c:1.22.2.5
--- src/sys/kern/sys_ptrace_common.c:1.22.2.4	Thu Nov 29 14:58:25 2018
+++ src/sys/kern/sys_ptrace_common.c	Mon Jul 22 18:02:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.4 2018/11/29 14:58:25 martin Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.5 2019/07/22 18:02:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.4 2018/11/29 14:58:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.5 2019/07/22 18:02:09 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -527,9 +527,9 @@ ptrace_update_lwp(struct proc *t, struct
 	if (lid == 0 || lid == (*lt)->l_lid || t->p_nlwps == 1)
 		return 0;
 
-	lwp_delref(*lt);
-
 	mutex_enter(t->p_lock);
+	lwp_delref2(*lt);
+
 	*lt = lwp_find(t, lid);
 	if (*lt == NULL) {
 		mutex_exit(t->p_lock);
@@ -537,6 +537,7 @@ ptrace_update_lwp(struct proc *t, struct
 	}
 
 	if ((*lt)->l_flag & LW_SYSTEM) {
+		mutex_exit(t->p_lock);
 		*lt = NULL;
 		return EINVAL;
 	}
@@ -574,9 +575,6 @@ ptrace_set_siginfo(struct proc *t, struc
 	if (psi.psi_siginfo.si_signo < 0 || psi.psi_siginfo.si_signo >= NSIG)
 		return EINVAL;
 
-	if ((error = ptrace_update_lwp(t, lt, psi.psi_lwpid)) != 0)
-		return error;
-
 	t->p_sigctx.ps_faked = true;
 	t->p_sigctx.ps_info = psi.psi_siginfo._info;
 	t->p_sigctx.ps_lwp = psi.psi_lwpid;



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

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 17:53:35 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: if_sriov.c ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_features.h ixgbe_mbx.c ixgbe_mbx.h ixgbe_netbsd.c
ixgbe_netbsd.h ixgbe_netmap.c ixgbe_phy.c ixgbe_type.h ixgbe_vf.c
ixgbe_x550.c ixgbe_x550.h ixv.c

Log Message:
Pull up the following revisions (via patch), requested by msaitoh in
ticket #1301:

sys/dev/pci/ixgbe/if_sriov.c1.5-1.6
sys/dev/pci/ixgbe/ix_txrx.c 1.53-1.54
sys/dev/pci/ixgbe/ixgbe_x550.h  1.5
sys/dev/pci/ixgbe/ixgbe.c   
1.169-1.170,1.176,1.179,1.181,1.185-1.186,1.188-1.192 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.53,1.55
sys/dev/pci/ixgbe/ixgbe_82599.c 1.21
sys/dev/pci/ixgbe/ixgbe_api.c   1.22-1.23
sys/dev/pci/ixgbe/ixgbe_api.h   1.14-1.15
sys/dev/pci/ixgbe/ixgbe_x550.c  1.14-1.15
sys/dev/pci/ixgbe/ixgbe_common.c1.23
sys/dev/pci/ixgbe/ixgbe_common.h1.14
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.11
sys/dev/pci/ixgbe/ixgbe_mbx.h   1.14
sys/dev/pci/ixgbe/ixgbe_netmap.c1.2
sys/dev/pci/ixgbe/ixgbe_features.h  1.2
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.9
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.9-1.10
sys/dev/pci/ixgbe/ixgbe_phy.c   1.18
sys/dev/pci/ixgbe/ixgbe_type.h  1.37,1.39-1.40
sys/dev/pci/ixgbe/ixgbe_vf.c1.18
sys/dev/pci/ixgbe/ixv.c 1.112-1.114,1.117,1.119 
via patch

Sync ixgbe up to 20190717 except ETHERCAP or ixv's VLAN stuff:
- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM(C3000).
- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again.
- On X550EMU, use ixgbe_identify_sfp_module_X550em() instead of
  ixgbe_identify_module_generic(). ixgbe_identify_sfp_module_X550em()
  has extra check (e.g. exclude 1G copper).
- It's not required to calculate unused queues' statistics.
- Remove ETHERCAP_VLAN_HWFILTER's definition.
- Match 82598_BX(0x1508), 82599_KR(0x1517), 82599_SFP_EM(0x1507),
  X550EM_X_XFI(0x15b0), X550EM_A_QSFP(0x15ca) and
  X550EM_A_QSFP_N(0x15cc)
- Add missing XFI support into ixgbe_get_link_capabilities_X550em().
- Other than IXGBE_VF_RESET should wait ACK, so use
  ixgbevf_write_msg_read_ack() instead of write_posted() in
  ixgbe_update_mc_addr_list_vf().
- When ixv_check_link() failed in the watchdog function, reset the
  interface.
- Remove RXCSUM register modification in
  ixv_initialize_receive_units(). It seems it's not required.
- Remove some debug printf in ixv_print_debug_info().
- Calculate vector's bit location correctly when the vector >= 31
  in ixgbe_allocate_msix().
- Fix hung queue check when the queue number >= 31.
- On ENETRESET case, not continue and quit the ifflags_cb() function
  because if_init() will do the same thing.
- Fix bugs in unused code.
- Fix typo in comment.
- Fix typo in unused code.
- Whitespace fixes. KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.4 -r1.1.4.5 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.24.2.15 -r1.24.2.16 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.29 -r1.88.2.30 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.24.6.16 -r1.24.6.17 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.14.8.4 -r1.14.8.5 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.15.8.4 -r1.15.8.5 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.9.8.3 -r1.9.8.4 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.13.2.4 -r1.13.2.5 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.7.8.4 -r1.7.8.5 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.1.4.2 -r1.1.4.3 src/sys/dev/pci/ixgbe/ixgbe_features.h \
src/sys/dev/pci/ixgbe/ixgbe_netmap.c
cvs rdiff -u -r1.6.8.2 -r1.6.8.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.10.8.2 -r1.10.8.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.11.6.3 -r1.11.6.4 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.22.2.8 -r1.22.2.9 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.12.8.2 -r1.12.8.3 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.5.6.5 -r1.5.6.6 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.2.12.2 -r1.2.12.3 src/sys/dev/pci/ixgbe/ixgbe_x550.h
cvs rdiff -u -r1.56.2.21 -r1.56.2.22 src/sys/dev/pci/ixgbe/ixv.c

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



Re: CVS commit: src/usr.bin/printf

2019-07-22 Thread Tobias Nygren
On Tue, 23 Jul 2019 00:31:32 +0700
Robert Elz  wrote:

> Date:Mon, 22 Jul 2019 12:23:35 +0200
> From:Tobias Nygren 
> Message-ID:  <20190722122335.55c0d421a18a082c8d67b...@netbsd.org>
> 
>   | Please exercise caution when changing established userland behaviour.
>   | This change broke the pkgsrc/lang/openjdk8(1) build.
> 
> I stand behind my previous reply, if that change seemed to break
> anything, then all it was really doing was revealing previous brokenness.
> 
> However, as well as saying that printf(1) has no options, and (by omission)
> also saying that it should not do getopt processing, POSIX also says
> that if the format arg (ie: the first arg) contains no % cpnversions,
> and yet there are more args (which more or less by defnition can never
> be used) then the results are unspecified.
> 
> If what is, I am guessing, the "established userland behaviour" was
>   printf -- format args
> which is truly pointless  (and incoorrect), but used to be accepted,
> then we can continue to allow that to work, relying upon that
> unspecified results clause from POSIX, "--" contains no % conversion,
> yet there are more args that nothing would normally ever consume
> (technically that format string is supposed to be used over and over
> again until the args are all used up ... but obviously that would never
> happen in this case - which is why it leads to unspecified results).
> 
> I intend to commit a change to printf in a few minutes to make it work
> like this (with the caveat that the "no % conversions" test will be "no
> % characters" which guarantees no % conversions of course, but is
> simpler).
> 
> If there is only one arg, it will always be treated as a format, so
>   printf ---\\n
> will continue working as it should, or if the arg contains a % char,
> then it will also be treated as a format, so
>   printf -%d\\n 3
> will print -3 as it should (neither of those wworked until recently).
> 
> This doesn't mean that whatever script in the openjdk8 build was using
> printf incorrectly shouldn't be fixed ... it should still be.
> 
> kre

Hi,

This sounds like a reasonable compromise in the interest of preserving
compatibility with other implementations. Thanks!

-Tobias


CVS commit: [netbsd-8] src/sys/arch/x86/pci

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 17:47:16 UTC 2019

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1300):

sys/arch/x86/pci/if_vmx.c: revision 1.31
sys/arch/x86/pci/if_vmx.c: revision 1.32 (via patch)

Eliminate IFF_RUNNING checking code from vmxnet3_init_locked().

Advised by hikaru@n.o, thanks.

 -

Fix vmx(4) MTU setting.

Advised by hikaru@n.o and msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.19.6.5 -r1.19.6.6 src/sys/arch/x86/pci/if_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/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.19.6.5 src/sys/arch/x86/pci/if_vmx.c:1.19.6.6
--- src/sys/arch/x86/pci/if_vmx.c:1.19.6.5	Thu Mar 21 14:27:02 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Jul 22 17:47:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.19.6.5 2019/03/21 14:27:02 martin Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.19.6.6 2019/07/22 17:47:16 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.5 2019/03/21 14:27:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.6 2019/07/22 17:47:16 martin Exp $");
 
 #include 
 #include 
@@ -372,7 +372,6 @@ void vmxnet3_start_locked(struct ifnet *
 void vmxnet3_start(struct ifnet *);
 
 void vmxnet3_set_rxfilter(struct vmxnet3_softc *);
-int vmxnet3_change_mtu(struct vmxnet3_softc *, int);
 int vmxnet3_ioctl(struct ifnet *, u_long, void *);
 int vmxnet3_ifflags_cb(struct ethercom *);
 
@@ -1748,14 +1747,12 @@ void
 vmxnet3_evintr(struct vmxnet3_softc *sc)
 {
 	device_t dev;
-	struct ifnet *ifp;
 	struct vmxnet3_txq_shared *ts;
 	struct vmxnet3_rxq_shared *rs;
 	uint32_t event;
 	int reset;
 
 	dev = sc->vmx_dev;
-	ifp = >vmx_ethercom.ec_if;
 	reset = 0;
 
 	VMXNET3_CORE_LOCK(sc);
@@ -1787,10 +1784,8 @@ vmxnet3_evintr(struct vmxnet3_softc *sc)
 	if (event & VMXNET3_EVENT_DEBUG)
 		device_printf(dev, "debug event\n");
 
-	if (reset != 0) {
-		ifp->if_flags &= ~IFF_RUNNING;
+	if (reset != 0)
 		vmxnet3_init_locked(sc);
-	}
 
 	VMXNET3_CORE_UNLOCK(sc);
 }
@@ -2500,9 +2495,6 @@ vmxnet3_init_locked(struct vmxnet3_softc
 	struct ifnet *ifp = >vmx_ethercom.ec_if;
 	int error;
 
-	if (ifp->if_flags & IFF_RUNNING)
-		return 0;
-
 	vmxnet3_stop_locked(sc);
 
 	error = vmxnet3_reinit(sc);
@@ -2880,22 +2872,6 @@ setit:
 }
 
 int
-vmxnet3_change_mtu(struct vmxnet3_softc *sc, int mtu)
-{
-	struct ifnet *ifp = >vmx_ethercom.ec_if;
-
-	if (mtu < VMXNET3_MIN_MTU || mtu > VMXNET3_MAX_MTU)
-		return EINVAL;
-
-	if (ifp->if_flags & IFF_RUNNING) {
-		ifp->if_flags &= ~IFF_RUNNING;
-		vmxnet3_init_locked(sc);
-	}
-
-	return 0;
-}
-
-int
 vmxnet3_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct vmxnet3_softc *sc = ifp->if_softc;
@@ -2903,13 +2879,20 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 	int s, error = 0;
 
 	switch (cmd) {
-	case SIOCSIFMTU:
-		if (ifp->if_mtu != ifr->ifr_mtu) {
-			VMXNET3_CORE_LOCK(sc);
-			error = vmxnet3_change_mtu(sc, ifr->ifr_mtu);
-			VMXNET3_CORE_UNLOCK(sc);
+	case SIOCSIFMTU: {
+		int nmtu = ifr->ifr_mtu;
+
+		if (nmtu < VMXNET3_MIN_MTU || nmtu > VMXNET3_MAX_MTU) {
+			error = EINVAL;
+			break;
+		}
+		if (ifp->if_mtu != nmtu) {
+			error = ether_ioctl(ifp, cmd, data);
+			if (error == ENETRESET)
+error = vmxnet3_init(ifp);
 		}
 		break;
+	}
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
 		s = splnet();
@@ -3014,11 +2997,9 @@ void
 vmxnet3_tick(void *xsc)
 {
 	struct vmxnet3_softc *sc;
-	struct ifnet *ifp;
 	int i, timedout;
 
 	sc = xsc;
-	ifp = >vmx_ethercom.ec_if;
 	timedout = 0;
 
 	VMXNET3_CORE_LOCK(sc);
@@ -3028,10 +3009,9 @@ vmxnet3_tick(void *xsc)
 	for (i = 0; i < sc->vmx_ntxqueues; i++)
 		timedout |= vmxnet3_watchdog(>vmx_txq[i]);
 
-	if (timedout != 0) {
-		ifp->if_flags &= ~IFF_RUNNING;
+	if (timedout != 0)
 		vmxnet3_init_locked(sc);
-	} else
+	else
 		callout_reset(>vmx_tick, hz, vmxnet3_tick, sc);
 
 	VMXNET3_CORE_UNLOCK(sc);



CVS commit: [netbsd-8] src/sys/arch/x86/pci

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 17:47:16 UTC 2019

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1300):

sys/arch/x86/pci/if_vmx.c: revision 1.31
sys/arch/x86/pci/if_vmx.c: revision 1.32 (via patch)

Eliminate IFF_RUNNING checking code from vmxnet3_init_locked().

Advised by hikaru@n.o, thanks.

 -

Fix vmx(4) MTU setting.

Advised by hikaru@n.o and msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.19.6.5 -r1.19.6.6 src/sys/arch/x86/pci/if_vmx.c

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



Re: CVS commit: src/usr.bin/printf

2019-07-22 Thread Robert Elz
Date:Mon, 22 Jul 2019 12:23:35 +0200
From:Tobias Nygren 
Message-ID:  <20190722122335.55c0d421a18a082c8d67b...@netbsd.org>

  | Please exercise caution when changing established userland behaviour.
  | This change broke the pkgsrc/lang/openjdk8(1) build.

I stand behind my previous reply, if that change seemed to break
anything, then all it was really doing was revealing previous brokenness.

However, as well as saying that printf(1) has no options, and (by omission)
also saying that it should not do getopt processing, POSIX also says
that if the format arg (ie: the first arg) contains no % cpnversions,
and yet there are more args (which more or less by defnition can never
be used) then the results are unspecified.

If what is, I am guessing, the "established userland behaviour" was
printf -- format args
which is truly pointless  (and incoorrect), but used to be accepted,
then we can continue to allow that to work, relying upon that
unspecified results clause from POSIX, "--" contains no % conversion,
yet there are more args that nothing would normally ever consume
(technically that format string is supposed to be used over and over
again until the args are all used up ... but obviously that would never
happen in this case - which is why it leads to unspecified results).

I intend to commit a change to printf in a few minutes to make it work
like this (with the caveat that the "no % conversions" test will be "no
% characters" which guarantees no % conversions of course, but is
simpler).

If there is only one arg, it will always be treated as a format, so
printf ---\\n
will continue working as it should, or if the arg contains a % char,
then it will also be treated as a format, so
printf -%d\\n 3
will print -3 as it should (neither of those wworked until recently).

This doesn't mean that whatever script in the openjdk8 build was using
printf incorrectly shouldn't be fixed ... it should still be.

kre



CVS commit: src/usr.bin/printf

2019-07-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 22 17:34:31 UTC 2019

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

Log Message:
Amend the previous change: we can have (almost) the best of both
worlds, as when the first arg (which should be the format) contains
no % conversions, and there are more args, the results are unspecified
(according to POSIX).

We can use this so the previous usage
printf -- format arg...
(which is stupid, and pointless, but used to work) continues to
simply ignore the -- (unspecified results mean we can do whatever
feels good...)

This brings back the #if 0'd block from the previous modification
(so there is no longer anything that needs cleaning up later) but runs
the getopt() loop it contained only when there are at least 2 args
(so any 1 arg printf always uses that arg as the format string,
whatever it contains, including just "--") and also only when the
first (format) arg contains no '%' characters (which guarantees no %
conversions without needing to actually parse the arg).  This is the
(or a) "unspecified results" case from POSIX, so we are free to do
anything we like - including assuming that we might have options
(we don't) and pretending to process them.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/printf/printf.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/printf/printf.c
diff -u src/usr.bin/printf/printf.c:1.49 src/usr.bin/printf/printf.c:1.50
--- src/usr.bin/printf/printf.c:1.49	Sun Jul 21 15:25:39 2019
+++ src/usr.bin/printf/printf.c	Mon Jul 22 17:34:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: printf.c,v 1.49 2019/07/21 15:25:39 kre Exp $	*/
+/*	$NetBSD: printf.c,v 1.50 2019/07/22 17:34:31 kre Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)printf.c	8.2 (Berkeley) 3/22/95";
 #else
-__RCSID("$NetBSD: printf.c,v 1.49 2019/07/21 15:25:39 kre Exp $");
+__RCSID("$NetBSD: printf.c,v 1.50 2019/07/22 17:34:31 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -138,27 +138,39 @@ main(int argc, char *argv[])
 
 	rval = 0;	/* clear for builtin versions (avoid holdover) */
 
-#if 0
-	int o;
-
 	/*
 	 * printf does not comply with Posix XBD 12.2 - there are no opts,
 	 * not even the -- end of options marker.   Do not run getoot().
 	 */
-	while ((o = getopt(argc, argv, "")) != -1) {
-		switch (o) {
-		case '?':
-		default:
-			usage();
-			return 1;
+	if (argc > 2 && strchr(argv[1], '%') == NULL) {
+		int o;
+
+		/*
+		 * except that if there are multiple args and
+		 * the first (the nominal format) contains no '%'
+		 * conversions (which we will approximate as no '%'
+		 * characters at all, conversions or not) then the
+		 * results are unspecified, and we can do what we
+		 * like.   So in that case, for some backward compat
+		 * to scripts which (stupidly) do:
+		 *	printf -- format args
+		 * process this case the old way.
+		 */
+
+		while ((o = getopt(argc, argv, "")) != -1) {
+			switch (o) {
+			case '?':
+			default:
+usage();
+return 1;
+			}
 		}
+		argc -= optind;
+		argv += optind;
+	} else {
+		argc -= 1;	/* drop argv[0] (the program name) */
+		argv += 1;
 	}
-	argc -= optind;
-	argv += optind;
-#else
-	argc -= 1;
-	argv += 1;
-#endif
 
 	if (argc < 1) {
 		usage();



CVS commit: src/usr.bin/printf

2019-07-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 22 17:34:31 UTC 2019

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

Log Message:
Amend the previous change: we can have (almost) the best of both
worlds, as when the first arg (which should be the format) contains
no % conversions, and there are more args, the results are unspecified
(according to POSIX).

We can use this so the previous usage
printf -- format arg...
(which is stupid, and pointless, but used to work) continues to
simply ignore the -- (unspecified results mean we can do whatever
feels good...)

This brings back the #if 0'd block from the previous modification
(so there is no longer anything that needs cleaning up later) but runs
the getopt() loop it contained only when there are at least 2 args
(so any 1 arg printf always uses that arg as the format string,
whatever it contains, including just "--") and also only when the
first (format) arg contains no '%' characters (which guarantees no %
conversions without needing to actually parse the arg).  This is the
(or a) "unspecified results" case from POSIX, so we are free to do
anything we like - including assuming that we might have options
(we don't) and pretending to process them.


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

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:32:17 UTC 2019

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

Log Message:
Ticket #1054


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 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.9 src/doc/CHANGES-8.2:1.1.2.10
--- src/doc/CHANGES-8.2:1.1.2.9	Wed Jul 17 16:22:40 2019
+++ src/doc/CHANGES-8.2	Mon Jul 22 16:32:17 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.9 2019/07/17 16:22:40 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.10 2019/07/22 16:32:17 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -240,3 +240,10 @@ sys/dev/usb/if_athn_usb.c			1.24,1.31-1.
 	- Fix the detach path to prevent panic.
 	[msaitoh, ticket #1299]
 
+sys/compat/netbsd32/netbsd32_ioctl.c		1.98,1.99
+sys/compat/netbsd32/netbsd32_ioctl.h		1.65
+
+	Add BIOCSRTIMEOUT32 to fix tcpdump for COMPAT_NETBSD32.
+	Correct misleading macro argument names.
+	[rin, ticket #1054]
+



CVS commit: [netbsd-8] src/doc

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:32:17 UTC 2019

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

Log Message:
Ticket #1054


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 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: [netbsd-8] src/sys/compat/netbsd32

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:27:29 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1054):

sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.65
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.98
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.99

PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.

 -

Correct misleading names of dummy variables. No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.1 -r1.89.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56.8.1 -r1.56.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.2
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.1	Mon Nov 27 14:07:53 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Jul 22 16:27:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1303,6 +1303,12 @@ netbsd32_ioctl(struct lwp *l, const stru
 		IOCTL_STRUCT_CONV_TO(BIOCSUDPF, bpf_program);
 	case BIOCGDLTLIST32:
 		IOCTL_STRUCT_CONV_TO(BIOCGDLTLIST, bpf_dltlist);
+	case BIOCSRTIMEOUT32:
+#define netbsd32_to_timeval(s32p, p, cmd) netbsd32_to_timeval(s32p, p)
+#define netbsd32_from_timeval(p, s32p, cmd) netbsd32_from_timeval(p, s32p)
+		IOCTL_STRUCT_CONV_TO(BIOCSRTIMEOUT, timeval);
+#undef netbsd32_to_timeval
+#undef netbsd32_from_timeval
 
 	case WSDISPLAYIO_ADDSCREEN32:
 		IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata);

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.2
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.1	Mon Nov 27 14:07:53 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Mon Jul 22 16:27:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.56.8.1 2017/11/27 14:07:53 martin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.56.8.2 2019/07/22 16:27:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -116,6 +116,7 @@ struct netbsd32_bpf_dltlist {
 #define BIOCSTCPF32	_IOW('B',114, struct netbsd32_bpf_program)
 #define BIOCSUDPF32	_IOW('B',115, struct netbsd32_bpf_program)
 #define BIOCGDLTLIST32	_IOWR('B',119, struct netbsd32_bpf_dltlist)
+#define BIOCSRTIMEOUT32	_IOW('B',122, struct netbsd32_timeval)
 
 
 struct netbsd32_wsdisplay_addscreendata {



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:27:29 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1054):

sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.65
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.98
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.99

PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.

 -

Correct misleading names of dummy variables. No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.1 -r1.89.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56.8.1 -r1.56.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.h

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



CVS commit: src

2019-07-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jul 22 14:47:51 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/broadcom/bcm43xx: Makefile

Log Message:
Move bcm43xx to /libdata/firmware, where all the other firmwares live.

Deprecate /usr/libdata/firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.1207 -r1.1208 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.198 -r1.199 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.3 -r1.4 src/external/broadcom/bcm43xx/Makefile

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



CVS commit: src

2019-07-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jul 22 14:47:51 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/broadcom/bcm43xx: Makefile

Log Message:
Move bcm43xx to /libdata/firmware, where all the other firmwares live.

Deprecate /usr/libdata/firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.1207 -r1.1208 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.198 -r1.199 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.3 -r1.4 src/external/broadcom/bcm43xx/Makefile

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1207 src/distrib/sets/lists/base/mi:1.1208
--- src/distrib/sets/lists/base/mi:1.1207	Sat Jul 20 19:09:21 2019
+++ src/distrib/sets/lists/base/mi	Mon Jul 22 14:47:51 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1207 2019/07/20 19:09:21 wiz Exp $
+# $NetBSD: mi,v 1.1208 2019/07/22 14:47:51 wiz Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -134,6 +134,9 @@
 ./lib/npf	base-sys-root		compatfile
 ./libdata	base-sys-root
 ./libdata/firmwarebase-firmware-root
+./libdata/firmware/bcm43xx			base-firmware-usr
+./libdata/firmware/bcm43xx/BCM43430A1.hcd	base-firmware-usr	firmware
+./libdata/firmware/bcm43xx/LICENCE.broadcom_bcm43xx		base-firmware-usr	firmware
 ./libdata/firmware/if_athn			base-firmware-root
 ./libdata/firmware/if_athn/athn-ar7010		base-firmware-root	firmware
 ./libdata/firmware/if_athn/athn-ar7010-11	base-firmware-root	firmware
@@ -1327,10 +1330,10 @@
 ./usr/libdata/debug/usr/libexec/uucp		base-obsolete		obsolete
 ./usr/libdata/debug/usr/mdec			base-sys-usr
 ./usr/libdata/debug/usr/sbin			base-sys-usr
-./usr/libdata/firmwarebase-firmware-usr
-./usr/libdata/firmware/bcm43xx			base-firmware-usr
-./usr/libdata/firmware/bcm43xx/BCM43430A1.hcd	base-firmware-usr	firmware
-./usr/libdata/firmware/bcm43xx/LICENCE.broadcom_bcm43xx		base-firmware-usr	firmware
+./usr/libdata/firmwarebase-obsolete	obsolete
+./usr/libdata/firmware/bcm43xx			base-obsolete	obsolete
+./usr/libdata/firmware/bcm43xx/BCM43430A1.hcd	base-obsolete	obsolete
+./usr/libdata/firmware/bcm43xx/LICENCE.broadcom_bcm43xx		base-obsolete	obsolete
 ./usr/libdata/firmware/radeon			base-obsolete	obsolete
 ./usr/libdata/firmware/radeon/ARUBA_me.bin	base-obsolete	obsolete
 ./usr/libdata/firmware/radeon/ARUBA_pfp.bin	base-obsolete	obsolete

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.198 src/etc/mtree/NetBSD.dist.base:1.199
--- src/etc/mtree/NetBSD.dist.base:1.198	Sat Jul 20 19:09:21 2019
+++ src/etc/mtree/NetBSD.dist.base	Mon Jul 22 14:47:51 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.198 2019/07/20 19:09:21 wiz Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.199 2019/07/22 14:47:51 wiz Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -65,6 +65,7 @@
 ./lib/npf
 ./libdata
 ./libdata/firmware
+./libdata/firmware/bcm43xx
 ./libdata/firmware/if_athn
 ./libdata/firmware/if_bwfm
 ./libdata/firmware/if_ipw
@@ -281,8 +282,6 @@
 ./usr/libdata/debug/usr/libexec/postfix
 ./usr/libdata/debug/usr/mdec
 ./usr/libdata/debug/usr/sbin
-./usr/libdata/firmware
-./usr/libdata/firmware/bcm43xx
 ./usr/libdata/ldscripts
 ./usr/libdata/lint
 ./usr/libexec

Index: src/external/broadcom/bcm43xx/Makefile
diff -u src/external/broadcom/bcm43xx/Makefile:1.3 src/external/broadcom/bcm43xx/Makefile:1.4
--- src/external/broadcom/bcm43xx/Makefile:1.3	Wed May 30 20:54:08 2018
+++ src/external/broadcom/bcm43xx/Makefile	Mon Jul 22 14:47:51 2019
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2018/05/30 20:54:08 mrg Exp $
+# $NetBSD: Makefile,v 1.4 2019/07/22 14:47:51 wiz Exp $
 
 NOMAN=	# define
 
 FILES=	LICENCE.broadcom_bcm43xx BCM43430A1.hcd
 
-FILESDIR=	/usr${FIRMWAREDIR}/bcm43xx
+FILESDIR=	${FIRMWAREDIR}/bcm43xx
 
 .include 



Re: CVS commit: src/usr.bin/printf

2019-07-22 Thread Robert Elz
Date:Mon, 22 Jul 2019 12:23:35 +0200
From:Tobias Nygren 
Message-ID:  <20190722122335.55c0d421a18a082c8d67b...@netbsd.org>

  | This change broke the pkgsrc/lang/openjdk8(1) build.

That it is broken and ought to be patched upstream, it is quite
clear that printf is required to take no options at all - there was
a bug report about it not correctly handling "printf ---" (actually with
a newline appended, but that is irrelevant) which it was correct to fix.

Sometimes stuff that has relied upon bugs simply breaks when the bugs
get fixed.

kre




CVS commit: src/games/fortune/datfiles

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 13:44:13 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Use double dash to simulate em dash


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/games/fortune/datfiles/fortunes

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



CVS commit: src/games/fortune/datfiles

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 13:44:13 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Use double dash to simulate em dash


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/games/fortune/datfiles/fortunes

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

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.80 src/games/fortune/datfiles/fortunes:1.81
--- src/games/fortune/datfiles/fortunes:1.80	Mon Jul 22 09:47:28 2019
+++ src/games/fortune/datfiles/fortunes	Mon Jul 22 13:44:13 2019
@@ -16262,5 +16262,5 @@ I'm going to a commune in Vermont and wi
 than a season.
 		-- Josh Rosen
 %
-Computers for the brasses, art for the masses.
+Computers for the brasses -- art for the masses.
 		-- J.C.R. Licklider



CVS commit: src/games/fortune/fortune

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 13:37:38 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Use \(em to get an emphasis dash


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/fortune/fortune/fortune.6

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

Modified files:

Index: src/games/fortune/fortune/fortune.6
diff -u src/games/fortune/fortune/fortune.6:1.13 src/games/fortune/fortune/fortune.6:1.14
--- src/games/fortune/fortune/fortune.6:1.13	Sat Aug  4 22:29:59 2012
+++ src/games/fortune/fortune/fortune.6	Mon Jul 22 13:37:37 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fortune.6,v 1.13 2012/08/04 22:29:59 jdf Exp $
+.\"	$NetBSD: fortune.6,v 1.14 2019/07/22 13:37:37 sevan Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)fortune.6	8.3 (Berkeley) 4/19/94
 .\"
-.Dd September 9, 2004
+.Dd July 22, 2019
 .Dt FORTUNE 6
 .Os
 .Sh NAME
@@ -91,12 +91,12 @@ rather than give us grief about it, okay
 .Bd -filled -offset indent
 \&... let us keep in mind the basic governing philosophy
 of The Brotherhood, as handsomely summarized in these words:
-we believe in healthy, hearty laughter -- at the expense of
+we believe in healthy, hearty laughter \(em at the expense of
 the whole human race, if needs be.
 Needs be.
 .Ed
 .Bd -filled -offset indent-two -compact
---H. Allen Smith, "Rude Jokes"
+\(em H. Allen Smith, "Rude Jokes"
 .Ed
 .It Fl s
 Short apothegms only.



CVS commit: src/games/fortune/fortune

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 13:37:38 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Use \(em to get an emphasis dash


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/fortune/fortune/fortune.6

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



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

2019-07-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Jul 22 11:44:01 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_ahcisata.c imx6_iomuxreg.h

Log Message:
Change register assignments.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/imx/imx6_ahcisata.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imx6_iomuxreg.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/arm/imx/imx6_ahcisata.c
diff -u src/sys/arch/arm/imx/imx6_ahcisata.c:1.9 src/sys/arch/arm/imx/imx6_ahcisata.c:1.10
--- src/sys/arch/arm/imx/imx6_ahcisata.c:1.9	Thu Jun 20 08:16:19 2019
+++ src/sys/arch/arm/imx/imx6_ahcisata.c	Mon Jul 22 11:44:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ahcisata.c,v 1.9 2019/06/20 08:16:19 hkenken Exp $	*/
+/*	$NetBSD: imx6_ahcisata.c,v 1.10 2019/07/22 11:44:01 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ahcisata.c,v 1.9 2019/06/20 08:16:19 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ahcisata.c,v 1.10 2019/07/22 11:44:01 hkenken Exp $");
 
 #include "locators.h"
 #include "opt_imx.h"
@@ -289,26 +289,26 @@ imx6_ahcisata_init(struct imx_ahci_softc
 
 	v = iomux_read(IOMUX_GPR13);
 	/* clear */
-	v &= ~(IOMUX_GPR13_SATA_PHY_8(7) |
-	IOMUX_GPR13_SATA_PHY_7(0x1f) |
-	IOMUX_GPR13_SATA_PHY_6(7) |
-	IOMUX_GPR13_SATA_SPEED(1) |
-	IOMUX_GPR13_SATA_PHY_5(1) |
-	IOMUX_GPR13_SATA_PHY_4(7) |
-	IOMUX_GPR13_SATA_PHY_3(0xf) |
-	IOMUX_GPR13_SATA_PHY_2(0x1f) |
-	IOMUX_GPR13_SATA_PHY_1(1) |
-	IOMUX_GPR13_SATA_PHY_0(1));
+	v &= ~(IOMUX_GPR13_SATA_PHY_8 |
+	IOMUX_GPR13_SATA_PHY_7 |
+	IOMUX_GPR13_SATA_PHY_6 |
+	IOMUX_GPR13_SATA_SPEED |
+	IOMUX_GPR13_SATA_PHY_5 |
+	IOMUX_GPR13_SATA_PHY_4 |
+	IOMUX_GPR13_SATA_PHY_3 |
+	IOMUX_GPR13_SATA_PHY_2 |
+	IOMUX_GPR13_SATA_PHY_1 |
+	IOMUX_GPR13_SATA_PHY_0);
 	/* setting */
-	v |= IOMUX_GPR13_SATA_PHY_8(5) |	/* Rx 3.0db */
-	IOMUX_GPR13_SATA_PHY_7(0x12) |	/* Rx SATA2m */
-	IOMUX_GPR13_SATA_PHY_6(3) |		/* Rx DPLL mode */
-	IOMUX_GPR13_SATA_SPEED(1) |		/* 3.0GHz */
-	IOMUX_GPR13_SATA_PHY_5(0) |		/* SpreadSpectram */
-	IOMUX_GPR13_SATA_PHY_4(4) |		/* Tx Attenuation 9/16 */
-	IOMUX_GPR13_SATA_PHY_3(0) |		/* Tx Boost 0db */
-	IOMUX_GPR13_SATA_PHY_2(0x11) |	/* Tx Level 1.104V */
-	IOMUX_GPR13_SATA_PHY_1(1);		/* PLL clock enable */
+	v |= __SHIFTIN(5, IOMUX_GPR13_SATA_PHY_8);	/* Rx 3.0db */
+	v |= __SHIFTIN(0x12, IOMUX_GPR13_SATA_PHY_7);	/* Rx SATA2m */
+	v |= __SHIFTIN(3, IOMUX_GPR13_SATA_PHY_6);	/* Rx DPLL mode */
+	v |= __SHIFTIN(1, IOMUX_GPR13_SATA_SPEED);	/* 3.0GHz */
+	v |= __SHIFTIN(0, IOMUX_GPR13_SATA_PHY_5);	/* SpreadSpectram */
+	v |= __SHIFTIN(4, IOMUX_GPR13_SATA_PHY_4);	/* Tx Attenuation 9/16 */
+	v |= __SHIFTIN(0, IOMUX_GPR13_SATA_PHY_3);	/* Tx Boost 0db */
+	v |= __SHIFTIN(0x11, IOMUX_GPR13_SATA_PHY_2);	/* Tx Level 1.104V */
+	v |= __SHIFTIN(1, IOMUX_GPR13_SATA_PHY_1);	/* PLL clock enable */
 	iomux_write(IOMUX_GPR13, v);
 
 	/* phy reset */

Index: src/sys/arch/arm/imx/imx6_iomuxreg.h
diff -u src/sys/arch/arm/imx/imx6_iomuxreg.h:1.4 src/sys/arch/arm/imx/imx6_iomuxreg.h:1.5
--- src/sys/arch/arm/imx/imx6_iomuxreg.h:1.4	Fri Jun  9 18:14:59 2017
+++ src/sys/arch/arm/imx/imx6_iomuxreg.h	Mon Jul 22 11:44:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_iomuxreg.h,v 1.4 2017/06/09 18:14:59 ryo Exp $	*/
+/*	$NetBSD: imx6_iomuxreg.h,v 1.5 2019/07/22 11:44:01 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -93,16 +93,16 @@
 #define  IOMUX_GPR13_CAN2_STOP_REQ		__BIT(29)
 #define  IOMUX_GPR13_CAN1_STOP_REQ		__BIT(28)
 #define  IOMUX_GPR13_ENET_STOP_REQ		__BIT(27)
-#define  IOMUX_GPR13_SATA_PHY_8(n)		__SHIFTIN(n, __BITS(26, 24))
-#define  IOMUX_GPR13_SATA_PHY_7(n)		__SHIFTIN(n, __BITS(23, 19))
-#define  IOMUX_GPR13_SATA_PHY_6(n)		__SHIFTIN(n, __BITS(18, 16))
-#define  IOMUX_GPR13_SATA_SPEED(n)		__SHIFTIN(n, __BIT(15))
-#define  IOMUX_GPR13_SATA_PHY_5(n)		__SHIFTIN(n, __BIT(14))
-#define  IOMUX_GPR13_SATA_PHY_4(n)		__SHIFTIN(n, __BITS(13, 11))
-#define  IOMUX_GPR13_SATA_PHY_3(n)		__SHIFTIN(n, __BITS(10, 7))
-#define  IOMUX_GPR13_SATA_PHY_2(n)		__SHIFTIN(n, __BITS(6, 2))
-#define  IOMUX_GPR13_SATA_PHY_1(n)		__SHIFTIN(n, __BIT(1))
-#define  IOMUX_GPR13_SATA_PHY_0(n)		__SHIFTIN(n, __BIT(0))
+#define  IOMUX_GPR13_SATA_PHY_8			__BITS(26, 24)
+#define  IOMUX_GPR13_SATA_PHY_7			__BITS(23, 19)
+#define  IOMUX_GPR13_SATA_PHY_6			__BITS(18, 16)
+#define  IOMUX_GPR13_SATA_SPEED			__BIT(15)
+#define  IOMUX_GPR13_SATA_PHY_5			__BIT(14)
+#define  IOMUX_GPR13_SATA_PHY_4			__BITS(13, 11)
+#define  IOMUX_GPR13_SATA_PHY_3			__BITS(10, 7)
+#define  IOMUX_GPR13_SATA_PHY_2			__BITS(6, 2)
+#define  IOMUX_GPR13_SATA_PHY_1			__BIT(1)
+#define  IOMUX_GPR13_SATA_PHY_0			__BIT(0)
 
 /* for iMX6Dual/Quad */
 #define IMX6DQ_IOMUXC_SW_MUX_CTL_PAD_SD2_DATA1			0x004c



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

2019-07-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Jul 22 11:44:01 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_ahcisata.c imx6_iomuxreg.h

Log Message:
Change register assignments.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/imx/imx6_ahcisata.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imx6_iomuxreg.h

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



Re: CVS commit: src/usr.bin/printf

2019-07-22 Thread Tobias Nygren
On Sun, 21 Jul 2019 15:25:39 +
Robert Elz  wrote:

> Module Name:  src
> Committed By: kre
> Date: Sun Jul 21 15:25:39 UTC 2019
> 
> Modified Files:
>   src/usr.bin/printf: printf.c
> 
> Log Message:
> Stop assuming that printf handles options in any way at all
> (it doesn't - that is, shouldn't) which includes processing -- as an
> "end of options".  The first arg is (always) the format string.
> 
> Remove call to getopt() (but still do associated changes to argc/argv)
> 
> Note: for now this is #if 0's out instead of being deleted, the old
> code should be fully removed sometime soon.
> 
> Problem pointed out on tech-userlevel by Thierry Laronde.

Hi!

Please exercise caution when changing established userland behaviour.
This change broke the pkgsrc/lang/openjdk8(1) build. We can patch it of
course but there may be other software out there that expects the old
behaviour.

(1) 
https://hg.openjdk.java.net/jdk8u/jdk8u/file/bb03d4e1088a/make/common/MakeBase.gmk#l59

Kind regards,
-Tobias


CVS commit: src/sys/dev/pckbport

2019-07-22 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Jul 22 09:58:39 UTC 2019

Modified Files:
src/sys/dev/pckbport: files.pckbport

Log Message:
hvkbd requires pckbd_keydesctab in wskbdmap_mfii.c.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pckbport/files.pckbport

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

2019-07-22 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Jul 22 09:58:39 UTC 2019

Modified Files:
src/sys/dev/pckbport: files.pckbport

Log Message:
hvkbd requires pckbd_keydesctab in wskbdmap_mfii.c.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pckbport/files.pckbport

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/files.pckbport
diff -u src/sys/dev/pckbport/files.pckbport:1.9 src/sys/dev/pckbport/files.pckbport:1.10
--- src/sys/dev/pckbport/files.pckbport:1.9	Sun Aug 13 08:49:27 2017
+++ src/sys/dev/pckbport/files.pckbport	Mon Jul 22 09:58:39 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.pckbport,v 1.9 2017/08/13 08:49:27 christos Exp $
+# $NetBSD: files.pckbport,v 1.10 2019/07/22 09:58:39 nakayama Exp $
 # devices attached at pckbport, for use with wscons
 
 defflag	opt_wskbdmap.h			WSKBD_USONLY
@@ -9,7 +9,7 @@ file	dev/pckbport/pckbport.c		pckbport |
 device	pckbd: wskbddev
 attach	pckbd at pckbport
 file	dev/pckbport/pckbd.c		pckbd			needs-flag
-file	dev/pckbport/wskbdmap_mfii.c	pckbd
+file	dev/pckbport/wskbdmap_mfii.c	pckbd | hvkbd
 defparam PCKBD_LAYOUT
 defflag	PCKBD_CNATTACH_MAY_FAIL
 



CVS commit: src/games/fortune/datfiles

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 09:47:28 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Art for the masses - The Dream Machine
The text used an em dash which I've replaced with a coma here.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/games/fortune/datfiles/fortunes

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

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.79 src/games/fortune/datfiles/fortunes:1.80
--- src/games/fortune/datfiles/fortunes:1.79	Sun Feb 24 12:34:00 2019
+++ src/games/fortune/datfiles/fortunes	Mon Jul 22 09:47:28 2019
@@ -16261,3 +16261,6 @@ can perform without thinking about them.
 I'm going to a commune in Vermont and will deal with no unit of time shorter
 than a season.
 		-- Josh Rosen
+%
+Computers for the brasses, art for the masses.
+		-- J.C.R. Licklider



CVS commit: src/games/fortune/datfiles

2019-07-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jul 22 09:47:28 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Art for the masses - The Dream Machine
The text used an em dash which I've replaced with a coma here.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/games/fortune/datfiles/fortunes

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



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

2019-07-22 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jul 22 06:52:06 UTC 2019

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
remove unnecessary NULL check after kmem_zalloc(KM_SLEEP)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/pci/if_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/dev/usb

2019-07-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 22 06:24:57 UTC 2019

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

Log Message:
KNF (from nhusb)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/udsir.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/udsir.c
diff -u src/sys/dev/usb/udsir.c:1.7 src/sys/dev/usb/udsir.c:1.8
--- src/sys/dev/usb/udsir.c:1.7	Mon Sep  3 16:29:34 2018
+++ src/sys/dev/usb/udsir.c	Mon Jul 22 06:24:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: udsir.c,v 1.7 2018/09/03 16:29:34 riastradh Exp $	*/
+/*	$NetBSD: udsir.c,v 1.8 2019/07/22 06:24:57 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.7 2018/09/03 16:29:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.8 2019/07/22 06:24:57 skrll Exp $");
 
 #include 
 #include 
@@ -693,7 +693,7 @@ udsir_kqfilter(void *h, struct knote *kn
 		kn->kn_fop = _filtops;
 		break;
 	default:
-		return (EINVAL);
+		return EINVAL;
 	}
 
 	kn->kn_hook = sc;
@@ -702,7 +702,7 @@ udsir_kqfilter(void *h, struct knote *kn
 	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
 	splx(s);
 
-	return (0);
+	return 0;
 }
 
 static int
@@ -783,7 +783,7 @@ filt_udsirread(struct knote *kn, long hi
 	struct udsir_softc *sc = kn->kn_hook;
 
 	kn->kn_data = sc->sc_ur_framelen;
-	return (kn->kn_data > 0);
+	return kn->kn_data > 0;
 }
 
 static void
@@ -804,7 +804,7 @@ filt_udsirwrite(struct knote *kn, long h
 	struct udsir_softc *sc = kn->kn_hook;
 
 	kn->kn_data = 0;
-	return (sc->sc_direction != udir_input);
+	return sc->sc_direction != udir_input;
 }
 
 



CVS commit: src/sys/dev/usb

2019-07-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 22 06:24:57 UTC 2019

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

Log Message:
KNF (from nhusb)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/udsir.c

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