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

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jan 27 07:51:04 UTC 2018

Removed Files:
src/sys/arch/i386/conf: kern.ldscript.4MB largepages.inc

Log Message:
Remove these files. No one cares about this on i386, and there is no
point in keeping undocumented options nobody understands anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/conf/kern.ldscript.4MB
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/conf/largepages.inc

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



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

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jan 27 07:45:58 UTC 2018

Modified Files:
src/sys/arch/i386/i386: copy.S

Log Message:
Sync with amd64, in particular, add END() markers, don't fall through
functions, narrow the copy windows, and remove suword.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/i386/copy.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/i386/i386/copy.S
diff -u src/sys/arch/i386/i386/copy.S:1.25 src/sys/arch/i386/i386/copy.S:1.26
--- src/sys/arch/i386/i386/copy.S:1.25	Fri Sep 16 12:28:41 2016
+++ src/sys/arch/i386/i386/copy.S	Sat Jan 27 07:45:57 2018
@@ -1,7 +1,6 @@
-/*	$NetBSD: copy.S,v 1.25 2016/09/16 12:28:41 maxv Exp $	*/
-/*	NetBSD: locore.S,v 1.34 2005/04/01 11:59:31 yamt Exp $	*/
+/*	$NetBSD: copy.S,v 1.26 2018/01/27 07:45:57 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 1998, 2000, 2004, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -30,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*-
+/*
  * Copyright (c) 1990 The Regents of the University of California.
  * All rights reserved.
  *
@@ -65,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.25 2016/09/16 12:28:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.26 2018/01/27 07:45:57 maxv Exp $");
 
 #include "assym.h"
 
@@ -75,8 +74,8 @@ __KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.2
 #include 
 
 #define GET_CURPCB(reg)	\
-	movl	CPUVAR(CURLWP), reg; \
-	movl	L_PCB(reg), reg
+	movl	CPUVAR(CURLWP),reg; \
+	movl	L_PCB(reg),reg
 
 /*
  * These are arranged so that the abnormal case is a forwards
@@ -86,10 +85,10 @@ __KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.2
 #define DEFERRED_SWITCH_CHECK \
 	CHECK_DEFERRED_SWITCH			; \
 	jnz	99f; \
-	98:
+98:
 
 #define DEFERRED_SWITCH_CALL \
-	99:		; \
+99:		; \
 	call	_C_LABEL(do_pmap_load)		; \
 	jmp	98b
 
@@ -109,25 +108,26 @@ LABEL(x86_copyfunc_start)
  */
 NENTRY(do_pmap_load)
 	pushl	%ebp
-	movl	%esp, %ebp
+	movl	%esp,%ebp
 	pushl	%ebx
-	movl	CPUVAR(CURLWP), %ebx
+	movl	CPUVAR(CURLWP),%ebx
 1:
 	incl	L_NOPREEMPT(%ebx)
 	call	_C_LABEL(pmap_load)
 	decl	L_NOPREEMPT(%ebx)
 	jnz	2f
-	cmpl	$0, L_DOPREEMPT(%ebx)
+	cmpl	$0,L_DOPREEMPT(%ebx)
 	jz	2f
 	pushl	$0
 	call	_C_LABEL(kpreempt)
-	addl	$4, %esp
+	addl	$4,%esp
 2:
-	cmpl	$0, CPUVAR(WANT_PMAPLOAD)
+	cmpl	$0,CPUVAR(WANT_PMAPLOAD)
 	jnz	1b
 	popl	%ebx
 	leave
 	ret
+END(do_pmap_load)
 
 /*
  * void *return_address(unsigned int level);
@@ -151,12 +151,12 @@ ENTRY(return_address)
 	movl	0x4(%eax),%eax
 	movl	$0,PCB_ONFAULT(%edx)
 	ret
+END(return_address)
 
 /*
  * int kcopy(const void *from, void *to, size_t len);
- * Copy len bytes, abort on fault.
+ * Copy len bytes from and to kernel memory, and abort on fault.
  */
-/* LINTSTUB: Func: int kcopy(const void *from, void *to, size_t len) */
 ENTRY(kcopy)
 	pushl	%esi
 	pushl	%edi
@@ -206,6 +206,7 @@ ENTRY(kcopy)
 	popl	%esi
 	xorl	%eax,%eax
 	ret
+END(kcopy)
 
 /*/
 
@@ -219,110 +220,107 @@ ENTRY(kcopy)
  * Copy len bytes into the user's address space.
  * see copyout(9)
  */
-
-/* LINTSTUB: Func: int copyout(const void *kaddr, void *uaddr, size_t len) */
 ENTRY(copyout)
 	DEFERRED_SWITCH_CHECK
 	pushl	%esi
 	pushl	%edi
-	movl	12(%esp),%esi
-	movl	16(%esp),%edi
-	movl	20(%esp),%eax
-.Lcopyout_start:
-	/*
-	 * We check that the end of the destination buffer is not past the end
-	 * of the user's address space.
-	 */
+	movl	12(%esp),%esi	/* from */
+	movl	16(%esp),%edi	/* to */
+	movl	20(%esp),%eax	/* len */
+
 	movl	%edi,%edx
 	addl	%eax,%edx
 	jc	_C_LABEL(copy_efault)
 	cmpl	$VM_MAXUSER_ADDRESS,%edx
 	ja	_C_LABEL(copy_efault)
+
+.Lcopyout_start:
 	movl	%eax,%ecx
 	shrl	$2,%ecx
 	rep
 	movsl
 	andl	$3,%eax
-	jz	1f
+	jz	.Lcopyout_end
 	movl	%eax,%ecx
 	rep
 	movsb
-1:
 .Lcopyout_end:
+
 	popl	%edi
 	popl	%esi
 	xorl	%eax,%eax
 	ret
 	DEFERRED_SWITCH_CALL
+END(copyout)
 
 /*
  * int copyin(const void *from, void *to, size_t len);
  * Copy len bytes from the user's address space.
  * see copyin(9)
  */
-
-/* LINTSTUB: Func: int copyin(const void *uaddr, void *kaddr, size_t len) */
 ENTRY(copyin)
 	DEFERRED_SWITCH_CHECK
 	pushl	%esi
 	pushl	%edi
-	movl	12(%esp),%esi
-	movl	16(%esp),%edi
-	movl	20(%esp),%eax
-	/*
-	 * We check that the end of the source buffer is not past the end of
-	 * the user's address space.  If it's not, then we only need to check
-	 * that each page is readable, and the CPU will do that for us.
-	 */
-.Lcopyin_start:
+	movl	12(%esp),%esi	/* from */
+	movl	16(%esp),%edi	/* to */
+	movl	20(%esp),%eax	/* len */
+
 	movl	%esi,%edx
 	addl	%eax,%edx
 	jc	_C_LABEL(copy_efault)
 	cmpl	$VM_MAXUSER_ADDRESS,%edx
 	ja	_C_LABEL(copy_efault)
+
+.Lcopyin_start:
 	movl	%eax,%ecx
 	shrl	$2,%ecx
 	rep
 	movsl
 	andl	$3,%eax
-	jz	1f
+	jz	.Lcopyin_end
 	movl	%eax,%ecx
 	rep
 	movsb
-1:
 .Lcopyin_end:
+
 	popl	

CVS commit: src/sys/fs/msdosfs

2018-01-26 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Jan 27 03:54:01 UTC 2018

Modified Files:
src/sys/fs/msdosfs: msdosfs_fat.c

Log Message:
Need strings.h for ffs()
Resolves implict declaration warning of ffs() when building tools via build.sh


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/fs/msdosfs/msdosfs_fat.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/fs/msdosfs/msdosfs_fat.c
diff -u src/sys/fs/msdosfs/msdosfs_fat.c:1.31 src/sys/fs/msdosfs/msdosfs_fat.c:1.32
--- src/sys/fs/msdosfs/msdosfs_fat.c:1.31	Sat May  7 16:43:02 2016
+++ src/sys/fs/msdosfs/msdosfs_fat.c	Sat Jan 27 03:54:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_fat.c,v 1.31 2016/05/07 16:43:02 mlelstv Exp $	*/
+/*	$NetBSD: msdosfs_fat.c,v 1.32 2018/01/27 03:54:01 sevan Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.31 2016/05/07 16:43:02 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.32 2018/01/27 03:54:01 sevan Exp $");
 
 /*
  * kernel include files.
@@ -69,6 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.
 #include 
 #include 		/* to define vattr structure */
 #else
+#include 
 #include 
 #endif
 



CVS commit: src/usr.sbin/makefs/msdos

2018-01-26 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Jan 27 02:07:33 UTC 2018

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vfsops.c

Log Message:
Need strings.h for ffs()


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c

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

Modified files:

Index: src/usr.sbin/makefs/msdos/msdosfs_vfsops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.10 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.11
--- src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.10	Sat Jan 30 09:59:27 2016
+++ src/usr.sbin/makefs/msdos/msdosfs_vfsops.c	Sat Jan 27 02:07:33 2018
@@ -50,7 +50,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.10 2016/01/30 09:59:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.11 2018/01/27 02:07:33 sevan Exp $");
 
 #include 
 
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_vfso
 #include 
 #include 
 #include 
+#include 
 
 #include "makefs.h"
 #include "msdos.h"



CVS commit: src/sys/modules/amdzentemp

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 00:23:19 UTC 2018

Modified Files:
src/sys/modules/amdzentemp: amdzentemp.ioconf

Log Message:
use the intermediate bus


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/amdzentemp/amdzentemp.ioconf

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

Modified files:

Index: src/sys/modules/amdzentemp/amdzentemp.ioconf
diff -u src/sys/modules/amdzentemp/amdzentemp.ioconf:1.1 src/sys/modules/amdzentemp/amdzentemp.ioconf:1.2
--- src/sys/modules/amdzentemp/amdzentemp.ioconf:1.1	Thu Jan 25 18:40:06 2018
+++ src/sys/modules/amdzentemp/amdzentemp.ioconf	Fri Jan 26 19:23:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: amdzentemp.ioconf,v 1.1 2018/01/25 23:40:06 pgoyette Exp $
+# $NetBSD: amdzentemp.ioconf,v 1.2 2018/01/27 00:23:19 christos Exp $
 
 ioconf amdzentemp
 
@@ -6,6 +6,6 @@ include "conf/files"
 include "dev/pci/files.pci"
 include "arch/x86/pci/files.pci"
 
-pseudo-root amdsmn*
+pseudo-root amdsmnbus*
 
-amdzentemp* at amdsmn?
+amdzentemp* at amdsmnbus?



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

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 00:21:42 UTC 2018

Modified Files:
src/sys/arch/x86/pci: files.pci

Log Message:
provide an intermediate "bus" for the module and to be the same structure
like amdtemp


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/pci/files.pci

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

Modified files:

Index: src/sys/arch/x86/pci/files.pci
diff -u src/sys/arch/x86/pci/files.pci:1.22 src/sys/arch/x86/pci/files.pci:1.23
--- src/sys/arch/x86/pci/files.pci:1.22	Wed Jan 24 20:22:21 2018
+++ src/sys/arch/x86/pci/files.pci	Fri Jan 26 19:21:41 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.22 2018/01/25 01:22:21 christos Exp $
+#	$NetBSD: files.pci,v 1.23 2018/01/27 00:21:41 christos Exp $
 
 device 	aapic
 attach 	aapic at pci
@@ -10,6 +10,7 @@ define	agp_x86: agp_ali, agp_amd, agp_am
 defflag	AGP_X86
 
 define amdnb_miscbus {}
+define amdsmnbus {}
 
 # PCI-Host bridge chipsets
 device	pchb:	pcibus, agpbus, agp_x86
@@ -36,13 +37,13 @@ attach	amdnb_misc at pci
 file	arch/x86/pci/amdnb_misc.c	amdnb_misc
  
 # AMD Family 17h system management network
-device	amdsmn {}
+device	amdsmn: amdsmnbus
 attach	amdsmn at pci
 file arch/x86/pci/amdsmn.c		amdsmn
 
 # AMD Family 17h CPU temp sensor
 device	amdzentemp: sysmon_envsys
-attach	amdzentemp at amdsmn
+attach	amdzentemp at amdsmnbus
 file	arch/x86/pci/amdzentemp.c		amdzentemp
 
 device	amdtemp: sysmon_envsys



CVS commit: src/sys/kern

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 00:00:26 UTC 2018

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

Log Message:
remove useless KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 src/sys/kern/kern_sysctl.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_sysctl.c
diff -u src/sys/kern/kern_sysctl.c:1.260 src/sys/kern/kern_sysctl.c:1.261
--- src/sys/kern/kern_sysctl.c:1.260	Fri Jan 26 17:54:33 2018
+++ src/sys/kern/kern_sysctl.c	Fri Jan 26 19:00:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $	*/
+/*	$NetBSD: kern_sysctl.c,v 1.261 2018/01/27 00:00:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.261 2018/01/27 00:00:26 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_defcorename.h"
@@ -2415,8 +2415,6 @@ sysctl_log_add(struct sysctllog **logp, 
 	const struct sysctlnode *pnode;
 	struct sysctllog *log;
 
-	KASSERT(namelen < CTL_MAXNAME);
-
 	if (node->sysctl_flags & CTLFLAG_PERMANENT)
 		return (0);
 



CVS commit: src/sys/dev/pad

2018-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 26 23:36:01 UTC 2018

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Fix typo in previous.  mea culpa, mea culpa, mea maxima culpa


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.51 src/sys/dev/pad/pad.c:1.52
--- src/sys/dev/pad/pad.c:1.51	Fri Jan 26 22:48:22 2018
+++ src/sys/dev/pad/pad.c	Fri Jan 26 23:36:01 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.51 2018/01/26 22:48:22 pgoyette Exp $ */
+/* $NetBSD: pad.c,v 1.52 2018/01/26 23:36:01 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.51 2018/01/26 22:48:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.52 2018/01/26 23:36:01 pgoyette Exp $");
 
 #include 
 #include 
@@ -308,7 +308,7 @@ pad_open(dev_t dev, int flags, int fmt, 
 	cfdata_t cf;
 	int error, fd, i;
 
-	erorr = 0;
+	error = 0;
 
 	mutex_enter();
 	if (PADUNIT(dev) == PADCLONER) {



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

2018-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 26 23:01:44 UTC 2018

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

Log Message:
sc->sc_sensor cannot be NULL since it was just allocated with KM_SLEEP
(which cannot fail).  So remove the NULL-check.  CID/1428644


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/pci/amdzentemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.6 src/sys/arch/x86/pci/amdzentemp.c:1.7
--- src/sys/arch/x86/pci/amdzentemp.c:1.6	Thu Jan 25 23:37:33 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Fri Jan 26 23:01:44 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.7 2018/01/26 23:01:44 pgoyette Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7 2018/01/26 23:01:44 pgoyette Exp $ ");
 
 #include 
 #include 
@@ -167,10 +167,8 @@ bad:
 		sc->sc_sme = NULL;
 	}
 
-	if (sc->sc_sensor != NULL) {
-		kmem_free(sc->sc_sensor, sc->sc_sensor_len);
-		sc->sc_sensor = NULL;
-	}
+	kmem_free(sc->sc_sensor, sc->sc_sensor_len);
+	sc->sc_sensor = NULL;
 }
 
 static int



CVS commit: src/sys/kern

2018-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 26 22:58:09 UTC 2018

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

Log Message:
Ensure that dev is not NULL - CID/1428649


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/sys/kern/subr_autoconf.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/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.255 src/sys/kern/subr_autoconf.c:1.256
--- src/sys/kern/subr_autoconf.c:1.255	Fri Oct 27 12:25:15 2017
+++ src/sys/kern/subr_autoconf.c	Fri Jan 26 22:58:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.255 2017/10/27 12:25:15 joerg Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.256 2018/01/26 22:58:09 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.255 2017/10/27 12:25:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.256 2018/01/26 22:58:09 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1398,6 +1398,7 @@ config_devalloc(const device_t parent, c
 #ifdef DIAGNOSTIC
 		printf("%s has not been converted to device_t\n", cd->cd_name);
 #endif
+		KASSERT(dev != NULL);
 	}
 	dev->dv_class = cd->cd_class;
 	dev->dv_cfdata = cf;



CVS commit: src/sys/kern

2018-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 26 22:54:33 UTC 2018

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

Log Message:
Bounds checking - CID/1428650


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/kern/kern_sysctl.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_sysctl.c
diff -u src/sys/kern/kern_sysctl.c:1.259 src/sys/kern/kern_sysctl.c:1.260
--- src/sys/kern/kern_sysctl.c:1.259	Tue Apr 25 22:07:10 2017
+++ src/sys/kern/kern_sysctl.c	Fri Jan 26 22:54:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sysctl.c,v 1.259 2017/04/25 22:07:10 pgoyette Exp $	*/
+/*	$NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.259 2017/04/25 22:07:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.260 2018/01/26 22:54:33 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_defcorename.h"
@@ -2415,6 +2415,8 @@ sysctl_log_add(struct sysctllog **logp, 
 	const struct sysctlnode *pnode;
 	struct sysctllog *log;
 
+	KASSERT(namelen < CTL_MAXNAME);
+
 	if (node->sysctl_flags & CTLFLAG_PERMANENT)
 		return (0);
 
@@ -2476,7 +2478,7 @@ sysctl_log_add(struct sysctllog **logp, 
 	 * stuff name in, then namelen, then node type, and finally,
 	 * the version for non-node nodes.
 	 */
-	for (i = 0; i < namelen; i++)
+	for (i = 0; i < namelen && i < CTL_MAXNAME; i++)
 		log->log_num[--log->log_left] = name[i];
 	log->log_num[--log->log_left] = namelen;
 	log->log_num[--log->log_left] = SYSCTL_TYPE(node->sysctl_flags);



CVS commit: src/sys/dev/pad

2018-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 26 22:48:22 UTC 2018

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Unitialized variable - CID/1428657


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.50 src/sys/dev/pad/pad.c:1.51
--- src/sys/dev/pad/pad.c:1.50	Tue Jan  9 04:23:59 2018
+++ src/sys/dev/pad/pad.c	Fri Jan 26 22:48:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.50 2018/01/09 04:23:59 nat Exp $ */
+/* $NetBSD: pad.c,v 1.51 2018/01/26 22:48:22 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.50 2018/01/09 04:23:59 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.51 2018/01/26 22:48:22 pgoyette Exp $");
 
 #include 
 #include 
@@ -308,6 +308,8 @@ pad_open(dev_t dev, int flags, int fmt, 
 	cfdata_t cf;
 	int error, fd, i;
 
+	erorr = 0;
+
 	mutex_enter();
 	if (PADUNIT(dev) == PADCLONER) {
 		for (i = 0; i < MAXDEVS; i++) {



CVS commit: [netbsd-8] src/doc

2018-01-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 26 19:53:10 UTC 2018

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

Log Message:
Note tickets #508, #510, #511 and #512


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.106 src/doc/CHANGES-8.0:1.1.2.107
--- src/doc/CHANGES-8.0:1.1.2.106	Mon Jan 22 12:36:02 2018
+++ src/doc/CHANGES-8.0	Fri Jan 26 19:53:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.106 2018/01/22 12:36:02 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.107 2018/01/26 19:53:10 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9175,3 +9175,92 @@ sys/fs/msdosfs/msdosfs_vfsops.c			1.129
 	Relax sanity check. It's ok to have more FAT sectors than needed.
 	[mlelstv, ticket #508]
 
+sys/arch/acorn26/conf/GENERIC			1.85
+sys/arch/acorn32/conf/EB7500ATX			1.64
+sys/arch/acorn32/conf/GENERIC			1.124
+sys/arch/alpha/conf/GENERIC			1.379
+sys/arch/amd64/conf/XEN3_DOM0			1.145
+sys/arch/amd64/conf/XEN3_DOMU			1.83
+sys/arch/amiga/conf/DRACO			1.185
+sys/arch/amiga/conf/GENERIC			1.319
+sys/arch/amiga/conf/GENERIC.in			1.137
+sys/arch/amiga/conf/INSTALL			1.129
+sys/arch/amigappc/conf/GENERIC			1.33
+sys/arch/amigappc/conf/NULL			1.53
+sys/arch/arc/conf/GENERIC			1.189
+sys/arch/arc/conf/RPC441.54
+sys/arch/atari/conf/GENERIC.in			1.115
+sys/arch/bebox/conf/GENERIC			1.157
+sys/arch/cats/conf/GENERIC			1.166
+sys/arch/cesfic/conf/GENERIC			1.69
+sys/arch/cobalt/conf/GENERIC			1.156
+sys/arch/cobalt/conf/INSTALL			1.65
+sys/arch/emips/conf/GENERIC			1.21
+sys/arch/evbarm/conf/MMNET_GENERIC		1.34
+sys/arch/evbarm/conf/MPCSA_GENERIC		1.55
+sys/arch/evbarm/conf/MV2120			1.35
+sys/arch/evbarm64/conf/A64EMUL			1.11
+sys/arch/evbppc/conf/EXPLORA451			1.62
+sys/arch/ews4800mips/conf/GENERIC		1.56
+sys/arch/hp300/conf/GENERIC			1.198
+sys/arch/hpcsh/conf/GENERIC			1.110
+sys/arch/hppa/conf/GENERIC			1.17
+sys/arch/i386/conf/XEN3_DOM0			1.125
+sys/arch/i386/conf/XEN3_DOMU			1.88
+sys/arch/iyonix/conf/GENERIC			1.97
+sys/arch/landisk/conf/GENERIC			1.58
+sys/arch/luna68k/conf/GENERIC			1.125
+sys/arch/luna68k/conf/INSTALL			1.25
+sys/arch/mac68k/conf/GENERIC			1.225
+sys/arch/macppc/conf/GENERIC			1.339
+sys/arch/macppc/conf/GENERIC_601		1.16
+sys/arch/macppc/conf/MAMBO			1.27
+sys/arch/macppc/conf/POWERMAC_G5		1.29
+sys/arch/mipsco/conf/GENERIC			1.92
+sys/arch/mvme68k/conf/GENERIC			1.98
+sys/arch/netwinder/conf/GENERIC			1.134
+sys/arch/news68k/conf/GENERIC			1.130
+sys/arch/news68k/conf/GENERIC_TINY		1.86
+sys/arch/news68k/conf/LIBERO			1.66
+sys/arch/newsmips/conf/GENERIC			1.133
+sys/arch/next68k/conf/GENERIC			1.145
+sys/arch/pmax/conf/GENERIC			1.196
+sys/arch/pmax/conf/GENERIC64			1.28
+sys/arch/prep/conf/GENERIC			1.185
+sys/arch/rs6000/conf/GENERIC			1.39
+sys/arch/sandpoint/conf/GENERIC			1.97
+sys/arch/sgimips/conf/GENERIC32_IP12		1.33
+sys/arch/sgimips/conf/GENERIC32_IP2x		1.112
+sys/arch/sgimips/conf/GENERIC32_IP3x		1.115
+sys/arch/sparc/conf/GENERIC			1.258
+sys/arch/sparc/conf/MRCOFFEE			1.54
+sys/arch/sparc64/conf/GENERIC			1.203
+sys/arch/sun2/conf/GENERIC			1.99
+sys/arch/sun3/conf/GENERIC			1.176
+sys/arch/sun3/conf/GENERIC3X			1.130
+sys/arch/vax/conf/GENERIC			1.204
+sys/arch/vax/conf/VAX780			1.25
+sys/arch/x68k/conf/GENERIC			1.187
+
+	Alternate buffer queue strategies no longer considered experimental,
+	update description.
+	[sevan, ticket #510]
+
+sys/kern/kern_timeout.c1.54
+sys/netinet/if_arp.c1.256
+sys/netinet6/nd6_nbr.c1.141,1.144
+
+	Fix a deadlock on callout_halt of nd6_dad_timer.
+	Make DAD destructions (MP-)safe with callout_stop.
+	Sanity-check if interlock is held when it's passed.
+	[ozaki-r, ticket #511]
+
+
+sys/netipsec/xform_ah.c1.75-1.76
+
+	Revert a part of rev 1.49, the pointer given to memcpy
+	was correct.
+	Fix a vulnerability in IPsec-IPv6-AH, that allows an attacker
+	to remotely crash the kernel with a single packet.
+	[maxv, ticket #512]
+



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

2018-01-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 26 19:51:19 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-8]: xform_ah.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #512):
sys/netipsec/xform_ah.c: revision 1.75
sys/netipsec/xform_ah.c: revision 1.76
Revert a part of rev1.49 (six months ago). The pointer given to memcpy
was correct.
Discussed with Christos and Ryota.
Fix a vulnerability in IPsec-IPv6-AH, that allows an attacker to remotely
crash the kernel with a single packet.
In this loop we need to increment 'ad' by two, because the length field
of the option header does not count the size of the option header itself.
If the length is zero, then 'count' is incremented by zero, and there's
an infinite loop. Beyond that, this code was written with the assumption
that since the IPv6 packet already went through the generic IPv6 option
parser, several fields are guaranteed to be valid; but this assumption
does not hold because of the missing '+2', and there's as a result a
triggerable buffer overflow (write zeros after the end of the mbuf,
potentially to the next mbuf in memory since it's a pool).
Add the missing '+2', this place will be reinforced in separate commits.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/netipsec/xform_ah.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/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.54.2.1 src/sys/netipsec/xform_ah.c:1.54.2.2
--- src/sys/netipsec/xform_ah.c:1.54.2.1	Sat Oct 21 19:43:54 2017
+++ src/sys/netipsec/xform_ah.c	Fri Jan 26 19:51:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.54.2.1 2017/10/21 19:43:54 snj Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.54.2.2 2018/01/26 19:51:19 martin Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.54.2.1 2017/10/21 19:43:54 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.54.2.2 2018/01/26 19:51:19 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -419,7 +419,7 @@ ah_massage_headers(struct mbuf **m0, int
 
 /* Zeroize all other options. */
 count = ptr[off + 1];
-memcpy(ptr, ipseczeroes, count);
+memcpy(ptr + off, ipseczeroes, count);
 off += count;
 break;
 			}
@@ -523,12 +523,12 @@ ah_massage_headers(struct mbuf **m0, int
 		return EINVAL;
 	}
 
-	ad = ptr[count + 1];
+	ad = ptr[count + 1] + 2;
 
 	/* If mutable option, zeroize. */
 	if (ptr[count] & IP6OPT_MUTABLE)
 		memcpy(ptr + count, ipseczeroes,
-		ptr[count + 1]);
+		ad);
 
 	count += ad;
 



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

2018-01-26 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Fri Jan 26 17:49:55 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Another try fixing printf format using the ultimate uintmax_t idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/e500_intr.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/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.36 src/sys/arch/powerpc/booke/e500_intr.c:1.37
--- src/sys/arch/powerpc/booke/e500_intr.c:1.36	Fri Jan 26 09:26:43 2018
+++ src/sys/arch/powerpc/booke/e500_intr.c	Fri Jan 26 17:49:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.37 2018/01/26 17:49:55 flxd Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.37 2018/01/26 17:49:55 flxd Exp $");
 
 #include 
 #include 
@@ -1150,8 +1150,8 @@ e500_intr_init(void)
 		break;
 #endif
 	default:
-		panic("%s: don't know how to deal with SVR %#" PRIxREGISTER,
-		__func__, mfspr(SPR_SVR));
+		panic("%s: don't know how to deal with SVR %#jx",
+		__func__, (uintmax_t)mfspr(SPR_SVR));
 	}
 
 	/*



CVS commit: src/sys/dev/pci

2018-01-26 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Jan 26 16:25:28 UTC 2018

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

Log Message:
Fix 82574 MSI-X mode cannot receive packets after 82574 receives high rate 
traffic.

In short, 82574 MSI-X mode does not cause RXQ MSI-X vector when 82574's
phys FIFO overflows. I don't know why but 82574 causes not RXQ MSI-X vector
but OTHER MSI-X vector at the situation.
see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc9=4aea7a5c5e940c1723add439f4088844cd26196d

advised by msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.558 -r1.559 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.558 src/sys/dev/pci/if_wm.c:1.559
--- src/sys/dev/pci/if_wm.c:1.558	Sun Jan 21 04:07:49 2018
+++ src/sys/dev/pci/if_wm.c	Fri Jan 26 16:25:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.558 2018/01/21 04:07:49 christos Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.559 2018/01/26 16:25:28 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.558 2018/01/21 04:07:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.559 2018/01/26 16:25:28 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -8962,8 +8962,14 @@ wm_txrxintr_enable(struct wm_queue *wmq)
 
 	wm_itrs_calculate(sc, wmq);
 
+	/*
+	 * ICR_OTHER which is disabled in wm_linkintr_msix() is enabled here.
+	 * There is no need to care about which of RXQ(0) and RXQ(1) enable
+	 * ICR_OTHER in first, because each RXQ/TXQ interrupt is disabled
+	 * while each wm_handle_queue(wmq) is runnig.
+	 */
 	if (sc->sc_type == WM_T_82574)
-		CSR_WRITE(sc, WMREG_IMS, ICR_TXQ(wmq->wmq_id) | ICR_RXQ(wmq->wmq_id));
+		CSR_WRITE(sc, WMREG_IMS, ICR_TXQ(wmq->wmq_id) | ICR_RXQ(wmq->wmq_id) | ICR_OTHER);
 	else if (sc->sc_type == WM_T_82575)
 		CSR_WRITE(sc, WMREG_EIMS, EITR_TX_QUEUE(wmq->wmq_id) | EITR_RX_QUEUE(wmq->wmq_id));
 	else
@@ -9060,24 +9066,59 @@ wm_linkintr_msix(void *arg)
 {
 	struct wm_softc *sc = arg;
 	uint32_t reg;
+	bool has_rxo;
 
 	DPRINTF(WM_DEBUG_LINK,
 	("%s: LINK: got link intr\n", device_xname(sc->sc_dev)));
 
 	reg = CSR_READ(sc, WMREG_ICR);
 	WM_CORE_LOCK(sc);
-	if ((sc->sc_core_stopping) || ((reg & ICR_LSC) == 0))
+	if (sc->sc_core_stopping)
 		goto out;
 
-	WM_EVCNT_INCR(>sc_ev_linkintr);
-	wm_linkintr(sc, ICR_LSC);
+	if((reg & ICR_LSC) != 0) {
+		WM_EVCNT_INCR(>sc_ev_linkintr);
+		wm_linkintr(sc, ICR_LSC);
+	}
+
+	/*
+	 * XXX 82574 MSI-X mode workaround
+	 *
+	 * 82574 MSI-X mode causes receive overrun(RXO) interrupt as ICR_OTHER
+	 * MSI-X vector, furthermore it does not cause neigher ICR_RXQ(0) nor
+	 * ICR_RXQ(1) vector. So, we generate ICR_RXQ(0) and ICR_RXQ(1)
+	 * interrupts by writing WMREG_ICS to process receive packets.
+	 */
+	if (sc->sc_type == WM_T_82574 && ((reg & ICR_RXO) != 0)) {
+#if defined(WM_DEBUG)
+		log(LOG_WARNING, "%s: Receive overrun\n",
+		device_xname(sc->sc_dev));
+#endif /* defined(WM_DEBUG) */
+
+		has_rxo = true;
+		/*
+		 * The RXO interrupt is very high rate when receive traffic is
+		 * high rate. We use polling mode for ICR_OTHER like Tx/Rx
+		 * interrupts. ICR_OTHER will be enabled at the end of
+		 * wm_txrxintr_msix() which is kicked by both ICR_RXQ(0) and
+		 * ICR_RXQ(1) interrupts.
+		 */
+		CSR_WRITE(sc, WMREG_IMC, ICR_OTHER);
+
+		CSR_WRITE(sc, WMREG_ICS, ICR_RXQ(0) | ICR_RXQ(1));
+	}
+
+
 
 out:
 	WM_CORE_UNLOCK(sc);
 	
-	if (sc->sc_type == WM_T_82574)
-		CSR_WRITE(sc, WMREG_IMS, ICR_OTHER | ICR_LSC);
-	else if (sc->sc_type == WM_T_82575)
+	if (sc->sc_type == WM_T_82574) {
+		if (!has_rxo)
+			CSR_WRITE(sc, WMREG_IMS, ICR_OTHER | ICR_LSC);
+		else
+			CSR_WRITE(sc, WMREG_IMS, ICR_LSC);
+	} else if (sc->sc_type == WM_T_82575)
 		CSR_WRITE(sc, WMREG_EIMS, EITR_OTHER);
 	else
 		CSR_WRITE(sc, WMREG_EIMS, 1 << sc->sc_link_intr_idx);



CVS commit: [netbsd-8] src/sys

2018-01-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 26 15:41:13 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: kern_timeout.c
src/sys/netinet [netbsd-8]: if_arp.c
src/sys/netinet6 [netbsd-8]: nd6_nbr.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #511):
sys/kern/kern_timeout.c: revision 1.54
sys/netinet6/nd6_nbr.c: revision 1.141
sys/netinet6/nd6_nbr.c: revision 1.144
sys/netinet/if_arp.c: revision 1.256
Fix a deadlock on callout_halt of nd6_dad_timer
We must not call callout_halt of nd6_dad_timer with holding nd6_dad_lock because
the lock is taken in nd6_dad_timer. Once softnet_lock goes away, we can pass the
lock to callout_halt, but for now we cannot.
Make DAD destructions (MP-)safe with callout_stop
arp_dad_stoptimer and nd6_dad_stoptimer can be called with or without
softnet_lock held and unfortunately we have no easy way to statically know 
which.
So it is hard to use callout_halt there.
To address the situation, we use callout_stop to make the code safe. The new
approach copes with the issue by delegating the destruction of a callout to
callout itself, which allows us to not wait the callout to finish. This can be
done thanks to that DAD objects are separated from other data such as ifa.
The approach is suggested by riastradh@
Proposed on tech-kern@ and tech-net@
Sanity-check if interlock is held when it's passed


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/kern/kern_timeout.c
cvs rdiff -u -r1.250.2.4 -r1.250.2.5 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.138.6.1 -r1.138.6.2 src/sys/netinet6/nd6_nbr.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_timeout.c
diff -u src/sys/kern/kern_timeout.c:1.52 src/sys/kern/kern_timeout.c:1.52.2.1
--- src/sys/kern/kern_timeout.c:1.52	Thu Jun  1 02:45:13 2017
+++ src/sys/kern/kern_timeout.c	Fri Jan 26 15:41:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_timeout.c,v 1.52 2017/06/01 02:45:13 chs Exp $	*/
+/*	$NetBSD: kern_timeout.c,v 1.52.2.1 2018/01/26 15:41:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.52 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.52.2.1 2018/01/26 15:41:12 martin Exp $");
 
 /*
  * Timeouts are kept in a hierarchical timing wheel.  The c_time is the
@@ -473,6 +473,7 @@ callout_halt(callout_t *cs, void *interl
 
 	KASSERT(c->c_magic == CALLOUT_MAGIC);
 	KASSERT(!cpu_intr_p());
+	KASSERT(interlock == NULL || mutex_owned(interlock));
 
 	lock = callout_lock(c);
 	relock = NULL;

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.250.2.4 src/sys/netinet/if_arp.c:1.250.2.5
--- src/sys/netinet/if_arp.c:1.250.2.4	Tue Jan  2 10:20:34 2018
+++ src/sys/netinet/if_arp.c	Fri Jan 26 15:41:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.250.2.4 2018/01/02 10:20:34 snj Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.250.2.5 2018/01/26 15:41:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.250.2.4 2018/01/02 10:20:34 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.250.2.5 2018/01/26 15:41:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -173,7 +173,8 @@ static	void revarprequest(struct ifnet *
 
 static	void arp_drainstub(void);
 
-static void arp_dad_timer(struct ifaddr *);
+struct dadq;
+static void arp_dad_timer(struct dadq *);
 static void arp_dad_start(struct ifaddr *);
 static void arp_dad_stop(struct ifaddr *);
 static void arp_dad_duplicated(struct ifaddr *, const char *);
@@ -1534,18 +1535,18 @@ arp_dad_starttimer(struct dadq *dp, int 
 {
 
 	callout_reset(>dad_timer_ch, ticks,
-	(void (*)(void *))arp_dad_timer, (void *)dp->dad_ifa);
+	(void (*)(void *))arp_dad_timer, dp);
 }
 
 static void
-arp_dad_stoptimer(struct dadq *dp)
+arp_dad_destroytimer(struct dadq *dp)
 {
 
-#ifdef NET_MPSAFE
-	callout_halt(>dad_timer_ch, NULL);
-#else
-	callout_halt(>dad_timer_ch, softnet_lock);
-#endif
+	TAILQ_REMOVE(, dp, dad_list);
+	/* Request the timer to destroy dp. */
+	dp->dad_ifa = NULL;
+	callout_reset(>dad_timer_ch, 0,
+	(void (*)(void *))arp_dad_timer, dp);
 }
 
 static void
@@ -1665,36 +1666,39 @@ arp_dad_stop(struct ifaddr *ifa)
 	}
 
 	/* Prevent the timer from running anymore. */
-	TAILQ_REMOVE(, dp, dad_list);
-	mutex_exit(_dad_lock);
+	arp_dad_destroytimer(dp);
 
-	arp_dad_stoptimer(dp);
+	mutex_exit(_dad_lock);
 
-	kmem_intr_free(dp, sizeof(*dp));
 	ifafree(ifa);
 }
 
 static void
-arp_dad_timer(struct ifaddr *ifa)
+arp_dad_timer(struct dadq *dp)
 {
-	struct in_ifaddr *ia = (struct in_ifaddr *)ifa;
-	struct dadq *dp;
+	struct ifaddr *ifa;
+	struct in_ifaddr *ia;
 	char 

CVS commit: src/share/man/man4/man4.x86

2018-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jan 26 15:12:37 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdsmn.4

Log Message:
Remove Tn. Mention first NetBSD release.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.x86/amdsmn.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/man4.x86/amdsmn.4
diff -u src/share/man/man4/man4.x86/amdsmn.4:1.2 src/share/man/man4/man4.x86/amdsmn.4:1.3
--- src/share/man/man4/man4.x86/amdsmn.4:1.2	Thu Jan 25 10:52:49 2018
+++ src/share/man/man4/man4.x86/amdsmn.4	Fri Jan 26 15:12:37 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: amdsmn.4,v 1.2 2018/01/25 10:52:49 uwe Exp $
+.\"	$NetBSD: amdsmn.4,v 1.3 2018/01/26 15:12:37 wiz Exp $
 .\"
 .\" Copyright (c) 2018 Ian Clark 
 .\" All rights reserved.
@@ -59,25 +59,23 @@
 .Os
 .Sh NAME
 .Nm amdsmn
-.Nd device driver for
-.Tn AMD
-processor System Management Network
+.Nd device driver for AMD processor System Management Network
 .Sh SYNOPSIS
 .Cd "amdsmn* at pci?"
 .Sh DESCRIPTION
 The
 .Nm
 driver provides support for resources on the System Management Network bus
-in
-.Tn AMD
-Family 17h processors.
+in AMD Family 17h processors.
 .Sh SEE ALSO
 .Xr amdzentemp 4
 .Sh HISTORY
 The
 .Nm
 driver first appeared in
-.Fx .
+.Fx
+and
+.Nx 9.0 .
 .Sh AUTHORS
 .An -nosplit
 Based on the



CVS commit: src/sys

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 14:47:41 UTC 2018

Modified Files:
src/sys/net: if_etherip.c
src/sys/netinet: ip_etherip.c
src/sys/netinet6: ip6_etherip.c

Log Message:
A few fixes:

 * Style.

 * Don't add M_PKTHDR manually, that's absolutely forbidden. Add a
   KASSERT to make sure it's already there.

 * Add a missing NULL check after m_pullup.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/net/if_etherip.c
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet/ip_etherip.c
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet6/ip6_etherip.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_etherip.c
diff -u src/sys/net/if_etherip.c:1.41 src/sys/net/if_etherip.c:1.42
--- src/sys/net/if_etherip.c:1.41	Fri Jan 26 11:06:32 2018
+++ src/sys/net/if_etherip.c	Fri Jan 26 14:47:41 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_etherip.c,v 1.41 2018/01/26 11:06:32 maxv Exp $*/
+/*  $NetBSD: if_etherip.c,v 1.42 2018/01/26 14:47:41 maxv Exp $*/
 
 /*
  *  Copyright (c) 2006, Hans Rosenfeld 
@@ -27,8 +27,9 @@
  *  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.
- *
- *
+ */
+
+/*
  *  Copyright (c) 2003, 2004, 2008 The NetBSD Foundation.
  *  All rights reserved.
  *
@@ -55,9 +56,9 @@
  *  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.
- *
- *
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ */
+
+/* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -86,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.41 2018/01/26 11:06:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.42 2018/01/26 14:47:41 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -227,7 +228,7 @@ etherip_attach(device_t parent, device_t
 	memcpy(enaddr+3, (uint8_t *), 3);
 
 	aprint_verbose_dev(self, "Ethernet address %s\n",
-		   ether_snprintf(enaddrstr, sizeof(enaddrstr), enaddr));
+	ether_snprintf(enaddrstr, sizeof(enaddrstr), enaddr));
 
 	/*
 	 * Why 1000baseT? Why not? You can add more.
@@ -363,7 +364,7 @@ etherip_start(struct ifnet *ifp)
 {
 	struct etherip_softc *sc = ifp->if_softc;
 
-	if(sc->sc_si)
+	if (sc->sc_si)
 		softint_schedule(sc->sc_si);
 }
 
@@ -400,10 +401,14 @@ etheripintr(void *arg)
 break;
 #endif
 			default:
+/* impossible */
+m_freem(m);
 error = ENETDOWN;
 			}
 			ifp->if_flags &= ~IFF_OACTIVE;
-		} else  m_freem(m);
+		} else {
+			m_freem(m);
+		}
 	}
 	mutex_exit(softnet_lock);
 	__USE(error);

Index: src/sys/netinet/ip_etherip.c
diff -u src/sys/netinet/ip_etherip.c:1.20 src/sys/netinet/ip_etherip.c:1.21
--- src/sys/netinet/ip_etherip.c:1.20	Wed Jan 11 13:08:29 2017
+++ src/sys/netinet/ip_etherip.c	Fri Jan 26 14:47:41 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: ip_etherip.c,v 1.20 2017/01/11 13:08:29 ozaki-r Exp $*/
+/*  $NetBSD: ip_etherip.c,v 1.21 2018/01/26 14:47:41 maxv Exp $*/
 
 /*
  *  Copyright (c) 2006, Hans Rosenfeld 
@@ -27,8 +27,9 @@
  *  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.
- *
- *
+ */
+
+/*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
  *
@@ -58,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_etherip.c,v 1.20 2017/01/11 13:08:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_etherip.c,v 1.21 2018/01/26 14:47:41 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -107,7 +108,7 @@ ip_etherip_output(struct ifnet *ifp, str
 	sin_src = (struct sockaddr_in *)sc->sc_src;
 	sin_dst = (struct sockaddr_in *)sc->sc_dst;
 
-	if (sin_src == NULL || 
+	if (sin_src == NULL ||
 	sin_dst == NULL ||
 	sin_src->sin_family != AF_INET ||
 	sin_dst->sin_family != AF_INET) {
@@ -118,7 +119,7 @@ ip_etherip_output(struct ifnet *ifp, str
 	/* reset broadcast/multicast flags */
 	m->m_flags &= ~(M_BCAST|M_MCAST);
 
-	m->m_flags |= M_PKTHDR;
+	KASSERT((m->m_flags & M_PKTHDR) != 0);
 	proto = IPPROTO_ETHERIP;
 
 	/* fill and prepend Ethernet-in-IP header */
@@ -132,8 +133,8 @@ ip_etherip_output(struct ifnet *ifp, str
 		if (m == NULL)
 			return ENOBUFS;
 	}
-	memcpy(mtod(m, struct etherip_header *), , 
-	   sizeof(struct etherip_header));
+	memcpy(mtod(m, struct etherip_header *), ,
+	sizeof(struct etherip_header));
 
 	/* fill new IP header */
 	memset(, 0, sizeof(struct ip));
@@ -156,6 +157,8 @@ ip_etherip_output(struct 

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

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 14:41:22 UTC 2018

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

Log Message:
Add etherip, so that we at least know it exists on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.482 -r1.483 src/sys/arch/amd64/conf/GENERIC

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/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.482 src/sys/arch/amd64/conf/GENERIC:1.483
--- src/sys/arch/amd64/conf/GENERIC:1.482	Thu Jan 25 01:21:40 2018
+++ src/sys/arch/amd64/conf/GENERIC	Fri Jan 26 14:41:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.482 2018/01/25 01:21:40 christos Exp $
+# $NetBSD: GENERIC,v 1.483 2018/01/26 14:41:22 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.482 $"
+#ident		"GENERIC-$Revision: 1.483 $"
 
 maxusers	64		# estimated number of users
 
@@ -1299,6 +1299,7 @@ pseudo-device	bridge			# simple inter-ne
 #options 	BRIDGE_IPF		# bridge uses IP/IPv6 pfil hooks too
 pseudo-device	agr			# IEEE 802.3ad link aggregation
 pseudo-device	l2tp			# L2TPv3 interface
+#pseudo-device	etherip			# Tunnel Ethernet over IP
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if
 #pseudo-device	pfsync			# PF sync if



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

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 14:38:46 UTC 2018

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

Log Message:
Zero out the scratch value in the UTLS page during context switches. We
temporarily put %rax there when processing syscalls, and we wouldn't
want the new lwp to see the %rax value of the previous lwp.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 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.295 src/sys/arch/amd64/amd64/machdep.c:1.296
--- src/sys/arch/amd64/amd64/machdep.c:1.295	Sun Jan 21 11:21:40 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Fri Jan 26 14:38:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.295 2018/01/21 11:21:40 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.296 2018/01/26 14:38:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.295 2018/01/21 11:21:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.296 2018/01/26 14:38:46 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -2522,6 +2522,7 @@ void
 svs_lwp_switch(struct lwp *oldlwp, struct lwp *newlwp)
 {
 	struct cpu_info *ci = curcpu();
+	struct svs_utls *utls;
 	struct pcb *pcb;
 	pt_entry_t *pte;
 	uintptr_t rsp0;
@@ -2551,6 +2552,9 @@ svs_lwp_switch(struct lwp *oldlwp, struc
 	KASSERT((ci->ci_svs_krsp0 % PAGE_SIZE) ==
 	(ci->ci_svs_ursp0 % PAGE_SIZE));
 
+	utls = (struct svs_utls *)ci->ci_svs_utls;
+	utls->scratch = 0;
+
 	/*
 	 * Enter the user rsp0. We don't need to flush the TLB here, since
 	 * the user page tables are not loaded.



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

2018-01-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 26 14:28:17 UTC 2018

Modified Files:
src/sys/arch/acorn26/conf [netbsd-8]: GENERIC
src/sys/arch/acorn32/conf [netbsd-8]: EB7500ATX GENERIC
src/sys/arch/alpha/conf [netbsd-8]: GENERIC
src/sys/arch/amd64/conf [netbsd-8]: XEN3_DOM0 XEN3_DOMU
src/sys/arch/amiga/conf [netbsd-8]: DRACO GENERIC GENERIC.in INSTALL
src/sys/arch/amigappc/conf [netbsd-8]: GENERIC NULL
src/sys/arch/arc/conf [netbsd-8]: GENERIC RPC44
src/sys/arch/atari/conf [netbsd-8]: GENERIC.in
src/sys/arch/bebox/conf [netbsd-8]: GENERIC
src/sys/arch/cats/conf [netbsd-8]: GENERIC
src/sys/arch/cesfic/conf [netbsd-8]: GENERIC
src/sys/arch/cobalt/conf [netbsd-8]: GENERIC INSTALL
src/sys/arch/emips/conf [netbsd-8]: GENERIC
src/sys/arch/evbarm/conf [netbsd-8]: MMNET_GENERIC MPCSA_GENERIC MV2120
src/sys/arch/evbarm64/conf [netbsd-8]: A64EMUL
src/sys/arch/evbppc/conf [netbsd-8]: EXPLORA451
src/sys/arch/ews4800mips/conf [netbsd-8]: GENERIC
src/sys/arch/hp300/conf [netbsd-8]: GENERIC
src/sys/arch/hpcsh/conf [netbsd-8]: GENERIC
src/sys/arch/hppa/conf [netbsd-8]: GENERIC
src/sys/arch/i386/conf [netbsd-8]: XEN3_DOM0 XEN3_DOMU
src/sys/arch/iyonix/conf [netbsd-8]: GENERIC
src/sys/arch/landisk/conf [netbsd-8]: GENERIC
src/sys/arch/luna68k/conf [netbsd-8]: GENERIC INSTALL
src/sys/arch/mac68k/conf [netbsd-8]: GENERIC
src/sys/arch/macppc/conf [netbsd-8]: GENERIC GENERIC_601 MAMBO
POWERMAC_G5
src/sys/arch/mipsco/conf [netbsd-8]: GENERIC
src/sys/arch/mvme68k/conf [netbsd-8]: GENERIC
src/sys/arch/netwinder/conf [netbsd-8]: GENERIC
src/sys/arch/news68k/conf [netbsd-8]: GENERIC GENERIC_TINY LIBERO
src/sys/arch/newsmips/conf [netbsd-8]: GENERIC
src/sys/arch/next68k/conf [netbsd-8]: GENERIC
src/sys/arch/pmax/conf [netbsd-8]: GENERIC GENERIC64
src/sys/arch/prep/conf [netbsd-8]: GENERIC
src/sys/arch/rs6000/conf [netbsd-8]: GENERIC
src/sys/arch/sandpoint/conf [netbsd-8]: GENERIC
src/sys/arch/sgimips/conf [netbsd-8]: GENERIC32_IP12 GENERIC32_IP2x
GENERIC32_IP3x
src/sys/arch/sparc/conf [netbsd-8]: GENERIC MRCOFFEE
src/sys/arch/sparc64/conf [netbsd-8]: GENERIC
src/sys/arch/sun2/conf [netbsd-8]: GENERIC
src/sys/arch/sun3/conf [netbsd-8]: GENERIC GENERIC3X
src/sys/arch/vax/conf [netbsd-8]: GENERIC VAX780
src/sys/arch/x68k/conf [netbsd-8]: GENERIC

Log Message:
Pull up following revision(s) (requested by sevan in ticket #510):
sys/arch/sun3/conf/GENERIC3X: revision 1.130
sys/arch/sparc64/conf/GENERIC: revision 1.203
sys/arch/news68k/conf/LIBERO: revision 1.66
sys/arch/amiga/conf/DRACO: revision 1.185
sys/arch/evbarm/conf/MV2120: revision 1.35
sys/arch/x68k/conf/GENERIC: revision 1.187
sys/arch/rs6000/conf/GENERIC: revision 1.39
sys/arch/news68k/conf/GENERIC_TINY: revision 1.86
sys/arch/i386/conf/XEN3_DOMU: revision 1.88
sys/arch/iyonix/conf/GENERIC: revision 1.97
sys/arch/evbarm64/conf/A64EMUL: revision 1.11
sys/arch/mvme68k/conf/GENERIC: revision 1.98
sys/arch/acorn32/conf/GENERIC: revision 1.124
sys/arch/i386/conf/XEN3_DOM0: revision 1.125
sys/arch/cobalt/conf/INSTALL: revision 1.65
sys/arch/macppc/conf/GENERIC_601: revision 1.16
sys/arch/hppa/conf/GENERIC: revision 1.17
sys/arch/amiga/conf/GENERIC.in: revision 1.137
sys/arch/sgimips/conf/GENERIC32_IP12: revision 1.33
sys/arch/netwinder/conf/GENERIC: revision 1.134
sys/arch/amd64/conf/XEN3_DOMU: revision 1.83
sys/arch/mac68k/conf/GENERIC: revision 1.225
sys/arch/arc/conf/RPC44: revision 1.54
sys/arch/mipsco/conf/GENERIC: revision 1.92
sys/arch/cats/conf/GENERIC: revision 1.166
sys/arch/amd64/conf/XEN3_DOM0: revision 1.145
sys/arch/amigappc/conf/GENERIC: revision 1.33
sys/arch/sun3/conf/GENERIC: revision 1.176
sys/arch/news68k/conf/GENERIC: revision 1.130
sys/arch/hpcsh/conf/GENERIC: revision 1.110
sys/arch/hp300/conf/GENERIC: revision 1.198
sys/arch/atari/conf/GENERIC.in: revision 1.115
sys/arch/sparc/conf/MRCOFFEE: revision 1.54
sys/arch/evbppc/conf/EXPLORA451: revision 1.62
sys/arch/cesfic/conf/GENERIC: revision 1.69
sys/arch/vax/conf/GENERIC: revision 1.204
sys/arch/sgimips/conf/GENERIC32_IP3x: revision 1.115
sys/arch/sgimips/conf/GENERIC32_IP2x: revision 1.112
sys/arch/sparc/conf/GENERIC: revision 1.258
sys/arch/next68k/conf/GENERIC: revision 1.145
sys/arch/evbarm/conf/MMNET_GENERIC: revision 1.34
sys/arch/prep/conf/GENERIC: revision 1.185

CVS commit: src/sys/net

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 14:10:15 UTC 2018

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

Log Message:
Use MH_ALIGN instead, ok knakahara@.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/net/if_l2tp.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_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.19 src/sys/net/if_l2tp.c:1.20
--- src/sys/net/if_l2tp.c:1.19	Fri Jan 26 07:49:15 2018
+++ src/sys/net/if_l2tp.c	Fri Jan 26 14:10:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.19 2018/01/26 07:49:15 maxv Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.20 2018/01/26 14:10:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.19 2018/01/26 07:49:15 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.20 2018/01/26 14:10:15 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -482,7 +482,6 @@ l2tp_input(struct mbuf *m, struct ifnet 
 		int copy_length;
 
 #define L2TP_COPY_LENGTH		60
-#define L2TP_LINK_HDR_ROOM	(MHLEN - L2TP_COPY_LENGTH - 4/*round4(2)*/)
 
 		if (m->m_pkthdr.len < L2TP_COPY_LENGTH) {
 			copy_length = m->m_pkthdr.len;
@@ -503,7 +502,7 @@ l2tp_input(struct mbuf *m, struct ifnet 
 		}
 		M_COPY_PKTHDR(m_head, m);
 
-		m_head->m_data += 2 /* align */ + L2TP_LINK_HDR_ROOM;
+		MH_ALIGN(m_head, L2TP_COPY_LENGTH);
 		memcpy(mtod(m_head, void *), mtod(m, void *), copy_length);
 		m_head->m_len = copy_length;
 		m->m_data += copy_length;



CVS commit: src/sys/net

2018-01-26 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 11:06:32 UTC 2018

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

Log Message:
Don't call if_attach, do if_initialize+if_register, otherwise when an
EtherIP packet is received the first KASSERT in if_input() fires.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/if_etherip.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_etherip.c
diff -u src/sys/net/if_etherip.c:1.40 src/sys/net/if_etherip.c:1.41
--- src/sys/net/if_etherip.c:1.40	Wed Dec  6 07:40:16 2017
+++ src/sys/net/if_etherip.c	Fri Jan 26 11:06:32 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_etherip.c,v 1.40 2017/12/06 07:40:16 ozaki-r Exp $*/
+/*  $NetBSD: if_etherip.c,v 1.41 2018/01/26 11:06:32 maxv Exp $*/
 
 /*
  *  Copyright (c) 2006, Hans Rosenfeld 
@@ -86,7 +86,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.40 2017/12/06 07:40:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_etherip.c,v 1.41 2018/01/26 11:06:32 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -266,14 +266,15 @@ etherip_attach(device_t parent, device_t
 	 * Those steps are mandatory for an Ethernet driver, the first call
 	 * being common to all network interface drivers.
 	 */
-	error = if_attach(ifp);
+	error = if_initialize(ifp);
 	if (error != 0) {
-		aprint_error_dev(self, "if_attach failed(%d)\n", error);
+		aprint_error_dev(self, "if_initialize failed(%d)\n", error);
 		ifmedia_delete_instance(>sc_im, IFM_INST_ANY);
 		pmf_device_deregister(self);
 		return;
 	}
 	ether_ifattach(ifp, enaddr);
+	if_register(ifp);
 
 	/*
 	 * Add a sysctl node for that interface.



CVS commit: src/usr.sbin/memswitch

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 09:38:26 UTC 2018

Modified Files:
src/usr.sbin/memswitch: memswitch.c memswitch.h

Log Message:
make this build again.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/memswitch/memswitch.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/memswitch/memswitch.h

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

Modified files:

Index: src/usr.sbin/memswitch/memswitch.c
diff -u src/usr.sbin/memswitch/memswitch.c:1.14 src/usr.sbin/memswitch/memswitch.c:1.15
--- src/usr.sbin/memswitch/memswitch.c:1.14	Tue Jan 23 17:40:06 2018
+++ src/usr.sbin/memswitch/memswitch.c	Fri Jan 26 04:38:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: memswitch.c,v 1.14 2018/01/23 22:40:06 sevan Exp $	*/
+/*	$NetBSD: memswitch.c,v 1.15 2018/01/26 09:38:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -41,11 +41,11 @@
 
 #include 
 
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 #include 
 #else
 /*
- * DEBUG -- works on other (faster) platforms;
+ * SRAMDEBUG -- works on other (faster) platforms;
  *   store in a regular file instead of actual non-volatile static RAM.
  */
 #define PATH_RAMFILE "/tmp/sramfile"
@@ -290,7 +290,7 @@ alloc_modified_values(void)
 void
 alloc_current_values(void)
 {
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 	int i;
 	int sramfd = 0;
 	struct sram_io buffer;
@@ -367,7 +367,7 @@ flush(void)
 {
 	int i;
 	int sramfd = 0;
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 	struct sram_io buffer;
 #endif
 
@@ -380,7 +380,7 @@ flush(void)
 		/* Not modified at all. */
 		return;
 
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 	/* Assume SRAM_IO_SIZE = n * 16. */
 	for (i = 0; i < 256; i += SRAM_IO_SIZE) {
 		if (memcmp(_values[i], _values[i],
@@ -414,7 +414,7 @@ flush(void)
 int
 save(const char *name)
 {
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 	int fd;
 
 	alloc_current_values();
@@ -442,7 +442,7 @@ save(const char *name)
 int
 restore(const char *name)
 {
-#ifndef DEBUG
+#ifndef SRAMDEBUG
 	int sramfd, fd, i;
 	struct sram_io buffer;
 

Index: src/usr.sbin/memswitch/memswitch.h
diff -u src/usr.sbin/memswitch/memswitch.h:1.4 src/usr.sbin/memswitch/memswitch.h:1.5
--- src/usr.sbin/memswitch/memswitch.h:1.4	Wed Jan 24 09:45:44 2018
+++ src/usr.sbin/memswitch/memswitch.h	Fri Jan 26 04:38:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: memswitch.h,v 1.4 2018/01/24 14:45:44 sevan Exp $	*/
+/*	$NetBSD: memswitch.h,v 1.5 2018/01/26 09:38:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -79,13 +79,12 @@ extern char *progname;
 extern u_int8_t *current_values;
 extern u_int8_t *modified_values;
 
-static void usage(void) __dead;
-void show_single(const char*));
-void show_all(void));
-void modify_single(const char*));
-void help_single(const char*));
-void alloc_current_values(void));
-void alloc_modified_values(void));
-void flush(void));
-int save(const char*));
-int restore(const char*));
+void show_single(const char*);
+void show_all(void);
+void modify_single(const char*);
+void help_single(const char*);
+void alloc_current_values(void);
+void alloc_modified_values(void);
+void flush(void);
+int save(const char*);
+int restore(const char*);



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

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 09:29:15 UTC 2018

Modified Files:
src/sys/compat/linux/arch/arm: linux_ptrace.c

Log Message:
union was removed


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/linux/arch/arm/linux_ptrace.c

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

Modified files:

Index: src/sys/compat/linux/arch/arm/linux_ptrace.c
diff -u src/sys/compat/linux/arch/arm/linux_ptrace.c:1.20 src/sys/compat/linux/arch/arm/linux_ptrace.c:1.21
--- src/sys/compat/linux/arch/arm/linux_ptrace.c:1.20	Sun Aug 27 20:46:07 2017
+++ src/sys/compat/linux/arch/arm/linux_ptrace.c	Fri Jan 26 04:29:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.20 2017/08/28 00:46:07 kamil Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.21 2018/01/26 09:29:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.20 2017/08/28 00:46:07 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.21 2018/01/26 09:29:15 christos Exp $");
 
 #include 
 #include 
@@ -206,7 +206,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	case LINUX_PTRACE_GET_THREAD_AREA:
 		mutex_exit(t->p_lock);
 		pcb = lwp_getpcb(l);
-		val = (void *)pcb->pcb_un.un_32.pcb32_user_pid_ro;
+		val = (void *)pcb->pcb_user_pid_ro;
 		error = copyout(, (void *)SCARG(uap, data), sizeof(val));
 		break;
 #endif



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

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 09:26:43 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
fix printf format.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/e500_intr.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/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.35 src/sys/arch/powerpc/booke/e500_intr.c:1.36
--- src/sys/arch/powerpc/booke/e500_intr.c:1.35	Wed May 31 22:45:07 2017
+++ src/sys/arch/powerpc/booke/e500_intr.c	Fri Jan 26 04:26:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.35 2017/06/01 02:45:07 chs Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.35 2017/06/01 02:45:07 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $");
 
 #include 
 #include 
@@ -1150,7 +1150,7 @@ e500_intr_init(void)
 		break;
 #endif
 	default:
-		panic("%s: don't know how to deal with SVR %#lx",
+		panic("%s: don't know how to deal with SVR %#" PRIxREGISTER,
 		__func__, mfspr(SPR_SVR));
 	}
 



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

2018-01-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 26 09:07:46 UTC 2018

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

Log Message:
 CID-1427719: Integer handling issues  (BAD_SHIFT). Print bus/slot info
correctly on 82599_SFP_SF_QP(DID 0x154a) and 82599_QSFP_SF_QP(DID 0x1558).


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

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.119 src/sys/dev/pci/ixgbe/ixgbe.c:1.120
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.119	Thu Dec 28 06:10:01 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Jan 26 09:07:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.119 2017/12/28 06:10:01 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.120 2018/01/26 09:07:46 msaitoh Exp $ */
 
 /**
 
@@ -2332,8 +2332,8 @@ get_parent_info:
 	}
 	/* ...and read the Link Status Register */
 	link = pci_conf_read(adapter->osdep.pc, adapter->osdep.tag,
-	offset + PCIE_LCSR);
-	ixgbe_set_pci_config_data_generic(hw, link >> 16);
+	offset + PCIE_LCSR) >> 16;
+	ixgbe_set_pci_config_data_generic(hw, link);
 
 display:
 	device_printf(dev, "PCI Express Bus: Speed %s Width %s\n",



CVS commit: src/share/man/man9

2018-01-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jan 26 08:09:53 UTC 2018

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Refer softint(9)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/xcall.9

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/man9/xcall.9
diff -u src/share/man/man9/xcall.9:1.10 src/share/man/man9/xcall.9:1.11
--- src/share/man/man9/xcall.9:1.10	Tue Nov 26 20:48:25 2013
+++ src/share/man/man9/xcall.9	Fri Jan 26 08:09:53 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: xcall.9,v 1.10 2013/11/26 20:48:25 rmind Exp $
+.\" $NetBSD: xcall.9,v 1.11 2018/01/26 08:09:53 ozaki-r Exp $
 .\"
 .\" Copyright (c) 2010 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 November 26, 2013
+.Dd January 26, 2018
 .Dt XCALL 9
 .Os
 .Sh NAME
@@ -144,7 +144,8 @@ interface is implemented within the file
 .\" .Sh EXAMPLES
 .Sh SEE ALSO
 .Xr kpreempt 9 ,
-.Xr percpu 9
+.Xr percpu 9 ,
+.Xr softint 9
 .Sh HISTORY
 The
 .Nm