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

2017-12-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Dec 29 07:53:33 UTC 2017

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

Log Message:
Add line break.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/vmt.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/x86/vmt.c
diff -u src/sys/arch/x86/x86/vmt.c:1.19 src/sys/arch/x86/x86/vmt.c:1.20
--- src/sys/arch/x86/x86/vmt.c:1.19	Tue Oct 17 06:50:00 2017
+++ src/sys/arch/x86/x86/vmt.c	Fri Dec 29 07:53:33 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt.c,v 1.19 2017/10/17 06:50:00 maya Exp $ */
+/* $NetBSD: vmt.c,v 1.20 2017/12/29 07:53:33 nakayama Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -179,6 +179,7 @@ vmt_attach(device_t parent, device_t sel
 	struct vmt_softc *sc = device_private(self);
 
 	aprint_naive("\n");
+	aprint_normal("\n");
 
 	sc->sc_dev = self;
 	sc->sc_log = NULL;



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

2017-12-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Dec 29 07:53:33 UTC 2017

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

Log Message:
Add line break.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/vmt.c

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



CVS commit: src

2017-12-28 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec 29 03:05:13 UTC 2017

Modified Files:
src: BUILDING

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/BUILDING

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.129 src/BUILDING:1.130
--- src/BUILDING:1.129	Sat Oct 21 23:49:28 2017
+++ src/BUILDING	Fri Dec 29 03:05:13 2017
@@ -340,7 +340,8 @@ CONFIGURATION
  build.  If set to "no", the entire built system will be
  statically linked.
 
- Default: "yes"
+ Default: Platform dependent.  As of this writing, all
+ platforms except m68000 default to "yes".
 
  MKPICINSTALL
  Can be set to "yes" or "no".  Indicates whether the ar(1)



CVS commit: src/doc

2017-12-28 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec 29 03:04:56 UTC 2017

Modified Files:
src/doc: BUILDING.mdoc

Log Message:
While SH3 is no longer an exception, m68000 still is.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/doc/BUILDING.mdoc

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

Modified files:

Index: src/doc/BUILDING.mdoc
diff -u src/doc/BUILDING.mdoc:1.122 src/doc/BUILDING.mdoc:1.123
--- src/doc/BUILDING.mdoc:1.122	Sat Oct 21 22:03:01 2017
+++ src/doc/BUILDING.mdoc	Fri Dec 29 03:04:56 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: BUILDING.mdoc,v 1.122 2017/10/21 22:03:01 sevan Exp $
+.\"	$NetBSD: BUILDING.mdoc,v 1.123 2017/12/29 03:04:56 sevan Exp $
 .\"
 .\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -612,7 +612,12 @@ installed during a build.
 If set to
 .Dq no ,
 the entire built system will be statically linked.
-.DFLTy
+.DFLT
+Platform dependent.
+As of this writing, all platforms except
+.Sy m68000
+default to
+.Dq yes .
 .
 .It Sy MKPICINSTALL
 .YorN



CVS commit: src

2017-12-28 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec 29 03:05:13 UTC 2017

Modified Files:
src: BUILDING

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/BUILDING

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



CVS commit: src/doc

2017-12-28 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec 29 03:04:56 UTC 2017

Modified Files:
src/doc: BUILDING.mdoc

Log Message:
While SH3 is no longer an exception, m68000 still is.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/doc/BUILDING.mdoc

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



CVS commit: src/sys/dev/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:20:47 UTC 2017

Modified Files:
src/sys/dev/i2c: am2315reg.h am2315var.h si70xxreg.h si70xxvar.h

Log Message:
add RCSID's


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/am2315reg.h \
src/sys/dev/i2c/am2315var.h src/sys/dev/i2c/si70xxreg.h \
src/sys/dev/i2c/si70xxvar.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/i2c/am2315reg.h
diff -u src/sys/dev/i2c/am2315reg.h:1.1 src/sys/dev/i2c/am2315reg.h:1.2
--- src/sys/dev/i2c/am2315reg.h:1.1	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/am2315reg.h	Thu Dec 28 21:20:47 2017
@@ -1,3 +1,5 @@
+/*	$NetBSD: am2315reg.h,v 1.2 2017/12/29 02:20:47 christos Exp $	*/
+
 /*
  * Copyright (c) 2017 Brad Spencer 
  *
Index: src/sys/dev/i2c/am2315var.h
diff -u src/sys/dev/i2c/am2315var.h:1.1 src/sys/dev/i2c/am2315var.h:1.2
--- src/sys/dev/i2c/am2315var.h:1.1	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/am2315var.h	Thu Dec 28 21:20:47 2017
@@ -1,3 +1,5 @@
+/*	$NetBSD: am2315var.h,v 1.2 2017/12/29 02:20:47 christos Exp $	*/
+
 /*
  * Copyright (c) 2017 Brad Spencer 
  *
Index: src/sys/dev/i2c/si70xxreg.h
diff -u src/sys/dev/i2c/si70xxreg.h:1.1 src/sys/dev/i2c/si70xxreg.h:1.2
--- src/sys/dev/i2c/si70xxreg.h:1.1	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/si70xxreg.h	Thu Dec 28 21:20:47 2017
@@ -1,3 +1,5 @@
+/*	$NetBSD: si70xxreg.h,v 1.2 2017/12/29 02:20:47 christos Exp $	*/
+
 /*
  * Copyright (c) 2017 Brad Spencer 
  *
Index: src/sys/dev/i2c/si70xxvar.h
diff -u src/sys/dev/i2c/si70xxvar.h:1.1 src/sys/dev/i2c/si70xxvar.h:1.2
--- src/sys/dev/i2c/si70xxvar.h:1.1	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/si70xxvar.h	Thu Dec 28 21:20:47 2017
@@ -1,3 +1,5 @@
+/*	$NetBSD: si70xxvar.h,v 1.2 2017/12/29 02:20:47 christos Exp $	*/
+
 /*
  * Copyright (c) 2017 Brad Spencer 
  *



CVS commit: src/sys/dev/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:20:47 UTC 2017

Modified Files:
src/sys/dev/i2c: am2315reg.h am2315var.h si70xxreg.h si70xxvar.h

Log Message:
add RCSID's


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/am2315reg.h \
src/sys/dev/i2c/am2315var.h src/sys/dev/i2c/si70xxreg.h \
src/sys/dev/i2c/si70xxvar.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/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:19:45 UTC 2017

Modified Files:
src/sys/dev/i2c: si70xx.c

Log Message:
Fix modules build.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/si70xx.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/i2c/si70xx.c
diff -u src/sys/dev/i2c/si70xx.c:1.1 src/sys/dev/i2c/si70xx.c:1.2
--- src/sys/dev/i2c/si70xx.c:1.1	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/si70xx.c	Thu Dec 28 21:19:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: si70xx.c,v 1.1 2017/12/28 23:23:47 christos Exp $	*/
+/*	$NetBSD: si70xx.c,v 1.2 2017/12/29 02:19:45 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: si70xx.c,v 1.1 2017/12/28 23:23:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: si70xx.c,v 1.2 2017/12/29 02:19:45 christos Exp $");
 
 /*
   Driver for the Silicon Labs SI7013/SI7020/SI7021
@@ -999,7 +999,7 @@ si70xxtemp_modcmd(modcmd_t cmd, void *op
 #endif
 	case MODULE_CMD_FINI:
 #ifdef _MODULE
-		error = config_fini_component(cfdriver_ioconf_si70xxtemp,
+		return config_fini_component(cfdriver_ioconf_si70xxtemp,
 		  cfattach_ioconf_si70xxtemp, cfdata_ioconf_si70xxtemp);
 #else
 		return 0;



CVS commit: src/sys/dev/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:19:45 UTC 2017

Modified Files:
src/sys/dev/i2c: si70xx.c

Log Message:
Fix modules build.


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

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



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:18:34 UTC 2017

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

Log Message:
add new drivers, sort.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/distrib/sets/lists/modules/mi

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



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:18:34 UTC 2017

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

Log Message:
add new drivers, sort.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/distrib/sets/lists/modules/mi

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

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.112 src/distrib/sets/lists/modules/mi:1.113
--- src/distrib/sets/lists/modules/mi:1.112	Sat Dec  9 03:03:06 2017
+++ src/distrib/sets/lists/modules/mi	Thu Dec 28 21:18:34 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.112 2017/12/09 08:03:06 pgoyette Exp $
+# $NetBSD: mi,v 1.113 2017/12/29 02:18:34 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -20,6 +20,8 @@
 ./@MODULEDIR@/adosfs/adosfs.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/aiobase-kernel-modules	kmod
 ./@MODULEDIR@/aio/aio.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/am2315temp			base-kernel-modules	kmod
+./@MODULEDIR@/am2315temp/am2315temp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/amrbase-obsolete		obsolete
 ./@MODULEDIR@/amr/amr.kmod			base-obsolete		obsolete
 ./@MODULEDIR@/ataraidbase-obsolete		obsolete
@@ -228,10 +230,10 @@
 ./@MODULEDIR@/luasystm/luasystm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/mfsbase-kernel-modules	kmod
 ./@MODULEDIR@/mfs/mfs.kmod			base-kernel-modules	kmod
-./@MODULEDIR@/miiverbose			base-kernel-modules	kmod
-./@MODULEDIR@/miiverbose/miiverbose.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/midibase-kernel-modules	kmod
 ./@MODULEDIR@/midi/midi.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/miiverbose			base-kernel-modules	kmod
+./@MODULEDIR@/miiverbose/miiverbose.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/minirootbase-kernel-modules	kmod
 ./@MODULEDIR@/miniroot/miniroot.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/mlxbase-obsolete		obsolete
@@ -316,6 +318,8 @@
 ./@MODULEDIR@/securelevel/securelevel.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/sequencerbase-kernel-modules	kmod
 ./@MODULEDIR@/sequencer/sequencer.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/si70xxtemp			base-kernel-modules	kmod
+./@MODULEDIR@/si70xxtemp/si70xxtemp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/skipjackbase-kernel-modules	kmod
 ./@MODULEDIR@/skipjack/skipjack.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/slcompress			base-kernel-modules kmod
@@ -364,10 +368,10 @@
 ./@MODULEDIR@/twa/twa.kmod			base-obsolete		obsolete
 ./@MODULEDIR@/twebase-obsolete		obsolete
 ./@MODULEDIR@/twe/twe.kmod			base-obsolete		obsolete
-./@MODULEDIR@/uatpbase-kernel-modules	kmod
-./@MODULEDIR@/uatp/uatp.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/ualeabase-kernel-modules	kmod
 ./@MODULEDIR@/ualea/ualea.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/uatpbase-kernel-modules	kmod
+./@MODULEDIR@/uatp/uatp.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/udfbase-kernel-modules	kmod
 ./@MODULEDIR@/udf/udf.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/umapbase-kernel-modules	kmod



CVS commit: src/sys/modules

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:14:25 UTC 2017

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/am2315temp: Makefile am2315temp.ioconf
src/sys/modules/si70xxtemp: Makefile si70xxtemp.ioconf

Log Message:
PR/52848: Brad Spencer: Add module glue for AM2315 and SI70xx drivers


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/am2315temp/Makefile \
src/sys/modules/am2315temp/am2315temp.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/si70xxtemp/Makefile \
src/sys/modules/si70xxtemp/si70xxtemp.ioconf

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



CVS commit: src/sys/modules

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 29 02:14:25 UTC 2017

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/am2315temp: Makefile am2315temp.ioconf
src/sys/modules/si70xxtemp: Makefile si70xxtemp.ioconf

Log Message:
PR/52848: Brad Spencer: Add module glue for AM2315 and SI70xx drivers


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/am2315temp/Makefile \
src/sys/modules/am2315temp/am2315temp.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/si70xxtemp/Makefile \
src/sys/modules/si70xxtemp/si70xxtemp.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/Makefile
diff -u src/sys/modules/Makefile:1.196 src/sys/modules/Makefile:1.197
--- src/sys/modules/Makefile:1.196	Sat Dec  9 03:03:07 2017
+++ src/sys/modules/Makefile	Thu Dec 28 21:14:25 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.196 2017/12/09 08:03:07 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.197 2017/12/29 02:14:25 christos Exp $
 
 .include 
 
@@ -48,6 +48,8 @@ SUBDIR+=	gpioow
 SUBDIR+=	gpiosim
 SUBDIR+=	hfs
 SUBDIR+=	hythygtemp
+SUBDIR+=	si70xxtemp
+SUBDIR+=	am2315temp
 SUBDIR+=	i2cexec
 SUBDIR+=	i2c_bitbang
 SUBDIR+=	if_agr

Added files:

Index: src/sys/modules/am2315temp/Makefile
diff -u /dev/null src/sys/modules/am2315temp/Makefile:1.1
--- /dev/null	Thu Dec 28 21:14:25 2017
+++ src/sys/modules/am2315temp/Makefile	Thu Dec 28 21:14:25 2017
@@ -0,0 +1,9 @@
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev/i2c
+
+KMOD=	am2315temp
+IOCONF=	am2315temp.ioconf
+SRCS=	am2315.c
+
+.include 
Index: src/sys/modules/am2315temp/am2315temp.ioconf
diff -u /dev/null src/sys/modules/am2315temp/am2315temp.ioconf:1.1
--- /dev/null	Thu Dec 28 21:14:25 2017
+++ src/sys/modules/am2315temp/am2315temp.ioconf	Thu Dec 28 21:14:25 2017
@@ -0,0 +1,7 @@
+ioconf am2315temp
+
+include "conf/files"
+
+pseudo-root iic*
+
+am2315temp* at iic? addr 0x5c

Index: src/sys/modules/si70xxtemp/Makefile
diff -u /dev/null src/sys/modules/si70xxtemp/Makefile:1.1
--- /dev/null	Thu Dec 28 21:14:25 2017
+++ src/sys/modules/si70xxtemp/Makefile	Thu Dec 28 21:14:25 2017
@@ -0,0 +1,9 @@
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev/i2c
+
+KMOD=	si70xxtemp
+IOCONF=	si70xxtemp.ioconf
+SRCS=	si70xx.c
+
+.include 
Index: src/sys/modules/si70xxtemp/si70xxtemp.ioconf
diff -u /dev/null src/sys/modules/si70xxtemp/si70xxtemp.ioconf:1.1
--- /dev/null	Thu Dec 28 21:14:25 2017
+++ src/sys/modules/si70xxtemp/si70xxtemp.ioconf	Thu Dec 28 21:14:25 2017
@@ -0,0 +1,7 @@
+ioconf si70xxtemp
+
+include "conf/files"
+
+pseudo-root iic*
+
+si70xxtemp* at iic? addr 0x40



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:31:07 UTC 2017

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

Log Message:
Add new entries, sort


To generate a diff of this commit:
cvs rdiff -u -r1.1567 -r1.1568 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1567 src/distrib/sets/lists/man/mi:1.1568
--- src/distrib/sets/lists/man/mi:1.1567	Mon Dec 18 20:49:18 2017
+++ src/distrib/sets/lists/man/mi	Thu Dec 28 18:31:07 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1567 2017/12/19 01:49:18 christos Exp $
+# $NetBSD: mi,v 1.1568 2017/12/28 23:31:07 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -790,6 +790,7 @@
 ./usr/share/man/cat4/alpha/ttwopci.0		man-sys-catman		.cat
 ./usr/share/man/cat4/altmem.0			man-sys-catman		.cat
 ./usr/share/man/cat4/altq.0			man-sys-catman		.cat
+./usr/share/man/cat4/am2315temp.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amdpm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/amdtemp.0			man-sys-catman		.cat
 ./usr/share/man/cat4/amhphy.0			man-sys-catman		.cat
@@ -1671,6 +1672,7 @@
 ./usr/share/man/cat4/shmif.0			man-sys-catman		.cat
 ./usr/share/man/cat4/shpcic.0			man-sys-catman		.cat
 ./usr/share/man/cat4/si.0			man-sys-catman		.cat
+./usr/share/man/cat4/si70xxtemp.0		man-sys-catman		.cat
 ./usr/share/man/cat4/siisata.0			man-sys-catman		.cat
 ./usr/share/man/cat4/siop.0			man-sys-catman		.cat
 ./usr/share/man/cat4/sip.0			man-sys-catman		.cat
@@ -2806,10 +2808,10 @@
 ./usr/share/man/cat8/npfctl.0			man-npf-catman		.cat,npf
 ./usr/share/man/cat8/npfd.0			man-npf-catman		.cat,npf
 ./usr/share/man/cat8/nqmgr.0			man-obsolete		obsolete
-./usr/share/man/cat8/nsd.0 			man-nsd-catman		.cat,nsd
 ./usr/share/man/cat8/nsd-checkconf.0		man-nsd-catman		.cat,nsd
 ./usr/share/man/cat8/nsd-checkzone.0		man-nsd-catman		.cat,nsd
 ./usr/share/man/cat8/nsd-control.0		man-nsd-catman		.cat,nsd
+./usr/share/man/cat8/nsd.0 			man-nsd-catman		.cat,nsd
 ./usr/share/man/cat8/nsec3hash.0		man-bind-catman		.cat
 ./usr/share/man/cat8/nslookup.0			man-netutil-catman	.cat
 ./usr/share/man/cat8/nsupdate.0			man-obsolete		obsolete
@@ -3953,6 +3955,7 @@
 ./usr/share/man/html4/alpha/ttwopci.html	man-sys-htmlman		html
 ./usr/share/man/html4/altmem.html		man-sys-htmlman		html
 ./usr/share/man/html4/altq.html			man-sys-htmlman		html
+./usr/share/man/html4/am2315temp.html		man-sys-htmlman		html
 ./usr/share/man/html4/amdpm.html		man-sys-htmlman		html
 ./usr/share/man/html4/amdtemp.html		man-sys-htmlman		html
 ./usr/share/man/html4/amhphy.html		man-sys-htmlman		html
@@ -4728,6 +4731,7 @@
 ./usr/share/man/html4/shmif.html		man-sys-htmlman		html
 ./usr/share/man/html4/shpcic.html		man-sys-htmlman		html
 ./usr/share/man/html4/si.html			man-sys-htmlman		html
+./usr/share/man/html4/si70xxtemp.html		man-sys-htmlman		html
 ./usr/share/man/html4/siisata.html		man-sys-htmlman		html
 ./usr/share/man/html4/siop.html			man-sys-htmlman		html
 ./usr/share/man/html4/sip.html			man-sys-htmlman		html
@@ -5704,10 +5708,10 @@
 ./usr/share/man/html8/npf.conf.html		man-obsolete		obsolete
 ./usr/share/man/html8/npfctl.html		man-npf-htmlman		html,npf
 ./usr/share/man/html8/npfd.html			man-npf-htmlman		html,npf
-./usr/share/man/html8/nsd.html			man-nsd-htmlman		html,nsd
 ./usr/share/man/html8/nsd-checkconf.html	man-nsd-htmlman		html,nsd
 ./usr/share/man/html8/nsd-checkzone.html	man-nsd-htmlman		html,nsd
 ./usr/share/man/html8/nsd-control.html		man-nsd-htmlman		html,nsd
+./usr/share/man/html8/nsd.html			man-nsd-htmlman		html,nsd
 ./usr/share/man/html8/nsec3hash.html		man-bind-htmlman	html
 ./usr/share/man/html8/nslookup.html		man-netutil-htmlman	html
 ./usr/share/man/html8/nsupdate.html		man-obsolete		obsolete
@@ -6810,6 +6814,7 @@
 ./usr/share/man/man4/alpha/ttwopci.4		man-sys-man		.man
 ./usr/share/man/man4/altmem.4			man-sys-man		.man
 ./usr/share/man/man4/altq.4			man-sys-man		.man
+./usr/share/man/man4/am2315temp.4		man-sys-man		.man
 ./usr/share/man/man4/amdpm.4			man-sys-man		.man
 ./usr/share/man/man4/amdtemp.4			man-sys-man		.man
 ./usr/share/man/man4/amhphy.4			man-sys-man		.man
@@ -7691,6 +7696,7 @@
 ./usr/share/man/man4/shmif.4			man-sys-man		.man
 ./usr/share/man/man4/shpcic.4			man-sys-man		.man
 ./usr/share/man/man4/si.4			man-sys-man		.man
+./usr/share/man/man4/si70xxtemp.4		man-sys-man		.man
 ./usr/share/man/man4/siisata.4			man-sys-man		.man
 ./usr/share/man/man4/siop.4			man-sys-man		.man
 ./usr/share/man/man4/sip.4			man-sys-man		.man
@@ -8052,8 +8058,8 @@
 ./usr/share/man/man4/xc5k.4			man-sys-man		.man
 ./usr/share/man/man4/xenbus.4			man-sys-man		.man
 ./usr/share/man/man4/xennet.4			man-sys-man		.man
-./usr/share/man/man4/xhci.4			man-sys-man		.man
 ./usr/share/man/man4/xge.4			man-sys-man		.man
+./usr/share/man/man4/xhci.4			man-sys-man		.man
 

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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:31:07 UTC 2017

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

Log Message:
Add new entries, sort


To generate a diff of this commit:
cvs rdiff -u -r1.1567 -r1.1568 src/distrib/sets/lists/man/mi

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



CVS commit: src/share/man/man4

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:28:01 UTC 2017

Modified Files:
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: am2315temp.4 si70xxtemp.4

Log Message:
PR/52848: Brad Spencer: Man pages for new drivers


To generate a diff of this commit:
cvs rdiff -u -r1.647 -r1.648 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/am2315temp.4 \
src/share/man/man4/si70xxtemp.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/Makefile
diff -u src/share/man/man4/Makefile:1.647 src/share/man/man4/Makefile:1.648
--- src/share/man/man4/Makefile:1.647	Mon Dec 18 20:46:57 2017
+++ src/share/man/man4/Makefile	Thu Dec 28 18:28:00 2017
@@ -1,12 +1,11 @@
-#	$NetBSD: Makefile,v 1.647 2017/12/19 01:46:57 christos Exp $
+#	$NetBSD: Makefile,v 1.648 2017/12/28 23:28:00 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
 	adbbt.4 adbkbd.4 adbms.4 \
 	adc.4 adm1026hm.4 admtemp.4 adv.4 adw.4 age.4 agp.4 agr.4 ahb.4 ahc.4 \
-	ahcisata.4 ahd.4 \
-	aibs.4 alc.4 ale.4 alipm.4 altmem.4 altq.4 amdpm.4 amdtemp.4 amhphy.4 \
-	amr.4 aps.4 asus.4 \
+	ahcisata.4 ahd.4 \ aibs.4 alc.4 ale.4 alipm.4 altmem.4 altq.4 \
+	am2315temp.4 amdpm.4 amdtemp.4 amhphy.4 amr.4 aps.4 asus.4 \
 	an.4 arcmsr.4 arcofi.4 aria.4 artsata.4 ata.4 atalk.4 ataraid.4 \
 	ath.4 athn.4 atphy.4 atppc.4 attimer.4 atw.4 \
 	auacer.4 audio.4 audiocs.4 auich.4 \
@@ -57,8 +56,8 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	rnd.4 route.4 rs5c372rtc.4 rtk.4 rtsx.4 rtw.4 rtwn.4 rum.4 run.4 \
 	s390rtc.4 satalink.4 sbus.4 schide.4 \
 	scsi.4 sd.4 se.4 seeprom.4 sem.4 \
-	ses.4 sf.4 sfb.4 sgsmix.4 shb.4 shmif.4 \
-	shpcic.4 siisata.4 siop.4 sip.4 siside.4 sk.4 sl.4 slide.4 \
+	ses.4 sf.4 sfb.4 sgsmix.4 shb.4 shmif.4 shpcic.4 si70xxtemp.4 \
+	siisata.4 siop.4 sip.4 siside.4 sk.4 sl.4 slide.4 \
 	sm.4 smsh.4 sn.4 sony.4 spc.4 speaker.4 spif.4 sqphy.4 ss.4 \
 	st.4 ste.4 stge.4 sti.4 stpcide.4 sv.4 strip.4 \
 	svwsata.4 swsensor.4 swwdog.4 sysmon.4 \

Added files:

Index: src/share/man/man4/am2315temp.4
diff -u /dev/null src/share/man/man4/am2315temp.4:1.1
--- /dev/null	Thu Dec 28 18:28:01 2017
+++ src/share/man/man4/am2315temp.4	Thu Dec 28 18:28:00 2017
@@ -0,0 +1,90 @@
+.\" $NetBSD: am2315temp.4,v 1.1 2017/12/28 23:28:00 christos Exp $
+.\"
+.\" Copyright (c) 2017 Brad Spencer 
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd December 28, 2017
+.Dt AM2315TEMP 4
+.Os
+.Sh NAME
+.Nm am2315temp
+.Nd Driver for Aosong AM2315 sensor chip via I2C bus
+.Sh SYNOPSIS
+.Cd "am2315temp* at iic? addr 0x5c"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides measurements from the AM2315 humidity/temperature
+sensors via the
+.Xr envsys 4
+framework.
+The
+.Nm
+.Ar addr
+argument selects the address at the
+.Xr iic 4
+bus.  The AM2315 has limits on how often the measurements can be read.
+Adjustments to the number of times to take reading before considering
+it valid, and the number of ticks to wait between readings can be
+changed through
+.Xr sysctl 8
+nodes.
+.Pp
+There are other oddities about the AM2315 that should be mentioned.
+The datasheet says that the device should read no more often then
+every 2 seconds, further, it also implies that a measurement is not
+performed until the device is 1) awake 2) has been asked for a
+measurement.  From observation, it has been noted that it is possible
+to ask for measurements more often than every 2 seconds, and actually
+get something that looks to be valid.  It may, in fact, be valid, but
+it has also been noted that the measurements do not appear to change.
+This implies that a measurement was done, and then returned time and
+time again.  It has also been noticed that if measurements are taken
+very close to every 2 seconds, that sometimes the device will return a
+I2C error on a read.  If this happens a lot, increase
+hw.am2315temp0.readticks a bit.
+.Sh SYSCTL VARIABLES
+The following
+.Xr sysctl 3
+variables are provided:
+.Bl -tag -width indent
+.It hw.am2315temp0.readcount
+The number of times to take a reading before considering it valid.  This defaults to 2.
+.It 

CVS commit: src/share/man/man4

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:28:01 UTC 2017

Modified Files:
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: am2315temp.4 si70xxtemp.4

Log Message:
PR/52848: Brad Spencer: Man pages for new drivers


To generate a diff of this commit:
cvs rdiff -u -r1.647 -r1.648 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/am2315temp.4 \
src/share/man/man4/si70xxtemp.4

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



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:24:30 UTC 2017

Added Files:
src/sys/arch/evbarm/conf: RPI3

Log Message:
XXX: Test for the new two environmental drivers


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/RPI3

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

Added files:

Index: src/sys/arch/evbarm/conf/RPI3
diff -u /dev/null src/sys/arch/evbarm/conf/RPI3:1.1
--- /dev/null	Thu Dec 28 18:24:30 2017
+++ src/sys/arch/evbarm/conf/RPI3	Thu Dec 28 18:24:30 2017
@@ -0,0 +1,10 @@
+#
+#	$NetBSD: RPI3,v 1.1 2017/12/28 23:24:30 christos Exp $
+#
+#	RPi3 -- Raspberry Pi 3
+#
+
+include "arch/evbarm/conf/RPI2"
+
+si70xxtemp* at iic?
+am2315temp* at iic?



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:24:30 UTC 2017

Added Files:
src/sys/arch/evbarm/conf: RPI3

Log Message:
XXX: Test for the new two environmental drivers


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/RPI3

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



CVS commit: src/sys/dev/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:23:47 UTC 2017

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: am2315.c am2315reg.h am2315var.h si70xx.c si70xxreg.h
si70xxvar.h

Log Message:
PR/52848: Brad Spencer: Two environment sensor drivers: AM2315 and SI70xx
XXX: Please check that my refactoring did not break them!


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/am2315.c src/sys/dev/i2c/am2315reg.h \
src/sys/dev/i2c/am2315var.h src/sys/dev/i2c/si70xx.c \
src/sys/dev/i2c/si70xxreg.h src/sys/dev/i2c/si70xxvar.h
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/i2c/files.i2c

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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.79 src/sys/dev/i2c/files.i2c:1.80
--- src/sys/dev/i2c/files.i2c:1.79	Sun Dec 10 12:05:54 2017
+++ src/sys/dev/i2c/files.i2c	Thu Dec 28 18:23:47 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.79 2017/12/10 17:05:54 bouyer Exp $
+#	$NetBSD: files.i2c,v 1.80 2017/12/28 23:23:47 christos Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -280,6 +280,16 @@ device	tcagpio
 attach	tcagpio at iic
 file	dev/i2c/tcagpio.c			tcagpio
 
+# Silicon Lab SI7013/SI7020/SI7021 Temperature and Humidity sensor
+device si70xxtemp
+attach si70xxtemp at iic
+file dev/i2c/si70xx.csi70xxtemp
+
+# Aosong AM2315 Temperature and Humidity sensor
+device am2315temp
+attach am2315temp at iic
+file dev/i2c/am2315.cam2315temp
+
 # Silergy SY8106A regulator
 device	sy8106a
 attach	sy8106a at iic

Added files:

Index: src/sys/dev/i2c/am2315.c
diff -u /dev/null src/sys/dev/i2c/am2315.c:1.1
--- /dev/null	Thu Dec 28 18:23:47 2017
+++ src/sys/dev/i2c/am2315.c	Thu Dec 28 18:23:47 2017
@@ -0,0 +1,531 @@
+/*	$NetBSD: am2315.c,v 1.1 2017/12/28 23:23:47 christos Exp $	*/
+
+/*
+ * Copyright (c) 2017 Brad Spencer 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: am2315.c,v 1.1 2017/12/28 23:23:47 christos Exp $");
+
+/*
+ * Driver for the Aosong AM2315
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+static uint16_t am2315_crc(uint8_t *, size_t);
+static int 	am2315_poke(struct am2315_sc *);
+static int 	am2315_poke_m(i2c_tag_t, i2c_addr_t, const char *, bool);
+static int 	am2315_match(device_t, cfdata_t, void *);
+static void 	am2315_attach(device_t, device_t, void *);
+static int 	am2315_detach(device_t, int);
+static void 	am2315_refresh(struct sysmon_envsys *, envsys_data_t *);
+static int 	am2315_verify_sysctl(SYSCTLFN_ARGS);
+
+#define AM2315_DEBUG
+#ifdef AM2315_DEBUG
+#define DPRINTF(s, l, x) \
+do { \
+	if (l <= s->sc_am2315debug) \
+	printf x; \
+} while (/*CONSTCOND*/0)
+#else
+#define DPRINTF(s, l, x)
+#endif
+
+CFATTACH_DECL_NEW(am2315temp, sizeof(struct am2315_sc),
+am2315_match, am2315_attach, am2315_detach, NULL);
+
+static struct am2315_sensor am2315_sensors[] = {
+	{
+		.desc = "humidity",
+		.type = ENVSYS_SRELHUMIDITY,
+	},
+	{
+		.desc = "temperature",
+		.type = ENVSYS_STEMP,
+	}
+};
+
+static uint16_t
+am2315_crc(uint8_t *data, size_t len)
+{
+	uint16_t crc = 0x;
+
+	for (size_t j = 0; j < len; j++) {
+		crc ^= data[j];
+		for (size_t i = 0; i < 8; i++) {
+			if (crc & 0x01) {
+crc >>= 1;
+crc ^= 0xA001;
+			} else {
+crc >>= 1;
+			}
+		}
+	}
+
+	return crc;
+}
+
+int 
+am2315_verify_sysctl(SYSCTLFN_ARGS)
+{
+	int error, t;
+	struct sysctlnode node;
+
+	node = *rnode;
+	t = *(int *)rnode->sysctl_data;
+	node.sysctl_data = 
+	error = sysctl_lookup(SYSCTLFN_CALL());
+	if (error || newp == NULL)
+		return error;
+
+	if (t < 0)
+		return EINVAL;
+
+	*(int *) rnode->sysctl_data = t;
+
+	return 0;
+}
+
+static int
+am2315_cmd(i2c_tag_t tag, i2c_addr_t addr, uint8_t dir, uint8_t cmd,
+uint8_t clen, uint8_t *buf, size_t blen)
+{
+	uint8_t command[] = { dir, cmd, clen };
+	if (buf)
+		memset(buf, 0xff, blen);
+	uint8_t reg = dir == AM2315_READ_REGISTERS ?
+	I2C_OP_READ_WITH_STOP : I2C_OP_WRITE_WITH_STOP;
+
+	return iic_exec(tag, reg, addr, 

CVS commit: src/sys/dev/i2c

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 23:23:47 UTC 2017

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: am2315.c am2315reg.h am2315var.h si70xx.c si70xxreg.h
si70xxvar.h

Log Message:
PR/52848: Brad Spencer: Two environment sensor drivers: AM2315 and SI70xx
XXX: Please check that my refactoring did not break them!


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/am2315.c src/sys/dev/i2c/am2315reg.h \
src/sys/dev/i2c/am2315var.h src/sys/dev/i2c/si70xx.c \
src/sys/dev/i2c/si70xxreg.h src/sys/dev/i2c/si70xxvar.h
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/i2c/files.i2c

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



CVS commit: src/share/man/man7

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:57 UTC 2017

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Fix word.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/share/man/man7/sysctl.7

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/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.119 src/share/man/man7/sysctl.7:1.120
--- src/share/man/man7/sysctl.7:1.119	Thu Dec 28 23:15:45 2017
+++ src/share/man/man7/sysctl.7	Thu Dec 28 23:16:57 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.119 2017/12/28 23:15:45 wiz Exp $
+.\"	$NetBSD: sysctl.7,v 1.120 2017/12/28 23:16:57 wiz Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -2488,7 +2488,7 @@ If not zero, DDB will output also to the
 If not empty, a command to be executed on each enter to the DDB.
 .It Li ddb.panicstackframes
 Number of stack frames to display on panic.
-Useful to avoid scrolling way the interesting frames on a glass tty.
+Useful to avoid scrolling away the interesting frames on a glass tty.
 Default value is
 .Dv 65535
 (all frames), useful value around



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:15 UTC 2017

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

Log Message:
Fix word.


To generate a diff of this commit:
cvs rdiff -u -r1.477 -r1.478 src/share/man/man4/options.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/options.4
diff -u src/share/man/man4/options.4:1.477 src/share/man/man4/options.4:1.478
--- src/share/man/man4/options.4:1.477	Thu Dec 28 23:14:49 2017
+++ src/share/man/man4/options.4	Thu Dec 28 23:16:15 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.477 2017/12/28 23:14:49 wiz Exp $
+.\"	$NetBSD: options.4,v 1.478 2017/12/28 23:16:15 wiz Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -588,7 +588,7 @@ This option adds more verbose descriptio
 command.
 .It Cd options DDB_PANICSTACKFRAMES=integer
 Number of stack frames to display on panic.
-Useful to avoid scrolling way the interesting frames on a glass tty.
+Useful to avoid scrolling away the interesting frames on a glass tty.
 Default value is
 .Dv 65535
 (all frames), useful value around



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:42 UTC 2017

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

Log Message:
Fix word.


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

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



CVS commit: src/share/man/man7

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:57 UTC 2017

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Fix word.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/share/man/man7/sysctl.7

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



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:42 UTC 2017

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

Log Message:
Fix word.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/share/man/man4/ddb.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/ddb.4
diff -u src/share/man/man4/ddb.4:1.169 src/share/man/man4/ddb.4:1.170
--- src/share/man/man4/ddb.4:1.169	Thu Dec 28 23:14:42 2017
+++ src/share/man/man4/ddb.4	Thu Dec 28 23:16:42 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.169 2017/12/28 23:14:42 wiz Exp $
+.\"	$NetBSD: ddb.4,v 1.170 2017/12/28 23:16:42 wiz Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -1283,7 +1283,7 @@ Mixing both /l
 and this setting can give double loggings.
 .It Va panicstackframes
 Number of stack frames to display on panic.
-Useful to avoid scrolling way the interesting frames on a glass tty.
+Useful to avoid scrolling away the interesting frames on a glass tty.
 Default value is
 .Dv 65535
 (all frames), useful value around



CVS commit: src/share/man/man7

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:15:45 UTC 2017

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Remove Tn.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/share/man/man7/sysctl.7

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/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.118 src/share/man/man7/sysctl.7:1.119
--- src/share/man/man7/sysctl.7:1.118	Thu Dec 28 17:51:49 2017
+++ src/share/man/man7/sysctl.7	Thu Dec 28 23:15:45 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.118 2017/12/28 17:51:49 christos Exp $
+.\"	$NetBSD: sysctl.7,v 1.119 2017/12/28 23:15:45 wiz Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -372,9 +372,8 @@ privilege may change the value.
 .El
 .Bl -tag -width "123456"
 .It Li kern.aio_listio_max
-The maximum number of asynchronous
-.Tn I/O
-operations in a single list I/O call.
+The maximum number of asynchronous I/O operations in a single list
+I/O call.
 Like with all variables related to
 .Xr aio 3 ,
 the variable may be created and removed dynamically
@@ -384,7 +383,7 @@ The maximum number of asynchronous I/O o
 .It Li kern.arandom
 This variable picks a random number each time it is queried.
 The used random number generator
-.Pf ( Tn RNG )
+.Pf ( RNG )
 is based on
 .Xr arc4random 3 .
 .It Li kern.argmax ( Dv KERN_ARGMAX )
@@ -811,9 +810,7 @@ Returns the standard version the impleme
 Monotonic Clock Option conforms to,
 otherwise\ 0.
 .It Li kern.mqueue
-Settings related to
-.Tn POSIX
-message queues; see
+Settings related to POSIX message queues; see
 .Xr mqueue 3 .
 This node is created dynamically when
 the corresponding kernel module is loaded.
@@ -2017,10 +2014,7 @@ Default UDP receive buffer size.
 Default UDP send buffer size.
 .El
 .Pp
-We reuse net.*.tcp for
-.Tn TCP
-over
-.Tn IPv6 ,
+We reuse net.*.tcp for TCP over IPv6,
 and therefore we do not have variables net.*.tcp6.
 Variables net.inet6.udp6 have identical meaning to net.inet.udp.
 Please refer to
@@ -2491,8 +2485,7 @@ console or by a special key sequence on 
 .It Li ddb.tee_msgbuf
 If not zero, DDB will output also to the kernel message buffer.
 .It Li ddb.commandonenter
-If not empty, a command to be executed on each enter to the
-.Tn DDB .
+If not empty, a command to be executed on each enter to the DDB.
 .It Li ddb.panicstackframes
 Number of stack frames to display on panic.
 Useful to avoid scrolling way the interesting frames on a glass tty.
@@ -2502,8 +2495,7 @@ Default value is
 .Dv 10 .
 .El
 .Pp
-Some of these
-.Tn MIB
+Some of these MIB
 nodes are also available as variables from within the debugger.
 See
 .Xr ddb 4
@@ -2524,8 +2516,7 @@ The available second level names are:
 Available settings are detailed below.
 .Bl -tag -width "123456"
 .It Li security.curtain
-If non-zero, will filter return objects according to the user
-.Tn ID
+If non-zero, will filter return objects according to the user ID
 requesting information about them, preventing users from
 accessing any objects they do not own.
 .Pp



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:16:15 UTC 2017

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

Log Message:
Fix word.


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

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



CVS commit: src/share/man/man7

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:15:45 UTC 2017

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Remove Tn.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/share/man/man7/sysctl.7

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



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:14:49 UTC 2017

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

Log Message:
Formatting nit.


To generate a diff of this commit:
cvs rdiff -u -r1.476 -r1.477 src/share/man/man4/options.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/options.4
diff -u src/share/man/man4/options.4:1.476 src/share/man/man4/options.4:1.477
--- src/share/man/man4/options.4:1.476	Thu Dec 28 17:51:49 2017
+++ src/share/man/man4/options.4	Thu Dec 28 23:14:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.476 2017/12/28 17:51:49 christos Exp $
+.\"	$NetBSD: options.4,v 1.477 2017/12/28 23:14:49 wiz Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -1062,7 +1062,7 @@ routines, (a.k.a. the
 .Fn namei
 cache, though called by many other names in the kernel source).
 By default, this cache has
-.Dv (NPROC + NTEXT + 100)
+.Dv ( NPROC + NTEXT + 100 )
 entries (NPROC set as 20 + 16 * MAXUSERS and NTEXT as 80 + NPROC / 8).
 A reasonable way to derive a value of
 .Dv NVNODE ,



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:14:42 UTC 2017

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

Log Message:
Remove Tn.


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

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



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:14:42 UTC 2017

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

Log Message:
Remove Tn.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/share/man/man4/ddb.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/ddb.4
diff -u src/share/man/man4/ddb.4:1.168 src/share/man/man4/ddb.4:1.169
--- src/share/man/man4/ddb.4:1.168	Thu Dec 28 17:51:49 2017
+++ src/share/man/man4/ddb.4	Thu Dec 28 23:14:42 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.168 2017/12/28 17:51:49 christos Exp $
+.\"	$NetBSD: ddb.4,v 1.169 2017/12/28 23:14:42 wiz Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -144,29 +144,21 @@ Some models:
 .It mvme68k
 Abort switch on CPU card.
 .It pmax
- on
-.Tn LK-201
-rcons console.
+ on LK-201 rcons console.
 .It ""
  on serial console.
 .It sandpoint
  on serial console.
 .It sparc
--A, or -A on a
-.Tn Sun
-keyboard.
+-A, or -A on a Sun keyboard.
 .It ""
  on serial console.
 .It sparc64
--A, or -A on a
-.Tn Sun
-keyboard.
+-A, or -A on a Sun keyboard.
 .It ""
  on serial console.
 .It sun3
--A, or -A on a
-.Tn Sun
-keyboard.
+-A, or -A on a Sun keyboard.
 .It ""
  on serial console.
 .It vax
@@ -784,14 +776,11 @@ text segment symbols display
 .Sy * ,
 data segment symbols display
 .Sy + ,
-.Tn BSS
-segment symbols display
+BSS segment symbols display
 .Sy - ,
 and filename symbols display
 .Sy / .
-For
-.Tn ELF Ns -format
-symbol tables,
+For ELF-format symbol tables,
 object symbols display
 .Sy + ,
 function symbols display



CVS commit: src/share/man/man4

2017-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 28 23:14:49 UTC 2017

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

Log Message:
Formatting nit.


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

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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 22:42:36 UTC 2017

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c

Log Message:
PR/52848: Brad Spencer: Comment out KASSERT, length 0 appears to be valid.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_bsc.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.8 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.9
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.8	Sun Dec 10 16:38:26 2017
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c	Thu Dec 28 17:42:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_bsc.c,v 1.8 2017/12/10 21:38:26 skrll Exp $	*/
+/*	$NetBSD: bcm2835_bsc.c,v 1.9 2017/12/28 22:42:36 christos Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.8 2017/12/10 21:38:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.9 2017/12/28 22:42:36 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_kernhist.h"
@@ -331,7 +331,9 @@ only_read:
 	dlen = datalen;
 
 	dlen = __SHIFTIN(dlen, BSC_DLEN_DLEN);
+#if 0
 	KASSERT(dlen >= 1);
+#endif
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_DLEN, dlen);
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_A, a);
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_C, c | BSC_C_ST);



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

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 22:42:36 UTC 2017

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c

Log Message:
PR/52848: Brad Spencer: Comment out KASSERT, length 0 appears to be valid.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_bsc.c

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



Re: CVS commit: src/sys/netinet

2017-12-28 Thread Chuck Silvers
On Thu, Dec 28, 2017 at 05:34:27PM +0900, Ryota Ozaki wrote:
> On Thu, Dec 28, 2017 at 5:05 PM, Tom Ivar Helbekkmo
>  wrote:
> > Ryota Ozaki  writes:
> >
> >> I think the below patch fixes the above issue, but probably
> >> there is a better solution.
> >
> > Looks like didn't -- it just changed it a little bit.  Just like the
> > last time, the hang happened while reading email over IMAP, which
> > exercises disk and network at the same time, while the machine was busy
> > doing a parallellized system build in the background.  This time,
> > though, I got a core dump.  Here's the hang (the active process on this
> > CPU is the IMAP server):
> 
> Oh, my patch failed to keep SPL at IPL_VM because mutex_exit
> tries to restore an SPL where mutex_enter is called. So I had to
> put splvm before mutex_enter. Could you try the 2nd patch:
>   http://www.netbsd.org/~ozaki-r/fix-pool_catchup.diff

let's not mix explicit spl* calls with mutexes... even if that works
in this particular case, it doesn't seem like a good practice in general.
I was hoping to commit a different fix for this yesterday but I ran out of time.
I should have time this evening to get back to this.

-Chuck


CVS commit: src/tests/lib/libc/sys

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 18:41:34 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
mips panic should be fixed on head.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.21 src/tests/lib/libc/sys/t_ptrace_wait.c:1.22
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.21	Thu Dec 28 04:47:52 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Thu Dec 28 13:41:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.21 2017/12/28 09:47:52 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.22 2017/12/28 18:41:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.21 2017/12/28 09:47:52 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.22 2017/12/28 18:41:33 christos Exp $");
 
 #include 
 #include 
@@ -4311,17 +4311,6 @@ ATF_TC_BODY(fpregs1, tc)
 #endif
 	struct fpreg r;
 
-	/* pmax kernel 8.99.9 panics */
-	char *machine;
-	size_t mlen;
-	machine = asysctlbyname("hw.machine", );
-	ATF_REQUIRE(machine);
-	if (strcmp(machine, "pmax") == 0) {
-		atf_tc_expect_fail("PR port-pmax/52871");
-		ATF_REQUIRE(0 && "In order to get reliable failure, abort");
-	}
-	free(machine);
-
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -4377,17 +4366,6 @@ ATF_TC_BODY(fpregs2, tc)
 #endif
 	struct fpreg r;
 
-	/* pmax kernel 8.99.9 panics */
-	char *machine;
-	size_t mlen;
-	machine = asysctlbyname("hw.machine", );
-	ATF_REQUIRE(machine);
-	if (strcmp(machine, "pmax") == 0) {
-		atf_tc_expect_fail("PR port-pmax/52871");
-		ATF_REQUIRE(0 && "In order to get reliable failure, abort");
-	}
-	free(machine);
-
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {



CVS commit: src/tests/lib/libc/sys

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 18:41:34 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
mips panic should be fixed on head.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/sys/kern

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 18:29:45 UTC 2017

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

Log Message:
provide separate read and write functions to accomodate register functions
that need a size argument.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/sys_ptrace_common.c

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

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.31 src/sys/kern/sys_ptrace_common.c:1.32
--- src/sys/kern/sys_ptrace_common.c:1.31	Sat Dec 23 17:12:19 2017
+++ src/sys/kern/sys_ptrace_common.c	Thu Dec 28 13:29:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.31 2017/12/23 22:12:19 christos Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.32 2017/12/28 18:29:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.31 2017/12/23 22:12:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.32 2017/12/28 18:29:45 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -1330,36 +1330,39 @@ out:
 	return error;
 }
 
-typedef int (*regfunc_t)(struct lwp *, void *);
+typedef int (*regrfunc_t)(struct lwp *, void *, size_t *);
+typedef int (*regwfunc_t)(struct lwp *, void *, size_t);
 
 #ifdef PT_REGISTERS
 static int
-proc_regio(struct lwp *l, struct uio *uio, size_t kl, regfunc_t r, regfunc_t w)
+proc_regio(struct lwp *l, struct uio *uio, size_t ks, regrfunc_t r,
+regwfunc_t w)
 {
 	char buf[1024];
 	int error;
 	char *kv;
+	size_t kl;
 
-	if (kl > sizeof(buf))
+	if (ks > sizeof(buf))
 		return E2BIG;
 
-	if (uio->uio_offset < 0 || uio->uio_offset > (off_t)kl)
+	if (uio->uio_offset < 0 || uio->uio_offset > (off_t)ks)
 		return EINVAL;
 
 	kv = buf + uio->uio_offset;
-	kl -= uio->uio_offset;
+	kl = ks - uio->uio_offset;
 
 	if (kl > uio->uio_resid)
 		kl = uio->uio_resid;
 
-	error = (*r)(l, buf);
+	error = (*r)(l, buf, );
 	if (error == 0)
 		error = uiomove(kv, kl, uio);
 	if (error == 0 && uio->uio_rw == UIO_WRITE) {
 		if (l->l_stat != LSSTOP)
 			error = EBUSY;
 		else
-			error = (*w)(l, buf);
+			error = (*w)(l, buf, ks);
 	}
 
 	uio->uio_offset = 0;
@@ -1374,21 +1377,22 @@ process_doregs(struct lwp *curl /*tracer
 {
 #if defined(PT_GETREGS) || defined(PT_SETREGS)
 	size_t s;
-	regfunc_t r, w;
+	regrfunc_t r;
+	regwfunc_t w;
 
 #ifdef COMPAT_NETBSD32
 	const bool pk32 = (l->l_proc->p_flag & PK_32) != 0;
 
 	if (__predict_false(pk32)) {
 		s = sizeof(process_reg32);
-		r = (regfunc_t)process_read_regs32;
-		w = (regfunc_t)process_write_regs32;
+		r = (regrfunc_t)process_read_regs32;
+		w = (regwfunc_t)process_write_regs32;
 	} else
 #endif
 	{
 		s = sizeof(struct reg);
-		r = (regfunc_t)process_read_regs;
-		w = (regfunc_t)process_write_regs;
+		r = (regrfunc_t)process_read_regs;
+		w = (regwfunc_t)process_write_regs;
 	}
 	return proc_regio(l, uio, s, r, w);
 #else
@@ -1414,21 +1418,22 @@ process_dofpregs(struct lwp *curl /*trac
 {
 #if defined(PT_GETFPREGS) || defined(PT_SETFPREGS)
 	size_t s;
-	regfunc_t r, w;
+	regrfunc_t r;
+	regwfunc_t w;
 
 #ifdef COMPAT_NETBSD32
 	const bool pk32 = (l->l_proc->p_flag & PK_32) != 0;
 
 	if (__predict_false(pk32)) {
 		s = sizeof(process_fpreg32);
-		r = (regfunc_t)process_read_fpregs32;
-		w = (regfunc_t)process_write_fpregs32;
+		r = (regrfunc_t)process_read_fpregs32;
+		w = (regwfunc_t)process_write_fpregs32;
 	} else
 #endif
 	{
 		s = sizeof(struct fpreg);
-		r = (regfunc_t)process_read_fpregs;
-		w = (regfunc_t)process_write_fpregs;
+		r = (regrfunc_t)process_read_fpregs;
+		w = (regwfunc_t)process_write_fpregs;
 	}
 	return proc_regio(l, uio, s, r, w);
 #else
@@ -1454,21 +1459,22 @@ process_dodbregs(struct lwp *curl /*trac
 {
 #if defined(PT_GETDBREGS) || defined(PT_SETDBREGS)
 	size_t s;
-	regfunc_t r, w;
+	regrfunc_t r;
+	regwfunc_t w;
 
 #ifdef COMPAT_NETBSD32
 	const bool pk32 = (l->l_proc->p_flag & PK_32) != 0;
 
 	if (__predict_false(pk32)) {
 		s = sizeof(process_dbreg32);
-		r = (regfunc_t)process_read_dbregs32;
-		w = (regfunc_t)process_write_dbregs32;
+		r = (regrfunc_t)process_read_dbregs32;
+		w = (regwfunc_t)process_write_dbregs32;
 	} else
 #endif
 	{
 		s = sizeof(struct dbreg);
-		r = (regfunc_t)process_read_dbregs;
-		w = (regfunc_t)process_write_dbregs;
+		r = (regrfunc_t)process_read_dbregs;
+		w = (regwfunc_t)process_write_dbregs;
 	}
 	return proc_regio(l, uio, s, r, w);
 #else



CVS commit: src/sys/kern

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 18:29:45 UTC 2017

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

Log Message:
provide separate read and write functions to accomodate register functions
that need a size argument.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/sys_ptrace_common.c

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



CVS commit: src/share/man

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 17:51:49 UTC 2017

Modified Files:
src/share/man/man4: ddb.4 options.4
src/share/man/man7: sysctl.7

Log Message:
document ddb.panicstackframes


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/share/man/man4/ddb.4
cvs rdiff -u -r1.475 -r1.476 src/share/man/man4/options.4
cvs rdiff -u -r1.117 -r1.118 src/share/man/man7/sysctl.7

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.167 src/share/man/man4/ddb.4:1.168
--- src/share/man/man4/ddb.4:1.167	Mon Jul  3 17:30:58 2017
+++ src/share/man/man4/ddb.4	Thu Dec 28 12:51:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.167 2017/07/03 21:30:58 wiz Exp $
+.\"	$NetBSD: ddb.4,v 1.168 2017/12/28 17:51:49 christos Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -56,7 +56,7 @@
 .\" any improvements or extensions that they make and grant Carnegie Mellon
 .\" the rights to redistribute these changes.
 .\"
-.Dd January 12, 2017
+.Dd December 28, 2017
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -1292,6 +1292,13 @@ This option is more generic than the /l 
 selected commands as discussed above to log the output.
 Mixing both /l
 and this setting can give double loggings.
+.It Va panicstackframes
+Number of stack frames to display on panic.
+Useful to avoid scrolling way the interesting frames on a glass tty.
+Default value is
+.Dv 65535
+(all frames), useful value around
+.Dv 10 .
 .\" .It Va work Ns Sy xx
 .\" Temporary work variable.
 .\" .Sq Sy xx

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.475 src/share/man/man4/options.4:1.476
--- src/share/man/man4/options.4:1.475	Thu Sep 14 04:52:41 2017
+++ src/share/man/man4/options.4	Thu Dec 28 12:51:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.475 2017/09/14 08:52:41 wiz Exp $
+.\"	$NetBSD: options.4,v 1.476 2017/12/28 17:51:49 christos Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd September 13, 2017
+.Dd December 28, 2017
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -586,6 +586,13 @@ This is currently only supported by the 
 This option adds more verbose descriptions to the
 .Em help
 command.
+.It Cd options DDB_PANICSTACKFRAMES=integer
+Number of stack frames to display on panic.
+Useful to avoid scrolling way the interesting frames on a glass tty.
+Default value is
+.Dv 65535
+(all frames), useful value around
+.Dv 10 .
 .It Cd options KGDB
 Compiles in a remote kernel debugger stub for diagnosing kernel problems
 using the

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.117 src/share/man/man7/sysctl.7:1.118
--- src/share/man/man7/sysctl.7:1.117	Sun Jul 30 12:07:06 2017
+++ src/share/man/man7/sysctl.7	Thu Dec 28 12:51:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.117 2017/07/30 16:07:06 maxv Exp $
+.\"	$NetBSD: sysctl.7,v 1.118 2017/12/28 17:51:49 christos Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\"
-.Dd July 30, 2017
+.Dd December 28, 2017
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -2465,6 +2465,7 @@ privilege may change the value.
 .It ddb.fromconsole	integer	yes
 .It ddb.tee_msgbuf	integer	yes
 .It ddb.commandonenter	string	yes
+.It ddb.panicstackframes	integer	yes
 .El
 .Bl -tag -width "123456"
 .It Li ddb.radix ( Dv DDBCTL_RADIX )
@@ -2492,9 +2493,13 @@ If not zero, DDB will output also to the
 .It Li ddb.commandonenter
 If not empty, a command to be executed on each enter to the
 .Tn DDB .
-.\"
-.\" XXX: (a) ddb.commandonenter is missing in ddb(4);
-.\"	 (b) No DDBCTL definitions for tee_msgbuf and commandonenter.
+.It Li ddb.panicstackframes
+Number of stack frames to display on panic.
+Useful to avoid scrolling way the interesting frames on a glass tty.
+Default value is
+.Dv 65535
+(all frames), useful value around
+.Dv 10 .
 .El
 .Pp
 Some of these



CVS commit: src/share/man

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 17:51:49 UTC 2017

Modified Files:
src/share/man/man4: ddb.4 options.4
src/share/man/man7: sysctl.7

Log Message:
document ddb.panicstackframes


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/share/man/man4/ddb.4
cvs rdiff -u -r1.475 -r1.476 src/share/man/man4/options.4
cvs rdiff -u -r1.117 -r1.118 src/share/man/man7/sysctl.7

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



CVS commit: src/sys/ddb

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 17:51:19 UTC 2017

Modified Files:
src/sys/ddb: db_panic.c db_variables.c db_variables.h ddbvar.h
files.ddb

Log Message:
- add ddb.panicstackframes to avoid scrolling the interesting parts of panic
  stacktraces off.
- change valuep to void * to avoid casts
- sort and use c99 initializers in variables array


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/ddb/db_panic.c
cvs rdiff -u -r1.44 -r1.45 src/sys/ddb/db_variables.c
cvs rdiff -u -r1.15 -r1.16 src/sys/ddb/db_variables.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ddb/ddbvar.h
cvs rdiff -u -r1.10 -r1.11 src/sys/ddb/files.ddb

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

Modified files:

Index: src/sys/ddb/db_panic.c
diff -u src/sys/ddb/db_panic.c:1.5 src/sys/ddb/db_panic.c:1.6
--- src/sys/ddb/db_panic.c:1.5	Fri Oct 27 08:25:15 2017
+++ src/sys/ddb/db_panic.c	Thu Dec 28 12:51:19 2017
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_panic.c,v 1.5 2017/10/27 12:25:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_panic.c,v 1.6 2017/12/28 17:51:19 christos Exp $");
 
 #include 
 #include 
@@ -52,7 +52,7 @@ void db_panic(void)
 			cpu_index(curcpu()));
 			db_stack_trace_print(
 			(db_expr_t)(intptr_t)__builtin_frame_address(0),
-			true, 65535, "", printf);
+			true, db_panicstackframes, "", printf);
 			printf("cpu%u: End traceback...\n",
 			cpu_index(curcpu()));
 			intrace = 0;

Index: src/sys/ddb/db_variables.c
diff -u src/sys/ddb/db_variables.c:1.44 src/sys/ddb/db_variables.c:1.45
--- src/sys/ddb/db_variables.c:1.44	Tue Feb 25 13:30:09 2014
+++ src/sys/ddb/db_variables.c	Thu Dec 28 12:51:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_variables.c,v 1.44 2014/02/25 18:30:09 pooka Exp $	*/
+/*	$NetBSD: db_variables.c,v 1.45 2017/12/28 17:51:19 christos Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_variables.c,v 1.44 2014/02/25 18:30:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_variables.c,v 1.45 2017/12/28 17:51:19 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddbparam.h"
@@ -66,6 +66,11 @@ int		db_fromconsole = DDB_FROMCONSOLE;
 #endif
 int		db_tee_msgbuf = DDB_TEE_MSGBUF;
 
+#ifndef DDB_PANICSTACKFRAMES
+#define DDB_PANICSTACKFRAMES 65535
+#endif
+int		db_panicstackframes = DDB_PANICSTACKFRAMES;
+
 
 static int	db_rw_internal_variable(const struct db_variable *, db_expr_t *,
 		int);
@@ -73,16 +78,62 @@ static int	db_find_variable(const struct
 
 /* XXX must all be ints for sysctl. */
 const struct db_variable db_vars[] = {
-	{ "radix",	(void *)_radix,	db_rw_internal_variable, NULL },
-	{ "maxoff",	(void *)_maxoff,	db_rw_internal_variable, NULL },
-	{ "maxwidth",	(void *)_max_width,	db_rw_internal_variable, NULL },
-	{ "tabstops",	(void *)_tab_stop_width, db_rw_internal_variable, NULL },
-	{ "lines",	(void *)_max_line,	db_rw_internal_variable, NULL },
-	{ "onpanic",	(void *)_onpanic,	db_rw_internal_variable, NULL },
-	{ "fromconsole", (void *)_fromconsole, db_rw_internal_variable, NULL },
-	{ "tee_msgbuf",	(void *)_tee_msgbuf,	db_rw_internal_variable, NULL },
+	{
+		.name = "fromconsole",
+		.valuep = _fromconsole,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "maxoff",
+		.valuep = _maxoff,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "maxwidth",
+		.valuep = _max_width,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "lines",
+		.valuep = _max_line,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "onpanic",
+		.valuep = _onpanic,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "panicstackframes",
+		.valuep = _panicstackframes,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "radix",
+		.valuep = _radix,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "tabstops",
+		.valuep = _tab_stop_width,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
+	{
+		.name = "tee_msgbuf",
+		.valuep = _tee_msgbuf,
+		.fcn = db_rw_internal_variable,
+		.modif = NULL,
+	},
 };
-const struct db_variable * const db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
+const struct db_variable * const db_evars = db_vars + __arraycount(db_vars);
 
 /*
  * ddb command line access to the DDB variables defined above.
@@ -154,13 +205,18 @@ SYSCTL_SETUP(sysctl_ddb_setup, "sysctl d
 		   SYSCTL_DESCR("Whether to tee ddb output to the msgbuf"),
 		   NULL, 0, _tee_msgbuf, 0,
 		   CTL_DDB, CTL_CREATE, CTL_EOL);
-
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_STRING, "commandonenter",
 		   SYSCTL_DESCR("Command to be executed on each ddb enter"),
 		   NULL, 0, db_cmd_on_enter, DB_LINE_MAXLEN,
 		   CTL_DDB, CTL_CREATE, CTL_EOL);
+	

CVS commit: src/sys/ddb

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 17:51:19 UTC 2017

Modified Files:
src/sys/ddb: db_panic.c db_variables.c db_variables.h ddbvar.h
files.ddb

Log Message:
- add ddb.panicstackframes to avoid scrolling the interesting parts of panic
  stacktraces off.
- change valuep to void * to avoid casts
- sort and use c99 initializers in variables array


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/ddb/db_panic.c
cvs rdiff -u -r1.44 -r1.45 src/sys/ddb/db_variables.c
cvs rdiff -u -r1.15 -r1.16 src/sys/ddb/db_variables.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ddb/ddbvar.h
cvs rdiff -u -r1.10 -r1.11 src/sys/ddb/files.ddb

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



CVS commit: src/lib/libc/net

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 15:12:16 UTC 2017

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
PR/52837: Michael Kaufmann: getaddrinfo() resolves "127.0.0.1 www.example.com"
to 127.0.0.1. Apply the patch from FreeBSD and explain the rationale.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/lib/libc/net/getaddrinfo.c

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



CVS commit: src/lib/libc/net

2017-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 28 15:12:16 UTC 2017

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
PR/52837: Michael Kaufmann: getaddrinfo() resolves "127.0.0.1 www.example.com"
to 127.0.0.1. Apply the patch from FreeBSD and explain the rationale.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/lib/libc/net/getaddrinfo.c

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

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.116 src/lib/libc/net/getaddrinfo.c:1.117
--- src/lib/libc/net/getaddrinfo.c:1.116	Thu Sep 28 20:04:33 2017
+++ src/lib/libc/net/getaddrinfo.c	Thu Dec 28 10:12:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.116 2017/09/29 00:04:33 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.117 2017/12/28 15:12:15 christos Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.116 2017/09/29 00:04:33 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.117 2017/12/28 15:12:15 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -1322,8 +1322,15 @@ explore_numeric(const struct addrinfo *p
 		* check for errors. inet_pton() only accepts addresses
 		* in the dotted quad format and only in base 10, so we
 		* need to treat AF_INET specially.
+		*
+		* We also check for trailing characters and fail if there
+		* are any. This matches the inet_pton6(), but not the
+		* inet_pton4() behavior. We choose to make the protocol
+		* behavior consistent.
 		*/
-		if (inet_aton(hostname, (void *)pton) == 1) {
+		if (inet_aton(hostname, (void *)pton) == 1 &&
+		hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")]
+		== '\0') {
 			if (pai->ai_family == afd->a_af ||
 			pai->ai_family == PF_UNSPEC /*?*/) {
 GET_AI(cur->ai_next, afd, pton);



CVS commit: src/sys/arch/x86

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 14:34:39 UTC 2017

Modified Files:
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c

Log Message:
Use variables in PMAP_DIRECT_*, so that the location of the direct map can
change.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.269 -r1.270 src/sys/arch/x86/x86/pmap.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/x86

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 14:34:39 UTC 2017

Modified Files:
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c

Log Message:
Use variables in PMAP_DIRECT_*, so that the location of the direct map can
change.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.269 -r1.270 src/sys/arch/x86/x86/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/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.71 src/sys/arch/x86/include/pmap.h:1.72
--- src/sys/arch/x86/include/pmap.h:1.71	Sat Nov 11 12:51:05 2017
+++ src/sys/arch/x86/include/pmap.h	Thu Dec 28 14:34:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.71 2017/11/11 12:51:05 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.72 2017/12/28 14:34:39 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -528,13 +528,18 @@ void	pmap_free_ptps(struct vm_page *);
 
 #ifdef __HAVE_DIRECT_MAP
 
+extern vaddr_t pmap_direct_base;
+extern vaddr_t pmap_direct_end;
+
 #define L4_SLOT_DIRECT		456
 #define PDIR_SLOT_DIRECT	L4_SLOT_DIRECT
 
 #define NL4_SLOT_DIRECT		32
 
-#define PMAP_DIRECT_BASE	(VA_SIGN_NEG((L4_SLOT_DIRECT * NBPD_L4)))
-#define PMAP_DIRECT_END		(PMAP_DIRECT_BASE + NL4_SLOT_DIRECT * NBPD_L4)
+#define PMAP_DIRECT_DEFAULT_BASE (VA_SIGN_NEG((L4_SLOT_DIRECT * NBPD_L4)))
+
+#define PMAP_DIRECT_BASE	pmap_direct_base
+#define PMAP_DIRECT_END		pmap_direct_end
 
 #define PMAP_DIRECT_MAP(pa)	((vaddr_t)PMAP_DIRECT_BASE + (pa))
 #define PMAP_DIRECT_UNMAP(va)	((paddr_t)(va) - PMAP_DIRECT_BASE)

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.269 src/sys/arch/x86/x86/pmap.c:1.270
--- src/sys/arch/x86/x86/pmap.c:1.269	Thu Dec 28 14:03:13 2017
+++ src/sys/arch/x86/x86/pmap.c	Thu Dec 28 14:34:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.269 2017/12/28 14:03:13 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.270 2017/12/28 14:34:39 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.269 2017/12/28 14:03:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.270 2017/12/28 14:34:39 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -495,6 +495,13 @@ static struct pool_cache pmap_cache;
  */
 static struct pool_cache pmap_pv_cache;
 
+#ifdef __HAVE_DIRECT_MAP
+vaddr_t pmap_direct_base __read_mostly;
+vaddr_t pmap_direct_end __read_mostly;
+size_t pmap_direct_pdpe __read_mostly;
+size_t pmap_direct_npdp __read_mostly;
+#endif
+
 #ifndef __HAVE_DIRECT_MAP
 /*
  * Special VAs and the PTEs that map them
@@ -1438,7 +1445,7 @@ pmap_init_directmap(struct pmap *kpm)
 	extern phys_ram_seg_t mem_clusters[];
 	extern int mem_cluster_cnt;
 
-	const vaddr_t startva = PMAP_DIRECT_BASE;
+	const vaddr_t startva = PMAP_DIRECT_DEFAULT_BASE;
 	size_t nL4e, nL3e, nL2e;
 	size_t L4e_idx, L3e_idx, L2e_idx;
 	size_t spahole, epahole;
@@ -1523,6 +1530,11 @@ pmap_init_directmap(struct pmap *kpm)
 	*pte = 0;
 	pmap_update_pg(tmpva);
 
+	pmap_direct_base = startva;
+	pmap_direct_end = endva;
+	pmap_direct_pdpe = L4e_idx;
+	pmap_direct_npdp = nL4e;
+
 	tlbflush();
 }
 #endif /* __HAVE_DIRECT_MAP */
@@ -2213,8 +2225,8 @@ pmap_pdp_ctor(void *arg, void *v, int fl
 	}
 
 #ifdef __HAVE_DIRECT_MAP
-	memcpy([PDIR_SLOT_DIRECT], _BASE[PDIR_SLOT_DIRECT],
-	NL4_SLOT_DIRECT * sizeof(pd_entry_t));
+	memcpy([pmap_direct_pdpe], _BASE[pmap_direct_pdpe],
+	pmap_direct_npdp * sizeof(pd_entry_t));
 #endif
 #endif /* XEN  && __x86_64__*/
 



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

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 14:03:13 UTC 2017

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

Log Message:
Eliminate the assumption that the beginning of the direct map is aligned
to NBPD_L4 and NBPD_L3. It won't be when we'll randomize its location.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/arch/x86/x86/pmap.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/x86/x86

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 14:03:13 UTC 2017

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

Log Message:
Eliminate the assumption that the beginning of the direct map is aligned
to NBPD_L4 and NBPD_L3. It won't be when we'll randomize its location.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.268 src/sys/arch/x86/x86/pmap.c:1.269
--- src/sys/arch/x86/x86/pmap.c:1.268	Thu Dec 28 13:46:10 2017
+++ src/sys/arch/x86/x86/pmap.c	Thu Dec 28 14:03:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.268 2017/12/28 13:46:10 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.269 2017/12/28 14:03:13 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.268 2017/12/28 13:46:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.269 2017/12/28 14:03:13 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1418,6 +1418,15 @@ pmap_init_lapic(void)
 #endif
 
 #ifdef __HAVE_DIRECT_MAP
+static size_t
+pmap_dmap_nentries_range(vaddr_t startva, vaddr_t endva, size_t pgsz)
+{
+	size_t npages;
+	npages = (roundup(endva, pgsz) / pgsz) -
+	(rounddown(startva, pgsz) / pgsz);
+	return npages;
+}
+
 /*
  * Create the amd64 direct map. Called only once at boot time. We map all of
  * the physical memory contiguously using 2MB large pages, with RW permissions.
@@ -1434,6 +1443,7 @@ pmap_init_directmap(struct pmap *kpm)
 	size_t L4e_idx, L3e_idx, L2e_idx;
 	size_t spahole, epahole;
 	paddr_t lastpa, pa;
+	vaddr_t endva;
 	vaddr_t tmpva;
 	pt_entry_t *pte;
 	phys_ram_seg_t *mc;
@@ -1460,6 +1470,7 @@ pmap_init_directmap(struct pmap *kpm)
 	if (lastpa > MAXPHYSMEM) {
 		panic("pmap_init_directmap: lastpa incorrect");
 	}
+	endva = startva + lastpa;
 
 	/* We will use this temporary va. */
 	tmpva = bootspace.spareva;
@@ -1467,7 +1478,7 @@ pmap_init_directmap(struct pmap *kpm)
 
 	/* Build L4 */
 	L4e_idx = pl4_i(startva);
-	nL4e = (lastpa + NBPD_L4 - 1) >> L4_SHIFT;
+	nL4e = pmap_dmap_nentries_range(startva, endva, NBPD_L4);
 	KASSERT(nL4e <= NL4_SLOT_DIRECT);
 	for (i = 0; i < nL4e; i++) {
 		KASSERT(L4_BASE[L4e_idx+i] == 0);
@@ -1482,7 +1493,7 @@ pmap_init_directmap(struct pmap *kpm)
 
 	/* Build L3 */
 	L3e_idx = pl3_i(startva);
-	nL3e = (lastpa + NBPD_L3 - 1) >> L3_SHIFT;
+	nL3e = pmap_dmap_nentries_range(startva, endva, NBPD_L3);
 	for (i = 0; i < nL3e; i++) {
 		KASSERT(L3_BASE[L3e_idx+i] == 0);
 
@@ -1496,7 +1507,7 @@ pmap_init_directmap(struct pmap *kpm)
 
 	/* Build L2 */
 	L2e_idx = pl2_i(startva);
-	nL2e = (lastpa + NBPD_L2 - 1) >> L2_SHIFT;
+	nL2e = pmap_dmap_nentries_range(startva, endva, NBPD_L2);
 	for (i = 0; i < nL2e; i++) {
 		KASSERT(L2_BASE[L2e_idx+i] == 0);
 



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

2017-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Dec 28 14:02:08 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_drm.c

Log Message:
Initialize drm_device bus and dma space tags


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nvidia/tegra_drm.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_drm.c
diff -u src/sys/arch/arm/nvidia/tegra_drm.c:1.8 src/sys/arch/arm/nvidia/tegra_drm.c:1.9
--- src/sys/arch/arm/nvidia/tegra_drm.c:1.8	Tue Dec 26 14:54:52 2017
+++ src/sys/arch/arm/nvidia/tegra_drm.c	Thu Dec 28 14:02:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm.c,v 1.8 2017/12/26 14:54:52 jmcneill Exp $ */
+/* $NetBSD: tegra_drm.c,v 1.9 2017/12/28 14:02:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.8 2017/12/26 14:54:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.9 2017/12/28 14:02:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -199,6 +199,10 @@ tegra_drm_attach(device_t parent, device
 		return;
 	}
 	sc->sc_ddev->dev_private = sc;
+	sc->sc_ddev->bst = sc->sc_bst;
+	sc->sc_ddev->bus_dmat = sc->sc_dmat;
+	sc->sc_ddev->dmat = sc->sc_ddev->bus_dmat;
+	sc->sc_ddev->dmat_subregion_p = false;
 
 	error = -drm_dev_register(sc->sc_ddev, 0);
 	if (error) {



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

2017-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Dec 28 14:02:08 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_drm.c

Log Message:
Initialize drm_device bus and dma space tags


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nvidia/tegra_drm.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/x86/x86

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 13:46:10 UTC 2017

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

Log Message:
Downgrade the direct map from 1GB superpages to 2MB large pages, and
simplify. Then, map the "head" region and the kernel segments as RO instead
of RW, to kill the last place that has .text mapped as writable. It will
also allow for a greater number of possibilities when we will randomize
the direct map.

While it is true that this change theoretically reduces performance a bit,
we are more interested in correctness.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/arch/x86/x86/pmap.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/x86/x86

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 13:46:10 UTC 2017

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

Log Message:
Downgrade the direct map from 1GB superpages to 2MB large pages, and
simplify. Then, map the "head" region and the kernel segments as RO instead
of RW, to kill the last place that has .text mapped as writable. It will
also allow for a greater number of possibilities when we will randomize
the direct map.

While it is true that this change theoretically reduces performance a bit,
we are more interested in correctness.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.267 src/sys/arch/x86/x86/pmap.c:1.268
--- src/sys/arch/x86/x86/pmap.c:1.267	Wed Nov 22 21:26:01 2017
+++ src/sys/arch/x86/x86/pmap.c	Thu Dec 28 13:46:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.267 2017/11/22 21:26:01 christos Exp $	*/
+/*	$NetBSD: pmap.c,v 1.268 2017/12/28 13:46:10 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.267 2017/11/22 21:26:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.268 2017/12/28 13:46:10 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1419,7 +1419,9 @@ pmap_init_lapic(void)
 
 #ifdef __HAVE_DIRECT_MAP
 /*
- * Create the amd64 direct map. Called only once at boot time.
+ * Create the amd64 direct map. Called only once at boot time. We map all of
+ * the physical memory contiguously using 2MB large pages, with RW permissions.
+ * However there is a hole: the kernel is mapped with RO permissions.
  */
 static void
 pmap_init_directmap(struct pmap *kpm)
@@ -1427,19 +1429,24 @@ pmap_init_directmap(struct pmap *kpm)
 	extern phys_ram_seg_t mem_clusters[];
 	extern int mem_cluster_cnt;
 
-	paddr_t lastpa, L2page_pa, L3page_pa, pdp;
+	const vaddr_t startva = PMAP_DIRECT_BASE;
+	size_t nL4e, nL3e, nL2e;
+	size_t L4e_idx, L3e_idx, L2e_idx;
+	size_t spahole, epahole;
+	paddr_t lastpa, pa;
 	vaddr_t tmpva;
 	pt_entry_t *pte;
-	pd_entry_t *pde;
 	phys_ram_seg_t *mc;
-	size_t nL4e, nL3e, nL2e;
-	size_t pn, npd;
-	int i, n;
+	int i;
 
 	const pd_entry_t pteflags = PG_V | PG_KW | pmap_pg_nx;
+	const pd_entry_t holepteflags = PG_V | pmap_pg_nx;
 
 	CTASSERT(NL4_SLOT_DIRECT * NBPD_L4 == MAXPHYSMEM);
 
+	spahole = roundup(bootspace.head.pa, NBPD_L2);
+	epahole = rounddown(bootspace.boot.pa, NBPD_L2);
+
 	/* Get the last physical address available */
 	lastpa = 0;
 	for (i = 0; i < mem_cluster_cnt; i++) {
@@ -1458,87 +1465,50 @@ pmap_init_directmap(struct pmap *kpm)
 	tmpva = bootspace.spareva;
 	pte = PTE_BASE + pl1_i(tmpva);
 
-	/* Number of L4 entries. */
+	/* Build L4 */
+	L4e_idx = pl4_i(startva);
 	nL4e = (lastpa + NBPD_L4 - 1) >> L4_SHIFT;
 	KASSERT(nL4e <= NL4_SLOT_DIRECT);
-
-	/* Allocate L3, and zero it out. */
-	L3page_pa = pmap_bootstrap_palloc(nL4e);
 	for (i = 0; i < nL4e; i++) {
-		pdp = L3page_pa + i * PAGE_SIZE;
-		*pte = (pdp & PG_FRAME) | pteflags;
+		KASSERT(L4_BASE[L4e_idx+i] == 0);
+
+		pa = pmap_bootstrap_palloc(1);
+		*pte = (pa & PG_FRAME) | pteflags;
 		pmap_update_pg(tmpva);
 		memset((void *)tmpva, 0, PAGE_SIZE);
+
+		L4_BASE[L4e_idx+i] = pa | pteflags | PG_U;
 	}
 
-	/* Number of L3 entries. */
+	/* Build L3 */
+	L3e_idx = pl3_i(startva);
 	nL3e = (lastpa + NBPD_L3 - 1) >> L3_SHIFT;
+	for (i = 0; i < nL3e; i++) {
+		KASSERT(L3_BASE[L3e_idx+i] == 0);
 
-	/*
-	 * Map the direct map RW. Use super pages (1GB) or large pages (2MB) if
-	 * they are supported. Note: PG_G is not allowed on non-leaf PTPs.
-	 */
-	if (cpu_feature[2] & CPUID_P1GB) {
-		/* Super pages are supported. Just create L3. */
-		for (i = 0; i < nL3e; i++) {
-			pdp = (paddr_t)&(((pd_entry_t *)L3page_pa)[i]);
-			*pte = (pdp & PG_FRAME) | pteflags;
-			pmap_update_pg(tmpva);
-
-			pde = (pd_entry_t *)(tmpva + (pdp & ~PG_FRAME));
-			*pde = ((paddr_t)i << L3_SHIFT) | pteflags | PG_U |
-			PG_PS | PG_G;
-		}
-	} else {
-		/* Allocate L2. */
-		L2page_pa = pmap_bootstrap_palloc(nL3e);
+		pa = pmap_bootstrap_palloc(1);
+		*pte = (pa & PG_FRAME) | pteflags;
+		pmap_update_pg(tmpva);
+		memset((void *)tmpva, 0, PAGE_SIZE);
 
-		/* Number of L2 entries. */
-		nL2e = (lastpa + NBPD_L2 - 1) >> L2_SHIFT;
+		L3_BASE[L3e_idx+i] = pa | pteflags | PG_U;
+	}
 
-		KASSERT(pmap_largepages != 0);
+	/* Build L2 */
+	L2e_idx = pl2_i(startva);
+	nL2e = (lastpa + NBPD_L2 - 1) >> L2_SHIFT;
+	for (i = 0; i < nL2e; i++) {
+		KASSERT(L2_BASE[L2e_idx+i] == 0);
 
-		/* Large pages are supported. Just create L2. */
-		for (i = 0; i < nL3e; i++) {
-			pdp = L2page_pa + i * PAGE_SIZE;
-			*pte = (pdp & PG_FRAME) | pteflags;
-			pmap_update_pg(tmpva);
-
-			memset((void *)tmpva, 0, PAGE_SIZE);
-
-			pde = 

Re: CVS commit: src/sys/netinet

2017-12-28 Thread Tom Ivar Helbekkmo
Ryota Ozaki  writes:

> Oh, my patch failed to keep SPL at IPL_VM because mutex_exit
> tries to restore an SPL where mutex_enter is called. So I had to
> put splvm before mutex_enter. Could you try the 2nd patch:
>   http://www.netbsd.org/~ozaki-r/fix-pool_catchup.diff

Will do.  I assume that this is instead of the previous patch, not in
addition to it, as we're now already at IPL_VM when pool_catchup() is
called, right?

-tih
-- 
Most people who graduate with CS degrees don't understand the significance
of Lisp.  Lisp is the most important idea in computer science.  --Alan Kay


CVS commit: src/tests/lib/libc/sys

2017-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 28 09:47:52 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
atf: ptrace: Temporarily skip fpregs* tests on pmax

NetBSD/pmax 8.99.9 panics when attempting to use fpregs through ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.20 src/tests/lib/libc/sys/t_ptrace_wait.c:1.21
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.20	Wed Dec 27 13:38:51 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Thu Dec 28 09:47:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.20 2017/12/27 13:38:51 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.21 2017/12/28 09:47:52 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.20 2017/12/27 13:38:51 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.21 2017/12/28 09:47:52 kamil Exp $");
 
 #include 
 #include 
@@ -4311,6 +4311,17 @@ ATF_TC_BODY(fpregs1, tc)
 #endif
 	struct fpreg r;
 
+	/* pmax kernel 8.99.9 panics */
+	char *machine;
+	size_t mlen;
+	machine = asysctlbyname("hw.machine", );
+	ATF_REQUIRE(machine);
+	if (strcmp(machine, "pmax") == 0) {
+		atf_tc_expect_fail("PR port-pmax/52871");
+		ATF_REQUIRE(0 && "In order to get reliable failure, abort");
+	}
+	free(machine);
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -4366,6 +4377,17 @@ ATF_TC_BODY(fpregs2, tc)
 #endif
 	struct fpreg r;
 
+	/* pmax kernel 8.99.9 panics */
+	char *machine;
+	size_t mlen;
+	machine = asysctlbyname("hw.machine", );
+	ATF_REQUIRE(machine);
+	if (strcmp(machine, "pmax") == 0) {
+		atf_tc_expect_fail("PR port-pmax/52871");
+		ATF_REQUIRE(0 && "In order to get reliable failure, abort");
+	}
+	free(machine);
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {



CVS commit: src/tests/lib/libc/sys

2017-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 28 09:47:52 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
atf: ptrace: Temporarily skip fpregs* tests on pmax

NetBSD/pmax 8.99.9 panics when attempting to use fpregs through ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/sys/dev/acpi

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 08:49:28 UTC 2017

Modified Files:
src/sys/dev/acpi: acpi_srat.c acpi_srat.h

Log Message:
Style, export struct acpisrat_node, and add acpisrat_get_node.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/acpi_srat.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_srat.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/acpi

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 08:49:28 UTC 2017

Modified Files:
src/sys/dev/acpi: acpi_srat.c acpi_srat.h

Log Message:
Style, export struct acpisrat_node, and add acpisrat_get_node.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/acpi_srat.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_srat.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/acpi/acpi_srat.c
diff -u src/sys/dev/acpi/acpi_srat.c:1.4 src/sys/dev/acpi/acpi_srat.c:1.5
--- src/sys/dev/acpi/acpi_srat.c:1.4	Thu Aug 31 08:45:03 2017
+++ src/sys/dev/acpi/acpi_srat.c	Thu Dec 28 08:49:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_srat.c,v 1.4 2017/08/31 08:45:03 msaitoh Exp $ */
+/* $NetBSD: acpi_srat.c,v 1.5 2017/12/28 08:49:28 maxv Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.4 2017/08/31 08:45:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,v 1.5 2017/12/28 08:49:28 maxv Exp $");
 
 #include 
 #include 
@@ -41,14 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_srat.c,
 
 static ACPI_TABLE_SRAT *srat;
 
-struct acpisrat_node {
-	acpisrat_nodeid_t nodeid;
-	uint32_t ncpus; /* Number of cpus in this node */
-	struct acpisrat_cpu **cpu; /* Array of cpus */
-	uint32_t nmems; /* Number of memory ranges in this node */
-	struct acpisrat_mem **mem; /* Array of memory ranges */
-};
-
 static uint32_t nnodes; /* Number of NUMA nodes */
 static struct acpisrat_node *node_array; /* Array of NUMA nodes */
 static uint32_t ncpus; /* Number of CPUs */
@@ -56,7 +48,6 @@ static struct acpisrat_cpu *cpu_array; /
 static uint32_t nmems; /* Number of Memory ranges */
 static struct acpisrat_mem *mem_array;
 
-
 struct cpulist {
 	struct acpisrat_cpu cpu;
 	TAILQ_ENTRY(cpulist) entry;
@@ -64,12 +55,11 @@ struct cpulist {
 
 static TAILQ_HEAD(, cpulist) cpulisthead;
 
-#define CPU_INIT		TAILQ_INIT();
+#define CPU_INIT()		TAILQ_INIT();
 #define CPU_FOREACH(cpu)	TAILQ_FOREACH(cpu, , entry)
 #define CPU_ADD(cpu)		TAILQ_INSERT_TAIL(, cpu, entry)
 #define CPU_REM(cpu)		TAILQ_REMOVE(, cpu, entry)
-#define CPU_FIRST		TAILQ_FIRST()
-
+#define CPU_FIRST()		TAILQ_FIRST()
 
 struct memlist {
 	struct acpisrat_mem mem;
@@ -78,12 +68,12 @@ struct memlist {
 
 static TAILQ_HEAD(, memlist) memlisthead;
 
-#define MEM_INIT		TAILQ_INIT()
+#define MEM_INIT()		TAILQ_INIT()
 #define MEM_FOREACH(mem)	TAILQ_FOREACH(mem, , entry)
 #define MEM_ADD(mem)		TAILQ_INSERT_TAIL(, mem, entry)
 #define MEM_ADD_BEFORE(mem, b)	TAILQ_INSERT_BEFORE(b, mem, entry)
 #define MEM_REM(mem)		TAILQ_REMOVE(, mem, entry)
-#define MEM_FIRST		TAILQ_FIRST()
+#define MEM_FIRST()		TAILQ_FIRST()
 
 
 static struct cpulist *
@@ -98,21 +88,6 @@ cpu_free(struct cpulist *c)
 	kmem_free(c, sizeof(struct cpulist));
 }
 
-#if 0
-static struct cpulist *
-cpu_get(acpisrat_nodeid_t nodeid)
-{
-	struct cpulist *tmp;
-
-	CPU_FOREACH(tmp) {
-		if (tmp->cpu.nodeid == nodeid)
-			return tmp;
-	}
-
-	return NULL;
-}
-#endif
-
 static struct memlist *
 mem_alloc(void)
 {
@@ -138,7 +113,10 @@ mem_get(acpisrat_nodeid_t nodeid)
 	return NULL;
 }
 
-
+/*
+ * Returns true if ACPI SRAT table is available. If table does not exist, all
+ * functions below have undefined behaviour.
+ */
 bool
 acpisrat_exist(void)
 {
@@ -232,12 +210,13 @@ acpisrat_parse(void)
 break;
 			nodeid = srat_x2apic->ProximityDomain;
 
-			/* This table entry overrides
+			/*
+			 * This table entry overrides
 			 * ACPI_SRAT_TYPE_CPU_AFFINITY.
 			 */
 			if (!ignore_cpu_affinity) {
 struct cpulist *citer;
-while ((citer = CPU_FIRST) != NULL) {
+while ((citer = CPU_FIRST()) != NULL) {
 	CPU_REM(citer);
 	cpu_free(citer);
 }
@@ -273,14 +252,13 @@ acpisrat_quirks(void)
 
 	/* Some sanity checks. */
 
-	/* Deal with holes in the memory nodes.
-	 * BIOS doesn't enlist memory nodes which
-	 * don't have any memory modules plugged in.
-	 * This behaviour has been observed on AMD machines.
+	/*
+	 * Deal with holes in the memory nodes. BIOS doesn't enlist memory
+	 * nodes which don't have any memory modules plugged in. This behaviour
+	 * has been observed on AMD machines.
 	 *
-	 * Do that by searching for CPUs in NUMA nodes
-	 * which don't exist in the memory and then insert
-	 * a zero memory range for the missing node.
+	 * Do that by searching for CPUs in NUMA nodes which don't exist in the
+	 * memory and then insert a zero memory range for the missing node.
 	 */
 	CPU_FOREACH(citer) {
 		mem = mem_get(citer->cpu.nodeid);
@@ -303,6 +281,10 @@ acpisrat_quirks(void)
 	return 0;
 }
 
+/*
+ * Initializes parser. Must be the first function being called when table is
+ * available.
+ */
 int
 acpisrat_init(void)
 {
@@ -311,6 +293,9 @@ acpisrat_init(void)
 	return acpisrat_refresh();
 }
 
+/*
+ * Re-parse ACPI SRAT table. Useful after hotplugging cpu or RAM.
+ */
 

Re: CVS commit: src/sys/netinet

2017-12-28 Thread Ryota Ozaki
On Thu, Dec 28, 2017 at 5:05 PM, Tom Ivar Helbekkmo
 wrote:
> Ryota Ozaki  writes:
>
>> I think the below patch fixes the above issue, but probably
>> there is a better solution.
>
> Looks like didn't -- it just changed it a little bit.  Just like the
> last time, the hang happened while reading email over IMAP, which
> exercises disk and network at the same time, while the machine was busy
> doing a parallellized system build in the background.  This time,
> though, I got a core dump.  Here's the hang (the active process on this
> CPU is the IMAP server):

Oh, my patch failed to keep SPL at IPL_VM because mutex_exit
tries to restore an SPL where mutex_enter is called. So I had to
put splvm before mutex_enter. Could you try the 2nd patch:
  http://www.netbsd.org/~ozaki-r/fix-pool_catchup.diff


>
> __cpu_simple_lock_try() at __cpu_simple_lock_try+0x9
> pool_grow() at pool_grow+0x55d
> pool_catchup() at pool_catchup+0x32
> pool_get() at pool_get+0x492
> pool_cache_get_slow() at pool_cache_get_slow+0x1b4
> pool_cache_get_paddr() at pool_cache_get_paddr+0x275
> m_get() at m_get+0x2a
> m_gethdr() at m_gethdr+0x9
> wm_add_rxbuf() at wm_add_rxbuf+0x3a
> wm_rxeof() at wm_rxeof+0x146
> wm_intr_legacy() at wm_intr_legacy+0xa1
> intr_biglock_wrapper() at intr_biglock_wrapper+0x1d
> Xintr_ioapic_level2() at Xintr_ioapic_level2+0xf7
> --- interrupt ---
> Xspllower() at Xspllower+0xe
> uvm_km_kmem_alloc() at uvm_km_kmem_alloc+0x139
> pool_page_alloc() at pool_page_alloc+0x2c
> pool_grow() at pool_grow+0x24f
> pool_catchup() at pool_catchup+0x32
> pool_get() at pool_get+0x492
> pool_cache_get_slow() at pool_cache_get_slow+0x1b4
> pool_cache_get_paddr() at pool_cache_get_paddr+0x275
> m_get() at m_get+0x2a
> m_gethdr() at m_gethdr+0x9
> sosend() at sosend+0x35a
> soo_write() at soo_write+0x2c
> dofilewrite() at dofilewrite+0x97
> sys_write() at sys_write+0x5f
> syscall() at syscall+0x1d8
> --- syscall (number 4) ---
>
> The only other CPU that looks interesting has this (copied from a
> photograph of the console, as crash(8) doesn't know about CPUs):
>
> _kernel_lock()
> ip_slowtimo()
> pfslowtimo()
> callout_softclock()
> softint_dispatch()

This is correct. intr_biglock_wrapper in the first backtrace holds
KERNEL_LOCK and this _kernel_lock() waits for it to be released.

Thanks,
  ozaki-r


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

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 08:30:36 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
typos


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/include/cpu.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/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.83 src/sys/arch/x86/include/cpu.h:1.84
--- src/sys/arch/x86/include/cpu.h:1.83	Sat Dec  2 21:04:59 2017
+++ src/sys/arch/x86/include/cpu.h	Thu Dec 28 08:30:36 2017
@@ -1,6 +1,6 @@
-/*	$NetBSD: cpu.h,v 1.83 2017/12/02 21:04:59 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.84 2017/12/28 08:30:36 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 1990 The Regents of the University of California.
  * All rights reserved.
  *
@@ -101,7 +101,7 @@ struct cpu_info {
 	struct lwp *ci_fpcurlwp;	/* current owner of the FPU */
 	cpuid_t ci_cpuid;		/* our CPU ID */
 	uint32_t ci_acpiid;		/* our ACPI/MADT ID */
-	uint32_t ci_initapicid;		/* our intitial APIC ID */
+	uint32_t ci_initapicid;		/* our initial APIC ID */
 
 	/*
 	 * Private members.
@@ -264,7 +264,7 @@ struct cpu_info {
 /*
  * Processor flag notes: The "primary" CPU has certain MI-defined
  * roles (mostly relating to hardclock handling); we distinguish
- * betwen the processor which booted us, and the processor currently
+ * between the processor which booted us, and the processor currently
  * holding the "primary" role just to give us the flexibility later to
  * change primaries should we be sufficiently twisted.
  */
@@ -504,7 +504,7 @@ void x86_bus_space_mallocok(void);
 	 * 3: maximum frequency
 	 */
 #define	CPU_TMLR_FREQUENCY	12	/* int: current frequency */
-#define	CPU_TMLR_VOLTAGE	13	/* int: curret voltage */
+#define	CPU_TMLR_VOLTAGE	13	/* int: current voltage */
 #define	CPU_TMLR_PERCENTAGE	14	/* int: current clock percentage */
 #define	CPU_FPU_SAVE		15	/* int: FPU Instructions layout
 	 * to use this, CPU_OSFXSR must be true



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

2017-12-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Dec 28 08:30:36 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
typos


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/include/cpu.h

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



Re: CVS commit: src/sys/netinet

2017-12-28 Thread Tom Ivar Helbekkmo
Ryota Ozaki  writes:

> I think the below patch fixes the above issue, but probably
> there is a better solution.

Looks like didn't -- it just changed it a little bit.  Just like the
last time, the hang happened while reading email over IMAP, which
exercises disk and network at the same time, while the machine was busy
doing a parallellized system build in the background.  This time,
though, I got a core dump.  Here's the hang (the active process on this
CPU is the IMAP server):

__cpu_simple_lock_try() at __cpu_simple_lock_try+0x9
pool_grow() at pool_grow+0x55d
pool_catchup() at pool_catchup+0x32
pool_get() at pool_get+0x492
pool_cache_get_slow() at pool_cache_get_slow+0x1b4
pool_cache_get_paddr() at pool_cache_get_paddr+0x275
m_get() at m_get+0x2a
m_gethdr() at m_gethdr+0x9
wm_add_rxbuf() at wm_add_rxbuf+0x3a
wm_rxeof() at wm_rxeof+0x146
wm_intr_legacy() at wm_intr_legacy+0xa1
intr_biglock_wrapper() at intr_biglock_wrapper+0x1d
Xintr_ioapic_level2() at Xintr_ioapic_level2+0xf7
--- interrupt ---
Xspllower() at Xspllower+0xe
uvm_km_kmem_alloc() at uvm_km_kmem_alloc+0x139
pool_page_alloc() at pool_page_alloc+0x2c
pool_grow() at pool_grow+0x24f
pool_catchup() at pool_catchup+0x32
pool_get() at pool_get+0x492
pool_cache_get_slow() at pool_cache_get_slow+0x1b4
pool_cache_get_paddr() at pool_cache_get_paddr+0x275
m_get() at m_get+0x2a
m_gethdr() at m_gethdr+0x9
sosend() at sosend+0x35a
soo_write() at soo_write+0x2c
dofilewrite() at dofilewrite+0x97
sys_write() at sys_write+0x5f
syscall() at syscall+0x1d8
--- syscall (number 4) ---

The only other CPU that looks interesting has this (copied from a
photograph of the console, as crash(8) doesn't know about CPUs):

_kernel_lock()
ip_slowtimo()
pfslowtimo()
callout_softclock()
softint_dispatch()

The two remaining ones are in x86_pause(), waiting for I/O.

-tih
-- 
Most people who graduate with CS degrees don't understand the significance
of Lisp.  Lisp is the most important idea in computer science.  --Alan Kay