CVS commit: [netbsd-8] src/doc

2018-12-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 10 17:17:08 UTC 2018

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

Log Message:
Ticket #1133


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.73 src/doc/CHANGES-8.1:1.1.2.74
--- src/doc/CHANGES-8.1:1.1.2.73	Mon Dec 10 08:52:20 2018
+++ src/doc/CHANGES-8.1	Mon Dec 10 17:17:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.73 2018/12/10 08:52:20 bouyer Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.74 2018/12/10 17:17:08 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2036,3 +2036,9 @@ sys/compat/linux/common/linux_socket.c		
 	Fix linux emulation of sendto(2).
 	[tsutsui, ticket #1132]
 
+sys/dev/vnd.c	1.270
+
+	Operation handle_with_strategy() also needs the
+	fstrans_start_lazy() / fstrans_done() bracket.
+	[hannken, ticket #1133]
+



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

2018-12-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 10 17:16:11 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1133):

sys/dev/vnd.c: revision 1.270

Operation handle_with_strategy() also needs the
fstrans_start_lazy() / fstrans_done() bracket.

PR kern/53624 (dom0 freeze on domU exit)


To generate a diff of this commit:
cvs rdiff -u -r1.259.6.4 -r1.259.6.5 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.259.6.4 src/sys/dev/vnd.c:1.259.6.5
--- src/sys/dev/vnd.c:1.259.6.4	Sat Oct 13 17:21:51 2018
+++ src/sys/dev/vnd.c	Mon Dec 10 17:16:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.259.6.4 2018/10/13 17:21:51 martin Exp $	*/
+/*	$NetBSD: vnd.c,v 1.259.6.5 2018/12/10 17:16:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.6.4 2018/10/13 17:21:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.6.5 2018/12/10 17:16:11 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -733,12 +733,17 @@ vndthread(void *arg)
 		bp->b_bcount = obp->b_bcount;
 		BIO_COPYPRIO(bp, obp);
 
+		/* Make sure the request succeeds while suspending this fs. */
+		fstrans_start_lazy(vnd->sc_vp->v_mount);
+
 		/* Handle the request using the appropriate operations. */
 		if ((vnd->sc_flags & VNF_USE_VN_RDWR) == 0)
 			handle_with_strategy(vnd, obp, bp);
 		else
 			handle_with_rdwr(vnd, obp, bp);
 
+		fstrans_done(vnd->sc_vp->v_mount);
+
 		s = splbio();
 		continue;
 
@@ -804,9 +809,6 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 		bp->b_bcount);
 #endif
 
-	/* Make sure the request succeeds while suspending this fs. */
-	fstrans_start_lazy(vp->v_mount);
-
 	/* Issue the read or write operation. */
 	bp->b_error =
 	vn_rdwr(doread ? UIO_READ : UIO_WRITE,
@@ -818,8 +820,6 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 	(void) VOP_PUTPAGES(vp, 0, 0,
 	PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE | PGO_SYNCIO);
 
-	fstrans_done(vp->v_mount);
-
 	/* We need to increase the number of outputs on the vnode if
 	 * there was any write to it. */
 	if (!doread) {



CVS commit: [netbsd-8] src/doc

2018-12-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Dec 10 08:52:21 UTC 2018

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

Log Message:
Corrent CHANGES entry for 1129 (it's mfii(4) not mpii(4)).
Pointed out by Stephen Borrill


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.72 src/doc/CHANGES-8.1:1.1.2.73
--- src/doc/CHANGES-8.1:1.1.2.72	Sat Dec  8 12:27:57 2018
+++ src/doc/CHANGES-8.1	Mon Dec 10 08:52:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.72 2018/12/08 12:27:57 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.73 2018/12/10 08:52:20 bouyer Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2007,7 +2007,7 @@ sys/dev/pci/mfii.c1.1,1.2 (adjusted)
 sys/dev/pci/mpii.c1.13
 sys/dev/pci/mpiireg.h1.1
 
-	Add mpii(4), a driver for LSI Megaraid Fusion controllers.
+	Add mfii(4), a driver for LSI Megaraid Fusion controllers.
 	Ported from OpenBSD.  Note that the earlier fusion controllers
 	(Megaraid 2208, codenamed Thunderbold) are also supported by mfi(4).
 	mpii(4) will take precedence if both drivers are enabled.



CVS commit: [netbsd-8] src/doc

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:27:57 UTC 2018

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

Log Message:
Tickets #1130 - #1132


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.71 src/doc/CHANGES-8.1:1.1.2.72
--- src/doc/CHANGES-8.1:1.1.2.71	Fri Dec  7 19:41:30 2018
+++ src/doc/CHANGES-8.1	Sat Dec  8 12:27:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.71 2018/12/07 19:41:30 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.72 2018/12/08 12:27:57 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2013,3 +2013,26 @@ sys/dev/pci/mpiireg.h1.1
 	mpii(4) will take precedence if both drivers are enabled.
 	[bouyer, ticket #1129]
 
+sys/dev/pci/if_bge.c1.317,1.320
+sys/dev/pci/if_bgereg.h1.94
+sys/dev/pci/if_bgevar.h1.24
+
+	bge(4): fix and workaround hardware bugs in TSO4 support for BCM5720
+	and similar.
+	[bouyer, ticket #1130]
+
+share/man/man4/mpii.41.3,1.4
+sys/dev/pci/mfii.c1.3
+sys/dev/pci/mpii.c1.15-1.18 (adapted)
+sys/dev/pci/mpiireg.h1.2
+
+	sync mpii(4) with OpenBSD, adding support for the SAS3xxx controllers,
+	and making the driver MP-safe.
+	[bouyer, ticket #1131]
+
+sys/compat/linux/common/linux_socket.c		(apply patch, see 1.140,
+		workaround without ABI change)
+
+	Fix linux emulation of sendto(2).
+	[tsutsui, ticket #1132]
+



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

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:24:18 UTC 2018

Modified Files:
src/sys/compat/linux/common [netbsd-8]: linux_socket.c

Log Message:
Apply patch, requested by tsutsui in ticket #1132:

Different solution for the fix in

sys/compat/linux/common/linux_socket.c  rev 1.140

The solution in -current could not be directly used as it required a kernel
version bump and broke the ABI. Work around it differently here.

Fixes linux emulation of sendto(2), PR 53103.


To generate a diff of this commit:
cvs rdiff -u -r1.138.6.2 -r1.138.6.3 \
src/sys/compat/linux/common/linux_socket.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.138.6.2 src/sys/compat/linux/common/linux_socket.c:1.138.6.3
--- src/sys/compat/linux/common/linux_socket.c:1.138.6.2	Sat May 12 10:29:08 2018
+++ src/sys/compat/linux/common/linux_socket.c	Sat Dec  8 12:24:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.138.6.2 2018/05/12 10:29:08 martin Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.2 2018/05/12 10:29:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -401,6 +401,7 @@ linux_sys_sendto(struct lwp *l, const st
 	struct msghdr   msg;
 	struct iovecaiov;
 	struct sockaddr_big nam;
+	struct mbuf *m;
 	int bflags;
 	int error;
 
@@ -415,13 +416,31 @@ linux_sys_sendto(struct lwp *l, const st
 	msg.msg_control = NULL;
 
 	if (SCARG(uap, tolen)) {
+		size_t solen;
+
 		/* Read in and convert the sockaddr */
 		error = linux_get_sa(l, SCARG(uap, s), , SCARG(uap, to),
 		SCARG(uap, tolen));
 		if (error)
 			return (error);
-		msg.msg_name = 
-		msg.msg_namelen = SCARG(uap, tolen);
+
+		/*
+		 * XXX
+		 * Copy sockaddr_big to mbuf because sockargs() called from
+		 * do_sys_sendmsg_so() can't handle sockaddr in msg_name
+		 * already copied into the kernel space.
+		 */
+		solen = nam.sb_len;
+		m = m_get(M_WAIT, MT_SONAME);
+		if (solen > MLEN) {
+			MEXTMALLOC(m, solen, M_WAITOK);
+		}
+		m->m_len = solen;
+		memcpy(mtod(m, void *), , solen);
+
+		msg.msg_flags |= MSG_NAMEMBUF;
+		msg.msg_name = m;
+		msg.msg_namelen = solen;
 	}
 
 	msg.msg_iov = 



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

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:10:22 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1130):

sys/dev/pci/if_bge.c: revision 1.320
sys/dev/pci/if_bgevar.h: revision 1.24
sys/dev/pci/if_bge.c: revision 1.317
sys/dev/pci/if_bgereg.h: revision 1.94

More TSO4 fixes, from the freebsd driver:
- the chip doens't want the lenght of options, but the complete lenght of
  ip headers (ip + tcp + options). Fix this for the BGE_IS_5717_PLUS()
  and BGE_IS_5705_PLUS() cases; FreeBSD doens't cover the last case so
  leave it as is for now. This fixes checksum failures for heavy transfers.
- It looks like the transmit engine hangs if the TCP segment crosses a 4GB
  boundary. FreeBSD fixes it by mapping everything below 4GB; instead
  try detect when this happens and do the bounce only when needed.

With these fixes I could transfers 3GB images over ftp at gigabit speed
(112MB/s with wget) without problems. Tested on a
bge0 at pci4 dev 0 function 0: Broadcom BCM5720 Gigabit Ethernet
bge0: APE firmware NCSI 1.4.22.0
bge0: interrupting at msi1 vec 0
bge0: HW config 002b1194, 6014, 0002aa38,  000c
bge0: ASIC BCM5720 A0 (0x572), Ethernet address d0:94:66:8b:9c:18
bge0: setting short Tx thresholds
brgphy0 at bge0 phy 1: BCM5720C 1000BASE-T media interface, rev. 0

 -

Don't destroy the dma maps if we're not disabling the adapter, avoids
a KASSERT() when bus_dmamap_destroy() is called from interrupt
context via bge_watchdog()

Set IFF_OACTIVE only when bge_encap() fails on adapter ressource shortage.
Otherwise we may set IFF_OACTIVE while no transmit is in progress, and
nothing will clear it.

If bus_dmamap_load_mbuf() fails with EFBIG, m_defrag() the chain and retry.
Refine the check for the 4GB boundary workaround (a fragment should also
not cross the boundary), and do it only for TSO.

If bge_encap() fails and didn't set IFF_OACTIVE, drop the packet.

Bring in more hardware bug workarounds from freebsd.

With these it seems that a BCM5720 A0 can survive a few hours of internet
load with TSO4 enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.310.2.3 -r1.310.2.4 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.93 -r1.93.4.1 src/sys/dev/pci/if_bgereg.h
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/pci/if_bgevar.h

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.310.2.3 src/sys/dev/pci/if_bge.c:1.310.2.4
--- src/sys/dev/pci/if_bge.c:1.310.2.3	Mon Nov 26 17:22:32 2018
+++ src/sys/dev/pci/if_bge.c	Sat Dec  8 12:10:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.310.2.4 2018/12/08 12:10:22 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.4 2018/12/08 12:10:22 martin Exp $");
 
 #include 
 #include 
@@ -233,10 +233,10 @@ static int bge_newbuf_std(struct bge_sof
 			   bus_dmamap_t);
 static int bge_newbuf_jumbo(struct bge_softc *, int, struct mbuf *);
 static int bge_init_rx_ring_std(struct bge_softc *);
-static void bge_free_rx_ring_std(struct bge_softc *);
+static void bge_free_rx_ring_std(struct bge_softc *m, bool);
 static int bge_init_rx_ring_jumbo(struct bge_softc *);
 static void bge_free_rx_ring_jumbo(struct bge_softc *);
-static void bge_free_tx_ring(struct bge_softc *);
+static void bge_free_tx_ring(struct bge_softc *m, bool);
 static int bge_init_tx_ring(struct bge_softc *);
 
 static int bge_chipinit(struct bge_softc *);
@@ -1713,6 +1713,9 @@ bge_newbuf_std(struct bge_softc *sc, int
 	struct bge_rx_bd	*r;
 	int			error;
 
+	if (dmamap == NULL)
+		dmamap = sc->bge_cdata.bge_rx_std_map[i];
+
 	if (dmamap == NULL) {
 		error = bus_dmamap_create(sc->bge_dmatag, MCLBYTES, 1,
 		MCLBYTES, 0, BUS_DMA_NOWAIT, );
@@ -1852,7 +1855,7 @@ bge_init_rx_ring_std(struct bge_softc *s
 }
 
 static void
-bge_free_rx_ring_std(struct bge_softc *sc)
+bge_free_rx_ring_std(struct bge_softc *sc, bool disable)
 {
 	int i;
 
@@ -1863,8 +1866,11 @@ bge_free_rx_ring_std(struct bge_softc *s
 		if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) {
 			m_freem(sc->bge_cdata.bge_rx_std_chain[i]);
 			sc->bge_cdata.bge_rx_std_chain[i] = NULL;
-			bus_dmamap_destroy(sc->bge_dmatag,
-			sc->bge_cdata.bge_rx_std_map[i]);
+			if (disable) {
+bus_dmamap_destroy(sc->bge_dmatag,
+sc->bge_cdata.bge_rx_std_map[i]);
+sc->bge_cdata.bge_rx_std_map[i] = NULL;
+			}
 		}
 		memset((char *)>bge_rdata->bge_rx_std_ring[i], 0,
 		sizeof(struct bge_rx_bd));
@@ -1920,7 +1926,7 @@ bge_free_rx_ring_jumbo(struct bge_softc 
 }
 
 static void

CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:41:30 UTC 2018

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

Log Message:
Annotate ticket #1129 for furhter fixes


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.70 src/doc/CHANGES-8.1:1.1.2.71
--- src/doc/CHANGES-8.1:1.1.2.70	Fri Dec  7 17:13:56 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 19:41:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.70 2018/12/07 17:13:56 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.71 2018/12/07 19:41:30 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1995,10 +1995,11 @@ share/man/man4/Makefile1.673 (patch)
 share/man/man4/mfii.41.1,1.2
 sys/arch/amd64/conf/ALL1.108
 sys/arch/amd64/conf/GENERIC			1.508
-sys/arch/amd64/conf/XEN3_DOM0			1.159 (patch)
+sys/arch/amd64/conf/XEN3_DOM0			1.159
 sys/arch/i386/conf/ALL1.458
 sys/arch/i386/conf/GENERIC			1.1194
-sys/arch/i386/conf/XEN3PAE_DOM0			1.8
+sys/arch/i386/conf/XEN3PAE_DOM0			1.8 (via patch, applied to
+		 XEN3_DOM0)
 sys/dev/ic/mfi.c1.60
 sys/dev/ic/mfireg.h1.9
 sys/dev/pci/files.pci1.410



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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:38:54 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-8]: XEN3_DOM0

Log Message:
Fixup pullups from ticket #1129:

sys/arch/amd64/conf/XEN3_DOM0 rev 1.159
src/sys/arch/i386/conf/XEN3PAE_DOM0 rev 1.8 (via patch)

Add mffii(4)


To generate a diff of this commit:
cvs rdiff -u -r1.135.4.7 -r1.135.4.8 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.112.4.8 -r1.112.4.9 src/sys/arch/i386/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.7 src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.8
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.7	Wed Apr 18 14:45:08 2018
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Fri Dec  7 19:38:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.135.4.7 2018/04/18 14:45:08 martin Exp $
+# $NetBSD: XEN3_DOM0,v 1.135.4.8 2018/12/07 19:38:53 martin Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -519,6 +519,7 @@ dpt*	at pci? dev ? function ?	# DPT Smar
 iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
 isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
 mfi*	at pci? dev ? function ?	# LSI MegaRAID SAS
+mfii*	at pci? dev ? function ?	# LSI MegaRAID SAS (Fusion and newer)
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSILogic 9x9 and 53c1030 (Fusion-MPT)
 mpii*	at pci? dev ? function ?	# LSI Logic Fusion-MPT II

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.8 src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.9
--- src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.8	Wed Apr 18 14:45:08 2018
+++ src/sys/arch/i386/conf/XEN3_DOM0	Fri Dec  7 19:38:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.112.4.8 2018/04/18 14:45:08 martin Exp $
+#	$NetBSD: XEN3_DOM0,v 1.112.4.9 2018/12/07 19:38:53 martin Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -492,6 +492,7 @@ dpt*	at pci? dev ? function ?	# DPT Smar
 iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
 isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
 mfi*	at pci? dev ? function ?	# LSI MegaRAID SAS
+mfii*	at pci? dev ? function ?	# LSI MegaRAID SAS (Fusion and newer)
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSILogic 9x9 and 53c1030 (Fusion-MPT)
 mpii*	at pci? dev ? function ?	# LSI Logic Fusion-MPT II



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 17:13:56 UTC 2018

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

Log Message:
Ticket #1129


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.69 src/doc/CHANGES-8.1:1.1.2.70
--- src/doc/CHANGES-8.1:1.1.2.69	Fri Dec  7 13:28:53 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 17:13:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.69 2018/12/07 13:28:53 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.70 2018/12/07 17:13:56 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1990,3 +1990,25 @@ sys/dev/pci/pcivar.h1.113
 	area when suspending and restore them on resume.
 	[msaitoh, ticket #1128]
 
+distrib/sets/lists/man/mi			1.1628
+share/man/man4/Makefile1.673 (patch)
+share/man/man4/mfii.41.1,1.2
+sys/arch/amd64/conf/ALL1.108
+sys/arch/amd64/conf/GENERIC			1.508
+sys/arch/amd64/conf/XEN3_DOM0			1.159 (patch)
+sys/arch/i386/conf/ALL1.458
+sys/arch/i386/conf/GENERIC			1.1194
+sys/arch/i386/conf/XEN3PAE_DOM0			1.8
+sys/dev/ic/mfi.c1.60
+sys/dev/ic/mfireg.h1.9
+sys/dev/pci/files.pci1.410
+sys/dev/pci/mfii.c1.1,1.2 (adjusted)
+sys/dev/pci/mpii.c1.13
+sys/dev/pci/mpiireg.h1.1
+
+	Add mpii(4), a driver for LSI Megaraid Fusion controllers.
+	Ported from OpenBSD.  Note that the earlier fusion controllers
+	(Megaraid 2208, codenamed Thunderbold) are also supported by mfi(4).
+	mpii(4) will take precedence if both drivers are enabled.
+	[bouyer, ticket #1129]
+



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:28:54 UTC 2018

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

Log Message:
Tickets #1124 - #1128


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.68 src/doc/CHANGES-8.1:1.1.2.69
--- src/doc/CHANGES-8.1:1.1.2.68	Tue Dec  4 12:07:53 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 13:28:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.68 2018/12/04 12:07:53 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.69 2018/12/07 13:28:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1955,3 +1955,38 @@ sys/dev/pci/pcidevs_data.h			(regen)
 	Add 2 Symbios products.
 	[bouyer, ticket #1123]
 
+usr.bin/vmstat/vmstat.11.21,1.22
+
+	Suggest kernhist(9) which is required for vmstat -u and -U.
+	Document that vmstat -w -1 is accepted.
+	[sevan, ticket #1124]
+
+bin/sh/redir.c	1.61
+
+	Fix the <> redirection operator to not truncate the named file.
+	[kre, ticket #1125]
+
+bin/sh/alias.c	1.19
+
+	Avoid core dumps from sh in alias processing.
+	[kre, ticket #1126]
+
+bin/sh/sh.1	1.211 (patch)
+bin/sh/var.c	1.72
+bin/sh/var.h	1.38 (patch)
+
+	Change /bin/sh magic variable semantics, so that if
+	one of them (other than LINENO or RANDOM) is used
+	as a normal variable (by setting it to any value)
+	then that variable loses its special properties, and
+	simply acts like any other variable.  These variables
+	already acted normally (for what that is) if unset.
+	[kre, ticket #1127]
+
+sys/dev/pci/pci.c1.153
+sys/dev/pci/pcivar.h1.113
+
+	Save control registers in PCI-X, PCIe, MSI and MSI-X capability
+	area when suspending and restore them on resume.
+	[msaitoh, ticket #1128]
+



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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:27:19 UTC 2018

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

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

sys/dev/pci/pcivar.h: revision 1.113
sys/dev/pci/pci.c: revision 1.153

  Save control registers in PCI-X, PCIe, MSI and MSI-X capability area when
suspend and restore them when resume. For PCIe capabilities register, it's
required to check the existence of each register to not to write the next area.

  This change fixes a stability of suspend/resume.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.152.6.1 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.109.8.1 -r1.109.8.2 src/sys/dev/pci/pcivar.h

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

Modified files:

Index: src/sys/dev/pci/pci.c
diff -u src/sys/dev/pci/pci.c:1.152 src/sys/dev/pci/pci.c:1.152.6.1
--- src/sys/dev/pci/pci.c:1.152	Wed Apr  5 04:04:54 2017
+++ src/sys/dev/pci/pci.c	Fri Dec  7 13:27:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.c,v 1.152 2017/04/05 04:04:54 msaitoh Exp $	*/
+/*	$NetBSD: pci.c,v 1.152.6.1 2018/12/07 13:27:19 martin Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.152 2017/04/05 04:04:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.152.6.1 2018/12/07 13:27:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -881,7 +881,70 @@ pci_conf_capture(pci_chipset_tag_t pc, p
 	for (off = 0; off < 16; off++)
 		pcs->reg[off] = pci_conf_read(pc, tag, (off * 4));
 
-	return;
+	/* For PCI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIX, , NULL) != 0)
+		pcs->x_csr = pci_conf_read(pc, tag, off + PCIX_CMD);
+
+	/* For PCIe */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIEXPRESS, , NULL) != 0) {
+		pcireg_t xcap = pci_conf_read(pc, tag, off + PCIE_XCAP);
+		unsigned int devtype;
+
+		devtype = PCIE_XCAP_TYPE(xcap);
+		pcs->e_dcr = (uint16_t)pci_conf_read(pc, tag, off + PCIE_DCSR);
+
+		if (PCIE_HAS_LINKREGS(devtype))
+			pcs->e_lcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_LCSR);
+
+		if ((xcap & PCIE_XCAP_SI) != 0)
+			pcs->e_slcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_SLCSR);
+
+		if (PCIE_HAS_ROOTREGS(devtype))
+			pcs->e_rcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_RCR);
+
+		if (__SHIFTOUT(xcap, PCIE_XCAP_VER_MASK) >= 2) {
+			pcs->e_dcr2 = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_DCSR2);
+
+			if (PCIE_HAS_LINKREGS(devtype))
+pcs->e_lcr2 = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_LCSR2);
+
+			/* XXX PCIE_SLCSR2 (It's reserved by the PCIe spec) */
+		}
+	}
+
+	/* For MSI */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSI, , NULL) != 0) {
+		bool bit64, pvmask;
+		
+		pcs->msi_ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+
+		bit64 = pcs->msi_ctl & PCI_MSI_CTL_64BIT_ADDR;
+		pvmask = pcs->msi_ctl & PCI_MSI_CTL_PERVEC_MASK;
+
+		/* Address */
+		pcs->msi_maddr = pci_conf_read(pc, tag, off + PCI_MSI_MADDR);
+		if (bit64)
+			pcs->msi_maddr64_hi = pci_conf_read(pc, tag,
+			off + PCI_MSI_MADDR64_HI);
+
+		/* Data */
+		pcs->msi_mdata = pci_conf_read(pc, tag,
+		off + (bit64 ? PCI_MSI_MDATA64 : PCI_MSI_MDATA));
+
+		/* Per-vector masking */
+		if (pvmask)
+			pcs->msi_mask = pci_conf_read(pc, tag,
+			off + (bit64 ? PCI_MSI_MASK64 : PCI_MSI_MASK));
+	}
+
+	/* For MSI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSIX, , NULL) != 0)
+		pcs->msix_ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
 }
 
 void
@@ -897,7 +960,80 @@ pci_conf_restore(pci_chipset_tag_t pc, p
 			pci_conf_write(pc, tag, (off * 4), pcs->reg[off]);
 	}
 
-	return;
+	/* For PCI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIX, , NULL) != 0)
+		pci_conf_write(pc, tag, off + PCIX_CMD, pcs->x_csr);
+
+	/* For PCIe */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIEXPRESS, , NULL) != 0) {
+		pcireg_t xcap = pci_conf_read(pc, tag, off + PCIE_XCAP);
+		unsigned int devtype;
+
+		devtype = PCIE_XCAP_TYPE(xcap);
+		pci_conf_write(pc, tag, off + PCIE_DCSR, pcs->e_dcr);
+
+		/*
+		 * PCIe capability is variable sized. To not to write the next
+		 * area, check the existence of each register.
+		 */
+		if (PCIE_HAS_LINKREGS(devtype))
+			pci_conf_write(pc, tag, off + PCIE_LCSR, pcs->e_lcr);
+
+		if ((xcap & PCIE_XCAP_SI) != 0)
+			pci_conf_write(pc, tag, off + PCIE_SLCSR, pcs->e_slcr);
+
+		if (PCIE_HAS_ROOTREGS(devtype))
+			pci_conf_write(pc, tag, off + PCIE_RCR, pcs->e_rcr);
+
+		if (__SHIFTOUT(xcap, PCIE_XCAP_VER_MASK) >= 2) {
+			pci_conf_write(pc, tag, off + PCIE_DCSR2, pcs->e_dcr2);
+
+			if (PCIE_HAS_LINKREGS(devtype))
+pci_conf_write(pc, tag, off + PCIE_LCSR2,
+pcs->e_lcr2);
+
+			/* XXX PCIE_SLCSR2 (It's reserved by the PCIe spec) */
+		}
+	}
+
+	/* For MSI */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSI, , NULL) != 0) {
+		pcireg_t reg;
+		bool 

CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:23:49 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: sh.1 var.c var.h

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

bin/sh/var.h: revision 1.38 (via patch)
bin/sh/var.c: revision 1.72
bin/sh/sh.1: revision 1.211 (via patch)

Alter a design botch when magic (self modifying) variables
were added to sh ... in other shells, setting such a variable
(for most of them) causes it to lose its special properties,
and act the same as any other variable.   I had assumed that
was just implementor laziness...   I was wrong.

>From now on the NetBSD shell will act like the others, and if vars
like HOSTNAME (and SECONDS, etc) are used as variables in a script
or whatever, they will act just like normal variables (and unless
this happens when they have been made local, or as a variable-assignment
as a prefix to a command, the special properties they would have had
otherwise are lost for the remainder of the life of the (sub-)shell
in which the variables were set).

Importing a value from the environment counts as setting the
value for this purpose (so if HOSTNAME is set in the environment,
the value there will be the value $HOSTNAME expands to).
The two exceptions to this are LINENO and RANDOM.   RANDOM
needs to be able to be set to (re-)set its seed.  LINENO needs to
be able to be set (at least in the "local" command) to achieve
the desired functionality.   It is unlikely that any (sane) script
is going to want to use those two as normal vars however.

While here, fix a minor bug in popping local vars (fn return) that need
to notify the shell of changes in value (like PATH).
Change sh(1) to reflect this alteration.  Also add doc of the
(forgotten) magic var EUSER (which has been there since the others
were added), and add a few more vars (which are documented
in other places in sh(1) - like ENV) into the defined or used
variable list (as well as wherever else they appear).

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.5 -r1.146.2.6 src/bin/sh/sh.1
cvs rdiff -u -r1.55.2.3 -r1.55.2.4 src/bin/sh/var.c
cvs rdiff -u -r1.28.8.1 -r1.28.8.2 src/bin/sh/var.h

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.146.2.5 src/bin/sh/sh.1:1.146.2.6
--- src/bin/sh/sh.1:1.146.2.5	Wed Oct 25 07:03:10 2017
+++ src/bin/sh/sh.1	Fri Dec  7 13:23:49 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.146.2.5 2017/10/25 07:03:10 snj Exp $
+.\"	$NetBSD: sh.1,v 1.146.2.6 2018/12/07 13:23:49 martin Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2315,6 +2315,21 @@ Making
 local causes any shell options that are changed via the set command inside the
 function to be restored to their original values when the function
 returns.
+If any of the shell's magic variables
+(those which return a value which may vary without
+the variable being explicitly altered,
+e.g.:
+.Dv SECONDS
+or
+.Dv HOSTNAME )
+are made local in a function,
+they will lose their special properties when set
+within the function, including by the
+.Ic local
+command itself
+(if not to be set in the function, there is little point
+in making a variable local)
+but those properties will be restored when the function returns.
 .Pp
 It is an error to use
 .Ic local
@@ -2985,6 +3000,30 @@ above, which are documented further abov
 If unset
 .Dq $HOME/.editrc
 is used.
+.It Ev ENV
+Names the file sourced at startup by the shell.
+Unused by this shell after initialization,
+but is usually passed through the environment to
+descendant shells.
+.It Ev EUSER
+Set to the login name of the effective user id running the shell,
+as returned by
+.Bd -compact -literal -offset indent
+getpwuid(geteuid())->pw_name
+.Ed
+.Po
+See
+.Xr getpwuid 3
+and
+.Xr geteuid 2
+for more details.
+.Pc
+This is obtained each time
+.Ev EUSER
+is expanded, so changes to the shell's execution identity
+cause updates without further action.
+If unset, it returns nothing.
+If set it loses its special properties, and is simply a variable.
 .It Ev HISTSIZE
 The number of lines in the history buffer for the shell.
 .It Ev HOME
@@ -3003,8 +3042,7 @@ This is obtained each time
 is expanded, so changes to the system's name are reflected
 without further action.
 If unset, it returns nothing.
-Setting it does nothing except reverse the effect of an earlier
-.Ic unset .
+If set it loses its special properties, and is simply a variable.
 .It Ev IFS
 Input Field Separators.
 This is normally set to
@@ -3056,6 +3094,22 @@ The default search path for executables.
 See the
 .Sx Path Search
 section above.
+.It Ev POSIXLY_CORRECT
+If set in the environment upon initialization of the shell,
+then the shell option
+.Ic posix
+will be set.
+.Po
+See the description of the
+.Ic set

CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:14:42 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: alias.c

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

bin/sh/alias.c: revision 1.19

Fix the worst of the bugs in alias processing.   This has been in sh
since this code was first imported (May 1994) (ie: before 4.4-Lite)

There is (much) more coming soon (the big ugly comment is going away).

This one has been separated out, as it can easily cause sh
core dumps, so needs:
XXX pullup-8

(the other changes to aliases probably will not get that.)


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

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

Modified files:

Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.15 src/bin/sh/alias.c:1.15.16.1
--- src/bin/sh/alias.c:1.15	Wed Jun 18 18:17:30 2014
+++ src/bin/sh/alias.c	Fri Dec  7 13:14:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $	*/
+/*	$NetBSD: alias.c,v 1.15.16.1 2018/12/07 13:14:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $");
+__RCSID("$NetBSD: alias.c,v 1.15.16.1 2018/12/07 13:14:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -67,17 +67,9 @@ setalias(char *name, char *val)
 {
 	struct alias *ap, **app;
 
+	(void) unalias(name);	/* old one (if any) is now gone */
 	app = hashalias(name);
-	for (ap = *app; ap; ap = ap->next) {
-		if (equal(name, ap->name)) {
-			INTOFF;
-			ckfree(ap->val);
-			ap->val	= savestr(val);
-			INTON;
-			return;
-		}
-	}
-	/* not found */
+
 	INTOFF;
 	ap = ckmalloc(sizeof (struct alias));
 	ap->name = savestr(name);



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:12:02 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: redir.c

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

bin/sh/redir.c: revision 1.61

Fix the <> redirection operator, which has been broken since it was
first implemented in response to PR bin/4966  (PR Feb 1998, fix Feb 1999).

The file named should not be truncated.

No other shell truncates the file (<> was added to FreeBSD sh in Oct 2000,
and did not include O_TRUNC) and POSIX certainly does not suggest that
should happen (just that the file is to be created if it does not exist.)

Bug pointed out in off-list e-mail by Martijn Dekker


To generate a diff of this commit:
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/bin/sh/redir.c

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

Modified files:

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.57.2.1 src/bin/sh/redir.c:1.57.2.2
--- src/bin/sh/redir.c:1.57.2.1	Sun Jul 23 14:58:14 2017
+++ src/bin/sh/redir.c	Fri Dec  7 13:12:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.57.2.1 2017/07/23 14:58:14 snj Exp $	*/
+/*	$NetBSD: redir.c,v 1.57.2.2 2018/12/07 13:12:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.57.2.1 2017/07/23 14:58:14 snj Exp $");
+__RCSID("$NetBSD: redir.c,v 1.57.2.2 2018/12/07 13:12:02 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -283,7 +283,7 @@ openredirect(union node *redir, char mem
 		break;
 	case NFROMTO:
 		fname = redir->nfile.expfname;
-		if ((f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
+		if ((f = open(fname, O_RDWR|O_CREAT, 0666)) < 0)
 			goto ecreate;
 		break;
 	case NTO:



CVS commit: [netbsd-8] src/usr.bin/vmstat

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:09:14 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1124):

usr.bin/vmstat/vmstat.1: revision 1.21
usr.bin/vmstat/vmstat.1: revision 1.22

Suggest kernhist(9) which is required for vmstat -u and -U
Drop Pp before Bl while here.

 -

Document vmstat -w -1 is accepted.
via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.38.1 src/usr.bin/vmstat/vmstat.1

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.1
diff -u src/usr.bin/vmstat/vmstat.1:1.20 src/usr.bin/vmstat/vmstat.1:1.20.38.1
--- src/usr.bin/vmstat/vmstat.1:1.20	Wed Oct 21 22:18:37 2009
+++ src/usr.bin/vmstat/vmstat.1	Fri Dec  7 13:09:14 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmstat.1,v 1.20 2009/10/21 22:18:37 wiz Exp $
+.\"	$NetBSD: vmstat.1,v 1.20.38.1 2018/12/07 13:09:14 martin Exp $
 .\"
 .\" Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
 .\"
-.Dd October 22, 2009
+.Dd December 5, 2018
 .Dt VMSTAT 1
 .Os
 .Sh NAME
@@ -186,12 +186,16 @@ seconds between each display.
 If no repeat
 .Ar count
 is specified, the default is infinity.
+The
+.Nm
+command will accept and honor a negative number of
+.Ar wait
+seconds.
 .El
 .Pp
 By default,
 .Nm
 displays the following information:
-.Pp
 .Bl -tag -width memory
 .It procs
 Information about the numbers of processes in various states.
@@ -288,7 +292,8 @@ apparent which are recomputed every seco
 .Xr ps 1 ,
 .Xr systat 1 ,
 .Xr iostat 8 ,
-.Xr pstat 8
+.Xr pstat 8 ,
+.Xr kernhist 9
 .Pp
 The sections starting with
 .Dq Interpreting system activity



CVS commit: [netbsd-8] src/doc

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 12:07:53 UTC 2018

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

Log Message:
Tickets #1114, #1116-#1123


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.67 -r1.1.2.68 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.67 src/doc/CHANGES-8.1:1.1.2.68
--- src/doc/CHANGES-8.1:1.1.2.67	Fri Nov 30 10:33:44 2018
+++ src/doc/CHANGES-8.1	Tue Dec  4 12:07:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.67 2018/11/30 10:33:44 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.68 2018/12/04 12:07:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1851,3 +1851,107 @@ sys/kern/kern_exit.c1.273
 	Fix info leak.
 	[maxv, ticket #1114]
 
+sys/dev/mii/miidevs1.130,1.131
+sys/dev/miidevs.h(regen)
+sys/dev/miidevs_data.h(regen)
+
+	Sort OUI by number. No functional change.
+	Add ASIX Ax88x9x.
+	Add description for DP83846A.
+	[msaitoh, ticket #1116]
+
+sys/dev/mii/inbmphyreg.h			1.12
+sys/dev/pci/if_wm.c1.597,1.598-1.602
+sys/dev/pci/if_wmreg.h1.109
+
+	- Fix race condition in wm_init_lcd_from_nvm().
+	- Check error status on some register's read/write.
+	- Control TX/RX descriptor snooping control bits on ICH8
+	  and newer.
+	- Disable relax ordering on 82546GB(Device ID 0x1099 and 0x10b5)
+	  or >= ICH8. Same as other OSes.
+	- Add wm_oem_bits_config_ich8lan() to control LPLU and GbE setting
+	  base on the NVM's info. This is for PCH and newer.
+	- Add some PHY workaround for suspend/resume.  This is for ICH8
+	  and newer.
+	- Add i82578 specific link stall workaround.
+	- Add PCH2 specific workaround for link layer's stability.
+	- Add comment. Modify comment.
+	[msaitoh, ticket #1117]
+
+sys/dev/pci/pci_subr.c1.207-1.210
+sys/dev/pci/pcireg.h1.143-1.146
+
+	- Decode PCI Enhanced Allocation.
+	- Fix the definition of PCI MSI vector mask and pending register.
+	  This problem was not a real bug because PCI_MSI{MASK,PENDING} were
+	  not used from anywhere.
+	- The downstream port of PCIe switch is not a root port, so don't
+	  print root port related registers.
+	- Add new macro PCIE_HAS_ROOTREGS(pcie_devtype) and use it. No
+	  functional change.
+	- Add new PCIE_HAS_LINKREGS(pcie_devtype) and use it. No functional
+	  change.
+	[msaitoh, ticket #1118]
+
+sys/dev/pci/pcidevs1.1345-1.1347,1.1349-1.1355
+sys/dev/pci/pcidevs.h(regen)
+sys/dev/pci/pcidevs_data.h			(regen)
+
+	Add some Intel devices. Some of them are found in Core i7-8550U.
+	Add Toshiba's XG4 and XG5 NVMe SSD.
+	Add C62x to the descriptions of Intel C620 series devices.
+	Add 0xa1ca for Intel C629 LPC or eSPI.
+	Add AMD Seattle Host Bridge and PCIE root port devices.
+	Add two other I2C devices of Intel.
+	Add some Intel 100 series and C230 series devices.
+	Add a whole bunch of Cavium ThunderX devices.
+	Add Rockchip vendor ID and a device.
+	Add Amazon.com UART, NVMe, and ENA PCI IDs.
+	[msaitoh, ticket #1119]
+
+sys/arch/x86/include/specialreg.h		1.132-1.136
+sys/arch/x86/x86/cpu_topology.c			1.14
+usr.sbin/cpuctl/arch/i386.c			1.85-1.90
+
+	Add MAWAU (for BND{LD,ST}X instruction) from the latest Intel SDM.
+	AMD also has CPUID 0x06 and 0x0d.
+	PCOMMIT was obsoleted.
+	Use ci_feat_val[7] as CPUID 7 %edx to match x86/cpu.h
+	AMD also has CPUID 6.
+	Remove unused code for coretemp.
+	Consistently use descs[] instead of data[].
+	AMD also reports CPUID 7's highest subleaf. Print it.
+	Add Intel CPUID Extended Topology Enumeration Fn000b definitions.
+	Add Intel/AMD MONITOR/MWAIT leaf.
+	Add Intel CPUID Architectural Performance Monitoring leaf Fn000a.
+	Print Intel CPUID Architectural Performance Monitoring leaf Fn000a.
+	[msaitoh, ticket #1120]
+
+usr.sbin/acpitool/acpidump/acpi.c		1.30-1.37, 1.39 via patch
+usr.sbin/acpitool/acpidump/acpidump.8		1.11-1.13 via patch
+
+	- Add ACPI LPIT (Low Power Idle Table) from FreeBSD r336185.
+	- Decode DMAR's ANDD (ACPI Name Space).
+	- Add X2APIC_MODE flag of DMAR.
+	- Remove extra newline in SPMI table.
+	- FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.
+	- Print SPCR's Interface Type and ARMH GIC Interrupt Type.
+	- Decode Generic Timer Description Table(GTDT).
+	- Don't print PM_TMR_BLK if the value is 0.
+	- Don't print X_PM_TMR_BLK if the address value is 0.
+	- Decode CSRT (Core System Resources Table).
+	[msaitoh, ticket #1121]
+
+sys/dev/ld.c	1.105
+
+	Take kernel lock for ioctl calls when backend isn't tagged MPSAFE.
+	[mlelstv, ticket #1122]
+
+sys/dev/pci/pcidevs1.1356
+sys/dev/pci/pcidevs.h(regen)
+sys/dev/pci/pcidevs_data.h			(regen)
+
+	Add 2 Symbios products.
+	[bouyer, ticket #1123]
+



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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 12:04:02 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1123


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.11 -r1.1281.2.12 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.11 -r1.1280.2.12 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1281.2.11 src/sys/dev/pci/pcidevs.h:1.1281.2.12
--- src/sys/dev/pci/pcidevs.h:1.1281.2.11	Tue Dec  4 11:43:54 2018
+++ src/sys/dev/pci/pcidevs.h	Tue Dec  4 12:03:43 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1281.2.11 2018/12/04 11:43:54 martin Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1281.2.12 2018/12/04 12:03:43 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1289.2.11 2018/12/04 11:34:59 martin Exp
+ *	NetBSD: pcidevs,v 1.1289.2.12 2018/12/04 12:02:12 martin Exp
  */
 
 /*
@@ -5842,9 +5842,11 @@
 #define	PCI_PRODUCT_SYMBIOS_SAS3108_4	0x0095		/* SAS3108 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3004	0x0096		/* SAS3004 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3008	0x0097		/* SAS3008 */
-#define	PCI_PRODUCT_SYMBIOS_SAS3516	0x00ab		/* SAS3516 */
+#define	PCI_PRODUCT_SYMBIOS_SAS3516	0x00aa		/* SAS3516 */
+#define	PCI_PRODUCT_SYMBIOS_SAS3516_1	0x00ab		/* SAS3516 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3416	0x00ac		/* SAS3416 */
-#define	PCI_PRODUCT_SYMBIOS_SAS3508	0x00ae		/* SAS3508 */
+#define	PCI_PRODUCT_SYMBIOS_SAS3508	0x00ad		/* SAS3508 */
+#define	PCI_PRODUCT_SYMBIOS_SAS3508_1	0x00ae		/* SAS3508 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3408	0x00af		/* SAS3408 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3504	0x00be		/* SAS3504 */
 #define	PCI_PRODUCT_SYMBIOS_SAS3404	0x00bf		/* SAS3404 */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1280.2.11 src/sys/dev/pci/pcidevs_data.h:1.1280.2.12
--- src/sys/dev/pci/pcidevs_data.h:1.1280.2.11	Tue Dec  4 11:43:54 2018
+++ src/sys/dev/pci/pcidevs_data.h	Tue Dec  4 12:03:43 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1280.2.11 2018/12/04 11:43:54 martin Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1280.2.12 2018/12/04 12:03:43 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1289.2.11 2018/12/04 11:34:59 martin Exp
+ *	NetBSD: pcidevs,v 1.1289.2.12 2018/12/04 12:02:12 martin Exp
  */
 
 /*
@@ -10214,10 +10214,14 @@ static const uint16_t pci_products[] = {
 	27572, 0,
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3516, 
 	27388, 0,
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3516_1, 
+	27388, 0,
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3416, 
 	27396, 0,
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3508, 
 	27404, 0,
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3508_1, 
+	27404, 0,
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3408, 
 	27412, 0,
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3504, 
@@ -17145,9 +17149,9 @@ static const char pci_words[] = { "." 
 	"53c1510\0" /* 1 refs @ 27364 */
 	"53c895A\0" /* 1 refs @ 27372 */
 	"53c875A\0" /* 1 refs @ 27380 */
-	"SAS3516\0" /* 2 refs @ 27388 */
+	"SAS3516\0" /* 3 refs @ 27388 */
 	"SAS3416\0" /* 2 refs @ 27396 */
-	"SAS3508\0" /* 2 refs @ 27404 */
+	"SAS3508\0" /* 3 refs @ 27404 */
 	"SAS3408\0" /* 2 refs @ 27412 */
 	"SAS3504\0" /* 2 refs @ 27420 */
 	"SAS3404\0" /* 2 refs @ 27428 */



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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 12:02:12 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1123):

sys/dev/pci/pcidevs: revision 1.1356

Add 2 Symbios products, from OpenBSD


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

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1289.2.11 src/sys/dev/pci/pcidevs:1.1289.2.12
--- src/sys/dev/pci/pcidevs:1.1289.2.11	Tue Dec  4 11:34:59 2018
+++ src/sys/dev/pci/pcidevs	Tue Dec  4 12:02:12 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.11 2018/12/04 11:34:59 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.12 2018/12/04 12:02:12 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5835,9 +5835,11 @@ product SYMBIOS SAS3108_3		0x0094	SAS310
 product SYMBIOS SAS3108_4		0x0095	SAS3108
 product SYMBIOS SAS3004			0x0096	SAS3004
 product SYMBIOS SAS3008			0x0097	SAS3008
-product	SYMBIOS	SAS3516			0x00ab	SAS3516
+product SYMBIOS SAS3516			0x00aa  SAS3516
+product	SYMBIOS	SAS3516_1		0x00ab	SAS3516
 product	SYMBIOS	SAS3416			0x00ac	SAS3416
-product	SYMBIOS	SAS3508			0x00ae	SAS3508
+product	SYMBIOS	SAS3508			0x00ad	SAS3508
+product SYMBIOS SAS3508_1		0x00ae  SAS3508
 product	SYMBIOS	SAS3408			0x00af	SAS3408
 product	SYMBIOS	SAS3504			0x00be	SAS3504
 product	SYMBIOS	SAS3404			0x00bf	SAS3404



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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 12:00:42 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1122):

sys/dev/ld.c: revision 1.105

take kernel lock for ioctl calls when backend isn't tagged MPSAFE.


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

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

Modified files:

Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.101.2.1 src/sys/dev/ld.c:1.101.2.2
--- src/sys/dev/ld.c:1.101.2.1	Fri Sep  1 09:59:10 2017
+++ src/sys/dev/ld.c	Tue Dec  4 12:00:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld.c,v 1.101.2.1 2017/09/01 09:59:10 martin Exp $	*/
+/*	$NetBSD: ld.c,v 1.101.2.2 2018/12/04 12:00:41 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.101.2.1 2017/09/01 09:59:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.101.2.2 2018/12/04 12:00:41 martin Exp $");
 
 #include 
 #include 
@@ -369,7 +369,11 @@ ldioctl(dev_t dev, u_long cmd, void *add
 		return (error);
 
 	if (sc->sc_ioctl) {
+		if ((sc->sc_flags & LDF_MPSAFE) == 0)
+			KERNEL_LOCK(1, curlwp);
 		error = (*sc->sc_ioctl)(sc, cmd, addr, flag, 0);
+		if ((sc->sc_flags & LDF_MPSAFE) == 0)
+			KERNEL_UNLOCK_ONE(curlwp);
 		if (error != EPASSTHROUGH)
 			return (error);
 	}
@@ -388,7 +392,11 @@ ld_flush(device_t self, bool poll)
 	struct ld_softc *sc = device_private(self);
 
 	if (sc->sc_ioctl) {
+		if ((sc->sc_flags & LDF_MPSAFE) == 0)
+			KERNEL_LOCK(1, curlwp);
 		error = (*sc->sc_ioctl)(sc, DIOCCACHESYNC, NULL, 0, poll);
+		if ((sc->sc_flags & LDF_MPSAFE) == 0)
+			KERNEL_UNLOCK_ONE(curlwp);
 		if (error != 0)
 			device_printf(self, "unable to flush cache\n");
 	}



CVS commit: [netbsd-8] src/usr.sbin/acpitools/acpidump

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:58:11 UTC 2018

Modified Files:
src/usr.sbin/acpitools/acpidump [netbsd-8]: acpi.c acpidump.8

Log Message:
Pull up the following, requested by msaitoh in ticket #1121:

usr.sbin/acpitool/acpidump/acpi.c   1.30-1.37, 1.39 via 
patch
usr.sbin/acpitool/acpidump/acpidump.8   1.11-1.13 via patch

- Add ACPI LPIT (Low Power Idle Table) from FreeBSD r336185.
- Decode DMAR's ANDD (ACPI Name Space).
- Add X2APIC_MODE flag of DMAR.
- Remove extra newline in SPMI table.
- FACS is optional if the HW_REDUCED_ACPI flag is set in the FADT.
- Print SPCR's Interface Type and ARMH GIC Interrupt Type.
- Decode Generic Timer Description Table(GTDT).
- Don't print PM_TMR_BLK if the value is 0.
- Don't print X_PM_TMR_BLK if the address value is 0.
- Decode CSRT (Core System Resources Table).


To generate a diff of this commit:
cvs rdiff -u -r1.15.8.1 -r1.15.8.2 src/usr.sbin/acpitools/acpidump/acpi.c
cvs rdiff -u -r1.7.18.1 -r1.7.18.2 src/usr.sbin/acpitools/acpidump/acpidump.8

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

Modified files:

Index: src/usr.sbin/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.15.8.1 src/usr.sbin/acpitools/acpidump/acpi.c:1.15.8.2
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.15.8.1	Wed Nov 22 15:54:09 2017
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Tue Dec  4 11:58:10 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.15.8.1 2017/11/22 15:54:09 martin Exp $ */
+/* $NetBSD: acpi.c,v 1.15.8.2 2018/12/04 11:58:10 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.15.8.1 2017/11/22 15:54:09 martin Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.15.8.2 2018/12/04 11:58:10 martin Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __RCSID("$NetBSD: acpi.c,v 1.15.8.1 2017
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,7 +54,11 @@ __RCSID("$NetBSD: acpi.c,v 1.15.8.1 2017
 #define BEGIN_COMMENT	"/*\n"
 #define END_COMMENT	" */\n"
 
+/* Commonly used helper functions */
 static void	acpi_print_string(char *s, size_t length);
+static void	acpi_print_tabs(unsigned int n);
+static void	acpi_dump_bytes(uint8_t *p, uint32_t len, unsigned int ntabs);
+static void	acpi_dump_table(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_gas(ACPI_GENERIC_ADDRESS *gas);
 static void	acpi_print_pci(uint16_t vendorid, uint16_t deviceid,
 		uint8_t seg, uint8_t bus, uint8_t device, uint8_t func);
@@ -68,6 +73,8 @@ static void	acpi_print_whea(ACPI_WHEA_HE
 		void (*print_ins)(ACPI_WHEA_HEADER *),
 		void (*print_flags)(ACPI_WHEA_HEADER *));
 static uint64_t	acpi_select_address(uint32_t, uint64_t);
+
+/* Handlers for each table */
 static void	acpi_handle_fadt(ACPI_TABLE_HEADER *fadt);
 static void	acpi_print_cpu(u_char cpu_id);
 static void	acpi_print_cpu_uid(uint32_t uid, char *uid_string);
@@ -81,11 +88,14 @@ static void	acpi_print_madt(ACPI_SUBTABL
 static void	acpi_handle_bert(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_boot(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_cpep(ACPI_TABLE_HEADER *sdp);
+static void	acpi_handle_csrt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_dbgp(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_dbg2(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_einj(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_erst(ACPI_TABLE_HEADER *sdp);
+static void	acpi_handle_gtdt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_hest(ACPI_TABLE_HEADER *sdp);
+static void	acpi_handle_lpit(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_madt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_msct(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_ecdt(ACPI_TABLE_HEADER *sdp);
@@ -110,7 +120,6 @@ static void	acpi_handle_wdat(ACPI_TABLE_
 static void	acpi_handle_wddt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_wdrt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_sdt(ACPI_TABLE_HEADER *sdp);
-static void	acpi_dump_bytes(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_fadt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_print_facs(ACPI_TABLE_FACS *facs);
 static void	acpi_print_dsdt(ACPI_TABLE_HEADER *dsdp);
@@ -210,7 +219,7 @@ acpi_print_string(char *s, size_t length
 static void
 acpi_print_gas(ACPI_GENERIC_ADDRESS *gas)
 {
-	switch(gas->SpaceId) {
+	switch (gas->SpaceId) {
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
 		if (gas->BitWidth <= 32)
 			printf("0x%08x:%u[%u] (Memory)",
@@ -813,11 +822,16 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp)
 	fadt = (ACPI_TABLE_FADT *)sdp;
 	acpi_print_fadt(sdp);
 
-	facs = (ACPI_TABLE_FACS *)acpi_map_sdt(
-		acpi_select_address(fadt->Facs, fadt->XFacs));
-	if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64)
-		errx(EXIT_FAILURE, "FACS is corrupt");
-	acpi_print_facs(facs);
+	if (acpi_select_address(fadt->Facs, fadt->XFacs) == 0) {
+		if 

CVS commit: [netbsd-8] src

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:52:57 UTC 2018

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/sys/arch/x86/x86 [netbsd-8]: cpu_topology.c
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

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

usr.sbin/cpuctl/arch/i386.c: revision 1.85
usr.sbin/cpuctl/arch/i386.c: revision 1.86
usr.sbin/cpuctl/arch/i386.c: revision 1.87
usr.sbin/cpuctl/arch/i386.c: revision 1.88
usr.sbin/cpuctl/arch/i386.c: revision 1.89
usr.sbin/cpuctl/arch/i386.c: revision 1.90
sys/arch/x86/include/specialreg.h: revision 1.132
sys/arch/x86/include/specialreg.h: revision 1.133
sys/arch/x86/include/specialreg.h: revision 1.134
sys/arch/x86/include/specialreg.h: revision 1.135
sys/arch/x86/include/specialreg.h: revision 1.136
sys/arch/x86/x86/cpu_topology.c: revision 1.14

  Add MAWAU (for BND{LD,ST}X instruction) from the latest Intel SDM.

  Whitespace fix. No functional change.

Modify comment. No functional change:
- AMD also has CPUID 0x06 and 0x0d.
- PCOMMIT was obsoleted.
- Use ci_feat_val[7] as CPUID 7 %edx to match x86/cpu.h
- AMD also has CPUID 6.
- Remove unused code for coretemp.
- Consistently use descs[] instead of data[].
- AMD also reports CPUID 7's highest subleaf. Print it.
- Use macro.
  Add Intel CPUID Extended Topology Enumeration Fn000b definitions.
  Decode package, core and SMT id if CPUID 0x0b is available on Intel processor.

If the value is different from the kernel value, we should fix the kernel code.

TODO: Use 0x1f if it's available.

  Add Intel/AMD MONITOR/MWAIT leaf.
  Decode Intel/AMD MONITOR/MWAIT leaf.

  Add Intel CPUID Architectural Performance Monitoring leaf Fn000a.

  Print Intel CPUID Architectural Performance Monitoring leaf Fn000a.


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.7 -r1.98.2.8 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.9.22.2 -r1.9.22.3 src/sys/arch/x86/x86/cpu_topology.c
cvs rdiff -u -r1.74.6.3 -r1.74.6.4 src/usr.sbin/cpuctl/arch/i386.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/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.98.2.7 src/sys/arch/x86/include/specialreg.h:1.98.2.8
--- src/sys/arch/x86/include/specialreg.h:1.98.2.7	Sun Sep 23 17:35:33 2018
+++ src/sys/arch/x86/include/specialreg.h	Tue Dec  4 11:52:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.98.2.7 2018/09/23 17:35:33 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.98.2.8 2018/12/04 11:52:57 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -282,7 +282,25 @@
 #define CPUID_DCP_COMPLEX	__BIT(2)	/* Complex cache indexing */
 
 /*
- * Intel Digital Thermal Sensor and
+ * Intel/AMD MONITOR/MWAIT
+ * Fn_0005
+ */
+/* %eax */
+#define CPUID_MON_MINSIZE	__BITS(15, 0)  /* Smallest monitor-line size */
+/* %ebx */
+#define CPUID_MON_MAXSIZE	__BITS(15, 0)  /* Largest monitor-line size */
+/* %ecx */
+#define CPUID_MON_EMX		__BIT(0)   /* MONITOR/MWAIT Extensions */
+#define CPUID_MON_IBE		__BIT(1)   /* Interrupt as Break Event */
+
+#define CPUID_MON_FLAGS	"\20" \
+	"\1" "EMX"	"\2" "IBE"
+
+/* %edx: number of substates for specific C-state */
+#define CPUID_MON_SUBSTATE(edx, cstate) (((edx) >> (cstate * 4)) & 0x000f)
+
+/*
+ * Intel/AMD Digital Thermal Sensor and
  * Power Management, Fn_0006 - %eax.
  */
 #define CPUID_DSPM_DTS	__BIT(0)	/* Digital Thermal Sensor */
@@ -313,7 +331,7 @@
 	"25" "HWP_IGNIDL"
 
 /*
- * Intel Digital Thermal Sensor and
+ * Intel/AMD Digital Thermal Sensor and
  * Power Management, Fn_0006 - %ecx.
  */
 #define CPUID_DSPM_HWF	0x0001	/* MSR_APERF/MSR_MPERF available */
@@ -322,7 +340,7 @@
 #define CPUID_DSPM_FLAGS1	"\20" "\1" "HWF" "\4" "EPB"
 
 /*
- * Intel Structured Extended Feature leaf Fn_0007
+ * Intel/AMD Structured Extended Feature leaf Fn_0007
  * %eax == 0: Subleaf 0
  *	%eax: The Maximum input value for supported subleaf.
  *	%ebx: Feature bits.
@@ -353,6 +371,7 @@
 #define CPUID_SEF_ADX		__BIT(19) /* ADCX/ADOX instructions */
 #define CPUID_SEF_SMAP		__BIT(20) /* Supervisor-Mode Access Prevention */
 #define CPUID_SEF_AVX512_IFMA	__BIT(21) /* AVX-512 Integer Fused Multiply Add */
+/* Bit 22 was PCOMMIT */
 #define CPUID_SEF_CLFLUSHOPT	__BIT(23) /* Cache Line FLUSH OPTimized */
 #define CPUID_SEF_CLWB		__BIT(24) /* Cache Line Write Back */
 #define CPUID_SEF_PT		__BIT(25) /* Processor Trace */
@@ -386,16 +405,18 @@
 #define CPUID_SEF_AVX512_VNNI	__BIT(11) /* Vector neural Network Instruction */
 #define CPUID_SEF_AVX512_BITALG	__BIT(12)
 #define CPUID_SEF_AVX512_VPOPCNTDQ __BIT(14)
+#define CPUID_SEF_MAWAU		__BITS(21, 17) /* MAWAU for BND{LD,ST}X */
 #define CPUID_SEF_RDPID		__BIT(22) 

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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:44:13 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
Regen for #1119


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.10 -r1.1281.2.11 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.10 -r1.1280.2.11 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:35:00 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

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

sys/dev/pci/pcidevs: revision 1.1350
sys/dev/pci/pcidevs: revision 1.1351
sys/dev/pci/pcidevs: revision 1.1352
sys/dev/pci/pcidevs: revision 1.1353
sys/dev/pci/pcidevs: revision 1.1354
sys/dev/pci/pcidevs: revision 1.1355
sys/dev/pci/pcidevs: revision 1.1345
sys/dev/pci/pcidevs: revision 1.1346
sys/dev/pci/pcidevs: revision 1.1347
sys/dev/pci/pcidevs: revision 1.1349

  Add some Intel devices. Some of them are found in Core i7-8550U.

  Add Toshiba's XG4 and XG5 NVMe SSD.

- Add C62x to the descriptions of Intel C620 series devices.
- Add 0xa1ca for Intel C629 LPC or eSPI.

Add AMD Seattle Host Bridge and PCIE root port devices

Add two otehr I2C devices of Intel.

"s/ are are / are /" in comment. No functional change.

Add some Intel 100 series and C230 series devices.

Add a whole bunch of Cavium ThunderX devices

Add Rockchip vendor ID and a device. Requested by jak@
 From OpenBSD

Add Amazon.com UART, NVMe, and ENA PCI IDs.


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

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1289.2.10 src/sys/dev/pci/pcidevs:1.1289.2.11
--- src/sys/dev/pci/pcidevs:1.1289.2.10	Wed Oct 17 13:45:31 2018
+++ src/sys/dev/pci/pcidevs	Tue Dec  4 11:34:59 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.10 2018/10/17 13:45:31 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.11 2018/12/04 11:34:59 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -649,6 +649,8 @@ vendor QINHENG2		0x1c00	Nanjing QinHeng 
 vendor SYMPHONY2	0x1c1c	Symphony Labs (2nd PCI Vendor ID)
 vendor HGST		0x1c58	HGST, Inc.
 vendor BEIJING_MEMBLAZE	0x1c5f	Beijing Memblaze Technology Co. Ltd.
+vendor AMAZON		0x1d0f	Amazon.com, Inc.
+vendor ROCKCHIP		0x1d87	Rockchip
 vendor TEKRAM2		0x1de1	Tekram Technology (2nd PCI Vendor ID)
 vendor SUNIX2		0x1fd4	SUNIX Co
 vendor HINT		0x3388	HiNT
@@ -953,6 +955,11 @@ product ALTIMA AC1001	0x03e9	AC1001 Giga
 product ALTIMA AC9100	0x03ea	AC9100 Gigabit Ethernet
 product ALTIMA AC1003	0x03eb	AC1003 Gigabit Ethernet
 
+/* Amazon.com, Inc. products */
+product AMAZON UART	0x8250	16650-compatible UART
+product AMAZON NVME	0x8061	NVMe SSD
+product AMAZON ENA	0xec20	Elastic Network Adapter
+
 /* AMD products */
 product AMD AMD64_HT	0x1100	K8 AMD64 HyperTransport Configuration
 product AMD AMD64_ADDR	0x1101	K8 AMD64 Address Map Configuration
@@ -1042,6 +1049,9 @@ product AMD F12_GPP0	0x1709	Family12h GP
 product AMD F14_MISC	0x1716	Family12h/14h Misc. Configuration
 product AMD F14_HB18	0x1718	Family12h/14h Host Bridge
 product AMD F14_HB19	0x1719	Family12h/14h Host Bridge
+product AMD SEATTLE_PCHB_1	0x1a00	Seattle Host Bridge
+product AMD SEATTLE_PCHB_2	0x1a01	Seattle Host Bridge
+product AMD SEATTLE_PCIE	0x1a02	Seattle PCIE Root Port
 product AMD PCNET_PCI	0x2000	PCnet-PCI Ethernet
 product AMD PCNET_HOME	0x2001	PCnet-Home HomePNA Ethernet
 product AMD AM_1771_MBW	0x2003	Alchemy AM 1771 MBW
@@ -1932,7 +1942,58 @@ product BUSLOGIC FLASHPOINT	0x8130	Flash
 product C4T GPPCI		0x6773	GPPCI
 
 /* Cavium products */
-product CAVIUM NITROX		0x0001	Nitrox XL
+product CAVIUM NITROX			0x0001	Nitrox XL
+product CAVIUM THUNDERX_MRML		0xa001	Master RML Bridge to RSL devices
+product CAVIUM THUNDERX_PCIB		0xa002	PCI Bridge
+product CAVIUM THUNDERX_RESET		0xa00e	Reset Controller
+product CAVIUM THUNDERX_RNG		0xa018	Random Number Generator
+product CAVIUM THUNDERX_XHCI		0xa01b	xHCI USB Controller
+product CAVIUM THUNDERX_AHCI		0xa01c	AHCI SATA Controller
+product CAVIUM THUNDERX_RAID		0xa01d	RAID Coprocessor
+product CAVIUM THUNDERX_NIC		0xa01e	Network Interface Controller
+product CAVIUM THUNDERX_TNS		0xa01f	Traffic Network Switch
+product CAVIUM THUNDERX_LMC		0xa022	DRAM Controller
+product CAVIUM THUNDERX_BGX		0xa026	Common Ethernet Interface
+product CAVIUM THUNDERX_L2C_TAD		0xa02e	Level 2 cache tag and data
+product CAVIUM THUNDERX_L2C_CBC		0xa02f	L2C-CBC
+product CAVIUM THUNDERX_L2C_MCI		0xa030	L2C-MCI
+
+product CAVIUM THUNDERX_SMMU		0xa008	SMMU
+product CAVIUM THUNDERX_GIC		0xa009	Generic Interrupt Controller
+product CAVIUM THUNDERX_GPIO		0xa00a	GPIO Controller
+product CAVIUM THUNDERX_MPI_SPI		0xa00b	MPI / SPI Controller
+product CAVIUM THUNDERX_MIO_PTP		0xa00c	MIO-PTP Controller
+product CAVIUM THUNDERX_MIX		0xa00d	MIX Network Controller
+product CAVIUM THUNDERX_UART		0xa00f	UART Controller
+product CAVIUM THUNDERX_EMMC_SD		0xa010	eMMC/SD Controller
+product CAVIUM THUNDERX_MIO_BOOT	0xa011	MIO-BOOT Controller
+product CAVIUM THUNDERX_TWSI_I2C	0xa012	TWSI / I2C 

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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:29:41 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c pcireg.h

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

sys/dev/pci/pci_subr.c: revision 1.210
sys/dev/pci/pci_subr.c: revision 1.207
sys/dev/pci/pcireg.h: revision 1.143
sys/dev/pci/pci_subr.c: revision 1.208
sys/dev/pci/pcireg.h: revision 1.144
sys/dev/pci/pci_subr.c: revision 1.209
sys/dev/pci/pcireg.h: revision 1.145
sys/dev/pci/pcireg.h: revision 1.146

  Decode PCI Enhanced Allocation.

  The register offset of the mask and pending register is depend on the 64bit
address capable bit, so fix the definition of PCI MSI vector mask and pending
register. This problem was not a real bug because PCI_MSI{MASK,PENDING} were
not used from anywhere.

  The downstream port of PCIe switch is not a root port, so don't print
root port related register. For example, Intel 63xxESB controller's
downstream port device was printed by pcictl(8) with this bug:

-
PCI configuration registers:
   Common header:
 0x00: 0x35108086 0x00100147 0x06040001 0x00010010
 Vendor Name: Intel (0x8086)
 Device Name: 63xxESB PCI Express Downstream Port #1 (0x3510)
(snip)
   Capability register at 0x44   <=
 type: 0x10 (PCI Express)
   Capability register at 0x60   <= 0x60 - 0x44 = 0x1c
 type: 0x05 (MSI)
   Capability register at 0x70
 type: 0x01 (Power Management)
   Capability register at 0x80
 type: 0x0d (Subsystem vendor ID)
(snip)
   PCI Message Signaled Interrupt
 Message Control register: 0x0080
   MSI Enabled: off
   Multiple Message Capable: no (1 vector)
   Multiple Message Enabled: off (1 vector)
   64 Bit Address Capable: on
   Per-Vector Masking Capable: off
   Extended Message Data Capable: off
   Extended Message Data Enable: off
 Message Address (lower) register: 0x
 Message Address (upper) register: 0x
 Message Data register: 0x
(snip)
   PCI Express Capabilities Register
(snip)
 Root Control Register: 0x7005  <=== 0x7005 is the first two byte
   SERR on Correctable Error Enable: on   of the MSI capability structure
   SERR on Non-Fatal Error Enable: off
   SERR on Fatal Error Enable: on
   PME Interrupt Enable: off
   CRS Software Visibility Enable: off
 Root Capability Register: 0x0080
   CRS Software Visibility: off
 Root Status Register: 0x
   PME Requester ID: 0x
   PME was asserted: off
   another PME is pending: off
   Device-dependent header:
 0x40: 0x00c0 0x00616010 0x0001 0x5026  |   |<- PCIe  |
 0x50: 0x0203f441 0x10010020 0x 0x004803c0  |   ->|
 0x60: 0x00807005 0x 0x 0x  |<- MSI ->|
 0x70: 0xc8028001 0x0100 0x 0x  |<- PM  ->|
 0x80: 0x000d 0x 0x 0x  |<- subsystem ID  |
--

  Add new macro PCIE_HAS_ROOTREGS(pcie_devtype) and use it. No functional
change.

  Add new PCIE_HAS_LINKREGS(pcie_devtype) and use it. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.8 -r1.183.2.9 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.130.2.7 -r1.130.2.8 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.183.2.8 src/sys/dev/pci/pci_subr.c:1.183.2.9
--- src/sys/dev/pci/pci_subr.c:1.183.2.8	Tue Oct 30 09:32:32 2018
+++ src/sys/dev/pci/pci_subr.c	Tue Dec  4 11:29:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.183.2.8 2018/10/30 09:32:32 sborrill Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.183.2.9 2018/12/04 11:29:41 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.8 2018/10/30 09:32:32 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.9 2018/12/04 11:29:41 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1756,9 +1756,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 {
 	pcireg_t reg; /* for each register */
 	pcireg_t val; /* for each bitfield */
-	bool check_link = true;
 	bool check_slot = false;
-	bool check_rootport = false;
+	unsigned int pcie_devtype;
 	bool check_upstreamport = false;
 	unsigned int pciever;
 	unsigned int i;
@@ -1770,7 +1769,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	pciever = (unsigned int)(PCIE_XCAP_VER(reg));
 	printf("  Capability version: %u\n", pciever);
 	printf("  Device type: ");
-	switch (PCIE_XCAP_TYPE(reg)) {
+	pcie_devtype = PCIE_XCAP_TYPE(reg);
+	switch (pcie_devtype) {
 	case 

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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:21:33 UTC 2018

Modified Files:
src/sys/dev/mii [netbsd-8]: inbmphyreg.h
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

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

sys/dev/pci/if_wmreg.h: revision 1.109
sys/dev/pci/if_wm.c: revision 1.597
sys/dev/pci/if_wm.c: revision 1.598
sys/dev/mii/inbmphyreg.h: revision 1.12
sys/dev/pci/if_wm.c: revision 1.600
sys/dev/pci/if_wm.c: revision 1.601
sys/dev/pci/if_wm.c: revision 1.602

- Add new wm_gmii_{hv,i82544}_{read,write}reg_locked() and use them in
   wm_gmii_{hv,i82544}_{read,write}reg(). *_locked() functions are not
   mii(4) API functions, so it's not required to keep the mii API. Change
   the PHY register type from int to uint16_t. It also change the usage of
   return value. It returns zero on success and non-zero on error.
- Check the return value of *_locked() function and treat it.
- Use *writereg_locked() function to reduce race condition in
   wm_init_lcd_from_nvm().
- Add comment.
- Control TX/RX descriptor snooping control bits on ICH8 and newer.
   Only on ICH8, No-snoop bits are opposite polarity. On my Thinkpad X61,
   the default value of this bits are all zero, so this commit changes
   the snoop function enable on the machine. I tested with some other
   PCH machines and those bits are all zero (enable snoop by default),
   so this commit won't affect to some machines.
- Disable relax ordering on 82546GB(Device ID 0x1099 and 0x10b5) or >= ICH8.
   Same as other OSes.
- Add wm_oem_bits_config_ich8lan() to control LPLU and GbE setting base on
   the NVM's info.
- Modify wm_enable_wakeup() to reduce difference against FreeBSD and Linux.
   This modification affects to ICH8 and newer devices. I217 Rapid Start
   Technology support have not written yet (it's TODO).
- Add wm_k1_workaround_lv() from FreeBSD. It's PCH2 specific:
 Workaround to set the K1 beacon duration for 82579 parts in 10Mbps.
 Disable K1 for 1000 and 100 speeds.
- Make wm_link_stall_workaround_hv() and move an 82578 specific code into it.
   Don't apply the workaround if BMCR_LOOP bit is set. Same as FreeBSD.
- Add comment. Modify comment.
  Fix comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9.8.2 -r1.9.8.3 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.508.4.26 -r1.508.4.27 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.5 -r1.98.6.6 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.9.8.2 src/sys/dev/mii/inbmphyreg.h:1.9.8.3
--- src/sys/dev/mii/inbmphyreg.h:1.9.8.2	Thu Nov  8 12:09:18 2018
+++ src/sys/dev/mii/inbmphyreg.h	Tue Dec  4 11:21:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.9.8.2 2018/11/08 12:09:18 martin Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.9.8.3 2018/12/04 11:21:32 martin Exp $	*/
 /***
 Copyright (c) 2001-2005, Intel Corporation 
 All rights reserved.
@@ -74,6 +74,13 @@ POSSIBILITY OF SUCH DAMAGE.
 #define BME1000_PSCR_DOWNSHIFT_COUNTER_MASK 0x7000
 #define BME1000_PSCR_DOWNSHIFT_COUNTER_SHIFT12
 
+/* BM PHY Copper Specific Status */
+#define BM_CS_STATUS		BME1000_REG(0, 17)
+#define BM_CS_STATUS_LINK_UP	0x0400
+#define BM_CS_STATUS_RESOLVED	0x0800
+#define BM_CS_STATUS_SPEED_MASK	0xC000
+#define BM_CS_STATUS_SPEED_1000	0x8000
+
 #define BME1000_PHY_PAGE_SELECT	BME1000_REG(0, 22) /* Page Select */
 
 #define BME1000_BIAS_SETTING	29
@@ -91,6 +98,14 @@ POSSIBILITY OF SUCH DAMAGE.
 #define HV_OEM_BITS_A1KDIS	(1 << 6)
 #define HV_OEM_BITS_ANEGNOW	(1 << 10)
 
+/* 82577 Mobile Phy Status Register */
+#define HV_M_STATUS		BME1000_REG(0, 26)
+#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000
+#define HV_M_STATUS_SPEED_MASK	0x0300
+#define HV_M_STATUS_SPEED_1000	0x0200
+#define HV_M_STATUS_SPEED_100	0x0100
+#define HV_M_STATUS_LINK_UP	0x0040
+
 #define HV_LED_CONFIG		BME1000_REG(0, 30)
 
 #define	HV_KMRN_MODE_CTRL	BME1000_REG(BM_PORT_CTRL_PAGE, 16)

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.26 src/sys/dev/pci/if_wm.c:1.508.4.27
--- src/sys/dev/pci/if_wm.c:1.508.4.26	Mon Nov 26 17:24:51 2018
+++ src/sys/dev/pci/if_wm.c	Tue Dec  4 11:21:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.26 2018/11/26 17:24:51 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.27 2018/12/04 11:21:32 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.26 2018/11/26 17:24:51 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.27 2018/12/04 11:21:32 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -463,6 +463,8 @@ struct wm_queue {
 struct 

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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:16:33 UTC 2018

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #1116


To generate a diff of this commit:
cvs rdiff -u -r1.128.6.2 -r1.128.6.3 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.116.6.2 -r1.116.6.3 src/sys/dev/mii/miidevs_data.h

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

Modified files:

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.128.6.2 src/sys/dev/mii/miidevs.h:1.128.6.3
--- src/sys/dev/mii/miidevs.h:1.128.6.2	Thu Jul 26 21:09:42 2018
+++ src/sys/dev/mii/miidevs.h	Tue Dec  4 11:16:33 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.128.6.2 2018/07/26 21:09:42 snj Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.128.6.3 2018/12/04 11:16:33 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.125.6.2 2018/07/26 21:09:22 snj Exp
+ *	NetBSD: miidevs,v 1.125.6.3 2018/12/04 11:15:20 martin Exp
  */
 
 /*-
@@ -56,36 +56,36 @@
  * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h
  */
 
+#define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
+#define	MII_OUI_CICADA	0x0003f1	/* Cicada Semiconductor */
 #define	MII_OUI_AGERE	0x00053d	/* Agere */
+#define	MII_OUI_BROADCOM2	0x000af7	/* Broadcom Corporation */
+#define	MII_OUI_BROADCOM	0x001018	/* Broadcom Corporation */
+#define	MII_OUI_MICREL	0x0010a1	/* Micrel */
 #define	MII_OUI_ALTIMA	0x0010a9	/* Altima Communications */
-#define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
+#define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
 #define	MII_OUI_ATHEROS	0x001374	/* Atheros */
-#define	MII_OUI_ATTANSIC	0x00c82e	/* Attansic Technology */
-#define	MII_OUI_BROADCOM	0x001018	/* Broadcom Corporation */
-#define	MII_OUI_BROADCOM2	0x000af7	/* Broadcom Corporation */
 #define	MII_OUI_BROADCOM3	0x001be9	/* Broadcom Corporation */
-#define	MII_OUI_CICADA	0x0003F1	/* Cicada Semiconductor */
+#define	MII_OUI_LEVEL1	0x00207b	/* Level 1 */
+#define	MII_OUI_MARVELL	0x005043	/* Marvell Semiconductor */
+#define	MII_OUI_QUALSEMI	0x006051	/* Quality Semiconductor */
 #define	MII_OUI_DAVICOM	0x00606e	/* Davicom Semiconductor */
-#define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
+#define	MII_OUI_SMSC	0x00800f	/* SMSC */
 #define	MII_OUI_ICPLUS	0x0090c3	/* IC Plus Corp. */
+#define	MII_OUI_SEEQ	0x00a07d	/* Seeq */
 #define	MII_OUI_ICS	0x00a0be	/* Integrated Circuit Systems */
 #define	MII_OUI_INTEL	0x00aa00	/* Intel */
-#define	MII_OUI_JMICRON	0x00d831	/* JMicron */
-#define	MII_OUI_LEVEL1	0x00207b	/* Level 1 */
-#define	MII_OUI_MARVELL	0x005043	/* Marvell Semiconductor */
-#define	MII_OUI_MICREL	0x0010a1	/* Micrel */
+#define	MII_OUI_TSC	0x00c039	/* TDK Semiconductor */
 #define	MII_OUI_MYSON	0x00c0b4	/* Myson Technology */
-#define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
-#define	MII_OUI_PMCSIERRA	0x00e004	/* PMC-Sierra */
+#define	MII_OUI_ATTANSIC	0x00c82e	/* Attansic Technology */
 #define	MII_OUI_RDC	0x00d02d	/* RDC Semiconductor */
-#define	MII_OUI_REALTEK	0x00e04c	/* RealTek */
-#define	MII_OUI_QUALSEMI	0x006051	/* Quality Semiconductor */
-#define	MII_OUI_SEEQ	0x00a07d	/* Seeq */
+#define	MII_OUI_JMICRON	0x00d831	/* JMicron */
+#define	MII_OUI_PMCSIERRA	0x00e004	/* PMC-Sierra */
 #define	MII_OUI_SIS	0x00e006	/* Silicon Integrated Systems */
-#define	MII_OUI_SMSC	0x00800f	/* SMSC */
-#define	MII_OUI_TI	0x080028	/* Texas Instruments */
-#define	MII_OUI_TSC	0x00c039	/* TDK Semiconductor */
+#define	MII_OUI_REALTEK	0x00e04c	/* RealTek */
 #define	MII_OUI_XAQTI	0x00e0ae	/* XaQti Corp. */
+#define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
+#define	MII_OUI_TI	0x080028	/* Texas Instruments */
 
 /* Some Intel 82553's use an alternative OUI. */
 #define	MII_OUI_xxINTEL	0x001f00	/* Intel */
@@ -110,6 +110,7 @@
 #define	MII_OUI_xxXAQTI	0xace000	/* XaQti Corp. */
 
 /* Don't know what's going on here. */
+#define	MII_OUI_xxASIX	0x000674	/* Asix Semiconductor */
 #define	MII_OUI_xxPMCSIERRA	0x0009c0	/* PMC-Sierra */
 #define	MII_OUI_xxPMCSIERRA2	0x009057	/* PMC-Sierra */
 
@@ -125,6 +126,10 @@
 #define	MII_MODEL_AGERE_ET1011	0x0004
 #define	MII_STR_AGERE_ET1011	"Agere ET1011 10/100/1000baseT PHY"
 
+/* Asix semiconductor PHYs */
+#define	MII_MODEL_xxASIX_AX88X9X	0x0031
+#define	MII_STR_xxASIX_AX88X9X	"Ax88x9x internal PHY"
+
 /* Atheros PHYs */
 #define	MII_MODEL_ATHEROS_F1	0x0001
 #define	MII_STR_ATHEROS_F1	"F1 10/100/1000 PHY"
@@ -446,7 +451,7 @@
 #define	MII_MODEL_xxNATSEMI_DP83843	0x0001
 #define	MII_STR_xxNATSEMI_DP83843	"DP83843 10/100 media interface"
 #define	MII_MODEL_xxNATSEMI_DP83815	0x0002
-#define	MII_STR_xxNATSEMI_DP83815	"DP83815 10/100 media interface"
+#define	MII_STR_xxNATSEMI_DP83815	"DP83815/DP83846A 10/100 media interface"
 #define	MII_MODEL_xxNATSEMI_DP83847	0x0003
 #define	

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

2018-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  4 11:15:21 UTC 2018

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs

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

sys/dev/mii/miidevs: revision 1.130
sys/dev/mii/miidevs: revision 1.131

Sort OUI by number. No functional change.

- Add ASIX Ax88x9x
- Add description for DP83846A.


To generate a diff of this commit:
cvs rdiff -u -r1.125.6.2 -r1.125.6.3 src/sys/dev/mii/miidevs

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.125.6.2 src/sys/dev/mii/miidevs:1.125.6.3
--- src/sys/dev/mii/miidevs:1.125.6.2	Thu Jul 26 21:09:22 2018
+++ src/sys/dev/mii/miidevs	Tue Dec  4 11:15:20 2018
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.125.6.2 2018/07/26 21:09:22 snj Exp $
+$NetBSD: miidevs,v 1.125.6.3 2018/12/04 11:15:20 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -49,36 +49,36 @@ $NetBSD: miidevs,v 1.125.6.2 2018/07/26 
  * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h
  */
 
+oui AMD0x1a	Advanced Micro Devices
+oui CICADA			0x0003f1	Cicada Semiconductor
 oui AGERE			0x00053d	Agere
+oui BROADCOM2			0x000af7	Broadcom Corporation
+oui BROADCOM			0x001018	Broadcom Corporation
+oui MICREL			0x0010a1	Micrel
 oui ALTIMA			0x0010a9	Altima Communications
-oui AMD0x1a	Advanced Micro Devices
+oui ENABLESEMI			0x0010dd	Enable Semiconductor
 oui ATHEROS			0x001374	Atheros
-oui ATTANSIC			0x00c82e	Attansic Technology
-oui BROADCOM			0x001018	Broadcom Corporation
-oui BROADCOM2			0x000af7	Broadcom Corporation
 oui BROADCOM3			0x001be9	Broadcom Corporation
-oui CICADA			0x0003F1	Cicada Semiconductor
+oui LEVEL1			0x00207b	Level 1
+oui MARVELL			0x005043	Marvell Semiconductor
+oui QUALSEMI			0x006051	Quality Semiconductor
 oui DAVICOM			0x00606e	Davicom Semiconductor
-oui ENABLESEMI			0x0010dd	Enable Semiconductor
+oui SMSC			0x00800f	SMSC
 oui ICPLUS			0x0090c3	IC Plus Corp.
+oui SEEQ			0x00a07d	Seeq
 oui ICS0x00a0be	Integrated Circuit Systems
 oui INTEL			0x00aa00	Intel
-oui JMICRON			0x00d831	JMicron
-oui LEVEL1			0x00207b	Level 1
-oui MARVELL			0x005043	Marvell Semiconductor
-oui MICREL			0x0010a1	Micrel
+oui TSC0x00c039	TDK Semiconductor
 oui MYSON			0x00c0b4	Myson Technology
-oui NATSEMI			0x080017	National Semiconductor
-oui PMCSIERRA			0x00e004	PMC-Sierra
+oui ATTANSIC			0x00c82e	Attansic Technology
 oui RDC0x00d02d	RDC Semiconductor
-oui REALTEK			0x00e04c	RealTek
-oui QUALSEMI			0x006051	Quality Semiconductor
-oui SEEQ			0x00a07d	Seeq
+oui JMICRON			0x00d831	JMicron
+oui PMCSIERRA			0x00e004	PMC-Sierra
 oui SIS0x00e006	Silicon Integrated Systems
-oui SMSC			0x00800f	SMSC
-oui TI0x080028	Texas Instruments
-oui TSC0x00c039	TDK Semiconductor
+oui REALTEK			0x00e04c	RealTek
 oui XAQTI			0x00e0ae	XaQti Corp.
+oui NATSEMI			0x080017	National Semiconductor
+oui TI0x080028	Texas Instruments
 
 /* Some Intel 82553's use an alternative OUI. */
 oui xxINTEL			0x001f00	Intel
@@ -103,6 +103,7 @@ oui xxLEVEL1			0x782000	Level 1
 oui xxXAQTI			0xace000	XaQti Corp.
 
 /* Don't know what's going on here. */
+oui xxASIX			0x000674	Asix Semiconductor
 oui xxPMCSIERRA			0x0009c0	PMC-Sierra
 oui xxPMCSIERRA2		0x009057	PMC-Sierra
 
@@ -117,6 +118,9 @@ oui yyREALTEK			0x04	Realtek
  */
 model AGERE ET1011		0x0004 Agere ET1011 10/100/1000baseT PHY
 
+/* Asix semiconductor PHYs */
+model xxASIX AX88X9X		0x0031 Ax88x9x internal PHY
+
 /* Atheros PHYs */
 model ATHEROS F1		0x0001 F1 10/100/1000 PHY
 model ATHEROS F2		0x0002 F2 10/100 PHY
@@ -295,7 +299,7 @@ model MYSON MTD803		0x MTD803 3-in-1
 /* National Semiconductor PHYs */
 model xxNATSEMI DP83840		0x DP83840 10/100 media interface
 model xxNATSEMI DP83843		0x0001 DP83843 10/100 media interface
-model xxNATSEMI DP83815		0x0002 DP83815 10/100 media interface
+model xxNATSEMI DP83815		0x0002 DP83815/DP83846A 10/100 media interface
 model xxNATSEMI DP83847		0x0003 DP83847 10/100 media interface
 model xxNATSEMI DP83891		0x0005 DP83891 1000BASE-T media interface
 model xxNATSEMI DP83861		0x0006 DP83861 1000BASE-T media interface



CVS commit: [netbsd-8] src/doc

2018-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov 30 10:33:44 UTC 2018

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

Log Message:
Ticket #1114, ammend ticket #1110 for additional changes pulled up.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.66 -r1.1.2.67 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.66 src/doc/CHANGES-8.1:1.1.2.67
--- src/doc/CHANGES-8.1:1.1.2.66	Thu Nov 29 15:00:45 2018
+++ src/doc/CHANGES-8.1	Fri Nov 30 10:33:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.66 2018/11/29 15:00:45 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.67 2018/11/30 10:33:44 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1825,7 +1825,8 @@ libexec/httpd/main.c1.22
 	Fix -X option parsing and miscelaneous cleanup.
 	[mrg, ticket #1109]
 
-sys/kern/kern_time.c1.192
+sys/kern/kern_time.c1.192,1.193
+sys/compat/linux/common/linux_misc_notalpha.c	1.110
 
 	Fix kernel info leak.
 	[maxv, ticket #1110]
@@ -1845,3 +1846,8 @@ sys/kern/kern_sig.c1.350
 	Fix kernel info leak.
 	[maxv, ticket #1113]
 
+sys/kern/kern_exit.c1.273
+
+	Fix info leak.
+	[maxv, ticket #1114]
+



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

2018-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov 30 10:32:22 UTC 2018

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

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

sys/kern/kern_exit.c: revision 1.273

Fix info leak. There is one branch where 'status' is not initialized at
all.

+ Possible info leak: [len=4, leaked=4]
| #0 0x80baf397 in kleak_copyout
| #1 0x80b56d0c in sys_wait6
| #2 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.268.8.1 -r1.268.8.2 src/sys/kern/kern_exit.c

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

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.268.8.1 src/sys/kern/kern_exit.c:1.268.8.2
--- src/sys/kern/kern_exit.c:1.268.8.1	Thu Apr 12 13:42:48 2018
+++ src/sys/kern/kern_exit.c	Fri Nov 30 10:32:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.268.8.1 2018/04/12 13:42:48 martin Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.268.8.2 2018/11/30 10:32:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.268.8.1 2018/04/12 13:42:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.268.8.2 2018/11/30 10:32:22 martin Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -661,6 +661,7 @@ do_sys_waitid(idtype_t idtype, id_t id, 
 	if (child == NULL) {
 		mutex_exit(proc_lock);
 		*pid = 0;
+		*status = 0;
 		return error;
 	}
 	*pid = child->p_pid;



CVS commit: [netbsd-8] src/sys

2018-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov 30 10:28:46 UTC 2018

Modified Files:
src/sys/compat/linux/common [netbsd-8]: linux_misc_notalpha.c
src/sys/kern [netbsd-8]: kern_time.c

Log Message:
Additionally pull up following revision(s) (requested by maxv in ticket #1110):

sys/compat/linux/common/linux_misc_notalpha.c: revision 1.110
sys/kern/kern_time.c: revision 1.193

Improve my kern_time.c::rev1.192, systematically clear the buffers we get
from 'ptimer_pool' to prevent more leaks.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.109.12.1 \
src/sys/compat/linux/common/linux_misc_notalpha.c
cvs rdiff -u -r1.189.8.1 -r1.189.8.2 src/sys/kern/kern_time.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_misc_notalpha.c
diff -u src/sys/compat/linux/common/linux_misc_notalpha.c:1.109 src/sys/compat/linux/common/linux_misc_notalpha.c:1.109.12.1
--- src/sys/compat/linux/common/linux_misc_notalpha.c:1.109	Sun Nov  9 17:48:08 2014
+++ src/sys/compat/linux/common/linux_misc_notalpha.c	Fri Nov 30 10:28:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc_notalpha.c,v 1.109 2014/11/09 17:48:08 maxv Exp $	*/
+/*	$NetBSD: linux_misc_notalpha.c,v 1.109.12.1 2018/11/30 10:28:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.109 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.109.12.1 2018/11/30 10:28:46 martin Exp $");
 
 /*
  * Note that we must NOT include "opt_compat_linux32.h" here,
@@ -161,6 +161,7 @@ linux_sys_alarm(struct lwp *l, const str
 		if (spare == NULL) {
 			mutex_spin_exit(_lock);
 			spare = pool_get(_pool, PR_WAITOK);
+			memset(spare, 0, sizeof(*spare));
 			goto retry;
 		}
 		ptp = spare;

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.189.8.1 src/sys/kern/kern_time.c:1.189.8.2
--- src/sys/kern/kern_time.c:1.189.8.1	Thu Nov 29 08:48:38 2018
+++ src/sys/kern/kern_time.c	Fri Nov 30 10:28:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.189.8.1 2018/11/29 08:48:38 martin Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.189.8.2 2018/11/30 10:28:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.189.8.1 2018/11/29 08:48:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.189.8.2 2018/11/30 10:28:46 martin Exp $");
 
 #include 
 #include 
@@ -1164,6 +1164,7 @@ dosetitimer(struct proc *p, int which, s
 		if (spare == NULL) {
 			mutex_spin_exit(_lock);
 			spare = pool_get(_pool, PR_WAITOK);
+			memset(spare, 0, sizeof(*spare));
 			goto retry;
 		}
 		pt = spare;



CVS commit: [netbsd-8] src/doc

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 15:00:45 UTC 2018

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

Log Message:
Tickets #1112 and #1113


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.65 -r1.1.2.66 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.65 src/doc/CHANGES-8.1:1.1.2.66
--- src/doc/CHANGES-8.1:1.1.2.65	Thu Nov 29 08:52:08 2018
+++ src/doc/CHANGES-8.1	Thu Nov 29 15:00:45 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.65 2018/11/29 08:52:08 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.66 2018/11/29 15:00:45 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1835,3 +1835,13 @@ sys/arch/amd64/amd64/machdep.c			1.321
 	Fix stack info leak.
 	[maxv, ticket #]
 
+sys/kern/sys_ptrace_common.c			1.46
+
+	Fix stack info leak.
+	[maxv, ticket #1112]
+
+sys/kern/kern_sig.c1.350
+
+	Fix kernel info leak.
+	[maxv, ticket #1113]
+



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

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 14:59:56 UTC 2018

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

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

sys/kern/kern_sig.c: revision 1.350

Fix kernel info leak, 4 bytes of padding at the end of struct sigaction.

+ Possible info leak: [len=32, leaked=4]
| #0 0x80baf327 in kleak_copyout
| #1 0x80bd9ca8 in sys___sigaction_sigtramp
| #2 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.336.4.2 -r1.336.4.3 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.336.4.2 src/sys/kern/kern_sig.c:1.336.4.3
--- src/sys/kern/kern_sig.c:1.336.4.2	Thu Apr 12 13:42:48 2018
+++ src/sys/kern/kern_sig.c	Thu Nov 29 14:59:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.336.4.2 2018/04/12 13:42:48 martin Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.336.4.3 2018/11/29 14:59:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.336.4.2 2018/04/12 13:42:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.336.4.3 2018/11/29 14:59:56 martin Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_dtrace.h"
@@ -189,6 +189,13 @@ signal_listener_cb(kauth_cred_t cred, ka
 	return result;
 }
 
+static int
+sigacts_ctor(void *arg __unused, void *obj, int flags __unused)
+{
+	memset(obj, 0, sizeof(struct sigacts));
+	return 0;
+}
+
 /*
  * signal_init:
  *
@@ -202,7 +209,7 @@ signal_init(void)
 
 	sigacts_cache = pool_cache_init(sizeof(struct sigacts), 0, 0, 0,
 	"sigacts", sizeof(struct sigacts) > PAGE_SIZE ?
-	_allocator : NULL, IPL_NONE, NULL, NULL, NULL);
+	_allocator : NULL, IPL_NONE, sigacts_ctor, NULL, NULL);
 	ksiginfo_cache = pool_cache_init(sizeof(ksiginfo_t), 0, 0, 0,
 	"ksiginfo", NULL, IPL_VM, NULL, NULL, NULL);
 



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

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 14:58:25 UTC 2018

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

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

sys/kern/sys_ptrace_common.c: revision 1.46

Fix stack info leak.

+ Possible info leak: [len=136, leaked=92]
| #0 0x80baf397 in kleak_copyout
| #1 0x80bd4155 in ptrace_copyout_siginfo
| #2 0x80bd5348 in do_ptrace
| #3 0x80bd40fe in sys_ptrace
| #4 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.3 -r1.22.2.4 src/sys/kern/sys_ptrace_common.c

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

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.22.2.3 src/sys/kern/sys_ptrace_common.c:1.22.2.4
--- src/sys/kern/sys_ptrace_common.c:1.22.2.3	Sat May  5 19:13:21 2018
+++ src/sys/kern/sys_ptrace_common.c	Thu Nov 29 14:58:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.3 2018/05/05 19:13:21 martin Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.4 2018/11/29 14:58:25 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.3 2018/05/05 19:13:21 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.4 2018/11/29 14:58:25 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -553,6 +553,7 @@ ptrace_get_siginfo(struct proc *t, struc
 {
 	struct ptrace_siginfo psi;
 
+	memset(, 0, sizeof(psi));
 	psi.psi_siginfo._info = t->p_sigctx.ps_info;
 	psi.psi_lwpid = t->p_sigctx.ps_lwp;
 



CVS commit: [netbsd-8] src/doc

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 08:52:08 UTC 2018

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

Log Message:
Tickets #1110 and #


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.64 -r1.1.2.65 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.64 src/doc/CHANGES-8.1:1.1.2.65
--- src/doc/CHANGES-8.1:1.1.2.64	Wed Nov 28 19:51:30 2018
+++ src/doc/CHANGES-8.1	Thu Nov 29 08:52:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.64 2018/11/28 19:51:30 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.65 2018/11/29 08:52:08 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1825,3 +1825,13 @@ libexec/httpd/main.c1.22
 	Fix -X option parsing and miscelaneous cleanup.
 	[mrg, ticket #1109]
 
+sys/kern/kern_time.c1.192
+
+	Fix kernel info leak.
+	[maxv, ticket #1110]
+
+sys/arch/amd64/amd64/machdep.c			1.321
+
+	Fix stack info leak.
+	[maxv, ticket #]
+



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

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 08:51:01 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-8]: machdep.c

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

sys/arch/amd64/amd64/machdep.c: revision 1.321

Fix stack info leak. There is a big padding in struct sigframe_siginfo.

[  224.006287] kleak: Possible leak in copyout: [len=920, leaked=92]
[  224.016977] #0 0x80224d0a in kleak_note 
[  224.026268] #1 0x80224d8a in kleak_copyout 
[  224.026268] #2 0x802224b5 in sendsig_siginfo 
[  224.036261] #3 0x80b51564 in sendsig 
[  224.046475] #4 0x80b51282 in postsig 
[  224.046475] #5 0x80b2fc5d in lwp_userret 
[  224.056273] #6 0x8025a951 in mi_userret 
[  224.066277] #7 0x8025ab89 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.255.6.7 -r1.255.6.8 src/sys/arch/amd64/amd64/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.255.6.7 src/sys/arch/amd64/amd64/machdep.c:1.255.6.8
--- src/sys/arch/amd64/amd64/machdep.c:1.255.6.7	Sat Jun  9 15:12:21 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Thu Nov 29 08:51:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.255.6.7 2018/06/09 15:12:21 martin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.255.6.8 2018/11/29 08:51:01 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255.6.7 2018/06/09 15:12:21 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255.6.8 2018/11/29 08:51:01 martin Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -606,6 +606,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	/* Round down the stackpointer to a multiple of 16 for the ABI. */
 	fp = (struct sigframe_siginfo *)(((unsigned long)sp & ~15) - 8);
 
+	memset(, 0, sizeof(frame));
 	frame.sf_ra = (uint64_t)ps->sa_sigdesc[sig].sd_tramp;
 	frame.sf_si._info = ksi->ksi_info;
 	frame.sf_uc.uc_flags = _UC_SIGMASK;
@@ -613,7 +614,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	frame.sf_uc.uc_link = l->l_ctxlink;
 	frame.sf_uc.uc_flags |= (l->l_sigstk.ss_flags & SS_ONSTACK)
 	? _UC_SETSTACK : _UC_CLRSTACK;
-	memset(_uc.uc_stack, 0, sizeof(frame.sf_uc.uc_stack));
 	sendsig_reset(l, sig);
 
 	mutex_exit(p->p_lock);



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

2018-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 29 08:48:38 UTC 2018

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

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

sys/kern/kern_time.c: revision 1.192

Fix kernel info leak.

+ Possible info leak: [len=32, leaked=16]
| #0 0x80baf3a7 in kleak_copyout
| #1 0x80b940f8 in sys___timer_settime50
| #2 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.189.8.1 src/sys/kern/kern_time.c

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

Modified files:

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.189 src/sys/kern/kern_time.c:1.189.8.1
--- src/sys/kern/kern_time.c:1.189	Fri Nov 11 15:29:36 2016
+++ src/sys/kern/kern_time.c	Thu Nov 29 08:48:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.189 2016/11/11 15:29:36 njoly Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.189.8.1 2018/11/29 08:48:38 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.189 2016/11/11 15:29:36 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.189.8.1 2018/11/29 08:48:38 martin Exp $");
 
 #include 
 #include 
@@ -602,6 +602,7 @@ timer_create1(timer_t *tid, clockid_t id
 		pts = timers_alloc(p);
 
 	pt = pool_get(_pool, PR_WAITOK);
+	memset(pt, 0, sizeof(*pt));
 	if (evp != NULL) {
 		if (((error =
 		(*fetch_event)(evp, >pt_ev, sizeof(pt->pt_ev))) != 0) ||



CVS commit: [netbsd-8] src/doc

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:51:30 UTC 2018

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

Log Message:
Ticket #1109


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.63 src/doc/CHANGES-8.1:1.1.2.64
--- src/doc/CHANGES-8.1:1.1.2.63	Wed Nov 28 05:10:54 2018
+++ src/doc/CHANGES-8.1	Wed Nov 28 19:51:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.63 2018/11/28 05:10:54 snj Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.64 2018/11/28 19:51:30 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1816,3 +1816,12 @@ sys/dev/pci/if_wm.c1.599
 	wm(4): Fix a bug that i82578 workarounds didn't work correctly.
 	[msaitoh, ticket #1108]
 
+libexec/httpd/CHANGES1.29,1.30
+libexec/httpd/bozohttpd.c			1.97-1.99
+libexec/httpd/bozohttpd.h			1.57
+libexec/httpd/cgi-bozo.c			1.45
+libexec/httpd/main.c1.22
+
+	Fix -X option parsing and miscelaneous cleanup.
+	[mrg, ticket #1109]
+



CVS commit: [netbsd-8] src/libexec/httpd

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:50:37 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-8]: CHANGES bozohttpd.c bozohttpd.h
cgi-bozo.c main.c

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

libexec/httpd/main.c: revision 1.22
libexec/httpd/CHANGES: revision 1.29
libexec/httpd/cgi-bozo.c: revision 1.45
libexec/httpd/bozohttpd.h: revision 1.57
libexec/httpd/CHANGES: revision 1.30
libexec/httpd/bozohttpd.c: revision 1.97
libexec/httpd/bozohttpd.c: revision 1.98
libexec/httpd/bozohttpd.c: revision 1.99

one semicolon is usually enough.

 -

appease lint

- add FALLTHROUGH comment
- one return is usually enough.

 -

avoid c99ism.

 -

fix -X option parsing.  noted by Rajeev V. Pillai.

 -

add option fixes here.

 -

normalise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.86.4.2 -r1.86.4.3 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.47.4.1 -r1.47.4.2 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.37.4.2 -r1.37.4.3 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.25.4.1 src/libexec/httpd/CHANGES:1.25.4.2
--- src/libexec/httpd/CHANGES:1.25.4.1	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/CHANGES	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,7 @@
-$NetBSD: CHANGES,v 1.25.4.1 2018/11/24 17:13:51 martin Exp $
+$NetBSD: CHANGES,v 1.25.4.2 2018/11/28 19:50:37 martin Exp $
+
+changes in bozohttpd 20181125:
+	o  fixes for option parsing introduced in bozohttpd 20181123
 
 changes in bozohttpd 20181121:
 	o  add url remap support via .bzremap file, from mar...@netbsd.org
@@ -9,7 +12,7 @@ changes in bozohttpd 20181121:
 	   initial line, each header, and the total time spent
 	o  add -T option to expose new timeout settings
 	o  minor RFC fixes related to timeout handling
-	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP.
+	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP
 
 changes in bozohttpd 20170201:
 	o  fix an infinite loop in cgi processing
@@ -94,7 +97,7 @@ changes in bozohttpd 20100617:
 
 changes in bozohttpd 20100509:
 	o  major rework and clean up of internal interfaces.  move the main
-	   program into main.c, the remaining parts are useable as library.
+	   program into main.c, the remaining parts are useable as library
 	   add bindings for lua.  by Alistair G. Crooks 
 	o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.86.4.2 src/libexec/httpd/bozohttpd.c:1.86.4.3
--- src/libexec/httpd/bozohttpd.c:1.86.4.2	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/bozohttpd.c	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.86.4.2 2018/11/24 17:13:51 martin Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.86.4.3 2018/11/28 19:50:37 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181124"
+#define SERVER_SOFTWARE		"bozohttpd/20181125"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		case '"':
 			if (absolute)
 goto leave_it;
+			/*FALLTHROUGH*/
 		case '\n':
 		case '\r':
 		case ' ':
@@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 			d += 3;
 			len += 3;
 			break;
-		leave_it:
 		default:
+		leave_it:
 			*d++ = *s++;
 			len++;
 			break;
@@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request
 			 REDIRECT_FILE) >= sizeof(redir)) {
 		return bozo_http_error(httpd, 404, request,
 		"redirectfile path too long");
-		return -1;
 	}
 	if (lstat(redir, ) == 0) {
 		if (!S_ISLNK(sb.st_mode))
@@ -1924,8 +1924,9 @@ int
 bozo_check_special_files(bozo_httpreq_t *request, const char *name)
 {
 	bozohttpd_t *httpd = request->hr_httpd;
+	size_t i;
 
-	for (size_t i = 0; specials[i].file; i++)
+	for (i = 0; specials[i].file; i++)
 		if (strcmp(name, specials[i].file) == 0)
 			return bozo_http_error(httpd, 403, request,
 	   specials[i].name);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.47.4.1 src/libexec/httpd/bozohttpd.h:1.47.4.2
--- src/libexec/httpd/bozohttpd.h:1.47.4.1	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/bozohttpd.h	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.47.4.1 2018/11/24 17:13:51 martin Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.47.4.2 2018/11/28 19:50:37 martin Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -407,7 +407,7 @@ void	

CVS commit: [netbsd-8] src/doc

2018-11-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Nov 28 05:10:54 UTC 2018

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

Log Message:
Use better description for ticket 1108.


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.62 src/doc/CHANGES-8.1:1.1.2.63
--- src/doc/CHANGES-8.1:1.1.2.62	Mon Nov 26 17:29:36 2018
+++ src/doc/CHANGES-8.1	Wed Nov 28 05:10:54 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.62 2018/11/26 17:29:36 snj Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.63 2018/11/28 05:10:54 snj Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1813,8 +1813,6 @@ sys/dev/pci/if_bge.c1.316
 
 sys/dev/pci/if_wm.c1.599
 
-	wm(4):
-	- Fix a bug that i82578 PHY can't detect correctly.
-	- Print PHY OUI and model number if a PHY's can't be identified.
+	wm(4): Fix a bug that i82578 workarounds didn't work correctly.
 	[msaitoh, ticket #1108]
 



CVS commit: [netbsd-8] src/doc

2018-11-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov 26 17:29:36 UTC 2018

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

Log Message:
tickets 1105-1108


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

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.61 src/doc/CHANGES-8.1:1.1.2.62
--- src/doc/CHANGES-8.1:1.1.2.61	Sat Nov 24 23:51:05 2018
+++ src/doc/CHANGES-8.1	Mon Nov 26 17:29:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.61 2018/11/24 23:51:05 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.62 2018/11/26 17:29:36 snj Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1795,3 +1795,26 @@ libexec/httpd/testsuite/test-simple 
 	Fix access checks for special files.
 	[mrg, #1104]
 
+sys/dev/dksubr.c1.104
+
+	rnd_add_uint32() doens't support concurent calls for the same
+	rnd_source, call it with dksc->sc_iolock held.
+	[bouyer, ticket #1105]
+
+sys/kern/subr_evcnt.c1.13 via patch
+
+	Fix kernel information leak.
+	[maxv, ticket #1106]
+
+sys/dev/pci/if_bge.c1.316
+
+	bge(4): Fix TSO4 for 5717 and newer.
+	[bouyer, ticket #1107]
+
+sys/dev/pci/if_wm.c1.599
+
+	wm(4):
+	- Fix a bug that i82578 PHY can't detect correctly.
+	- Print PHY OUI and model number if a PHY's can't be identified.
+	[msaitoh, ticket #1108]
+



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

2018-11-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov 26 17:24:51 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1108):
sys/dev/pci/if_wm.c: revision 1.599
- Fix a bug that i82578 PHY can't detect correctly.
- Print PHY OUI and model number if a PHY's can't be identified.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.25 -r1.508.4.26 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.25 src/sys/dev/pci/if_wm.c:1.508.4.26
--- src/sys/dev/pci/if_wm.c:1.508.4.25	Thu Nov  8 12:09:18 2018
+++ src/sys/dev/pci/if_wm.c	Mon Nov 26 17:24:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.25 2018/11/08 12:09:18 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.26 2018/11/26 17:24:51 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.25 2018/11/08 12:09:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.26 2018/11/26 17:24:51 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9534,7 +9534,7 @@ wm_gmii_setup_phytype(struct wm_softc *s
 	} else {
 		/* It's not the first call. Use PHY OUI and model */
 		switch (phy_oui) {
-		case MII_OUI_ATHEROS: /* XXX ??? */
+		case MII_OUI_ATTANSIC: /* XXX ??? */
 			switch (phy_model) {
 			case 0x0004: /* XXX */
 new_phytype = WMPHY_82578;
@@ -9611,8 +9611,9 @@ wm_gmii_setup_phytype(struct wm_softc *s
 			break;
 		}
 		if (new_phytype == WMPHY_UNKNOWN)
-			aprint_verbose_dev(dev, "%s: unknown PHY model\n",
-			__func__);
+			aprint_verbose_dev(dev,
+			"%s: unknown PHY model. OUI=%06x, model=%04x\n",
+			__func__, phy_oui, phy_model);
 
 		if ((sc->sc_phytype != WMPHY_UNKNOWN)
 		&& (sc->sc_phytype != new_phytype )) {



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

2018-11-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov 26 17:22:32 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1107):
sys/dev/pci/if_bge.c: revision 1.316
5717 and newer handle TSO in a sighly different way. From FreeBSD.
While there, use different lowat/hiwat values if MTU is larger than ETHERMTU,
from FreeBSD.
Tested at LIP6 on a
bge0 at pci4 dev 0 function 0: Broadcom BCM5720 Gigabit Ethernet
bge0: APE firmware NCSI 1.4.22.0
bge0: interrupting at msi1 vec 0
bge0: HW config 002b1194, 6014, 0002aa38,  000c
bge0: ASIC BCM5720 A0 (0x572), Ethernet address d0:94:66:8b:9c:18
bge0: setting short Tx thresholds
brgphy0 at bge0 phy 1: BCM5720C 1000BASE-T media interface, rev. 0
with all ipv4 checksums and TSO4 enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.310.2.2 -r1.310.2.3 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.2 src/sys/dev/pci/if_bge.c:1.310.2.3
--- src/sys/dev/pci/if_bge.c:1.310.2.2	Fri Nov 24 08:39:09 2017
+++ src/sys/dev/pci/if_bge.c	Mon Nov 26 17:22:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.310.2.2 2017/11/24 08:39:09 martin Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.2 2017/11/24 08:39:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $");
 
 #include 
 #include 
@@ -2555,8 +2555,13 @@ bge_blockinit(struct bge_softc *sc)
 	 */
 	if (BGE_IS_5717_PLUS(sc)) {
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
-		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
-		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
+		if (ifp->if_mtu > ETHERMTU) {
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e);
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xea);
+		} else {
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
+			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
+		}
 	} else if (BGE_IS_5705_PLUS(sc)) {
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
 
@@ -3060,8 +3065,11 @@ bge_blockinit(struct bge_softc *sc)
 		if (ifp->if_mtu <= ETHERMTU)
 			val |= BGE_RDMAMODE_JMB_2K_MMRR;
 	}
-	if (sc->bge_flags & BGEF_TSO)
+	if (sc->bge_flags & BGEF_TSO) {
 		val |= BGE_RDMAMODE_TSO4_ENABLE;
+		if (BGE_IS_5717_PLUS(sc))
+			val |= BGE_RDMAMODE_TSO6_ENABLE;
+	}
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5720) {
 		val |= CSR_READ_4(sc, BGE_RDMA_MODE) &
@@ -3641,6 +3649,10 @@ bge_attach(device_t parent, device_t sel
 		if ((PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BROADCOM_BCM5754) &&
 		(PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BROADCOM_BCM5754M))
 			sc->bge_flags |= BGEF_TSO;
+		/* TSO on BCM5719 A0 does not work. */
+		if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5719) &&
+		(sc->bge_chipid == BGE_CHIPID_BCM5719_A0))
+			sc->bge_flags &= ~BGEF_TSO;
 	}
 
 	capmask = 0x; /* XXX BMSR_DEFCAPMASK */
@@ -5221,7 +5233,7 @@ doit:
 		if (__predict_false(m0->m_len <
 (hlen + sizeof(struct tcphdr {
 
-			aprint_debug_dev(sc->bge_dev,
+			aprint_error_dev(sc->bge_dev,
 			"TSO: hard case m0->m_len == %d < ip/tcp hlen %zd,"
 			"not handled yet\n",
 			 m0->m_len, hlen+ sizeof(struct tcphdr));
@@ -5298,7 +5310,13 @@ doit:
 		 */
 		tcp_seg_flags = 0;
 		if (iptcp_opt_words) {
-			if (BGE_IS_5705_PLUS(sc)) {
+			if (BGE_IS_5717_PLUS(sc)) {
+tcp_seg_flags =
+	(iptcp_opt_words & 0x3) << 14;
+txbd_tso_flags |=
+((iptcp_opt_words & 0xF8) << 7) |
+((iptcp_opt_words & 0x4) << 2);
+			} else if (BGE_IS_5705_PLUS(sc)) {
 tcp_seg_flags =
 	iptcp_opt_words << 11;
 			} else {



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

2018-11-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov 26 17:19:46 UTC 2018

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

Log Message:
Apply patch (requested by maxv in ticket #1106):
Fix kernel information leak.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.22.1 src/sys/kern/subr_evcnt.c

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

Modified files:

Index: src/sys/kern/subr_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.12 src/sys/kern/subr_evcnt.c:1.12.22.1
--- src/sys/kern/subr_evcnt.c:1.12	Tue Feb 25 18:30:11 2014
+++ src/sys/kern/subr_evcnt.c	Mon Nov 26 17:19:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.12 2014/02/25 18:30:11 pooka Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.12.22.1 2018/11/26 17:19:46 snj Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.12 2014/02/25 18:30:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.12.22.1 2018/11/26 17:19:46 snj Exp $");
 
 #include 
 #include 
@@ -257,7 +257,7 @@ sysctl_doevcnt(SYSCTLFN_ARGS)
 	sysctl_unlock();
 
 	if (oldp != NULL && xevs0 == NULL)
-		xevs0 = kmem_alloc(sizeof(*xevs0), KM_SLEEP);
+		xevs0 = kmem_zalloc(sizeof(*xevs0), KM_SLEEP);
 
 	retries = 100;
  retry:



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

2018-11-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov 26 17:13:07 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1105):
sys/dev/dksubr.c: revision 1.104
rnd_add_uint32() doens't support concurent calls for the same rnd_source,
call it with dksc->sc_iolock held.


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.1 -r1.97.2.2 src/sys/dev/dksubr.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/dksubr.c
diff -u src/sys/dev/dksubr.c:1.97.2.1 src/sys/dev/dksubr.c:1.97.2.2
--- src/sys/dev/dksubr.c:1.97.2.1	Fri Sep  1 09:59:10 2017
+++ src/sys/dev/dksubr.c	Mon Nov 26 17:13:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.97.2.1 2017/09/01 09:59:10 martin Exp $ */
+/* $NetBSD: dksubr.c,v 1.97.2.2 2018/11/26 17:13:07 snj Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.97.2.1 2017/09/01 09:59:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.97.2.2 2018/11/26 17:13:07 snj Exp $");
 
 #include 
 #include 
@@ -459,11 +459,11 @@ dk_done1(struct dk_softc *dksc, struct b
 	if (lock)
 		mutex_enter(>sc_iolock);
 	disk_unbusy(dk, bp->b_bcount - bp->b_resid, (bp->b_flags & B_READ));
-	if (lock)
-		mutex_exit(>sc_iolock);
 
 	if ((dksc->sc_flags & DKF_NO_RND) == 0)
 		rnd_add_uint32(>sc_rnd_source, bp->b_rawblkno);
+	if (lock)
+		mutex_exit(>sc_iolock);
 
 	biodone(bp);
 }



CVS commit: [netbsd-8] src/doc

2018-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 24 23:51:05 UTC 2018

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

Log Message:
Tickets #1103 and #1104


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.60 -r1.1.2.61 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.60 src/doc/CHANGES-8.1:1.1.2.61
--- src/doc/CHANGES-8.1:1.1.2.60	Wed Nov 21 12:06:14 2018
+++ src/doc/CHANGES-8.1	Sat Nov 24 23:51:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.60 2018/11/21 12:06:14 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.61 2018/11/24 23:51:05 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1748,3 +1748,50 @@ sys/kern/kern_event.c1.104
 	Fix kernel info leak.
 	[maxv, ticket #1102]
 
+usr.sbin/mtree/create.c1.76
+
+	Avoid null de-reference.
+	[sevan, ticket #1103]
+
+libexec/httpd/testsuite/data/.bzremap   up to 1.1
+libexec/httpd/testsuite/t12.out up to 1.1
+libexec/httpd/testsuite/t12.in  up to 1.1
+libexec/httpd/testsuite/t13.out up to 1.1
+libexec/httpd/testsuite/t13.in  up to 1.1
+libexec/httpd/testsuite/t14.out up to 1.1
+libexec/httpd/testsuite/t14.in  up to 1.1
+libexec/httpd/testsuite/t15.out up to 1.1
+libexec/httpd/testsuite/t15.in  up to 1.1
+libexec/httpd/CHANGES   up to 1.28
+libexec/httpd/auth-bozo.c   up to 1.22
+libexec/httpd/bozohttpd.8   up to 1.74
+libexec/httpd/bozohttpd.c   up to 1.96
+libexec/httpd/bozohttpd.h   up to 1.56
+libexec/httpd/cgi-bozo.cup to 1.44
+libexec/httpd/content-bozo.cup to 1.16
+libexec/httpd/daemon-bozo.c up to 1.19
+libexec/httpd/dir-index-bozo.c  up to 1.28
+libexec/httpd/main.cup to 1.21
+libexec/httpd/ssl-bozo.cup to 1.25
+libexec/httpd/tilde-luzah-bozo.cup to 1.16
+libexec/httpd/lua/bozo.lua  up to 1.3
+libexec/httpd/lua/glue.cup to 1.5
+libexec/httpd/lua/optparse.lua  up to 1.2
+libexec/httpd/testsuite/Makefileup to 1.11
+libexec/httpd/testsuite/html_cmpup to 1.6
+libexec/httpd/testsuite/t3.out  up to 1.4
+libexec/httpd/testsuite/t5.out  up to 1.4
+libexec/httpd/testsuite/t6.out  up to 1.4
+libexec/httpd/testsuite/test-bigfileup to 1.5
+libexec/httpd/testsuite/test-simple up to 1.5
+
+	Sync with HEAD as of 2018-11-24. Includes various changes:
+	Cosmetic changes to Lua binding in bozohttpd.
+	Fix -C scripts execution and document restrictions.
+	Add support for remapping requested paths via a .bzredirect file.
+	Handle redirections for any protocol, not just http:.
+	Fix a denial of service attack against header contents, which
+	is now bounded at 16KiB.
+	Fix access checks for special files.
+	[mrg, #1104]
+



CVS commit: [netbsd-8] src/usr.sbin/mtree

2018-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 24 23:50:36 UTC 2018

Modified Files:
src/usr.sbin/mtree [netbsd-8]: create.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1103):

usr.sbin/mtree/create.c: revision 1.76

Adjust test, we only want to return the structure member if the result
is not NULL.

Heads up by Sascha Wildner @ DragonFly BSD.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.16.1 src/usr.sbin/mtree/create.c

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

Modified files:

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.73 src/usr.sbin/mtree/create.c:1.73.16.1
--- src/usr.sbin/mtree/create.c:1.73	Thu Apr 24 17:22:41 2014
+++ src/usr.sbin/mtree/create.c	Sat Nov 24 23:50:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $	*/
+/*	$NetBSD: create.c,v 1.73.16.1 2018/11/24 23:50:36 martin Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.73.16.1 2018/11/24 23:50:36 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,7 +117,7 @@ cwalk(FILE *fp)
 	host[sizeof(host) - 1] = '\0';
 	if ((user = getlogin()) == NULL) {
 		struct passwd *pw;
-		user = (pw = getpwuid(getuid())) == NULL ? pw->pw_name :
+		user = (pw = getpwuid(getuid())) != NULL ? pw->pw_name :
 		"";
 	}
 



CVS commit: [netbsd-8] src/libexec/httpd

2018-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 24 17:13:51 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-8]: CHANGES auth-bozo.c bozohttpd.8
bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c daemon-bozo.c
dir-index-bozo.c main.c ssl-bozo.c tilde-luzah-bozo.c
src/libexec/httpd/lua [netbsd-8]: bozo.lua glue.c optparse.lua
src/libexec/httpd/testsuite [netbsd-8]: Makefile html_cmp t3.out t5.out
t6.out test-bigfile test-simple
Added Files:
src/libexec/httpd/testsuite [netbsd-8]: t12.in t12.out t13.in t13.out
t14.in t14.out t15.in t15.out
src/libexec/httpd/testsuite/data [netbsd-8]: .bzremap

Log Message:
Sync to HEAD (requested by mrg in ticket #1104)

libexec/httpd/testsuite/data/.bzremap   up to 1.1
libexec/httpd/testsuite/t12.out up to 1.1
libexec/httpd/testsuite/t12.in  up to 1.1
libexec/httpd/testsuite/t13.out up to 1.1
libexec/httpd/testsuite/t13.in  up to 1.1
libexec/httpd/testsuite/t14.out up to 1.1
libexec/httpd/testsuite/t14.in  up to 1.1
libexec/httpd/testsuite/t15.out up to 1.1
libexec/httpd/testsuite/t15.in  up to 1.1
libexec/httpd/CHANGES   up to 1.28
libexec/httpd/auth-bozo.c   up to 1.22
libexec/httpd/bozohttpd.8   up to 1.74
libexec/httpd/bozohttpd.c   up to 1.96
libexec/httpd/bozohttpd.h   up to 1.56
libexec/httpd/cgi-bozo.cup to 1.44
libexec/httpd/content-bozo.cup to 1.16
libexec/httpd/daemon-bozo.c up to 1.19
libexec/httpd/dir-index-bozo.c  up to 1.28
libexec/httpd/main.cup to 1.21
libexec/httpd/ssl-bozo.cup to 1.25
libexec/httpd/tilde-luzah-bozo.cup to 1.16
libexec/httpd/lua/bozo.lua  up to 1.3
libexec/httpd/lua/glue.cup to 1.5
libexec/httpd/lua/optparse.lua  up to 1.2
libexec/httpd/testsuite/Makefileup to 1.11
libexec/httpd/testsuite/html_cmpup to 1.6
libexec/httpd/testsuite/t3.out  up to 1.4
libexec/httpd/testsuite/t5.out  up to 1.4
libexec/httpd/testsuite/t6.out  up to 1.4
libexec/httpd/testsuite/test-bigfileup to 1.5
libexec/httpd/testsuite/test-simple up to 1.5

Cosmetic changes to Lua binding in bozohttpd.

- Don't use negative indicies to read arguments of Lua functions.
- On error, return nil, "error string".
- Use ssize_t for return values from bozo_read() and bozo_write().
- Prefer lstring especially when if saves you from appending NUL and
  doing len + 1 which can potentially wraparound.
- Don't mix C allocations with Lua functions marked with "m" in the Lua
  manual. Those functions may throw (longjump) and leak data allocated
  by C function. In one case, I use luaL_Buffer, in the other case,
  I rearranged calls a bit.

fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
thanks!

s/u_int/unsigned/.

from Jan Danielsson.  increases/fixes portability.

PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.

Document script handler issues with httpd(8).
>From martin@, addressing PR 52194.

While here, use American spelling consistently and upper-case some
abbreviations.

Bump date.

fix output since protocol agnostic change went in.

XXX: i thought someone hooked this into atf already, please do :)

Add support for remapping requested paths via a .bzredirect file.
Fixes PR 52772. Ok: mrg@

Bump date

Remove trailing whitespace.

use __func__ in debug().

fix a denial of service attack against header contents, which
is now bounded at 16KiB.  reported by JP.

avoid memory leak in sending multiple auth headers.
mostly mitigated by previous patch to limit total header size,
but still a real problem here.

note the changes present in bozohttpd 20181118:

o  add url remap support via .bzremap file, from martin%netbsd.org@localhost
o  handle redirections for any protocol, not just http:
o  fix a denial of service attack against header contents, which
   is now bounded at 16KiB.  reported by JP.

from CHANGES:

o  reduce default timeouts, and add expand timeouts to handle the
   initial line, each header, and the total time spent
o  add -T option to expose new timeout settings
o  minor RFC fixes related to timeout handling responses

old timeouts:
60 seconds for initial request like, 60 seconds per 

CVS commit: [netbsd-8] src/doc

2018-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 21 12:06:14 UTC 2018

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

Log Message:
Tickets #1100, #1101 and #1102


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.59 -r1.1.2.60 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.59 src/doc/CHANGES-8.1:1.1.2.60
--- src/doc/CHANGES-8.1:1.1.2.59	Tue Nov 20 16:06:49 2018
+++ src/doc/CHANGES-8.1	Wed Nov 21 12:06:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.59 2018/11/20 16:06:49 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.60 2018/11/21 12:06:14 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1733,3 +1733,18 @@ sys/dev/usb/usbdi.c1.179,1.180
 	Workaround NBP PN533 USB toggle bit bugs.
 	[manu, ticket #1099]
 
+sys/kern/kern_exec.c1.462
+
+	Fix stack info leak.
+	[maxv, ticket #1100]
+
+sys/net/rtsock.c1.244
+
+	Fix kernel info leak.
+	[maxv, ticket #1101]
+
+sys/kern/kern_event.c1.104
+
+	Fix kernel info leak.
+	[maxv, ticket #1102]
+



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

2018-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 21 12:05:10 UTC 2018

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

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

sys/kern/kern_event.c: revision 1.104

Fix kernel info leak. There are 4 bytes of padding in struct kevent.
[  287.537676] kleak: Possible leak in copyout: [len=40, leaked=4]
[  287.537676] #0 0x80b7c41a in kleak_note 
[  287.547673] #1 0x80b7c49a in kleak_copyout 
[  287.557677] #2 0x80b1d32d in kqueue_scan.isra.1.constprop.2 
[  287.557677] #3 0x80b1dc6a in kevent1 
[  287.567683] #4 0x80b1dcb0 in sys___kevent50 
[  287.567683] #5 0x8025ab3c in sy_call 
[  287.577688] #6 0x8025ad6e in sy_invoke 
[  287.587693] #7 0x8025adf4 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.91.2.2 -r1.91.2.3 src/sys/kern/kern_event.c

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

Modified files:

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.91.2.2 src/sys/kern/kern_event.c:1.91.2.3
--- src/sys/kern/kern_event.c:1.91.2.2	Tue Jan 16 13:26:12 2018
+++ src/sys/kern/kern_event.c	Wed Nov 21 12:05:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.91.2.2 2018/01/16 13:26:12 martin Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.91.2.3 2018/11/21 12:05:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.91.2.2 2018/01/16 13:26:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.91.2.3 2018/11/21 12:05:09 martin Exp $");
 
 #include 
 #include 
@@ -584,6 +584,7 @@ filt_proc(struct knote *kn, long hint)
 		 * event with the parent's pid.  Register knote with new
 		 * process.
 		 */
+		memset(, 0, sizeof(kev));
 		kev.ident = hint & NOTE_PDATAMASK;	/* pid */
 		kev.filter = kn->kn_filter;
 		kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_FLAG1;



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

2018-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 21 12:01:11 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: rtsock.c

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

sys/net/rtsock.c: revision 1.244

Fix kernel info leak. There are 2 bytes of padding in struct if_msghdr.
[  944.607323] kleak: Possible leak in copyout: [len=176, leaked=2]
[  944.617335] #0 0x80b7c44a in kleak_note 
[  944.627332] #1 0x80b7c4ca in kleak_copyout 
[  944.627332] #2 0x80c91698 in sysctl_iflist_if 
[  944.637336] #3 0x80c91d3c in sysctl_iflist 
[  944.647343] #4 0x80c93855 in sysctl_rtable 
[  944.647343] #5 0x80b5b328 in sysctl_dispatch 
[  944.657346] #6 0x80b5b62e in sys___sysctl 
[  944.667354] #7 0x8025ab3c in sy_call 
[  944.667354] #8 0x8025ad6e in sy_invoke 
[  944.677365] #9 0x8025adf4 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.213.2.10 -r1.213.2.11 src/sys/net/rtsock.c

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

Modified files:

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.213.2.10 src/sys/net/rtsock.c:1.213.2.11
--- src/sys/net/rtsock.c:1.213.2.10	Sat May  5 19:07:51 2018
+++ src/sys/net/rtsock.c	Wed Nov 21 12:01:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.213.2.10 2018/05/05 19:07:51 martin Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.213.2.11 2018/11/21 12:01:11 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.10 2018/05/05 19:07:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.11 2018/11/21 12:01:11 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1294,7 +1294,7 @@ again:
 			if (rw->w_tmemsize < len) {
 if (rw->w_tmem)
 	kmem_free(rw->w_tmem, rw->w_tmemsize);
-rw->w_tmem = kmem_alloc(len, KM_SLEEP);
+rw->w_tmem = kmem_zalloc(len, KM_SLEEP);
 rw->w_tmemsize = len;
 			}
 			if (rw->w_tmem) {
@@ -1863,7 +1863,7 @@ sysctl_rtable(SYSCTLFN_ARGS)
 again:
 	/* we may return here if a later [re]alloc of the t_mem buffer fails */
 	if (w.w_tmemneeded) {
-		w.w_tmem = kmem_alloc(w.w_tmemneeded, KM_SLEEP);
+		w.w_tmem = kmem_zalloc(w.w_tmemneeded, KM_SLEEP);
 		w.w_tmemsize = w.w_tmemneeded;
 		w.w_tmemneeded = 0;
 	}



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

2018-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 21 11:58:32 UTC 2018

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

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

sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.
[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0x80224d0a in kleak_note 
[  223.906430] #1 0x80224d8a in kleak_copyout 
[  223.918363] #2 0x80b1e26c in copyoutpsstrs 
[  223.926560] #3 0x80b1e331 in copyoutargs 
[  223.936216] #4 0x80b21768 in execve_runproc 
[  223.946225] #5 0x80b21cc9 in execve1 
[  223.946225] #6 0x8025a89c in sy_call 
[  223.956225] #7 0x8025aace in sy_invoke 
[  223.966232] #8 0x8025ab54 in syscall 


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

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.442.4.3 src/sys/kern/kern_exec.c:1.442.4.4
--- src/sys/kern/kern_exec.c:1.442.4.3	Sat Mar 17 11:19:27 2018
+++ src/sys/kern/kern_exec.c	Wed Nov 21 11:58:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.442.4.3 2018/03/17 11:19:27 martin Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.442.4.4 2018/11/21 11:58:32 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.442.4.3 2018/03/17 11:19:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.442.4.4 2018/11/21 11:58:32 martin Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1447,6 +1447,8 @@ copyoutargs(struct execve_data * restric
 	struct proc		*p = l->l_proc;
 	int			error;
 
+	memset(>ed_arginfo, 0, sizeof(data->ed_arginfo));
+
 	/* remember information about the process */
 	data->ed_arginfo.ps_nargvstr = data->ed_argc;
 	data->ed_arginfo.ps_nenvstr = data->ed_envc;



CVS commit: [netbsd-8] src/doc

2018-11-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 20 16:06:49 UTC 2018

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

Log Message:
Ticket #1098 and #1099


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.58 -r1.1.2.59 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.58 src/doc/CHANGES-8.1:1.1.2.59
--- src/doc/CHANGES-8.1:1.1.2.58	Sun Nov 18 19:34:52 2018
+++ src/doc/CHANGES-8.1	Tue Nov 20 16:06:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.58 2018/11/18 19:34:52 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.59 2018/11/20 16:06:49 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1721,4 +1721,15 @@ sys/arch/macppc/stand/ofwboot/version		1
 	PR port-macppc/53727.
 	[tsutsui, ticket #1097]
 
+external/bsd/nsd/dist/server.c			1.2
+
+	Fix NSD when built with --enable-recvmmsg.
+	[hannken, ticket #1098]
+
+sys/dev/usb/usb_quirks.c			1.90
+sys/dev/usb/usb_quirks.h			1.29
+sys/dev/usb/usbdi.c1.179,1.180
+
+	Workaround NBP PN533 USB toggle bit bugs.
+	[manu, ticket #1099]
 



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

2018-11-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 20 16:05:38 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: usb_quirks.c usb_quirks.h usbdi.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1099):

sys/dev/usb/usb_quirks.c: revision 1.90
sys/dev/usb/usbdi.c: revision 1.179
sys/dev/usb/usb_quirks.h: revision 1.29
sys/dev/usb/usbdi.c: revision 1.180

Workaround NBP PN533 USB toggle bit bugs

The PN533 is known to mishandle the USB toggle bit, causing replies to
be filtered out by the host controller. As a result, the kernel sees
a timed out operation.

Vendor errata suggests that userland applications should detect the
situation on read timeout, and write a dumy frame to resync the toggle bit.
NFC Tools's libnfc does just that, but in order to succeed, the dummy
frame write must not be reported as timed out.

We therefore introduce a new USB quirk for devices known to miss output
acks. When that occur, we pretend that the operation succeeded, leaving
userland the duty to check that everything went okay.

This workaround lets libnfc recover from interrupted communications
without the need te reboot the system.

 -

Build fix
>From David H. Gutteridge


To generate a diff of this commit:
cvs rdiff -u -r1.86.8.1 -r1.86.8.2 src/sys/dev/usb/usb_quirks.c
cvs rdiff -u -r1.27.10.1 -r1.27.10.2 src/sys/dev/usb/usb_quirks.h
cvs rdiff -u -r1.173.2.3 -r1.173.2.4 src/sys/dev/usb/usbdi.c

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

Modified files:

Index: src/sys/dev/usb/usb_quirks.c
diff -u src/sys/dev/usb/usb_quirks.c:1.86.8.1 src/sys/dev/usb/usb_quirks.c:1.86.8.2
--- src/sys/dev/usb/usb_quirks.c:1.86.8.1	Mon Nov 12 16:01:35 2018
+++ src/sys/dev/usb/usb_quirks.c	Tue Nov 20 16:05:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_quirks.c,v 1.86.8.1 2018/11/12 16:01:35 martin Exp $	*/
+/*	$NetBSD: usb_quirks.c,v 1.86.8.2 2018/11/20 16:05:38 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.30 2003/01/02 04:15:55 imp Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.86.8.1 2018/11/12 16:01:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.86.8.2 2018/11/20 16:05:38 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -310,13 +310,24 @@ Static const struct usbd_quirk_entry {
  { USB_VENDOR_ZOOM,		USB_PRODUCT_ZOOM_3095,			ANY,
 	{ UQ_LOST_CS_DESC, NULL }},
 
- /* NXP PN533 corrupts its USB configuration descriptors */
+ /*
+  * NXP PN533 bugs
+  * 
+  * 1. It corrupts its USB descriptors. The quirk is to provide hardcoded
+  *descriptors instead of getting them from the device.
+  * 2. It mishandles the USB toggle bit. This causes some replies to be
+  *filered out by the USB host controller and be reported as timed out.
+  *NFC tool's libnfc workaround this bug by sending a dummy frame to
+  *resync the toggle bit, but in order to succeed, that operation must
+  *not be reported as failed. The quirk is therefore to pretend to 
+  *userland that output timeouts are successes.
+  */
  { USB_VENDOR_PHILIPSSEMI,	USB_PRODUCT_PHILIPSSEMI_PN533,		ANY,
-	{ UQ_DESC_CORRUPT, desc_pn533 }},
+	{ UQ_DESC_CORRUPT | UQ_MISS_OUT_ACK, desc_pn533 }},
  { USB_VENDOR_SHUTTLE,		USB_PRODUCT_SHUTTLE_SCL3711,		ANY,
-	{ UQ_DESC_CORRUPT, desc_pn533 }},
+	{ UQ_DESC_CORRUPT | UQ_MISS_OUT_ACK, desc_pn533 }},
  { USB_VENDOR_SHUTTLE,		USB_PRODUCT_SHUTTLE_SCL3712,		ANY,
-	{ UQ_DESC_CORRUPT, desc_pn533 }},
+	{ UQ_DESC_CORRUPT | UQ_MISS_OUT_ACK, desc_pn533 }},
  { 0, 0, 0, { 0, NULL } }
 };
 

Index: src/sys/dev/usb/usb_quirks.h
diff -u src/sys/dev/usb/usb_quirks.h:1.27.10.1 src/sys/dev/usb/usb_quirks.h:1.27.10.2
--- src/sys/dev/usb/usb_quirks.h:1.27.10.1	Mon Nov 12 16:01:35 2018
+++ src/sys/dev/usb/usb_quirks.h	Tue Nov 20 16:05:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_quirks.h,v 1.27.10.1 2018/11/12 16:01:35 martin Exp $	*/
+/*	$NetBSD: usb_quirks.h,v 1.27.10.2 2018/11/20 16:05:38 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $	*/
 
 /*
@@ -50,6 +50,7 @@ struct usbd_quirks {
 #define UQ_LOST_CS_DESC 0x1 /* look everywhere for the CS descriptors */
 #define UQ_APPLE_ISO	0x2	/* force ISO layout on Apple keyboards */
 #define UQ_DESC_CORRUPT	0x4	/* may corrupt its config descriptors */
+#define UQ_MISS_OUT_ACK	0x8	/* may fail to ack output */
 	const usb_descriptor_t **desc;	/* Replacement for UQ_DESC_CORRUPT */
 };
 

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.173.2.3 src/sys/dev/usb/usbdi.c:1.173.2.4
--- src/sys/dev/usb/usbdi.c:1.173.2.3	Thu Sep 27 14:52:26 2018
+++ src/sys/dev/usb/usbdi.c	Tue Nov 20 16:05:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.173.2.3 2018/09/27 14:52:26 martin Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.173.2.4 2018/11/20 16:05:38 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD 

CVS commit: [netbsd-8] src/external/bsd/nsd/dist

2018-11-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 20 16:02:50 UTC 2018

Modified Files:
src/external/bsd/nsd/dist [netbsd-8]: server.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1098):

external/bsd/nsd/dist/server.c: revision 1.2

Fix NSD when built with --enable-recvmmsg:

When resetting a query with query_reset(queries[i], ...) always restore the
corresponding msgs[i].msg_hdr.msg_namelen from queries[i]->addrlen.

After receiving a message set queries[i]->addrlen to the received msg_namelen.

Reported upstream, will be fixed for 4.1.26


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.8.1 -r1.1.1.1.8.2 src/external/bsd/nsd/dist/server.c

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

Modified files:

Index: src/external/bsd/nsd/dist/server.c
diff -u src/external/bsd/nsd/dist/server.c:1.1.1.1.8.1 src/external/bsd/nsd/dist/server.c:1.1.1.1.8.2
--- src/external/bsd/nsd/dist/server.c:1.1.1.1.8.1	Sat Oct 13 17:30:00 2018
+++ src/external/bsd/nsd/dist/server.c	Tue Nov 20 16:02:50 2018
@@ -2209,6 +2209,7 @@ handle_udp(int fd, short event, void* ar
 	for (i = 0; i < recvcount; i++) {
 	loopstart:
 		received = msgs[i].msg_len;
+		queries[i]->addrlen = msgs[i].msg_hdr.msg_namelen;
 		q = queries[i];
 		if (received == -1) {
 			log_msg(LOG_ERR, "recvmmsg %d failed %s", i, strerror(
@@ -2217,6 +2218,7 @@ handle_udp(int fd, short event, void* ar
 			/* No zone statup */
 			query_reset(queries[i], UDP_MAX_MESSAGE_LEN, 0);
 			iovecs[i].iov_len = buffer_remaining(q->packet);
+			msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
 			goto swap_drop;
 		}
 
@@ -2264,6 +2266,7 @@ handle_udp(int fd, short event, void* ar
 		} else {
 			query_reset(queries[i], UDP_MAX_MESSAGE_LEN, 0);
 			iovecs[i].iov_len = buffer_remaining(q->packet);
+			msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
 		swap_drop:
 			STATUP(data->nsd, dropped);
 			ZTATUP(data->nsd, q->zone, dropped);
@@ -2304,6 +2307,7 @@ handle_udp(int fd, short event, void* ar
 	for(i=0; ipacket);
+		msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
 	}
 }
 
@@ -2344,13 +2348,15 @@ handle_udp(int fd, short event, void* ar
 	}
 	for (i = 0; i < recvcount; i++) {
 		received = msgs[i].msg_len;
-		msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
+		queries[i]->addrlen = msgs[i].msg_hdr.msg_namelen;
 		if (received == -1) {
 			log_msg(LOG_ERR, "recvmmsg failed");
 			STATUP(data->nsd, rxerr);
 			/* No zone statup */
 			/* the error can be found in msgs[i].msg_hdr.msg_flags */
 			query_reset(queries[i], UDP_MAX_MESSAGE_LEN, 0);
+			iovecs[i].iov_len = buffer_remaining(queries[i]->packet);
+			msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
 			continue;
 		}
 		q = queries[i];
@@ -2442,6 +2448,8 @@ handle_udp(int fd, short event, void* ar
 #ifndef NONBLOCKING_IS_BROKEN
 #ifdef HAVE_RECVMMSG
 		query_reset(queries[i], UDP_MAX_MESSAGE_LEN, 0);
+		iovecs[i].iov_len = buffer_remaining(queries[i]->packet);
+		msgs[i].msg_hdr.msg_namelen = queries[i]->addrlen;
 #endif
 	}
 #endif



CVS commit: [netbsd-8] src/doc

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 19:34:52 UTC 2018

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

Log Message:
Ticket #1097


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.57 -r1.1.2.58 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.57 src/doc/CHANGES-8.1:1.1.2.58
--- src/doc/CHANGES-8.1:1.1.2.57	Sun Nov 18 12:00:18 2018
+++ src/doc/CHANGES-8.1	Sun Nov 18 19:34:52 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.57 2018/11/18 12:00:18 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.58 2018/11/18 19:34:52 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1714,3 +1714,11 @@ libexec/makewhatis/makewhatis.c			1.50,1
 	Fix time.h include.
 	[sevan, ticket #1096]
 
+sys/arch/macppc/stand/ofwboot/ofdev.c		1.27
+sys/arch/macppc/stand/ofwboot/version		1.14
+
+	Fix boot failure from installation floppies.
+	PR port-macppc/53727.
+	[tsutsui, ticket #1097]
+
+



CVS commit: [netbsd-8] src/sys/arch/macppc/stand/ofwboot

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 19:33:44 UTC 2018

Modified Files:
src/sys/arch/macppc/stand/ofwboot [netbsd-8]: ofdev.c version

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

sys/arch/macppc/stand/ofwboot/version: revision 1.14
sys/arch/macppc/stand/ofwboot/ofdev.c: revision 1.27

Fix boot failure from installation floppies.  PR port-macppc/53727

Also bump version to denote a visible fix.

Should be pulled up to netbsd-8 and netbsd-7.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.32.1 src/sys/arch/macppc/stand/ofwboot/ofdev.c
cvs rdiff -u -r1.13 -r1.13.52.1 src/sys/arch/macppc/stand/ofwboot/version

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/macppc/stand/ofwboot/ofdev.c
diff -u src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.26 src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.26.32.1
--- src/sys/arch/macppc/stand/ofwboot/ofdev.c:1.26	Sun Feb 19 12:02:55 2012
+++ src/sys/arch/macppc/stand/ofwboot/ofdev.c	Sun Nov 18 19:33:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofdev.c,v 1.26 2012/02/19 12:02:55 tsutsui Exp $	*/
+/*	$NetBSD: ofdev.c,v 1.26.32.1 2018/11/18 19:33:44 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -437,10 +437,11 @@ devopen(struct open_file *of, const char
 		ofdev.type = OFDEV_DISK;
 		ofdev.bsize = DEV_BSIZE;
 		/* First try to find a disklabel without partitions */
-		if (strategy(, F_READ,
-			 LABELSECTOR, DEV_BSIZE, buf, ) != 0
-		|| nread != DEV_BSIZE
-		|| getdisklabel(buf, )) {
+		if (!floppyboot &&
+		(strategy(, F_READ,
+			  LABELSECTOR, DEV_BSIZE, buf, ) != 0
+		 || nread != DEV_BSIZE
+		 || getdisklabel(buf, ))) {
 			/* Else try APM or MBR partitions */
 			struct drvr_map *map = (struct drvr_map *)buf;
 

Index: src/sys/arch/macppc/stand/ofwboot/version
diff -u src/sys/arch/macppc/stand/ofwboot/version:1.13 src/sys/arch/macppc/stand/ofwboot/version:1.13.52.1
--- src/sys/arch/macppc/stand/ofwboot/version:1.13	Sun Oct 17 15:33:04 2010
+++ src/sys/arch/macppc/stand/ofwboot/version	Sun Nov 18 19:33:44 2018
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.13 2010/10/17 15:33:04 phx Exp $
+$NetBSD: version,v 1.13.52.1 2018/11/18 19:33:44 martin Exp $
 
 1.1:		Initial revision from NetBSD/powerpc.
 1.2:		Use MI loadfile().
@@ -14,3 +14,4 @@ $NetBSD: version,v 1.13 2010/10/17 15:33
 1.11:		Check floppyboot and disable LOAD_NOTE to avoid backward seek.
 1.12:		Read Apple Partition Map to find the root partition, when
 		no OF path was specified.
+1.13:		Fix boot failure of installation floppies



CVS commit: [netbsd-8] src/doc

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 12:00:18 UTC 2018

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

Log Message:
Tickets #1094, #1095 and #1096


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.56 -r1.1.2.57 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.56 src/doc/CHANGES-8.1:1.1.2.57
--- src/doc/CHANGES-8.1:1.1.2.56	Tue Nov 13 16:57:45 2018
+++ src/doc/CHANGES-8.1	Sun Nov 18 12:00:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.56 2018/11/13 16:57:45 snj Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.57 2018/11/18 12:00:18 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1696,3 +1696,21 @@ sys/compat/netbsd32/netbsd32_socket.c		1
 	Fix inverted logic, which leads to buffer overflow.
 	[maxv, ticket #1093]
 
+sys/arch/x86/x86/procfs_machdep.c		1.25
+
+	Fix output of LAPIC ID and initial APIC ID.
+	[msaitoh, ticket #1094]
+
+sys/arch/newsmips/apbus/apbus.c			1.23
+sys/arch/newsmips/apbus/apbus_subr.c		1.10
+sys/arch/newsmips/apbus/apbusvar.h		1.10
+sys/arch/newsmips/conf/std.newsmips		1.18
+
+	Fix news5000 panic during boot on APbus attach. PR port-newsmips/53626.
+	[tsutsui, ticket #1095]
+
+libexec/makewhatis/makewhatis.c			1.50,1.51
+
+	Fix time.h include.
+	[sevan, ticket #1096]
+



CVS commit: [netbsd-8] src/libexec/makewhatis

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 11:58:20 UTC 2018

Modified Files:
src/libexec/makewhatis [netbsd-8]: makewhatis.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1096):

libexec/makewhatis/makewhatis.c: revision 1.50
libexec/makewhatis/makewhatis.c: revision 1.51

Include time.h for time.
XXX Doesn't build with newer zlib, remove?

 -

make this compile.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.20.1 src/libexec/makewhatis/makewhatis.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/makewhatis/makewhatis.c
diff -u src/libexec/makewhatis/makewhatis.c:1.49 src/libexec/makewhatis/makewhatis.c:1.49.20.1
--- src/libexec/makewhatis/makewhatis.c:1.49	Mon Jun 24 20:57:47 2013
+++ src/libexec/makewhatis/makewhatis.c	Sun Nov 18 11:58:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: makewhatis.c,v 1.49 2013/06/24 20:57:47 christos Exp $	*/
+/*	$NetBSD: makewhatis.c,v 1.49.20.1 2018/11/18 11:58:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: makewhatis.c,v 1.49 2013/06/24 20:57:47 christos Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.49.20.1 2018/11/18 11:58:20 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -58,6 +58,7 @@ __RCSID("$NetBSD: makewhatis.c,v 1.49 20
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -97,10 +98,10 @@ static void	addwhatis(whatis **, char *,
 static char	*makesection(int);
 static char	*makewhatisline(const char *, const char *, const char *);
 static void	catpreprocess(char *);
-static char	*parsecatpage(const char *, gzFile *);
+static char	*parsecatpage(const char *, gzFile);
 static int	manpreprocess(char *);
-static char	*nroff(const char *, gzFile *);
-static char	*parsemanpage(const char *, gzFile *, int);
+static char	*nroff(const char *, gzFile);
+static char	*parsemanpage(const char *, gzFile, int);
 static char	*getwhatisdata(char *);
 static void	processmanpages(manpage **, whatis **);
 static void	dumpwhatis(FILE *, whatis *);
@@ -624,7 +625,7 @@ makewhatisline(const char *file, const c
 }
 
 static char *
-parsecatpage(const char *name, gzFile *in)
+parsecatpage(const char *name, gzFile in)
 {
 	char	 buffer[8192];
 	char	*section, *ptr, *last;
@@ -769,7 +770,7 @@ manpreprocess(char *line)
 }
 
 static char *
-nroff(const char *inname, gzFile *in)
+nroff(const char *inname, gzFile in)
 {
 	char tempname[MAXPATHLEN], buffer[65536], *data;
 	int tempfd, bytes, pipefd[2], status;
@@ -868,7 +869,7 @@ nroff(const char *inname, gzFile *in)
 }
 
 static char *
-parsemanpage(const char *name, gzFile *in, int defaultsection)
+parsemanpage(const char *name, gzFile in, int defaultsection)
 {
 	char	*section, buffer[8192], *ptr;
 	static const char POD[] = ".\\\" Automatically generated by Pod";
@@ -1097,7 +1098,7 @@ parsemanpage(const char *name, gzFile *i
 static char *
 getwhatisdata(char *name)
 {
-	gzFile	*in;
+	gzFile	in;
 	char	*data;
 	int	 section;
 



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

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 11:54:03 UTC 2018

Modified Files:
src/sys/arch/newsmips/apbus [netbsd-8]: apbus.c apbus_subr.c apbusvar.h
src/sys/arch/newsmips/conf [netbsd-8]: std.newsmips

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

sys/arch/newsmips/apbus/apbus.c: revision 1.23
sys/arch/newsmips/apbus/apbus_subr.c: revision 1.10
sys/arch/newsmips/apbus/apbusvar.h: revision 1.10
sys/arch/newsmips/conf/std.newsmips: revision 1.18

Fix news5000 panic during boot on APbus attach. PR port-newsmips/53626

Discussed with ryo@ (the original author of news5000 support).

Should be pulled up to netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.48.1 src/sys/arch/newsmips/apbus/apbus.c
cvs rdiff -u -r1.9 -r1.9.22.1 src/sys/arch/newsmips/apbus/apbus_subr.c
cvs rdiff -u -r1.9 -r1.9.100.1 src/sys/arch/newsmips/apbus/apbusvar.h
cvs rdiff -u -r1.17 -r1.17.158.1 src/sys/arch/newsmips/conf/std.newsmips

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/newsmips/apbus/apbus.c
diff -u src/sys/arch/newsmips/apbus/apbus.c:1.22 src/sys/arch/newsmips/apbus/apbus.c:1.22.48.1
--- src/sys/arch/newsmips/apbus/apbus.c:1.22	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/apbus/apbus.c	Sun Nov 18 11:54:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: apbus.c,v 1.22.48.1 2018/11/18 11:54:02 martin Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.22.48.1 2018/11/18 11:54:02 martin Exp $");
 
 #define __INTR_PRIVATE
 
@@ -99,6 +99,7 @@ apbusattach(device_t parent, device_t se
 	struct newsmips_intr *ip;
 	int i;
 
+	apbus_map_romwork();
 	mips_set_wbflush(apbus_wbflush);
 
 	*(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x;

Index: src/sys/arch/newsmips/apbus/apbus_subr.c
diff -u src/sys/arch/newsmips/apbus/apbus_subr.c:1.9 src/sys/arch/newsmips/apbus/apbus_subr.c:1.9.22.1
--- src/sys/arch/newsmips/apbus/apbus_subr.c:1.9	Mon Mar 24 20:05:20 2014
+++ src/sys/arch/newsmips/apbus/apbus_subr.c	Sun Nov 18 11:54:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $	*/
+/*	$NetBSD: apbus_subr.c,v 1.9.22.1 2018/11/18 11:54:02 martin Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,15 +27,47 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.9.22.1 2018/11/18 11:54:02 martin Exp $");
 
 #include 
 #include 
 
+#include 
+
+#include 
+#include 
+
+#include 
+
 #include 
 
 static void apctl_dump(struct apbus_ctl *);
 
+#define	APBUS_ROMWORK_VA	0xfff0
+
+void
+apbus_map_romwork(void)
+{
+	static bool mapped = false;
+	vaddr_t apbd_work_va;
+	vsize_t apbd_work_sz;
+	paddr_t apbd_work_pa;
+
+	if (!mapped) {
+		/* map PROM work RAM into VA 0xFFF0 - 0x */
+		apbd_work_va = APBUS_ROMWORK_VA;
+		apbd_work_sz = MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_1M);
+		apbd_work_pa = ctob(physmem);
+
+		mapped = mips3_wired_enter_page(apbd_work_va, apbd_work_pa,
+		apbd_work_sz);
+		if (!mapped) {
+			printf("%s: cannot allocate APbus PROM work\n",
+			__func__);
+		}
+	}
+}
+
 void *
 apbus_device_to_hwaddr(struct apbus_dev *apbus_dev)
 {

Index: src/sys/arch/newsmips/apbus/apbusvar.h
diff -u src/sys/arch/newsmips/apbus/apbusvar.h:1.9 src/sys/arch/newsmips/apbus/apbusvar.h:1.9.100.1
--- src/sys/arch/newsmips/apbus/apbusvar.h:1.9	Wed Oct 17 19:55:54 2007
+++ src/sys/arch/newsmips/apbus/apbusvar.h	Sun Nov 18 11:54:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbusvar.h,v 1.9 2007/10/17 19:55:54 garbled Exp $	*/
+/*	$NetBSD: apbusvar.h,v 1.9.100.1 2018/11/18 11:54:02 martin Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -39,6 +39,7 @@ struct apbus_attach_args {
 	u_long	apa_hwbase;	/* hardware I/O address */
 };
 
+void apbus_map_romwork(void);
 void *apbus_device_to_hwaddr(struct apbus_dev *);
 struct apbus_dev *apbus_lookupdev(char *);
 void apdevice_dump(struct apbus_dev *);

Index: src/sys/arch/newsmips/conf/std.newsmips
diff -u src/sys/arch/newsmips/conf/std.newsmips:1.17 src/sys/arch/newsmips/conf/std.newsmips:1.17.158.1
--- src/sys/arch/newsmips/conf/std.newsmips:1.17	Sun Dec 11 12:18:24 2005
+++ src/sys/arch/newsmips/conf/std.newsmips	Sun Nov 18 11:54:03 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.newsmips,v 1.17 2005/12/11 12:18:24 christos Exp $
+#	$NetBSD: std.newsmips,v 1.17.158.1 2018/11/18 11:54:03 martin Exp $
 
 machine newsmips mips
 include		"conf/std"	# MI standard options
@@ -7,5 +7,7 @@ makeoptions	MACHINE_ARCH="mipseb"
 options 	EXEC_ELF32	# exec ELF32 

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

2018-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 18 11:16:52 UTC 2018

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

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

sys/arch/x86/x86/procfs_machdep.c: revision 1.25

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
   Print it correctly.

- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.6 -r1.15.2.7 src/sys/arch/x86/x86/procfs_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/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.6 src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.7
--- src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.6	Sun Sep 23 17:35:33 2018
+++ src/sys/arch/x86/x86/procfs_machdep.c	Sun Nov 18 11:16:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.15.2.6 2018/09/23 17:35:33 martin Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.15.2.7 2018/11/18 11:16:52 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.6 2018/09/23 17:35:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.7 2018/11/18 11:16:52 martin Exp $");
 
 #include 
 #include 
@@ -421,9 +421,9 @@ procfs_getonecpu(int xcpu, struct cpu_in
 		left = 0;
 
 	l = snprintf(p, left,
-	"apicid\t\t: %d\n"
-	"initial apicid\t: %d\n",
-	ci->ci_acpiid,
+	"apicid\t\t: %lu\n"
+	"initial apicid\t: %u\n",
+	ci->ci_cpuid,
 	ci->ci_initapicid
 	);
 	size += l;



CVS commit: [netbsd-8] src/doc

2018-11-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Nov 13 16:57:45 UTC 2018

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

Log Message:
1093


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.55 -r1.1.2.56 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.55 src/doc/CHANGES-8.1:1.1.2.56
--- src/doc/CHANGES-8.1:1.1.2.55	Mon Nov 12 16:03:17 2018
+++ src/doc/CHANGES-8.1	Tue Nov 13 16:57:45 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.55 2018/11/12 16:03:17 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.56 2018/11/13 16:57:45 snj Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1691,3 +1691,8 @@ sys/dev/usb/usbdevs_data.h			(regen)
 	in those chips destroying USB descirptors.
 	[manu, ticket #1091]
 
+sys/compat/netbsd32/netbsd32_socket.c		1.48 via patch
+
+	Fix inverted logic, which leads to buffer overflow.
+	[maxv, ticket #1093]
+



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

2018-11-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Nov 13 16:55:22 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1093):
sys/compat/netbsd32/netbsd32_socket.c: 1.48
Fix inverted logic, which leads to buffer overflow. Detected by kASan.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.44 src/sys/compat/netbsd32/netbsd32_socket.c:1.44.8.1
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.44	Tue Sep 13 07:01:07 2016
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Tue Nov 13 16:55:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.44 2016/09/13 07:01:07 martin Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.44.8.1 2018/11/13 16:55:22 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.44 2016/09/13 07:01:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.44.8.1 2018/11/13 16:55:22 snj Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@ copyout32_msg_control_mbuf(struct lwp *l
 		}
 
 		ktrkuser("msgcontrol", cmsg, cmsg->cmsg_len);
-		error = copyout(, *q, MAX(i, sizeof(cmsg32)));
+		error = copyout(, *q, MIN(i, sizeof(cmsg32)));
 		if (error)
 			return (error);
 		if (i > CMSG32_LEN(0)) {



CVS commit: [netbsd-8] src/doc

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 16:03:17 UTC 2018

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

Log Message:
Ticket #1091


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.54 src/doc/CHANGES-8.1:1.1.2.55
--- src/doc/CHANGES-8.1:1.1.2.54	Mon Nov 12 12:24:42 2018
+++ src/doc/CHANGES-8.1	Mon Nov 12 16:03:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.54 2018/11/12 12:24:42 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.55 2018/11/12 16:03:17 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1679,3 +1679,15 @@ sys/netipsec/keysock.c1.66
 	Don't call soroverflow when we return the error to the sender.
 	[roy, ticket #1092]
 
+sys/dev/usb/usb_quirks.c			1.88,1.89 (patch)
+sys/dev/usb/usb_quirks.h			1.28 (patch)
+sys/dev/usb/usbdevs1.760,1.761 (patch)
+sys/dev/usb/usbdi_util.c			1.72 (patch)
+sys/dev/usb/usbdi_util.h			1.48 (patch)
+sys/dev/usb/usbdevs.h(regen)
+sys/dev/usb/usbdevs_data.h			(regen)
+
+	Add PN533 based NFC devices and a workaround for an errata
+	in those chips destroying USB descirptors.
+	[manu, ticket #1091]
+



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

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 16:02:18 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdevs.h usbdevs_data.h

Log Message:
regen for ticket #1091


To generate a diff of this commit:
cvs rdiff -u -r1.727.2.1 -r1.727.2.2 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.728.2.1 -r1.728.2.2 src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.727.2.1 src/sys/dev/usb/usbdevs.h:1.727.2.2
--- src/sys/dev/usb/usbdevs.h:1.727.2.1	Wed Oct 31 09:32:21 2018
+++ src/sys/dev/usb/usbdevs.h	Mon Nov 12 16:02:17 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.727.2.1 2018/10/31 09:32:21 martin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.727.2.2 2018/11/12 16:02:17 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.736.2.1 2018/10/31 09:30:10 martin Exp
+ *	NetBSD: usbdevs,v 1.736.2.2 2018/11/12 16:01:35 martin Exp
  */
 
 /*
@@ -2595,6 +2595,7 @@
 
 /* Philips Semiconductor products */
 #define	USB_PRODUCT_PHILIPSSEMI_HUB1122	0x1122		/* hub */
+#define	USB_PRODUCT_PHILIPSSEMI_PN533	0x2533		/* NFC PN533 */
 
 /* P.I. Engineering products */
 #define	USB_PRODUCT_PIENGINEERING_PS2USB	0x020b		/* PS2 to Mac USB Adapter */
@@ -2938,6 +2939,8 @@
 #define	USB_PRODUCT_SHUTTLE_CDRW	0x0101		/* CD-RW Device */
 #define	USB_PRODUCT_SHUTTLE_ORCA	0x0325		/* eUSB ORCA Quad Reader */
 #define	USB_PRODUCT_SHUTTLE_SCM	0x1010		/* SCM Micro */
+#define	USB_PRODUCT_SHUTTLE_SCL3711	0x5591		/* SCM Micro SCL3711-NFC */
+#define	USB_PRODUCT_SHUTTLE_SCL3712	0x5594		/* SCM Micro SCL3712-NFC */
 
 /* Siemens products */
 #define	USB_PRODUCT_SIEMENS_SPEEDSTREAM	0x1001		/* SpeedStream USB */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.728.2.1 src/sys/dev/usb/usbdevs_data.h:1.728.2.2
--- src/sys/dev/usb/usbdevs_data.h:1.728.2.1	Wed Oct 31 09:32:21 2018
+++ src/sys/dev/usb/usbdevs_data.h	Mon Nov 12 16:02:17 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.728.2.1 2018/10/31 09:32:21 martin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.728.2.2 2018/11/12 16:02:17 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.736.2.1 2018/10/31 09:30:10 martin Exp
+ *	NetBSD: usbdevs,v 1.736.2.2 2018/11/12 16:01:35 martin Exp
  */
 
 /*
@@ -3472,88 +3472,90 @@ static const uint16_t usb_products[] = {
 	4969, 0,
 	USB_VENDOR_PHILIPSSEMI, USB_PRODUCT_PHILIPSSEMI_HUB1122, 
 	6882, 0,
+	USB_VENDOR_PHILIPSSEMI, USB_PRODUCT_PHILIPSSEMI_PN533, 
+	15490, 15494, 0,
 	USB_VENDOR_PIENGINEERING, USB_PRODUCT_PIENGINEERING_PS2USB, 
 	8034, 5556, 9582, 4743, 4757, 0,
 	USB_VENDOR_PIENGINEERING, USB_PRODUCT_PIENGINEERING_XKEYS58, 
-	15490, 15496, 5759, 15509, 15513, 0,
+	15500, 15506, 5759, 15519, 15523, 0,
 	USB_VENDOR_PIENGINEERING, USB_PRODUCT_PIENGINEERING_XKEYS, 
-	15490, 15496, 5759, 0,
+	15500, 15506, 5759, 0,
 	USB_VENDOR_PILOTECH, USB_PRODUCT_PILOTECH_CRW600, 
-	15519, 14389, 10260, 0,
+	15529, 14389, 10260, 0,
 	USB_VENDOR_PINNACLE, USB_PRODUCT_PINNACLE_PCTV800E, 
-	15527, 15532, 0,
+	15537, 15542, 0,
 	USB_VENDOR_PINNACLE, USB_PRODUCT_PINNACLE_PCTVDVBTFLASH, 
-	4461, 15527, 6687, 11242, 0,
+	4461, 15537, 6687, 11242, 0,
 	USB_VENDOR_PINNACLE, USB_PRODUCT_PINNACLE_PCTV72E, 
-	4461, 15527, 15537, 0,
+	4461, 15537, 15547, 0,
 	USB_VENDOR_PINNACLE, USB_PRODUCT_PINNACLE_PCTV73E, 
-	4461, 15527, 15541, 0,
+	4461, 15537, 15551, 0,
 	USB_VENDOR_PLANEX, USB_PRODUCT_PLANEX_GW_US11H, 
-	15545, 5183, 0,
+	1, 5183, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_RTL8188CUS, 
 	7246, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GW_US11S, 
-	15554, 5183, 0,
+	15564, 5183, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_RTL8188CU_3, 
 	5110, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSFANG300, 
-	15563, 0,
+	15573, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54GXS, 
-	15576, 0,
+	15586, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GW_US300, 
-	15587, 0,
+	15597, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54HP, 
-	15596, 0,
-	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS300MINIS, 
 	15606, 0,
+	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS300MINIS, 
+	15616, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_RT3070, 
 	4976, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSNANO, 
-	15620, 0,
-	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMICRO300, 
 	15630, 0,
+	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMICRO300, 
+	15640, 0,
 	USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_RTL8188CU_1, 
-	15644, 0,
+	15654, 0,
 	USB_VENDOR_PLANEX2, 

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

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 16:01:35 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: usb_quirks.c usb_quirks.h usbdevs
usbdi_util.c usbdi_util.h

Log Message:
Pull up following revision(s) (requested by manu in ticket #1091):

sys/dev/usb/usb_quirks.c: revision 1.88,1.89 (via patch)
sys/dev/usb/usbdi_util.c: revision 1.72 (via patch)
sys/dev/usb/usb_quirks.h: revision 1.28 (via patch)
sys/dev/usb/usbdi_util.h: revision 1.48
sys/dev/usb/usbdevs: revision 1.760,1.761 (via patch)

Add PN533 based NFC devices

 -

Workaround PN533 USB descriptor corruption

During normal operation, the PN533 chip may corrupt its USB configuration,
interface and endpoint descriptors. The device descriptor remains unaffected.

Since the descriptors are documented to be immutable, we can work around
the problem by providing hard-coded descriptors instead of pulling them
from the device.

Userland implementation such as NFC tools' libnfc use the same approach,
but this kernel quirk is still necessary so that the device can be
attached on reboot, after its USB descriptors got corrupted.

 -

Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.8.1 src/sys/dev/usb/usb_quirks.c
cvs rdiff -u -r1.27 -r1.27.10.1 src/sys/dev/usb/usb_quirks.h
cvs rdiff -u -r1.736.2.1 -r1.736.2.2 src/sys/dev/usb/usbdevs
cvs rdiff -u -r1.66.2.1 -r1.66.2.2 src/sys/dev/usb/usbdi_util.c
cvs rdiff -u -r1.47 -r1.47.10.1 src/sys/dev/usb/usbdi_util.h

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

Modified files:

Index: src/sys/dev/usb/usb_quirks.c
diff -u src/sys/dev/usb/usb_quirks.c:1.86 src/sys/dev/usb/usb_quirks.c:1.86.8.1
--- src/sys/dev/usb/usb_quirks.c:1.86	Sun Dec  4 10:12:35 2016
+++ src/sys/dev/usb/usb_quirks.c	Mon Nov 12 16:01:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_quirks.c,v 1.86 2016/12/04 10:12:35 skrll Exp $	*/
+/*	$NetBSD: usb_quirks.c,v 1.86.8.1 2018/11/12 16:01:35 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.30 2003/01/02 04:15:55 imp Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.86 2016/12/04 10:12:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.86.8.1 2018/11/12 16:01:35 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -43,13 +43,137 @@ __KERNEL_RCSID(0, "$NetBSD: usb_quirks.c
 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #ifdef USB_DEBUG
 extern int usbdebug;
 #endif
 
+#define DPRINTF(FMT,A,B,C,D)USBHIST_LOG(usbdebug,FMT,A,B,C,D)
+
 #define ANY 0x
+#define _USETW(w) { (w) & 0x00ff, ((w) & 0xff00) >> 8 }
+
+/*
+ * NXP PN533 NFC chip descriptors
+ */
+static const usb_endpoint_descriptor_t desc_ep_pn533_in = {
+	/* bLength */		sizeof(desc_ep_pn533_in),
+	/* bDescriptorType */	UDESC_ENDPOINT,
+	/* bEndpointAddress */	UE_DIR_IN | 0x04,
+	/* bmAttributes */	UE_BULK,
+	/* wMaxPacketSize */	_USETW(0x0040),
+	/* bInterval */		0x04, /* 255ms */
+};
+
+static const usb_endpoint_descriptor_t desc_ep_pn533_out = {
+	/* bLength */		sizeof(desc_ep_pn533_in),
+	/* bDescriptorType */	UDESC_ENDPOINT,
+	/* bEndpointAddress */	UE_DIR_OUT | 0x04,
+	/* bmAttributes */	UE_BULK,
+	/* wMaxPacketSize */	_USETW(0x0040),
+	/* bInterval */		0x04, /* 255ms */
+};
+
+static const usb_interface_descriptor_t desc_iface_pn533 = {
+	/* bLength */		sizeof(desc_iface_pn533),
+	/* bDescriptorType */	 UDESC_INTERFACE,
+	/* bInterfaceNumber */	 0,
+	/* bAlternateSetting */	 0,
+	/* bNumEndpoints */	 2,
+	/* bInterfaceClass */	 0xff,
+	/* bInterfaceSubClass */ 0xff,
+	/* bInterfaceProtocol */ 0xff,
+	/* iInterface */	 0,
+};
+
+static const usb_config_descriptor_t desc_conf_pn533 = {
+	/* bLength */		 sizeof(desc_conf_pn533),
+	/* bDescriptorType */	 UDESC_CONFIG,
+	/* wTotalLength	 */	 _USETW(sizeof(desc_conf_pn533) +
+	sizeof(desc_iface_pn533) +
+	sizeof(desc_ep_pn533_in) +
+	sizeof(desc_ep_pn533_out)
+ ),
+	/* bNumInterfac	*/	 1,
+	/* bConfigurationValue */1,
+	/* iConfiguration */	 0,
+	/* bmAttributes	*/	 UC_ATTR_MBO,
+	/* bMaxPower */		 0x32, /* 100mA */
+};
+
+static const usb_descriptor_t *desc_pn533[] = {
+	(const usb_descriptor_t *)_conf_pn533,
+	(const usb_descriptor_t *)_iface_pn533,
+	(const usb_descriptor_t *)_ep_pn533_out,
+	(const usb_descriptor_t *)_ep_pn533_in,
+	NULL
+};
+
+
+usbd_status
+usbd_get_desc_fake(struct usbd_device *dev, int type, int index,
+		   int len, void *desc)
+{
+	USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
+#ifdef USB_DEBUG
+	const usb_device_descriptor_t *dd = usbd_get_device_descriptor(dev);
+#endif
+	const usb_descriptor_t *ub;
+	int i = 0;
+	int j = 0;
+	usbd_status err = USBD_INVAL;
+
+	if (dev->ud_quirks == NULL || dev->ud_quirks->desc == NULL) {
+		DPRINTF("%04x/%04x: no fake descriptors",
+		UGETW(dd->idVendor), UGETW(dd->idProduct), 0, 0);
+		goto out;
+	}
+
+	for (j = 0; 

CVS commit: [netbsd-8] src/doc

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 12:24:42 UTC 2018

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

Log Message:
Tickets #1090 and #1092


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.53 src/doc/CHANGES-8.1:1.1.2.54
--- src/doc/CHANGES-8.1:1.1.2.53	Mon Nov 12 09:44:17 2018
+++ src/doc/CHANGES-8.1	Mon Nov 12 12:24:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.53 2018/11/12 09:44:17 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.54 2018/11/12 12:24:42 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1668,3 +1668,14 @@ sys/kern/uipc_syscalls.c			1.198,1.199
 	Fix sendmmsg() and recvmmsg() and re-enable them for NSD.
 	[hannken, ticket #1089]
 
+sys/dev/usb/ugen.c1.141
+
+	Enfore USB timeout on ugen(4) write operations.
+	[manu, ticket #1090]
+
+sys/kern/uipc_usrreq.c1.187
+sys/netipsec/keysock.c1.66
+
+	Don't call soroverflow when we return the error to the sender.
+	[roy, ticket #1092]
+



CVS commit: [netbsd-8] src/sys

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 12:23:20 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: uipc_usrreq.c
src/sys/netipsec [netbsd-8]: keysock.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #1092):

sys/netipsec/keysock.c: revision 1.66
sys/kern/uipc_usrreq.c: revision 1.187

Don't call soroverflow when we return the error to the sender.

Thanks to thorpej@ for a sanity check.


To generate a diff of this commit:
cvs rdiff -u -r1.181.8.2 -r1.181.8.3 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.58.2.2 -r1.58.2.3 src/sys/netipsec/keysock.c

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

Modified files:

Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.181.8.2 src/sys/kern/uipc_usrreq.c:1.181.8.3
--- src/sys/kern/uipc_usrreq.c:1.181.8.2	Sat May 12 10:42:22 2018
+++ src/sys/kern/uipc_usrreq.c	Mon Nov 12 12:23:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.181.8.2 2018/05/12 10:42:22 martin Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.181.8.3 2018/11/12 12:23:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.181.8.2 2018/05/12 10:42:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.181.8.3 2018/11/12 12:23:20 martin Exp $");
 
 #include 
 #include 
@@ -332,11 +332,13 @@ unp_output(struct mbuf *m, struct mbuf *
 		unp_dispose(control);
 		m_freem(control);
 		m_freem(m);
-		soroverflow(so2);
-		return (ENOBUFS);
+		/* Don't call soroverflow because we're returning this
+		 * error directly to the sender. */
+		so2->so_rcv.sb_overflowed++;
+		return ENOBUFS;
 	} else {
 		sorwakeup(so2);
-		return (0);
+		return 0;
 	}
 }
 

Index: src/sys/netipsec/keysock.c
diff -u src/sys/netipsec/keysock.c:1.58.2.2 src/sys/netipsec/keysock.c:1.58.2.3
--- src/sys/netipsec/keysock.c:1.58.2.2	Mon Apr  9 13:34:10 2018
+++ src/sys/netipsec/keysock.c	Mon Nov 12 12:23:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: keysock.c,v 1.58.2.2 2018/04/09 13:34:10 bouyer Exp $	*/
+/*	$NetBSD: keysock.c,v 1.58.2.3 2018/11/12 12:23:20 martin Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.58.2.2 2018/04/09 13:34:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.58.2.3 2018/11/12 12:23:20 martin Exp $");
 
 /* This code has derived from sys/net/rtsock.c on FreeBSD2.2.5 */
 
@@ -207,7 +207,9 @@ key_sendup0(
 		__func__);
 		PFKEY_STATINC(PFKEY_STAT_IN_NOMEM);
 		m_freem(m);
-		soroverflow(rp->rcb_socket);
+		/* Don't call soroverflow because we're returning this
+		 * error directly to the sender. */
+		rp->rcb_socket->so_rcv.sb_overflowed++;
 		error = ENOBUFS;
 	} else {
 		sorwakeup(rp->rcb_socket);



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

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 12:17:07 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: ugen.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1090):

sys/dev/usb/ugen.c: revision 1.141

Enfore USB timeout on ugen(4) write operations


To generate a diff of this commit:
cvs rdiff -u -r1.134.10.1 -r1.134.10.2 src/sys/dev/usb/ugen.c

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

Modified files:

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.134.10.1 src/sys/dev/usb/ugen.c:1.134.10.2
--- src/sys/dev/usb/ugen.c:1.134.10.1	Wed Jan 31 18:01:55 2018
+++ src/sys/dev/usb/ugen.c	Mon Nov 12 12:17:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.134.10.1 2018/01/31 18:01:55 martin Exp $	*/
+/*	$NetBSD: ugen.c,v 1.134.10.2 2018/11/12 12:17:06 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.134.10.1 2018/01/31 18:01:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.134.10.2 2018/11/12 12:17:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1428,6 +1428,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int
 	uint8_t conf, alt;
 	int cdesclen;
 	int error;
+	int dir;
 
 	DPRINTFN(5, ("ugenioctl: cmd=%08lx\n", cmd));
 	if (sc->sc_dying)
@@ -1450,14 +1451,13 @@ ugen_do_ioctl(struct ugen_softc *sc, int
 			sce->state &= ~UGEN_SHORT_OK;
 		return 0;
 	case USB_SET_TIMEOUT:
-		sce = >sc_endpoints[endpt][IN];
-		if (sce == NULL
-		/* XXX this shouldn't happen, but the distinction between
-		   input and output pipes isn't clear enough.
-		   || sce->pipeh == NULL */
-			)
-			return EINVAL;
-		sce->timeout = *(int *)addr;
+		for (dir = OUT; dir <= IN; dir++) {
+			sce = >sc_endpoints[endpt][dir];
+			if (sce == NULL)
+return EINVAL;
+
+			sce->timeout = *(int *)addr;
+		}
 		return 0;
 	case USB_SET_BULK_RA:
 		if (endpt == USB_CONTROL_ENDPOINT)



CVS commit: [netbsd-8] src/doc

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 09:44:17 UTC 2018

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

Log Message:
Ticket #1089


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.52 src/doc/CHANGES-8.1:1.1.2.53
--- src/doc/CHANGES-8.1:1.1.2.52	Mon Nov 12 08:57:23 2018
+++ src/doc/CHANGES-8.1	Mon Nov 12 09:44:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.52 2018/11/12 08:57:23 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.53 2018/11/12 09:44:17 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1661,3 +1661,10 @@ sys/kern/kern_proc.c1.219 (patch)
 	Fix buffer overflow, which can lead to severe information leak.
 	[maxv, ticket #1088]
 
+external/bsd/nsd/include/config.h		1.5
+sys/kern/uipc_socket.c1.267
+sys/kern/uipc_syscalls.c			1.198,1.199
+
+	Fix sendmmsg() and recvmmsg() and re-enable them for NSD.
+	[hannken, ticket #1089]
+



CVS commit: [netbsd-8] src

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 09:43:19 UTC 2018

Modified Files:
src/external/bsd/nsd/include [netbsd-8]: config.h
src/sys/kern [netbsd-8]: uipc_socket.c uipc_syscalls.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1089):

external/bsd/nsd/include/config.h: revision 1.5
sys/kern/uipc_syscalls.c: revision 1.198
sys/kern/uipc_syscalls.c: revision 1.199
sys/kern/uipc_socket.c: revision 1.267

Update getsockopt(SO_ERROR) to behave like soreceive() and
return and clear so->so_rerror if so->so_error is zero.

Ok: christos@

 -

Don't defer errors from sendmmsg().  This matches the linux manpage.

Defer errors from recvmmsg() through so_rerror and
tests and return a deferred error on entry.

Ok: christos@

 -

sys_recvmmsg: don't defer an error that already gets returned.

 -

Re-enable {send,recv}mmsg now they are working.


To generate a diff of this commit:
cvs rdiff -u -r1.1.8.2 -r1.1.8.3 src/external/bsd/nsd/include/config.h
cvs rdiff -u -r1.255.2.3 -r1.255.2.4 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.186.6.1 -r1.186.6.2 src/sys/kern/uipc_syscalls.c

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

Modified files:

Index: src/external/bsd/nsd/include/config.h
diff -u src/external/bsd/nsd/include/config.h:1.1.8.2 src/external/bsd/nsd/include/config.h:1.1.8.3
--- src/external/bsd/nsd/include/config.h:1.1.8.2	Sat Nov  3 17:15:58 2018
+++ src/external/bsd/nsd/include/config.h	Mon Nov 12 09:43:19 2018
@@ -233,13 +233,11 @@
 /* Define to 1 if you have the `reallocarray' function. */
 #define HAVE_REALLOCARRAY 1
 
-#ifdef notyet
 /* Define if recvmmsg is implemented */
 #define HAVE_RECVMMSG 1
 
 /* Define if sendmmsg is implemented */
 #define HAVE_SENDMMSG 1
-#endif
 
 /* Define to 1 if you have the `setregid' function. */
 #define HAVE_SETREGID 1

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.255.2.3 src/sys/kern/uipc_socket.c:1.255.2.4
--- src/sys/kern/uipc_socket.c:1.255.2.3	Sat Jun  9 15:16:30 2018
+++ src/sys/kern/uipc_socket.c	Mon Nov 12 09:43:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.255.2.3 2018/06/09 15:16:30 martin Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.255.2.4 2018/11/12 09:43:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.255.2.3 2018/06/09 15:16:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.255.2.4 2018/11/12 09:43:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1970,6 +1970,10 @@ sogetopt1(struct socket *so, struct sock
 		break;
 
 	case SO_ERROR:
+		if (so->so_error == 0) {
+			so->so_error = so->so_rerror;
+			so->so_rerror = 0;
+		}
 		error = sockopt_setint(sopt, so->so_error);
 		so->so_error = 0;
 		break;

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.186.6.1 src/sys/kern/uipc_syscalls.c:1.186.6.2
--- src/sys/kern/uipc_syscalls.c:1.186.6.1	Sun Mar 18 10:57:01 2018
+++ src/sys/kern/uipc_syscalls.c	Mon Nov 12 09:43:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.186.6.1 2018/03/18 10:57:01 martin Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.186.6.2 2018/11/12 09:43:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.186.6.1 2018/03/18 10:57:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.186.6.2 2018/11/12 09:43:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pipe.h"
@@ -809,14 +809,11 @@ sys_sendmmsg(struct lwp *l, const struct
 	}
 
 	*retval = dg;
-	if (error)
-		so->so_error = error;
 
 	fd_putfile(s);
 
 	/*
-	 * If we succeeded at least once, return 0, hopefully so->so_error
-	 * will catch it next time.
+	 * If we succeeded at least once, return 0.
 	 */
 	if (dg)
 		return 0;
@@ -1062,6 +1059,16 @@ sys_recvmmsg(struct lwp *l, const struct
 	if ((error = fd_getsock(s, )) != 0)
 		return error;
 
+	/*
+	 * If so->so_rerror holds a deferred error return it now.
+	 */
+	if (so->so_rerror) {
+		error = so->so_rerror;
+		so->so_rerror = 0;
+		fd_putfile(s);
+		return error;
+	}
+
 	vlen = SCARG(uap, vlen);
 	if (vlen > 1024)
 		vlen = 1024;
@@ -1126,17 +1133,17 @@ sys_recvmmsg(struct lwp *l, const struct
 		m_free(from);
 
 	*retval = dg;
-	if (error)
-		so->so_error = error;
-
-	fd_putfile(s);
 
 	/*
-	 * If we succeeded at least once, return 0, hopefully so->so_error
+	 * If we succeeded at least once, return 0, hopefully so->so_rerror
 	 * will catch it next time.
 	 */
-	if (dg)
-		return 0;
+	if (error && dg > 0) {
+		so->so_rerror = error;
+		error = 0;
+	}
+
+	fd_putfile(s);
 
 	return error;
 }



CVS commit: [netbsd-8] src/doc

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 08:57:23 UTC 2018

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

Log Message:
Tickets #1086 - #1088


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.51 -r1.1.2.52 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.51 src/doc/CHANGES-8.1:1.1.2.52
--- src/doc/CHANGES-8.1:1.1.2.51	Thu Nov  8 12:11:27 2018
+++ src/doc/CHANGES-8.1	Mon Nov 12 08:57:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.51 2018/11/08 12:11:27 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.52 2018/11/12 08:57:23 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1646,3 +1646,18 @@ sys/dev/pci/if_wm.c			1.590-1.596 via pa
 	- KNF & Use macro.
 	[msaitoh, ticket #1085]
 
+bin/sh/parser.c	1.152
+
+	Avoid crash from redirect on null compound command.
+	[kre, ticket #1086]
+
+sys/net/if_gif.c1.145
+
+	Fix ALTQ on gif(4).
+	[knakahara, ticket #1087]
+
+sys/kern/kern_proc.c1.219 (patch)
+
+	Fix buffer overflow, which can lead to severe information leak.
+	[maxv, ticket #1088]
+



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

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 08:56:15 UTC 2018

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

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

sys/kern/kern_proc.c: revision 1.219 (via patch)

Fix buffer overflow, which can lead to severe information leak. Detected
by kASan.


To generate a diff of this commit:
cvs rdiff -u -r1.206.6.4 -r1.206.6.5 src/sys/kern/kern_proc.c

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

Modified files:

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.206.6.4 src/sys/kern/kern_proc.c:1.206.6.5
--- src/sys/kern/kern_proc.c:1.206.6.4	Mon Apr 16 13:31:33 2018
+++ src/sys/kern/kern_proc.c	Mon Nov 12 08:56:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.206.6.5 2018/11/12 08:56:15 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.5 2018/11/12 08:56:15 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -2461,7 +2461,8 @@ fill_pathname(struct lwp *l, pid_t pid, 
 
 	len = strlen(path) + 1;
 	if (oldp != NULL) {
-		error = sysctl_copyout(l, path, oldp, *oldlenp);
+		size_t copylen = min(len, *oldlenp);
+		error = sysctl_copyout(l, path, oldp, copylen);
 		if (error == 0 && *oldlenp < len)
 			error = ENOSPC;
 	}



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

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 08:50:18 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if_gif.c

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

sys/net/if_gif.c: revision 1.145

Fix ALTQ on gif(4). Reported and tested by Anthony Mallet, advised by Greg 
Troxel, thanks.

l2tp(4) and ipsecif(4) don't support ALTQ yet. So, they don't require this fix.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.12 -r1.126.2.13 src/sys/net/if_gif.c

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

Modified files:

Index: src/sys/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.126.2.12 src/sys/net/if_gif.c:1.126.2.13
--- src/sys/net/if_gif.c:1.126.2.12	Sun Oct 21 11:55:54 2018
+++ src/sys/net/if_gif.c	Mon Nov 12 08:50:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.126.2.12 2018/10/21 11:55:54 martin Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.126.2.13 2018/11/12 08:50:18 martin Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.12 2018/10/21 11:55:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126.2.13 2018/11/12 08:50:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -489,7 +489,8 @@ gif_output(struct ifnet *ifp, struct mbu
 	m->m_pkthdr.csum_flags = 0;
 	m->m_pkthdr.csum_data = 0;
 
-	error = gif_transmit_direct(var, m);
+	error = if_transmit_lock(ifp, m);
+
 end:
 	if (var != NULL)
 		gif_putref_variant(var, );



CVS commit: [netbsd-8] src/bin/sh

2018-11-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 12 08:46:54 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: parser.c

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

bin/sh/parser.c: revision 1.152

PR bin/53712

Avoid crash from redirect on null compound command.


To generate a diff of this commit:
cvs rdiff -u -r1.132.2.6 -r1.132.2.7 src/bin/sh/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/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.132.2.6 src/bin/sh/parser.c:1.132.2.7
--- src/bin/sh/parser.c:1.132.2.6	Mon Sep 10 15:45:11 2018
+++ src/bin/sh/parser.c	Mon Nov 12 08:46:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parser.c,v 1.132.2.6 2018/09/10 15:45:11 martin Exp $	*/
+/*	$NetBSD: parser.c,v 1.132.2.7 2018/11/12 08:46:54 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c	8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.132.2.6 2018/09/10 15:45:11 martin Exp $");
+__RCSID("$NetBSD: parser.c,v 1.132.2.7 2018/11/12 08:46:54 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -597,7 +597,7 @@ command(void)
 	tokpushback++;
 	*rpp = NULL;
 	if (redir) {
-		if (n1->type != NSUBSHELL) {
+		if (n1 == NULL || n1->type != NSUBSHELL) {
 			n2 = stalloc(sizeof(struct nredir));
 			n2->type = NREDIR;
 			n2->nredir.n = n1;



CVS commit: [netbsd-8] src/doc

2018-11-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov  8 12:11:28 UTC 2018

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

Log Message:
Ticket #1084 and #1085


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.50 src/doc/CHANGES-8.1:1.1.2.51
--- src/doc/CHANGES-8.1:1.1.2.50	Wed Nov  7 09:13:44 2018
+++ src/doc/CHANGES-8.1	Thu Nov  8 12:11:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.50 2018/11/07 09:13:44 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.51 2018/11/08 12:11:27 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1618,3 +1618,31 @@ external/gpl2/groff/dist/configure		1.2
 	the cross-compile from FreeBSD.
 	[sevan, ticket #1083]
 
+sys/dev/pci/ixgbe/ixgbe.c			1.167
+sys/dev/pci/ixgbe/ixv.c1.107
+
+	Don't set LRO capability flag because we don't support it yet.
+	[msaitoh, ticket #1084]
+
+sys/dev/mii/inbmphyreg.h		1.11
+sys/dev/pci/if_wmreg.h			1.108
+sys/dev/pci/if_wm.c			1.590-1.596 via patch
+
+	- 82574 and newer document says the status field has neither EC
+	  (Excessive Collision) bit nor LC (Late Collision) bit (reserved), so
+	  don't check the bit.
+	- Add workaround for DMA hang problem which result in TX device timeout
+	  on PCH_LPT with I218. Same as FreeBSD and Linux. This workaround is
+	  only for device ID 0x155a, 0x15a2, 0x1559 and 0x15a3.
+	- Fix a PCH2 specific bug that wrong PHY register value can be read
+	  when boot. Same as FreeBSD and Linux.
+	- After writing MDIC register, don't read quickly the same register but
+	  do delay(50). Same as other OSes.
+	- Add missing wm_gate_hw_phy_config_ich8lan(false) in
+	  wm_phy_post_reset() on PCH2. wm_gate_hw_phy_config_ich8lan(true) is
+	  called in wm_reset(), so wm_gate_hw_phy_config_ich8lan(false) should
+	  be called after reset in wm_phy_post_reset().
+	- On PCH2, set the phy config counter to 50msec after (PHY) reset.
+	- KNF & Use macro.
+	[msaitoh, ticket #1085]
+



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

2018-11-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov  8 12:09:18 UTC 2018

Modified Files:
src/sys/dev/mii [netbsd-8]: inbmphyreg.h
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following, requested by msaitoh in tickt #1085:

sys/dev/mii/inbmphyreg.h1.11
sys/dev/pci/if_wmreg.h  1.108
sys/dev/pci/if_wm.c 1.590-1.596 via patch

- 82574 and newer document says the status field has neither EC
  (Excessive Collision) bit nor LC (Late Collision) bit (reserved), so
  don't check the bit.
- Add workaround for DMA hang problem which result in TX device timeout
  on PCH_LPT with I218. Same as FreeBSD and Linux. This workaround is
  only for device ID 0x155a, 0x15a2, 0x1559 and 0x15a3.
- Fix a PCH2 specific bug that wrong PHY register value can be read
  when boot. Same as FreeBSD and Linux.
- After writing MDIC register, don't read quickly the same register but
  do delay(50). Same as other OSes.
- Add missing wm_gate_hw_phy_config_ich8lan(false) in
  wm_phy_post_reset() on PCH2. wm_gate_hw_phy_config_ich8lan(true) is
  called in wm_reset(), so wm_gate_hw_phy_config_ich8lan(false) should
  be called after reset in wm_phy_post_reset().
- On PCH2, set the phy config counter to 50msec after (PHY) reset.
- KNF & Use macro.


To generate a diff of this commit:
cvs rdiff -u -r1.9.8.1 -r1.9.8.2 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.508.4.24 -r1.508.4.25 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.4 -r1.98.6.5 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.9.8.1 src/sys/dev/mii/inbmphyreg.h:1.9.8.2
--- src/sys/dev/mii/inbmphyreg.h:1.9.8.1	Tue Aug  1 23:33:18 2017
+++ src/sys/dev/mii/inbmphyreg.h	Thu Nov  8 12:09:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.9.8.1 2017/08/01 23:33:18 snj Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.9.8.2 2018/11/08 12:09:18 martin Exp $	*/
 /***
 Copyright (c) 2001-2005, Intel Corporation 
 All rights reserved.
@@ -104,6 +104,10 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	HV_PM_CTRL		BME1000_REG(770, 17)
 #define	HV_PM_CTRL_K1_ENA	__BIT(14)
 
+#define	I217_INBAND_CTRL	BME1000_REG(770, 18)
+#define	I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_MASK	0x3f00
+#define	I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT	8
+
 #define	IGP3_KMRN_DIAG		BME1000_REG(770, 19)
 #define	IGP3_KMRN_DIAG_PCS_LOCK_LOSS	(1 << 1)
 

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.24 src/sys/dev/pci/if_wm.c:1.508.4.25
--- src/sys/dev/pci/if_wm.c:1.508.4.24	Tue Oct 30 09:25:13 2018
+++ src/sys/dev/pci/if_wm.c	Thu Nov  8 12:09:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.24 2018/10/30 09:25:13 sborrill Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.25 2018/11/08 12:09:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.24 2018/10/30 09:25:13 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.25 2018/11/08 12:09:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -966,6 +966,7 @@ static void	wm_kmrn_lock_loss_workaround
 static void	wm_gig_downshift_workaround_ich8lan(struct wm_softc *);
 static void	wm_hv_phy_workaround_ich8lan(struct wm_softc *);
 static void	wm_lv_phy_workaround_ich8lan(struct wm_softc *);
+static int	wm_k1_workaround_lpt_lp(struct wm_softc *, bool);
 static int	wm_k1_gig_workaround_hv(struct wm_softc *, int);
 static void	wm_set_mdio_slow_mode_hv(struct wm_softc *);
 static void	wm_configure_k1_ich8lan(struct wm_softc *, int);
@@ -1869,10 +1870,9 @@ wm_attach(device_t parent, device_t self
 	0, >sc_iot, >sc_ioh,
 	NULL, >sc_ios) == 0) {
 sc->sc_flags |= WM_F_IOH_VALID;
-			} else {
+			} else
 aprint_error_dev(sc->sc_dev,
 "WARNING: unable to map I/O space\n");
-			}
 		}
 
 	}
@@ -3258,9 +3258,9 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 
 		error = 0;
 
-		if (cmd == SIOCSIFCAP) {
+		if (cmd == SIOCSIFCAP)
 			error = (*ifp->if_init)(ifp);
-		} else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
+		else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
 			;
 		else if (ifp->if_flags & IFF_RUNNING) {
 			/*
@@ -3858,7 +3858,7 @@ wm_phy_post_reset(struct wm_softc *sc)
 	/* Perform any necessary post-reset workarounds */
 	if (sc->sc_type == WM_T_PCH)
 		wm_hv_phy_workaround_ich8lan(sc);
-	if (sc->sc_type == WM_T_PCH2)
+	else if (sc->sc_type == WM_T_PCH2)
 		wm_lv_phy_workaround_ich8lan(sc);
 
 	/* Clear the host wakeup bit after lcd reset */
@@ -3873,7 +3873,16 @@ wm_phy_post_reset(struct wm_softc *sc)
 	/* Configure the LCD with the extended configuration region in NVM */
 	wm_init_lcd_from_nvm(sc);
 
-	/* 

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

2018-11-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov  8 12:04:49 UTC 2018

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

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

sys/dev/pci/ixgbe/ixv.c: revision 1.107
sys/dev/pci/ixgbe/ixgbe.c: revision 1.167

  Don't set LRO capability flag because we don't support it yet.

This doesn't change any behavior other than if_capabilities' visibility
(e.g. ifconfig).


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.24 -r1.88.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.17 -r1.56.2.18 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.24 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.25
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.24	Sun Sep 23 17:43:36 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Nov  8 12:04:48 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.24 2018/09/23 17:43:36 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.25 2018/11/08 12:04:48 martin Exp $ */
 
 /**
 
@@ -1312,8 +1312,7 @@ ixgbe_setup_interface(device_t dev, stru
 	ifp->if_capabilities |= IFCAP_RXCSUM
 			 |  IFCAP_TXCSUM
 			 |  IFCAP_TSOv4
-			 |  IFCAP_TSOv6
-			 |  IFCAP_LRO;
+			 |  IFCAP_TSOv6;
 	ifp->if_capenable = 0;
 
 	ec->ec_capabilities |= ETHERCAP_VLAN_HWTAGGING

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.56.2.17 src/sys/dev/pci/ixgbe/ixv.c:1.56.2.18
--- src/sys/dev/pci/ixgbe/ixv.c:1.56.2.17	Sat Jun  9 14:59:43 2018
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Nov  8 12:04:48 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.56.2.17 2018/06/09 14:59:43 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.56.2.18 2018/11/08 12:04:48 martin Exp $*/
 
 /**
 
@@ -1554,9 +1554,9 @@ ixv_setup_interface(device_t dev, struct
 	ec->ec_capenable = ec->ec_capabilities;
 
 	/* Don't enable LRO by default */
-	ifp->if_capabilities |= IFCAP_LRO;
 #if 0
-	ifp->if_capenable = ifp->if_capabilities;
+	/* NetBSD doesn't support LRO yet */
+	ifp->if_capabilities |= IFCAP_LRO;
 #endif
 
 	/*



CVS commit: [netbsd-8] src/doc

2018-11-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  7 09:13:44 UTC 2018

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

Log Message:
Ticket #1083


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.49 -r1.1.2.50 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.49 src/doc/CHANGES-8.1:1.1.2.50
--- src/doc/CHANGES-8.1:1.1.2.49	Tue Nov  6 14:48:37 2018
+++ src/doc/CHANGES-8.1	Wed Nov  7 09:13:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.49 2018/11/06 14:48:37 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.50 2018/11/07 09:13:44 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1612,3 +1612,9 @@ sys/fs/puffs/puffs_vnops.c			1.213
 	Fix use after RECLAIM in PUFFS filesystems.
 	[manu, ticket #1082]
 
+external/gpl2/groff/dist/configure		1.2
+
+	Test for other variants to declare exit(3) to fix
+	the cross-compile from FreeBSD.
+	[sevan, ticket #1083]
+



CVS commit: [netbsd-8] src/external/gpl2/groff/dist

2018-11-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  7 09:12:28 UTC 2018

Modified Files:
src/external/gpl2/groff/dist [netbsd-8]: configure

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1083):

external/gpl2/groff/dist/configure: revision 1.2

Test for other exit cases.

It might be worth regenerating configure with modern autoconf.
Reviewed by 

Closes PR toolchain/53314


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.8.1 src/external/gpl2/groff/dist/configure

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

Modified files:

Index: src/external/gpl2/groff/dist/configure
diff -u src/external/gpl2/groff/dist/configure:1.1.1.1 src/external/gpl2/groff/dist/configure:1.1.1.1.8.1
--- src/external/gpl2/groff/dist/configure:1.1.1.1	Wed Jan 13 18:41:45 2016
+++ src/external/gpl2/groff/dist/configure	Wed Nov  7 09:12:28 2018
@@ -2511,6 +2511,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'extern "C" void exit (int);' \
+   'extern "C" [[noreturn]] void exit (int);' \
+   'extern "C" _Noreturn void exit (int);' \
'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
@@ -2977,6 +2979,8 @@ for ac_declaration in \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'extern "C" void exit (int);' \
+   'extern "C" [[noreturn]] void exit (int);' \
+   'extern "C" _Noreturn void exit (int);' \
'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF



CVS commit: [netbsd-8] src/doc

2018-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  6 14:48:37 UTC 2018

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

Log Message:
Tickets #1080 - #1082


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.48 src/doc/CHANGES-8.1:1.1.2.49
--- src/doc/CHANGES-8.1:1.1.2.48	Sun Nov  4 11:15:10 2018
+++ src/doc/CHANGES-8.1	Tue Nov  6 14:48:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.48 2018/11/04 11:15:10 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.49 2018/11/06 14:48:37 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1589,4 +1589,26 @@ sys/netinet6/udp6_usrreq.c			1.142
 	Fix error path in ip6 source address selection.
 	[mlelstv, ticket #1079]
 
+sys/net/if.c	1.438,1.439
+sys/net/if.c	1.440
+sys/net/route.c	1.214-1.216
+sys/net/route.h	1.120
+sys/netinet/if_arp.c1.276
+sys/netinet6/in6.c1.270
+sys/netinet6/nd6.c1.251
+
+	Avoid race conditions on ifaddr and rtentry changes.
+	[ozaki-r, ticket #1080]
+
+sys/netinet6/udp6_usrreq.c			1.143
+	(applied to udp6_output.c due to code refactoring)
+
+	Restore the length check of a sockaddr passed from userland at
+	udp6_output.
+	[ozaki-r, ticket #1081]
+
+sys/fs/puffs/puffs_vnops.c			1.213
+
+	Fix use after RECLAIM in PUFFS filesystems.
+	[manu, ticket #1082]
 



CVS commit: [netbsd-8] src/sys/fs/puffs

2018-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  6 14:47:38 UTC 2018

Modified Files:
src/sys/fs/puffs [netbsd-8]: puffs_vnops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1082):

sys/fs/puffs/puffs_vnops.c: revision 1.213

Fix use after RECLAIM in PUFFS filesystems

>From hannken@

When puffs_cookie2vnode() misses an entry and vrele() it operations
puffs_vnop_reclaim() and puffs_vnop_fsync() get called with a VNON
vnode.

Do not notify the server in this case as the cookie is stale.


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.211.2.1 src/sys/fs/puffs/puffs_vnops.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/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.211 src/sys/fs/puffs/puffs_vnops.c:1.211.2.1
--- src/sys/fs/puffs/puffs_vnops.c:1.211	Fri May 26 14:21:01 2017
+++ src/sys/fs/puffs/puffs_vnops.c	Tue Nov  6 14:47:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.211.2.1 2018/11/06 14:47:38 martin Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.211.2.1 2018/11/06 14:47:38 martin Exp $");
 
 #include 
 #include 
@@ -1467,6 +1467,10 @@ puffs_vnop_reclaim(void *v)
 		notifyserver = false;
 	}
 
+	/* See the comment on top of puffs_vnop_inactive(). */
+	if (vp->v_type == VNON)
+		notifyserver = false;
+
 	/*
 	 * purge info from kernel before issueing FAF, since we
 	 * don't really know when we'll get around to it after
@@ -1720,6 +1724,11 @@ puffs_vnop_fsync(void *v)
 	pn = VPTOPP(vp);
 	KASSERT(pn != NULL);
 	pmp = MPTOPUFFSMP(vp->v_mount);
+
+	/* See the comment on top of puffs_vnop_inactive(). */
+	if (vp->v_type == VNON)
+		return 0;
+
 	if (ap->a_flags & FSYNC_WAIT) {
 		mutex_enter(>pn_sizemtx);
 	} else {



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

2018-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  6 14:44:23 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: udp6_output.c

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

sys/netinet6/udp6_usrreq.c: revision 1.143
(applied to udp6_output.c, due to refactoring in -current)

Restore the length check of a sockaddr passed from userland at udp6_output

A sockaddr with invalid length could be passed to the network stack resulting in
a kernel panic like this:

panic: sockaddr_copy: source too long, 28 < 128 bytes
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip 0x80216c35 cs 0x8 rflags 0x246
cr2 0x7f7ff7ef3000 ilevel 0x4 rsp 0x80003308b690
curlwp 0xfe803e11ca40 pid 48.1 lowest kstack 0x8000330852c0
Stopped in pid 48.1 (a.out) at  netbsd:breakpoint+0x5:  leave
db{1}> bt
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0x140
panic() at netbsd:panic+0x3c
sockaddr_copy() at netbsd:sockaddr_copy+0x95
rtcache_setdst() at netbsd:rtcache_setdst+0x73
rtcache_lookup2() at netbsd:rtcache_lookup2+0x56
in6_selectroute() at netbsd:in6_selectroute+0x184
in6_selectsrc() at netbsd:in6_selectsrc+0x119
udp6_output() at netbsd:udp6_output+0x25e
udp6_send_wrapper() at netbsd:udp6_send_wrapper+0x8a
sosend() at netbsd:sosend+0x7bf
do_sys_sendmsg_so() at netbsd:do_sys_sendmsg_so+0x28e
do_sys_sendmsg() at netbsd:do_sys_sendmsg+0x89
sys_sendto() at netbsd:sys_sendto+0x5c
syscall() at netbsd:syscall+0x1ed
--- syscall (number 133) ---
7f7ff790173a:

Reported by Paul Ripke


To generate a diff of this commit:
cvs rdiff -u -r1.55.6.1 -r1.55.6.2 src/sys/netinet6/udp6_output.c

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

Modified files:

Index: src/sys/netinet6/udp6_output.c
diff -u src/sys/netinet6/udp6_output.c:1.55.6.1 src/sys/netinet6/udp6_output.c:1.55.6.2
--- src/sys/netinet6/udp6_output.c:1.55.6.1	Sun Nov  4 11:14:09 2018
+++ src/sys/netinet6/udp6_output.c	Tue Nov  6 14:44:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp6_output.c,v 1.55.6.1 2018/11/04 11:14:09 martin Exp $	*/
+/*	$NetBSD: udp6_output.c,v 1.55.6.2 2018/11/06 14:44:22 martin Exp $	*/
 /*	$KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.55.6.1 2018/11/04 11:14:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.55.6.2 2018/11/06 14:44:22 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -139,6 +139,10 @@ udp6_output(struct in6pcb * const in6p, 
 
 	if (addr6) {
 		sin6 = addr6;
+		if (sin6->sin6_len != sizeof(*sin6)) {
+			error = EINVAL;
+			goto release;
+		}
 		if (sin6->sin6_family != AF_INET6) {
 			error = EAFNOSUPPORT;
 			goto release;



CVS commit: [netbsd-8] src/sys

2018-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  6 14:38:58 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if.c route.c route.h
src/sys/netinet [netbsd-8]: if_arp.c
src/sys/netinet6 [netbsd-8]: in6.c nd6.c

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

sys/netinet6/nd6.c: revision 1.251
sys/netinet/if_arp.c: revision 1.276
sys/net/if.c: revision 1.438
sys/net/if.c: revision 1.439
sys/net/route.c: revision 1.214
sys/net/route.c: revision 1.215
sys/net/route.c: revision 1.216
sys/netinet6/in6.c: revision 1.270
sys/net/route.h: revision 1.120
sys/net/if.c: revision 1.440

Remove a wrong assertion in ifaref

 -

Doing ifref on an ifa with IFA_DESTROYING is not a problem; the reference should
be dropped during the destruction of the ifa.

 -

Use atomic operations for ifa_refcnt

 -

Avoid a dangling pointer during rt_replace_ifa

 -

Avoid double rt_replace_ifa on rtrequest1(RTM_ADD)

Some callers of rtrequest1(RTM_ADD) adjust rt_ifa of an rtentry created by
rtrequest1 that may change rt_ifa (in ifa_rtrequest) with another ifa that is
different from requested one.  It's wasteful and even worse introduces a race
condition.  rtrequest1 should just use a passed ifa as is if a caller hopes so.

 -

Use rt_update framework on updating a rtentry


To generate a diff of this commit:
cvs rdiff -u -r1.394.2.14 -r1.394.2.15 src/sys/net/if.c
cvs rdiff -u -r1.194.6.11 -r1.194.6.12 src/sys/net/route.c
cvs rdiff -u -r1.112.4.4 -r1.112.4.5 src/sys/net/route.h
cvs rdiff -u -r1.250.2.8 -r1.250.2.9 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.245.2.11 -r1.245.2.12 src/sys/netinet6/in6.c
cvs rdiff -u -r1.232.2.8 -r1.232.2.9 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.394.2.14 src/sys/net/if.c:1.394.2.15
--- src/sys/net/if.c:1.394.2.14	Mon Aug 27 07:49:11 2018
+++ src/sys/net/if.c	Tue Nov  6 14:38:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.394.2.14 2018/08/27 07:49:11 martin Exp $	*/
+/*	$NetBSD: if.c,v 1.394.2.15 2018/11/06 14:38:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.14 2018/08/27 07:49:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.15 2018/11/06 14:38:58 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1777,8 +1777,8 @@ ifa_psref_init(struct ifaddr *ifa)
 void
 ifaref(struct ifaddr *ifa)
 {
-	KASSERT(!ISSET(ifa->ifa_flags, IFA_DESTROYING));
-	ifa->ifa_refcnt++;
+
+	atomic_inc_uint(>ifa_refcnt);
 }
 
 void
@@ -1787,7 +1787,7 @@ ifafree(struct ifaddr *ifa)
 	KASSERT(ifa != NULL);
 	KASSERT(ifa->ifa_refcnt > 0);
 
-	if (--ifa->ifa_refcnt == 0) {
+	if (atomic_dec_uint_nv(>ifa_refcnt) == 0) {
 		free(ifa, M_IFADDR);
 	}
 }
@@ -2177,7 +2177,8 @@ link_rtrequest(int cmd, struct rtentry *
 	struct psref psref;
 
 	if (cmd != RTM_ADD || (ifa = rt->rt_ifa) == NULL ||
-	(ifp = ifa->ifa_ifp) == NULL || (dst = rt_getkey(rt)) == NULL)
+	(ifp = ifa->ifa_ifp) == NULL || (dst = rt_getkey(rt)) == NULL ||
+	ISSET(info->rti_flags, RTF_DONTCHANGEIFA))
 		return;
 	if ((ifa = ifaof_ifpforaddr_psref(dst, ifp, )) != NULL) {
 		rt_replace_ifa(rt, ifa);
@@ -2431,6 +2432,9 @@ p2p_rtrequest(int req, struct rtentry *r
 
 		rt->rt_ifp = lo0ifp;
 
+		if (ISSET(info->rti_flags, RTF_DONTCHANGEIFA))
+			break;
+
 		IFADDR_READER_FOREACH(ifa, ifp) {
 			if (equal(rt_getkey(rt), ifa->ifa_addr))
 break;

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.194.6.11 src/sys/net/route.c:1.194.6.12
--- src/sys/net/route.c:1.194.6.11	Fri Sep  7 12:31:30 2018
+++ src/sys/net/route.c	Tue Nov  6 14:38:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $	*/
+/*	$NetBSD: route.c,v 1.194.6.12 2018/11/06 14:38:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.12 2018/11/06 14:38:58 martin Exp $");
 
 #include 
 #ifdef RTFLUSH_DEBUG
@@ -406,6 +406,11 @@ rt_ifa_connected(const struct rtentry *r
 void
 rt_replace_ifa(struct rtentry *rt, struct ifaddr *ifa)
 {
+	struct ifaddr *old;
+
+	if (rt->rt_ifa == ifa)
+		return;
+
 	if (rt->rt_ifa &&
 	rt->rt_ifa != ifa &&
 	rt->rt_ifa->ifa_flags & IFA_ROUTE &&
@@ -424,8 +429,9 @@ rt_replace_ifa(struct rtentry *rt, struc
 	}
 
 	ifaref(ifa);
-	ifafree(rt->rt_ifa);
+	old = rt->rt_ifa;
 	rt_set_ifa1(rt, ifa);
+	ifafree(old);
 }
 
 static void
@@ -1236,7 +1242,7 @@ rtrequest1(int req, struct rt_addrinfo *
 		if (rt == NULL)
 			senderr(ENOBUFS);
 		memset(rt, 0, sizeof(*rt));
-		

CVS commit: [netbsd-8] src/doc

2018-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  4 11:15:10 UTC 2018

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

Log Message:
Tickets #1078 and #1079


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.47 src/doc/CHANGES-8.1:1.1.2.48
--- src/doc/CHANGES-8.1:1.1.2.47	Sat Nov  3 17:20:35 2018
+++ src/doc/CHANGES-8.1	Sun Nov  4 11:15:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.47 2018/11/03 17:20:35 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.48 2018/11/04 11:15:10 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1576,3 +1576,17 @@ external/bsd/nsd/include/config.h		1.4
 	errors.
 	[christos, ticket #1077]
 
+sys/dev/usb/uhub.c1.140,1.141
+sys/dev/usb/usb_subr.c1.228
+
+	Make USB port numbers display consistent.
+	[manu, ticket #1078]
+
+sys/netinet6/udp6_usrreq.c			1.142
+	(applied to udp6_output.c, due to code refactoring
+	in -current)
+
+	Fix error path in ip6 source address selection.
+	[mlelstv, ticket #1079]
+
+



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

2018-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  4 11:14:09 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: udp6_output.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1079):

sys/netinet6/udp6_usrreq.c: revision 1.142
applied to udp6_output.c (refactured in HEAD)

Fix error path in ip6 source address selection.

in6_selectsrc previously returned a pointer to an ipv6 address,
the pointer was NULL in case of an error and is checked later
instead of the also returned error code. When in6_selectsrc was
changed to store the address into a buffer, the error code
was still ignored, but the buffer pointer was never set to NULL.

As a result send() to an ipv6 address on a system that isn't
configured for ipv6 no longer returns the expected EADDRAVAIL
but fails later in ip6_output with EOPNOTSUPP when trying to
send from an unspecified address. The wrong error code caused
BIND to log the unexpected errors.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.6.1 src/sys/netinet6/udp6_output.c

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

Modified files:

Index: src/sys/netinet6/udp6_output.c
diff -u src/sys/netinet6/udp6_output.c:1.55 src/sys/netinet6/udp6_output.c:1.55.6.1
--- src/sys/netinet6/udp6_output.c:1.55	Fri Mar  3 07:13:06 2017
+++ src/sys/netinet6/udp6_output.c	Sun Nov  4 11:14:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp6_output.c,v 1.55 2017/03/03 07:13:06 ozaki-r Exp $	*/
+/*	$NetBSD: udp6_output.c,v 1.55.6.1 2018/11/04 11:14:09 martin Exp $	*/
 /*	$KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.55 2017/03/03 07:13:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.55.6.1 2018/11/04 11:14:09 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -233,7 +233,10 @@ udp6_output(struct in6pcb * const in6p, 
 			in6p->in6p_moptions,
 			>in6p_route,
 			>in6p_laddr, , , &_laddr);
-			/* XXX need error check? */
+			if (error)
+laddr = NULL;
+			else
+laddr = &_laddr;
 			if (oifp && scope_ambiguous &&
 			(error = in6_setscope(>sin6_addr,
 			oifp, NULL))) {
@@ -243,7 +246,6 @@ udp6_output(struct in6pcb * const in6p, 
 			}
 			if_put(oifp, );
 			curlwp_bindx(bound);
-			laddr = &_laddr;
 		} else {
 			/*
 			 * XXX: freebsd[34] does not have in_selectsrc, but



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

2018-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  4 11:08:10 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-8]: uhub.c usb_subr.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1078):

sys/dev/usb/uhub.c: revision 1.140
sys/dev/usb/uhub.c: revision 1.141
sys/dev/usb/usb_subr.c: revision 1.228

Make USB port numbers display consistent

Make sure USB ports numbers are displayed with the first one as number one
and not number zero when rescanning bus. The change makes the display
consistent with the display at boot time USB discovery.

While we are there, make port iteration consistent everywhere in the code,
always starting at one instead of zero.

 -

Make USB port iteration code consistent, always startint at port #1
This complements change in revision 1.140


To generate a diff of this commit:
cvs rdiff -u -r1.136.2.2 -r1.136.2.3 src/sys/dev/usb/uhub.c
cvs rdiff -u -r1.220.2.5 -r1.220.2.6 src/sys/dev/usb/usb_subr.c

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

Modified files:

Index: src/sys/dev/usb/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.136.2.2 src/sys/dev/usb/uhub.c:1.136.2.3
--- src/sys/dev/usb/uhub.c:1.136.2.2	Thu Sep 27 14:52:26 2018
+++ src/sys/dev/usb/uhub.c	Sun Nov  4 11:08:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.136.2.2 2018/09/27 14:52:26 martin Exp $	*/
+/*	$NetBSD: uhub.c,v 1.136.2.3 2018/11/04 11:08:10 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 /*	$OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.136.2.2 2018/09/27 14:52:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.136.2.3 2018/11/04 11:08:10 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -412,11 +412,11 @@ uhub_attach(device_t parent, device_t se
 			 sizeof(struct usbd_tt), KM_SLEEP);
 	}
 	/* Set up data structures */
-	for (p = 0; p < nports; p++) {
-		struct usbd_port *up = >uh_ports[p];
+	for (p = 1; p <= nports; p++) {
+		struct usbd_port *up = >uh_ports[p - 1];
 		up->up_dev = NULL;
 		up->up_parent = dev;
-		up->up_portno = p + 1;
+		up->up_portno = p;
 		if (dev->ud_selfpowered)
 			/* Self powered hub, give ports maximum current. */
 			up->up_power = USB_MAX_POWER;
@@ -425,7 +425,7 @@ uhub_attach(device_t parent, device_t se
 		up->up_restartcnt = 0;
 		up->up_reattach = 0;
 		if (UHUB_IS_HIGH_SPEED(sc)) {
-			up->up_tt = [UHUB_IS_SINGLE_TT(sc) ? 0 : p];
+			up->up_tt = [UHUB_IS_SINGLE_TT(sc) ? 0 : p - 1];
 			up->up_tt->utt_hub = hub;
 		} else {
 			up->up_tt = NULL;
@@ -822,8 +822,8 @@ uhub_detach(device_t self, int flags)
 	KERNEL_LOCK(1, curlwp);
 
 	nports = hub->uh_hubdesc.bNbrPorts;
-	for (port = 0; port < nports; port++) {
-		rup = >uh_ports[port];
+	for (port = 1; port <= nports; port++) {
+		rup = >uh_ports[port - 1];
 		if (rup->up_dev == NULL)
 			continue;
 		if ((rc = usb_disconnect_port(rup, self, flags)) != 0) {
@@ -870,8 +870,8 @@ uhub_rescan(device_t self, const char *i
 	struct usbd_device *dev;
 	int port;
 
-	for (port = 0; port < hub->uh_hubdesc.bNbrPorts; port++) {
-		dev = hub->uh_ports[port].up_dev;
+	for (port = 1; port <= hub->uh_hubdesc.bNbrPorts; port++) {
+		dev = hub->uh_ports[port - 1].up_dev;
 		if (dev == NULL)
 			continue;
 		usbd_reattach_device(sc->sc_dev, dev, port, locators);
@@ -895,8 +895,8 @@ uhub_childdet(device_t self, device_t ch
 		panic("hub not fully initialised, but child deleted?");
 
 	nports = devhub->ud_hub->uh_hubdesc.bNbrPorts;
-	for (port = 0; port < nports; port++) {
-		dev = devhub->ud_hub->uh_ports[port].up_dev;
+	for (port = 1; port <= nports; port++) {
+		dev = devhub->ud_hub->uh_ports[port - 1].up_dev;
 		if (!dev || dev->ud_subdevlen == 0)
 			continue;
 		for (i = 0; i < dev->ud_subdevlen; i++) {

Index: src/sys/dev/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.220.2.5 src/sys/dev/usb/usb_subr.c:1.220.2.6
--- src/sys/dev/usb/usb_subr.c:1.220.2.5	Thu Sep 27 14:52:26 2018
+++ src/sys/dev/usb/usb_subr.c	Sun Nov  4 11:08:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.220.2.5 2018/09/27 14:52:26 martin Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.220.2.6 2018/11/04 11:08:10 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.220.2.5 2018/09/27 14:52:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.220.2.6 2018/11/04 11:08:10 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1230,9 +1230,10 @@ usbd_new_device(device_t parent, struct 
 	 adev = hub, hub = hub->ud_myhub)
 		;
 	if (hub) {
-		for (p = 0; p < hub->ud_hub->uh_hubdesc.bNbrPorts; p++) {
-			if (hub->ud_hub->uh_ports[p].up_dev == adev) {
-dev->ud_myhsport = >ud_hub->uh_ports[p];
+		for (p = 1; p <= 

CVS commit: [netbsd-8] src/doc

2018-11-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov  3 17:20:35 UTC 2018

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

Log Message:
Ticket #1077


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.46 src/doc/CHANGES-8.1:1.1.2.47
--- src/doc/CHANGES-8.1:1.1.2.46	Fri Nov  2 15:36:21 2018
+++ src/doc/CHANGES-8.1	Sat Nov  3 17:20:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.46 2018/11/02 15:36:21 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.47 2018/11/03 17:20:35 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1570,4 +1570,9 @@ sys/arch/evbarm/conf/RPI_INSTALL		1.10
 
 	Bump image size to 28000k, adjust ramdisk size accordingly.
 
+external/bsd/nsd/include/config.h		1.4
+
+	Disable {send,recv}mmsg until we make our syscalls not have "sticky"
+	errors.
+	[christos, ticket #1077]
 



CVS commit: [netbsd-8] src/external/bsd/nsd/include

2018-11-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov  3 17:15:58 UTC 2018

Modified Files:
src/external/bsd/nsd/include [netbsd-8]: config.h

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

external/bsd/nsd/include/config.h: revision 1.4

Disable {send,recv}mmsg until we make our syscalls not have "sticky" errors.


To generate a diff of this commit:
cvs rdiff -u -r1.1.8.1 -r1.1.8.2 src/external/bsd/nsd/include/config.h

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

Modified files:

Index: src/external/bsd/nsd/include/config.h
diff -u src/external/bsd/nsd/include/config.h:1.1.8.1 src/external/bsd/nsd/include/config.h:1.1.8.2
--- src/external/bsd/nsd/include/config.h:1.1.8.1	Sat Oct 13 17:30:01 2018
+++ src/external/bsd/nsd/include/config.h	Sat Nov  3 17:15:58 2018
@@ -233,11 +233,13 @@
 /* Define to 1 if you have the `reallocarray' function. */
 #define HAVE_REALLOCARRAY 1
 
+#ifdef notyet
 /* Define if recvmmsg is implemented */
 #define HAVE_RECVMMSG 1
 
 /* Define if sendmmsg is implemented */
 #define HAVE_SENDMMSG 1
+#endif
 
 /* Define to 1 if you have the `setregid' function. */
 #define HAVE_SETREGID 1



CVS commit: [netbsd-8] src/doc

2018-11-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  2 15:36:22 UTC 2018

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

Log Message:
Annotate build fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.45 src/doc/CHANGES-8.1:1.1.2.46
--- src/doc/CHANGES-8.1:1.1.2.45	Fri Nov  2 07:55:56 2018
+++ src/doc/CHANGES-8.1	Fri Nov  2 15:36:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.45 2018/11/02 07:55:56 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.46 2018/11/02 15:36:21 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1566,7 +1566,8 @@ sys/arch/arm/arm/disassem.c			1.40
 	[skrll, ticket #1076]
 
 distrib/evbarm/instkernel/sshramdisk/Makefile	1.16,1.17
+sys/arch/evbarm/conf/RPI_INSTALL		1.10
 
-	Bump image size to 28000k.
+	Bump image size to 28000k, adjust ramdisk size accordingly.
 
 



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

2018-11-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  2 15:31:26 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf [netbsd-8]: RPI_INSTALL

Log Message:
Bump size for ramdisk.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.8.1 src/sys/arch/evbarm/conf/RPI_INSTALL

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

Modified files:

Index: src/sys/arch/evbarm/conf/RPI_INSTALL
diff -u src/sys/arch/evbarm/conf/RPI_INSTALL:1.9 src/sys/arch/evbarm/conf/RPI_INSTALL:1.9.8.1
--- src/sys/arch/evbarm/conf/RPI_INSTALL:1.9	Thu Dec 29 20:51:26 2016
+++ src/sys/arch/evbarm/conf/RPI_INSTALL	Fri Nov  2 15:31:26 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: RPI_INSTALL,v 1.9 2016/12/29 20:51:26 skrll Exp $
+#	$NetBSD: RPI_INSTALL,v 1.9.8.1 2018/11/02 15:31:26 martin Exp $
 #
 #	RPI_INSTALL -- RPI kernel with installation-sized
 #	ramdisk
@@ -8,7 +8,7 @@ include "arch/evbarm/conf/RPI"
 include "arch/evbarm/conf/INSTALL"
 
 no options	MEMORY_DISK_ROOT_SIZE
-options 	MEMORY_DISK_ROOT_SIZE=49152
+options 	MEMORY_DISK_ROOT_SIZE=56000
 
 makeoptions	RAMDISKNAME=sshramdisk
 no makeoptions	DEBUG



CVS commit: [netbsd-8] src/doc

2018-11-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  2 07:55:56 UTC 2018

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

Log Message:
Ammend #1072 for additional pullups.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.44 src/doc/CHANGES-8.1:1.1.2.45
--- src/doc/CHANGES-8.1:1.1.2.44	Thu Nov  1 07:54:18 2018
+++ src/doc/CHANGES-8.1	Fri Nov  2 07:55:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.44 2018/11/01 07:54:18 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.45 2018/11/02 07:55:56 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1535,7 +1535,7 @@ sys/dev/usb/usbdevs	(patch)
 sys/dev/ic/bwfm.c	1.14 (patch)
 sys/dev/ic/bwfmreg.h	1.3 (patch)
 sys/dev/ic/bwfmvar.h	1.3 (patch)
-sys/dev/pci/if_bwfm_pci.c 1.4 (patch)
+sys/dev/pci/if_bwfm_pci.c 1.4 (patch), 1.5
 sys/dev/pci/if_bwfm_pci.h1.8 (patch)
 sys/dev/usb/if_bwfm_usb.c 1.8 (patch)
 distrib/sets/lists/man/mi(patch)



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

2018-11-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  2 07:55:06 UTC 2018

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

Log Message:
Additional pullup for ticket #1072:

sys/dev/pci/if_bwfm_pci.c   1.5

Make this compilable with 32bit paddr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/dev/pci/if_bwfm_pci.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_bwfm_pci.c
diff -u src/sys/dev/pci/if_bwfm_pci.c:1.4.2.2 src/sys/dev/pci/if_bwfm_pci.c:1.4.2.3
--- src/sys/dev/pci/if_bwfm_pci.c:1.4.2.2	Wed Oct 31 09:23:00 2018
+++ src/sys/dev/pci/if_bwfm_pci.c	Fri Nov  2 07:55:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bwfm_pci.c,v 1.4.2.2 2018/10/31 09:23:00 martin Exp $	*/
+/*	$NetBSD: if_bwfm_pci.c,v 1.4.2.3 2018/11/02 07:55:06 martin Exp $	*/
 /*	$OpenBSD: if_bwfm_pci.c,v 1.18 2018/02/08 05:00:38 patrick Exp $	*/
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -199,7 +199,7 @@ struct bwfm_pci_dmamem {
 
 #define BWFM_PCI_DMA_MAP(_bdm)	((_bdm)->bdm_map)
 #define BWFM_PCI_DMA_LEN(_bdm)	((_bdm)->bdm_size)
-#define BWFM_PCI_DMA_DVA(_bdm)	((_bdm)->bdm_map->dm_segs[0].ds_addr)
+#define BWFM_PCI_DMA_DVA(_bdm)	(uint64_t)((_bdm)->bdm_map->dm_segs[0].ds_addr)
 #define BWFM_PCI_DMA_KVA(_bdm)	((_bdm)->bdm_kva)
 
 static u_int	 if_rxr_get(struct if_rxring *rxr, unsigned int max);
@@ -1006,6 +1006,7 @@ bwfm_pci_fill_rx_ioctl_ring(struct bwfm_
 	uint32_t pktid;
 	paddr_t paddr;
 	int s, slots;
+	uint64_t devaddr;
 
 	s = splnet();
 	for (slots = if_rxr_get(rxring, 8); slots > 0; slots--) {
@@ -1025,12 +1026,13 @@ bwfm_pci_fill_rx_ioctl_ring(struct bwfm_
 			m_freem(m);
 			break;
 		}
+		devaddr = paddr;
 		memset(req, 0, sizeof(*req));
 		req->msg.msgtype = msgtype;
 		req->msg.request_id = htole32(pktid);
 		req->host_buf_len = htole16(MSGBUF_MAX_PKT_SIZE);
-		req->host_buf_addr.high_addr = htole32(paddr >> 32);
-		req->host_buf_addr.low_addr = htole32(paddr & 0x);
+		req->host_buf_addr.high_addr = htole32(devaddr >> 32);
+		req->host_buf_addr.low_addr = htole32(devaddr & 0x);
 		bwfm_pci_ring_write_commit(sc, >sc_ctrl_submit);
 	}
 	if_rxr_put(rxring, slots);
@@ -1045,6 +1047,7 @@ bwfm_pci_fill_rx_buf_ring(struct bwfm_pc
 	uint32_t pktid;
 	paddr_t paddr;
 	int s, slots;
+	uint64_t devaddr;
 
 	s = splnet();
 	for (slots = if_rxr_get(>sc_rxbuf_ring, sc->sc_max_rxbufpost);
@@ -1065,12 +1068,13 @@ bwfm_pci_fill_rx_buf_ring(struct bwfm_pc
 			m_freem(m);
 			break;
 		}
+		devaddr = paddr;
 		memset(req, 0, sizeof(*req));
 		req->msg.msgtype = MSGBUF_TYPE_RXBUF_POST;
 		req->msg.request_id = htole32(pktid);
 		req->data_buf_len = htole16(MSGBUF_MAX_PKT_SIZE);
-		req->data_buf_addr.high_addr = htole32(paddr >> 32);
-		req->data_buf_addr.low_addr = htole32(paddr & 0x);
+		req->data_buf_addr.high_addr = htole32(devaddr >> 32);
+		req->data_buf_addr.low_addr = htole32(devaddr & 0x);
 		bwfm_pci_ring_write_commit(sc, >sc_rxpost_submit);
 	}
 	if_rxr_put(>sc_rxbuf_ring, slots);
@@ -1898,6 +1902,7 @@ bwfm_pci_txdata(struct bwfm_softc *bwfm,
 	struct msgbuf_tx_msghdr *tx;
 	uint32_t pktid;
 	paddr_t paddr;
+	uint64_t devaddr;
 	struct ether_header *eh;
 	int flowid, ret, ac;
 
@@ -1952,12 +1957,12 @@ bwfm_pci_txdata(struct bwfm_softc *bwfm,
 		bwfm_pci_ring_write_cancel(sc, ring, 1);
 		return ret;
 	}
-	paddr += ETHER_HDR_LEN;
+	devaddr = paddr + ETHER_HDR_LEN;
 
 	tx->msg.request_id = htole32(pktid);
 	tx->data_len = htole16((*mp)->m_len - ETHER_HDR_LEN);
-	tx->data_buf_addr.high_addr = htole32(paddr >> 32);
-	tx->data_buf_addr.low_addr = htole32(paddr & 0x);
+	tx->data_buf_addr.high_addr = htole32(devaddr >> 32);
+	tx->data_buf_addr.low_addr = htole32(devaddr & 0x);
 
 	bwfm_pci_ring_write_commit(sc, ring);
 	return 0;



CVS commit: [netbsd-8] src/doc

2018-11-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov  1 07:54:18 UTC 2018

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

Log Message:
Note build fix changes


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.43 src/doc/CHANGES-8.1:1.1.2.44
--- src/doc/CHANGES-8.1:1.1.2.43	Wed Oct 31 10:05:33 2018
+++ src/doc/CHANGES-8.1	Thu Nov  1 07:54:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.43 2018/10/31 10:05:33 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.44 2018/11/01 07:54:18 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1565,3 +1565,8 @@ sys/arch/arm/arm/disassem.c			1.40
 	Allow "setend be" decode.
 	[skrll, ticket #1076]
 
+distrib/evbarm/instkernel/sshramdisk/Makefile	1.16,1.17
+
+	Bump image size to 28000k.
+
+



CVS commit: [netbsd-8] src/distrib/evbarm/instkernel/sshramdisk

2018-11-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov  1 07:52:59 UTC 2018

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-8]: Makefile

Log Message:
Pull up the following trying to fix the build:

distrib/evbarm/instkernel/sshramdisk/Makefile   1.16,1.17

Bump image size to 28000k.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile

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

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15.4.1
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.15	Sat Mar 18 17:07:04 2017
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Thu Nov  1 07:52:59 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.15 2017/03/18 17:07:04 sevan Exp $
+#	$NetBSD: Makefile,v 1.15.4.1 2018/11/01 07:52:59 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		sshramdisk.fs
-IMAGESIZE=	22000k
+IMAGESIZE=	28000k
 MAKEFS_FLAGS+=	-f 15
 
 .if ${MKREPRO_TIMESTAMP:Uno} != "no"



CVS commit: [netbsd-8] src/distrib/sets/lists/man

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:39:55 UTC 2018

Modified Files:
src/distrib/sets/lists/man [netbsd-8]: mi

Log Message:
Missing commit from ticket #1072: add bwfm man page


To generate a diff of this commit:
cvs rdiff -u -r1.1557.2.5 -r1.1557.2.6 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1557.2.5 src/distrib/sets/lists/man/mi:1.1557.2.6
--- src/distrib/sets/lists/man/mi:1.1557.2.5	Thu Jun  7 18:24:16 2018
+++ src/distrib/sets/lists/man/mi	Wed Oct 31 10:39:55 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1557.2.5 2018/06/07 18:24:16 martin Exp $
+# $NetBSD: mi,v 1.1557.2.6 2018/10/31 10:39:55 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -951,6 +951,7 @@
 ./usr/share/man/cat4/btms.0			man-sys-catman		.cat
 ./usr/share/man/cat4/btsco.0			man-sys-catman		.cat
 ./usr/share/man/cat4/btuart.0			man-sys-catman		.cat
+./usr/share/man/cat4/bwfm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/bwi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ca.0			man-obsolete		obsolete
 ./usr/share/man/cat4/cac.0			man-sys-catman		.cat
@@ -4072,6 +4073,7 @@
 ./usr/share/man/html4/btms.html			man-sys-htmlman		html
 ./usr/share/man/html4/btsco.html		man-sys-htmlman		html
 ./usr/share/man/html4/btuart.html		man-sys-htmlman		html
+./usr/share/man/html4/bwfm.html			man-sys-htmlman		html
 ./usr/share/man/html4/bwi.html			man-sys-htmlman		html
 ./usr/share/man/html4/cac.html			man-sys-htmlman		html
 ./usr/share/man/html4/can.html			man-sys-htmlman		html
@@ -6963,6 +6965,7 @@
 ./usr/share/man/man4/btms.4			man-sys-man		.man
 ./usr/share/man/man4/btsco.4			man-sys-man		.man
 ./usr/share/man/man4/btuart.4			man-sys-man		.man
+./usr/share/man/man4/bwfm.4			man-sys-man		.man
 ./usr/share/man/man4/bwi.4			man-sys-man		.man
 ./usr/share/man/man4/ca.4			man-obsolete		obsolete
 ./usr/share/man/man4/cac.4			man-sys-man		.man



CVS commit: [netbsd-8] src/doc

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:05:33 UTC 2018

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

Log Message:
Tickets #1072, #1073 and #1076


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.42 src/doc/CHANGES-8.1:1.1.2.43
--- src/doc/CHANGES-8.1:1.1.2.42	Tue Oct 30 09:32:48 2018
+++ src/doc/CHANGES-8.1	Wed Oct 31 10:05:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.42 2018/10/30 09:32:48 sborrill Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.43 2018/10/31 10:05:33 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1512,3 +1512,56 @@ sys/dev/pci/pcireg.h1.141-1.142
 	- Add comment.
 	[msaitoh, ticket #1074]
 
+distrib/sets/lists/base/mi(patch)
+etc/mtree/NetBSD.dist.base(patch)
+external/Makefile	(patch)
+external/broadcom/Makefile1.3 (patch)
+external/broadcom/Makefile.inc1.1 (patch)
+external/broadcom/bwfm/Makefile1.3 (patch)
+external/broadcom/bwfm/dist/LICENCE.broadcom_bcm43xx	1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43143.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43236b.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43242a.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac4350-pcie.bin	1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac4350c2-pcie.bin	1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43569.bin		1.1.1.1 (patch)
+external/broadcom/bwfm/dist/brcmfmac43602-pcie.bin	1.1 (patch)
+sys/arch/amd64/conf/GENERIC(patch)
+sys/arch/i386/conf/GENERIC(patch)
+sys/conf/files		(patch)
+sys/dev/pci/files.pci	(patch)
+sys/dev/usb/files.usb	(patch)
+sys/dev/usb/usbdevs	(patch)
+sys/dev/ic/bwfm.c	1.14 (patch)
+sys/dev/ic/bwfmreg.h	1.3 (patch)
+sys/dev/ic/bwfmvar.h	1.3 (patch)
+sys/dev/pci/if_bwfm_pci.c 1.4 (patch)
+sys/dev/pci/if_bwfm_pci.h1.8 (patch)
+sys/dev/usb/if_bwfm_usb.c 1.8 (patch)
+distrib/sets/lists/man/mi(patch)
+share/man/man4/bwfm.4	1.3 (patch)
+sys/dev/usb/usbdevs.h	(regen)
+sys/dev/usb/usbdevs_data.h(regen)
+
+	Add backport of bwfm(4).
+	[maya, ticket #1072]
+
+external/public-domain/tz/dist/NEWS up to 1.1.1.24
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.14
+external/public-domain/tz/dist/africa   up to 1.1.1.17
+external/public-domain/tz/dist/europe   up to 1.1.1.23
+external/public-domain/tz/dist/northamerica up to 1.1.1.21
+external/public-domain/tz/dist/theory.html  up to 1.1.1.6
+external/public-domain/tz/dist/version  up to 1.1.1.11
+external/public-domain/tz/dist/ziguard.awk  up to 1.1.1.3
+external/public-domain/tz/dist/zishrink.awk up to 1.1.1.5
+doc/3RDPARTY	(patch)
+
+	Updated tzdata to 2018g.
+	[kre, ticket #1073]
+
+sys/arch/arm/arm/disassem.c			1.40
+
+	Allow "setend be" decode.
+	[skrll, ticket #1076]
+



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

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:03:48 UTC 2018

Modified Files:
src/sys/arch/arm/arm [netbsd-8]: disassem.c

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

sys/arch/arm/arm/disassem.c: revision 1.40

Allow setend be decode


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.2.1 src/sys/arch/arm/arm/disassem.c

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

Modified files:

Index: src/sys/arch/arm/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.39 src/sys/arch/arm/arm/disassem.c:1.39.2.1
--- src/sys/arch/arm/arm/disassem.c:1.39	Sat Jun  3 11:51:59 2017
+++ src/sys/arch/arm/arm/disassem.c	Wed Oct 31 10:03:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $	*/
+/*	$NetBSD: disassem.c,v 1.39.2.1 2018/10/31 10:03:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.39.2.1 2018/10/31 10:03:48 martin Exp $");
 
 #include 
 
@@ -134,7 +134,7 @@ static const struct arm32_insn arm32_i[]
  * miscellaneous instructions
  */
 { 0xfff10020, 0xf100, "cps",	"C!c" },
-{ 0xfff100f0, 0xf101, "setend\tle", "" },
+{ 0xfff102f0, 0xf101, "setend\tle", "" },
 { 0xfff102f0, 0xf1010200, "setend\tbe", "" },
 /* pli */
 /* pld */



CVS commit: [netbsd-8] src

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 10:02:15 UTC 2018

Modified Files:
src/doc [netbsd-8]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-8]: NEWS TZDATA_VERSION
africa europe northamerica theory.html version ziguard.awk
zishrink.awk

Log Message:
Sync to -current, requested by kre in ticket #1073:

external/public-domain/tz/dist/NEWS up to 1.1.1.24
external/public-domain/tz/dist/TZDATA_VERSION   up to 1.14
external/public-domain/tz/dist/africa   up to 1.1.1.17
external/public-domain/tz/dist/europe   up to 1.1.1.23
external/public-domain/tz/dist/northamerica up to 1.1.1.21
external/public-domain/tz/dist/theory.html  up to 1.1.1.6
external/public-domain/tz/dist/version  up to 1.1.1.11
external/public-domain/tz/dist/ziguard.awk  up to 1.1.1.3
external/public-domain/tz/dist/zishrink.awk up to 1.1.1.5
doc/3RDPARTY(patch)

Import tzdata2018g from ftp://ftp.iana.org/tz/releases/tzdata2018g.tar.gz

Summary of changes in tzdata2018g (2018-10-26 22:22:45 -0700):

Morocco switches to permanent +01 on 2018-10-27.


To generate a diff of this commit:
cvs rdiff -u -r1.1444.2.18 -r1.1444.2.19 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.18.4.5 -r1.1.1.18.4.6 \
src/external/public-domain/tz/dist/NEWS
cvs rdiff -u -r1.8.4.5 -r1.8.4.6 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.11.4.5 -r1.1.1.11.4.6 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.17.4.5 -r1.1.1.17.4.6 \
src/external/public-domain/tz/dist/europe
cvs rdiff -u -r1.1.1.16.4.4 -r1.1.1.16.4.5 \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7 \
src/external/public-domain/tz/dist/theory.html
cvs rdiff -u -r1.1.1.5.4.5 -r1.1.1.5.4.6 \
src/external/public-domain/tz/dist/version
cvs rdiff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4 \
src/external/public-domain/tz/dist/ziguard.awk
cvs rdiff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6 \
src/external/public-domain/tz/dist/zishrink.awk

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1444.2.18 src/doc/3RDPARTY:1.1444.2.19
--- src/doc/3RDPARTY:1.1444.2.18	Sun Oct 21 12:10:22 2018
+++ src/doc/3RDPARTY	Wed Oct 31 10:02:14 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1444.2.18 2018/10/21 12:10:22 martin Exp $
+#	$NetBSD: 3RDPARTY,v 1.1444.2.19 2018/10/31 10:02:14 martin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1411,8 +1411,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2017b / tzdata2018f
-Current Vers:	tzcode2018f / tzdata2018f
+Version:	tzcode2017b / tzdata2018g
+Current Vers:	tzcode2018g / tzdata2018g
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/external/public-domain/tz/dist/NEWS
diff -u src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.5 src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.6
--- src/external/public-domain/tz/dist/NEWS:1.1.1.18.4.5	Sun Oct 21 12:10:23 2018
+++ src/external/public-domain/tz/dist/NEWS	Wed Oct 31 10:02:15 2018
@@ -1,5 +1,40 @@
 News for the tz database
 
+Release 2018g - 2018-10-26 22:22:45 -0700
+
+  Briefly:
+Morocco switches to permanent +01 on 2018-10-27.
+
+  Changes to future timestamps
+
+Morocco switches from +00/+01 to permanent +01 effective 2018-10-27,
+so its clocks will not fall back on 2018-10-28 as previously scheduled.
+(Thanks to Mohamed Essedik Najd and Brian Inglis.)
+
+  Changes to code
+
+When generating TZif files with leap seconds, zic no longer uses a
+format that trips up older 32-bit clients, fixing a bug introduced
+in 2018f.  (Reported by Daniel Fischer.)  Also, the zic workaround
+for QTBUG-53071 now also works for TZif files with leap seconds.
+
+The translator to rearguard format now rewrites the line
+"Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
+"Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
+This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
+and earlier.  (Reported by Christos Zoulas.)
+
+  Changes to past time zone abbreviations
+
+Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii.
+This reverts to 2011h, as the abbreviation change in 2011i was
+likely inadvertent.
+
+  Changes to documentation
+
+tzfile.5 has new sections on interoperability issues.
+
+
 Release 2018f - 2018-10-18 00:14:18 -0700
 
   Briefly:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.8.4.5 

CVS commit: [netbsd-8] src/sys

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 09:30:10 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: GENERIC
src/sys/arch/i386/conf [netbsd-8]: GENERIC
src/sys/conf [netbsd-8]: files
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/usb [netbsd-8]: files.usb usbdevs

Log Message:
Add bwfm config glue, requested by maya in ticket #1072.


To generate a diff of this commit:
cvs rdiff -u -r1.459.2.11 -r1.459.2.12 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1156.2.11 -r1.1156.2.12 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.1173.2.5 -r1.1173.2.6 src/sys/conf/files
cvs rdiff -u -r1.388.4.2 -r1.388.4.3 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.145 -r1.145.2.1 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.736 -r1.736.2.1 src/sys/dev/usb/usbdevs

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.459.2.11 src/sys/arch/amd64/conf/GENERIC:1.459.2.12
--- src/sys/arch/amd64/conf/GENERIC:1.459.2.11	Fri Sep  7 12:27:26 2018
+++ src/sys/arch/amd64/conf/GENERIC	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.459.2.11 2018/09/07 12:27:26 martin Exp $
+# $NetBSD: GENERIC,v 1.459.2.12 2018/10/31 09:30:10 martin 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.459.2.11 $"
+#ident		"GENERIC-$Revision: 1.459.2.12 $"
 
 maxusers	64		# estimated number of users
 
@@ -753,6 +753,7 @@ bce*	at pci? dev ? function ?	# Broadcom
 bge*	at pci? dev ? function ?	# Broadcom 570x gigabit Ethernet
 bnx*	at pci? dev ? function ?	# Broadcom NetXtremeII gigabit Ethernet
 bwi*	at pci? dev ? function ?	# Broadcom BCM43xx wireless
+bwfm*	at pci? dev ? function ?	# Broadcom FullMAC
 dge*	at pci? dev ? function ?	# Intel 82597 10GbE LR
 en*	at pci? dev ? function ?	# ENI/Adaptec ATM
 ep*	at pci? dev ? function ?	# 3Com 3c59x

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1156.2.11 src/sys/arch/i386/conf/GENERIC:1.1156.2.12
--- src/sys/arch/i386/conf/GENERIC:1.1156.2.11	Fri Sep  7 12:27:26 2018
+++ src/sys/arch/i386/conf/GENERIC	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1156.2.11 2018/09/07 12:27:26 martin Exp $
+# $NetBSD: GENERIC,v 1.1156.2.12 2018/10/31 09:30:10 martin 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.1156.2.11 $"
+#ident		"GENERIC-$Revision: 1.1156.2.12 $"
 
 maxusers	64		# estimated number of users
 
@@ -988,6 +988,7 @@ bce*	at pci? dev ? function ?	# Broadcom
 bge*	at pci? dev ? function ?	# Broadcom 570x gigabit Ethernet
 bnx*	at pci? dev ? function ?	# Broadcom NetXtremeII gigabit Ethernet
 bwi*	at pci? dev ? function ?	# Broadcom BCM43xx wireless
+bwfm*	at pci? dev ? function ?	# Broadcom FullMAC
 dge*	at pci? dev ? function ?	# Intel 82597 10GbE LR
 en*	at pci? dev ? function ?	# ENI/Adaptec ATM
 ep*	at pci? dev ? function ?	# 3Com 3c59x

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1173.2.5 src/sys/conf/files:1.1173.2.6
--- src/sys/conf/files:1.1173.2.5	Mon Apr  9 12:49:31 2018
+++ src/sys/conf/files	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1173.2.5 2018/04/09 12:49:31 bouyer Exp $
+#	$NetBSD: files,v 1.1173.2.6 2018/10/31 09:30:10 martin Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20170615
@@ -1401,6 +1401,11 @@ file	dev/ic/isic_bchan.c		isic
 device	iavc: isdndev, isdncapi, passive_isdn
 file	dev/ic/iavc.c			iavc
 
+
+# Broadcom FullMAC 802.11 driver
+device	bwfm: arp, ifnet, wlan
+file	dev/ic/bwfm.c			bwfm
+
 # Broadcom AirForce / Apple Airport Extreme
 device	bwi: arp, ifnet, firmload, wlan
 file	dev/ic/bwi.c			bwi

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.388.4.2 src/sys/dev/pci/files.pci:1.388.4.3
--- src/sys/dev/pci/files.pci:1.388.4.2	Sun Sep 23 18:00:53 2018
+++ src/sys/dev/pci/files.pci	Wed Oct 31 09:30:10 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.388.4.2 2018/09/23 18:00:53 martin Exp $
+#	$NetBSD: files.pci,v 1.388.4.3 2018/10/31 09:30:10 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1067,6 +1067,10 @@ include "dev/pci/n8/files.n8"
 attach	bwi at pci with bwi_pci
 file	dev/pci/if_bwi_pci.c		bwi_pci
 
+# Broadcom FullMAC USB wireless adapter
+attach	bwfm at pci with bwfm_pci: firmload
+file	dev/pci/if_bwfm_pci.c		bwfm_pci
+
 # Marvell Serial-ATA Host Controller
 attach	mvsata at pci with mvsata_pci
 file	dev/pci/mvsata_pci.c		mvsata_pci

Index: src/sys/dev/usb/files.usb
diff -u 

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

2018-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 31 09:26:52 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: Makefile
Added Files:
src/share/man/man4 [netbsd-8]: bwfm.4

Log Message:
Pull up the following, requested by maya in ticket #1072:

distrib/sets/lists/man/mi   (patch)
share/man/man4/bwfm.4   1.3 (patch)

Add bwfm man page.


To generate a diff of this commit:
cvs rdiff -u -r1.637.2.2 -r1.637.2.3 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.3.4.2 src/share/man/man4/bwfm.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/Makefile
diff -u src/share/man/man4/Makefile:1.637.2.2 src/share/man/man4/Makefile:1.637.2.3
--- src/share/man/man4/Makefile:1.637.2.2	Sat May 12 10:35:45 2018
+++ src/share/man/man4/Makefile	Wed Oct 31 09:26:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.637.2.2 2018/05/12 10:35:45 martin Exp $
+#	$NetBSD: Makefile,v 1.637.2.3 2018/10/31 09:26:51 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -15,7 +15,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	bio.4 bktr.4 bluetooth.4 bmtphy.4 bpf.4 bpfjit.4 \
 	brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 \
 	btmagic.4 btms.4 btsco.4 btuart.4 \
-	bwi.4 \
+	bwfm.4 bwi.4 \
 	cac.4 can.4 canloop.4 cardbus.4 carp.4 cas.4 ccd.4 cd.4 \
 	cec.4 cgd.4 cfb.4 ch.4 chipsfb.4 ciphy.4 ciss.4 clcs.4 clct.4 \
 	clockctl.4 cmdide.4 cmpci.4 cms.4 cnw.4 \

Added files:

Index: src/share/man/man4/bwfm.4
diff -u /dev/null src/share/man/man4/bwfm.4:1.3.4.2
--- /dev/null	Wed Oct 31 09:26:52 2018
+++ src/share/man/man4/bwfm.4	Wed Oct 31 09:26:51 2018
@@ -0,0 +1,58 @@
+.\" $NetBSD: bwfm.4,v 1.3.4.2 2018/10/31 09:26:51 martin Exp $
+.\"
+.\" Copyright (c) 2017 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd May 5, 2018
+.Dt BWFM 4
+.Os
+.Sh NAME
+.Nm bwfm
+.Nd Broadcom and Cypress wireless network driver
+.Sh SYNOPSIS
+.Cd "bwfm* at uhub? port ?"
+.Cd "bwfm* at pci? dev ? function ?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Broadcom and Cypress FullMAC network adapters.
+.Sh SEE ALSO
+.Xr bwi 4 ,
+.\".Xr ifconfig 4 ,
+.Xr ifmedia 4 ,
+.Xr usb 4 ,
+.Xr ifconfig.if 5 ,
+.Xr wpa_supplicant 8
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Patrick Wildt
+.Aq Mt patr...@blueri.se
+and ported to
+.Nx
+by
+.An Jared D. McNeill
+.Aq Mt jmcne...@netbsd.org .



  1   2   3   4   5   6   7   8   9   10   >