CVS commit: src/doc

2020-06-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jun 13 22:03:38 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
tmux-3.1b out.


To generate a diff of this commit:
cvs rdiff -u -r1.1726 -r1.1727 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1726 src/doc/3RDPARTY:1.1727
--- src/doc/3RDPARTY:1.1726	Sat Jun 13 21:23:00 2020
+++ src/doc/3RDPARTY	Sat Jun 13 22:03:38 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1726 2020/06/13 21:23:00 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1727 2020/06/13 22:03:38 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1356,11 +1356,11 @@ purposes.
 
 Package:	tmux
 Version:	3.0a
-Current Vers:	3.0a
+Current Vers:	3.1b
 Maintainer:	Nicholas Marriott 
 Archive site:	https://github.com/tmux/tmux
 Home page:	http://tmux.github.io
-Date: 		2020-01-06
+Date: 		2020-05-04
 Mailing List:	tmux-us...@googlegroups.com
 Responsible:	christos
 License:	BSD



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 22:15:06 UTC 2020

Modified Files:
src/sys/dev: cgd.c cgd_crypto.c cgd_crypto.h

Log Message:
Eliminate uio indirection for cgd crypto.

We don't actually use it, and we only ever used it kludgily in the
CBC encryption direction in the past anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/dev/cgd.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/cgd_crypto.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/cgd_crypto.h

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

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.131 src/sys/dev/cgd.c:1.132
--- src/sys/dev/cgd.c:1.131	Sat Jun 13 18:42:22 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 22:15:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.131 2020/06/13 18:42:22 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.132 2020/06/13 22:15:06 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.131 2020/06/13 18:42:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.132 2020/06/13 22:15:06 riastradh Exp $");
 
 #include 
 #include 
@@ -1541,46 +1541,26 @@ cgd_cipher(struct cgd_softc *sc, void *d
 	char		*dst = dstv;
 	char		*src = srcv;
 	cfunc_cipher	*cipher = sc->sc_cfuncs->cf_cipher;
-	struct uio	dstuio;
-	struct uio	srcuio;
-	struct iovec	dstiov[2];
-	struct iovec	srciov[2];
 	size_t		blocksize = sc->sc_cdata.cf_blocksize;
 	size_t		todo;
 	char		blkno_buf[CGD_MAXBLOCKSIZE];
 
 	DPRINTF_FOLLOW(("cgd_cipher() dir=%d\n", dir));
 
-	KASSERTMSG(len % blocksize == 0,
-	"cgd_cipher: len %% blocksize != 0");
-
+	KASSERT(len % blocksize == 0);
 	/* ensure that sizeof(daddr_t) <= blocksize (for encblkno IVing) */
-	KASSERTMSG(sizeof(daddr_t) <= blocksize,
-	"cgd_cipher: sizeof(daddr_t) > blocksize");
-
-	KASSERTMSG(blocksize <= CGD_MAXBLOCKSIZE,
-	"cgd_cipher: blocksize > CGD_MAXBLOCKSIZE");
-
-	dstuio.uio_iov = dstiov;
-	dstuio.uio_iovcnt = 1;
-
-	srcuio.uio_iov = srciov;
-	srcuio.uio_iovcnt = 1;
+	KASSERT(sizeof(daddr_t) <= blocksize);
+	KASSERT(blocksize <= CGD_MAXBLOCKSIZE);
 
 	for (; len > 0; len -= todo) {
 		todo = MIN(len, secsize);
 
-		dstiov[0].iov_base = dst;
-		srciov[0].iov_base = src;
-		dstiov[0].iov_len  = todo;
-		srciov[0].iov_len  = todo;
-
 		memset(blkno_buf, 0x0, blocksize);
 		blkno2blkno_buf(blkno_buf, blkno);
 		IFDEBUG(CGDB_CRYPTO, hexprint("step 1: blkno_buf",
 		blkno_buf, blocksize));
 
-		cipher(sc->sc_cdata.cf_priv, , , blkno_buf, dir);
+		cipher(sc->sc_cdata.cf_priv, dst, src, todo, blkno_buf, dir);
 
 		dst += todo;
 		src += todo;

Index: src/sys/dev/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.22 src/sys/dev/cgd_crypto.c:1.23
--- src/sys/dev/cgd_crypto.c:1.22	Sat Jun 13 18:40:14 2020
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 22:15:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.22 2020/06/13 18:40:14 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.23 2020/06/13 22:15:06 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.22 2020/06/13 18:40:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.23 2020/06/13 22:15:06 riastradh Exp $");
 
 #include 
 #include 
@@ -109,66 +109,6 @@ cryptfuncs_find(const char *alg)
 	return NULL;
 }
 
-typedef void	(*cipher_func)(void *, void *, const void *, size_t);
-
-static void
-cgd_cipher_uio(void *privdata, cipher_func cipher,
-	struct uio *dstuio, struct uio *srcuio);
-
-/*
- * cgd_cipher_uio takes a simple cbc or xts cipher and iterates
- * it over two struct uio's.  It presumes that the cipher function
- * that is passed to it keeps the IV state between calls.
- *
- * We assume that the caller has ensured that each segment is evenly
- * divisible by the block size, which for the cgd is a valid assumption.
- * If we were to make this code more generic, we might need to take care
- * of this case, either by issuing an error or copying the data.
- */
-
-static void
-cgd_cipher_uio(void *privdata, cipher_func cipher,
-struct uio *dstuio, struct uio *srcuio)
-{
-	const struct iovec	*dst;
-	const struct iovec	*src;
-	int		 dstnum;
-	int		 dstoff = 0;
-	int		 srcnum;
-	int		 srcoff = 0;
-
-	dst = dstuio->uio_iov;
-	dstnum = dstuio->uio_iovcnt;
-	src = srcuio->uio_iov;
-	srcnum = srcuio->uio_iovcnt;
-	for (;;) {
-		int l = MIN(dst->iov_len - dstoff, src->iov_len - srcoff);
-		uint8_t *d = (uint8_t *)dst->iov_base + dstoff;
-		const uint8_t *s = (const uint8_t *)src->iov_base + srcoff;
-
-		cipher(privdata, d, s, l);
-
-		dstoff += l;
-		srcoff += l;
-		/*
-		 * We assume that {dst,src} == {dst,src}->iov_len,
-		 * because it should not be possible for it not to be.
-		 */
-		if (dstoff == dst->iov_len) {
-			dstoff = 0;
-			dstnum--;
-			dst++;
-		}
-		if (srcoff == src->iov_len) {
-			

CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 22:17:03 UTC 2020

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

Log Message:
Fix encblkno8 legacy support.  Add a test vector while here.

What a crock!

This is deliberately _not_ neatly abstracted because the whole
configurable `iv method' mechanism is a mistake and should never be
used for anything new.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.133 src/sys/dev/cgd.c:1.134
--- src/sys/dev/cgd.c:1.133	Sat Jun 13 22:15:57 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 22:17:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.133 2020/06/13 22:15:57 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.134 2020/06/13 22:17:03 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.133 2020/06/13 22:15:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.134 2020/06/13 22:17:03 riastradh Exp $");
 
 #include 
 #include 
@@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.13
 
 struct selftest_params {
 	const char *alg;
+	int encblkno8;
 	int blocksize;	/* number of bytes */
 	int secsize;
 	daddr_t blkno;
@@ -292,6 +293,18 @@ static const uint8_t selftest_bf_cbc_ctx
 	0xb8, 0xbf, 0x69, 0x17, 0x20, 0x0a, 0xf7, 0xda,
 };
 
+static const uint8_t selftest_aes_cbc_encblkno8_zero64[64];
+static const uint8_t selftest_aes_cbc_encblkno8_ctxt[64] = {
+	0xa2, 0x06, 0x26, 0x26, 0xac, 0xdc, 0xe7, 0xcf,
+	0x47, 0x68, 0x24, 0x0e, 0xfa, 0x40, 0x44, 0x83,
+	0x07, 0xe1, 0xf4, 0x5d, 0x53, 0x47, 0xa0, 0xfe,
+	0xc0, 0x6e, 0x4e, 0xf8, 0x9d, 0x98, 0x63, 0xb8,
+	0x2c, 0x27, 0xfa, 0x3a, 0xd5, 0x40, 0xda, 0xdb,
+	0xe6, 0xc3, 0xe4, 0xfb, 0x85, 0x53, 0xfb, 0x78,
+	0x5d, 0xbd, 0x8f, 0x4c, 0x1a, 0x04, 0x9c, 0x88,
+	0x85, 0xec, 0x3c, 0x56, 0x46, 0x1a, 0x6e, 0xf5,
+};
+
 const struct selftest_params selftests[] = {
 	{
 		.alg = "aes-xts",
@@ -359,6 +372,18 @@ const struct selftest_params selftests[]
 		.ptxt = selftest_bf_cbc_ptxt,
 		.ctxt = selftest_bf_cbc_ctxt,
 	},
+	{
+		.alg = "aes-cbc",
+		.encblkno8 = 1,
+		.blocksize = 16,
+		.secsize = 512,
+		.blkno = 0,
+		.keylen = 128,
+		.txtlen = sizeof(selftest_aes_cbc_encblkno8_zero64),
+		.key = selftest_aes_cbc_encblkno8_zero64,
+		.ptxt = selftest_aes_cbc_encblkno8_zero64,
+		.ctxt = selftest_aes_cbc_encblkno8_ctxt,
+	},
 };
 
 static int cgd_match(device_t, cfdata_t, void *);
@@ -1264,6 +1289,25 @@ cgd_ioctl_set(struct cgd_softc *sc, void
 
 	sc->sc_cdata.cf_blocksize = ci->ci_blocksize;
 	sc->sc_cdata.cf_mode = encblkno[i].v;
+
+	/*
+	 * Print a warning if the user selected the legacy encblkno8
+	 * mistake, and reject it altogether for ciphers that it
+	 * doesn't apply to.
+	 */
+	if (encblkno[i].v != CGD_CIPHER_CBC_ENCBLKNO1) {
+		if (strcmp(sc->sc_cfuncs->cf_name, "aes-cbc") &&
+		strcmp(sc->sc_cfuncs->cf_name, "3des-cbc") &&
+		strcmp(sc->sc_cfuncs->cf_name, "bf-cbc")) {
+			log(LOG_WARNING, "cgd: %s only makes sense for cbc,"
+			" not for %s; ignoring\n",
+			encblkno[i].n, sc->sc_cfuncs->cf_name);
+			sc->sc_cdata.cf_mode = CGD_CIPHER_CBC_ENCBLKNO1;
+		} else {
+			log(LOG_WARNING, "cgd: enabling legacy encblkno8\n");
+		}
+	}
+
 	sc->sc_cdata.cf_keylen = ci->ci_keylen;
 	sc->sc_cdata.cf_priv = sc->sc_cfuncs->cf_init(ci->ci_keylen, inbuf,
 	>sc_cdata.cf_blocksize);
@@ -1547,6 +1591,9 @@ cgd_cipher(struct cgd_softc *sc, void *d
 
 	DPRINTF_FOLLOW(("cgd_cipher() dir=%d\n", dir));
 
+	if (sc->sc_cdata.cf_mode == CGD_CIPHER_CBC_ENCBLKNO8)
+		blocksize /= 8;
+
 	KASSERT(len % blocksize == 0);
 	/* ensure that sizeof(daddr_t) <= blocksize (for encblkno IVing) */
 	KASSERT(sizeof(daddr_t) <= blocksize);
@@ -1560,6 +1607,32 @@ cgd_cipher(struct cgd_softc *sc, void *d
 		IFDEBUG(CGDB_CRYPTO, hexprint("step 1: blkno_buf",
 		blkno_buf, blocksize));
 
+		/*
+		 * Handle bollocksed up encblkno8 mistake.  We used to
+		 * compute the encryption of a zero block with blkno as
+		 * the CBC IV -- except in an early mistake arising
+		 * from bit/byte confusion, we actually computed the
+		 * encryption of the last of _eight_ zero blocks under
+		 * CBC as the CBC IV.
+		 *
+		 * Encrypting the block number is handled inside the
+		 * cipher dispatch now (even though in practice, both
+		 * CBC and XTS will do the same thing), so we have to
+		 * simulate the block number that would yield the same
+		 * result.  So we encrypt _six_ zero blocks -- the
+		 * first one and the last one are handled inside the
+		 * cipher dispatch.
+		 */
+		if (sc->sc_cdata.cf_mode == CGD_CIPHER_CBC_ENCBLKNO8) {
+			static const uint8_t zero[CGD_MAXBLOCKSIZE];
+			uint8_t iv[CGD_MAXBLOCKSIZE];
+
+			memcpy(iv, blkno_buf, blocksize);
+			cipher(sc->sc_cdata.cf_priv, blkno_buf, zero,
+			6*blocksize, iv, 

CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 22:15:58 UTC 2020

Modified Files:
src/sys/dev: cgd.c cgdvar.h

Log Message:
Constify.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/cgd.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/cgdvar.h

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

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.132 src/sys/dev/cgd.c:1.133
--- src/sys/dev/cgd.c:1.132	Sat Jun 13 22:15:06 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 22:15:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.132 2020/06/13 22:15:06 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.133 2020/06/13 22:15:57 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.132 2020/06/13 22:15:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.133 2020/06/13 22:15:57 riastradh Exp $");
 
 #include 
 #include 
@@ -386,7 +386,7 @@ static int	cgd_ioctl_clr(struct cgd_soft
 static int	cgd_ioctl_get(dev_t, void *, struct lwp *);
 static int	cgdinit(struct cgd_softc *, const char *, struct vnode *,
 			struct lwp *);
-static void	cgd_cipher(struct cgd_softc *, void *, void *,
+static void	cgd_cipher(struct cgd_softc *, void *, const void *,
 			   size_t, daddr_t, size_t, int);
 
 static void	cgd_selftest(void);
@@ -1535,11 +1535,11 @@ cgd_process(struct work *wk, void *arg)
 }
 
 static void
-cgd_cipher(struct cgd_softc *sc, void *dstv, void *srcv,
+cgd_cipher(struct cgd_softc *sc, void *dstv, const void *srcv,
 size_t len, daddr_t blkno, size_t secsize, int dir)
 {
 	char		*dst = dstv;
-	char		*src = srcv;
+	const char	*src = srcv;
 	cfunc_cipher	*cipher = sc->sc_cfuncs->cf_cipher;
 	size_t		blocksize = sc->sc_cdata.cf_blocksize;
 	size_t		todo;

Index: src/sys/dev/cgdvar.h
diff -u src/sys/dev/cgdvar.h:1.20 src/sys/dev/cgdvar.h:1.21
--- src/sys/dev/cgdvar.h:1.20	Sat Jun 13 18:38:33 2020
+++ src/sys/dev/cgdvar.h	Sat Jun 13 22:15:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdvar.h,v 1.20 2020/06/13 18:38:33 riastradh Exp $ */
+/* $NetBSD: cgdvar.h,v 1.21 2020/06/13 22:15:58 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -87,7 +87,7 @@ struct cgd_xfer {
 	struct buf		*cx_obp;
 	struct buf		*cx_nbp;
 	void			*cx_dstv;
-	void			*cx_srcv;
+	const void		*cx_srcv;
 	size_t			 cx_len;
 	daddr_t			 cx_blkno;
 	size_t			 cx_secsize;



CVS commit: src/doc

2020-06-13 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Jun 13 22:35:23 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
Partial scan of components


To generate a diff of this commit:
cvs rdiff -u -r1.1727 -r1.1728 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1727 src/doc/3RDPARTY:1.1728
--- src/doc/3RDPARTY:1.1727	Sat Jun 13 22:03:38 2020
+++ src/doc/3RDPARTY	Sat Jun 13 22:35:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1727 2020/06/13 22:03:38 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1728 2020/06/13 22:35:23 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -42,11 +42,11 @@
 
 Package:	acpica
 Version:	20200430
-Current Vers:	20200430
+Current Vers:	20200528
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/
 Home Page:	http://www.acpica.org/
-Date:		2020-05-25
+Date:		2020-06-13
 Mailing List:	de...@acpica.org
 License:	BSD-like
 Responsible:	jruoho
@@ -61,7 +61,7 @@ Current Vers:	6.2
 Maintainer:	Erez Zadok 
 Archive Site:	ftp://ftp.am-utils.org/pub/am-utils/
 Home Page:	http://www.am-utils.org/
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:	am-utils
 Responsible:	christos
 License:	BSD (4-clause)
@@ -78,7 +78,7 @@ Current Vers:	0.21
 Maintainer:	Julio Merino 
 Archive site:	https://github.com/jmmv/atf/releases
 Home page:	https://github.com/jmmv/atf
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:	atf-de...@netbsd.org
 Responsible:	jmmv
 License:	The NetBSD Foundation's license (BSD 2-clause)
@@ -94,11 +94,11 @@ upfront.
 
 Package:	ath-hal
 Version:	FreeBSD SVN revision number 185521
-Current Vers:	FreeBSD SVN revision number 348331
+Current Vers:	FreeBSD SVN revision number 361486
 Maintainer:	Sam Leffler 
 Archive Site:	none
 Home Page:	https://svnweb.freebsd.org/base/head/sys/dev/ath/ath_hal/
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:	none
 Responsible:	sam, alc
 License:	BSD-like (2-clause), ISC
@@ -111,7 +111,7 @@ Current Vers:	1.07.1
 Maintainer:	Phil Nelson 
 Archive Site:	ftp://ftp.gnu.org/gnu/bc/
 Home Page:	http://www.gnu.org/software/bc/
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:	bug...@gnu.org
 Responsible:	phil, simonb
 License:	GPLv2, LGPGv2.1
@@ -125,7 +125,7 @@ Current Vers:	9.16.3/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/
-Date:		2020-05-24
+Date:		2020-06-13
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-announce
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-users
 Responsible:	christos
@@ -144,7 +144,7 @@ Current Vers:	1.38.0
 Maintainer:	libuv
 Archive Site:	https://dist.libuv.org/dist/
 Home Page:	https://libuv.org
-Date:		2020-05-24
+Date:		2020-06-13
 Mailing List:	https://groups.google.com/forum/#!forum/libuv
 Responsible:	christos
 License:	mit
@@ -153,11 +153,11 @@ Notes:
 
 Package:	unbound
 Version:	1.9.6
-Current Vers:	1.9.6
+Current Vers:	1.10.1
 Maintainer:	Nlnetlabs
 Archive Site:	https://www.unbound.net/downloads/unbound-latest.tar.gz
 Home Page:	https://www.unbound.net/
-Date:		2019-12-15
+Date:		2020-06-13
 Mailing List:	https://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users
 Responsible:	christos
 License:	BSD-like
@@ -168,11 +168,11 @@ run configure and update config files in
 
 Package:	nsd
 Version:	4.2.4
-Current Vers:	4.2.4
+Current Vers:	4.3.1
 Maintainer:	Nlnetlabs
 Archive Site:	https://www.nlnetlabs.nl/svn/nsd/
 Home Page:	https://www.nlnetlabs.nl/projects/nsd/
-Date:		2019-12-15
+Date:		2020-06-13
 Mailing List:	https://open.nlnetlabs.nl/mailman/listinfo/nsd-users/
 Responsible:	christos
 License:	BSD-like
@@ -225,11 +225,11 @@ in the past.
 
 Package:	byacc
 Version:	20190617
-Current Vers:	20190617
+Current Vers:	20200330
 Maintainer:	Thomas Dickey 
 Archive Site:	http://www.invisible-island.net/byacc/byacc.html
 Home Page:	http://www.invisible-island.net/byacc/byacc.html
-Date:		2019-10-06
+Date:		2020-06-13
 Mailing List:
 Responsible:	christos
 License:	Public Domain
@@ -243,7 +243,7 @@ Current Vers:	1.0.8
 Maintainer:	Julian Seward 
 Archive Site:	https://sourceware.org/pub/bzip2/
 Home Page:	https://www.sourceware.org/bzip2/
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:
 Responsible:
 License:	BSD (4-clause)
@@ -257,7 +257,7 @@ Current Vers:
 Maintainer:	Citrus
 Archive Site:	http://citrus.bsdclub.org/
 Home Page:	http://citrus.bsdclub.org/
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:	bsd-loc...@haun.org
 Responsible:	tshiozak
 License:	Ambiguous. Either BSD or Perl Artistic License
@@ -279,7 +279,7 @@ Current Vers:	4.1
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/cron/
 Home Page:
-Date:		2019-10-09
+Date:		2020-06-13
 Mailing List:
 Responsible:
 License:	BSD-like
@@ -292,7 +292,7 @@ Current Vers:	1.12.13
 

CVS commit: src/sys/arch

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 23:58:52 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: cpufunc.S
src/sys/arch/amd64/include: proc.h
src/sys/arch/i386/i386: cpufunc.S
src/sys/arch/i386/include: proc.h
src/sys/arch/x86/x86: tsc.c

Log Message:
Print a rate limited warning if the TSC timecounter goes backwards from the
viewpoint of any single LWP.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/include/proc.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/i386/cpufunc.S
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/include/proc.h
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/x86/x86/tsc.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.59 src/sys/arch/amd64/amd64/cpufunc.S:1.60
--- src/sys/arch/amd64/amd64/cpufunc.S:1.59	Mon Jun  1 22:58:06 2020
+++ src/sys/arch/amd64/amd64/cpufunc.S	Sat Jun 13 23:58:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.59 2020/06/01 22:58:06 ad Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.60 2020/06/13 23:58:51 ad Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -206,8 +206,10 @@ ENTRY(x86_hotpatch)
 END(x86_hotpatch)
 #endif /* !XENPV */
 
-/* Could be exact same as cpu_counter, but KMSAN needs to have the correct
- * size of the return value. */
+/*
+ * Could be exact same as cpu_counter, but KMSAN needs to have the correct
+ * size of the return value.
+ */
 ENTRY(cpu_counter32)
 	movq	CPUVAR(CURLWP), %rcx
 1:
@@ -221,7 +223,6 @@ ENTRY(cpu_counter32)
 2:
 	jmp	1b
 END(cpu_counter32)
-STRONG_ALIAS(tsc_get_timecount, cpu_counter32)
 
 ENTRY(cpu_counter)
 	movq	CPUVAR(CURLWP), %rcx

Index: src/sys/arch/amd64/include/proc.h
diff -u src/sys/arch/amd64/include/proc.h:1.24 src/sys/arch/amd64/include/proc.h:1.25
--- src/sys/arch/amd64/include/proc.h:1.24	Mon Jan 13 00:26:52 2020
+++ src/sys/arch/amd64/include/proc.h	Sat Jun 13 23:58:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.24 2020/01/13 00:26:52 ad Exp $	*/
+/*	$NetBSD: proc.h,v 1.25 2020/06/13 23:58:51 ad Exp $	*/
 
 /*
  * Copyright (c) 1991 Regents of the University of California.
@@ -46,6 +46,7 @@ struct pmap;
 struct vm_page;
 
 struct mdlwp {
+	volatile uint64_t md_tsc;	/* last TSC reading */
 	struct	trapframe *md_regs;	/* registers on current frame */
 	int	md_flags;		/* machine-dependent flags */
 	volatile int md_astpending;

Index: src/sys/arch/i386/i386/cpufunc.S
diff -u src/sys/arch/i386/i386/cpufunc.S:1.45 src/sys/arch/i386/i386/cpufunc.S:1.46
--- src/sys/arch/i386/i386/cpufunc.S:1.45	Thu May 28 20:03:19 2020
+++ src/sys/arch/i386/i386/cpufunc.S	Sat Jun 13 23:58:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.45 2020/05/28 20:03:19 ad Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.46 2020/06/13 23:58:52 ad Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2020 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.45 2020/05/28 20:03:19 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.46 2020/06/13 23:58:52 ad Exp $");
 
 #include "opt_xen.h"
 
@@ -163,7 +163,7 @@ ENTRY(msr_onfault)
 	ret
 END(msr_onfault)
 
-ENTRY(tsc_get_timecount)
+ENTRY(cpu_counter)
 	pushl	%ebx
 	movl	CPUVAR(CURLWP), %ecx
 1:
@@ -177,10 +177,9 @@ ENTRY(tsc_get_timecount)
 	ret
 2:
 	jmp	1b
-END(tsc_get_timecount)
+END(cpu_counter)
 
-STRONG_ALIAS(cpu_counter, tsc_get_timecount)
-STRONG_ALIAS(cpu_counter32, tsc_get_timecount)
+STRONG_ALIAS(cpu_counter32, cpu_counter)
 
 ENTRY(breakpoint)
 	pushl	%ebp

Index: src/sys/arch/i386/include/proc.h
diff -u src/sys/arch/i386/include/proc.h:1.47 src/sys/arch/i386/include/proc.h:1.48
--- src/sys/arch/i386/include/proc.h:1.47	Mon Jan 13 00:26:52 2020
+++ src/sys/arch/i386/include/proc.h	Sat Jun 13 23:58:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.47 2020/01/13 00:26:52 ad Exp $	*/
+/*	$NetBSD: proc.h,v 1.48 2020/06/13 23:58:52 ad Exp $	*/
 
 /*
  * Copyright (c) 1991 Regents of the University of California.
@@ -46,6 +46,7 @@ struct vm_page;
 #define	MDL_FPU_IN_CPU		0x0020	/* the FPU state is in the CPU */
 
 struct mdlwp {
+	volatile uint64_t md_tsc;	/* last TSC reading */
 	struct	trapframe *md_regs;	/* registers on current frame */
 	int	md_flags;		/* machine-dependent flags */
 	volatile int md_astpending;	/* AST pending for this process */

Index: src/sys/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.48 src/sys/arch/x86/x86/tsc.c:1.49
--- src/sys/arch/x86/x86/tsc.c:1.48	Wed May 27 18:46:15 2020
+++ src/sys/arch/x86/x86/tsc.c	Sat Jun 13 23:58:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.48 2020/05/27 18:46:15 ad Exp $	*/
+/*	$NetBSD: tsc.c,v 1.49 2020/06/13 23:58:52 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 

CVS commit: src/sys/sys

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 23:59:16 UTC 2020

Modified Files:
src/sys/sys: param.h

Log Message:
NetBSD 9.99.67 - struct lwp changed on x86


To generate a diff of this commit:
cvs rdiff -u -r1.669 -r1.670 src/sys/sys/param.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/sys/param.h
diff -u src/sys/sys/param.h:1.669 src/sys/sys/param.h:1.670
--- src/sys/sys/param.h:1.669	Fri Jun 12 11:09:49 2020
+++ src/sys/sys/param.h	Sat Jun 13 23:59:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.669 2020/06/12 11:09:49 roy Exp $	*/
+/*	$NetBSD: param.h,v 1.670 2020/06/13 23:59:16 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999006600	/* NetBSD 9.99.66 */
+#define	__NetBSD_Version__	999006700	/* NetBSD 9.99.67 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/kern

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jun 14 00:20:17 UTC 2020

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

Log Message:
If a vnode is marked with VI_EXECMAP then in all likelyhood it has pages.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/kern/vfs_vnode.c

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

Modified files:

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.124 src/sys/kern/vfs_vnode.c:1.125
--- src/sys/kern/vfs_vnode.c:1.124	Thu Jun 11 22:21:05 2020
+++ src/sys/kern/vfs_vnode.c	Sun Jun 14 00:20:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.124 2020/06/11 22:21:05 ad Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.125 2020/06/14 00:20:17 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.124 2020/06/11 22:21:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.125 2020/06/14 00:20:17 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -897,8 +897,7 @@ vrelel(vnode_t *vp, int flags, int lktyp
  		}
 
 		/* Take care of space accounting. */
-		if ((vp->v_iflag & VI_EXECMAP) != 0 &&
-		vp->v_uobj.uo_npages != 0) {
+		if ((vp->v_iflag & VI_EXECMAP) != 0) {
 			cpu_count(CPU_COUNT_EXECPAGES, -vp->v_uobj.uo_npages);
 		}
 		vp->v_iflag &= ~(VI_TEXT|VI_EXECMAP|VI_WRMAP);
@@ -1707,7 +1706,7 @@ vcache_reclaim(vnode_t *vp)
 
 	rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
 	mutex_enter(vp->v_interlock);
-	if ((vp->v_iflag & VI_EXECMAP) != 0 && vp->v_uobj.uo_npages != 0) {
+	if ((vp->v_iflag & VI_EXECMAP) != 0) {
 		cpu_count(CPU_COUNT_EXECPAGES, -vp->v_uobj.uo_npages);
 	}
 	vp->v_iflag &= ~(VI_TEXT|VI_EXECMAP);



CVS commit: src/sys/netinet6

2020-06-13 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jun 13 06:05:08 UTC 2020

Modified Files:
src/sys/netinet6: in6.c

Log Message:
COMPAT_90 doesn't necessarily imply COMPAT_50. So include compat in6_var.h in
either case.

Fixes evbarm build that starts with COMPAT_60.


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/sys/netinet6/in6.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/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.278 src/sys/netinet6/in6.c:1.279
--- src/sys/netinet6/in6.c:1.278	Fri Jun 12 11:04:45 2020
+++ src/sys/netinet6/in6.c	Sat Jun 13 06:05:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.278 2020/06/12 11:04:45 roy Exp $	*/
+/*	$NetBSD: in6.c,v 1.279 2020/06/13 06:05:08 mlelstv Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.278 2020/06/12 11:04:45 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.279 2020/06/13 06:05:08 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -109,6 +109,7 @@ __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.27
 #include 
 #endif
 #ifdef COMPAT_90
+#include 
 #include 
 #endif
 



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

2020-06-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jun 13 12:53:42 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Add a comment to say that instruction encoding 0x7c03e83b is "rdhwr $3,$29".


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.107 src/sys/arch/mips/mips/mipsX_subr.S:1.108
--- src/sys/arch/mips/mips/mipsX_subr.S:1.107	Sat Feb 15 17:01:00 2020
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sat Jun 13 12:53:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.107 2020/02/15 17:01:00 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.108 2020/06/13 12:53:42 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1321,8 +1321,8 @@ NESTED_NOPROFILE(MIPSX(user_reserved_ins
 	/*
 	 * Was this rdhwr $3,$29?
 	 */
-	lui	v0, %hi(0x7c03e83b)
-	addiu	v0, %lo(0x7c03e83b)
+	lui	v0, %hi(0x7c03e83b)	# 0x7c03e83b => rdhwr $3,$29
+	addiu	v0, %lo(0x7c03e83b)	#or ... rdhwr v1,ulr
 	bne	AT, v0, MIPSX(user_gen_exception_common)
 	 nop
 



CVS commit: src/share/misc

2020-06-13 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Jun 13 14:31:49 UTC 2020

Modified Files:
src/share/misc: acronyms

Log Message:
BAU


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.303 src/share/misc/acronyms:1.304
--- src/share/misc/acronyms:1.303	Thu Jun 11 23:19:53 2020
+++ src/share/misc/acronyms	Sat Jun 13 14:31:49 2020
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.303 2020/06/11 23:19:53 sevan Exp $
+$NetBSD: acronyms,v 1.304 2020/06/13 14:31:49 sevan Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -59,6 +59,7 @@ B/W	bandwidth
 B/W	between
 BAI	goodbye
 BAK	back at keyboard
+BAU	business as usual
 BBIAB	be back in a bit
 BBL	[I'll] be back later
 BBR	burnt beyond repair



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

2020-06-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jun 13 14:41:24 UTC 2020

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

Log Message:
Move MIPSNN_CFG3_ULRI so that it doesn't appear in some random position
among the other config3 register definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/include/mipsNN.h

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

Modified files:

Index: src/sys/arch/mips/include/mipsNN.h
diff -u src/sys/arch/mips/include/mipsNN.h:1.7 src/sys/arch/mips/include/mipsNN.h:1.8
--- src/sys/arch/mips/include/mipsNN.h:1.7	Sat Jun 13 14:39:07 2020
+++ src/sys/arch/mips/include/mipsNN.h	Sat Jun 13 14:41:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsNN.h,v 1.7 2020/06/13 14:39:07 simonb Exp $	*/
+/*	$NetBSD: mipsNN.h,v 1.8 2020/06/13 14:41:24 simonb Exp $	*/
 
 /*
  * Copyright 2000, 2001
@@ -239,9 +239,6 @@
 /* "CMGCR" (R): Coherency Manager memory-mapped Global Configuration Register Space is implemented. */
 #define	MIPSNN_CFG3_CMGCR	0x2000
 
-/* "ULRI" (R): UserLocal register is implemented. */
-#define	MIPSNN_CFG3_ULRI	0x2000
-
 /* "IPLW" (R): Width of Status[IPL] and Cause[RIPL] fields. */
 #define	MIPSNN_CFG3_IPLW_MASK	0x0060
 #define	MIPSNN_CFG3_IPLW_SHIFT	21
@@ -271,6 +268,9 @@
 #define	MIPSNN_CFG3_ISA_MIPS64_OOR	2	/* both, MIPS64 out of reset */
 #define	MIPSNN_CFG3_ISA_microMIPS64_OOR	3	/* both, microMIPS64 OOR */
 
+/* "ULRI" (R): UserLocal register is implemented. */
+#define	MIPSNN_CFG3_ULRI	0x2000
+
 /* "DSP2P" (R): DSP v2 ASE extension present. */
 #define	MIPSNN_CFG3_DSP2P	0x0800
 



CVS commit: src/tools

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 08:12:16 UTC 2020

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
tools: if MAKEVERBOSE < 2, quieten automake builds


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tools/Makefile.gnuhost

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

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.51 src/tools/Makefile.gnuhost:1.52
--- src/tools/Makefile.gnuhost:1.51	Mon Oct 22 13:19:42 2018
+++ src/tools/Makefile.gnuhost	Sat Jun 13 08:12:16 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.51 2018/10/22 13:19:42 maya Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.52 2020/06/13 08:12:16 lukem Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -102,6 +102,10 @@ BUILD_COMMAND=	/usr/bin/env -i ${BUILD_E
 
 MAKE_ARGS+=	BISON=true DESTDIR= INSTALL=${HOST_INSTALL_FILE:Q}
 
+.if ${MAKEVERBOSE} < 2
+MAKE_ARGS+=	V=0
+.endif
+
 ALL_TARGET?=	all
 INSTALL_TARGET?=install
 



CVS commit: src/tools

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 10:49:17 UTC 2020

Modified Files:
src/tools: Makefile.gnuhost
src/tools/compat: Makefile
src/tools/host-mkdep: Makefile
src/tools/xz-include: Makefile

Log Message:
tools: configure --silent if MAKEVERBOSE == 0


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tools/Makefile.gnuhost
cvs rdiff -u -r1.87 -r1.88 src/tools/compat/Makefile
cvs rdiff -u -r1.15 -r1.16 src/tools/host-mkdep/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tools/xz-include/Makefile

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

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.52 src/tools/Makefile.gnuhost:1.53
--- src/tools/Makefile.gnuhost:1.52	Sat Jun 13 08:12:16 2020
+++ src/tools/Makefile.gnuhost	Sat Jun 13 10:49:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.52 2020/06/13 08:12:16 lukem Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.53 2020/06/13 10:49:17 lukem Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -77,6 +77,11 @@ CONFIGURE_ARGS+=--prefix=${TOOLDIR}
 CONFIGURE_ARGS+=--disable-shared
 .endif
 
+.if ${MAKEVERBOSE} == 0
+CONFIGURE_ARGS+=--silent
+.endif
+
+
 .if ${MAKE_PROGRAM} == ${MAKE}
 .ifndef _NOWRAPPER
 # Some systems have a small ARG_MAX.  On such systems, prevent Make

Index: src/tools/compat/Makefile
diff -u src/tools/compat/Makefile:1.87 src/tools/compat/Makefile:1.88
--- src/tools/compat/Makefile:1.87	Wed May  8 02:25:50 2019
+++ src/tools/compat/Makefile	Sat Jun 13 10:49:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.87 2019/05/08 02:25:50 thorpej Exp $
+#	$NetBSD: Makefile,v 1.88 2020/06/13 10:49:17 lukem Exp $
 
 HOSTLIB=	nbcompat
 
@@ -76,10 +76,15 @@ _CURDIR:=	${.CURDIR}
 
 SRCS:=		${SRCS:M*.c}
 
+CONFIGURE_ARGS=	--cache-file=config.cache
+.if ${MAKEVERBOSE} == 0
+CONFIGURE_ARGS+=--silent
+.endif
+
 config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
 	rm -f ${.TARGET}
 	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
-		${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
+		${HOST_SH} ${.CURDIR}/configure ${CONFIGURE_ARGS}
 
 defs.mk: config.cache
 	@touch ${.TARGET}

Index: src/tools/host-mkdep/Makefile
diff -u src/tools/host-mkdep/Makefile:1.15 src/tools/host-mkdep/Makefile:1.16
--- src/tools/host-mkdep/Makefile:1.15	Sun Jan 27 05:16:10 2019
+++ src/tools/host-mkdep/Makefile	Sat Jun 13 10:49:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2019/01/27 05:16:10 dholland Exp $
+#	$NetBSD: Makefile,v 1.16 2020/06/13 10:49:17 lukem Exp $
 
 .include 
 
@@ -19,11 +19,15 @@ CLEANFILES+=	config.cache config.log con
 #
 CONFIGURE_ENV=	CC=${HOST_CC:Q}
 
+CONFIGURE_ARGS=	--cache-file=config.cache
+.if ${MAKEVERBOSE} == 0
+CONFIGURE_ARGS+=--silent
+.endif
+
 realall: host-mkdep
 host-mkdep: configure host-mkdep.in
 	-rm -f $@
-	${CONFIGURE_ENV} \
-	${HOST_SH} ${.CURDIR}/configure --cache-file=config.cache
+	${CONFIGURE_ENV} ${HOST_SH} ${.CURDIR}/configure ${CONFIGURE_ARGS}
 	chmod +x $@
 
 # Use uninstalled copy of the install program

Index: src/tools/xz-include/Makefile
diff -u src/tools/xz-include/Makefile:1.2 src/tools/xz-include/Makefile:1.3
--- src/tools/xz-include/Makefile:1.2	Tue Sep 25 11:41:35 2018
+++ src/tools/xz-include/Makefile	Sat Jun 13 10:49:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2018/09/25 11:41:35 joerg Exp $
+#	$NetBSD: Makefile,v 1.3 2020/06/13 10:49:17 lukem Exp $
 
 .include 
 
@@ -9,6 +9,9 @@
 .include "Makefile.inc"
 
 CONFIGURE_ARGS+=	--enable-threads=no --disable-nls
+.if ${MAKEVERBOSE} == 0
+CONFIGURE_ARGS+=	--silent
+.endif
 
 config.status: ${XZSRCDIR}/configure
 	${HOST_SH} ${XZSRCDIR}/configure ${CONFIGURE_ARGS} \



CVS commit: src/usr.sbin/puffs/mount_9p

2020-06-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jun 13 13:45:06 UTC 2020

Modified Files:
src/usr.sbin/puffs/mount_9p: Makefile mount_9p.8 ninepuffs.c

Log Message:
Support IPv6.

Use getaddrinfo(3).  Add -4 and -6 command line options.  Obey USE_INET6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/puffs/mount_9p/Makefile
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/puffs/mount_9p/mount_9p.8
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/puffs/mount_9p/ninepuffs.c

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

Modified files:

Index: src/usr.sbin/puffs/mount_9p/Makefile
diff -u src/usr.sbin/puffs/mount_9p/Makefile:1.3 src/usr.sbin/puffs/mount_9p/Makefile:1.4
--- src/usr.sbin/puffs/mount_9p/Makefile:1.3	Wed Apr 22 15:23:06 2009
+++ src/usr.sbin/puffs/mount_9p/Makefile	Sat Jun 13 13:45:06 2020
@@ -1,5 +1,6 @@
-#	$NetBSD: Makefile,v 1.3 2009/04/22 15:23:06 lukem Exp $
+#	$NetBSD: Makefile,v 1.4 2020/06/13 13:45:06 uwe Exp $
 #
+.include 		# include early to pick up USE_*
 
 PROG=	mount_9p
 SRCS=	ninepuffs.c ninebuf.c nineproto.c fs.c node.c subr.c
@@ -7,4 +8,8 @@ LDADD+= -lpuffs -lutil
 
 MAN=	mount_9p.8
 
+.if (${USE_INET6} != "no")
+CPPFLAGS += -DINET6
+.endif
+
 .include 

Index: src/usr.sbin/puffs/mount_9p/mount_9p.8
diff -u src/usr.sbin/puffs/mount_9p/mount_9p.8:1.13 src/usr.sbin/puffs/mount_9p/mount_9p.8:1.14
--- src/usr.sbin/puffs/mount_9p/mount_9p.8:1.13	Sat May 30 00:00:35 2020
+++ src/usr.sbin/puffs/mount_9p/mount_9p.8	Sat Jun 13 13:45:06 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount_9p.8,v 1.13 2020/05/30 00:00:35 uwe Exp $
+.\"	$NetBSD: mount_9p.8,v 1.14 2020/06/13 13:45:06 uwe Exp $
 .\"
 .\" Copyright (c) 2007 Antti Kantee.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .Nd mount a file server using the 9P resource sharing protocol
 .Sh SYNOPSIS
 .Nm
-.Op Fl su
+.Op Fl 46su
 .Op Fl o Ar options
 .Op Fl p Ar port
 .Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Op Li \&: Ns Ar path
@@ -72,6 +72,14 @@ for more information.
 .Pp
 The following options are available:
 .Bl -tag -width "Fl o Ar options"
+.It Fl 4
+Forces
+.Nm
+to use IPv4 addresses only.
+.It Fl 6
+Forces
+.Nm
+to use IPv6 addresses only.
 .It Fl c
 Interpret
 .Ar special

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.29 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.30
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.29	Sat May 30 02:53:30 2020
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Sat Jun 13 13:45:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninepuffs.c,v 1.29 2020/05/30 02:53:30 uwe Exp $	*/
+/*	$NetBSD: ninepuffs.c,v 1.30 2020/06/13 13:45:06 uwe Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.29 2020/05/30 02:53:30 uwe Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.30 2020/06/13 13:45:06 uwe Exp $");
 #endif /* !lint */
 
 #include 
@@ -42,6 +42,7 @@ __RCSID("$NetBSD: ninepuffs.c,v 1.29 202
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -52,7 +53,7 @@ __RCSID("$NetBSD: ninepuffs.c,v 1.29 202
 #include "ninepuffs.h"
 #include "nineproto.h"
 
-#define DEFPORT_9P 564
+#define DEFPORT_9P "564" /* "9pfs", but don't depend on it being in services */
 
 __dead static void
 usage(void)
@@ -66,39 +67,58 @@ usage(void)
 }
 
 /*
- * TCPv4 connection to 9P file server, forget IL and IPv6 for now.
+ * TCP connection to 9P file server.
  * Return connected socket or exit with error.
  */
 static int
-serverconnect(const char *addr, unsigned short port)
+serverconnect(const char *hostname, const char *portname, int family)
 {
-	struct sockaddr_in mysin;
-	struct hostent *he;
-	int s, ret, opt;
-
-	he = gethostbyname2(addr, AF_INET);
-	if (he == NULL) {
-		herror("gethostbyname");
-		exit(1);
+	int ret;
+
+	struct addrinfo hints;
+	memset(, 0, sizeof(hints));
+	hints.ai_family = family;
+	hints.ai_socktype = SOCK_STREAM;
+
+	if (portname == NULL) {
+		portname = DEFPORT_9P;
+		hints.ai_flags |= AI_NUMERICSERV;
 	}
 
-	s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (s == -1)
-		err(1, "socket");
+	struct addrinfo *ai0;
+	ret = getaddrinfo(hostname, portname, , );
+	if (ret != 0)
+		errx(EXIT_FAILURE, "%s", gai_strerror(ret));
+
+	int s = -1;
+	const char *cause = NULL;
+	for (struct addrinfo *ai = ai0; ai != NULL; ai = ai->ai_next) {
+		s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+		if (s < 0) {
+			cause = "socket";
+			continue;
+		}
+
+		const int opt = 1;
+		ret = setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, , sizeof(opt));
+		if (ret < 0) {
+			cause = "SO_NOSIGPIPE";
+			continue;
+		}
 
-	opt = 1;
-	ret = setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, , sizeof(opt));
-	if (ret == -1)
-		err(1, "setsockopt(SO_NOSIGPIPE)");
-
-	memset(, 0, sizeof(struct sockaddr_in));
-	mysin.sin_family = AF_INET;
-	mysin.sin_port = htons(port);
-	memcpy(_addr, he->h_addr, sizeof(struct 

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

2020-06-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jun 13 14:26:34 UTC 2020

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

Log Message:
Note some hard-coded capabilties that can be probed.

XXX: Fix this and CPU table in mips/mips_machdep.c one day...


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/mips/include/locore.h

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

Modified files:

Index: src/sys/arch/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.105 src/sys/arch/mips/include/locore.h:1.106
--- src/sys/arch/mips/include/locore.h:1.105	Sun May 24 07:15:24 2020
+++ src/sys/arch/mips/include/locore.h	Sat Jun 13 14:26:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.105 2020/05/24 07:15:24 simonb Exp $ */
+/* $NetBSD: locore.h,v 1.106 2020/06/13 14:26:33 simonb Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -857,17 +857,17 @@ struct pridtab {
 #define  MIPS_CP0FL_CACHE_ERR	__BIT(2)
 #define  MIPS_CP0FL_EIRR	__BIT(3)
 #define  MIPS_CP0FL_EIMR	__BIT(4)
-#define  MIPS_CP0FL_EBASE	__BIT(5)
-#define  MIPS_CP0FL_CONFIG	__BIT(6)
-#define  MIPS_CP0FL_CONFIG1	__BIT(7)
-#define  MIPS_CP0FL_CONFIG2	__BIT(8)
-#define  MIPS_CP0FL_CONFIG3	__BIT(9)
-#define  MIPS_CP0FL_CONFIG4	__BIT(10)
-#define  MIPS_CP0FL_CONFIG5	__BIT(11)
-#define  MIPS_CP0FL_CONFIG6	__BIT(12)
-#define  MIPS_CP0FL_CONFIG7	__BIT(13)
-#define  MIPS_CP0FL_USERLOCAL	__BIT(14)
-#define  MIPS_CP0FL_HWRENA	__BIT(15)
+#define  MIPS_CP0FL_EBASE	__BIT(5)  /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG	__BIT(6)  /* XXX defined - doesn't need to be hard coded */
+#define  MIPS_CP0FL_CONFIG1	__BIT(7)  /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG2	__BIT(8)  /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG3	__BIT(9)  /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG4	__BIT(10) /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG5	__BIT(11) /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG6	__BIT(12) /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_CONFIG7	__BIT(13) /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_USERLOCAL	__BIT(14) /* XXX probeable - shouldn't be hard coded */
+#define  MIPS_CP0FL_HWRENA	__BIT(15) /* XXX probeable - shouldn't be hard coded */
 
 /*
  * cpu_cidflags defines, by company



CVS commit: src/sys/arch/mips

2020-06-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jun 13 14:39:07 UTC 2020

Modified Files:
src/sys/arch/mips/include: mipsNN.h
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Use the correct config3 field name (ULRI) for UserLocal register is
implemented bit.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/include/mipsNN.h
cvs rdiff -u -r1.285 -r1.286 src/sys/arch/mips/mips/mips_machdep.c

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

Modified files:

Index: src/sys/arch/mips/include/mipsNN.h
diff -u src/sys/arch/mips/include/mipsNN.h:1.6 src/sys/arch/mips/include/mipsNN.h:1.7
--- src/sys/arch/mips/include/mipsNN.h:1.6	Mon Jul 11 16:15:35 2016
+++ src/sys/arch/mips/include/mipsNN.h	Sat Jun 13 14:39:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsNN.h,v 1.6 2016/07/11 16:15:35 matt Exp $	*/
+/*	$NetBSD: mipsNN.h,v 1.7 2020/06/13 14:39:07 simonb Exp $	*/
 
 /*
  * Copyright 2000, 2001
@@ -239,8 +239,8 @@
 /* "CMGCR" (R): Coherency Manager memory-mapped Global Configuration Register Space is implemented. */
 #define	MIPSNN_CFG3_CMGCR	0x2000
 
-/* "ULRP" (R): UserLocal register is implemented. */
-#define	MIPSNN_CFG3_ULRP	0x2000
+/* "ULRI" (R): UserLocal register is implemented. */
+#define	MIPSNN_CFG3_ULRI	0x2000
 
 /* "IPLW" (R): Width of Status[IPL] and Cause[RIPL] fields. */
 #define	MIPSNN_CFG3_IPLW_MASK	0x0060

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.285 src/sys/arch/mips/mips/mips_machdep.c:1.286
--- src/sys/arch/mips/mips/mips_machdep.c:1.285	Wed Jun 10 01:42:17 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jun 13 14:39:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.285 2020/06/10 01:42:17 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.286 2020/06/13 14:39:07 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.285 2020/06/10 01:42:17 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.286 2020/06/13 14:39:07 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -935,7 +935,7 @@ mips32r2_vector_init(const struct splsw 
 	uint32_t cp0flags = mips_options.mips_cpu->cpu_cp0flags;
 	if (mipsNN_cp0_config2_read() & MIPSNN_CFG2_M) {
 		const uint32_t cfg3 = mipsNN_cp0_config3_read();
-		if (cfg3 & MIPSNN_CFG3_ULRP) {
+		if (cfg3 & MIPSNN_CFG3_ULRI) {
 			cp0flags |= MIPS_CP0FL_USERLOCAL;
 		}
 		if (cfg3 & MIPSNN_CFG3_DSP2P) {
@@ -1081,7 +1081,7 @@ mips64r2_vector_init(const struct splsw 
 	uint32_t cp0flags = mips_options.mips_cpu->cpu_cp0flags;
 	if (mipsNN_cp0_config2_read() & MIPSNN_CFG2_M) {
 		const uint32_t cfg3 = mipsNN_cp0_config3_read();
-		if (cfg3 & MIPSNN_CFG3_ULRP) {
+		if (cfg3 & MIPSNN_CFG3_ULRI) {
 			cp0flags |= MIPS_CP0FL_USERLOCAL;
 		}
 		if (cfg3 & MIPSNN_CFG3_DSP2P) {



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

2020-06-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jun 13 14:45:17 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Correct a comment (or at least comment on what we do instead of half of
what we do).


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/sys/arch/mips/mips/mips_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.286 src/sys/arch/mips/mips/mips_machdep.c:1.287
--- src/sys/arch/mips/mips/mips_machdep.c:1.286	Sat Jun 13 14:39:07 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jun 13 14:45:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.286 2020/06/13 14:39:07 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.287 2020/06/13 14:45:17 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.286 2020/06/13 14:39:07 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.287 2020/06/13 14:45:17 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -930,7 +930,7 @@ mips32r2_vector_init(const struct splsw 
 	  mips32r2_intr_end - mips32r2_tlb_miss);
 
 	/*
-	 * Let see if this cpu has DSP V2 ASE...
+	 * Let's see if this cpu has USERLOCAL or DSP V2 ASE...
 	 */
 	uint32_t cp0flags = mips_options.mips_cpu->cpu_cp0flags;
 	if (mipsNN_cp0_config2_read() & MIPSNN_CFG2_M) {
@@ -1076,7 +1076,7 @@ mips64r2_vector_init(const struct splsw 
 	  mips64r2_intr_end - mips64r2_tlb_miss);
 
 	/*
-	 * Let see if this cpu has DSP V2 ASE...
+	 * Let's see if this cpu has USERLOCAL or DSP V2 ASE...
 	 */
 	uint32_t cp0flags = mips_options.mips_cpu->cpu_cp0flags;
 	if (mipsNN_cp0_config2_read() & MIPSNN_CFG2_M) {



CVS commit: src

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 11:42:47 UTC 2020

Modified Files:
src: build.sh

Log Message:
nbmake bootstrap: silent configure if MAKEVERBOSE==0

Be consistent with the silencing of configure in tools/
and suppress the output in build.sh configure of nbmake


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.339 src/build.sh:1.340
--- src/build.sh:1.339	Sun May 24 04:55:53 2020
+++ src/build.sh	Sat Jun 13 11:42:47 2020
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.339 2020/05/24 04:55:53 rin Exp $
+#	$NetBSD: build.sh,v 1.340 2020/06/13 11:42:47 lukem Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1662,12 +1662,17 @@ rebuildmake()
 	if ! ${do_rebuildmake}; then
 		return
 	fi
+	
+	# Silent configure with MAKEVERBOSE==0
+	if [ ${MAKEVERBOSE:-2} -eq 0 ]; then
+		configure_args=--silent
+	fi
 
 	statusmsg "Bootstrapping ${toolprefix}make"
 	${runcmd} cd "${tmpdir}"
 	${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \
 		CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
-	${HOST_SH} "${TOP}/tools/make/configure" ||
+	${HOST_SH} "${TOP}/tools/make/configure" ${configure_args} ||
 	( cp ${tmpdir}/config.log ${tmpdir}-config.log
 	  bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" )
 	${runcmd} ${HOST_SH} buildmake.sh ||
@@ -1937,7 +1942,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src/sys/dev/pci

2020-06-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jun 13 12:42:26 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add ASIX AX99100 Multi I/O (Serial,Parallel,I2C,SPI,LocalBus,GPIO) Controller


To generate a diff of this commit:
cvs rdiff -u -r1.1415 -r1.1416 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1415 src/sys/dev/pci/pcidevs:1.1416
--- src/sys/dev/pci/pcidevs:1.1415	Thu Jun 11 09:01:27 2020
+++ src/sys/dev/pci/pcidevs	Sat Jun 13 12:42:26 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1415 2020/06/11 09:01:27 jdolecek Exp $
+$NetBSD: pcidevs,v 1.1416 2020/06/13 12:42:26 ryo Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1346,6 +1346,7 @@ product ARECA ARC1880 		0x1880	ARC-1880
 
 /* ASIX Electronics products */
 product ASIX AX88140A	0x1400	AX88140A 10/100 Ethernet
+product ASIX AX99100	0x9100	AX99100 Multi I/O Controller
 
 /* ASMedia products */
 product ASMEDIA ASM1061_01	0x0601	ASM1061 AHCI SATA III Controller



CVS commit: src/usr.bin/make

2020-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jun 13 07:30:02 UTC 2020

Modified Files:
src/usr.bin/make: str.c

Log Message:
usr.bin/make: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/make/str.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/make/str.c
diff -u src/usr.bin/make/str.c:1.42 src/usr.bin/make/str.c:1.43
--- src/usr.bin/make/str.c:1.42	Wed May  6 02:30:10 2020
+++ src/usr.bin/make/str.c	Sat Jun 13 07:30:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $	*/
+/*	$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $");
+__RCSID("$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -415,8 +415,8 @@ Str_Match(const char *string, const char
 			goto thisCharOK;
 		}
 		/*
-		 * If the next pattern character is '/', just strip off the
-		 * '/' so we do exact matching on the character that follows.
+		 * If the next pattern character is a backslash, just strip it
+		 * off so we do exact matching on the character that follows.
 		 */
 		if (*pattern == '\\') {
 			++pattern;



CVS commit: src/usr.bin/make

2020-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jun 13 07:49:00 UTC 2020

Modified Files:
src/usr.bin/make: str.c

Log Message:
usr.bin/make: remove redundant parentheses around return


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/str.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/make/str.c
diff -u src/usr.bin/make/str.c:1.44 src/usr.bin/make/str.c:1.45
--- src/usr.bin/make/str.c:1.44	Sat Jun 13 07:36:07 2020
+++ src/usr.bin/make/str.c	Sat Jun 13 07:48:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -119,7 +119,7 @@ str_concat(const char *s1, const char *s
 	/* copy second string plus EOS into place */
 	memcpy(result + len1, s2, len2 + 1);
 
-	return(result);
+	return result;
 }
 
 /*-
@@ -344,9 +344,9 @@ Str_Match(const char *string, const char
 		 * pattern but not at the end of the string, we failed.
 		 */
 		if (*pattern == 0)
-			return(!*string);
+			return !*string;
 		if (*string == 0 && *pattern != '*')
-			return(0);
+			return 0;
 		/*
 		 * Check for a "*" as the next pattern character.  It matches
 		 * any substring.  We handle this by calling ourselves
@@ -356,13 +356,13 @@ Str_Match(const char *string, const char
 		if (*pattern == '*') {
 			pattern++;
 			if (*pattern == 0)
-return(1);
+return 1;
 			while (*string != 0) {
 if (Str_Match(string, pattern))
-	return(1);
+	return 1;
 ++string;
 			}
-			return(0);
+			return 0;
 		}
 		/*
 		 * Check for a "?" as the next pattern character.  It matches
@@ -388,14 +388,14 @@ Str_Match(const char *string, const char
 if ((*pattern == ']') || (*pattern == 0)) {
 	if (nomatch)
 		break;
-	return(0);
+	return 0;
 }
 if (*pattern == *string)
 	break;
 if (pattern[1] == '-') {
 	c2 = pattern[2];
 	if (c2 == 0)
-		return(nomatch);
+		return nomatch;
 	if ((*pattern <= *string) &&
 	(c2 >= *string))
 		break;
@@ -421,14 +421,14 @@ Str_Match(const char *string, const char
 		if (*pattern == '\\') {
 			++pattern;
 			if (*pattern == 0)
-return(0);
+return 0;
 		}
 		/*
 		 * There's no special character.  Just make sure that the
 		 * next characters of each string match.
 		 */
 		if (*pattern != *string)
-			return(0);
+			return 0;
 thisCharOK:	++pattern;
 		++string;
 	}



CVS commit: src/tools/make

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 11:28:24 UTC 2020

Modified Files:
src/tools/make: buildmake.sh.in

Log Message:
nbmake bootstrap: if MAKEVERBOSE < 2, output similar to 


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tools/make/buildmake.sh.in

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

Modified files:

Index: src/tools/make/buildmake.sh.in
diff -u src/tools/make/buildmake.sh.in:1.12 src/tools/make/buildmake.sh.in:1.13
--- src/tools/make/buildmake.sh.in:1.12	Tue Jan 16 08:53:51 2018
+++ src/tools/make/buildmake.sh.in	Sat Jun 13 11:28:24 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: buildmake.sh.in,v 1.12 2018/01/16 08:53:51 uwe Exp $
+#	$NetBSD: buildmake.sh.in,v 1.13 2020/06/13 11:28:24 lukem Exp $
 #
 # buildmake.sh.in - Autoconf-processed shell script for building make(1).
 #
@@ -17,12 +17,17 @@ _CFLAGS="${_CFLAGS} @CFLAGS@"
 _LDFLAGS="@LDFLAGS@ @LIBS@"
 
 docmd () {
-	echo "$1"
-	$1 || exit 1
+	if [ ${MAKEVERBOSE:-2} -lt 2 ]; then
+		echo "   $1 ${2##*/}"
+	else
+		echo "$3"
+	fi
+	$3 || exit 1
 }
 
 for f in $MKSRCDIR/*.c $MKSRCDIR/lst.lib/*.c; do
-	docmd "${_CC} ${_CFLAGS} -c $f"
+	docmd "compile " "$f" "${_CC} ${_CFLAGS} -c $f"
 done
 
-docmd "${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}"
+docmd "   link " "${_TOOL_PREFIX:-nb}make" \
+	"${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}"



CVS commit: src/tools/make

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 11:32:52 UTC 2020

Modified Files:
src/tools/make: buildmake.sh.in

Log Message:
nbmake bootstrap: consistency fix in MAKEVERBOSE<2 support


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tools/make/buildmake.sh.in

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

Modified files:

Index: src/tools/make/buildmake.sh.in
diff -u src/tools/make/buildmake.sh.in:1.13 src/tools/make/buildmake.sh.in:1.14
--- src/tools/make/buildmake.sh.in:1.13	Sat Jun 13 11:28:24 2020
+++ src/tools/make/buildmake.sh.in	Sat Jun 13 11:32:52 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: buildmake.sh.in,v 1.13 2020/06/13 11:28:24 lukem Exp $
+#	$NetBSD: buildmake.sh.in,v 1.14 2020/06/13 11:32:52 lukem Exp $
 #
 # buildmake.sh.in - Autoconf-processed shell script for building make(1).
 #
@@ -18,7 +18,7 @@ _LDFLAGS="@LDFLAGS@ @LIBS@"
 
 docmd () {
 	if [ ${MAKEVERBOSE:-2} -lt 2 ]; then
-		echo "   $1 ${2##*/}"
+		echo "$1 ${2##*/}"
 	else
 		echo "$3"
 	fi



CVS commit: src/sys/dev/pci

2020-06-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jun 13 12:42:58 UTC 2020

Modified Files:
src/sys/dev/pci: pucdata.c

Log Message:
add entry for ASIX AX99100 PCIe 4port serial card


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/pucdata.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/pci/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.107 src/sys/dev/pci/pucdata.c:1.108
--- src/sys/dev/pci/pucdata.c:1.107	Sun Apr  5 10:43:09 2020
+++ src/sys/dev/pci/pucdata.c	Sat Jun 13 12:42:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.107 2020/04/05 10:43:09 ryo Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.108 2020/06/13 12:42:58 ryo Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.107 2020/04/05 10:43:09 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.108 2020/06/13 12:42:58 ryo Exp $");
 
 #include 
 #include 
@@ -142,6 +142,15 @@ const struct puc_device_description puc_
 	}
 	},
 
+	/* ASIX PCIe AX99100 : 4S */
+	{   "ASIX AX99100 UART",
+	{	PCI_VENDOR_ASIX, PCI_PRODUCT_ASIX_AX99100,	0xa000, 0x1000 },
+	{	0x, 0x,	0x, 0x },
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
 	/* Avlab Technology, Inc. PCI 2 Serial: 2S */
 	{   "Avlab PCI 2 Serial",
 	{	PCI_VENDOR_AVLAB, PCI_PRODUCT_AVLAB_PCI2S,	0, 0  },



CVS commit: src/sys/dev/pci

2020-06-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jun 13 12:42:51 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1402 -r1.1403 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1401 -r1.1402 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: src/usr.bin/make

2020-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jun 13 07:36:07 UTC 2020

Modified Files:
src/usr.bin/make: str.c

Log Message:
usr.bin/make: consistently use ++ for incrementing pointers


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/str.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/make/str.c
diff -u src/usr.bin/make/str.c:1.43 src/usr.bin/make/str.c:1.44
--- src/usr.bin/make/str.c:1.43	Sat Jun 13 07:30:02 2020
+++ src/usr.bin/make/str.c	Sat Jun 13 07:36:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.43 2020/06/13 07:30:02 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.44 2020/06/13 07:36:07 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -304,7 +304,7 @@ Str_FindSubstring(const char *string, co
 	 * substring.
 	 */
 
-	for (b = substring; *string != 0; string += 1) {
+	for (b = substring; *string != 0; string++) {
 		if (*string != *b)
 			continue;
 		a = string;
@@ -354,7 +354,7 @@ Str_Match(const char *string, const char
 		 * match or we reach the end of the string.
 		 */
 		if (*pattern == '*') {
-			pattern += 1;
+			pattern++;
 			if (*pattern == 0)
 return(1);
 			while (*string != 0) {



CVS commit: src/tools/make

2020-06-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun 13 11:39:43 UTC 2020

Modified Files:
src/tools/make: buildmake.sh.in

Log Message:
nbmake bootstrap: be quieter if MAKEVERBOSE==0

More accurately simulate  and don't even print
the "compile" lines with MAKEVERBOSE=0


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tools/make/buildmake.sh.in

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

Modified files:

Index: src/tools/make/buildmake.sh.in
diff -u src/tools/make/buildmake.sh.in:1.14 src/tools/make/buildmake.sh.in:1.15
--- src/tools/make/buildmake.sh.in:1.14	Sat Jun 13 11:32:52 2020
+++ src/tools/make/buildmake.sh.in	Sat Jun 13 11:39:43 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: buildmake.sh.in,v 1.14 2020/06/13 11:32:52 lukem Exp $
+#	$NetBSD: buildmake.sh.in,v 1.15 2020/06/13 11:39:43 lukem Exp $
 #
 # buildmake.sh.in - Autoconf-processed shell script for building make(1).
 #
@@ -17,11 +17,14 @@ _CFLAGS="${_CFLAGS} @CFLAGS@"
 _LDFLAGS="@LDFLAGS@ @LIBS@"
 
 docmd () {
-	if [ ${MAKEVERBOSE:-2} -lt 2 ]; then
-		echo "$1 ${2##*/}"
-	else
-		echo "$3"
-	fi
+	case "${MAKEVERBOSE:-2}" in
+	0)
+		;;
+	1)
+		echo "$1 ${2##*/}" ;;
+	*)
+		echo "$3" ;;
+	esac
 	$3 || exit 1
 }
 



CVS commit: src

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:00:29 UTC 2020

Modified Files:
src: build.sh

Log Message:
Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.340 src/build.sh:1.341
--- src/build.sh:1.340	Sat Jun 13 11:42:47 2020
+++ src/build.sh	Sat Jun 13 18:00:29 2020
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.340 2020/06/13 11:42:47 lukem Exp $
+#	$NetBSD: build.sh,v 1.341 2020/06/13 18:00:29 riastradh Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1662,7 +1662,7 @@ rebuildmake()
 	if ! ${do_rebuildmake}; then
 		return
 	fi
-	
+
 	# Silent configure with MAKEVERBOSE==0
 	if [ ${MAKEVERBOSE:-2} -eq 0 ]; then
 		configure_args=--silent
@@ -1942,7 +1942,7 @@ createmakewrapper()
 	eval cat 

CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:35:35 UTC 2020

Modified Files:
src/sys/dev: cgd.c cgd_crypto.c cgd_crypto.h

Log Message:
Fold `cipher prep' into `cipher' in cgd.

Simplify some logic along the way and u_int*_t -> uint*_t.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/cgd.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/cgd_crypto.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/cgd_crypto.h

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

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.126 src/sys/dev/cgd.c:1.127
--- src/sys/dev/cgd.c:1.126	Thu Jun  4 19:54:53 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 18:35:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.126 2020/06/04 19:54:53 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.127 2020/06/13 18:35:35 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.126 2020/06/04 19:54:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.127 2020/06/13 18:35:35 riastradh Exp $");
 
 #include 
 #include 
@@ -1535,7 +1535,6 @@ cgd_cipher(struct cgd_softc *sc, void *d
 {
 	char		*dst = dstv;
 	char		*src = srcv;
-	cfunc_cipher_prep	*ciprep = sc->sc_cfuncs->cf_cipher_prep;
 	cfunc_cipher	*cipher = sc->sc_cfuncs->cf_cipher;
 	struct uio	dstuio;
 	struct uio	srcuio;
@@ -1543,7 +1542,7 @@ cgd_cipher(struct cgd_softc *sc, void *d
 	struct iovec	srciov[2];
 	size_t		blocksize = sc->sc_cdata.cf_blocksize;
 	size_t		todo;
-	char		blkno_buf[CGD_MAXBLOCKSIZE], *iv;
+	char		blkno_buf[CGD_MAXBLOCKSIZE];
 
 	DPRINTF_FOLLOW(("cgd_cipher() dir=%d\n", dir));
 
@@ -1576,15 +1575,7 @@ cgd_cipher(struct cgd_softc *sc, void *d
 		IFDEBUG(CGDB_CRYPTO, hexprint("step 1: blkno_buf",
 		blkno_buf, blocksize));
 
-		/*
-		 * Compute an initial IV. All ciphers
-		 * can convert blkno_buf in-place.
-		 */
-		iv = blkno_buf;
-		ciprep(sc->sc_cdata.cf_priv, iv, blkno_buf, blocksize, dir);
-		IFDEBUG(CGDB_CRYPTO, hexprint("step 2: iv", iv, blocksize));
-
-		cipher(sc->sc_cdata.cf_priv, , , iv, dir);
+		cipher(sc->sc_cdata.cf_priv, , , blkno_buf, dir);
 
 		dst += todo;
 		src += todo;

Index: src/sys/dev/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.17 src/sys/dev/cgd_crypto.c:1.18
--- src/sys/dev/cgd_crypto.c:1.17	Sat Dec 14 16:58:38 2019
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 18:35:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.17 2019/12/14 16:58:38 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.18 2020/06/13 18:35:35 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.17 2019/12/14 16:58:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.18 2020/06/13 18:35:35 riastradh Exp $");
 
 #include 
 #include 
@@ -59,22 +59,18 @@ __KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c
 static cfunc_init		cgd_cipher_aes_cbc_init;
 static cfunc_destroy		cgd_cipher_aes_cbc_destroy;
 static cfunc_cipher		cgd_cipher_aes_cbc;
-static cfunc_cipher_prep	cgd_cipher_aes_cbc_prep;
 
 static cfunc_init		cgd_cipher_aes_xts_init;
 static cfunc_destroy		cgd_cipher_aes_xts_destroy;
 static cfunc_cipher		cgd_cipher_aes_xts;
-static cfunc_cipher_prep	cgd_cipher_aes_xts_prep;
 
 static cfunc_init		cgd_cipher_3des_init;
 static cfunc_destroy		cgd_cipher_3des_destroy;
 static cfunc_cipher		cgd_cipher_3des_cbc;
-static cfunc_cipher_prep	cgd_cipher_3des_cbc_prep;
 
 static cfunc_init		cgd_cipher_bf_init;
 static cfunc_destroy		cgd_cipher_bf_destroy;
 static cfunc_cipher		cgd_cipher_bf_cbc;
-static cfunc_cipher_prep	cgd_cipher_bf_cbc_prep;
 
 static const struct cryptfuncs cf[] = {
 	{
@@ -82,28 +78,24 @@ static const struct cryptfuncs cf[] = {
 		.cf_init	= cgd_cipher_aes_xts_init,
 		.cf_destroy	= cgd_cipher_aes_xts_destroy,
 		.cf_cipher	= cgd_cipher_aes_xts,
-		.cf_cipher_prep	= cgd_cipher_aes_xts_prep,
 	},
 	{
 		.cf_name	= "aes-cbc",
 		.cf_init	= cgd_cipher_aes_cbc_init,
 		.cf_destroy	= cgd_cipher_aes_cbc_destroy,
 		.cf_cipher	= cgd_cipher_aes_cbc,
-		.cf_cipher_prep	= cgd_cipher_aes_cbc_prep,
 	},
 	{
 		.cf_name	= "3des-cbc",
 		.cf_init	= cgd_cipher_3des_init,
 		.cf_destroy	= cgd_cipher_3des_destroy,
 		.cf_cipher	= cgd_cipher_3des_cbc,
-		.cf_cipher_prep	= cgd_cipher_3des_cbc_prep,
 	},
 	{
 		.cf_name	= "blowfish-cbc",
 		.cf_init	= cgd_cipher_bf_init,
 		.cf_destroy	= cgd_cipher_bf_destroy,
 		.cf_cipher	= cgd_cipher_bf_cbc,
-		.cf_cipher_prep	= cgd_cipher_bf_cbc_prep,
 	},
 };
 const struct cryptfuncs *
@@ -150,9 +142,9 @@ cgd_cipher_uio(void *privdata, cipher_fu
 	src = srcuio->uio_iov;
 	srcnum = srcuio->uio_iovcnt;
 	for (;;) {
-		int	  l = MIN(dst->iov_len - dstoff, src->iov_len - srcoff);
-		u_int8_t *d = (u_int8_t *)dst->iov_base + dstoff;
-		const u_int8_t *s = (const u_int8_t *)src->iov_base + srcoff;
+		int l = MIN(dst->iov_len - 

CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:36:07 UTC 2020

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

Log Message:
Print cgd self-test noise only with verbose boot.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.127 src/sys/dev/cgd.c:1.128
--- src/sys/dev/cgd.c:1.127	Sat Jun 13 18:35:35 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 18:36:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.127 2020/06/13 18:35:35 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.128 2020/06/13 18:36:07 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.127 2020/06/13 18:35:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.128 2020/06/13 18:36:07 riastradh Exp $");
 
 #include 
 #include 
@@ -1602,15 +1602,13 @@ selftest(void)
 	struct cgd_softc sc;
 	void *buf;
 
-	printf("running cgd selftest ");
-
 	for (size_t i = 0; i < __arraycount(selftests); i++) {
 		const char *alg = selftests[i].alg;
 		const uint8_t *key = selftests[i].key;
 		int keylen = selftests[i].keylen;
 		int txtlen = selftests[i].txtlen;
 
-		printf("%s-%d ", alg, keylen);
+		aprint_verbose("cgd: self-test %s-%d\n", alg, keylen);
 
 		memset(, 0, sizeof(sc));
 
@@ -1648,7 +1646,7 @@ selftest(void)
 		sc.sc_cfuncs->cf_destroy(sc.sc_cdata.cf_priv);
 	}
 
-	printf("done\n");
+	aprint_verbose("cgd: self-tests passed\n");
 }
 
 MODULE(MODULE_CLASS_DRIVER, cgd, "blowfish,des,dk_subr,bufq_fcfs");



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:40:44 UTC 2020

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

Log Message:
Specify which cgd self-test failed and dump the mismatch.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.129 src/sys/dev/cgd.c:1.130
--- src/sys/dev/cgd.c:1.129	Sat Jun 13 18:38:33 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 18:40:44 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.129 2020/06/13 18:38:33 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.130 2020/06/13 18:40:44 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.129 2020/06/13 18:38:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.130 2020/06/13 18:40:44 riastradh Exp $");
 
 #include 
 #include 
@@ -1635,13 +1635,21 @@ selftest(void)
 
 		cgd_cipher(, buf, buf, txtlen, selftests[i].blkno,
 selftests[i].secsize, CGD_CIPHER_ENCRYPT);
-		if (memcmp(buf, selftests[i].ctxt, txtlen) != 0)
-			panic("encryption is broken");
+		if (memcmp(buf, selftests[i].ctxt, txtlen) != 0) {
+			hexdump(printf, "was", buf, txtlen);
+			hexdump(printf, "exp", selftests[i].ctxt, txtlen);
+			panic("cgd %s encryption is broken [%zu]",
+			selftests[i].alg, i);
+		}
 
 		cgd_cipher(, buf, buf, txtlen, selftests[i].blkno,
 selftests[i].secsize, CGD_CIPHER_DECRYPT);
-		if (memcmp(buf, selftests[i].ptxt, txtlen) != 0)
-			panic("decryption is broken");
+		if (memcmp(buf, selftests[i].ptxt, txtlen) != 0) {
+			hexdump(printf, "was", buf, txtlen);
+			hexdump(printf, "exp", selftests[i].ptxt, txtlen);
+			panic("cgd %s decryption is broken [%zu]",
+			selftests[i].alg, i);
+		}
 
 		kmem_free(buf, txtlen);
 		sc.sc_cfuncs->cf_destroy(sc.sc_cdata.cf_priv);



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:40:14 UTC 2020

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

Log Message:
Shrink AES-XTS state by 280 bytes.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/cgd_crypto.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/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.21 src/sys/dev/cgd_crypto.c:1.22
--- src/sys/dev/cgd_crypto.c:1.21	Sat Jun 13 18:39:36 2020
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 18:40:14 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.21 2020/06/13 18:39:36 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.22 2020/06/13 18:40:14 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.21 2020/06/13 18:39:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.22 2020/06/13 18:40:14 riastradh Exp $");
 
 #include 
 #include 
@@ -270,10 +270,25 @@ cgd_cipher_aes_cbc(void *privdata, struc
 	}
 }
 
+/*
+ * AES-XTS
+ */
+
+struct aesxts {
+	keyInstance	ax_enckey;
+	keyInstance	ax_deckey;
+	keyInstance	ax_tweakkey;
+};
+
+struct aesxts_state {
+	struct aesxts	*axs_keys;
+	uint8_t		axs_tweak[CGD_AES_BLOCK_SIZE];
+};
+
 static void *
 cgd_cipher_aes_xts_init(size_t keylen, const void *xtskey, size_t *blocksize)
 {
-	struct aes_privdata *ap;
+	struct aesxts *ax;
 	const char *key, *key2; /* XTS key is made of two AES keys. */
 
 	if (!blocksize)
@@ -285,77 +300,75 @@ cgd_cipher_aes_xts_init(size_t keylen, c
 	if (*blocksize != 128)
 		return NULL;
 
-	ap = kmem_zalloc(2 * sizeof(*ap), KM_SLEEP);
+	ax = kmem_zalloc(sizeof(*ax), KM_SLEEP);
 	keylen /= 2;
 	key = xtskey;
 	key2 = key + keylen / CHAR_BIT;
 
-	rijndael_makeKey([0].ap_enckey, DIR_ENCRYPT, keylen, key);
-	rijndael_makeKey([0].ap_deckey, DIR_DECRYPT, keylen, key);
-	rijndael_makeKey([1].ap_enckey, DIR_ENCRYPT, keylen, key2);
+	rijndael_makeKey(>ax_enckey, DIR_ENCRYPT, keylen, key);
+	rijndael_makeKey(>ax_deckey, DIR_DECRYPT, keylen, key);
+	rijndael_makeKey(>ax_tweakkey, DIR_ENCRYPT, keylen, key2);
 
-	return ap;
+	return ax;
 }
 
 static void
-cgd_cipher_aes_xts_destroy(void *data)
+cgd_cipher_aes_xts_destroy(void *cookie)
 {
-	struct aes_privdata *apd = data;
+	struct aesxts *ax = cookie;
 
-	explicit_memset(apd, 0, 2 * sizeof(*apd));
-	kmem_free(apd, 2 * sizeof(*apd));
+	explicit_memset(ax, 0, sizeof(*ax));
+	kmem_free(ax, sizeof(*ax));
 }
 
 static void
-aes_xts_enc_int(void *privdata, void *dst, const void *src, size_t len)
+aes_xts_enc_int(void *state, void *dst, const void *src, size_t len)
 {
-	struct aes_encdata	*ae = privdata;
-	cipherInstance		 cipher;
-	int			 cipher_ok __diagused;
+	struct aesxts_state *axs = state;
+	cipherInstance cipher;
+	int cipher_ok __diagused;
 
-	cipher_ok = rijndael_cipherInit(, MODE_XTS, ae->ae_iv);
+	cipher_ok = rijndael_cipherInit(, MODE_XTS, axs->axs_tweak);
 	KASSERT(cipher_ok > 0);
-	rijndael_blockEncrypt(, ae->ae_key, src, /*inputbits*/len * 8,
-	dst);
-	(void)memcpy(ae->ae_iv, cipher.IV, CGD_AES_BLOCK_SIZE);
+	rijndael_blockEncrypt(, >axs_keys->ax_enckey, src,
+	/*inputbits*/len * 8, dst);
+	memcpy(axs->axs_tweak, cipher.IV, CGD_AES_BLOCK_SIZE);
 }
 
 static void
-aes_xts_dec_int(void *privdata, void *dst, const void *src, size_t len)
+aes_xts_dec_int(void *state, void *dst, const void *src, size_t len)
 {
-	struct aes_encdata	*ae = privdata;
-	cipherInstance		 cipher;
-	int			 cipher_ok __diagused;
+	struct aesxts_state *axs = state;
+	cipherInstance cipher;
+	int cipher_ok __diagused;
 
-	cipher_ok = rijndael_cipherInit(, MODE_XTS, ae->ae_iv);
+	cipher_ok = rijndael_cipherInit(, MODE_XTS, axs->axs_tweak);
 	KASSERT(cipher_ok > 0);
-	rijndael_blockDecrypt(, ae->ae_key, src, /*inputbits*/len * 8,
-	dst);
-	(void)memcpy(ae->ae_iv, cipher.IV, CGD_AES_BLOCK_SIZE);
+	rijndael_blockDecrypt(, >axs_keys->ax_deckey, src,
+	/*inputbits*/len * 8, dst);
+	memcpy(axs->axs_tweak, cipher.IV, CGD_AES_BLOCK_SIZE);
 }
 
 static void
-cgd_cipher_aes_xts(void *privdata, struct uio *dstuio,
-struct uio *srcuio, const void *iv, int dir)
+cgd_cipher_aes_xts(void *cookie, struct uio *dstuio, struct uio *srcuio,
+const void *iv, int dir)
 {
-	struct aes_privdata	*apd = privdata;
-	struct aes_encdata	 encd;
-	cipherInstance		 cipher;
-	int			 cipher_ok __diagused;
+	struct aesxts *ax = cookie;
+	struct aesxts_state axs = { .axs_keys = ax };
+	cipherInstance cipher;
+	int cipher_ok __diagused;
 
 	cipher_ok = rijndael_cipherInit(, MODE_ECB, NULL);
 	KASSERT(cipher_ok > 0);
-	rijndael_blockEncrypt(, [1].ap_enckey, iv, /*inputbits*/128,
-	encd.ae_iv);
+	rijndael_blockEncrypt(, >ax_tweakkey, iv, /*inputbits*/128,
+	axs.axs_tweak);
 
 	switch (dir) {
 	case CGD_CIPHER_ENCRYPT:
-		encd.ae_key = >ap_enckey;
-		cgd_cipher_uio(, aes_xts_enc_int, dstuio, srcuio);
+		

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

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:58:26 UTC 2020

Modified Files:
src/sys/arch/arm/sunxi: sun8i_crypto.c

Log Message:
Draft opencrypto support for Allwinner Crypto Engine.

XXX Can't handle nonzero crd_skip yet.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/sunxi/sun8i_crypto.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun8i_crypto.c
diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.16 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.17
--- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.16	Sat Jun 13 18:57:54 2020
+++ src/sys/arch/arm/sunxi/sun8i_crypto.c	Sat Jun 13 18:58:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun8i_crypto.c,v 1.16 2020/06/13 18:57:54 riastradh Exp $	*/
+/*	$NetBSD: sun8i_crypto.c,v 1.17 2020/06/13 18:58:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.16 2020/06/13 18:57:54 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.17 2020/06/13 18:58:26 riastradh Exp $");
 
 #include 
 #include 
@@ -51,16 +51,21 @@ __KERNEL_RCSID(1, "$NetBSD: sun8i_crypto
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
 
+#include 
+
 #include 
 
 #define	SUN8I_CRYPTO_TIMEOUT	hz
@@ -110,15 +115,22 @@ struct sun8i_crypto_softc {
 		const struct sysctlnode		*cy_root_node;
 		const struct sysctlnode		*cy_trng_node;
 	}sc_sysctl;
+	struct sun8i_crypto_opencrypto {
+		uint32_t			co_driverid;
+	}sc_opencrypto;
 };
 
 struct sun8i_crypto_task {
 	struct sun8i_crypto_buf	ct_descbuf;
 	struct sun8i_crypto_taskdesc *ct_desc;
+	struct sun8i_crypto_buf	ct_ivbuf;
+	void			*ct_iv;
+	struct sun8i_crypto_buf	ct_ctrbuf;
+	void			*ct_ctr;
 	bus_dmamap_t		ct_descmap;
 	bus_dmamap_t		ct_keymap;
-	bus_dmamap_t		ct_ivmap;
-	bus_dmamap_t		ct_ctrmap;
+	bus_dmamap_t		ct_ivmap;	/* IV input */
+	bus_dmamap_t		ct_ctrmap;	/* updated IV output */
 	bus_dmamap_t		ct_srcmap;
 	bus_dmamap_t		ct_dstmap;
 	uint32_t		ct_nbytes;
@@ -159,8 +171,8 @@ static void	sun8i_crypto_task_put(struct
 static int	sun8i_crypto_task_load(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *, uint32_t,
 		uint32_t, uint32_t, uint32_t);
-static int	sun8i_crypto_task_scatter(struct sun8i_crypto_adrlen *,
-		bus_dmamap_t, uint32_t);
+static int	sun8i_crypto_task_scatter(struct sun8i_crypto_task *,
+		struct sun8i_crypto_adrlen *, bus_dmamap_t, uint32_t);
 
 static int	sun8i_crypto_task_load_trng(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *, uint32_t);
@@ -196,19 +208,106 @@ static int	sun8i_crypto_sysctl_rng(SYSCT
 static void	sun8i_crypto_sysctl_rng_done(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *, void *, int);
 
+static void	sun8i_crypto_register(struct sun8i_crypto_softc *);
+static void	sun8i_crypto_register1(struct sun8i_crypto_softc *, uint32_t);
+static int	sun8i_crypto_newsession(void *, uint32_t *,
+		struct cryptoini *);
+static int	sun8i_crypto_freesession(void *, uint64_t);
+static u_int	sun8i_crypto_ivlen(const struct cryptodesc *);
+static int	sun8i_crypto_process(void *, struct cryptop *, int);
+static void	sun8i_crypto_callback(struct sun8i_crypto_softc *,
+		struct sun8i_crypto_task *, void *, int);
+
+/*
+ * Probes
+ */
+
+SDT_PROBE_DEFINE2(sdt, sun8i_crypto, register, read,
+"bus_size_t"/*reg*/,
+"uint32_t"/*value*/);
+SDT_PROBE_DEFINE2(sdt, sun8i_crypto, register, write,
+"bus_size_t"/*reg*/,
+"uint32_t"/*write*/);
+
+SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, ctor__success,
+"struct sun8i_crypto_task *"/*task*/);
+SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, ctor__failure,
+"int"/*error*/);
+SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, dtor,
+"struct sun8i_crypto_task *"/*task*/);
+SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, get,
+"struct sun8i_crypto_task *"/*task*/);
+SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, put,
+"struct sun8i_crypto_task *"/*task*/);
+
+SDT_PROBE_DEFINE6(sdt, sun8i_crypto, task, load,
+"struct sun8i_crypto_task *"/*task*/,
+"uint32_t"/*tdqc*/,
+"uint32_t"/*tdqs*/,
+"uint32_t"/*tdqa*/,
+"struct sun8i_crypto_taskdesc *"/*desc*/,
+"int"/*error*/);
+SDT_PROBE_DEFINE3(sdt, sun8i_crypto, task, misaligned,
+"struct sun8i_crypto_task *"/*task*/,
+"bus_addr_t"/*ds_addr*/,
+"bus_size_t"/*ds_len*/);
+SDT_PROBE_DEFINE2(sdt, sun8i_crypto, task, done,
+"struct sun8i_crypto_task *"/*task*/,
+"int"/*error*/);
+
+SDT_PROBE_DEFINE3(sdt, sun8i_crypto, engine, submit__failure,
+"struct sun8i_crypto_softc *"/*sc*/,
+"struct sun8i_crypto_task *"/*task*/,
+"int"/*error*/);
+SDT_PROBE_DEFINE3(sdt, sun8i_crypto, engine, submit__success,
+"struct sun8i_crypto_softc 

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

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:57:54 UTC 2020

Modified Files:
src/sys/arch/arm/sunxi: sun8i_crypto.c sun8i_crypto.h

Log Message:
Rework sun8i crypto.

- Preallocate tasks and DMA maps together for now, for 4k transfers.
- Confine setup of the task descriptor to a single function, without
  bus_dmamap_t as an input; just use the preallocated DMA maps.
- Take the DMA map part out of sun8i_crypto_buf.
  => Not much left here, just a dmamem segment and kva mapping.

This should make it easier to use with opencrypto.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/sunxi/sun8i_crypto.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun8i_crypto.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/sunxi/sun8i_crypto.c
diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.15 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.16
--- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.15	Sat Jun 13 18:54:38 2020
+++ src/sys/arch/arm/sunxi/sun8i_crypto.c	Sat Jun 13 18:57:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun8i_crypto.c,v 1.15 2020/06/13 18:54:38 riastradh Exp $	*/
+/*	$NetBSD: sun8i_crypto.c,v 1.16 2020/06/13 18:57:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.15 2020/06/13 18:54:38 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.16 2020/06/13 18:57:54 riastradh Exp $");
 
 #include 
 #include 
@@ -72,7 +72,6 @@ struct sun8i_crypto_task;
 struct sun8i_crypto_buf {
 	bus_dma_segment_t	cb_seg[1];
 	int			cb_nsegs;
-	bus_dmamap_t		cb_map;
 	void			*cb_kva;
 };
 
@@ -81,6 +80,7 @@ struct sun8i_crypto_softc {
 	bus_space_tag_t			sc_bst;
 	bus_space_handle_t		sc_bsh;
 	bus_dma_tag_t			sc_dmat;
+	struct pool_cache		*sc_taskpool;
 	kmutex_t			sc_lock;
 	struct sun8i_crypto_chan {
 		struct sun8i_crypto_task	*cc_task;
@@ -113,13 +113,32 @@ struct sun8i_crypto_softc {
 };
 
 struct sun8i_crypto_task {
-	struct sun8i_crypto_buf	ct_buf;
+	struct sun8i_crypto_buf	ct_descbuf;
 	struct sun8i_crypto_taskdesc *ct_desc;
+	bus_dmamap_t		ct_descmap;
+	bus_dmamap_t		ct_keymap;
+	bus_dmamap_t		ct_ivmap;
+	bus_dmamap_t		ct_ctrmap;
+	bus_dmamap_t		ct_srcmap;
+	bus_dmamap_t		ct_dstmap;
+	uint32_t		ct_nbytes;
+	int			ct_flags;
+#define	TASK_KEY		__BIT(0)
+#define	TASK_IV			__BIT(1)
+#define	TASK_CTR		__BIT(2)
+#define	TASK_SRC		__BIT(3)
+#define	TASK_BYTES		__BIT(4) /* datalen is in bytes, not words */
 	void			(*ct_callback)(struct sun8i_crypto_softc *,
 struct sun8i_crypto_task *, void *, int);
 	void			*ct_cookie;
 };
 
+#define	SUN8I_CRYPTO_MAXDMASIZE		PAGE_SIZE
+#define	SUN8I_CRYPTO_MAXDMASEGSIZE	PAGE_SIZE
+
+CTASSERT(SUN8I_CRYPTO_MAXDMASIZE <= SUN8I_CRYPTO_MAXDATALEN);
+CTASSERT(SUN8I_CRYPTO_MAXDMASEGSIZE <= SUN8I_CRYPTO_MAXSEGLEN);
+
 /*
  * Forward declarations
  */
@@ -127,33 +146,27 @@ struct sun8i_crypto_task {
 static int	sun8i_crypto_match(device_t, cfdata_t, void *);
 static void	sun8i_crypto_attach(device_t, device_t, void *);
 
+static int	sun8i_crypto_task_ctor(void *, void *, int);
+static void	sun8i_crypto_task_dtor(void *, void *);
 static struct sun8i_crypto_task *
 		sun8i_crypto_task_get(struct sun8i_crypto_softc *,
 		void (*)(struct sun8i_crypto_softc *,
 			struct sun8i_crypto_task *, void *, int),
-		void *);
+		void *, int);
 static void	sun8i_crypto_task_put(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *);
-static void	sun8i_crypto_task_reset(struct sun8i_crypto_task *);
 
-static void	sun8i_crypto_task_set_key(struct sun8i_crypto_task *,
-		bus_dmamap_t);
-static void	sun8i_crypto_task_set_iv(struct sun8i_crypto_task *,
-		bus_dmamap_t);
-static void	sun8i_crypto_task_set_ctr(struct sun8i_crypto_task *,
-		bus_dmamap_t);
-static void	sun8i_crypto_task_set_input(struct sun8i_crypto_task *,
-		bus_dmamap_t);
-static void	sun8i_crypto_task_set_output(struct sun8i_crypto_task *,
-		bus_dmamap_t);
+static int	sun8i_crypto_task_load(struct sun8i_crypto_softc *,
+		struct sun8i_crypto_task *, uint32_t,
+		uint32_t, uint32_t, uint32_t);
+static int	sun8i_crypto_task_scatter(struct sun8i_crypto_adrlen *,
+		bus_dmamap_t, uint32_t);
 
-static void	sun8i_crypto_task_scatter(struct sun8i_crypto_adrlen *,
-		bus_dmamap_t);
-
-static int	sun8i_crypto_submit_trng(struct sun8i_crypto_softc *,
+static int	sun8i_crypto_task_load_trng(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *, uint32_t);
-static int	sun8i_crypto_submit_aesecb(struct sun8i_crypto_softc *,
+static int	sun8i_crypto_task_load_aesecb(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *, uint32_t, uint32_t, uint32_t);
+
 static int	sun8i_crypto_submit(struct sun8i_crypto_softc *,
 		struct sun8i_crypto_task *);
 
@@ -165,7 +178,7 @@ static void	

CVS commit: src/lib/libpthread

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 17:39:42 UTC 2020

Modified Files:
src/lib/libpthread: pthread_cond.c

Log Message:
Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/lib/libpthread/pthread_cond.c

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

Modified files:

Index: src/lib/libpthread/pthread_cond.c
diff -u src/lib/libpthread/pthread_cond.c:1.74 src/lib/libpthread/pthread_cond.c:1.75
--- src/lib/libpthread/pthread_cond.c:1.74	Wed Jun 10 22:45:15 2020
+++ src/lib/libpthread/pthread_cond.c	Sat Jun 13 17:39:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_cond.c,v 1.74 2020/06/10 22:45:15 ad Exp $	*/
+/*	$NetBSD: pthread_cond.c,v 1.75 2020/06/13 17:39:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_cond.c,v 1.74 2020/06/10 22:45:15 ad Exp $");
+__RCSID("$NetBSD: pthread_cond.c,v 1.75 2020/06/13 17:39:42 riastradh Exp $");
 
 #include 
 #include 
@@ -179,7 +179,7 @@ pthread_cond_timedwait(pthread_cond_t *c
 		pthread_cond_broadcast(cond);
 
 		/*
-		 * Might have raced with another thread to do the wakeup. 
+		 * Might have raced with another thread to do the wakeup.
 		 * Wait until released, otherwise "waiter" is still globally
 		 * visible.
 		 */



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:39:07 UTC 2020

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

Log Message:
Remove obsolete comment -- AES block size is always 128.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/cgd_crypto.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/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.19 src/sys/dev/cgd_crypto.c:1.20
--- src/sys/dev/cgd_crypto.c:1.19	Sat Jun 13 18:38:33 2020
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 18:39:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.19 2020/06/13 18:38:33 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.20 2020/06/13 18:39:06 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.19 2020/06/13 18:38:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.20 2020/06/13 18:39:06 riastradh Exp $");
 
 #include 
 #include 
@@ -173,11 +173,6 @@ cgd_cipher_uio(void *privdata, cipher_fu
  *  AES Framework
  */
 
-/*
- * NOTE: we do not store the blocksize in here, because it is not
- *   variable [yet], we hardcode the blocksize to 16 (128 bits).
- */
-
 struct aes_privdata {
 	keyInstance	ap_enckey;
 	keyInstance	ap_deckey;



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:39:36 UTC 2020

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

Log Message:
Convert malloc -> kmem.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/cgd_crypto.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/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.20 src/sys/dev/cgd_crypto.c:1.21
--- src/sys/dev/cgd_crypto.c:1.20	Sat Jun 13 18:39:06 2020
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 18:39:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.20 2020/06/13 18:39:06 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.21 2020/06/13 18:39:36 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,10 +37,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.20 2020/06/13 18:39:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.21 2020/06/13 18:39:36 riastradh Exp $");
 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -196,9 +196,7 @@ cgd_cipher_aes_cbc_init(size_t keylen, c
 		*blocksize = 128;
 	if (*blocksize != 128)
 		return NULL;
-	ap = malloc(sizeof(*ap), M_DEVBUF, 0);
-	if (!ap)
-		return NULL;
+	ap = kmem_zalloc(sizeof(*ap), KM_SLEEP);
 	rijndael_makeKey(>ap_enckey, DIR_ENCRYPT, keylen, key);
 	rijndael_makeKey(>ap_deckey, DIR_DECRYPT, keylen, key);
 	return ap;
@@ -210,7 +208,7 @@ cgd_cipher_aes_cbc_destroy(void *data)
 	struct aes_privdata *apd = data;
 
 	explicit_memset(apd, 0, sizeof(*apd));
-	free(apd, M_DEVBUF);
+	kmem_free(apd, sizeof(*apd));
 }
 
 static void
@@ -286,10 +284,8 @@ cgd_cipher_aes_xts_init(size_t keylen, c
 		*blocksize = 128;
 	if (*blocksize != 128)
 		return NULL;
-	ap = malloc(2 * sizeof(*ap), M_DEVBUF, 0);
-	if (!ap)
-		return NULL;
 
+	ap = kmem_zalloc(2 * sizeof(*ap), KM_SLEEP);
 	keylen /= 2;
 	key = xtskey;
 	key2 = key + keylen / CHAR_BIT;
@@ -307,7 +303,7 @@ cgd_cipher_aes_xts_destroy(void *data)
 	struct aes_privdata *apd = data;
 
 	explicit_memset(apd, 0, 2 * sizeof(*apd));
-	free(apd, M_DEVBUF);
+	kmem_free(apd, 2 * sizeof(*apd));
 }
 
 static void
@@ -396,16 +392,14 @@ cgd_cipher_3des_init(size_t keylen, cons
 		*blocksize = 64;
 	if (keylen != (DES_KEY_SZ * 3 * 8) || *blocksize != 64)
 		return NULL;
-	cp = malloc(sizeof(*cp), M_DEVBUF, 0);
-	if (!cp)
-		return NULL;
+	cp = kmem_zalloc(sizeof(*cp), KM_SLEEP);
 	block = __UNCONST(key);
 	error  = des_key_sched(block, cp->cp_key1);
 	error |= des_key_sched(block + 1, cp->cp_key2);
 	error |= des_key_sched(block + 2, cp->cp_key3);
 	if (error) {
 		explicit_memset(cp, 0, sizeof(*cp));
-		free(cp, M_DEVBUF);
+		kmem_free(cp, sizeof(*cp));
 		return NULL;
 	}
 	return cp;
@@ -417,7 +411,7 @@ cgd_cipher_3des_destroy(void *data)
 	struct c3des_privdata *cp = data;
 
 	explicit_memset(cp, 0, sizeof(*cp));
-	free(cp, M_DEVBUF);
+	kmem_free(cp, sizeof(*cp));
 }
 
 static void
@@ -496,7 +490,7 @@ cgd_cipher_bf_init(size_t keylen, const 
 		*blocksize = 64;
 	if (*blocksize != 64)
 		return NULL;
-	bp = malloc(sizeof(*bp), M_DEVBUF, 0);
+	bp = kmem_zalloc(sizeof(*bp), KM_SLEEP);
 	if (!bp)
 		return NULL;
 	BF_set_key(>bp_key, keylen / 8, key);
@@ -509,7 +503,7 @@ cgd_cipher_bf_destroy(void *data)
 	struct	bf_privdata *bp = data;
 
 	explicit_memset(bp, 0, sizeof(*bp));
-	free(bp, M_DEVBUF);
+	kmem_free(bp, sizeof(*bp));
 }
 
 static void



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:38:33 UTC 2020

Modified Files:
src/sys/dev: cgd.c cgd_crypto.c cgdvar.h

Log Message:
Tidy up includes.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/dev/cgd.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/cgd_crypto.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/cgdvar.h

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

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.128 src/sys/dev/cgd.c:1.129
--- src/sys/dev/cgd.c:1.128	Sat Jun 13 18:36:07 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 18:38:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.128 2020/06/13 18:36:07 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.129 2020/06/13 18:38:33 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,32 +30,33 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.128 2020/06/13 18:36:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.129 2020/06/13 18:38:33 riastradh Exp $");
 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include  /* for pathbuf */
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
-#include 
 
-#include 
+#include 
 #include 
+#include 
 
 #include  /* for v_rdev */
 

Index: src/sys/dev/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.18 src/sys/dev/cgd_crypto.c:1.19
--- src/sys/dev/cgd_crypto.c:1.18	Sat Jun 13 18:35:35 2020
+++ src/sys/dev/cgd_crypto.c	Sat Jun 13 18:38:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.18 2020/06/13 18:35:35 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.19 2020/06/13 18:38:33 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,17 +37,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.18 2020/06/13 18:35:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.19 2020/06/13 18:38:33 riastradh Exp $");
 
 #include 
-#include 
 #include 
+#include 
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 /*
  * The general framework provides only one generic function.

Index: src/sys/dev/cgdvar.h
diff -u src/sys/dev/cgdvar.h:1.19 src/sys/dev/cgdvar.h:1.20
--- src/sys/dev/cgdvar.h:1.19	Mon Mar  9 08:33:15 2020
+++ src/sys/dev/cgdvar.h	Sat Jun 13 18:38:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdvar.h,v 1.19 2020/03/09 08:33:15 mlelstv Exp $ */
+/* $NetBSD: cgdvar.h,v 1.20 2020/06/13 18:38:33 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -66,6 +66,7 @@ struct cgd_user {
 #ifdef _KERNEL
 
 #include 
+#include 
 
 /* This cryptdata structure is here rather than cgd_crypto.h, since
  * it stores local state which will not be generalised beyond the



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

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 16:51:25 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: ARMADAXP ARMADILLO-IOT-G3 BCM5301X DUOVERO
GENERIC.common N900 OMAP5EVM PANDABOARD PEPPER TISDP2420 VTC100

Log Message:
Comment out "options PMAPCOUNTERS".  It adds much overhead and is mostly of
interest to people hacking on the VM system or pmap.  Proposed on port-arm@.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/conf/ARMADAXP
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3 \
src/sys/arch/evbarm/conf/VTC100
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/BCM5301X
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/DUOVERO
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/GENERIC.common
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/N900
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/OMAP5EVM
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/conf/PANDABOARD
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/PEPPER
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/TISDP2420

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

Modified files:

Index: src/sys/arch/evbarm/conf/ARMADAXP
diff -u src/sys/arch/evbarm/conf/ARMADAXP:1.27 src/sys/arch/evbarm/conf/ARMADAXP:1.28
--- src/sys/arch/evbarm/conf/ARMADAXP:1.27	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/evbarm/conf/ARMADAXP	Sat Jun 13 16:51:25 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ARMADAXP,v 1.27 2020/04/18 11:00:38 skrll Exp $
+#	$NetBSD: ARMADAXP,v 1.28 2020/06/13 16:51:25 ad Exp $
 #
 #	ARMADA XP DEV BOARD
 #
@@ -115,7 +115,7 @@ options 	LOCKDEBUG
 options 	DIAGNOSTIC		# internal consistency checks
 #options 	DEBUG
 #options 	UVMHIST		# kernhist for uvm/pmap subsystems
-options 	PMAPCOUNTERS
+#options 	PMAPCOUNTERS
 #options 	VERBOSE_INIT_ARM	# verbose bootstraping messages
 options 	DDB			# in-kernel debugger
 options 	DDB_ONPANIC=1

Index: src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3
diff -u src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.22 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.23
--- src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.22	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3	Sat Jun 13 16:51:25 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ARMADILLO-IOT-G3,v 1.22 2020/04/18 11:00:38 skrll Exp $
+# $NetBSD: ARMADILLO-IOT-G3,v 1.23 2020/06/13 16:51:25 ad Exp $
 #
 # ARMADILLO-IOT-G3 -- Atmark Techno, Armadillo-IoT G3
 #
@@ -19,7 +19,7 @@ options 	CPU_CORTEX
 options 	CPU_CORTEXA7
 options 	IMX7
 options 	MULTIPROCESSOR
-options 	PMAPCOUNTERS
+#options 	PMAPCOUNTERS
 
 options 	MEMSIZE=512
 options 	MEMSIZE_RESERVED=32	# only reserved 32M for Cortex-M4 core
Index: src/sys/arch/evbarm/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.22 src/sys/arch/evbarm/conf/VTC100:1.23
--- src/sys/arch/evbarm/conf/VTC100:1.22	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/evbarm/conf/VTC100	Sat Jun 13 16:51:25 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.22 2020/04/18 11:00:38 skrll Exp $
+#	$NetBSD: VTC100,v 1.23 2020/06/13 16:51:25 ad Exp $
 #
 #	VTC100 -- NEXCOM VTC100 Kernel
 #
@@ -19,7 +19,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 
 options 	CPU_CORTEXA8
 options 	TI_AM335X
-options 	PMAPCOUNTERS
+#options 	PMAPCOUNTERS
 
 # XXX The Cortex PMC delay() doesn't seem to work.
 #no options	CORTEX_PMC

Index: src/sys/arch/evbarm/conf/BCM5301X
diff -u src/sys/arch/evbarm/conf/BCM5301X:1.35 src/sys/arch/evbarm/conf/BCM5301X:1.36
--- src/sys/arch/evbarm/conf/BCM5301X:1.35	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/evbarm/conf/BCM5301X	Sat Jun 13 16:51:25 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BCM5301X,v 1.35 2020/04/18 11:00:38 skrll Exp $
+#	$NetBSD: BCM5301X,v 1.36 2020/06/13 16:51:25 ad Exp $
 #
 #	BCM5301X -- Broadcom BCM5301X Eval Board Kernel
 #
@@ -26,7 +26,7 @@ options 	BCMETH_COUNTERS
 options 	CPU_CORTEXA9
 #options 	MEMSIZE=256
 options 	BCM5301X
-options 	PMAPCOUNTERS
+#options 	PMAPCOUNTERS
 options 	BUSDMA_COUNTERS
 makeoptions	KERNEL_BASE_PHYS="0x8010"
 

Index: src/sys/arch/evbarm/conf/DUOVERO
diff -u src/sys/arch/evbarm/conf/DUOVERO:1.17 src/sys/arch/evbarm/conf/DUOVERO:1.18
--- src/sys/arch/evbarm/conf/DUOVERO:1.17	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/evbarm/conf/DUOVERO	Sat Jun 13 16:51:25 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: DUOVERO,v 1.17 2020/04/18 11:00:38 skrll Exp $
+#	$NetBSD: DUOVERO,v 1.18 2020/06/13 16:51:25 ad Exp $
 #
 #	DUOOVERO -- Gumstix. Inc. DuoVero COMS platforms kernel
 #
@@ -19,7 +19,7 @@ options 	OMAP_4430
 options 	MULTIPROCESSOR
 options 	 __HAVE_CPU_UAREA_ALLOC_IDLELWP	# need for MULTIPROCESSOR
 options 	FPU_VFP
-options 	PMAPCOUNTERS
+#options 	PMAPCOUNTERS
 options 	ARM_HAS_VBAR
 options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 makeoptions	CPUFLAGS="-mcpu=cortex-a9 -mfpu=neon"

Index: src/sys/arch/evbarm/conf/GENERIC.common
diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.36 src/sys/arch/evbarm/conf/GENERIC.common:1.37
--- 

CVS commit: src/lib/librumpuser

2020-06-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jun 13 16:51:59 UTC 2020

Modified Files:
src/lib/librumpuser: sp_common.c

Log Message:
Fix incompatible function pointer casts


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/librumpuser/sp_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/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.41 src/lib/librumpuser/sp_common.c:1.42
--- src/lib/librumpuser/sp_common.c:1.41	Wed May  6 12:44:36 2020
+++ src/lib/librumpuser/sp_common.c	Sat Jun 13 16:51:59 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.41 2020/05/06 12:44:36 christos Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.42 2020/06/13 16:51:59 kamil Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -705,15 +705,21 @@ unix_cleanup(struct sockaddr *sa)
 
 /*ARGSUSED*/
 static int
-notsupp(void)
+addrparse_notsupp(const char *addr __unused, struct sockaddr **sa __unused,
+		  int allow_wildcard __unused)
 {
 
 	fprintf(stderr, "rump_sp: support not yet implemented\n");
 	return EOPNOTSUPP;
 }
 
+static void
+cleanup_success(struct sockaddr *sa __unused)
+{
+}
+
 static int
-success(void)
+connecthook_success(int s __unused)
 {
 
 	return 0;
@@ -728,12 +734,12 @@ static struct {
 	cleanup_fn cleanup;
 } parsetab[] = {
 	{ "tcp", PF_INET, sizeof(struct sockaddr_in),
-	tcp_parse, tcp_connecthook, (cleanup_fn)success },
+	tcp_parse, tcp_connecthook, cleanup_success },
 	{ "unix", PF_LOCAL, sizeof(struct sockaddr_un),
-	unix_parse, (connecthook_fn)success, unix_cleanup },
+	unix_parse, connecthook_success, unix_cleanup },
 	{ "tcp6", PF_INET6, sizeof(struct sockaddr_in6),
-	(addrparse_fn)notsupp, (connecthook_fn)success,
-	(cleanup_fn)success },
+	addrparse_notsupp, connecthook_success,
+	cleanup_success },
 };
 #define NPARSE (sizeof(parsetab)/sizeof(parsetab[0]))
 



CVS commit: src/usr.sbin/puffs/mount_9p

2020-06-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jun 13 16:56:46 UTC 2020

Modified Files:
src/usr.sbin/puffs/mount_9p: ninepuffs.c

Log Message:
Add -46 to usage.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/puffs/mount_9p/ninepuffs.c

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

Modified files:

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.30 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.31
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.30	Sat Jun 13 13:45:06 2020
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Sat Jun 13 16:56:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninepuffs.c,v 1.30 2020/06/13 13:45:06 uwe Exp $	*/
+/*	$NetBSD: ninepuffs.c,v 1.31 2020/06/13 16:56:46 wiz Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.30 2020/06/13 13:45:06 uwe Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.31 2020/06/13 16:56:46 wiz Exp $");
 #endif /* !lint */
 
 #include 
@@ -59,9 +59,9 @@ __dead static void
 usage(void)
 {
 
-	fprintf(stderr, "usage: %s [-su] [-o mntopts] [-p port] "
+	fprintf(stderr, "usage: %s [-46su] [-o mntopts] [-p port] "
 	"[user@]server[:path] mountpoint\n", getprogname());
-	fprintf(stderr, "   %s -c [-su] [-o mntopts] devfile mountpoint\n",
+	fprintf(stderr, "   %s -c [-46su] [-o mntopts] devfile mountpoint\n",
 	getprogname());
 	exit(1);
 }



CVS commit: src/sys/dev

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:42:22 UTC 2020

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

Log Message:
Move cgd selftest from module init to cgdattach.

This defers it until considerably later at boot, after cpu_attach has
run, which will be needed in order to make AES-NI work.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.130 src/sys/dev/cgd.c:1.131
--- src/sys/dev/cgd.c:1.130	Sat Jun 13 18:40:44 2020
+++ src/sys/dev/cgd.c	Sat Jun 13 18:42:22 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.130 2020/06/13 18:40:44 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.131 2020/06/13 18:42:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.130 2020/06/13 18:40:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.131 2020/06/13 18:42:22 riastradh Exp $");
 
 #include 
 #include 
@@ -389,6 +389,8 @@ static int	cgdinit(struct cgd_softc *, c
 static void	cgd_cipher(struct cgd_softc *, void *, void *,
 			   size_t, daddr_t, size_t, int);
 
+static void	cgd_selftest(void);
+
 static const struct dkdriver cgddkdriver = {
 .d_minphys  = minphys,
 .d_open = cgdopen,
@@ -534,6 +536,8 @@ cgdattach(int num)
 		aprint_error("%s: unable to register cfattach\n",
 		cgd_cd.cd_name);
 #endif
+
+	cgd_selftest();
 }
 
 static struct cgd_softc *
@@ -1598,7 +1602,7 @@ hexprint(const char *start, void *buf, i
 #endif
 
 static void
-selftest(void)
+cgd_selftest(void)
 {
 	struct cgd_softc sc;
 	void *buf;
@@ -1673,7 +1677,6 @@ cgd_modcmd(modcmd_t cmd, void *arg)
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-		selftest();
 #ifdef _MODULE
 		mutex_init(_spawning_mtx, MUTEX_DEFAULT, IPL_NONE);
 		cv_init(_spawning_cv, "cgspwn");



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

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 18:54:38 UTC 2020

Modified Files:
src/sys/arch/arm/sunxi: sun8i_crypto.c

Log Message:
Truncate hw.sun8icryptoN.rng queries to 4096 bytes.

...rather than fail entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/sunxi/sun8i_crypto.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun8i_crypto.c
diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.14 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.15
--- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.14	Fri May 15 19:28:09 2020
+++ src/sys/arch/arm/sunxi/sun8i_crypto.c	Sat Jun 13 18:54:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun8i_crypto.c,v 1.14 2020/05/15 19:28:09 maxv Exp $	*/
+/*	$NetBSD: sun8i_crypto.c,v 1.15 2020/06/13 18:54:38 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.14 2020/05/15 19:28:09 maxv Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.15 2020/06/13 18:54:38 riastradh Exp $");
 
 #include 
 #include 
@@ -1203,10 +1203,8 @@ sun8i_crypto_sysctl_rng(SYSCTLFN_ARGS)
 		return 0;
 	}
 
-	/* Verify the output buffer size is reasonable.  */
-	size = *oldlenp;
-	if (size > 4096)	/* size_t, so never negative */
-		return E2BIG;
+	/* Truncate to 4096 bytes.  */
+	size = MIN(4096, *oldlenp);
 	if (size == 0)
 		return 0;	/* nothing to do */
 



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

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 19:01:11 UTC 2020

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

Log Message:
Add comments over fpu_kern_enter/leave.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/x86/x86/fpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.63 src/sys/arch/x86/x86/fpu.c:1.64
--- src/sys/arch/x86/x86/fpu.c:1.63	Sat Jun 13 19:00:18 2020
+++ src/sys/arch/x86/x86/fpu.c	Sat Jun 13 19:01:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $	*/
+/*	$NetBSD: fpu.c,v 1.64 2020/06/13 19:01:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.64 2020/06/13 19:01:11 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -343,6 +343,15 @@ fpu_lwp_abandon(struct lwp *l)
 
 /* -- */
 
+/*
+ * fpu_kern_enter()
+ *
+ *	Begin using the FPU.  Raises to splhigh, disabling all
+ *	interrupts and rendering the thread non-preemptible; caller
+ *	should not use this for long periods of time, and must call
+ *	fpu_kern_leave() afterward.  Non-recursive -- you cannot call
+ *	fpu_kern_enter() again without calling fpu_kern_leave() first.
+ */
 void
 fpu_kern_enter(void)
 {
@@ -375,6 +384,11 @@ fpu_kern_enter(void)
 	clts();
 }
 
+/*
+ * fpu_kern_leave()
+ *
+ *	End using the FPU after fpu_kern_enter().
+ */
 void
 fpu_kern_leave(void)
 {



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

2020-06-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 13 19:00:18 UTC 2020

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

Log Message:
Zero the fpu registers on fpu_kern_leave.

Avoid Spectre-class attacks on any values left in them.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/x86/x86/fpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.62 src/sys/arch/x86/x86/fpu.c:1.63
--- src/sys/arch/x86/x86/fpu.c:1.62	Thu Jun  4 19:53:55 2020
+++ src/sys/arch/x86/x86/fpu.c	Sat Jun 13 19:00:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.62 2020/06/04 19:53:55 riastradh Exp $	*/
+/*	$NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.62 2020/06/04 19:53:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.63 2020/06/13 19:00:18 riastradh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -378,6 +378,7 @@ fpu_kern_enter(void)
 void
 fpu_kern_leave(void)
 {
+	union savefpu zero_fpu __aligned(64);
 	struct cpu_info *ci = curcpu();
 	int s;
 
@@ -385,6 +386,14 @@ fpu_kern_leave(void)
 	KASSERT(ci->ci_kfpu_spl != -1);
 
 	/*
+	 * Zero the fpu registers; otherwise we might leak secrets
+	 * through Spectre-class attacks to userland, even if there are
+	 * no bugs in fpu state management.
+	 */
+	memset(_fpu, 0, sizeof(zero_fpu));
+	fpu_area_restore(_fpu, x86_xsave_features);
+
+	/*
 	 * Set CR0_TS again so that the kernel can't accidentally use
 	 * the FPU.
 	 */



CVS commit: src/distrib/news68k/floppies/ramdisk

2020-06-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 13 19:15:44 UTC 2020

Modified Files:
src/distrib/news68k/floppies/ramdisk: list

Log Message:
Use more shrinked x_foo binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/distrib/news68k/floppies/ramdisk/list

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

Modified files:

Index: src/distrib/news68k/floppies/ramdisk/list
diff -u src/distrib/news68k/floppies/ramdisk/list:1.28 src/distrib/news68k/floppies/ramdisk/list:1.29
--- src/distrib/news68k/floppies/ramdisk/list:1.28	Fri Jan 14 10:26:34 2011
+++ src/distrib/news68k/floppies/ramdisk/list	Sat Jun 13 19:15:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.28 2011/01/14 10:26:34 tsutsui Exp $
+#	$NetBSD: list,v 1.29 2020/06/13 19:15:43 tsutsui Exp $
 
 SRCDIRS	bin sbin usr.bin usr.sbin
 
@@ -58,10 +58,13 @@ PROG	usr/sbin/chroot
 # init invokes the shell as -sh
 ARGVLN	sh	-sh
 
+SPECIAL	disklabel	srcdir	distrib/utils/x_disklabel
 SPECIAL	ed		srcdir	distrib/utils/x_ed
 SPECIAL	gzip		srcdir	distrib/utils/x_gzip
+SPECIAL	fsck_ffs	srcdir	distrib/utils/x_fsck_ffs
 SPECIAL	ifconfig	srcdir	distrib/utils/x_ifconfig
 SPECIAL	more		srcdir	distrib/utils/more
+SPECIAL	newfs		srcdir	distrib/utils/x_newfs
 SPECIAL	ping		srcdir	distrib/utils/x_ping
 SPECIAL	route		srcdir	distrib/utils/x_route
 SPECIAL	umount		srcdir	distrib/utils/x_umount



CVS commit: src/sys/uvm

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 19:55:39 UTC 2020

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pagerealloc(): resurrect the insertion case.


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.240 src/sys/uvm/uvm_page.c:1.241
--- src/sys/uvm/uvm_page.c:1.240	Thu Jun 11 22:21:05 2020
+++ src/sys/uvm/uvm_page.c	Sat Jun 13 19:55:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.240 2020/06/11 22:21:05 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.241 2020/06/13 19:55:39 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.240 2020/06/11 22:21:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.241 2020/06/13 19:55:39 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -1411,12 +1411,13 @@ uvm_pagereplace(struct vm_page *oldpg, s
  * uvm_pagerealloc: reallocate a page from one object to another
  *
  * => both objects must be locked
- * => both interlocks must be held
  */
 
-void
+int
 uvm_pagerealloc(struct vm_page *pg, struct uvm_object *newobj, voff_t newoff)
 {
+	int error = 0;
+
 	/*
 	 * remove it from the old object
 	 */
@@ -1431,11 +1432,25 @@ uvm_pagerealloc(struct vm_page *pg, stru
 	 */
 
 	if (newobj) {
-		/*
-		 * XXX we have no in-tree users of this functionality
-		 */
-		panic("uvm_pagerealloc: no impl");
+		mutex_enter(>interlock);
+		pg->uobject = newobj;
+		pg->offset = newoff;
+		if (UVM_OBJ_IS_VNODE(newobj)) {
+			pg->flags |= PG_FILE;
+		} else if (UVM_OBJ_IS_AOBJ(newobj)) {
+			pg->flags |= PG_AOBJ;
+		}
+		uvm_pageinsert_object(newobj, pg);
+		mutex_exit(>interlock);
+		error = uvm_pageinsert_tree(newobj, pg);
+		if (error != 0) {
+			mutex_enter(>interlock);
+			uvm_pageremove_object(newobj, pg);
+			mutex_exit(>interlock);
+		}
 	}
+
+	return error;
 }
 
 #ifdef DEBUG



CVS commit: src/sys/uvm

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 19:55:58 UTC 2020

Modified Files:
src/sys/uvm: uvm_extern.h

Log Message:
uvm_pagerealloc(): resurrect the insertion case.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/uvm/uvm_extern.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.228 src/sys/uvm/uvm_extern.h:1.229
--- src/sys/uvm/uvm_extern.h:1.228	Thu Jun 11 19:20:47 2020
+++ src/sys/uvm/uvm_extern.h	Sat Jun 13 19:55:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.228 2020/06/11 19:20:47 ad Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.229 2020/06/13 19:55:58 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -789,7 +789,7 @@ struct vm_page		*uvm_pagealloc_strat(str
 UVM_PGA_STRAT_NORMAL, 0)
 void			uvm_pagereplace(struct vm_page *,
 			struct vm_page *);
-void			uvm_pagerealloc(struct vm_page *,
+int			uvm_pagerealloc(struct vm_page *,
 			struct uvm_object *, voff_t);
 void			uvm_setpagesize(void);
 



CVS commit: src/sys/arch

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 20:01:27 UTC 2020

Modified Files:
src/sys/arch/arc/arc: p_acer_pica_61.c p_dti_arcstation.c p_dti_tyne.c
p_sni_rm200pci.c
src/sys/arch/sparc/sparc: cpu.c
src/sys/arch/x86/x86: cpu.c

Log Message:
g/c vm_page_zero_enable


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arc/arc/p_acer_pica_61.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arc/arc/p_dti_arcstation.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arc/arc/p_dti_tyne.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arc/arc/p_sni_rm200pci.c
cvs rdiff -u -r1.255 -r1.256 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.192 -r1.193 src/sys/arch/x86/x86/cpu.c

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

Modified files:

Index: src/sys/arch/arc/arc/p_acer_pica_61.c
diff -u src/sys/arch/arc/arc/p_acer_pica_61.c:1.12 src/sys/arch/arc/arc/p_acer_pica_61.c:1.13
--- src/sys/arch/arc/arc/p_acer_pica_61.c:1.12	Sun Mar  6 14:58:42 2011
+++ src/sys/arch/arc/arc/p_acer_pica_61.c	Sat Jun 13 20:01:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: p_acer_pica_61.c,v 1.12 2011/03/06 14:58:42 tsutsui Exp $	*/
+/*	$NetBSD: p_acer_pica_61.c,v 1.13 2020/06/13 20:01:27 ad Exp $	*/
 /*	$OpenBSD: picabus.c,v 1.11 1999/01/11 05:11:10 millert Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: p_acer_pica_61.c,v 1.12 2011/03/06 14:58:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p_acer_pica_61.c,v 1.13 2020/06/13 20:01:27 ad Exp $");
 
 #include 
 #include 
@@ -87,15 +87,6 @@ void
 p_acer_pica_61_init(void)
 {
 
-	/*
-	 * PICA-61 has PC-style coherent(?) 128KB L2 cache,
-	 * and mips_L2CachePresent == 0 on this machine.
-	 *
-	 * if page zero in the idle loop is enabled,
-	 * commands dump core due to incoherent cache.
-	 */
-	vm_page_zero_enable = false; /* XXX - should be enabled */
-
 	c_magnum_init();
 
 	/* chipset-dependent jazzio bus configuration */

Index: src/sys/arch/arc/arc/p_dti_arcstation.c
diff -u src/sys/arch/arc/arc/p_dti_arcstation.c:1.18 src/sys/arch/arc/arc/p_dti_arcstation.c:1.19
--- src/sys/arch/arc/arc/p_dti_arcstation.c:1.18	Sun Nov 10 21:16:22 2019
+++ src/sys/arch/arc/arc/p_dti_arcstation.c	Sat Jun 13 20:01:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: p_dti_arcstation.c,v 1.18 2019/11/10 21:16:22 chs Exp $	*/
+/*	$NetBSD: p_dti_arcstation.c,v 1.19 2020/06/13 20:01:27 ad Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: p_dti_arcstation.c,v 1.18 2019/11/10 21:16:22 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p_dti_arcstation.c,v 1.19 2020/06/13 20:01:27 ad Exp $");
 
 #define __INTR_PRIVATE
 #include 
@@ -205,14 +205,6 @@ p_dti_arcstation_init(void)
 	ipl_sr_map = dti_arcstation_ipl_sr_map;
 
 	/*
-	 * XXX - should be enabled, if tested.
-	 *
-	 * We use safe default for now, because this platform is untested.
-	 * In other words, the following may not be needed at all.
-	 */
-	vm_page_zero_enable = false;
-
-	/*
 	 * Initialize I/O address offset
 	 */
 	arc_bus_space_init(_bus_io, "rpc44isaio",

Index: src/sys/arch/arc/arc/p_dti_tyne.c
diff -u src/sys/arch/arc/arc/p_dti_tyne.c:1.19 src/sys/arch/arc/arc/p_dti_tyne.c:1.20
--- src/sys/arch/arc/arc/p_dti_tyne.c:1.19	Sun Feb 20 07:52:42 2011
+++ src/sys/arch/arc/arc/p_dti_tyne.c	Sat Jun 13 20:01:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: p_dti_tyne.c,v 1.19 2011/02/20 07:52:42 matt Exp $	*/
+/*	$NetBSD: p_dti_tyne.c,v 1.20 2020/06/13 20:01:27 ad Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -40,7 +40,7 @@
 
 #define __INTR_PRIVATE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: p_dti_tyne.c,v 1.19 2011/02/20 07:52:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p_dti_tyne.c,v 1.20 2020/06/13 20:01:27 ad Exp $");
 
 #include 
 #include 
@@ -200,14 +200,6 @@ p_dti_tyne_init(void)
 	ipl_sr_map = dti_tyne_ipl_sr_map;
 
 	/*
-	 * XXX - should be enabled, if tested.
-	 *
-	 * We use safe default for now, because this platform is untested.
-	 * In other words, the following may not be needed at all.
-	 */
-	vm_page_zero_enable = false;
-
-	/*
 	 * Initialize I/O address offset
 	 */
 	arc_bus_space_init(_bus_io, "tyneisaio",

Index: src/sys/arch/arc/arc/p_sni_rm200pci.c
diff -u src/sys/arch/arc/arc/p_sni_rm200pci.c:1.15 src/sys/arch/arc/arc/p_sni_rm200pci.c:1.16
--- src/sys/arch/arc/arc/p_sni_rm200pci.c:1.15	Sun Feb 20 07:52:42 2011
+++ src/sys/arch/arc/arc/p_sni_rm200pci.c	Sat Jun 13 20:01:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: p_sni_rm200pci.c,v 1.15 2011/02/20 07:52:42 matt Exp $	*/
+/*	$NetBSD: p_sni_rm200pci.c,v 1.16 2020/06/13 20:01:27 ad Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -40,7 +40,7 @@
 
 #define __INTR_PRIVATE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: p_sni_rm200pci.c,v 1.15 2011/02/20 07:52:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: 

CVS commit: src/share/man/man7

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jun 13 20:18:00 UTC 2020

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
g/c vm.idlezero


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/share/man/man7/sysctl.7

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

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.146 src/share/man/man7/sysctl.7:1.147
--- src/share/man/man7/sysctl.7:1.146	Sun May 10 02:32:32 2020
+++ src/share/man/man7/sysctl.7	Sat Jun 13 20:18:00 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.146 2020/05/10 02:32:32 riastradh Exp $
+.\"	$NetBSD: sysctl.7,v 1.147 2020/06/13 20:18:00 ad Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -2589,7 +2589,6 @@ them with
 with the caveat that whatever pages were already written to disk
 unencrypted or encrypted with a compromised key may still be written to
 disk afterward.
-.\" XXX vm.idlezero
 .El
 .Ss The ddb.* subtree ( Dv CTL_DDB )
 The information available for the



CVS commit: src/usr.bin/make

2020-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jun 13 21:16:27 UTC 2020

Modified Files:
src/usr.bin/make: str.c
src/usr.bin/make/unit-tests: modmatch.mk

Log Message:
usr.bin/make: make Str_Match faster for repeated asterisks

Conceptually related to https://en.wikipedia.org/wiki/ReDoS.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/make/str.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/modmatch.mk

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

Modified files:

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.45 src/usr.bin/make/str.c:1.46
--- src/usr.bin/make/str.c:1.45	Sat Jun 13 07:48:59 2020
+++ src/usr.bin/make/str.c	Sat Jun 13 21:16:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.46 2020/06/13 21:16:27 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.46 2020/06/13 21:16:27 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.45 2020/06/13 07:48:59 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.46 2020/06/13 21:16:27 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -355,6 +355,8 @@ Str_Match(const char *string, const char
 		 */
 		if (*pattern == '*') {
 			pattern++;
+			while (*pattern == '*')
+pattern++;
 			if (*pattern == 0)
 return 1;
 			while (*string != 0) {

Index: src/usr.bin/make/unit-tests/modmatch.mk
diff -u src/usr.bin/make/unit-tests/modmatch.mk:1.3 src/usr.bin/make/unit-tests/modmatch.mk:1.4
--- src/usr.bin/make/unit-tests/modmatch.mk:1.3	Fri Apr 21 22:15:44 2017
+++ src/usr.bin/make/unit-tests/modmatch.mk	Sat Jun 13 21:16:27 2020
@@ -15,7 +15,7 @@ res = no
 res = OK
 .endif
 
-all:	show-libs check-cclass
+all:	show-libs check-cclass slow
 
 show-libs:
 	@for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done
@@ -32,3 +32,8 @@ check-cclass:
 	@echo Upper=${LIST:M[A-Z]*}
 	@echo Lower=${LIST:M[^A-Z]*}
 	@echo nose=${LIST:M[^s]*[ex]}
+
+# Before 2020-06-13, this expression took quite a long time in Str_Match,
+# calling itself 601080390 times for 16 asterisks.
+slow: .PHONY
+	@:;: ${:U:Mb:Q}



CVS commit: src/etc

2020-06-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jun 13 19:46:23 UTC 2020

Modified Files:
src/etc: MAKEDEV.awk

Log Message:
When reading in the MD MAKEDEV.conf, perform block / char major
substitutions that may be present in that file.

PR port-cobalt/55009


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/etc/MAKEDEV.awk

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

Modified files:

Index: src/etc/MAKEDEV.awk
diff -u src/etc/MAKEDEV.awk:1.28 src/etc/MAKEDEV.awk:1.29
--- src/etc/MAKEDEV.awk:1.28	Sun Nov  3 12:03:35 2019
+++ src/etc/MAKEDEV.awk	Sat Jun 13 19:46:23 2020
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -
 #
-#	$NetBSD: MAKEDEV.awk,v 1.28 2019/11/03 12:03:35 martin Exp $
+#	$NetBSD: MAKEDEV.awk,v 1.29 2020/06/13 19:46:23 thorpej Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -104,10 +104,33 @@ BEGIN {
 	getline < cfgfile		# blank line
 	MDDEV = 0		# MD device targets
 	while (getline < cfgfile) {
+		#
+		# Perform the same blk / chr subsitution that happens below.
+		#
+		md_deventry = $0
+		if (match(md_deventry, /%[a-z0-9]*_(blk|chr)%/)) {
+			nam = substr(md_deventry, RSTART + 1, RLENGTH - 6);
+			typ = substr(md_deventry, RSTART + RLENGTH - 4, 3);
+			dev = ""
+			if (typ == "blk") {
+if (nam in blk) {
+	dev = blk[nam];
+}
+			} else {
+if (nam in chr) {
+	dev = chr[nam];
+}
+			}
+			if (dev != "") {
+parsed = substr(md_deventry, 1, RSTART - 1) dev
+md_deventry = substr(md_deventry, RSTART + RLENGTH)
+			}
+			md_deventry = parsed md_deventry
+		}
 		if (MDDEV)
-			MDDEV = MDDEV "\n" $0
+			MDDEV = MDDEV "\n" md_deventry
 		else
-			MDDEV = $0
+			MDDEV = md_deventry
 	}
 	close(cfgfile)
 
@@ -225,7 +248,7 @@ BEGIN {
 	print "# Generated from:"
 
 	# MAKEDEV.awk (this script) RCS Id
-	ARCSID = "$NetBSD: MAKEDEV.awk,v 1.28 2019/11/03 12:03:35 martin Exp $"
+	ARCSID = "$NetBSD: MAKEDEV.awk,v 1.29 2020/06/13 19:46:23 thorpej Exp $"
 	gsub(/\$/, "", ARCSID)
 	print "#	" ARCSID
 	



CVS commit: src/etc/etc.cobalt

2020-06-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jun 13 19:47:10 UTC 2020

Modified Files:
src/etc/etc.cobalt: MAKEDEV.conf

Log Message:
Create a compatibility symlink panel0 -> lcdpanel0

PR port-cobalt/55009


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/etc/etc.cobalt/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.cobalt/MAKEDEV.conf
diff -u src/etc/etc.cobalt/MAKEDEV.conf:1.17 src/etc/etc.cobalt/MAKEDEV.conf:1.18
--- src/etc/etc.cobalt/MAKEDEV.conf:1.17	Sun Apr  5 14:09:17 2020
+++ src/etc/etc.cobalt/MAKEDEV.conf	Sat Jun 13 19:47:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.17 2020/04/05 14:09:17 jdolecek Exp $
+# $NetBSD: MAKEDEV.conf,v 1.18 2020/06/13 19:47:10 thorpej Exp $
 
 all_md)
 	makedev wd0 wd1 sd0 sd1 sd2 sd3
@@ -26,6 +26,8 @@ minimal)
 
 lcdpanel)
 mkdev lcdpanel0 c %lcdpanel_chr% 0 660
+	# Support the legacy "panel0" name.
+	lndev lcdpanel0 panel0
 	;;
 
 



CVS commit: src/doc

2020-06-13 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Jun 13 21:23:00 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
New xz released


To generate a diff of this commit:
cvs rdiff -u -r1.1725 -r1.1726 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1725 src/doc/3RDPARTY:1.1726
--- src/doc/3RDPARTY:1.1725	Thu Jun 11 09:17:10 2020
+++ src/doc/3RDPARTY	Sat Jun 13 21:23:00 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1725 2020/06/11 09:17:10 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1726 2020/06/13 21:23:00 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1483,11 +1483,11 @@ Notes:
 
 Package:	xz
 Version:	5.2.4
-Current Vers:	5.2.4
+Current Vers:	5.2.5
 Maintainer:	Lasse Collin 
 Archive Site:	http://tukaani.org/xz/
 Home Page:	http://tukaani.org/xz/
-Date: 		2019-10-09
+Date: 		2020-06-13
 Responsible:	joerg
 License:	public-domain
 Location:	external/public-domain/xz/dist



CVS commit: src/usr.sbin/puffs/mount_9p

2020-06-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jun 13 21:23:28 UTC 2020

Modified Files:
src/usr.sbin/puffs/mount_9p: ninepuffs.c

Log Message:
Remove -46 from the -c usage.  While here, sync usage with man page
(s/devfile/device).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/puffs/mount_9p/ninepuffs.c

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

Modified files:

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.31 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.32
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.31	Sat Jun 13 16:56:46 2020
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Sat Jun 13 21:23:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninepuffs.c,v 1.31 2020/06/13 16:56:46 wiz Exp $	*/
+/*	$NetBSD: ninepuffs.c,v 1.32 2020/06/13 21:23:27 uwe Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.31 2020/06/13 16:56:46 wiz Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.32 2020/06/13 21:23:27 uwe Exp $");
 #endif /* !lint */
 
 #include 
@@ -61,7 +61,7 @@ usage(void)
 
 	fprintf(stderr, "usage: %s [-46su] [-o mntopts] [-p port] "
 	"[user@]server[:path] mountpoint\n", getprogname());
-	fprintf(stderr, "   %s -c [-46su] [-o mntopts] devfile mountpoint\n",
+	fprintf(stderr, "   %s -c [-su] [-o mntopts] device mountpoint\n",
 	getprogname());
 	exit(1);
 }



CVS commit: src/usr.bin/jot

2020-06-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun 14 01:26:46 UTC 2020

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

Log Message:
Generate format after setting the prec value

Otherwise we end up with setting invalid printf format: "%.-1f" (from
"if (snprintf(p, sz, "%%.%df", prec) >= (int)sz)") for prec equal to -1,
which is not canonical (rejected by gcc and clang when used explicitly).

Detected by ASan (MKSANITIZER) for "jot 8".


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/jot/jot.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/jot/jot.c
diff -u src/usr.bin/jot/jot.c:1.27 src/usr.bin/jot/jot.c:1.28
--- src/usr.bin/jot/jot.c:1.27	Sun Feb  3 03:19:29 2019
+++ src/usr.bin/jot/jot.c	Sun Jun 14 01:26:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jot.c,v 1.27 2019/02/03 03:19:29 mrg Exp $	*/
+/*	$NetBSD: jot.c,v 1.28 2020/06/14 01:26:46 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = "@(#)jot.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: jot.c,v 1.27 2019/02/03 03:19:29 mrg Exp $");
+__RCSID("$NetBSD: jot.c,v 1.28 2020/06/14 01:26:46 kamil Exp $");
 #endif /* not lint */
 
 /*
@@ -226,11 +226,12 @@ getargs(int argc, char *argv[])
 		errx(EXIT_FAILURE,
 		"Too many arguments.  What do you mean by %s?", argv[4]);
 	}
-	getformat();
 
 	if (prec == -1)
 		prec = 0;
 
+	getformat();
+
 	if (randomize) {
 		/* 'step' is the seed here, use pseudo-random default */
 		if (!(have & STEP))



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

2020-06-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 14 04:35:49 UTC 2020

Modified Files:
src/sys/arch/ews4800mips/conf: RAMDISK

Log Message:
Disable npf instead of obsolete ipfilter.  Saves ~82kbytes.

Maybe other installation kernels that include GENEIRIC-like ones
and use "no pseudo-device" options should be checked:
 https://mail-index.netbsd.org/source-changes/2018/08/01/msg097235.html


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

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

Modified files:

Index: src/sys/arch/ews4800mips/conf/RAMDISK
diff -u src/sys/arch/ews4800mips/conf/RAMDISK:1.29 src/sys/arch/ews4800mips/conf/RAMDISK:1.30
--- src/sys/arch/ews4800mips/conf/RAMDISK:1.29	Tue Jun  9 17:13:41 2020
+++ src/sys/arch/ews4800mips/conf/RAMDISK	Sun Jun 14 04:35:49 2020
@@ -1,4 +1,4 @@
-# 	$NetBSD: RAMDISK,v 1.29 2020/06/09 17:13:41 tsutsui Exp $
+# 	$NetBSD: RAMDISK,v 1.30 2020/06/14 04:35:49 tsutsui Exp $
 #
 # kernel config file with memory disk for installation
 #
@@ -68,7 +68,7 @@ no pseudo-device	raid
 no pseudo-device	vnd
 no pseudo-device	fss
 no pseudo-device	putter
-no pseudo-device	ipfilter
+no pseudo-device	npf
 no pseudo-device	ppp
 no pseudo-device	pppoe
 no pseudo-device	tap



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

2020-06-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 14 04:51:09 UTC 2020

Modified Files:
src/sys/arch/ews4800mips/conf: RAMDISK

Log Message:
Disable COMPAT_13 and UFS_EXTATTR.  Saves ~52kbytes.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/ews4800mips/conf/RAMDISK

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

Modified files:

Index: src/sys/arch/ews4800mips/conf/RAMDISK
diff -u src/sys/arch/ews4800mips/conf/RAMDISK:1.31 src/sys/arch/ews4800mips/conf/RAMDISK:1.32
--- src/sys/arch/ews4800mips/conf/RAMDISK:1.31	Sun Jun 14 04:46:27 2020
+++ src/sys/arch/ews4800mips/conf/RAMDISK	Sun Jun 14 04:51:09 2020
@@ -1,4 +1,4 @@
-# 	$NetBSD: RAMDISK,v 1.31 2020/06/14 04:46:27 tsutsui Exp $
+# 	$NetBSD: RAMDISK,v 1.32 2020/06/14 04:51:09 tsutsui Exp $
 #
 # kernel config file with memory disk for installation
 #
@@ -35,6 +35,7 @@ no options 	SYSCTL_INCLUDE_DESCR
 no options	DDB
 
 no options	COMPAT_43
+no options	COMPAT_13
 
 no file-system	EXT2FS
 no file-system	LFS
@@ -52,6 +53,7 @@ no file-system	TMPFS
 no options 	QUOTA
 no options 	QUOTA2
 no options 	NFSSERVER
+no options 	UFS_EXTATTR
 
 no options 	NETATALK
 no options 	PPP_FILTER



CVS commit: src/sys/miscfs/genfs

2020-06-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jun 14 00:25:22 UTC 2020

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs_putpages(): when building a cluster make use of pages in the in the
existing uvm_page_array.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.97 src/sys/miscfs/genfs/genfs_io.c:1.98
--- src/sys/miscfs/genfs/genfs_io.c:1.97	Mon May 25 21:15:10 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sun Jun 14 00:25:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.97 2020/05/25 21:15:10 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.98 2020/06/14 00:25:22 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.97 2020/05/25 21:15:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.98 2020/06/14 00:25:22 ad Exp $");
 
 #include 
 #include 
@@ -1208,6 +1208,11 @@ retry:
 			 *	0
 			 *	UVM_PAGE_ARRAY_FILL_DIRTY
 			 *	UVM_PAGE_ARRAY_FILL_DIRTY|WRITEBACK
+			 *
+			 * XXX this is fragile but it'll work: the array
+			 * was earlier filled sparsely, but UFP_DIRTYONLY
+			 * implies dense.  see corresponding comment in
+			 * uvn_findpages().
 			 */
 
 			npages = MAXPAGES - nback - 1;
@@ -1215,7 +1220,7 @@ retry:
 npages = MIN(npages,
 	 (fshi - off - 1) >> PAGE_SHIFT);
 			uvn_findpages(uobj, off + PAGE_SIZE, ,
-			[nback + 1], NULL,
+			[nback + 1], ,
 			UFP_NOWAIT|UFP_NOALLOC|UFP_DIRTYONLY);
 			npages += nback + 1;
 		} else {



CVS commit: src/sys

2020-06-13 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Jun 14 01:40:06 UTC 2020

Modified Files:
src/sys/arch/algor/dev: mainbus.c
src/sys/arch/amiga/pci: em4k.c empb.c mppb.c p5pb.c
src/sys/arch/arc/pci: necpb.c
src/sys/arch/arm/broadcom: bcm53xx_pax.c
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/gemini: gemini_pci.c
src/sys/arch/arm/imx: imx6_pcie.c
src/sys/arch/arm/imx/fdt: imx6_pcie.c
src/sys/arch/arm/ixp12x0: ixp12x0_pci.c
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/s3c2xx0: s3c2800_pci.c
src/sys/arch/arm/xscale: becc_pci.c i80312_pci.c i80321_pci.c
ixp425_pci.c
src/sys/arch/bebox/bebox: mainbus.c
src/sys/arch/cobalt/dev: gt.c
src/sys/arch/evbarm/ifpga: ifpga.c
src/sys/arch/evbmips/gdium: mainbus.c
src/sys/arch/evbmips/loongson: mainbus.c
src/sys/arch/evbmips/malta/dev: mainbus.c
src/sys/arch/evbppc/walnut/pci: pchb.c
src/sys/arch/hppa/dev: astro.c dino.c uturn.c
src/sys/arch/ibmnws/ibmnws: mainbus.c
src/sys/arch/mvmeppc/mvmeppc: mainbus.c
src/sys/arch/ofppc/pci: ofwpci.c
src/sys/arch/powerpc/ibm4xx/pci: pchb.c
src/sys/arch/prep/prep: mainbus.c
src/sys/arch/sandpoint/sandpoint: mainbus.c
src/sys/arch/sgimips/gio: pci_gio.c
src/sys/arch/sgimips/mace: pci_mace.c
src/sys/arch/sh3/dev: shpcic.c
src/sys/arch/sparc/dev: vme_machdep.c
src/sys/arch/sparc/sparc: iommu.c
src/sys/arch/sparc64/dev: sbus.c
src/sys/arch/vax/uba: qv.c
src/sys/arch/x68k/dev: intio.c
src/sys/dev/ic: cpc700.c
src/sys/dev/marvell: gtpci.c mvpex.c

Log Message:
replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/algor/dev/mainbus.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/pci/em4k.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amiga/pci/empb.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/amiga/pci/mppb.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/pci/p5pb.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arc/pci/necpb.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/broadcom/bcm53xx_pax.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/gemini/gemini_pci.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/imx/imx6_pcie.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/fdt/imx6_pcie.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/ixp12x0/ixp12x0_pci.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/s3c2xx0/s3c2800_pci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/xscale/becc_pci.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/xscale/i80312_pci.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/xscale/i80321_pci.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/xscale/ixp425_pci.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/bebox/bebox/mainbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/cobalt/dev/gt.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/ifpga/ifpga.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/gdium/mainbus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/loongson/mainbus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbmips/malta/dev/mainbus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbppc/walnut/pci/pchb.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/dev/astro.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/dev/dino.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/dev/uturn.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ibmnws/ibmnws/mainbus.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mvmeppc/mvmeppc/mainbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ofppc/pci/ofwpci.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/ibm4xx/pci/pchb.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/prep/prep/mainbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sandpoint/sandpoint/mainbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sgimips/gio/pci_gio.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sgimips/mace/pci_mace.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sh3/dev/shpcic.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/sparc/dev/vme_machdep.c
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/sparc/sparc/iommu.c
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/sparc64/dev/sbus.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/vax/uba/qv.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/x68k/dev/intio.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/cpc700.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/marvell/gtpci.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/marvell/mvpex.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/algor/dev/mainbus.c
diff -u src/sys/arch/algor/dev/mainbus.c:1.26 src/sys/arch/algor/dev/mainbus.c:1.27
--- src/sys/arch/algor/dev/mainbus.c:1.26	Fri Jan 27 18:52:47 2012
+++ 

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

2020-06-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 14 04:46:27 UTC 2020

Modified Files:
src/sys/arch/ews4800mips/conf: RAMDISK

Log Message:
Sort options to match GENERIC.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/ews4800mips/conf/RAMDISK

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

Modified files:

Index: src/sys/arch/ews4800mips/conf/RAMDISK
diff -u src/sys/arch/ews4800mips/conf/RAMDISK:1.30 src/sys/arch/ews4800mips/conf/RAMDISK:1.31
--- src/sys/arch/ews4800mips/conf/RAMDISK:1.30	Sun Jun 14 04:35:49 2020
+++ src/sys/arch/ews4800mips/conf/RAMDISK	Sun Jun 14 04:46:27 2020
@@ -1,4 +1,4 @@
-# 	$NetBSD: RAMDISK,v 1.30 2020/06/14 04:35:49 tsutsui Exp $
+# 	$NetBSD: RAMDISK,v 1.31 2020/06/14 04:46:27 tsutsui Exp $
 #
 # kernel config file with memory disk for installation
 #
@@ -23,16 +23,17 @@ options 	FFS_NO_SNAPSHOT
 options 	NO_DEV_PTM
 
 # disable some options to shrink kernel
-no options	DDB
 no options 	INCLUDE_CONFIG_FILE
 no options 	NTP
 no options 	KTRACE
-no options 	USERCONF
 no options 	SYSVMSG
 no options 	SYSVSEM
 no options 	SYSVSHM
+no options 	USERCONF
 no options 	SYSCTL_INCLUDE_DESCR
 
+no options	DDB
+
 no options	COMPAT_43
 
 no file-system	EXT2FS
@@ -51,8 +52,10 @@ no file-system	TMPFS
 no options 	QUOTA
 no options 	QUOTA2
 no options 	NFSSERVER
+
 no options 	NETATALK
 no options 	PPP_FILTER
+
 no options 	SCSIVERBOSE
 
 no ewsms0 at zsc?
@@ -65,9 +68,10 @@ no uk*	at scsibus?
 
 no pseudo-device	ccd
 no pseudo-device	raid
-no pseudo-device	vnd
 no pseudo-device	fss
 no pseudo-device	putter
+no pseudo-device	vnd
+no pseudo-device 	carp
 no pseudo-device	npf
 no pseudo-device	ppp
 no pseudo-device	pppoe
@@ -84,5 +88,4 @@ no pseudo-device	accf_http
 no pseudo-device	clockctl
 no pseudo-device	ksyms
 no pseudo-device	wsmux
-no pseudo-device 	carp
 no pseudo-device 	veriexec



CVS commit: src/usr.sbin/puffs/mount_9p

2020-06-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jun 14 00:30:20 UTC 2020

Modified Files:
src/usr.sbin/puffs/mount_9p: mount_9p.8 ninepuffs.c

Log Message:
Support optional square brackets around the host name.

The brackets are required when using numeric IPv6 addresses as they
contain colons as part of their syntax.  We do not enforce that the
thing in the brackets is a numeric IPv6 address - this matches scp
syntax and behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/puffs/mount_9p/mount_9p.8
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/puffs/mount_9p/ninepuffs.c

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

Modified files:

Index: src/usr.sbin/puffs/mount_9p/mount_9p.8
diff -u src/usr.sbin/puffs/mount_9p/mount_9p.8:1.14 src/usr.sbin/puffs/mount_9p/mount_9p.8:1.15
--- src/usr.sbin/puffs/mount_9p/mount_9p.8:1.14	Sat Jun 13 13:45:06 2020
+++ src/usr.sbin/puffs/mount_9p/mount_9p.8	Sun Jun 14 00:30:20 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount_9p.8,v 1.14 2020/06/13 13:45:06 uwe Exp $
+.\"	$NetBSD: mount_9p.8,v 1.15 2020/06/14 00:30:20 uwe Exp $
 .\"
 .\" Copyright (c) 2007 Antti Kantee.  All rights reserved.
 .\"
@@ -58,6 +58,10 @@ is supplied, it is used as the mount roo
 .Ar path
 must be an absolute path.
 .Pp
+The host name may be optionally enclosed in square brackets.
+This is required when using numeric IPv6 addresses as they contain
+colons as part of their syntax.
+.Pp
 The
 .Fl c
 option enables to mount a file system exported by a VM host through

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.32 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.33
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.32	Sat Jun 13 21:23:27 2020
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Sun Jun 14 00:30:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninepuffs.c,v 1.32 2020/06/13 21:23:27 uwe Exp $	*/
+/*	$NetBSD: ninepuffs.c,v 1.33 2020/06/14 00:30:20 uwe Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.32 2020/06/13 21:23:27 uwe Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.33 2020/06/14 00:30:20 uwe Exp $");
 #endif /* !lint */
 
 #include 
@@ -262,16 +262,34 @@ main(int argc, char *argv[])
 		user = pw->pw_name;
 	}
 
-	/* :/mountpath */
-	if ((p = strchr(srvhost, ':')) != NULL) {
-		*p = '\0';
-		srvpath = p+1;
-		if (*srvpath != '/')
-			errx(1, "%s is not an absolute path", srvpath);
-	} else {
-		srvpath = "/";
+	/* [host] or [host]:/path with square brackets around host */
+	if (server == P9P_SERVER_TCP && *srvhost == '[') {
+		++srvhost;
+		if ((p = strchr(srvhost, ']')) == NULL)
+			errx(EXIT_FAILURE, "Missing bracket after the host name");
+		*p++ = '\0';
+		if (*p == '\0')		/* [host] */
+			srvpath = "/";
+		else if (*p == ':')	/* [host]:path */
+			srvpath = p+1;
+		else			/* [foo]bar */
+			errx(EXIT_FAILURE, "Invalid brackets in the host name");
+
+	} else { /* host or host:/path without brackets around host */
+		if ((p = strchr(srvhost, ':')) != NULL) {
+			*p = '\0';
+			srvpath = p+1;
+		} else {
+			srvpath = "/";
+		}
 	}
 
+	if (*srvpath == '\0')
+		errx(1, "Empty path");
+	if (*srvpath != '/')
+		errx(1, "%s: Not an absolute path", srvpath);
+
+
 	if (p9p.server == P9P_SERVER_TCP) {
 		p9p.servsock = serverconnect(srvhost, port, family);
 	} else {



CVS commit: src/distrib/ews4800mips/floppies/instkernel

2020-06-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 14 05:10:33 UTC 2020

Modified Files:
src/distrib/ews4800mips/floppies/instkernel: Makefile

Log Message:
Put a message in build error logs to notify what this target builds.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/ews4800mips/floppies/instkernel/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/ews4800mips/floppies/instkernel/Makefile
diff -u src/distrib/ews4800mips/floppies/instkernel/Makefile:1.8 src/distrib/ews4800mips/floppies/instkernel/Makefile:1.9
--- src/distrib/ews4800mips/floppies/instkernel/Makefile:1.8	Tue Jan  1 19:09:12 2019
+++ src/distrib/ews4800mips/floppies/instkernel/Makefile	Sun Jun 14 05:10:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2019/01/01 19:09:12 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2020/06/14 05:10:33 tsutsui Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -18,6 +18,7 @@ BOOT_RELEASEDIR=	installation/boot
 all realall:	${BOOT_RAMDISK}.gz
 
 ${BOOT_RAMDISK}.gz:	netbsd-RAMDISK.gz ${DESTDIR}/usr/mdec/boot_kernel.gz
+	@echo "Creating a bootloader binary with embedded RAMDISK kernel"
 	gunzip -c ${DESTDIR}/usr/mdec/boot_kernel.gz > ${BOOT_RAMDISK}.tmp
 	${TOOL_MDSETIMAGE} -v ${BOOT_RAMDISK}.tmp netbsd-RAMDISK.gz
 	${MIPS_ELF2ECOFF} ${BOOT_RAMDISK}.tmp ${BOOT_RAMDISK}.coff