CVS commit: src/sys/dev/i2c

2018-06-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jun  7 05:56:18 UTC 2018

Modified Files:
src/sys/dev/i2c: i2c.c i2cvar.h

Log Message:
Back out unintended commits.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/i2c/i2cvar.h

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

Modified files:

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.59 src/sys/dev/i2c/i2c.c:1.60
--- src/sys/dev/i2c/i2c.c:1.59	Thu Jun  7 05:54:23 2018
+++ src/sys/dev/i2c/i2c.c	Thu Jun  7 05:56:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.59 2018/06/07 05:54:23 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.60 2018/06/07 05:56:18 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.59 2018/06/07 05:54:23 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.60 2018/06/07 05:56:18 thorpej Exp $");
 
 #include 
 #include 
@@ -67,7 +67,6 @@ __KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.59
 #endif
 
 struct iic_softc {
-	device_t sc_dev;
 	i2c_tag_t sc_tag;
 	int sc_type;
 	device_t sc_devices[I2C_MAX_ADDR + 1];
@@ -128,160 +127,21 @@ iic_print(void *aux, const char *pnp)
 	return UNCONF;
 }
 
-static bool
-iic_is_special_address(i2c_addr_t addr)
-{
-
-	/*
-	 * See: https://www.i2c-bus.org/addressing/
-	 */
-
-	/* General Call (read) / Start Byte (write) */
-	if (addr == 0x00)
-		return (true);
-
-	/* CBUS Addresses */
-	if (addr == 0x01)
-		return (true);
-
-	/* Reserved for Different Bus Formats */
-	if (addr == 0x02)
-		return (true);
-
-	/* Reserved for future purposes */
-	if (addr == 0x03)
-		return (true);
-
-	/* High Speed Master Code */
-	if ((addr & 0x7c) == 0x04)
-		return (true);
-
-	/* 10-bit Slave Addressing prefix */
-	if ((addr & 0x7c) == 0x78)
-		return (true);
-	
-	/* Reserved for future purposes */
-	if ((addr & 0x7c) == 0x7c)
-		return (true);
-	
-	return (false);
-}
-
-static int
-iic_probe_none(struct iic_softc *sc,
-	   const struct i2c_attach_args *ia, int flags)
-{
-
-	return (0);
-}
-
-static int
-iic_probe_smbus_quick_write(struct iic_softc *sc,
-			const struct i2c_attach_args *ia, int flags)
-{
-	int error;
-
-	if ((error = iic_acquire_bus(ia->ia_tag, flags)) == 0) {
-		error = iic_smbus_quick_write(ia->ia_tag, ia->ia_addr, flags);
-	}
-	(void) iic_release_bus(ia->ia_tag, flags);
-
-	return (error);
-}
-
-static int
-iic_probe_smbus_receive_byte(struct iic_softc *sc,
-			 const struct i2c_attach_args *ia, int flags)
-{
-	int error;
-
-	if ((error = iic_acquire_bus(ia->ia_tag, flags)) == 0) {
-		uint8_t dummy;
-
-		error = iic_smbus_receive_byte(ia->ia_tag, ia->ia_addr,
-	   , flags);
-	}
-	(void) iic_release_bus(ia->ia_tag, flags);
-
-	return (error);
-}
-
-static bool
-iic_indirect_driver_is_whitelisted(struct iic_softc *sc, cfdata_t cf)
-{
-	prop_object_iterator_t iter;
-	prop_array_t whitelist;
-	prop_string_t pstr;
-	prop_type_t ptype;
-	bool rv = false;
-
-	whitelist = prop_dictionary_get(device_properties(sc->sc_dev),
-	I2C_PROP_INDIRECT_DEVICE_WHITELIST);
-	if (whitelist == NULL) {
-		/* No whitelist -> everything allowed */
-		return (true);
-	}
-
-	if ((ptype = prop_object_type(whitelist)) != PROP_TYPE_ARRAY) {
-		aprint_error_dev(sc->sc_dev,
-		"invalid property type (%d) for '%s'; must be array (%d)\n",
-		ptype, I2C_PROP_INDIRECT_DEVICE_WHITELIST, PROP_TYPE_ARRAY);
-		return (false);
-	}
-
-	iter = prop_array_iterator(whitelist);
-	while ((pstr = prop_object_iterator_next(iter)) != NULL) {
-		if (prop_string_equals_cstring(pstr, cf->cf_name)) {
-			rv = true;
-			break;
-		}
-	}
-	prop_object_iterator_release(iter);
-
-	return (rv);
-}
-
 static int
 iic_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct iic_softc *sc = device_private(parent);
 	struct i2c_attach_args ia;
-	int (*probe_func)(struct iic_softc *,
-			  const struct i2c_attach_args *, int);
-	prop_string_t pstr;
-	i2c_addr_t first_addr, last_addr;
 
 	/*
-	 * Before we do any more work, consult the allowed-driver
-	 * white-list for this bus (if any).
+	 * I2C doesn't have any regular probing capability.  If we
+	 * encounter a cfdata with a wild-carded address or a wild-
+	 * carded parent spec, we skip them because they can only
+	 * be used for direct-coniguration.
 	 */
-	if (iic_indirect_driver_is_whitelisted(sc, cf) == false)
-		return (0);
-
-	/* default to "quick write". */
-	probe_func = iic_probe_smbus_quick_write;
-
-	pstr = prop_dictionary_get(device_properties(sc->sc_dev),
-   I2C_PROP_INDIRECT_PROBE_STRATEGY);
-	if (pstr == NULL) {
-		/* Use the default. */
-	} else if (prop_string_equals_cstring(pstr,
-	I2C_PROBE_STRATEGY_QUICK_WRITE)) {
-		probe_func = iic_probe_smbus_quick_write;
-	} else if (prop_string_equals_cstring(pstr,
-	I2C_PROBE_STRATEGY_RECEIVE_BYTE)) {
-		probe_func = 

CVS commit: src/sys/dev/i2c

2018-06-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jun  7 05:54:24 UTC 2018

Modified Files:
src/sys/dev/i2c: i2c.c i2cvar.h tsl256x.c

Log Message:
Adjust come defaults:
- Initial gain -> 16x
- auto_gain -> true


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/i2cvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/tsl256x.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/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.58 src/sys/dev/i2c/i2c.c:1.59
--- src/sys/dev/i2c/i2c.c:1.58	Tue May 15 02:02:18 2018
+++ src/sys/dev/i2c/i2c.c	Thu Jun  7 05:54:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.58 2018/05/15 02:02:18 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.59 2018/06/07 05:54:23 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.58 2018/05/15 02:02:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.59 2018/06/07 05:54:23 thorpej Exp $");
 
 #include 
 #include 
@@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.58
 #endif
 
 struct iic_softc {
+	device_t sc_dev;
 	i2c_tag_t sc_tag;
 	int sc_type;
 	device_t sc_devices[I2C_MAX_ADDR + 1];
@@ -127,21 +128,160 @@ iic_print(void *aux, const char *pnp)
 	return UNCONF;
 }
 
+static bool
+iic_is_special_address(i2c_addr_t addr)
+{
+
+	/*
+	 * See: https://www.i2c-bus.org/addressing/
+	 */
+
+	/* General Call (read) / Start Byte (write) */
+	if (addr == 0x00)
+		return (true);
+
+	/* CBUS Addresses */
+	if (addr == 0x01)
+		return (true);
+
+	/* Reserved for Different Bus Formats */
+	if (addr == 0x02)
+		return (true);
+
+	/* Reserved for future purposes */
+	if (addr == 0x03)
+		return (true);
+
+	/* High Speed Master Code */
+	if ((addr & 0x7c) == 0x04)
+		return (true);
+
+	/* 10-bit Slave Addressing prefix */
+	if ((addr & 0x7c) == 0x78)
+		return (true);
+	
+	/* Reserved for future purposes */
+	if ((addr & 0x7c) == 0x7c)
+		return (true);
+	
+	return (false);
+}
+
+static int
+iic_probe_none(struct iic_softc *sc,
+	   const struct i2c_attach_args *ia, int flags)
+{
+
+	return (0);
+}
+
+static int
+iic_probe_smbus_quick_write(struct iic_softc *sc,
+			const struct i2c_attach_args *ia, int flags)
+{
+	int error;
+
+	if ((error = iic_acquire_bus(ia->ia_tag, flags)) == 0) {
+		error = iic_smbus_quick_write(ia->ia_tag, ia->ia_addr, flags);
+	}
+	(void) iic_release_bus(ia->ia_tag, flags);
+
+	return (error);
+}
+
+static int
+iic_probe_smbus_receive_byte(struct iic_softc *sc,
+			 const struct i2c_attach_args *ia, int flags)
+{
+	int error;
+
+	if ((error = iic_acquire_bus(ia->ia_tag, flags)) == 0) {
+		uint8_t dummy;
+
+		error = iic_smbus_receive_byte(ia->ia_tag, ia->ia_addr,
+	   , flags);
+	}
+	(void) iic_release_bus(ia->ia_tag, flags);
+
+	return (error);
+}
+
+static bool
+iic_indirect_driver_is_whitelisted(struct iic_softc *sc, cfdata_t cf)
+{
+	prop_object_iterator_t iter;
+	prop_array_t whitelist;
+	prop_string_t pstr;
+	prop_type_t ptype;
+	bool rv = false;
+
+	whitelist = prop_dictionary_get(device_properties(sc->sc_dev),
+	I2C_PROP_INDIRECT_DEVICE_WHITELIST);
+	if (whitelist == NULL) {
+		/* No whitelist -> everything allowed */
+		return (true);
+	}
+
+	if ((ptype = prop_object_type(whitelist)) != PROP_TYPE_ARRAY) {
+		aprint_error_dev(sc->sc_dev,
+		"invalid property type (%d) for '%s'; must be array (%d)\n",
+		ptype, I2C_PROP_INDIRECT_DEVICE_WHITELIST, PROP_TYPE_ARRAY);
+		return (false);
+	}
+
+	iter = prop_array_iterator(whitelist);
+	while ((pstr = prop_object_iterator_next(iter)) != NULL) {
+		if (prop_string_equals_cstring(pstr, cf->cf_name)) {
+			rv = true;
+			break;
+		}
+	}
+	prop_object_iterator_release(iter);
+
+	return (rv);
+}
+
 static int
 iic_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct iic_softc *sc = device_private(parent);
 	struct i2c_attach_args ia;
+	int (*probe_func)(struct iic_softc *,
+			  const struct i2c_attach_args *, int);
+	prop_string_t pstr;
+	i2c_addr_t first_addr, last_addr;
 
 	/*
-	 * I2C doesn't have any regular probing capability.  If we
-	 * encounter a cfdata with a wild-carded address or a wild-
-	 * carded parent spec, we skip them because they can only
-	 * be used for direct-coniguration.
+	 * Before we do any more work, consult the allowed-driver
+	 * white-list for this bus (if any).
 	 */
-	if (cf->cf_loc[IICCF_ADDR] == IICCF_ADDR_DEFAULT ||
-	cf->cf_pspec->cfp_unit == DVUNIT_ANY)
-		return 0;
+	if (iic_indirect_driver_is_whitelisted(sc, cf) == false)
+		return (0);
+
+	/* default to "quick write". */
+	probe_func = iic_probe_smbus_quick_write;
+
+	pstr = prop_dictionary_get(device_properties(sc->sc_dev),
+   I2C_PROP_INDIRECT_PROBE_STRATEGY);
+	if (pstr == NULL) {
+		/* Use the default. */
+	} else if (prop_string_equals_cstring(pstr,

CVS commit: src/doc

2018-06-06 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun  7 05:48:29 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
sqlite 3.24 out.


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1527 src/doc/3RDPARTY:1.1528
--- src/doc/3RDPARTY:1.1527	Mon Jun  4 16:46:46 2018
+++ src/doc/3RDPARTY	Thu Jun  7 05:48:29 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1527 2018/06/04 16:46:46 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1528 2018/06/07 05:48:29 maya Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1285,7 +1285,7 @@ original.
 
 Package:	sqlite
 Version:	3.17.0
-Current Vers:	3.22
+Current Vers:	3.24
 Maintainer:	Richard Hipp 
 Home Page:	http://www.sqlite.org
 Responsible:	joerg



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

2018-06-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jun  7 05:07:28 UTC 2018

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c

Log Message:
A minimal change to prevent the Raspberry Pi i2c driver from
looping forever if the command buffer and data buffer are both
NULL.  XXX This driver needs an overhaul.

Also, preemptively return an error if we get a 10-bit address,
because we don't yet handle them correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_bsc.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.11 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.12
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.11	Wed May  9 02:53:00 2018
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c	Thu Jun  7 05:07:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_bsc.c,v 1.11 2018/05/09 02:53:00 thorpej Exp $	*/
+/*	$NetBSD: bcm2835_bsc.c,v 1.12 2018/06/07 05:07:28 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.11 2018/05/09 02:53:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.12 2018/06/07 05:07:28 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_kernhist.h"
@@ -242,8 +242,15 @@ bsciic_exec(void *v, i2c_op_t op, i2c_ad
 	size_t len;
 	size_t pos;
 	int error = 0;
+	int whichbuf = 0;
 	const bool isread = I2C_OP_READ_P(op);
 
+	/*
+	 * XXX We don't do 10-bit addressing correctly yet.
+	 */
+	if (addr > 0x7f)
+		return (ENOTSUP);
+
 	flags |= I2C_F_POLL;
 
 #if 0
@@ -312,10 +319,13 @@ flood_again:
 	KERNHIST_LOG(bsciichist, "flood bot %#jx %ju",
 	(uintptr_t)buf, len, 0, 0);
 
-	if (buf == cmdbuf && !isread) {
+	if (whichbuf == 0 && !isread) {
+		KASSERT(buf == cmdbuf);
+		whichbuf++;
 		buf = databuf;
 		len = datalen;
-		goto flood_again;
+		if (len)
+			goto flood_again;
 	}
 
 	do {



CVS commit: [netbsd-7-0] src/sys/netinet

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun  7 05:03:26 UTC 2018

Modified Files:
src/sys/netinet [netbsd-7-0]: udp_usrreq.c

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

sys/netinet/udp_usrreq.c: revision 1.237 (via patch)

Fix three pretty bad mistakes in NAT-T:

 * If we got a keepalive packet, we need to call m_freem, not m_free.
   Here the next mbufs in the chain are not freed. Seems easy to remotely
   DoS the system by sending fragmented keepalives in a loop.

 * If !ipsec_used, free the mbuf.

 * In udp_input, we need to update 'uh', because udp4_realinput may have
   modified the chain. Perhaps we also need to re-enforce alignment, so
   add an XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.217.6.1 src/sys/netinet/udp_usrreq.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/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.217 src/sys/netinet/udp_usrreq.c:1.217.6.1
--- src/sys/netinet/udp_usrreq.c:1.217	Sat Aug  9 05:33:01 2014
+++ src/sys/netinet/udp_usrreq.c	Thu Jun  7 05:03:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.217.6.1 2018/06/07 05:03:26 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217.6.1 2018/06/07 05:03:26 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -395,7 +395,15 @@ udp_input(struct mbuf *m, ...)
 		 */
 		return;
 	}
+
 	ip = mtod(m, struct ip *);
+	IP6_EXTHDR_GET(uh, struct udphdr *, m, iphlen, sizeof(struct udphdr));
+	if (uh == NULL) {
+		UDP_STATINC(UDP_STAT_HDROPS);
+		return;
+	}
+	/* XXX Re-enforce alignment? */
+
 #ifdef INET6
 	if (IN_MULTICAST(ip->ip_dst.s_addr) || n == 0) {
 		struct sockaddr_in6 src6, dst6;
@@ -1301,7 +1309,7 @@ udp4_espinudp(struct mbuf **mp, int off,
 
 	/* Ignore keepalive packets */
 	if ((len == 1) && (*(unsigned char *)data == 0xff)) {
-		m_free(m);
+		m_freem(m);
 		*mp = NULL; /* avoid any further processiong by caller ... */
 		return 1;
 	}
@@ -1383,7 +1391,8 @@ udp4_espinudp(struct mbuf **mp, int off,
 #ifdef IPSEC
 	if (ipsec_used)
 		ipsec4_common_input(m, iphdrlen, IPPROTO_ESP);
-	/* XXX: else */
+	else
+		m_freem(m);
 #else
 	esp4_input(m, iphdrlen);
 #endif



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

2018-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun  7 00:51:41 UTC 2018

Added Files:
src/sys/arch/arm/dts: sun50i-a64-sopine-baseboard.dts

Log Message:
Add extra sun50i-a64 nodes to SoPine Baseboard dts.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts

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

Added files:

Index: src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
diff -u /dev/null src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts:1.1
--- /dev/null	Thu Jun  7 00:51:41 2018
+++ src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts	Thu Jun  7 00:51:41 2018
@@ -0,0 +1,30 @@
+/* $NetBSD: sun50i-a64-sopine-baseboard.dts,v 1.1 2018/06/07 00:51:41 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts"
+#include "sun50i-a64.dtsi"



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

2018-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun  7 00:39:27 UTC 2018

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

Log Message:
Disable HS200 and DDR52 on A64 eMMC for now, and use len=0 for max length
transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/sunxi/sunxi_mmc.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.24 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.25
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.24	Mon May 21 22:04:27 2018
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c	Thu Jun  7 00:39:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.24 2018/05/21 22:04:27 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.25 2018/06/07 00:39:27 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_sunximmc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.24 2018/05/21 22:04:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.25 2018/06/07 00:39:27 jmcneill Exp $");
 
 #include 
 #include 
@@ -254,8 +254,7 @@ static const struct sunxi_mmc_config sun
 	.idma_xferlen = 0x2000,
 	.dma_ftrglevel = 0x20070008,
 	.delays = NULL,
-	.flags = SUNXI_MMC_FLAG_CALIB_REG |
-		 SUNXI_MMC_FLAG_HS200,
+	.flags = SUNXI_MMC_FLAG_CALIB_REG,
 };
 
 static const struct sunxi_mmc_config sun50i_h6_mmc_config = {
@@ -554,10 +553,14 @@ sunxi_mmc_attach_i(device_t self)
 		   SMC_CAPS_AUTO_STOP |
 		   SMC_CAPS_SD_HIGHSPEED |
 		   SMC_CAPS_MMC_HIGHSPEED |
-		   SMC_CAPS_MMC_DDR52 |
 		   SMC_CAPS_POLLING;
+
+	if (sc->sc_config->delays || (flags & SUNXI_MMC_FLAG_NEW_TIMINGS))
+		saa.saa_caps |= SMC_CAPS_MMC_DDR52;
+
 	if (flags & SUNXI_MMC_FLAG_HS200)
 		saa.saa_caps |= SMC_CAPS_MMC_HS200;
+
 	if (width == 4)
 		saa.saa_caps |= SMC_CAPS_4BIT_MODE;
 	if (width == 8)
@@ -967,7 +970,8 @@ sunxi_mmc_dma_prepare(struct sunxi_mmc_s
 			if (desc == sc->sc_idma_ndesc)
 break;
 			len = min(sc->sc_config->idma_xferlen, resid);
-			dma[desc].dma_buf_size = htole32(len);
+			dma[desc].dma_buf_size =
+			htole32(len == sc->sc_config->idma_xferlen ? 0 : len);
 			dma[desc].dma_buf_addr = htole32(paddr + off);
 			dma[desc].dma_config = htole32(SUNXI_MMC_IDMA_CONFIG_CH |
 	   SUNXI_MMC_IDMA_CONFIG_OWN);



CVS commit: src/sys/arch/macppc/stand/ofwboot

2018-06-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jun  6 23:50:29 UTC 2018

Modified Files:
src/sys/arch/macppc/stand/ofwboot: Locore.c openfirm.h

Log Message:
Provide commented out OF_enter() that comes in handy when debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/macppc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/stand/ofwboot/openfirm.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/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.30 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.31
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.30	Wed Jun  6 22:56:25 2018
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Wed Jun  6 23:50:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.30 2018/06/06 22:56:25 uwe Exp $	*/
+/*	$NetBSD: Locore.c,v 1.31 2018/06/06 23:50:29 uwe Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -179,6 +179,24 @@ startup(void *vpd, int res, int (*openfi
 	OF_exit();
 }
 
+#if 0
+void
+OF_enter(void)
+{
+	static struct {
+		const char *name;
+		int nargs;
+		int nreturns;
+	} args = {
+		"enter",
+		0,
+		0
+	};
+
+	openfirmware();
+}
+#endif	/* OF_enter */
+
 __dead void
 OF_exit(void)
 {

Index: src/sys/arch/macppc/stand/ofwboot/openfirm.h
diff -u src/sys/arch/macppc/stand/ofwboot/openfirm.h:1.7 src/sys/arch/macppc/stand/ofwboot/openfirm.h:1.8
--- src/sys/arch/macppc/stand/ofwboot/openfirm.h:1.7	Mon Dec 24 15:46:45 2007
+++ src/sys/arch/macppc/stand/ofwboot/openfirm.h	Wed Jun  6 23:50:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.h,v 1.7 2007/12/24 15:46:45 perry Exp $	*/
+/*	$NetBSD: openfirm.h,v 1.8 2018/06/06 23:50:29 uwe Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -39,6 +39,7 @@
 
 #include "boot.h"
 
+void OF_enter(void);
 __dead void OF_exit(void);
 int OF_finddevice(const char *);
 int OF_instance_to_package(int);



CVS commit: src/sys/arch/macppc/stand/ofwboot

2018-06-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jun  6 22:56:25 UTC 2018

Modified Files:
src/sys/arch/macppc/stand/ofwboot: Locore.c Makefile boot.c

Log Message:
Provide an option to use libsa allocator.  Not yet enabled.  Same
binary code is generated.

To enable uncomment -DHEAP_VARIABLE and comment out alloc.c in the
makefile.

PR port-macppc/44895


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/macppc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/macppc/stand/ofwboot/Makefile
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/macppc/stand/ofwboot/boot.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/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.30
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29	Fri Apr 22 18:25:41 2016
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Wed Jun  6 22:56:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.29 2016/04/22 18:25:41 christos Exp $	*/
+/*	$NetBSD: Locore.c,v 1.30 2018/06/06 22:56:25 uwe Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -31,6 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
 #include 
 
 #include 
@@ -43,6 +44,13 @@ static void startup(void *, int, int (*)
 		__attribute__((__used__));
 static void setup(void);
 
+#ifdef HEAP_VARIABLE
+#ifndef HEAP_SIZE
+#define HEAP_SIZE 0x2
+#endif
+char *heapspace;
+#endif
+
 static int stack[8192/4 + 4] __attribute__((__used__));
 
 #ifdef XCOFF_GLUE
@@ -621,6 +629,15 @@ setup(void)
 	OF_getprop(chosen, "stdout", , sizeof(stdout)) !=
 	sizeof(stdout))
 		OF_exit();
+
+#ifdef HEAP_VARIABLE
+	heapspace = OF_claim(0, HEAP_SIZE, NBPG);
+	if (heapspace == (char *)-1) {
+		panic("Failed to allocate heap");
+	}
+
+	setheap(heapspace, heapspace + HEAP_SIZE);
+#endif	/* HEAP_VARIABLE */
 }
 
 void

Index: src/sys/arch/macppc/stand/ofwboot/Makefile
diff -u src/sys/arch/macppc/stand/ofwboot/Makefile:1.58 src/sys/arch/macppc/stand/ofwboot/Makefile:1.59
--- src/sys/arch/macppc/stand/ofwboot/Makefile:1.58	Thu Apr 20 19:09:29 2017
+++ src/sys/arch/macppc/stand/ofwboot/Makefile	Wed Jun  6 22:56:25 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.58 2017/04/20 19:09:29 uwe Exp $
+#	$NetBSD: Makefile,v 1.59 2018/06/06 22:56:25 uwe Exp $
 
 S=	${.CURDIR}/../../../..
 
 PROG=		ofwboot
 FILES=		${PROG}.elf ${PROG}.xcf
-SRCS=		Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c
+SRCS=		Locore.c boot.c ofdev.c hfs.c net.c netif_of.c
 XCOFFXTRA=	Xcoffxtra.c
 XCOFFXTRAOBJ=	Xcoffxtra.o
 CFLAGS+=	-ffreestanding
@@ -16,6 +16,10 @@ CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
 CPPFLAGS+=	-DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK
 DBG=		-Os
 
+# PR port-macppc/44895
+SRCS+=		alloc.c			# use ./alloc.c
+#CPPFLAGS+=	-DHEAP_VARIABLE		# use libsa alloc.c
+
 LIBCRT0=	# nothing
 LIBCRTI=	# nothing
 LIBCRTBEGIN=	# nothing

Index: src/sys/arch/macppc/stand/ofwboot/boot.c
diff -u src/sys/arch/macppc/stand/ofwboot/boot.c:1.28 src/sys/arch/macppc/stand/ofwboot/boot.c:1.29
--- src/sys/arch/macppc/stand/ofwboot/boot.c:1.28	Sat Jun 11 06:32:45 2016
+++ src/sys/arch/macppc/stand/ofwboot/boot.c	Wed Jun  6 22:56:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.28 2016/06/11 06:32:45 dholland Exp $	*/
+/*	$NetBSD: boot.c,v 1.29 2018/06/06 22:56:25 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -181,7 +181,9 @@ chain(boot_entry_t entry, char *args, vo
 	extern char end[];
 	int l;
 
+#if !defined(HEAP_VARIABLE)
 	freeall();
+#endif
 
 	/*
 	 * Stash pointer to end of symbol table after the argument



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

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 20:38:00 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: VEXPRESS_A15

Log Message:
Add virtio drivers and potential children thereof.

In part from sparc64 GENERIC.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/VEXPRESS_A15

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

Modified files:

Index: src/sys/arch/evbarm/conf/VEXPRESS_A15
diff -u src/sys/arch/evbarm/conf/VEXPRESS_A15:1.17 src/sys/arch/evbarm/conf/VEXPRESS_A15:1.18
--- src/sys/arch/evbarm/conf/VEXPRESS_A15:1.17	Fri Jun 16 21:37:11 2017
+++ src/sys/arch/evbarm/conf/VEXPRESS_A15	Wed Jun  6 20:38:00 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VEXPRESS_A15,v 1.17 2017/06/16 21:37:11 jmcneill Exp $
+#	$NetBSD: VEXPRESS_A15,v 1.18 2018/06/06 20:38:00 jakllsch Exp $
 #
 #	ARM Versatile Express A15
 #
@@ -95,6 +95,25 @@ wskbd*		at pckbd? console ?
 pms*		at pckbport?
 wsmouse*	at pms? mux 0
 
+# Virtio devices
+virtio*	at fdt?# Virtio MMIO device
+# the baloon driver can not work on machines with non-4k pages
+#viomb*	at virtio?			# Virtio memory balloon device
+ld*	at virtio?			# Virtio disk device
+vioif*	at virtio?			# Virtio network device
+viornd* at virtio?			# Virtio entropy device
+vioscsi* at virtio?			# Virtio SCSI device
+
+# SCSI
+scsibus* at scsi?
+sd*	at scsibus? target ? lun ?	# SCSI disks
+st*	at scsibus? target ? lun ?	# SCSI tapes
+cd*	at scsibus? target ? lun ?	# SCSI CD-ROMs
+ch*	at scsibus? target ? lun ?	# SCSI changer devices
+ss*	at scsibus? target ? lun ?	# SCSI scanners
+ses*	at scsibus? target ? lun ?	# SCSI SES/SAF-TE devices
+uk*	at scsibus? target ? lun ?	# unknown SCSI
+
 # wscons pseudo-devices
 pseudo-device	wsfont
 pseudo-device	wsmux



CVS commit: src/sys/dev

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 20:35:37 UTC 2018

Modified Files:
src/sys/dev/fdt: files.fdt
src/sys/dev/virtio: files.virtio
Added Files:
src/sys/dev/fdt: virtio_mmio_fdt.c
src/sys/dev/virtio: virtio_mmio.c virtio_mmiovar.h

Log Message:
Add Virtio MMIO transport.

Adapted in part from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/virtio_mmio_fdt.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/virtio/files.virtio
cvs rdiff -u -r0 -r1.1 src/sys/dev/virtio/virtio_mmio.c \
src/sys/dev/virtio/virtio_mmiovar.h

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

Modified files:

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.28 src/sys/dev/fdt/files.fdt:1.29
--- src/sys/dev/fdt/files.fdt:1.28	Fri Jun  1 22:11:53 2018
+++ src/sys/dev/fdt/files.fdt	Wed Jun  6 20:35:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.28 2018/06/01 22:11:53 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.29 2018/06/06 20:35:36 jakllsch Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -91,3 +91,7 @@ file	dev/fdt/dw_apb_uart.c			dw_apb_uart
 # Designware USB3 XHCI
 attach	xhci at fdt with dwc3_fdt
 file	dev/fdt/dwc3_fdt.c			dwc3_fdt
+
+# Virtio virtio,mmio
+attach	virtio at fdt with virtio_mmio_fdt:	virtio_mmio
+file	dev/fdt/virtio_mmio_fdt.c		virtio_mmio_fdt

Index: src/sys/dev/virtio/files.virtio
diff -u src/sys/dev/virtio/files.virtio:1.1 src/sys/dev/virtio/files.virtio:1.2
--- src/sys/dev/virtio/files.virtio:1.1	Wed Jun  6 18:10:35 2018
+++ src/sys/dev/virtio/files.virtio	Wed Jun  6 20:35:36 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: files.virtio,v 1.1 2018/06/06 18:10:35 jakllsch Exp $
+#	$NetBSD: files.virtio,v 1.2 2018/06/06 20:35:36 jakllsch Exp $
 
 # XXX the contents of the following included file should be moved here
 include "dev/pci/files.virtio"
+
+file	dev/virtio/virtio_mmio.c	virtio_mmio

Added files:

Index: src/sys/dev/fdt/virtio_mmio_fdt.c
diff -u /dev/null src/sys/dev/fdt/virtio_mmio_fdt.c:1.1
--- /dev/null	Wed Jun  6 20:35:37 2018
+++ src/sys/dev/fdt/virtio_mmio_fdt.c	Wed Jun  6 20:35:36 2018
@@ -0,0 +1,193 @@
+/* $NetBSD: virtio_mmio_fdt.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $ */
+
+/*
+ * Copyright (c) 2018 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $");
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define VIRTIO_PRIVATE
+#include 
+
+static int	virtio_mmio_fdt_match(device_t, cfdata_t, void *);
+static void	virtio_mmio_fdt_attach(device_t, device_t, void *);
+static int	virtio_mmio_fdt_rescan(device_t, const char *, const int *);
+static int	virtio_mmio_fdt_detach(device_t, int);
+
+static int	virtio_mmio_fdt_setup_interrupts(struct virtio_mmio_softc *);
+static void	virtio_mmio_fdt_free_interrupts(struct virtio_mmio_softc *);
+
+struct virtio_mmio_fdt_softc {
+	struct virtio_mmio_softc	sc_msc;
+	intsc_phandle;
+};
+
+CFATTACH_DECL3_NEW(virtio_mmio_fdt, sizeof(struct virtio_mmio_fdt_softc),
+virtio_mmio_fdt_match, virtio_mmio_fdt_attach, virtio_mmio_fdt_detach, NULL,
+virtio_mmio_fdt_rescan, (void *)voidop, DVF_DETACH_SHUTDOWN);
+
+static const char * const compatible[] = {
+	"virtio,mmio",
+	NULL
+};
+
+static int
+virtio_mmio_fdt_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct fdt_attach_args * const faa = aux;
+
+	return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+virtio_mmio_fdt_attach(device_t parent, 

CVS commit: src/sys/dev/pci

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 20:05:36 UTC 2018

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

Log Message:
Enhance the syntax in order to be acceptable by Clang

Replace "((crv == 0))" with "(crv == 0)", as the intention is to check the
value, whether it is equal to 0.

This fixes kernel=GENERIC build under MKLLVM=yes.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/svwsata.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/svwsata.c
diff -u src/sys/dev/pci/svwsata.c:1.22 src/sys/dev/pci/svwsata.c:1.23
--- src/sys/dev/pci/svwsata.c:1.22	Fri Jun  1 18:14:33 2018
+++ src/sys/dev/pci/svwsata.c	Wed Jun  6 20:05:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $	*/
+/*	$NetBSD: svwsata.c,v 1.23 2018/06/06 20:05:36 kamil Exp $	*/
 
 /*
  * Copyright (c) 2005 Mark Kettenis
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.23 2018/06/06 20:05:36 kamil Exp $");
 
 #include 
 #include 
@@ -369,7 +369,7 @@ svwsata_intr(void *arg)
 			continue;
 		}
 		crv = wdcintr(wdc_cp);
-		if ((crv == 0)) {
+		if (crv == 0) {
 			bus_space_write_1(sc->sc_dma_iot, 
 			cp->dma_iohs[IDEDMA_CTL], 0, dmastat);
 		}



CVS commit: src/sys/dev/pci/ixgbe

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 20:02:31 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
Comment out unused functions in order to fix Clang build

ixv_rearm_queues() and ixgbe_rearm_queues() are unused.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.160 src/sys/dev/pci/ixgbe/ixgbe.c:1.161
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.160	Mon Jun  4 02:42:23 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jun  6 20:02:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.160 2018/06/04 02:42:23 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.161 2018/06/06 20:02:31 kamil Exp $ */
 
 /**
 
@@ -191,7 +191,9 @@ static void	ixgbe_config_delay_values(st
 static void	ixgbe_config_link(struct adapter *);
 static void	ixgbe_check_wol_support(struct adapter *);
 static int	ixgbe_setup_low_power_mode(struct adapter *);
+#if 0
 static void	ixgbe_rearm_queues(struct adapter *, u64);
+#endif
 
 static void ixgbe_initialize_transmit_units(struct adapter *);
 static void ixgbe_initialize_receive_units(struct adapter *);
@@ -6642,6 +6644,7 @@ ixgbe_handle_link(void *context)
 	IXGBE_CORE_UNLOCK(adapter);
 } /* ixgbe_handle_link */
 
+#if 0
 /
  * ixgbe_rearm_queues
  /
@@ -6669,3 +6672,4 @@ ixgbe_rearm_queues(struct adapter *adapt
 		break;
 	}
 } /* ixgbe_rearm_queues */
+#endif

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.104 src/sys/dev/pci/ixgbe/ixv.c:1.105
--- src/sys/dev/pci/ixgbe/ixv.c:1.104	Mon Jun  4 02:42:23 2018
+++ src/sys/dev/pci/ixgbe/ixv.c	Wed Jun  6 20:02:31 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.104 2018/06/04 02:42:23 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.105 2018/06/06 20:02:31 kamil Exp $*/
 
 /**
 
@@ -873,12 +873,14 @@ out:
 	mutex_exit(>dc_mtx);
 } /* ixv_disable_queue */
 
+#if 0
 static inline void
 ixv_rearm_queues(struct adapter *adapter, u64 queues)
 {
 	u32 mask = (IXGBE_EIMS_RTX_QUEUE & queues);
 	IXGBE_WRITE_REG(>hw, IXGBE_VTEICS, mask);
 } /* ixv_rearm_queues */
+#endif
 
 
 /



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

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 19:49:51 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gic_fdt.c

Log Message:
more completely gic_fdt_disestablish() such that it's possible to
re-establish later


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/fdt/gic_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/gic_fdt.c
diff -u src/sys/arch/arm/fdt/gic_fdt.c:1.8 src/sys/arch/arm/fdt/gic_fdt.c:1.9
--- src/sys/arch/arm/fdt/gic_fdt.c:1.8	Thu Nov 30 14:42:37 2017
+++ src/sys/arch/arm/fdt/gic_fdt.c	Wed Jun  6 19:49:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.8 2017/11/30 14:42:37 skrll Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.8 2017/11/30 14:42:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $");
 
 #include 
 #include 
@@ -80,6 +80,7 @@ struct gic_fdt_irq {
 	int			intr_level;
 	int			intr_mpsafe;
 	TAILQ_HEAD(, gic_fdt_irqhandler) intr_handlers;
+	int			intr_irq;
 };
 
 struct gic_fdt_softc {
@@ -190,6 +191,7 @@ gic_fdt_establish(device_t dev, u_int *s
 		firq->intr_level = level;
 		firq->intr_mpsafe = mpsafe;
 		TAILQ_INIT(>intr_handlers);
+		firq->intr_irq = irq;
 		if (arg == NULL) {
 			firq->intr_ih = intr_establish(irq, ipl, level | mpsafe,
 			func, NULL);
@@ -239,8 +241,10 @@ gic_fdt_establish(device_t dev, u_int *s
 static void
 gic_fdt_disestablish(device_t dev, void *ih)
 {
+	struct gic_fdt_softc * const sc = device_private(dev);
 	struct gic_fdt_irqhandler *firqh = ih;
 	struct gic_fdt_irq *firq = firqh->ih_irq;
+	const int irq = firq->intr_irq;
 
 	KASSERT(firq->intr_refcnt > 0);
 
@@ -251,6 +255,7 @@ gic_fdt_disestablish(device_t dev, void 
 	if (firq->intr_refcnt == 0) {
 		intr_disestablish(firq->intr_ih);
 		kmem_free(firq, sizeof(*firq));
+		sc->sc_irq[irq] = NULL;
 	}
 }
 



CVS commit: src/sys

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 18:10:36 UTC 2018

Modified Files:
src/sys/conf: files
src/sys/dev/pci: files.pci
Added Files:
src/sys/dev/virtio: files.virtio

Log Message:
shuffle mechanics of files.virtio config(5) include location,
without actually moving the contents thereof from dev/pci yet


To generate a diff of this commit:
cvs rdiff -u -r1.1199 -r1.1200 src/sys/conf/files
cvs rdiff -u -r1.396 -r1.397 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1 src/sys/dev/virtio/files.virtio

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1199 src/sys/conf/files:1.1200
--- src/sys/conf/files:1.1199	Sun May  6 10:32:33 2018
+++ src/sys/conf/files	Wed Jun  6 18:10:36 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1199 2018/05/06 10:32:33 jmcneill Exp $
+#	$NetBSD: files,v 1.1200 2018/06/06 18:10:36 jakllsch Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -1000,6 +1000,10 @@ file	dev/ic/rtl81x9.c		rtk | re
 device	re: ether, ifnet, arp, mii
 file	dev/ic/rtl8169.c		re
 
+# Virtual I/O Device (VIRTIO) bus controller and devices
+#
+include "dev/virtio/files.virtio"
+
 # Common code for ESDI/IDE/etc. controllers
 #
 define	wdc_common

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.396 src/sys/dev/pci/files.pci:1.397
--- src/sys/dev/pci/files.pci:1.396	Sat May 19 09:27:09 2018
+++ src/sys/dev/pci/files.pci	Wed Jun  6 18:10:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.396 2018/05/19 09:27:09 jdolecek Exp $
+#	$NetBSD: files.pci,v 1.397 2018/06/06 18:10:35 jakllsch Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1149,9 +1149,6 @@ device  sisfb: wsemuldisplaydev, rasops8
 attach  sisfb at pci
 filedev/pci/sisfb.c		sisfb	needs-flag
 
-# VirtIO: XXX: move to dev/vmm/virtio
-include "dev/pci/files.virtio"
-
 attach	virtio at pci with virtio_pci
 file	dev/pci/virtio_pci.c	virtio_pci
 

Added files:

Index: src/sys/dev/virtio/files.virtio
diff -u /dev/null src/sys/dev/virtio/files.virtio:1.1
--- /dev/null	Wed Jun  6 18:10:36 2018
+++ src/sys/dev/virtio/files.virtio	Wed Jun  6 18:10:35 2018
@@ -0,0 +1,4 @@
+#	$NetBSD: files.virtio,v 1.1 2018/06/06 18:10:35 jakllsch Exp $
+
+# XXX the contents of the following included file should be moved here
+include "dev/pci/files.virtio"



CVS commit: src/sys/modules/dtrace/linux_syscall

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 17:54:33 UTC 2018

Modified Files:
src/sys/modules/dtrace/linux_syscall: Makefile

Log Message:
Really disable unsupported $CC flag for LLVM

The build of kernel modules works now:

  ./build.sh -V MKLLVM=yes -V MKGCC=no -V HAVE_LLVM=yes modules

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/dtrace/linux_syscall/Makefile

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

Modified files:

Index: src/sys/modules/dtrace/linux_syscall/Makefile
diff -u src/sys/modules/dtrace/linux_syscall/Makefile:1.4 src/sys/modules/dtrace/linux_syscall/Makefile:1.5
--- src/sys/modules/dtrace/linux_syscall/Makefile:1.4	Wed Jun  6 15:01:13 2018
+++ src/sys/modules/dtrace/linux_syscall/Makefile	Wed Jun  6 17:54:33 2018
@@ -11,8 +11,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dev/dtrace
 
-CPPFLAGS+=	-Wno-unknown-pragmas \
-		-Wno-discarded-qualifiers
+CPPFLAGS+=	-Wno-unknown-pragmas
 
 .if defined(HAVE_GCC)
 CPPFLAGS+=	-Wno-discarded-qualifiers



CVS commit: src/external/cddl/osnet/dev/systrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 17:47:10 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/systrace: systrace.c

Log Message:
Correct compilation of osnet/dev/systrace/systrace.c under Clang

Mark arguments to dtrace_probe_lookup() with __UNCONST().
The proper fix constifying it causes pollution of const in too many files.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/dev/systrace/systrace.c

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

Modified files:

Index: src/external/cddl/osnet/dev/systrace/systrace.c
diff -u src/external/cddl/osnet/dev/systrace/systrace.c:1.10 src/external/cddl/osnet/dev/systrace/systrace.c:1.11
--- src/external/cddl/osnet/dev/systrace/systrace.c:1.10	Mon May 28 21:05:04 2018
+++ src/external/cddl/osnet/dev/systrace/systrace.c	Wed Jun  6 17:47:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: systrace.c,v 1.10 2018/05/28 21:05:04 chs Exp $	*/
+/*	$NetBSD: systrace.c,v 1.11 2018/06/06 17:47:10 kamil Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -356,7 +356,7 @@ systrace_provide(void *arg, dtrace_probe
 #else
 		const char *name = ALTSYSCALLNAMES[i] ? ALTSYSCALLNAMES[i] :
 		SYSCALLNAMES[i];
-		if (dtrace_probe_lookup(systrace_id, NULL, name, "entry") != 0)
+		if (dtrace_probe_lookup(systrace_id, NULL, __UNCONST(name), __UNCONST("entry")) != 0)
 			continue;
 
 		(void) dtrace_probe_create(systrace_id, NULL,



CVS commit: src/external/cddl/osnet/dev/profile

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 17:19:49 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/profile: profile.c

Log Message:
Correct compilation of osnet/dev/profile/profile.c under Clang

Constify char* types when initialized with liternals.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/dev/profile/profile.c

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

Modified files:

Index: src/external/cddl/osnet/dev/profile/profile.c
diff -u src/external/cddl/osnet/dev/profile/profile.c:1.8 src/external/cddl/osnet/dev/profile/profile.c:1.9
--- src/external/cddl/osnet/dev/profile/profile.c:1.8	Mon May 28 21:05:03 2018
+++ src/external/cddl/osnet/dev/profile/profile.c	Wed Jun  6 17:19:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.c,v 1.8 2018/05/28 21:05:03 chs Exp $	*/
+/*	$NetBSD: profile.c,v 1.9 2018/06/06 17:19:49 kamil Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -434,7 +434,7 @@ profile_provide(void *arg, dtrace_probed
 	char *name, *suffix = NULL;
 
 	const struct {
-		char *prefix;
+		const char *prefix;
 		int kind;
 	} types[] = {
 		{ PROF_PREFIX_PROFILE, PROF_PROFILE },
@@ -443,7 +443,7 @@ profile_provide(void *arg, dtrace_probed
 	};
 
 	const struct {
-		char *name;
+		const char *name;
 		hrtime_t mult;
 	} suffixes[] = {
 		{ "ns", 	NANOSEC / NANOSEC },



CVS commit: src/external/cddl/osnet/dev/dtrace/x86

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 17:16:56 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/dtrace/x86: dis_tables.c

Log Message:
Correct compilation of osnet/dev/dtrace/x86/dis_tables.c under Clang

Constify dgr_suffix.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c

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

Modified files:

Index: src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c
diff -u src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c:1.1 src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c:1.2
--- src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c:1.1	Mon May 28 23:47:39 2018
+++ src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c	Wed Jun  6 17:16:56 2018
@@ -2345,7 +2345,7 @@ typedef struct dis_gather_regs {
 	uint_t dgr_arg0;	/* src reg */
 	uint_t dgr_arg1;	/* vsib reg */
 	uint_t dgr_arg2;	/* dst reg */
-	char   *dgr_suffix;	/* suffix to append */
+	const char   *dgr_suffix;	/* suffix to append */
 } dis_gather_regs_t;
 
 static dis_gather_regs_t dis_vgather[4][2][2] = {



CVS commit: src/sys/dev/pci

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 17:17:31 UTC 2018

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

Log Message:
remove now-irrelevant  includes


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/virtio.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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.32 src/sys/dev/pci/virtio.c:1.33
--- src/sys/dev/pci/virtio.c:1.32	Wed Jun  6 16:11:36 2018
+++ src/sys/dev/pci/virtio.c	Wed Jun  6 17:17:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $	*/
+/*	$NetBSD: virtio.c,v 1.33 2018/06/06 17:17:31 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.33 2018/06/06 17:17:31 jakllsch Exp $");
 
 #include 
 #include 
@@ -37,10 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1
 #include 
 #include 
 
-#include 
-#include 
-#include 
-
 #define VIRTIO_PRIVATE
 
 #include  /* XXX: move to non-pci */



CVS commit: src/sys/modules

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 16:46:02 UTC 2018

Modified Files:
src/sys/modules: Makefile

Log Message:
add virtio_pci to list of not-yet-enabled modules


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.204 src/sys/modules/Makefile:1.205
--- src/sys/modules/Makefile:1.204	Sun May 20 14:08:33 2018
+++ src/sys/modules/Makefile	Wed Jun  6 16:46:02 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.204 2018/05/20 14:08:33 thorpej Exp $
+#	$NetBSD: Makefile,v 1.205 2018/06/06 16:46:02 jakllsch Exp $
 
 .include 
 
@@ -423,6 +423,7 @@ SUBDIR+=	twa
 SUBDIR+=	twe
 SUBDIR+=	viomb
 SUBDIR+=	virtio
+SUBDIR+=	virtio_pci
 SUBDIR+=	vioscsi
 .endif
 



CVS commit: src/sys

2018-06-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Jun  6 16:11:36 UTC 2018

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c
src/sys/modules/virtio: Makefile
Added Files:
src/sys/modules/virtio_pci: Makefile virtio_pci.ioconf
Removed Files:
src/sys/modules/virtio: virtio.ioconf

Log Message:
fix up virtio module for current structure; add virtio_pci module


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/virtio/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/modules/virtio/virtio.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/virtio_pci/Makefile \
src/sys/modules/virtio_pci/virtio_pci.ioconf

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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.31 src/sys/dev/pci/virtio.c:1.32
--- src/sys/dev/pci/virtio.c:1.31	Sat Jun  2 22:43:15 2018
+++ src/sys/dev/pci/virtio.c	Wed Jun  6 16:11:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.31 2018/06/02 22:43:15 jakllsch Exp $	*/
+/*	$NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.31 2018/06/02 22:43:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $");
 
 #include 
 #include 
@@ -932,7 +932,7 @@ virtio_features(struct virtio_softc *sc)
 	return sc->sc_features;
 }
 
-MODULE(MODULE_CLASS_DRIVER, virtio, "pci");
+MODULE(MODULE_CLASS_DRIVER, virtio, NULL);
  
 #ifdef _MODULE
 #include "ioconf.c"

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.4 src/sys/dev/pci/virtio_pci.c:1.5
--- src/sys/dev/pci/virtio_pci.c:1.4	Sat Jun  2 22:43:15 2018
+++ src/sys/dev/pci/virtio_pci.c	Wed Jun  6 16:11:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.4 2018/06/02 22:43:15 jakllsch Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.5 2018/06/06 16:11:36 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,11 +26,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.4 2018/06/02 22:43:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.5 2018/06/06 16:11:36 jakllsch Exp $");
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -727,3 +728,34 @@ virtio_pci_msix_config_intr(void *arg)
 		r = (sc->sc_config_change)(sc);
 	return r;
 }
+
+MODULE(MODULE_CLASS_DRIVER, virtio_pci, "pci,virtio");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+virtio_pci_modcmd(modcmd_t cmd, void *opaque)
+{
+	int error = 0;
+
+#ifdef _MODULE
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		error = config_init_component(cfdriver_ioconf_virtio_pci,
+		cfattach_ioconf_virtio_pci, cfdata_ioconf_virtio_pci);
+		break;
+	case MODULE_CMD_FINI:
+		error = config_fini_component(cfdriver_ioconf_virtio_pci,
+		cfattach_ioconf_virtio_pci, cfdata_ioconf_virtio_pci);
+		break;
+	default:
+		error = ENOTTY;
+		break;
+	}
+#endif
+
+	return error;
+}
+

Index: src/sys/modules/virtio/Makefile
diff -u src/sys/modules/virtio/Makefile:1.1 src/sys/modules/virtio/Makefile:1.2
--- src/sys/modules/virtio/Makefile:1.1	Tue Sep 27 03:53:09 2016
+++ src/sys/modules/virtio/Makefile	Wed Jun  6 16:11:36 2018
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.1 2016/09/27 03:53:09 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.2 2018/06/06 16:11:36 jakllsch Exp $
 
 .include "../Makefile.inc"
 
 .PATH:	${S}/dev/pci
 
 KMOD=	virtio
-IOCONF=	virtio.ioconf
 
 SRCS+=	virtio.c
 

Added files:

Index: src/sys/modules/virtio_pci/Makefile
diff -u /dev/null src/sys/modules/virtio_pci/Makefile:1.1
--- /dev/null	Wed Jun  6 16:11:37 2018
+++ src/sys/modules/virtio_pci/Makefile	Wed Jun  6 16:11:36 2018
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2018/06/06 16:11:36 jakllsch Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev/pci
+
+KMOD=	virtio_pci
+IOCONF=	virtio_pci.ioconf
+
+SRCS+=	virtio_pci.c
+
+CPPFLAGS+=	-DDIAGNOSTIC
+
+.include 
Index: src/sys/modules/virtio_pci/virtio_pci.ioconf
diff -u /dev/null src/sys/modules/virtio_pci/virtio_pci.ioconf:1.1
--- /dev/null	Wed Jun  6 16:11:37 2018
+++ src/sys/modules/virtio_pci/virtio_pci.ioconf	Wed Jun  6 16:11:36 2018
@@ -0,0 +1,10 @@
+#   $NetBSD: virtio_pci.ioconf,v 1.1 2018/06/06 16:11:36 jakllsch Exp $
+
+ioconf virtio_pci
+
+include "conf/files"
+include "dev/pci/files.pci"
+
+pseudo-root pci*
+
+virtio* at pci? dev ? function ?



CVS commit: src/external/cddl/osnet/dev/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 15:54:03 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/dtrace: dtrace_hacks.c

Log Message:
Correct compilation of osnet/dev/dtrace/dtrace_hacks.c under Clang

Use __UNCONST() to remove const from an argument.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c

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

Modified files:

Index: src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c
diff -u src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c:1.6 src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c:1.7
--- src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c:1.6	Mon May 28 21:05:03 2018
+++ src/external/cddl/osnet/dev/dtrace/dtrace_hacks.c	Wed Jun  6 15:54:03 2018
@@ -1,13 +1,15 @@
-/*	$NetBSD: dtrace_hacks.c,v 1.6 2018/05/28 21:05:03 chs Exp $	*/
+/*	$NetBSD: dtrace_hacks.c,v 1.7 2018/06/06 15:54:03 kamil Exp $	*/
 
 /* $FreeBSD: head/sys/cddl/dev/dtrace/dtrace_hacks.c 281916 2015-04-24 03:19:30Z markj $ */
 /* XXX Hacks */
 
+#include 
+
 dtrace_cacheid_t dtrace_predcache_id;
 
 boolean_t
 priv_policy_only(const cred_t *cr, int b, boolean_t c)
 {
 
-	return kauth_authorize_generic(cr, KAUTH_GENERIC_ISSUSER, NULL) == 0;
+	return kauth_authorize_generic(__UNCONST(cr), KAUTH_GENERIC_ISSUSER, NULL) == 0;
 }



CVS commit: [netbsd-7] src/doc

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:50:23 UTC 2018

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

Log Message:
Tickets #1607 - #1615


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.90 -r1.1.2.91 src/doc/CHANGES-7.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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.90 src/doc/CHANGES-7.2:1.1.2.91
--- src/doc/CHANGES-7.2:1.1.2.90	Tue May 22 17:36:10 2018
+++ src/doc/CHANGES-7.2	Wed Jun  6 15:50:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.90 2018/05/22 17:36:10 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.91 2018/06/06 15:50:23 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5487,3 +5487,56 @@ sys/kern/uipc_mbuf.c1.214
 	remove the M_READONLY check. The initial code was correct.
 	[maxv, ticket #1606]
 
+sys/netinet/udp_usrreq.c			1.237 (patch)
+
+	Fix bad/wrong memory deallocations and dangling pointer
+	issues in NAT-T.
+	[maxv, ticket #1607]
+
+external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata 1.4
+external/mit/xorg/lib/xkeyboard-config/rules/Makefile 1.4
+
+	Generate xml files properly.
+	[youri, ticket #1608]
+
+usr.bin/tr/str.c1.30
+
+	Do not accept invalid octal character values (>= 0400).
+	[leot, ticket #1609]
+
+usr.bin/look/look.c1.17
+
+	Properly check mmap(2) return value.
+	[leot, ticket #1610]
+
+external/mpl/dhcp/dist/common/bpf.c		1.3 (patch)
+(as external/bsd/dhcp/dist/common/bpf.c)
+
+	Handle carp interfaces.
+	[maya, ticket #1611]
+
+sbin/fsck_lfs/bufcache.c			1.20
+sbin/fsck_lfs/bufcache.h			1.14
+
+	Fix incore(), use a 64bit logical block number.
+	[maya, ticket #1612]
+
+sys/dev/usb/if_urtwn.c1.53
+sys/dev/usb/usbdevs1.733
+sys/dev/usb/usbdevs.h(regen)
+sys/dev/usb/usbdevs_data.h			(regen)
+
+	Add TP-Link TL-WN722N v2.
+	[maya, ticket #1613]
+
+
+sys/dev/pci/mpii.c1.9
+
+	Call malloc with M_NOWAIT to avoid a sleep-in-interrupt.
+	[maya, ticket #1614]
+
+usr.sbin/makefs/ffs.c1.70
+
+	Fix makefs UFS2 lazy inode initialization.
+	[maya, ticket #1615]
+



CVS commit: [netbsd-7] src/usr.sbin/makefs

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:49:02 UTC 2018

Modified Files:
src/usr.sbin/makefs [netbsd-7]: ffs.c

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

usr.sbin/makefs/ffs.c: revision 1.70

PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.

If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912


To generate a diff of this commit:
cvs rdiff -u -r1.63.6.1 -r1.63.6.2 src/usr.sbin/makefs/ffs.c

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

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.63.6.1 src/usr.sbin/makefs/ffs.c:1.63.6.2
--- src/usr.sbin/makefs/ffs.c:1.63.6.1	Tue Apr 14 05:08:09 2015
+++ src/usr.sbin/makefs/ffs.c	Wed Jun  6 15:49:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $	*/
+/*	$NetBSD: ffs.c,v 1.63.6.2 2018/06/06 15:49:02 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.63.6.2 2018/06/06 15:49:02 martin Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -1102,7 +1102,7 @@ ffs_write_inode(union dinode *dp, uint32
 	 * Initialize inode blocks on the fly for UFS2.
 	 */
 	initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap);
-	if (ffs_opts->version == 2 &&
+	while (ffs_opts->version == 2 &&
 	(uint32_t)(cgino + FFS_INOPB(fs)) > initediblk &&
 	initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
 		memset(buf, 0, fs->fs_bsize);



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

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:46:16 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-7]: mpii.c

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

sys/dev/pci/mpii.c: revision 1.9

PR/52330: Jia-Ju Bai: mpii driver: a sleep-in-interrupt bug in mpii_intr
Since the enclosing routime mpii_event_raid already calls malloc with
M_NOWAIT, fix the cache routine to do the same. While there check the
result of the cache routine and change some error prints to aprint.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/dev/pci/mpii.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/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.5 src/sys/dev/pci/mpii.c:1.5.4.1
--- src/sys/dev/pci/mpii.c:1.5	Sat Mar 29 19:28:25 2014
+++ src/sys/dev/pci/mpii.c	Wed Jun  6 15:46:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.5 2014/03/29 19:28:25 christos Exp $ */
+/* $NetBSD: mpii.c,v 1.5.4.1 2018/06/06 15:46:16 martin Exp $ */
 /*	OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp 	*/
 /*
  * Copyright (c) 2010 Mike Belopuhov 
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.5 2014/03/29 19:28:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.5.4.1 2018/06/06 15:46:16 martin Exp $");
 
 #include "bio.h"
 
@@ -3434,26 +3434,34 @@ mpii_event_raid(struct mpii_softc *sc, s
 			case MPII_EVT_IR_CFG_ELEMENT_RC_VOLUME_CREATED:
 if (mpii_find_dev(sc,
 le16toh(ce->vol_dev_handle))) {
-	printf("%s: device %#x is already "
-	"configured\n", DEVNAME(sc),
+	aprint_error_dev(sc->sc_dev,
+	"device %#x is already "
+	"configured\n",
 	le16toh(ce->vol_dev_handle));
 	break;
 }
 dev = malloc(sizeof(*dev), M_DEVBUF,
 M_NOWAIT | M_ZERO);
 if (!dev) {
-	printf("%s: failed to allocate a "
-	"device structure\n", DEVNAME(sc));
+	aprint_error_dev(sc->sc_dev,
+	"can't allocate device structure\n");
 	break;
 }
 SET(dev->flags, MPII_DF_VOLUME);
 dev->slot = sc->sc_vd_id_low;
 dev->dev_handle = le16toh(ce->vol_dev_handle);
 if (mpii_insert_dev(sc, dev)) {
+	aprint_error_dev(sc->sc_dev,
+	"can't insert device structure\n");
+	free(dev, M_DEVBUF);
+	break;
+}
+if (mpii_cache_enable(sc, dev)) {
+	aprint_error_dev(sc->sc_dev,
+	"can't enable device cache\n");
 	free(dev, M_DEVBUF);
 	break;
 }
-mpii_cache_enable(sc, dev);
 sc->sc_vd_count++;
 break;
 			case MPII_EVT_IR_CFG_ELEMENT_RC_REMOVED:
@@ -3515,15 +3523,15 @@ mpii_event_sas(struct mpii_softc *sc, st
 		switch (pe->phy_status & MPII_EVENT_SAS_TOPO_PS_RC_MASK) {
 		case MPII_EVENT_SAS_TOPO_PS_RC_ADDED:
 			if (mpii_find_dev(sc, le16toh(pe->dev_handle))) {
-printf("%s: device %#x is already "
-"configured\n", DEVNAME(sc),
+aprint_error_dev(sc->sc_dev,
+"device %#x is already configured\n",
 le16toh(pe->dev_handle));
 break;
 			}
 			dev = malloc(sizeof(*dev), M_DEVBUF, M_NOWAIT | M_ZERO);
 			if (!dev) {
-printf("%s: failed to allocate a "
-"device structure\n", DEVNAME(sc));
+aprint_error_dev(sc->sc_dev, "can't allocate "
+"device structure\n");
 break;
 			}
 			dev->slot = sc->sc_pd_id_start + tcl->start_phy_num + i;
@@ -3534,6 +3542,8 @@ mpii_event_sas(struct mpii_softc *sc, st
 			dev->enclosure = le16toh(tcl->enclosure_handle);
 			dev->expander = le16toh(tcl->expander_handle);
 			if (mpii_insert_dev(sc, dev)) {
+aprint_error_dev(sc->sc_dev, "can't insert "
+"device structure\n");
 free(dev, M_DEVBUF);
 break;
 			}
@@ -3550,9 +3560,9 @@ mpii_event_sas(struct mpii_softc *sc, st
 DVACT_DEACTIVATE);
 if (scsi_task(mpii_event_defer, sc,
 dev, 0) != 0)
-	printf("%s: unable to run device "
-	"detachment routine\n",
-	DEVNAME(sc));
+	aprint_error_dev(sc->sc_dev, 
+	"unable to run device "
+	"detachment routine\n");
 			}
 #else
 			mpii_event_defer(sc, dev);
@@ -4981,7 +4991,7 @@ mpii_cache_enable(struct mpii_softc *sc,
 		return (EINVAL);
 
 	pagelen = hdr.page_length * 4;
-	vpg = malloc(pagelen, M_TEMP, M_WAITOK | M_CANFAIL | M_ZERO);
+	vpg = malloc(pagelen, M_TEMP, M_NOWAIT | M_ZERO);
 	if (vpg == NULL)
 		return (ENOMEM);
 



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

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:42:31 UTC 2018

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

Log Message:
regen (ticket #1613)


To generate a diff of this commit:
cvs rdiff -u -r1.672.2.8 -r1.672.2.9 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.673.2.8 -r1.673.2.9 src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.672.2.8 src/sys/dev/usb/usbdevs.h:1.672.2.9
--- src/sys/dev/usb/usbdevs.h:1.672.2.8	Wed Apr  5 19:54:20 2017
+++ src/sys/dev/usb/usbdevs.h	Wed Jun  6 15:42:28 2018
@@ -4,7 +4,7 @@
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.680.2.7 2016/12/14 19:16:14 snj Exp
+ *	NetBSD: usbdevs,v 1.680.2.9 2018/06/06 15:41:47 martin Exp
  */
 
 /*
@@ -3261,6 +3261,7 @@
 
 /* TP-Link products */
 #define	USB_PRODUCT_TPLINK_RTL8192CU	0x0100		/* RTL8192CU */
+#define	USB_PRODUCT_TPLINK_RTL8188EU	0x010c		/* RTL8188EU */
 
 /* Trek Technology products */
 #define	USB_PRODUCT_TREK_THUMBDRIVE	0x		/* ThumbDrive */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.673.2.8 src/sys/dev/usb/usbdevs_data.h:1.673.2.9
--- src/sys/dev/usb/usbdevs_data.h:1.673.2.8	Wed Apr  5 19:54:20 2017
+++ src/sys/dev/usb/usbdevs_data.h	Wed Jun  6 15:42:28 2018
@@ -4,7 +4,7 @@
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.680.2.7 2016/12/14 19:16:14 snj Exp
+ *	NetBSD: usbdevs,v 1.680.2.9 2018/06/06 15:41:47 martin Exp
  */
 
 /*
@@ -9923,6 +9923,10 @@ const struct usb_product usb_products[] 
 	"RTL8192CU",
 	},
 	{
+	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8188EU,
+	"RTL8188EU",
+	},
+	{
 	USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE,
 	"ThumbDrive",
 	},
@@ -10567,4 +10571,4 @@ const struct usb_product usb_products[] 
 	"Prestige",
 	},
 };
-const int usb_nproducts = 2092;
+const int usb_nproducts = 2093;



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

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:41:47 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: if_urtwn.c usbdevs

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

sys/dev/usb/if_urtwn.c: revision 1.53
sys/dev/usb/usbdevs: revision 1.733

PR/52212 - Kai-Uwe Eckhardt -- add TP-Link TL-WN722N v2


To generate a diff of this commit:
cvs rdiff -u -r1.34.2.3 -r1.34.2.4 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.680.2.8 -r1.680.2.9 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.34.2.3 src/sys/dev/usb/if_urtwn.c:1.34.2.4
--- src/sys/dev/usb/if_urtwn.c:1.34.2.3	Mon Feb 19 19:33:06 2018
+++ src/sys/dev/usb/if_urtwn.c	Wed Jun  6 15:41:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.34.2.3 2018/02/19 19:33:06 snj Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.34.2.4 2018/06/06 15:41:47 martin 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.34.2.3 2018/02/19 19:33:06 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.34.2.4 2018/06/06 15:41:47 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -191,6 +191,7 @@ static const struct urtwn_dev {
 	URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV),
 	URTWN_RTL8188E_DEV(REALTEK, RTL8188EU),
 	URTWN_RTL8188E_DEV(ABOCOM, RTL8188EU),
+	URTWN_RTL8188E_DEV(TPLINK, RTL8188EU),
 
 	/* URTWN_RTL8192EU */
 	URTWN_RTL8192EU_DEV(REALTEK,	RTL8192EU),

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.680.2.8 src/sys/dev/usb/usbdevs:1.680.2.9
--- src/sys/dev/usb/usbdevs:1.680.2.8	Wed Apr  5 19:54:20 2017
+++ src/sys/dev/usb/usbdevs	Wed Jun  6 15:41:47 2018
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.680.2.8 2017/04/05 19:54:20 snj Exp $
+$NetBSD: usbdevs,v 1.680.2.9 2018/06/06 15:41:47 martin Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3254,6 +3254,7 @@ product TOSHIBA HSDPA_MODEM_EU870DT1	0x1
 
 /* TP-Link products */
 product TPLINK RTL8192CU	0x0100	RTL8192CU
+product TPLINK RTL8188EU	0x010c	RTL8188EU
 
 /* Trek Technology products */
 product TREK THUMBDRIVE		0x	ThumbDrive



CVS commit: [netbsd-7] src/sbin/fsck_lfs

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:38:05 UTC 2018

Modified Files:
src/sbin/fsck_lfs [netbsd-7]: bufcache.c bufcache.h

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

sbin/fsck_lfs/bufcache.h: revision 1.14
sbin/fsck_lfs/bufcache.c: revision 1.20

PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.11 -r1.11.38.1 src/sbin/fsck_lfs/bufcache.h

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

Modified files:

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.14 src/sbin/fsck_lfs/bufcache.c:1.14.4.1
--- src/sbin/fsck_lfs/bufcache.c:1.14	Sat Oct 19 01:09:58 2013
+++ src/sbin/fsck_lfs/bufcache.c	Wed Jun  6 15:38:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.14 2013/10/19 01:09:58 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.14.4.1 2018/06/06 15:38:05 martin Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -193,7 +193,7 @@ bremfree(struct ubuf * bp)
 
 /* Return a buffer if it is in the cache, otherwise return NULL. */
 struct ubuf *
-incore(struct uvnode * vp, int lbn)
+incore(struct uvnode * vp, daddr_t lbn)
 {
 	struct ubuf *bp;
 	int hash, depth;

Index: src/sbin/fsck_lfs/bufcache.h
diff -u src/sbin/fsck_lfs/bufcache.h:1.11 src/sbin/fsck_lfs/bufcache.h:1.11.38.1
--- src/sbin/fsck_lfs/bufcache.h:1.11	Fri May 16 09:21:59 2008
+++ src/sbin/fsck_lfs/bufcache.h	Wed Jun  6 15:38:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.h,v 1.11 2008/05/16 09:21:59 hannken Exp $	*/
+/*	$NetBSD: bufcache.h,v 1.11.38.1 2018/06/06 15:38:05 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@ void bufrehash(int);
 void bufstats(void);
 void buf_destroy(struct ubuf *);
 void bremfree(struct ubuf *);
-struct ubuf *incore(struct uvnode *, int);
+struct ubuf *incore(struct uvnode *, daddr_t);
 struct ubuf *getblk(struct uvnode *, daddr_t, int);
 void bwrite(struct ubuf *);
 void brelse(struct ubuf *, int);



CVS commit: [netbsd-7] src/external/bsd/dhcp/dist/common

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:31:58 UTC 2018

Modified Files:
src/external/bsd/dhcp/dist/common [netbsd-7]: bpf.c

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

external/mpl/dhcp/dist/common/bpf.c: revision 1.3
(via patch, applied to src/external/bsd/dhcp/dist/common/bpf.c)

PR/50893: Bruce Lilly: Handle carp interfaces.

XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.2.1 src/external/bsd/dhcp/dist/common/bpf.c

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

Modified files:

Index: src/external/bsd/dhcp/dist/common/bpf.c
diff -u src/external/bsd/dhcp/dist/common/bpf.c:1.3 src/external/bsd/dhcp/dist/common/bpf.c:1.3.2.1
--- src/external/bsd/dhcp/dist/common/bpf.c:1.3	Sat Jul 12 12:09:37 2014
+++ src/external/bsd/dhcp/dist/common/bpf.c	Wed Jun  6 15:31:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.3 2014/07/12 12:09:37 spz Exp $	*/
+/*	$NetBSD: bpf.c,v 1.3.2.1 2018/06/06 15:31:58 martin Exp $	*/
 /* bpf.c
 
BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -35,7 +35,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: bpf.c,v 1.3 2014/07/12 12:09:37 spz Exp $");
+__RCSID("$NetBSD: bpf.c,v 1.3.2.1 2018/06/06 15:31:58 martin Exp $");
 
 #include "dhcpd.h"
 #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE)	\
@@ -623,6 +623,9 @@ get_hw_addr(const char *name, struct har
 	 */
 switch (sa->sdl_type) {
 case IFT_ETHER:
+#ifdef IFT_CARP
+			case IFT_CARP:
+#endif
 hw->hlen = sa->sdl_alen + 1;
 hw->hbuf[0] = HTYPE_ETHER;
 memcpy(>hbuf[1], LLADDR(sa), sa->sdl_alen);



CVS commit: src/external/cddl/osnet/dist/uts/common/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 15:24:57 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/dtrace: dtrace.c

Log Message:
Correct compilation of osnet/dist/uts/common/dtrace/dtrace.c under Clang

Add missing const keywords in dtrace_strncmp().

Initialize lim1 and lim2 to zero always. This prevents a false positive
about potentially unset but used variable.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.36 src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.37
--- src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.36	Mon May 28 21:05:06 2018
+++ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c	Wed Jun  6 15:24:57 2018
@@ -1263,7 +1263,7 @@ dtrace_strtoll(char *input, int base, si
  * Compare two strings using safe loads.
  */
 static int
-dtrace_strncmp(char *s1, char *s2, size_t limit)
+dtrace_strncmp(const char *s1, const char *s2, size_t limit)
 {
 	uint8_t c1, c2;
 	volatile uint16_t *flags;
@@ -6592,7 +6592,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, 
 			size_t sz = state->dts_options[DTRACEOPT_STRSIZE];
 			uintptr_t s1 = regs[r1];
 			uintptr_t s2 = regs[r2];
-			size_t lim1, lim2;
+			size_t lim1 = 0, lim2 = 0;
 
 			if (s1 != 0 &&
 			!dtrace_strcanload(s1, sz, , mstate, vstate))



CVS commit: src/sys/modules/dtrace/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 15:15:41 UTC 2018

Modified Files:
src/sys/modules/dtrace/dtrace: Makefile

Log Message:
Restrict -Wno-unused-but-set-variable in sys/modules/dtrace/dtrace to GCC

Clang/LLVM does not recognize it.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/modules/dtrace/dtrace/Makefile

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

Modified files:

Index: src/sys/modules/dtrace/dtrace/Makefile
diff -u src/sys/modules/dtrace/dtrace/Makefile:1.7 src/sys/modules/dtrace/dtrace/Makefile:1.8
--- src/sys/modules/dtrace/dtrace/Makefile:1.7	Wed Jun  6 15:01:13 2018
+++ src/sys/modules/dtrace/dtrace/Makefile	Wed Jun  6 15:15:41 2018
@@ -54,8 +54,10 @@ COPTS.dis_tables.c+= \
 		-Wno-parentheses \
 		-Wno-uninitialized
 
+.if defined(HAVE_GCC)
 COPTS.dtrace.c+= \
-		-Wno-unused-but-set-variable \
+		-Wno-unused-but-set-variable
+.endif
 
 COPTS.dtrace_subr.c+= \
 		-Wno-unused-value



CVS commit: [netbsd-7] src/usr.bin/look

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:15:01 UTC 2018

Modified Files:
src/usr.bin/look [netbsd-7]: look.c

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

usr.bin/look/look.c: revision 1.17

Properly check mmap(2) return value. We can end up with a segmentation
fault if the user does not provide a regular file as look(1) file
argument.

Kindly reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.10.1 src/usr.bin/look/look.c

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

Modified files:

Index: src/usr.bin/look/look.c
diff -u src/usr.bin/look/look.c:1.16 src/usr.bin/look/look.c:1.16.10.1
--- src/usr.bin/look/look.c:1.16	Thu Feb 23 22:57:53 2012
+++ src/usr.bin/look/look.c	Wed Jun  6 15:15:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: look.c,v 1.16 2012/02/23 22:57:53 joerg Exp $	*/
+/*	$NetBSD: look.c,v 1.16.10.1 2018/06/06 15:15:01 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)look.c	8.2 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: look.c,v 1.16 2012/02/23 22:57:53 joerg Exp $");
+__RCSID("$NetBSD: look.c,v 1.16.10.1 2018/06/06 15:15:01 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -147,7 +147,7 @@ main(int argc, char *argv[])
 		err(2, "%s", file);
 	}
 	if ((front = mmap(NULL, len,
-	PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0)) == NULL)
+	PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED)
 		err(2, "%s", file);
 	back = front + len;
 	exit(look(string, front, back));



CVS commit: [netbsd-7] src/usr.bin/tr

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:13:00 UTC 2018

Modified Files:
src/usr.bin/tr [netbsd-7]: str.c

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

usr.bin/tr/str.c: revision 1.30

Do not accept invalid octal character values (>= 0400).

This also avoid possible stack corruption (e.g. previously `tr -s '\400'' or
similars lead to them).

Reviewed and thanks to !


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.4.1 src/usr.bin/tr/str.c

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

Modified files:

Index: src/usr.bin/tr/str.c
diff -u src/usr.bin/tr/str.c:1.29 src/usr.bin/tr/str.c:1.29.4.1
--- src/usr.bin/tr/str.c:1.29	Sun Aug 11 01:54:35 2013
+++ src/usr.bin/tr/str.c	Wed Jun  6 15:13:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.29 2013/08/11 01:54:35 dholland Exp $	*/
+/*	$NetBSD: str.c,v 1.29.4.1 2018/06/06 15:13:00 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)str.c	8.2 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: str.c,v 1.29 2013/08/11 01:54:35 dholland Exp $");
+__RCSID("$NetBSD: str.c,v 1.29.4.1 2018/06/06 15:13:00 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -417,6 +417,8 @@ backslash(STR *s)
 	}
 	if (cnt) {
 		/* We saw digits, so return their value */
+		if (val >= OOBCH)
+			errx(1, "Invalid octal character value");
 		return val;
 	}
 	if (ch == '\0') {



CVS commit: [netbsd-7] src/external/mit/xorg/lib/xkeyboard-config

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 15:09:51 UTC 2018

Modified Files:
src/external/mit/xorg/lib/xkeyboard-config [netbsd-7]: Makefile.xkbdata
src/external/mit/xorg/lib/xkeyboard-config/rules [netbsd-7]: Makefile

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

external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata: revision 1.4
external/mit/xorg/lib/xkeyboard-config/rules/Makefile: revision 1.4

Generate xml files properly. Noted by youri.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.28.1 \
src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata
cvs rdiff -u -r1.3 -r1.3.24.1 \
src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata
diff -u src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata:1.1 src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata:1.1.28.1
--- src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata:1.1	Thu Jun 11 01:49:20 2009
+++ src/external/mit/xorg/lib/xkeyboard-config/Makefile.xkbdata	Wed Jun  6 15:09:51 2018
@@ -1,9 +1,15 @@
-#	$NetBSD: Makefile.xkbdata,v 1.1 2009/06/11 01:49:20 mrg Exp $
+#	$NetBSD: Makefile.xkbdata,v 1.1.28.1 2018/06/06 15:09:51 martin Exp $
 
 XKBDISTDIR=	${X11SRCDIR.xkeyboard-config}/${XKBNAME}
 
 .PATH:		${XKBDISTDIR}
 
+.SUFFIXES: .in
+
+.in:
+	${TOOL_SED} -e 's,<_,<,g' -e 's, ${.TARGET}
+
+
 FILESDIR=	${X11LIBDIR}/xkb/${XKBNAME}
 
 

Index: src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile
diff -u src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile:1.3 src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile:1.3.24.1
--- src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile:1.3	Sat May 29 07:58:24 2010
+++ src/external/mit/xorg/lib/xkeyboard-config/rules/Makefile	Wed Jun  6 15:09:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2010/05/29 07:58:24 ghen Exp $
+#	$NetBSD: Makefile,v 1.3.24.1 2018/06/06 15:09:51 martin Exp $
 #
 #	When upgrading, re-assemble the files base, base.lst, evdev and
 #	evdev.lst by running ./configure && make in the dist directory,
@@ -7,14 +7,14 @@
 .include 
 
 XKBNAME=	rules
-FILES=		README base base.lst base.extras.xml.in base.xml.in \
-		evdev evdev.lst evdev.extras.xml.in evdev.xml.in \
-		xfree98 xkb.dtd
-
-FILESNAME_base.xml.in=		base.xml
-FILESNAME_base.extras.xml.in=	base.extras.xml
-FILESNAME_evdev.xml.in=		evdev.xml
-FILESNAME_evdev.extras.xml.in=	evdev.extras.xml
+GENFILES=	base.extras.xml base.xml evdev.extras.xml evdev.xml
+FILES=		README base base.lst evdev evdev.lst xfree98 xkb.dtd
+FILES+=		${GENFILES}
+CLEAN+=		${GENFILES}
+
+.for i in ${GENFILES}
+FILESBUILD_${i}=	yes
+.endfor
 
 SYMLINKS=	base ${FILESDIR}/xorg \
 		base.lst ${FILESDIR}/xorg.lst \



CVS commit: src

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 15:01:13 UTC 2018

Modified Files:
src/external/cddl/osnet: Makefile.zfs
src/sys/modules/dtrace/dtrace: Makefile
src/sys/modules/dtrace/linux32_syscall: Makefile
src/sys/modules/dtrace/linux_syscall: Makefile
src/sys/modules/dtrace/netbsd32_syscall: Makefile
src/sys/modules/dtrace/profile: Makefile
src/sys/modules/dtrace/syscall: Makefile

Log Message:
Swap conditions HAVE_LLVM -> HAVE_GCC


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/Makefile.zfs
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/dtrace/dtrace/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/linux32_syscall/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/linux_syscall/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/netbsd32_syscall/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/dtrace/profile/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/syscall/Makefile

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

Modified files:

Index: src/external/cddl/osnet/Makefile.zfs
diff -u src/external/cddl/osnet/Makefile.zfs:1.6 src/external/cddl/osnet/Makefile.zfs:1.7
--- src/external/cddl/osnet/Makefile.zfs:1.6	Wed Jun  6 14:47:54 2018
+++ src/external/cddl/osnet/Makefile.zfs	Wed Jun  6 15:01:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zfs,v 1.6 2018/06/06 14:47:54 kamil Exp $
+#	$NetBSD: Makefile.zfs,v 1.7 2018/06/06 15:01:13 kamil Exp $
 
 .include 
 
@@ -42,7 +42,7 @@ CPPFLAGS+=  -I${ZFSDIR}/dist/common
 CWARNFLAGS+=	-Wno-missing-field-initializers
 CWARNFLAGS+=	-Wno-strict-prototypes
 CWARNFLAGS+=	-Wno-cast-qual
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CWARNFLAGS+=	-Wno-discarded-qualifiers
 .endif
 CWARNFLAGS+=	-Wno-switch

Index: src/sys/modules/dtrace/dtrace/Makefile
diff -u src/sys/modules/dtrace/dtrace/Makefile:1.6 src/sys/modules/dtrace/dtrace/Makefile:1.7
--- src/sys/modules/dtrace/dtrace/Makefile:1.6	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/dtrace/Makefile	Wed Jun  6 15:01:13 2018
@@ -44,7 +44,7 @@ CPPFLAGS+=	-Wno-unknown-pragmas \
 		-Wno-unused-variable \
 		-Wno-unused-function
 
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CPPFLAGS+=	 -Wno-discarded-qualifiers
 .endif
 

Index: src/sys/modules/dtrace/linux32_syscall/Makefile
diff -u src/sys/modules/dtrace/linux32_syscall/Makefile:1.3 src/sys/modules/dtrace/linux32_syscall/Makefile:1.4
--- src/sys/modules/dtrace/linux32_syscall/Makefile:1.3	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/linux32_syscall/Makefile	Wed Jun  6 15:01:13 2018
@@ -13,7 +13,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 
 CPPFLAGS+=	-Wno-unknown-pragmas
 
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CPPFLAGS+=	-Wno-discarded-qualifiers
 .endif
 

Index: src/sys/modules/dtrace/linux_syscall/Makefile
diff -u src/sys/modules/dtrace/linux_syscall/Makefile:1.3 src/sys/modules/dtrace/linux_syscall/Makefile:1.4
--- src/sys/modules/dtrace/linux_syscall/Makefile:1.3	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/linux_syscall/Makefile	Wed Jun  6 15:01:13 2018
@@ -14,7 +14,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 CPPFLAGS+=	-Wno-unknown-pragmas \
 		-Wno-discarded-qualifiers
 
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CPPFLAGS+=	-Wno-discarded-qualifiers
 .endif
 

Index: src/sys/modules/dtrace/netbsd32_syscall/Makefile
diff -u src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.3 src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.4
--- src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.3	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/netbsd32_syscall/Makefile	Wed Jun  6 15:01:13 2018
@@ -13,7 +13,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 
 CPPFLAGS+=	-Wno-unknown-pragmas
 
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CPPFLAGS+=	-Wno-discarded-qualifiers
 .endif
 

Index: src/sys/modules/dtrace/profile/Makefile
diff -u src/sys/modules/dtrace/profile/Makefile:1.4 src/sys/modules/dtrace/profile/Makefile:1.5
--- src/sys/modules/dtrace/profile/Makefile:1.4	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/profile/Makefile	Wed Jun  6 15:01:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2018/06/06 14:57:38 kamil Exp $
+# $NetBSD: Makefile,v 1.5 2018/06/06 15:01:13 kamil Exp $
 
 .include "../../Makefile.inc"
 
@@ -13,7 +13,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 
 CPPFLAGS+=	-Wno-unknown-pragmas -Wno-cast-qual
 
-.if defined(HAVE_LLVM)
+.if defined(HAVE_GCC)
 CPPFLAGS+=	-Wno-discarded-qualifiers
 .endif
 

Index: src/sys/modules/dtrace/syscall/Makefile
diff -u src/sys/modules/dtrace/syscall/Makefile:1.3 src/sys/modules/dtrace/syscall/Makefile:1.4
--- src/sys/modules/dtrace/syscall/Makefile:1.3	Wed Jun  6 14:57:38 2018
+++ src/sys/modules/dtrace/syscall/Makefile	Wed Jun  6 15:01:13 2018
@@ -13,7 +13,7 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 
 CPPFLAGS+=	-Wno-unknown-pragmas
 
-.if 

CVS commit: src/sys/modules/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 14:57:38 UTC 2018

Modified Files:
src/sys/modules/dtrace/dtrace: Makefile
src/sys/modules/dtrace/linux32_syscall: Makefile
src/sys/modules/dtrace/linux_syscall: Makefile
src/sys/modules/dtrace/netbsd32_syscall: Makefile
src/sys/modules/dtrace/profile: Makefile
src/sys/modules/dtrace/syscall: Makefile

Log Message:
Restrict -Wno-discarded-qualifiers in sys/modules/dtrace/* to GCC

Clang/LLVM does not recognize it.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/dtrace/dtrace/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/linux32_syscall/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/linux_syscall/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/netbsd32_syscall/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/profile/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/syscall/Makefile

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

Modified files:

Index: src/sys/modules/dtrace/dtrace/Makefile
diff -u src/sys/modules/dtrace/dtrace/Makefile:1.5 src/sys/modules/dtrace/dtrace/Makefile:1.6
--- src/sys/modules/dtrace/dtrace/Makefile:1.5	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/dtrace/Makefile	Wed Jun  6 14:57:38 2018
@@ -42,9 +42,12 @@ CPPFLAGS+=	-I${OSNETDIR}/sys \
 CPPFLAGS+=	-Wno-unknown-pragmas \
 		-Wno-shadow \
 		-Wno-unused-variable \
-		-Wno-discarded-qualifiers \
 		-Wno-unused-function
 
+.if defined(HAVE_LLVM)
+CPPFLAGS+=	 -Wno-discarded-qualifiers
+.endif
+
 COPTS.dis_tables.c+= \
 		-Wno-missing-field-initializers \
 		-Wno-cast-qual \

Index: src/sys/modules/dtrace/linux32_syscall/Makefile
diff -u src/sys/modules/dtrace/linux32_syscall/Makefile:1.2 src/sys/modules/dtrace/linux32_syscall/Makefile:1.3
--- src/sys/modules/dtrace/linux32_syscall/Makefile:1.2	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/linux32_syscall/Makefile	Wed Jun  6 14:57:38 2018
@@ -11,7 +11,10 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dev/dtrace
 
-CPPFLAGS+=	-Wno-unknown-pragmas \
-		-Wno-discarded-qualifiers
+CPPFLAGS+=	-Wno-unknown-pragmas
+
+.if defined(HAVE_LLVM)
+CPPFLAGS+=	-Wno-discarded-qualifiers
+.endif
 
 .include 

Index: src/sys/modules/dtrace/linux_syscall/Makefile
diff -u src/sys/modules/dtrace/linux_syscall/Makefile:1.2 src/sys/modules/dtrace/linux_syscall/Makefile:1.3
--- src/sys/modules/dtrace/linux_syscall/Makefile:1.2	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/linux_syscall/Makefile	Wed Jun  6 14:57:38 2018
@@ -14,4 +14,8 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 CPPFLAGS+=	-Wno-unknown-pragmas \
 		-Wno-discarded-qualifiers
 
+.if defined(HAVE_LLVM)
+CPPFLAGS+=	-Wno-discarded-qualifiers
+.endif
+
 .include 

Index: src/sys/modules/dtrace/netbsd32_syscall/Makefile
diff -u src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.2 src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.3
--- src/sys/modules/dtrace/netbsd32_syscall/Makefile:1.2	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/netbsd32_syscall/Makefile	Wed Jun  6 14:57:38 2018
@@ -11,7 +11,10 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dev/dtrace
 
-CPPFLAGS+=	-Wno-unknown-pragmas \
-		-Wno-discarded-qualifiers
+CPPFLAGS+=	-Wno-unknown-pragmas
+
+.if defined(HAVE_LLVM)
+CPPFLAGS+=	-Wno-discarded-qualifiers
+.endif
 
 .include 

Index: src/sys/modules/dtrace/profile/Makefile
diff -u src/sys/modules/dtrace/profile/Makefile:1.3 src/sys/modules/dtrace/profile/Makefile:1.4
--- src/sys/modules/dtrace/profile/Makefile:1.3	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/profile/Makefile	Wed Jun  6 14:57:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/05/28 21:05:01 chs Exp $
+# $NetBSD: Makefile,v 1.4 2018/06/06 14:57:38 kamil Exp $
 
 .include "../../Makefile.inc"
 
@@ -11,6 +11,10 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dev/profile \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common
 
-CPPFLAGS+=	-Wno-unknown-pragmas -Wno-cast-qual -Wno-discarded-qualifiers
+CPPFLAGS+=	-Wno-unknown-pragmas -Wno-cast-qual
+
+.if defined(HAVE_LLVM)
+CPPFLAGS+=	-Wno-discarded-qualifiers
+.endif
 
 .include 

Index: src/sys/modules/dtrace/syscall/Makefile
diff -u src/sys/modules/dtrace/syscall/Makefile:1.2 src/sys/modules/dtrace/syscall/Makefile:1.3
--- src/sys/modules/dtrace/syscall/Makefile:1.2	Mon May 28 21:05:01 2018
+++ src/sys/modules/dtrace/syscall/Makefile	Wed Jun  6 14:57:38 2018
@@ -11,7 +11,10 @@ CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cd
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dev/dtrace
 

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

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 14:51:16 UTC 2018

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

Log Message:
Ticket #1607


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

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.105 src/doc/CHANGES-7.0.3:1.1.2.106
--- src/doc/CHANGES-7.0.3:1.1.2.105	Tue May 22 17:38:48 2018
+++ src/doc/CHANGES-7.0.3	Wed Jun  6 14:51:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.105 2018/05/22 17:38:48 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.106 2018/06/06 14:51:16 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5442,3 +5442,9 @@ sys/kern/uipc_mbuf.c1.214
 	remove the M_READONLY check. The initial code was correct.
 	[maxv, ticket #1606]
 
+sys/netinet/udp_usrreq.c			1.237 (patch)
+
+	Fix bad/wrong memory deallocations and dangling pointer
+	issues in NAT-T.
+	[maxv, ticket #1607]
+



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

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 14:50:21 UTC 2018

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

Log Message:
Ticket #1607


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

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.12 src/doc/CHANGES-7.1.3:1.1.2.13
--- src/doc/CHANGES-7.1.3:1.1.2.12	Tue May 22 17:37:15 2018
+++ src/doc/CHANGES-7.1.3	Wed Jun  6 14:50:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.12 2018/05/22 17:37:15 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.13 2018/06/06 14:50:21 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -134,3 +134,9 @@ sys/kern/uipc_mbuf.c1.214
 	remove the M_READONLY check. The initial code was correct.
 	[maxv, ticket #1606]
 
+sys/netinet/udp_usrreq.c			1.237 (patch)
+
+	Fix bad/wrong memory deallocations and dangling pointer
+	issues in NAT-T.
+	[maxv, ticket #1607]
+



CVS commit: [netbsd-7-1] src/sys/netinet

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 14:49:42 UTC 2018

Modified Files:
src/sys/netinet [netbsd-7-1]: udp_usrreq.c

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

sys/netinet/udp_usrreq.c: revision 1.237 (via patch)

Fix three pretty bad mistakes in NAT-T:

 * If we got a keepalive packet, we need to call m_freem, not m_free.
   Here the next mbufs in the chain are not freed. Seems easy to remotely
   DoS the system by sending fragmented keepalives in a loop.

 * If !ipsec_used, free the mbuf.

 * In udp_input, we need to update 'uh', because udp4_realinput may have
   modified the chain. Perhaps we also need to re-enforce alignment, so
   add an XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.217.10.1 src/sys/netinet/udp_usrreq.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/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.217 src/sys/netinet/udp_usrreq.c:1.217.10.1
--- src/sys/netinet/udp_usrreq.c:1.217	Sat Aug  9 05:33:01 2014
+++ src/sys/netinet/udp_usrreq.c	Wed Jun  6 14:49:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.217.10.1 2018/06/06 14:49:41 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217.10.1 2018/06/06 14:49:41 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -395,7 +395,15 @@ udp_input(struct mbuf *m, ...)
 		 */
 		return;
 	}
+
 	ip = mtod(m, struct ip *);
+	IP6_EXTHDR_GET(uh, struct udphdr *, m, iphlen, sizeof(struct udphdr));
+	if (uh == NULL) {
+		UDP_STATINC(UDP_STAT_HDROPS);
+		return;
+	}
+	/* XXX Re-enforce alignment? */
+
 #ifdef INET6
 	if (IN_MULTICAST(ip->ip_dst.s_addr) || n == 0) {
 		struct sockaddr_in6 src6, dst6;
@@ -1301,7 +1309,7 @@ udp4_espinudp(struct mbuf **mp, int off,
 
 	/* Ignore keepalive packets */
 	if ((len == 1) && (*(unsigned char *)data == 0xff)) {
-		m_free(m);
+		m_freem(m);
 		*mp = NULL; /* avoid any further processiong by caller ... */
 		return 1;
 	}
@@ -1383,7 +1391,8 @@ udp4_espinudp(struct mbuf **mp, int off,
 #ifdef IPSEC
 	if (ipsec_used)
 		ipsec4_common_input(m, iphdrlen, IPPROTO_ESP);
-	/* XXX: else */
+	else
+		m_freem(m);
 #else
 	esp4_input(m, iphdrlen);
 #endif



CVS commit: src/external/cddl/osnet

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 14:47:54 UTC 2018

Modified Files:
src/external/cddl/osnet: Makefile.zfs

Log Message:
Make cddl/osnet/Makefile.zfs compatible with MKLLVM=yes

Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/Makefile.zfs

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

Modified files:

Index: src/external/cddl/osnet/Makefile.zfs
diff -u src/external/cddl/osnet/Makefile.zfs:1.5 src/external/cddl/osnet/Makefile.zfs:1.6
--- src/external/cddl/osnet/Makefile.zfs:1.5	Mon May 28 21:05:02 2018
+++ src/external/cddl/osnet/Makefile.zfs	Wed Jun  6 14:47:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zfs,v 1.5 2018/05/28 21:05:02 chs Exp $
+#	$NetBSD: Makefile.zfs,v 1.6 2018/06/06 14:47:54 kamil Exp $
 
 .include 
 
@@ -42,7 +42,9 @@ CPPFLAGS+=  -I${ZFSDIR}/dist/common
 CWARNFLAGS+=	-Wno-missing-field-initializers
 CWARNFLAGS+=	-Wno-strict-prototypes
 CWARNFLAGS+=	-Wno-cast-qual
+.if defined(HAVE_LLVM)
 CWARNFLAGS+=	-Wno-discarded-qualifiers
+.endif
 CWARNFLAGS+=	-Wno-switch
 CWARNFLAGS+=	-Wno-missing-prototypes
 CWARNFLAGS+=	-Wno-unused-variable



CVS commit: src/external/cddl/osnet/dist/cmd/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 14:46:58 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/cmd/dtrace: dtrace.c

Log Message:
Correct compilation of osnet/dist/cmd/dtrace/dtrace.c under Clang

Add missing const keywords.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c

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

Modified files:

Index: src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.11 src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.12
--- src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:1.11	Mon May 28 21:05:04 2018
+++ src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c	Wed Jun  6 14:46:58 2018
@@ -555,7 +555,7 @@ static void
 print_probe_info(const dtrace_probeinfo_t *p)
 {
 	char buf[BUFSIZ];
-	char *user;
+	const char *user;
 	int i;
 
 	oprintf("\n\tProbe Description Attributes\n");
@@ -1164,8 +1164,8 @@ go(void)
 	int i;
 
 	struct {
-		char *name;
-		char *optname;
+		const char *name;
+		const char *optname;
 		dtrace_optval_t val;
 	} bufs[] = {
 		{ "buffer size", "bufsize" },
@@ -1221,7 +1221,7 @@ go(void)
 
 	for (i = 0; rates[i].name != NULL; i++) {
 		dtrace_optval_t nval;
-		char *dir;
+		const char *dir;
 
 		if (rates[i].val == DTRACEOPT_UNSET)
 			continue;



CVS commit: src/external/cddl/osnet/usr.sbin/dtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 14:31:45 UTC 2018

Modified Files:
src/external/cddl/osnet/usr.sbin/dtrace: Makefile

Log Message:
Make cddl/osnet/usr.sbin/dtrace -W compatible with MKLLVM=yes

Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers
 - -Wno-unused-but-set-variable

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/usr.sbin/dtrace/Makefile

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

Modified files:

Index: src/external/cddl/osnet/usr.sbin/dtrace/Makefile
diff -u src/external/cddl/osnet/usr.sbin/dtrace/Makefile:1.10 src/external/cddl/osnet/usr.sbin/dtrace/Makefile:1.11
--- src/external/cddl/osnet/usr.sbin/dtrace/Makefile:1.10	Mon May 28 21:05:11 2018
+++ src/external/cddl/osnet/usr.sbin/dtrace/Makefile	Wed Jun  6 14:31:45 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2018/05/28 21:05:11 chs Exp $
+#	$NetBSD: Makefile,v 1.11 2018/06/06 14:31:45 kamil Exp $
 
 # $FreeBSD: head/cddl/usr.sbin/dtrace/Makefile 314654 2017-03-04 11:30:04Z ngie $
 
@@ -32,9 +32,11 @@ COPTS.dtrace.c += -Wno-stack-protector
 COPTS.dtrace.c += -Wno-format-extra-args
 
 COPTS.dtrace.c += -Wno-shadow
+.if defined(HAVE_GCC)
 COPTS.dtrace.c += -Wno-discarded-qualifiers
-COPTS.dtrace.c += -Wno-missing-field-initializers
 COPTS.dtrace.c += -Wno-unused-but-set-variable
+.endif
+COPTS.dtrace.c += -Wno-missing-field-initializers
 COPTS.dtrace.c += -Wno-format
 
 LDFLAGS+=	-pthread



CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 14:18:39 UTC 2018

Modified Files:
src/external/cddl/osnet/lib/libdtrace: Makefile

Log Message:
Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes

Clang/LLVM does not recognize:
 - -Wno-maybe-uninitialized
 - -Wno-unused-but-set-variable

MKGCC=yes still builds the distribution.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/cddl/osnet/lib/libdtrace/Makefile

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

Modified files:

Index: src/external/cddl/osnet/lib/libdtrace/Makefile
diff -u src/external/cddl/osnet/lib/libdtrace/Makefile:1.17 src/external/cddl/osnet/lib/libdtrace/Makefile:1.18
--- src/external/cddl/osnet/lib/libdtrace/Makefile:1.17	Mon May 28 21:05:09 2018
+++ src/external/cddl/osnet/lib/libdtrace/Makefile	Wed Jun  6 14:18:39 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2018/05/28 21:05:09 chs Exp $
+#	$NetBSD: Makefile,v 1.18 2018/06/06 14:18:39 kamil Exp $
 
 # $FreeBSD: head/cddl/lib/libdtrace/Makefile 314654 2017-03-04 11:30:04Z ngie $
 
@@ -86,9 +86,14 @@ COPTS.dt_program.c	+= -Wno-stack-protect
 COPTS.dt_provider.c	+= -Wno-stack-protector
 COPTS.dt_subr.c		+= -Wno-stack-protector
 
-COPTS.dt_consume.c	+= -Wno-parentheses -Wno-maybe-uninitialized
+COPTS.dt_consume.c	+= -Wno-parentheses
+.if defined(HAVE_GCC)
+COPTS.dt_consume.c	+= -Wno-maybe-uninitialized
+.endif
 COPTS.dt_options.c	+= -Wno-parentheses
+.if defined(HAVE_GCC)
 COPTS.dt_pid.c		+= -Wno-unused-but-set-variable
+.endif
 COPTS.dt_isadep.c	+= -Wno-unused-variable
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
@@ -96,7 +101,10 @@ CPPFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/
 CPPFLAGS+=	-I${.CURDIR}/../../dev/dtrace/x86
 .PATH:		${.CURDIR}/../../dist/lib/libdtrace/i386 ${.CURDIR}/../../dev/dtrace/x86
 SRCS+=		dis_tables.c
-COPTS.dis_tables.c	+= -Wno-parentheses -Wno-maybe-uninitialized
+COPTS.dis_tables.c	+= -Wno-parentheses
+.if defined(HAVE_GCC)
+COPTS.dis_tables.c	+= -Wno-maybe-uninitialized
+.endif
 .elif ${MACHINE_ARCH} == "sparc64"
 CPPFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
 .elif ${MACHINE_CPU} == "arm"



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

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 13:18:44 UTC 2018

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

Log Message:
Fix previous

The failing tests are for vfork(2), not fork(2).


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.62 src/tests/lib/libc/sys/t_ptrace_wait.c:1.63
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.62	Wed Jun  6 13:16:32 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Jun  6 13:18:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.62 2018/06/06 13:16:32 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.63 2018/06/06 13:18:44 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.62 2018/06/06 13:16:32 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.63 2018/06/06 13:18:44 kamil Exp $");
 
 #include 
 #include 
@@ -191,10 +191,6 @@ traceme_crash(int sig)
 
 	memset(, 0, sizeof(info));
 
-	if (sig == SIGBUS) {
-		atf_tc_expect_fail("lib/53343");
-	}
-
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -873,6 +869,10 @@ traceme_vfork_crash(int sig)
 	int status;
 #endif
 
+	if (sig == SIGBUS) {
+		atf_tc_expect_fail("lib/53343");
+	}
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = vfork()) != -1);
 	if (child == 0) {



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

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 13:16:32 UTC 2018

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

Log Message:
Mark sigbus ATF tests in t_ptrace_wait as expected failure

They are breaking right now on all ports.

lib/53343


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.61 src/tests/lib/libc/sys/t_ptrace_wait.c:1.62
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.61	Fri Jun  1 05:48:29 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Jun  6 13:16:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.61 2018/06/01 05:48:29 kre Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.62 2018/06/06 13:16:32 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.61 2018/06/01 05:48:29 kre Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.62 2018/06/06 13:16:32 kamil Exp $");
 
 #include 
 #include 
@@ -191,6 +191,10 @@ traceme_crash(int sig)
 
 	memset(, 0, sizeof(info));
 
+	if (sig == SIGBUS) {
+		atf_tc_expect_fail("lib/53343");
+	}
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {



CVS commit: src/external/bsd/libc++/lib

2018-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun  6 12:02:43 UTC 2018

Modified Files:
src/external/bsd/libc++/lib: Makefile

Log Message:
Don't pass -z defs to libc++ with MKSANITIZER=yes

Sanitizers are conflicting with this option:

  When linking shared libraries, the AddressSanitizer run-time is not
  linked, so -Wl,-z,defs may cause link errors (t use it with
  AddressSanitizer).

https://clang.llvm.org/docs/AddressSanitizer.html

  When linking shared libraries, the MemorySanitizer run-time is not
  linked, so -Wl,-z,defs may cause link errors (t use it with
  MemorySanitizer).

https://clang.llvm.org/docs/MemorySanitizer.html

Solution suggested by 
Root cause of breaking libc++ investigated by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/libc++/lib/Makefile

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

Modified files:

Index: src/external/bsd/libc++/lib/Makefile
diff -u src/external/bsd/libc++/lib/Makefile:1.10 src/external/bsd/libc++/lib/Makefile:1.11
--- src/external/bsd/libc++/lib/Makefile:1.10	Wed Jan 11 12:10:26 2017
+++ src/external/bsd/libc++/lib/Makefile	Wed Jun  6 12:02:43 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2017/01/11 12:10:26 joerg Exp $
+#	$NetBSD: Makefile,v 1.11 2018/06/06 12:02:43 kamil Exp $
 
 LIB=		c++
 WARNS=		4
@@ -44,6 +44,8 @@ CWARNFLAGS.clang+=	-Wno-error=missing-pr
 CWARNFLAGS.clang+=	-Wno-error=missing-field-initializers -Wno-error=switch
 CWARNFLAGS.clang+=	-Wno-error=implicit-exception-spec-mismatch
 
+.if ${MKSANITIZER} != "yes"
 LDFLAGS+=	-Wl,-z,defs
+.endif
 
 .include 



CVS commit: [netbsd-7] src/sys/netinet

2018-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 09:48:50 UTC 2018

Modified Files:
src/sys/netinet [netbsd-7]: udp_usrreq.c

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

sys/netinet/udp_usrreq.c: revision 1.237 (via patch)

Fix three pretty bad mistakes in NAT-T:

 * If we got a keepalive packet, we need to call m_freem, not m_free.
   Here the next mbufs in the chain are not freed. Seems easy to remotely
   DoS the system by sending fragmented keepalives in a loop.

 * If !ipsec_used, free the mbuf.

 * In udp_input, we need to update 'uh', because udp4_realinput may have
   modified the chain. Perhaps we also need to re-enforce alignment, so
   add an XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.217.2.1 src/sys/netinet/udp_usrreq.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/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.217 src/sys/netinet/udp_usrreq.c:1.217.2.1
--- src/sys/netinet/udp_usrreq.c:1.217	Sat Aug  9 05:33:01 2014
+++ src/sys/netinet/udp_usrreq.c	Wed Jun  6 09:48:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.217.2.1 2018/06/06 09:48:50 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.217.2.1 2018/06/06 09:48:50 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -395,7 +395,15 @@ udp_input(struct mbuf *m, ...)
 		 */
 		return;
 	}
+
 	ip = mtod(m, struct ip *);
+	IP6_EXTHDR_GET(uh, struct udphdr *, m, iphlen, sizeof(struct udphdr));
+	if (uh == NULL) {
+		UDP_STATINC(UDP_STAT_HDROPS);
+		return;
+	}
+	/* XXX Re-enforce alignment? */
+
 #ifdef INET6
 	if (IN_MULTICAST(ip->ip_dst.s_addr) || n == 0) {
 		struct sockaddr_in6 src6, dst6;
@@ -1301,7 +1309,7 @@ udp4_espinudp(struct mbuf **mp, int off,
 
 	/* Ignore keepalive packets */
 	if ((len == 1) && (*(unsigned char *)data == 0xff)) {
-		m_free(m);
+		m_freem(m);
 		*mp = NULL; /* avoid any further processiong by caller ... */
 		return 1;
 	}
@@ -1383,7 +1391,8 @@ udp4_espinudp(struct mbuf **mp, int off,
 #ifdef IPSEC
 	if (ipsec_used)
 		ipsec4_common_input(m, iphdrlen, IPPROTO_ESP);
-	/* XXX: else */
+	else
+		m_freem(m);
 #else
 	esp4_input(m, iphdrlen);
 #endif



CVS commit: src/sys

2018-06-06 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Jun  6 09:46:46 UTC 2018

Modified Files:
src/sys/kern: uipc_socket.c uipc_socket2.c
src/sys/sys: socketvar.h

Log Message:
Separate receive socket errors from general socket errors.


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.155 -r1.156 src/sys/sys/socketvar.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/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.263 src/sys/kern/uipc_socket.c:1.264
--- src/sys/kern/uipc_socket.c:1.263	Thu Apr 26 19:50:09 2018
+++ src/sys/kern/uipc_socket.c	Wed Jun  6 09:46:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.263 2018/04/26 19:50:09 maxv Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.264 2018/06/06 09:46:46 roy Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.263 2018/04/26 19:50:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.264 2018/06/06 09:46:46 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1240,11 +1240,16 @@ soreceive(struct socket *so, struct mbuf
 		if (m == NULL && so->so_rcv.sb_cc)
 			panic("receive 1");
 #endif
-		if (so->so_error) {
+		if (so->so_error || so->so_rerror) {
 			if (m != NULL)
 goto dontblock;
-			error = so->so_error;
-			so->so_error = 0;
+			if (so->so_error) {
+error = so->so_error;
+so->so_error = 0;
+			} else {
+error = so->so_rerror;
+so->so_rerror = 0;
+			}
 			goto release;
 		}
 		if (so->so_state & SS_CANTRCVMORE) {
@@ -1564,7 +1569,8 @@ soreceive(struct socket *so, struct mbuf
 		 */
 		while (flags & MSG_WAITALL && m == NULL && uio->uio_resid > 0 &&
 		!sosendallatonce(so) && !nextrecord) {
-			if (so->so_error || so->so_state & SS_CANTRCVMORE)
+			if (so->so_error || so->so_rerror ||
+			so->so_state & SS_CANTRCVMORE)
 break;
 			/*
 			 * If we are peeking and the socket receive buffer is
@@ -2250,7 +2256,7 @@ filt_soread(struct knote *kn, long hint)
 		kn->kn_flags |= EV_EOF;
 		kn->kn_fflags = so->so_error;
 		rv = 1;
-	} else if (so->so_error)
+	} else if (so->so_error || so->so_rerror)
 		rv = 1;
 	else if (kn->kn_sfflags & NOTE_LOWAT)
 		rv = (kn->kn_data >= kn->kn_sdata);

Index: src/sys/kern/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.129 src/sys/kern/uipc_socket2.c:1.130
--- src/sys/kern/uipc_socket2.c:1.129	Sun Apr 29 07:13:10 2018
+++ src/sys/kern/uipc_socket2.c	Wed Jun  6 09:46:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.129 2018/04/29 07:13:10 maxv Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.130 2018/06/06 09:46:46 roy Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.129 2018/04/29 07:13:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.130 2018/06/06 09:46:46 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -504,7 +504,7 @@ soroverflow(struct socket *so)
 	KASSERT(solocked(so));
 
 	so->so_rcv.sb_overflowed++;
-	so->so_error = ENOBUFS;
+	so->so_rerror = ENOBUFS;
 	sorwakeup(so);
 }
 

Index: src/sys/sys/socketvar.h
diff -u src/sys/sys/socketvar.h:1.155 src/sys/sys/socketvar.h:1.156
--- src/sys/sys/socketvar.h:1.155	Fri May  4 08:35:07 2018
+++ src/sys/sys/socketvar.h	Wed Jun  6 09:46:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: socketvar.h,v 1.155 2018/05/04 08:35:07 christos Exp $	*/
+/*	$NetBSD: socketvar.h,v 1.156 2018/06/06 09:46:46 roy Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -160,6 +160,7 @@ struct socket {
 	short		so_qlimit;	/* max number queued connections */
 	short		so_timeo;	/* connection timeout */
 	u_short		so_error;	/* error affecting connection */
+	u_short		so_rerror;	/* error affecting receiving */
 	u_short		so_aborting;	/* references from soabort() */
 	pid_t		so_pgid;	/* pgid for signals */
 	u_long		so_oobmark;	/* chars to oob mark */