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

2017-02-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb 10 06:35:22 UTC 2017

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

Log Message:
- Both mbuf_defrag_failed and m_defrag_failed existed. Remove m_defrag_failed.
- rx_irq, dropped_pkts, morerx, moretx and txloops counters are uncounted, so
  remove them.
- Count handleq in ixv_handle_que().
- Detach event counters correctly.
- Set some per-queue event names correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.18 src/sys/dev/pci/ixgbe/ix_txrx.c:1.19
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.18	Wed Feb  1 10:47:13 2017
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Feb 10 06:35:22 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.18 2017/02/01 10:47:13 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.19 2017/02/10 06:35:22 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -171,7 +171,7 @@ ixgbe_start_locked(struct tx_ring *txr, 
 if (rc != 0)
 	adapter->efbig2_tx_dma_setup.ev_count++;
 			} else
-adapter->m_defrag_failed.ev_count++;
+adapter->mbuf_defrag_failed.ev_count++;
 		}
 		if (rc != 0) {
 			m_freem(m_head);

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.71 src/sys/dev/pci/ixgbe/ixgbe.c:1.72
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.71	Wed Feb  8 09:00:37 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Feb 10 06:35:22 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.71 2017/02/08 09:00:37 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.72 2017/02/10 06:35:22 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -710,10 +710,10 @@ static int
 ixgbe_detach(device_t dev, int flags)
 {
 	struct adapter *adapter = device_private(dev);
-	struct rx_ring *rxr = adapter->rx_rings;
-	struct ixgbe_hw_stats *stats = >stats.pf;
 	struct ix_queue *que = adapter->queues;
+	struct rx_ring *rxr = adapter->rx_rings;
 	struct tx_ring *txr = adapter->tx_rings;
+	struct ixgbe_hw_stats *stats = >stats.pf;
 	u32	ctrl_ext;
 
 	INIT_DEBUGOUT("ixgbe_detach: begin");
@@ -784,11 +784,8 @@ ixgbe_detach(device_t dev, int flags)
 	sysctl_teardown(>sysctllog);
 	evcnt_detach(>handleq);
 	evcnt_detach(>req);
-	evcnt_detach(>morerx);
-	evcnt_detach(>moretx);
-	evcnt_detach(>txloops);
 	evcnt_detach(>efbig_tx_dma_setup);
-	evcnt_detach(>m_defrag_failed);
+	evcnt_detach(>mbuf_defrag_failed);
 	evcnt_detach(>efbig2_tx_dma_setup);
 	evcnt_detach(>einval_tx_dma_setup);
 	evcnt_detach(>other_tx_dma_setup);
@@ -800,26 +797,30 @@ ixgbe_detach(device_t dev, int flags)
 
 	txr = adapter->tx_rings;
 	for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
+		evcnt_detach(>queues[i].irqs);
 		evcnt_detach(>no_desc_avail);
 		evcnt_detach(>total_packets);
 		evcnt_detach(>tso_tx);
+#ifndef IXGBE_LEGACY_TX
+		evcnt_detach(>pcq_drops);
+#endif
 
-		if (i < __arraycount(adapter->stats.pf.mpc)) {
-			evcnt_detach(>stats.pf.mpc[i]);
+		if (i < __arraycount(stats->mpc)) {
+			evcnt_detach(>mpc[i]);
+		}
+		if (i < __arraycount(stats->pxontxc)) {
+			evcnt_detach(>pxontxc[i]);
+			evcnt_detach(>pxonrxc[i]);
+			evcnt_detach(>pxofftxc[i]);
+			evcnt_detach(>pxoffrxc[i]);
+			evcnt_detach(>pxon2offc[i]);
 		}
-		if (i < __arraycount(adapter->stats.pf.pxontxc)) {
-			evcnt_detach(>stats.pf.pxontxc[i]);
-			evcnt_detach(>stats.pf.pxonrxc[i]);
-			evcnt_detach(>stats.pf.pxofftxc[i]);
-			evcnt_detach(>stats.pf.pxoffrxc[i]);
-			evcnt_detach(>stats.pf.pxon2offc[i]);
-		}
-		if (i < __arraycount(adapter->stats.pf.qprc)) {
-			evcnt_detach(>stats.pf.qprc[i]);
-			evcnt_detach(>stats.pf.qptc[i]);
-			evcnt_detach(>stats.pf.qbrc[i]);
-			evcnt_detach(>stats.pf.qbtc[i]);
-			evcnt_detach(>stats.pf.qprdc[i]);
+		if (i < __arraycount(stats->qprc)) {
+			evcnt_detach(>qprc[i]);
+			evcnt_detach(>qptc[i]);
+			evcnt_detach(>qbrc[i]);
+			evcnt_detach(>qbtc[i]);
+			evcnt_detach(>qprdc[i]);
 		}
 
 		evcnt_detach(>rx_packets);
@@ -827,7 +828,6 @@ ixgbe_detach(device_t dev, int flags)
 		evcnt_detach(>rx_copies);
 		evcnt_detach(>no_jmbuf);
 		evcnt_detach(>rx_discarded);
-		evcnt_detach(>rx_irq);
 	}
 	evcnt_detach(>ipcs);
 	evcnt_detach(>l4cs);
@@ -4660,13 +4660,11 @@ ixgbe_add_hw_stats(struct adapter *adapt
 	struct tx_ring *txr = adapter->tx_rings;
 	struct rx_ring *rxr = adapter->rx_rings;
 	struct 

CVS commit: src/lib/libcurses

2017-02-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Feb 10 06:25:28 UTC 2017

Modified Files:
src/lib/libcurses: scroll.c

Log Message:
Remove checks for cursor being in scrolling region, ncurses doesn't
do checking, rather just scrolls the scrolling region so we shall
follow suit.  SUSv2 says what is happens when scrl is called with the
cursor outside the scrolling is undefined so we should match ncurses.
This fixes PR#51819 without forcing tin to use terminfo directly.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/scroll.c

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

Modified files:

Index: src/lib/libcurses/scroll.c
diff -u src/lib/libcurses/scroll.c:1.23 src/lib/libcurses/scroll.c:1.24
--- src/lib/libcurses/scroll.c:1.23	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/scroll.c	Fri Feb 10 06:25:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: scroll.c,v 1.23 2017/01/06 13:53:18 roy Exp $	*/
+/*	$NetBSD: scroll.c,v 1.24 2017/02/10 06:25:28 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)scroll.c	8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: scroll.c,v 1.23 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: scroll.c,v 1.24 2017/02/10 06:25:28 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -100,12 +100,7 @@ wscrl(WINDOW *win, int nlines)
 #ifdef DEBUG
 	__CTRACE(__CTRACE_WINDOW, "wscrl: y=%d\n", oy);
 #endif
-	if (oy < win->scr_t || oy > win->scr_b)
-		/* Outside scrolling region */
-		wmove(win, 0, 0);
-	else
-		/* Inside scrolling region */
-		wmove(win, win->scr_t, 0);
+	wmove(win, win->scr_t, 0);
 	winsdelln(win, 0 - nlines);
 	wmove(win, oy, ox);
 



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

2017-02-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb 10 04:34:11 UTC 2017

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

Log Message:
No functional change:
 - Rename ixv_sysctl_attach() to ixv_add_device_sysctls().
 - Move sysct and evcnt related functions to match ixgbe.c.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.47 src/sys/dev/pci/ixgbe/ixv.c:1.48
--- src/sys/dev/pci/ixgbe/ixv.c:1.47	Wed Feb  8 09:00:37 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Feb 10 04:34:11 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.47 2017/02/08 09:00:37 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.48 2017/02/10 04:34:11 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -117,6 +117,7 @@ static void	ixv_register_vlan(void *, st
 static void	ixv_unregister_vlan(void *, struct ifnet *, u16);
 #endif
 
+static void	ixv_add_device_sysctls(struct adapter *);
 static void	ixv_save_stats(struct adapter *);
 static void	ixv_init_stats(struct adapter *);
 static void	ixv_update_stats(struct adapter *);
@@ -276,37 +277,6 @@ ixv_lookup(const struct pci_attach_args 
 }
 
 
-static void
-ixv_sysctl_attach(struct adapter *adapter)
-{
-	struct sysctllog **log;
-	const struct sysctlnode *rnode, *cnode;
-	device_t dev;
-
-	dev = adapter->dev;
-	log = >sysctllog;
-
-	if ((rnode = ixv_sysctl_instance(adapter)) == NULL) {
-		aprint_error_dev(dev, "could not create sysctl root\n");
-		return;
-	}
-
-	if (sysctl_createv(log, 0, , ,
-	CTLFLAG_READWRITE, CTLTYPE_INT,
-	"debug", SYSCTL_DESCR("Debug Info"),
-	ixv_sysctl_debug, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
-		aprint_error_dev(dev, "could not create sysctl\n");
-
-	/* XXX This is an *instance* sysctl controlling a *global* variable.
-	 * XXX It's that way in the FreeBSD driver that this derives from.
-	 */
-	if (sysctl_createv(log, 0, , ,
-	CTLFLAG_READWRITE, CTLTYPE_INT,
-	"enable_aim", SYSCTL_DESCR("Interrupt Moderation"),
-	NULL, 0, _enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
-		aprint_error_dev(dev, "could not create sysctl\n");
-}
-
 /*
  *  Device initialization routine
  *
@@ -356,9 +326,6 @@ ixv_attach(device_t parent, device_t dev
 	/* Core Lock Init*/
 	IXGBE_CORE_LOCK_INIT(adapter, device_xname(dev));
 
-	/* SYSCTL APIs */
-	ixv_sysctl_attach(adapter);
-
 	/* Set up the timer callout */
 	callout_init(>timer, 0);
 
@@ -464,7 +431,6 @@ ixv_attach(device_t parent, device_t dev
 	/* Do the stats setup */
 	ixv_save_stats(adapter);
 	ixv_init_stats(adapter);
-	ixv_add_stats_sysctls(adapter);
 
 	/* Register for VLAN events */
 #if 0 /* XXX delete after write? */
@@ -474,6 +440,10 @@ ixv_attach(device_t parent, device_t dev
 	ixv_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST);
 #endif
 
+	/* Add sysctls */
+	ixv_add_device_sysctls(adapter);
+	ixv_add_stats_sysctls(adapter);
+
 #ifdef DEV_NETMAP
 	ixgbe_netmap_attach(adapter);
 #endif /* DEV_NETMAP */
@@ -2194,78 +2164,6 @@ ixv_update_stats(struct adapter *adapter
 	adapter->stats.vf.vfmprc);
 }
 
-/*
- * Add statistic sysctls for the VF.
- */
-static void
-ixv_add_stats_sysctls(struct adapter *adapter)
-{
-	device_t dev = adapter->dev;
-	struct ix_queue *que = >queues[0];
-	struct tx_ring *txr = que->txr;
-	struct rx_ring *rxr = que->rxr;
-
-	struct ixgbevf_hw_stats *stats = >stats.vf;
-
-	const char *xname = device_xname(dev);
-
-	/* Driver Statistics */
-	evcnt_attach_dynamic(>dropped_pkts, EVCNT_TYPE_MISC,
-	NULL, xname, "Driver dropped packets");
-	evcnt_attach_dynamic(>mbuf_defrag_failed, EVCNT_TYPE_MISC,
-	NULL, xname, "m_defrag() failed");
-	evcnt_attach_dynamic(>watchdog_events, EVCNT_TYPE_MISC,
-	NULL, xname, "Watchdog timeouts");
-
-	evcnt_attach_dynamic(>vfgprc, EVCNT_TYPE_MISC, NULL,
-	xname, "Good Packets Received");
-	evcnt_attach_dynamic(>vfgorc, EVCNT_TYPE_MISC, NULL,
-	xname, "Good Octets Received");
-	evcnt_attach_dynamic(>vfmprc, EVCNT_TYPE_MISC, NULL,
-	xname, "Multicast Packets Received");
-	evcnt_attach_dynamic(>vfgptc, EVCNT_TYPE_MISC, NULL,
-	xname, "Good Packets Transmitted");
-	evcnt_attach_dynamic(>vfgotc, EVCNT_TYPE_MISC, NULL,
-	xname, "Good Octets Transmitted");
-	evcnt_attach_dynamic(>irqs, EVCNT_TYPE_INTR, NULL,
-	xname, "IRQs on queue");
-	evcnt_attach_dynamic(>rx_irq, EVCNT_TYPE_INTR, NULL,
-	xname, "RX irqs on queue");
-	evcnt_attach_dynamic(>rx_packets, EVCNT_TYPE_MISC, NULL,
-	xname, "RX packets");
-	evcnt_attach_dynamic(>rx_bytes, EVCNT_TYPE_MISC, NULL,
-	xname, "RX bytes");
-	

CVS commit: src/sys/arch/sgimips/sgimips

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 10 04:00:48 UTC 2017

Modified Files:
src/sys/arch/sgimips/sgimips: machdep.c

Log Message:
kill variable stack allocation


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/sgimips/sgimips/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/sgimips/sgimips/machdep.c
diff -u src/sys/arch/sgimips/sgimips/machdep.c:1.143 src/sys/arch/sgimips/sgimips/machdep.c:1.144
--- src/sys/arch/sgimips/sgimips/machdep.c:1.143	Thu Dec 22 09:47:59 2016
+++ src/sys/arch/sgimips/sgimips/machdep.c	Thu Feb  9 23:00:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.143 2016/12/22 14:47:59 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.144 2017/02/10 04:00:48 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.143 2016/12/22 14:47:59 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.144 2017/02/10 04:00:48 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -255,7 +255,10 @@ mach_init(int argc, int32_t argv32[], ui
 	struct btinfo_symtab *bi_syms;
 #endif
 #ifdef _LP64
-	char *argv[argc+1];
+	char *argv[20];
+
+	if (argc >= __arraycount(argv))
+		panic("too many args");
 
 	for (i = 0; i < argc; i++) {
 		argv[i] = (void *)(intptr_t)argv32[i];



CVS commit: src/doc

2017-02-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Feb 10 03:59:02 UTC 2017

Modified Files:
src/doc: TODO.smpnet

Log Message:
Add many entries


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/doc/TODO.smpnet

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

Modified files:

Index: src/doc/TODO.smpnet
diff -u src/doc/TODO.smpnet:1.1 src/doc/TODO.smpnet:1.2
--- src/doc/TODO.smpnet:1.1	Tue Jan 24 09:05:27 2017
+++ src/doc/TODO.smpnet	Fri Feb 10 03:59:02 2017
@@ -1,13 +1,82 @@
-$NetBSD: TODO.smpnet,v 1.1 2017/01/24 09:05:27 ozaki-r Exp $
+$NetBSD: TODO.smpnet,v 1.2 2017/02/10 03:59:02 ozaki-r Exp $
 
-Non MP-safe components
-==
+MP-safe components
+==
 
- - bpf
- - To be listed more...
+ - bridge(4)
+ - bpf(4)
+ - gif(4)
+ - npf(7)
+ - pfil(9)
+ - pppoe(4)
+   - if_spppsubr.c
+ - tun(4)
+ - vioif(4)
+ - vmx(4)
+ - wm(4)
+
+ - Layer 2 (only Ethernet)
+   - if_ethersubr.c
+ - Most Layer 3
+
+Non MP-safe components and kernel options
+=
+
+ - agr(4)
+ - altq(4)
+ - carp(4)
+ - etherip(4)
+ - faith(4)
+ - gre(4)
+ - ieee80211(4)
+ - ipf(4)
+ - ipsec(4)
+ - kttcp(4)
+ - mpls(4)
+ - opencrypto(9)
+ - pf(4)
+ - ppp(4)
+ - sl(4)
+ - stf(4)
+ - strip(4)
+ - if_srt
+ - tap(4)
+ - vlan(4)
+
+ - netsmb
+ - netnatm
+ - netisbn
+ - netatalk
+ - netbt
+ - netkey
+
+ - if_arcsubr.c
+ - if_atmsubr.c
+ - if_ecosubr.c
+ - if_fddisubr.c
+ - if_hippisubr.c
+ - if_ieee1394subr.c
+ - if_tokensubr.c
+
+ - DCCP
+ - IGMP
+ - IPSELSRC
+ - MROUTING
+ - NFS
+ - PIM
+ - SCTP
+ - TCP
+ - UDP
+
+ - Layer 4
+ - IP multicast
+ - Most network device drivers
+
+Know issues
+===
 
 bpf
-===
+---
 
 MP-ification of bpf requires all of bpf_mtap* are called in normal LWP context
 or softint context, i.e., not in hardware interrupt context.  For Tx, all



CVS commit: src/sys/dev/pci

2017-02-09 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Feb  9 23:30:46 UTC 2017

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

Log Message:
detach wm(4) evcnt.

pointed out by msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.476 -r1.477 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.476 src/sys/dev/pci/if_wm.c:1.477
--- src/sys/dev/pci/if_wm.c:1.476	Thu Feb  2 10:29:10 2017
+++ src/sys/dev/pci/if_wm.c	Thu Feb  9 23:30:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.476 2017/02/02 10:29:10 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.477 2017/02/09 23:30:46 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.476 2017/02/02 10:29:10 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.477 2017/02/09 23:30:46 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -280,6 +280,9 @@ struct wm_softc;
 
 #define WM_Q_INTR_EVCNT_ATTACH(qname, evname, q, qnum, xname)		\
 	WM_Q_EVCNT_ATTACH(qname, evname, q, qnum, xname, EVCNT_TYPE_INTR)
+
+#define WM_Q_EVCNT_DETACH(qname, evname, q, qnum)	\
+	evcnt_detach(&(q)->qname##_ev_##evname);
 #endif /* WM_EVENT_COUNTERS */
 
 struct wm_txqueue {
@@ -2693,6 +2696,16 @@ wm_detach(device_t self, int flags __unu
 
 	pmf_device_deregister(self);
 
+#ifdef WM_EVENT_COUNTERS
+	evcnt_detach(>sc_ev_linkintr);
+
+	evcnt_detach(>sc_ev_tx_xoff);
+	evcnt_detach(>sc_ev_tx_xon);
+	evcnt_detach(>sc_ev_rx_xoff);
+	evcnt_detach(>sc_ev_rx_xon);
+	evcnt_detach(>sc_ev_rx_macctl);
+#endif /* WM_EVENT_COUNTERS */
+
 	/* Tell the firmware about the release */
 	WM_CORE_LOCK(sc);
 	wm_release_manageability(sc);
@@ -5917,6 +5930,13 @@ wm_free_txrx_queues(struct wm_softc *sc)
 
 	for (i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
+
+#ifdef WM_EVENT_COUNTERS
+		WM_Q_EVCNT_DETACH(rxq, rxintr, rxq, i);
+		WM_Q_EVCNT_DETACH(rxq, rxipsum, rxq, i);
+		WM_Q_EVCNT_DETACH(rxq, rxtusum, rxq, i);
+#endif /* WM_EVENT_COUNTERS */
+
 		wm_free_rx_buffer(sc, rxq);
 		wm_free_rx_descs(sc, rxq);
 		if (rxq->rxq_lock)
@@ -5926,6 +5946,27 @@ wm_free_txrx_queues(struct wm_softc *sc)
 	for (i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_txqueue *txq = >sc_queue[i].wmq_txq;
 		struct mbuf *m;
+#ifdef WM_EVENT_COUNTERS
+		int j;
+
+		WM_Q_EVCNT_DETACH(txq, txsstall, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txdstall, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txfifo_stall, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txdw, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txqe, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txipsum, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txtusum, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txtusum6, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txtso, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txtso6, txq, i);
+		WM_Q_EVCNT_DETACH(txq, txtsopain, txq, i);
+
+		for (j = 0; j < WM_NTXSEGS; j++)
+			evcnt_detach(>txq_ev_txseg[j]);
+
+		WM_Q_EVCNT_DETACH(txq, txdrop, txq, i);
+		WM_Q_EVCNT_DETACH(txq, tu, txq, i);
+#endif /* WM_EVENT_COUNTERS */
 
 		/* drain txq_interq */
 		while ((m = pcq_get(txq->txq_interq)) != NULL)



CVS commit: src/lib/libm/src

2017-02-09 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Feb  9 22:11:09 UTC 2017

Modified Files:
src/lib/libm/src: s_expm1.c s_expm1f.c

Log Message:
ifdef out some dead code. improves code readability.
all later users of y first assign another value.

using ifdefs to make potential future code syncs easier, as is done
elsewhere.

suggested by coverity, CID 1300929, 1300930.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_expm1.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/s_expm1f.c

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

Modified files:

Index: src/lib/libm/src/s_expm1.c
diff -u src/lib/libm/src/s_expm1.c:1.12 src/lib/libm/src/s_expm1.c:1.13
--- src/lib/libm/src/s_expm1.c:1.12	Sun May 26 22:01:55 2002
+++ src/lib/libm/src/s_expm1.c	Thu Feb  9 22:11:09 2017
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_expm1.c,v 1.12 2002/05/26 22:01:55 wiz Exp $");
+__RCSID("$NetBSD: s_expm1.c,v 1.13 2017/02/09 22:11:09 maya Exp $");
 #endif
 
 /* expm1(x)
@@ -138,7 +138,9 @@ expm1(double x)
 	c = 0;
 	GET_HIGH_WORD(hx,x);
 	xsb = hx&0x8000;		/* sign bit of x */
+#ifdef DEAD_CODE
 	if(xsb==0) y=x; else y= -x;	/* y = |x| */
+#endif
 	hx &= 0x7fff;		/* high word of |x| */
 
 /* filter out huge and non-finite argument */

Index: src/lib/libm/src/s_expm1f.c
diff -u src/lib/libm/src/s_expm1f.c:1.10 src/lib/libm/src/s_expm1f.c:1.11
--- src/lib/libm/src/s_expm1f.c:1.10	Sun May 26 22:01:55 2002
+++ src/lib/libm/src/s_expm1f.c	Thu Feb  9 22:11:09 2017
@@ -15,7 +15,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_expm1f.c,v 1.10 2002/05/26 22:01:55 wiz Exp $");
+__RCSID("$NetBSD: s_expm1f.c,v 1.11 2017/02/09 22:11:09 maya Exp $");
 #endif
 
 #include "math.h"
@@ -46,7 +46,9 @@ expm1f(float x)
 	c = 0;
 	GET_FLOAT_WORD(hx,x);
 	xsb = hx&0x8000;		/* sign bit of x */
+#ifdef DEAD_CODE
 	if(xsb==0) y=x; else y= -x;	/* y = |x| */
+#endif
 	hx &= 0x7fff;		/* high word of |x| */
 
 /* filter out huge and non-finite argument */



CVS commit: src/sys/compat/linux/arch/mips

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 22:02:05 UTC 2017

Modified Files:
src/sys/compat/linux/arch/mips: syscalls.master

Log Message:
revert listen


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/linux/arch/mips/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/mips/syscalls.master
diff -u src/sys/compat/linux/arch/mips/syscalls.master:1.65 src/sys/compat/linux/arch/mips/syscalls.master:1.66
--- src/sys/compat/linux/arch/mips/syscalls.master:1.65	Wed Feb  8 22:23:59 2017
+++ src/sys/compat/linux/arch/mips/syscalls.master	Thu Feb  9 17:02:05 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.65 2017/02/09 03:23:59 christos Exp $  
+	$NetBSD: syscalls.master,v 1.66 2017/02/09 22:02:05 christos Exp $  
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -295,7 +295,7 @@
 			int *alen); }
 173	STD		{ int|linux_sys||getsockopt(int s, int level, \
 			int optname, void *optval, int *optlen); }
-174	STD		{ int|linux_sys||listen(int s, int backlog); }
+174	NOARGS		{ int|sys||listen(int s, int backlog); }
 175	STD		{ int|linux_sys||recv(int s, void *buf, int len, \
 			int flags); }
 176	STD		{ int|linux_sys||recvfrom(int s, void *buf, int len, \



CVS commit: src/sys/compat/linux/arch/mips

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 22:02:14 UTC 2017

Modified Files:
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c

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

Modified files:

Index: src/sys/compat/linux/arch/mips/linux_syscall.h
diff -u src/sys/compat/linux/arch/mips/linux_syscall.h:1.75 src/sys/compat/linux/arch/mips/linux_syscall.h:1.76
--- src/sys/compat/linux/arch/mips/linux_syscall.h:1.75	Wed Feb  8 22:24:05 2017
+++ src/sys/compat/linux/arch/mips/linux_syscall.h	Thu Feb  9 17:02:13 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.75 2017/02/09 03:24:05 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.76 2017/02/09 22:02:13 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.65 2017/02/09 03:23:59 christos Exp  
+ * created from	NetBSD: syscalls.master,v 1.66 2017/02/09 22:02:05 christos Exp  
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_

Index: src/sys/compat/linux/arch/mips/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/mips/linux_syscallargs.h:1.74 src/sys/compat/linux/arch/mips/linux_syscallargs.h:1.75
--- src/sys/compat/linux/arch/mips/linux_syscallargs.h:1.74	Wed Feb  8 22:24:05 2017
+++ src/sys/compat/linux/arch/mips/linux_syscallargs.h	Thu Feb  9 17:02:13 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.74 2017/02/09 03:24:05 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.75 2017/02/09 22:02:13 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.65 2017/02/09 03:23:59 christos Exp  
+ * created from	NetBSD: syscalls.master,v 1.66 2017/02/09 22:02:05 christos Exp  
  */
 
 #ifndef _LINUX_SYS_SYSCALLARGS_H_
@@ -593,11 +593,7 @@ struct linux_sys_getsockopt_args {
 };
 check_syscall_args(linux_sys_getsockopt)
 
-struct linux_sys_listen_args {
-	syscallarg(int) s;
-	syscallarg(int) backlog;
-};
-check_syscall_args(linux_sys_listen)
+struct sys_listen_args;
 
 struct linux_sys_recv_args {
 	syscallarg(int) s;
@@ -1448,7 +1444,7 @@ int	linux_sys_getsockname(struct lwp *, 
 
 int	linux_sys_getsockopt(struct lwp *, const struct linux_sys_getsockopt_args *, register_t *);
 
-int	linux_sys_listen(struct lwp *, const struct linux_sys_listen_args *, register_t *);
+int	sys_listen(struct lwp *, const struct sys_listen_args *, register_t *);
 
 int	linux_sys_recv(struct lwp *, const struct linux_sys_recv_args *, register_t *);
 
Index: src/sys/compat/linux/arch/mips/linux_syscalls.c
diff -u src/sys/compat/linux/arch/mips/linux_syscalls.c:1.74 src/sys/compat/linux/arch/mips/linux_syscalls.c:1.75
--- src/sys/compat/linux/arch/mips/linux_syscalls.c:1.74	Wed Feb  8 22:24:05 2017
+++ src/sys/compat/linux/arch/mips/linux_syscalls.c	Thu Feb  9 17:02:13 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_syscalls.c,v 1.74 2017/02/09 03:24:05 christos Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.75 2017/02/09 22:02:13 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.65 2017/02/09 03:23:59 christos Exp  
+ * created from	NetBSD: syscalls.master,v 1.66 2017/02/09 22:02:05 christos Exp  
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.74 2017/02/09 03:24:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.75 2017/02/09 22:02:13 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include 
Index: src/sys/compat/linux/arch/mips/linux_sysent.c
diff -u src/sys/compat/linux/arch/mips/linux_sysent.c:1.74 src/sys/compat/linux/arch/mips/linux_sysent.c:1.75
--- src/sys/compat/linux/arch/mips/linux_sysent.c:1.74	Wed Feb  8 22:24:05 2017
+++ src/sys/compat/linux/arch/mips/linux_sysent.c	Thu Feb  9 17:02:13 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_sysent.c,v 1.74 2017/02/09 03:24:05 christos Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.75 2017/02/09 22:02:13 christos Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.65 2017/02/09 03:23:59 christos Exp  
+ * created from	NetBSD: syscalls.master,v 1.66 2017/02/09 22:02:05 christos Exp  
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.74 2017/02/09 03:24:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.75 2017/02/09 22:02:13 christos Exp $");
 
 #include 
 #include 
@@ -763,8 +763,8 @@ struct sysent 

CVS commit: src/sys/compat/linux/common

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 22:01:48 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_socketcall.c linux_socketcall.h

Log Message:
use proper arg functions, remove bogus ones.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/linux/common/linux_socketcall.c
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/linux/common/linux_socketcall.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/compat/linux/common/linux_socketcall.c
diff -u src/sys/compat/linux/common/linux_socketcall.c:1.47 src/sys/compat/linux/common/linux_socketcall.c:1.48
--- src/sys/compat/linux/common/linux_socketcall.c:1.47	Fri Feb  3 11:57:39 2017
+++ src/sys/compat/linux/common/linux_socketcall.c	Thu Feb  9 17:01:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socketcall.c,v 1.47 2017/02/03 16:57:39 christos Exp $	*/
+/*	$NetBSD: linux_socketcall.c,v 1.48 2017/02/09 22:01:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.47 2017/02/03 16:57:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.48 2017/02/09 22:01:48 christos Exp $");
 
 #include 
 #include 
@@ -93,7 +93,7 @@ static const struct {
 	{L("socket"),	sizeof(struct linux_sys_socket_args)},		/* 1 */
 	{L("bind"),	sizeof(struct linux_sys_bind_args)},		/* 2 */
 	{L("connect"),	sizeof(struct linux_sys_connect_args)},		/* 3 */
-	{L("listen"),	sizeof(struct linux_sys_listen_args)},		/* 4 */
+	{L("listen"),	sizeof(struct sys_listen_args)},		/* 4 */
 	{L("accept"),	sizeof(struct linux_sys_accept_args)},		/* 5 */
 	{L("getsockname"),sizeof(struct linux_sys_getsockname_args)},	/* 6 */
 	{L("getpeername"),sizeof(struct linux_sys_getpeername_args)},	/* 7 */
@@ -102,7 +102,7 @@ static const struct {
 	{L("recv"),	sizeof(struct linux_sys_recv_args)},		/* 10 */
 	{L("sendto"),	sizeof(struct linux_sys_sendto_args)},		/* 11 */
 	{L("recvfrom"),	sizeof(struct linux_sys_recvfrom_args)},	/* 12 */
-	{L("shutdown"),	sizeof(struct linux_sys_shutdown_args)},	/* 13 */
+	{L("shutdown"),	sizeof(struct sys_shutdown_args)},		/* 13 */
 	{L("setsockopt"),sizeof(struct linux_sys_setsockopt_args)},	/* 14 */
 	{L("getsockopt"),sizeof(struct linux_sys_getsockopt_args)},	/* 15 */
 	{L("sendmsg"),	sizeof(struct linux_sys_sendmsg_args)},		/* 16 */

Index: src/sys/compat/linux/common/linux_socketcall.h
diff -u src/sys/compat/linux/common/linux_socketcall.h:1.20 src/sys/compat/linux/common/linux_socketcall.h:1.21
--- src/sys/compat/linux/common/linux_socketcall.h:1.20	Fri Feb  3 17:29:51 2017
+++ src/sys/compat/linux/common/linux_socketcall.h	Thu Feb  9 17:01:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socketcall.h,v 1.20 2017/02/03 22:29:51 christos Exp $	*/
+/*	$NetBSD: linux_socketcall.h,v 1.21 2017/02/09 22:01:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -244,22 +244,6 @@ struct linux_sys_recv_args {
 };
 #endif
 
-/* These are only used for their size: */
-
-#ifndef LINUX_SYS_listen
-struct linux_sys_listen_args {
-	syscallarg(int) s;
-	syscallarg(int) backlog;
-};
-#endif
-
-#ifndef LINUX_SYS_shutdown
-struct linux_sys_shutdown_args {
-	syscallarg(int) s;
-	syscallarg(int) how;
-};
-#endif
-
 #ifndef LINUX_SYS_accept4
 struct linux_sys_accept4_args {
 	syscallarg(int) s;



CVS commit: src/usr.bin/nc

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 21:25:06 UTC 2017

Modified Files:
src/usr.bin/nc: Makefile

Log Message:
no more warnings for ld.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/nc/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/nc/Makefile
diff -u src/usr.bin/nc/Makefile:1.3 src/usr.bin/nc/Makefile:1.4
--- src/usr.bin/nc/Makefile:1.3	Thu Feb  9 15:39:42 2017
+++ src/usr.bin/nc/Makefile	Thu Feb  9 16:25:05 2017
@@ -12,5 +12,3 @@ SRCS=	netcat.c atomicio.c socks.c
 #.endif
 
 .include 
-
-LDFLAGS+=	-Wl,--no-fatal-warnings



CVS commit: src/usr.bin/nc

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 21:23:49 UTC 2017

Modified Files:
src/usr.bin/nc: netcat.c

Log Message:
use mkstemp to prevent linker warning.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/nc/netcat.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/nc/netcat.c
diff -u src/usr.bin/nc/netcat.c:1.4 src/usr.bin/nc/netcat.c:1.5
--- src/usr.bin/nc/netcat.c:1.4	Thu Feb  9 15:37:58 2017
+++ src/usr.bin/nc/netcat.c	Thu Feb  9 16:23:48 2017
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: netcat.c,v 1.4 2017/02/09 20:37:58 joerg Exp $");
+__RCSID("$NetBSD: netcat.c,v 1.5 2017/02/09 21:23:48 christos Exp $");
 
 /*
  * Re-written nc(1) for OpenBSD. Original implementation by
@@ -425,10 +425,14 @@ main(int argc, char *argv[])
 		if (sflag) {
 			unix_dg_tmp_socket = sflag;
 		} else {
-			strlcpy(unix_dg_tmp_socket_buf, "/tmp/nc.XX",
-			UNIX_DG_TMP_SOCKET_SIZE);
-			if (mktemp(unix_dg_tmp_socket_buf) == NULL)
+			int fd;
+			snprintf(unix_dg_tmp_socket_buf,
+			sizeof(unix_dg_tmp_socket_buf),
+			"/tmp/%s.XX", getprogname());
+			/* XXX: abstract sockets instead? */
+			if ((fd = mkstemp(unix_dg_tmp_socket_buf)) == -1)
 err(1, "mktemp");
+			close(fd);
 			unix_dg_tmp_socket = unix_dg_tmp_socket_buf;
 		}
 	}



CVS commit: src/lib/libm/src

2017-02-09 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Feb  9 21:23:11 UTC 2017

Modified Files:
src/lib/libm/src: e_j0.c e_j0f.c e_j1.c e_j1f.c

Log Message:
Appease static analyzers by making all code paths which assign
values into p,q sane. Get rid of redundant assignment. Indent
for legibility. NFC.

This doesn't create a functional difference, as all callers
test number >= 0x4000 anyway.

To see this, note the following:
- consistently, hx is the high bits of x, lx is the low bits,
  x is the float.
- & 0x7fff zeroes the sign bit, as does fabs.

A case where it isn't easy to see that there's no functional
change is y1, which does:

ix = hx & 0x7fff (zero signbit of high bits of x)
y = fabs(x) (this has a zeroed signbit but otherwise same as x)
ix >= 0x4000
  pone(y); qone(y)

qone(x) (also pone) do:
  ix = hx & 0x7fff

ix in qone and in the calling function are the same number,
and the comparison applies for both, and ix < 0x4000 isn't
possible.

(Also, no explosions seem to happen when I feed it random numbers)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/e_j0.c src/lib/libm/src/e_j1.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/e_j0f.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/e_j1f.c

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

Modified files:

Index: src/lib/libm/src/e_j0.c
diff -u src/lib/libm/src/e_j0.c:1.12 src/lib/libm/src/e_j0.c:1.13
--- src/lib/libm/src/e_j0.c:1.12	Mon Aug 20 16:01:38 2007
+++ src/lib/libm/src/e_j0.c	Thu Feb  9 21:23:11 2017
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: e_j0.c,v 1.12 2007/08/20 16:01:38 drochner Exp $");
+__RCSID("$NetBSD: e_j0.c,v 1.13 2017/02/09 21:23:11 maya Exp $");
 #endif
 
 /* __ieee754_j0(x), __ieee754_y0(x)
@@ -277,13 +277,12 @@ pzero(double x)
 	double z,r,s;
 	int32_t ix;
 
-	p = q = 0;
 	GET_HIGH_WORD(ix,x);
 	ix &= 0x7fff;
-	if(ix>=0x4020) {p = pR8; q= pS8;}
-	else if(ix>=0x40122E8B){p = pR5; q= pS5;}
-	else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
-	else if(ix>=0x4000){p = pR2; q= pS2;}
+	if(ix>=0x4020) {p = pR8; q= pS8;}
+	else if(ix>=0x40122E8B){p = pR5; q= pS5;}
+	else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
+	else /*if(ix>=0x4000)*/{p = pR2; q= pS2;}
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];
@@ -375,13 +374,12 @@ qzero(double x)
 	double s,r,z;
 	int32_t ix;
 
-	p = q = 0;
 	GET_HIGH_WORD(ix,x);
 	ix &= 0x7fff;
-	if(ix>=0x4020) {p = qR8; q= qS8;}
-	else if(ix>=0x40122E8B){p = qR5; q= qS5;}
-	else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
-	else if(ix>=0x4000){p = qR2; q= qS2;}
+	if(ix>=0x4020) {p = qR8; q= qS8;}
+	else if(ix>=0x40122E8B){p = qR5; q= qS5;}
+	else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
+	else /*if(ix>=0x4000)*/{p = qR2; q= qS2;}
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5]);
Index: src/lib/libm/src/e_j1.c
diff -u src/lib/libm/src/e_j1.c:1.12 src/lib/libm/src/e_j1.c:1.13
--- src/lib/libm/src/e_j1.c:1.12	Mon Aug 20 16:01:38 2007
+++ src/lib/libm/src/e_j1.c	Thu Feb  9 21:23:11 2017
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: e_j1.c,v 1.12 2007/08/20 16:01:38 drochner Exp $");
+__RCSID("$NetBSD: e_j1.c,v 1.13 2017/02/09 21:23:11 maya Exp $");
 #endif
 
 /* __ieee754_j1(x), __ieee754_y1(x)
@@ -271,13 +271,12 @@ pone(double x)
 	double z,r,s;
 int32_t ix;
 
-	p = q = 0;
 	GET_HIGH_WORD(ix,x);
 	ix &= 0x7fff;
-if(ix>=0x4020) {p = pr8; q= ps8;}
-else if(ix>=0x40122E8B){p = pr5; q= ps5;}
-else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
-else if(ix>=0x4000){p = pr2; q= ps2;}
+if(ix>=0x4020) {p = pr8; q= ps8;}
+else if(ix>=0x40122E8B){p = pr5; q= ps5;}
+else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
+else /*if(ix>=0x4000)*/{p = pr2; q= ps2;}
 z = one/(x*x);
 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];
@@ -370,13 +369,12 @@ qone(double x)
 	double  s,r,z;
 	int32_t ix;
 
-	p = q = 0;
 	GET_HIGH_WORD(ix,x);
 	ix &= 0x7fff;
-	if(ix>=0x4020) {p = qr8; q= qs8;}
-	else if(ix>=0x40122E8B){p = qr5; q= qs5;}
-	else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
-	else if(ix>=0x4000){p = qr2; q= qs2;}
+	if(ix>=0x4020) {p = qr8; q= qs8;}
+	else if(ix>=0x40122E8B){p = qr5; q= qs5;}
+	else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
+	else /*if(ix>=0x4000)*/{p = qr2; q= qs2;}
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5]);

Index: src/lib/libm/src/e_j0f.c
diff -u 

CVS commit: src/sys/dev/pci

2017-02-09 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  9 20:42:30 UTC 2017

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

Log Message:
fix tpyo


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/trm.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/trm.c
diff -u src/sys/dev/pci/trm.c:1.38 src/sys/dev/pci/trm.c:1.39
--- src/sys/dev/pci/trm.c:1.38	Thu Feb  9 20:32:19 2017
+++ src/sys/dev/pci/trm.c	Thu Feb  9 20:42:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: trm.c,v 1.38 2017/02/09 20:32:19 macallan Exp $	*/
+/*	$NetBSD: trm.c,v 1.39 2017/02/09 20:42:30 macallan Exp $	*/
 /*-
  * Copyright (c) 2002 Izumi Tsutsui.  All rights reserved.
  *
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trm.c,v 1.38 2017/02/09 20:32:19 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trm.c,v 1.39 2017/02/09 20:42:30 macallan Exp $");
 
 /* #define TRM_DEBUG */
 #ifdef TRM_DEBUG
@@ -437,7 +437,7 @@ trm_attach(device_t parent, device_t sel
 		, NULL, NULL);
 	}
 	if (fl != 0) {
-		aprint_verbose_dev(self, "couldn't map MMIO registers, tryion PIO\n");
+		aprint_verbose_dev(self, "couldn't map MMIO registers, trying PIO\n");
 		if ((fl = pci_mapreg_map(pa, TRM_BAR_PIO, PCI_MAPREG_TYPE_IO,
 		0, , , NULL, NULL)) != 0) {
 			aprint_error(": unable to map registers (%d)\n", fl);



CVS commit: src/usr.bin/nc

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 20:39:42 UTC 2017

Modified Files:
src/usr.bin/nc: Makefile

Log Message:
Turn off fatal linker warnings for now due to mktemp.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/nc/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/nc/Makefile
diff -u src/usr.bin/nc/Makefile:1.2 src/usr.bin/nc/Makefile:1.3
--- src/usr.bin/nc/Makefile:1.2	Mon Feb  6 16:03:40 2017
+++ src/usr.bin/nc/Makefile	Thu Feb  9 20:39:42 2017
@@ -12,3 +12,5 @@ SRCS=	netcat.c atomicio.c socks.c
 #.endif
 
 .include 
+
+LDFLAGS+=	-Wl,--no-fatal-warnings



CVS commit: src/usr.bin/nc

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 20:37:58 UTC 2017

Modified Files:
src/usr.bin/nc: netcat.c socks.c

Log Message:
Mark help as static+dead. Don't use __attribute__.
XXX needs a lot more static love. Uses mktemp and doesn't link.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/nc/netcat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/nc/socks.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/nc/netcat.c
diff -u src/usr.bin/nc/netcat.c:1.3 src/usr.bin/nc/netcat.c:1.4
--- src/usr.bin/nc/netcat.c:1.3	Thu Feb  9 17:27:30 2017
+++ src/usr.bin/nc/netcat.c	Thu Feb  9 20:37:58 2017
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: netcat.c,v 1.3 2017/02/09 17:27:30 christos Exp $");
+__RCSID("$NetBSD: netcat.c,v 1.4 2017/02/09 20:37:58 joerg Exp $");
 
 /*
  * Re-written nc(1) for OpenBSD. Original implementation by
@@ -129,11 +129,11 @@ int minttl = -1;
 
 void	atelnet(int, unsigned char *, unsigned int);
 void	build_ports(char *);
-void	help(void);
+static void	help(void) __dead;
 int	local_listen(char *, char *, struct addrinfo);
 struct tls;
 void	readwrite(int, struct tls *);
-void	fdpass(int nfd) __attribute__((noreturn));
+void	fdpass(int nfd) __dead;
 int	remote_connect(const char *, const char *, struct addrinfo);
 int	timeout_connect(int, const struct sockaddr *, socklen_t);
 int	socks_connect(const char *, const char *, struct addrinfo,

Index: src/usr.bin/nc/socks.c
diff -u src/usr.bin/nc/socks.c:1.2 src/usr.bin/nc/socks.c:1.3
--- src/usr.bin/nc/socks.c:1.2	Mon Feb  6 16:03:40 2017
+++ src/usr.bin/nc/socks.c	Thu Feb  9 20:37:58 2017
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: socks.c,v 1.2 2017/02/06 16:03:40 christos Exp $");
+__RCSID("$NetBSD: socks.c,v 1.3 2017/02/09 20:37:58 joerg Exp $");
 
 #include 
 #include 
@@ -185,7 +185,7 @@ socks5_strerror(int e)
 
 int
 socks_connect(const char *host, const char *port,
-struct addrinfo hints __attribute__ ((__unused__)),
+struct addrinfo hints __unused,
 const char *proxyhost, const char *proxyport, struct addrinfo proxyhints,
 int socksv, const char *proxyuser)
 {



CVS commit: src/sys/dev/pci

2017-02-09 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  9 20:32:19 UTC 2017

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

Log Message:
make fallback to PIO actually work properly


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/trm.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/trm.c
diff -u src/sys/dev/pci/trm.c:1.37 src/sys/dev/pci/trm.c:1.38
--- src/sys/dev/pci/trm.c:1.37	Thu Jul  7 06:55:41 2016
+++ src/sys/dev/pci/trm.c	Thu Feb  9 20:32:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: trm.c,v 1.37 2016/07/07 06:55:41 msaitoh Exp $	*/
+/*	$NetBSD: trm.c,v 1.38 2017/02/09 20:32:19 macallan Exp $	*/
 /*-
  * Copyright (c) 2002 Izumi Tsutsui.  All rights reserved.
  *
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trm.c,v 1.37 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trm.c,v 1.38 2017/02/09 20:32:19 macallan Exp $");
 
 /* #define TRM_DEBUG */
 #ifdef TRM_DEBUG
@@ -412,7 +412,7 @@ trm_attach(device_t parent, device_t sel
 	pci_intr_handle_t ih;
 	pcireg_t command;
 	const char *intrstr;
-	int fl = 0;
+	int fl = -1;
 	char intrbuf[PCI_INTRSTR_LEN];
 
 	sc->sc_dev = self;



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

2017-02-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  9 19:30:56 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: locore.S

Log Message:
If the preloaded modules cannot be mapped with the initial amount of VA,
discard the associated bootinfo entry. Otherwise the machine faults and
reboots immediately.

I spotted this bug more than a year ago, but I recently saw that there is
already PR/42645 (7 years old), so just fix it. The size has been increased
in the meantime, so the limit is unlikely to be reached anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/amd64/amd64/locore.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.120 src/sys/arch/amd64/amd64/locore.S:1.121
--- src/sys/arch/amd64/amd64/locore.S:1.120	Thu Feb  9 08:23:46 2017
+++ src/sys/arch/amd64/amd64/locore.S	Thu Feb  9 19:30:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.120 2017/02/09 08:23:46 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.121 2017/02/09 19:30:56 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -211,6 +211,10 @@
   ((NKL4_KIMG_ENTRIES + TABLE_L3_ENTRIES + TABLE_L2_ENTRIES + 1 + UPAGES) \
 * PAGE_SIZE)
 
+/* Amount of VA used to map the kernel, the syms and the preloaded modules */
+#define BOOTMAP_VA_SIZE \
+	(NKL2_KIMG_ENTRIES * (1 << L2_SHIFT) - TABLESIZE - IOM_SIZE)
+
 /*
  * fillkpt - Fill in a kernel page table
  *	eax = pte (page frame | control | status)
@@ -443,7 +447,7 @@ ENTRY(start)
 	testl	%eax,%eax		/* bootinfo = NULL? */
 	jz	bootinfo_finished
 
-	movl	(%eax),%ebx		/* number of entries */
+	movl	(%eax),%ebx		/* bootinfo::bi_nentries */
 	movl	$RELOC(bootinfo),%ebp
 	movl	%ebp,%edx
 	addl	$BOOTINFO_MAXSIZE,%ebp
@@ -462,7 +466,7 @@ bootinfo_entryloop:
 
 	movl	(%ecx),%eax		/* btinfo_common::len (size of entry) */
 	movl	%edx,%edi
-	addl	(%ecx),%edx		/* update dest pointer */
+	addl	%eax,%edx		/* update dest pointer */
 	cmpl	%ebp,%edx		/* beyond bootinfo+BOOTINFO_MAXSIZE? */
 	jg	bootinfo_overflow
 
@@ -470,20 +474,31 @@ bootinfo_entryloop:
 	movl	%eax,%ecx
 
 	/*
-	 * If any modules were loaded, record where they end.  We'll need to
-	 * skip over them.
+	 * If any modules were loaded, record where they end. 'eblob' is used
+	 * later to compute the initial bootstrap tables.
 	 */
 	cmpl	$BTINFO_MODULELIST,4(%esi) /* btinfo_common::type */
-	jne	0f
+	jne	bootinfo_copy
 
-	pushl	12(%esi)		/* btinfo_modulelist::endpa */
-	popl	RELOC(eblob)
+	/* Skip the modules if we won't have enough VA to map them */
+	movl	12(%esi),%eax		/* btinfo_modulelist::endpa */
+	addl	$PGOFSET,%eax		/* roundup to a page */
+	andl	$~PGOFSET,%eax
+	cmpl	$BOOTMAP_VA_SIZE,%eax
+	jg	bootinfo_skip
+	movl	%eax,RELOC(eblob)
 	addl	$KERNBASE_LO,RELOC(eblob)
 	adcl	$KERNBASE_HI,RELOC(eblob)+4
 
-0:
+bootinfo_copy:
 	rep
 	movsb/* copy esi -> edi */
+	jmp	bootinfo_next
+
+bootinfo_skip:
+	subl	%ecx,%edx		/* revert dest pointer */
+
+bootinfo_next:
 	popl	%eax
 	popl	%esi
 	popl	%edi
@@ -501,8 +516,8 @@ bootinfo_overflow:
 	movl	$RELOC(bootinfo),%ebp
 	movl	%ebp,%edx
 	subl	%ebx,(%edx)		/* correct the number of entries */
-
 bootinfo_finished:
+
 	/* Load 'esym' */
 	movl	16(%esp),%eax
 	testl	%eax,%eax		/* esym = NULL? */



CVS commit: src

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 18:15:07 UTC 2017

Modified Files:
src/distrib/sparc/miniroot: Makefile.inc
src/distrib/sparc/ramdisk: Makefile
src/sys/arch/sparc/conf: INSTALL

Log Message:
Bump the ram disk and miniroot size slightly for clang.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/sparc/miniroot/Makefile.inc
cvs rdiff -u -r1.42 -r1.43 src/distrib/sparc/ramdisk/Makefile
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/sparc/conf/INSTALL

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

Modified files:

Index: src/distrib/sparc/miniroot/Makefile.inc
diff -u src/distrib/sparc/miniroot/Makefile.inc:1.26 src/distrib/sparc/miniroot/Makefile.inc:1.27
--- src/distrib/sparc/miniroot/Makefile.inc:1.26	Tue Jan 24 18:04:04 2017
+++ src/distrib/sparc/miniroot/Makefile.inc	Thu Feb  9 18:15:07 2017
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.26 2017/01/24 18:04:04 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.27 2017/02/09 18:15:07 joerg Exp $
 
-IMAGESIZE=	9500k
+IMAGESIZE=	9600k
 DBG=		${${ACTIVE_CC} == "clang":? -Oz -fomit-frame-pointer : -Os } -fno-unwind-tables
 
 MAKEFS_FLAGS+=   -o density=4k

Index: src/distrib/sparc/ramdisk/Makefile
diff -u src/distrib/sparc/ramdisk/Makefile:1.42 src/distrib/sparc/ramdisk/Makefile:1.43
--- src/distrib/sparc/ramdisk/Makefile:1.42	Sat Feb 27 18:52:51 2016
+++ src/distrib/sparc/ramdisk/Makefile	Thu Feb  9 18:15:07 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.42 2016/02/27 18:52:51 joerg Exp $
+#	$NetBSD: Makefile,v 1.43 2017/02/09 18:15:07 joerg Exp $
 #
 # ramdisk.fs is the microroot filesystem intended for use with
 # the INSTALL kernel. It provides just enough tools to extract the
@@ -10,7 +10,7 @@
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	1800b
+IMAGESIZE=	2000b
 
 WARNS=		1
 DBG=		${${ACTIVE_CC} == "clang":? -Oz -fomit-frame-pointer -fno-unwind-tables : -Os }

Index: src/sys/arch/sparc/conf/INSTALL
diff -u src/sys/arch/sparc/conf/INSTALL:1.95 src/sys/arch/sparc/conf/INSTALL:1.96
--- src/sys/arch/sparc/conf/INSTALL:1.95	Tue Dec 13 20:42:20 2016
+++ src/sys/arch/sparc/conf/INSTALL	Thu Feb  9 18:15:07 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.95 2016/12/13 20:42:20 christos Exp $
+#	$NetBSD: INSTALL,v 1.96 2017/02/09 18:15:07 joerg Exp $
 #
 # from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
 #
@@ -19,7 +19,7 @@ options 	MEMORY_DISK_IS_ROOT	# force roo
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
 ## The miniroot size must be kept in sync manually with the size of
 ## the `ramdisk' image (which is built in distrib/sparc/ramdisk).
-options 	MEMORY_DISK_ROOT_SIZE=1800	# size of memory disk, in blocks
+options 	MEMORY_DISK_ROOT_SIZE=2000	# size of memory disk, in blocks
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 pseudo-device	md			# memory disk device (ramdisk)



CVS commit: [LLVM] src/external/bsd/llvm/dist/llvm

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 17:54:07 UTC 2017

Removed Files:
src/external/bsd/llvm/dist/llvm/include/llvm/Analysis [LLVM]:
LoopPassManager.h
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/CodeView [LLVM]:
TypeDumper.h
src/external/bsd/llvm/dist/llvm/lib/Analysis [LLVM]:
LoopPassManager.cpp
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/CodeView [LLVM]:
TypeDumper.cpp
src/external/bsd/llvm/dist/llvm/test/CodeGen/AArch64 [LLVM]:
aarch64-interleaved-accesses-extract-user.ll
aarch64-interleaved-accesses.ll ldst-opt-dbg-limit.mir
src/external/bsd/llvm/dist/llvm/test/CodeGen/AMDGPU [LLVM]:
ci-use-flat-for-global.ll fp16_to_fp.ll
src/external/bsd/llvm/dist/llvm/test/CodeGen/ARM [LLVM]:
arm-interleaved-accesses-extract-user.ll
arm-interleaved-accesses.ll
src/external/bsd/llvm/dist/llvm/test/CodeGen/X86 [LLVM]:
atom-bypass-slow-division-64.ll atom-bypass-slow-division.ll
slow-div.ll
src/external/bsd/llvm/dist/llvm/test/FileCheck [LLVM]:
strict-whitespace-match-full-lines.txt
src/external/bsd/llvm/dist/llvm/test/MC/Disassembler/Mips/mips4 [LLVM]:
valid-xfail-mips4.txt
src/external/bsd/llvm/dist/llvm/test/MC/Mips/mips3 [LLVM]:
invalid-mips4-wrong-error.s
src/external/bsd/llvm/dist/llvm/test/tools/llvm-xray/X86 [LLVM]:
bad-instrmap-sizes.bin
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump [LLVM]:
BuiltinDumper.cpp BuiltinDumper.h ClassDefinitionDumper.cpp
ClassDefinitionDumper.h CompilandDumper.cpp CompilandDumper.h
EnumDumper.cpp EnumDumper.h ExternalSymbolDumper.cpp
ExternalSymbolDumper.h FunctionDumper.cpp FunctionDumper.h
TypeDumper.cpp TypeDumper.h TypedefDumper.cpp TypedefDumper.h
VariableDumper.cpp VariableDumper.h
src/external/bsd/llvm/dist/llvm/unittests/Analysis [LLVM]:
LoopPassManagerTest.cpp

Log Message:
Mark files not in r294123 as dead.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/include/llvm/Analysis/LoopPassManager.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/CodeView/TypeDumper.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/lib/Analysis/LoopPassManager.cpp
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/AArch64/aarch64-interleaved-accesses-extract-user.ll
 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/AArch64/ldst-opt-dbg-limit.mir
cvs rdiff -u -r1.1.1.2 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/AArch64/aarch64-interleaved-accesses.ll
cvs rdiff -u -r1.1.1.2 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/AMDGPU/ci-use-flat-for-global.ll
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/AMDGPU/fp16_to_fp.ll
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/ARM/arm-interleaved-accesses-extract-user.ll
cvs rdiff -u -r1.1.1.2 -r0 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll
cvs rdiff -u -r1.1.1.2 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/X86/atom-bypass-slow-division-64.ll
 \
src/external/bsd/llvm/dist/llvm/test/CodeGen/X86/slow-div.ll
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/CodeGen/X86/atom-bypass-slow-division.ll
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/FileCheck/strict-whitespace-match-full-lines.txt
cvs rdiff -u -r1.1.1.4 -r0 \

src/external/bsd/llvm/dist/llvm/test/MC/Disassembler/Mips/mips4/valid-xfail-mips4.txt
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/MC/Mips/mips3/invalid-mips4-wrong-error.s
cvs rdiff -u -r1.1.1.1 -r0 \

src/external/bsd/llvm/dist/llvm/test/tools/llvm-xray/X86/bad-instrmap-sizes.bin
cvs rdiff -u -r1.1.1.2 -r0 \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/BuiltinDumper.cpp \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/BuiltinDumper.h \

src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.h \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/CompilandDumper.cpp \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/CompilandDumper.h \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/EnumDumper.cpp \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/EnumDumper.h \
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/ExternalSymbolDumper.cpp 
\
src/external/bsd/llvm/dist/llvm/tools/llvm-pdbdump/ExternalSymbolDumper.h \

CVS commit: src/external/bsd/llvm

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 17:58:57 UTC 2017

Modified Files:
src/external/bsd/llvm: Makefile.inc
src/external/bsd/llvm/lib/libLLVMAnalysis: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView: Makefile
src/external/bsd/llvm/lib/libLLVMObject: Makefile
src/external/bsd/llvm/lib/libLLVMScalarOpts: Makefile
Added Files:
src/external/bsd/llvm/bin/llvm-xray: Makefile
src/external/bsd/llvm/lib/libLLVMXRay: Makefile

Log Message:
Switch to the 4.0 release branch and update build glue for r294123.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/external/bsd/llvm/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/llvm/bin/llvm-xray/Makefile
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/llvm/lib/libLLVMObject/Makefile
cvs rdiff -u -r1.21 -r1.22 \
src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/llvm/lib/libLLVMXRay/Makefile

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

Modified files:

Index: src/external/bsd/llvm/Makefile.inc
diff -u src/external/bsd/llvm/Makefile.inc:1.82 src/external/bsd/llvm/Makefile.inc:1.83
--- src/external/bsd/llvm/Makefile.inc:1.82	Wed Jan 11 12:02:24 2017
+++ src/external/bsd/llvm/Makefile.inc	Thu Feb  9 17:58:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.82 2017/01/11 12:02:24 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.83 2017/02/09 17:58:57 joerg Exp $
 
 .if !defined(LLVM_TOPLEVEL_MK)
 LLVM_TOPLEVEL_MK=
@@ -6,9 +6,9 @@ LLVM_TOPLEVEL_MK=
 .include 
 
 SVN_ROOT=		http://llvm.org/svn/llvm-project
-SVN_BRANCH=		trunk
+SVN_BRANCH=		branches/release_40
 
-COMMON_REVISION=	r291444
+COMMON_REVISION=	r294123
 CLANG_REVISION=		${COMMON_REVISION}
 LLD_REVISION=		${COMMON_REVISION}
 LLDB_REVISION=		${COMMON_REVISION}

Index: src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile:1.22 src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile:1.23
--- src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile:1.22	Wed Jan 11 12:02:28 2017
+++ src/external/bsd/llvm/lib/libLLVMAnalysis/Makefile	Thu Feb  9 17:58:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2017/01/11 12:02:28 joerg Exp $
+#	$NetBSD: Makefile,v 1.23 2017/02/09 17:58:57 joerg Exp $
 
 LIB=	LLVMAnalysis
 
@@ -51,9 +51,9 @@ SRCS+=	AliasAnalysis.cpp \
 	Lint.cpp \
 	Loads.cpp \
 	LoopAccessAnalysis.cpp \
+	LoopAnalysisManager.cpp \
 	LoopInfo.cpp \
 	LoopPass.cpp \
-	LoopPassManager.cpp \
 	LoopUnrollAnalyzer.cpp \
 	MemDepPrinter.cpp \
 	MemDerefPrinter.cpp \

Index: src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile:1.2 src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile:1.3
--- src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile:1.2	Wed Jan 11 12:02:29 2017
+++ src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView/Makefile	Thu Feb  9 17:58:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2017/01/11 12:02:29 joerg Exp $
+#	$NetBSD: Makefile,v 1.3 2017/02/09 17:58:57 joerg Exp $
 
 LIB=	LLVMDebugInfoCodeView
 
@@ -7,6 +7,7 @@ LIB=	LLVMDebugInfoCodeView
 .PATH: ${LLVM_SRCDIR}/lib/DebugInfo/CodeView
 
 SRCS+=	CVSymbolVisitor.cpp \
+	CVTypeDumper.cpp \
 	CVTypeVisitor.cpp \
 	CodeViewError.cpp \
 	CodeViewRecordIO.cpp \
@@ -17,7 +18,9 @@ SRCS+=	CVSymbolVisitor.cpp \
 	RecordSerialization.cpp \
 	SymbolDumper.cpp \
 	SymbolRecordMapping.cpp \
-	TypeDumper.cpp \
+	TypeDatabase.cpp \
+	TypeDatabaseVisitor.cpp \
+	TypeDumpVisitor.cpp \
 	TypeRecord.cpp \
 	TypeRecordMapping.cpp \
 	TypeSerializer.cpp \

Index: src/external/bsd/llvm/lib/libLLVMObject/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMObject/Makefile:1.13 src/external/bsd/llvm/lib/libLLVMObject/Makefile:1.14
--- src/external/bsd/llvm/lib/libLLVMObject/Makefile:1.13	Wed Jan 11 12:02:30 2017
+++ src/external/bsd/llvm/lib/libLLVMObject/Makefile	Thu Feb  9 17:58:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2017/01/11 12:02:30 joerg Exp $
+#	$NetBSD: Makefile,v 1.14 2017/02/09 17:58:57 joerg Exp $
 
 LIB=	LLVMObject
 
@@ -10,6 +10,7 @@ SRCS+=	Archive.cpp \
 	ArchiveWriter.cpp \
 	Binary.cpp \
 	COFFObjectFile.cpp \
+	Decompressor.cpp \
 	ELF.cpp \
 	ELFObjectFile.cpp \
 	Error.cpp \

Index: src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile:1.21 src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile:1.22
--- src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile:1.21	Wed Jan 11 12:02:31 2017
+++ src/external/bsd/llvm/lib/libLLVMScalarOpts/Makefile	Thu Feb  9 17:58:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2017/01/11 12:02:31 joerg Exp $
+#	$NetBSD: Makefile,v 1.22 

CVS commit: src/usr.bin/nc

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 17:27:30 UTC 2017

Modified Files:
src/usr.bin/nc: netcat.c

Log Message:
the tls ifdef was a bit too aggressive.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/nc/netcat.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/nc/netcat.c
diff -u src/usr.bin/nc/netcat.c:1.2 src/usr.bin/nc/netcat.c:1.3
--- src/usr.bin/nc/netcat.c:1.2	Mon Feb  6 11:03:40 2017
+++ src/usr.bin/nc/netcat.c	Thu Feb  9 12:27:30 2017
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: netcat.c,v 1.2 2017/02/06 16:03:40 christos Exp $");
+__RCSID("$NetBSD: netcat.c,v 1.3 2017/02/09 17:27:30 christos Exp $");
 
 /*
  * Re-written nc(1) for OpenBSD. Original implementation by
@@ -709,8 +709,8 @@ main(int argc, char *argv[])
 			}
 			if (Fflag)
 fdpass(s);
-#ifdef CRYPTO
 			else {
+#ifdef CRYPTO
 if (usetls)
 	tls_setup_client(tls_ctx, s, host);
 if (!zflag)
@@ -725,8 +725,11 @@ main(int argc, char *argv[])
 	tls_free(tls_ctx);
 	tls_ctx = NULL;
 }
-			}
+#else
+if (!zflag)
+	readwrite(s, NULL);
 #endif
+			}
 		}
 	}
 



CVS commit: src

2017-02-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb  9 15:24:08 UTC 2017

Modified Files:
src/distrib/evbppc/ramdisk: Makefile
src/sys/arch/evbppc/conf: INSTALL.inc

Log Message:
Give clang a bit more space on the RAM disk.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/evbppc/ramdisk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/conf/INSTALL.inc

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

Modified files:

Index: src/distrib/evbppc/ramdisk/Makefile
diff -u src/distrib/evbppc/ramdisk/Makefile:1.21 src/distrib/evbppc/ramdisk/Makefile:1.22
--- src/distrib/evbppc/ramdisk/Makefile:1.21	Tue Jan 24 18:04:02 2017
+++ src/distrib/evbppc/ramdisk/Makefile	Thu Feb  9 15:24:08 2017
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.21 2017/01/24 18:04:02 christos Exp $
+#	$NetBSD: Makefile,v 1.22 2017/02/09 15:24:08 joerg Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	3240k
+IMAGESIZE=	3280k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1

Index: src/sys/arch/evbppc/conf/INSTALL.inc
diff -u src/sys/arch/evbppc/conf/INSTALL.inc:1.3 src/sys/arch/evbppc/conf/INSTALL.inc:1.4
--- src/sys/arch/evbppc/conf/INSTALL.inc:1.3	Sun Nov 13 22:14:44 2016
+++ src/sys/arch/evbppc/conf/INSTALL.inc	Thu Feb  9 15:24:08 2017
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL.inc,v 1.3 2016/11/13 22:14:44 joerg Exp $
+# 	$NetBSD: INSTALL.inc,v 1.4 2017/02/09 15:24:08 joerg Exp $
 
 # DEBUG options turned on:
 
@@ -17,5 +17,5 @@ options 	MEMORY_DISK_IS_ROOT	# force roo
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
 ## The ramdisk size must be kept in sync manually with the size of
 ## the `ramdisk' image (which is built in distrib/evbppc/ramdisk/ramdisk).
-options 	MEMORY_DISK_ROOT_SIZE=6480	# size of memory disk, in blocks
+options 	MEMORY_DISK_ROOT_SIZE=6560	# size of memory disk, in blocks
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode



CVS commit: src/distrib/emips/instkernel

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 14:00:06 UTC 2017

Modified Files:
src/distrib/emips/instkernel: Makefile

Log Message:
loosen the belt again.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/emips/instkernel/Makefile

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

Modified files:

Index: src/distrib/emips/instkernel/Makefile
diff -u src/distrib/emips/instkernel/Makefile:1.2 src/distrib/emips/instkernel/Makefile:1.3
--- src/distrib/emips/instkernel/Makefile:1.2	Sun Jun 12 01:39:57 2011
+++ src/distrib/emips/instkernel/Makefile	Thu Feb  9 09:00:06 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/06/12 05:39:57 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.3 2017/02/09 14:00:06 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -6,7 +6,7 @@
 .include 
 
 IMAGE=		diskimage
-IMAGESIZE=	2100k
+IMAGESIZE=	2200k
 LISTS=		${.CURDIR}/list
 MTREECONF=	${DISTRIBDIR}/common/mtree.dot
 IMAGEENDIAN=	be



CVS commit: src/distrib/sets/lists/tests

2017-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 13:59:02 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
put back exect directory; we try to remove it before the files inside it and
we fail.


To generate a diff of this commit:
cvs rdiff -u -r1.718 -r1.719 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.718 src/distrib/sets/lists/tests/mi:1.719
--- src/distrib/sets/lists/tests/mi:1.718	Wed Feb  8 22:29:55 2017
+++ src/distrib/sets/lists/tests/mi	Thu Feb  9 08:59:02 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.718 2017/02/09 03:29:55 christos Exp $
+# $NetBSD: mi,v 1.719 2017/02/09 13:59:02 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -91,7 +91,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/c063tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc/dbtests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gentests-lib-debug		compattestfile,atf
-./usr/libdata/debug/usr/tests/lib/libc/gen/exect			tests-obsolete		obsolete
+./usr/libdata/debug/usr/tests/lib/libc/gen/exect			tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/execve			tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc/gen/posix_spawn			tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc/getaddrinfo			tests-obsolete		obsolete



CVS commit: src/distrib/sets/lists/misc

2017-02-09 Thread Ryosuke Moro
Module Name:src
Committed By:   szptvlfn
Date:   Thu Feb  9 13:26:56 UTC 2017

Modified Files:
src/distrib/sets/lists/misc: mi

Log Message:
fix build (MKUNBOUND=no)


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/distrib/sets/lists/misc/mi

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

Modified files:

Index: src/distrib/sets/lists/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.201 src/distrib/sets/lists/misc/mi:1.202
--- src/distrib/sets/lists/misc/mi:1.201	Wed Feb  8 17:51:21 2017
+++ src/distrib/sets/lists/misc/mi	Thu Feb  9 13:26:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.201 2017/02/08 17:51:21 christos Exp $
+# $NetBSD: mi,v 1.202 2017/02/09 13:26:56 szptvlfn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1619,7 +1619,7 @@
 ./usr/share/examples/usermgmt/.cshrc		misc-obsolete		obsolete
 ./usr/share/examples/usermgmt/.login		misc-obsolete		obsolete
 ./usr/share/examples/usermgmt/.profile		misc-obsolete		obsolete
-./usr/share/examples/unbound/unbound.conf	misc-netutil-examples	share
+./usr/share/examples/unbound/unbound.conf	misc-netutil-examples	share,unbound
 ./usr/share/misc/NetBSD.el			misc-reference-share	share
 ./usr/share/misc/airport			misc-reference-share	share
 ./usr/share/misc/birthtoken			misc-reference-share	share



CVS commit: src/sys/arch/x86

2017-02-09 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Feb  9 11:56:41 UTC 2017

Modified Files:
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: efi.h
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
efi_md::md_virt always uses uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/include/efi.h
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/x86/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.15 src/sys/arch/x86/acpi/acpi_machdep.c:1.16
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.15	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Thu Feb  9 11:56:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.15 2017/01/24 11:09:14 nonaka Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.16 2017/02/09 11:56:40 nonaka Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.15 2017/01/24 11:09:14 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.16 2017/02/09 11:56:40 nonaka Exp $");
 
 #include 
 #include 
@@ -402,8 +402,7 @@ acpi_md_mcfg_validate(uint64_t addr, int
 			", size=0x%016" PRIx64 ", attr=0x%016" PRIx64
 			", type=%d(%s)\n",
 			mapaddr, mapaddr + mapsize - 1,
-			(uint64_t)(u_long)md->md_virt,
-			(uint64_t)(u_long)md->md_virt + mapsize - 1,
+			md->md_virt, md->md_virt + mapsize - 1,
 			size, md->md_attr, md->md_type,
 			efi_getmemtype_str(md->md_type));
 		} else

Index: src/sys/arch/x86/include/efi.h
diff -u src/sys/arch/x86/include/efi.h:1.2 src/sys/arch/x86/include/efi.h:1.3
--- src/sys/arch/x86/include/efi.h:1.2	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/x86/include/efi.h	Thu Feb  9 11:56:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: efi.h,v 1.2 2017/01/24 11:09:14 nonaka Exp $   */
+/* $NetBSD: efi.h,v 1.3 2017/02/09 11:56:40 nonaka Exp $   */
 
 /*-
  * Copyright (c) 2004 Marcel Moolenaar
@@ -76,7 +76,7 @@ struct efi_md {
 #defineEFI_MD_TYPE_PALCODE 13  /* PAL */
uint32_t__pad;
uint64_tmd_phys;
-   void*md_virt;
+   uint64_tmd_virt;
uint64_tmd_pages;
uint64_tmd_attr;
 #defineEFI_MD_ATTR_UC  0x0001UL

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.83 src/sys/arch/x86/x86/x86_machdep.c:1.84
--- src/sys/arch/x86/x86/x86_machdep.c:1.83	Thu Jan 26 01:36:35 2017
+++ src/sys/arch/x86/x86/x86_machdep.c	Thu Feb  9 11:56:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.83 2017/01/26 01:36:35 nonaka Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.84 2017/02/09 11:56:41 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.83 2017/01/26 01:36:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.84 2017/02/09 11:56:41 nonaka Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -666,8 +666,7 @@ x86_parse_clusters(struct btinfo_common 
 			", size=0x%016" PRIx64 ", attr=0x%016" PRIx64
 			", type=%d(%s)\n",
 			addr, addr + size - 1,
-			(uint64_t)(u_long)md->md_virt,
-			(uint64_t)(u_long)md->md_virt + size - 1,
+			md->md_virt, md->md_virt + size - 1,
 			size, md->md_attr, md->md_type,
 			efi_getmemtype_str(md->md_type));
 #endif



CVS commit: src/sys/net

2017-02-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Feb  9 11:43:32 UTC 2017

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

Log Message:
PR kern/51280

This allows srt devices to work for IPv6.   srt still needs work
(particularly #ifdef INET6 but also general effeciency and similar.)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/net/if_srt.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_srt.c
diff -u src/sys/net/if_srt.c:1.24 src/sys/net/if_srt.c:1.25
--- src/sys/net/if_srt.c:1.24	Sat Jan 14 16:34:44 2017
+++ src/sys/net/if_srt.c	Thu Feb  9 11:43:32 2017
@@ -1,8 +1,8 @@
-/* $NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $ */
+/* $NetBSD: if_srt.c,v 1.25 2017/02/09 11:43:32 kre Exp $ */
 /* This file is in the public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.24 2017/01/14 16:34:44 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.25 2017/02/09 11:43:32 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -35,6 +35,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #include "if_srt.h"
@@ -236,6 +239,8 @@ srt_if_output(
 		return 0; /* XXX ENETDOWN? */
 	}
 	/* XXX is 0 the right last arg here? */
+	if (to->sa_family == AF_INET6)
+		return nd6_output(r->u.dstifp, r->u.dstifp, m, >dst.sin6, 0);
 	return if_output_lock(r->u.dstifp, r->u.dstifp, m, >dst.sa, 0);
 }
 
@@ -466,6 +471,8 @@ srt_ioctl(dev_t dev, u_long cmd, void *d
 		scr->srcmask = dr->srcmask;
 		scr->u.dstifp = ifp;
 		memcpy(>dst,>dst,dr->dst.sa.sa_len);
+		if (dr->af == AF_INET6)
+			in6_setzoneid(>dst.sin6.sin6_addr, ifp->if_index);
 		update_mtu(sc);
 		return 0;
 	case SRT_DELRT:



CVS commit: src/sys/net

2017-02-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb  9 09:30:26 UTC 2017

Modified Files:
src/sys/net: bpf.c bpfdesc.h if.c

Log Message:
Make bpf MP-safe

By the change, bpf_mtap can run without any locks as long as its bpf filter
doesn't match a target packet. Pushing data to a bpf buffer still needs
a lock. Removing the lock requires big changes and it's a future work.

Another known issue is that we need to remain some obsolete variables to
avoid breaking kvm(3) users such as netstat and fstat. One problem for
MP-ification is that in order to keep statistic counters of bpf_d we need
to use atomic operations for them. Once we retire the kvm(3) users, we
should make the counters per-CPU and remove the atomic operations.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/net/bpf.c
cvs rdiff -u -r1.43 -r1.44 src/sys/net/bpfdesc.h
cvs rdiff -u -r1.375 -r1.376 src/sys/net/if.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/bpf.c
diff -u src/sys/net/bpf.c:1.212 src/sys/net/bpf.c:1.213
--- src/sys/net/bpf.c:1.212	Wed Feb  1 08:18:33 2017
+++ src/sys/net/bpf.c	Thu Feb  9 09:30:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.212 2017/02/01 08:18:33 ozaki-r Exp $	*/
+/*	$NetBSD: bpf.c,v 1.213 2017/02/09 09:30:26 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.212 2017/02/01 08:18:33 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.213 2017/02/09 09:30:26 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -77,6 +77,8 @@ __KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.21
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -132,11 +134,48 @@ static struct percpu	*bpf_gstats_percpu;
 	}
 
 /*
+ * Locking notes:
+ * - bpf_mtx (adaptive mutex) protects:
+ *   - Gobal lists: bpf_iflist and bpf_dlist
+ *   - struct bpf_if
+ *   - bpf_close
+ *   - bpf_psz (pserialize)
+ * - struct bpf_d has two mutexes:
+ *   - bd_buf_mtx (spin mutex) protects the buffers that can be accessed
+ * on packet tapping
+ *   - bd_mtx (adaptive mutex) protects member variables other than the buffers
+ * - Locking order: bpf_mtx => bpf_d#bd_mtx => bpf_d#bd_buf_mtx
+ * - struct bpf_d obtained via fp->f_bpf in bpf_read and bpf_write is
+ *   never freed because struct bpf_d is only freed in bpf_close and
+ *   bpf_close never be called while executing bpf_read and bpf_write
+ * - A filter that is assigned to bpf_d can be replaced with another filter
+ *   while tapping packets, so it needs to be done atomically
+ * - struct bpf_d is iterated on bpf_dlist with psz
+ * - struct bpf_if is iterated on bpf_iflist with psz or psref
+ */
+/*
  * Use a mutex to avoid a race condition between gathering the stats/peers
  * and opening/closing the device.
  */
 static kmutex_t bpf_mtx;
 
+static struct psref_class	*bpf_psref_class __read_mostly;
+static pserialize_t		bpf_psz;
+
+static inline void
+bpf_if_acquire(struct bpf_if *bp, struct psref *psref)
+{
+
+	psref_acquire(psref, >bif_psref, bpf_psref_class);
+}
+
+static inline void
+bpf_if_release(struct bpf_if *bp, struct psref *psref)
+{
+
+	psref_release(psref, >bif_psref, bpf_psref_class);
+}
+
 /*
  *  bpf_iflist is the list of interfaces; each corresponds to an ifnet
  *  bpf_dtab holds the descriptors, indexed by minor device #
@@ -201,6 +240,7 @@ static void	bpf_deliver(struct bpf_if *,
 		void *(*cpfn)(void *, const void *, size_t),
 		void *, u_int, u_int, const bool);
 static void	bpf_freed(struct bpf_d *);
+static void	bpf_free_filter(struct bpf_filter *);
 static void	bpf_ifname(struct ifnet *, struct ifreq *);
 static void	*bpf_mcpy(void *, const void *, size_t);
 static int	bpf_movein(struct uio *, int, uint64_t,
@@ -404,7 +444,9 @@ bad:
 static void
 bpf_attachd(struct bpf_d *d, struct bpf_if *bp)
 {
+
 	KASSERT(mutex_owned(_mtx));
+	KASSERT(mutex_owned(d->bd_mtx));
 	/*
 	 * Point d at bp, and add d to the interface's list of listeners.
 	 * Finally, point the driver's bpf cookie at the interface so
@@ -425,6 +467,7 @@ bpf_detachd(struct bpf_d *d)
 	struct bpf_if *bp;
 
 	KASSERT(mutex_owned(_mtx));
+	KASSERT(mutex_owned(d->bd_mtx));
 
 	bp = d->bd_bif;
 	/*
@@ -442,7 +485,13 @@ bpf_detachd(struct bpf_d *d)
 		 * the interface was configured down, so only panic
 		 * if we don't get an unexpected error.
 		 */
+#ifndef NET_MPSAFE
+		KERNEL_LOCK(1, NULL);
+#endif
   		error = ifpromisc(bp->bif_ifp, 0);
+#ifndef NET_MPSAFE
+		KERNEL_UNLOCK_ONE(NULL);
+#endif
 #ifdef DIAGNOSTIC
 		if (error)
 			printf("%s: ifpromisc failed: %d", __func__, error);
@@ -452,11 +501,8 @@ bpf_detachd(struct bpf_d *d)
 	/* Remove d from the interface's descriptor list. */
 	BPFIF_DLIST_WRITER_REMOVE(d);
 
-	/* TODO pserialize_perform(); */
-	/* TODO psref_target_destroy(); */
-	BPFIF_DLIST_ENTRY_DESTROY(d);
+	

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

2017-02-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  9 08:38:25 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
No, do not just copy code from i386 and expect it to work on amd64. There
are several structural differences. At least two issues here: segment
registers that could fault in kernel mode with userland TLS, and a non-
canonical %eip on iret.

Not even tested, but just obvious. By the way, I believe this function is
still buggy since we don't call cpu_fsgs_reload while %fs/%gs could have
been reloaded.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/amd64/amd64/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.101 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.102
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.101	Mon Feb  6 16:34:37 2017
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Thu Feb  9 08:38:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.101 2017/02/06 16:34:37 maxv Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.102 2017/02/09 08:38:25 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.101 2017/02/06 16:34:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.102 2017/02/09 08:38:25 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -531,13 +531,31 @@ netbsd32_process_read_fpregs(struct lwp 
 int
 netbsd32_process_write_regs(struct lwp *l, const struct reg32 *regs)
 {
-	struct trapframe *tf = l->l_md.md_regs;
+	struct trapframe *tf;
+	struct pcb *pcb;
+
+	tf = l->l_md.md_regs;
+	pcb = lwp_getpcb(l);
 
 	/*
-	 * Check for security violations. Taken from i386/process_machdep.c.
+	 * Check for security violations.
 	 */
-	if (((regs->r_eflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
-	!VALID_USER_CSEL32(regs->r_cs))
+	if (((regs->r_eflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0)
+		return EINVAL;
+	if (!VALID_USER_CSEL32(regs->r_cs))
+		return EINVAL;
+	if (regs->r_fs != 0 && !VALID_USER_DSEL32(regs->r_fs) &&
+	!(VALID_USER_FSEL32(regs->r_fs) && pcb->pcb_fs != 0))
+		return EINVAL;
+	if (regs->r_gs != 0 && !VALID_USER_DSEL32(regs->r_gs) &&
+	!(VALID_USER_GSEL32(regs->r_gs) && pcb->pcb_gs != 0))
+		return EINVAL;
+	if (regs->r_es != 0 && !VALID_USER_DSEL32(regs->r_es))
+		return EINVAL;
+	if (!VALID_USER_DSEL32(regs->r_ds) ||
+	!VALID_USER_DSEL32(regs->r_ss))
+		return EINVAL;
+	if (regs->r_eip >= VM_MAXUSER_ADDRESS32)
 		return EINVAL;
 
 	tf->tf_rax = regs->r_eax;



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

2017-02-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  9 08:23:46 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: locore.S

Log Message:
Restore %ds before swapgs. Movs to segment registers are allowed to fault
in kernel mode but simply cause a signal to be sent to userland. The thing
is, in this case %gs is not restored when entering the trap routine, which
means the kernel uses userland's TLS instead of using its own. Which in
short makes it easy to escalate privileges.

Currently, this bug is triggered only in one place, which I am about to
fix too.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/amd64/amd64/locore.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.119 src/sys/arch/amd64/amd64/locore.S:1.120
--- src/sys/arch/amd64/amd64/locore.S:1.119	Thu Feb  2 19:12:09 2017
+++ src/sys/arch/amd64/amd64/locore.S	Thu Feb  9 08:23:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.119 2017/02/02 19:12:09 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.120 2017/02/09 08:23:46 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1310,16 +1310,15 @@ do_syscall:
 	testl	$(MDL_IRET|MDL_COMPAT32),L_MD_FLAGS(%r14)
 	INTR_RESTORE_GPRS
 	movw	TF_ES(%rsp),%es
+	movw	TF_DS(%rsp),%ds
 	SWAPGS
 	jnz	2f
 #ifndef XEN
 	movq	TF_RIP(%rsp),%rcx	/* %rip for sysret */
 	movq	TF_RFLAGS(%rsp),%r11	/* %flags for sysret */
-	movw	TF_DS(%rsp),%ds
 	movq	TF_RSP(%rsp),%rsp
 	sysretq
 #else
-	movw	TF_DS(%rsp),%ds
 	addq	$TF_RIP,%rsp
 	pushq	$256	/* VGCF_IN_SYSCALL */
 	jmp	HYPERVISOR_iret
@@ -1332,7 +1331,6 @@ do_syscall:
  * then a SIGSEGV will be signalled.
  */
 2:
-	movw	TF_DS(%rsp),%ds
 	addq	$TF_RIP,%rsp
 	iretq