CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:24:17 UTC 2019

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

Log Message:
Convert debug printfs to usbhist.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/if_urtwn.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/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.73 src/sys/dev/usb/if_urtwn.c:1.74
--- src/sys/dev/usb/if_urtwn.c:1.73	Thu Oct 10 23:30:02 2019
+++ src/sys/dev/usb/if_urtwn.c	Tue Nov 26 10:24:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -73,6 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -95,10 +96,27 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v
 #define	DBG_REG		__BIT(6)
 #define	DBG_ALL		0xU
 u_int urtwn_debug = 0;
-#define DPRINTFN(n, s)	\
-	do { if (urtwn_debug & (n)) printf s; } while (/*CONSTCOND*/0)
+#define DPRINTFN(n, fmt, a, b, c, d) do {			\
+	if (urtwn_debug & (n)) {\
+		KERNHIST_LOG(usbhist, fmt, a, b, c, d);		\
+	}			\
+} while (/*CONSTCOND*/0)
+#define URTWNHIST_FUNC() USBHIST_FUNC()
+#define URTWNHIST_CALLED() do {	\
+	if (urtwn_debug & DBG_FN) {\
+		KERNHIST_CALLED(usbhist);			\
+	}			\
+} while(/*CONSTCOND*/0)
+#define URTWNHIST_CALLARGS(fmt, a, b, c, d) do {		\
+	if (urtwn_debug & DBG_FN) {\
+		KERNHIST_CALLARGS(usbhist, fmt, a, b, c, d);	\
+	}			\
+} while(/*CONSTCOND*/0)
 #else
-#define DPRINTFN(n, s)
+#define DPRINTFN(n, fmt, a, b, c, d)
+#define URTWNHIST_FUNC()
+#define URTWNHIST_CALLED()
+#define URTWNHIST_CALLARGS(fmt, a, b, c, d)
 #endif
 
 #define URTWN_DEV(v,p)	{ { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, 0 }
@@ -350,6 +368,8 @@ urtwn_attach(device_t parent, device_t s
 	size_t i;
 	int error;
 
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
+
 	sc->sc_dev = self;
 	sc->sc_udev = uaa->uaa_device;
 
@@ -363,8 +383,6 @@ urtwn_attach(device_t parent, device_t s
 	aprint_naive("\n");
 	aprint_normal("\n");
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
-
 	devinfop = usbd_devinfo_alloc(sc->sc_udev, 0);
 	aprint_normal_dev(self, "%s\n", devinfop);
 	usbd_devinfo_free(devinfop);
@@ -539,7 +557,7 @@ urtwn_detach(device_t self, int flags)
 	struct ifnet *ifp = >sc_if;
 	int s;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	pmf_device_deregister(self);
 
@@ -589,7 +607,7 @@ urtwn_activate(device_t self, enum devac
 {
 	struct urtwn_softc *sc = device_private(self);
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	switch (act) {
 	case DVACT_DEACTIVATE:
@@ -611,7 +629,7 @@ urtwn_open_pipes(struct urtwn_softc *sc)
 	size_t i, ntx = 0, nrx = 0;
 	int error;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* Determine the number of bulk-out pipes. */
 	id = usbd_get_interface_descriptor(sc->sc_iface);
@@ -641,8 +659,8 @@ urtwn_open_pipes(struct urtwn_softc *sc)
 		"%zd: invalid number of Tx bulk pipes\n", ntx);
 		return EIO;
 	}
-	DPRINTFN(DBG_INIT, ("%s: %s: found %zd/%zd bulk-in/out pipes\n",
-	device_xname(sc->sc_dev), __func__, nrx, ntx));
+	DPRINTFN(DBG_INIT, "found %jd/%jd bulk-in/out pipes",
+	nrx, ntx, 0, 0);
 	sc->rx_npipe = nrx;
 	sc->tx_npipe = ntx;
 
@@ -688,7 +706,7 @@ urtwn_close_pipes(struct urtwn_softc *sc
 	struct usbd_pipe *pipe;
 	size_t i;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* Close Rx pipes. */
 	CTASSERT(sizeof(pipe) == sizeof(void *));
@@ -715,7 +733,7 @@ urtwn_alloc_rx_list(struct urtwn_softc *
 	size_t i;
 	int error = 0;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	for (size_t j = 0; j < sc->rx_npipe; j++) {
 		TAILQ_INIT(>rx_free_list[j]);
@@ -747,7 +765,7 @@ urtwn_free_rx_list(struct urtwn_softc *s
 	struct usbd_xfer *xfer;
 	size_t i;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* NB: Caller must abort pipe first. */
 	for (size_t j = 0; j < sc->rx_npipe; j++) {
@@ -767,7 +785,7 @@ urtwn_alloc_tx_list(struct urtwn_softc *
 	size_t i;
 	int error = 0;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	

CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:24:17 UTC 2019

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

Log Message:
Convert debug printfs to usbhist.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/if_urtwn.c

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



CVS commit: [netbsd-8] src/share/tmac

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:59:41 UTC 2019

Modified Files:
src/share/tmac [netbsd-8]: doc2html

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

share/tmac/doc2html: revision 1.68

PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.
With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.6.1 src/share/tmac/doc2html

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



CVS commit: [netbsd-8] src/share/tmac

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:59:41 UTC 2019

Modified Files:
src/share/tmac [netbsd-8]: doc2html

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

share/tmac/doc2html: revision 1.68

PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.
With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.6.1 src/share/tmac/doc2html

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

Modified files:

Index: src/share/tmac/doc2html
diff -u src/share/tmac/doc2html:1.67 src/share/tmac/doc2html:1.67.6.1
--- src/share/tmac/doc2html:1.67	Tue Nov 22 00:36:49 2016
+++ src/share/tmac/doc2html	Tue Nov 26 08:59:41 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: doc2html,v 1.67 2016/11/22 00:36:49 kamil Exp $
+.\" $NetBSD: doc2html,v 1.67.6.1 2019/11/26 08:59:41 martin Exp $
 .\"
 .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -788,12 +788,12 @@ AT UNIX\\$*
 .	as doc-pcresult \\*[an-eol]
 .	pc-fin
 ..
-.de Lk
-.	as doc-pcresult \\$1
-.	shift
-.	recurse \\$@
-.	pc-fin
-..
+.\".de Lk
+.\".	as doc-pcresult \\$1
+.\".	shift
+.\".	recurse \\$@
+.\".	pc-fin
+.\"..
 .de Mt
 .	as doc-pcresult \\$1
 .	shift



CVS commit: [netbsd-8] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 09:00:55 UTC 2019

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

Log Message:
Ticket #1461


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

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.73 src/doc/CHANGES-8.2:1.1.2.74
--- src/doc/CHANGES-8.2:1.1.2.73	Tue Nov 26 08:26:19 2019
+++ src/doc/CHANGES-8.2	Tue Nov 26 09:00:55 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.73 2019/11/26 08:26:19 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.74 2019/11/26 09:00:55 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1717,3 +1717,9 @@ sys/dev/hyperv/if_hvn.c1.11
 	hvn(4): Fix incorrect ident when waiting for NVS command response.
 	[nonaka, ticket #1460]
 
+share/tmac/doc2html1.68
+
+	PR toolchain/54715: Remove duplicate (incorrect) version of
+	the .Lk macro.
+	[kre, ticket #1461]
+



CVS commit: [netbsd-8] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 09:00:55 UTC 2019

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

Log Message:
Ticket #1461


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

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



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:25:28 UTC 2019

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

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

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.6 -r1.2.2.7 src/sys/dev/hyperv/if_hvn.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/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.6 src/sys/dev/hyperv/if_hvn.c:1.2.2.7
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.6	Mon Nov 25 16:01:25 2019
+++ src/sys/dev/hyperv/if_hvn.c	Tue Nov 26 08:25:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.7 2019/11/26 08:25:28 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.7 2019/11/26 08:25:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1103,7 +1103,8 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			hvn_nvs_intr(sc);
 			splx(s);
 		} else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
+			tsleep(sc->sc_nvsrsp, PRIBIO | PCATCH, "nvscmd",
+			mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:25:28 UTC 2019

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

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

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.6 -r1.2.2.7 src/sys/dev/hyperv/if_hvn.c

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



CVS commit: [netbsd-8] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:26:19 UTC 2019

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

Log Message:
Ticket #1460


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

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



CVS commit: [netbsd-8] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:26:19 UTC 2019

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

Log Message:
Ticket #1460


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

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.72 src/doc/CHANGES-8.2:1.1.2.73
--- src/doc/CHANGES-8.2:1.1.2.72	Mon Nov 25 16:04:46 2019
+++ src/doc/CHANGES-8.2	Tue Nov 26 08:26:19 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.72 2019/11/25 16:04:46 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.73 2019/11/26 08:26:19 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1712,3 +1712,8 @@ sys/kern/subr_cprng.c1.33
 	Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
 	[riastradh, ticket #1459]
 
+sys/dev/hyperv/if_hvn.c1.11
+
+	hvn(4): Fix incorrect ident when waiting for NVS command response.
+	[nonaka, ticket #1460]
+



CVS commit: src/sys/dev/pci

2019-11-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Nov 26 10:33:19 UTC 2019

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

Log Message:
Fix IFF_ALLMULTI handling.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.6 src/sys/dev/pci/if_mcx.c:1.7
--- src/sys/dev/pci/if_mcx.c:1.6	Mon Nov 18 04:40:05 2019
+++ src/sys/dev/pci/if_mcx.c	Tue Nov 26 10:33:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.6 2019/11/18 04:40:05 nonaka Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.7 2019/11/26 10:33:19 jmcneill Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 
 /*
@@ -6205,8 +6205,11 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 {
 	struct mcx_softc *sc = (struct mcx_softc *)ifp->if_softc;
 	struct ifreq *ifr = (struct ifreq *)data;
+	struct ethercom *ec = >sc_ec;
 	uint8_t addrhi[ETHER_ADDR_LEN], addrlo[ETHER_ADDR_LEN];
-	int s, i, error = 0;
+	struct ether_multi *enm;
+	struct ether_multistep step;
+	int s, i, flags, error = 0;
 
 	s = splnet();
 	switch (cmd) {
@@ -6214,8 +6217,10 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCADDMULTI:
 		if (ether_addmulti(ifreq_getaddr(cmd, ifr), >sc_ec) == ENETRESET) {
 			error = ether_multiaddr(>ifr_addr, addrlo, addrhi);
-			if (error != 0)
+			if (error != 0) {
+splx(s);
 return (error);
+			}
 
 			for (i = 0; i < MCX_NUM_MCAST_FLOWS; i++) {
 if (sc->sc_mcast_flows[i][0] == 0) {
@@ -6238,7 +6243,7 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	error = ENETRESET;
 }
 
-if (sc->sc_ec.ec_multicnt > 0) {
+if (memcmp(addrlo, addrhi, ETHER_ADDR_LEN)) {
 	SET(ifp->if_flags, IFF_ALLMULTI);
 	error = ENETRESET;
 }
@@ -6249,8 +6254,10 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCDELMULTI:
 		if (ether_delmulti(ifreq_getaddr(cmd, ifr), >sc_ec) == ENETRESET) {
 			error = ether_multiaddr(>ifr_addr, addrlo, addrhi);
-			if (error != 0)
+			if (error != 0) {
+splx(s);
 return (error);
+			}
 
 			for (i = 0; i < MCX_NUM_MCAST_FLOWS; i++) {
 if (memcmp(sc->sc_mcast_flows[i], addrlo,
@@ -6269,10 +6276,23 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 sc->sc_extra_mcast--;
 
 			if (ISSET(ifp->if_flags, IFF_ALLMULTI) &&
-			(sc->sc_extra_mcast == 0) &&
-			(sc->sc_ec.ec_multicnt == 0)) {
-CLR(ifp->if_flags, IFF_ALLMULTI);
-error = ENETRESET;
+			sc->sc_extra_mcast == 0) {
+flags = 0;
+ETHER_LOCK(ec);
+ETHER_FIRST_MULTI(step, ec, enm);
+while (enm != NULL) {
+	if (memcmp(enm->enm_addrlo,
+	enm->enm_addrhi, ETHER_ADDR_LEN)) {
+		SET(flags, IFF_ALLMULTI);
+		break;
+	}
+	ETHER_NEXT_MULTI(step, enm);
+}
+ETHER_UNLOCK(ec);
+if (!ISSET(flags, IFF_ALLMULTI)) {
+	CLR(ifp->if_flags, IFF_ALLMULTI);
+	error = ENETRESET;
+}
 			}
 		}
 		break;



CVS commit: src/sys/dev/pci

2019-11-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Nov 26 10:33:19 UTC 2019

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

Log Message:
Fix IFF_ALLMULTI handling.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_mcx.c

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



CVS commit: [netbsd-9] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:24:43 UTC 2019

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

Log Message:
Tickets #469, #482 - #484


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.118 src/doc/CHANGES-9.0:1.1.2.119
--- src/doc/CHANGES-9.0:1.1.2.118	Mon Nov 25 17:03:50 2019
+++ src/doc/CHANGES-9.0	Tue Nov 26 08:24:43 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.118 2019/11/25 17:03:50 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.119 2019/11/26 08:24:43 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6429,3 +6429,30 @@ sys/kern/subr_cprng.c1.33
 	Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
 	[riastradh, ticket #481]
 
+lib/libc/tls/Makefile.inc			1.3
+lib/libc/tls/tls.c1.10-1.13
+libexec/ld.elf_so/Makefile			1.142
+libexec/ld.elf_so/tls.c1.13,1.14
+usr.bin/ldd/Makefile.elf			1.6
+
+	PR/54074 and PR/54093: fix static TLS allocation properly aligned.
+	[nakayama, ticket #469]
+
+sys/dev/pci/if_age.c1.63
+
+	Fix multicast handling.
+	[msaitoh, ticket #482]
+
+sys/dev/pci/if_age.c1.64
+sys/dev/pci/if_alc.c1.44
+sys/dev/pci/if_ale.c1.35,1.36
+sys/dev/pci/if_cas.c1.36
+
+	Fix a bug that IFF_ALLMULTI is almost always set.
+	[msaitoh, ticket #483]
+
+sys/dev/hyperv/if_hvn.c1.11
+
+	hvn(4): Fix incorrect ident when waiting for NVS command response.
+	[nonaka, ticket #484]
+



CVS commit: [netbsd-9] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:24:43 UTC 2019

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

Log Message:
Tickets #469, #482 - #484


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

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



CVS commit: src/sys/dev/pci

2019-11-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Nov 26 08:37:05 UTC 2019

Modified Files:
src/sys/dev/pci: files.pci if_kse.c

Log Message:
- use mii(4) layer to control KSZ8841 builtin PHY.
- handle PAUSE flow control properly according to ifconfig(8) mediaopt
  selection.
- some style knits; use aprint(9) and modernise callout(9).


To generate a diff of this commit:
cvs rdiff -u -r1.416 -r1.417 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_kse.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.416 src/sys/dev/pci/files.pci:1.417
--- src/sys/dev/pci/files.pci:1.416	Wed Nov 20 09:37:45 2019
+++ src/sys/dev/pci/files.pci	Tue Nov 26 08:37:05 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.416 2019/11/20 09:37:45 hikaru Exp $
+#	$NetBSD: files.pci,v 1.417 2019/11/26 08:37:05 nisimura Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -965,7 +965,7 @@ attach  nfe at pci
 filedev/pci/if_nfe.cnfe
 
 # MICREL Etherent
-device	kse: ether, ifnet, arp
+device	kse: ether, ifnet, arp, mii
 attach	kse at pci
 file	dev/pci/if_kse.c		kse
 

Index: src/sys/dev/pci/if_kse.c
diff -u src/sys/dev/pci/if_kse.c:1.41 src/sys/dev/pci/if_kse.c:1.42
--- src/sys/dev/pci/if_kse.c:1.41	Thu Nov  7 22:00:37 2019
+++ src/sys/dev/pci/if_kse.c	Tue Nov 26 08:37:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kse.c,v 1.41 2019/11/07 22:00:37 nisimura Exp $	*/
+/*	$NetBSD: if_kse.c,v 1.42 2019/11/26 08:37:05 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,11 +30,11 @@
  */
 
 /*
- * Micrel 8841/8842 10/100 ethernet driver
+ * Micrel 8841/8842 10/100 PCI ethernet driver
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.41 2019/11/07 22:00:37 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.42 2019/11/26 08:37:05 nisimura Exp $");
 
 #include 
 #include 
@@ -55,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -68,9 +70,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1
 #define CSR_WRITE_4(sc, off, val) \
 	bus_space_write_4(sc->sc_st, sc->sc_sh, off, val)
 #define CSR_READ_2(sc, off) \
-	bus_space_read_2(sc->sc_st, sc->sc_sh, off)
+	bus_space_read_2((sc)->sc_st, (sc)->sc_sh, (off))
 #define CSR_WRITE_2(sc, off, val) \
-	bus_space_write_2(sc->sc_st, sc->sc_sh, off, val)
+	bus_space_write_2((sc)->sc_st, (sc)->sc_sh, (off), (val))
 
 #define MDTXC	0x000	/* DMA transmit control */
 #define MDRXC	0x004	/* DMA receive control */
@@ -86,8 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1
 #define MARM	0x202	/* MAC address middle */
 #define MARH	0x204	/* MAC address high */
 #define GRR	0x216	/* global reset */
-#define CIDR	0x400	/* chip ID and enable */
-#define CGCR	0x40a	/* chip global control */
+#define SIDER	0x400	/* switch ID and function enable */
 #define IACR	0x4a0	/* indirect access control */
 #define IADR1	0x4a2	/* indirect access data 66:63 */
 #define IADR2	0x4a4	/* indirect access data 47:32 */
@@ -98,24 +99,27 @@ __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1
 #define P1SR	0x514	/* port 1 status */
 #define P2CR4	0x532	/* port 2 control 4 */
 #define P2SR	0x534	/* port 2 status */
-#define PxCR_STARTNEG	(1U << 9)	/* restart auto negotiation */
-#define PxCR_AUTOEN	(1U << 7)	/* auto negotiation enable */
-#define PxCR_SPD100	(1U << 6)	/* force speed 100 */
-#define PxCR_USEFDX	(1U << 5)	/* force full duplex */
-#define PxCR_USEFC	(1U << 4)	/* advertise pause flow control */
-#define PxSR_ACOMP	(1U << 6)	/* auto negotiation completed */
-#define PxSR_SPD100	(1U << 10)	/* speed is 100Mbps */
-#define PxSR_FDX	(1U << 9)	/* full duplex */
-#define PxSR_LINKUP	(1U << 5)	/* link is good */
-#define PxSR_RXFLOW	(1U << 12)	/* receive flow control active */
-#define PxSR_TXFLOW	(1U << 11)	/* transmit flow control active */
+#define  PxCR_STARTNEG	(1U<<9)		/* restart auto negotiation */
+#define  PxCR_AUTOEN	(1U<<7)		/* auto negotiation enable */
+#define  PxCR_SPD100	(1U<<6)		/* force speed 100 */
+#define  PxCR_USEFDX	(1U<<5)		/* force full duplex */
+#define  PxCR_USEFC	(1U<<4)		/* advertise pause flow control */
+#define  PxSR_ACOMP	(1U<<6)		/* auto negotiation completed */
+#define  PxSR_SPD100	(1U<<10)	/* speed is 100Mbps */
+#define  PxSR_FDX	(1U<<9)		/* full duplex */
+#define  PxSR_LINKUP	(1U<<5)		/* link is good */
+#define  PxSR_RXFLOW	(1U<<12)	/* receive flow control active */
+#define  PxSR_TXFLOW	(1U<<11)	/* transmit flow control active */
+#define P1VIDCR	0x504	/* port 1 vtag */
+#define P2VIDCR	0x524	/* port 2 vtag */
+#define P3VIDCR	0x544	/* 8842 host vtag */
 
 #define TXC_BS_MSK	0x3f00	/* burst size */
 #define TXC_BS_SFT	(24)		/* 1,2,4,8,16,32 or 0 for unlimited 

CVS commit: src/sys/dev/pci

2019-11-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Nov 26 08:37:05 UTC 2019

Modified Files:
src/sys/dev/pci: files.pci if_kse.c

Log Message:
- use mii(4) layer to control KSZ8841 builtin PHY.
- handle PAUSE flow control properly according to ifconfig(8) mediaopt
  selection.
- some style knits; use aprint(9) and modernise callout(9).


To generate a diff of this commit:
cvs rdiff -u -r1.416 -r1.417 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_kse.c

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



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:22:51 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-9]: if_hvn.c

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

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/sys/dev/hyperv/if_hvn.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/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.4.2.4 src/sys/dev/hyperv/if_hvn.c:1.4.2.5
--- src/sys/dev/hyperv/if_hvn.c:1.4.2.4	Mon Nov 25 16:58:54 2019
+++ src/sys/dev/hyperv/if_hvn.c	Tue Nov 26 08:22:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.4.2.4 2019/11/25 16:58:54 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.4.2.5 2019/11/26 08:22:51 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.4 2019/11/25 16:58:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.5 2019/11/26 08:22:51 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1097,7 +1097,8 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			hvn_nvs_intr(sc);
 			splx(s);
 		} else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
+			tsleep(sc->sc_nvsrsp, PRIBIO | PCATCH, "nvscmd",
+			mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:22:51 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-9]: if_hvn.c

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

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/sys/dev/hyperv/if_hvn.c

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



CVS commit: src/share/tmac

2019-11-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 26 08:38:19 UTC 2019

Modified Files:
src/share/tmac: doc2html

Log Message:
PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.

With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/share/tmac/doc2html

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



CVS commit: src/share/tmac

2019-11-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 26 08:38:19 UTC 2019

Modified Files:
src/share/tmac: doc2html

Log Message:
PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.

With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/share/tmac/doc2html

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

Modified files:

Index: src/share/tmac/doc2html
diff -u src/share/tmac/doc2html:1.67 src/share/tmac/doc2html:1.68
--- src/share/tmac/doc2html:1.67	Tue Nov 22 00:36:49 2016
+++ src/share/tmac/doc2html	Tue Nov 26 08:38:19 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: doc2html,v 1.67 2016/11/22 00:36:49 kamil Exp $
+.\" $NetBSD: doc2html,v 1.68 2019/11/26 08:38:19 kre Exp $
 .\"
 .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -788,12 +788,12 @@ AT UNIX\\$*
 .	as doc-pcresult \\*[an-eol]
 .	pc-fin
 ..
-.de Lk
-.	as doc-pcresult \\$1
-.	shift
-.	recurse \\$@
-.	pc-fin
-..
+.\".de Lk
+.\".	as doc-pcresult \\$1
+.\".	shift
+.\".	recurse \\$@
+.\".	pc-fin
+.\"..
 .de Mt
 .	as doc-pcresult \\$1
 .	shift



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.c

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.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/mii/amhphy.c
diff -u src/sys/dev/mii/amhphy.c:1.23 src/sys/dev/mii/amhphy.c:1.24
--- src/sys/dev/mii/amhphy.c:1.23	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/amhphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -200,7 +200,7 @@ amhphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.84 src/sys/dev/mii/brgphy.c:1.85
--- src/sys/dev/mii/brgphy.c:1.84	Thu Apr 11 08:50:20 2019
+++ src/sys/dev/mii/brgphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $	*/
+/*	$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -491,7 +491,7 @@ brgphy_copper_status(struct mii_softc *s
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/glxtphy.c
diff -u src/sys/dev/mii/glxtphy.c:1.29 src/sys/dev/mii/glxtphy.c:1.30
--- src/sys/dev/mii/glxtphy.c:1.29	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/glxtphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -223,7 +223,7 @@ glxtphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((qsr & QSR_ACOMP) == 0) {

Index: src/sys/dev/mii/gphyter.c
diff -u src/sys/dev/mii/gphyter.c:1.34 src/sys/dev/mii/gphyter.c:1.35
--- src/sys/dev/mii/gphyter.c:1.34	Thu Nov 21 09:48:57 2019
+++ src/sys/dev/mii/gphyter.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $	*/
+/*	$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -255,7 +255,7 @@ gphyter_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/ikphy.c
diff -u src/sys/dev/mii/ikphy.c:1.16 src/sys/dev/mii/ikphy.c:1.17
--- src/sys/dev/mii/ikphy.c:1.16	Wed Sep  4 06:28:30 2019
+++ src/sys/dev/mii/ikphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ikphy.c,v 1.16 2019/09/04 06:28:30 msaitoh Exp $	*/
+/*	$NetBSD: ikphy.c,v 1.17 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /***
 Copyright (c) 2001-2005, Intel Corporation 
@@ -59,7 +59,7 @@ POSSIBILITY OF SUCH 

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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:20:47 UTC 2019

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

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

sys/dev/pci/if_cas.c: revision 1.36
sys/dev/pci/if_alc.c: revision 1.44
sys/dev/pci/if_ale.c: revision 1.35
sys/dev/pci/if_ale.c: revision 1.36
sys/dev/pci/if_age.c: revision 1.64

Fix a bug that IFF_ALLMULTI is almost always set.
 OpenBSD's ac_multirangecnt is not NetBSD's ec_multicnt.

 Remove accidentally committed debug code. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.60.2.3 -r1.60.2.4 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.38.2.2 -r1.38.2.3 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/dev/pci/if_cas.c

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

Modified files:

Index: src/sys/dev/pci/if_age.c
diff -u src/sys/dev/pci/if_age.c:1.60.2.3 src/sys/dev/pci/if_age.c:1.60.2.4
--- src/sys/dev/pci/if_age.c:1.60.2.3	Tue Nov 26 08:18:40 2019
+++ src/sys/dev/pci/if_age.c	Tue Nov 26 08:20:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.60.2.3 2019/11/26 08:18:40 martin Exp $ */
+/*	$NetBSD: if_age.c,v 1.60.2.4 2019/11/26 08:20:47 martin Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.3 2019/11/26 08:18:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.4 2019/11/26 08:20:47 martin Exp $");
 
 #include "vlan.h"
 
@@ -2275,27 +2275,37 @@ age_rxfilter(struct age_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_LOCK(ec);
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+	ETHER_UNLOCK(ec);
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		ETHER_LOCK(ec);
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
-			ETHER_NEXT_MULTI(step, enm);
-		}
-		ETHER_UNLOCK(ec);
 	}
-
 	CSR_WRITE_4(sc, AGE_MAR0, mchash[0]);
 	CSR_WRITE_4(sc, AGE_MAR1, mchash[1]);
 	CSR_WRITE_4(sc, AGE_MAC_CFG, rxcfg);

Index: src/sys/dev/pci/if_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.38.2.2 src/sys/dev/pci/if_alc.c:1.38.2.3
--- src/sys/dev/pci/if_alc.c:1.38.2.2	Wed Nov  6 09:59:38 2019
+++ src/sys/dev/pci/if_alc.c	Tue Nov 26 08:20:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.38.2.2 2019/11/06 09:59:38 martin Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.38.2.3 2019/11/26 08:20:47 martin Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -3443,27 +3443,37 @@ alc_iff(struct alc_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_LOCK(ec);
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+	ETHER_UNLOCK(ec);
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		

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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:20:47 UTC 2019

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

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

sys/dev/pci/if_cas.c: revision 1.36
sys/dev/pci/if_alc.c: revision 1.44
sys/dev/pci/if_ale.c: revision 1.35
sys/dev/pci/if_ale.c: revision 1.36
sys/dev/pci/if_age.c: revision 1.64

Fix a bug that IFF_ALLMULTI is almost always set.
 OpenBSD's ac_multirangecnt is not NetBSD's ec_multicnt.

 Remove accidentally committed debug code. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.60.2.3 -r1.60.2.4 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.38.2.2 -r1.38.2.3 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/dev/pci/if_cas.c

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.c

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



CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:34:16 UTC 2019

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

Log Message:
Change 0x%jx -> %#jx as suggested by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/usb/if_urtwn.c

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



CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:34:16 UTC 2019

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

Log Message:
Change 0x%jx -> %#jx as suggested by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/usb/if_urtwn.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/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.74 src/sys/dev/usb/if_urtwn.c:1.75
--- src/sys/dev/usb/if_urtwn.c:1.74	Tue Nov 26 10:24:17 2019
+++ src/sys/dev/usb/if_urtwn.c	Tue Nov 26 10:34:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.75 2019/11/26 10:34:16 gson Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.75 2019/11/26 10:34:16 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -954,7 +954,7 @@ urtwn_write_region_1(struct urtwn_softc 
 	USETW(req.wLength, len);
 	error = usbd_do_request(sc->sc_udev, , buf);
 	if (error != USBD_NORMAL_COMPLETION) {
-		DPRINTFN(DBG_REG, "error=%jd: addr=0x%jx, len=%jd",
+		DPRINTFN(DBG_REG, "error=%jd: addr=%#jx, len=%jd",
 		error, addr, len, 0);
 	}
 	return error;
@@ -965,7 +965,7 @@ urtwn_write_1(struct urtwn_softc *sc, ui
 {
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	urtwn_write_region_1(sc, addr, , 1);
 }
@@ -976,7 +976,7 @@ urtwn_write_2(struct urtwn_softc *sc, ui
 	uint8_t buf[2];
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	buf[0] = (uint8_t)val;
 	buf[1] = (uint8_t)(val >> 8);
@@ -989,7 +989,7 @@ urtwn_write_4(struct urtwn_softc *sc, ui
 	uint8_t buf[4];
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	buf[0] = (uint8_t)val;
 	buf[1] = (uint8_t)(val >> 8);
@@ -1003,7 +1003,7 @@ urtwn_write_region(struct urtwn_softc *s
 {
 
 	URTWNHIST_FUNC();
-	URTWNHIST_CALLARGS("addr=0x%jx, len=0x%jx", addr, len, 0, 0);
+	URTWNHIST_CALLARGS("addr=%#jx, len=%#jx", addr, len, 0, 0);
 
 	return urtwn_write_region_1(sc, addr, buf, len);
 }
@@ -1024,7 +1024,7 @@ urtwn_read_region_1(struct urtwn_softc *
 	USETW(req.wLength, len);
 	error = usbd_do_request(sc->sc_udev, , buf);
 	if (error != USBD_NORMAL_COMPLETION) {
-		DPRINTFN(DBG_REG, "error=%jd: addr=0x%jx, len=%jd",
+		DPRINTFN(DBG_REG, "error=%jd: addr=%#jx, len=%jd",
 		error, addr, len, 0);
 	}
 	return error;
@@ -1040,7 +1040,7 @@ urtwn_read_1(struct urtwn_softc *sc, uin
 	if (urtwn_read_region_1(sc, addr, , 1) != USBD_NORMAL_COMPLETION)
 		return 0xff;
 
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1056,7 +1056,7 @@ urtwn_read_2(struct urtwn_softc *sc, uin
 		return 0x;
 
 	val = LE_READ_2([0]);
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1072,7 +1072,7 @@ urtwn_read_4(struct urtwn_softc *sc, uin
 		return 0x;
 
 	val = LE_READ_4([0]);
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1452,7 +1452,7 @@ urtwn_read_rom(struct urtwn_softc *sc)
 	sc->regulatory = MS(rom->rf_opt1, R92C_ROM_RF1_REGULATORY);
 
 	DPRINTFN(DBG_INIT,
-	"PA setting=0x%jx, board=0x%jx, regulatory=%jd",
+	"PA setting=%#jx, board=%#jx, regulatory=%jd",
 	sc->pa_setting, sc->board_type, sc->regulatory, 0);
 
 	IEEE80211_ADDR_COPY(ic->ic_myaddr, rom->macaddr);
@@ -1610,8 +1610,8 @@ urtwn_ra_init(struct urtwn_softc *sc)
 	} else {
 		mode = R92C_RAID_11BG;
 	}
-	DPRINTFN(DBG_INIT, "mode=0x%jx", mode, 0, 0, 0);
-	DPRINTFN(DBG_INIT, "rates=0x%jx, basicrates=0x%jx, "
+	DPRINTFN(DBG_INIT, "mode=%#jx", mode, 0, 0, 0);
+	DPRINTFN(DBG_INIT, "rates=%#jx, basicrates=%#jx, "
 	"maxrate=%jx, maxbasicrate=%jx",
 	rates, basicrates, maxrate, maxbasicrate);
 
@@ -3571,7 +3571,7 @@ urtwn_r92c_dma_init(struct urtwn_softc *
 	/* Get Tx queues to USB endpoints mapping. */
 	hashq = hasnq = haslq = 0;
 	reg = urtwn_read_2(sc, R92C_USB_EP + 1);
-	DPRINTFN(DBG_INIT, "USB endpoints mapping 0x%jx", reg, 0, 0, 0);
+	DPRINTFN(DBG_INIT, "USB endpoints mapping %#jx", reg, 0, 0, 0);
 	if (MS(reg, R92C_USB_EP_HQ) != 0)
 		hashq = 1;
 	if (MS(reg, R92C_USB_EP_NQ) != 0)



CVS commit: [netbsd-9] src

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:12:27 UTC 2019

Modified Files:
src/lib/libc/tls [netbsd-9]: Makefile.inc tls.c
src/libexec/ld.elf_so [netbsd-9]: Makefile tls.c
src/usr.bin/ldd [netbsd-9]: Makefile.elf

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

lib/libc/tls/tls.c: revision 1.10
lib/libc/tls/tls.c: revision 1.11
lib/libc/tls/tls.c: revision 1.12
lib/libc/tls/tls.c: revision 1.13
libexec/ld.elf_so/tls.c: revision 1.13
libexec/ld.elf_so/tls.c: revision 1.14
libexec/ld.elf_so/Makefile: revision 1.142
lib/libc/tls/Makefile.inc: revision 1.3
usr.bin/ldd/Makefile.elf: revision 1.6

PR 54093: Align static TLS area to max_align_t.
Use alignof and not size_t for platforms with non-natural base
alignments.

Mirror the ld.elf_so logic for handling aligning the TLS size.
Most noticable, recompute the start of the TLS area for variant I
relative to the TCB. This makes a difference when the segment size and
base alignment don't agree.

Fix PR/54074 and PR/54093 completely.
More similar to the ld.elf_so logic, it is necessary to align with
p_align first.  Also, invert the #ifdef condition for consistency.

Should fix regression for static linking binaries:
http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.10.23.39.03
http://releng.netbsd.org/b5reports/sparc64/commits-2019.11.html#2019.11.16.04.10.33


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.46.1 src/lib/libc/tls/Makefile.inc
cvs rdiff -u -r1.9 -r1.9.2.1 src/lib/libc/tls/tls.c
cvs rdiff -u -r1.141 -r1.141.2.1 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.12 -r1.12.2.1 src/libexec/ld.elf_so/tls.c
cvs rdiff -u -r1.5 -r1.5.30.1 src/usr.bin/ldd/Makefile.elf

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

Modified files:

Index: src/lib/libc/tls/Makefile.inc
diff -u src/lib/libc/tls/Makefile.inc:1.2 src/lib/libc/tls/Makefile.inc:1.2.46.1
--- src/lib/libc/tls/Makefile.inc:1.2	Sat Mar 12 07:55:09 2011
+++ src/lib/libc/tls/Makefile.inc	Tue Nov 26 08:12:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.2 2011/03/12 07:55:09 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.2.46.1 2019/11/26 08:12:26 martin Exp $
 
 .include 
 
@@ -6,4 +6,4 @@
 .PATH:	${.PARSEDIR} ${ARCHDIR}/tls
 
 SRCS+=			tls.c
-CPPFLAGS.tls.c+=	-D_LIBC_SOURCE
+CPPFLAGS.tls.c+=	-D_LIBC_SOURCE -std=gnu11

Index: src/lib/libc/tls/tls.c
diff -u src/lib/libc/tls/tls.c:1.9 src/lib/libc/tls/tls.c:1.9.2.1
--- src/lib/libc/tls/tls.c:1.9	Fri Jul 13 19:50:21 2018
+++ src/lib/libc/tls/tls.c	Tue Nov 26 08:12:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls.c,v 1.9 2018/07/13 19:50:21 joerg Exp $	*/
+/*	$NetBSD: tls.c,v 1.9.2.1 2019/11/26 08:12:26 martin Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: tls.c,v 1.9 2018/07/13 19:50:21 joerg Exp $");
+__RCSID("$NetBSD: tls.c,v 1.9.2.1 2019/11/26 08:12:26 martin Exp $");
 
 #include "namespace.h"
 
@@ -46,6 +46,7 @@ __RCSID("$NetBSD: tls.c,v 1.9 2018/07/13
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -84,15 +85,17 @@ _rtld_tls_allocate(void)
 	uint8_t *p;
 
 	if (initial_thread_tcb == NULL) {
-#ifdef __HAVE_TLS_VARIANT_II
-		tls_size = roundup2(tls_size, sizeof(void *));
+#ifdef __HAVE_TLS_VARIANT_I
+		tls_allocation = tls_size;
+#else
+		tls_allocation = roundup2(tls_size, alignof(max_align_t));
 #endif
-		tls_allocation = tls_size + sizeof(*tcb);
 
-		initial_thread_tcb = p = mmap(NULL, tls_allocation,
-		PROT_READ | PROT_WRITE, MAP_ANON, -1, 0);
+		initial_thread_tcb = p = mmap(NULL,
+		tls_allocation + sizeof(*tcb), PROT_READ | PROT_WRITE,
+		MAP_ANON, -1, 0);
 	} else {
-		p = calloc(1, tls_allocation);
+		p = calloc(1, tls_allocation + sizeof(*tcb));
 	}
 	if (p == NULL) {
 		static const char msg[] =  "TLS allocation failed, terminating\n";
@@ -105,7 +108,8 @@ _rtld_tls_allocate(void)
 	p += sizeof(struct tls_tcb);
 #else
 	/* LINTED tls_size is rounded above */
-	tcb = (struct tls_tcb *)(p + tls_size);
+	tcb = (struct tls_tcb *)(p + tls_allocation);
+	p = (uint8_t *)tcb - tls_size;
 	tcb->tcb_self = tcb;
 #endif
 	memcpy(p, tls_initaddr, tls_initsize);
@@ -125,10 +129,10 @@ _rtld_tls_free(struct tls_tcb *tcb)
 	p = (uint8_t *)tcb;
 #else
 	/* LINTED */
-	p = (uint8_t *)tcb - tls_size;
+	p = (uint8_t *)tcb - tls_allocation;
 #endif
 	if (p == initial_thread_tcb)
-		munmap(p, tls_allocation);
+		munmap(p, tls_allocation + sizeof(*tcb));
 	else
 		free(p);
 }
@@ -148,7 +152,11 @@ __libc_static_tls_setup_cb(struct dl_phd
 			continue;
 		tls_initaddr = (void *)(phdr->p_vaddr + data->dlpi_addr);
 		tls_initsize = phdr->p_filesz;
+#ifdef __HAVE_TLS_VARIANT_I
 		tls_size = phdr->p_memsz;
+#else
+		tls_size = roundup2(phdr->p_memsz, phdr->p_align);
+#endif
 	}
 	return 0;
 }

Index: 

CVS commit: [netbsd-9] src

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:12:27 UTC 2019

Modified Files:
src/lib/libc/tls [netbsd-9]: Makefile.inc tls.c
src/libexec/ld.elf_so [netbsd-9]: Makefile tls.c
src/usr.bin/ldd [netbsd-9]: Makefile.elf

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

lib/libc/tls/tls.c: revision 1.10
lib/libc/tls/tls.c: revision 1.11
lib/libc/tls/tls.c: revision 1.12
lib/libc/tls/tls.c: revision 1.13
libexec/ld.elf_so/tls.c: revision 1.13
libexec/ld.elf_so/tls.c: revision 1.14
libexec/ld.elf_so/Makefile: revision 1.142
lib/libc/tls/Makefile.inc: revision 1.3
usr.bin/ldd/Makefile.elf: revision 1.6

PR 54093: Align static TLS area to max_align_t.
Use alignof and not size_t for platforms with non-natural base
alignments.

Mirror the ld.elf_so logic for handling aligning the TLS size.
Most noticable, recompute the start of the TLS area for variant I
relative to the TCB. This makes a difference when the segment size and
base alignment don't agree.

Fix PR/54074 and PR/54093 completely.
More similar to the ld.elf_so logic, it is necessary to align with
p_align first.  Also, invert the #ifdef condition for consistency.

Should fix regression for static linking binaries:
http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.10.23.39.03
http://releng.netbsd.org/b5reports/sparc64/commits-2019.11.html#2019.11.16.04.10.33


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.46.1 src/lib/libc/tls/Makefile.inc
cvs rdiff -u -r1.9 -r1.9.2.1 src/lib/libc/tls/tls.c
cvs rdiff -u -r1.141 -r1.141.2.1 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.12 -r1.12.2.1 src/libexec/ld.elf_so/tls.c
cvs rdiff -u -r1.5 -r1.5.30.1 src/usr.bin/ldd/Makefile.elf

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



CVS commit: [netbsd-9] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:57:49 UTC 2019

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

Log Message:
Ticket #485


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

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



CVS commit: [netbsd-9] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:57:49 UTC 2019

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

Log Message:
Ticket #485


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.119 src/doc/CHANGES-9.0:1.1.2.120
--- src/doc/CHANGES-9.0:1.1.2.119	Tue Nov 26 08:24:43 2019
+++ src/doc/CHANGES-9.0	Tue Nov 26 08:57:49 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.119 2019/11/26 08:24:43 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.120 2019/11/26 08:57:49 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6456,3 +6456,9 @@ sys/dev/hyperv/if_hvn.c1.11
 	hvn(4): Fix incorrect ident when waiting for NVS command response.
 	[nonaka, ticket #484]
 
+share/tmac/doc2html1.68
+
+	PR toolchain/54715: Remove duplicate (incorrect) version of
+	the .Lk macro.
+	[kre, ticket #485]
+



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:56:51 UTC 2019

Modified Files:
src/share/tmac [netbsd-9]: doc2html

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

share/tmac/doc2html: revision 1.68

PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.
With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.16.1 src/share/tmac/doc2html

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.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/mii/jmphy.c
diff -u src/sys/dev/mii/jmphy.c:1.1 src/sys/dev/mii/jmphy.c:1.2
--- src/sys/dev/mii/jmphy.c:1.1	Wed Oct 30 12:06:26 2019
+++ src/sys/dev/mii/jmphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: jmphy.c,v 1.1 2019/10/30 12:06:26 msaitoh Exp $ */
+/*	$NetBSD: jmphy.c,v 1.2 2019/11/26 08:19:51 msaitoh Exp $ */
 /*	$OpenBSD: jmphy.c,v 1.6 2015/03/14 03:38:48 jsg Exp $	*/
 /*-
  * Copyright (c) 2008, Pyun YongHyeon 
@@ -127,9 +127,7 @@ jmphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -145,9 +143,7 @@ jmphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -156,21 +152,15 @@ jmphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 
-		/*
-		 * Is the interface even up?
-		 */
+		/* Is the interface even up? */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return 0;
 
-		/*
-		 * Only used for autonegotiation.
-		 */
+		/* Only used for autonegotiation. */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
 			break;
 

Index: src/sys/dev/mii/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.60 src/sys/dev/mii/makphy.c:1.61
--- src/sys/dev/mii/makphy.c:1.60	Wed Jul  3 17:40:29 2019
+++ src/sys/dev/mii/makphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $	*/
+/*	$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -240,9 +240,7 @@ makphy_reset(struct mii_softc *sc)
 
 	mii_phy_reset(sc);
 
-	/*
-	 * Initialize PHY Specific Control Register.
-	 */
+	/* Initialize PHY Specific Control Register. */
 	PHY_READ(sc, MAKPHY_PSCR, );
 
 	/* Assert CRS on transmit. */

Index: src/sys/dev/mii/qsphy.c
diff -u src/sys/dev/mii/qsphy.c:1.52 src/sys/dev/mii/qsphy.c:1.53
--- src/sys/dev/mii/qsphy.c:1.52	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/qsphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -147,9 +147,7 @@ qsphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -165,9 +163,7 @@ qsphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -175,9 +171,7 @@ qsphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:18:40 UTC 2019

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

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

sys/dev/pci/if_age.c: revision 1.63

Fix multicast handling. All Atheros controllers use big-endian form
when computing multicast hash. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.60.2.2 -r1.60.2.3 src/sys/dev/pci/if_age.c

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

Modified files:

Index: src/sys/dev/pci/if_age.c
diff -u src/sys/dev/pci/if_age.c:1.60.2.2 src/sys/dev/pci/if_age.c:1.60.2.3
--- src/sys/dev/pci/if_age.c:1.60.2.2	Wed Nov  6 09:59:39 2019
+++ src/sys/dev/pci/if_age.c	Tue Nov 26 08:18:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.60.2.2 2019/11/06 09:59:39 martin Exp $ */
+/*	$NetBSD: if_age.c,v 1.60.2.3 2019/11/26 08:18:40 martin Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.2 2019/11/06 09:59:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.3 2019/11/26 08:18:40 martin Exp $");
 
 #include "vlan.h"
 
@@ -2289,7 +2289,7 @@ age_rxfilter(struct age_softc *sc)
 		ETHER_LOCK(ec);
 		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
-			crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
+			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
 			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 			ETHER_NEXT_MULTI(step, enm);
 		}



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:18:40 UTC 2019

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

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

sys/dev/pci/if_age.c: revision 1.63

Fix multicast handling. All Atheros controllers use big-endian form
when computing multicast hash. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.60.2.2 -r1.60.2.3 src/sys/dev/pci/if_age.c

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



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:56:51 UTC 2019

Modified Files:
src/share/tmac [netbsd-9]: doc2html

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

share/tmac/doc2html: revision 1.68

PR toolchain/54715

Remove duplicate (incorrect) version of the .Lk macro, so the
earlier (fancier and functional) definition survives.

For now simply comment it out.  Sometime later this one should be
removed - but the two have been present since these macros were
first imported (1999) so leaving this visible (but removed) a
little longer shouldn't hurt.

I (believe) this one is the only duplicate of this form.
With this change the Lk macro in doc2html should work as it is designed
(but does not call other macros, and can only have punctuation following
the URL and (optional) anchor args (2nd arg is the anchor if it isn't
punctuation).

Tested by martin@


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.16.1 src/share/tmac/doc2html

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

Modified files:

Index: src/share/tmac/doc2html
diff -u src/share/tmac/doc2html:1.67 src/share/tmac/doc2html:1.67.16.1
--- src/share/tmac/doc2html:1.67	Tue Nov 22 00:36:49 2016
+++ src/share/tmac/doc2html	Tue Nov 26 08:56:51 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: doc2html,v 1.67 2016/11/22 00:36:49 kamil Exp $
+.\" $NetBSD: doc2html,v 1.67.16.1 2019/11/26 08:56:51 martin Exp $
 .\"
 .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -788,12 +788,12 @@ AT UNIX\\$*
 .	as doc-pcresult \\*[an-eol]
 .	pc-fin
 ..
-.de Lk
-.	as doc-pcresult \\$1
-.	shift
-.	recurse \\$@
-.	pc-fin
-..
+.\".de Lk
+.\".	as doc-pcresult \\$1
+.\".	shift
+.\".	recurse \\$@
+.\".	pc-fin
+.\"..
 .de Mt
 .	as doc-pcresult \\$1
 .	shift



CVS commit: src/sys/fs/autofs

2019-11-26 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Tue Nov 26 16:17:31 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Use NULLVP for NULL vnode

I originally used NULL for NetBSD autofs, but it got mixed up with
NULLVP when merged with NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vnops.c

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



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 18:30:57 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_mcx.c

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

sys/dev/pci/if_mcx.c: revision 1.7

Fix IFF_ALLMULTI handling.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/dev/pci/if_mcx.c

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



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

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 18:30:57 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_mcx.c

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

sys/dev/pci/if_mcx.c: revision 1.7

Fix IFF_ALLMULTI handling.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.1.2.5 src/sys/dev/pci/if_mcx.c:1.1.2.6
--- src/sys/dev/pci/if_mcx.c:1.1.2.5	Mon Nov 18 19:46:33 2019
+++ src/sys/dev/pci/if_mcx.c	Tue Nov 26 18:30:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.1.2.5 2019/11/18 19:46:33 martin Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.1.2.6 2019/11/26 18:30:57 martin Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 
 /*
@@ -6205,8 +6205,11 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 {
 	struct mcx_softc *sc = (struct mcx_softc *)ifp->if_softc;
 	struct ifreq *ifr = (struct ifreq *)data;
+	struct ethercom *ec = >sc_ec;
 	uint8_t addrhi[ETHER_ADDR_LEN], addrlo[ETHER_ADDR_LEN];
-	int s, i, error = 0;
+	struct ether_multi *enm;
+	struct ether_multistep step;
+	int s, i, flags, error = 0;
 
 	s = splnet();
 	switch (cmd) {
@@ -6214,8 +6217,10 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCADDMULTI:
 		if (ether_addmulti(ifreq_getaddr(cmd, ifr), >sc_ec) == ENETRESET) {
 			error = ether_multiaddr(>ifr_addr, addrlo, addrhi);
-			if (error != 0)
+			if (error != 0) {
+splx(s);
 return (error);
+			}
 
 			for (i = 0; i < MCX_NUM_MCAST_FLOWS; i++) {
 if (sc->sc_mcast_flows[i][0] == 0) {
@@ -6238,7 +6243,7 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	error = ENETRESET;
 }
 
-if (sc->sc_ec.ec_multicnt > 0) {
+if (memcmp(addrlo, addrhi, ETHER_ADDR_LEN)) {
 	SET(ifp->if_flags, IFF_ALLMULTI);
 	error = ENETRESET;
 }
@@ -6249,8 +6254,10 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCDELMULTI:
 		if (ether_delmulti(ifreq_getaddr(cmd, ifr), >sc_ec) == ENETRESET) {
 			error = ether_multiaddr(>ifr_addr, addrlo, addrhi);
-			if (error != 0)
+			if (error != 0) {
+splx(s);
 return (error);
+			}
 
 			for (i = 0; i < MCX_NUM_MCAST_FLOWS; i++) {
 if (memcmp(sc->sc_mcast_flows[i], addrlo,
@@ -6269,10 +6276,23 @@ mcx_ioctl(struct ifnet *ifp, u_long cmd,
 sc->sc_extra_mcast--;
 
 			if (ISSET(ifp->if_flags, IFF_ALLMULTI) &&
-			(sc->sc_extra_mcast == 0) &&
-			(sc->sc_ec.ec_multicnt == 0)) {
-CLR(ifp->if_flags, IFF_ALLMULTI);
-error = ENETRESET;
+			sc->sc_extra_mcast == 0) {
+flags = 0;
+ETHER_LOCK(ec);
+ETHER_FIRST_MULTI(step, ec, enm);
+while (enm != NULL) {
+	if (memcmp(enm->enm_addrlo,
+	enm->enm_addrhi, ETHER_ADDR_LEN)) {
+		SET(flags, IFF_ALLMULTI);
+		break;
+	}
+	ETHER_NEXT_MULTI(step, enm);
+}
+ETHER_UNLOCK(ec);
+if (!ISSET(flags, IFF_ALLMULTI)) {
+	CLR(ifp->if_flags, IFF_ALLMULTI);
+	error = ENETRESET;
+}
 			}
 		}
 		break;



CVS commit: src/sys/fs/autofs

2019-11-26 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Tue Nov 26 16:17:31 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Use NULLVP for NULL vnode

I originally used NULL for NetBSD autofs, but it got mixed up with
NULLVP when merged with NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_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/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.7 src/sys/fs/autofs/autofs_vfsops.c:1.8
--- src/sys/fs/autofs/autofs_vfsops.c:1.7	Sat Nov 23 15:17:46 2019
+++ src/sys/fs/autofs/autofs_vfsops.c	Tue Nov 26 16:17:31 2019
@@ -33,7 +33,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.7 2019/11/23 15:17:46 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.8 2019/11/26 16:17:31 tkusumi Exp $");
 
 
 #include "autofs.h"
@@ -273,7 +273,7 @@ autofs_root(struct mount *mp, struct vno
 	error = vn_lock(*vpp, LK_EXCLUSIVE);
 	if (error) {
 		vrele(*vpp);
-		*vpp = NULL;
+		*vpp = NULLVP;
 		return error;
 	}
 

Index: src/sys/fs/autofs/autofs_vnops.c
diff -u src/sys/fs/autofs/autofs_vnops.c:1.3 src/sys/fs/autofs/autofs_vnops.c:1.4
--- src/sys/fs/autofs/autofs_vnops.c:1.3	Sat Nov 23 17:13:46 2019
+++ src/sys/fs/autofs/autofs_vnops.c	Tue Nov 26 16:17:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $	*/
+/*	$NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $	*/
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
  * Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $");
 
 #include "autofs.h"
 
@@ -87,7 +87,7 @@ autofs_getattr(void *v)
 	if (autofs_mount_on_stat &&
 	autofs_cached(anp, NULL, 0) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		int error = autofs_trigger_vn(vp, "", 0, );
 		if (error)
 			return error;
@@ -171,7 +171,7 @@ mounted:
 		return error;
 
 	if (!vp->v_mountedhere) {
-		*newvp = NULL;
+		*newvp = NULLVP;
 		return 0;
 	} else {
 		/*
@@ -212,7 +212,7 @@ autofs_lookup(void *v)
 	KASSERT(VOP_ISLOCKED(dvp));
 
 	anp = VTOI(dvp);
-	*vpp = NULL;
+	*vpp = NULLVP;
 
 	/* Check accessibility of directory. */
 	KASSERT(!VOP_ACCESS(dvp, VEXEC, cnp->cn_cred));
@@ -259,7 +259,7 @@ autofs_lookup(void *v)
 
 	if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		error = autofs_trigger_vn(dvp, cnp->cn_nameptr, cnp->cn_namelen,
 		);
 		if (error)
@@ -468,7 +468,7 @@ autofs_readdir(void *v)
 
 	if (autofs_cached(anp, NULL, 0) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		error = autofs_trigger_vn(vp, "", 0, );
 		if (error)
 			return error;
@@ -578,7 +578,7 @@ autofs_reclaim(void *v)
 	 * We do not free autofs_node here; instead we are
 	 * destroying them in autofs_node_delete().
 	 */
-	anp->an_vnode = NULL;
+	anp->an_vnode = NULLVP;
 	vp->v_data = NULL;
 
 	return 0;
@@ -630,7 +630,7 @@ autofs_node_new(struct autofs_node *pare
 	getnanotime(>an_ctime);
 	anp->an_parent = parent;
 	anp->an_mount = amp;
-	anp->an_vnode = NULL;
+	anp->an_vnode = NULLVP;
 	anp->an_cached = false;
 	anp->an_wildcards = false;
 	anp->an_retries = 0;



CVS commit: [netbsd-9] src/doc

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 18:31:55 UTC 2019

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

Log Message:
Ticket #486


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

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



CVS commit: src/external/mpl/bind

2019-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 27 05:48:43 UTC 2019

Modified Files:
src/external/mpl/bind: bind2netbsd
src/external/mpl/bind/dist: configure
src/external/mpl/bind/dist/bin/check: check-tool.c
src/external/mpl/bind/dist/bin/delv: delv.c
src/external/mpl/bind/dist/bin/dig: dighost.c host.c nslookup.c
src/external/mpl/bind/dist/bin/dnssec: dnssec-dsfromkey.c
dnssec-importkey.c dnssec-signzone.c
src/external/mpl/bind/dist/bin/named: config.c main.c server.c
statschannel.c zoneconf.c
src/external/mpl/bind/dist/bin/named/include/named: globals.h
src/external/mpl/bind/dist/bin/named/win32: os.c
src/external/mpl/bind/dist/bin/nsupdate: nsupdate.c
src/external/mpl/bind/dist/bin/tests/optional: zone_test.c
src/external/mpl/bind/dist/bin/tests/system/dlzexternal: driver.c
src/external/mpl/bind/dist/bin/tests/system/dyndb/driver: syncptr.c
src/external/mpl/bind/dist/doc/arm: Bv9ARM.pdf
src/external/mpl/bind/dist/lib/bind9: check.c
src/external/mpl/bind/dist/lib/dns: acl.c adb.c client.c dnsrps.c
ecdb.c geoip2.c gssapi_link.c journal.c lookup.c masterdump.c
message.c name.c nsec3.c nta.c openssldh_link.c opensslrsa_link.c
order.c rbt.c rbtdb.c rcode.c rdata.c rdatalist.c rdataset.c
resolver.c rrl.c sdb.c sdlz.c spnego_asn1.c tkey.c tsig.c ttl.c
update.c validator.c view.c zone.c zoneverify.c
src/external/mpl/bind/dist/lib/dns/include/dns: acl.h name.h tsig.h
src/external/mpl/bind/dist/lib/dns/rdata/any_255: tsig_250.c
src/external/mpl/bind/dist/lib/dns/rdata/ch_3: a_1.c
src/external/mpl/bind/dist/lib/dns/rdata/generic: afsdb_18.c avc_258.c
caa_257.c cds_59.c cert_37.c cname_5.c csync_62.c dlv_32769.c
dname_39.c doa_259.c ds_43.c eui48_108.c eui64_109.c gpos_27.c
hinfo_13.c hip_55.c ipseckey_45.c isdn_20.c key_25.c
keydata_65533.c l32_105.c l64_106.c loc_29.c lp_107.c mb_7.c md_3.c
mf_4.c mg_8.c minfo_14.c mr_9.c mx_15.c naptr_35.c nid_104.c
ninfo_56.c ns_2.c nsec3_50.c nsec3param_51.c nsec_47.c null_10.c
nxt_30.c openpgpkey_61.c opt_41.c proforma.c ptr_12.c rp_17.c
rrsig_46.c rt_21.c sig_24.c sink_40.c smimea_53.c soa_6.c spf_99.c
sshfp_44.c ta_32768.c talink_58.c tkey_249.c tlsa_52.c txt_16.c
uri_256.c x25_19.c
src/external/mpl/bind/dist/lib/dns/rdata/hs_4: a_1.c
src/external/mpl/bind/dist/lib/dns/rdata/in_1: a6_38.c a_1.c _28.c
apl_42.c atma_34.c dhcid_49.c eid_31.c kx_36.c nimloc_32.c
nsap-ptr_23.c nsap_22.c px_26.c srv_33.c wks_11.c
src/external/mpl/bind/dist/lib/dns/tests: dnstap_test.c dnstest.c
master_test.c rbt_serialize_test.c
src/external/mpl/bind/dist/lib/isc: buffer.c pk11.c result.c sockaddr.c
stats.c task.c
src/external/mpl/bind/dist/lib/isc/include/isc: result.h stats.h
types.h util.h
src/external/mpl/bind/dist/lib/isc/tests: hmac_test.c ht_test.c
md_test.c mem_test.c random_test.c
src/external/mpl/bind/dist/lib/isc/unix: meminfo.c net.c resource.c
socket.c
src/external/mpl/bind/dist/lib/isc/win32: app.c socket.c
src/external/mpl/bind/dist/lib/isccfg: aclconf.c parser.c
src/external/mpl/bind/dist/lib/ns: client.c interfacemgr.c query.c
stats.c update.c
src/external/mpl/bind/dist/lib/ns/include/ns: client.h stats.h
src/external/mpl/bind/dist/lib/samples: nsprobe.c
src/external/mpl/bind/include: config.h
Removed Files:
src/external/mpl/bind/dist/bin/tests/system/checkzone/zones:
.gitattributes
src/external/mpl/bind/dist/doc/arm: notes-bug-fixes.xml
notes-new-features.xml notes-sec-fixes.xml

Log Message:
merge bind 9.14.8


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/bind2netbsd
cvs rdiff -u -r1.7 -r1.8 src/external/mpl/bind/dist/configure
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/bind/dist/bin/check/check-tool.c
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/bin/delv/delv.c
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/bind/dist/bin/dig/dighost.c
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/bind/dist/bin/dig/host.c
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/bin/dig/nslookup.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/mpl/bind/dist/bin/dnssec/dnssec-dsfromkey.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/mpl/bind/dist/bin/dnssec/dnssec-importkey.c \
src/external/mpl/bind/dist/bin/dnssec/dnssec-signzone.c
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/bind/dist/bin/named/config.c \
src/external/mpl/bind/dist/bin/named/main.c
cvs rdiff -u -r1.8 -r1.9 src/external/mpl/bind/dist/bin/named/server.c
cvs rdiff -u -r1.5 -r1.6 

CVS commit: src/sys/arch/x86

2019-11-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Nov 27 06:24:33 UTC 2019

Modified Files:
src/sys/arch/x86/include: cpu.h fpu.h
src/sys/arch/x86/x86: cpu.c fpu.c

Log Message:
Add a small API for in-kernel FPU operations.

fpu_kern_enter();
/* do FPU stuff */
fpu_kern_leave();


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/x86/fpu.c

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

Modified files:

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.113 src/sys/arch/x86/include/cpu.h:1.114
--- src/sys/arch/x86/include/cpu.h:1.113	Sat Nov 23 19:40:37 2019
+++ src/sys/arch/x86/include/cpu.h	Wed Nov 27 06:24:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.113 2019/11/23 19:40:37 ad Exp $	*/
+/*	$NetBSD: cpu.h,v 1.114 2019/11/27 06:24:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -139,6 +139,8 @@ struct cpu_info {
 	uintptr_t ci_pmap_data[64 / sizeof(uintptr_t)];
 	struct kcpuset *ci_tlb_cpuset;
 
+	int ci_kfpu_spl;
+
 #ifndef XENPV
 	struct intrsource *ci_isources[MAX_INTR_SOURCES];
 #endif

Index: src/sys/arch/x86/include/fpu.h
diff -u src/sys/arch/x86/include/fpu.h:1.19 src/sys/arch/x86/include/fpu.h:1.20
--- src/sys/arch/x86/include/fpu.h:1.19	Sat Oct 12 06:31:03 2019
+++ src/sys/arch/x86/include/fpu.h	Wed Nov 27 06:24:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.h,v 1.19 2019/10/12 06:31:03 maxv Exp $	*/
+/*	$NetBSD: fpu.h,v 1.20 2019/11/27 06:24:33 maxv Exp $	*/
 
 #ifndef	_X86_FPU_H_
 #define	_X86_FPU_H_
@@ -30,6 +30,9 @@ void fpu_sigreset(struct lwp *);
 void fpu_lwp_fork(struct lwp *, struct lwp *);
 void fpu_lwp_abandon(struct lwp *l);
 
+void fpu_kern_enter(void);
+void fpu_kern_leave(void);
+
 void process_write_fpregs_xmm(struct lwp *, const struct fxsave *);
 void process_write_fpregs_s87(struct lwp *, const struct save87 *);
 

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.176 src/sys/arch/x86/x86/cpu.c:1.177
--- src/sys/arch/x86/x86/cpu.c:1.176	Sat Nov 23 19:40:37 2019
+++ src/sys/arch/x86/x86/cpu.c	Wed Nov 27 06:24:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.176 2019/11/23 19:40:37 ad Exp $	*/
+/*	$NetBSD: cpu.c,v 1.177 2019/11/27 06:24:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.176 2019/11/23 19:40:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.177 2019/11/27 06:24:33 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -376,6 +376,7 @@ cpu_attach(device_t parent, device_t sel
 	ci->ci_acpiid = caa->cpu_id;
 	ci->ci_cpuid = caa->cpu_number;
 	ci->ci_func = caa->cpu_func;
+	ci->ci_kfpu_spl = -1;
 	aprint_normal("\n");
 
 	/* Must be before mi_cpu_attach(). */

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.59 src/sys/arch/x86/x86/fpu.c:1.60
--- src/sys/arch/x86/x86/fpu.c:1.59	Wed Oct 30 16:32:04 2019
+++ src/sys/arch/x86/x86/fpu.c	Wed Nov 27 06:24:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.59 2019/10/30 16:32:04 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.60 2019/11/27 06:24:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.59 2019/10/30 16:32:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.60 2019/11/27 06:24:33 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -146,14 +146,9 @@ fpu_lwp_area(struct lwp *l)
 	return area;
 }
 
-/*
- * Bring curlwp's FPU state in memory. It will get installed back in the CPU
- * when returning to userland.
- */
-void
-fpu_save(void)
+static inline void
+fpu_save_lwp(struct lwp *l)
 {
-	struct lwp *l = curlwp;
 	struct pcb *pcb = lwp_getpcb(l);
 	union savefpu *area = >pcb_savefpu;
 
@@ -166,6 +161,16 @@ fpu_save(void)
 	kpreempt_enable();
 }
 
+/*
+ * Bring curlwp's FPU state in memory. It will get installed back in the CPU
+ * when returning to userland.
+ */
+void
+fpu_save(void)
+{
+	fpu_save_lwp(curlwp);
+}
+
 void
 fpuinit(struct cpu_info *ci)
 {
@@ -338,6 +343,45 @@ fpu_lwp_abandon(struct lwp *l)
 
 /* -- */
 
+void
+fpu_kern_enter(void)
+{
+	struct lwp *l = curlwp;
+	struct cpu_info *ci;
+	int s;
+
+	s = splhigh();
+
+	ci = curcpu();
+	KASSERT(ci->ci_kfpu_spl == -1);
+	ci->ci_kfpu_spl = s;
+
+	/*
+	 * If we are in a softint and have a pinned lwp, the fpu state is that
+	 * of the pinned lwp, so save it there.
+	 */
+	if ((l->l_pflag & LP_INTR) && (l->l_switchto != NULL)) {
+		fpu_save_lwp(l->l_switchto);
+	} else {
+		fpu_save_lwp(l);
+	}
+}
+
+void
+fpu_kern_leave(void)
+{
+	struct 

CVS commit: src/sys/arch/x86

2019-11-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Nov 27 06:24:33 UTC 2019

Modified Files:
src/sys/arch/x86/include: cpu.h fpu.h
src/sys/arch/x86/x86: cpu.c fpu.c

Log Message:
Add a small API for in-kernel FPU operations.

fpu_kern_enter();
/* do FPU stuff */
fpu_kern_leave();


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/x86/fpu.c

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



CVS commit: src/doc

2019-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 27 05:50:26 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind (tcp DoS security fix)


To generate a diff of this commit:
cvs rdiff -u -r1.1670 -r1.1671 src/doc/3RDPARTY
cvs rdiff -u -r1.2616 -r1.2617 src/doc/CHANGES

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



CVS commit: src/doc

2019-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 27 05:50:26 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind (tcp DoS security fix)


To generate a diff of this commit:
cvs rdiff -u -r1.1670 -r1.1671 src/doc/3RDPARTY
cvs rdiff -u -r1.2616 -r1.2617 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1670 src/doc/3RDPARTY:1.1671
--- src/doc/3RDPARTY:1.1670	Wed Nov 13 05:52:40 2019
+++ src/doc/3RDPARTY	Wed Nov 27 00:50:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1670 2019/11/13 10:52:40 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1671 2019/11/27 05:50:26 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -120,8 +120,8 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.14.7/MPL
-Current Vers:	9.14.7/MPL
+Version:	9.14.8/MPL
+Current Vers:	9.14.8/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2616 src/doc/CHANGES:1.2617
--- src/doc/CHANGES:1.2616	Tue Nov 26 02:17:42 2019
+++ src/doc/CHANGES	Wed Nov 27 00:50:26 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2616 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2617 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -73,3 +73,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		Atom C2XXX, C3XXX, Xeon D-21XX and D-15XX, C62X chipsets and
 		QuickAssist Adapter 8960/8970.
 		[hikaru 20191120]
+	bind: Import version 9.14.8. [christos 20191127]



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:45:54 UTC 2019

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

Log Message:
- Add Xeon D-1500 NTB-secondary
- Add Xeon D NS QuickData DMA channel 0-7


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

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



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:45:54 UTC 2019

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

Log Message:
- Add Xeon D-1500 NTB-secondary
- Add Xeon D NS QuickData DMA channel 0-7


To generate a diff of this commit:
cvs rdiff -u -r1.1391 -r1.1392 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.1391 src/sys/dev/pci/pcidevs:1.1392
--- src/sys/dev/pci/pcidevs:1.1391	Thu Nov 14 09:10:41 2019
+++ src/sys/dev/pci/pcidevs	Wed Nov 27 03:45:54 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1391 2019/11/14 09:10:41 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1392 2019/11/27 03:45:54 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4995,6 +4995,7 @@ product INTEL XEOND_PCIE_9	0x6f0a	Core i
 product INTEL XEOND_PCIE_10	0x6f0b	Core i7-6xxxK/Xeon-D PCIe Root Port (x16, x8 or x4 max)
 product INTEL XEOND_PCIE_NTBNTB	0x6f0d	Xeon-D PCIe Root Port NTB-NTB
 product INTEL XEOND_PCIE_NTBRP	0x6f0e	Xeon-D PCIe Root Port NTB-RP
+product INTEL XEOND_PCIE_NTB2ND	0x6f0f	Xeon-D PCIe Root Port NTB-secondary
 product INTEL XEOND_IIO_DEBUG_0	0x6f10	Xeon-D IIO Debug
 product INTEL XEOND_IIO_DEBUG_1	0x6f11	Xeon-D IIO Debug
 product INTEL XEOND_IIO_DEBUG_2	0x6f12	Xeon-D IIO Debug
@@ -5011,7 +5012,15 @@ product INTEL XEOND_IIO_DEBUG_12 0x6f1c	
 product INTEL XEOND_R2_0	0x6f1d	Xeon-D R2 PCIe Agent
 product INTEL XEOND_UBOX_0	0x6f1e	Core i7-6xxxK/Xeon-D Ubox
 product INTEL XEOND_UBOX_1	0x6f1f	Core i7-6xxxK/Xeon-D Ubox
-product INTEL XEOND_ADDRMAP	0x6f28	Core i7-6xxxK/Xeon-D IIO Address Map, VTD_Misc, System Management
+product INTEL XEONDNS_QD_0	0x6f20	Xeon-D NS QuickData DMA Channel 0
+product INTEL XEONDNS_QD_1	0x6f21	Xeon-D NS QuickData DMA Channel 1
+product INTEL XEONDNS_QD_2	0x6f22	Xeon-D NS QuickData DMA Channel 2
+product INTEL XEONDNS_QD_3	0x6f23	Xeon-D NS QuickData DMA Channel 3
+product INTEL XEONDNS_QD_4	0x6f24	Xeon-D NS QuickData DMA Channel 4
+product INTEL XEONDNS_QD_5	0x6f25	Xeon-D NS QuickData DMA Channel 5
+product INTEL XEONDNS_QD_6	0x6f26	Xeon-D NS QuickData DMA Channel 6
+product INTEL XEONDNS_QD_7	0x6f27	Xeon-D NS QuickData DMA Channel 7
+product INTEL XEONDNS_ADDRMAP	0x6f28	Core i7-6xxxK/Xeon-D IIO Address Map, VTD_Misc, System Management
 product INTEL XEOND_HOTPLUG	0x6f29	Xeon-D IIO Hot Plug
 product INTEL XEOND_RAS		0x6f2a	Core i7-6xxxK/Xeon-D IIO RAS, Control Status, Global Errors
 product INTEL XEOND_IOAPIC_2	0x6f2c	Core i7-6xxxK/Xeon-D I/O APIC



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:47:06 UTC 2019

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

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1379 -r1.1380 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1378 -r1.1379 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.



CVS commit: src/sys

2019-11-26 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Nov 27 07:26:08 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imxgpio.c
src/sys/arch/arm/imx/fdt: imx6_gpio.c
src/sys/dev/spi: spi.c spivar.h

Log Message:
Remove GPIO driver attach defer.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imxgpio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_gpio.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/spi/spivar.h

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



CVS commit: src/sys

2019-11-26 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Nov 27 07:26:08 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imxgpio.c
src/sys/arch/arm/imx/fdt: imx6_gpio.c
src/sys/dev/spi: spi.c spivar.h

Log Message:
Remove GPIO driver attach defer.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imxgpio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_gpio.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/spi/spivar.h

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

Modified files:

Index: src/sys/arch/arm/imx/imxgpio.c
diff -u src/sys/arch/arm/imx/imxgpio.c:1.6 src/sys/arch/arm/imx/imxgpio.c:1.7
--- src/sys/arch/arm/imx/imxgpio.c:1.6	Wed Jul 24 12:33:18 2019
+++ src/sys/arch/arm/imx/imxgpio.c	Wed Nov 27 07:26:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxgpio.c,v 1.6 2019/07/24 12:33:18 hkenken Exp $ */
+/*	$NetBSD: imxgpio.c,v 1.7 2019/11/27 07:26:08 hkenken Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imxgpio.c,v 1.6 2019/07/24 12:33:18 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxgpio.c,v 1.7 2019/11/27 07:26:08 hkenken Exp $");
 
 #define	_INTR_PRIVATE
 
@@ -288,40 +288,37 @@ imxgpio_pin_ctl(void *arg, int pin, int 
 }
 
 static void
-gpio_defer(device_t self)
+imxgpio_attach_ports(struct imxgpio_softc *gpio)
 {
-	struct imxgpio_softc * const gpio = device_private(self);
 	struct gpio_chipset_tag * const gp = >gpio_chipset;
 	struct gpiobus_attach_args gba;
-	gpio_pin_t *pins;
-	uint32_t mask, dir, value;
-	int pin;
+	uint32_t dir;
+	u_int pin;
 
 	gp->gp_cookie = gpio;
 	gp->gp_pin_read = imxgpio_pin_read;
 	gp->gp_pin_write = imxgpio_pin_write;
 	gp->gp_pin_ctl = imxgpio_pin_ctl;
 
-	gba.gba_gc = gp;
-	gba.gba_pins = gpio->gpio_pins;
-	gba.gba_npins = __arraycount(gpio->gpio_pins);
-
 	dir = GPIO_READ(gpio, GPIO_DIR);
-	value = GPIO_READ(gpio, GPIO_DR);
-	for (pin = 0, mask = 1, pins = gpio->gpio_pins;
-	 pin < 32; pin++, mask <<= 1, pins++) {
+	for (pin = 0; pin < __arraycount(gpio->gpio_pins); pin++) {
+		uint32_t mask = __BIT(pin);
+		gpio_pin_t *pins = >gpio_pins[pin];
 		pins->pin_num = pin;
 		if ((gpio->gpio_edge_mask | gpio->gpio_level_mask) & mask)
 			pins->pin_caps = GPIO_PIN_INPUT;
 		else
-			pins->pin_caps = GPIO_PIN_INPUT|GPIO_PIN_OUTPUT;
+			pins->pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT;
 		pins->pin_flags =
 		(dir & mask) ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT;
-		pins->pin_state =
-		(value & mask) ? GPIO_PIN_HIGH : GPIO_PIN_LOW;
+		pins->pin_state = imxgpio_pin_read(gpio, pin);
 	}
 
-	config_found_ia(self, "gpiobus", , gpiobus_print);
+	memset(, 0, sizeof(gba));
+	gba.gba_gc = gp;
+	gba.gba_pins = gpio->gpio_pins;
+	gba.gba_npins = __arraycount(gpio->gpio_pins);
+	config_found_ia(gpio->gpio_dev, "gpiobus", , gpiobus_print);
 }
 #endif /* NGPIO > 0 */
 
@@ -351,7 +348,7 @@ imxgpio_attach_common(device_t self)
 	imxgpio_handles[gpio->gpio_unit] = gpio;
 
 #if NGPIO > 0
-	config_interrupts(self, gpio_defer);
+	imxgpio_attach_ports(gpio);
 #endif
 }
 

Index: src/sys/arch/arm/imx/fdt/imx6_gpio.c
diff -u src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.3 src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.4
--- src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.3	Sun Nov 24 11:07:19 2019
+++ src/sys/arch/arm/imx/fdt/imx6_gpio.c	Wed Nov 27 07:26:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_gpio.c,v 1.3 2019/11/24 11:07:19 skrll Exp $	*/
+/*	$NetBSD: imx6_gpio.c,v 1.4 2019/11/27 07:26:08 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_gpio.c,v 1.3 2019/11/24 11:07:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_gpio.c,v 1.4 2019/11/27 07:26:08 hkenken Exp $");
 
 #include "opt_fdt.h"
 #include "gpio.h"
@@ -123,8 +123,8 @@ imxgpio_attach(device_t parent, device_t
 		aprint_error_dev(self, "failed to decode interrupt\n");
 		return;
 	}
-	sc->gpio_is = fdtbus_intr_establish(phandle, 0, IPL_HIGH,
-	FDT_INTR_MPSAFE, pic_handle_intr, >gpio_pic);
+	sc->gpio_is = fdtbus_intr_establish(phandle, 0, IPL_HIGH, 0,
+	pic_handle_intr, >gpio_pic);
 	if (sc->gpio_is == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt on %s\n",
 		intrstr);
@@ -136,8 +136,8 @@ imxgpio_attach(device_t parent, device_t
 		aprint_error_dev(self, "failed to decode interrupt\n");
 		return;
 	}
-	sc->gpio_is_high = fdtbus_intr_establish(phandle, 1, IPL_HIGH,
-	FDT_INTR_MPSAFE, pic_handle_intr, >gpio_pic);
+	sc->gpio_is_high = fdtbus_intr_establish(phandle, 1, IPL_HIGH, 0,
+	pic_handle_intr, >gpio_pic);
 	if (sc->gpio_is_high == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt on %s\n",
 		intrstr);

Index: src/sys/dev/spi/spi.c