Re: CVS commit: src/sys/arch/x86/x86

2018-06-21 Thread Maxime Villard

Le 22/06/2018 à 03:40, matthew green a écrit :

"Maxime Villard" writes:

Module Name:src
Committed By:   maxv
Date:   Tue Jun 19 09:25:13 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
When using EagerFPU, create the fpu state in execve at IPL_HIGH.


why splhigh instead of kpreempt_disable()?


Nick Hudson asked me the same question yesterday, here's the relevant part
of my answer (quoting his mail, I guess he doesn't mind).

The fpu code already runs at splhigh, and this disables preemption. So I
used splhigh too.




 Message transféré 
Sujet : Re: Fwd: CVS commit: src/sys/arch/x86/x86
Date : Thu, 21 Jun 2018 07:23:33 +0100
De : Nick Hudson 
Pour : Maxime Villard 

On 21/06/2018 07:21, Maxime Villard wrote:

Le 21/06/2018 à 08:11, Nick Hudson a écrit :

On 21/06/2018 06:42, Maxime Villard wrote:

Le 21/06/2018 à 07:34, Maxime Villard a écrit :

Le 21/06/2018 à 07:21, Nick Hudson a écrit :

Surely, kpreempt_{disable,enable}() is what you really mean?

Nick


No, I mean splhigh. splhigh does prevent preemption, is that 
incorrect?


If you want to disable preemption then kpreempt_disable() is what you 
want.


If you want to disable interrupts (and as a consequence pre-emption) 
then splhigh is what you want.


I firmly believe you want the former.

Why disable interupts unnecessarily? This is "bad practice" and 
shouldn't be left for others to cargo cult copy.


There is a KASSERT in fpusave_cpu(), which I didn't introduce. We want
IPL_HIGH, unconditionally.

So no, I don't want the former, the FPU code wants the latter. Then we 
can say that maybe splhigh is not needed after all in fpusave_cpu; I won't 
risk introducing random races.


In the commit I said "disable preemption" because I had in mind the 
problem where a context switch occurs as a result of preemption.


Up to you... really don't know why FPU code needs interrupts disabled.


CVS commit: src/sys

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 22 04:41:57 UTC 2018

Modified Files:
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/playstation2/dev: if_smap.c
src/sys/dev/ic: dm9000.c

Log Message:
 Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/playstation2/dev/if_smap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/dm9000.c

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



CVS commit: src/sys

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 22 04:41:57 UTC 2018

Modified Files:
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/playstation2/dev: if_smap.c
src/sys/dev/ic: dm9000.c

Log Message:
 Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/playstation2/dev/if_smap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/dm9000.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/emips/ebus/if_le_ebus.c
diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.14 src/sys/arch/emips/ebus/if_le_ebus.c:1.15
--- src/sys/arch/emips/ebus/if_le_ebus.c:1.14	Fri Jun 22 04:17:40 2018
+++ src/sys/arch/emips/ebus/if_le_ebus.c	Fri Jun 22 04:41:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le_ebus.c,v 1.14 2018/06/22 04:17:40 msaitoh Exp $	*/
+/*	$NetBSD: if_le_ebus.c,v 1.15 2018/06/22 04:41:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.14 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.15 2018/06/22 04:41:57 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -873,8 +873,7 @@ enic_start(struct ifnet *ifp)
 		 * If BPF is listening on this interface, let it see the packet
 		 * before we commit it to the wire.
 		 */
-		if (ifp->if_bpf)
-			bpf_mtap(ifp, m);
+		bpf_mtap(ifp, m);
 
 		/*
 		 * Copy the mbuf chain into a contiguous transmit buffer.

Index: src/sys/arch/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.25 src/sys/arch/playstation2/dev/if_smap.c:1.26
--- src/sys/arch/playstation2/dev/if_smap.c:1.25	Fri Jun 22 04:17:41 2018
+++ src/sys/arch/playstation2/dev/if_smap.c	Fri Jun 22 04:41:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.25 2018/06/22 04:17:41 msaitoh Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.26 2018/06/22 04:41:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.25 2018/06/22 04:17:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.26 2018/06/22 04:41:57 msaitoh Exp $");
 
 #include "debug_playstation2.h"
 
@@ -497,8 +497,7 @@ smap_start(struct ifnet *ifp)
 
 		IFQ_DEQUEUE(>if_snd, m0);
 		KDASSERT(m0 != NULL);
-		if (ifp->if_bpf)
-			bpf_mtap(ifp, m0);
+		bpf_mtap(ifp, m0);
 
 		p = (u_int8_t *)sc->tx_buf;
 		q = p + sz;

Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.13 src/sys/dev/ic/dm9000.c:1.14
--- src/sys/dev/ic/dm9000.c:1.13	Fri Jun 22 04:17:42 2018
+++ src/sys/dev/ic/dm9000.c	Fri Jun 22 04:41:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.13 2018/06/22 04:17:42 msaitoh Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.14 2018/06/22 04:41:57 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -650,8 +650,7 @@ dme_prepare(struct dme_softc *sc, struct
 
 	/* Element has now been removed from the queue, so we better send it */
 
-	if (ifp->if_bpf)
-		bpf_mtap(ifp, bufChain);
+	bpf_mtap(ifp, bufChain);
 
 	/* Setup the DM9000 to accept the writes, and then write each buf in
 	   the chain. */



CVS commit: src/sys

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 22 04:17:42 UTC 2018

Modified Files:
src/sys/arch/acorn32/podulebus: if_ie.c
src/sys/arch/amiga/dev: if_es.c if_qn.c
src/sys/arch/arm/at91: at91emac.c
src/sys/arch/arm/ep93xx: epe.c
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/mac68k/dev: if_mc.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/newsmips/apbus: if_sn.c
src/sys/arch/next68k/dev: mb8795.c
src/sys/arch/playstation2/dev: if_smap.c
src/sys/arch/sun2/dev: if_ec.c
src/sys/arch/sun3/dev: if_ie.c
src/sys/arch/x68k/dev: if_ne_intio.c
src/sys/arch/xen/xen: if_xennet_xenbus.c xennetback_xenbus.c
src/sys/dev/bi: if_ni.c
src/sys/dev/cadence: if_cemac.c
src/sys/dev/ic: am7990.c am79900.c an.c cs89x0.c dm9000.c dp8390.c
elink3.c elinkxl.c hme.c i82586.c lance.c mb86950.c mb86960.c
mtd803.c pdq_ifsubr.c rrunner.c seeq8005.c sgec.c smc90cx6.c
smc91cxx.c tropic.c wi.c
src/sys/dev/isa: if_eg.c if_el.c if_iy.c
src/sys/dev/ofw: ofnet.c
src/sys/dev/pci: if_de.c if_fpa.c if_jme.c if_tl.c if_vte.c
src/sys/dev/pcmcia: if_cnw.c if_ray.c if_xi.c mhzc.c xirc.c
src/sys/dev/qbus: if_de.c if_qe.c if_qt.c
src/sys/dev/sbus: be.c qe.c
src/sys/dev/scsipi: if_se.c
src/sys/dev/usb: if_atu.c

Log Message:
 It's not required to include net/bpfdesc.h. Remove it.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/acorn32/podulebus/if_ie.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/dev/if_es.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amiga/dev/if_qn.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/at91/at91emac.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/newsmips/apbus/if_sn.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/next68k/dev/mb8795.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/playstation2/dev/if_smap.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun2/dev/if_ec.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sun3/dev/if_ie.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x68k/dev/if_ne_intio.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xennetback_xenbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/bi/if_ni.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/cadence/if_cemac.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/ic/am7990.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/am79900.c src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/an.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/dm9000.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/ic/elink3.c
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/ic/elinkxl.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/ic/hme.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/lance.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/ic/mb86960.c src/sys/dev/ic/rrunner.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/mtd803.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/pdq_ifsubr.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/seeq8005.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/sgec.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/smc90cx6.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/tropic.c
cvs rdiff -u -r1.244 -r1.245 src/sys/dev/ic/wi.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/isa/if_eg.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/isa/if_el.c
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ofw/ofnet.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/pci/if_de.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/if_fpa.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_jme.c
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/if_tl.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_vte.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/pcmcia/if_xi.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pcmcia/mhzc.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pcmcia/xirc.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/qbus/if_de.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/qbus/if_qe.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/qbus/if_qt.c
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/sbus/be.c
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/scsipi/if_se.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_atu.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/acorn32/podulebus/if_ie.c

CVS commit: src/sys

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 22 04:17:42 UTC 2018

Modified Files:
src/sys/arch/acorn32/podulebus: if_ie.c
src/sys/arch/amiga/dev: if_es.c if_qn.c
src/sys/arch/arm/at91: at91emac.c
src/sys/arch/arm/ep93xx: epe.c
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/mac68k/dev: if_mc.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/newsmips/apbus: if_sn.c
src/sys/arch/next68k/dev: mb8795.c
src/sys/arch/playstation2/dev: if_smap.c
src/sys/arch/sun2/dev: if_ec.c
src/sys/arch/sun3/dev: if_ie.c
src/sys/arch/x68k/dev: if_ne_intio.c
src/sys/arch/xen/xen: if_xennet_xenbus.c xennetback_xenbus.c
src/sys/dev/bi: if_ni.c
src/sys/dev/cadence: if_cemac.c
src/sys/dev/ic: am7990.c am79900.c an.c cs89x0.c dm9000.c dp8390.c
elink3.c elinkxl.c hme.c i82586.c lance.c mb86950.c mb86960.c
mtd803.c pdq_ifsubr.c rrunner.c seeq8005.c sgec.c smc90cx6.c
smc91cxx.c tropic.c wi.c
src/sys/dev/isa: if_eg.c if_el.c if_iy.c
src/sys/dev/ofw: ofnet.c
src/sys/dev/pci: if_de.c if_fpa.c if_jme.c if_tl.c if_vte.c
src/sys/dev/pcmcia: if_cnw.c if_ray.c if_xi.c mhzc.c xirc.c
src/sys/dev/qbus: if_de.c if_qe.c if_qt.c
src/sys/dev/sbus: be.c qe.c
src/sys/dev/scsipi: if_se.c
src/sys/dev/usb: if_atu.c

Log Message:
 It's not required to include net/bpfdesc.h. Remove it.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/acorn32/podulebus/if_ie.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/amiga/dev/if_es.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amiga/dev/if_qn.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/at91/at91emac.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/newsmips/apbus/if_sn.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/next68k/dev/mb8795.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/playstation2/dev/if_smap.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun2/dev/if_ec.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sun3/dev/if_ie.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x68k/dev/if_ne_intio.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xennetback_xenbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/bi/if_ni.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/cadence/if_cemac.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/ic/am7990.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/am79900.c src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/an.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/dm9000.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/ic/elink3.c
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/ic/elinkxl.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/ic/hme.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/lance.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/ic/mb86960.c src/sys/dev/ic/rrunner.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/mtd803.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/pdq_ifsubr.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/seeq8005.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/sgec.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/smc90cx6.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/tropic.c
cvs rdiff -u -r1.244 -r1.245 src/sys/dev/ic/wi.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/isa/if_eg.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/isa/if_el.c
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ofw/ofnet.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/pci/if_de.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/if_fpa.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_jme.c
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/if_tl.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_vte.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/pcmcia/if_xi.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pcmcia/mhzc.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pcmcia/xirc.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/qbus/if_de.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/qbus/if_qe.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/qbus/if_qt.c
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/sbus/be.c
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/scsipi/if_se.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_atu.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/amd64/conf

2018-06-21 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Fri Jun 22 02:51:17 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
PR port-xen/50446
With approval from bouyer@ and acceptance, sometimes grudgingly, from
others I have removed the AGP lines from the XEN3_DOM0 config.  I have
left a note in the PR suggesting that if it ever gets a proper fix that
those lines can be considered for re-inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/amd64/conf/XEN3_DOM0

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.151 src/sys/arch/amd64/conf/XEN3_DOM0:1.152
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.151	Thu Jun  7 13:36:28 2018
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Fri Jun 22 02:51:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.151 2018/06/07 13:36:28 thorpej Exp $
+# $NetBSD: XEN3_DOM0,v 1.152 2018/06/22 02:51:17 darcy Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -10,7 +10,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 #options 	UVMHIST_PRINT
 #options 	SYSCALL_DEBUG
 
-#ident		"XEN3_DOM0-$Revision: 1.151 $"
+#ident		"XEN3_DOM0-$Revision: 1.152 $"
 
 maxusers	32		# estimated number of users
 
@@ -256,13 +256,10 @@ ichlpcib* at pci? dev ? function ?	# Int
 	# watchdog and SpeedStep support
 pcib*	at pci? dev ? function ?	# PCI-ISA bridges
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
-options 	AGP_X86
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 # XXX 'puc's aren't really bridges, but there's no better place for them here
 puc*	at pci? dev ? function ?	# PCI "universal" comm. cards
 
-agp*	at pchb?
-
 # ISA bus support
 isa0	at ichlpcib?
 isa0	at pcib?



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

2018-06-21 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Fri Jun 22 02:51:17 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
PR port-xen/50446
With approval from bouyer@ and acceptance, sometimes grudgingly, from
others I have removed the AGP lines from the XEN3_DOM0 config.  I have
left a note in the PR suggesting that if it ever gets a proper fix that
those lines can be considered for re-inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/amd64/conf/XEN3_DOM0

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



re: CVS commit: src/share/mk

2018-06-21 Thread matthew green
"Maya Rashish" writes:
> Module Name:  src
> Committed By: maya
> Date: Wed Jun 20 02:15:13 UTC 2018
> 
> Modified Files:
>   src/share/mk: sys.mk
> 
> Log Message:
> Strip -Wsystem-headers from CXXFLAGS.
> 
> GCC's C++ headers are not clean (yet). They are trying, but haven't got there
> yet.
> 
> Necessary for including  which uses .

can you add a comment about this?  the stripping is normally
about stuff that c++ frontend does not support, vs stuff that
breaks because of other issues.

ie, the rest of them should always stay, but this one will
hopefully go away in the future.

thanks.


.mrg.


re: CVS commit: src/sys/arch/x86/x86

2018-06-21 Thread matthew green
"Maxime Villard" writes:
> Module Name:  src
> Committed By: maxv
> Date: Tue Jun 19 09:25:13 UTC 2018
> 
> Modified Files:
>   src/sys/arch/x86/x86: fpu.c
> 
> Log Message:
> When using EagerFPU, create the fpu state in execve at IPL_HIGH.

why splhigh instead of kpreempt_disable()?


.mrg.


CVS commit: src/share/misc

2018-06-21 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 21 23:05:44 UTC 2018

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Amend MIPS, there are multiple stages in a pipeline.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.202 src/share/misc/acronyms.comp:1.203
--- src/share/misc/acronyms.comp:1.202	Thu Jun 21 22:56:42 2018
+++ src/share/misc/acronyms.comp	Thu Jun 21 23:05:44 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.202 2018/06/21 22:56:42 sevan Exp $
+$NetBSD: acronyms.comp,v 1.203 2018/06/21 23:05:44 maya Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -810,7 +810,7 @@ MIMD	multiple instruction, multiple data
 MIME	Multipurpose Internet Mail Extensions
 MIMO	multiple input multiple output
 MIPS	million instructions per second
-MIPS	Microprocessor without Interlocked Pipeline Stage
+MIPS	Microprocessor without Interlocked Pipeline Stages
 MISD	multiple instruction, single data
 MIT	Massachusetts Institute of Technology
 MITM	man in the middle



CVS commit: src/usr.sbin/sysinst

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 23:05:28 UTC 2018

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
Fix invalid free(3) in sysinst(8)

The path variable is assigned with an allocation on the heap with
strdup(3). Later this pointer is changed with strsep(3) and this caused
invalid free(3).

Store the original pointer in a new helper variable opath and pass it to
free(3). With this change, the problem is going away.

Detected with MKSANITIZER=yes with AddressSanitizer.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/util.c

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

Modified files:

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.8 src/usr.sbin/sysinst/util.c:1.9
--- src/usr.sbin/sysinst/util.c:1.8	Fri May 18 12:23:22 2018
+++ src/usr.sbin/sysinst/util.c	Thu Jun 21 23:05:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.8 2018/05/18 12:23:22 joerg Exp $	*/
+/*	$NetBSD: util.c,v 1.9 2018/06/21 23:05:28 kamil Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1681,14 +1681,16 @@ set_menu_select(menudesc *m, void *arg)
 int
 binary_available(const char *prog)
 {
-char *p, tmp[MAXPATHLEN], *path = getenv("PATH");
+char *p, tmp[MAXPATHLEN], *path = getenv("PATH"), *opath;
  
 if (path == NULL)
 return access(prog, X_OK) == 0;
 path = strdup(path);
 if (path == NULL)
 return 0;
- 
+
+	opath = path;
+
 while ((p = strsep(, ":")) != NULL) {
 if (strlcpy(tmp, p, MAXPATHLEN) >= MAXPATHLEN)
 continue;
@@ -1697,11 +1699,11 @@ binary_available(const char *prog)
 if (strlcat(tmp, prog, MAXPATHLEN) >= MAXPATHLEN)
 continue;
 if (access(tmp, X_OK) == 0) {
-free(path);
+free(opath);
 return 1;
 }
 }
-free(path);
+free(opath);
 return 0;
 }
 



CVS commit: src/share/misc

2018-06-21 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 21 23:05:44 UTC 2018

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Amend MIPS, there are multiple stages in a pipeline.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/share/misc/acronyms.comp

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



CVS commit: src/usr.sbin/sysinst

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 23:05:28 UTC 2018

Modified Files:
src/usr.sbin/sysinst: util.c

Log Message:
Fix invalid free(3) in sysinst(8)

The path variable is assigned with an allocation on the heap with
strdup(3). Later this pointer is changed with strsep(3) and this caused
invalid free(3).

Store the original pointer in a new helper variable opath and pass it to
free(3). With this change, the problem is going away.

Detected with MKSANITIZER=yes with AddressSanitizer.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/util.c

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



CVS commit: src/share/misc

2018-06-21 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Jun 21 22:56:42 UTC 2018

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Add AFP, AMD, ASA, BSDP, DEC, IPL, MDMX, MIPS, PIX, PRU (found on the BeagleBone
Black), XHR.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.201 src/share/misc/acronyms.comp:1.202
--- src/share/misc/acronyms.comp:1.201	Wed Jun 20 21:53:15 2018
+++ src/share/misc/acronyms.comp	Thu Jun 21 22:56:42 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.201 2018/06/20 21:53:15 sevan Exp $
+$NetBSD: acronyms.comp,v 1.202 2018/06/21 22:56:42 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -29,6 +29,7 @@ ADSL	asymmetric digital subscriber line
 ADT	abstract data type
 AER	advanced error reporting
 AES	Advanced Encryption Standard
+AFP	Apple Filing Protocol
 AFS	Andrew File System
 AGC	automatic gain control
 AGP	accelerated graphics port
@@ -43,6 +44,7 @@ ALUA	asymmetric logical unit access
 AM	access method
 AM	alignment mask
 AM	amplitude modulation
+AMD	Advanced Micro Devices Inc
 AMI	alternate mark inversion
 AMP	asymmetric multiprocessing
 AMQP	advanced message queuing protocol
@@ -74,6 +76,7 @@ ARQ	automatic repeat request
 ARR	address range register
 ARU	audio response unit
 AS	autonomous system
+ASA	Adaptive Security Appliance
 ASC	advanced smart cache
 ASCII	American Standard Code for Information Interchange
 ASD	agile software development
@@ -153,6 +156,7 @@ BS	backspace
 BS	binary sequence
 BSA	basic service area
 BSD	Berkeley Software Distribution
+BSDP	Boot Service Discovery Protocol
 BSF	bit scan forward
 BSOD	blue screen of death
 BSP	binary space partition
@@ -322,6 +326,7 @@ DDWG	Digital Display Working Group
 DE	debugging extensions
 DE	desktop environment
 DEA	data encryption algorithm
+DEC	Digital Equipment Corporation
 DEK	data encryption key
 DEP	data execution prevention
 DER	distinguished encoding rules
@@ -643,6 +648,7 @@ IP	intellectual property
 IPC	interprocess communication
 IPE	integrated programming environment
 IPI	interprocessor interrupt
+IPL	Initial Program Load
 IPMB	Intelligent Platform Management Bus
 IPMI	Intelligent Platform Management Interface
 IPNG	Internet Protocol, Next Generation
@@ -786,6 +792,7 @@ MD	machine-dependent
 MD-SAL	model-driven service abstraction layer
 MDA	mail delivery agent
 MDA	Monochrome Display Adapter
+MDMX	MIPS Digital Media eXtension
 MDRAM	multibank dynamic random access memory
 MESI	modified, exclusive, shared, invalid
 MFC	merge from current
@@ -803,6 +810,7 @@ MIMD	multiple instruction, multiple data
 MIME	Multipurpose Internet Mail Extensions
 MIMO	multiple input multiple output
 MIPS	million instructions per second
+MIPS	Microprocessor without Interlocked Pipeline Stage
 MISD	multiple instruction, single data
 MIT	Massachusetts Institute of Technology
 MITM	man in the middle
@@ -1016,6 +1024,7 @@ PIPT	physically indexed, physically tagg
 PIQ	prefetch input queue
 PIT	programmable interrupt timer
 PIV	personal identity verification
+PIX	Private Internet eXchange
 PKCS	public-key cryptography standards
 PKI	public key infrastructure
 PLC	programmable logic controller
@@ -1059,6 +1068,7 @@ PRN	pseudorandom {noise,number}
 PRNG	pseudorandom number generator
 PROM	programmable read only memory
 PRP	pseudorandom permutation
+PRU	Programmable Realtime Unit
 PSD	power spectral density
 PSE	page size extensions
 PSK	phase shift keying
@@ -1502,6 +1512,7 @@ XBAR	crossbar
 XDMCP	X Display Manager control protocol
 XER	XML encoding rules
 XGA	Extended Graphics Array
+XHR	XMLHttpRequest
 XIP	execute in place
 XML	Extensible Markup Language
 XOR	exclusive or



CVS commit: src/share/misc

2018-06-21 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Jun 21 22:56:42 UTC 2018

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Add AFP, AMD, ASA, BSDP, DEC, IPL, MDMX, MIPS, PIX, PRU (found on the BeagleBone
Black), XHR.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/share/misc/acronyms.comp

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



CVS commit: src/sys/dev/ata

2018-06-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Jun 21 21:52:15 UTC 2018

Modified Files:
src/sys/dev/ata: sata_subr.c satavar.h

Log Message:
split the port status reporting to new function sata_interpret_det()
so it can be called separately from sata_reset_interface()

do not treat PHY offline as an error, it's pretty normal when there
is no device actually connected

debugging aid for PR kern/52372


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ata/sata_subr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ata/satavar.h

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

Modified files:

Index: src/sys/dev/ata/sata_subr.c
diff -u src/sys/dev/ata/sata_subr.c:1.23 src/sys/dev/ata/sata_subr.c:1.24
--- src/sys/dev/ata/sata_subr.c:1.23	Sat Oct  7 16:05:32 2017
+++ src/sys/dev/ata/sata_subr.c	Thu Jun 21 21:52:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sata_subr.c,v 1.23 2017/10/07 16:05:32 jdolecek Exp $	*/
+/*	$NetBSD: sata_subr.c,v 1.24 2018/06/21 21:52:15 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * Common functions for Serial ATA.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sata_subr.c,v 1.23 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sata_subr.c,v 1.24 2018/06/21 21:52:15 jdolecek Exp $");
 
 #include 
 #include 
@@ -121,6 +121,14 @@ sata_reset_interface(struct ata_channel 
 		}
 	}
 
+	sata_interpret_det(chp, sstatus);
+
+	return (sstatus & SStatus_DET_mask);
+}
+
+void
+sata_interpret_det(struct ata_channel *chp, uint32_t sstatus)
+{ 
 	switch (sstatus & SStatus_DET_mask) {
 	case SStatus_DET_NODEV:
 		/* No Device; be silent.  */
@@ -133,7 +141,7 @@ sata_reset_interface(struct ata_channel 
 		break;
 
 	case SStatus_DET_OFFLINE:
-		aprint_error("%s port %d: PHY offline\n",
+		aprint_normal("%s port %d: PHY offline\n",
 		device_xname(chp->ch_atac->atac_dev), chp->ch_channel);
 		break;
 
@@ -147,7 +155,6 @@ sata_reset_interface(struct ata_channel 
 		device_xname(chp->ch_atac->atac_dev), chp->ch_channel,
 		sstatus);
 	}
-	return(sstatus & SStatus_DET_mask);
 }
 
 void

Index: src/sys/dev/ata/satavar.h
diff -u src/sys/dev/ata/satavar.h:1.9 src/sys/dev/ata/satavar.h:1.10
--- src/sys/dev/ata/satavar.h:1.9	Wed Apr  3 17:15:07 2013
+++ src/sys/dev/ata/satavar.h	Thu Jun 21 21:52:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: satavar.h,v 1.9 2013/04/03 17:15:07 bouyer Exp $	*/
+/*	$NetBSD: satavar.h,v 1.10 2018/06/21 21:52:15 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@
 const char *sata_speed(uint32_t);
 uint32_t sata_reset_interface(struct ata_channel *, bus_space_tag_t,
 bus_space_handle_t, bus_space_handle_t, int);
+void	sata_interpret_det(struct ata_channel *, uint32_t);
 void	sata_interpret_sig(struct ata_channel *, int, uint32_t);
 
 #endif /* _DEV_ATA_SATAVAR_H_ */



CVS commit: src/sys/dev/ata

2018-06-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Jun 21 21:52:15 UTC 2018

Modified Files:
src/sys/dev/ata: sata_subr.c satavar.h

Log Message:
split the port status reporting to new function sata_interpret_det()
so it can be called separately from sata_reset_interface()

do not treat PHY offline as an error, it's pretty normal when there
is no device actually connected

debugging aid for PR kern/52372


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ata/sata_subr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ata/satavar.h

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



Re: CVS commit: src/sys/arch/i386/include

2018-06-21 Thread Joerg Sonnenberger
On Sun, Jun 17, 2018 at 03:46:39PM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Sun Jun 17 15:46:39 UTC 2018
> 
> Modified Files:
>   src/sys/arch/i386/include: frameasm.h
> 
> Log Message:
> i586 and below don't have this 3-byte nop, so use three 1-byte nops,
> reported by Nathanial Sloss

Can't we use 0x66 0x89 0xc0 for this purpose, i.e. movw %ax, %ax?

Joerg


CVS commit: src/sys/net80211

2018-06-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 21 17:03:45 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_input.c

Log Message:
remove unused arguments


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/net80211/ieee80211_input.c

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



CVS commit: src/sys/net80211

2018-06-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 21 17:03:45 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_input.c

Log Message:
remove unused arguments


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/net80211/ieee80211_input.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/net80211/ieee80211_input.c
diff -u src/sys/net80211/ieee80211_input.c:1.112 src/sys/net80211/ieee80211_input.c:1.113
--- src/sys/net80211/ieee80211_input.c:1.112	Thu Jun 21 16:53:10 2018
+++ src/sys/net80211/ieee80211_input.c	Thu Jun 21 17:03:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_input.c,v 1.112 2018/06/21 16:53:10 maxv Exp $	*/
+/*	$NetBSD: ieee80211_input.c,v 1.113 2018/06/21 17:03:45 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.112 2018/06/21 16:53:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.113 2018/06/21 17:03:45 maxv Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -132,9 +132,9 @@ static void ieee80211_discard_mac(struct
 #define	IEEE80211_DEBUGVAR(a)
 #endif /* IEEE80211_DEBUG */
 
-static struct mbuf *ieee80211_defrag(struct ieee80211com *,
-	struct ieee80211_node *, struct mbuf *, int);
-static struct mbuf *ieee80211_decap(struct ieee80211com *, struct mbuf *, int);
+static struct mbuf *ieee80211_defrag(struct ieee80211_node *,
+struct mbuf *, int);
+static struct mbuf *ieee80211_decap(struct mbuf *, int);
 static void ieee80211_send_error(struct ieee80211com *, struct ieee80211_node *,
 	const u_int8_t *mac, int subtype, int arg);
 static void ieee80211_deliver_data(struct ieee80211com *,
@@ -291,7 +291,7 @@ ieee80211_input_data(struct ieee80211com
 	 * Next up, any fragmentation.
 	 */
 	if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
-		m = ieee80211_defrag(ic, ni, m, hdrspace);
+		m = ieee80211_defrag(ni, m, hdrspace);
 		if (m == NULL) {
 			/* Fragment dropped or frame not complete yet */
 			goto out;
@@ -314,7 +314,7 @@ ieee80211_input_data(struct ieee80211com
 	/*
 	 * Finally, strip the 802.11 header.
 	 */
-	m = ieee80211_decap(ic, m, hdrspace);
+	m = ieee80211_decap(m, hdrspace);
 	if (m == NULL) {
 		/* don't count Null data frames as errors */
 		if (subtype == IEEE80211_FC0_SUBTYPE_NODATA)
@@ -757,8 +757,7 @@ out:
  * This function reassembles fragments.
  */
 static struct mbuf *
-ieee80211_defrag(struct ieee80211com *ic, struct ieee80211_node *ni,
-	struct mbuf *m, int hdrspace)
+ieee80211_defrag(struct ieee80211_node *ni, struct mbuf *m, int hdrspace)
 {
 	struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
 	struct ieee80211_frame *lwh;
@@ -932,7 +931,7 @@ ieee80211_deliver_data(struct ieee80211c
 }
 
 static struct mbuf *
-ieee80211_decap(struct ieee80211com *ic, struct mbuf *m, int hdrlen)
+ieee80211_decap(struct mbuf *m, int hdrlen)
 {
 	struct ieee80211_qosframe_addr4 wh; /* Max size address frames */
 	struct ether_header *eh;



CVS commit: src/sys/net80211

2018-06-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 21 16:53:10 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_input.c

Log Message:
Fix use-after-free, m_cat can free m.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/net80211/ieee80211_input.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/net80211/ieee80211_input.c
diff -u src/sys/net80211/ieee80211_input.c:1.111 src/sys/net80211/ieee80211_input.c:1.112
--- src/sys/net80211/ieee80211_input.c:1.111	Tue May  8 07:02:07 2018
+++ src/sys/net80211/ieee80211_input.c	Thu Jun 21 16:53:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_input.c,v 1.111 2018/05/08 07:02:07 maxv Exp $	*/
+/*	$NetBSD: ieee80211_input.c,v 1.112 2018/06/21 16:53:10 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.111 2018/05/08 07:02:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.112 2018/06/21 16:53:10 maxv Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -762,14 +762,15 @@ ieee80211_defrag(struct ieee80211com *ic
 {
 	struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
 	struct ieee80211_frame *lwh;
-	u_int16_t rxseq;
+	u_int16_t rxseq, iseq;
 	u_int8_t fragno;
 	const u_int8_t more_frag = wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG;
 	struct mbuf *mfrag;
 
 	IASSERT(!IEEE80211_IS_MULTICAST(wh->i_addr1), ("multicast fragm?"));
 
-	rxseq = le16toh(*(u_int16_t *)wh->i_seq);
+	iseq = *(u_int16_t *)wh->i_seq;
+	rxseq = le16toh(iseq);
 	fragno = rxseq & IEEE80211_SEQ_FRAG_MASK;
 
 	/* Quick way out, if there's nothing to defragment */
@@ -827,16 +828,19 @@ ieee80211_defrag(struct ieee80211com *ic
 		}
 		mfrag = m;
 	} else {
+		int mlen;
+
 		/* Strip header and concatenate */
 		m_adj(m, hdrspace);
+		mlen = m->m_pkthdr.len;
 		m_cat(mfrag, m);
 
 		/* NB: m_cat doesn't update the packet header */
-		mfrag->m_pkthdr.len += m->m_pkthdr.len;
+		mfrag->m_pkthdr.len += mlen;
 
 		/* track last seqnum and fragno */
 		lwh = mtod(mfrag, struct ieee80211_frame *);
-		*(u_int16_t *)lwh->i_seq = *(u_int16_t *)wh->i_seq;
+		*(u_int16_t *)lwh->i_seq = iseq;
 	}
 
 	if (more_frag) {



CVS commit: src/sys/net80211

2018-06-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 21 16:53:10 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_input.c

Log Message:
Fix use-after-free, m_cat can free m.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/net80211/ieee80211_input.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/pci

2018-06-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jun 21 16:47:07 UTC 2018

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

Log Message:
destroy 'sc_sync_wait' condvar and mutex upon detach


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ld_virtio.c

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

Modified files:

Index: src/sys/dev/pci/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.22 src/sys/dev/pci/ld_virtio.c:1.23
--- src/sys/dev/pci/ld_virtio.c:1.22	Sun Jun 10 14:59:23 2018
+++ src/sys/dev/pci/ld_virtio.c	Thu Jun 21 16:47:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.22 2018/06/10 14:59:23 jakllsch Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.23 2018/06/21 16:47:06 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.22 2018/06/10 14:59:23 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.23 2018/06/21 16:47:06 jakllsch Exp $");
 
 #include 
 #include 
@@ -629,6 +629,9 @@ ld_virtio_detach(device_t self, int flag
 
 	ldenddetach(ld);
 
+	cv_destroy(>sc_sync_wait);
+	mutex_destroy(>sc_sync_wait_lock);
+
 	virtio_child_detach(sc->sc_virtio);
 
 	return 0;



CVS commit: src/sys/dev/pci

2018-06-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jun 21 16:47:07 UTC 2018

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

Log Message:
destroy 'sc_sync_wait' condvar and mutex upon detach


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ld_virtio.c

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



CVS commit: src/doc

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 12:02:15 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-7.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.1529 -r1.1530 src/doc/3RDPARTY
cvs rdiff -u -r1.2401 -r1.2402 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1529 src/doc/3RDPARTY:1.1530
--- src/doc/3RDPARTY:1.1529	Sun Jun 17 18:10:18 2018
+++ src/doc/3RDPARTY	Thu Jun 21 12:02:15 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1529 2018/06/17 18:10:18 alnsn Exp $
+#	$NetBSD: 3RDPARTY,v 1.1530 2018/06/21 12:02:15 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -334,8 +334,8 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	7.0.5b
-Current Vers:	7.0.5b
+Version:	7.0.6
+Current Vers:	7.0.6
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2401 src/doc/CHANGES:1.2402
--- src/doc/CHANGES:1.2401	Tue Jun 19 19:57:45 2018
+++ src/doc/CHANGES	Thu Jun 21 12:02:15 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2401 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2402 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -166,3 +166,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	arm: Add support for Rockchip RK3328 SoC. [jmcneill 20180615]
 	xen: Enabled XSAVE and AVX support on hardware with proper XSAVE
 		support, PR kern/50332. [jdolecek 20180619]
+	dhcpcd: Import 7.0.6. [roy 20180621]



CVS commit: src/doc

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 12:02:15 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-7.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.1529 -r1.1530 src/doc/3RDPARTY
cvs rdiff -u -r1.2401 -r1.2402 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/external/bsd/dhcpcd/dist/src

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 11:58:23 UTC 2018

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcpcd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/dhcpcd.c

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 11:58:23 UTC 2018

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcpcd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/dhcpcd.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.12 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.13
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.12	Mon Jun  4 09:56:16 2018
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Thu Jun 21 11:58:23 2018
@@ -373,7 +373,7 @@ dhcpcd_drop(struct interface *ifp, int s
 #ifdef IPV4LL
 	ipv4ll_drop(ifp);
 #endif
-#ifdef DHCP
+#ifdef INET
 	dhcp_drop(ifp, stop ? "STOP" : "EXPIRE");
 #endif
 #ifdef ARP



CVS commit: src/sys/arch

2018-06-21 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jun 21 11:57:05 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
* make to work printf() and panic() even before consinit().
* tidy up output for VERBOSE_INIT_ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/fdt/fdt_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.6 src/sys/arch/aarch64/aarch64/locore.S:1.7
--- src/sys/arch/aarch64/aarch64/locore.S:1.6	Thu May 17 08:24:28 2018
+++ src/sys/arch/aarch64/aarch64/locore.S	Thu Jun 21 11:57:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.6 2018/05/17 08:24:28 ryo Exp $	*/
+/*	$NetBSD: locore.S,v 1.7 2018/06/21 11:57:05 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -36,7 +36,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.6 2018/05/17 08:24:28 ryo Exp $")
+RCSID("$NetBSD: locore.S,v 1.7 2018/06/21 11:57:05 ryo Exp $")
 
 /* #define DEBUG_LOCORE */
 /* #define DEBUG_MMU */
@@ -181,11 +181,11 @@ ENTRY_NP(aarch64_start)
 	PRINT("DAIF= ")
 	mrs	x0, daif
 	bl	print_x0
-#endif
 
 	PRINT("VSTART  = ")
 	ldr	x0, =vstart	# virtual address of vstart
 	bl	print_x0
+#endif
 
 	ldr	x0, =vstart	# virtual address of vstart
 	br	x0		# jump to the kernel virtual address

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.22 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.23
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.22	Thu Jun 14 10:53:39 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Thu Jun 21 11:57:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.22 2018/06/14 10:53:39 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.23 2018/06/21 11:57:05 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.22 2018/06/14 10:53:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.23 2018/06/21 11:57:05 ryo Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_machdep.
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -118,43 +119,46 @@ static void fdt_device_register(device_t
 static void fdt_reset(void);
 static void fdt_powerdown(void);
 
-#ifdef VERBOSE_INIT_ARM
+static dev_type_cnputc(earlyconsputc);
+static dev_type_cngetc(earlyconsgetc);
+
+static struct consdev earlycons = {
+	.cn_putc = earlyconsputc,
+	.cn_getc = earlyconsgetc,
+	.cn_pollc = nullcnpollc,
+};
+
 static void
 fdt_putchar(char c)
 {
 	const struct arm_platform *plat = arm_fdt_platform();
-	if (plat && plat->early_putchar)
+	if (plat && plat->early_putchar) {
 		plat->early_putchar(c);
+	}
+#ifdef EARLYCONS
+	else {
+		void uartputc(int);	/* evbarm/fdt/fdt_start.S */
+		uartputc(c);
+	}
+#endif
 }
 
 static void
-fdt_putstr(const char *s)
+earlyconsputc(dev_t dev, int c)
 {
-	for (const char *p = s; *p; p++)
-		fdt_putchar(*p);
+	fdt_putchar(c);
 }
 
-static void
-fdt_printn(unsigned long n, int base)
+static int
+earlyconsgetc(dev_t dev)
 {
-	char *p, buf[(sizeof(unsigned long) * NBBY / 3) + 1 + 2 /* ALT + SIGN */];
-
-	p = buf;
-	do {
-		*p++ = hexdigits[n % base];
-	} while (n /= base);
-
-	do {
-		fdt_putchar(*--p);
-	} while (p > buf);
+	return 0;	/* XXX */
 }
-#define DPRINTF(...)		printf(__VA_ARGS__)
-#define DPRINT(x)		fdt_putstr(x)
-#define DPRINTN(x,b)		fdt_printn((x), (b))
+
+#ifdef VERBOSE_INIT_ARM
+#define DPRINTF(...)	printf(__VA_ARGS__)
 #else
 #define DPRINTF(...)
-#define DPRINT(x)
-#define DPRINTN(x,b)
 #endif
 
 /*
@@ -354,6 +358,9 @@ initarm(void *arg)
 	const struct arm_platform *plat;
 	uint64_t memory_start, memory_end;
 
+	/* set temporally to work printf()/panic() even before consinit() */
+	cn_tab = 
+
 	/* Load FDT */
 	int error = fdt_check_header(fdt_addr_r);
 	if (error == 0) {
@@ -371,27 +378,25 @@ initarm(void *arg)
 		panic("Kernel does not support this device");
 
 	/* Early console may be available, announce ourselves. */
-	DPRINT("FDT<");
-	DPRINTN((uintptr_t)fdt_addr_r, 16);
-	DPRINT(">");
+	DPRINTF("FDT<%p>\n", fdt_addr_r);
 
 	const int chosen = OF_finddevice("/chosen");
 	if (chosen >= 0)
 		OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs));
 	boot_args = bootargs;
 
-	DPRINT(" devmap");
+	DPRINTF("devmap\n");
 	pmap_devmap_register(plat->devmap());
 #ifdef __aarch64__
 	pmap_devmap_bootstrap(plat->devmap());
 #endif
 
 	/* Heads up ... Setup the CPU / MMU / TLB functions. */
-	DPRINT(" cpufunc");
+	DPRINTF("cpufunc\n");
 	if (set_cpufuncs())
 		panic("cpu not recognized!");
 
-	DPRINT(" bootstrap");
+	DPRINTF("bootstrap\n");
 	plat->bootstrap();
 
 	/*
@@ -400,10 +405,9 @@ 

CVS commit: src/sys/arch

2018-06-21 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jun 21 11:57:05 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
* make to work printf() and panic() even before consinit().
* tidy up output for VERBOSE_INIT_ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/fdt/fdt_machdep.c

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



CVS import: src/external/bsd/dhcpcd/dist

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 11:55:20 UTC 2018

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv29160

Log Message:
Import dhcpcd-7.0.6 with the following changes:
  *  fixed compile issues with prior release
  *  fixed carrier loss not being detected for IPv4
  *  UUID based DUID is used where available and no prior DUID exists 

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-7-0-6

U src/external/bsd/dhcpcd/dist/.arcconfig
U src/external/bsd/dhcpcd/dist/.gitignore
U src/external/bsd/dhcpcd/dist/BUILDING.md
U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/Makefile
U src/external/bsd/dhcpcd/dist/Makefile.inc
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/config-null.mk
U src/external/bsd/dhcpcd/dist/configure
U src/external/bsd/dhcpcd/dist/iconfig.mk
U src/external/bsd/dhcpcd/dist/compat/_strtoi.h
U src/external/bsd/dhcpcd/dist/compat/arc4random.c
U src/external/bsd/dhcpcd/dist/compat/arc4random.h
U src/external/bsd/dhcpcd/dist/compat/bitops.h
U src/external/bsd/dhcpcd/dist/compat/queue.h
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.c
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.h
U src/external/bsd/dhcpcd/dist/compat/endian.h
U src/external/bsd/dhcpcd/dist/compat/pidfile.c
U src/external/bsd/dhcpcd/dist/compat/pidfile.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.h
U src/external/bsd/dhcpcd/dist/compat/strlcpy.c
U src/external/bsd/dhcpcd/dist/compat/strlcpy.h
U src/external/bsd/dhcpcd/dist/compat/strtoi.c
U src/external/bsd/dhcpcd/dist/compat/strtoi.h
U src/external/bsd/dhcpcd/dist/compat/strtou.c
U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.c
U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.h
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.c
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.h
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.c
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.h
U src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/GNUmakefile
U src/external/bsd/dhcpcd/dist/src/Makefile
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.c
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/dev.c
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/src/genembedc
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/if-linux-wext.c
U src/external/bsd/dhcpcd/dist/src/genembedh
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
U src/external/bsd/dhcpcd/dist/src/if-linux.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/if-sun.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/dev/Makefile
U src/external/bsd/dhcpcd/dist/src/dev/udev.c
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U 

CVS import: src/external/bsd/dhcpcd/dist

2018-06-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 21 11:55:20 UTC 2018

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv29160

Log Message:
Import dhcpcd-7.0.6 with the following changes:
  *  fixed compile issues with prior release
  *  fixed carrier loss not being detected for IPv4
  *  UUID based DUID is used where available and no prior DUID exists 

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-7-0-6

U src/external/bsd/dhcpcd/dist/.arcconfig
U src/external/bsd/dhcpcd/dist/.gitignore
U src/external/bsd/dhcpcd/dist/BUILDING.md
U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/Makefile
U src/external/bsd/dhcpcd/dist/Makefile.inc
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/config-null.mk
U src/external/bsd/dhcpcd/dist/configure
U src/external/bsd/dhcpcd/dist/iconfig.mk
U src/external/bsd/dhcpcd/dist/compat/_strtoi.h
U src/external/bsd/dhcpcd/dist/compat/arc4random.c
U src/external/bsd/dhcpcd/dist/compat/arc4random.h
U src/external/bsd/dhcpcd/dist/compat/bitops.h
U src/external/bsd/dhcpcd/dist/compat/queue.h
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.c
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.h
U src/external/bsd/dhcpcd/dist/compat/endian.h
U src/external/bsd/dhcpcd/dist/compat/pidfile.c
U src/external/bsd/dhcpcd/dist/compat/pidfile.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.h
U src/external/bsd/dhcpcd/dist/compat/strlcpy.c
U src/external/bsd/dhcpcd/dist/compat/strlcpy.h
U src/external/bsd/dhcpcd/dist/compat/strtoi.c
U src/external/bsd/dhcpcd/dist/compat/strtoi.h
U src/external/bsd/dhcpcd/dist/compat/strtou.c
U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.c
U src/external/bsd/dhcpcd/dist/compat/crypt/hmac.h
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.c
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.h
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.c
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.h
U src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/GNUmakefile
U src/external/bsd/dhcpcd/dist/src/Makefile
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.c
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/dev.c
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/src/genembedc
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/if-linux-wext.c
U src/external/bsd/dhcpcd/dist/src/genembedh
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
U src/external/bsd/dhcpcd/dist/src/if-linux.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/if-sun.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/dev/Makefile
U src/external/bsd/dhcpcd/dist/src/dev/udev.c
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U 

CVS commit: src/distrib/amd64/ramdisks/common

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:48:05 UTC 2018

Modified Files:
src/distrib/amd64/ramdisks/common: Makefile.ramdisk

Log Message:
Specify NOSANITIZER in distrib/amd64/ramdisks/common

This option cannot be set in distrib/common/Makefile.distrib as it's too
late, after including  that will set MKSANITIZER.

This makes generation of ramdisk for amd64 with MKSANITIZER=yes successful.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/amd64/ramdisks/common/Makefile.ramdisk

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

Modified files:

Index: src/distrib/amd64/ramdisks/common/Makefile.ramdisk
diff -u src/distrib/amd64/ramdisks/common/Makefile.ramdisk:1.11 src/distrib/amd64/ramdisks/common/Makefile.ramdisk:1.12
--- src/distrib/amd64/ramdisks/common/Makefile.ramdisk:1.11	Wed Oct  7 14:09:04 2015
+++ src/distrib/amd64/ramdisks/common/Makefile.ramdisk	Thu Jun 21 11:48:05 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile.ramdisk,v 1.11 2015/10/07 14:09:04 martin Exp $
+#	$NetBSD: Makefile.ramdisk,v 1.12 2018/06/21 11:48:05 kamil Exp $
+
+NOSANITIZER=	# defined
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"



CVS commit: src/distrib/amd64/ramdisks/common

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:48:05 UTC 2018

Modified Files:
src/distrib/amd64/ramdisks/common: Makefile.ramdisk

Log Message:
Specify NOSANITIZER in distrib/amd64/ramdisks/common

This option cannot be set in distrib/common/Makefile.distrib as it's too
late, after including  that will set MKSANITIZER.

This makes generation of ramdisk for amd64 with MKSANITIZER=yes successful.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/amd64/ramdisks/common/Makefile.ramdisk

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



CVS commit: src/share/mk

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:24:38 UTC 2018

Modified Files:
src/share/mk: bsd.lib.mk bsd.prog.mk bsd.sys.mk

Log Message:
Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.313 -r1.314 src/share/mk/bsd.prog.mk
cvs rdiff -u -r1.282 -r1.283 src/share/mk/bsd.sys.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.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.374 src/share/mk/bsd.lib.mk:1.375
--- src/share/mk/bsd.lib.mk:1.374	Tue Jun  5 15:37:52 2018
+++ src/share/mk/bsd.lib.mk	Thu Jun 21 11:24:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.374 2018/06/05 15:37:52 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.375 2018/06/21 11:24:38 kamil Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -149,7 +149,7 @@ SHLIB_FULLVERSION=${SHLIB_MAJOR}
 PICFLAGS ?= -fPIC
 
 .if ${MKPICLIB} != "no"
-CSHLIBFLAGS+= ${PICFLAGS}
+CSHLIBFLAGS+= ${PICFLAGS} ${SANITIZERFLAGS}
 .endif
 
 .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
@@ -171,6 +171,7 @@ CFLAGS+=	-g
 # Platform-independent linker flags for ELF shared libraries
 SHLIB_SOVERSION=	${SHLIB_MAJOR}
 SHLIB_SHFLAGS=		-Wl,-soname,${_LIB}.so.${SHLIB_SOVERSION}
+SHLIB_SHFLAGS+=		${SANITIZERFLAGS}
 .if !defined(SHLIB_WARNTEXTREL) || ${SHLIB_WARNTEXTREL} != "no"
 SHLIB_SHFLAGS+=		-Wl,--warn-shared-textrel
 .endif

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.313 src/share/mk/bsd.prog.mk:1.314
--- src/share/mk/bsd.prog.mk:1.313	Sat Jun  2 15:19:45 2018
+++ src/share/mk/bsd.prog.mk	Thu Jun 21 11:24:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.313 2018/06/02 15:19:45 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.314 2018/06/21 11:24:38 kamil Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -7,6 +7,12 @@
 .include 
 .include 
 
+# Sanitizer specific flags.
+
+CFLAGS+=	${SANITIZERFLAGS}
+CXXFLAGS+=	${SANITIZERFLAGS}
+LDFLAGS+=	${SANITIZERFLAGS}
+
 #
 # Definitions and targets shared among all programs built by a single
 # Makefile.

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.282 src/share/mk/bsd.sys.mk:1.283
--- src/share/mk/bsd.sys.mk:1.282	Sun Jun 17 23:37:22 2018
+++ src/share/mk/bsd.sys.mk	Thu Jun 21 11:24:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.282 2018/06/17 23:37:22 christos Exp $
+#	$NetBSD: bsd.sys.mk,v 1.283 2018/06/21 11:24:38 kamil Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -141,9 +141,9 @@ LDFLAGS+=	-Wl,-z,now
 .endif
 
 .if ${MKSANITIZER:Uno} == "yes"
-CFLAGS+=	-fsanitize=${USE_SANITIZER}
-CXXFLAGS+=	-fsanitize=${USE_SANITIZER}
-LDFLAGS+=	-fsanitize=${USE_SANITIZER}
+SANITIZERFLAGS+=	-fsanitize=${USE_SANITIZER}
+.else
+SANITIZERFLAGS+=	# empty
 .endif
 
 



CVS commit: src/share/mk

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:24:38 UTC 2018

Modified Files:
src/share/mk: bsd.lib.mk bsd.prog.mk bsd.sys.mk

Log Message:
Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.313 -r1.314 src/share/mk/bsd.prog.mk
cvs rdiff -u -r1.282 -r1.283 src/share/mk/bsd.sys.mk

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



Re: CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Kamil Rytarowski
On 21.06.2018 13:09, Paul Goyette wrote:
> On Thu, 21 Jun 2018, Kamil Rytarowski wrote:
> 
>> Module Name:    src
>> Committed By:    kamil
>> Date:    Thu Jun 21 11:02:48 UTC 2018
>>
>> Modified Files:
>> src/external/mpl/dhcp: Makefile.inc
>>
>> Log Message:
>> Make building of dhcp compatible with MKSANITIZER
>>
>> Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled
>> MKSANITIZER.
>> These options are incompatible with the current design of sanitizers,
>> because they cause duplication of symbols into programs and thus symbols
>> from the interceptors from sanitizers cannot be linked.
>>
>> This change makes effectively mounting /usr required for dhcp programs
>> like
>> dhclient(8).
> 
> This could be difficult if /usr is nfs-mount and requires dhcp and
> friends for setting up the network.
> 
> 

There is no functional change for MKSANITIZER=no users (the default ones).

For MKSANITIZER=yes ones it's a tradeoff.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Paul Goyette

On Thu, 21 Jun 2018, Kamil Rytarowski wrote:


Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:02:48 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Make building of dhcp compatible with MKSANITIZER

Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).


This could be difficult if /usr is nfs-mount and requires dhcp and 
friends for setting up the network.




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:02:48 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Make building of dhcp compatible with MKSANITIZER

Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/dhcp/Makefile.inc

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



CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:02:48 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Make building of dhcp compatible with MKSANITIZER

Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/dhcp/Makefile.inc

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

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.1 src/external/mpl/dhcp/Makefile.inc:1.2
--- src/external/mpl/dhcp/Makefile.inc:1.1	Sat Apr  7 22:31:36 2018
+++ src/external/mpl/dhcp/Makefile.inc	Thu Jun 21 11:02:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2018/04/07 22:31:36 christos Exp $
+# $NetBSD: Makefile.inc,v 1.2 2018/06/21 11:02:48 kamil Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -30,7 +30,7 @@ CPPFLAGS+= -I${BIND}/lib/${dir}/pthreads
 CPPFLAGS+= -DLOCALSTATEDIR='"/var"'
 LDADD+= ${COBJDIR}/libdhcp.a
 LDADD+= ${OMOBJDIR}/libomapi.a
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc
@@ -39,12 +39,12 @@ LDADD+=-lpthread
 LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
 DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
 .endif
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
 LDADD+= -lcrypto -lipsec -lcrypt
 DPADD+= ${LIBCRYPTO} ${LIBIPSEC} ${LIBCRYPT}
-.if defined(PROG) && ${PROG} == "dhclient"
+.if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes"
 LDADD+=-Wl,-Bdynamic
 .endif
 DPADD+= ${COBJDIR}/libdhcp.a



CVS commit: src/usr.bin/crunch/crunchgen

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:55:54 UTC 2018

Modified Files:
src/usr.bin/crunch/crunchgen: crunchgen.1 crunchgen.c

Log Message:
Add new option -s to crunchgen(1) -- enable sanitization

As of today typical sanitizers require dynamic executables, while
crunchgen(1) programs are produced with static properties.

Lack of specified -s will:
 - generate a Makefile file with NOSANITIZER=
 - build programs that are dependencies with NOSANITIZER=

In future there is an option to handle sanitization in statically linked
programs.

An idea with -s LGTM by 


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/crunch/crunchgen/crunchgen.1
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/crunch/crunchgen/crunchgen.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/crunch/crunchgen/crunchgen.1
diff -u src/usr.bin/crunch/crunchgen/crunchgen.1:1.34 src/usr.bin/crunch/crunchgen/crunchgen.1:1.35
--- src/usr.bin/crunch/crunchgen/crunchgen.1:1.34	Mon Oct  9 10:31:50 2017
+++ src/usr.bin/crunch/crunchgen/crunchgen.1	Thu Jun 21 10:55:54 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: crunchgen.1,v 1.34 2017/10/09 10:31:50 wiz Exp $
+.\"	$NetBSD: crunchgen.1,v 1.35 2018/06/21 10:55:54 kamil Exp $
 .\"
 .\" Copyright (c) 1994 University of Maryland
 .\" All Rights Reserved.
@@ -24,7 +24,7 @@
 .\"			   Computer Science Department
 .\"			   University of Maryland at College Park
 .\"
-.Dd May 31, 2017
+.Dd June 21, 2018
 .Dt CRUNCHGEN 1
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@
 .Nd generates build environment for a crunched binary
 .Sh SYNOPSIS
 .Nm
-.Op Fl fOopq
+.Op Fl fOopqs
 .Op Fl c Ar c-file-name
 .Op Fl D Ar src-root
 .Op Fl d Ar build-options
@@ -129,6 +129,8 @@ Produce static pie (position independent
 .It Fl q
 Quiet operation.
 Status messages are suppressed.
+.It Fl s
+Enable sanitization.
 .It Fl v Ar varspec
 Append a variable specification to the on-the fly generated Makefile.
 .El

Index: src/usr.bin/crunch/crunchgen/crunchgen.c
diff -u src/usr.bin/crunch/crunchgen/crunchgen.c:1.86 src/usr.bin/crunch/crunchgen/crunchgen.c:1.87
--- src/usr.bin/crunch/crunchgen/crunchgen.c:1.86	Tue May  8 23:05:17 2018
+++ src/usr.bin/crunch/crunchgen/crunchgen.c	Thu Jun 21 10:55:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: crunchgen.c,v 1.86 2018/05/08 23:05:17 mrg Exp $	*/
+/*	$NetBSD: crunchgen.c,v 1.87 2018/06/21 10:55:54 kamil Exp $	*/
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.86 2018/05/08 23:05:17 mrg Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.87 2018/06/21 10:55:54 kamil Exp $");
 #endif
 
 #include 
@@ -102,7 +102,7 @@ static int goterror = 0;
 
 static const char *pname = "crunchgen";
 
-static int verbose, readcache, useobjs, oneobj, pie;	/* options */
+static int verbose, readcache, useobjs, oneobj, pie, sanitizer;	/* options */
 static int reading_cache;
 static char *machine;
 static char *makeobjdirprefix;
@@ -157,13 +157,14 @@ main(int argc, char **argv)
 if (argc > 0)
 	pname = argv[0];
 
-while ((optc = getopt(argc, argv, "m:c:d:e:fopqD:L:Ov:")) != -1) {
+while ((optc = getopt(argc, argv, "m:c:d:e:fopqsD:L:Ov:")) != -1) {
 	switch(optc) {
 	case 'f':	readcache = 0; break;
 	case 'p':	pie = 1; break;
 	case 'q':	verbose = 0; break;
 	case 'O':	oneobj = 0; break;
 	case 'o':   useobjs = 1, oneobj = 0; break;
+	case 's':   sanitizer = 1; break;
 
 	case 'm':	(void)estrlcpy(outmkname, optarg, sizeof(outmkname)); break;
 	case 'c':	(void)estrlcpy(outcfname, optarg, sizeof(outcfname)); break;
@@ -922,6 +923,8 @@ top_makefile_rules(FILE *outmk)
 
 if (!pie)
 	fprintf(outmk, "NOPIE=\n");
+if (!sanitizer)
+	fprintf(outmk, "NOSANITIZER=\n");
 fprintf(outmk, "NOMAN=\n\n");
 
 fprintf(outmk, "DBG=%s\n", dbg);
@@ -1017,7 +1020,7 @@ prog_makefile_rules(FILE *outmk, prog_t 
 	for (lst = vars; lst != NULL; lst = lst->next)
 	fprintf(outmk, "%s\\n", lst->str);
 	fprintf(outmk, "'\\\n");
-	fprintf(outmk, MAKECMD);
+	fprintf(outmk, MAKECMD "%s ", sanitizer ? "" : "NOSANITIZER=");
 	if (p->objs)
 	fprintf(outmk, "${%s_OBJS} ) \n\n", p->ident);
 	else



CVS commit: src/usr.bin/crunch/crunchgen

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:55:54 UTC 2018

Modified Files:
src/usr.bin/crunch/crunchgen: crunchgen.1 crunchgen.c

Log Message:
Add new option -s to crunchgen(1) -- enable sanitization

As of today typical sanitizers require dynamic executables, while
crunchgen(1) programs are produced with static properties.

Lack of specified -s will:
 - generate a Makefile file with NOSANITIZER=
 - build programs that are dependencies with NOSANITIZER=

In future there is an option to handle sanitization in statically linked
programs.

An idea with -s LGTM by 


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/crunch/crunchgen/crunchgen.1
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/crunch/crunchgen/crunchgen.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/dts

2018-06-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 21 10:46:39 UTC 2018

Added Files:
src/sys/arch/arm/dts: rk3328-rock64.dts rk3328.dtsi

Log Message:
Enable DWC3 USB DRD (host mode) on Rock64.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/rk3328-rock64.dts \
src/sys/arch/arm/dts/rk3328.dtsi

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

Added files:

Index: src/sys/arch/arm/dts/rk3328-rock64.dts
diff -u /dev/null src/sys/arch/arm/dts/rk3328-rock64.dts:1.1
--- /dev/null	Thu Jun 21 10:46:39 2018
+++ src/sys/arch/arm/dts/rk3328-rock64.dts	Thu Jun 21 10:46:39 2018
@@ -0,0 +1,38 @@
+/* $NetBSD: rk3328-rock64.dts,v 1.1 2018/06/21 10:46:39 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts"
+#include "rk3328.dtsi"
+
+ {
+	status = "okay";
+	snps,phyif-utmi-bits = <16>;
+	snps,dis-enblslpm-quirk;
+	snps,dis-u2-freeclk-exists-quirk;
+	snps,dis-u2-susphy-quirk;
+};
Index: src/sys/arch/arm/dts/rk3328.dtsi
diff -u /dev/null src/sys/arch/arm/dts/rk3328.dtsi:1.1
--- /dev/null	Thu Jun 21 10:46:39 2018
+++ src/sys/arch/arm/dts/rk3328.dtsi	Thu Jun 21 10:46:39 2018
@@ -0,0 +1,45 @@
+/* $NetBSD: rk3328.dtsi,v 1.1 2018/06/21 10:46:39 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/ {
+	usbdrd3: usb@ff60 {
+		compatible = "rockchip,rk3328-dwc3";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		status = "disabled";
+
+		usbdrd_dwc3: dwc3@ff60 {
+			compatible = "snps,dwc3";
+			reg = <0x0 0xff60 0x0 0x10>;
+			interrupts = ;
+			dr_mode = "host";
+		};
+	};
+};



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

2018-06-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 21 10:46:39 UTC 2018

Added Files:
src/sys/arch/arm/dts: rk3328-rock64.dts rk3328.dtsi

Log Message:
Enable DWC3 USB DRD (host mode) on Rock64.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/rk3328-rock64.dts \
src/sys/arch/arm/dts/rk3328.dtsi

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



CVS commit: src/sys/dev/fdt

2018-06-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 21 10:45:25 UTC 2018

Modified Files:
src/sys/dev/fdt: dwc3_fdt.c

Log Message:
Add support for RK3328


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/dwc3_fdt.c

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

Modified files:

Index: src/sys/dev/fdt/dwc3_fdt.c
diff -u src/sys/dev/fdt/dwc3_fdt.c:1.1 src/sys/dev/fdt/dwc3_fdt.c:1.2
--- src/sys/dev/fdt/dwc3_fdt.c:1.1	Tue May  1 23:59:15 2018
+++ src/sys/dev/fdt/dwc3_fdt.c	Thu Jun 21 10:45:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc3_fdt.c,v 1.1 2018/05/01 23:59:15 jmcneill Exp $ */
+/* $NetBSD: dwc3_fdt.c,v 1.2 2018/06/21 10:45:25 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.1 2018/05/01 23:59:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.2 2018/06/21 10:45:25 jmcneill Exp $");
 
 #include 
 #include 
@@ -54,10 +54,23 @@ __KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v
 
 #define	DWC3_GUSB2PHYCFG(n)		(0xc200 + ((n) * 4))
 #define	 GUSB2PHYCFG_PHYSOFTRST		__BIT(31)
+#define	 GUSB2PHYCFG_U2_FREECLK_EXISTS	__BIT(30)
+#define	 GUSB2PHYCFG_USBTRDTIM		__BITS(13,10)
+#define	 GUSB2PHYCFG_SUSPHY		__BIT(6)
+#define	 GUSB2PHYCFG_PHYIF		__BIT(3)
+#define	 GUSB2PHYCFG_ENBLSLPM		__BIT(0)
 
 #define	DWC3_GUSB3PIPECTL(n)		(0xc2c0 + ((n) * 4))
 #define	 GUSB3PIPECTL_PHYSOFTRST	__BIT(31)
 
+#define	DWC3_DCFG			0xc700
+#define	 DCFG_SPEED			__BITS(2,0)
+#define	  DCFG_SPEED_HS			0
+#define	  DCFG_SPEED_FS			1
+#define	  DCFG_SPEED_LS			2
+#define	  DCFG_SPEED_SS			4
+#define	  DCFG_SPEED_SS_PLUS		5
+
 static int	dwc3_fdt_match(device_t, cfdata_t, void *);
 static void	dwc3_fdt_attach(device_t, device_t, void *);
 
@@ -101,6 +114,52 @@ dwc3_fdt_soft_reset(struct xhci_softc *s
 }
 
 static void
+dwc3_fdt_enable_phy(struct xhci_softc *sc, const int phandle)
+{
+	const char *max_speed;
+	u_int phyif_utmi_bits;
+	uint32_t val;
+
+	val = RD4(sc, DWC3_GUSB2PHYCFG(0));
+	if (of_getprop_uint32(phandle, "snps,phyif-utmi-bits", _utmi_bits) == 0) {
+		if (phyif_utmi_bits == 16) {
+			val |= GUSB2PHYCFG_PHYIF;
+			val &= ~GUSB2PHYCFG_USBTRDTIM;
+			val |= __SHIFTIN(5, GUSB2PHYCFG_USBTRDTIM);
+		} else if (phyif_utmi_bits == 8) {
+			val &= ~GUSB2PHYCFG_PHYIF;
+			val &= ~GUSB2PHYCFG_USBTRDTIM;
+			val |= __SHIFTIN(9, GUSB2PHYCFG_USBTRDTIM);
+		}
+	}
+	if (of_hasprop(phandle, "snps,dis-enblslpm-quirk"))
+		val &= ~GUSB2PHYCFG_ENBLSLPM;
+	if (of_hasprop(phandle, "snps,dis-u2-freeclk-exists-quirk"))
+		val &= ~GUSB2PHYCFG_U2_FREECLK_EXISTS;
+	if (of_hasprop(phandle, "snps,dis-u2-susphy-quirk"))
+		val &= ~GUSB2PHYCFG_SUSPHY;
+	WR4(sc, DWC3_GUSB2PHYCFG(0), val);
+
+	max_speed = fdtbus_get_string(phandle, "maximum-speed");
+	if (max_speed == NULL)
+		max_speed = "super-speed";
+
+	val = RD4(sc, DWC3_DCFG);
+	val &= ~DCFG_SPEED;
+	if (strcmp(max_speed, "low-speed") == 0)
+		val |= __SHIFTIN(DCFG_SPEED_LS, DCFG_SPEED);
+	else if (strcmp(max_speed, "full-speed") == 0)
+		val |= __SHIFTIN(DCFG_SPEED_FS, DCFG_SPEED);
+	else if (strcmp(max_speed, "high-speed") == 0)
+		val |= __SHIFTIN(DCFG_SPEED_HS, DCFG_SPEED);
+	else if (strcmp(max_speed, "super-speed") == 0)
+		val |= __SHIFTIN(DCFG_SPEED_SS, DCFG_SPEED);
+	else
+		val |= __SHIFTIN(DCFG_SPEED_SS, DCFG_SPEED);	/* default to super speed */
+	WR4(sc, DWC3_DCFG, val);
+}
+
+static void
 dwc3_fdt_set_mode(struct xhci_softc *sc, u_int mode)
 {
 	uint32_t val;
@@ -116,6 +175,7 @@ dwc3_fdt_match(device_t parent, cfdata_t
 {
 	const char * const compatible[] = {
 		"allwinner,sun50i-h6-dwc3",
+		"rockchip,rk3328-dwc3",
 		NULL
 	};
 	struct fdt_attach_args * const faa = aux;
@@ -166,13 +226,6 @@ dwc3_fdt_attach(device_t parent, device_
 			return;
 		}
 
-	/* Enable phy */
-	phy = fdtbus_phy_get(dwc3_phandle, "usb3-phy");
-	if (!phy || fdtbus_phy_enable(phy, true) != 0) {
-		aprint_error(": couldn't enable phy\n");
-		return;
-	}
-
 	/* Get resources */
 	if (fdtbus_get_reg(dwc3_phandle, 0, , ) != 0) {
 		aprint_error(": couldn't get registers\n");
@@ -191,7 +244,14 @@ dwc3_fdt_attach(device_t parent, device_
 	aprint_naive("\n");
 	aprint_normal(": DesignWare USB3 XHCI\n");
 
+	/* Enable phy */
+	phy = fdtbus_phy_get(dwc3_phandle, "usb3-phy");
+	if (!phy || fdtbus_phy_enable(phy, true) != 0) {
+		aprint_error_dev(self, "couldn't enable usb3-phy\n");
+	}
+
 	dwc3_fdt_soft_reset(sc);
+	dwc3_fdt_enable_phy(sc, phandle);
 	dwc3_fdt_set_mode(sc, GCTL_PRTCAP_HOST);
 
 	if (!fdtbus_intr_str(dwc3_phandle, 0, intrstr, sizeof(intrstr))) {



CVS commit: src/sys/dev/fdt

2018-06-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 21 10:45:25 UTC 2018

Modified Files:
src/sys/dev/fdt: dwc3_fdt.c

Log Message:
Add support for RK3328


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/dwc3_fdt.c

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



CVS commit: src/rescue

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:44:01 UTC 2018

Modified Files:
src/rescue: Makefile

Log Message:
Set NOSANITIZER in rescue/Makefile

This is required to stop sanitizing rcmd.o and liboverride.o. These object
files will be linked into statically linked rescue.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/rescue/Makefile

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



CVS commit: src/rescue

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:44:01 UTC 2018

Modified Files:
src/rescue: Makefile

Log Message:
Set NOSANITIZER in rescue/Makefile

This is required to stop sanitizing rcmd.o and liboverride.o. These object
files will be linked into statically linked rescue.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/rescue/Makefile

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

Modified files:

Index: src/rescue/Makefile
diff -u src/rescue/Makefile:1.33 src/rescue/Makefile:1.34
--- src/rescue/Makefile:1.33	Sun Oct  8 15:02:33 2017
+++ src/rescue/Makefile	Thu Jun 21 10:44:01 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.33 2017/10/08 15:02:33 christos Exp $
+#	$NetBSD: Makefile,v 1.34 2018/06/21 10:44:01 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"



CVS commit: src/usr.bin/ldd

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:41:46 UTC 2018

Modified Files:
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf32: Makefile
src/usr.bin/ldd/elf32_compat: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
Disable SANITIZER for ldd(1)

These utilities (elf32, elf32_compat, elf64, liblldb) share code with the
ELF dynamic loader that is not being sanitized and its symbols are
installed into sanitized programs (in particular __tls_get_addr()).

Additionally libldd is used in rescue that is not expected to be sanitized
as of today.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/elf32_compat/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/elf64/Makefile

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/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.2 src/usr.bin/ldd/build/Makefile:1.3
--- src/usr.bin/ldd/build/Makefile:1.2	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/build/Makefile	Thu Jun 21 10:41:45 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2014/03/02 03:55:19 matt Exp $
+#	$NetBSD: Makefile,v 1.3 2018/06/21 10:41:45 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 		# for MKDYNAMICROOT definition
 

Index: src/usr.bin/ldd/elf32/Makefile
diff -u src/usr.bin/ldd/elf32/Makefile:1.9 src/usr.bin/ldd/elf32/Makefile:1.10
--- src/usr.bin/ldd/elf32/Makefile:1.9	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/elf32/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.9 2014/03/02 03:55:19 matt Exp $
+#	$NetBSD: Makefile,v 1.10 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 .include 

Index: src/usr.bin/ldd/elf32_compat/Makefile
diff -u src/usr.bin/ldd/elf32_compat/Makefile:1.1 src/usr.bin/ldd/elf32_compat/Makefile:1.2
--- src/usr.bin/ldd/elf32_compat/Makefile:1.1	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/elf32_compat/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 08:50:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 .include 

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.8 src/usr.bin/ldd/elf64/Makefile:1.9
--- src/usr.bin/ldd/elf64/Makefile:1.8	Thu Aug 28 12:23:29 2014
+++ src/usr.bin/ldd/elf64/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.8 2014/08/28 12:23:29 joerg Exp $
+#	$NetBSD: Makefile,v 1.9 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 



CVS commit: src/usr.bin/ldd

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:41:46 UTC 2018

Modified Files:
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf32: Makefile
src/usr.bin/ldd/elf32_compat: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
Disable SANITIZER for ldd(1)

These utilities (elf32, elf32_compat, elf64, liblldb) share code with the
ELF dynamic loader that is not being sanitized and its symbols are
installed into sanitized programs (in particular __tls_get_addr()).

Additionally libldd is used in rescue that is not expected to be sanitized
as of today.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/elf32_compat/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/elf64/Makefile

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



CVS commit: src/sys

2018-06-21 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Jun 21 10:37:50 UTC 2018

Modified Files:
src/sys/net: if.h
src/sys/netinet: igmp.c in_l2tp.c ip_encap.c ip_icmp.c ip_mroute.c
src/sys/netinet6: in6_l2tp.c ip6_mroute.c

Log Message:
sbappendaddr() is required any lock. Currently, softnet_lock is appropriate.

When rip_input() is called as inetsw[].pr_input, rip_iput() is always called
with holding softnet_lock, that is, in case of !defined(NET_MPSAFE) it is
acquired in ipintr(), otherwise(defined(NET_MPSAFE)) it is acquire in
PR_WRAP_INPUT macro.
However, some function calls rip_input() directly without holding softnet_lock.
That causes assertion failure in sbappendaddr().
rip6_input() and icmp6_rip6_input() are also required softnet_lock for the same
reason.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/net/if.h
cvs rdiff -u -r1.67 -r1.68 src/sys/netinet/igmp.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.68 -r1.69 src/sys/netinet/ip_encap.c
cvs rdiff -u -r1.171 -r1.172 src/sys/netinet/ip_icmp.c
cvs rdiff -u -r1.159 -r1.160 src/sys/netinet/ip_mroute.c
cvs rdiff -u -r1.15 -r1.16 src/sys/netinet6/in6_l2tp.c
cvs rdiff -u -r1.128 -r1.129 src/sys/netinet6/ip6_mroute.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.h
diff -u src/sys/net/if.h:1.262 src/sys/net/if.h:1.263
--- src/sys/net/if.h:1.262	Tue Jun 12 07:12:35 2018
+++ src/sys/net/if.h	Thu Jun 21 10:37:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.262 2018/06/12 07:12:35 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.263 2018/06/21 10:37:49 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -535,6 +535,11 @@ if_is_link_state_changeable(struct ifnet
 #define SOFTNET_LOCK_UNLESS_NET_MPSAFE()	do { } while (0)
 #define SOFTNET_UNLOCK_UNLESS_NET_MPSAFE()	do { } while (0)
 
+#define SOFTNET_LOCK_IF_NET_MPSAFE()	\
+	do { mutex_enter(softnet_lock); } while (0)
+#define SOFTNET_UNLOCK_IF_NET_MPSAFE()	\
+	do { mutex_exit(softnet_lock); } while (0)
+
 #else /* NET_MPSAFE */
 
 #define KERNEL_LOCK_UNLESS_NET_MPSAFE()	\
@@ -547,6 +552,9 @@ if_is_link_state_changeable(struct ifnet
 #define SOFTNET_UNLOCK_UNLESS_NET_MPSAFE()\
 	do { mutex_exit(softnet_lock); } while (0)
 
+#define SOFTNET_LOCK_IF_NET_MPSAFE()		do { } while (0)
+#define SOFTNET_UNLOCK_IF_NET_MPSAFE()		do { } while (0)
+
 #endif /* NET_MPSAFE */
 
 #define SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE()\

Index: src/sys/netinet/igmp.c
diff -u src/sys/netinet/igmp.c:1.67 src/sys/netinet/igmp.c:1.68
--- src/sys/netinet/igmp.c:1.67	Tue Apr 10 08:22:35 2018
+++ src/sys/netinet/igmp.c	Thu Jun 21 10:37:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $	*/
+/*	$NetBSD: igmp.c,v 1.68 2018/06/21 10:37:50 knakahara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.68 2018/06/21 10:37:50 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -474,6 +474,11 @@ igmp_input(struct mbuf *m, ...)
 	 * Pass all valid IGMP packets up to any process(es) listening
 	 * on a raw IGMP socket.
 	 */
+	/*
+	 * Currently, igmp_input() is always called holding softnet_lock
+	 * by ipintr()(!NET_MPSAFE) or PR_INPUT_WRAP()(NET_MPSAFE).
+	 */
+	KASSERT(mutex_owned(softnet_lock));
 	rip_input(m, iphlen, proto);
 	return;
 

Index: src/sys/netinet/in_l2tp.c
diff -u src/sys/netinet/in_l2tp.c:1.14 src/sys/netinet/in_l2tp.c:1.15
--- src/sys/netinet/in_l2tp.c:1.14	Tue May  1 07:21:39 2018
+++ src/sys/netinet/in_l2tp.c	Thu Jun 21 10:37:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_l2tp.c,v 1.14 2018/05/01 07:21:39 maxv Exp $	*/
+/*	$NetBSD: in_l2tp.c,v 1.15 2018/06/21 10:37:50 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.14 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.15 2018/06/21 10:37:50 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 
 #include 
 #include 
 #include 
+#include  /* For softnet_lock */
 
 #include 
 #include 
@@ -275,7 +276,9 @@ in_l2tp_input(struct mbuf *m, int off, i
 		 * L2TPv3 control packet received.
 		 * userland daemon(l2tpd?) should process.
 		 */
+		SOFTNET_LOCK_IF_NET_MPSAFE();
 		rip_input(m, off, proto);
+		SOFTNET_UNLOCK_IF_NET_MPSAFE();
 		return;
 	}
 

Index: src/sys/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.68 src/sys/netinet/ip_encap.c:1.69
--- src/sys/netinet/ip_encap.c:1.68	Tue May  1 07:21:39 2018
+++ src/sys/netinet/ip_encap.c	Thu Jun 21 10:37:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.c,v 1.68 2018/05/01 07:21:39 

CVS commit: src/sys

2018-06-21 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Jun 21 10:37:50 UTC 2018

Modified Files:
src/sys/net: if.h
src/sys/netinet: igmp.c in_l2tp.c ip_encap.c ip_icmp.c ip_mroute.c
src/sys/netinet6: in6_l2tp.c ip6_mroute.c

Log Message:
sbappendaddr() is required any lock. Currently, softnet_lock is appropriate.

When rip_input() is called as inetsw[].pr_input, rip_iput() is always called
with holding softnet_lock, that is, in case of !defined(NET_MPSAFE) it is
acquired in ipintr(), otherwise(defined(NET_MPSAFE)) it is acquire in
PR_WRAP_INPUT macro.
However, some function calls rip_input() directly without holding softnet_lock.
That causes assertion failure in sbappendaddr().
rip6_input() and icmp6_rip6_input() are also required softnet_lock for the same
reason.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/net/if.h
cvs rdiff -u -r1.67 -r1.68 src/sys/netinet/igmp.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.68 -r1.69 src/sys/netinet/ip_encap.c
cvs rdiff -u -r1.171 -r1.172 src/sys/netinet/ip_icmp.c
cvs rdiff -u -r1.159 -r1.160 src/sys/netinet/ip_mroute.c
cvs rdiff -u -r1.15 -r1.16 src/sys/netinet6/in6_l2tp.c
cvs rdiff -u -r1.128 -r1.129 src/sys/netinet6/ip6_mroute.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/pci

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 21 09:09:50 UTC 2018

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

Log Message:
 Simplify & white space fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/if_msk.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/pci

2018-06-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 21 09:09:50 UTC 2018

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

Log Message:
 Simplify & white space fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/if_msk.c

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

Modified files:

Index: src/sys/dev/pci/if_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.65 src/sys/dev/pci/if_msk.c:1.66
--- src/sys/dev/pci/if_msk.c:1.65	Thu Jun 14 09:29:55 2018
+++ src/sys/dev/pci/if_msk.c	Thu Jun 21 09:09:50 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.65 2018/06/14 09:29:55 msaitoh Exp $ */
+/* $NetBSD: if_msk.c,v 1.66 2018/06/21 09:09:50 msaitoh Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.65 2018/06/14 09:29:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.66 2018/06/21 09:09:50 msaitoh Exp $");
 
 #include 
 #include 
@@ -443,8 +443,7 @@ msk_init_tx_ring(struct sk_if_softc *sc_
 	struct sk_txmap_entry	*entry;
 	int			i, nexti;
 
-	memset(sc_if->sk_rdata->sk_tx_ring, 0,
-	sizeof(struct msk_tx_desc) * MSK_TX_RING_CNT);
+	memset(rd->sk_tx_ring, 0, sizeof(struct msk_tx_desc) * MSK_TX_RING_CNT);
 
 	SIMPLEQ_INIT(_if->sk_txmap_head);
 	for (i = 0; i < MSK_TX_RING_CNT; i++) {
@@ -2304,7 +2303,7 @@ msk_init(struct ifnet *ifp)
 	s = splnet();
 
 	/* Cancel pending I/O and free all RX/TX buffers. */
-	msk_stop(ifp,0);
+	msk_stop(ifp, 0);
 
 	/* Configure I2C registers */
 
@@ -2353,7 +2352,7 @@ msk_init(struct ifnet *ifp)
 	if (msk_init_rx_ring(sc_if) == ENOBUFS) {
 		aprint_error_dev(sc_if->sk_dev, "initialization failed: no "
 		"memory for rx buffers\n");
-		msk_stop(ifp,0);
+		msk_stop(ifp, 0);
 		splx(s);
 		return ENOBUFS;
 	}
@@ -2361,7 +2360,7 @@ msk_init(struct ifnet *ifp)
 	if (msk_init_tx_ring(sc_if) == ENOBUFS) {
 		aprint_error_dev(sc_if->sk_dev, "initialization failed: no "
 		"memory for tx buffers\n");
-		msk_stop(ifp,0);
+		msk_stop(ifp, 0);
 		splx(s);
 		return ENOBUFS;
 	}