CVS commit: src/sys

2019-12-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Dec  6 07:27:07 UTC 2019

Modified Files:
src/sys/dev/acpi: acpi_pci_link.c
src/sys/dev/pci: auich.c
src/sys/kern: uipc_mbuf.c

Log Message:
Minor changes, reported by the LGTM bot.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_pci_link.c
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/pci/auich.c
cvs rdiff -u -r1.235 -r1.236 src/sys/kern/uipc_mbuf.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/acpi/acpi_pci_link.c
diff -u src/sys/dev/acpi/acpi_pci_link.c:1.23 src/sys/dev/acpi/acpi_pci_link.c:1.24
--- src/sys/dev/acpi/acpi_pci_link.c:1.23	Sun Nov 10 21:16:34 2019
+++ src/sys/dev/acpi/acpi_pci_link.c	Fri Dec  6 07:27:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_pci_link.c,v 1.23 2019/11/10 21:16:34 chs Exp $	*/
+/*	$NetBSD: acpi_pci_link.c,v 1.24 2019/12/06 07:27:06 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2002 Mitsuru IWASAKI 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_link.c,v 1.23 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_link.c,v 1.24 2019/12/06 07:27:06 maxv Exp $");
 
 #include 
 #include 
@@ -116,8 +116,8 @@ struct link {
 	int	l_references;
 	int	l_dev_count;
 	pcitag_t *l_devices;
-	int	l_routed:1;
-	int	l_isa_irq:1;
+	u_int	l_routed:1;
+	u_int	l_isa_irq:1;
 	ACPI_RESOURCE l_prs_template;
 };
 

Index: src/sys/dev/pci/auich.c
diff -u src/sys/dev/pci/auich.c:1.157 src/sys/dev/pci/auich.c:1.158
--- src/sys/dev/pci/auich.c:1.157	Sat Jun  8 08:02:38 2019
+++ src/sys/dev/pci/auich.c	Fri Dec  6 07:27:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: auich.c,v 1.157 2019/06/08 08:02:38 isaki Exp $	*/
+/*	$NetBSD: auich.c,v 1.158 2019/12/06 07:27:07 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2008 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.157 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.158 2019/12/06 07:27:07 maxv Exp $");
 
 #include 
 #include 
@@ -215,7 +215,7 @@ struct auich_softc {
 	/* 440MX workaround */
 	int  sc_dmamap_flags;
 	/* flags */
-	int  sc_iose	:1,
+	u_int  sc_iose	:1,
 		 	:31;
 
 	/* sysctl */

Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.235 src/sys/kern/uipc_mbuf.c:1.236
--- src/sys/kern/uipc_mbuf.c:1.235	Sat Oct 19 06:36:47 2019
+++ src/sys/kern/uipc_mbuf.c	Fri Dec  6 07:27:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.235 2019/10/19 06:36:47 tnn Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.236 2019/12/06 07:27:07 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001, 2018 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.235 2019/10/19 06:36:47 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.236 2019/12/06 07:27:07 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -2205,7 +2205,7 @@ m_verify_packet(struct mbuf *m)
 
 		dat = n->m_data;
 		len = n->m_len;
-		if (__predict_false(dat + len < dat)) {
+		if (__predict_false(len < 0)) {
 			panic("%s: incorrect length (len = %d)", __func__, len);
 		}
 



CVS commit: src/sys/dev

2019-12-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Dec  6 07:12:39 UTC 2019

Modified Files:
src/sys/dev/gpio: gpioow.c
src/sys/dev/ic: smc91cxx.c smc91cxxvar.h
src/sys/dev/pci: if_txp.c
src/sys/dev/pcmcia: if_cnw.c
src/sys/dev/usb: uhidev.c uirda.c umass.c
src/sys/dev/wscons: wsdisplay.c

Log Message:
localify


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/gpio/gpioow.c
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/smc91cxxvar.h
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/if_txp.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/usb/uhidev.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/uirda.c
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/umass.c
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/wscons/wsdisplay.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/gpio/gpioow.c
diff -u src/sys/dev/gpio/gpioow.c:1.16 src/sys/dev/gpio/gpioow.c:1.17
--- src/sys/dev/gpio/gpioow.c:1.16	Sat Nov 30 23:04:12 2019
+++ src/sys/dev/gpio/gpioow.c	Fri Dec  6 07:12:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioow.c,v 1.16 2019/11/30 23:04:12 ad Exp $ */
+/* $NetBSD: gpioow.c,v 1.17 2019/12/06 07:12:38 maxv Exp $ */
 /*	$OpenBSD: gpioow.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gpioow.c,v 1.16 2019/11/30 23:04:12 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioow.c,v 1.17 2019/12/06 07:12:38 maxv Exp $");
 
 /*
  * 1-Wire bus bit-banging through GPIO pin.
@@ -51,19 +51,19 @@ struct gpioow_softc {
 	int			sc_dying;
 };
 
-int	gpioow_match(device_t, cfdata_t, void *);
-void	gpioow_attach(device_t, device_t, void *);
-int	gpioow_detach(device_t, int);
-int	gpioow_activate(device_t, enum devact);
-
-int	gpioow_ow_reset(void *);
-int	gpioow_ow_read_bit(void *);
-void	gpioow_ow_write_bit(void *, int);
-
-void	gpioow_bb_rx(void *);
-void	gpioow_bb_tx(void *);
-int	gpioow_bb_get(void *);
-void	gpioow_bb_set(void *, int);
+static int	gpioow_match(device_t, cfdata_t, void *);
+static void	gpioow_attach(device_t, device_t, void *);
+static int	gpioow_detach(device_t, int);
+static int	gpioow_activate(device_t, enum devact);
+
+static int	gpioow_ow_reset(void *);
+static int	gpioow_ow_read_bit(void *);
+static void	gpioow_ow_write_bit(void *, int);
+
+static void	gpioow_bb_rx(void *);
+static void	gpioow_bb_tx(void *);
+static int	gpioow_bb_get(void *);
+static void	gpioow_bb_set(void *, int);
 
 CFATTACH_DECL_NEW(gpioow, sizeof(struct gpioow_softc),
 	gpioow_match, gpioow_attach, gpioow_detach, gpioow_activate);
@@ -75,7 +75,7 @@ static const struct onewire_bbops gpioow
 	gpioow_bb_set
 };
 
-int
+static int
 gpioow_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct gpio_attach_args *ga = aux;
@@ -95,7 +95,7 @@ gpioow_match(device_t parent, cfdata_t c
 	return 1;
 }
 
-void
+static void
 gpioow_attach(device_t parent, device_t self, void *aux)
 {
 	struct gpioow_softc *sc = device_private(self);
@@ -158,7 +158,7 @@ finish:
 	return;
 }
 
-int
+static int
 gpioow_detach(device_t self, int flags)
 {
 	struct gpioow_softc *sc = device_private(self);
@@ -174,7 +174,7 @@ gpioow_detach(device_t self, int flags)
 	return rv;
 }
 
-int
+static int
 gpioow_activate(device_t self, enum devact act)
 {
 	struct gpioow_softc *sc = device_private(self);
@@ -188,25 +188,25 @@ gpioow_activate(device_t self, enum deva
 	}
 }
 
-int
+static int
 gpioow_ow_reset(void *arg)
 {
 	return (onewire_bb_reset(_bbops, arg));
 }
 
-int
+static int
 gpioow_ow_read_bit(void *arg)
 {
 	return (onewire_bb_read_bit(_bbops, arg));
 }
 
-void
+static void
 gpioow_ow_write_bit(void *arg, int value)
 {
 	onewire_bb_write_bit(_bbops, arg, value);
 }
 
-void
+static void
 gpioow_bb_rx(void *arg)
 {
 	struct gpioow_softc *sc = arg;
@@ -223,7 +223,7 @@ gpioow_bb_rx(void *arg)
 	}
 }
 
-void
+static void
 gpioow_bb_tx(void *arg)
 {
 	struct gpioow_softc *sc = arg;
@@ -238,7 +238,7 @@ gpioow_bb_tx(void *arg)
 	}
 }
 
-int
+static int
 gpioow_bb_get(void *arg)
 {
 	struct gpioow_softc *sc = arg;
@@ -247,7 +247,7 @@ gpioow_bb_get(void *arg)
 	GPIO_PIN_HIGH ? 1 : 0);
 }
 
-void
+static void
 gpioow_bb_set(void *arg, int value)
 {
 	struct gpioow_softc *sc = arg;

Index: src/sys/dev/ic/smc91cxx.c
diff -u src/sys/dev/ic/smc91cxx.c:1.102 src/sys/dev/ic/smc91cxx.c:1.103
--- src/sys/dev/ic/smc91cxx.c:1.102	Thu May 30 02:32:18 2019
+++ src/sys/dev/ic/smc91cxx.c	Fri Dec  6 07:12:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: smc91cxx.c,v 1.102 2019/05/30 02:32:18 msaitoh Exp $	*/
+/*	$NetBSD: smc91cxx.c,v 1.103 2019/12/06 07:12:38 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.102 2019/05/30 02:32:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: 

CVS commit: src/sys

2019-12-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  6 06:38:39 UTC 2019

Modified Files:
src/sys/arch/powerpc/include: types.h
src/sys/arch/powerpc/powerpc: openfirm.c
src/sys/dev/ofw: openfirmio.c

Log Message:
revert this change from early this year.  it appears the
changes macallan@ commited to fix FIRMWORKSBUGS issues
in openfirmware() have fixed the hangs seen on PegasosII.

hooray!

---
Log Message:
workaround a problem with the pegasos firmware interface:
attempting to use /dev/openfirm on this machine hangs hard.

this isn't a new problem, and i've been meaning to try to
figure it out for years, but it's become a problem since
the xf86-video-radeon driver gained code to look for the
macppc model using this interface.

this is why xorg-server 1.18 and 1.20 hang recently on the
pegasosII.

this change is fairly ugly but i couldn't think of a less
ugly method to avoid /dev/openfirm working just on this
one platform.  introduce new __OPENFIRMIO_OPEN_CHECK_BROKEN
macro and associated __openfirmio_open_check_broken(), and
use them in the new openfirmopen() to fail opens.

include proplib.h in macppc and ofppc autoconf.h since they
use it.
---


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/powerpc/openfirm.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ofw/openfirmio.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/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.59 src/sys/arch/powerpc/include/types.h:1.60
--- src/sys/arch/powerpc/include/types.h:1.59	Sun Apr  7 05:25:55 2019
+++ src/sys/arch/powerpc/include/types.h	Fri Dec  6 06:38:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.59 2019/04/07 05:25:55 thorpej Exp $	*/
+/*	$NetBSD: types.h,v 1.60 2019/12/06 06:38:39 mrg Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -87,8 +87,6 @@ typedef __uint32_t tlb_asid_t;		/* for b
 #define	__HAVE___LWP_GETTCB_FAST
 #define	__HAVE___LWP_SETTCB
 #define	__HAVE_TLS_VARIANT_I
-#define	__OPENFIRMIO_OPEN_CHECK_BROKEN
-int __openfirmio_open_check_broken(void);
 
 #if defined(_KERNEL) || defined(_KMEMUSER)
 #define	PCU_FPU		0	/* FPU */

Index: src/sys/arch/powerpc/powerpc/openfirm.c
diff -u src/sys/arch/powerpc/powerpc/openfirm.c:1.29 src/sys/arch/powerpc/powerpc/openfirm.c:1.30
--- src/sys/arch/powerpc/powerpc/openfirm.c:1.29	Sat Nov 16 00:16:55 2019
+++ src/sys/arch/powerpc/powerpc/openfirm.c	Fri Dec  6 06:38:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.c,v 1.29 2019/11/16 00:16:55 macallan Exp $	*/
+/*	$NetBSD: openfirm.c,v 1.30 2019/12/06 06:38:39 mrg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.29 2019/11/16 00:16:55 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.30 2019/12/06 06:38:39 mrg Exp $");
 
 #include 
 #include 
@@ -762,11 +762,3 @@ ofbcopy(const void *src, void *dst, size
 	while (len-- > 0)
 		*dp++ = *sp++;
 }
-
-#ifdef __OPENFIRMIO_OPEN_CHECK_BROKEN
-int
-__openfirmio_open_check_broken(void)
-{
-	return strncmp(model_name, "Pegasos", 7) == 0 ? ENXIO : 0;
-}
-#endif

Index: src/sys/dev/ofw/openfirmio.c
diff -u src/sys/dev/ofw/openfirmio.c:1.14 src/sys/dev/ofw/openfirmio.c:1.15
--- src/sys/dev/ofw/openfirmio.c:1.14	Tue Jan  8 07:46:11 2019
+++ src/sys/dev/ofw/openfirmio.c	Fri Dec  6 06:38:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirmio.c,v 1.14 2019/01/08 07:46:11 mrg Exp $ */
+/*	$NetBSD: openfirmio.c,v 1.15 2019/12/06 06:38:39 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: openfirmio.c,v 1.14 2019/01/08 07:46:11 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: openfirmio.c,v 1.15 2019/12/06 06:38:39 mrg Exp $");
 
 #include 
 #include 
@@ -122,11 +122,7 @@ static int
 openfirmopen(dev_t dev, int flag, int mode, struct lwp *l)
 {
 
-#ifdef __OPENFIRMIO_OPEN_CHECK_BROKEN
-	return __openfirmio_open_check_broken();
-#else
 	return 0;
-#endif
 }
 
 static int



CVS commit: src/libexec/httpd

2019-12-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  6 05:53:21 UTC 2019

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
remove some XXX comments.  one isn't relevant, and the other two
have been incorrect for a long while now.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.48 src/libexec/httpd/cgi-bozo.c:1.49
--- src/libexec/httpd/cgi-bozo.c:1.48	Fri Mar 29 14:46:44 2019
+++ src/libexec/httpd/cgi-bozo.c	Fri Dec  6 05:53:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.48 2019/03/29 14:46:44 martin Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.49 2019/12/06 05:53:20 mrg Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -137,7 +137,7 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 		 * return it in the response.  If the cgi program does
 		 * not return any `Status:' header then the server should
 		 * respond with 200 OK.
-		 * XXX The CGI 1.1 and 1.2 specification differ slightly on
+		 * The CGI 1.1 and 1.2 specification differ slightly on
 		 * this in that v1.2 says that the script MUST NOT return a
 		 * `Status:' header if it is returning a `Location:' header.
 		 * For compatibility we are going with the CGI 1.1 behavior.
@@ -182,8 +182,7 @@ finish_cgi_output(bozohttpd_t *httpd, bo
 		bozo_flush(httpd, stdout);
 	}
 
-	/* XXX we should have some goo that times us out
-	 */
+	/* CGI programs should perform their own timeouts */
 	while ((rbytes = read(in, buf, sizeof buf)) > 0) {
 		ssize_t wbytes;
 		char *bp = buf;
@@ -645,8 +644,7 @@ bozo_process_cgi(bozo_httpreq_t *request
 	}
 	close(STDOUT_FILENO);
 
-	/* XXX we should have some goo that times us out
-	 */
+	/* CGI programs should perform their own timeouts */
 	while ((rbytes = bozo_read(httpd, STDIN_FILENO, buf, sizeof buf)) > 0) {
 		ssize_t wbytes;
 		char *bp = buf;



CVS commit: src/sys/dev

2019-12-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec  6 04:15:38 UTC 2019

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

Log Message:
Restore historical $Hdr$ tag after git cvsexportcommit nixed it.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/cons.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/cons.c
diff -u src/sys/dev/cons.c:1.76 src/sys/dev/cons.c:1.77
--- src/sys/dev/cons.c:1.76	Fri Dec  6 03:45:33 2019
+++ src/sys/dev/cons.c	Fri Dec  6 04:15:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $	*/
+/*	$NetBSD: cons.c,v 1.77 2019/12/06 04:15:38 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -33,13 +33,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: Utah $Hdr$
+ * from: Utah $Hdr: cons.c 1.7 92/01/21$
  *
  *	@(#)cons.c	8.2 (Berkeley) 1/12/94
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.77 2019/12/06 04:15:38 riastradh Exp $");
 
 #include 
 #include 



CVS commit: src/sys/dev

2019-12-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec  6 03:45:33 UTC 2019

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

Log Message:
Fix reference count leak in cons(4).

Don't forget to vrele after you're done, folks!

XXX pullup-9
XXX pullup-8
XXX pullup-7
XXX pullup-6... 5... 4 might not have had this bug!


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/cons.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/cons.c
diff -u src/sys/dev/cons.c:1.75 src/sys/dev/cons.c:1.76
--- src/sys/dev/cons.c:1.75	Fri May 29 16:26:45 2015
+++ src/sys/dev/cons.c	Fri Dec  6 03:45:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $	*/
+/*	$NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -33,13 +33,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: Utah $Hdr: cons.c 1.7 92/01/21$
+ * from: Utah $Hdr$
  *
  *	@(#)cons.c	8.2 (Berkeley) 1/12/94
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.75 2015/05/29 16:26:45 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.76 2019/12/06 03:45:33 riastradh Exp $");
 
 #include 
 #include 
@@ -158,6 +158,7 @@ cnclose(dev_t dev, int flag, int mode, s
 	if (error == 0) {
 		error = VOP_CLOSE(vp, flag, kauth_cred_get());
 		VOP_UNLOCK(vp);
+		vrele(vp);
 	}
 	return error;
 }



CVS commit: src/sys/gdbscripts

2019-12-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  6 02:37:53 UTC 2019

Modified Files:
src/sys/gdbscripts: vchain

Log Message:
more updates for the vnode and mount list iterator changes
that happened a while back.  also, port to 64 bit properly.
now these all appear to work again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/gdbscripts/vchain

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

Modified files:

Index: src/sys/gdbscripts/vchain
diff -u src/sys/gdbscripts/vchain:1.10 src/sys/gdbscripts/vchain:1.11
--- src/sys/gdbscripts/vchain:1.10	Fri Dec  6 01:01:02 2019
+++ src/sys/gdbscripts/vchain	Fri Dec  6 02:37:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: vchain,v 1.10 2019/12/06 01:01:02 mrg Exp $
+#	$NetBSD: vchain,v 1.11 2019/12/06 02:37:53 mrg Exp $
 
 #	@(#)vchain	8.1 (Berkeley) 6/10/93
 #
@@ -6,14 +6,15 @@
 define vchain
 	set $num = 0
 
-	set $vp=(struct vnode *)$arg0
-	set $vi=(struct vnode_impl *)$arg0
-	while ($vp)
-		printf "vp: 0x%lx lrulist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
-		   $vp, $vi->vi_lrulist.tqe_next, $vp->v_uobj.uo_refs, \
+	set $vi = (struct vnode_impl *)$arg0
+	printf "lrulist_next: 0x%lx\n", $vi->vi_lrulist.tqe_next
+	while ($vi)
+		set $vp = &$vi->vi_vnode
+		printf "vp: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
+		   $vp, $vp->v_uobj.uo_refs, \
 		   $vp->v_iflag, $vp->v_vflag, $vp->v_uflag
 		set $num++
-		set $vp = $vp->v_mntvnodes.tqe_next
+		set $vi = $vi->vi_mntvnodes.tqe_next
 	end
 	printf "Number of vnodes: %d\n", $num
 end
@@ -28,23 +29,26 @@ define vprint
 end
 
 define mp_vchain
-	set $mp = (struct mount *)$arg0
-	vchain $mp->mnt_vnodelist.tqh_first
+	set $mp = $arg0->me_mount
+	set $first = $mp->mnt_vnodelist.tqh_first
+	if ($first)
+		vchain $mp->mnt_vnodelist.tqh_first
+	end
 end
 document mp_vchain
 print the vnode chain for a given mount point
 end
 
 define vall
-	set $mp=mountlist.tqh_first
-	while ($mp)
-		printf "\tmount point at 0x%x\n", $mp
-		mp_vchain $mp
-		set $mp=$mp->mnt_list.tqe_next
+	set $mpe=mountlist.tqh_first
+	while ($mpe)
+		printf "\tmount point at 0x%lx\n", $mpe
+		mp_vchain $mpe
+		set $mpe = $mpe->me_list.tqe_next
 
 		# "break"
-		if ((const void *)$mp == (const void *))
-			set $mp = 0
+		if ((const void *)$mpe == (const void *))
+			set $mpe = 0
 		end
 	end
 end
@@ -57,7 +61,7 @@ define mountdump
 	while ($me)
 		if ($me->me_type == ME_MOUNT)
 			set $mp = $me->me_mount
-			printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \
+			printf "%s on %s type %s, (mp 0x%lx, privdata 0x%lx)\n", \
 			$mp->mnt_stat->f_mntfromname, \
 			$mp->mnt_stat->f_mntonname, \
 			$mp->mnt_op->vfs_name, $mp, $mp->mnt_data



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

2019-12-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Dec  6 01:09:51 UTC 2019

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

Log Message:
Log PID.LWP in t_ptrace_wait* tests for enabled debug

This is useful for multithreaded test scenarios.


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.141 src/tests/lib/libc/sys/t_ptrace_wait.c:1.142
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.141	Tue Nov 12 18:18:04 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Fri Dec  6 01:09:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.141 2019/11/12 18:18:04 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.142 2019/12/06 01:09:50 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.141 2019/11/12 18:18:04 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.142 2019/12/06 01:09:50 kamil Exp $");
 
 #include 
 #include 
@@ -118,7 +118,8 @@ static int debug = 0;
 
 #define DPRINTF(a, ...)	do  \
 	if (debug) \
-	printf("%s() %s:%d " a, __func__, __FILE__, __LINE__,  ##__VA_ARGS__); \
+	printf("%s() %d.%d %s:%d " a, \
+	__func__, getpid(), _lwp_self(), __FILE__, __LINE__,  ##__VA_ARGS__); \
 while (/*CONSTCOND*/0)
 
 /// 



CVS commit: src/sys/gdbscripts

2019-12-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  6 01:01:02 UTC 2019

Modified Files:
src/sys/gdbscripts: vchain

Log Message:
it's mountlist not mount_list.  now 'mountdump' works again.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/gdbscripts/vchain

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

Modified files:

Index: src/sys/gdbscripts/vchain
diff -u src/sys/gdbscripts/vchain:1.9 src/sys/gdbscripts/vchain:1.10
--- src/sys/gdbscripts/vchain:1.9	Thu Apr 13 09:52:18 2017
+++ src/sys/gdbscripts/vchain	Fri Dec  6 01:01:02 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: vchain,v 1.9 2017/04/13 09:52:18 hannken Exp $
+#	$NetBSD: vchain,v 1.10 2019/12/06 01:01:02 mrg Exp $
 
 #	@(#)vchain	8.1 (Berkeley) 6/10/93
 #
@@ -53,7 +53,7 @@ print vnode chains for all mount points
 end
 
 define mountdump
-	set $me=mount_list.tqh_first
+	set $me=mountlist.tqh_first
 	while ($me)
 		if ($me->me_type == ME_MOUNT)
 			set $mp = $me->me_mount
@@ -63,7 +63,7 @@ define mountdump
 			$mp->mnt_op->vfs_name, $mp, $mp->mnt_data
 		end
 		set $me=$me->me_list.tqe_next
-		if ((const void *)$me == (const void *)_list)
+		if ((const void *)$me == (const void *))
 			set $me = 0
 		end
 	end



CVS commit: src/sys/arch

2019-12-05 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Dec  5 22:05:05 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC

Log Message:
Enable pciverbose option to make use of the pcidevs database by default.

ok ad, mrg


To generate a diff of this commit:
cvs rdiff -u -r1.547 -r1.548 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1215 -r1.1216 src/sys/arch/i386/conf/GENERIC

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/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.547 src/sys/arch/amd64/conf/GENERIC:1.548
--- src/sys/arch/amd64/conf/GENERIC:1.547	Wed Nov 20 09:37:45 2019
+++ src/sys/arch/amd64/conf/GENERIC	Thu Dec  5 22:05:05 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.547 2019/11/20 09:37:45 hikaru Exp $
+# $NetBSD: GENERIC,v 1.548 2019/12/05 22:05:05 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.547 $"
+#ident		"GENERIC-$Revision: 1.548 $"
 
 maxusers	64		# estimated number of users
 
@@ -234,7 +234,7 @@ options 	PPP_FILTER	# Active filter supp
 # Warning, these may compile large string tables into the kernel!
 #options 	ACPIVERBOSE	# verbose ACPI configuration messages
 #options 	MIIVERBOSE	# verbose PHY autoconfig messages
-#options 	PCIVERBOSE	# verbose PCI device autoconfig messages
+options 	PCIVERBOSE	# verbose PCI device autoconfig messages
 #options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
 #options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
 options 	SCSIVERBOSE	# human readable SCSI error messages

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1215 src/sys/arch/i386/conf/GENERIC:1.1216
--- src/sys/arch/i386/conf/GENERIC:1.1215	Fri Nov  1 02:53:23 2019
+++ src/sys/arch/i386/conf/GENERIC	Thu Dec  5 22:05:05 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1215 2019/11/01 02:53:23 msaitoh Exp $
+# $NetBSD: GENERIC,v 1.1216 2019/12/05 22:05:05 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1215 $"
+#ident		"GENERIC-$Revision: 1.1216 $"
 
 maxusers	64		# estimated number of users
 
@@ -198,7 +198,7 @@ options 	PPP_FILTER	# Active filter supp
 #options 	ACPIVERBOSE	# verbose ACPI device autoconfig messages
 #options 	EISAVERBOSE	# verbose EISA device autoconfig messages
 #options 	MIIVERBOSE	# verbose PHY autoconfig messages
-#options 	PCIVERBOSE	# verbose PCI device autoconfig messages
+options 	PCIVERBOSE	# verbose PCI device autoconfig messages
 #options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
 #options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
 options 	SCSIVERBOSE	# human readable SCSI error messages



CVS commit: src/etc

2019-12-05 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Dec  5 22:02:29 UTC 2019

Modified Files:
src/etc/etc.amd64: boot.cfg
src/etc/etc.i386: boot.cfg

Log Message:
Undo loading pciverbose module by default.
See item 14 in src/doc/TODO.modules.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.amd64/boot.cfg
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.i386/boot.cfg

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.amd64/boot.cfg
diff -u src/etc/etc.amd64/boot.cfg:1.7 src/etc/etc.amd64/boot.cfg:1.8
--- src/etc/etc.amd64/boot.cfg:1.7	Wed Dec  4 21:53:20 2019
+++ src/etc/etc.amd64/boot.cfg	Thu Dec  5 22:02:29 2019
@@ -1,4 +1,4 @@
-menu=Boot normally:rndseed /var/db/entropy-file;load pciverbose;boot
+menu=Boot normally:rndseed /var/db/entropy-file;boot
 menu=Boot single user:rndseed /var/db/entropy-file;boot -s
 menu=Drop to boot prompt:prompt
 default=1

Index: src/etc/etc.i386/boot.cfg
diff -u src/etc/etc.i386/boot.cfg:1.7 src/etc/etc.i386/boot.cfg:1.8
--- src/etc/etc.i386/boot.cfg:1.7	Wed Dec  4 21:53:20 2019
+++ src/etc/etc.i386/boot.cfg	Thu Dec  5 22:02:29 2019
@@ -1,4 +1,4 @@
-menu=Boot normally:rndseed /var/db/entropy-file;load pciverbose;boot
+menu=Boot normally:rndseed /var/db/entropy-file;boot
 menu=Boot single user:rndseed /var/db/entropy-file;boot -s
 menu=Drop to boot prompt:prompt
 default=1



CVS commit: src/sys/arch/powerpc/powerpc

2019-12-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Dec  5 20:55:24 UTC 2019

Modified Files:
src/sys/arch/powerpc/powerpc: powerpc_machdep.c

Log Message:
Need to call userret() from cpu_ast().


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/powerpc/powerpc/powerpc_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/powerpc/powerpc/powerpc_machdep.c
diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.75
--- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74	Sat Nov 23 19:40:36 2019
+++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c	Thu Dec  5 20:55:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 ad Exp $	*/
+/*	$NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 ad Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 ad Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -373,6 +373,8 @@ void
 cpu_ast(struct lwp *l, struct cpu_info *ci)
 {
 	l->l_md.md_astpending = 0;	/* we are about to do it */
+	__insn_barrier();
+	userret(l, l->l_md.md_utf);
 
 	if (l->l_pflag & LP_OWEUPC) {
 		l->l_pflag &= ~LP_OWEUPC;
@@ -400,7 +402,7 @@ cpu_need_resched(struct cpu_info *ci, st
 		cpu_send_ipi(cpu_index(ci), IPI_AST);
 #endif
 	} else {
-		l->l_md.md_astpending = 1;		/* force call to ast() */
+		l->l_md.md_astpending = 1;	/* force call to cpu_ast() */
 	}
 }
 



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

2019-12-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec  5 20:25:54 UTC 2019

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

Log Message:
Use the original linux function rather than my wrong translation.

...Include the header to have it.

Thanks Riastradh!


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

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.19 src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.20
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.19	Thu Dec  5 20:03:09 2019
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c	Thu Dec  5 20:25:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_cmd_parser.c,v 1.19 2019/12/05 20:03:09 maya Exp $	*/
+/*	$NetBSD: i915_cmd_parser.c,v 1.20 2019/12/05 20:25:54 maya Exp $	*/
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -28,10 +28,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.19 2019/12/05 20:03:09 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.20 2019/12/05 20:25:54 maya Exp $");
 
 #include "i915_drv.h"
 #include 
+#include 
 
 /**
  * DOC: batch buffer command parser
@@ -1259,7 +1260,7 @@ static void init_whitelist(struct intel_
 {
 	const u32 batch_cmds = DIV_ROUND_UP(batch_len, sizeof(u32));
 	const u32 exact_size = BITS_TO_LONGS(batch_cmds);
-	u32 next_size = BITS_TO_LONGS(powerof2(batch_cmds));
+	u32 next_size = BITS_TO_LONGS(roundup_pow_of_two(batch_cmds));
 	unsigned long *next_whitelist;
 
 	if (CMDPARSER_USES_GGTT(ctx->i915))



CVS commit: src/sys/external/bsd

2019-12-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec  5 20:03:09 UTC 2019

Modified Files:
src/sys/external/bsd/common/include/linux: bitops.h
src/sys/external/bsd/drm2/dist/drm/i915: i915_cmd_parser.c i915_dma.c
i915_drv.c i915_drv.h i915_gem_context.c i915_gem_execbuffer.c
i915_gem_gtt.c i915_gem_gtt.h i915_reg.h intel_display.c
intel_drv.h intel_pm.c intel_ringbuffer.c intel_ringbuffer.h

Log Message:
Add what appears to be the fixes to CVE-2019-0154, CVE-2019-0155.
This commit requires review, but I'd also like it to be tested by others
while it is being reviewed.

CVE-2019-0155:
It was discovered that the Intel i915 graphics chipsets allowed userspace
to modify page table entries via writes to MMIO from the Blitter Command
Streamer and expose kernel memory information. A local attacker could use
this to expose sensitive information or possibly elevate privileges.

CVE-2019-0154:
It was discovered that the Intel i915 graphics chipsets could cause
a system hang when userspace performed a read from GT memory mapped
input output (MMIO) when the product is in certain low power states.
A local attacker could use this to cause a denial of service.

>From upstream commits to linux-4.4.y:

---
>From 6d0cfddc7afc715835f0e17827106f832b14dd2a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Thu, 12 Jul 2018 19:53:10 +0100
Subject: [PATCH] drm/i915/gtt: Add read only pages to gen8_pte_encode

We can set a bit inside the ppGTT PTE to indicate a page is read-only;
writes from the GPU will be discarded. We can use this to protect pages
and in particular support read-only userptr mappings (necessary for
importing PROT_READ vma).
---
>From 774b68aa2105c70b40c3b1777feb7ab500d716dd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Mon, 6 Aug 2018 14:10:48 -0700
Subject: [PATCH] drm/i915/gtt: Read-only pages for insert_entries on bdw+

Hook up the flags to allow read-only ppGTT mappings for gen8+

v2: Include a selftest to check that writes to a readonly PTE are
dropped
v3: Don't duplicate cpu_check() as we can just reuse it, and even worse
don't wholesale copy the theory-of-operation comment from igt_ctx_exec
without changing it to explain the intention behind the new test!
v4: Joonas really likes magic mystery values
---
>From 3fd1c2e65c60c1c513155e1d1d74138b141aa8a3 Mon Sep 17 00:00:00 2001
From: Chris Wilson 
Date: Thu, 12 Jul 2018 19:53:12 +0100
Subject: [PATCH] drm/i915/gtt: Disable read-only support under GVT

GVT is not propagating the PTE bits, and is always setting the
read-write bit, thus breaking read-only support.
---
>From e5e3c0154c19f2d8213e0af88b7a10d9de7fbafd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Fri, 20 Apr 2018 14:26:01 -0700
Subject: [PATCH] drm/i915: Rename gen7 cmdparser tables

We're about to introduce some new tables for later gens, and the
current naming for the gen7 tables will no longer make sense.

v2: rebase
---
>From 3122671a5df3ee13f5cf22b7bdacf422b7b4319a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Fri, 8 Jun 2018 08:53:46 -0700
Subject: [PATCH] drm/i915: Disable Secure Batches for gen6+

Retroactively stop reporting support for secure batches
through the api for gen6+ so that older binaries trigger
the fallback path instead.

Older binaries use secure batches pre gen6 to access resources
that are not available to normal usermode processes. However,
all known userspace explicitly checks for HAS_SECURE_BATCHES
before relying on the secure batch feature.

Since there are no known binaries relying on this for newer gens
we can kill secure batches from gen6, via I915_PARAM_HAS_SECURE_BATCHES.

v2: rebase (Mika)
v3: rebase (Mika)
---
>From 544fd7d9d4cfe32357beab2f1dc543637d42e69f Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Fri, 8 Jun 2018 10:05:26 -0700
Subject: [PATCH] drm/i915: Remove Master tables from cmdparser

The previous patch has killed support for secure batches
on gen6+, and hence the cmdparsers master tables are
now dead code. Remove them.
---
>From 17e89f38212d8b3cba470efca91b997ac03c592c Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Wed, 1 Aug 2018 09:33:59 -0700
Subject: [PATCH] drm/i915: Add support for mandatory cmdparsing

The existing cmdparser for gen7 can be bypassed by specifying
batch_len=0 in the execbuf call. This is safe because bypassing
simply reduces the cmd-set available.

In a later patch we will introduce cmdparsing for gen9, as a
security measure, which must be strictly enforced since without
it we are vulnerable to DoS attacks.

Introduce the concept of 'required' cmd parsing that cannot be
bypassed by submitting zero-length bb's.

v2: rebase (Mika)
v2: rebase (Mika)
v3: fix conflict on engine flags (Mika)
---
>From 77524398bccea3592a25cbe92a9a54fa555013af Mon Sep 17 00:00:00 2001
From: Jon Bloomfield 
Date: Tue, 22 May 2018 

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

2019-12-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Dec  5 19:03:39 UTC 2019

Modified Files:
src/common/lib/libc/gen: radixtree.c

Log Message:
Fix warning that appears when compiling in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/common/lib/libc/gen/radixtree.c

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

Modified files:

Index: src/common/lib/libc/gen/radixtree.c
diff -u src/common/lib/libc/gen/radixtree.c:1.19 src/common/lib/libc/gen/radixtree.c:1.20
--- src/common/lib/libc/gen/radixtree.c:1.19	Thu Dec  5 18:50:41 2019
+++ src/common/lib/libc/gen/radixtree.c	Thu Dec  5 19:03:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $	*/
+/*	$NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $	*/
 
 /*-
  * Copyright (c)2011,2012,2013 YAMAMOTO Takashi,
@@ -112,7 +112,7 @@
 #include 
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $");
 #include 
 #include 
 #include 
@@ -122,7 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: radixtree.c,
 #include 
 #endif /* defined(_STANDALONE) */
 #else /* defined(_KERNEL) || defined(_STANDALONE) */
-__RCSID("$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $");
+__RCSID("$NetBSD: radixtree.c,v 1.20 2019/12/05 19:03:39 ad Exp $");
 #include 
 #include 
 #include 
@@ -851,7 +851,9 @@ scan_siblings:
 			}
 		}
 		if (i == guard) {
+#if 0
 no_siblings:
+#endif /* 0 */
 			/*
 			 * not found.  go to parent.
 			 */



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

2019-12-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Dec  5 18:50:41 UTC 2019

Modified Files:
src/common/lib/libc/gen: radixtree.c

Log Message:
Delete the counter from "struct radix_tree_node", and in the one place we
need a non-zero check, substitute with a deterministic bitwise OR of all
values in the node.  The structure then becomes cache line aligned.

For each node we now need only touch 2 cache lines instead of 3, which makes
all the operations faster (measured), amortises the cost of not having a
counter, and will avoid intra-pool-page false sharing on MP.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/common/lib/libc/gen/radixtree.c

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

Modified files:

Index: src/common/lib/libc/gen/radixtree.c
diff -u src/common/lib/libc/gen/radixtree.c:1.18 src/common/lib/libc/gen/radixtree.c:1.19
--- src/common/lib/libc/gen/radixtree.c:1.18	Thu Dec  5 18:32:25 2019
+++ src/common/lib/libc/gen/radixtree.c	Thu Dec  5 18:50:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radixtree.c,v 1.18 2019/12/05 18:32:25 ad Exp $	*/
+/*	$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $	*/
 
 /*-
  * Copyright (c)2011,2012,2013 YAMAMOTO Takashi,
@@ -112,7 +112,7 @@
 #include 
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.18 2019/12/05 18:32:25 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $");
 #include 
 #include 
 #include 
@@ -122,7 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: radixtree.c,
 #include 
 #endif /* defined(_STANDALONE) */
 #else /* defined(_KERNEL) || defined(_STANDALONE) */
-__RCSID("$NetBSD: radixtree.c,v 1.18 2019/12/05 18:32:25 ad Exp $");
+__RCSID("$NetBSD: radixtree.c,v 1.19 2019/12/05 18:50:41 ad Exp $");
 #include 
 #include 
 #include 
@@ -185,11 +185,16 @@ entry_match_p(void *p, unsigned int tagm
  * radix_tree_node: an intermediate node
  *
  * we don't care the type of leaf nodes.  they are just void *.
+ *
+ * we used to maintain a count of non-NULL nodes in this structure, but it
+ * prevented it from being aligned to a cache line boundary; the performance
+ * benefit from being cache friendly is greater than the benefit of having
+ * a dedicated count value, especially in multi-processor situations where
+ * we need to avoid intra-pool-page false sharing.
  */
 
 struct radix_tree_node {
 	void *n_ptrs[RADIX_TREE_PTR_PER_NODE];
-	unsigned int n_nptrs;	/* # of non-NULL pointers in n_ptrs */
 };
 
 /*
@@ -340,8 +345,8 @@ radix_tree_init(void)
 {
 
 	radix_tree_node_cache = pool_cache_init(sizeof(struct radix_tree_node),
-	0, 0, 0, "radix_tree_node", NULL, IPL_NONE, radix_tree_node_ctor,
-	NULL, NULL);
+	coherency_unit, 0, 0, "radixnode", NULL, IPL_NONE,
+	radix_tree_node_ctor, NULL, NULL);
 	KASSERT(radix_tree_node_cache != NULL);
 }
 #endif /* defined(_KERNEL) */
@@ -349,17 +354,57 @@ radix_tree_init(void)
 static bool __unused
 radix_tree_node_clean_p(const struct radix_tree_node *n)
 {
+#if RADIX_TREE_PTR_PER_NODE > 16
 	unsigned int i;
 
-	if (n->n_nptrs != 0) {
-		return false;
-	}
 	for (i = 0; i < RADIX_TREE_PTR_PER_NODE; i++) {
 		if (n->n_ptrs[i] != NULL) {
 			return false;
 		}
 	}
 	return true;
+#else /* RADIX_TREE_PTR_PER_NODE > 16 */
+	uintptr_t sum;
+
+	/*
+	 * Unrolling the above is much better than a tight loop with two
+	 * test+branch pairs.  On x86 with gcc 5.5.0 this compiles into 19
+	 * deterministic instructions including the "return" and prologue &
+	 * epilogue.
+	 */
+	sum = (uintptr_t)n->n_ptrs[0];
+	sum |= (uintptr_t)n->n_ptrs[1];
+	sum |= (uintptr_t)n->n_ptrs[2];
+	sum |= (uintptr_t)n->n_ptrs[3];
+#if RADIX_TREE_PTR_PER_NODE > 4
+	sum |= (uintptr_t)n->n_ptrs[4];
+	sum |= (uintptr_t)n->n_ptrs[5];
+	sum |= (uintptr_t)n->n_ptrs[6];
+	sum |= (uintptr_t)n->n_ptrs[7];
+#endif
+#if RADIX_TREE_PTR_PER_NODE > 8
+	sum |= (uintptr_t)n->n_ptrs[8];
+	sum |= (uintptr_t)n->n_ptrs[9];
+	sum |= (uintptr_t)n->n_ptrs[10];
+	sum |= (uintptr_t)n->n_ptrs[11];
+	sum |= (uintptr_t)n->n_ptrs[12];
+	sum |= (uintptr_t)n->n_ptrs[13];
+	sum |= (uintptr_t)n->n_ptrs[14];
+	sum |= (uintptr_t)n->n_ptrs[15];
+#endif
+	return sum == 0;
+#endif /* RADIX_TREE_PTR_PER_NODE > 16 */
+}
+
+static int __unused
+radix_tree_node_count_ptrs(const struct radix_tree_node *n)
+{
+	unsigned int i, c;
+
+	for (i = c = 0; i < RADIX_TREE_PTR_PER_NODE; i++) {
+		c += (n->n_ptrs[i] != NULL);
+	}
+	return c;
 }
 
 static struct radix_tree_node *
@@ -421,7 +466,6 @@ radix_tree_grow(struct radix_tree *t, un
 			 */
 			return ENOMEM;
 		}
-		n->n_nptrs = 1;
 		n->n_ptrs[0] = t->t_root;
 		t->t_root = entry_compose(n, tagmask);
 		t->t_height++;
@@ -516,10 +560,6 @@ radix_tree_lookup_ptr(struct radix_tree 
 return NULL;
 			}
 			*vpp = c;
-			if (n != NULL) {
-KASSERT(n->n_nptrs < RADIX_TREE_PTR_PER_NODE);
-n->n_nptrs++;
-			}
 		}
 		n = c;
 		vpp = >n_ptrs[i];
@@ -531,10 

CVS commit: src

2019-12-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Dec  5 18:32:25 UTC 2019

Modified Files:
src/common/lib/libc/gen: radixtree.c
src/sys/sys: radixtree.h

Log Message:
Merge radixtree changes from yamt-pagecache.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/common/lib/libc/gen/radixtree.c
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/radixtree.h

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

Modified files:

Index: src/common/lib/libc/gen/radixtree.c
diff -u src/common/lib/libc/gen/radixtree.c:1.17 src/common/lib/libc/gen/radixtree.c:1.18
--- src/common/lib/libc/gen/radixtree.c:1.17	Wed Nov  2 13:49:43 2011
+++ src/common/lib/libc/gen/radixtree.c	Thu Dec  5 18:32:25 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: radixtree.c,v 1.17 2011/11/02 13:49:43 yamt Exp $	*/
+/*	$NetBSD: radixtree.c,v 1.18 2019/12/05 18:32:25 ad Exp $	*/
 
 /*-
- * Copyright (c)2011 YAMAMOTO Takashi,
+ * Copyright (c)2011,2012,2013 YAMAMOTO Takashi,
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,46 +29,90 @@
 /*
  * radixtree.c
  *
- * this is an implementation of radix tree, whose keys are uint64_t and leafs
+ * Overview:
+ *
+ * This is an implementation of radix tree, whose keys are uint64_t and leafs
  * are user provided pointers.
  *
- * leaf nodes are just void * and this implementation doesn't care about
- * what they actually point to.  however, this implementation has an assumption
- * about their alignment.  specifically, this implementation assumes that their
- * 2 LSBs are zero and uses them internally.
- *
- * intermediate nodes are automatically allocated and freed internally and
- * basically users don't need to care about them.  only radix_tree_insert_node
- * function can allocate memory for intermediate nodes and thus can fail for
- * ENOMEM.
- *
- * efficiency:
- * it's designed to work efficiently with dense index distribution.
- * the memory consumption (number of necessary intermediate nodes)
- * heavily depends on index distribution.  basically, more dense index
- * distribution consumes less nodes per item.
- * approximately,
- * the best case: about RADIX_TREE_PTR_PER_NODE items per intermediate node.
- * the worst case: RADIX_TREE_MAX_HEIGHT intermediate nodes per item.
+ * Leaf nodes are just void * and this implementation doesn't care about
+ * what they actually point to.  However, this implementation has an assumption
+ * about their alignment.  Specifically, this implementation assumes that their
+ * 2 LSBs are always zero and uses them for internal accounting.
+ *
+ * Intermediate nodes and memory allocation:
+ *
+ * Intermediate nodes are automatically allocated and freed internally and
+ * basically users don't need to care about them.  The allocation is done via
+ * pool_cache_get(9) for _KERNEL, malloc(3) for userland, and alloc() for
+ * _STANDALONE environment.  Only radix_tree_insert_node function can allocate
+ * memory for intermediate nodes and thus can fail for ENOMEM.
+ *
+ * Memory Efficiency:
+ *
+ * It's designed to work efficiently with dense index distribution.
+ * The memory consumption (number of necessary intermediate nodes) heavily
+ * depends on the index distribution.  Basically, more dense index distribution
+ * consumes less nodes per item.  Approximately,
+ *
+ *  - the best case: about RADIX_TREE_PTR_PER_NODE items per intermediate node.
+ *it would look like the following.
+ *
+ * root (t_height=1)
+ *  |
+ *  v
+ *  [ | | | ]   (intermediate node.  RADIX_TREE_PTR_PER_NODE=4 in this fig)
+ *   | | | |
+ *   v v v v
+ *   p p p p(items)
+ *
+ *  - the worst case: RADIX_TREE_MAX_HEIGHT intermediate nodes per item.
+ *it would look like the following if RADIX_TREE_MAX_HEIGHT=3.
+ *
+ * root (t_height=3)
+ *  |
+ *  v
+ *  [ | | | ]
+ *   |
+ *   v
+ *   [ | | | ]
+ *|
+ *v
+ *[ | | | ]
+ *   |
+ *   v
+ *   p
+ *
+ * The height of tree (t_height) is dynamic.  It's smaller if only small
+ * index values are used.  As an extreme case, if only index 0 is used,
+ * the corresponding value is directly stored in the root of the tree
+ * (struct radix_tree) without allocating any intermediate nodes.  In that
+ * case, t_height=0.
+ *
+ * Gang lookup:
  *
- * gang lookup:
- * this implementation provides a way to lookup many nodes quickly via
+ * This implementation provides a way to scan many nodes quickly via
  * radix_tree_gang_lookup_node function and its varients.
  *
- * tags:
- * this implementation provides tagging functionality to allow quick
- * scanning of a subset of leaf nodes.  leaf nodes are untagged when
- * inserted into the tree and can be tagged by radix_tree_set_tag function.
- * radix_tree_gang_lookup_tagged_node function and its variants 

CVS commit: src/crypto/external/bsd/openssl/dist/crypto/engine

2019-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  5 17:52:06 UTC 2019

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/engine: eng_devcrypto.c

Log Message:
PR/54740: Izumi Tsutsui: Disable cryptoengine unavailable message when
device is not configured (ENXIO).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.4 src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.5
--- src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.4	Tue Mar 12 12:58:13 2019
+++ src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c	Thu Dec  5 12:52:06 2019
@@ -761,7 +761,7 @@ void engine_load_devcrypto_int()
 
 if ((cfd = open("/dev/crypto", O_RDWR, 0)) < 0) {
 #ifndef ENGINE_DEVCRYPTO_DEBUG
-if (errno != ENOENT)
+if (errno != ENOENT && errno != ENXIO)
 #endif
 fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
 return;



CVS commit: xsrc/external/mit/MesaLib/dist/src

2019-12-05 Thread Maya Rashish
Module Name:xsrc
Committed By:   maya
Date:   Thu Dec  5 17:41:10 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/intel/dev: gen_device_info.c
xsrc/external/mit/MesaLib/dist/src/loader: loader.c
xsrc/external/mit/MesaLib/dist/src/mesa/main: context.c
xsrc/external/mit/MesaLib/dist/src/util: disk_cache.c

Log Message:
Wherever we test for setuid, also test for setgid.

Inspired by a diff to openbsd but with a few more instances.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/loader/loader.c
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c

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

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c
diff -u xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c:1.4 xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c:1.5
--- xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c:1.4	Tue Sep 24 19:26:45 2019
+++ xsrc/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c	Thu Dec  5 17:41:10 2019
@@ -83,7 +83,7 @@ gen_device_name_to_pci_device_id(const c
 int
 gen_get_pci_device_id_override(void)
 {
-   if (geteuid() == getuid()) {
+   if (!issetugid()) {
   const char *devid_override = getenv("INTEL_DEVID_OVERRIDE");
   if (devid_override) {
  const int id = gen_device_name_to_pci_device_id(devid_override);

Index: xsrc/external/mit/MesaLib/dist/src/loader/loader.c
diff -u xsrc/external/mit/MesaLib/dist/src/loader/loader.c:1.1.1.3 xsrc/external/mit/MesaLib/dist/src/loader/loader.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/loader/loader.c:1.1.1.3	Tue Sep 24 17:55:48 2019
+++ xsrc/external/mit/MesaLib/dist/src/loader/loader.c	Thu Dec  5 17:41:10 2019
@@ -445,7 +445,7 @@ loader_get_driver_for_fd(int fd)
 * user's problem, but this allows vc4 simulator to run on an i965 host,
 * and may be useful for some touch testing of i915 on an i965 host.
 */
-   if (geteuid() == getuid()) {
+   if (!issetugid()) {
   driver = getenv("MESA_LOADER_DRIVER_OVERRIDE");
   if (driver)
  return strdup(driver);
@@ -533,7 +533,7 @@ loader_open_driver(const char *driver_na
const struct __DRIextensionRec **(*get_extensions)(void);
 
search_paths = NULL;
-   if (geteuid() == getuid() && search_path_vars) {
+   if (!issetugid() && search_path_vars) {
   for (int i = 0; search_path_vars[i] != NULL; i++) {
  search_paths = getenv(search_path_vars[i]);
  if (search_paths)

Index: xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.7 xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.8
--- xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c:1.7	Tue Sep 24 19:26:50 2019
+++ xsrc/external/mit/MesaLib/dist/src/mesa/main/context.c	Thu Dec  5 17:41:10 2019
@@ -1240,7 +1240,7 @@ _mesa_initialize_context(struct gl_conte
 */
if (env_var_as_boolean("MESA_NO_ERROR", false)) {
 #if !defined(_WIN32)
-  if (geteuid() == getuid())
+  if (!issetugid())
 #endif
  ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
}

Index: xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c
diff -u xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c:1.3 xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c:1.4
--- xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c:1.3	Tue Sep 24 19:26:51 2019
+++ xsrc/external/mit/MesaLib/dist/src/util/disk_cache.c	Thu Dec  5 17:41:10 2019
@@ -212,7 +212,7 @@ disk_cache_create(const char *gpu_name, 
size_t cv_size = sizeof(cache_version);
 
/* If running as a users other than the real user disable cache */
-   if (geteuid() != getuid())
+   if (issetugid())
   return NULL;
 
/* A ralloc context for transient data during this invocation. */



CVS commit: [netbsd-8] src/doc

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 17:00:36 UTC 2019

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

Log Message:
tickets 1462-1468


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

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.74 src/doc/CHANGES-8.2:1.1.2.75
--- src/doc/CHANGES-8.2:1.1.2.74	Tue Nov 26 09:00:55 2019
+++ src/doc/CHANGES-8.2	Thu Dec  5 17:00:36 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.74 2019/11/26 09:00:55 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.75 2019/12/05 17:00:36 bouyer Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1723,3 +1723,55 @@ share/tmac/doc2html1.68
 	the .Lk macro.
 	[kre, ticket #1461]
 
+sys/dev/pci/if_bge.c1.336, 1.340, 1.341
+
+	- Avoid undefined behavior in bge_setmulti().
+	- Avoid undefined behavior when setting the MAC address in
+	  bge_init(). 
+	- Fix a bug that SK-9D41 can't detect fiber media.
+	- Use *_FLUSH() more. The main purpose is to wait following
+	  delay() correctly.
+	- Add missing DELAY(80) after writing BGE_MI_MODE register.
+	[msaitoh, ticket #1462]
+
+sys/dev/pci/if_age.c1.61, 1.63-1.64 
+	- Fix direction of the loop in age_get_macaddr().
+	- Fix multicast handling. All Atheros controllers use big-endian form
+	  when computing multicast hash.
+	- Fix a bug that IFF_ALLMULTI is almost always set.
+	[msaitoh, ticket #1463]
+
+sys/dev/pci/if_alc.c1.44 via patch
+sys/dev/pci/if_ale.c1.35-1.36 via patch
+sys/dev/pci/if_cas.c1.36 via patch
+	- Fix a bug that IFF_ALLMULTI is almost always set.
+	- Whitespace fixes.
+	[msaitoh, ticket #1464]
+
+sys/arch/powerpc/oea/ofw_autoconf.c		1.24
+
+	Add a hack for qemu/macppc. OF_finddevice calls will crash depending on
+	the boot loader and kernel being used. This patch allows using
+	-prom-env qemu_boot_hack=y to disable the lookup.
+	[joerg, ticket #1465]
+
+sys/arch/x86/include/genfb_machdep.h		1.4
+sys/arch/x86/x86/genfb_machdep.c		1.15
+sys/arch/x86/x86/hyperv.c			1.5
+
+	Prevent panic when attaching genfb if using a serial console
+	with Hyper-V Gen.2.
+	[nonaka, ticket #1466]
+
+share/man/man4/rnd.41.25 - 1.28
+
+	Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
+	Update NIST SP800-90A reference.
+	[riastradh, ticket #1467]
+
+sys/external/bsd/dwc2/dwc2.c			1.60 - 1.66
+	Make dwc2debug sysctl'able
+	Calulate the right lenght for isoc transfer and the usb_syncmem
+	PR/54696: Kernel panic in bus_dma.c on Raspberry Pi 3B/3B+
+	[skrll, ticket #1468]
+



CVS commit: src/sys/dev/dm

2019-12-05 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec  5 16:59:43 UTC 2019

Modified Files:
src/sys/dev/dm: dm_table.c dm_target_error.c dm_target_linear.c
dm_target_mirror.c dm_target_snapshot.c dm_target_stripe.c
dm_target_zero.c

Log Message:
dm: Make dm core set config to NULL after destroy

Just let dm core do this instead of having a comment expecting each
target to do the right thing.

taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/dm/dm_table.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/dm/dm_target_error.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/dm/dm_target_linear.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/dm/dm_target_mirror.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/dm/dm_target_snapshot.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/dm/dm_target_stripe.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/dm/dm_target_zero.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/dm/dm_table.c
diff -u src/sys/dev/dm/dm_table.c:1.9 src/sys/dev/dm/dm_table.c:1.10
--- src/sys/dev/dm/dm_table.c:1.9	Wed Dec  4 15:31:12 2019
+++ src/sys/dev/dm/dm_table.c	Thu Dec  5 16:59:43 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_table.c,v 1.9 2019/12/04 15:31:12 tkusumi Exp $  */
+/*$NetBSD: dm_table.c,v 1.10 2019/12/05 16:59:43 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.9 2019/12/04 15:31:12 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.10 2019/12/05 16:59:43 tkusumi Exp $");
 
 #include 
 #include 
@@ -162,11 +162,8 @@ dm_table_destroy(dm_table_head_t * head,
 
 	while (!SLIST_EMPTY(tbl)) {	/* List Deletion. */
 		table_en = SLIST_FIRST(tbl);
-		/*
-		 * Remove target specific config data. After successfull
-		 * call table_en->target_config must be set to NULL.
-		 */
-		table_en->target->destroy(table_en);
+		if (table_en->target->destroy(table_en) == 0)
+			table_en->target_config = NULL;
 
 		SLIST_REMOVE_HEAD(tbl, next);
 

Index: src/sys/dev/dm/dm_target_error.c
diff -u src/sys/dev/dm/dm_target_error.c:1.13 src/sys/dev/dm/dm_target_error.c:1.14
--- src/sys/dev/dm/dm_target_error.c:1.13	Sun Dec  1 06:53:31 2019
+++ src/sys/dev/dm/dm_target_error.c	Thu Dec  5 16:59:43 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_error.c,v 1.13 2019/12/01 06:53:31 tkusumi Exp $  */
+/*$NetBSD: dm_target_error.c,v 1.14 2019/12/05 16:59:43 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target_error.c,v 1.13 2019/12/01 06:53:31 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_error.c,v 1.14 2019/12/05 16:59:43 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper error target.
@@ -155,8 +155,6 @@ dm_target_error_sync(dm_table_entry_t * 
 int
 dm_target_error_destroy(dm_table_entry_t * table_en)
 {
-	table_en->target_config = NULL;
-
 	/* Unbusy target so we can unload it */
 	dm_target_unbusy(table_en->target);
 

Index: src/sys/dev/dm/dm_target_linear.c
diff -u src/sys/dev/dm/dm_target_linear.c:1.21 src/sys/dev/dm/dm_target_linear.c:1.22
--- src/sys/dev/dm/dm_target_linear.c:1.21	Tue Dec  3 15:47:38 2019
+++ src/sys/dev/dm/dm_target_linear.c	Thu Dec  5 16:59:43 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_linear.c,v 1.21 2019/12/03 15:47:38 tkusumi Exp $  */
+/*$NetBSD: dm_target_linear.c,v 1.22 2019/12/05 16:59:43 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.21 2019/12/03 15:47:38 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.22 2019/12/05 16:59:43 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper dklinear target.
@@ -166,7 +166,6 @@ dm_target_linear_destroy(dm_table_entry_
 		goto out;
 
 	dm_target_linear_config_t *tlc = table_en->target_config;
-	table_en->target_config = NULL;
 
 	/* Decrement pdev ref counter if 0 remove it */
 	dm_pdev_decr(tlc->pdev);

Index: src/sys/dev/dm/dm_target_mirror.c
diff -u src/sys/dev/dm/dm_target_mirror.c:1.11 src/sys/dev/dm/dm_target_mirror.c:1.12
--- src/sys/dev/dm/dm_target_mirror.c:1.11	Sun Dec  1 06:53:31 2019
+++ src/sys/dev/dm/dm_target_mirror.c	Thu Dec  5 16:59:43 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_mirror.c,v 1.11 2019/12/01 06:53:31 tkusumi Exp $*/
+/*$NetBSD: dm_target_mirror.c,v 1.12 2019/12/05 16:59:43 tkusumi Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target_mirror.c,v 1.11 2019/12/01 06:53:31 tkusumi Exp $");

CVS commit: [netbsd-8] src/sys/external/bsd/dwc2

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:59:35 UTC 2019

Modified Files:
src/sys/external/bsd/dwc2 [netbsd-8]: dwc2.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1468):
sys/external/bsd/dwc2/dwc2.c: revision 1.60
sys/external/bsd/dwc2/dwc2.c: revision 1.61
sys/external/bsd/dwc2/dwc2.c: revision 1.62
sys/external/bsd/dwc2/dwc2.c: revision 1.63
sys/external/bsd/dwc2/dwc2.c: revision 1.64
sys/external/bsd/dwc2/dwc2.c: revision 1.65
sys/external/bsd/dwc2/dwc2.c: revision 1.66
KNF
Make dwc2debug sysctl'able
Need  for previous
Use size_t for loop count variable
Calulate the right lenght for isoc transfer and the usb_syncmem
PR/54696: Kernel panic in bus_dma.c on Raspberry Pi 3B/3B+
build fix
Consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.46.2.3 -r1.46.2.4 src/sys/external/bsd/dwc2/dwc2.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.46.2.3 src/sys/external/bsd/dwc2/dwc2.c:1.46.2.4
--- src/sys/external/bsd/dwc2/dwc2.c:1.46.2.3	Thu Sep 27 14:52:26 2018
+++ src/sys/external/bsd/dwc2/dwc2.c	Thu Dec  5 16:59:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.46.2.3 2018/09/27 14:52:26 martin Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.46.2.4 2019/12/05 16:59:35 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,19 +30,21 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.46.2.3 2018/09/27 14:52:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.46.2.4 2019/12/05 16:59:35 bouyer Exp $");
 
 #include "opt_usb.h"
 
 #include 
-#include 
-#include 
-#include 
+
+#include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -74,6 +76,33 @@ __KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.4
 } while (0)
 #define	DPRINTF(...)	DPRINTFN(1, __VA_ARGS__)
 int dwc2debug = 0;
+
+SYSCTL_SETUP(sysctl_hw_dwc2_setup, "sysctl hw.dwc2 setup")
+{
+	int err;
+	const struct sysctlnode *rnode;
+	const struct sysctlnode *cnode;
+
+	err = sysctl_createv(clog, 0, NULL, ,
+	CTLFLAG_PERMANENT, CTLTYPE_NODE, "dwc2",
+	SYSCTL_DESCR("dwc2 global controls"),
+	NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL);
+
+	if (err)
+		goto fail;
+
+	/* control debugging printfs */
+	err = sysctl_createv(clog, 0, , ,
+	CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT,
+	"debug", SYSCTL_DESCR("Enable debugging output"),
+	NULL, 0, , sizeof(dwc2debug), CTL_CREATE, CTL_EOL);
+	if (err)
+		goto fail;
+
+	return;
+fail:
+	aprint_error("%s: sysctl_createv failed (err = %d)\n", __func__, err);
+}
 #else
 #define	DPRINTF(...) do { } while (0)
 #define	DPRINTFN(...) do { } while (0)
@@ -953,7 +982,6 @@ dwc2_device_start(struct usbd_xfer *xfer
 	uint32_t off = 0;
 	int retval, err;
 	int alloc_bandwidth = 0;
-	int i;
 
 	DPRINTFN(1, "xfer=%p pipe=%p\n", xfer, xfer->ux_pipe);
 
@@ -993,6 +1021,14 @@ dwc2_device_start(struct usbd_xfer *xfer
 		DPRINTFN(3, "req = %p dma = %" PRIxBUSADDR " len %d dir %s\n",
 		KERNADDR(>req_dma, 0), DMAADDR(>req_dma, 0),
 		len, dir == UE_DIR_IN ? "in" : "out");
+	} else if (xfertype == UE_ISOCHRONOUS) {
+		DPRINTFN(3, "xfer=%p nframes=%d flags=%d addr=%d endpt=%d,"
+		" mps=%d dir %s\n", xfer, xfer->ux_nframes, xfer->ux_flags, addr,
+		epnum, mps, dir == UT_READ ? "in" :"out");
+
+		len = 0;
+		for (size_t i = 0; i < xfer->ux_nframes; i++)
+			len += xfer->ux_frlengths[i];
 	} else {
 		DPRINTFN(3, "xfer=%p len=%d flags=%d addr=%d endpt=%d,"
 		" mps=%d dir %s\n", xfer, xfer->ux_length, xfer->ux_flags, addr,
@@ -1086,8 +1122,9 @@ dwc2_device_start(struct usbd_xfer *xfer
 	KASSERTMSG(xfer->ux_nframes == 0 || xfertype == UE_ISOCHRONOUS,
 	"nframes %d xfertype %d\n", xfer->ux_nframes, xfertype);
 
-	for (off = i = 0; i < xfer->ux_nframes; ++i) {
-		DPRINTFN(3, "xfer=%p frame=%d offset=%d length=%d\n", xfer, i,
+	off = 0;
+	for (size_t i = 0; i < xfer->ux_nframes; ++i) {
+		DPRINTFN(3, "xfer=%p frame=%zd offset=%d length=%d\n", xfer, i,
 		off, xfer->ux_frlengths[i]);
 
 		dwc2_hcd_urb_set_iso_desc_params(dwc2_urb, i, off,
@@ -1467,22 +1504,21 @@ void dwc2_host_complete(struct dwc2_hsot
 	DPRINTFN(3, "xfer=%p actlen=%d\n", xfer, xfer->ux_actlen);
 
 	if (xfertype == UE_ISOCHRONOUS) {
-		int i;
-
 		xfer->ux_actlen = 0;
-		for (i = 0; i < xfer->ux_nframes; ++i) {
+		for (size_t i = 0; i < xfer->ux_nframes; ++i) {
 			xfer->ux_frlengths[i] =
 dwc2_hcd_urb_get_iso_desc_actual_length(
 		urb, i);
+			DPRINTFN(1, "xfer=%p frame=%zu length=%d\n", xfer, i,
+			xfer->ux_frlengths[i]);
 			xfer->ux_actlen += xfer->ux_frlengths[i];
 		}
+		DPRINTFN(1, "xfer=%p actlen=%d (isoc)\n", xfer, xfer->ux_actlen);
 	}
 
 	if (xfertype == UE_ISOCHRONOUS && dbg_perio()) {
-		int i;
-
-		for (i = 

CVS commit: [netbsd-8] src/share/man/man4

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:57:11 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-8]: rnd.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1467):
share/man/man4/rnd.4: revision 1.26
share/man/man4/rnd.4: revision 1.27
share/man/man4/rnd.4: revision 1.28
share/man/man4/rnd.4: revision 1.25
Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)
Update NIST SP800-90A reference.
New sentence, new line. Use \(em.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.4.1 src/share/man/man4/rnd.4

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.24 src/share/man/man4/rnd.4:1.24.4.1
--- src/share/man/man4/rnd.4:1.24	Wed Jan 18 22:38:00 2017
+++ src/share/man/man4/rnd.4	Thu Dec  5 16:57:11 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.24 2017/01/18 22:38:00 abhinav Exp $
+.\"	$NetBSD: rnd.4,v 1.24.4.1 2019/12/05 16:57:11 bouyer Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 16, 2014
+.Dd September 3, 2019
 .Dt RND 4
 .Os
 .Sh NAME
@@ -187,8 +187,8 @@ quantum computers.
 Systems with nonvolatile storage should store a secret from
 .Pa /dev/urandom
 on disk during installation or shutdown, and feed it back during boot,
-so that the work the operating system has done to gather entropy --
-including the work its operator may have done to flip a coin! -- can be
+so that the work the operating system has done to gather entropy \(em
+including the work its operator may have done to flip a coin! \(em can be
 saved from one boot to the next, and so that newly installed systems
 are not vulnerable to generating cryptographic keys predictably.
 .Pp
@@ -205,7 +205,7 @@ in
 which is enabled by default; see
 .Xr rc.conf 5 .
 .Sh LIMITATIONS
-Some people worry about recovery from state compromise -- that is,
+Some people worry about recovery from state compromise \(em that is,
 ensuring that even if an attacker sees the entire state of the
 operating system, then the attacker will be unable to predict any new
 future outputs as long as the operating system gathers fresh entropy
@@ -404,9 +404,9 @@ When a user process opens
 or
 .Pa /dev/urandom
 and first reads from it, the kernel draws from the entropy pool to seed
-a cryptographic pseudorandom number generator, the NIST CTR_DRBG
-(counter-mode deterministic random bit generator) with AES-128 as the
-block cipher, and uses that to generate data.
+a cryptographic pseudorandom number generator, the NIST Hash_DRBG
+(hash-based deterministic random bit generator) with SHA-256 as the
+hash function, and uses that to generate data.
 .Pp
 To draw a seed from the entropy pool, the kernel
 .Bl -bullet -offset abcd -compact
@@ -489,10 +489,10 @@ Never blocks.
 .%A Elaine Barker
 .%A John Kelsey
 .%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
-.%D January 2012
+.%D June 2015
 .%I National Institute of Standards and Technology
-.%O NIST Special Publication 800-90A
-.%U http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf
+.%O NIST Special Publication 800-90A, Revision 1
+.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
 .Re
 .Rs
 .%A Daniel J. Bernstein
@@ -551,59 +551,33 @@ Unfortunately, no amount of software eng
 .Sh ENTROPY ACCOUNTING
 The entropy accounting described here is not grounded in any
 cryptography theory.
-It is done because it was always done, and because it gives people a
-warm fuzzy feeling about information theory.
+.Sq Entropy estimation
+doesn't mean much: the kernel hypothesizes an extremely simple-minded
+parametric model for all entropy sources which bears little relation to
+any physical processes, implicitly fits parameters from data, and
+accounts for the entropy of the fitted model.
 .Pp
-The folklore is that every
-.Fa n Ns -bit
-output of
-.Fa /dev/random
-is not merely indistinguishable from uniform random to a
-computationally bounded attacker, but information-theoretically is
-independent and has
-.Fa n
-bits of entropy even to a computationally
-.Em unbounded
-attacker -- that is, an attacker who can recover AES keys, compute
-SHA-1 preimages, etc.
-This property is not provided, nor was it ever provided in any
-implementation of
-.Fa /dev/random
-known to the author.
-.Pp
-This property would require that, after each read, the system discard
-all measurements from hardware in the entropy pool and begin anew.
-All work done to make the system unpredictable would be 

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

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:54:59 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-8]: genfb_machdep.h
src/sys/arch/x86/x86 [netbsd-8]: genfb_machdep.c hyperv.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1466):
sys/arch/x86/x86/hyperv.c: revision 1.5
sys/arch/x86/include/genfb_machdep.h: revision 1.4
sys/arch/x86/x86/genfb_machdep.c: revision 1.15
Prevent panic when attaching genfb if using a serial console with Hyper-V Gen.2.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.48.1 src/sys/arch/x86/include/genfb_machdep.h
cvs rdiff -u -r1.12 -r1.12.6.1 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/x86/x86/hyperv.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/include/genfb_machdep.h
diff -u src/sys/arch/x86/include/genfb_machdep.h:1.3 src/sys/arch/x86/include/genfb_machdep.h:1.3.48.1
--- src/sys/arch/x86/include/genfb_machdep.h:1.3	Wed Feb  9 13:24:23 2011
+++ src/sys/arch/x86/include/genfb_machdep.h	Thu Dec  5 16:54:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.h,v 1.3 2011/02/09 13:24:23 jmcneill Exp $ */
+/* $NetBSD: genfb_machdep.h,v 1.3.48.1 2019/12/05 16:54:59 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -29,6 +29,7 @@
 #ifndef _X86_GENFB_MACHDEP_H
 #define _X86_GENFB_MACHDEP_H
 
+int	x86_genfb_init(void);
 int	x86_genfb_cnattach(void);
 void	x86_genfb_mtrr_init(uint64_t, uint32_t);
 void	x86_genfb_set_console_dev(device_t);

Index: src/sys/arch/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.12 src/sys/arch/x86/x86/genfb_machdep.c:1.12.6.1
--- src/sys/arch/x86/x86/genfb_machdep.c:1.12	Sat Feb 25 01:13:50 2017
+++ src/sys/arch/x86/x86/genfb_machdep.c	Thu Dec  5 16:54:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.12.6.1 2019/12/05 16:54:59 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.12.6.1 2019/12/05 16:54:59 bouyer Exp $");
 
 #include "opt_mtrr.h"
 
@@ -136,23 +136,19 @@ x86_genfb_mtrr_init(uint64_t physaddr, u
 }
 
 int
-x86_genfb_cnattach(void)
+x86_genfb_init(void)
 {
-	static int ncalls = 0;
+	static int inited, attached;
 	struct rasops_info *ri = _genfb_console_screen.scr_ri;
 	const struct btinfo_framebuffer *fbinfo;
 	bus_space_tag_t t = x86_bus_space_mem;
 	bus_space_handle_t h;
 	void *bits;
-	long defattr;
 	int err;
 
-	/* XXX jmcneill
-	 *  Defer console initialization until UVM is initialized
-	 */
-	++ncalls;
-	if (ncalls < 3)
-		return -1;
+	if (inited)
+		return attached;
+	inited = 1;
 
 	memset(_genfb_console_screen, 0, sizeof(x86_genfb_console_screen));
 
@@ -206,6 +202,27 @@ x86_genfb_cnattach(void)
 	x86_genfb_stdscreen.textops = >ri_ops;
 	x86_genfb_stdscreen.capabilities = ri->ri_caps;
 
+	attached = 1;
+	return 1;
+}
+
+int
+x86_genfb_cnattach(void)
+{
+	static int ncalls = 0;
+	struct rasops_info *ri = _genfb_console_screen.scr_ri;
+	long defattr;
+
+	/* XXX jmcneill
+	 *  Defer console initialization until UVM is initialized
+	 */
+	++ncalls;
+	if (ncalls < 3)
+		return -1;
+
+	if (!x86_genfb_init())
+		return 0;
+
 	ri->ri_ops.allocattr(ri, 0, 0, 0, );
 	wsdisplay_preattach(_genfb_stdscreen, ri, 0, 0, defattr);
 
@@ -213,6 +230,12 @@ x86_genfb_cnattach(void)
 }
 #else	/* NWSDISPLAY > 0 && NGENFB > 0 */
 int
+x86_genfb_init(void)
+{
+	return 0;
+}
+
+int
 x86_genfb_cnattach(void)
 {
 	return 0;

Index: src/sys/arch/x86/x86/hyperv.c
diff -u src/sys/arch/x86/x86/hyperv.c:1.1.2.3 src/sys/arch/x86/x86/hyperv.c:1.1.2.4
--- src/sys/arch/x86/x86/hyperv.c:1.1.2.3	Wed Jun 12 10:17:32 2019
+++ src/sys/arch/x86/x86/hyperv.c	Thu Dec  5 16:54:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperv.c,v 1.1.2.3 2019/06/12 10:17:32 martin Exp $	*/
+/*	$NetBSD: hyperv.c,v 1.1.2.4 2019/12/05 16:54:59 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012,2016-2017 Microsoft Corp.
@@ -33,7 +33,7 @@
  */
 #include 
 #ifdef __KERNEL_RCSID
-__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.1.2.3 2019/06/12 10:17:32 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.1.2.4 2019/12/05 16:54:59 bouyer Exp $");
 #endif
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/sys/dev/hyperv/vmbus/hyperv.c 331757 2018-03-30 02:25:12Z emaste $");
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD: head/sys/dev/hyperv/
 #include 
 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -1103,6 +1103,9 @@ device_hyperv_register(device_t dev, voi
 		sizeof(*aa->aa_type)) == 0) {
 			prop_dictionary_t dict = device_properties(dev);
 
+			/* Initialize genfb for serial console */
+			x86_genfb_init();
+
 			/*
 			 * framebuffer drivers other 

CVS commit: [netbsd-8] src/sys/arch/powerpc/oea

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:53:06 UTC 2019

Modified Files:
src/sys/arch/powerpc/oea [netbsd-8]: ofw_autoconf.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #1465):
sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.24
Add a hack for qemu/macppc. OF_finddevice calls will crash depending on
the boot loader and kernel being used. This patch allows using
-prom-env qemu_boot_hack=y to disable the lookup.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.22.1 src/sys/arch/powerpc/oea/ofw_autoconf.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/powerpc/oea/ofw_autoconf.c
diff -u src/sys/arch/powerpc/oea/ofw_autoconf.c:1.20 src/sys/arch/powerpc/oea/ofw_autoconf.c:1.20.22.1
--- src/sys/arch/powerpc/oea/ofw_autoconf.c:1.20	Tue Feb 18 12:27:15 2014
+++ src/sys/arch/powerpc/oea/ofw_autoconf.c	Thu Dec  5 16:53:06 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_autoconf.c,v 1.20 2014/02/18 12:27:15 macallan Exp $ */
+/* $NetBSD: ofw_autoconf.c,v 1.20.22.1 2019/12/05 16:53:06 bouyer Exp $ */
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
  * Copyright (C) 1995, 1996 TooLs GmbH.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.20 2014/02/18 12:27:15 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.20.22.1 2019/12/05 16:53:06 bouyer Exp $");
 
 #ifdef ofppc
 #include "gtpci.h"
@@ -137,10 +137,17 @@ canonicalize_bootpath(void)
 	 *   /pci/mac-io/ata-3@2000/disk@0:0/netbsd.new		(OF-3.x)
 	 */
 	strcpy(cbootpath, bootpath);
-	while ((node = OF_finddevice(cbootpath)) == -1) {
-		if ((p = strrchr(cbootpath, '/')) == NULL)
-			break;
-		*p = '\0';
+
+	if ((node = OF_finddevice("/options")) == -1 ||
+	OF_getprop(node, "qemu_boot_hack", type, sizeof(type) - 1) == -1 ||
+	type[0] != 'y') {
+		while ((node = OF_finddevice(cbootpath)) == -1) {
+			if ((p = strrchr(cbootpath, '/')) == NULL)
+break;
+			*p = '\0';
+		}
+	} else {
+		node = -1;
 	}
 
 	printf("bootpath: %s\n", bootpath);



CVS commit: src/doc

2019-12-05 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Dec  5 16:51:06 UTC 2019

Modified Files:
src/doc: CHANGES.prev

Log Message:
Fix date sorting order of previous checkin


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.151 src/doc/CHANGES.prev:1.152
--- src/doc/CHANGES.prev:1.151	Thu Dec  5 09:36:01 2019
+++ src/doc/CHANGES.prev	Thu Dec  5 16:51:06 2019
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.151 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.152 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12517,11 +12517,11 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[christos 20190103]
 	evbarm: Add SMP support for Allwinner multi-cluster SoCs (A83T, A80).
 		[jmcneill 20190103]
-	macppc: Update install media and documentation for powerpc 601
-		machines. [scole 20190107]
 	wpa: Import wpa_supplicant and hostapd 2.7. [christos 20190104]
 	acpi(4): Updated ACPICA to 20181213. [christos 20190104]
 	tmux(1): Imported 2.8. [christos 20190104]
+	macppc: Update install media and documentation for powerpc 601
+		machines. [scole 20190107]
 	TrouSerS: Import trousers-0.3.14. [christos 20190107]
 	tpm-tools: Import tpm-tools-1.3.9.1. [christos 20190107]
 	compiler-rt: Import compiler-rt r350590 LLVM sanitizers.



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

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:50:54 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_alc.c if_ale.c if_cas.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1464):
sys/dev/pci/if_alc.c1.44 via patch
sys/dev/pci/if_ale.c1.35-1.36 via patch
sys/dev/pci/if_cas.c1.36 via patch
- Fix a bug that IFF_ALLMULTI is almost always set.
- Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.4 -r1.24.8.5 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.22.2.2 -r1.22.2.3 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.26 -r1.26.8.1 src/sys/dev/pci/if_cas.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/if_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.24.8.4 src/sys/dev/pci/if_alc.c:1.24.8.5
--- src/sys/dev/pci/if_alc.c:1.24.8.4	Wed Nov  6 10:04:47 2019
+++ src/sys/dev/pci/if_alc.c	Thu Dec  5 16:50:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.24.8.4 2019/11/06 10:04:47 martin Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.24.8.5 2019/12/05 16:50:54 bouyer Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -745,7 +745,6 @@ alc_get_macaddr_816x(struct alc_softc *s
 	alc_get_macaddr_par(sc);
 }
 
-
 static void
 alc_get_macaddr_par(struct alc_softc *sc)
 {
@@ -2776,7 +2775,6 @@ alc_init_backend(struct ifnet *ifp, bool
 	} else
 		CSR_WRITE_4(sc, ALC_CLK_GATING_CFG, 0);
  
-
 	/* Reprogram the station address. */
 	memcpy(eaddr, CLLADDR(ifp->if_sadl), sizeof(eaddr));
 	CSR_WRITE_4(sc, ALC_PAR0,
@@ -2832,7 +2830,7 @@ alc_init_backend(struct ifnet *ifp, bool
 		CSR_WRITE_4(sc, ALC_RRD1_HEAD_ADDR_LO, 0);
 		CSR_WRITE_4(sc, ALC_RRD2_HEAD_ADDR_LO, 0);
 		CSR_WRITE_4(sc, ALC_RRD3_HEAD_ADDR_LO, 0);
-	}\
+	}
 	/* Set Rx return descriptor counter. */
 	CSR_WRITE_4(sc, ALC_RRD_RING_CNT,
 	(ALC_RR_RING_CNT << RRD_RING_CNT_SHIFT) & RRD_RING_CNT_MASK);
@@ -3403,25 +3401,35 @@ alc_iff(struct alc_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
-			ETHER_NEXT_MULTI(step, enm);
-		}
 	}
-
 	CSR_WRITE_4(sc, ALC_MAR0, mchash[0]);
 	CSR_WRITE_4(sc, ALC_MAR1, mchash[1]);
 	CSR_WRITE_4(sc, ALC_MAC_CFG, rxcfg);

Index: src/sys/dev/pci/if_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.22.2.2 src/sys/dev/pci/if_ale.c:1.22.2.3
--- src/sys/dev/pci/if_ale.c:1.22.2.2	Wed Nov  6 10:04:47 2019
+++ src/sys/dev/pci/if_ale.c	Thu Dec  5 16:50:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.22.2.2 2019/11/06 10:04:47 martin Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.22.2.3 2019/12/05 16:50:54 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon 
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.22.2.2 2019/11/06 10:04:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.22.2.3 2019/12/05 16:50:54 bouyer Exp $");
 
 #include "vlan.h"
 
@@ -1990,25 +1990,35 @@ ale_rxfilter(struct ale_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		

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

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:47:17 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_age.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1462):
sys/dev/pci/if_age.c: revision 1.61, 1.63-1.64 via patch

- Fix direction of the loop in age_get_macaddr().
- Fix multicast handling. All Atheros controllers use big-endian form
  when computing multicast hash.
- Fix a bug that IFF_ALLMULTI is almost always set.


To generate a diff of this commit:
cvs rdiff -u -r1.50.8.2 -r1.50.8.3 src/sys/dev/pci/if_age.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/if_age.c
diff -u src/sys/dev/pci/if_age.c:1.50.8.2 src/sys/dev/pci/if_age.c:1.50.8.3
--- src/sys/dev/pci/if_age.c:1.50.8.2	Wed Nov  6 10:04:47 2019
+++ src/sys/dev/pci/if_age.c	Thu Dec  5 16:47:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.50.8.2 2019/11/06 10:04:47 martin Exp $ */
+/*	$NetBSD: if_age.c,v 1.50.8.3 2019/12/05 16:47:17 bouyer Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.50.8.2 2019/11/06 10:04:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.50.8.3 2019/12/05 16:47:17 bouyer Exp $");
 
 #include "vlan.h"
 
@@ -572,7 +572,7 @@ age_get_macaddr(struct age_softc *sc, ui
 		 */
 		CSR_WRITE_4(sc, AGE_TWSI_CTRL, CSR_READ_4(sc, AGE_TWSI_CTRL) |
 		TWSI_CTRL_SW_LD_START);
-		for (i = 100; i > 0; i++) {
+		for (i = 100; i > 0; i--) {
 			DELAY(1000);
 			reg = CSR_READ_4(sc, AGE_TWSI_CTRL);
 			if ((reg & TWSI_CTRL_SW_LD_START) == 0)
@@ -2274,25 +2274,35 @@ age_rxfilter(struct age_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
-			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
-			ETHER_NEXT_MULTI(step, enm);
-		}
 	}
-
 	CSR_WRITE_4(sc, AGE_MAR0, mchash[0]);
 	CSR_WRITE_4(sc, AGE_MAR1, mchash[1]);
 	CSR_WRITE_4(sc, AGE_MAC_CFG, rxcfg);



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

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:44:32 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bge.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1462):
sys/dev/pci/if_bge.c: revision 1.340
sys/dev/pci/if_bge.c: revision 1.341
sys/dev/pci/if_bge.c: revision 1.336
- Avoid undefined behavior in bge_setmulti(). found by kUBSan.
- Avoid undefined behavior when setting the MAC address in bge_init().
  found by kUBSan.
 Fix a bug that SK-9D41 can't detect fiber media. Check the subsystem ID
correctly. This bug was added in if_bge.c rev. 1.161.
- Use *_FLUSH() more. The main purpose is to wait following delay() correctly.
- Add missing DELAY(80) after writing BGE_MI_MODE register.


To generate a diff of this commit:
cvs rdiff -u -r1.310.2.7 -r1.310.2.8 src/sys/dev/pci/if_bge.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/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.310.2.7 src/sys/dev/pci/if_bge.c:1.310.2.8
--- src/sys/dev/pci/if_bge.c:1.310.2.7	Mon May 13 12:40:13 2019
+++ src/sys/dev/pci/if_bge.c	Thu Dec  5 16:44:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.310.2.7 2019/05/13 12:40:13 martin Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.310.2.8 2019/12/05 16:44:32 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.7 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.8 2019/12/05 16:44:32 bouyer Exp $");
 
 #include 
 #include 
@@ -1030,10 +1030,10 @@ bge_eeprom_getbyte(struct bge_softc *sc,
 	 * Enable use of auto EEPROM access so we can avoid
 	 * having to use the bitbang method.
 	 */
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	/* Reset the EEPROM, load the clock period. */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	DELAY(20);
 
@@ -1825,7 +1825,7 @@ bge_setmulti(struct bge_softc *sc)
 		/* Just want the 7 least-significant bits. */
 		h &= 0x7f;
 
-		hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F);
+		hashes[(h & 0x60) >> 5] |= 1U << (h & 0x1F);
 		ETHER_NEXT_MULTI(step, enm);
 	}
 
@@ -2283,7 +2283,7 @@ bge_chipinit(struct bge_softc *sc)
 #endif
 
 	/* Set the timer prescaler (always 66MHz) */
-	CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
+	CSR_WRITE_4_FLUSH(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
 		DELAY(40);	/* XXX */
@@ -3439,6 +3439,7 @@ bge_attach(device_t parent, device_t sel
 	else
 		mimode |= BGE_MIMODE_BASE;
 	CSR_WRITE_4(sc, BGE_MI_MODE, mimode);
+	DELAY(80);
 
 	/*
 	 * When using the BCM5701 in PCI-X mode, data corruption has
@@ -3638,10 +3639,10 @@ alloc_retry:
 	 * Reset NVRAM before bge_reset(). It's required to acquire NVRAM
 	 * lock in bge_reset().
 	 */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	delay(1000);
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	bge_stop_fw(sc);
 	bge_sig_pre_reset(sc, BGE_RESET_START);
@@ -3854,7 +3855,7 @@ alloc_retry:
 	 * by its PCI subsystem ID, as we do below for the SysKonnect SK-9D41.
 	 * The SysKonnect SK-9D41 is a 1000baseSX card.
 	 */
-	if (PCI_PRODUCT(pa->pa_id) == SK_SUBSYSID_9D41 ||
+	if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
 	(hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
 		if (BGE_IS_5705_PLUS(sc)) {
 			sc->bge_flags |= BGEF_FIBER_MII;
@@ -5534,7 +5535,8 @@ bge_init(struct ifnet *ifp)
 	/* Load our MAC address. */
 	m = (const uint16_t *)&(CLLADDR(ifp->if_sadl)[0]);
 	CSR_WRITE_4(sc, BGE_MAC_ADDR1_LO, htons(m[0]));
-	CSR_WRITE_4(sc, BGE_MAC_ADDR1_HI, (htons(m[1]) << 16) | htons(m[2]));
+	CSR_WRITE_4(sc, BGE_MAC_ADDR1_HI,
+	((uint32_t)htons(m[1]) << 16) | htons(m[2]));
 
 	/* Enable or disable promiscuous mode as needed. */
 	if (ifp->if_flags & IFF_PROMISC)
@@ -5680,10 +5682,10 @@ bge_ifmedia_upd(struct ifnet *ifp)
 			break;
 		case IFM_1000_SX:
 			if ((ifm->ifm_media & IFM_FDX) != 0) {
-BGE_CLRBIT(sc, BGE_MAC_MODE,
+BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			} else {
-BGE_SETBIT(sc, BGE_MAC_MODE,
+BGE_SETBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			}
 			DELAY(40);
@@ -6081,7 +6083,7 @@ bge_link_upd(struct bge_softc *sc)
 BGE_STS_SETBIT(sc, BGE_STS_LINK);
 if (BGE_ASICREV(sc->bge_chipid)
 == BGE_ASICREV_BCM5704) {
-	BGE_CLRBIT(sc, BGE_MAC_MODE,
+	BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 	BGE_MACMODE_TBI_SEND_CFGS);
 	DELAY(40);
 }



CVS commit: [netbsd-7] src/doc

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:30:45 UTC 2019

Modified Files:
src/doc [netbsd-7]: CHANGES-7.3

Log Message:
ticket 1716


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-7.3

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

Modified files:

Index: src/doc/CHANGES-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.70 src/doc/CHANGES-7.3:1.1.2.71
--- src/doc/CHANGES-7.3:1.1.2.70	Thu Dec  5 16:25:17 2019
+++ src/doc/CHANGES-7.3	Thu Dec  5 16:30:45 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.70 2019/12/05 16:25:17 bouyer Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.71 2019/12/05 16:30:45 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -737,3 +737,10 @@ share/man/man4/rnd.41.25 - 1.28
 	Update NIST SP800-90A reference.
 	[riastradh, ticket #1715]
 
+sys/external/bsd/dwc2/dwc2.c			1.60 - 1.66
+
+	Make dwc2debug sysctl'able
+	Calulate the right lenght for isoc transfer and the usb_syncmem
+	PR/54696: Kernel panic in bus_dma.c on Raspberry Pi 3B/3B+
+	[skrll, ticket #1716]
+



CVS commit: [netbsd-7] src/sys/external/bsd/dwc2

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:30:17 UTC 2019

Modified Files:
src/sys/external/bsd/dwc2 [netbsd-7]: dwc2.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1716):
sys/external/bsd/dwc2/dwc2.c: revision 1.60
sys/external/bsd/dwc2/dwc2.c: revision 1.61
sys/external/bsd/dwc2/dwc2.c: revision 1.62
sys/external/bsd/dwc2/dwc2.c: revision 1.63
sys/external/bsd/dwc2/dwc2.c: revision 1.64
sys/external/bsd/dwc2/dwc2.c: revision 1.65
sys/external/bsd/dwc2/dwc2.c: revision 1.66
KNF
Make dwc2debug sysctl'able
Need  for previous
Use size_t for loop count variable
Calulate the right lenght for isoc transfer and the usb_syncmem
PR/54696: Kernel panic in bus_dma.c on Raspberry Pi 3B/3B+
build fix
Consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.31.2.4 -r1.31.2.5 src/sys/external/bsd/dwc2/dwc2.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.31.2.4 src/sys/external/bsd/dwc2/dwc2.c:1.31.2.5
--- src/sys/external/bsd/dwc2/dwc2.c:1.31.2.4	Sat Aug 25 14:57:35 2018
+++ src/sys/external/bsd/dwc2/dwc2.c	Thu Dec  5 16:30:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.31.2.4 2018/08/25 14:57:35 martin Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.31.2.5 2019/12/05 16:30:17 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,19 +30,21 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.31.2.4 2018/08/25 14:57:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.31.2.5 2019/12/05 16:30:17 bouyer Exp $");
 
 #include "opt_usb.h"
 
 #include 
-#include 
-#include 
-#include 
+
+#include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -74,6 +76,33 @@ __KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.3
 } while (0)
 #define	DPRINTF(...)	DPRINTFN(1, __VA_ARGS__)
 int dwc2debug = 0;
+
+SYSCTL_SETUP(sysctl_hw_dwc2_setup, "sysctl hw.dwc2 setup")
+{
+	int err;
+	const struct sysctlnode *rnode;
+	const struct sysctlnode *cnode;
+
+	err = sysctl_createv(clog, 0, NULL, ,
+	CTLFLAG_PERMANENT, CTLTYPE_NODE, "dwc2",
+	SYSCTL_DESCR("dwc2 global controls"),
+	NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL);
+
+	if (err)
+		goto fail;
+
+	/* control debugging printfs */
+	err = sysctl_createv(clog, 0, , ,
+	CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT,
+	"debug", SYSCTL_DESCR("Enable debugging output"),
+	NULL, 0, , sizeof(dwc2debug), CTL_CREATE, CTL_EOL);
+	if (err)
+		goto fail;
+
+	return;
+fail:
+	aprint_error("%s: sysctl_createv failed (err = %d)\n", __func__, err);
+}
 #else
 #define	DPRINTF(...) do { } while (0)
 #define	DPRINTFN(...) do { } while (0)
@@ -944,7 +973,6 @@ dwc2_device_start(struct usbd_xfer *xfer
 	uint32_t off = 0;
 	int retval, err;
 	int alloc_bandwidth = 0;
-	int i;
 
 	DPRINTFN(1, "xfer=%p pipe=%p\n", xfer, xfer->ux_pipe);
 
@@ -984,6 +1012,14 @@ dwc2_device_start(struct usbd_xfer *xfer
 		DPRINTFN(3, "req = %p dma = %" PRIxBUSADDR " len %d dir %s\n",
 		KERNADDR(>req_dma, 0), DMAADDR(>req_dma, 0),
 		len, dir == UE_DIR_IN ? "in" : "out");
+	} else if (xfertype == UE_ISOCHRONOUS) {
+		DPRINTFN(3, "xfer=%p nframes=%d flags=%d addr=%d endpt=%d,"
+		" mps=%d dir %s\n", xfer, xfer->ux_nframes, xfer->ux_flags, addr,
+		epnum, mps, dir == UT_READ ? "in" :"out");
+
+		len = 0;
+		for (size_t i = 0; i < xfer->ux_nframes; i++)
+			len += xfer->ux_frlengths[i];
 	} else {
 		DPRINTFN(3, "xfer=%p len=%d flags=%d addr=%d endpt=%d,"
 		" mps=%d dir %s\n", xfer, xfer->ux_length, xfer->ux_flags, addr,
@@ -1077,8 +1113,9 @@ dwc2_device_start(struct usbd_xfer *xfer
 	KASSERTMSG(xfer->ux_nframes == 0 || xfertype == UE_ISOCHRONOUS,
 	"nframes %d xfertype %d\n", xfer->ux_nframes, xfertype);
 
-	for (off = i = 0; i < xfer->ux_nframes; ++i) {
-		DPRINTFN(3, "xfer=%p frame=%d offset=%d length=%d\n", xfer, i,
+	off = 0;
+	for (size_t i = 0; i < xfer->ux_nframes; ++i) {
+		DPRINTFN(3, "xfer=%p frame=%zd offset=%d length=%d\n", xfer, i,
 		off, xfer->ux_frlengths[i]);
 
 		dwc2_hcd_urb_set_iso_desc_params(dwc2_urb, i, off,
@@ -1469,22 +1506,21 @@ void dwc2_host_complete(struct dwc2_hsot
 	DPRINTFN(3, "xfer=%p actlen=%d\n", xfer, xfer->ux_actlen);
 
 	if (xfertype == UE_ISOCHRONOUS) {
-		int i;
-
 		xfer->ux_actlen = 0;
-		for (i = 0; i < xfer->ux_nframes; ++i) {
+		for (size_t i = 0; i < xfer->ux_nframes; ++i) {
 			xfer->ux_frlengths[i] =
 dwc2_hcd_urb_get_iso_desc_actual_length(
 		urb, i);
+			DPRINTFN(1, "xfer=%p frame=%zu length=%d\n", xfer, i,
+			xfer->ux_frlengths[i]);
 			xfer->ux_actlen += xfer->ux_frlengths[i];
 		}
+		DPRINTFN(1, "xfer=%p actlen=%d (isoc)\n", xfer, xfer->ux_actlen);
 	}
 
 	if (xfertype == UE_ISOCHRONOUS && dbg_perio()) {
-		int i;
-
-		for (i = 

CVS commit: [netbsd-7] src/share/man/man4

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:29:23 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-7]: rnd.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1715):
share/man/man4/rnd.4: revision 1.26
share/man/man4/rnd.4: revision 1.27
share/man/man4/rnd.4: revision 1.28
share/man/man4/rnd.4: revision 1.25
Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)
Update NIST SP800-90A reference.
New sentence, new line. Use \(em.


To generate a diff of this commit:
cvs rdiff -u -r1.20.10.1 -r1.20.10.2 src/share/man/man4/rnd.4

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.20.10.1 src/share/man/man4/rnd.4:1.20.10.2
--- src/share/man/man4/rnd.4:1.20.10.1	Wed Mar 18 07:54:26 2015
+++ src/share/man/man4/rnd.4	Thu Dec  5 16:29:23 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.20.10.1 2015/03/18 07:54:26 snj Exp $
+.\"	$NetBSD: rnd.4,v 1.20.10.2 2019/12/05 16:29:23 bouyer Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 16, 2014
+.Dd September 3, 2019
 .Dt RND 4
 .Os
 .Sh NAME
@@ -187,8 +187,8 @@ quantum computers.
 Systems with nonvolatile storage should store a secret from
 .Pa /dev/urandom
 on disk during installation or shutdown, and feed it back during boot,
-so that the work the operating system has done to gather entropy --
-including the work its operator may have done to flip a coin! -- can be
+so that the work the operating system has done to gather entropy \(em
+including the work its operator may have done to flip a coin! \(em can be
 saved from one boot to the next, and so that newly installed systems
 are not vulnerable to generating cryptographic keys predictably.
 .Pp
@@ -205,7 +205,7 @@ in
 see
 .Xr rc.conf 5 .
 .Sh LIMITATIONS
-Some people worry about recovery from state compromise -- that is,
+Some people worry about recovery from state compromise \(em that is,
 ensuring that even if an attacker sees the entire state of the
 operating system, then the attacker will be unable to predict any new
 future outputs as long as the operating system gathers fresh entropy
@@ -404,9 +404,9 @@ When a user process opens
 or
 .Pa /dev/urandom
 and first reads from it, the kernel draws from the entropy pool to seed
-a cryptographic pseudorandom number generator, the NIST CTR_DRBG
-(counter-mode deterministic random bit generator) with AES-128 as the
-block cipher, and uses that to generate data.
+a cryptographic pseudorandom number generator, the NIST Hash_DRBG
+(hash-based deterministic random bit generator) with SHA-256 as the
+hash function, and uses that to generate data.
 .Pp
 To draw a seed from the entropy pool, the kernel
 .Bl -bullet -offset abcd -compact
@@ -489,10 +489,10 @@ Never blocks.
 .%A Elaine Barker
 .%A John Kelsey
 .%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
-.%D January 2012
+.%D June 2015
 .%I National Institute of Standards and Technology
-.%O NIST Special Publication 800-90A
-.%U http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf
+.%O NIST Special Publication 800-90A, Revision 1
+.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
 .Re
 .Rs
 .%A Daniel J. Bernstein
@@ -551,59 +551,33 @@ Unfortunately, no amount of software eng
 .Sh ENTROPY ACCOUNTING
 The entropy accounting described here is not grounded in any
 cryptography theory.
-It is done because it was always done, and because it gives people a
-warm fuzzy feeling about information theory.
+.Sq Entropy estimation
+doesn't mean much: the kernel hypothesizes an extremely simple-minded
+parametric model for all entropy sources which bears little relation to
+any physical processes, implicitly fits parameters from data, and
+accounts for the entropy of the fitted model.
 .Pp
-The folklore is that every
-.Fa n Ns -bit
-output of
-.Fa /dev/random
-is not merely indistinguishable from uniform random to a
-computationally bounded attacker, but information-theoretically is
-independent and has
-.Fa n
-bits of entropy even to a computationally
-.Em unbounded
-attacker -- that is, an attacker who can recover AES keys, compute
-SHA-1 preimages, etc.
-This property is not provided, nor was it ever provided in any
-implementation of
-.Fa /dev/random
-known to the author.
-.Pp
-This property would require that, after each read, the system discard
-all measurements from hardware in the entropy pool and begin anew.
-All work done to make the system unpredictable would be thrown 

CVS commit: [netbsd-7] src/doc

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:25:17 UTC 2019

Modified Files:
src/doc [netbsd-7]: CHANGES-7.3

Log Message:
ticket 1715


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-7.3

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

Modified files:

Index: src/doc/CHANGES-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.69 src/doc/CHANGES-7.3:1.1.2.70
--- src/doc/CHANGES-7.3:1.1.2.69	Mon Nov 25 15:47:16 2019
+++ src/doc/CHANGES-7.3	Thu Dec  5 16:25:17 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.69 2019/11/25 15:47:16 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.70 2019/12/05 16:25:17 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -731,3 +731,9 @@ sys/kern/subr_cprng.c1.33
 	Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
 	[riastradh, ticket #1714]
 
+share/man/man4/rnd.41.25 - 1.28
+
+	Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
+	Update NIST SP800-90A reference.
+	[riastradh, ticket #1715]
+



CVS commit: [netbsd-7-1] src/doc

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:24:46 UTC 2019

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
ticket 1715


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.62 -r1.1.2.63 src/doc/CHANGES-7.1.3

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.62 src/doc/CHANGES-7.1.3:1.1.2.63
--- src/doc/CHANGES-7.1.3:1.1.2.62	Mon Nov 25 15:48:04 2019
+++ src/doc/CHANGES-7.1.3	Thu Dec  5 16:24:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.62 2019/11/25 15:48:04 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.63 2019/12/05 16:24:46 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -612,3 +612,9 @@ sys/kern/subr_cprng.c1.33
 	Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
 	[riastradh, ticket #1714]
 
+share/man/man4/rnd.41.25 - 1.28
+
+	Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
+	Update NIST SP800-90A reference.
+	[riastradh, ticket #1715]
+



CVS commit: [netbsd-7-1] src/share/man/man4

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:24:29 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-7-1]: rnd.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1715):
share/man/man4/rnd.4: revision 1.26
share/man/man4/rnd.4: revision 1.27
share/man/man4/rnd.4: revision 1.28
share/man/man4/rnd.4: revision 1.25
Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)
Update NIST SP800-90A reference.
New sentence, new line. Use \(em.


To generate a diff of this commit:
cvs rdiff -u -r1.20.10.1 -r1.20.10.1.6.1 src/share/man/man4/rnd.4

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.20.10.1 src/share/man/man4/rnd.4:1.20.10.1.6.1
--- src/share/man/man4/rnd.4:1.20.10.1	Wed Mar 18 07:54:26 2015
+++ src/share/man/man4/rnd.4	Thu Dec  5 16:24:28 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.20.10.1 2015/03/18 07:54:26 snj Exp $
+.\"	$NetBSD: rnd.4,v 1.20.10.1.6.1 2019/12/05 16:24:28 bouyer Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 16, 2014
+.Dd September 3, 2019
 .Dt RND 4
 .Os
 .Sh NAME
@@ -187,8 +187,8 @@ quantum computers.
 Systems with nonvolatile storage should store a secret from
 .Pa /dev/urandom
 on disk during installation or shutdown, and feed it back during boot,
-so that the work the operating system has done to gather entropy --
-including the work its operator may have done to flip a coin! -- can be
+so that the work the operating system has done to gather entropy \(em
+including the work its operator may have done to flip a coin! \(em can be
 saved from one boot to the next, and so that newly installed systems
 are not vulnerable to generating cryptographic keys predictably.
 .Pp
@@ -205,7 +205,7 @@ in
 see
 .Xr rc.conf 5 .
 .Sh LIMITATIONS
-Some people worry about recovery from state compromise -- that is,
+Some people worry about recovery from state compromise \(em that is,
 ensuring that even if an attacker sees the entire state of the
 operating system, then the attacker will be unable to predict any new
 future outputs as long as the operating system gathers fresh entropy
@@ -404,9 +404,9 @@ When a user process opens
 or
 .Pa /dev/urandom
 and first reads from it, the kernel draws from the entropy pool to seed
-a cryptographic pseudorandom number generator, the NIST CTR_DRBG
-(counter-mode deterministic random bit generator) with AES-128 as the
-block cipher, and uses that to generate data.
+a cryptographic pseudorandom number generator, the NIST Hash_DRBG
+(hash-based deterministic random bit generator) with SHA-256 as the
+hash function, and uses that to generate data.
 .Pp
 To draw a seed from the entropy pool, the kernel
 .Bl -bullet -offset abcd -compact
@@ -489,10 +489,10 @@ Never blocks.
 .%A Elaine Barker
 .%A John Kelsey
 .%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
-.%D January 2012
+.%D June 2015
 .%I National Institute of Standards and Technology
-.%O NIST Special Publication 800-90A
-.%U http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf
+.%O NIST Special Publication 800-90A, Revision 1
+.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
 .Re
 .Rs
 .%A Daniel J. Bernstein
@@ -551,59 +551,33 @@ Unfortunately, no amount of software eng
 .Sh ENTROPY ACCOUNTING
 The entropy accounting described here is not grounded in any
 cryptography theory.
-It is done because it was always done, and because it gives people a
-warm fuzzy feeling about information theory.
+.Sq Entropy estimation
+doesn't mean much: the kernel hypothesizes an extremely simple-minded
+parametric model for all entropy sources which bears little relation to
+any physical processes, implicitly fits parameters from data, and
+accounts for the entropy of the fitted model.
 .Pp
-The folklore is that every
-.Fa n Ns -bit
-output of
-.Fa /dev/random
-is not merely indistinguishable from uniform random to a
-computationally bounded attacker, but information-theoretically is
-independent and has
-.Fa n
-bits of entropy even to a computationally
-.Em unbounded
-attacker -- that is, an attacker who can recover AES keys, compute
-SHA-1 preimages, etc.
-This property is not provided, nor was it ever provided in any
-implementation of
-.Fa /dev/random
-known to the author.
-.Pp
-This property would require that, after each read, the system discard
-all measurements from hardware in the entropy pool and begin anew.
-All work done to make the system unpredictable would 

CVS commit: [netbsd-7-0] src/doc

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:23:51 UTC 2019

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
ticket 1715


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.155 src/doc/CHANGES-7.0.3:1.1.2.156
--- src/doc/CHANGES-7.0.3:1.1.2.155	Mon Nov 25 15:49:05 2019
+++ src/doc/CHANGES-7.0.3	Thu Dec  5 16:23:51 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.155 2019/11/25 15:49:05 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.156 2019/12/05 16:23:51 bouyer Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5920,3 +5920,9 @@ sys/kern/subr_cprng.c1.33
 	Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
 	[riastradh, ticket #1714]
 
+share/man/man4/rnd.41.25 - 1.28
+
+	Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
+	Update NIST SP800-90A reference.
+	[riastradh, ticket #1715]
+



CVS commit: [netbsd-7-0] src/share/man/man4

2019-12-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Dec  5 16:23:23 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-7-0]: rnd.4

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1715):
share/man/man4/rnd.4: revision 1.26
share/man/man4/rnd.4: revision 1.27
share/man/man4/rnd.4: revision 1.28
share/man/man4/rnd.4: revision 1.25
Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)
Update NIST SP800-90A reference.
New sentence, new line. Use \(em.


To generate a diff of this commit:
cvs rdiff -u -r1.20.10.1 -r1.20.10.1.2.1 src/share/man/man4/rnd.4

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.20.10.1 src/share/man/man4/rnd.4:1.20.10.1.2.1
--- src/share/man/man4/rnd.4:1.20.10.1	Wed Mar 18 07:54:26 2015
+++ src/share/man/man4/rnd.4	Thu Dec  5 16:23:22 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.20.10.1 2015/03/18 07:54:26 snj Exp $
+.\"	$NetBSD: rnd.4,v 1.20.10.1.2.1 2019/12/05 16:23:22 bouyer Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 16, 2014
+.Dd September 3, 2019
 .Dt RND 4
 .Os
 .Sh NAME
@@ -187,8 +187,8 @@ quantum computers.
 Systems with nonvolatile storage should store a secret from
 .Pa /dev/urandom
 on disk during installation or shutdown, and feed it back during boot,
-so that the work the operating system has done to gather entropy --
-including the work its operator may have done to flip a coin! -- can be
+so that the work the operating system has done to gather entropy \(em
+including the work its operator may have done to flip a coin! \(em can be
 saved from one boot to the next, and so that newly installed systems
 are not vulnerable to generating cryptographic keys predictably.
 .Pp
@@ -205,7 +205,7 @@ in
 see
 .Xr rc.conf 5 .
 .Sh LIMITATIONS
-Some people worry about recovery from state compromise -- that is,
+Some people worry about recovery from state compromise \(em that is,
 ensuring that even if an attacker sees the entire state of the
 operating system, then the attacker will be unable to predict any new
 future outputs as long as the operating system gathers fresh entropy
@@ -404,9 +404,9 @@ When a user process opens
 or
 .Pa /dev/urandom
 and first reads from it, the kernel draws from the entropy pool to seed
-a cryptographic pseudorandom number generator, the NIST CTR_DRBG
-(counter-mode deterministic random bit generator) with AES-128 as the
-block cipher, and uses that to generate data.
+a cryptographic pseudorandom number generator, the NIST Hash_DRBG
+(hash-based deterministic random bit generator) with SHA-256 as the
+hash function, and uses that to generate data.
 .Pp
 To draw a seed from the entropy pool, the kernel
 .Bl -bullet -offset abcd -compact
@@ -489,10 +489,10 @@ Never blocks.
 .%A Elaine Barker
 .%A John Kelsey
 .%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
-.%D January 2012
+.%D June 2015
 .%I National Institute of Standards and Technology
-.%O NIST Special Publication 800-90A
-.%U http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf
+.%O NIST Special Publication 800-90A, Revision 1
+.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
 .Re
 .Rs
 .%A Daniel J. Bernstein
@@ -551,59 +551,33 @@ Unfortunately, no amount of software eng
 .Sh ENTROPY ACCOUNTING
 The entropy accounting described here is not grounded in any
 cryptography theory.
-It is done because it was always done, and because it gives people a
-warm fuzzy feeling about information theory.
+.Sq Entropy estimation
+doesn't mean much: the kernel hypothesizes an extremely simple-minded
+parametric model for all entropy sources which bears little relation to
+any physical processes, implicitly fits parameters from data, and
+accounts for the entropy of the fitted model.
 .Pp
-The folklore is that every
-.Fa n Ns -bit
-output of
-.Fa /dev/random
-is not merely indistinguishable from uniform random to a
-computationally bounded attacker, but information-theoretically is
-independent and has
-.Fa n
-bits of entropy even to a computationally
-.Em unbounded
-attacker -- that is, an attacker who can recover AES keys, compute
-SHA-1 preimages, etc.
-This property is not provided, nor was it ever provided in any
-implementation of
-.Fa /dev/random
-known to the author.
-.Pp
-This property would require that, after each read, the system discard
-all measurements from hardware in the entropy pool and begin anew.
-All work done to make the system unpredictable would 

CVS commit: src/sys/dev/dm

2019-12-05 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec  5 15:52:39 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c dm.h dm_ioctl.c

Log Message:
dm: Remove unneeded dm_get_version_ioctl()

"version" is implemented and handled in userspace,
hence dm ioctl doesn't need to support it.

taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/dm/dm.h
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/dm/dm_ioctl.c

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

Modified files:

Index: src/sys/dev/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.44 src/sys/dev/dm/device-mapper.c:1.45
--- src/sys/dev/dm/device-mapper.c:1.44	Wed Dec  4 16:55:30 2019
+++ src/sys/dev/dm/device-mapper.c	Thu Dec  5 15:52:39 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.44 2019/12/04 16:55:30 tkusumi Exp $ */
+/*$NetBSD: device-mapper.c,v 1.45 2019/12/05 15:52:39 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -134,7 +134,7 @@ static const struct cmd_function {
 	int  (*fn)(prop_dictionary_t);
 	int  allowed;
 } cmd_fn[] = {
-	{ .cmd = "version", .fn = dm_get_version_ioctl,	  .allowed = 1 },
+	{ .cmd = "version", .fn = NULL,   .allowed = 1 },
 	{ .cmd = "targets", .fn = dm_list_versions_ioctl, .allowed = 1 },
 	{ .cmd = "create",  .fn = dm_dev_create_ioctl,.allowed = 0 },
 	{ .cmd = "info",.fn = dm_dev_status_ioctl,.allowed = 1 },
@@ -413,7 +413,9 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict)
 	if (cmd_fn[i].cmd == NULL)
 		return EINVAL;
 
-	aprint_debug("ioctl %s called\n", cmd_fn[i].cmd);
+	aprint_debug("ioctl %s called %p\n", cmd_fn[i].cmd, cmd_fn[i].fn);
+	if (cmd_fn[i].fn == NULL)
+		return 0;
 	r = cmd_fn[i].fn(dm_dict);
 
 	return r;

Index: src/sys/dev/dm/dm.h
diff -u src/sys/dev/dm/dm.h:1.32 src/sys/dev/dm/dm.h:1.33
--- src/sys/dev/dm/dm.h:1.32	Wed Dec  4 16:54:03 2019
+++ src/sys/dev/dm/dm.h	Thu Dec  5 15:52:39 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm.h,v 1.32 2019/12/04 16:54:03 tkusumi Exp $  */
+/*$NetBSD: dm.h,v 1.33 2019/12/05 15:52:39 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -251,7 +251,6 @@ int dm_dev_status_ioctl(prop_dictionary_
 int dm_dev_suspend_ioctl(prop_dictionary_t);
 
 int dm_check_version(prop_dictionary_t);
-int dm_get_version_ioctl(prop_dictionary_t);
 int dm_list_versions_ioctl(prop_dictionary_t);
 
 int dm_table_clear_ioctl(prop_dictionary_t);

Index: src/sys/dev/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.37 src/sys/dev/dm/dm_ioctl.c:1.38
--- src/sys/dev/dm/dm_ioctl.c:1.37	Wed Dec  4 15:31:12 2019
+++ src/sys/dev/dm/dm_ioctl.c	Thu Dec  5 15:52:39 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $  */
+/* $NetBSD: dm_ioctl.c,v 1.38 2019/12/05 15:52:39 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.38 2019/12/05 15:52:39 tkusumi Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -161,17 +161,6 @@ dm_dbg_print_flags(int flags)
 }
 
 /*
- * Get version ioctl call I do it as default therefore this
- * function is unused now.
- */
-int
-dm_get_version_ioctl(prop_dictionary_t dm_dict)
-{
-
-	return 0;
-}
-
-/*
  * Get list of all available targets from global
  * target list and sent them back to libdevmapper.
  */



CVS commit: [netbsd-9] src/doc

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 10:29:13 UTC 2019

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

Log Message:
Note macppc ISO generator changes


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.129 src/doc/CHANGES-9.0:1.1.2.130
--- src/doc/CHANGES-9.0:1.1.2.129	Thu Dec  5 09:40:15 2019
+++ src/doc/CHANGES-9.0	Thu Dec  5 10:29:13 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.129 2019/12/05 09:40:15 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.130 2019/12/05 10:29:13 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6636,3 +6636,7 @@ distrib/notes/common/main			(edited manu
 doc/CHANGES	(edited manually)
 
 	Add macppc powerpc 601 changes.
+
+distrib/cdrom/NetBSD-9.0.mk			1.1
+
+	Add config cloned from -current (for macppc ppc 601 support)



CVS commit: [netbsd-9] src/distrib/cdrom

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 10:28:07 UTC 2019

Added Files:
src/distrib/cdrom [netbsd-9]: NetBSD-9.0.mk

Log Message:
Pull up the following revision:

distrib/cdrom/NetBSD-9.0.mk 1.1

Add a clone of -current for 9.0. First time this makes a difference
(for macppc ppc 601) for all still relevant use cases.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/distrib/cdrom/NetBSD-9.0.mk

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

Added files:

Index: src/distrib/cdrom/NetBSD-9.0.mk
diff -u /dev/null src/distrib/cdrom/NetBSD-9.0.mk:1.1.2.2
--- /dev/null	Thu Dec  5 10:28:07 2019
+++ src/distrib/cdrom/NetBSD-9.0.mk	Thu Dec  5 10:28:07 2019
@@ -0,0 +1,69 @@
+# $NetBSD: NetBSD-9.0.mk,v 1.1.2.2 2019/12/05 10:28:07 martin Exp $
+#
+# Configuration file for NetBSD-9.0
+
+# sysinst expects the architectures at top level
+RELEASE_SUBDIR=		# empty
+
+# BOOTFILE.alpha is absolute
+BOOTFILE.alpha=		${EXTFILEDIR}/alpha.bootxx
+EXTFILES.alpha=		alpha.bootxx:alpha/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660
+INTFILES.alpha=		netbsd.alpha:alpha/installation/instkernel/netbsd.gz,link \
+			boot:alpha/binary/sets/base.tgz,./usr/mdec/boot
+
+# cats needs an a.out kernel to boot from
+INTFILES.cats=		netbsd.cats:cats/binary/kernel/netbsd-INSTALL.aout.gz
+
+# BOOTFILE.i386 is relative to CD staging root
+BOOTFILE.i386=		boot.i386
+INTFILES.i386=		boot.i386:i386/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660 \
+			boot:i386/binary/sets/base.tgz,./usr/mdec/boot \
+			netbsd:i386/binary/kernel/netbsd-INSTALL.gz,link
+
+# BOOTFILE.amd64 is relative to CD staging root
+BOOTFILE.amd64=		boot.amd64
+INTFILES.amd64=		boot.amd64:amd64/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660 \
+			boot:amd64/binary/sets/base.tgz,./usr/mdec/boot \
+			netbsd:amd64/binary/kernel/netbsd-INSTALL.gz,link
+
+# macppc has external bootblock generation tool
+EXTFILES.macppc=	macppc.bootxx:macppc/binary/sets/base.tgz,./usr/mdec/bootxx \
+			macppc.ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot
+INTFILES.macppc=	ofwboot.xcf:macppc/installation/ofwboot.xcf,link \
+			ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot \
+			netbsd.macppc:macppc/binary/kernel/netbsd-INSTALL.gz,link \
+			netbsd.601:macppc/binary/kernel/netbsd-INSTALL_601.gz,link
+
+# BOOTFILE.pmax is absolute
+BOOTFILE.pmax=		${EXTFILEDIR}/pmax.bootxx
+EXTFILES.pmax=		pmax.bootxx:pmax/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660
+INTFILES.pmax=		netbsd.pmax:pmax/binary/kernel/netbsd-INSTALL.gz,link \
+			boot.pmax:pmax/binary/sets/base.tgz,./usr/mdec/boot.pmax
+
+# sgimips needs the compressed kernels with short names in /, the various
+# boot files that go into the volume header and the bootblock.h file
+# to grep for the volume header size
+EXTFILES.sgimips=	sgimips.bootblock.h:sgimips/binary/sets/comp.tgz,./usr/include/sys/bootblock.h
+INTFILES.sgimips=	aoutboot:sgimips/binary/sets/base.tgz,./usr/mdec/aoutboot \
+			ip2xboot:sgimips/binary/sets/base.tgz,./usr/mdec/ip2xboot \
+			ip3xboot:sgimips/binary/sets/base.tgz,./usr/mdec/ip3xboot \
+			ip2x:sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz,link \
+			ip3x:sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz,link
+
+
+# BOOTFILE.sparc is absolute
+BOOTFILE.sparc=		${EXTFILEDIR}/sparc-boot.fs
+EXTFILES.sparc=		sparc-boot.fs:sparc/installation/bootfs/boot.fs.gz
+INTFILES.sparc=		installation/bootfs/instfs.tgz:sparc/installation/bootfs/instfs.tgz,link
+INTDIRS.sparc=		installation/bootfs
+MKISOFS_ARGS.sparc=	-hide-hfs ./installation -hide-joliet ./installation
+
+# BOOTFILE.sparc64 is absolute
+BOOTFILE.sparc64=	${EXTFILEDIR}/sparc64-boot.fs
+EXTFILES.sparc64=	sparc64-boot.fs:sparc64/installation/misc/boot.fs.gz
+
+# BOOTFILE.vax is absolute
+BOOTFILE.vax=		${EXTFILEDIR}/vax.xxboot
+EXTFILES.vax=		vax.xxboot:vax/binary/sets/base.tgz,./usr/mdec/xxboot
+INTFILES.vax=		netbsd.vax:vax/installation/netboot/install.ram.gz,link \
+			boot.vax:vax/binary/sets/base.tgz,./usr/mdec/boot



CVS commit: src/distrib/cdrom

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 10:25:41 UTC 2019

Added Files:
src/distrib/cdrom: NetBSD-9.0.mk

Log Message:
Copy -current to 9.0, this has diverged (macppc 601 support and others,
but since the macppc release ISOs are still generated by this, it is
important to catch up)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/distrib/cdrom/NetBSD-9.0.mk

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

Added files:

Index: src/distrib/cdrom/NetBSD-9.0.mk
diff -u /dev/null src/distrib/cdrom/NetBSD-9.0.mk:1.1
--- /dev/null	Thu Dec  5 10:25:41 2019
+++ src/distrib/cdrom/NetBSD-9.0.mk	Thu Dec  5 10:25:41 2019
@@ -0,0 +1,69 @@
+# $NetBSD: NetBSD-9.0.mk,v 1.1 2019/12/05 10:25:41 martin Exp $
+#
+# Configuration file for NetBSD-9.0
+
+# sysinst expects the architectures at top level
+RELEASE_SUBDIR=		# empty
+
+# BOOTFILE.alpha is absolute
+BOOTFILE.alpha=		${EXTFILEDIR}/alpha.bootxx
+EXTFILES.alpha=		alpha.bootxx:alpha/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660
+INTFILES.alpha=		netbsd.alpha:alpha/installation/instkernel/netbsd.gz,link \
+			boot:alpha/binary/sets/base.tgz,./usr/mdec/boot
+
+# cats needs an a.out kernel to boot from
+INTFILES.cats=		netbsd.cats:cats/binary/kernel/netbsd-INSTALL.aout.gz
+
+# BOOTFILE.i386 is relative to CD staging root
+BOOTFILE.i386=		boot.i386
+INTFILES.i386=		boot.i386:i386/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660 \
+			boot:i386/binary/sets/base.tgz,./usr/mdec/boot \
+			netbsd:i386/binary/kernel/netbsd-INSTALL.gz,link
+
+# BOOTFILE.amd64 is relative to CD staging root
+BOOTFILE.amd64=		boot.amd64
+INTFILES.amd64=		boot.amd64:amd64/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660 \
+			boot:amd64/binary/sets/base.tgz,./usr/mdec/boot \
+			netbsd:amd64/binary/kernel/netbsd-INSTALL.gz,link
+
+# macppc has external bootblock generation tool
+EXTFILES.macppc=	macppc.bootxx:macppc/binary/sets/base.tgz,./usr/mdec/bootxx \
+			macppc.ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot
+INTFILES.macppc=	ofwboot.xcf:macppc/installation/ofwboot.xcf,link \
+			ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot \
+			netbsd.macppc:macppc/binary/kernel/netbsd-INSTALL.gz,link \
+			netbsd.601:macppc/binary/kernel/netbsd-INSTALL_601.gz,link
+
+# BOOTFILE.pmax is absolute
+BOOTFILE.pmax=		${EXTFILEDIR}/pmax.bootxx
+EXTFILES.pmax=		pmax.bootxx:pmax/binary/sets/base.tgz,./usr/mdec/bootxx_cd9660
+INTFILES.pmax=		netbsd.pmax:pmax/binary/kernel/netbsd-INSTALL.gz,link \
+			boot.pmax:pmax/binary/sets/base.tgz,./usr/mdec/boot.pmax
+
+# sgimips needs the compressed kernels with short names in /, the various
+# boot files that go into the volume header and the bootblock.h file
+# to grep for the volume header size
+EXTFILES.sgimips=	sgimips.bootblock.h:sgimips/binary/sets/comp.tgz,./usr/include/sys/bootblock.h
+INTFILES.sgimips=	aoutboot:sgimips/binary/sets/base.tgz,./usr/mdec/aoutboot \
+			ip2xboot:sgimips/binary/sets/base.tgz,./usr/mdec/ip2xboot \
+			ip3xboot:sgimips/binary/sets/base.tgz,./usr/mdec/ip3xboot \
+			ip2x:sgimips/binary/kernel/netbsd-INSTALL32_IP2x.gz,link \
+			ip3x:sgimips/binary/kernel/netbsd-INSTALL32_IP3x.gz,link
+
+
+# BOOTFILE.sparc is absolute
+BOOTFILE.sparc=		${EXTFILEDIR}/sparc-boot.fs
+EXTFILES.sparc=		sparc-boot.fs:sparc/installation/bootfs/boot.fs.gz
+INTFILES.sparc=		installation/bootfs/instfs.tgz:sparc/installation/bootfs/instfs.tgz,link
+INTDIRS.sparc=		installation/bootfs
+MKISOFS_ARGS.sparc=	-hide-hfs ./installation -hide-joliet ./installation
+
+# BOOTFILE.sparc64 is absolute
+BOOTFILE.sparc64=	${EXTFILEDIR}/sparc64-boot.fs
+EXTFILES.sparc64=	sparc64-boot.fs:sparc64/installation/misc/boot.fs.gz
+
+# BOOTFILE.vax is absolute
+BOOTFILE.vax=		${EXTFILEDIR}/vax.xxboot
+EXTFILES.vax=		vax.xxboot:vax/binary/sets/base.tgz,./usr/mdec/xxboot
+INTFILES.vax=		netbsd.vax:vax/installation/netboot/install.ram.gz,link \
+			boot.vax:vax/binary/sets/base.tgz,./usr/mdec/boot



CVS commit: [netbsd-9] src/doc

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 09:40:15 UTC 2019

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

Log Message:
Note manual CHANGES changes for ppc 601


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.128 src/doc/CHANGES-9.0:1.1.2.129
--- src/doc/CHANGES-9.0:1.1.2.128	Mon Dec  2 15:03:51 2019
+++ src/doc/CHANGES-9.0	Thu Dec  5 09:40:15 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.128 2019/12/02 15:03:51 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.129 2019/12/05 09:40:15 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6633,3 +6633,6 @@ distrib/notes/common/main			(edited manu
 
 	Add dedication to Matthias Drochner and Eric Schnoebelen.
 
+doc/CHANGES	(edited manually)
+
+	Add macppc powerpc 601 changes.



CVS commit: [netbsd-9] src/doc

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 09:39:03 UTC 2019

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

Log Message:
Belatedly add changes from scole for macppc powerpc 601 machines


To generate a diff of this commit:
cvs rdiff -u -r1.2563.2.1 -r1.2563.2.2 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2563.2.1 src/doc/CHANGES:1.2563.2.2
--- src/doc/CHANGES:1.2563.2.1	Thu Oct 17 19:15:24 2019
+++ src/doc/CHANGES	Thu Dec  5 09:39:03 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2563.2.1 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2563.2.2 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -311,6 +311,8 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	wpa: Import wpa_supplicant and hostapd 2.7. [christos 20190104]
 	acpi(4): Updated ACPICA to 20181213. [christos 20190104]
 	tmux(1): Imported 2.8. [christos 20190104]
+	macppc: Update install media and documentation for powerpc 601
+		machines. [scole 20190107]
 	TrouSerS: Import trousers-0.3.14. [christos 20190107]
 	tpm-tools: Import tpm-tools-1.3.9.1. [christos 20190107]
 	compiler-rt: Import compiler-rt r350590 LLVM sanitizers.



CVS commit: src/doc

2019-12-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec  5 09:36:01 UTC 2019

Modified Files:
src/doc: CHANGES.prev

Log Message:
Belatedly note changes from scole for macppc powerpc 601 machines.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.150 src/doc/CHANGES.prev:1.151
--- src/doc/CHANGES.prev:1.150	Tue Nov 26 07:51:35 2019
+++ src/doc/CHANGES.prev	Thu Dec  5 09:36:01 2019
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.150 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.151 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12517,6 +12517,8 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[christos 20190103]
 	evbarm: Add SMP support for Allwinner multi-cluster SoCs (A83T, A80).
 		[jmcneill 20190103]
+	macppc: Update install media and documentation for powerpc 601
+		machines. [scole 20190107]
 	wpa: Import wpa_supplicant and hostapd 2.7. [christos 20190104]
 	acpi(4): Updated ACPICA to 20181213. [christos 20190104]
 	tmux(1): Imported 2.8. [christos 20190104]



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

2019-12-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec  5 08:00:05 UTC 2019

Modified Files:
src/sys/arch/hppa/include: cpu.h

Log Message:
Attempt to restore Utah $Hdr$


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/include/cpu.h

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

Modified files:

Index: src/sys/arch/hppa/include/cpu.h
diff -u src/sys/arch/hppa/include/cpu.h:1.8 src/sys/arch/hppa/include/cpu.h:1.9
--- src/sys/arch/hppa/include/cpu.h:1.8	Thu Dec  5 03:59:39 2019
+++ src/sys/arch/hppa/include/cpu.h	Thu Dec  5 08:00:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.8 2019/12/05 03:59:39 riastradh Exp $	*/
+/*	$NetBSD: cpu.h,v 1.9 2019/12/05 08:00:05 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $	*/
 
@@ -47,7 +47,7 @@
  * CSL requests users of this software to return to csl-d...@cs.utah.edu any
  * improvements that they make and grant CSL redistribution rights.
  *
- * 	Utah $Hdr$
+ * 	Utah $Hdr: cpu.h 1.19 94/12/16$
  */
 
 #ifndef	_MACHINE_CPU_H_