Re: CVS commit: src/tests/net

2019-08-19 Thread Martin Husemann
On Tue, Aug 20, 2019 at 11:21:08AM +0900, Ryota Ozaki wrote:
> Is it an issue specific to sparc64?

No, same happens on (big endian) arm. Endianess issue?
I'll do a little endian arm run today.

Martin


CVS commit: src/sys

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 04:11:22 UTC 2019

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

Log Message:
 Fix a bug that VLAN HW "tagging" enable/disable may not refrect correctly.

  - Always call ec_vlan_cb() if it exists.
  - Some (or all?) ethernet drivers don't enable HW tagging if no any vlan is
attached. ixgbe is one of them. Check the the transition and update
VLAN HW tagging function.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.143 -r1.144 src/sys/net/if_vlan.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.199 src/sys/dev/pci/ixgbe/ixgbe.c:1.200
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199	Tue Jul 30 08:44:28 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Aug 20 04:11:22 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199 2019/07/30 08:44:28 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.200 2019/08/20 04:11:22 msaitoh Exp $ */
 
 /**
 
@@ -219,6 +219,7 @@ static void	ixgbe_configure_ivars(struct
 static u8 *	ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
 static void	ixgbe_eitr_write(struct adapter *, uint32_t, uint32_t);
 
+static void	ixgbe_setup_vlan_hw_tagging(struct adapter *);
 static void	ixgbe_setup_vlan_hw_support(struct adapter *);
 static int	ixgbe_vlan_cb(struct ethercom *, uint16_t, bool);
 static int	ixgbe_register_vlan(void *, struct ifnet *, u16);
@@ -2305,6 +2306,7 @@ static int
 ixgbe_vlan_cb(struct ethercom *ec, uint16_t vid, bool set)
 {
 	struct ifnet *ifp = >ec_if;
+	struct adapter *adapter = ifp->if_softc;
 	int rv;
 
 	if (set)
@@ -2312,6 +2314,16 @@ ixgbe_vlan_cb(struct ethercom *ec, uint1
 	else
 		rv = ixgbe_unregister_vlan(ifp->if_softc, ifp, vid);
 
+	if (rv != 0)
+		return rv;
+
+	/*
+	 * Control VLAN HW tagging when ec_nvlan is changed from 1 to 0
+	 * or 0 to 1.
+	 */
+	if ((set && (ec->ec_nvlans == 1)) || (!set && (ec->ec_nvlans == 0)))
+		ixgbe_setup_vlan_hw_tagging(adapter);
+
 	return rv;
 }
 
@@ -2381,21 +2393,15 @@ ixgbe_unregister_vlan(void *arg, struct 
 } /* ixgbe_unregister_vlan */
 
 static void
-ixgbe_setup_vlan_hw_support(struct adapter *adapter)
+ixgbe_setup_vlan_hw_tagging(struct adapter *adapter)
 {
 	struct ethercom *ec = >osdep.ec;
 	struct ixgbe_hw *hw = >hw;
 	struct rx_ring	*rxr;
-	int		i;
 	u32		ctrl;
-	struct vlanid_list *vlanidp;
+	int		i;
 	bool		hwtagging;
 
-	/*
-	 *  This function is called from both if_init and ifflags_cb()
-	 * on NetBSD.
-	 */
-
 	/* Enable HW tagging only if any vlan is attached */
 	hwtagging = (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING)
 	&& VLAN_ATTACHED(ec);
@@ -2417,6 +2423,41 @@ ixgbe_setup_vlan_hw_support(struct adapt
 		rxr->vtag_strip = hwtagging ? TRUE : FALSE;
 	}
 
+	/* VLAN hw tagging for 82598 */
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		ctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
+		if (hwtagging)
+			ctrl |= IXGBE_VLNCTRL_VME;
+		else
+			ctrl &= ~IXGBE_VLNCTRL_VME;
+		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
+	}
+} /* ixgbe_setup_vlan_hw_tagging */
+
+static void
+ixgbe_setup_vlan_hw_support(struct adapter *adapter)
+{
+	struct ethercom *ec = >osdep.ec;
+	struct ixgbe_hw *hw = >hw;
+	int		i;
+	u32		ctrl;
+	struct vlanid_list *vlanidp;
+
+	/*
+	 *  This function is called from both if_init and ifflags_cb()
+	 * on NetBSD.
+	 */
+
+	/*
+	 * Part 1:
+	 * Setup VLAN HW tagging
+	 */
+	ixgbe_setup_vlan_hw_tagging(adapter);
+
+	/*
+	 * Part 2:
+	 * Setup VLAN HW filter
+	 */
 	/* Cleanup shadow_vfta */
 	for (i = 0; i < IXGBE_VFTA_SIZE; i++)
 		adapter->shadow_vfta[i] = 0;
@@ -2439,13 +2480,6 @@ ixgbe_setup_vlan_hw_support(struct adapt
 		ctrl |= IXGBE_VLNCTRL_VFE;
 	else
 		ctrl &= ~IXGBE_VLNCTRL_VFE;
-	/* VLAN hw tagging for 82598 */
-	if (hw->mac.type == ixgbe_mac_82598EB) {
-		if (hwtagging)
-			ctrl |= IXGBE_VLNCTRL_VME;
-		else
-			ctrl &= ~IXGBE_VLNCTRL_VME;
-	}
 	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl);
 } /* ixgbe_setup_vlan_hw_support */
 

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.125 src/sys/dev/pci/ixgbe/ixv.c:1.126
--- src/sys/dev/pci/ixgbe/ixv.c:1.125	Tue Jul 30 08:38:03 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Aug 20 04:11:22 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.125 2019/07/30 08:38:03 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.126 2019/08/20 04:11:22 msaitoh Exp $*/
 
 /**
 
@@ -120,6 +120,7 @@ static void	ixv_configure_ivars(struct a
 static u8 *	ixv_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
 static void	ixv_eitr_write(struct adapter *, uint32_t, uint32_t);
 
+static void	ixv_setup_vlan_tagging(struct adapter 

CVS commit: src/sys

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 04:11:22 UTC 2019

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

Log Message:
 Fix a bug that VLAN HW "tagging" enable/disable may not refrect correctly.

  - Always call ec_vlan_cb() if it exists.
  - Some (or all?) ethernet drivers don't enable HW tagging if no any vlan is
attached. ixgbe is one of them. Check the the transition and update
VLAN HW tagging function.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.143 -r1.144 src/sys/net/if_vlan.c

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



CVS commit: src/sys/net

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 03:56:59 UTC 2019

Modified Files:
src/sys/net: if_vlan.c

Log Message:
 Add missing IFNET_LOCK() and IFNET_UNLOCK() in vlan_config().

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/net/if_vlan.c

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



CVS commit: src/sys/net

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 03:56:59 UTC 2019

Modified Files:
src/sys/net: if_vlan.c

Log Message:
 Add missing IFNET_LOCK() and IFNET_UNLOCK() in vlan_config().

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.142 src/sys/net/if_vlan.c:1.143
--- src/sys/net/if_vlan.c:1.142	Tue Aug 20 03:50:55 2019
+++ src/sys/net/if_vlan.c	Tue Aug 20 03:56:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.142 2019/08/20 03:50:55 msaitoh Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.143 2019/08/20 03:56:59 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.142 2019/08/20 03:50:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.143 2019/08/20 03:56:59 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -494,8 +494,11 @@ vlan_config(struct ifvlan *ifv, struct i
 			KM_SLEEP);
 			if (vidmem == NULL){
 ec->ec_nvlans--;
-if (ec->ec_nvlans == 0)
+if (ec->ec_nvlans == 0) {
+	IFNET_LOCK(p);
 	(void)ether_disable_vlan_mtu(p);
+	IFNET_UNLOCK(p);
+}
 error = ENOMEM;
 goto done;
 			}
@@ -509,8 +512,11 @@ vlan_config(struct ifvlan *ifv, struct i
 error = (*ec->ec_vlan_cb)(ec, vid, true);
 if (error) {
 	ec->ec_nvlans--;
-	if (ec->ec_nvlans == 0)
+	if (ec->ec_nvlans == 0) {
+		IFNET_LOCK(p);
 		(void)ether_disable_vlan_mtu(p);
+		IFNET_UNLOCK(p);
+	}
 	goto done;
 }
 			}



CVS commit: src/sys/net

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 03:50:55 UTC 2019

Modified Files:
src/sys/net: if_vlan.c

Log Message:
 Check ec_capenable instead of ec_capabilities to control TX side of VLAN HW
tagging correctly.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/net/if_vlan.c

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



CVS commit: src/sys/net

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 03:50:55 UTC 2019

Modified Files:
src/sys/net: if_vlan.c

Log Message:
 Check ec_capenable instead of ec_capabilities to control TX side of VLAN HW
tagging correctly.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.141 src/sys/net/if_vlan.c:1.142
--- src/sys/net/if_vlan.c:1.141	Wed Jul 17 03:26:24 2019
+++ src/sys/net/if_vlan.c	Tue Aug 20 03:50:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.141 2019/07/17 03:26:24 msaitoh Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.142 2019/08/20 03:50:55 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.141 2019/07/17 03:26:24 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.142 2019/08/20 03:50:55 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1373,7 +1373,7 @@ vlan_start(struct ifnet *ifp)
 		 * If the parent can insert the tag itself, just mark
 		 * the tag in the mbuf header.
 		 */
-		if (ec->ec_capabilities & ETHERCAP_VLAN_HWTAGGING) {
+		if (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING) {
 			vlan_set_tag(m, mib->ifvm_tag);
 		} else {
 			/*
@@ -1491,7 +1491,7 @@ vlan_transmit(struct ifnet *ifp, struct 
 	 * If the parent can insert the tag itself, just mark
 	 * the tag in the mbuf header.
 	 */
-	if (ec->ec_capabilities & ETHERCAP_VLAN_HWTAGGING) {
+	if (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING) {
 		vlan_set_tag(m, mib->ifvm_tag);
 	} else {
 		/*



Re: CVS commit: src/tests/net

2019-08-19 Thread Ryota Ozaki
On Mon, Aug 19, 2019 at 10:18 PM Martin Husemann  wrote:
>
> On Mon, Aug 19, 2019 at 03:22:47AM +, Ryota Ozaki wrote:
> > Module Name:  src
> > Committed By: ozaki-r
> > Date: Mon Aug 19 03:22:47 UTC 2019
> >
> > Modified Files:
> >   src/tests/net: net_common.sh
> >
> > Log Message:
> > tests: check pool object leaks
> >
> > Currently only llentpl leaks can be detected.
>
> The message is cryptic ;-)

Sorry, I'll describe how it works in the script.

>
> Also this breaks ~all the networking tests for me, failures jumped from
> 19 to 462 on my sparc64 test run.

Hmm, it works correctly for me on amd64 and it seems to work on anita/i386
too: 
http://releng.netbsd.org/b5reports/i386/commits-2019.08.html#build-2019.08.19.03.25.40
.

Is it an issue specific to sparc64?

  ozaki-r


CVS commit: src/doc

2019-08-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Aug 20 02:42:04 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Fix year in previous entry's datestamp


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

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



CVS commit: src/doc

2019-08-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Aug 20 02:42:04 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Fix year in previous entry's datestamp


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2571 src/doc/CHANGES:1.2572
--- src/doc/CHANGES:1.2571	Tue Aug 20 01:48:48 2019
+++ src/doc/CHANGES	Tue Aug 20 02:42:04 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2571 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2572 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -30,4 +30,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		ure(4), url(4), and urndis(4) drivers fixing many bugs and
 		porting to NET_MPSAFE in the process.  [mrg 20190814]
 	usbnet(9): Port kue(4) and upl(4). [mrg 20190818]
-	boot(8): GPT and RAIDframe support for x86 bootstrap [manu 20180818]
+	boot(8): GPT and RAIDframe support for x86 bootstrap [manu 20190818]



CVS commit: src/sys/kern

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 01:56:22 UTC 2019

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

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/sys_select.c

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

Modified files:

Index: src/sys/kern/sys_select.c
diff -u src/sys/kern/sys_select.c:1.46 src/sys/kern/sys_select.c:1.47
--- src/sys/kern/sys_select.c:1.46	Fri Jul 26 05:37:59 2019
+++ src/sys/kern/sys_select.c	Tue Aug 20 01:56:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_select.c,v 1.46 2019/07/26 05:37:59 msaitoh Exp $	*/
+/*	$NetBSD: sys_select.c,v 1.47 2019/08/20 01:56:21 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.46 2019/07/26 05:37:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.47 2019/08/20 01:56:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -391,7 +391,7 @@ selscan(char *bits, const int nfd, const
 			ibits = *ibitp;
 			obits = 0;
 			while ((j = ffs(ibits)) && (fd = i + --j) < nfd) {
-ibits &= ~(1 << j);
+ibits &= ~(1U << j);
 if ((fp = fd_getfile(fd)) == NULL)
 	return (EBADF);
 /*
@@ -400,7 +400,7 @@ selscan(char *bits, const int nfd, const
  */
 curlwp->l_selrec = fd;
 if ((*fp->f_ops->fo_poll)(fp, sel_flag[msk])) {
-	obits |= (1 << j);
+	obits |= (1U << j);
 	n++;
 }
 fd_putfile(fd);
@@ -754,7 +754,7 @@ selnotify(struct selinfo *sip, int event
 		sip->sel_collision = 0;
 		do {
 			index = ffs(mask) - 1;
-			mask &= ~(1 << index);
+			mask &= ~(1U << index);
 			sc = selcluster[index];
 			lock = sc->sc_lock;
 			mutex_spin_enter(lock);



CVS commit: src/sys/kern

2019-08-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Aug 20 01:56:22 UTC 2019

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

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/sys_select.c

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



CVS commit: src/doc

2019-08-19 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Aug 20 01:48:48 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
boot(8): GPT and RAIDframe support for x86 bootstrap [manu 20180818]


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2570 src/doc/CHANGES:1.2571
--- src/doc/CHANGES:1.2570	Sun Aug 18 09:43:26 2019
+++ src/doc/CHANGES	Tue Aug 20 01:48:48 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2570 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2571 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -30,3 +30,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		ure(4), url(4), and urndis(4) drivers fixing many bugs and
 		porting to NET_MPSAFE in the process.  [mrg 20190814]
 	usbnet(9): Port kue(4) and upl(4). [mrg 20190818]
+	boot(8): GPT and RAIDframe support for x86 bootstrap [manu 20180818]



CVS commit: src/doc

2019-08-19 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Aug 20 01:48:48 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
boot(8): GPT and RAIDframe support for x86 bootstrap [manu 20180818]


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

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



CVS commit: src/sbin/dump

2019-08-19 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Mon Aug 19 18:12:50 UTC 2019

Modified Files:
src/sbin/dump: dump.8 main.c

Log Message:
Add -D flag to allow the user to specify an alternate dumpdates file.
Closes PR #54469.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sbin/dump/dump.8
cvs rdiff -u -r1.75 -r1.76 src/sbin/dump/main.c

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



CVS commit: src/sbin/dump

2019-08-19 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Mon Aug 19 18:12:50 UTC 2019

Modified Files:
src/sbin/dump: dump.8 main.c

Log Message:
Add -D flag to allow the user to specify an alternate dumpdates file.
Closes PR #54469.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sbin/dump/dump.8
cvs rdiff -u -r1.75 -r1.76 src/sbin/dump/main.c

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

Modified files:

Index: src/sbin/dump/dump.8
diff -u src/sbin/dump/dump.8:1.71 src/sbin/dump/dump.8:1.72
--- src/sbin/dump/dump.8:1.71	Mon Mar 25 07:03:17 2019
+++ src/sbin/dump/dump.8	Mon Aug 19 18:12:50 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dump.8,v 1.71 2019/03/25 07:03:17 wiz Exp $
+.\"	$NetBSD: dump.8,v 1.72 2019/08/19 18:12:50 perseant Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	 Regents of the University of California.
@@ -42,6 +42,7 @@
 .Op Fl 0123456789aceFinStuX
 .Op Fl B Ar records
 .Op Fl b Ar blocksize
+.Op Fl D Ar dumpdates-file
 .Op Fl d Ar density
 .Op Fl f Ar file
 .Op Fl h Ar level
@@ -145,6 +146,9 @@ The number of kilobytes per dump record.
 .It Fl c
 Modify the calculation of the default density and tape size to be more
 appropriate for cartridge tapes.
+.It Fl D Ar dumpdates-file
+Use the given file as a record of dump dates instead of
+.Pa /etc/dumpdates .
 .It Fl d Ar density
 Set tape density to
 .Ar density .

Index: src/sbin/dump/main.c
diff -u src/sbin/dump/main.c:1.75 src/sbin/dump/main.c:1.76
--- src/sbin/dump/main.c:1.75	Mon Mar 25 02:13:01 2019
+++ src/sbin/dump/main.c	Mon Aug 19 18:12:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $	*/
+/*	$NetBSD: main.c,v 1.76 2019/08/19 18:12:50 perseant Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $");
+__RCSID("$NetBSD: main.c,v 1.76 2019/08/19 18:12:50 perseant Exp $");
 #endif
 #endif /* not lint */
 
@@ -133,7 +133,7 @@ main(int argc, char *argv[])
 
 	obsolete(, );
 	while ((ch = getopt(argc, argv,
-	"0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
+	"0123456789aB:b:cd:D:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
 		switch (ch) {
 		/* dump level */
 		case '0': case '1': case '2': case '3': case '4':
@@ -164,6 +164,10 @@ main(int argc, char *argv[])
 ntrec = HIGHDENSITYTREC;
 			break;
 
+		case 'D':		/* specify alt. dumpdates file */
+			dumpdates = optarg;
+			break;
+
 		case 'e':		/* eject full tapes */
 			eflag = 1;
 			break;



CVS commit: [netbsd-9] src/doc

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:12:04 UTC 2019

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

Log Message:
Tickets #90 - #98


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.23 src/doc/CHANGES-9.0:1.1.2.24
--- src/doc/CHANGES-9.0:1.1.2.23	Sun Aug 18 14:36:49 2019
+++ src/doc/CHANGES-9.0	Mon Aug 19 16:12:04 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.23 2019/08/18 14:36:49 msaitoh Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.24 2019/08/19 16:12:04 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2034,3 +2034,75 @@ usr.sbin/sysinst/checkrc.c			1.2
 
 	Fix memory leak (found by MKSANITIZER=yes build).
 	[martin, ticket #89]
+
+external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk 1.2
+
+	Set NODEBUG for LLVM sanitizers.
+	[kamil, ticket #90]
+
+tests/rump/modautoload/Makefile			1.9
+
+	Avoid symbol clashes in test/rump/modautoload/t_modautoload with
+	sanitizers.
+	[kamil, ticket #91]
+
+usr.sbin/traceroute/Makefile			1.20
+usr.sbin/traceroute/ifaddrlist.c		1.11
+usr.sbin/traceroute/prog_ops.h			1.2
+usr.sbin/traceroute/traceroute_hostops.c	1.2
+usr.sbin/traceroute/traceroute_rumpops.c	1.2
+
+	traceroute: Add indirection of symbol to remove clash with sanitizers.
+	[kamil, ticket #92]
+
+share/mk/bsd.prog.mk1.322
+
+	Add PAXCTL_FLAG rules for MKSANITIZER: disable ASLR for
+	programs sanitized by ASan, TSan and MSan.
+	[kamil, ticket #93]
+
+usr.bin/netstat/Makefile			1.46
+usr.bin/netstat/atalk.c1.17
+usr.bin/netstat/bpf.c1.14
+usr.bin/netstat/fast_ipsec.c			1.23
+usr.bin/netstat/inet.c1.110
+usr.bin/netstat/inet6.c1.73
+usr.bin/netstat/netstat_hostops.c		1.2
+usr.bin/netstat/netstat_rumpops.c		1.2
+usr.bin/netstat/pfkey.c1.2
+usr.bin/netstat/pfsync.c			1.2
+usr.bin/netstat/prog_ops.h			1.3
+
+	netstat: Add indirection of symbols to remove clash with sanitizers.
+	[kamil, ticket #94]
+
+sbin/sysctl/Makefile1.22
+sbin/sysctl/prog_ops.h1.3
+sbin/sysctl/sysctl.c1.162
+sbin/sysctl/sysctl_hostops.c			1.2
+sbin/sysctl/sysctl_rumpops.c			1.2
+
+	sysctl: Add indirection of symbols to remove clash with sanitizers.
+	[kamil, ticket #95]
+
+usr.bin/sockstat/Makefile			1.4
+usr.bin/sockstat/prog_ops.h			1.2
+usr.bin/sockstat/sockstat.c			1.21
+usr.bin/sockstat/sockstat_hostops.c		1.2
+usr.bin/sockstat/sockstat_rumpops.c		1.2
+
+	sockstat: Add indirection of symbols to remove clash with sanitizers.
+	[kamil, ticket #96]
+
+sys/netinet6/nd6.c1.257
+
+	Add missing IFNET_LOCK for regen_tmpaddr.
+	[ozaki-r, ticket #97]
+
+sys/net/if.c	1.458
+tests/net/if/t_ifconfig.sh			1.21
+
+	PR kern/54434: restore if_ioctl on error of ifc_destroy, 
+	otherwise subsequent ioctls will not work. Add a test for this.
+	[ozaki-r, ticket #98]
+



CVS commit: [netbsd-9] src/doc

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:12:04 UTC 2019

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

Log Message:
Tickets #90 - #98


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

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



CVS commit: [netbsd-9] src

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:10:35 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if.c
src/tests/net/if [netbsd-9]: t_ifconfig.sh

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

sys/net/if.c: revision 1.458
tests/net/if/t_ifconfig.sh: revision 1.21

Restore if_ioctl on error of ifc_destroy

Otherwise subsequence ioctls won't work.

Patch from Harold Gutch on PR kern/54434 (tweaked a bit by me)
tests: check if ifconfig (ioctl) works after a failure of ifconfig destroy

This is a test for PR kern/54434.


To generate a diff of this commit:
cvs rdiff -u -r1.457 -r1.457.2.1 src/sys/net/if.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/tests/net/if/t_ifconfig.sh

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.457 src/sys/net/if.c:1.457.2.1
--- src/sys/net/if.c:1.457	Thu Jul 25 07:45:57 2019
+++ src/sys/net/if.c	Mon Aug 19 16:10:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.457 2019/07/25 07:45:57 knakahara Exp $	*/
+/*	$NetBSD: if.c,v 1.457.2.1 2019/08/19 16:10:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.457 2019/07/25 07:45:57 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.457.2.1 2019/08/19 16:10:35 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1611,6 +1611,8 @@ if_clone_destroy(const char *name)
 	struct if_clone *ifc;
 	struct ifnet *ifp;
 	struct psref psref;
+	int error;
+	int (*if_ioctl)(struct ifnet *, u_long, void *);
 
 	KASSERT(mutex_owned(_clone_mtx));
 
@@ -1627,6 +1629,7 @@ if_clone_destroy(const char *name)
 
 	/* We have to disable ioctls here */
 	IFNET_LOCK(ifp);
+	if_ioctl = ifp->if_ioctl;
 	ifp->if_ioctl = if_nullioctl;
 	IFNET_UNLOCK(ifp);
 
@@ -1636,7 +1639,16 @@ if_clone_destroy(const char *name)
 	 */
 	if_put(ifp, );
 
-	return (*ifc->ifc_destroy)(ifp);
+	error = (*ifc->ifc_destroy)(ifp);
+
+	if (error != 0) {
+		/* We have to restore if_ioctl on error */
+		IFNET_LOCK(ifp);
+		ifp->if_ioctl = if_ioctl;
+		IFNET_UNLOCK(ifp);
+	}
+
+	return error;
 }
 
 static bool

Index: src/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.20 src/tests/net/if/t_ifconfig.sh:1.20.2.1
--- src/tests/net/if/t_ifconfig.sh:1.20	Thu Jul  4 02:46:40 2019
+++ src/tests/net/if/t_ifconfig.sh	Mon Aug 19 16:10:35 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.20 2019/07/04 02:46:40 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.20.2.1 2019/08/19 16:10:35 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -69,6 +69,11 @@ ifconfig_create_destroy_body()
 	atf_check -s exit:0 rump.ifconfig shmif0 up
 	atf_check -s exit:0 rump.ifconfig shmif0 destroy
 
+	# Check if ifconfig (ioctl) works after a failure of ifconfig destroy
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0
+	atf_check -s not-exit:0 -e ignore rump.ifconfig lo0 destroy
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0
+
 	unset RUMP_SERVER
 }
 



CVS commit: [netbsd-9] src

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:10:35 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if.c
src/tests/net/if [netbsd-9]: t_ifconfig.sh

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

sys/net/if.c: revision 1.458
tests/net/if/t_ifconfig.sh: revision 1.21

Restore if_ioctl on error of ifc_destroy

Otherwise subsequence ioctls won't work.

Patch from Harold Gutch on PR kern/54434 (tweaked a bit by me)
tests: check if ifconfig (ioctl) works after a failure of ifconfig destroy

This is a test for PR kern/54434.


To generate a diff of this commit:
cvs rdiff -u -r1.457 -r1.457.2.1 src/sys/net/if.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/tests/net/if/t_ifconfig.sh

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



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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:08:19 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: nd6.c

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

sys/netinet6/nd6.c: revision 1.257

Add missing IFNET_LOCK for regen_tmpaddr
Reported by ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.256 -r1.256.2.1 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.256 src/sys/netinet6/nd6.c:1.256.2.1
--- src/sys/netinet6/nd6.c:1.256	Fri Jul 26 10:18:42 2019
+++ src/sys/netinet6/nd6.c	Mon Aug 19 16:08:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.256 2019/07/26 10:18:42 christos Exp $	*/
+/*	$NetBSD: nd6.c,v 1.256.2.1 2019/08/19 16:08:19 martin Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256 2019/07/26 10:18:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.1 2019/08/19 16:08:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -666,8 +666,12 @@ nd6_timer_work(struct work *wk, void *ar
 			if (ip6_use_tempaddr &&
 			(ia6->ia6_flags & IN6_IFF_TEMPORARY) != 0 &&
 			(oldflags & IN6_IFF_DEPRECATED) == 0) {
+int ret;
 
-if (regen_tmpaddr(ia6) == 0) {
+IFNET_LOCK(ia6->ia_ifa.ifa_ifp);
+ret = regen_tmpaddr(ia6);
+IFNET_UNLOCK(ia6->ia_ifa.ifa_ifp);
+if (ret == 0) {
 	/*
 	 * A new temporary address is
 	 * generated.



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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:08:19 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: nd6.c

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

sys/netinet6/nd6.c: revision 1.257

Add missing IFNET_LOCK for regen_tmpaddr
Reported by ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.256 -r1.256.2.1 src/sys/netinet6/nd6.c

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



Re: CVS commit: src/sys/kern

2019-08-19 Thread Christos Zoulas
I was thinking of doing that too. The problem is that we don't have a standard 
way to pass feedback to the user why the mount fail, and returning EINVAL seems 
suboptimal. It also changes the current semantics.

christos

> On Aug 19, 2019, at 6:35 PM, Robert Elz  wrote:
> 
>Date:Mon, 19 Aug 2019 05:32:42 -0400
>From:"Christos Zoulas" 
>Message-ID:  <20190819093242.88152f...@cvs.netbsd.org>
> 
>  | Log Message:
>  | If we could not start extattr for some reason, don't advertise extattr
>  | in the mount.
> 
> I would have expected a better result would be that if an attempt is
> made to mount with extattr turned on, and extattr is not available, then
> the mount would fail, rather than succeeding with exattr missing.
> 
> kre



CVS commit: [netbsd-9] src/usr.bin/sockstat

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:01:52 UTC 2019

Modified Files:
src/usr.bin/sockstat [netbsd-9]: Makefile prog_ops.h sockstat.c
sockstat_hostops.c sockstat_rumpops.c

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

usr.bin/sockstat/sockstat.c: revision 1.21
usr.bin/sockstat/prog_ops.h: revision 1.2
usr.bin/sockstat/sockstat_rumpops.c: revision 1.2
usr.bin/sockstat/sockstat_hostops.c: revision 1.2
usr.bin/sockstat/Makefile: revision 1.4

sockstat: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlgetmibinfo and sysctlnametomib.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.46.1 src/usr.bin/sockstat/Makefile
cvs rdiff -u -r1.1 -r1.1.48.1 src/usr.bin/sockstat/prog_ops.h \
src/usr.bin/sockstat/sockstat_hostops.c \
src/usr.bin/sockstat/sockstat_rumpops.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.bin/sockstat/sockstat.c

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



CVS commit: [netbsd-9] src/usr.bin/sockstat

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:01:52 UTC 2019

Modified Files:
src/usr.bin/sockstat [netbsd-9]: Makefile prog_ops.h sockstat.c
sockstat_hostops.c sockstat_rumpops.c

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

usr.bin/sockstat/sockstat.c: revision 1.21
usr.bin/sockstat/prog_ops.h: revision 1.2
usr.bin/sockstat/sockstat_rumpops.c: revision 1.2
usr.bin/sockstat/sockstat_hostops.c: revision 1.2
usr.bin/sockstat/Makefile: revision 1.4

sockstat: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlgetmibinfo and sysctlnametomib.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.46.1 src/usr.bin/sockstat/Makefile
cvs rdiff -u -r1.1 -r1.1.48.1 src/usr.bin/sockstat/prog_ops.h \
src/usr.bin/sockstat/sockstat_hostops.c \
src/usr.bin/sockstat/sockstat_rumpops.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/usr.bin/sockstat/sockstat.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/sockstat/Makefile
diff -u src/usr.bin/sockstat/Makefile:1.3 src/usr.bin/sockstat/Makefile:1.3.46.1
--- src/usr.bin/sockstat/Makefile:1.3	Fri Jan 28 18:52:49 2011
+++ src/usr.bin/sockstat/Makefile	Mon Aug 19 16:01:52 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/01/28 18:52:49 pooka Exp $
+#	$NetBSD: Makefile,v 1.3.46.1 2019/08/19 16:01:52 martin Exp $
 
 .include 
 
@@ -8,6 +8,10 @@ RUMPPRG=	sockstat
 CPPFLAGS+= -DRUMP_ACTION
 RUMPSRCS+=	sysctlgetmibinfo.c sysctlnametomib.c
 
+SANITIZER_RENAME_CLASSES+=	rump
+SANITIZER_RENAME_FILES.rump+=	${PROG}_rumpops.c ${RUMPSRCS}
+SANITIZER_RENAME_SYMBOL.rump+=	sysctlgetmibinfo sysctlnametomib
+
 .if (${USE_INET6} != "no")
 CPPFLAGS+=-DINET6
 .endif

Index: src/usr.bin/sockstat/prog_ops.h
diff -u src/usr.bin/sockstat/prog_ops.h:1.1 src/usr.bin/sockstat/prog_ops.h:1.1.48.1
--- src/usr.bin/sockstat/prog_ops.h:1.1	Fri Jan 28 18:52:49 2011
+++ src/usr.bin/sockstat/prog_ops.h	Mon Aug 19 16:01:52 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.1 2011/01/28 18:52:49 pooka Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.1.48.1 2019/08/19 16:01:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,19 +32,32 @@
 #include 
 
 #ifndef CRUNCHOPS
+struct sysctlnode;
+
 struct prog_ops {
 	int (*op_init)(void);
 
 	int (*op_sysctl)(const int *, u_int, void *, size_t *,
 			 const void *, size_t);
+
+	/* Indirection needed for sanitizers. */
+
+	int (*op_sysctlgetmibinfo)(const char *, int *, u_int *, char *,
+			 size_t *, struct sysctlnode **, int);
+
+	int (*op_sysctlnametomib)(const char *, int *, size_t *);
 };
 extern const struct prog_ops prog_ops;
 
 #define prog_init prog_ops.op_init
 #define prog_sysctl prog_ops.op_sysctl
+#define prog_sysctlgetmibinfo prog_ops.op_sysctlgetmibinfo
+#define prog_sysctlnametomib prog_ops.op_sysctlnametomib
 #else
 #define prog_init ((int (*)(void))NULL)
 #define prog_sysctl sysctl
+#define prog_sysctlgetmibinfo sysctlgetmibinfo
+#define prog_sysctlnametomib sysctlnametomib
 #endif
 
 #endif /* _PROG_OPS_H_ */
Index: src/usr.bin/sockstat/sockstat_hostops.c
diff -u src/usr.bin/sockstat/sockstat_hostops.c:1.1 src/usr.bin/sockstat/sockstat_hostops.c:1.1.48.1
--- src/usr.bin/sockstat/sockstat_hostops.c:1.1	Fri Jan 28 18:52:49 2011
+++ src/usr.bin/sockstat/sockstat_hostops.c	Mon Aug 19 16:01:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockstat_hostops.c,v 1.1 2011/01/28 18:52:49 pooka Exp $	*/
+/*	$NetBSD: sockstat_hostops.c,v 1.1.48.1 2019/08/19 16:01:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: sockstat_hostops.c,v 1.1 2011/01/28 18:52:49 pooka Exp $");
+__RCSID("$NetBSD: sockstat_hostops.c,v 1.1.48.1 2019/08/19 16:01:52 martin Exp $");
 #endif /* !lint */
 
 #include 
@@ -38,4 +38,8 @@ __RCSID("$NetBSD: sockstat_hostops.c,v 1
 
 const struct prog_ops prog_ops = {
 	.op_sysctl = sysctl,
+
+.op_sysctlgetmibinfo = sysctlgetmibinfo,
+
+.op_sysctlnametomib = sysctlnametomib,
 };
Index: src/usr.bin/sockstat/sockstat_rumpops.c
diff -u src/usr.bin/sockstat/sockstat_rumpops.c:1.1 src/usr.bin/sockstat/sockstat_rumpops.c:1.1.48.1
--- src/usr.bin/sockstat/sockstat_rumpops.c:1.1	Fri Jan 28 18:52:49 2011
+++ src/usr.bin/sockstat/sockstat_rumpops.c	Mon Aug 19 16:01:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockstat_rumpops.c,v 1.1 2011/01/28 18:52:49 pooka Exp $	*/
+/*	$NetBSD: sockstat_rumpops.c,v 1.1.48.1 2019/08/19 16:01:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,10 +28,11 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: sockstat_rumpops.c,v 1.1 2011/01/28 18:52:49 pooka Exp $");
+__RCSID("$NetBSD: sockstat_rumpops.c,v 1.1.48.1 2019/08/19 16:01:52 martin Exp $");
 #endif /* !lint 

CVS commit: [netbsd-9] src/sbin/sysctl

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:00:04 UTC 2019

Modified Files:
src/sbin/sysctl [netbsd-9]: Makefile prog_ops.h sysctl.c
sysctl_hostops.c sysctl_rumpops.c

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

sbin/sysctl/prog_ops.h: revision 1.3
sbin/sysctl/sysctl_rumpops.c: revision 1.2
sbin/sysctl/sysctl_hostops.c: revision 1.2
sbin/sysctl/Makefile: revision 1.22
sbin/sysctl/sysctl.c: revision 1.162

sysctl: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname and sysctlgetmibinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.32.1 src/sbin/sysctl/Makefile
cvs rdiff -u -r1.2 -r1.2.48.1 src/sbin/sysctl/prog_ops.h
cvs rdiff -u -r1.161 -r1.161.2.1 src/sbin/sysctl/sysctl.c
cvs rdiff -u -r1.1 -r1.1.48.1 src/sbin/sysctl/sysctl_hostops.c \
src/sbin/sysctl/sysctl_rumpops.c

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

Modified files:

Index: src/sbin/sysctl/Makefile
diff -u src/sbin/sysctl/Makefile:1.21 src/sbin/sysctl/Makefile:1.21.32.1
--- src/sbin/sysctl/Makefile:1.21	Thu Nov 29 02:05:38 2012
+++ src/sbin/sysctl/Makefile	Mon Aug 19 16:00:03 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2012/11/29 02:05:38 christos Exp $
+#	$NetBSD: Makefile,v 1.21.32.1 2019/08/19 16:00:03 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
@@ -13,4 +13,8 @@ SRCS=	sysctl.c
 CPPFLAGS+= -DRUMP_ACTION
 RUMPSRCS+= sysctlbyname.c sysctlgetmibinfo.c
 
+SANITIZER_RENAME_CLASSES+=	rump
+SANITIZER_RENAME_FILES.rump+=	${PROG}_rumpops.c ${RUMPSRCS}
+SANITIZER_RENAME_SYMBOL.rump+=	sysctlbyname sysctlgetmibinfo
+
 .include 

Index: src/sbin/sysctl/prog_ops.h
diff -u src/sbin/sysctl/prog_ops.h:1.2 src/sbin/sysctl/prog_ops.h:1.2.48.1
--- src/sbin/sysctl/prog_ops.h:1.2	Mon Dec 13 21:48:01 2010
+++ src/sbin/sysctl/prog_ops.h	Mon Aug 19 16:00:03 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.2 2010/12/13 21:48:01 pooka Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.2.48.1 2019/08/19 16:00:03 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,19 +32,33 @@
 #include 
 
 #ifndef CRUNCHOPS
+struct sysctlnode;
+
 struct prog_ops {
 	int (*op_init)(void);
 
 	int (*op_sysctl)(const int *, u_int, void *, size_t *,
 			 const void *, size_t);
+
+	/* Indirection needed for sanitizers. */
+
+	int (*op_sysctlbyname)(const char *, void *, size_t *,
+			 const void *, size_t);
+
+	int (*op_sysctlgetmibinfo)(const char *, int *, u_int *, char *,
+			 size_t *, struct sysctlnode **, int);
 };
 extern const struct prog_ops prog_ops;
 
 #define prog_init prog_ops.op_init
 #define prog_sysctl prog_ops.op_sysctl
+#define prog_sysctlbyname prog_ops.op_sysctlbyname
+#define prog_sysctlgetmibinfo prog_ops.op_sysctlgetmibinfo
 #else
 #define prog_init ((int (*)(void))NULL)
 #define prog_sysctl sysctl
+#define prog_sysctlbyname sysctlbyname
+#define prog_sysctlgetmibinfo sysctlgetmibinfo
 #endif
 
 #endif /* _PROG_OPS_H_ */

Index: src/sbin/sysctl/sysctl.c
diff -u src/sbin/sysctl/sysctl.c:1.161 src/sbin/sysctl/sysctl.c:1.161.2.1
--- src/sbin/sysctl/sysctl.c:1.161	Tue Oct 30 19:41:21 2018
+++ src/sbin/sysctl/sysctl.c	Mon Aug 19 16:00:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.c,v 1.161 2018/10/30 19:41:21 kre Exp $ */
+/*	$NetBSD: sysctl.c,v 1.161.2.1 2019/08/19 16:00:03 martin Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = "@(#)sysctl.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.161 2018/10/30 19:41:21 kre Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.161.2.1 2019/08/19 16:00:03 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -896,7 +896,7 @@ parse(char *l, regex_t *re, size_t *last
 	namelen = CTL_MAXNAME;
 	sz = sizeof(gsname);
 
-	if (sysctlgetmibinfo(key, [0], , gsname, , ,
+	if (prog_sysctlgetmibinfo(key, [0], , gsname, , ,
 			 SYSCTL_VERSION) == -1) {
 		if (optional)
 			return;
@@ -1441,7 +1441,7 @@ parse_create(char *l)
 		namelen = sizeof(name) / sizeof(name[0]);
 		sz = sizeof(gsname);
 		*t = '\0';
-		rc = sysctlgetmibinfo(nname, [0], ,
+		rc = prog_sysctlgetmibinfo(nname, [0], ,
   gsname, , NULL, SYSCTL_VERSION);
 		*t = sep[0];
 		if (rc == -1) {
@@ -1489,7 +1489,7 @@ parse_destroy(char *l)
 	memset(name, 0, sizeof(name));
 	namelen = sizeof(name) / sizeof(name[0]);
 	sz = sizeof(gsname);
-	rc = sysctlgetmibinfo(l, [0], , gsname, , NULL,
+	rc = prog_sysctlgetmibinfo(l, [0], , gsname, , NULL,
 			  SYSCTL_VERSION);
 	if (rc == -1) {
 		sysctlparseerror(namelen, l);
@@ -1538,7 +1538,7 @@ parse_describe(char *l)
 	memset(name, 0, sizeof(name));
 	namelen = sizeof(name) / sizeof(name[0]);
 	sz = sizeof(gsname);
-	rc = sysctlgetmibinfo(l, [0], , gsname, , 

CVS commit: [netbsd-9] src/sbin/sysctl

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 16:00:04 UTC 2019

Modified Files:
src/sbin/sysctl [netbsd-9]: Makefile prog_ops.h sysctl.c
sysctl_hostops.c sysctl_rumpops.c

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

sbin/sysctl/prog_ops.h: revision 1.3
sbin/sysctl/sysctl_rumpops.c: revision 1.2
sbin/sysctl/sysctl_hostops.c: revision 1.2
sbin/sysctl/Makefile: revision 1.22
sbin/sysctl/sysctl.c: revision 1.162

sysctl: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname and sysctlgetmibinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.32.1 src/sbin/sysctl/Makefile
cvs rdiff -u -r1.2 -r1.2.48.1 src/sbin/sysctl/prog_ops.h
cvs rdiff -u -r1.161 -r1.161.2.1 src/sbin/sysctl/sysctl.c
cvs rdiff -u -r1.1 -r1.1.48.1 src/sbin/sysctl/sysctl_hostops.c \
src/sbin/sysctl/sysctl_rumpops.c

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



CVS commit: [netbsd-9] src/usr.bin/netstat

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:56:49 UTC 2019

Modified Files:
src/usr.bin/netstat [netbsd-9]: Makefile atalk.c bpf.c fast_ipsec.c
inet.c inet6.c netstat_hostops.c netstat_rumpops.c pfkey.c pfsync.c
prog_ops.h

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

usr.bin/netstat/netstat_rumpops.c: revision 1.2
usr.bin/netstat/netstat_hostops.c: revision 1.2
usr.bin/netstat/inet6.c: revision 1.73
usr.bin/netstat/bpf.c: revision 1.14
usr.bin/netstat/Makefile: revision 1.46
usr.bin/netstat/prog_ops.h: revision 1.3
usr.bin/netstat/pfsync.c: revision 1.2
usr.bin/netstat/pfkey.c: revision 1.2
usr.bin/netstat/fast_ipsec.c: revision 1.23
usr.bin/netstat/atalk.c: revision 1.17
usr.bin/netstat/inet.c: revision 1.110

netstat: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname, sysctlgetmibinfo and sysctlnametomib.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.6.1 src/usr.bin/netstat/Makefile
cvs rdiff -u -r1.16 -r1.16.18.1 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.13 -r1.13.4.1 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.22 -r1.22.8.1 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.109 -r1.109.2.1 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.72 -r1.72.2.1 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.1 -r1.1.48.1 src/usr.bin/netstat/netstat_hostops.c \
src/usr.bin/netstat/netstat_rumpops.c src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.1 -r1.1.44.1 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.2 -r1.2.48.1 src/usr.bin/netstat/prog_ops.h

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



CVS commit: [netbsd-9] src/usr.bin/netstat

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:56:49 UTC 2019

Modified Files:
src/usr.bin/netstat [netbsd-9]: Makefile atalk.c bpf.c fast_ipsec.c
inet.c inet6.c netstat_hostops.c netstat_rumpops.c pfkey.c pfsync.c
prog_ops.h

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

usr.bin/netstat/netstat_rumpops.c: revision 1.2
usr.bin/netstat/netstat_hostops.c: revision 1.2
usr.bin/netstat/inet6.c: revision 1.73
usr.bin/netstat/bpf.c: revision 1.14
usr.bin/netstat/Makefile: revision 1.46
usr.bin/netstat/prog_ops.h: revision 1.3
usr.bin/netstat/pfsync.c: revision 1.2
usr.bin/netstat/pfkey.c: revision 1.2
usr.bin/netstat/fast_ipsec.c: revision 1.23
usr.bin/netstat/atalk.c: revision 1.17
usr.bin/netstat/inet.c: revision 1.110

netstat: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname, sysctlgetmibinfo and sysctlnametomib.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.6.1 src/usr.bin/netstat/Makefile
cvs rdiff -u -r1.16 -r1.16.18.1 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.13 -r1.13.4.1 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.22 -r1.22.8.1 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.109 -r1.109.2.1 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.72 -r1.72.2.1 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.1 -r1.1.48.1 src/usr.bin/netstat/netstat_hostops.c \
src/usr.bin/netstat/netstat_rumpops.c src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.1 -r1.1.44.1 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.2 -r1.2.48.1 src/usr.bin/netstat/prog_ops.h

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/netstat/Makefile
diff -u src/usr.bin/netstat/Makefile:1.45 src/usr.bin/netstat/Makefile:1.45.6.1
--- src/usr.bin/netstat/Makefile:1.45	Tue Oct 10 19:31:10 2017
+++ src/usr.bin/netstat/Makefile	Mon Aug 19 15:56:49 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45 2017/10/10 19:31:10 christos Exp $
+#	$NetBSD: Makefile,v 1.45.6.1 2019/08/19 15:56:49 martin Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/12/93
 
 .include 
@@ -25,6 +25,10 @@ RUMPSRCS+= sysctlbyname.c sysctlgetmibin
 LDADD.rump+=	-lrumpres
 DPADD.add+=	${LIBRUMPRES}
 CPPFLAGS+=  -DRUMP_ACTION
+
+SANITIZER_RENAME_CLASSES+=	rump
+SANITIZER_RENAME_FILES.rump+=	${PROG}_rumpops.c ${RUMPSRCS}
+SANITIZER_RENAME_SYMBOL.rump+=	sysctlbyname sysctlgetmibinfo sysctlnametomib
 .endif
 
 

Index: src/usr.bin/netstat/atalk.c
diff -u src/usr.bin/netstat/atalk.c:1.16 src/usr.bin/netstat/atalk.c:1.16.18.1
--- src/usr.bin/netstat/atalk.c:1.16	Sat Jun  6 13:08:31 2015
+++ src/usr.bin/netstat/atalk.c	Mon Aug 19 15:56:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $	*/
+/*	$NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from @(#)atalk.c	1.1 (Whistle) 6/6/96";
 #else
-__RCSID("$NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $");
+__RCSID("$NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -61,6 +61,7 @@ __RCSID("$NetBSD: atalk.c,v 1.16 2015/06
 #include 
 #include 
 #include "netstat.h"
+#include "prog_ops.h"
 
 struct ddpcbddpcb;
 struct socket   sockb;
@@ -290,7 +291,7 @@ ddp_stats(u_long off, const char *name)
 	if (use_sysctl) {
 		size_t size = sizeof(ddpstat);
 
-		if (sysctlbyname("net.atalk.ddp.stats", ddpstat, ,
+		if (prog_sysctlbyname("net.atalk.ddp.stats", ddpstat, ,
  NULL, 0) == -1)
 			return;
 	} else {

Index: src/usr.bin/netstat/bpf.c
diff -u src/usr.bin/netstat/bpf.c:1.13 src/usr.bin/netstat/bpf.c:1.13.4.1
--- src/usr.bin/netstat/bpf.c:1.13	Tue Jun 26 09:50:42 2018
+++ src/usr.bin/netstat/bpf.c	Mon Aug 19 15:56:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.13 2018/06/26 09:50:42 msaitoh Exp $	*/
+/*	$NetBSD: bpf.c,v 1.13.4.1 2019/08/19 15:56:49 martin Exp $	*/
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@ bpf_stats(void)
 	size_t len = sizeof(bpf_s);
 
 	if (use_sysctl) {
-		if (sysctlbyname("net.bpf.stats", _s, , NULL, 0) == -1)
+		if (prog_sysctlbyname("net.bpf.stats", _s, , NULL, 0) == -1)
 			err(1, "net.bpf.stats");
 	
 		printf("bpf:\n");
@@ -83,7 +83,7 @@ bpf_dump(const char *bpfif)
 		/* adapted from sockstat.c by Andrew Brown */
 
 		sz = CTL_MAXNAME;
-		if (sysctlnametomib("net.bpf.peers", [0], ) == -1)
+		if (prog_sysctlnametomib("net.bpf.peers", [0], ) == -1)
 			err(1, "sysctlnametomib: net.bpf.peers");
 		namelen = sz;
 

Index: src/usr.bin/netstat/fast_ipsec.c
diff -u src/usr.bin/netstat/fast_ipsec.c:1.22 src/usr.bin/netstat/fast_ipsec.c:1.22.8.1
--- src/usr.bin/netstat/fast_ipsec.c:1.22	Thu Jun 29 07:15:27 2017
+++ 

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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:53:40 UTC 2019

Modified Files:
src/share/mk [netbsd-9]: bsd.prog.mk

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

share/mk/bsd.prog.mk: revision 1.322

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.
Approach originally suggested by 


To generate a diff of this commit:
cvs rdiff -u -r1.319.2.1 -r1.319.2.2 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.319.2.1 src/share/mk/bsd.prog.mk:1.319.2.2
--- src/share/mk/bsd.prog.mk:1.319.2.1	Fri Aug 16 19:22:08 2019
+++ src/share/mk/bsd.prog.mk	Mon Aug 19 15:53:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.319.2.1 2019/08/16 19:22:08 martin Exp $
+#	$NetBSD: bsd.prog.mk,v 1.319.2.2 2019/08/19 15:53:40 martin Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -482,10 +482,18 @@ PROGNAME.${_P}?=	${_P}
 _PROGDEBUG.${_P}:=	${PROGNAME.${_P}}.debug
 .endif
 
+# paxctl specific arguments
+
 .if defined(PAXCTL_FLAGS)
 PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
 .endif
 
+.if ${MKSANITIZER:Uno} == "yes" && \
+	(${USE_SANITIZER} == "address" || ${USE_SANITIZER} == "thread" || \
+	${USE_SANITIZER} == "memory")
+PAXCTL_FLAGS.${_P}= +a
+.endif
+
 # PROG specific flags.
 
 _DPADD.${_P}=		${DPADD}${DPADD.${_P}}



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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:53:40 UTC 2019

Modified Files:
src/share/mk [netbsd-9]: bsd.prog.mk

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

share/mk/bsd.prog.mk: revision 1.322

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.
Approach originally suggested by 


To generate a diff of this commit:
cvs rdiff -u -r1.319.2.1 -r1.319.2.2 src/share/mk/bsd.prog.mk

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



CVS commit: [netbsd-9] src/tests/rump/modautoload

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:47:00 UTC 2019

Modified Files:
src/tests/rump/modautoload [netbsd-9]: Makefile

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

tests/rump/modautoload/Makefile: revision 1.9

Avoid symbol clashes in test/rump/modautoload/t_modautoload with sanitizers

Set SANITIZER_RENAME_SYMBOL.t_modautoload to:

 * sysctlbyname
 * sysctlgetmibinfo


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.16.1 src/tests/rump/modautoload/Makefile

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

Modified files:

Index: src/tests/rump/modautoload/Makefile
diff -u src/tests/rump/modautoload/Makefile:1.8 src/tests/rump/modautoload/Makefile:1.8.16.1
--- src/tests/rump/modautoload/Makefile:1.8	Fri Oct 14 16:02:35 2016
+++ src/tests/rump/modautoload/Makefile	Mon Aug 19 15:47:00 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2016/10/14 16:02:35 christos Exp $
+#	$NetBSD: Makefile,v 1.8.16.1 2019/08/19 15:47:00 martin Exp $
 #
 
 .include 
@@ -29,4 +29,9 @@ SRCS.t_modautoload+=		sysctlbyname.c
 SRCS.t_modautoload+=		sysctlgetmibinfo.c
 CPPFLAGS+=	-DRUMP_ACTION
 
+SANITIZER_RENAME_CLASSES+=		t_modautoload
+SANITIZER_RENAME_FILES.t_modautoload+=	${SRCS.t_modautoload}
+SANITIZER_RENAME_SYMBOL.t_modautoload+=	sysctlbyname
+SANITIZER_RENAME_SYMBOL.t_modautoload+=	sysctlgetmibinfo
+
 .include 



CVS commit: [netbsd-9] src/tests/rump/modautoload

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:47:00 UTC 2019

Modified Files:
src/tests/rump/modautoload [netbsd-9]: Makefile

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

tests/rump/modautoload/Makefile: revision 1.9

Avoid symbol clashes in test/rump/modautoload/t_modautoload with sanitizers

Set SANITIZER_RENAME_SYMBOL.t_modautoload to:

 * sysctlbyname
 * sysctlgetmibinfo


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.16.1 src/tests/rump/modautoload/Makefile

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



CVS commit: [netbsd-9] src/external/bsd/compiler_rt/lib/clang/lib/netbsd

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:43:54 UTC 2019

Modified Files:
src/external/bsd/compiler_rt/lib/clang/lib/netbsd [netbsd-9]: common.mk

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

external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk: revision 1.2
Set NODEBUG for LLVM sanitizers

The sanitizers are special purpose piece of software that needs customized
build rules. Do not bother with generating debuginfo files for them.

Fixes MKDEBUG=yes build


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk

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



CVS commit: [netbsd-9] src/external/bsd/compiler_rt/lib/clang/lib/netbsd

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 15:43:54 UTC 2019

Modified Files:
src/external/bsd/compiler_rt/lib/clang/lib/netbsd [netbsd-9]: common.mk

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

external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk: revision 1.2
Set NODEBUG for LLVM sanitizers

The sanitizers are special purpose piece of software that needs customized
build rules. Do not bother with generating debuginfo files for them.

Fixes MKDEBUG=yes build


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk

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/compiler_rt/lib/clang/lib/netbsd/common.mk
diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk:1.1.2.2 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk:1.1.2.3
--- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk:1.1.2.2	Fri Aug 16 18:44:06 2019
+++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/common.mk	Mon Aug 19 15:43:54 2019
@@ -1 +1,2 @@
 CLANG_VER=	7.0.0
+NODEBUG=	# defined



Re: CVS commit: src/sys/kern

2019-08-19 Thread Robert Elz
Date:Mon, 19 Aug 2019 05:32:42 -0400
From:"Christos Zoulas" 
Message-ID:  <20190819093242.88152f...@cvs.netbsd.org>

  | Log Message:
  | If we could not start extattr for some reason, don't advertise extattr
  | in the mount.

I would have expected a better result would be that if an attempt is
made to mount with extattr turned on, and extattr is not available, then
the mount would fail, rather than succeeding with exattr missing.

kre



CVS commit: [netbsd-8] src/doc

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:32:14 UTC 2019

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

Log Message:
Tickets #1339 and #1340


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

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



CVS commit: [netbsd-8] src/doc

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:32:14 UTC 2019

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

Log Message:
Tickets #1339 and #1340


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

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.26 src/doc/CHANGES-8.2:1.1.2.27
--- src/doc/CHANGES-8.2:1.1.2.26	Fri Aug 16 15:39:59 2019
+++ src/doc/CHANGES-8.2	Mon Aug 19 14:32:14 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.26 2019/08/16 15:39:59 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.27 2019/08/19 14:32:14 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -588,3 +588,15 @@ usr.sbin/cpuctl/arch/i386.c			1.104
 	  cpu_dcp_cacheinfo() and use it on both Intel and AMD.
 	[msaitoh, ticket #1338]
 
+sys/net/if.c	1.458
+tests/net/if/t_ifconfig.sh			1.21
+
+	PR kern/54434.: restore if_ioctl on error of ifc_destroy, otherwise
+	subsequent ioctls will not work. Add a test case for this.
+	[ozaki-r, ticket #1339]
+
+sys/netinet6/nd6.c1.257
+
+	Add missing IFNET_LOCK for regen_tmpaddr.
+	[ozaki-r, ticket #1340]
+



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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:28:13 UTC 2019

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

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

sys/netinet6/nd6.c: revision 1.257

Add missing IFNET_LOCK for regen_tmpaddr
Reported by ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.11 -r1.232.2.12 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.232.2.11 src/sys/netinet6/nd6.c:1.232.2.12
--- src/sys/netinet6/nd6.c:1.232.2.11	Fri Jul 26 11:27:36 2019
+++ src/sys/netinet6/nd6.c	Mon Aug 19 14:28:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.232.2.11 2019/07/26 11:27:36 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.232.2.12 2019/08/19 14:28:12 martin Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.232.2.11 2019/07/26 11:27:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.232.2.12 2019/08/19 14:28:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -668,8 +668,12 @@ nd6_timer_work(struct work *wk, void *ar
 			if (ip6_use_tempaddr &&
 			(ia6->ia6_flags & IN6_IFF_TEMPORARY) != 0 &&
 			(oldflags & IN6_IFF_DEPRECATED) == 0) {
+int ret;
 
-if (regen_tmpaddr(ia6) == 0) {
+IFNET_LOCK(ia6->ia_ifa.ifa_ifp);
+ret = regen_tmpaddr(ia6);
+IFNET_UNLOCK(ia6->ia_ifa.ifa_ifp);
+if (ret == 0) {
 	/*
 	 * A new temporary address is
 	 * generated.



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

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:28:13 UTC 2019

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

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

sys/netinet6/nd6.c: revision 1.257

Add missing IFNET_LOCK for regen_tmpaddr
Reported by ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.11 -r1.232.2.12 src/sys/netinet6/nd6.c

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



CVS commit: [netbsd-8] src

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:27:16 UTC 2019

Modified Files:
src/sys/net [netbsd-8]: if.c
src/tests/net/if [netbsd-8]: t_ifconfig.sh

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

sys/net/if.c: revision 1.458
tests/net/if/t_ifconfig.sh: revision 1.21

Restore if_ioctl on error of ifc_destroy

Otherwise subsequence ioctls won't work.

Patch from Harold Gutch on PR kern/54434 (tweaked a bit by me)
tests: check if ifconfig (ioctl) works after a failure of ifconfig destroy

This is a test for PR kern/54434.


To generate a diff of this commit:
cvs rdiff -u -r1.394.2.16 -r1.394.2.17 src/sys/net/if.c
cvs rdiff -u -r1.18 -r1.18.4.1 src/tests/net/if/t_ifconfig.sh

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



CVS commit: [netbsd-8] src

2019-08-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 19 14:27:16 UTC 2019

Modified Files:
src/sys/net [netbsd-8]: if.c
src/tests/net/if [netbsd-8]: t_ifconfig.sh

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

sys/net/if.c: revision 1.458
tests/net/if/t_ifconfig.sh: revision 1.21

Restore if_ioctl on error of ifc_destroy

Otherwise subsequence ioctls won't work.

Patch from Harold Gutch on PR kern/54434 (tweaked a bit by me)
tests: check if ifconfig (ioctl) works after a failure of ifconfig destroy

This is a test for PR kern/54434.


To generate a diff of this commit:
cvs rdiff -u -r1.394.2.16 -r1.394.2.17 src/sys/net/if.c
cvs rdiff -u -r1.18 -r1.18.4.1 src/tests/net/if/t_ifconfig.sh

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.394.2.16 src/sys/net/if.c:1.394.2.17
--- src/sys/net/if.c:1.394.2.16	Fri Apr 19 09:12:58 2019
+++ src/sys/net/if.c	Mon Aug 19 14:27:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.394.2.16 2019/04/19 09:12:58 martin Exp $	*/
+/*	$NetBSD: if.c,v 1.394.2.17 2019/08/19 14:27:16 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.16 2019/04/19 09:12:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.17 2019/08/19 14:27:16 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1601,6 +1601,8 @@ if_clone_destroy(const char *name)
 	struct if_clone *ifc;
 	struct ifnet *ifp;
 	struct psref psref;
+	int error;
+	int (*if_ioctl)(struct ifnet *, u_long, void *);
 
 	KASSERT(mutex_owned(_clone_mtx));
 
@@ -1617,6 +1619,7 @@ if_clone_destroy(const char *name)
 
 	/* We have to disable ioctls here */
 	IFNET_LOCK(ifp);
+	if_ioctl = ifp->if_ioctl;
 	ifp->if_ioctl = if_nullioctl;
 	IFNET_UNLOCK(ifp);
 
@@ -1626,7 +1629,16 @@ if_clone_destroy(const char *name)
 	 */
 	if_put(ifp, );
 
-	return (*ifc->ifc_destroy)(ifp);
+	error = (*ifc->ifc_destroy)(ifp);
+
+	if (error != 0) {
+		/* We have to restore if_ioctl on error */
+		IFNET_LOCK(ifp);
+		ifp->if_ioctl = if_ioctl;
+		IFNET_UNLOCK(ifp);
+	}
+
+	return error;
 }
 
 static bool

Index: src/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.18 src/tests/net/if/t_ifconfig.sh:1.18.4.1
--- src/tests/net/if/t_ifconfig.sh:1.18	Thu Mar 16 09:43:56 2017
+++ src/tests/net/if/t_ifconfig.sh	Mon Aug 19 14:27:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.18 2017/03/16 09:43:56 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.18.4.1 2019/08/19 14:27:16 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -69,6 +69,11 @@ ifconfig_create_destroy_body()
 	atf_check -s exit:0 rump.ifconfig shmif0 up
 	atf_check -s exit:0 rump.ifconfig shmif0 destroy
 
+	# Check if ifconfig (ioctl) works after a failure of ifconfig destroy
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0
+	atf_check -s not-exit:0 -e ignore rump.ifconfig lo0 destroy
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0
+
 	unset RUMP_SERVER
 }
 



CVS commit: src/sys/ufs/ufs

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 14:09:12 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
- KNF more
- print the full path in error messages


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/ufs/ufs/ufs_extattr.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/ufs/ufs/ufs_extattr.c
diff -u src/sys/ufs/ufs/ufs_extattr.c:1.49 src/sys/ufs/ufs/ufs_extattr.c:1.50
--- src/sys/ufs/ufs/ufs_extattr.c:1.49	Mon Aug 19 05:30:30 2019
+++ src/sys/ufs/ufs/ufs_extattr.c	Mon Aug 19 10:09:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extattr.c,v 1.49 2019/08/19 09:30:30 christos Exp $	*/
+/*	$NetBSD: ufs_extattr.c,v 1.50 2019/08/19 14:09:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.49 2019/08/19 09:30:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.50 2019/08/19 14:09:12 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -238,17 +238,13 @@ ufs_extattr_autocreate_attr(struct vnode
 	switch (attrnamespace) {
 	case EXTATTR_NAMESPACE_SYSTEM:
 		(void)snprintf(path, PATH_MAX, "%s/%s/%s/%s", 
-			   mp->mnt_stat.f_mntonname,
-			   UFS_EXTATTR_FSROOTSUBDIR,
-			   UFS_EXTATTR_SUBDIR_SYSTEM,
-			   attrname);
+		mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR,
+		UFS_EXTATTR_SUBDIR_SYSTEM, attrname);
 		break;
 	case EXTATTR_NAMESPACE_USER:
 		(void)snprintf(path, PATH_MAX, "%s/%s/%s/%s", 
-			   mp->mnt_stat.f_mntonname,
-			   UFS_EXTATTR_FSROOTSUBDIR,
-			   UFS_EXTATTR_SUBDIR_USER,
-			   attrname);
+		mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR,
+		UFS_EXTATTR_SUBDIR_USER, attrname);
 		break;
 	default:
 		PNBUF_PUT(path);
@@ -666,16 +662,18 @@ ufs_extattr_subdir(struct lwp *l, struct
 	error = ufs_extattr_lookup(attr_dvp, LOCKPARENT, subdir, _sub, l);
 	KASSERT(VOP_ISLOCKED(attr_dvp) == LK_EXCLUSIVE);
 	if (error) {
-		printf("%s: Can't find `%s/%s' (%d)\n",
-		__func__, UFS_EXTATTR_FSROOTSUBDIR, subdir, error);
+		printf("%s: Can't find `%s/%s/%s' (%d)\n",
+		__func__, mp->mnt_stat.f_mntonname,
+		UFS_EXTATTR_FSROOTSUBDIR, subdir, error);
 		return error;
 	}
 	KASSERT(VOP_ISLOCKED(attr_sub) == LK_EXCLUSIVE);
 	error = ufs_extattr_iterate_directory(VFSTOUFS(mp),
 	attr_sub, namespace, l);
 	if (error) {
-		printf("%s: ufs_extattr_iterate_directory for `%s/%s' (%d)\n",
-		__func__, UFS_EXTATTR_FSROOTSUBDIR, subdir, error);
+		printf("%s: ufs_extattr_iterate_directory `%s/%s/%s' (%d)\n",
+		__func__, mp->mnt_stat.f_mntonname,
+		UFS_EXTATTR_FSROOTSUBDIR, subdir, error);
 	}
 	KASSERT(VOP_ISLOCKED(attr_sub) == LK_EXCLUSIVE);
 	vput(attr_sub);
@@ -710,8 +708,8 @@ ufs_extattr_autostart(struct mount *mp, 
 		/* rvp ref'd but now unlocked */
 		KASSERT(VOP_ISLOCKED(rvp) == 0);
 		vrele(rvp);
-		printf("%s: lookup `%s' (%d)\n", __func__,
-		UFS_EXTATTR_FSROOTSUBDIR, error);
+		printf("%s: lookup `%s/%s' (%d)\n", __func__,
+		mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR, error);
 		return error;
 	}
 	if (rvp == attr_dvp) {
@@ -719,8 +717,8 @@ ufs_extattr_autostart(struct mount *mp, 
 		KASSERT(VOP_ISLOCKED(rvp) == LK_EXCLUSIVE);
 		vrele(attr_dvp);
 		vput(rvp);
-		printf("%s: `/' == `%s' (%d)\n", __func__,
-		UFS_EXTATTR_FSROOTSUBDIR, EINVAL);
+		printf("%s: `/' == `%s/%s' (%d)\n", __func__,
+		mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR, EINVAL);
 		return EINVAL;
 	}
 	KASSERT(VOP_ISLOCKED(rvp) == 0);
@@ -729,8 +727,9 @@ ufs_extattr_autostart(struct mount *mp, 
 	KASSERT(VOP_ISLOCKED(attr_dvp) == LK_EXCLUSIVE);
 
 	if (attr_dvp->v_type != VDIR) {
-		printf("%s: `%s' is not a directory\n",
-		__func__, UFS_EXTATTR_FSROOTSUBDIR);
+		printf("%s: `%s/%s' is not a directory\n",
+		__func__, mp->mnt_stat.f_mntonname,
+		UFS_EXTATTR_FSROOTSUBDIR);
 		goto return_vput_attr_dvp;
 	}
 



CVS commit: src/sys/ufs/ufs

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 14:09:12 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
- KNF more
- print the full path in error messages


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/ufs/ufs/ufs_extattr.c

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



Re: CVS commit: src/tests/net

2019-08-19 Thread Martin Husemann
On Mon, Aug 19, 2019 at 03:22:47AM +, Ryota Ozaki wrote:
> Module Name:  src
> Committed By: ozaki-r
> Date: Mon Aug 19 03:22:47 UTC 2019
> 
> Modified Files:
>   src/tests/net: net_common.sh
> 
> Log Message:
> tests: check pool object leaks
> 
> Currently only llentpl leaks can be detected.

The message is cryptic ;-)

Also this breaks ~all the networking tests for me, failures jumped from
19 to 462 on my sparc64 test run.

Martin


CVS commit: src/sys/arch

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 11:41:36 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx51_spi.c imx51reg.h imxspi.c imxspivar.h
src/sys/arch/arm/imx/fdt: files.imx6
src/sys/arch/evbarm/conf: IMX
src/sys/arch/evbarm/netwalker: netwalker_spi.c
Added Files:
src/sys/arch/arm/imx/fdt: imx6_spi.c

Log Message:
Add support SPI driver for i.MX6.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx51_spi.c \
src/sys/arch/arm/imx/imxspivar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/imx51reg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imxspi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/fdt/files.imx6
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/fdt/imx6_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/IMX
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/netwalker/netwalker_spi.c

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



CVS commit: src/sys/arch

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 11:41:36 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx51_spi.c imx51reg.h imxspi.c imxspivar.h
src/sys/arch/arm/imx/fdt: files.imx6
src/sys/arch/evbarm/conf: IMX
src/sys/arch/evbarm/netwalker: netwalker_spi.c
Added Files:
src/sys/arch/arm/imx/fdt: imx6_spi.c

Log Message:
Add support SPI driver for i.MX6.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx51_spi.c \
src/sys/arch/arm/imx/imxspivar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/imx51reg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imxspi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/fdt/files.imx6
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/fdt/imx6_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/IMX
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/netwalker/netwalker_spi.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/imx/imx51_spi.c
diff -u src/sys/arch/arm/imx/imx51_spi.c:1.1 src/sys/arch/arm/imx/imx51_spi.c:1.2
--- src/sys/arch/arm/imx/imx51_spi.c:1.1	Sat Mar 22 09:28:08 2014
+++ src/sys/arch/arm/imx/imx51_spi.c	Mon Aug 19 11:41:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_spi.c,v 1.1 2014/03/22 09:28:08 hkenken Exp $	*/
+/*	$NetBSD: imx51_spi.c,v 1.2 2019/08/19 11:41:36 hkenken Exp $	*/
 
 /*-
  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx51_spi.c,v 1.1 2014/03/22 09:28:08 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx51_spi.c,v 1.2 2019/08/19 11:41:36 hkenken Exp $");
 
 #include "locators.h"
 #include "opt_imx.h"
@@ -43,7 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: imx51_spi.c,
 #include 
 
 struct imx51spi_softc {
-	struct imxspi_softc sc_spi;
+	struct imxspi_softc sc_spi; /* Must be first */
+
 	struct spi_chipset_tag sc_tag;
 };
 
@@ -74,26 +75,39 @@ imxspi_match(device_t parent, cfdata_t c
 void
 imxspi_attach(device_t parent, device_t self, void *aux)
 {
-	struct imx51spi_softc *sc = device_private(self);
+	struct imx51spi_softc *isc = device_private(self);
+	struct imxspi_softc *sc = >sc_spi;
 	struct axi_attach_args *aa = aux;
 	struct imxspi_attach_args saa;
 	int cf_flags = device_cfdata(self)->cf_flags;
+	bus_addr_t addr;
+	bus_size_t size;
+	int error;
+
+	addr = aa->aa_addr;
+	size = aa->aa_size;
+	if (size <= 0)
+		size = SPI_SIZE;
 
 	sc->sc_tag.cookie = sc;
 	sc->sc_tag.spi_cs_enable = imxspi_cs_enable;
 	sc->sc_tag.spi_cs_disable = imxspi_cs_disable;
 
-	saa.saa_iot = aa->aa_iot;
-	saa.saa_addr = aa->aa_addr;
-	saa.saa_size = aa->aa_size;
-	saa.saa_irq = aa->aa_irq;
-	saa.saa_enhanced = cf_flags;
-
-	saa.saa_nslaves = IMXSPINSLAVES;
-	saa.saa_freq = imx51_get_clock(IMX51CLK_CSPI_CLK_ROOT);
-	saa.saa_tag = >sc_tag;
+	sc->sc_iot = aa->aa_iot;
+	sc->sc_enhanced = cf_flags;
 
-	sc->sc_spi.sc_dev = self;
+	sc->sc_nslaves = IMXSPINSLAVES;
+	sc->sc_freq = imx51_get_clock(IMX51CLK_CSPI_CLK_ROOT);
+	sc->sc_tag = >sc_tag;
+
+	if (bus_space_map(sc->sc_iot, addr, size, 0, >sc_ioh)) {
+		aprint_error_dev(sc->sc_dev, "couldn't map registers\n");
+		return;
+	}
+
+	/* enable device interrupts */
+	sc->sc_ih = intr_establish(aa->aa_irq, IPL_BIO, IST_LEVEL,
+	imxspi_intr, sc);
 
-	imxspi_attach_common(parent, >sc_spi, );
+	imxspi_attach_common(self);
 }
Index: src/sys/arch/arm/imx/imxspivar.h
diff -u src/sys/arch/arm/imx/imxspivar.h:1.1 src/sys/arch/arm/imx/imxspivar.h:1.2
--- src/sys/arch/arm/imx/imxspivar.h:1.1	Sat Mar 22 09:28:08 2014
+++ src/sys/arch/arm/imx/imxspivar.h	Mon Aug 19 11:41:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxspivar.h,v 1.1 2014/03/22 09:28:08 hkenken Exp $	*/
+/*	$NetBSD: imxspivar.h,v 1.2 2019/08/19 11:41:36 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
@@ -38,21 +38,10 @@ typedef struct spi_chipset_tag {
 	int (*spi_cs_disable)(void *, int);
 } *spi_chipset_tag_t;
 
-struct imxspi_attach_args {
-	bus_space_tag_t saa_iot;
-	bus_addr_t saa_addr;
-	bus_size_t saa_size;
-	int saa_irq;
-
-	spi_chipset_tag_t saa_tag;
-	int saa_nslaves;
-	unsigned long saa_freq;
-
-	int saa_enhanced;
-};
-
 struct imxspi_softc {
 	device_t sc_dev;
+	int sc_phandle;
+
 	bus_space_tag_t  sc_iot;
 	bus_space_handle_t sc_ioh;
 	spi_chipset_tag_t sc_tag;
@@ -66,10 +55,12 @@ struct imxspi_softc {
 	bool  sc_running;
 	SIMPLEQ_HEAD(,spi_transfer) sc_q;
 
+	int sc_nslaves;
 	int sc_enhanced;
 };
 
-int imxspi_attach_common(device_t, struct imxspi_softc *, void *);
+int imxspi_attach_common(device_t);
+int imxspi_intr(void *);
 
 /*
  * defined in machine dependent code

Index: src/sys/arch/arm/imx/imx51reg.h
diff -u src/sys/arch/arm/imx/imx51reg.h:1.7 src/sys/arch/arm/imx/imx51reg.h:1.8
--- src/sys/arch/arm/imx/imx51reg.h:1.7	Thu May  7 04:37:29 2015
+++ src/sys/arch/arm/imx/imx51reg.h	Mon Aug 19 11:41:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: 

CVS commit: src/sys/dev/spi

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 10:56:33 UTC 2019

Modified Files:
src/sys/dev/spi: oj6sh.c

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/spi/oj6sh.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/spi/oj6sh.c
diff -u src/sys/dev/spi/oj6sh.c:1.3 src/sys/dev/spi/oj6sh.c:1.4
--- src/sys/dev/spi/oj6sh.c:1.3	Thu Jul  4 11:13:26 2019
+++ src/sys/dev/spi/oj6sh.c	Mon Aug 19 10:56:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: oj6sh.c,v 1.3 2019/07/04 11:13:26 hkenken Exp $	*/
+/*	$NetBSD: oj6sh.c,v 1.4 2019/08/19 10:56:33 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: oj6sh.c,v 1.3 2019/07/04 11:13:26 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oj6sh.c,v 1.4 2019/08/19 10:56:33 hkenken Exp $");
 
 #include "opt_oj6sh.h"
 
@@ -127,7 +127,7 @@ static const struct wsmouse_accessops oj
 };
 
 static int
-oj6sh_match(device_t parent, cfdata_t match, void *aux)
+oj6sh_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct spi_attach_args *sa = aux;
 
@@ -180,6 +180,7 @@ oj6sh_attach(device_t parent, device_t s
 	struct spi_attach_args *sa = aux;
 	struct wsmousedev_attach_args a;
 
+	aprint_naive("\n");
 	aprint_normal(": OJ6SH-T25 Optical Joystick\n");
 
 	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -229,7 +230,7 @@ oj6sh_cb(struct work *wk, void *arg)
 	DPRINTF(3,("%s: x = %d, y = %d\n", device_xname(sc->sc_dev),
 		delta.x, delta.y));
 
-#if defined(J6SH_DOWN_Y_LEFT_X)
+#if defined(OJ6SH_DOWN_Y_LEFT_X)
 	y = -delta.y;
 	x = -delta.x;
 #elif defined(OJ6SH_UP_X_LEFT_Y)



CVS commit: src/sys/dev/spi

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 10:56:33 UTC 2019

Modified Files:
src/sys/dev/spi: oj6sh.c

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/spi/oj6sh.c

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



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

2019-08-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Aug 19 10:53:31 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c

Log Message:
Use a unique name for the acpi ARM_PLATFORM definition


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

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



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

2019-08-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Aug 19 10:53:31 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c

Log Message:
Use a unique name for the acpi ARM_PLATFORM definition


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/acpi/acpi_platform.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/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.16 src/sys/arch/arm/acpi/acpi_platform.c:1.17
--- src/sys/arch/arm/acpi/acpi_platform.c:1.16	Fri Aug  2 19:49:17 2019
+++ src/sys/arch/arm/acpi/acpi_platform.c	Mon Aug 19 10:53:31 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.16 2019/08/02 19:49:17 jmcneill Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.17 2019/08/19 10:53:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.16 2019/08/02 19:49:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.17 2019/08/19 10:53:31 jmcneill Exp $");
 
 #include 
 #include 
@@ -444,4 +444,4 @@ static const struct arm_platform acpi_pl
 	.ap_uart_freq = acpi_platform_uart_freq,
 };
 
-ARM_PLATFORM(virt, "netbsd,generic-acpi", _platform);
+ARM_PLATFORM(acpi, "netbsd,generic-acpi", _platform);



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

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 10:44:35 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_platform.c

Log Message:
Use a9ptmr_delay().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/fdt/imx6_platform.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/imx/fdt/imx6_platform.c
diff -u src/sys/arch/arm/imx/fdt/imx6_platform.c:1.5 src/sys/arch/arm/imx/fdt/imx6_platform.c:1.6
--- src/sys/arch/arm/imx/fdt/imx6_platform.c:1.5	Mon Aug  5 12:44:01 2019
+++ src/sys/arch/arm/imx/fdt/imx6_platform.c	Mon Aug 19 10:44:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.5 2019/08/05 12:44:01 hkenken Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.6 2019/08/19 10:44:35 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.5 2019/08/05 12:44:01 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.6 2019/08/19 10:44:35 hkenken Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -191,7 +191,7 @@ const struct arm_platform imx6_platform 
 	.ap_init_attach_args = imx_platform_init_attach_args,
 	.ap_device_register = imx_platform_device_register,
 	.ap_reset = imx6_platform_reset,
-	.ap_delay = a9tmr_delay,
+	.ap_delay = a9ptmr_delay,
 	.ap_uart_freq = imx_platform_uart_freq,
 	.ap_mpstart = imx_platform_mpstart,
 };



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

2019-08-19 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Aug 19 10:44:35 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_platform.c

Log Message:
Use a9ptmr_delay().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/fdt/imx6_platform.c

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



CVS commit: src/sys/kern

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:32:42 UTC 2019

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

Log Message:
If we could not start extattr for some reason, don't advertise extattr in the
mount.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/vfs_mount.c

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



CVS commit: src/sys/kern

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:32:42 UTC 2019

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

Log Message:
If we could not start extattr for some reason, don't advertise extattr in the
mount.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/vfs_mount.c

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

Modified files:

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.70 src/sys/kern/vfs_mount.c:1.71
--- src/sys/kern/vfs_mount.c:1.70	Wed Feb 20 05:08:37 2019
+++ src/sys/kern/vfs_mount.c	Mon Aug 19 05:32:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.70 2019/02/20 10:08:37 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.71 2019/08/19 09:32:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.70 2019/02/20 10:08:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.71 2019/08/19 09:32:42 christos Exp $");
 
 #include 
 #include 
@@ -807,10 +807,11 @@ mount_domount(struct lwp *l, vnode_t **v
 	vfs_ref(mp);
 	(void) VFS_STATVFS(mp, >mnt_stat);
 	error = VFS_START(mp, 0);
-   if (error) {
+	if (error) {
 		vrele(vp);
 	} else if (flags & MNT_EXTATTR) {
-		(void)start_extattr(mp);
+		if (start_extattr(mp) != 0)
+			mp->mnt_flag &= ~MNT_EXTATTR;
 	}
 	/* Drop reference held for VFS_START(). */
 	vfs_rele(mp);



CVS commit: src/sys/modules

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:31:31 UTC 2019

Modified Files:
src/sys/modules/ffs: Makefile
src/sys/modules/ufs: Makefile

Log Message:
Enable extended attributes in modules.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/modules/ffs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/ufs/Makefile

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



CVS commit: src/sys/modules

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:31:31 UTC 2019

Modified Files:
src/sys/modules/ffs: Makefile
src/sys/modules/ufs: Makefile

Log Message:
Enable extended attributes in modules.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/modules/ffs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/ufs/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/ffs/Makefile
diff -u src/sys/modules/ffs/Makefile:1.12 src/sys/modules/ffs/Makefile:1.13
--- src/sys/modules/ffs/Makefile:1.12	Wed Jun 19 23:31:29 2019
+++ src/sys/modules/ffs/Makefile	Mon Aug 19 05:31:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2019/06/20 03:31:29 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.13 2019/08/19 09:31:30 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -6,6 +6,7 @@
 
 KMOD=	ffs
 CPPFLAGS+=  -DUFS_DIRHASH -DFFS_EI -DWAPBL -DAPPLE_UFS -DQUOTA -DQUOTA2
+CPPFLAGS+=	-DUFS_EXTATTR
 
 CWARNFLAGS.clang=	-Wno-conversion
 

Index: src/sys/modules/ufs/Makefile
diff -u src/sys/modules/ufs/Makefile:1.1 src/sys/modules/ufs/Makefile:1.2
--- src/sys/modules/ufs/Makefile:1.1	Wed Jun 19 23:31:30 2019
+++ src/sys/modules/ufs/Makefile	Mon Aug 19 05:31:31 2019
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.1 2019/06/20 03:31:30 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.2 2019/08/19 09:31:31 christos Exp $
 
 .include "../Makefile.inc"
 
 KMOD=	ufs
 
 CPPFLAGS+=  -DUFS_DIRHASH -DFFS_EI -DWAPBL -DAPPLE_UFS -DQUOTA -DQUOTA2
+CPPFLAGS+=	-DUFS_EXTATTR
 
 CWARNFLAGS.clang=	-Wno-conversion
 



CVS commit: src/sys/ufs/ufs

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:30:30 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
- return (foo) -> return foo
- normalize all error messages to use __func__
- add more messages for startup failure (should perhaps auto-create
  the attributes directory and the user and system subdirs?)
- factor out common code


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/ufs/ufs/ufs_extattr.c

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



CVS commit: src/sys/ufs/ufs

2019-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 09:30:30 UTC 2019

Modified Files:
src/sys/ufs/ufs: ufs_extattr.c

Log Message:
- return (foo) -> return foo
- normalize all error messages to use __func__
- add more messages for startup failure (should perhaps auto-create
  the attributes directory and the user and system subdirs?)
- factor out common code


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/ufs/ufs/ufs_extattr.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/ufs/ufs/ufs_extattr.c
diff -u src/sys/ufs/ufs/ufs_extattr.c:1.48 src/sys/ufs/ufs/ufs_extattr.c:1.49
--- src/sys/ufs/ufs/ufs_extattr.c:1.48	Wed Nov  9 00:08:35 2016
+++ src/sys/ufs/ufs/ufs_extattr.c	Mon Aug 19 05:30:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extattr.c,v 1.48 2016/11/09 05:08:35 dholland Exp $	*/
+/*	$NetBSD: ufs_extattr.c,v 1.49 2019/08/19 09:30:30 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.48 2016/11/09 05:08:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.49 2019/08/19 09:30:30 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -207,10 +207,10 @@ ufs_extattr_valid_attrname(int attrnames
 {
 
 	if (attrname == NULL)
-		return (0);
+		return 0;
 	if (strlen(attrname) == 0)
-		return (0);
-	return (1);
+		return 0;
+	return 1;
 }
 
 /*
@@ -321,8 +321,8 @@ ufs_extattr_autocreate_attr(struct vnode
 	VOP_UNLOCK(backing_vp);
 
 	if (error != 0) {
-		printf("%s: write uef header failed for %s, error = %d\n", 
-		   __func__, attrname, error);
+		printf("%s: write uef header failed for `%s' (%d)\n", 
+		__func__, attrname, error);
 		vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
 		*uelep = NULL;
 		return error;
@@ -335,8 +335,8 @@ ufs_extattr_autocreate_attr(struct vnode
 	KASSERT(VOP_ISLOCKED(backing_vp) == 0);
 
 	if (error != 0) {
-		printf("%s: enable %s failed, error %d\n", 
-		   __func__, attrname, error);
+		printf("%s: enable `%s' failed (%d)\n", 
+		__func__, attrname, error);
 		vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
 		*uelep = NULL;
 		return error;
@@ -344,7 +344,7 @@ ufs_extattr_autocreate_attr(struct vnode
 
 	uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
 	if (uele == NULL) {
-		printf("%s: atttribute %s created but not found!\n",
+		printf("%s: atttribute `%s' created but not found!\n",
 		   __func__, attrname);
 		vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
 		*uelep = NULL;
@@ -352,7 +352,7 @@ ufs_extattr_autocreate_attr(struct vnode
 	}
 
 	printf("%s: EA backing store autocreated for %s\n",
-	   mp->mnt_stat.f_mntonname, attrname);
+	mp->mnt_stat.f_mntonname, attrname);
 
 	*uelep = uele;
 	return 0;
@@ -374,11 +374,11 @@ ufs_extattr_find_attr(struct ufsmount *u
 		if (!(strncmp(attrname, search_attribute->uele_attrname,
 		UFS_EXTATTR_MAXEXTATTRNAME)) &&
 		(attrnamespace == search_attribute->uele_attrnamespace)) {
-			return (search_attribute);
+			return search_attribute;
 		}
 	}
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -453,8 +453,7 @@ ufs_extattr_start(struct mount *mp, stru
 
  unlock:
 	ufs_extattr_uepm_unlock(ump);
-
-	return (error);
+	return error;
 }
 
 /*
@@ -490,8 +489,8 @@ ufs_extattr_lookup(struct vnode *start_d
 			VOP_UNLOCK(start_dvp);
 		}
 		PNBUF_PUT(pnbuf);
-		printf("ufs_extattr_lookup: copystr failed\n");
-		return (error);
+		printf("%s: copystr failed (%d)\n", __func__, error);
+		return error;
 	}
 	cnp.cn_namelen--;	/* trim nul termination */
 	vargs.a_desc = NULL;
@@ -504,11 +503,11 @@ ufs_extattr_lookup(struct vnode *start_d
 		if (lockparent == 0) {
 			VOP_UNLOCK(start_dvp);
 		}
-		return (error);
+		return error;
 	}
 #if 0
 	if (target_vp == start_dvp)
-		panic("ufs_extattr_lookup: target_vp == start_dvp");
+		panic("%s: target_vp == start_dvp", __func__);
 #endif
 
 	if (target_vp != start_dvp) {
@@ -523,7 +522,7 @@ ufs_extattr_lookup(struct vnode *start_d
 
 	KASSERT(VOP_ISLOCKED(target_vp) == LK_EXCLUSIVE);
 	*vp = target_vp;
-	return (0);
+	return 0;
 }
 
 /*
@@ -541,10 +540,9 @@ ufs_extattr_enable_with_open(struct ufsm
 
 	error = VOP_OPEN(vp, FREAD|FWRITE, l->l_cred);
 	if (error) {
-		printf("ufs_extattr_enable_with_open.VOP_OPEN(): failed "
-		"with %d\n", error);
+		printf("%s: VOP_OPEN(): failed (%d)\n", __func__, error);
 		VOP_UNLOCK(vp);
-		return (error);
+		return error;
 	}
 
 	mutex_enter(vp->v_interlock);
@@ -558,7 +556,7 @@ ufs_extattr_enable_with_open(struct ufsm
 	error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, l);
 	if (error != 0)
 		vn_close(vp, FREAD|FWRITE, l->l_cred);
-	return (error);
+	return error;
 }
 
 /*
@@ -582,7 +580,7 @@ ufs_extattr_iterate_directory(struct ufs
 	int error, eofflag = 0;
 
 	if (dvp->v_type != VDIR)
-		return (ENOTDIR);
+		return ENOTDIR;
 
 	dirbuf 

CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 08:07:55 UTC 2019

Modified Files:
src/sys/dev/usb: TODO.usbmp

Log Message:
axe, udav, url, cue, kue, smsc, udav[*], upl, url and urdnis
are now all ported to usbmp and mpsafe interfaces, and have
all been tested too.

[*] udav has an issue with usbnet port for some devices.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/TODO.usbmp

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/TODO.usbmp
diff -u src/sys/dev/usb/TODO.usbmp:1.14 src/sys/dev/usb/TODO.usbmp:1.15
--- src/sys/dev/usb/TODO.usbmp:1.14	Wed Jul 31 11:02:49 2019
+++ src/sys/dev/usb/TODO.usbmp	Mon Aug 19 08:07:55 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO.usbmp,v 1.14 2019/07/31 11:02:49 mrg Exp $
+$NetBSD: TODO.usbmp,v 1.15 2019/08/19 08:07:55 mrg Exp $
 
 
 the majority of the USB MP device interface is documented in usbdivar.h.
@@ -21,9 +21,6 @@ KERNEL_LOCK
 usb_detach_{waitold,wakeup} to usb_detach_{wait,broadcast} conversion:
   - drivers:
   if_aue.c
-  if_axe.c
-  if_udav.c
-  if_url.c
   stuirda.c
   ubt.c
   ucom.c
@@ -66,17 +63,10 @@ splusb drivers:
   - emdtv_dtv.c
   - if_athn_usb.c
   - if_aue.c
-  - if_cue.c
-  - if_kue.c
   - if_otus.c
   - if_rum.c
   - if_run.c
-  - if_smsc.c
-  - if_udav.c
-  - if_upl.c
   - if_ural.c
-  - if_url.c
-  - if_urndis.c
   - if_urtw.c
   - if_urtwn.c
   - if_zyd.c
@@ -113,16 +103,11 @@ missing D_MPSAFE drivers:
   - utoppy
 
 missing CALLOUT_MPSAFE drivers:
-  - if_aue.c
-  - if_cue.c
   - if_otus.c
   - if_rum.c
   - if_run.c
-  - if_smsc.c
-  - if_udav.c
   - if_upgt.c
   - if_ural.c
-  - if_url.c
   - if_urtw.c
   - if_urtwn.c
   - if_zyd.c
@@ -153,11 +138,11 @@ driver testing:		STATUS
   - axe			working
   - axen		working
   - cdce		working
-  - cue
-  - kue
+  - cue			working
+  - kue			working
   - udav
-  - url
-  - urndis
+  - url			working
+  - urndis		working
   - atu
   - otus
   - ral
@@ -168,7 +153,7 @@ driver testing:		STATUS
   - urtwn		working
   - upgt
   - zyd
-  - upl
+  - upl			working
   - uberry
   - uipad
   - urio



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 08:07:55 UTC 2019

Modified Files:
src/sys/dev/usb: TODO.usbmp

Log Message:
axe, udav, url, cue, kue, smsc, udav[*], upl, url and urdnis
are now all ported to usbmp and mpsafe interfaces, and have
all been tested too.

[*] udav has an issue with usbnet port for some devices.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/TODO.usbmp

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



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 07:33:37 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_mue.c if_smsc.c if_ure.c
usbnet.c

Log Message:
move the check against un_phyno from usbnet back into the drivers
that do this (axe, axen, mue, smsc, ure.)  it made mii scanning
only work for phy 0, and aue needs it for at least one device.

fix smsc to return usbd_status not -1 on failure.  XXX smsc was
writing to '*val' even in error cases, it does not now.

remove a double call to IFQ_SET_READY() (noticed by chuq).

avoid unlock+instant relock by using usbnet_lock_mii_un_locked().


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/usbnet.c

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



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 07:33:37 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_mue.c if_smsc.c if_ure.c
usbnet.c

Log Message:
move the check against un_phyno from usbnet back into the drivers
that do this (axe, axen, mue, smsc, ure.)  it made mii scanning
only work for phy 0, and aue needs it for at least one device.

fix smsc to return usbd_status not -1 on failure.  XXX smsc was
writing to '*val' even in error cases, it does not now.

remove a double call to IFQ_SET_READY() (noticed by chuq).

avoid unlock+instant relock by using usbnet_lock_mii_un_locked().


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/usbnet.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.116 src/sys/dev/usb/if_axe.c:1.117
--- src/sys/dev/usb/if_axe.c:1.116	Fri Aug 16 08:29:20 2019
+++ src/sys/dev/usb/if_axe.c	Mon Aug 19 07:33:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.116 2019/08/16 08:29:20 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.117 2019/08/19 07:33:37 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.116 2019/08/16 08:29:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.117 2019/08/19 07:33:37 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -323,6 +323,9 @@ axe_mii_read_reg(struct usbnet *un, int 
 
 	DPRINTFN(30, "phy 0x%jx reg 0x%jx\n", phy, reg, 0, 0);
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
 	axe_cmd(sc, AXE_CMD_MII_OPMODE_SW, 0, 0, NULL);
 
 	err = axe_cmd(sc, AXE_CMD_MII_READ_REG, reg, phy, );
@@ -356,6 +359,9 @@ axe_mii_write_reg(struct usbnet *un, int
 	usbd_status err;
 	uint16_t aval;
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
 	aval = htole16(val);
 
 	axe_cmd(sc, AXE_CMD_MII_OPMODE_SW, 0, 0, NULL);

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.64 src/sys/dev/usb/if_axen.c:1.65
--- src/sys/dev/usb/if_axen.c:1.64	Thu Aug 15 05:52:23 2019
+++ src/sys/dev/usb/if_axen.c	Mon Aug 19 07:33:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.64 2019/08/15 05:52:23 mrg Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.65 2019/08/19 07:33:37 mrg Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.64 2019/08/15 05:52:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.65 2019/08/19 07:33:37 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -135,8 +135,11 @@ static usbd_status
 axen_mii_read_reg(struct usbnet *un, int phy, int reg, uint16_t *val)
 {
 	uint16_t data;
-	usbd_status err = axen_cmd(un, AXEN_CMD_MII_READ_REG, reg, phy, );
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
+	usbd_status err = axen_cmd(un, AXEN_CMD_MII_READ_REG, reg, phy, );
 	if (!err) {
 		*val = le16toh(data);
 
@@ -152,6 +155,9 @@ axen_mii_write_reg(struct usbnet *un, in
 {
 	uint16_t uval = htole16(val);
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
 	return axen_cmd(un, AXEN_CMD_MII_WRITE_REG, reg, phy, );
 }
 

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.52 src/sys/dev/usb/if_mue.c:1.53
--- src/sys/dev/usb/if_mue.c:1.52	Thu Aug 15 08:02:32 2019
+++ src/sys/dev/usb/if_mue.c	Mon Aug 19 07:33:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.52 2019/08/15 08:02:32 mrg Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.53 2019/08/19 07:33:37 mrg Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.52 2019/08/15 08:02:32 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.53 2019/08/19 07:33:37 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -217,6 +217,9 @@ mue_mii_read_reg(struct usbnet *un, int 
 
 	usbnet_isowned_mii(un);
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
 	if (MUE_WAIT_CLR(un, MUE_MII_ACCESS, MUE_MII_ACCESS_BUSY, 0)) {
 		MUE_PRINTF(un, "not ready\n");
 		return USBD_IN_USE;
@@ -242,6 +245,9 @@ mue_mii_write_reg(struct usbnet *un, int
 {
 	usbnet_isowned_mii(un);
 
+	if (un->un_phyno != phy)
+		return USBD_INVAL;
+
 	if (MUE_WAIT_CLR(un, MUE_MII_ACCESS, MUE_MII_ACCESS_BUSY, 0)) {
 		MUE_PRINTF(un, "not ready\n");
 		return USBD_IN_USE;

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.58 src/sys/dev/usb/if_smsc.c:1.59
--- src/sys/dev/usb/if_smsc.c:1.58	Thu Aug 15 05:52:23 2019
+++ src/sys/dev/usb/if_smsc.c	Mon Aug 19 

CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 07:20:07 UTC 2019

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

Log Message:
move the call to rnd_attach_source() earlier and add a matching
call to rnd_detach_source() into detach.

fixes an attach-detach-reattach issue where the rnd source was
already known.


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

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

Modified files:

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.71 src/sys/dev/usb/if_urtwn.c:1.72
--- src/sys/dev/usb/if_urtwn.c:1.71	Thu Jul 25 14:31:35 2019
+++ src/sys/dev/usb/if_urtwn.c	Mon Aug 19 07:20:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.71 2019/07/25 14:31:35 msaitoh Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg 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.71 2019/07/25 14:31:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -390,6 +390,9 @@ urtwn_attach(device_t parent, device_t s
 	callout_init(>sc_calib_to, 0);
 	callout_setfunc(>sc_calib_to, urtwn_calib_to, sc);
 
+	rnd_attach_source(>rnd_source, device_xname(sc->sc_dev),
+	RND_TYPE_NET, RND_FLAG_DEFAULT);
+
 	error = usbd_set_config_no(sc->sc_udev, 1, 0);
 	if (error != 0) {
 		aprint_error_dev(self, "failed to set configuration"
@@ -513,8 +516,6 @@ urtwn_attach(device_t parent, device_t s
 
 	ifp->if_percpuq = if_percpuq_create(ifp);
 	if_register(ifp);
-	rnd_attach_source(>rnd_source, device_xname(sc->sc_dev),
-	RND_TYPE_NET, RND_FLAG_DEFAULT);
 
 	ieee80211_announce(ic);
 
@@ -569,6 +570,8 @@ urtwn_detach(device_t self, int flags)
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev);
 
+	rnd_detach_source(>rnd_source);
+
 	callout_destroy(>sc_scan_to);
 	callout_destroy(>sc_calib_to);
 



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 07:20:07 UTC 2019

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

Log Message:
move the call to rnd_attach_source() earlier and add a matching
call to rnd_detach_source() into detach.

fixes an attach-detach-reattach issue where the rnd source was
already known.


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

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



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 06:35:14 UTC 2019

Modified Files:
src/sys/dev/usb: usbhist.h usbnet.c

Log Message:
add USBHIST_CALLARGS() frontend to KERNHIST_CALLARGS().
add USBNETHIST_CALLARGS() frontend to USBHIST_CALLARGS().

use both in read/write reg, instead of aprint.

use %jx and (uintptr_t) and fix the 32 bit debug build.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/usbhist.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/usbnet.c

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

Modified files:

Index: src/sys/dev/usb/usbhist.h
diff -u src/sys/dev/usb/usbhist.h:1.4 src/sys/dev/usb/usbhist.h:1.5
--- src/sys/dev/usb/usbhist.h:1.4	Sat Apr 23 10:15:32 2016
+++ src/sys/dev/usb/usbhist.h	Mon Aug 19 06:35:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbhist.h,v 1.4 2016/04/23 10:15:32 skrll Exp $	*/
+/*	$NetBSD: usbhist.h,v 1.5 2019/08/19 06:35:14 mrg Exp $	*/
 
 /*
  * Copyright (c) 2012 Matthew R. Green
@@ -69,6 +69,11 @@ extern int usbdebug;
 		KERNHIST_CALLED(usbhist);			\
 	}			\
 } while (0)
+#define USBHIST_CALLARGS(NAME,FMT,A,B,C,D) do {			\
+	if ((NAME) != 0) {	\
+		KERNHIST_CALLARGS(usbhist,FMT,A,B,C,D);		\
+	}			\
+} while (0)
 #define USBHIST_FUNC()			KERNHIST_FUNC(__func__)
 
 USBHIST_DECL(usbhist);
@@ -83,6 +88,7 @@ USBHIST_DECL(usbhist);
 #define USBHIST_LOGN(N,NAME,FMT,A,B,C,D)	do { } while(0)
 #define USBHIST_LOGM(N,NAME,FMT,A,B,C,D)	do { } while(0)
 #define USBHIST_LOG(NAME,FMT,A,B,C,D)		do { } while(0)
+#define USBHIST_CALLARGS(NAME,FMT,A,B,C,D)
 #define USBHIST_CALLED(NAME)
 #define USBHIST_FUNC()
 

Index: src/sys/dev/usb/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.18 src/sys/dev/usb/usbnet.c:1.19
--- src/sys/dev/usb/usbnet.c:1.18	Sun Aug 18 09:46:58 2019
+++ src/sys/dev/usb/usbnet.c	Mon Aug 19 06:35:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.18 2019/08/18 09:46:58 mrg Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.19 2019/08/19 06:35:14 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.18 2019/08/18 09:46:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.19 2019/08/19 06:35:14 mrg Exp $");
 
 #include 
 #include 
@@ -134,6 +134,8 @@ fail:
 #define DPRINTFN(N,FMT,A,B,C,D)	USBHIST_LOGN(usbnetdebug,N,FMT,A,B,C,D)
 #define USBNETHIST_FUNC()	USBHIST_FUNC()
 #define USBNETHIST_CALLED(name)	USBHIST_CALLED(usbnetdebug)
+#define USBNETHIST_CALLARGS(FMT,A,B,C,D) \
+USBHIST_CALLARGS(usbnetdebug,FMT,A,B,C,D)
 
 /* Callback vectors. */
 
@@ -274,7 +276,8 @@ usbnet_input(struct usbnet * const un, u
 	struct mbuf *m;
 
 	usbnet_isowned_rx(un);
-	DPRINTFN(0, "called! un %p buf %p len %ju", un, buf, buflen, 0);
+	DPRINTFN(0, "called! un %jx buf %jx len %ju",
+	(uintmax_t)un, (uintmax_t)buf, buflen, 0);
 
 	m = usbnet_newbuf(buflen);
 	if (m == NULL) {
@@ -860,6 +863,7 @@ usbnet_mutex_mii(struct usbnet *un)
 int
 usbnet_mii_readreg(device_t dev, int phy, int reg, uint16_t *val)
 {
+	USBNETHIST_FUNC();
 	struct usbnet * const un = device_private(dev);
 	struct usbnet_private * const unp = un->un_pri;
 	usbd_status err;
@@ -876,7 +880,7 @@ usbnet_mii_readreg(device_t dev, int phy
 	usbnet_unlock_mii(un);
 
 	if (err) {
-		aprint_error_dev(un->un_dev, "read PHY failed: %d\n", err);
+		USBNETHIST_CALLARGS("read PHY failed: %d", err, 0, 0, 0);
 		return EIO;
 	}
 
@@ -886,6 +890,7 @@ usbnet_mii_readreg(device_t dev, int phy
 int
 usbnet_mii_writereg(device_t dev, int phy, int reg, uint16_t val)
 {
+	USBNETHIST_FUNC();
 	struct usbnet * const un = device_private(dev);
 	struct usbnet_private * const unp = un->un_pri;
 	usbd_status err;
@@ -902,7 +907,7 @@ usbnet_mii_writereg(device_t dev, int ph
 	usbnet_unlock_mii(un);
 
 	if (err) {
-		aprint_error_dev(un->un_dev, "write PHY failed: %d\n", err);
+		USBNETHIST_CALLARGS("write PHY failed: %d", err, 0, 0, 0);
 		return EIO;
 	}
 



CVS commit: src/sys/dev/usb

2019-08-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 19 06:35:14 UTC 2019

Modified Files:
src/sys/dev/usb: usbhist.h usbnet.c

Log Message:
add USBHIST_CALLARGS() frontend to KERNHIST_CALLARGS().
add USBNETHIST_CALLARGS() frontend to USBHIST_CALLARGS().

use both in read/write reg, instead of aprint.

use %jx and (uintptr_t) and fix the 32 bit debug build.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/usbhist.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/usbnet.c

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