CVS commit: [netbsd-7] src/doc

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec 27 07:12:32 UTC 2016

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

Log Message:
1340


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-7.1

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

Modified files:

Index: src/doc/CHANGES-7.1
diff -u src/doc/CHANGES-7.1:1.1.2.139 src/doc/CHANGES-7.1:1.1.2.140
--- src/doc/CHANGES-7.1:1.1.2.139	Mon Dec 26 19:01:18 2016
+++ src/doc/CHANGES-7.1	Tue Dec 27 07:12:32 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1,v 1.1.2.139 2016/12/26 19:01:18 snj Exp $
+# $NetBSD: CHANGES-7.1,v 1.1.2.140 2016/12/27 07:12:32 snj Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1
 release:
@@ -7796,3 +7796,8 @@ sys/net/npf/lpm.c1.2
 	Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().
 	[rmind, ticket #1339]
 
+sys/net/npf/lpm.c1.3
+
+	Fix kmem_free() in hashmap_remove().
+	[rmind, ticket #1340]
+



CVS commit: [netbsd-7] src/doc

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec 27 07:12:32 UTC 2016

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

Log Message:
1340


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-7.1

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



CVS commit: [netbsd-7] src/sys/net/npf

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec 27 07:03:53 UTC 2016

Modified Files:
src/sys/net/npf [netbsd-7]: lpm.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #1340):
sys/net/npf/lpm.c: revision 1.3
Fix kmem_free() in hashmap_remove().


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/net/npf/lpm.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/npf/lpm.c
diff -u src/sys/net/npf/lpm.c:1.1.2.3 src/sys/net/npf/lpm.c:1.1.2.4
--- src/sys/net/npf/lpm.c:1.1.2.3	Mon Dec 26 18:55:08 2016
+++ src/sys/net/npf/lpm.c	Tue Dec 27 07:03:52 2016
@@ -31,7 +31,7 @@
 
 #if defined(_KERNEL)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.3 2016/12/26 18:55:08 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.4 2016/12/27 07:03:52 snj Exp $");
 
 #include 
 #include 
@@ -245,7 +245,7 @@ hashmap_remove(lpm_hmap_t *hmap, const v
 			} else {
 hmap->bucket[i] = entry->next;
 			}
-			free(entry, M_TEMP);
+			kmem_free(entry, offsetof(lpm_ent_t, key[len]));
 			return 0;
 		}
 		prev = entry;



CVS commit: [netbsd-7] src/sys/net/npf

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec 27 07:03:53 UTC 2016

Modified Files:
src/sys/net/npf [netbsd-7]: lpm.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #1340):
sys/net/npf/lpm.c: revision 1.3
Fix kmem_free() in hashmap_remove().


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/net/npf/lpm.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/nvi/dist/docs/vi.man

2016-12-26 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Dec 27 06:50:03 UTC 2016

Modified Files:
src/external/bsd/nvi/dist/docs/vi.man: vi.1

Log Message:
Fix the date (setting the date to the same as the date on which this version 
was imported).

Looks like the '%Q%' was supposed to be translated to an actual date through
some tool but neither the README nor the Makefile say anything. So just
setting the date manually.

ok wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/docs/vi.man/vi.1

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/nvi/dist/docs/vi.man/vi.1
diff -u src/external/bsd/nvi/dist/docs/vi.man/vi.1:1.4 src/external/bsd/nvi/dist/docs/vi.man/vi.1:1.5
--- src/external/bsd/nvi/dist/docs/vi.man/vi.1:1.4	Sat Aug 27 03:34:28 2016
+++ src/external/bsd/nvi/dist/docs/vi.man/vi.1	Tue Dec 27 06:50:03 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vi.1,v 1.4 2016/08/27 03:34:28 dholland Exp $
+.\"	$NetBSD: vi.1,v 1.5 2016/12/27 06:50:03 abhinav Exp $
 .\"
 .\" Copyright (c) 1994
 .\" The Regents of the University of California.  All rights reserved.
@@ -12,7 +12,7 @@
 .\"
 .\" Id: vi.1,v 8.53 2001/01/28 13:20:06 skimo Exp  (Berkeley) Date: 2001/01/28 13:20:06 
 .\"
-.TH VI 1 "%Q%"
+.TH VI 1 "November 22, 2013"
 .UC
 .SH NAME
 ex, vi, view \- text editors



CVS commit: src/external/bsd/nvi/dist/docs/vi.man

2016-12-26 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Dec 27 06:50:03 UTC 2016

Modified Files:
src/external/bsd/nvi/dist/docs/vi.man: vi.1

Log Message:
Fix the date (setting the date to the same as the date on which this version 
was imported).

Looks like the '%Q%' was supposed to be translated to an actual date through
some tool but neither the README nor the Makefile say anything. So just
setting the date manually.

ok wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/docs/vi.man/vi.1

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



CVS commit: src/sys

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 27 04:12:34 UTC 2016

Modified Files:
src/sys/kern: vfs_bio.c
src/sys/sys: biohist.h

Log Message:
Decouple BIOHIST from other users of KERNHIST.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/biohist.h

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

Modified files:

Index: src/sys/kern/vfs_bio.c
diff -u src/sys/kern/vfs_bio.c:1.265 src/sys/kern/vfs_bio.c:1.266
--- src/sys/kern/vfs_bio.c:1.265	Mon Dec 26 23:15:15 2016
+++ src/sys/kern/vfs_bio.c	Tue Dec 27 04:12:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_bio.c,v 1.265 2016/12/26 23:15:15 pgoyette Exp $	*/
+/*	$NetBSD: vfs_bio.c,v 1.266 2016/12/27 04:12:34 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.265 2016/12/26 23:15:15 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.266 2016/12/27 04:12:34 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -199,17 +199,15 @@ static void sysctl_vm_buf_setup(void);
 
 /* Initialization for biohist */
 
-#ifdef BIOHIST
 #include 
-#endif	/* BIOHIST */
 
-KERNHIST_DEFINE(biohist);
+BIOHIST_DEFINE(biohist);
 
 void
 biohist_init(void)
 {
  
-	KERNHIST_INIT(biohist, BIOHIST_SIZE);
+	BIOHIST_INIT(biohist, BIOHIST_SIZE);
 }
 
 /*
@@ -742,7 +740,7 @@ bread(struct vnode *vp, daddr_t blkno, i
 	buf_t *bp;
 	int error;
 
-	KERNHIST_FUNC(__func__); KERNHIST_CALLED(biohist);
+	BIOHIST_FUNC(__func__); BIOHIST_CALLED(biohist);
 
 	/* Get buffer for block. */
 	bp = *bpp = bio_doread(vp, blkno, size, 0);
@@ -772,7 +770,7 @@ breadn(struct vnode *vp, daddr_t blkno, 
 	buf_t *bp;
 	int error, i;
 
-	KERNHIST_FUNC(__func__); KERNHIST_CALLED(biohist);
+	BIOHIST_FUNC(__func__); BIOHIST_CALLED(biohist);
 
 	bp = *bpp = bio_doread(vp, blkno, size, 0);
 	if (bp == NULL)
@@ -816,7 +814,7 @@ bwrite(buf_t *bp)
 	struct vnode *vp;
 	struct mount *mp;
 
-	KERNHIST_FUNC(__func__); KERNHIST_CALLARGS(biohist, "bp=%p",
+	BIOHIST_FUNC(__func__); BIOHIST_CALLARGS(biohist, "bp=%p",
 	bp, 0, 0, 0);
 
 	KASSERT(ISSET(bp->b_cflags, BC_BUSY));
@@ -941,7 +939,7 @@ void
 bdwrite(buf_t *bp)
 {
 
-	KERNHIST_FUNC(__func__); KERNHIST_CALLARGS(biohist, "bp=%p",
+	BIOHIST_FUNC(__func__); BIOHIST_CALLARGS(biohist, "bp=%p",
 	bp, 0, 0, 0);
 
 	KASSERT(bp->b_vp == NULL || bp->b_vp->v_tag != VT_UFS ||
@@ -1523,7 +1521,7 @@ int
 biowait(buf_t *bp)
 {
 
-	KERNHIST_FUNC(__func__);
+	BIOHIST_FUNC(__func__);
 
 	KASSERT(ISSET(bp->b_cflags, BC_BUSY));
 	KASSERT(bp->b_refcnt > 0);
@@ -1532,18 +1530,18 @@ biowait(buf_t *bp)
 
 	mutex_enter(bp->b_objlock);
 
-	KERNHIST_CALLARGS(biohist, "bp=%p, oflags=0x%x",
+	BIOHIST_CALLARGS(biohist, "bp=%p, oflags=0x%x",
 	bp, bp->b_oflags, 0, 0);
 
 	while (!ISSET(bp->b_oflags, BO_DONE | BO_DELWRI)) {
-		KERNHIST_LOG(biohist, "waiting bp=%p", bp, 0, 0, 0);
+		BIOHIST_LOG(biohist, "waiting bp=%p", bp, 0, 0, 0);
 		cv_wait(>b_done, bp->b_objlock);
 	}
 	mutex_exit(bp->b_objlock);
 
 	SDT_PROBE1(io, kernel, , wait__done, bp);
 
-	KERNHIST_LOG(biohist, "  return %d", bp->b_error, 0, 0, 0);
+	BIOHIST_LOG(biohist, "  return %d", bp->b_error, 0, 0, 0);
 
 	return bp->b_error;
 }
@@ -1569,7 +1567,7 @@ biodone(buf_t *bp)
 {
 	int s;
 
-	KERNHIST_FUNC(__func__);
+	BIOHIST_FUNC(__func__);
 
 	KASSERT(!ISSET(bp->b_oflags, BO_DONE));
 
@@ -1578,7 +1576,7 @@ biodone(buf_t *bp)
 		s = splvm();
 		TAILQ_INSERT_TAIL(()->ci_data.cpu_biodone, bp, b_actq);
 
-		KERNHIST_CALLARGS(biohist, "bp=%p, softint scheduled",
+		BIOHIST_CALLARGS(biohist, "bp=%p, softint scheduled",
 		bp, 0, 0, 0);
 		softint_schedule(biodone_sih);
 		splx(s);
@@ -1597,8 +1595,8 @@ biodone2(buf_t *bp)
 
 	SDT_PROBE1(io, kernel, ,done, bp);
 
-	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLARGS(biohist, "bp=%p", bp, 0, 0, 0);
+	BIOHIST_FUNC(__func__);
+	BIOHIST_CALLARGS(biohist, "bp=%p", bp, 0, 0, 0);
 
 	mutex_enter(bp->b_objlock);
 	/* Note that the transfer is done. */
@@ -1613,7 +1611,7 @@ biodone2(buf_t *bp)
 		vwakeup(bp);
 
 	if ((callout = bp->b_iodone) != NULL) {
-		KERNHIST_LOG(biohist, "callout %p", callout, 0, 0, 0);
+		BIOHIST_LOG(biohist, "callout %p", callout, 0, 0, 0);
 
 		/* Note callout done, then call out. */
 		KASSERT(!cv_has_waiters(>b_done));
@@ -1624,13 +1622,13 @@ biodone2(buf_t *bp)
 		KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 	} else if (ISSET(bp->b_flags, B_ASYNC)) {
 		/* If async, release. */
-		KERNHIST_LOG(biohist, "async", 0, 0, 0, 0);
+		BIOHIST_LOG(biohist, "async", 0, 0, 0, 0);
 		KASSERT(!cv_has_waiters(>b_done));
 		mutex_exit(bp->b_objlock);
 		brelse(bp, 0);
 	} else {
 		/* Otherwise just wake up waiters in biowait(). */
-		KERNHIST_LOG(biohist, "wake-up", 0, 0, 0, 0);
+		BIOHIST_LOG(biohist, "wake-up", 0, 0, 0, 0);
 		cv_broadcast(>b_done);
 		

CVS commit: src/sys

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 27 04:12:34 UTC 2016

Modified Files:
src/sys/kern: vfs_bio.c
src/sys/sys: biohist.h

Log Message:
Decouple BIOHIST from other users of KERNHIST.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/biohist.h

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

2016-12-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 03:51:56 UTC 2016

Modified Files:
src/sys/dev/pci: pcireg.h

Log Message:
Fix PASID Control Register.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/pcireg.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/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.117 src/sys/dev/pci/pcireg.h:1.118
--- src/sys/dev/pci/pcireg.h:1.117	Mon Oct 31 05:10:45 2016
+++ src/sys/dev/pci/pcireg.h	Tue Dec 27 03:51:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.117 2016/10/31 05:10:45 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.118 2016/12/27 03:51:55 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1871,9 +1871,9 @@ struct pci_rom {
 #define	PCI_PASID_CAP_PRIVMODE	__BIT(2)	/* Privileged Mode Supported */
 #define	PCI_PASID_CAP_MAXPASIDW	__BITS(12, 8)	/* Max PASID Width */
 #define	PCI_PASID_CTL	0x04	/* Control Register */
-#define	PCI_PASID_CTL_PASID_EN	__BIT(0)	/* PASID Enable */
-#define	PCI_PASID_CTL_XPERM_EN	__BIT(1)	/* Execute Permission Enable */
-#define	PCI_PASID_CTL_PRIVMODE_EN __BIT(2)	/* Privileged Mode Enable */
+#define	PCI_PASID_CTL_PASID_EN	__BIT(0+16)	/* PASID Enable */
+#define	PCI_PASID_CTL_XPERM_EN	__BIT(1+16)	/* Execute Permission Enable */
+#define	PCI_PASID_CTL_PRIVMODE_EN __BIT(2+16)	/* Privileged Mode Enable */
 
 /*
  * Extended capability ID: 0x001c



CVS commit: src/sys/dev/pci

2016-12-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 03:51:56 UTC 2016

Modified Files:
src/sys/dev/pci: pcireg.h

Log Message:
Fix PASID Control Register.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/pcireg.h

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



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

2016-12-26 Thread Hikaru Abe
Module Name:src
Committed By:   hikaru
Date:   Tue Dec 27 03:09:55 UTC 2016

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
Use the correct number of multicast addrs


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/pci/if_vmx.c

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



CVS commit: src/sys/sys

2016-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 27 02:20:46 UTC 2016

Modified Files:
src/sys/sys: siginfo.h

Log Message:
Replace in comment SIGPOLL with SIGIO

SIGPOLL is absent in NetBSD.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/sys/siginfo.h

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



CVS commit: src/share/man/man2

2016-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 27 01:44:06 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Rename SIGPOLL signal to SIGIO in documentation siginfo(2)

SIGPOLL is absent on NetBSD, it's emulated in linux_compat(8).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man2/siginfo.2

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

Modified files:

Index: src/share/man/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.9 src/share/man/man2/siginfo.2:1.10
--- src/share/man/man2/siginfo.2:1.9	Mon Apr  4 20:43:31 2016
+++ src/share/man/man2/siginfo.2	Tue Dec 27 01:44:06 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.9 2016/04/04 20:43:31 wiz Exp $
+.\"	$NetBSD: siginfo.2,v 1.10 2016/12/27 01:44:06 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 4, 2016
+.Dd December 27, 2016
 .Dt SIGINFO 2
 .Os
 .Sh NAME
@@ -229,7 +229,7 @@ Child has stopped
 .It CLD_CONTINUED
 Stopped child has continued
 .El
-.It SIGPOLL
+.It SIGIO
 .Bl -tag -width POLL_OUT
 .It POLL_IN
 Data input available
@@ -286,7 +286,7 @@ the value of
 may be inaccurate.
 .Pp
 For
-.Dv SIGPOLL
+.Dv SIGIO
 the
 .Nm
 structure contains the following additional members:



CVS commit: src/share/man/man2

2016-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 27 01:44:06 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Rename SIGPOLL signal to SIGIO in documentation siginfo(2)

SIGPOLL is absent on NetBSD, it's emulated in linux_compat(8).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man2/siginfo.2

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



CVS commit: src/sys/net

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 27 01:31:06 UTC 2016

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

Log Message:
fix merge conflict.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/net/if_pppoe.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_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.122 src/sys/net/if_pppoe.c:1.123
--- src/sys/net/if_pppoe.c:1.122	Mon Dec 26 18:21:49 2016
+++ src/sys/net/if_pppoe.c	Mon Dec 26 20:31:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.122 2016/12/26 23:21:49 christos Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.123 2016/12/27 01:31:06 christos Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.122 2016/12/26 23:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.123 2016/12/27 01:31:06 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -235,7 +235,7 @@ static struct pppoe_softc * pppoe_find_s
 struct ifnet *, krw_t);
 static struct mbuf *pppoe_get_mbuf(size_t len);
 
-static void pppoe_ifattach_hook(void *, u_long, void *);
+static void pppoe_ifattach_hook(void *, unsigned long, void *);
 
 static LIST_HEAD(pppoe_softc_head, pppoe_softc) pppoe_softc_list;
 static krwlock_t pppoe_softc_list_lock;
@@ -1898,14 +1898,15 @@ pppoe_transmit(struct ifnet *ifp, struct
 }
 #endif /* PPPOE_MPSAFE */
 
-static int
-pppoe_ifattach_hook(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
+static void
+pppoe_ifattach_hook(void *arg, unsigned long cmd, void *arg2)
 {
+	struct ifnet *ifp = arg2;
 	struct pppoe_softc *sc;
 	DECLARE_SPLNET_VARIABLE;
 
-	if (mp != (struct mbuf **)PFIL_IFNET_DETACH)
-		return 0;
+	if (cmd != PFIL_IFNET_DETACH)
+		return;
 
 	ACQUIRE_SPLNET();
 	rw_enter(_softc_list_lock, RW_READER);
@@ -1930,8 +1931,6 @@ pppoe_ifattach_hook(void *arg, struct mb
 	}
 	rw_exit(_softc_list_lock);
 	RELEASE_SPLNET();
-
-	return 0;
 }
 
 static void



CVS commit: src/sys/arch

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 27 01:11:52 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Add BIOHIST (and belatedly, UVMHIST) to the ALL kernels for i386 and amd64.

XXX Perhaps it should be added to others as well?  Perhaps just as comments?


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.409 -r1.410 src/sys/arch/i386/conf/ALL

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/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.47 src/sys/arch/amd64/conf/ALL:1.48
--- src/sys/arch/amd64/conf/ALL:1.47	Fri Dec 23 11:27:10 2016
+++ src/sys/arch/amd64/conf/ALL	Tue Dec 27 01:11:52 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.47 2016/12/23 11:27:10 maya Exp $
+# $NetBSD: ALL,v 1.48 2016/12/27 01:11:52 pgoyette Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.47 $"
+#ident 		"ALL-$Revision: 1.48 $"
 
 maxusers	64		# estimated number of users
 
@@ -125,6 +125,8 @@ options 	SYSCALL_STATS	# per syscall cou
 options 	SYSCALL_TIMES	# per syscall times
 options 	SYSCALL_TIMES_HASCOUNTER	# use 'broken' rdtsc (soekris)
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
+options 	UVMHIST		# kernhist for uvm subsystem
+options 	BIOHIST		# kernhist for buff I/O
 
 # Compatibility options
 #options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.409 src/sys/arch/i386/conf/ALL:1.410
--- src/sys/arch/i386/conf/ALL:1.409	Fri Dec 23 11:27:10 2016
+++ src/sys/arch/i386/conf/ALL	Tue Dec 27 01:11:52 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.409 2016/12/23 11:27:10 maya Exp $
+# $NetBSD: ALL,v 1.410 2016/12/27 01:11:52 pgoyette Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.409 $"
+#ident 		"ALL-$Revision: 1.410 $"
 
 maxusers	64		# estimated number of users
 
@@ -125,6 +125,8 @@ options 	SYSCALL_STATS	# per syscall cou
 options 	SYSCALL_TIMES	# per syscall times
 options 	SYSCALL_TIMES_HASCOUNTER	# use 'broken' rdtsc (soekris)
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
+options 	UVMHIST		# kernhist for uvm subsystem
+options 	BIOHIST		# kernhist for buff I/O
 
 # Compatibility options
 options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI



CVS commit: src/sys/arch

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 27 01:11:52 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Add BIOHIST (and belatedly, UVMHIST) to the ALL kernels for i386 and amd64.

XXX Perhaps it should be added to others as well?  Perhaps just as comments?


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.409 -r1.410 src/sys/arch/i386/conf/ALL

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:59:48 UTC 2016

Modified Files:
src/sys/net/npf: npf_os.c

Log Message:
Convert NPF to the latest pfil(9) changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_os.c

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:59:48 UTC 2016

Modified Files:
src/sys/net/npf: npf_os.c

Log Message:
Convert NPF to the latest pfil(9) changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_os.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/npf/npf_os.c
diff -u src/sys/net/npf/npf_os.c:1.1 src/sys/net/npf/npf_os.c:1.2
--- src/sys/net/npf/npf_os.c:1.1	Mon Dec 26 23:05:06 2016
+++ src/sys/net/npf/npf_os.c	Mon Dec 26 23:59:47 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_os.c,v 1.1 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf_os.c,v 1.2 2016/12/26 23:59:47 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009-2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.1 2016/12/26 23:05:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.2 2016/12/26 23:59:47 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -345,23 +345,20 @@ npfkern_packet_handler(void *arg, struct
 /*
  * npf_ifhook: hook handling interface changes.
  */
-static int
-npf_ifhook(void *arg, struct mbuf **mp, ifnet_t *ifp, int di)
+static void
+npf_ifhook(void *arg, unsigned long cmd, void *arg2)
 {
 	npf_t *npf = npf_getkernctx();
-	u_long cmd = (u_long)mp;
+	ifnet_t *ifp = arg2;
 
-	if (di == PFIL_IFNET) {
-		switch (cmd) {
-		case PFIL_IFNET_ATTACH:
-			npf_ifmap_attach(npf, ifp);
-			break;
-		case PFIL_IFNET_DETACH:
-			npf_ifmap_detach(npf, ifp);
-			break;
-		}
+	switch (cmd) {
+	case PFIL_IFNET_ATTACH:
+		npf_ifmap_attach(npf, ifp);
+		break;
+	case PFIL_IFNET_DETACH:
+		npf_ifmap_detach(npf, ifp);
+		break;
 	}
-	return 0;
 }
 
 /*
@@ -383,8 +380,7 @@ npf_pfil_register(bool init)
 			error = ENOENT;
 			goto out;
 		}
-		error = pfil_add_hook(npf_ifhook, NULL,
-		PFIL_IFADDR | PFIL_IFNET, npf_ph_if);
+		error = pfil_add_ihook(npf_ifhook, NULL, PFIL_IFNET, npf_ph_if);
 		KASSERT(error == 0);
 	}
 	if (init) {
@@ -436,8 +432,7 @@ npf_pfil_unregister(bool fini)
 	KERNEL_LOCK(1, NULL);
 
 	if (fini && npf_ph_if) {
-		(void)pfil_remove_hook(npf_ifhook, NULL,
-		PFIL_IFADDR | PFIL_IFNET, npf_ph_if);
+		(void)pfil_remove_ihook(npf_ifhook, NULL, PFIL_IFNET, npf_ph_if);
 	}
 	if (npf_ph_inet) {
 		(void)pfil_remove_hook(npfkern_packet_handler, npf,



CVS commit: src/sys/kern

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:49:53 UTC 2016

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

Log Message:
#include giohist.h from proper location


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_history.c

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

Modified files:

Index: src/sys/kern/kern_history.c
diff -u src/sys/kern/kern_history.c:1.7 src/sys/kern/kern_history.c:1.8
--- src/sys/kern/kern_history.c:1.7	Mon Dec 26 23:12:33 2016
+++ src/sys/kern/kern_history.c	Mon Dec 26 23:49:53 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_history.c,v 1.7 2016/12/26 23:12:33 pgoyette Exp $	 */
+/*	$NetBSD: kern_history.c,v 1.8 2016/12/26 23:49:53 pgoyette Exp $	 */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.7 2016/12/26 23:12:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.8 2016/12/26 23:49:53 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
@@ -56,7 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_history
 #endif
 
 #ifdef BIOHIST
-#include 
+#include 
 #endif
 
 #ifdef SYSCALL_DEBUG



CVS commit: src/sys/kern

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:49:53 UTC 2016

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

Log Message:
#include giohist.h from proper location


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_history.c

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:39:18 UTC 2016

Modified Files:
src/sys/net/npf: npf.h

Log Message:
Bump NPF_VERSION to 19.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/net/npf/npf.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/net/npf/npf.h
diff -u src/sys/net/npf/npf.h:1.52 src/sys/net/npf/npf.h:1.53
--- src/sys/net/npf/npf.h:1.52	Mon Dec 26 23:05:06 2016
+++ src/sys/net/npf/npf.h	Mon Dec 26 23:39:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.h,v 1.52 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf.h,v 1.53 2016/12/26 23:39:18 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-#define	NPF_VERSION		18
+#define	NPF_VERSION		19
 
 #if defined(_NPF_STANDALONE)
 #include "npf_stand.h"



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:39:18 UTC 2016

Modified Files:
src/sys/net/npf: npf.h

Log Message:
Bump NPF_VERSION to 19.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/net/npf/npf.h

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



CVS commit: src/sys

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 26 23:21:49 UTC 2016

Modified Files:
src/sys/dist/pf/net: pf_if.c
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c
src/sys/net: if.c if_pppoe.c if_spppsubr.c pfil.c pfil.h

Log Message:
pfil(9) improvements to handle address changes:

Add:
  PFIL_IFADDR call on interface reconfig (mbuf is ioctl #)
  PFIL_IFNET  call on interface attach/detach (mbuf is PFIL_IFNET_*)

from rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dist/pf/net/pf_if.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.368 -r1.369 src/sys/net/if.c
cvs rdiff -u -r1.121 -r1.122 src/sys/net/if_pppoe.c
cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.28 -r1.29 src/sys/net/pfil.c
cvs rdiff -u -r1.31 -r1.32 src/sys/net/pfil.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/dist/pf/net/pf_if.c
diff -u src/sys/dist/pf/net/pf_if.c:1.31 src/sys/dist/pf/net/pf_if.c:1.32
--- src/sys/dist/pf/net/pf_if.c:1.31	Wed Jul 20 03:37:51 2016
+++ src/sys/dist/pf/net/pf_if.c	Mon Dec 26 18:21:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf_if.c,v 1.31 2016/07/20 07:37:51 ozaki-r Exp $	*/
+/*	$NetBSD: pf_if.c,v 1.32 2016/12/26 23:21:49 christos Exp $	*/
 /*	$OpenBSD: pf_if.c,v 1.47 2007/07/13 09:17:48 markus Exp $ */
 
 /*
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pf_if.c,v 1.31 2016/07/20 07:37:51 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf_if.c,v 1.32 2016/12/26 23:21:49 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -87,8 +87,8 @@ int		 pfi_unmask(void *);
 void		 pfi_init_groups(struct ifnet *);
 void		 pfi_destroy_groups(struct ifnet *);
 
-int		 pfil_ifnet_wrapper(void *, struct mbuf **, struct ifnet *, int);
-int		 pfil_ifaddr_wrapper(void *, struct mbuf **, struct ifnet *, int);
+void		 pfil_ifnet_wrapper(void *, u_long, void *);
+void		 pfil_ifaddr_wrapper(void *, u_long, void *);
 #endif
 
 RB_PROTOTYPE(pfi_ifhead, pfi_kif, pfik_tree, pfi_if_compare);
@@ -138,8 +138,8 @@ pfi_initialize(void)
 	pserialize_read_exit(s);
 	curlwp_bindx(bound);
 
-	pfil_add_hook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
-	pfil_add_hook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
+	pfil_add_ihook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
+	pfil_add_ihook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
 #endif /* __NetBSD__ */
 }
 
@@ -152,8 +152,8 @@ pfi_destroy(void)
 	int s;
 	int bound;
 
-	pfil_remove_hook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
-	pfil_remove_hook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
+	pfil_remove_ihook(pfil_ifaddr_wrapper, NULL, PFIL_IFADDR, if_pfil);
+	pfil_remove_ihook(pfil_ifnet_wrapper, NULL, PFIL_IFNET, if_pfil);
 
 	bound = curlwp_bind();
 	s = pserialize_read_enter();
@@ -885,10 +885,10 @@ pfi_destroy_groups(struct ifnet *ifp)
 	if_destroy_groups(ifp);
 }
 
-int
-pfil_ifnet_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
+void
+pfil_ifnet_wrapper(void *arg, u_long cmd, void *arg2)
 {
-	u_long cmd = (u_long)mp;
+	ifnet_t *ifp = arg2;
 
 	switch (cmd) {
 	case PFIL_IFNET_ATTACH:
@@ -904,14 +904,12 @@ pfil_ifnet_wrapper(void *arg, struct mbu
 	default:
 		panic("pfil_ifnet_wrapper: unexpected cmd %lu", cmd);
 	}
-
-	return (0);
 }
 
-int
-pfil_ifaddr_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
+void
+pfil_ifaddr_wrapper(void *arg, u_long cmd, void *arg2)
 {
-	u_long cmd = (u_long)mp;
+	struct ifaddr *ifa = arg2;
 
 	switch (cmd) {
 	case SIOCSIFADDR:
@@ -921,12 +919,10 @@ pfil_ifaddr_wrapper(void *arg, struct mb
 	case SIOCAIFADDR_IN6:
 	case SIOCDIFADDR_IN6:
 #endif /* INET6 */
-		pfi_kifaddr_update(ifp->if_pf_kif);
+		pfi_kifaddr_update(ifa->ifa_ifp->if_pf_kif);
 		break;
 	default:
 		panic("pfil_ifaddr_wrapper: unexpected ioctl %lu", cmd);
 	}
-
-	return (0);
 }
 #endif /* __NetBSD__ */

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.19 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.20
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.19	Thu Dec  8 00:16:33 2016
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Mon Dec 26 18:21:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.19 2016/12/08 05:16:33 ozaki-r Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.20 2016/12/26 23:21:49 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.19 2016/12/08 05:16:33 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.20 2016/12/26 23:21:49 christos Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 

CVS commit: src/sys

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 26 23:21:49 UTC 2016

Modified Files:
src/sys/dist/pf/net: pf_if.c
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c
src/sys/net: if.c if_pppoe.c if_spppsubr.c pfil.c pfil.h

Log Message:
pfil(9) improvements to handle address changes:

Add:
  PFIL_IFADDR call on interface reconfig (mbuf is ioctl #)
  PFIL_IFNET  call on interface attach/detach (mbuf is PFIL_IFNET_*)

from rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dist/pf/net/pf_if.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.368 -r1.369 src/sys/net/if.c
cvs rdiff -u -r1.121 -r1.122 src/sys/net/if_pppoe.c
cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.28 -r1.29 src/sys/net/pfil.c
cvs rdiff -u -r1.31 -r1.32 src/sys/net/pfil.h

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



CVS commit: src/sys/kern

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:15:15 UTC 2016

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

Log Message:
Fix locking so we don't release the lock between the time we check the
tailq (for being non-empty) and the time we remove an entry.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/kern/vfs_bio.c

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

Modified files:

Index: src/sys/kern/vfs_bio.c
diff -u src/sys/kern/vfs_bio.c:1.264 src/sys/kern/vfs_bio.c:1.265
--- src/sys/kern/vfs_bio.c:1.264	Mon Dec 26 23:12:33 2016
+++ src/sys/kern/vfs_bio.c	Mon Dec 26 23:15:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_bio.c,v 1.264 2016/12/26 23:12:33 pgoyette Exp $	*/
+/*	$NetBSD: vfs_bio.c,v 1.265 2016/12/26 23:15:15 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.264 2016/12/26 23:12:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.265 2016/12/26 23:15:15 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -1647,17 +1647,20 @@ biointr(void *cookie)
 
 	ci = curcpu();
 
+	s = splvm();
 	while (!TAILQ_EMPTY(>ci_data.cpu_biodone)) {
 		KASSERT(curcpu() == ci);
 
-		s = splvm();
 		bp = TAILQ_FIRST(>ci_data.cpu_biodone);
 		TAILQ_REMOVE(>ci_data.cpu_biodone, bp, b_actq);
 		splx(s);
 
 		KERNHIST_LOG(biohist, "bp=%p", bp, 0, 0, 0);
 		biodone2(bp);
+
+		s = splvm();
 	}
+	splx(s);
 }
 
 /*



CVS commit: src/sys/kern

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:15:15 UTC 2016

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

Log Message:
Fix locking so we don't release the lock between the time we check the
tailq (for being non-empty) and the time we remove an entry.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/kern/vfs_bio.c

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



CVS commit: src

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:12:34 UTC 2016

Modified Files:
src/share/man/man4: ddb.4 options.4
src/sys/conf: files
src/sys/kern: init_main.c kern_history.c vfs_bio.c
src/sys/sys: buf.h kernhist.h
Added Files:
src/sys/sys: biohist.h

Log Message:
Add a BIOHIST option.  As mentioned on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/share/man/man4/ddb.4
cvs rdiff -u -r1.457 -r1.458 src/share/man/man4/options.4
cvs rdiff -u -r1.1167 -r1.1168 src/sys/conf/files
cvs rdiff -u -r1.487 -r1.488 src/sys/kern/init_main.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/kern_history.c
cvs rdiff -u -r1.263 -r1.264 src/sys/kern/vfs_bio.c
cvs rdiff -u -r0 -r1.1 src/sys/sys/biohist.h
cvs rdiff -u -r1.125 -r1.126 src/sys/sys/buf.h
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/kernhist.h

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

Modified files:

Index: src/share/man/man4/ddb.4
diff -u src/share/man/man4/ddb.4:1.161 src/share/man/man4/ddb.4:1.162
--- src/share/man/man4/ddb.4:1.161	Wed Apr 13 00:47:01 2016
+++ src/share/man/man4/ddb.4	Mon Dec 26 23:12:33 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.161 2016/04/13 00:47:01 ozaki-r Exp $
+.\"	$NetBSD: ddb.4,v 1.162 2016/12/26 23:12:33 pgoyette Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -749,6 +749,8 @@ This command is available only if a kern
 or
 .Cd options USB_DEBUG
 (or related options) or
+.Cd options BIOHIST
+or
 .Cd options UVMHIST .
 .It Ic show vnode Ns Oo Cm /f Oc Ar address
 Print the vnode at

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.457 src/share/man/man4/options.4:1.458
--- src/share/man/man4/options.4:1.457	Tue Dec 13 11:00:20 2016
+++ src/share/man/man4/options.4	Mon Dec 26 23:12:33 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.457 2016/12/13 11:00:20 wiz Exp $
+.\"	$NetBSD: options.4,v 1.458 2016/12/26 23:12:33 pgoyette Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -711,6 +711,32 @@ The default is 100.
 This option depends upon the
 .Em UVMHIST
 option.
+.It Cd options BIOHIST
+Like
+.Em KERNHIST ,
+it enables the BIO history logs.
+These logs can be displayed by using
+.Cm show kernhist
+from DDB.
+See the kernel source file
+.Pa sys/kern/vfs_vio.c
+for details.
+.It Cd options BIOHIST_PRINT
+Like
+.Em BIOHIST ,
+it prints the BIO history logs on the system console as entries are added.
+Note that the output is
+.Em extremely
+voluminous, so this option is really only useful for debugging
+the very earliest parts of kernel initialization.
+.It Cd options BIOHIST_SIZE
+Set the size of the
+.Dq biohist
+kernel history.
+The default is 500.
+This option depends upon the
+.Em BIOHIST
+option.
 .El
 .Ss File Systems
 .Bl -ohang

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1167 src/sys/conf/files:1.1168
--- src/sys/conf/files:1.1167	Tue Dec 13 20:20:34 2016
+++ src/sys/conf/files	Mon Dec 26 23:12:33 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1167 2016/12/13 20:20:34 christos Exp $
+#	$NetBSD: files,v 1.1168 2016/12/26 23:12:33 pgoyette Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20150846
@@ -39,6 +39,7 @@ defflag	opt_pipe.h		PIPE_SOCKETPAIR PIPE
 
 defflagAIO
 defflagMQUEUE
+defflagSEMAPHORE
 
 defflagBUFQ_DISKSORT
 defflagBUFQ_FCFS
@@ -201,6 +202,13 @@ defflag	opt_usb.h			USB_DEBUG: KERNHIST
 defparam opt_usb.h			USBHIST_SIZE
 
 #
+# Options for BIOHIST
+#
+defflag opt_biohist.h   BIOHIST: KERNHIST
+defflag opt_biohist.h   BIOHIST_PRINT: KERNHIST_PRINT
+defparam opt_biohist.h  BIOHIST_SIZE
+
+#
 # System monitoring framework
 #
 include "dev/sysmon/files.sysmon"
@@ -1507,6 +1515,7 @@ include "miscfs/procfs/files.procfs"
 include "miscfs/umapfs/files.umapfs"
 include "nfs/files.nfs"
 include "ufs/files.ufs"
+include "fs/nfs/files.newnfs"
 
 #
 # UVM (virtual memory)

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.487 src/sys/kern/init_main.c:1.488
--- src/sys/kern/init_main.c:1.487	Wed Nov 16 12:31:33 2016
+++ src/sys/kern/init_main.c	Mon Dec 26 23:12:33 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.487 2016/11/16 12:31:33 pgoyette Exp $	*/
+/*	$NetBSD: init_main.c,v 1.488 2016/12/26 23:12:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.487 2016/11/16 12:31:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.488 2016/12/26 23:12:33 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -349,6 +349,7 @@ main(void)
 
 	/* Initialize the buffer cache */
 	bufinit();
+	biohist_init();
 
 
 #if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_IMAGE)

Index: src/sys/kern/kern_history.c
diff -u src/sys/kern/kern_history.c:1.6 

CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:10:46 UTC 2016

Modified Files:
src/sys/net/npf: npf_state_tcp.c

Log Message:
npf_tcp_fsm: fix for the NPF_TCPS_SYN_RECEIVED state.

SYN re-transmission after SYN-ACK was seen by NPF should not terminate
the connection.  Thanks to: Alexander Kiselev 


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/npf/npf_state_tcp.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/npf/npf_state_tcp.c
diff -u src/sys/net/npf/npf_state_tcp.c:1.17 src/sys/net/npf/npf_state_tcp.c:1.18
--- src/sys/net/npf/npf_state_tcp.c:1.17	Mon Dec 26 23:05:06 2016
+++ src/sys/net/npf/npf_state_tcp.c	Mon Dec 26 23:10:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_state_tcp.c,v 1.17 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf_state_tcp.c,v 1.18 2016/12/26 23:10:46 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_state_tcp.c,v 1.17 2016/12/26 23:05:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_state_tcp.c,v 1.18 2016/12/26 23:10:46 rmind Exp $");
 
 #include 
 #include 
@@ -192,6 +192,8 @@ static const uint8_t npf_tcp_fsm[NPF_TCP
 			[TCPFC_ACK]	= NPF_TCPS_ESTABLISHED,
 			/* FIN may be sent early. */
 			[TCPFC_FIN]	= NPF_TCPS_FIN_SENT,
+			/* Late SYN re-transmission. */
+			[TCPFC_SYN]	= NPF_TCPS_OK,
 		},
 		[NPF_FLOW_BACK] = {
 			/* SYN-ACK may be retransmitted. */



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 23:10:46 UTC 2016

Modified Files:
src/sys/net/npf: npf_state_tcp.c

Log Message:
npf_tcp_fsm: fix for the NPF_TCPS_SYN_RECEIVED state.

SYN re-transmission after SYN-ACK was seen by NPF should not terminate
the connection.  Thanks to: Alexander Kiselev 


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/npf/npf_state_tcp.c

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



CVS commit: src

2016-12-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 26 23:12:34 UTC 2016

Modified Files:
src/share/man/man4: ddb.4 options.4
src/sys/conf: files
src/sys/kern: init_main.c kern_history.c vfs_bio.c
src/sys/sys: buf.h kernhist.h
Added Files:
src/sys/sys: biohist.h

Log Message:
Add a BIOHIST option.  As mentioned on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/share/man/man4/ddb.4
cvs rdiff -u -r1.457 -r1.458 src/share/man/man4/options.4
cvs rdiff -u -r1.1167 -r1.1168 src/sys/conf/files
cvs rdiff -u -r1.487 -r1.488 src/sys/kern/init_main.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/kern_history.c
cvs rdiff -u -r1.263 -r1.264 src/sys/kern/vfs_bio.c
cvs rdiff -u -r0 -r1.1 src/sys/sys/biohist.h
cvs rdiff -u -r1.125 -r1.126 src/sys/sys/buf.h
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/kernhist.h

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



CVS commit: src

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 26 23:05:06 UTC 2016

Modified Files:
src/lib/libnpf: npf.c npf.h
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h
src/sys/net/npf: files.npf if_npflog.c npf.c npf.h npf_alg.c
npf_alg_icmp.c npf_bpf.c npf_conf.c npf_conn.c npf_conn.h
npf_conndb.c npf_ctl.c npf_ext_log.c npf_ext_normalize.c
npf_ext_rndblock.c npf_handler.c npf_if.c npf_impl.h npf_inet.c
npf_mbuf.c npf_nat.c npf_rproc.c npf_ruleset.c npf_sendpkt.c
npf_state.c npf_state_tcp.c npf_tableset.c npf_worker.c
src/sys/rump/net/lib/libnpf: Makefile
src/usr.sbin/npf/npfctl: npf_bpf_comp.c npf_build.c npf_data.c
npf_show.c npfctl.c npfctl.h
src/usr.sbin/npf/npftest: npfstream.c npftest.c npftest.h
src/usr.sbin/npf/npftest/libnpftest: npf_bpf_test.c npf_mbuf_subr.c
npf_nat_test.c npf_nbuf_test.c npf_perf_test.c npf_rule_test.c
npf_state_test.c npf_table_test.c npf_test.h npf_test_subr.c
Added Files:
src/sys/net/npf: npf_os.c npfkern.h

Log Message:
Sync NPF with the version on github: backport standalone NPF changes,
which allow us to create and run separate NPF instances. Minor fixes.
(from rmind@)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libnpf/npf.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libnpf/npf.h
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_ioctl.h
cvs rdiff -u -r1.18 -r1.19 src/sys/net/npf/files.npf
cvs rdiff -u -r1.3 -r1.4 src/sys/net/npf/if_npflog.c \
src/sys/net/npf/npf_ext_normalize.c
cvs rdiff -u -r1.32 -r1.33 src/sys/net/npf/npf.c
cvs rdiff -u -r1.51 -r1.52 src/sys/net/npf/npf.h
cvs rdiff -u -r1.15 -r1.16 src/sys/net/npf/npf_alg.c \
src/sys/net/npf/npf_sendpkt.c
cvs rdiff -u -r1.23 -r1.24 src/sys/net/npf/npf_alg_icmp.c
cvs rdiff -u -r1.11 -r1.12 src/sys/net/npf/npf_bpf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/net/npf/npf_conf.c \
src/sys/net/npf/npf_ext_log.c
cvs rdiff -u -r1.21 -r1.22 src/sys/net/npf/npf_conn.c
cvs rdiff -u -r1.10 -r1.11 src/sys/net/npf/npf_conn.h
cvs rdiff -u -r1.2 -r1.3 src/sys/net/npf/npf_conndb.c
cvs rdiff -u -r1.44 -r1.45 src/sys/net/npf/npf_ctl.c
cvs rdiff -u -r1.5 -r1.6 src/sys/net/npf/npf_ext_rndblock.c
cvs rdiff -u -r1.34 -r1.35 src/sys/net/npf/npf_handler.c
cvs rdiff -u -r1.6 -r1.7 src/sys/net/npf/npf_if.c
cvs rdiff -u -r1.63 -r1.64 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.35 -r1.36 src/sys/net/npf/npf_inet.c
cvs rdiff -u -r1.17 -r1.18 src/sys/net/npf/npf_mbuf.c \
src/sys/net/npf/npf_state.c
cvs rdiff -u -r1.40 -r1.41 src/sys/net/npf/npf_nat.c
cvs rdiff -u -r0 -r1.1 src/sys/net/npf/npf_os.c src/sys/net/npf/npfkern.h
cvs rdiff -u -r1.13 -r1.14 src/sys/net/npf/npf_rproc.c
cvs rdiff -u -r1.42 -r1.43 src/sys/net/npf/npf_ruleset.c
cvs rdiff -u -r1.16 -r1.17 src/sys/net/npf/npf_state_tcp.c
cvs rdiff -u -r1.24 -r1.25 src/sys/net/npf/npf_tableset.c
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_worker.c
cvs rdiff -u -r1.18 -r1.19 src/sys/rump/net/lib/libnpf/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npfctl/npf_bpf_comp.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/npf/npfctl/npf_build.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/npf/npfctl/npf_data.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/npf/npfctl/npf_show.c
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/npf/npfctl/npfctl.c
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/npf/npfctl/npfctl.h
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npftest/npfstream.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/npf/npftest/npftest.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/npf/npftest/npftest.h
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/npf/npftest/libnpftest/npf_mbuf_subr.c \
src/usr.sbin/npf/npftest/libnpftest/npf_nbuf_test.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c
cvs rdiff -u -r1.12 -r1.13 \
src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npftest/libnpftest/npf_state_test.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/libnpftest/npf_table_test.c
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/npf/npftest/libnpftest/npf_test.h
cvs rdiff -u -r1.11 -r1.12 \
src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.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/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 21:54:00 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Remove wrong comment which was copy-and-pasted from somewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/powerpc/ibm4xx/trap.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/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 21:54:00 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Remove wrong comment which was copy-and-pasted from somewhere.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/powerpc/ibm4xx/trap.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/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.68 src/sys/arch/powerpc/ibm4xx/trap.c:1.69
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.68	Fri Dec 16 06:29:11 2016
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Mon Dec 26 21:54:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.68 2016/12/16 06:29:11 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.69 2016/12/26 21:54:00 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.68 2016/12/16 06:29:11 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2016/12/26 21:54:00 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -172,10 +172,6 @@ trap(struct trapframe *tf)
 		trapsignal(l, );
 		break;
 
-	/*
-	 * If we could not find and install appropriate TLB entry, fall through.
-	 */
-
 	case EXC_DSI:
 		/* FALLTHROUGH */
 	case EXC_DTMISS:



CVS commit: src/sys/arch/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 21:25:08 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c

Log Message:
Assert that the size of a trap handler does not exceed its room.

XXX
The debug exception is critical for ibm4xx. Since rev 1.24, we use the critical
trap hundler for it. Sorry for the wrong commit log for rev 1.24.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/ibm4xx_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/powerpc/ibm4xx/ibm4xx_machdep.c
diff -u src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.24 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.25
--- src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.24	Mon Dec 26 20:28:00 2016
+++ src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c	Mon Dec 26 21:25:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $	*/
+/*	$NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $	*/
 /*	Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -193,6 +193,7 @@ ibm4xx_init(vaddr_t startkernel, vaddr_t
 	}
 
 	for (size_t i = 0; i < __arraycount(trap_table); i++) {
+		KASSERT(trap_table[i].exc_size <= 0x100);
 		trap_copy(trap_table[i].exc_addr, trap_table[i].exc_vector,
 		trap_table[i].exc_size);
 	}



CVS commit: src/sys/arch/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 21:25:08 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c

Log Message:
Assert that the size of a trap handler does not exceed its room.

XXX
The debug exception is critical for ibm4xx. Since rev 1.24, we use the critical
trap hundler for it. Sorry for the wrong commit log for rev 1.24.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 21:16:06 UTC 2016

Modified Files:
src/sys/net/npf: lpm.c

Log Message:
Fix kmem_free() in hashmap_remove().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/net/npf/lpm.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/npf/lpm.c
diff -u src/sys/net/npf/lpm.c:1.2 src/sys/net/npf/lpm.c:1.3
--- src/sys/net/npf/lpm.c:1.2	Mon Dec 26 12:44:10 2016
+++ src/sys/net/npf/lpm.c	Mon Dec 26 21:16:06 2016
@@ -31,7 +31,7 @@
 
 #if defined(_KERNEL)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.2 2016/12/26 12:44:10 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.3 2016/12/26 21:16:06 rmind Exp $");
 
 #include 
 #include 
@@ -245,7 +245,7 @@ hashmap_remove(lpm_hmap_t *hmap, const v
 			} else {
 hmap->bucket[i] = entry->next;
 			}
-			free(entry, M_TEMP);
+			kmem_free(entry, offsetof(lpm_ent_t, key[len]));
 			return 0;
 		}
 		prev = entry;



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 21:16:06 UTC 2016

Modified Files:
src/sys/net/npf: lpm.c

Log Message:
Fix kmem_free() in hashmap_remove().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/net/npf/lpm.c

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



CVS commit: src/bin/ps

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 20:52:39 UTC 2016

Modified Files:
src/bin/ps: ps.c

Log Message:
simplify logic; there must be no CPU usage when p_swtime is zero


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/ps/ps.c

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

Modified files:

Index: src/bin/ps/ps.c
diff -u src/bin/ps/ps.c:1.87 src/bin/ps/ps.c:1.88
--- src/bin/ps/ps.c:1.87	Fri Dec  2 21:59:03 2016
+++ src/bin/ps/ps.c	Mon Dec 26 20:52:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ps.c,v 1.87 2016/12/02 21:59:03 christos Exp $	*/
+/*	$NetBSD: ps.c,v 1.88 2016/12/26 20:52:39 rin Exp $	*/
 
 /*
  * Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)ps.c	8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: ps.c,v 1.87 2016/12/02 21:59:03 christos Exp $");
+__RCSID("$NetBSD: ps.c,v 1.88 2016/12/26 20:52:39 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -611,8 +611,7 @@ setpinfo(struct kinfo_proc2 *ki, int nen
 		pi[i].ki = [i];
 		if (!calc_pcpu)
 			continue;
-		if (ki[i].p_realstat == SZOMB ||
-		(!rawcpu && ki[i].p_swtime == 0)) {
+		if (ki[i].p_swtime == 0 || ki[i].p_realstat == SZOMB) {
 			pi[i].pcpu = 0.0;
 			continue;
 		}



CVS commit: src/bin/ps

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 20:52:39 UTC 2016

Modified Files:
src/bin/ps: ps.c

Log Message:
simplify logic; there must be no CPU usage when p_swtime is zero


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/ps/ps.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/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 20:28:00 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c trap_subr.S

Log Message:
No need to have same trap handlers in trap_subr.S.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/trap_subr.S

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 20:28:00 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c trap_subr.S

Log Message:
No need to have same trap handlers in trap_subr.S.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/trap_subr.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/powerpc/ibm4xx/ibm4xx_machdep.c
diff -u src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.23 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.24
--- src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.23	Mon Dec 26 20:16:29 2016
+++ src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c	Mon Dec 26 20:28:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibm4xx_machdep.c,v 1.23 2016/12/26 20:16:29 rin Exp $	*/
+/*	$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $	*/
 /*	Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.23 2016/12/26 20:16:29 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -123,14 +123,11 @@ void *startsym, *endsym;
  */
 extern const uint32_t defaulttrap[], defaultsize;
 extern const uint32_t sctrap[], scsize;
-extern const uint32_t alitrap[], alisize;
-extern const uint32_t dsitrap[], dsisize;
-extern const uint32_t isitrap[], isisize;
-extern const uint32_t mchktrap[], mchksize;
+extern const uint32_t accesstrap[], accesssize;
+extern const uint32_t criticaltrap[], criticalsize;
 extern const uint32_t tlbimiss4xx[], tlbim4size;
 extern const uint32_t tlbdmiss4xx[], tlbdm4size;
 extern const uint32_t pitfitwdog[], pitfitwdogsize;
-extern const uint32_t debugtrap[], debugsize;
 extern const uint32_t errata51handler[], errata51size;
 #if defined(DDB)
 extern const uint32_t ddblow[], ddbsize;
@@ -139,14 +136,13 @@ extern const uint32_t ipkdblow[], ipkdbs
 #endif
 static const struct exc_info trap_table[] = {
 	{ EXC_SC,	sctrap,		(uintptr_t) },
-	{ EXC_ALI,	alitrap,	(uintptr_t) },
-	{ EXC_DSI,	dsitrap,	(uintptr_t) },
-	{ EXC_ISI,	isitrap,	(uintptr_t) },
-	{ EXC_MCHK,	mchktrap,	(uintptr_t) },
+	{ EXC_ALI,	accesstrap,	(uintptr_t) },
+	{ EXC_DSI,	accesstrap,	(uintptr_t) },
+	{ EXC_MCHK,	criticaltrap,	(uintptr_t) },
 	{ EXC_ITMISS,	tlbimiss4xx,	(uintptr_t) },
 	{ EXC_DTMISS,	tlbdmiss4xx,	(uintptr_t) },
 	{ EXC_PIT,	pitfitwdog,	(uintptr_t) },
-	{ EXC_DEBUG,	debugtrap,	(uintptr_t) },
+	{ EXC_DEBUG,	criticaltrap,	(uintptr_t) },
 	{ (EXC_DTMISS|EXC_ALI),
 			errata51handler, (uintptr_t) },
 #if defined(DDB)

Index: src/sys/arch/powerpc/ibm4xx/trap_subr.S
diff -u src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.24 src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.25
--- src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.24	Sat Feb  9 11:22:51 2013
+++ src/sys/arch/powerpc/ibm4xx/trap_subr.S	Mon Dec 26 20:28:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.24 2013/02/09 11:22:51 kiyohara Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.25 2016/12/26 20:28:00 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -105,7 +105,7 @@
 	mfcr	%r29;			/* save CR */		\
 	mfdear	%r30;		\
 	mfesr	%r31;		\
-	stmw	%r30,(savearea+CPUSAVE_DEAR)(%r1);		\
+	stmw	%r30,(savearea+CPUSAVE_DEAR)(%r1); /* save esr/dear */ \
 	mfsrr0	%r30;		\
 	mfsrr1	%r31; /* Test whether we already had PR set */	\
 	stmw	%r30,(savearea+CPUSAVE_SRR0)(%r1); /* save srr0/srr1 */	\
@@ -172,18 +172,10 @@ _C_LABEL(name ## size) = .-_C_LABEL(name
 	addi	%r1,%r1,USPACE-CALLFRAMELEN; /* stack is top of user struct */ \
 1:
 
-/*
- * This code gets copied to all the trap vectors
- * (except ISI/DSI, ALI, the interrupts, and possibly the debugging
- * traps when using IPKDB).
- */
 	.text
 	STANDARD_EXC_HANDLER(default)
-	ACCESS_EXC_HANDLER(ali)
-	ACCESS_EXC_HANDLER(dsi)
-	ACCESS_EXC_HANDLER(isi)
-	STANDARD_EXC_HANDLER(debug)
-	CRITICAL_EXC_HANDLER(mchk)
+	ACCESS_EXC_HANDLER(access)
+	CRITICAL_EXC_HANDLER(critical)
 
 /*
  * This one for the external interrupt handler.
@@ -258,7 +250,8 @@ _C_LABEL(ipkdbsize) = .-_C_LABEL(ipkdblo
 /*
  * FRAME_SETUP assumes:
  *	SPRG1		SP (r1)
- *	savearea	r28-r31,DEAR,ESR,SRR0,SRR1 (DEAR & ESR only for DSI traps)
+ *	savearea	r28-r31,DEAR,ESR,SRR0,SRR1
+ *			(DEAR & ESR only for access traps)
  *	%r28		LR
  *	%r29		CR
  *	%r1		kernel stack



CVS commit: src/sys/arch/powerpc/ibm4xx

2016-12-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Dec 26 20:16:29 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c

Log Message:
We cannot have DDB and IPKDB at the same time.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.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/ia64/ia64

2016-12-26 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Dec 26 19:46:59 UTC 2016

Modified Files:
src/sys/arch/ia64/ia64: context.S

Log Message:
Fix some comments and add new comment explaining probable bug in 
cpu_switchto().  Not sure of a fix for it yet


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/context.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/ia64/ia64/context.S
diff -u src/sys/arch/ia64/ia64/context.S:1.6 src/sys/arch/ia64/ia64/context.S:1.7
--- src/sys/arch/ia64/ia64/context.S:1.6	Fri Aug  5 16:46:56 2016
+++ src/sys/arch/ia64/ia64/context.S	Mon Dec 26 19:46:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: context.S,v 1.6 2016/08/05 16:46:56 scole Exp $	*/
+/*	$NetBSD: context.S,v 1.7 2016/12/26 19:46:59 scole Exp $	*/
 
 /*
  * Copyright (c) 2003 Marcel Moolenaar
@@ -821,7 +821,7 @@ ENTRY(cpu_switchto, 3)
 	 * Save old context, unless the LWP is exiting.
 	 */
 	cmp.eq		p6,p0=r0,in0		// p6 = (in0 == 0)
-	add		r14=PC_CURLWP,r13	// r2 = >ci_curlwp
+	add		r14=PC_CURLWP,r13	// r14 = >ci_curlwp
 	;;
 }
 {	.mii
@@ -840,7 +840,7 @@ ENTRY(cpu_switchto, 3)
 	nop		0
 	/*
 	 * Switch to new context, if p6 == true.
-	 * We assum to return to restorectx_return_here for swapped context.
+	 * We assume to return to restorectx_return_here for swapped context.
 	 */
 (p6)	ld8		out0=[r3]		// out0 = pcb of 
 (p6)	br.call.sptk.many rp=restorectx		// if (p6) restorectx(out0)
@@ -855,7 +855,25 @@ ENTRY(cpu_switchto, 3)
 	br.call.sptk.many rp=swapctx
 	;;
 }
-
+	/*
+	 * XXX seems to be a bug here...
+	 *
+	 * swapctx() and restorectx() (which is called by swapctx())
+	 * both adjust the bspstore (and hence bsp) registers.  When
+	 * returning to "restorectx_return_here:" the bspstore can
+	 * be greater than bsp, a state known as an "Incomplete Register Frame".
+	 *
+	 * That is not necessarily fatal in itself, but apparently the RSE
+	 * engine sets bsp=bspstore to adjust, which re-syncs the stacked
+	 * registers (r32-r127).  This clobbers our local registers below
+	 * (loc0 and loc1) on the br return from swapctx(), and you get all
+	 * kind of mysterious exceptions depeding on what gets restored from
+	 * the backing store.
+	 *
+	 * Not sure of a proper fix is yet or how cpu_switchto should/can
+	 * be interacting with restorectx()/swapctx()
+	 * 
+	 */
 restorectx_return_here:
 {	.mib
 	mov		r8=r9			// r8(ret0) = oldlwp



CVS commit: src/sys/arch/ia64/ia64

2016-12-26 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Dec 26 19:46:59 UTC 2016

Modified Files:
src/sys/arch/ia64/ia64: context.S

Log Message:
Fix some comments and add new comment explaining probable bug in 
cpu_switchto().  Not sure of a fix for it yet


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/context.S

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



CVS commit: [netbsd-7] src/doc

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 26 19:01:18 UTC 2016

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

Log Message:
1339


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.138 -r1.1.2.139 src/doc/CHANGES-7.1

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

Modified files:

Index: src/doc/CHANGES-7.1
diff -u src/doc/CHANGES-7.1:1.1.2.138 src/doc/CHANGES-7.1:1.1.2.139
--- src/doc/CHANGES-7.1:1.1.2.138	Sat Dec 24 04:39:05 2016
+++ src/doc/CHANGES-7.1	Mon Dec 26 19:01:18 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1,v 1.1.2.138 2016/12/24 04:39:05 snj Exp $
+# $NetBSD: CHANGES-7.1,v 1.1.2.139 2016/12/26 19:01:18 snj Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1
 release:
@@ -7791,3 +7791,8 @@ sys/external/bsd/ipf/netinet/ip_nat6.c		
 	squid, for example.
 	[sborrill, ticket #1261]
 
+sys/net/npf/lpm.c1.2
+
+	Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().
+	[rmind, ticket #1339]
+



CVS commit: [netbsd-7] src/doc

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 26 19:01:18 UTC 2016

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

Log Message:
1339


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.138 -r1.1.2.139 src/doc/CHANGES-7.1

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



CVS commit: [netbsd-7] src/sys/net/npf

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 26 18:55:08 UTC 2016

Modified Files:
src/sys/net/npf [netbsd-7]: lpm.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #1339):
sys/net/npf/lpm.c: revision 1.2
Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/net/npf/lpm.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/npf/lpm.c
diff -u src/sys/net/npf/lpm.c:1.1.2.2 src/sys/net/npf/lpm.c:1.1.2.3
--- src/sys/net/npf/lpm.c:1.1.2.2	Sun Dec 18 07:40:50 2016
+++ src/sys/net/npf/lpm.c	Mon Dec 26 18:55:08 2016
@@ -31,7 +31,7 @@
 
 #if defined(_KERNEL)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.2 2016/12/18 07:40:50 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1.2.3 2016/12/26 18:55:08 snj Exp $");
 
 #include 
 #include 
@@ -117,7 +117,7 @@ lpm_clear(lpm_t *lpm, lpm_dtor_t dtor, v
 entry = next;
 			}
 		}
-		kmem_free(hmap->bucket, hmap->hashsize);
+		kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
 		hmap->bucket = NULL;
 		hmap->hashsize = 0;
 		hmap->nitems = 0;
@@ -158,7 +158,7 @@ hashmap_rehash(lpm_hmap_t *hmap, uint32_
 	for (hashsize = 1; hashsize < size; hashsize <<= 1) {
 		continue;
 	}
-	bucket = kmem_zalloc(hashsize * sizeof(*bucket), KM_SLEEP);
+	bucket = kmem_zalloc(hashsize * sizeof(lpm_ent_t *), KM_SLEEP);
 	if (bucket == NULL)
 		return false;
 	for (unsigned n = 0; n < hmap->hashsize; n++) {
@@ -175,7 +175,7 @@ hashmap_rehash(lpm_hmap_t *hmap, uint32_
 		}
 	}
 	if (hmap->bucket)
-		kmem_free(hmap->bucket, hmap->hashsize);
+		kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
 	hmap->bucket = bucket;
 	hmap->hashsize = hashsize;
 	return true;



CVS commit: [netbsd-7] src/sys/net/npf

2016-12-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 26 18:55:08 UTC 2016

Modified Files:
src/sys/net/npf [netbsd-7]: lpm.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #1339):
sys/net/npf/lpm.c: revision 1.2
Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/net/npf/lpm.c

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



CVS commit: src/sys/uvm

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 18:47:00 UTC 2016

Modified Files:
src/sys/uvm: uvm_physseg.h

Log Message:
Add copyright info.

After sufficient poking by Taylor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/uvm/uvm_physseg.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/uvm/uvm_physseg.h
diff -u src/sys/uvm/uvm_physseg.h:1.5 src/sys/uvm/uvm_physseg.h:1.6
--- src/sys/uvm/uvm_physseg.h:1.5	Sat Dec 24 15:42:05 2016
+++ src/sys/uvm/uvm_physseg.h	Mon Dec 26 18:47:00 2016
@@ -1,8 +1,37 @@
-/* $NetBSD: uvm_physseg.h,v 1.5 2016/12/24 15:42:05 maya Exp $ */
+/* $NetBSD: uvm_physseg.h,v 1.6 2016/12/26 18:47:00 cherry Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by  Cherry G. Mathew 
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
 
 /*
  * Consolidated API from uvm_page.c and others.
- * Consolidated and designed by Cherry G. Mathew 
+ * Consolidated and designed by Cherry G. Mathew 
  */
 
 #ifndef _UVM_UVM_PHYSSEG_H_



CVS commit: src/sys/uvm

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 18:47:00 UTC 2016

Modified Files:
src/sys/uvm: uvm_physseg.h

Log Message:
Add copyright info.

After sufficient poking by Taylor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/uvm/uvm_physseg.h

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



CVS commit: src/sys/arch

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 18:04:31 UTC 2016

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

Log Message:
xen dom0 SMP is now bootable again.

add the 'options MULTIPROCESSOR' in respective configs, but mark them
experimental - and thus disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/i386/conf/XEN3_DOM0

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



CVS commit: src/sys/arch

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 18:04:31 UTC 2016

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

Log Message:
xen dom0 SMP is now bootable again.

add the 'options MULTIPROCESSOR' in respective configs, but mark them
experimental - and thus disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/i386/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.125 src/sys/arch/amd64/conf/XEN3_DOM0:1.126
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.125	Sun Dec 18 04:35:26 2016
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Dec 26 18:04:31 2016
@@ -1,7 +1,9 @@
-# $NetBSD: XEN3_DOM0,v 1.125 2016/12/18 04:35:26 dholland Exp $
+# $NetBSD: XEN3_DOM0,v 1.126 2016/12/26 18:04:31 cherry Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.103 src/sys/arch/i386/conf/XEN3_DOM0:1.104
--- src/sys/arch/i386/conf/XEN3_DOM0:1.103	Sat Dec 17 14:49:26 2016
+++ src/sys/arch/i386/conf/XEN3_DOM0	Mon Dec 26 18:04:31 2016
@@ -1,9 +1,11 @@
-#	$NetBSD: XEN3_DOM0,v 1.103 2016/12/17 14:49:26 maxv Exp $
+#	$NetBSD: XEN3_DOM0,v 1.104 2016/12/26 18:04:31 cherry Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
 include 	"arch/xen/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST



CVS commit: src/sys/arch

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 17:54:07 UTC 2016

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/include: machdep.h
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
the i386 and amd64 boot time msgbuf init code is nearly identical.

Unify them into x86/x86_machdep.c:init_x86_msgbuf()

Boot tested on GENERIC (i386, amd64), XEN3_DOM0 (amd64)


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.775 -r1.776 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/include/machdep.h
cvs rdiff -u -r1.79 -r1.80 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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.245 src/sys/arch/amd64/amd64/machdep.c:1.246
--- src/sys/arch/amd64/amd64/machdep.c:1.245	Mon Dec 26 13:55:13 2016
+++ src/sys/arch/amd64/amd64/machdep.c	Mon Dec 26 17:54:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.245 2016/12/26 13:55:13 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.246 2016/12/26 17:54:06 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.245 2016/12/26 13:55:13 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.246 2016/12/26 17:54:06 cherry Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -254,14 +254,6 @@ size_t dump_npages;
 size_t dump_header_size;
 size_t dump_totalbytesleft;
 
-vaddr_t msgbuf_vaddr;
-
-struct {
-	paddr_t paddr;
-	psize_t sz;
-} msgbuf_p_seg[VM_PHYSSEG_MAX];
-unsigned int msgbuf_p_cnt = 0;
-
 vaddr_t idt_vaddr;
 paddr_t idt_paddr;
 vaddr_t gdt_vaddr;
@@ -1466,52 +1458,6 @@ extern vector IDTVEC(oosyscall);
 extern vector *IDTVEC(exceptions)[];
 
 static void
-init_x86_64_msgbuf(void)
-{
-	/* Message buffer is located at end of core. */
-	psize_t sz = round_page(MSGBUFSIZE);
-	psize_t reqsz = sz;
-	uvm_physseg_t x;
-		
- search_again:
-for (x = uvm_physseg_get_first();
-	 uvm_physseg_valid_p(x);
-	 x = uvm_physseg_get_next(x)) {
-
-		if (ctob(uvm_physseg_get_avail_end(x)) == avail_end)
-			break;
-	}
-
-	if (uvm_physseg_valid_p(x) == false)
-		panic("init_x86_64: can't find end of memory");
-
-	/* Shrink so it'll fit in the last segment. */
-	if (uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x) < atop(sz))
-		sz = ctob(uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x));
-
-	uvm_physseg_unplug(uvm_physseg_get_end(x) - atop(sz), atop(sz));
-	msgbuf_p_seg[msgbuf_p_cnt].sz = sz;
-msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(uvm_physseg_get_avail_end(x));
-
-	/* Now find where the new avail_end is. */
-	avail_end = ctob(uvm_physseg_get_avail_end(x));
-
-	if (sz == reqsz)
-		return;
-
-	reqsz -= sz;
-	if (msgbuf_p_cnt == VM_PHYSSEG_MAX) {
-		/* No more segments available, bail out. */
-		printf("WARNING: MSGBUFSIZE (%zu) too large, using %zu.\n",
-		(size_t)MSGBUFSIZE, (size_t)(MSGBUFSIZE - reqsz));
-		return;
-	}
-
-	sz = reqsz;
-	goto search_again;
-}
-
-static void
 init_x86_64_ksyms(void)
 {
 #if NKSYMS || defined(DDB) || defined(MODULAR)
@@ -1640,7 +1586,7 @@ init_x86_64(paddr_t first_avail)
 	atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT);
 #endif
 
-	init_x86_64_msgbuf();
+	init_x86_msgbuf();
 
 	pmap_growkernel(VM_MIN_KERNEL_ADDRESS + 32 * 1024 * 1024);
 

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.775 src/sys/arch/i386/i386/machdep.c:1.776
--- src/sys/arch/i386/i386/machdep.c:1.775	Mon Dec 26 15:47:48 2016
+++ src/sys/arch/i386/i386/machdep.c	Mon Dec 26 17:54:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.775 2016/12/26 15:47:48 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.776 2016/12/26 17:54:06 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.775 2016/12/26 15:47:48 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.776 2016/12/26 17:54:06 cherry Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -236,13 +236,6 @@ int i386_use_fxsave;
 int i386_has_sse;
 int i386_has_sse2;
 
-vaddr_t msgbuf_vaddr;
-struct {
-	paddr_t paddr;
-	psize_t sz;
-} msgbuf_p_seg[VM_PHYSSEG_MAX];
-unsigned int msgbuf_p_cnt = 0;
-
 vaddr_t idt_vaddr;
 paddr_t idt_paddr;
 vaddr_t gdt_vaddr;
@@ -1034,51 +1027,6 @@ initgdt(union descriptor *tgdt)
 #endif /* !XEN */
 }
 
-static void
-init386_msgbuf(void)
-{
-	/* Message buffer is located at end of core. */
-	psize_t sz = round_page(MSGBUFSIZE);
-	psize_t reqsz = sz;
-	uvm_physseg_t x;
-		
-search_again:
-for (x = uvm_physseg_get_first();
-	 uvm_physseg_valid_p(x);
-	 x = uvm_physseg_get_next(x)) {
-		if 

CVS commit: src/sys/arch

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 17:54:07 UTC 2016

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/include: machdep.h
src/sys/arch/x86/x86: x86_machdep.c

Log Message:
the i386 and amd64 boot time msgbuf init code is nearly identical.

Unify them into x86/x86_machdep.c:init_x86_msgbuf()

Boot tested on GENERIC (i386, amd64), XEN3_DOM0 (amd64)


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.775 -r1.776 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/include/machdep.h
cvs rdiff -u -r1.79 -r1.80 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.



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

2016-12-26 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Mon Dec 26 16:20:17 UTC 2016

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h

Log Message:
Remove more trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/arm/allwinner/awin_reg.h

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.89 src/sys/arch/arm/allwinner/awin_reg.h:1.90
--- src/sys/arch/arm/allwinner/awin_reg.h:1.89	Wed May 11 18:33:40 2016
+++ src/sys/arch/arm/allwinner/awin_reg.h	Mon Dec 26 16:20:17 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_reg.h,v 1.89 2016/05/11 18:33:40 bouyer Exp $ */
+/* $NetBSD: awin_reg.h,v 1.90 2016/12/26 16:20:17 rjs Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -1296,8 +1296,8 @@ struct awin_mmc_idma_descriptor {
 #define AWIN_PIO_INT_SIZE		0x0028
 
 #define AWIN_PIO_CFG_PINMASK(pin)	(7 << (4*((pin) & 7)))
-#define AWIN_PIO_DRV_MASK(pin)		((x) << (2*((pin) & 15))) 
-#define AWIN_PIO_PULn(v, pin)		((v) << (2*((pin) & 15))) 
+#define AWIN_PIO_DRV_MASK(pin)		((x) << (2*((pin) & 15)))
+#define AWIN_PIO_PULn(v, pin)		((v) << (2*((pin) & 15)))
 
 #define AWIN_PIO_FUNC_INPUT		0x0
 #define AWIN_PIO_FUNC_OUTPUT		0x1



CVS commit: src/share/man/man4

2016-12-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Dec 26 16:03:50 UTC 2016

Modified Files:
src/share/man/man4: tc.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/tc.4

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

Modified files:

Index: src/share/man/man4/tc.4
diff -u src/share/man/man4/tc.4:1.5 src/share/man/man4/tc.4:1.6
--- src/share/man/man4/tc.4:1.5	Mon Dec 26 15:59:26 2016
+++ src/share/man/man4/tc.4	Mon Dec 26 16:03:50 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: tc.4,v 1.5 2016/12/26 15:59:26 flxd Exp $
+.\" $NetBSD: tc.4,v 1.6 2016/12/26 16:03:50 wiz Exp $
 .\"
 .\" Copyright (c) 1996, 1997 Jonathan Stone.
 .\" All rights reserved.
@@ -48,7 +48,8 @@ expansion bus found on all DEC 5000-seri
 .Pp
 Your system may support additional
 .Tn TURBOchannel
-devices.  Drivers for
+devices.
+Drivers for
 .Tn TURBOchannel
 devices not listed here are machine-dependent.
 Consult your system's



CVS commit: src/share/man/man4

2016-12-26 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Mon Dec 26 15:59:26 UTC 2016

Modified Files:
src/share/man/man4: tc.4

Log Message:
Add tcu(4) for TC-USB.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/tc.4

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

Modified files:

Index: src/share/man/man4/tc.4
diff -u src/share/man/man4/tc.4:1.4 src/share/man/man4/tc.4:1.5
--- src/share/man/man4/tc.4:1.4	Mon Oct 29 18:59:55 2001
+++ src/share/man/man4/tc.4	Mon Dec 26 15:59:26 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: tc.4,v 1.4 2001/10/29 18:59:55 gmcgarry Exp $
+.\" $NetBSD: tc.4,v 1.5 2016/12/26 15:59:26 flxd Exp $
 .\"
 .\" Copyright (c) 1996, 1997 Jonathan Stone.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 12, 2001
+.Dd December 26, 2016
 .Dt TC 4
 .Os
 .Sh NAME
@@ -93,6 +93,8 @@ PMAG-J TX 24-bit colour unaccelerated 2-
 .Bl -tag -width pcdisplay -offset indent
 .It ioasic
 baseboard IO control ASIC for DEC TURBOchannel systems
+.It tcu
+TC-USB USB host and GPIO option
 .El
 .Sh SEE ALSO
 .Xr asc 4 ,
@@ -106,6 +108,7 @@ baseboard IO control ASIC for DEC TURBOc
 .Xr pxg 4 ,
 .Xr sfb 4 ,
 .Xr tcds 4 ,
+.Xr tcu 4 ,
 .Xr tfb 4
 .Sh HISTORY
 The



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 15:47:48 UTC 2016

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

Log Message:
Make the msgbuf initialisation track closer to the original
pre-uvm_physseg.h one.

To see the exact changes with the original, line for line, do:

cvs rdiff -u -r1.772 -r1.775 src/sys/arch/i386/i386/machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.774 -r1.775 src/sys/arch/i386/i386/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/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.774 src/sys/arch/i386/i386/machdep.c:1.775
--- src/sys/arch/i386/i386/machdep.c:1.774	Fri Dec 23 09:24:57 2016
+++ src/sys/arch/i386/i386/machdep.c	Mon Dec 26 15:47:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.774 2016/12/23 09:24:57 maya Exp $	*/
+/*	$NetBSD: machdep.c,v 1.775 2016/12/26 15:47:48 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.774 2016/12/23 09:24:57 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.775 2016/12/26 15:47:48 cherry Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1037,30 +1037,46 @@ initgdt(union descriptor *tgdt)
 static void
 init386_msgbuf(void)
 {
-/* Message buffer is located at end of core. */
-	psize_t reqsz = round_page(MSGBUFSIZE);
-	psize_t sz = 0;
+	/* Message buffer is located at end of core. */
+	psize_t sz = round_page(MSGBUFSIZE);
+	psize_t reqsz = sz;
+	uvm_physseg_t x;
+		
+search_again:
+for (x = uvm_physseg_get_first();
+	 uvm_physseg_valid_p(x);
+	 x = uvm_physseg_get_next(x)) {
+		if (ctob(uvm_physseg_get_avail_end(x)) == avail_end) {
+			break;
+		}
+	}
+	if (uvm_physseg_valid_p(x) == false)
+		panic("init386: can't find end of memory");
 
-	for (sz = 0; sz < reqsz; sz += PAGE_SIZE) {
-		paddr_t stolenpa;
+	/* Shrink so it'll fit in the last segment. */
+	if (uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x) < atop(sz))
+		sz = ctob(uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x));
 
-		if (!uvm_page_physget())
-			break;
+	uvm_physseg_unplug(uvm_physseg_get_end(x) - atop(sz), atop(sz));
+	msgbuf_p_seg[msgbuf_p_cnt].sz = sz;
+msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(uvm_physseg_get_avail_end(x));
 
-		if (stolenpa == (msgbuf_p_seg[msgbuf_p_cnt].paddr
-			+ PAGE_SIZE)) {
-			/* contiguous: append it to current buf alloc */
-			msgbuf_p_seg[msgbuf_p_cnt].sz += PAGE_SIZE;
-		} else  {
-			/* non-contiguous: start a new msgbuf seg */
-			msgbuf_p_seg[msgbuf_p_cnt].sz = PAGE_SIZE;
-			msgbuf_p_seg[msgbuf_p_cnt++].paddr = stolenpa;
-		}
+	/* Now find where the new avail_end is. */
+	avail_end = ctob(uvm_physseg_get_avail_end(x));
+
+	if (sz == reqsz)
+		return;
+
+	reqsz -= sz;
+	if (msgbuf_p_cnt == VM_PHYSSEG_MAX) {
+		/* No more segments available, bail out. */
+		printf("WARNING: MSGBUFSIZE (%zu) too large, using %zu.\n",
+		(size_t)MSGBUFSIZE, (size_t)(MSGBUFSIZE - reqsz));
+		return;
 	}
 
-	if (sz != reqsz)
-		printf("%s: could only allocate %"PRIxPSIZE" bytes of requested"
-		" %"PRIxPSIZE" bytes\n", __func__, sz, reqsz);
+	sz = reqsz;
+	goto search_again;
 }
 
 #ifndef XEN



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 15:47:48 UTC 2016

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

Log Message:
Make the msgbuf initialisation track closer to the original
pre-uvm_physseg.h one.

To see the exact changes with the original, line for line, do:

cvs rdiff -u -r1.772 -r1.775 src/sys/arch/i386/i386/machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.774 -r1.775 src/sys/arch/i386/i386/machdep.c

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



CVS commit: src/usr.bin/cvslatest

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 26 14:53:17 UTC 2016

Modified Files:
src/usr.bin/cvslatest: cvslatest.c

Log Message:
- use UTC
- initialize tm_isdst
- use accpath to handle relative paths


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/cvslatest/cvslatest.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/cvslatest/cvslatest.c
diff -u src/usr.bin/cvslatest/cvslatest.c:1.3 src/usr.bin/cvslatest/cvslatest.c:1.4
--- src/usr.bin/cvslatest/cvslatest.c:1.3	Sun Dec 18 20:48:00 2016
+++ src/usr.bin/cvslatest/cvslatest.c	Mon Dec 26 09:53:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cvslatest.c,v 1.3 2016/12/19 01:48:00 christos Exp $	*/
+/*	$NetBSD: cvslatest.c,v 1.4 2016/12/26 14:53:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: cvslatest.c,v 1.3 2016/12/19 01:48:00 christos Exp $");
+__RCSID("$NetBSD: cvslatest.c,v 1.4 2016/12/26 14:53:17 christos Exp $");
 
 /*
  * Find the latest timestamp in a set of CVS trees, by examining the
@@ -113,6 +113,7 @@ getlatest(const char *path, const char *
 			if (!ignore)
 exit(EXIT_FAILURE);
 		}
+		tm.tm_isdst = 0;	// We are in GMT anyway
 		if ((t = mktime()) == (time_t)-1)
 			errx(EXIT_FAILURE, "Time conversion `%s' in `%s'",
 			dt, name);
@@ -152,8 +153,8 @@ cvsscan(char **pathv, const char *name, 
 		if (strcmp(entry->fts_name, name) != 0)
 continue;
 
-		getrepo(entry->fts_path, repo, sizeof(repo));
-		getlatest(entry->fts_path, repo, lat);
+		getrepo(entry->fts_accpath, repo, sizeof(repo));
+		getlatest(entry->fts_accpath, repo, lat);
 }
 
 (void)fts_close(dh);
@@ -192,6 +193,9 @@ main(int argc, char *argv[])
 	if (argc == optind)
 		usage();
 
+	// So that mktime behaves consistently
+	setenv("TZ", "UTC", 1);
+
 	cvsscan(argv + optind, name, );
 	if (debug)
 		printlat();



CVS commit: src/usr.bin/cvslatest

2016-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 26 14:53:17 UTC 2016

Modified Files:
src/usr.bin/cvslatest: cvslatest.c

Log Message:
- use UTC
- initialize tm_isdst
- use accpath to handle relative paths


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/cvslatest/cvslatest.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/amd64

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 13:55:13 UTC 2016

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

Log Message:
remove spurious printf()


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/arch/amd64/amd64/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/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.244 src/sys/arch/amd64/amd64/machdep.c:1.245
--- src/sys/arch/amd64/amd64/machdep.c:1.244	Mon Dec 26 12:54:42 2016
+++ src/sys/arch/amd64/amd64/machdep.c	Mon Dec 26 13:55:13 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.244 2016/12/26 12:54:42 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.245 2016/12/26 13:55:13 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.244 2016/12/26 12:54:42 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.245 2016/12/26 13:55:13 cherry Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1485,8 +1485,6 @@ init_x86_64_msgbuf(void)
 	if (uvm_physseg_valid_p(x) == false)
 		panic("init_x86_64: can't find end of memory");
 
-	printf("uvm_physseg_find(atop(avail_end), NULL) == %d\n",
-	uvm_physseg_find(atop(avail_end), NULL));
 	/* Shrink so it'll fit in the last segment. */
 	if (uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x) < atop(sz))
 		sz = ctob(uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x));



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 13:55:13 UTC 2016

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

Log Message:
remove spurious printf()


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/arch/amd64/amd64/machdep.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

2016-12-26 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Mon Dec 26 13:28:59 UTC 2016

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c awin_var.h
src/sys/arch/evbarm/awin: awin_start.S

Log Message:
Remove trailing whitespace, no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/allwinner/awin_board.c \
src/sys/arch/arm/allwinner/awin_var.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/awin/awin_start.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/arm/allwinner/awin_board.c
diff -u src/sys/arch/arm/allwinner/awin_board.c:1.40 src/sys/arch/arm/allwinner/awin_board.c:1.41
--- src/sys/arch/arm/allwinner/awin_board.c:1.40	Sun Oct 25 20:54:19 2015
+++ src/sys/arch/arm/allwinner/awin_board.c	Mon Dec 26 13:28:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.40 2015/10/25 20:54:19 bouyer Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.41 2016/12/26 13:28:59 rjs Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.40 2015/10/25 20:54:19 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.41 2016/12/26 13:28:59 rjs Exp $");
 
 #include 
 #include 
@@ -248,7 +248,7 @@ awin_current_frequency_sysctl_helper(SYS
 	for (size_t i = 0; awin_freqs[i].freq > 0; i++) {
 		if (awin_freqs[i].freq == freq) {
 			new_awin_freq = awin_freqs[i];
-			error = 0;
+			error = 0;
 			break;
 		}
 	}
@@ -315,7 +315,7 @@ awin_available_frequency_sysctl_helper(S
 		if (awin_freqs[i].freq < awin_freq_min ||
 		awin_freqs[i].freq > awin_freq_max)
 			continue;
-		snprintf(cur_cpu_freq, sizeof(cur_cpu_freq), "%u",  
+		snprintf(cur_cpu_freq, sizeof(cur_cpu_freq), "%u",
 		awin_freqs[i].freq);
 		if (strlen(available_frequencies) > 0) {
 			strlcat(available_frequencies, " ", availfreq_size);
@@ -370,17 +370,17 @@ SYSCTL_SETUP(sysctl_awin_machdep_setup, 
 	sysctl_createv(clog, 0, , NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "current", NULL,
-		   awin_current_frequency_sysctl_helper, 0, NULL, 0, 
+		   awin_current_frequency_sysctl_helper, 0, NULL, 0,
 		   CTL_CREATE, CTL_EOL);
 	sysctl_createv(clog, 0, , NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "min", NULL,
-		   NULL, 0, _freq_min, sizeof(awin_freq_min), 
+		   NULL, 0, _freq_min, sizeof(awin_freq_min),
 		   CTL_CREATE, CTL_EOL);
 	sysctl_createv(clog, 0, , NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "max", NULL,
-		   NULL, 0, _freq_max, sizeof(awin_freq_max), 
+		   NULL, 0, _freq_max, sizeof(awin_freq_max),
 		   CTL_CREATE, CTL_EOL);
 }
 
Index: src/sys/arch/arm/allwinner/awin_var.h
diff -u src/sys/arch/arm/allwinner/awin_var.h:1.40 src/sys/arch/arm/allwinner/awin_var.h:1.41
--- src/sys/arch/arm/allwinner/awin_var.h:1.40	Sat Dec 26 16:54:41 2015
+++ src/sys/arch/arm/allwinner/awin_var.h	Mon Dec 26 13:28:59 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.40 2015/12/26 16:54:41 macallan Exp $ */
+/* $NetBSD: awin_var.h,v 1.41 2016/12/26 13:28:59 rjs Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@ struct awin_locators {
 	const char *loc_name;
 	bus_size_t loc_offset;
 	bus_size_t loc_size;
-	int loc_port; 
+	int loc_port;
 	int loc_intr;
 #define	AWINIO_INTR_DEFAULT	0
 	int loc_flags;
@@ -101,7 +101,7 @@ extern struct arm32_bus_dma_tag awin_dma
 extern struct arm32_bus_dma_tag awin_coherent_dma_tag;
 
 psize_t awin_memprobe(void);
-void	awin_bootstrap(vaddr_t, vaddr_t); 
+void	awin_bootstrap(vaddr_t, vaddr_t);
 void	awin_dma_bootstrap(psize_t);
 void	awin_pll2_enable(void);
 void	awin_pll3_enable(void);

Index: src/sys/arch/evbarm/awin/awin_start.S
diff -u src/sys/arch/evbarm/awin/awin_start.S:1.12 src/sys/arch/evbarm/awin/awin_start.S:1.13
--- src/sys/arch/evbarm/awin/awin_start.S:1.12	Sat Apr 18 11:04:49 2015
+++ src/sys/arch/evbarm/awin/awin_start.S	Mon Dec 26 13:28:59 2016
@@ -39,9 +39,9 @@
 #include "assym.h"
 
 #include 
-#include   
+#include 
 
-RCSID("$NetBSD: awin_start.S,v 1.12 2015/04/18 11:04:49 skrll Exp $")
+RCSID("$NetBSD: awin_start.S,v 1.13 2016/12/26 13:28:59 rjs Exp $")
 
 #if defined(VERBOSE_INIT_ARM)
 #define	XPUTC(n)	mov r0, n; bl xputc
@@ -240,13 +240,13 @@ a20_mpinit:
 	dsb
 
 	/* Ensure CPU1 reset also invalidates its L1 caches */
-	ldr	r1, [r5, #AWIN_CPUCFG_GENCTRL_REG] 
+	ldr	r1, [r5, #AWIN_CPUCFG_GENCTRL_REG]
 	bic	r1, r1, #(1 << 1)
 	str	r1, [r5, #AWIN_CPUCFG_GENCTRL_REG]
 	dsb
 
 	/* Hold DBGPWRDUP signal low */
-	ldr	r1, [r5, #AWIN_CPUCFG_DBGCTRL1_REG] 
+	ldr	r1, [r5, #AWIN_CPUCFG_DBGCTRL1_REG]
 	bic	r1, r1, #(1 << 1)
 	str	r1, [r5, #AWIN_CPUCFG_DBGCTRL1_REG]
 	dsb
@@ -263,7 +263,7 @@ a20_mpinit:
 	bl	_C_LABEL(gtmr_bootdelay)	// endian-neutral
 
 	

CVS commit: src/sys/arch

2016-12-26 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Mon Dec 26 13:28:59 UTC 2016

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c awin_var.h
src/sys/arch/evbarm/awin: awin_start.S

Log Message:
Remove trailing whitespace, no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/allwinner/awin_board.c \
src/sys/arch/arm/allwinner/awin_var.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/awin/awin_start.S

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/amd64

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 12:54:42 UTC 2016

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

Log Message:
Make the msgbuf initialisation track closer to the original
pre-uvm_physseg.h one.

To see the exact changes with the original, line for line, do:

cvs diff -u -r 1.241 sys/arch/amd64/amd64/machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/arch/amd64/amd64/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/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.243 src/sys/arch/amd64/amd64/machdep.c:1.244
--- src/sys/arch/amd64/amd64/machdep.c:1.243	Fri Dec 23 07:15:27 2016
+++ src/sys/arch/amd64/amd64/machdep.c	Mon Dec 26 12:54:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.243 2016/12/23 07:15:27 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.244 2016/12/26 12:54:42 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.243 2016/12/23 07:15:27 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.244 2016/12/26 12:54:42 cherry Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1468,30 +1468,49 @@ extern vector *IDTVEC(exceptions)[];
 static void
 init_x86_64_msgbuf(void)
 {
-/* Message buffer is located at end of core. */
-	psize_t reqsz = round_page(MSGBUFSIZE);
-	psize_t sz = 0;
+	/* Message buffer is located at end of core. */
+	psize_t sz = round_page(MSGBUFSIZE);
+	psize_t reqsz = sz;
+	uvm_physseg_t x;
+		
+ search_again:
+for (x = uvm_physseg_get_first();
+	 uvm_physseg_valid_p(x);
+	 x = uvm_physseg_get_next(x)) {
 
-	for (sz = 0; sz < reqsz; sz += PAGE_SIZE) {
-		paddr_t stolenpa;
-
-		if (!uvm_page_physget())
+		if (ctob(uvm_physseg_get_avail_end(x)) == avail_end)
 			break;
+	}
 
-		if (stolenpa == (msgbuf_p_seg[msgbuf_p_cnt].paddr
-			+ PAGE_SIZE)) {
-			/* contiguous: append it to current buf alloc */
-			msgbuf_p_seg[msgbuf_p_cnt].sz += PAGE_SIZE;
-		} else  {
-			/* non-contiguous: start a new msgbuf seg */
-			msgbuf_p_seg[msgbuf_p_cnt].sz = PAGE_SIZE;
-			msgbuf_p_seg[msgbuf_p_cnt++].paddr = stolenpa;
-		}
+	if (uvm_physseg_valid_p(x) == false)
+		panic("init_x86_64: can't find end of memory");
+
+	printf("uvm_physseg_find(atop(avail_end), NULL) == %d\n",
+	uvm_physseg_find(atop(avail_end), NULL));
+	/* Shrink so it'll fit in the last segment. */
+	if (uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x) < atop(sz))
+		sz = ctob(uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x));
+
+	uvm_physseg_unplug(uvm_physseg_get_end(x) - atop(sz), atop(sz));
+	msgbuf_p_seg[msgbuf_p_cnt].sz = sz;
+msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(uvm_physseg_get_avail_end(x));
+
+	/* Now find where the new avail_end is. */
+	avail_end = ctob(uvm_physseg_get_avail_end(x));
+
+	if (sz == reqsz)
+		return;
+
+	reqsz -= sz;
+	if (msgbuf_p_cnt == VM_PHYSSEG_MAX) {
+		/* No more segments available, bail out. */
+		printf("WARNING: MSGBUFSIZE (%zu) too large, using %zu.\n",
+		(size_t)MSGBUFSIZE, (size_t)(MSGBUFSIZE - reqsz));
+		return;
 	}
 
-	if (sz != reqsz)
-		printf("%s: could only allocate %ld bytes of requested %ld bytes\n",
-		__func__, sz, reqsz);
+	sz = reqsz;
+	goto search_again;
 }
 
 static void



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 12:54:42 UTC 2016

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

Log Message:
Make the msgbuf initialisation track closer to the original
pre-uvm_physseg.h one.

To see the exact changes with the original, line for line, do:

cvs diff -u -r 1.241 sys/arch/amd64/amd64/machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/arch/amd64/amd64/machdep.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/top/dist/machine

2016-12-26 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Mon Dec 26 12:46:32 UTC 2016

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
Implement the `c' command in "interactive mode" that displays only commands
that match a specified string.

Reviewed by and thanks to 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/top/dist/machine/m_netbsd.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/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.18 src/external/bsd/top/dist/machine/m_netbsd.c:1.19
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.18	Sun Oct 20 03:02:27 2013
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Mon Dec 26 12:46:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.19 2016/12/26 12:46:31 leot Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $
+ * $Id: m_netbsd.c,v 1.19 2016/12/26 12:46:31 leot Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.19 2016/12/26 12:46:31 leot Exp $");
 #endif
 
 #include 
@@ -587,6 +587,7 @@ get_proc_info(struct system_info *si, st
 	int show_idle;
 	int show_system;
 	int show_uid;
+	char *show_command;
 
 	static struct handle handle;
 
@@ -626,6 +627,7 @@ get_proc_info(struct system_info *si, st
 	show_idle = sel->idle;
 	show_system = sel->system;
 	show_uid = sel->uid != -1;
+	show_command = sel->command;
 
 	/* count up process states and get pointers to interesting procs */
 	total_procs = 0;
@@ -646,9 +648,12 @@ get_proc_info(struct system_info *si, st
 			if (pp->p_stat != LSZOMB &&
 			(show_idle || (pp->p_pctcpu != 0) || 
 			(pp->p_stat == LSRUN || pp->p_stat == LSONPROC)) &&
-			(!show_uid || pp->p_ruid == (uid_t)sel->uid)) {
-*prefp++ = pp;
-active_procs++;
+			(!show_uid || pp->p_ruid == (uid_t)sel->uid) &&
+			(!show_command ||
+			 strstr(get_command(sel, pp),
+ show_command) != NULL)) {
+	*prefp++ = pp;
+	active_procs++;
 			}
 		}
 	}
@@ -685,6 +690,7 @@ get_lwp_info(struct system_info *si, str
 	int show_idle;
 	int show_system;
 	int show_uid;
+	char *show_command;
 
 	static struct handle handle;
 
@@ -736,6 +742,7 @@ get_lwp_info(struct system_info *si, str
 	show_idle = sel->idle;
 	show_system = sel->system;
 	show_uid = sel->uid != -1;
+	show_command = sel->command;
 
 	/* count up thread states and get pointers to interesting threads */
 	total_lwps = 0;
@@ -758,9 +765,12 @@ get_lwp_info(struct system_info *si, str
 			if (lp->l_stat != LSZOMB &&
 			(show_idle || (lp->l_pctcpu != 0) || 
 			(lp->l_stat == LSRUN || lp->l_stat == LSONPROC)) &&
-			(!show_uid || uid_from_thread(lp) == sel->uid)) {
-*lrefp++ = lp;
-active_lwps++;
+			(!show_uid || uid_from_thread(lp) == sel->uid) &&
+			(!show_command ||
+			 strstr(get_command(sel, proc_from_thread(lp)),
+ show_command) != NULL)) {
+	*lrefp++ = lp;
+	active_lwps++;
 			}
 		}
 	}



CVS commit: src/external/bsd/top/dist/machine

2016-12-26 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Mon Dec 26 12:46:32 UTC 2016

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
Implement the `c' command in "interactive mode" that displays only commands
that match a specified string.

Reviewed by and thanks to 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/top/dist/machine/m_netbsd.c

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 12:44:10 UTC 2016

Modified Files:
src/sys/net/npf: lpm.c

Log Message:
Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/lpm.c

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



CVS commit: src/sys/net/npf

2016-12-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 26 12:44:10 UTC 2016

Modified Files:
src/sys/net/npf: lpm.c

Log Message:
Fix kmem_free() sizes in hashmap_rehash() and lpm_clear().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/lpm.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/npf/lpm.c
diff -u src/sys/net/npf/lpm.c:1.1 src/sys/net/npf/lpm.c:1.2
--- src/sys/net/npf/lpm.c:1.1	Fri Dec  9 02:40:38 2016
+++ src/sys/net/npf/lpm.c	Mon Dec 26 12:44:10 2016
@@ -31,7 +31,7 @@
 
 #if defined(_KERNEL)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.1 2016/12/09 02:40:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpm.c,v 1.2 2016/12/26 12:44:10 rmind Exp $");
 
 #include 
 #include 
@@ -117,7 +117,7 @@ lpm_clear(lpm_t *lpm, lpm_dtor_t dtor, v
 entry = next;
 			}
 		}
-		kmem_free(hmap->bucket, hmap->hashsize);
+		kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
 		hmap->bucket = NULL;
 		hmap->hashsize = 0;
 		hmap->nitems = 0;
@@ -158,7 +158,7 @@ hashmap_rehash(lpm_hmap_t *hmap, uint32_
 	for (hashsize = 1; hashsize < size; hashsize <<= 1) {
 		continue;
 	}
-	bucket = kmem_zalloc(hashsize * sizeof(*bucket), KM_SLEEP);
+	bucket = kmem_zalloc(hashsize * sizeof(lpm_ent_t *), KM_SLEEP);
 	if (bucket == NULL)
 		return false;
 	for (unsigned n = 0; n < hmap->hashsize; n++) {
@@ -175,7 +175,7 @@ hashmap_rehash(lpm_hmap_t *hmap, uint32_
 		}
 	}
 	if (hmap->bucket)
-		kmem_free(hmap->bucket, hmap->hashsize);
+		kmem_free(hmap->bucket, hmap->hashsize * sizeof(lpm_ent_t *));
 	hmap->bucket = bucket;
 	hmap->hashsize = hashsize;
 	return true;



CVS commit: src/lib/libc/gen

2016-12-26 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Dec 26 10:16:43 UTC 2016

Modified Files:
src/lib/libc/gen: getpwent.3

Log Message:
Add missing full stop.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/gen/getpwent.3

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



CVS commit: src/lib/libc/gen

2016-12-26 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Dec 26 10:16:43 UTC 2016

Modified Files:
src/lib/libc/gen: getpwent.3

Log Message:
Add missing full stop.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/gen/getpwent.3

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

Modified files:

Index: src/lib/libc/gen/getpwent.3
diff -u src/lib/libc/gen/getpwent.3:1.38 src/lib/libc/gen/getpwent.3:1.39
--- src/lib/libc/gen/getpwent.3:1.38	Thu Apr 28 16:35:05 2011
+++ src/lib/libc/gen/getpwent.3	Mon Dec 26 10:16:43 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getpwent.3,v 1.38 2011/04/28 16:35:05 wiz Exp $
+.\"	$NetBSD: getpwent.3,v 1.39 2016/12/26 10:16:43 abhinav Exp $
 .\"
 .\" Copyright (c) 1988, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -289,7 +289,7 @@ The resulting
 does not fit in the space defined by
 .Dv buffer
 and
-.Dv buflen
+.Dv buflen .
 .El
 .Pp
 Other



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 08:53:11 UTC 2016

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
In the MP case,
do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during
boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the
entry on the local CPU only.

XXX: to DTRT, probably this assumption needs re-examination.
XXX: The tradeoff is a (predicted) single word size comparison
 penalty, so perhaps a decision needs performance stats.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/x86/xen_pmap.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/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.24 src/sys/arch/xen/x86/xen_pmap.c:1.25
--- src/sys/arch/xen/x86/xen_pmap.c:1.24	Tue Dec 13 10:54:27 2016
+++ src/sys/arch/xen/x86/xen_pmap.c	Mon Dec 26 08:53:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.24 2016/12/13 10:54:27 kamil Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.25 2016/12/26 08:53:11 cherry Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.24 2016/12/13 10:54:27 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.25 2016/12/26 08:53:11 cherry Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -188,9 +188,13 @@ pmap_kenter_ma(vaddr_t va, paddr_t ma, v
 
 	if (pmap_valid_entry(opte)) {
 #if defined(MULTIPROCESSOR)
-		kpreempt_disable();
-		pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
-		kpreempt_enable();
+		if (__predict_false(x86_mp_online == false)) {
+			pmap_update_pg(va);
+		} else {
+			kpreempt_disable();
+			pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
+			kpreempt_enable();
+		}
 #else
 		/* Don't bother deferring in the single CPU case. */
 		pmap_update_pg(va);



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

2016-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Dec 26 08:53:11 UTC 2016

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
In the MP case,
do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during
boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the
entry on the local CPU only.

XXX: to DTRT, probably this assumption needs re-examination.
XXX: The tradeoff is a (predicted) single word size comparison
 penalty, so perhaps a decision needs performance stats.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/x86/xen_pmap.c

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



CVS commit: src/doc

2016-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 26 08:43:55 UTC 2016

Modified Files:
src/doc: TODO.ptrace

Log Message:
Add new entry in TODO.ptrace

 + add support to read and write siginfo_t from and to tracee (reuse PT_IO?)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/doc/TODO.ptrace

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



CVS commit: src/doc

2016-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 26 08:43:55 UTC 2016

Modified Files:
src/doc: TODO.ptrace

Log Message:
Add new entry in TODO.ptrace

 + add support to read and write siginfo_t from and to tracee (reuse PT_IO?)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/doc/TODO.ptrace

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.ptrace
diff -u src/doc/TODO.ptrace:1.7 src/doc/TODO.ptrace:1.8
--- src/doc/TODO.ptrace:1.7	Mon Dec 26 03:24:11 2016
+++ src/doc/TODO.ptrace	Mon Dec 26 08:43:55 2016
@@ -1,4 +1,4 @@
-$NetBSD: TODO.ptrace,v 1.7 2016/12/26 03:24:11 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.8 2016/12/26 08:43:55 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
@@ -22,7 +22,8 @@ Items we (currently) plan to finish in t
  - refactor pthread_dbg(3) to only query private pthread_t data, otherwise it
duplicates ptrace(2) interface and cannot cover all types of threads
  - add ATF tests for SIGCHLD
- - add ATF tsts for PT_SYSCALL and PT_SYSCALLEMU
+ - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU
+ - add support to read and write siginfo_t from and to tracee (reuse PT_IO?)
 
 and of course: fix as many bugs as possible.
 



CVS commit: src/sys/fs/puffs

2016-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 26 08:21:09 UTC 2016

Modified Files:
src/sys/fs/puffs: puffs_msgif.c

Log Message:
Hold the interlock when calling cv_broadcast as per condvar(9)


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/fs/puffs/puffs_msgif.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/xen/xen

2016-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 26 08:16:28 UTC 2016

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Hold the interlock before cv_broadcast as per condvar(9)


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen

2016-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 26 08:16:28 UTC 2016

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Hold the interlock before cv_broadcast as per condvar(9)


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.62 src/sys/arch/xen/xen/xbdback_xenbus.c:1.63
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.62	Wed Jan  6 15:28:40 2016
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Mon Dec 26 08:16:28 2016
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.62 2016/01/06 15:28:40 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.63 2016/12/26 08:16:28 skrll Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.62 2016/01/06 15:28:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.63 2016/12/26 08:16:28 skrll Exp $");
 
 #include 
 #include 
@@ -1672,9 +1672,8 @@ xbdback_wakeup_thread(struct xbdback_ins
 	/* only set RUN state when we are WAITING for work */
 	if (xbdi->xbdi_status == WAITING)
 	   xbdi->xbdi_status = RUN;
-	mutex_exit(>xbdi_lock);
-
 	cv_broadcast(>xbdi_cv);
+	mutex_exit(>xbdi_lock);
 }
 
 /*



CVS commit: src/sys/dev/pci

2016-12-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 26 07:55:00 UTC 2016

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

Log Message:
0x10cb is not 82801H but 82801I. No functional change (The macro name
was changed but the vaule is the same).


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 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.458 src/sys/dev/pci/if_wm.c:1.459
--- src/sys/dev/pci/if_wm.c:1.458	Thu Dec 15 09:28:05 2016
+++ src/sys/dev/pci/if_wm.c	Mon Dec 26 07:55:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.458 2016/12/15 09:28:05 ozaki-r Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.459 2016/12/26 07:55:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.458 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.459 2016/12/26 07:55:00 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1179,7 +1179,7 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_82801I_IGP_M,
 	  "82801I mobile LAN Controller",
 	  WM_T_ICH9,		WMP_F_COPPER },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_82801H_IGP_M_V,
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_82801I_IGP_M_V,
 	  "82801I mobile (V) LAN Controller",
 	  WM_T_ICH9,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_82801I_IGP_M_AMT,



CVS commit: src/sys/dev/pci

2016-12-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 26 07:55:00 UTC 2016

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

Log Message:
0x10cb is not 82801H but 82801I. No functional change (The macro name
was changed but the vaule is the same).


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 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.