CVS commit: src/share/man/man4

2018-08-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 13 05:41:54 UTC 2018

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

Log Message:
Add a missing word.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/netintro.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/netintro.4
diff -u src/share/man/man4/netintro.4:1.29 src/share/man/man4/netintro.4:1.30
--- src/share/man/man4/netintro.4:1.29	Thu Aug  2 00:41:17 2018
+++ src/share/man/man4/netintro.4	Mon Aug 13 05:41:54 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netintro.4,v 1.29 2018/08/02 00:41:17 sevan Exp $
+.\"	$NetBSD: netintro.4,v 1.30 2018/08/13 05:41:54 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -109,7 +109,7 @@ Raw socket interfaces are provided to th
 .Tn IP
 protocol layer of the Internet.
 Consult the appropriate manual pages in this section for more
-information regarding the support a protocol.
+information regarding the support for a protocol.
 .Sh ADDRESSING
 Associated with each protocol family is an address format.
 All network address adhere to a general structure, called a sockaddr,



CVS commit: src/share/man/man4

2018-08-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 13 05:41:54 UTC 2018

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

Log Message:
Add a missing word.


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

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



CVS commit: src

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 13 03:20:19 UTC 2018

Modified Files:
src/share/man/man4: ddb.4
src/sys/ddb: db_command.c
src/sys/kern: kern_history.c
src/sys/sys: kernhist.h

Log Message:
extend the ddb "show kernhist" command.  the synopsis is now:

 show kernhist[/i] [addr[,count]]

the i modifier means display info instead of entries, and the count
restricts to the last count entries.

the count option is only supported for specified histories.  it
could be extended but requires more logic than the single history,
as multiple histories are merged during display.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/share/man/man4/ddb.4
cvs rdiff -u -r1.155 -r1.156 src/sys/ddb/db_command.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_history.c
cvs rdiff -u -r1.23 -r1.24 src/sys/sys/kernhist.h

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

Modified files:

Index: src/share/man/man4/ddb.4
diff -u src/share/man/man4/ddb.4:1.182 src/share/man/man4/ddb.4:1.183
--- src/share/man/man4/ddb.4:1.182	Mon Jul 30 06:18:25 2018
+++ src/share/man/man4/ddb.4	Mon Aug 13 03:20:19 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.182 2018/07/30 06:18:25 ryo Exp $
+.\"	$NetBSD: ddb.4,v 1.183 2018/08/13 03:20:19 mrg 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 July 30, 2018
+.Dd August 12, 2018
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -771,9 +771,21 @@ is specified, all sockets are printed.
 .El
 .It Ic show uvmexp
 Print a selection of UVM counters and statistics.
-.It Ic show kernhist Oo Ar addr Oc
+.It Ic show kernhist Ns Oo Cm /i Oc Oo Ar addr Ns Oo , Ns Ar count Oc Oc
 Dumps all the kernel histories if no address is specified, or the history
 at the address.
+If
+.Cm /i
+is specified, display information about the named history or all histories,
+instead of history entries.
+If
+.Ar count
+is specified, only the last
+.Ar count
+entries will be displayed.
+Currently the
+.Ar count
+handling is only performed if a single history is requested.
 This command is available only if a kernel is compiled with one or more
 of the kernel history options
 .Cd KERNHIST ,

Index: src/sys/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.155 src/sys/ddb/db_command.c:1.156
--- src/sys/ddb/db_command.c:1.155	Sun Aug 12 22:05:29 2018
+++ src/sys/ddb/db_command.c	Mon Aug 13 03:20:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.155 2018/08/12 22:05:29 mrg Exp $	*/
+/*	$NetBSD: db_command.c,v 1.156 2018/08/13 03:20:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.155 2018/08/12 22:05:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.156 2018/08/13 03:20:19 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1232,7 +1232,7 @@ db_kernhist_print_cmd(db_expr_t addr, bo
 db_expr_t count, const char *modif)
 {
 
-	kernhist_print((void *)(uintptr_t)addr, db_printf);
+	kernhist_print((void *)(uintptr_t)addr, count, modif, db_printf);
 }
 #endif
 

Index: src/sys/kern/kern_history.c
diff -u src/sys/kern/kern_history.c:1.16 src/sys/kern/kern_history.c:1.17
--- src/sys/kern/kern_history.c:1.16	Fri Nov  3 22:45:14 2017
+++ src/sys/kern/kern_history.c	Mon Aug 13 03:20:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_history.c,v 1.16 2017/11/03 22:45:14 pgoyette Exp $	 */
+/*	$NetBSD: kern_history.c,v 1.17 2018/08/13 03:20:19 mrg Exp $	 */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.16 2017/11/03 22:45:14 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.17 2018/08/13 03:20:19 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
@@ -92,12 +92,22 @@ static int sysctl_kernhist_helper(SYSCTL
  * prototypes
  */
 
-void kernhist_dump(struct kern_history *,
+void kernhist_dump(struct kern_history *, size_t count,
 void (*)(const char *, ...) __printflike(1, 2));
+static void kernhist_info(struct kern_history *,
+void (*)(const char *, ...));
 void kernhist_dumpmask(uint32_t);
-static void kernhist_dump_histories(struct kern_history *[],
+static void kernhist_dump_histories(struct kern_history *[], size_t count,
 void (*)(const char *, ...) __printflike(1, 2));
 
+/* display info about one kernhist */
+static void
+kernhist_info(struct kern_history *l, void (*pr)(const char *, ...))
+{
+
+	pr("kernhist '%s': at %p total %u next free %u\n",
+	l->name, l, l->n, l->f);
+}
 
 /*
  * call this from ddb
@@ -105,11 +115,17 @@ static void kernhist_dump_histories(stru
  * expects the system to be quiesced, no locking
  */
 

CVS commit: src

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 13 03:20:19 UTC 2018

Modified Files:
src/share/man/man4: ddb.4
src/sys/ddb: db_command.c
src/sys/kern: kern_history.c
src/sys/sys: kernhist.h

Log Message:
extend the ddb "show kernhist" command.  the synopsis is now:

 show kernhist[/i] [addr[,count]]

the i modifier means display info instead of entries, and the count
restricts to the last count entries.

the count option is only supported for specified histories.  it
could be extended but requires more logic than the single history,
as multiple histories are merged during display.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/share/man/man4/ddb.4
cvs rdiff -u -r1.155 -r1.156 src/sys/ddb/db_command.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_history.c
cvs rdiff -u -r1.23 -r1.24 src/sys/sys/kernhist.h

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



CVS commit: src/sys

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 12 22:05:29 UTC 2018

Modified Files:
src/sys/ddb: db_command.c
src/sys/kern: subr_lockdebug.c
src/sys/sys: lockdebug.h

Log Message:
add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts.  use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/ddb/db_command.c
cvs rdiff -u -r1.64 -r1.65 src/sys/kern/subr_lockdebug.c
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/lockdebug.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.154 src/sys/ddb/db_command.c:1.155
--- src/sys/ddb/db_command.c:1.154	Fri Jul 20 08:26:25 2018
+++ src/sys/ddb/db_command.c	Sun Aug 12 22:05:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.154 2018/07/20 08:26:25 msaitoh Exp $	*/
+/*	$NetBSD: db_command.c,v 1.155 2018/08/12 22:05:29 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.154 2018/07/20 08:26:25 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.155 2018/08/12 22:05:29 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1352,6 +1352,10 @@ db_reboot_cmd(db_expr_t addr, bool have_
 	 * called from cpu_reboot.
 	 */
 	db_recover = 0;
+	/* Avoid all mutex errors */
+#ifdef LOCKDEBUG
+	lockdebug_dismiss();
+#endif
 	panicstr = "reboot forced via kernel debugger";
 	cpu_reboot((int)bootflags, NULL);
 #else	/* _KERNEL */

Index: src/sys/kern/subr_lockdebug.c
diff -u src/sys/kern/subr_lockdebug.c:1.64 src/sys/kern/subr_lockdebug.c:1.65
--- src/sys/kern/subr_lockdebug.c:1.64	Mon Mar 19 08:41:21 2018
+++ src/sys/kern/subr_lockdebug.c	Sun Aug 12 22:05:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_lockdebug.c,v 1.64 2018/03/19 08:41:21 ozaki-r Exp $	*/
+/*	$NetBSD: subr_lockdebug.c,v 1.65 2018/08/12 22:05:29 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.64 2018/03/19 08:41:21 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.65 2018/08/12 22:05:29 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -981,6 +981,19 @@ lockdebug_show_lockstats(void (*pr)(cons
 #endif	/* DDB */
 
 /*
+ * lockdebug_dismiss:
+ *
+ *  The system is rebooting, and potentially from an unsafe
+ *  place so avoid any future aborts.
+ */
+void
+lockdebug_dismiss(void)
+{
+
+	atomic_inc_uint_nv(_panic);
+}
+
+/*
  * lockdebug_abort:
  *
  *	An error has been trapped - dump lock info and call panic().

Index: src/sys/sys/lockdebug.h
diff -u src/sys/sys/lockdebug.h:1.19 src/sys/sys/lockdebug.h:1.20
--- src/sys/sys/lockdebug.h:1.19	Mon Mar 19 08:41:21 2018
+++ src/sys/sys/lockdebug.h	Sun Aug 12 22:05:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockdebug.h,v 1.19 2018/03/19 08:41:21 ozaki-r Exp $	*/
+/*	$NetBSD: lockdebug.h,v 1.20 2018/08/12 22:05:29 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@ typedef	struct lockops {
 #define	LOCKDEBUG_ABORT(f, ln, l, o, m) \
 lockdebug_abort(f, ln, l, o, m)
 
+void	lockdebug_dismiss(void);
 void	lockdebug_abort(const char *, size_t, const volatile void *,
 lockops_t *, const char *);
 



CVS commit: src/sys

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 12 22:05:29 UTC 2018

Modified Files:
src/sys/ddb: db_command.c
src/sys/kern: subr_lockdebug.c
src/sys/sys: lockdebug.h

Log Message:
add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts.  use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/ddb/db_command.c
cvs rdiff -u -r1.64 -r1.65 src/sys/kern/subr_lockdebug.c
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/lockdebug.h

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



CVS commit: src/external/gpl3

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 12 21:48:57 UTC 2018

Modified Files:
src/external/gpl3/gcc: Makefile.gcc_path
src/external/gpl3/gcc.old: Makefile.gcc_path
src/external/gpl3/gcc.old/lib/libgomp: Makefile
src/external/gpl3/gcc.old/usr.bin/include: Makefile
src/external/gpl3/gcc.old/usr.bin/include/sanitizer: Makefile
src/external/gpl3/gcc/lib/libgomp: Makefile
src/external/gpl3/gcc/usr.bin/include: Makefile
src/external/gpl3/gcc/usr.bin/include/sanitizer: Makefile

Log Message:
consolidate path for gcc-version specific into GCC_INCSDIR, and
have it derived from the HAVE_GCC value so it does not need to
be modified for newer GCCs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/Makefile.gcc_path
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/Makefile.gcc_path
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/lib/libgomp/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/usr.bin/include/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gcc/lib/libgomp/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/usr.bin/include/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/Makefile.gcc_path
diff -u src/external/gpl3/gcc/Makefile.gcc_path:1.2 src/external/gpl3/gcc/Makefile.gcc_path:1.3
--- src/external/gpl3/gcc/Makefile.gcc_path:1.2	Sat Jun 14 20:49:36 2014
+++ src/external/gpl3/gcc/Makefile.gcc_path	Sun Aug 12 21:48:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gcc_path,v 1.2 2014/06/14 20:49:36 mrg Exp $
+#	$NetBSD: Makefile.gcc_path,v 1.3 2018/08/12 21:48:56 mrg Exp $
 
 # Define some commom paths
 
@@ -13,4 +13,6 @@ GCC_SUBDIR=	${NETBSDSRCDIR}/external/gpl
 GCCDIST=	${GCC_SUBDIR}/dist
 #.endif
 
+GCC_INCSDIR=	/usr/include/gcc-${HAVE_GCC}
+
 .endif	# _GPL3_GCC_MAKEFILE_INC_

Index: src/external/gpl3/gcc.old/Makefile.gcc_path
diff -u src/external/gpl3/gcc.old/Makefile.gcc_path:1.6 src/external/gpl3/gcc.old/Makefile.gcc_path:1.7
--- src/external/gpl3/gcc.old/Makefile.gcc_path:1.6	Sun Jul 23 01:10:50 2017
+++ src/external/gpl3/gcc.old/Makefile.gcc_path	Sun Aug 12 21:48:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gcc_path,v 1.6 2017/07/23 01:10:50 mrg Exp $
+#	$NetBSD: Makefile.gcc_path,v 1.7 2018/08/12 21:48:57 mrg Exp $
 
 # Define some commom paths
 
@@ -13,4 +13,6 @@ GCC_SUBDIR=	${NETBSDSRCDIR}/external/gpl
 GCCDIST=	${GCC_SUBDIR}/dist
 #.endif
 
+GCC_INCSDIR=	/usr/include/gcc-${HAVE_GCC}
+
 .endif	# _GPL3_GCC_MAKEFILE_INC_

Index: src/external/gpl3/gcc.old/lib/libgomp/Makefile
diff -u src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.7 src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.8
--- src/external/gpl3/gcc.old/lib/libgomp/Makefile:1.7	Thu Aug  2 00:03:42 2018
+++ src/external/gpl3/gcc.old/lib/libgomp/Makefile	Sun Aug 12 21:48:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2018/08/02 00:03:42 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2018/08/12 21:48:57 mrg Exp $
 
 # build GCC's libgomp, so that -fopenmp works.
 
@@ -79,7 +79,7 @@ FILES=		libgomp.spec
 FILESDIR=	${LIBDIR}
 
 INCS=		omp.h openacc.h
-INCSDIR=	/usr/include/gcc-6
+INCSDIR=	${GCC_INCSDIR}
 .endif
 
 .else			# } else {

Index: src/external/gpl3/gcc.old/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.9 src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.10
--- src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.9	Thu Aug  2 00:04:03 2018
+++ src/external/gpl3/gcc.old/usr.bin/include/Makefile	Sun Aug 12 21:48:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2018/08/02 00:04:03 mrg Exp $
+#	$NetBSD: Makefile,v 1.10 2018/08/12 21:48:57 mrg Exp $
 
 .include 
 
@@ -25,7 +25,7 @@ mm_malloc.h: ${DIST}/gcc/config/i386/pmm
 CLEANFILES+=	mm_malloc.h
 .endif
 
-INCSDIR=	/usr/include/gcc-6
+INCSDIR=	${GCC_INCSDIR}
 
 .include 
 .include 

Index: src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile
diff -u src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile:1.2 src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile:1.3
--- src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile:1.2	Thu Aug  2 07:47:30 2018
+++ src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile	Sun Aug 12 21:48:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2018/08/02 07:47:30 mrg Exp $
+#	$NetBSD: Makefile,v 1.3 2018/08/12 21:48:57 mrg Exp $
 
 .include "../../../Makefile.gcc_path"
 
@@ -19,6 +19,6 @@ INCS+=	tsan_interface_atomic.h
 
 .include 
 
-INCSDIR=	/usr/include/gcc-6/sanitizer
+INCSDIR=	${GCC_INCSDIR}/sanitizer
 
 .include 

Index: src/external/gpl3/gcc/lib/libgomp/Makefile
diff -u src/external/gpl3/gcc/lib/libgomp/Makefile:1.19 

CVS commit: src/external/gpl3

2018-08-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 12 21:48:57 UTC 2018

Modified Files:
src/external/gpl3/gcc: Makefile.gcc_path
src/external/gpl3/gcc.old: Makefile.gcc_path
src/external/gpl3/gcc.old/lib/libgomp: Makefile
src/external/gpl3/gcc.old/usr.bin/include: Makefile
src/external/gpl3/gcc.old/usr.bin/include/sanitizer: Makefile
src/external/gpl3/gcc/lib/libgomp: Makefile
src/external/gpl3/gcc/usr.bin/include: Makefile
src/external/gpl3/gcc/usr.bin/include/sanitizer: Makefile

Log Message:
consolidate path for gcc-version specific into GCC_INCSDIR, and
have it derived from the HAVE_GCC value so it does not need to
be modified for newer GCCs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/Makefile.gcc_path
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/Makefile.gcc_path
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/lib/libgomp/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc.old/usr.bin/include/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gcc/lib/libgomp/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/usr.bin/include/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 21:44:17 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gicv3_fdt.c

Log Message:
Use aprint_debug for redist count print


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

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

Modified files:

Index: src/sys/arch/arm/fdt/gicv3_fdt.c
diff -u src/sys/arch/arm/fdt/gicv3_fdt.c:1.1 src/sys/arch/arm/fdt/gicv3_fdt.c:1.2
--- src/sys/arch/arm/fdt/gicv3_fdt.c:1.1	Wed Aug  8 19:03:08 2018
+++ src/sys/arch/arm/fdt/gicv3_fdt.c	Sun Aug 12 21:44:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_fdt.c,v 1.1 2018/08/08 19:03:08 jmcneill Exp $ */
+/* $NetBSD: gicv3_fdt.c,v 1.2 2018/08/12 21:44:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -29,7 +29,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.1 2018/08/08 19:03:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.2 2018/08/12 21:44:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -142,7 +142,7 @@ gicv3_fdt_attach(device_t parent, device
 		return;
 	}
 
-	aprint_normal_dev(self, "%d redistributors\n", sc->sc_gic.sc_bsh_r_count);
+	aprint_debug_dev(self, "%d redistributors\n", sc->sc_gic.sc_bsh_r_count);
 
 	error = gicv3_init(>sc_gic);
 	if (error) {



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 21:44:17 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gicv3_fdt.c

Log Message:
Use aprint_debug for redist count print


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/gicv3_fdt.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/evbarm/zynq

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 20:28:38 UTC 2018

Modified Files:
src/sys/arch/evbarm/zynq: zynq_machdep.c

Log Message:
Make PARALLELLA build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/zynq/zynq_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/zynq/zynq_machdep.c
diff -u src/sys/arch/evbarm/zynq/zynq_machdep.c:1.2 src/sys/arch/evbarm/zynq/zynq_machdep.c:1.3
--- src/sys/arch/evbarm/zynq/zynq_machdep.c:1.2	Tue Jul 17 18:41:01 2018
+++ src/sys/arch/evbarm/zynq/zynq_machdep.c	Sun Aug 12 20:28:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: zynq_machdep.c,v 1.2 2018/07/17 18:41:01 christos Exp $	*/
+/*	$NetBSD: zynq_machdep.c,v 1.3 2018/08/12 20:28:38 skrll Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.2 2018/07/17 18:41:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.3 2018/08/12 20:28:38 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -78,8 +78,6 @@ u_int uboot_args[4] __attribute__((__sec
  * kernel address space.  *Not* for general use.
  */
 #define	KERN_VTOPDIFF	((vaddr_t)KERNEL_BASE_phys - (vaddr_t)KERNEL_BASE_virt)
-#define KERN_VTOPHYS(va) ((paddr_t)((vaddr_t)va + (vaddr_t)KERN_VTOPDIFF))
-#define KERN_PHYSTOV(pa) ((vaddr_t)((paddr_t)pa - (vaddr_t)KERN_VTOPDIFF))
 
 #ifndef CONADDR
 #define CONADDR	(UART1_BASE)
@@ -147,6 +145,8 @@ static const struct pmap_devmap devmap[]
 u_int
 initarm(void *arg)
 {
+	kern_vtopdiff = KERN_VTOPDIFF;
+
 	pmap_devmap_register(devmap);
 	zynq7000_bootstrap(KERNEL_IO_IOREG_VBASE);
 



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 20:28:38 UTC 2018

Modified Files:
src/sys/arch/evbarm/zynq: zynq_machdep.c

Log Message:
Make PARALLELLA build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/zynq/zynq_machdep.c

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



CVS commit: src/external/mpl/bind/include/isc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 20:16:10 UTC 2018

Modified Files:
src/external/mpl/bind/include/isc: platform.h

Log Message:
don't use stdatomic.h yet; there is no support for the _8 functions on
ILP32 so we end up with undefined symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/bind/include/isc/platform.h

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

Modified files:

Index: src/external/mpl/bind/include/isc/platform.h
diff -u src/external/mpl/bind/include/isc/platform.h:1.1 src/external/mpl/bind/include/isc/platform.h:1.2
--- src/external/mpl/bind/include/isc/platform.h:1.1	Sun Aug 12 09:02:43 2018
+++ src/external/mpl/bind/include/isc/platform.h	Sun Aug 12 16:16:10 2018
@@ -324,7 +324,7 @@
  * If  is available on this architecture,
  * ISC_PLATFORM_HAVESTDATOMIC will be defined.
  */
-#ifndef __lint__
+#ifdef notyet
 #define ISC_PLATFORM_HAVESTDATOMIC 1
 #endif
 



CVS commit: src/external/mpl/bind/include/isc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 20:16:10 UTC 2018

Modified Files:
src/external/mpl/bind/include/isc: platform.h

Log Message:
don't use stdatomic.h yet; there is no support for the _8 functions on
ILP32 so we end up with undefined symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mpl/bind/include/isc/platform.h

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



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 20:13:13 UTC 2018

Modified Files:
src/sys/arch/evbarm/imx23_olinuxino: imx23_olinuxino_machdep.c

Log Message:
Fix IMX23_OLINUXINO build


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c

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



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 20:13:13 UTC 2018

Modified Files:
src/sys/arch/evbarm/imx23_olinuxino: imx23_olinuxino_machdep.c

Log Message:
Fix IMX23_OLINUXINO build


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c
diff -u src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.7 src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.8
--- src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.7	Tue Jul 31 06:46:26 2018
+++ src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c	Sun Aug 12 20:13:13 2018
@@ -1,4 +1,4 @@
-/* $Id: imx23_olinuxino_machdep.c,v 1.7 2018/07/31 06:46:26 skrll Exp $ */
+/* $Id: imx23_olinuxino_machdep.c,v 1.8 2018/08/12 20:13:13 skrll Exp $ */
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -87,10 +87,6 @@ do {	\
 
 #define KERNEL_BASE_PHYS ((paddr_t)_BASE_phys)
 #define KERNEL_BASE_VIRT ((vaddr_t)_BASE_virt)
-#define KERN_VTOPHYS(va) \
-((paddr_t)((vaddr_t)(va) - KERNEL_BASE + KERNEL_BASE_PHYS))
-#define KERN_PHYSTOV(pa) \
-((vaddr_t)((paddr_t)(pa) + KERNEL_BASE_VIRT + KERNEL_BASE))
 
 /*
  * Static device map for i.MX23 peripheral address space.
@@ -142,6 +138,8 @@ initarm(void *arg)
 	if (set_cpufuncs())
 		panic("set_cpufuncs failed");
 
+	kern_vtopdiff = KERNEL_BASE + KERNEL_BASE_PHYS;
+
 	pmap_devmap_register(devmap);
 	consinit();
 



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:48:36 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_cru.c

Log Message:
Back to aprint_debug for dumping clocks at attach


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_cru.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/rockchip/rk_cru.c
diff -u src/sys/arch/arm/rockchip/rk_cru.c:1.5 src/sys/arch/arm/rockchip/rk_cru.c:1.6
--- src/sys/arch/arm/rockchip/rk_cru.c:1.5	Sun Aug 12 16:48:05 2018
+++ src/sys/arch/arm/rockchip/rk_cru.c	Sun Aug 12 19:48:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_cru.c,v 1.5 2018/08/12 16:48:05 jmcneill Exp $ */
+/* $NetBSD: rk_cru.c,v 1.6 2018/08/12 19:48:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk_cru.c,v 1.5 2018/08/12 16:48:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_cru.c,v 1.6 2018/08/12 19:48:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -355,13 +355,13 @@ rk_cru_print(struct rk_cru_softc *sc)
 		default:			type = "???"; break;
 		}
 
-	aprint_normal_dev(sc->sc_dev,
+	aprint_debug_dev(sc->sc_dev,
 		"%3d %-14s %2s %-14s %-7s ",
 		clk->id,
 	clk->base.name,
 	clkp_parent ? "<-" : "",
 	clkp_parent ? clkp_parent->name : "",
 	type);
-		aprint_normal("%10d Hz\n", clk_get_rate(>base));
+		aprint_debug("%10d Hz\n", clk_get_rate(>base));
 	}
 }



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:48:36 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_cru.c

Log Message:
Back to aprint_debug for dumping clocks at attach


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_cru.c

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



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:28:42 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk3399_cru.c rk3399_pmucru.c

Log Message:
Add I2C clocks


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk3399_cru.c \
src/sys/arch/arm/rockchip/rk3399_pmucru.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/rockchip/rk3399_cru.c
diff -u src/sys/arch/arm/rockchip/rk3399_cru.c:1.1 src/sys/arch/arm/rockchip/rk3399_cru.c:1.2
--- src/sys/arch/arm/rockchip/rk3399_cru.c:1.1	Sun Aug 12 16:48:05 2018
+++ src/sys/arch/arm/rockchip/rk3399_cru.c	Sun Aug 12 19:28:41 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_cru.c,v 1.1 2018/08/12 16:48:05 jmcneill Exp $ */
+/* $NetBSD: rk3399_cru.c,v 1.2 2018/08/12 19:28:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.1 2018/08/12 16:48:05 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.2 2018/08/12 19:28:41 jmcneill Exp $");
 
 #include 
 #include 
@@ -601,6 +601,58 @@ static struct rk_cru_clk rk3399_cru_clks
 	RK_GATE(RK3399_ACLK_USB3OTG1, "aclk_usb3otg1", "aclk_usb3", CLKGATE_CON(30), 2),
 	RK_GATE(RK3399_ACLK_USB3_RKSOC_AXI_PERF, "aclk_usb3_rksoc_axi_perf", "aclk_usb3", CLKGATE_CON(30), 3),
 	RK_GATE(RK3399_ACLK_USB3_GRF, "aclk_usb3_grf", "aclk_usb3", CLKGATE_CON(30), 4),
+
+	/*
+	 * I2C
+	 */
+	RK_COMPOSITE(RK3399_SCLK_I2C1, "clk_i2c1", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(61),	/* muxdiv_reg */
+		 __BIT(7),		/* mux_mask */
+		 __BITS(6,0),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(0),		/* gate_mask */
+		 0),
+	RK_COMPOSITE(RK3399_SCLK_I2C2, "clk_i2c2", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(62),	/* muxdiv_reg */
+		 __BIT(7),		/* mux_mask */
+		 __BITS(6,0),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(2),		/* gate_mask */
+		 0),
+	RK_COMPOSITE(RK3399_SCLK_I2C3, "clk_i2c3", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(63),	/* muxdiv_reg */
+		 __BIT(7),		/* mux_mask */
+		 __BITS(6,0),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(4),		/* gate_mask */
+		 0),
+	RK_COMPOSITE(RK3399_SCLK_I2C5, "clk_i2c5", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(61),	/* muxdiv_reg */
+		 __BIT(15),		/* mux_mask */
+		 __BITS(14,8),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(1),		/* gate_mask */
+		 0),
+	RK_COMPOSITE(RK3399_SCLK_I2C6, "clk_i2c6", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(62),	/* muxdiv_reg */
+		 __BIT(15),		/* mux_mask */
+		 __BITS(14,8),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(3),		/* gate_mask */
+		 0),
+	RK_COMPOSITE(RK3399_SCLK_I2C7, "clk_i2c7", mux_pll_src_cpll_gpll_parents,
+		 CLKSEL_CON(63),	/* muxdiv_reg */
+		 __BIT(15),		/* mux_mask */
+		 __BITS(14,8),	/* div_mask */
+		 CLKGATE_CON(10),	/* gate_reg */
+		 __BIT(5),		/* gate_mask */
+		 0),
+	RK_GATE(RK3399_PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", CLKGATE_CON(22), 5),
+	RK_GATE(RK3399_PCLK_I2C1, "pclk_rki2c1", "pclk_perilp1", CLKGATE_CON(22), 6),
+	RK_GATE(RK3399_PCLK_I2C5, "pclk_rki2c5", "pclk_perilp1", CLKGATE_CON(22), 7),
+	RK_GATE(RK3399_PCLK_I2C6, "pclk_rki2c6", "pclk_perilp1", CLKGATE_CON(22), 8),
+	RK_GATE(RK3399_PCLK_I2C2, "pclk_rki2c2", "pclk_perilp1", CLKGATE_CON(22), 9),
+	RK_GATE(RK3399_PCLK_I2C3, "pclk_rki2c3", "pclk_perilp1", CLKGATE_CON(22), 10),
 };
 
 static int
Index: src/sys/arch/arm/rockchip/rk3399_pmucru.c
diff -u src/sys/arch/arm/rockchip/rk3399_pmucru.c:1.1 src/sys/arch/arm/rockchip/rk3399_pmucru.c:1.2
--- src/sys/arch/arm/rockchip/rk3399_pmucru.c:1.1	Sun Aug 12 16:48:05 2018
+++ src/sys/arch/arm/rockchip/rk3399_pmucru.c	Sun Aug 12 19:28:41 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_pmucru.c,v 1.1 2018/08/12 16:48:05 jmcneill Exp $ */
+/* $NetBSD: rk3399_pmucru.c,v 1.2 2018/08/12 19:28:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_pmucru.c,v 1.1 2018/08/12 16:48:05 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_pmucru.c,v 1.2 2018/08/12 19:28:41 jmcneill Exp $");
 
 #include 
 #include 
@@ -293,11 +293,33 @@ static struct rk_cru_clk rk3399_pmucru_c
 		   __BIT(31),		/* lock_mask */
 		   pll_rates),
 
+RK_COMPOSITE_NOMUX(RK3399_SCLK_I2C0_PMU, "clk_i2c0_pmu", "ppll",
+			   CLKSEL_CON(2),	/* div_reg */
+			   __BITS(6,0),		/* div_mask */
+			   CLKGATE_CON(0),	/* gate_reg */
+			   __BIT(9),		/* gate_mask */
+			   0),
+RK_COMPOSITE_NOMUX(RK3399_SCLK_I2C4_PMU, "clk_i2c4_pmu", "ppll",
+			   CLKSEL_CON(3),	/* div_reg */
+			   __BITS(6,0),		/* div_mask */
+			   CLKGATE_CON(0),	/* gate_reg */
+			   __BIT(10),		/* gate_mask */
+			

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:28:42 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk3399_cru.c rk3399_pmucru.c

Log Message:
Add I2C clocks


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk3399_cru.c \
src/sys/arch/arm/rockchip/rk3399_pmucru.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/evbarm/conf

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 19:23:20 UTC 2018

Removed Files:
src/sys/arch/evbarm/conf: CUBIEBOARD_INSTALL

Log Message:
G/C


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

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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 19:23:20 UTC 2018

Removed Files:
src/sys/arch/evbarm/conf: CUBIEBOARD_INSTALL

Log Message:
G/C


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

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



CVS commit: src/sys/dev/fdt

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:10:14 UTC 2018

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

Log Message:
Add support for RK3399


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

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

Modified files:

Index: src/sys/dev/fdt/dwc3_fdt.c
diff -u src/sys/dev/fdt/dwc3_fdt.c:1.5 src/sys/dev/fdt/dwc3_fdt.c:1.6
--- src/sys/dev/fdt/dwc3_fdt.c:1.5	Tue Jul  3 16:05:31 2018
+++ src/sys/dev/fdt/dwc3_fdt.c	Sun Aug 12 19:10:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc3_fdt.c,v 1.5 2018/07/03 16:05:31 jmcneill Exp $ */
+/* $NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.5 2018/07/03 16:05:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $");
 
 #include 
 #include 
@@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v
 #define	DWC3_GUSB3PIPECTL(n)		(0xc2c0 + ((n) * 4))
 #define	 GUSB3PIPECTL_PHYSOFTRST	__BIT(31)
 #define	 GUSB3PIPECTL_UX_EXIT_PX	__BIT(27)
+#define	 GUSB3PIPECTL_DEPOCHANGE	__BIT(18)
 #define	 GUSB3PIPECTL_SUSPHY		__BIT(17)
 
 #define	DWC3_DCFG			0xc700
@@ -121,23 +122,31 @@ dwc3_fdt_soft_reset(struct xhci_softc *s
 static void
 dwc3_fdt_enable_phy(struct xhci_softc *sc, const int phandle)
 {
-	const char *max_speed;
+	const char *max_speed, *phy_type;
 	u_int phyif_utmi_bits;
 	uint32_t val;
 
 	val = RD4(sc, DWC3_GUSB2PHYCFG(0));
-	if (of_getprop_uint32(phandle, "snps,phyif-utmi-bits", _utmi_bits) == 0) {
-		if (phyif_utmi_bits == 16) {
-			val |= GUSB2PHYCFG_PHYIF;
-			val &= ~GUSB2PHYCFG_USBTRDTIM;
-			val |= __SHIFTIN(5, GUSB2PHYCFG_USBTRDTIM);
-		} else if (phyif_utmi_bits == 8) {
-			val &= ~GUSB2PHYCFG_PHYIF;
-			val &= ~GUSB2PHYCFG_USBTRDTIM;
-			val |= __SHIFTIN(9, GUSB2PHYCFG_USBTRDTIM);
-		}
+	if (of_getprop_uint32(phandle, "snps,phyif-utmi-bits", _utmi_bits) != 0) {
+		phy_type = fdtbus_get_string(phandle, "phy_type");
+		if (phy_type && strcmp(phy_type, "utmi_wide") == 0)
+			phyif_utmi_bits = 16;
+		else if (phy_type && strcmp(phy_type, "utmi") == 0)
+			phyif_utmi_bits = 8;
+		else
+			phyif_utmi_bits = 0;
+	}
+	if (phyif_utmi_bits == 16) {
+		val |= GUSB2PHYCFG_PHYIF;
+		val &= ~GUSB2PHYCFG_USBTRDTIM;
+		val |= __SHIFTIN(5, GUSB2PHYCFG_USBTRDTIM);
+	} else if (phyif_utmi_bits == 8) {
+		val &= ~GUSB2PHYCFG_PHYIF;
+		val &= ~GUSB2PHYCFG_USBTRDTIM;
+		val |= __SHIFTIN(9, GUSB2PHYCFG_USBTRDTIM);
 	}
-	if (of_hasprop(phandle, "snps,dis-enblslpm-quirk"))
+	if (of_hasprop(phandle, "snps,dis-enblslpm-quirk") ||
+	of_hasprop(phandle, "snps,dis_enblslpm_quirk"))
 		val &= ~GUSB2PHYCFG_ENBLSLPM;
 	if (of_hasprop(phandle, "snps,dis-u2-freeclk-exists-quirk"))
 		val &= ~GUSB2PHYCFG_U2_FREECLK_EXISTS;
@@ -149,6 +158,8 @@ dwc3_fdt_enable_phy(struct xhci_softc *s
 	val &= ~GUSB3PIPECTL_UX_EXIT_PX;
 	if (of_hasprop(phandle, "snps,dis_u3_susphy_quirk"))
 		val &= ~GUSB3PIPECTL_SUSPHY;
+	if (of_hasprop(phandle, "snps,dis-del-phy-power-chg-quirk"))
+		val &= ~GUSB3PIPECTL_DEPOCHANGE;
 	WR4(sc, DWC3_GUSB3PIPECTL(0), val);
 
 	max_speed = fdtbus_get_string(phandle, "maximum-speed");
@@ -187,6 +198,7 @@ dwc3_fdt_match(device_t parent, cfdata_t
 	const char * const compatible[] = {
 		"allwinner,sun50i-h6-dwc3",
 		"rockchip,rk3328-dwc3",
+		"rockchip,rk3399-dwc3",
 		"samsung,exynos5250-dwusb3",
 		NULL
 	};
@@ -268,7 +280,7 @@ dwc3_fdt_attach(device_t parent, device_
 		aprint_error_dev(self, "couldn't enable usb3-phy\n");
 
 	dwc3_fdt_soft_reset(sc);
-	dwc3_fdt_enable_phy(sc, phandle);
+	dwc3_fdt_enable_phy(sc, dwc3_phandle);
 	dwc3_fdt_set_mode(sc, GCTL_PRTCAP_HOST);
 
 	if (!fdtbus_intr_str(dwc3_phandle, 0, intrstr, sizeof(intrstr))) {



CVS commit: src/sys/dev/fdt

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 19:10:14 UTC 2018

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

Log Message:
Add support for RK3399


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

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



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 18:42:08 UTC 2018

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c

Log Message:
Fix GEMINI build


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/gemini/gemini_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/gemini/gemini_machdep.c
diff -u src/sys/arch/evbarm/gemini/gemini_machdep.c:1.26 src/sys/arch/evbarm/gemini/gemini_machdep.c:1.27
--- src/sys/arch/evbarm/gemini/gemini_machdep.c:1.26	Tue Jul 31 06:46:26 2018
+++ src/sys/arch/evbarm/gemini/gemini_machdep.c	Sun Aug 12 18:42:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gemini_machdep.c,v 1.26 2018/07/31 06:46:26 skrll Exp $	*/
+/*	$NetBSD: gemini_machdep.c,v 1.27 2018/08/12 18:42:08 skrll Exp $	*/
 
 /* adapted from:
  *	NetBSD: sdp24xx_machdep.c,v 1.4 2008/08/27 11:03:10 matt Exp
@@ -129,7 +129,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.26 2018/07/31 06:46:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.27 2018/08/12 18:42:08 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_machdep.h"
@@ -237,10 +237,7 @@ unsigned long gemini_ipmq_vbase = GEMINI
  */
 #define KERNEL_BASE_PHYS ((paddr_t)_BASE_phys)
 
-#define KERN_VTOPHYS(va) \
-	((paddr_t)((vaddr_t)va - KERNEL_BASE + GEMINI_DRAM_BASE))
-#define KERN_PHYSTOV(pa) \
-	((vaddr_t)((paddr_t)pa - GEMINI_DRAM_BASE + KERNEL_BASE))
+u_long kern_vtopdiff;
 
 /* Prototypes */
 
@@ -632,6 +629,8 @@ initarm(void *arg)
 	bootconfig.dram[0].address = physical_start;
 	bootconfig.dram[0].pages = physmem;
 
+	kern_vtopdiff = KERNEL_BASE + GEMINI_DRAM_BASE;
+
 	/*
 	 * Our kernel is at the beginning of memory, so set our free space to
 	 * all the memory after the kernel.
@@ -1145,16 +1144,16 @@ printf("%s:%d: pmap_link_l2pt ipmq_pt\n"
 	KERN_PHYSTOV(physical_start), KERN_PHYSTOV(physical_end-1),
 	(int)physmem);
 	printf(mem_fmt, "text section",
-	   KERN_VTOPHYS(KERNEL_BASE_virt), KERN_VTOPHYS(etext-1),
+	   KERN_VTOPHYS((vaddr_t)KERNEL_BASE_virt), KERN_VTOPHYS((vaddr_t)etext-1),
 	   (vaddr_t)KERNEL_BASE_virt, (vaddr_t)etext-1,
 	   (int)(textsize / PAGE_SIZE));
 	printf(mem_fmt, "data section",
-	   KERN_VTOPHYS(__data_start), KERN_VTOPHYS(_edata),
+	   KERN_VTOPHYS((vaddr_t)__data_start), KERN_VTOPHYS((vaddr_t)_edata),
 	   (vaddr_t)__data_start, (vaddr_t)_edata,
 	   (int)((round_page((vaddr_t)_edata)
 		  - trunc_page((vaddr_t)__data_start)) / PAGE_SIZE));
 	printf(mem_fmt, "bss section",
-	   KERN_VTOPHYS(__bss_start), KERN_VTOPHYS(__bss_end__),
+	   KERN_VTOPHYS((vaddr_t)__bss_start), KERN_VTOPHYS((vaddr_t)__bss_end__),
 	   (vaddr_t)__bss_start, (vaddr_t)__bss_end__,
 	   (int)((round_page((vaddr_t)__bss_end__)
 		  - trunc_page((vaddr_t)__bss_start)) / PAGE_SIZE));



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 18:42:08 UTC 2018

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c

Log Message:
Fix GEMINI build


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/gemini/gemini_machdep.c

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



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:39:59 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
Only attempt to set interrupt affinity if we have more than one IRQ.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/fdt/pmu_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/pmu_fdt.c
diff -u src/sys/arch/arm/fdt/pmu_fdt.c:1.3 src/sys/arch/arm/fdt/pmu_fdt.c:1.4
--- src/sys/arch/arm/fdt/pmu_fdt.c:1.3	Mon Jul 16 10:49:52 2018
+++ src/sys/arch/arm/fdt/pmu_fdt.c	Sun Aug 12 18:39:59 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pmu_fdt.c,v 1.3 2018/07/16 10:49:52 jmcneill Exp $ */
+/* $NetBSD: pmu_fdt.c,v 1.4 2018/08/12 18:39:59 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.3 2018/07/16 10:49:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.4 2018/08/12 18:39:59 jmcneill Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -114,38 +115,51 @@ pmu_fdt_init(device_t self)
 	const int phandle = sc->sc_phandle;
 	char intrstr[128];
 	int error, n;
-	void *ih;
+	void **ih;
 
-	for (n = 0; ; n++) {
-		ih = fdtbus_intr_establish(phandle, n, IPL_HIGH,
+	error = arm_pmu_init();
+	if (error != 0) {
+		aprint_error_dev(self, "failed to initialize PMU\n");
+		return;
+	}
+
+	ih = kmem_zalloc(sizeof(void *) * ncpu, KM_SLEEP);
+
+	for (n = 0; n < ncpu; n++) {
+		ih[n] = fdtbus_intr_establish(phandle, n, IPL_HIGH,
 		FDT_INTR_MPSAFE, arm_pmu_intr, NULL);
-		if (ih == NULL)
+		if (ih[n] == NULL)
 			break;
 		if (!fdtbus_intr_str(phandle, n, intrstr, sizeof(intrstr))) {
 			aprint_error_dev(self,
 			"couldn't decode interrupt %u\n", n);
-			return;
+			goto cleanup;
 		}
 		aprint_normal_dev(self, "interrupting on %s\n", intrstr);
-		error = pmu_fdt_intr_distribute(phandle, n, ih);
-		if (error != 0) {
-			aprint_error_dev(self,
-			"failed to distribute interrupt %u: %d\n",
-			n, error);
-			return;
-		}
 	}
+
 	/* We need either one IRQ (PPI), or one per CPU (SPI) */
-	if (n == 0) {
+	const int nirq = n;
+	if (nirq == 0) {
 		aprint_error_dev(self, "couldn't establish interrupts\n");
-		return;
+		goto cleanup;
 	}
 
-	error = arm_pmu_init();
-	if (error != 0) {
-		aprint_error_dev(self, "failed to initialize PMU\n");
-		return;
+	/* Set interrupt affinity if we have more than one interrupt */
+	if (nirq > 1) {
+		for (n = 0; n < nirq; n++) {
+			error = pmu_fdt_intr_distribute(phandle, n, ih[n]);
+			if (error != 0) {
+aprint_error_dev(self,
+"failed to distribute interrupt %u: %d\n",
+n, error);
+goto cleanup;
+			}
+		}
 	}
+
+cleanup:
+	kmem_free(ih, sizeof(void *) * ncpu);
 }
 
 static int



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:39:59 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
Only attempt to set interrupt affinity if we have more than one IRQ.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/fdt/pmu_fdt.c

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



CVS commit: src/share/mk

2018-08-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Aug 12 18:36:27 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Try the more likely gfortran instead of g77.
g77 has likely not shipped as a binary in a long time.

No change for netbsd src as it has no fortran code, no change for pkgsrc
because it passes ${FC} for fortran packages.


To generate a diff of this commit:
cvs rdiff -u -r1.1073 -r1.1074 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1073 src/share/mk/bsd.own.mk:1.1074
--- src/share/mk/bsd.own.mk:1.1073	Sat Aug 11 19:45:13 2018
+++ src/share/mk/bsd.own.mk	Sun Aug 12 18:36:27 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1073 2018/08/11 19:45:13 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1074 2018/08/12 18:36:27 maya Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -271,7 +271,7 @@ STRIP=		${EXTERNAL_TOOLCHAIN}/bin/${MACH
 TOOL_CC.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
 TOOL_CPP.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
 TOOL_CXX.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
-TOOL_FC.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
+TOOL_FC.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran
 TOOL_OBJC.gcc=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
 
 TOOL_CC.clang=		${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
@@ -297,7 +297,7 @@ STRIP=		${TOOLDIR}/bin/${MACHINE_GNU_PLA
 TOOL_CC.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
 TOOL_CPP.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
 TOOL_CXX.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
-TOOL_FC.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
+TOOL_FC.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran
 TOOL_OBJC.gcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
 .endif	#  }
 
@@ -461,7 +461,7 @@ TOOL_OBJC.clang=	clang
 TOOL_CC.gcc=	gcc
 TOOL_CPP.gcc=	cpp
 TOOL_CXX.gcc=	c++
-TOOL_FC.gcc=	g77
+TOOL_FC.gcc=	gfortran
 TOOL_OBJC.gcc=	gcc
 
 # PCC supports C and Fortran



CVS commit: src/share/mk

2018-08-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Aug 12 18:36:27 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Try the more likely gfortran instead of g77.
g77 has likely not shipped as a binary in a long time.

No change for netbsd src as it has no fortran code, no change for pkgsrc
because it passes ${FC} for fortran packages.


To generate a diff of this commit:
cvs rdiff -u -r1.1073 -r1.1074 src/share/mk/bsd.own.mk

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:01:22 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add rk3399-rockpro64.dts


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/conf/GENERIC64

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:01:22 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add rk3399-rockpro64.dts


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.30 src/sys/arch/evbarm/conf/GENERIC64:1.31
--- src/sys/arch/evbarm/conf/GENERIC64:1.30	Sun Aug 12 16:49:25 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Aug 12 18:01:22 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.30 2018/08/12 16:49:25 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.31 2018/08/12 18:01:22 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -27,6 +27,7 @@ makeoptions	DTS="
 	rk3399-firefly.dts
 	rk3399-gru-kevin.dts
 	rk3399-puma-haikou.dts
+	rk3399-rockpro64.dts
 	rk3399-sapphire-excavator.dts
 	rk3399-sapphire.dts
 



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:01:03 UTC 2018

Added Files:
src/sys/arch/arm/dts: rk3399-rockpro64.dts

Log Message:
Add dts for ROCKPro64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/rk3399-rockpro64.dts

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

Added files:

Index: src/sys/arch/arm/dts/rk3399-rockpro64.dts
diff -u /dev/null src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.1
--- /dev/null	Sun Aug 12 18:01:03 2018
+++ src/sys/arch/arm/dts/rk3399-rockpro64.dts	Sun Aug 12 18:01:03 2018
@@ -0,0 +1,907 @@
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include 
+#include 
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
+	model = "Pine64 RockPro64";
+	compatible = "pine64,rockpro64", "rockchip,rk3399";
+
+	chosen {
+		bootargs = "earlycon=uart8250,mmio32,0xff1a swiotlb=1";
+		stdout-path = "serial2:150n8";
+	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		drm_logo: drm-logo@ {
+			compatible = "rockchip,drm-logo";
+			reg = <0x0 0x0 0x0 0x0>;
+		};
+	};
+
+	/* first 64k(0xff8c~0xff8d) for ddr and suspend */
+	iram: sram@ff8d {
+		compatible = "mmio-sram";
+		reg = <0x0 0xff8d 0x0 0x2>; /* 128k */
+	};
+
+	aliases {
+		ethernet0 = 
+	};
+
+	dc_12v: dc-12v {
+		compatible = "regulator-fixed";
+		regulator-name = "dc_12v";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1200>;
+		regulator-max-microvolt = <1200>;
+	};
+
+	vcc1v8_s0: vcc1v8-s0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc1v8_s0";
+		regulator-min-microvolt = <180>;
+		regulator-max-microvolt = <180>;
+		regulator-always-on;
+	};
+
+	vcc_sys: vcc-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sys";
+		regulator-min-microvolt = <500>;
+		regulator-max-microvolt = <500>;
+		regulator-always-on;
+		vin-supply = <_12v>;
+	};
+
+	vcc_phy: vcc-phy-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_phy";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vcc3v3_sys: vcc3v3-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3_sys";
+		regulator-min-microvolt = <330>;
+		regulator-max-microvolt = <330>;
+		regulator-always-on;
+		vin-supply = <_sys>;
+	};
+
+	vcc5v0_host: vcc5v0-host-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = < RK_PD2 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <_vbus_drv>;
+		regulator-name = "vcc5v0_host";
+		regulator-always-on;
+	};
+
+	vdd_log: vdd-log {
+		compatible = "pwm-regulator";
+		pwms = < 0 25000 1>;
+		pwm-supply = <_sys>;
+		regulator-name = "vdd_log";
+		regulator-min-microvolt = <80>;
+		regulator-max-microvolt = <140>;
+		regulator-always-on;
+		regulator-boot-on;
+
+		/* for rockchip boot on */
+		rockchip,pwm_id= <2>;
+		

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:01:03 UTC 2018

Added Files:
src/sys/arch/arm/dts: rk3399-rockpro64.dts

Log Message:
Add dts for ROCKPro64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/rk3399-rockpro64.dts

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:00:32 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_usb.c

Log Message:
Fix USB2 on RK3399


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_usb.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/rockchip/rk_usb.c
diff -u src/sys/arch/arm/rockchip/rk_usb.c:1.5 src/sys/arch/arm/rockchip/rk_usb.c:1.6
--- src/sys/arch/arm/rockchip/rk_usb.c:1.5	Sun Aug 12 17:46:49 2018
+++ src/sys/arch/arm/rockchip/rk_usb.c	Sun Aug 12 18:00:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_usb.c,v 1.5 2018/08/12 17:46:49 jmcneill Exp $ */
+/* $NetBSD: rk_usb.c,v 1.6 2018/08/12 18:00:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.5 2018/08/12 17:46:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.6 2018/08/12 18:00:32 jmcneill Exp $");
 
 #include 
 #include 
@@ -314,7 +314,7 @@ rk_usbphy_otg_enable(device_t dev, void 
 		RK3399_GRF_USB20_PHY0_CON1_REG :
 		RK3399_GRF_USB20_PHY1_CON1_REG;
 		write_mask = (RK3399_USBPHY_SUSPEND_N|RK3399_USBPHY_UTMI_SEL) << 16;
-		write_val = RK3399_USBPHY_UTMI_SEL;
+		write_val = enable ? 0 : RK3399_USBPHY_UTMI_SEL;
 		break;
 	default:
 		return ENXIO;
@@ -353,7 +353,7 @@ rk_usbphy_host_enable(device_t dev, void
 		RK3399_GRF_USB20_PHY0_CON2_REG :
 		RK3399_GRF_USB20_PHY1_CON2_REG;
 		write_mask = (RK3399_USBPHY_SUSPEND_N|RK3399_USBPHY_UTMI_SEL) << 16;
-		write_val = RK3399_USBPHY_UTMI_SEL;
+		write_val = enable ? 0 : RK3399_USBPHY_UTMI_SEL;
 		break;
 	default:
 		return ENXIO;



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 18:00:32 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_usb.c

Log Message:
Fix USB2 on RK3399


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_usb.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

2018-08-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 12 17:59:21 UTC 2018

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

Log Message:
Remove commented out BPFJIT & SLJIT options as they are provided as loadable
modules already.

Heads up by  


To generate a diff of this commit:
cvs rdiff -u -r1.500 -r1.501 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1186 -r1.1187 src/sys/arch/i386/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.500 src/sys/arch/amd64/conf/GENERIC:1.501
--- src/sys/arch/amd64/conf/GENERIC:1.500	Fri Aug 10 17:54:46 2018
+++ src/sys/arch/amd64/conf/GENERIC	Sun Aug 12 17:59:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.500 2018/08/10 17:54:46 sevan Exp $
+# $NetBSD: GENERIC,v 1.501 2018/08/12 17:59:21 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.500 $"
+#ident		"GENERIC-$Revision: 1.501 $"
 
 maxusers	64		# estimated number of users
 
@@ -205,10 +205,6 @@ options 	PPP_FILTER	# Active filter supp
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 #options 	TCP_SIGNATURE	# Enable RFC-2385 TCP md5 signatures
 
-# JIT compiler for bpfilter
-#options 	SLJIT
-#options 	BPFJIT
-
 #options 	ALTQ		# Manipulate network interfaces' output queues
 #options 	ALTQ_BLUE	# Stochastic Fair Blue
 #options 	ALTQ_CBQ	# Class-Based Queueing

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1186 src/sys/arch/i386/conf/GENERIC:1.1187
--- src/sys/arch/i386/conf/GENERIC:1.1186	Fri Aug 10 17:54:46 2018
+++ src/sys/arch/i386/conf/GENERIC	Sun Aug 12 17:59:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1186 2018/08/10 17:54:46 sevan Exp $
+# $NetBSD: GENERIC,v 1.1187 2018/08/12 17:59:21 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1186 $"
+#ident		"GENERIC-$Revision: 1.1187 $"
 
 maxusers	64		# estimated number of users
 
@@ -196,10 +196,6 @@ options 	NETATALK	# AppleTalk networking
 options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 
-# JIT compiler for bpfilter
-#options 	SLJIT
-#options 	BPFJIT
-
 #options 	ALTQ		# Manipulate network interfaces' output queues
 #options 	ALTQ_BLUE	# Stochastic Fair Blue
 #options 	ALTQ_CBQ	# Class-Based Queueing



CVS commit: src/sys/arch

2018-08-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 12 17:59:21 UTC 2018

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

Log Message:
Remove commented out BPFJIT & SLJIT options as they are provided as loadable
modules already.

Heads up by  


To generate a diff of this commit:
cvs rdiff -u -r1.500 -r1.501 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1186 -r1.1187 src/sys/arch/i386/conf/GENERIC

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:46:49 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_usb.c

Log Message:
Remove a sneaky KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk_usb.c

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



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:46:49 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: rk_usb.c

Log Message:
Remove a sneaky KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk_usb.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/rockchip/rk_usb.c
diff -u src/sys/arch/arm/rockchip/rk_usb.c:1.4 src/sys/arch/arm/rockchip/rk_usb.c:1.5
--- src/sys/arch/arm/rockchip/rk_usb.c:1.4	Sun Aug 12 16:48:05 2018
+++ src/sys/arch/arm/rockchip/rk_usb.c	Sun Aug 12 17:46:49 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_usb.c,v 1.4 2018/08/12 16:48:05 jmcneill Exp $ */
+/* $NetBSD: rk_usb.c,v 1.5 2018/08/12 17:46:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.4 2018/08/12 16:48:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.5 2018/08/12 17:46:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -221,7 +221,6 @@ rk_usb_attach(device_t parent, device_t 
 	}
 
 	clk = fdtbus_clock_get(phandle, "phyclk");
-KASSERT(clk != NULL);
 	if (clk && clk_enable(clk) != 0) {
 		aprint_error(": couldn't enable phy clock\n");
 		return;



CVS commit: src/sys/arch

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 17:21:36 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h
src/sys/arch/arm/fdt: psci_fdt.c
src/sys/arch/arm/include: armreg.h

Log Message:
Provide and use cpu_mpidr_aff_read in psci_fdt_bootstrap


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/fdt/psci_fdt.c
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/arm/include/armreg.h

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



CVS commit: src/sys/arch

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 17:21:36 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h
src/sys/arch/arm/fdt: psci_fdt.c
src/sys/arch/arm/include: armreg.h

Log Message:
Provide and use cpu_mpidr_aff_read in psci_fdt_bootstrap


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/fdt/psci_fdt.c
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/arm/include/armreg.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/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.17 src/sys/arch/aarch64/include/armreg.h:1.18
--- src/sys/arch/aarch64/include/armreg.h:1.17	Sun Aug 12 17:16:18 2018
+++ src/sys/arch/aarch64/include/armreg.h	Sun Aug 12 17:21:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.17 2018/08/12 17:16:18 skrll Exp $ */
+/* $NetBSD: armreg.h,v 1.18 2018/08/12 17:21:35 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -1025,6 +1025,19 @@ AARCH64REG_READ_INLINE2(icc_iar1_el1, s3
 #define	icc_iar1_read		reg_icc_iar1_el1_read
 #define	icc_eoi1r_write		reg_icc_eoir1_el1_write
 
+#if defined(_KERNEL)
+
+/*
+ * CPU REGISTER ACCESS
+ */
+static __inline register_t
+cpu_mpidr_aff_read(void)
+{
+
+	return reg_mpidr_el1_read() &
+	(MPIDR_AFF3|MPIDR_AFF2|MPIDR_AFF1|MPIDR_AFF0);
+}
+
 /*
  * GENERIC TIMER REGISTER ACCESS
  */
@@ -1117,5 +1130,6 @@ gtmr_cntv_cval_read(void)
 
 	return reg_cntv_cval_el0_read();
 }
+#endif /* _KERNEL */
 
 #endif /* _AARCH64_ARMREG_H_ */

Index: src/sys/arch/arm/fdt/psci_fdt.c
diff -u src/sys/arch/arm/fdt/psci_fdt.c:1.11 src/sys/arch/arm/fdt/psci_fdt.c:1.12
--- src/sys/arch/arm/fdt/psci_fdt.c:1.11	Fri Aug 10 22:34:36 2018
+++ src/sys/arch/arm/fdt/psci_fdt.c	Sun Aug 12 17:21:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.11 2018/08/10 22:34:36 jmcneill Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.12 2018/08/12 17:21:36 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.11 2018/08/10 22:34:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.12 2018/08/12 17:21:36 skrll Exp $");
 
 #include 
 #include 
@@ -154,14 +154,6 @@ psci_fdt_preinit(void)
 }
 
 #ifdef MULTIPROCESSOR
-static bus_addr_t psci_fdt_read_mpidr_aff(void)
-{
-#ifdef __aarch64__
-	return reg_mpidr_el1_read() & (MPIDR_AFF3|MPIDR_AFF2|MPIDR_AFF1|MPIDR_AFF0);
-#else
-	return armreg_mpidr_read() & (MPIDR_AFF2|MPIDR_AFF1|MPIDR_AFF0);
-#endif
-}
 
 static register_t
 psci_fdt_mpstart_pa(void)
@@ -181,7 +173,7 @@ psci_fdt_bootstrap(void)
 {
 #ifdef MULTIPROCESSOR
 	extern void cortex_mpstart(void);
-	bus_addr_t mpidr, bp_mpidr;
+	uint64_t mpidr, bp_mpidr;
 	int child;
 
 	const int cpus = OF_finddevice("/cpus");
@@ -201,7 +193,7 @@ psci_fdt_bootstrap(void)
 		return;
 
 	/* MPIDR affinity levels of boot processor. */
-	bp_mpidr = psci_fdt_read_mpidr_aff();
+	bp_mpidr = cpu_mpidr_aff_read();
 
 	/* Boot APs */
 	uint32_t started = 0;

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.122 src/sys/arch/arm/include/armreg.h:1.123
--- src/sys/arch/arm/include/armreg.h:1.122	Sun Jul 15 23:46:57 2018
+++ src/sys/arch/arm/include/armreg.h	Sun Aug 12 17:21:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.122 2018/07/15 23:46:57 jmcneill Exp $	*/
+/*	$NetBSD: armreg.h,v 1.123 2018/08/12 17:21:36 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -908,6 +908,15 @@ ARMREG_WRITE_INLINE(tlbdataop, "p15,3,%0
 ARMREG_READ_INLINE(sheeva_xctrl, "p15,1,%0,c15,c1,0") /* Sheeva eXtra Control register */
 ARMREG_WRITE_INLINE(sheeva_xctrl, "p15,1,%0,c15,c1,0") /* Sheeva eXtra Control register */
 
+#if defined(_KERNEL)
+
+static inline uint64_t
+cpu_mpidr_aff_read(void)
+{
+
+	return armreg_mpidr_read() & (MPIDR_AFF2|MPIDR_AFF1|MPIDR_AFF0);
+}
+
 /*
  * GENERIC TIMER register access
  */
@@ -1002,7 +1011,8 @@ gtmr_cntv_cval_read(void)
 	return armreg_cntv_cval_read();
 }
 
-#endif /* !__ASSEMBLER__ */
+#endif /* _KERNEL */
+#endif /* !__ASSEMBLER && !_RUMPKERNEL */
 
 #elif defined(__aarch64__)
 



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 17:16:18 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/include/armreg.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/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.16 src/sys/arch/aarch64/include/armreg.h:1.17
--- src/sys/arch/aarch64/include/armreg.h:1.16	Thu Aug  9 10:27:17 2018
+++ src/sys/arch/aarch64/include/armreg.h	Sun Aug 12 17:16:18 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.16 2018/08/09 10:27:17 jmcneill Exp $ */
+/* $NetBSD: armreg.h,v 1.17 2018/08/12 17:16:18 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -929,7 +929,6 @@ AARCH64REG_WRITE_INLINE(cntvct_el0)
 #define	CNTCTL_IMASK		__BIT(1)	// Timer Interrupt is Masked
 #define	CNTCTL_ENABLE		__BIT(0)	// Timer Enabled
 
-
 // ID_AA64PFR0_EL1: AArch64 Processor Feature Register 0
 #define	ID_AA64PFR0_EL1_GIC		__BITS(24,27) // GIC CPU IF
 #define	ID_AA64PFR0_EL1_GIC_SHIFT	24
@@ -1088,7 +1087,6 @@ static __inline void
 gtmr_cntp_ctl_write(uint32_t val)
 {
 
-
 	reg_cntp_ctl_el0_write(val);
 }
 



CVS commit: src/distrib/utils/embedded/conf

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:15:56 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Move rk3399 dtb files to the correct location


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.2 src/distrib/utils/embedded/conf/arm64.conf:1.3
--- src/distrib/utils/embedded/conf/arm64.conf:1.2	Tue Jun 19 15:13:51 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Sun Aug 12 17:15:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.2 2018/06/19 15:13:51 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.3 2018/08/12 17:15:56 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -44,6 +44,7 @@ populate_rockchip() {
 	# U-Boot expects 64-bit DTB files to live in a rockchip/ subdirectory
 	mkdir -p "${mnt}/boot/dtb/rockchip"
 	mv "${mnt}"/boot/rk3328-*.dtb "${mnt}/boot/dtb/rockchip/"
+	mv "${mnt}"/boot/rk3399-*.dtb "${mnt}/boot/dtb/rockchip/"
 }
 
 populate_rpi() {



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

2018-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 12 17:16:18 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/include/armreg.h

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



CVS commit: src/distrib/utils/embedded/conf

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:15:56 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Move rk3399 dtb files to the correct location


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/arm64.conf

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



CVS commit: src/doc

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:14:42 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for Rockchip RK3399 SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.2421 -r1.2422 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2421 src/doc/CHANGES:1.2422
--- src/doc/CHANGES:1.2421	Sun Aug 12 13:51:58 2018
+++ src/doc/CHANGES	Sun Aug 12 17:14:42 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2421 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2422 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -195,3 +195,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lua: Import version 5.3.5. [alnsn 20180804]
 	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]
  	bind: Import version 9.12.2-P1. [christos 20180812]
+	arm: Add support for Rockchip RK3399 SoC. [jmcneill 20180812]



CVS commit: src/doc

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:14:42 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for Rockchip RK3399 SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.2421 -r1.2422 src/doc/CHANGES

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



CVS commit: src/distrib/sets/lists

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 17:11:55 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi
src/distrib/sets/lists/man: mi

Log Message:
fix sets for new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1182 -r1.1183 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.844 -r1.845 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.261 -r1.262 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.203 -r1.204 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.1607 -r1.1608 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/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1182 src/distrib/sets/lists/base/mi:1.1183
--- src/distrib/sets/lists/base/mi:1.1182	Tue Jul 31 12:44:28 2018
+++ src/distrib/sets/lists/base/mi	Sun Aug 12 13:11:55 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1182 2018/07/31 16:44:28 khorben Exp $
+# $NetBSD: mi,v 1.1183 2018/08/12 17:11:55 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1767,7 +1767,7 @@
 ./usr/sbin/lpc	base-lpr-bin
 ./usr/sbin/lpd	base-lpr-bin
 ./usr/sbin/lptestbase-lpr-bin
-./usr/sbin/lwresdbase-bind-bin
+./usr/sbin/lwresdbase-obsolete		obsolete
 ./usr/sbin/mailstatsbase-obsolete		obsolete
 ./usr/sbin/mailwrapperbase-mailwrapper-bin
 ./usr/sbin/makedbmbase-nis-bin		yp
@@ -5974,7 +5974,7 @@
 ./var/chroot/named/usr/libexec			base-bind-root
 ./var/chroot/named/varbase-bind-root
 ./var/chroot/named/var/run			base-bind-root
-./var/chroot/named/var/run/lwresd		base-bind-root
+./var/chroot/named/var/run/lwresd		base-obsolete		obsolete
 ./var/chroot/named/var/run/named		base-bind-root
 ./var/chroot/named/var/tmp			base-bind-root
 ./var/chroot/nsdbase-sys-root
@@ -6042,7 +6042,7 @@
 ./var/preserve	base-util-root
 ./var/quotas	base-util-root
 ./var/run	base-sys-root
-./var/run/lwresdbase-bind-root
+./var/run/lwresdbase-obsolete		obsolete
 ./var/run/named	base-bind-root
 ./var/rwho	base-netutil-root
 ./var/shm	base-sys-root

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.844 src/distrib/sets/lists/base/shl.mi:1.845
--- src/distrib/sets/lists/base/shl.mi:1.844	Thu Aug  2 04:40:47 2018
+++ src/distrib/sets/lists/base/shl.mi	Sun Aug 12 13:11:55 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.844 2018/08/02 08:40:47 rjs Exp $
+# $NetBSD: shl.mi,v 1.845 2018/08/12 17:11:55 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -202,8 +202,8 @@
 ./usr/lib/libbfd.so.16base-sys-shlib		compatfile,binutils=230
 ./usr/lib/libbfd.so.16.0			base-sys-shlib		compatfile,binutils=230
 ./usr/lib/libbind9.sobase-bind-shlib		compatfile
-./usr/lib/libbind9.so.8base-bind-shlib		compatfile
-./usr/lib/libbind9.so.8.5			base-bind-shlib		compatfile
+./usr/lib/libbind9.so.9base-bind-shlib		compatfile
+./usr/lib/libbind9.so.9.0			base-bind-shlib		compatfile
 ./usr/lib/libblacklist.so			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0.0			base-sys-shlib		compatfile
@@ -259,8 +259,8 @@
 ./usr/lib/libdm.so.0base-sys-shlib		compatfile
 ./usr/lib/libdm.so.0.0base-sys-shlib		compatfile
 ./usr/lib/libdns.sobase-bind-shlib		compatfile
-./usr/lib/libdns.so.8base-bind-shlib		compatfile
-./usr/lib/libdns.so.8.5base-bind-shlib		compatfile
+./usr/lib/libdns.so.9base-bind-shlib		compatfile
+./usr/lib/libdns.so.9.0base-bind-shlib		compatfile
 ./usr/lib/libdns_sd.sobase-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0			base-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0.0			base-mdns-shlib		compatfile,mdns
@@ -333,17 +333,17 @@
 ./usr/lib/libipsec.so.3base-net-shlib		compatfile
 ./usr/lib/libipsec.so.3.0			base-net-shlib		compatfile
 ./usr/lib/libirs.sobase-bind-shlib		compatfile
-./usr/lib/libirs.so.8base-bind-shlib		compatfile
-./usr/lib/libirs.so.8.5base-bind-shlib		compatfile
+./usr/lib/libirs.so.9base-bind-shlib		compatfile
+./usr/lib/libirs.so.9.0base-bind-shlib		compatfile
 ./usr/lib/libisc.sobase-bind-shlib		compatfile
-./usr/lib/libisc.so.8base-bind-shlib		compatfile
-./usr/lib/libisc.so.8.5base-bind-shlib		compatfile
+./usr/lib/libisc.so.9base-bind-shlib		compatfile
+./usr/lib/libisc.so.9.0base-bind-shlib		compatfile
 ./usr/lib/libisccc.sobase-bind-shlib		compatfile
-./usr/lib/libisccc.so.8base-bind-shlib		compatfile
-./usr/lib/libisccc.so.8.5			base-bind-shlib		compatfile
+./usr/lib/libisccc.so.9base-bind-shlib		compatfile
+./usr/lib/libisccc.so.9.0			base-bind-shlib		compatfile
 ./usr/lib/libisccfg.sobase-bind-shlib		

CVS commit: src/distrib/sets/lists

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 17:11:55 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi
src/distrib/sets/lists/man: mi

Log Message:
fix sets for new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1182 -r1.1183 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.844 -r1.845 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.261 -r1.262 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.203 -r1.204 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.1607 -r1.1608 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/sys/arch/evbarm/conf

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:49:25 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Enable support for GICv3 and Rockchip RK3399


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.29 src/sys/arch/evbarm/conf/GENERIC64:1.30
--- src/sys/arch/evbarm/conf/GENERIC64:1.29	Sun Jul 15 18:00:14 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Aug 12 16:49:25 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.29 2018/07/15 18:00:14 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.30 2018/08/12 16:49:25 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -23,6 +23,13 @@ makeoptions	DTS="
 	rk3328-roc-cc.dts
 	rk3328-rock64.dts
 
+	rk3399-evb.dts
+	rk3399-firefly.dts
+	rk3399-gru-kevin.dts
+	rk3399-puma-haikou.dts
+	rk3399-sapphire-excavator.dts
+	rk3399-sapphire.dts
+
 	sun50i-a64-bananapi-m64.dts
 	sun50i-a64-nanopi-a64.dts
 	sun50i-a64-olinuxino.dts
@@ -52,6 +59,7 @@ options 	CPU_CORTEXA53
 options 	CPU_CORTEXA57
 options 	SOC_BCM2837
 options 	SOC_RK3328
+options 	SOC_RK3399
 options 	SOC_TEGRA210
 options 	SOC_SUN50I_A64
 options 	SOC_SUN50I_H5
@@ -119,8 +127,9 @@ watchdog*	at fdt?			# Broadcom BCM283x w
 # Interrupt controller
 bcmicu*		at fdt? pass 1		# Broadcom BCM283x ICU
 tegralic*	at fdt? pass 1		# NVIDIA Tegra LIC
-gic*		at fdt? pass 1		# ARM GIC
+gic*		at fdt? pass 1		# ARM GICv2
 armgic0		at gic?
+gicvthree*	at fdt? pass 1		# ARM GICv3
 sunxinmi*	at fdt? pass 2		# Allwinner NMI / R_INTC
 
 # Memory controller
@@ -168,7 +177,7 @@ gpio*		at gpiobus?
 sunxipwm*	at fdt? pass 3		# Allwinner PWM
 
 # MPIO / Pinmux
-rkiomux*	at fdt?	pass 2		# Rockchip IOMUX
+rkiomux*	at fdt?	pass 3		# Rockchip IOMUX
 tegrapinmux*	at fdt?			# NVIDIA Tegra MPIO
 
 # XUSB PADCTL



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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:49:25 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Enable support for GICv3 and Rockchip RK3399


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/GENERIC64

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:48:05 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: files.rockchip rk3328_cru.c rk_cru.c
rk_cru.h rk_cru_pll.c rk_gmac.c rk_platform.c rk_usb.c
Added Files:
src/sys/arch/arm/rockchip: rk3328_iomux.c rk3399_cru.c rk3399_cru.h
rk3399_iomux.c rk3399_platform.h rk3399_pmucru.c rk3399_pmucru.h
Removed Files:
src/sys/arch/arm/rockchip: rk_iomux.c

Log Message:
Add support for Rockchip RK3399 SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk3328_cru.c \
src/sys/arch/arm/rockchip/rk_cru_pll.c src/sys/arch/arm/rockchip/rk_usb.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rk3328_iomux.c \
src/sys/arch/arm/rockchip/rk3399_cru.c \
src/sys/arch/arm/rockchip/rk3399_cru.h \
src/sys/arch/arm/rockchip/rk3399_iomux.c \
src/sys/arch/arm/rockchip/rk3399_platform.h \
src/sys/arch/arm/rockchip/rk3399_pmucru.c \
src/sys/arch/arm/rockchip/rk3399_pmucru.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk_cru.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk_cru.h \
src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/rockchip/rk_gmac.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/rockchip/rk_iomux.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/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.14 src/sys/arch/arm/rockchip/files.rockchip:1.15
--- src/sys/arch/arm/rockchip/files.rockchip:1.14	Sun Jul  1 18:16:58 2018
+++ src/sys/arch/arm/rockchip/files.rockchip	Sun Aug 12 16:48:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.14 2018/07/01 18:16:58 jmcneill Exp $
+#	$NetBSD: files.rockchip,v 1.15 2018/08/12 16:48:04 jmcneill Exp $
 #
 # Configuration info for Rockchip family SoCs
 #
@@ -19,10 +19,18 @@ file	arch/arm/rockchip/rk_cru_pll.c		rk_
 attach	rkcru at fdt with rk3328_cru
 file	arch/arm/rockchip/rk3328_cru.c		rk3328_cru & soc_rk3328
 
+# RK3399 clock and reset unit
+attach	rkcru at fdt with rk3399_cru
+file	arch/arm/rockchip/rk3399_cru.c		rk3399_cru & soc_rk3399
+attach	rkcru at fdt with rk3399_pmucru
+file	arch/arm/rockchip/rk3399_pmucru.c	rk3399_pmucru & soc_rk3399
+
 # IOMUX control
 device	rkiomux { }
-attach	rkiomux at fdt with rk_iomux
-file	arch/arm/rockchip/rk_iomux.c		rk_iomux
+attach	rkiomux at fdt with rk3328_iomux
+file	arch/arm/rockchip/rk3328_iomux.c	rk3328_iomux & soc_rk3328
+attach	rkiomux at fdt with rk3399_iomux
+file	arch/arm/rockchip/rk3399_iomux.c	rk3399_iomux & soc_rk3399
 
 # GPIO
 device	rkgpio: gpiobus
@@ -48,3 +56,4 @@ file	arch/arm/rockchip/rk_gmac.c		rk_gma
 # SOC parameters
 defflag	opt_soc.h			SOC_ROCKCHIP
 defflag	opt_soc.h			SOC_RK3328: SOC_ROCKCHIP
+defflag	opt_soc.h			SOC_RK3399: SOC_ROCKCHIP

Index: src/sys/arch/arm/rockchip/rk3328_cru.c
diff -u src/sys/arch/arm/rockchip/rk3328_cru.c:1.3 src/sys/arch/arm/rockchip/rk3328_cru.c:1.4
--- src/sys/arch/arm/rockchip/rk3328_cru.c:1.3	Sun Jul  1 18:15:19 2018
+++ src/sys/arch/arm/rockchip/rk3328_cru.c	Sun Aug 12 16:48:04 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3328_cru.c,v 1.3 2018/07/01 18:15:19 jmcneill Exp $ */
+/* $NetBSD: rk3328_cru.c,v 1.4 2018/08/12 16:48:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.3 2018/07/01 18:15:19 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.4 2018/08/12 16:48:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,7 @@ __KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c
 #define	MISC_CON	0x0084	
 #define	CLKSEL_CON(n)	(0x0100 + (n) * 4)
 #define	CLKGATE_CON(n)	(0x0200 + (n) * 4)
+#define	SOFTRST_CON(n)	(0x0300 + (n) * 4)
 
 #define	GRF_SOC_CON4	0x0410
 #define	GRF_MAC_CON1	0x0904
@@ -131,6 +132,7 @@ static const struct rk_cru_arm_rate armc
 	RK_ARM_RATE(  9600, 1),
 };
 
+static const char * pll_parents[] = { "xin24m" };
 static const char * armclk_parents[] = { "apll", "gpll", "dpll", "npll" };
 static const char * aclk_bus_pre_parents[] = { "cpll", "gpll", "hdmiphy" };
 static const char * hclk_bus_pre_parents[] = { "aclk_bus_pre" };
@@ -151,31 +153,31 @@ static const char * comp_uart_parents[] 
 static const char * pclk_gmac_parents[] = { "aclk_gmac" };
 
 static struct rk_cru_clk rk3328_cru_clks[] = {
-	RK_PLL(RK3328_PLL_APLL, "apll", "xin24m",
+	RK_PLL(RK3328_PLL_APLL, "apll", pll_parents,
 	   PLL_CON(0),		/* con_base */
 	   0x80,			/* mode_reg */
 	   __BIT(0),		/* mode_mask */
 	   __BIT(4),		/* lock_mask */
 	   pll_frac_rates),
-	RK_PLL(RK3328_PLL_DPLL, "dpll", "xin24m",
+	RK_PLL(RK3328_PLL_DPLL, "dpll", pll_parents,
 	   PLL_CON(8),		/* con_base */
 	   0x80,			/* mode_reg */
 	   __BIT(4),		/* mode_mask */
 	   

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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:48:05 UTC 2018

Modified Files:
src/sys/arch/arm/rockchip: files.rockchip rk3328_cru.c rk_cru.c
rk_cru.h rk_cru_pll.c rk_gmac.c rk_platform.c rk_usb.c
Added Files:
src/sys/arch/arm/rockchip: rk3328_iomux.c rk3399_cru.c rk3399_cru.h
rk3399_iomux.c rk3399_platform.h rk3399_pmucru.c rk3399_pmucru.h
Removed Files:
src/sys/arch/arm/rockchip: rk_iomux.c

Log Message:
Add support for Rockchip RK3399 SoC.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk3328_cru.c \
src/sys/arch/arm/rockchip/rk_cru_pll.c src/sys/arch/arm/rockchip/rk_usb.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rk3328_iomux.c \
src/sys/arch/arm/rockchip/rk3399_cru.c \
src/sys/arch/arm/rockchip/rk3399_cru.h \
src/sys/arch/arm/rockchip/rk3399_iomux.c \
src/sys/arch/arm/rockchip/rk3399_platform.h \
src/sys/arch/arm/rockchip/rk3399_pmucru.c \
src/sys/arch/arm/rockchip/rk3399_pmucru.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk_cru.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk_cru.h \
src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/rockchip/rk_gmac.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/rockchip/rk_iomux.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/fdt

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:34:28 UTC 2018

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

Log Message:
Use more generic rk3288 compatible string, and do clock assignments when present


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/dwcmmc_fdt.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/fdt

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:33:58 UTC 2018

Modified Files:
src/sys/dev/fdt: ehci_fdt.c ohci_fdt.c

Log Message:
Register shutdown handlers


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

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:34:28 UTC 2018

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

Log Message:
Use more generic rk3288 compatible string, and do clock assignments when present


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/dwcmmc_fdt.c

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

Modified files:

Index: src/sys/dev/fdt/dwcmmc_fdt.c
diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.6 src/sys/dev/fdt/dwcmmc_fdt.c:1.7
--- src/sys/dev/fdt/dwcmmc_fdt.c:1.6	Tue Jul 17 00:42:06 2018
+++ src/sys/dev/fdt/dwcmmc_fdt.c	Sun Aug 12 16:34:28 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: dwcmmc_fdt.c,v 1.6 2018/07/17 00:42:06 christos Exp $ */
+/* $NetBSD: dwcmmc_fdt.c,v 1.7 2018/08/12 16:34:28 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.6 2018/07/17 00:42:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.7 2018/08/12 16:34:28 jmcneill Exp $");
 
 #include 
 #include 
@@ -52,12 +52,12 @@ struct dwcmmc_fdt_config {
 	u_int		ciu_div;
 };
 
-static const struct dwcmmc_fdt_config dwcmmc_rk3328_config = {
+static const struct dwcmmc_fdt_config dwcmmc_rk3288_config = {
 	.ciu_div = 2,
 };
 
 static const struct of_compat_data compat_data[] = {
-	{ "rockchip,rk3328-dw-mshc",	(uintptr_t)_rk3328_config },
+	{ "rockchip,rk3288-dw-mshc",	(uintptr_t)_rk3288_config },
 	{ NULL }
 };
 
@@ -102,6 +102,8 @@ dwcmmc_fdt_attach(device_t parent, devic
 	if (of_getprop_uint32(phandle, "fifo-depth", _depth))
 		fifo_depth = 0;
 
+	fdtbus_clock_assign(phandle);
+
 	esc->sc_clk_biu = fdtbus_clock_get(phandle, "biu");
 	if (esc->sc_clk_biu == NULL) {
 		aprint_error(": couldn't get clock biu\n");



CVS commit: src/sys/dev/fdt

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 16:33:58 UTC 2018

Modified Files:
src/sys/dev/fdt: ehci_fdt.c ohci_fdt.c

Log Message:
Register shutdown handlers


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/ehci_fdt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/ohci_fdt.c

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

Modified files:

Index: src/sys/dev/fdt/ehci_fdt.c
diff -u src/sys/dev/fdt/ehci_fdt.c:1.3 src/sys/dev/fdt/ehci_fdt.c:1.4
--- src/sys/dev/fdt/ehci_fdt.c:1.3	Mon Apr  9 16:21:10 2018
+++ src/sys/dev/fdt/ehci_fdt.c	Sun Aug 12 16:33:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_fdt.c,v 1.3 2018/04/09 16:21:10 jakllsch Exp $ */
+/* $NetBSD: ehci_fdt.c,v 1.4 2018/08/12 16:33:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.3 2018/04/09 16:21:10 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.4 2018/08/12 16:33:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -147,5 +147,7 @@ ehci_fdt_attach(device_t parent, device_
 		return;
 	}
 
+	pmf_device_register1(self, NULL, NULL, ehci_shutdown);
+
 	sc->sc_child = config_found(self, >sc_bus, usbctlprint);
 }

Index: src/sys/dev/fdt/ohci_fdt.c
diff -u src/sys/dev/fdt/ohci_fdt.c:1.2 src/sys/dev/fdt/ohci_fdt.c:1.3
--- src/sys/dev/fdt/ohci_fdt.c:1.2	Mon Apr  9 16:21:10 2018
+++ src/sys/dev/fdt/ohci_fdt.c	Sun Aug 12 16:33:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci_fdt.c,v 1.2 2018/04/09 16:21:10 jakllsch Exp $ */
+/* $NetBSD: ohci_fdt.c,v 1.3 2018/08/12 16:33:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.2 2018/04/09 16:21:10 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.3 2018/08/12 16:33:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -143,5 +143,7 @@ ohci_fdt_attach(device_t parent, device_
 		return;
 	}
 
+	pmf_device_register1(self, NULL, NULL, ohci_shutdown);
+
 	sc->sc_child = config_found(self, >sc_bus, usbctlprint);
 }



CVS commit: src/external/cddl/osnet/dev/dtrace/amd64

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 16:07:27 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/dtrace/amd64: dtrace_isa.c

Log Message:
handle variable kernel vm min address


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c

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

Modified files:

Index: src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c
diff -u src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.8 src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.9
--- src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.8	Fri Jul 27 03:32:59 2018
+++ src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c	Sun Aug 12 12:07:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtrace_isa.c,v 1.8 2018/07/27 07:32:59 maxv Exp $	*/
+/*	$NetBSD: dtrace_isa.c,v 1.9 2018/08/12 16:07:27 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -45,7 +45,11 @@ uint16_t dtrace_fuword16_nocheck(void *)
 uint32_t dtrace_fuword32_nocheck(void *);
 uint64_t dtrace_fuword64_nocheck(void *);
 
+#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
+__strong_alias(kernelbase, vm_min_kernel_address)
+#else
 uintptr_t kernelbase = (uintptr_t)VM_MIN_KERNEL_ADDRESS;
+#endif
 
 #define INKERNEL(va) ((intptr_t)(va) < 0) /* XXX horror */
 



CVS commit: src/external/cddl/osnet/dev/dtrace/amd64

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 16:07:27 UTC 2018

Modified Files:
src/external/cddl/osnet/dev/dtrace/amd64: dtrace_isa.c

Log Message:
handle variable kernel vm min address


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c

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



CVS commit: src/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 16:00:41 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
i386 does not have a variable min address (yet)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/crash/arch/x86.c

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

Modified files:

Index: src/usr.sbin/crash/arch/x86.c
diff -u src/usr.sbin/crash/arch/x86.c:1.3 src/usr.sbin/crash/arch/x86.c:1.4
--- src/usr.sbin/crash/arch/x86.c:1.3	Sun Aug 12 11:55:26 2018
+++ src/usr.sbin/crash/arch/x86.c	Sun Aug 12 12:00:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $	*/
+/*	$NetBSD: x86.c,v 1.4 2018/08/12 16:00:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $");
+__RCSID("$NetBSD: x86.c,v 1.4 2018/08/12 16:00:41 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -47,11 +47,15 @@ __RCSID("$NetBSD: x86.c,v 1.3 2018/08/12
 
 #include "extern.h"
 
+#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
 vaddr_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_DEFAULT;
+#endif
 
 static struct nlist nl[] = {
 	{ .n_name = "_dumppcb" },
+#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
 	{ .n_name = "vm_min_kernel_address" },
+#endif
 	{ .n_name = NULL },
 };
 
@@ -68,11 +72,13 @@ db_mach_init(kvm_t *kd)
 	sizeof(pcb)) {
 		errx(EXIT_FAILURE, "cannot read dumppcb: %s", kvm_geterr(kd));
 	}
+#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
 	if ((size_t)kvm_read(kd, nl[1].n_value, _min_kernel_address,
 	sizeof(vm_min_kernel_address)) != sizeof(vm_min_kernel_address)) {
 		errx(EXIT_FAILURE, "cannot read vm_min_kernel_address: %s",
 		kvm_geterr(kd));
 	}
+#endif
 ddb_regs.tf_sp = pcb.pcb_sp;
 ddb_regs.tf_bp = pcb.pcb_bp;
 if (ddb_regs.tf_bp != 0 && ddb_regs.tf_sp != 0) {



CVS commit: src/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 16:00:41 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
i386 does not have a variable min address (yet)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/crash/arch/x86.c

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



CVS commit: src/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:55:27 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
reorder


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/crash/arch/x86.c

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

Modified files:

Index: src/usr.sbin/crash/arch/x86.c
diff -u src/usr.sbin/crash/arch/x86.c:1.2 src/usr.sbin/crash/arch/x86.c:1.3
--- src/usr.sbin/crash/arch/x86.c:1.2	Sun Aug 12 11:05:13 2018
+++ src/usr.sbin/crash/arch/x86.c	Sun Aug 12 11:55:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86.c,v 1.2 2018/08/12 15:05:13 christos Exp $	*/
+/*	$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: x86.c,v 1.2 2018/08/12 15:05:13 christos Exp $");
+__RCSID("$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -50,8 +50,8 @@ __RCSID("$NetBSD: x86.c,v 1.2 2018/08/12
 vaddr_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_DEFAULT;
 
 static struct nlist nl[] = {
-	{ .n_name = "vm_min_kernel_address" },
 	{ .n_name = "_dumppcb" },
+	{ .n_name = "vm_min_kernel_address" },
 	{ .n_name = NULL },
 };
 



CVS commit: src/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:55:27 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
reorder


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/crash/arch/x86.c

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



CVS commit: src/external/mpl/dhcp

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:39:22 UTC 2018

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

Log Message:
Add libz for new libisc needing it.


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

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

Modified files:

Index: src/external/mpl/dhcp/Makefile.inc
diff -u src/external/mpl/dhcp/Makefile.inc:1.3 src/external/mpl/dhcp/Makefile.inc:1.4
--- src/external/mpl/dhcp/Makefile.inc:1.3	Fri Jun 22 16:48:43 2018
+++ src/external/mpl/dhcp/Makefile.inc	Sun Aug 12 11:39:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.3 2018/06/22 20:48:43 christos Exp $
+# $NetBSD: Makefile.inc,v 1.4 2018/08/12 15:39:22 christos Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual -Wsign-compare
 
@@ -38,7 +38,7 @@ LDADD+= ${OMOBJDIR}/libomapi.a
 LDADD+=-Wl,-Bstatic
 .endif
 LDADD+= -lirs -lisccfg -ldns -lisc
-LDADD+=-lpthread
+LDADD+=-lpthread -lz
 .if (${MKKERBEROS} != "no")
 LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} ${LIBKRB5_STATIC_LDADD}
 DPADD+= ${LIBKRB5_DPADD} ${LIBHEIMNTLM} ${LIBGSSAPI} ${LIBKRB5_STATIC_DPADD}
@@ -54,4 +54,4 @@ LDADD+=-Wl,-Bdynamic
 DPADD+= ${COBJDIR}/libdhcp.a
 DPADD+= ${OMOBJDIR}/libomapi.a
 DPADD+=	${LIBDNS} ${LIBISC}
-DPADD+= ${LIBPTHREAD}
+DPADD+= ${LIBPTHREAD} ${LIBZ}



CVS commit: src/external/mpl/dhcp

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:39:22 UTC 2018

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

Log Message:
Add libz for new libisc needing it.


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

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



CVS commit: src/external/mpl/bind/lib/libisc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:37:06 UTC 2018

Modified Files:
src/external/mpl/bind/lib/libisc: Makefile

Log Message:
Add -lz


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

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

Modified files:

Index: src/external/mpl/bind/lib/libisc/Makefile
diff -u src/external/mpl/bind/lib/libisc/Makefile:1.1 src/external/mpl/bind/lib/libisc/Makefile:1.2
--- src/external/mpl/bind/lib/libisc/Makefile:1.1	Sun Aug 12 09:02:43 2018
+++ src/external/mpl/bind/lib/libisc/Makefile	Sun Aug 12 11:37:06 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2018/08/12 13:02:43 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2018/08/12 15:37:06 christos Exp $
 
 LIB=isc
 #USE_SHLIBDIR=   yes
@@ -45,4 +45,7 @@ CPPFLAGS.net.c=	-Wno-error
 SRCS+=		ipv6.c
 .endif
 
+LDADD+=-lz
+DPADD+=${LIBZ}
+
 .include 



CVS commit: src/external/mpl/bind/lib/libisc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:37:06 UTC 2018

Modified Files:
src/external/mpl/bind/lib/libisc: Makefile

Log Message:
Add -lz


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

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



CVS commit: src/doc

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 15:33:36 UTC 2018

Modified Files:
src/doc: TODO.kaslr

Log Message:
mark two entries as done


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

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

Modified files:

Index: src/doc/TODO.kaslr
diff -u src/doc/TODO.kaslr:1.2 src/doc/TODO.kaslr:1.3
--- src/doc/TODO.kaslr:1.2	Thu Aug  2 17:34:51 2018
+++ src/doc/TODO.kaslr	Sun Aug 12 15:33:36 2018
@@ -25,9 +25,9 @@
 
 == RANDOMIZATION ==
 
--- Randomize the PTE space.
+[DONE] -- Randomize the PTE space.
 
--- Randomize the kernel main memory (VM_MIN_KERNEL_ADDRESS).
+[DONE] -- Randomize the kernel main memory (VM_MIN_KERNEL_ADDRESS).
 
 [DONE] -- Randomize the direct map.
 



CVS commit: src/doc

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 15:33:36 UTC 2018

Modified Files:
src/doc: TODO.kaslr

Log Message:
mark two entries as done


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

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



CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 15:31:01 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf locore.S machdep.c prekern.c
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/x86: pmap.c

Log Message:
More ASLR: randomize the location of the PTE area. The PTE slot is not
created in locore anymore, but a little later; by using the already
entered L4 page, rather than the recursive slot itself (which doesn't
exist yet).

In the prekern we still map the slot - the prekern behaves as an external
locore -, because we need it as part of the randomization/relocation
work. The kernel then removes this slot, and regenerates a randomized
one.

Tested on GENERIC and GENERIC_KASLR, Xen doesn't have it and dom0 still
boots fine.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.313 -r1.314 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/amd64/prekern.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.301 -r1.302 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/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.69 src/sys/arch/amd64/amd64/genassym.cf:1.70
--- src/sys/arch/amd64/amd64/genassym.cf:1.69	Sun Aug 12 06:11:47 2018
+++ src/sys/arch/amd64/amd64/genassym.cf	Sun Aug 12 15:31:01 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.69 2018/08/12 06:11:47 maxv Exp $
+#	$NetBSD: genassym.cf,v 1.70 2018/08/12 15:31:01 maxv Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -143,8 +143,6 @@ define	L3_SLOT_KERNBASE	pl3_pi(KERNBASE)
 define	L2_SLOT_KERNBASE	pl2_pi(KERNBASE)
 define	L1_SLOT_KERNBASE	pl1_pi(KERNBASE)
 
-define	PDIR_SLOT_PTE		PDIR_SLOT_PTE
-
 define	PDE_SIZE		sizeof(pd_entry_t)
 
 define	VM_MAXUSER_ADDRESS	(unsigned long long)VM_MAXUSER_ADDRESS

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.173 src/sys/arch/amd64/amd64/locore.S:1.174
--- src/sys/arch/amd64/amd64/locore.S:1.173	Thu Jul 26 09:29:08 2018
+++ src/sys/arch/amd64/amd64/locore.S	Sun Aug 12 15:31:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.173 2018/07/26 09:29:08 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.174 2018/08/12 15:31:01 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -770,13 +770,6 @@ ENTRY(start)
 	movl	$NKL4_KIMG_ENTRIES,%ecx
 	fillkpt
 
-	/* Install recursive top level PDE (one entry) */
-	leal	(PROC0_PML4_OFF + PDIR_SLOT_PTE * PDE_SIZE)(%esi),%ebx
-	leal	(PROC0_PML4_OFF)(%esi),%eax
-	orl	$(PG_V|PG_KW),%eax
-	movl	$1,%ecx
-	fillkpt_nox
-
 	/*
 	 * Startup checklist:
 	 * 1. Enable PAE (and SSE while here).

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.313 src/sys/arch/amd64/amd64/machdep.c:1.314
--- src/sys/arch/amd64/amd64/machdep.c:1.313	Sun Aug 12 12:42:53 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Aug 12 15:31:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.313 2018/08/12 12:42:53 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.314 2018/08/12 15:31:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.313 2018/08/12 12:42:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.314 2018/08/12 15:31:01 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -266,6 +266,7 @@ extern struct slotspace slotspace;
 
 vaddr_t vm_min_kernel_address __read_mostly = VM_MIN_KERNEL_ADDRESS_DEFAULT;
 vaddr_t vm_max_kernel_address __read_mostly = VM_MAX_KERNEL_ADDRESS_DEFAULT;
+pd_entry_t *pte_base __read_mostly;
 
 struct vm_map *phys_map = NULL;
 
@@ -1589,6 +1590,21 @@ init_bootspace(void)
 	bootspace.emodule = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
 }
 
+static void init_pte(void)
+{
+#ifndef XEN
+	extern uint32_t nox_flag;
+	pd_entry_t *pdir = (pd_entry_t *)bootspace.pdir;
+	pdir[L4_SLOT_PTE] = PDPpaddr | PG_KW | ((uint64_t)nox_flag << 32) |
+	PG_V;
+#endif
+
+	extern pd_entry_t *normal_pdes[3];
+	normal_pdes[0] = L2_BASE;
+	normal_pdes[1] = L3_BASE;
+	normal_pdes[2] = L4_BASE;
+}
+
 void
 init_slotspace(void)
 {
@@ -1604,12 +1620,14 @@ init_slotspace(void)
 	slotspace.area[SLAREA_USER].active = true;
 	slotspace.area[SLAREA_USER].dropmax = false;
 
+#ifdef XEN
 	/* PTE. */
 	slotspace.area[SLAREA_PTE].sslot = PDIR_SLOT_PTE;
 	slotspace.area[SLAREA_PTE].mslot = 1;
 	slotspace.area[SLAREA_PTE].nslot = 1;
 	slotspace.area[SLAREA_PTE].active = true;
 	slotspace.area[SLAREA_PTE].dropmax = false;
+#endif
 
 #ifdef __HAVE_PCPU_AREA
 	/* Per-CPU. */
@@ -1652,6 +1670,14 @@ init_slotspace(void)
 	NBPD_L4);
 	vm_min_kernel_address = va;
 	vm_max_kernel_address = va + NKL4_MAX_ENTRIES * NBPD_L4;
+

CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 15:31:01 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf locore.S machdep.c prekern.c
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/x86: pmap.c

Log Message:
More ASLR: randomize the location of the PTE area. The PTE slot is not
created in locore anymore, but a little later; by using the already
entered L4 page, rather than the recursive slot itself (which doesn't
exist yet).

In the prekern we still map the slot - the prekern behaves as an external
locore -, because we need it as part of the randomization/relocation
work. The kernel then removes this slot, and regenerates a randomized
one.

Tested on GENERIC and GENERIC_KASLR, Xen doesn't have it and dom0 still
boots fine.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.313 -r1.314 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/amd64/prekern.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.301 -r1.302 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/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:05:13 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
make things link again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/crash/arch/x86.c

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

Modified files:

Index: src/usr.sbin/crash/arch/x86.c
diff -u src/usr.sbin/crash/arch/x86.c:1.1 src/usr.sbin/crash/arch/x86.c:1.2
--- src/usr.sbin/crash/arch/x86.c:1.1	Sat Apr 30 12:57:58 2011
+++ src/usr.sbin/crash/arch/x86.c	Sun Aug 12 11:05:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86.c,v 1.1 2011/04/30 16:57:58 christos Exp $	*/
+/*	$NetBSD: x86.c,v 1.2 2018/08/12 15:05:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: x86.c,v 1.1 2011/04/30 16:57:58 christos Exp $");
+__RCSID("$NetBSD: x86.c,v 1.2 2018/08/12 15:05:13 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -47,7 +47,10 @@ __RCSID("$NetBSD: x86.c,v 1.1 2011/04/30
 
 #include "extern.h"
 
+vaddr_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_DEFAULT;
+
 static struct nlist nl[] = {
+	{ .n_name = "vm_min_kernel_address" },
 	{ .n_name = "_dumppcb" },
 	{ .n_name = NULL },
 };
@@ -65,6 +68,11 @@ db_mach_init(kvm_t *kd)
 	sizeof(pcb)) {
 		errx(EXIT_FAILURE, "cannot read dumppcb: %s", kvm_geterr(kd));
 	}
+	if ((size_t)kvm_read(kd, nl[1].n_value, _min_kernel_address,
+	sizeof(vm_min_kernel_address)) != sizeof(vm_min_kernel_address)) {
+		errx(EXIT_FAILURE, "cannot read vm_min_kernel_address: %s",
+		kvm_geterr(kd));
+	}
 ddb_regs.tf_sp = pcb.pcb_sp;
 ddb_regs.tf_bp = pcb.pcb_bp;
 if (ddb_regs.tf_bp != 0 && ddb_regs.tf_sp != 0) {



CVS commit: src/usr.sbin/crash/arch

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 15:05:13 UTC 2018

Modified Files:
src/usr.sbin/crash/arch: x86.c

Log Message:
make things link again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/crash/arch/x86.c

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



CVS commit: src/external/mpl/bind/lib

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 14:32:39 UTC 2018

Modified Files:
src/external/mpl/bind/lib: Makefile

Log Message:
add libns


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

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

Modified files:

Index: src/external/mpl/bind/lib/Makefile
diff -u src/external/mpl/bind/lib/Makefile:1.1 src/external/mpl/bind/lib/Makefile:1.2
--- src/external/mpl/bind/lib/Makefile:1.1	Sun Aug 12 09:02:43 2018
+++ src/external/mpl/bind/lib/Makefile	Sun Aug 12 10:32:39 2018
@@ -1,5 +1,6 @@
-#	$NetBSD: Makefile,v 1.1 2018/08/12 13:02:43 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2018/08/12 14:32:39 christos Exp $
 
 SUBDIR+= libisc .WAIT libdns libisccc .WAIT libisccfg .WAIT libbind9 libirs
+SUBDIR+= libns
 
 .include 



CVS commit: src/external/mpl/bind/lib

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 14:32:39 UTC 2018

Modified Files:
src/external/mpl/bind/lib: Makefile

Log Message:
add libns


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

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



CVS commit: src/doc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:51:59 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
undo the time warp


To generate a diff of this commit:
cvs rdiff -u -r1.2420 -r1.2421 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2420 src/doc/CHANGES:1.2421
--- src/doc/CHANGES:1.2420	Sun Aug 12 09:07:41 2018
+++ src/doc/CHANGES	Sun Aug 12 09:51:58 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2420 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2421 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -194,4 +194,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[kamil 20180803]
 	lua: Import version 5.3.5. [alnsn 20180804]
 	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]
- 	bind: Import version 9.12.2-P1. [christos 20170615]
+ 	bind: Import version 9.12.2-P1. [christos 20180812]



CVS commit: src/doc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:51:59 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
undo the time warp


To generate a diff of this commit:
cvs rdiff -u -r1.2420 -r1.2421 src/doc/CHANGES

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



CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 13:31:16 UTC 2018

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

Log Message:
Move the PCPU area from slot 384 to slot 510, to avoid creating too much
fragmentation in the slot space (384 is in the middle of the kernel half
of the VA).


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/include/pmap.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/amd64/include/frameasm.h
diff -u src/sys/arch/amd64/include/frameasm.h:1.40 src/sys/arch/amd64/include/frameasm.h:1.41
--- src/sys/arch/amd64/include/frameasm.h:1.40	Fri Jul 13 14:11:02 2018
+++ src/sys/arch/amd64/include/frameasm.h	Sun Aug 12 13:31:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frameasm.h,v 1.40 2018/07/13 14:11:02 martin Exp $	*/
+/*	$NetBSD: frameasm.h,v 1.41 2018/08/12 13:31:16 maxv Exp $	*/
 
 #ifndef _AMD64_MACHINE_FRAMEASM_H
 #define _AMD64_MACHINE_FRAMEASM_H
@@ -130,7 +130,7 @@
 #ifdef SVS
 
 /* XXX: put this somewhere else */
-#define SVS_UTLS		0xc000 /* PMAP_PCPU_BASE */
+#define SVS_UTLS		0xff00 /* PMAP_PCPU_BASE */
 #define UTLS_KPDIRPA		0
 #define UTLS_SCRATCH		8
 #define UTLS_RSP0		16

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.83 src/sys/arch/x86/include/pmap.h:1.84
--- src/sys/arch/x86/include/pmap.h:1.83	Sun Aug 12 10:50:35 2018
+++ src/sys/arch/x86/include/pmap.h	Sun Aug 12 13:31:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.83 2018/08/12 10:50:35 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.84 2018/08/12 13:31:16 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -559,7 +559,7 @@ void	pmap_free_ptps(struct vm_page *);
 
 #ifdef __HAVE_PCPU_AREA
 extern struct pcpu_area *pcpuarea;
-#define PDIR_SLOT_PCPU		384
+#define PDIR_SLOT_PCPU		510
 #define PMAP_PCPU_BASE		(VA_SIGN_NEG((PDIR_SLOT_PCPU * NBPD_L4)))
 #endif
 



CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 13:31:16 UTC 2018

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

Log Message:
Move the PCPU area from slot 384 to slot 510, to avoid creating too much
fragmentation in the slot space (384 is in the middle of the kernel half
of the VA).


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/include/pmap.h

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



CVS commit: src/external/mpl

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:03:09 UTC 2018

Modified Files:
src/external/mpl: Makefile

Log Message:
hook bind


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

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



CVS commit: src/doc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:07:41 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1540 -r1.1541 src/doc/3RDPARTY
cvs rdiff -u -r1.2419 -r1.2420 src/doc/CHANGES

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



CVS commit: src/external/mpl

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:03:09 UTC 2018

Modified Files:
src/external/mpl: Makefile

Log Message:
hook bind


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

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

Modified files:

Index: src/external/mpl/Makefile
diff -u src/external/mpl/Makefile:1.1 src/external/mpl/Makefile:1.2
--- src/external/mpl/Makefile:1.1	Sat Apr  7 21:30:01 2018
+++ src/external/mpl/Makefile	Sun Aug 12 09:03:08 2018
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.1 2018/04/08 01:30:01 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2018/08/12 13:03:08 christos Exp $
 
 .include 
 
-SUBDIR=	dhcp
+SUBDIR=	bind dhcp
 
 .include 



CVS commit: src/doc

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:07:41 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1540 -r1.1541 src/doc/3RDPARTY
cvs rdiff -u -r1.2419 -r1.2420 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1540 src/doc/3RDPARTY:1.1541
--- src/doc/3RDPARTY:1.1540	Thu Aug  9 20:19:09 2018
+++ src/doc/3RDPARTY	Sun Aug 12 09:07:41 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1540 2018/08/10 00:19:09 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1541 2018/08/12 13:07:41 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -114,8 +114,8 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.10.7/BSD	9.12.1/MPL
-Current Vers:	9.10.7/BSD
+Version:	9.10.7/BSD	9.12.2-P1/MPL
+Current Vers:	9.10.7/BSD	9.12.2-P1/MPL
 Maintainer:	Paul Vixie 
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2419 src/doc/CHANGES:1.2420
--- src/doc/CHANGES:1.2419	Fri Aug 10 16:11:29 2018
+++ src/doc/CHANGES	Sun Aug 12 09:07:41 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2419 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2420 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -194,3 +194,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[kamil 20180803]
 	lua: Import version 5.3.5. [alnsn 20180804]
 	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]
+ 	bind: Import version 9.12.2-P1. [christos 20170615]



CVS commit: src/external/mpl/bind

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:02:44 UTC 2018

Modified Files:
src/external/mpl/bind/dist: Makefile.in acconfig.h bind.keys.h
config.guess config.h.in config.sub configure configure.in
isc-config.sh.1
src/external/mpl/bind/dist/bin/check: check-tool.c check-tool.h
named-checkconf.8 named-checkconf.c named-checkzone.8
named-checkzone.c
src/external/mpl/bind/dist/bin/confgen: ddns-confgen.8 ddns-confgen.c
keygen.c keygen.h rndc-confgen.8 rndc-confgen.c util.c util.h
src/external/mpl/bind/dist/bin/confgen/include/confgen: os.h
src/external/mpl/bind/dist/bin/confgen/unix: os.c
src/external/mpl/bind/dist/bin/confgen/win32: os.c
src/external/mpl/bind/dist/bin/delv: delv.1 delv.c
src/external/mpl/bind/dist/bin/dig: dig.1 dig.c dighost.c host.1 host.c
nslookup.1 nslookup.c
src/external/mpl/bind/dist/bin/dig/include/dig: dig.h
src/external/mpl/bind/dist/bin/dnssec: dnssec-cds.8 dnssec-cds.c
dnssec-dsfromkey.8 dnssec-dsfromkey.c dnssec-importkey.8
dnssec-importkey.c dnssec-keyfromlabel.8 dnssec-keyfromlabel.c
dnssec-keygen.8 dnssec-keygen.c dnssec-revoke.8 dnssec-revoke.c
dnssec-settime.8 dnssec-settime.c dnssec-signzone.8
dnssec-signzone.c dnssec-verify.8 dnssec-verify.c dnssectool.c
dnssectool.h
src/external/mpl/bind/dist/bin/named: bind9.xsl.h builtin.c config.c
control.c controlconf.c fuzz.c geoip.c log.c logconf.c main.c
named.8 named.conf.5 server.c statschannel.c tkeyconf.c tsigconf.c
zoneconf.c
src/external/mpl/bind/dist/bin/named/include/dlz: dlz_dlopen_driver.h
src/external/mpl/bind/dist/bin/named/include/named: builtin.h config.h
control.h fuzz.h geoip.h globals.h log.h logconf.h main.h seccomp.h
server.h smf_globals.h statschannel.h tkeyconf.h tsigconf.h types.h
zoneconf.h
src/external/mpl/bind/dist/bin/named/unix: dlz_dlopen_driver.c os.c
src/external/mpl/bind/dist/bin/named/unix/include/named: os.h
src/external/mpl/bind/dist/bin/named/win32: dlz_dlopen_driver.c
ntservice.c os.c
src/external/mpl/bind/dist/bin/named/win32/include/named: ntservice.h
os.h
src/external/mpl/bind/dist/bin/nsupdate: nsupdate.1 nsupdate.c
src/external/mpl/bind/dist/bin/pkcs11: pkcs11-destroy.8
pkcs11-destroy.c pkcs11-keygen.8 pkcs11-keygen.c pkcs11-list.8
pkcs11-list.c pkcs11-tokens.8 pkcs11-tokens.c
src/external/mpl/bind/dist/bin/python: dnssec-checkds.8
dnssec-coverage.8 dnssec-keymgr.8
src/external/mpl/bind/dist/bin/rndc: rndc.8 rndc.c rndc.conf.5 util.c
util.h
src/external/mpl/bind/dist/bin/rndc/include/rndc: os.h
src/external/mpl/bind/dist/bin/tests: cfg_test.c makejournal.c
wire_test.c
src/external/mpl/bind/dist/bin/tests/optional: adb_test.c
backtrace_test.c byaddr_test.c byname_test.c db_test.c dst_test.c
entropy2_test.c entropy_test.c fsaccess_test.c gsstest.c
hash_test.c inter_test.c keyboard_test.c lex_test.c lfsr_test.c
log_test.c master_test.c mempool_test.c name_test.c nsecify.c
ratelimiter_test.c rbt_test.c rwlock_test.c serial_test.c
shutdown_test.c sig0_test.c sock_test.c sym_test.c task_test.c
timer_test.c zone_test.c
src/external/mpl/bind/dist/bin/tests/pkcs11: pkcs11-hmacmd5.c
pkcs11-md5sum.c
src/external/mpl/bind/dist/bin/tests/pkcs11/benchmarks: create.c find.c
genrsa.c login.c privrsa.c pubrsa.c random.c session.c sha1.c
sign.c verify.c
src/external/mpl/bind/dist/bin/tests/system: feature-test.c
src/external/mpl/bind/dist/bin/tests/system/addzone/ns1: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/addzone/ns2: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/addzone/ns3: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/checkconf: dnssec.1
dnssec.2 dnssec.3

src/external/mpl/bind/dist/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d:
10.53.0.1
src/external/mpl/bind/dist/bin/tests/system/dlzexternal: driver.c
driver.h
src/external/mpl/bind/dist/bin/tests/system/dyndb/driver: db.c db.h
driver.c instance.c instance.h lock.c lock.h log.c log.h syncptr.c
syncptr.h util.h zone.c zone.h
src/external/mpl/bind/dist/bin/tests/system/pipelined: pipequeries.c
src/external/mpl/bind/dist/bin/tests/system/rndc: gencheck.c
src/external/mpl/bind/dist/bin/tests/system/rpz: dnsrps.c

CVS commit: src/external/mpl/bind

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:02:44 UTC 2018

Modified Files:
src/external/mpl/bind/dist: Makefile.in acconfig.h bind.keys.h
config.guess config.h.in config.sub configure configure.in
isc-config.sh.1
src/external/mpl/bind/dist/bin/check: check-tool.c check-tool.h
named-checkconf.8 named-checkconf.c named-checkzone.8
named-checkzone.c
src/external/mpl/bind/dist/bin/confgen: ddns-confgen.8 ddns-confgen.c
keygen.c keygen.h rndc-confgen.8 rndc-confgen.c util.c util.h
src/external/mpl/bind/dist/bin/confgen/include/confgen: os.h
src/external/mpl/bind/dist/bin/confgen/unix: os.c
src/external/mpl/bind/dist/bin/confgen/win32: os.c
src/external/mpl/bind/dist/bin/delv: delv.1 delv.c
src/external/mpl/bind/dist/bin/dig: dig.1 dig.c dighost.c host.1 host.c
nslookup.1 nslookup.c
src/external/mpl/bind/dist/bin/dig/include/dig: dig.h
src/external/mpl/bind/dist/bin/dnssec: dnssec-cds.8 dnssec-cds.c
dnssec-dsfromkey.8 dnssec-dsfromkey.c dnssec-importkey.8
dnssec-importkey.c dnssec-keyfromlabel.8 dnssec-keyfromlabel.c
dnssec-keygen.8 dnssec-keygen.c dnssec-revoke.8 dnssec-revoke.c
dnssec-settime.8 dnssec-settime.c dnssec-signzone.8
dnssec-signzone.c dnssec-verify.8 dnssec-verify.c dnssectool.c
dnssectool.h
src/external/mpl/bind/dist/bin/named: bind9.xsl.h builtin.c config.c
control.c controlconf.c fuzz.c geoip.c log.c logconf.c main.c
named.8 named.conf.5 server.c statschannel.c tkeyconf.c tsigconf.c
zoneconf.c
src/external/mpl/bind/dist/bin/named/include/dlz: dlz_dlopen_driver.h
src/external/mpl/bind/dist/bin/named/include/named: builtin.h config.h
control.h fuzz.h geoip.h globals.h log.h logconf.h main.h seccomp.h
server.h smf_globals.h statschannel.h tkeyconf.h tsigconf.h types.h
zoneconf.h
src/external/mpl/bind/dist/bin/named/unix: dlz_dlopen_driver.c os.c
src/external/mpl/bind/dist/bin/named/unix/include/named: os.h
src/external/mpl/bind/dist/bin/named/win32: dlz_dlopen_driver.c
ntservice.c os.c
src/external/mpl/bind/dist/bin/named/win32/include/named: ntservice.h
os.h
src/external/mpl/bind/dist/bin/nsupdate: nsupdate.1 nsupdate.c
src/external/mpl/bind/dist/bin/pkcs11: pkcs11-destroy.8
pkcs11-destroy.c pkcs11-keygen.8 pkcs11-keygen.c pkcs11-list.8
pkcs11-list.c pkcs11-tokens.8 pkcs11-tokens.c
src/external/mpl/bind/dist/bin/python: dnssec-checkds.8
dnssec-coverage.8 dnssec-keymgr.8
src/external/mpl/bind/dist/bin/rndc: rndc.8 rndc.c rndc.conf.5 util.c
util.h
src/external/mpl/bind/dist/bin/rndc/include/rndc: os.h
src/external/mpl/bind/dist/bin/tests: cfg_test.c makejournal.c
wire_test.c
src/external/mpl/bind/dist/bin/tests/optional: adb_test.c
backtrace_test.c byaddr_test.c byname_test.c db_test.c dst_test.c
entropy2_test.c entropy_test.c fsaccess_test.c gsstest.c
hash_test.c inter_test.c keyboard_test.c lex_test.c lfsr_test.c
log_test.c master_test.c mempool_test.c name_test.c nsecify.c
ratelimiter_test.c rbt_test.c rwlock_test.c serial_test.c
shutdown_test.c sig0_test.c sock_test.c sym_test.c task_test.c
timer_test.c zone_test.c
src/external/mpl/bind/dist/bin/tests/pkcs11: pkcs11-hmacmd5.c
pkcs11-md5sum.c
src/external/mpl/bind/dist/bin/tests/pkcs11/benchmarks: create.c find.c
genrsa.c login.c privrsa.c pubrsa.c random.c session.c sha1.c
sign.c verify.c
src/external/mpl/bind/dist/bin/tests/system: feature-test.c
src/external/mpl/bind/dist/bin/tests/system/addzone/ns1: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/addzone/ns2: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/addzone/ns3: redirect.db.1
redirect.db.2
src/external/mpl/bind/dist/bin/tests/system/checkconf: dnssec.1
dnssec.2 dnssec.3

src/external/mpl/bind/dist/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d:
10.53.0.1
src/external/mpl/bind/dist/bin/tests/system/dlzexternal: driver.c
driver.h
src/external/mpl/bind/dist/bin/tests/system/dyndb/driver: db.c db.h
driver.c instance.c instance.h lock.c lock.h log.c log.h syncptr.c
syncptr.h util.h zone.c zone.h
src/external/mpl/bind/dist/bin/tests/system/pipelined: pipequeries.c
src/external/mpl/bind/dist/bin/tests/system/rndc: gencheck.c
src/external/mpl/bind/dist/bin/tests/system/rpz: dnsrps.c

CVS commit: src/external/bsd

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:02:42 UTC 2018

Modified Files:
src/external/bsd: Makefile

Log Message:
unhook bind


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/bsd/Makefile

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

Modified files:

Index: src/external/bsd/Makefile
diff -u src/external/bsd/Makefile:1.59 src/external/bsd/Makefile:1.60
--- src/external/bsd/Makefile:1.59	Sat Apr  7 18:39:53 2018
+++ src/external/bsd/Makefile	Sun Aug 12 09:02:42 2018
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.59 2018/04/07 22:39:53 christos Exp $
+#	$NetBSD: Makefile,v 1.60 2018/08/12 13:02:42 christos Exp $
 
 .include 
 
-SUBDIR=	acpica am-utils bc bind byacc cron dhcpcd ekermit elftosb \
+SUBDIR=	acpica am-utils bc byacc cron dhcpcd ekermit elftosb \
 	fetch file flex less \
 	libarchive libevent liblzf libpcap mdocml \
 	ntp openresolv tcpdump tmux top tre wpa



CVS commit: src/external/bsd

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:02:42 UTC 2018

Modified Files:
src/external/bsd: Makefile

Log Message:
unhook bind


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/bsd/Makefile

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



CVS commit: src/lib

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:01:56 UTC 2018

Modified Files:
src/lib: Makefile

Log Message:
switch to the new bind.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/lib/Makefile

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

Modified files:

Index: src/lib/Makefile
diff -u src/lib/Makefile:1.259 src/lib/Makefile:1.260
--- src/lib/Makefile:1.259	Thu Jul 12 02:52:49 2018
+++ src/lib/Makefile	Sun Aug 12 09:01:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.259 2018/07/12 06:52:49 maxv Exp $
+#	$NetBSD: Makefile,v 1.260 2018/08/12 13:01:55 christos Exp $
 #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
 
 .include 
@@ -220,7 +220,7 @@ SUBDIR+= 	../libexec/httpd/libbozohttpd 
 SUBDIR+=	.WAIT
 
 SUBDIR+=	../crypto/external/bsd/netpgp/bindings/lua  # depends on netpgp/lib
-SUBDIR+=	../external/bsd/bind/lib	# depends on heimdal, libcrypto
+SUBDIR+=	../external/mpl/bind/lib	# depends on heimdal, libcrypto
 .if ${MKUNBOUND} != "no"
 SUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
 .endif



CVS commit: src/lib

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 13:01:56 UTC 2018

Modified Files:
src/lib: Makefile

Log Message:
switch to the new bind.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/lib/Makefile

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



CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 12:42:54 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: machdep.c prekern.c
src/sys/arch/amd64/include: pmap.h
src/sys/arch/amd64/stand/prekern: pdir.h prekern.c
src/sys/arch/x86/x86: pmap.c

Log Message:
Move the PTE area from slot 255 to slot 509. I've never understood why we
put it on 255; the "kernel" half of the VM space begins on slot 256, so
if anything, the PTE area should have been above it, not below.

Virtually extend the user slots in slotspace, because we don't want
(randomized) kernel mappings to land on slot 255.

The prekern is updated accordingly.

Tested on GENERIC, GENERIC_KASLR and XEN3_DOM0.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/amd64/prekern.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/stand/prekern/pdir.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/stand/prekern/prekern.c
cvs rdiff -u -r1.300 -r1.301 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

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 12:42:54 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: machdep.c prekern.c
src/sys/arch/amd64/include: pmap.h
src/sys/arch/amd64/stand/prekern: pdir.h prekern.c
src/sys/arch/x86/x86: pmap.c

Log Message:
Move the PTE area from slot 255 to slot 509. I've never understood why we
put it on 255; the "kernel" half of the VM space begins on slot 256, so
if anything, the PTE area should have been above it, not below.

Virtually extend the user slots in slotspace, because we don't want
(randomized) kernel mappings to land on slot 255.

The prekern is updated accordingly.

Tested on GENERIC, GENERIC_KASLR and XEN3_DOM0.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/amd64/prekern.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/stand/prekern/pdir.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/stand/prekern/prekern.c
cvs rdiff -u -r1.300 -r1.301 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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.312 src/sys/arch/amd64/amd64/machdep.c:1.313
--- src/sys/arch/amd64/amd64/machdep.c:1.312	Sun Aug 12 10:50:35 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Aug 12 12:42:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.312 2018/08/12 10:50:35 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.313 2018/08/12 12:42:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.312 2018/08/12 10:50:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.313 2018/08/12 12:42:53 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -1597,10 +1597,10 @@ init_slotspace(void)
 
 	memset(, 0, sizeof(slotspace));
 
-	/* User. */
+	/* User. [256, because we want to land in >= 256] */
 	slotspace.area[SLAREA_USER].sslot = 0;
-	slotspace.area[SLAREA_USER].mslot = PDIR_SLOT_PTE;
-	slotspace.area[SLAREA_USER].nslot = PDIR_SLOT_PTE;
+	slotspace.area[SLAREA_USER].mslot = PDIR_SLOT_USERLIM+1;
+	slotspace.area[SLAREA_USER].nslot = PDIR_SLOT_USERLIM+1;
 	slotspace.area[SLAREA_USER].active = true;
 	slotspace.area[SLAREA_USER].dropmax = false;
 

Index: src/sys/arch/amd64/amd64/prekern.c
diff -u src/sys/arch/amd64/amd64/prekern.c:1.3 src/sys/arch/amd64/amd64/prekern.c:1.4
--- src/sys/arch/amd64/amd64/prekern.c:1.3	Thu Aug  2 17:18:00 2018
+++ src/sys/arch/amd64/amd64/prekern.c	Sun Aug 12 12:42:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: prekern.c,v 1.3 2018/08/02 17:18:00 maxv Exp $	*/
+/*	$NetBSD: prekern.c,v 1.4 2018/08/12 12:42:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -46,7 +46,7 @@
 #include 
 #include 
 
-#define PREKERN_API_VERSION	1
+#define PREKERN_API_VERSION	2
 
 struct prekern_args {
 	int version;

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.51 src/sys/arch/amd64/include/pmap.h:1.52
--- src/sys/arch/amd64/include/pmap.h:1.51	Sun Aug 12 12:23:33 2018
+++ src/sys/arch/amd64/include/pmap.h	Sun Aug 12 12:42:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.51 2018/08/12 12:23:33 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.52 2018/08/12 12:42:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -137,7 +137,7 @@
  */
 #define VA_SIGN_POS(va)		((va) & ~VA_SIGN_MASK)
 
-#define L4_SLOT_PTE		255
+#define L4_SLOT_PTE		509
 #define L4_SLOT_KERN		slotspace.area[SLAREA_MAIN].sslot
 #define L4_SLOT_KERNBASE	511 /* pl4_i(KERNBASE) */
 
@@ -153,7 +153,7 @@
  * PDP_PDE: the VA of the PDE that points back to the PDP
  */
 
-#define PTE_BASE	((pt_entry_t *)(L4_SLOT_PTE * NBPD_L4))
+#define PTE_BASE	((pt_entry_t *)VA_SIGN_NEG((L4_SLOT_PTE * NBPD_L4)))
 
 #define L1_BASE	PTE_BASE
 #define L2_BASE	((pd_entry_t *)((char *)L1_BASE + L4_SLOT_PTE * NBPD_L3))

Index: src/sys/arch/amd64/stand/prekern/pdir.h
diff -u src/sys/arch/amd64/stand/prekern/pdir.h:1.4 src/sys/arch/amd64/stand/prekern/pdir.h:1.5
--- src/sys/arch/amd64/stand/prekern/pdir.h:1.4	Sun Jan 21 10:59:21 2018
+++ src/sys/arch/amd64/stand/prekern/pdir.h	Sun Aug 12 12:42:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdir.h,v 1.4 2018/01/21 10:59:21 maxv Exp $	*/
+/*	$NetBSD: pdir.h,v 1.5 2018/08/12 12:42:54 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -32,12 +32,12 @@
 #define PREKERNTEXTOFF	(PREKERNBASE + 0x10)
 
 #define L4_SLOT_PREKERN	0 /* pl4_i(PREKERNBASE) */
-#define L4_SLOT_PTE	255
+#define L4_SLOT_PTE	509
 
 #define PDIR_SLOT_KERN	L4_SLOT_PREKERN
 #define PDIR_SLOT_PTE	L4_SLOT_PTE
 
-#define PTE_BASE	((pt_entry_t *)(L4_SLOT_PTE * NBPD_L4))
+#define PTE_BASE	

CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 12:23:33 UTC 2018

Modified Files:
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/x86: pmap.c svs.c
src/sys/arch/xen/x86: cpu.c

Log Message:
Introduce PDIR_SLOT_USERLIM, which indicates the limit of the user slots.
Use it instead of PDIR_SLOT_PTE when we just want to iterate over the
user slots. Also use it in SVS, I had hardcoded 255 because there was no
proper define (which there now is).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.299 -r1.300 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/xen/x86/cpu.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

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 12:23:33 UTC 2018

Modified Files:
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/x86: pmap.c svs.c
src/sys/arch/xen/x86: cpu.c

Log Message:
Introduce PDIR_SLOT_USERLIM, which indicates the limit of the user slots.
Use it instead of PDIR_SLOT_PTE when we just want to iterate over the
user slots. Also use it in SVS, I had hardcoded 255 because there was no
proper define (which there now is).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.299 -r1.300 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/xen/x86/cpu.c

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

Modified files:

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.50 src/sys/arch/amd64/include/pmap.h:1.51
--- src/sys/arch/amd64/include/pmap.h:1.50	Sun Aug 12 10:50:35 2018
+++ src/sys/arch/amd64/include/pmap.h	Sun Aug 12 12:23:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.50 2018/08/12 10:50:35 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.51 2018/08/12 12:23:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -141,6 +141,7 @@
 #define L4_SLOT_KERN		slotspace.area[SLAREA_MAIN].sslot
 #define L4_SLOT_KERNBASE	511 /* pl4_i(KERNBASE) */
 
+#define PDIR_SLOT_USERLIM	255
 #define PDIR_SLOT_KERN	L4_SLOT_KERN
 #define PDIR_SLOT_PTE	L4_SLOT_PTE
 

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.299 src/sys/arch/x86/x86/pmap.c:1.300
--- src/sys/arch/x86/x86/pmap.c:1.299	Sun Aug 12 11:51:42 2018
+++ src/sys/arch/x86/x86/pmap.c	Sun Aug 12 12:23:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.299 2018/08/12 11:51:42 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.300 2018/08/12 12:23:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -157,7 +157,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2018/08/12 11:51:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2018/08/12 12:23:33 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2571,7 +2571,7 @@ pmap_check_inuse(struct pmap *pmap)
 		if (ci->ci_pmap == pmap)
 			panic("destroying pmap being used");
 #if defined(XEN) && defined(__x86_64__)
-		for (int i = 0; i < PDIR_SLOT_PTE; i++) {
+		for (int i = 0; i < PDIR_SLOT_USERLIM; i++) {
 			if (pmap->pm_pdir[i] != 0 &&
 			ci->ci_kpm_pdir[i] == pmap->pm_pdir[i]) {
 printf("pmap_destroy(%p) pmap_kernel %p "

Index: src/sys/arch/x86/x86/svs.c
diff -u src/sys/arch/x86/x86/svs.c:1.19 src/sys/arch/x86/x86/svs.c:1.20
--- src/sys/arch/x86/x86/svs.c:1.19	Thu Jul 12 19:48:16 2018
+++ src/sys/arch/x86/x86/svs.c	Sun Aug 12 12:23:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: svs.c,v 1.19 2018/07/12 19:48:16 maxv Exp $	*/
+/*	$NetBSD: svs.c,v 1.20 2018/08/12 12:23:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.19 2018/07/12 19:48:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.20 2018/08/12 12:23:33 maxv Exp $");
 
 #include "opt_svs.h"
 
@@ -460,7 +460,7 @@ svs_pmap_sync(struct pmap *pmap, int ind
 	KASSERT(pmap != pmap_kernel());
 	KASSERT(mutex_owned(pmap->pm_lock));
 	KASSERT(kpreempt_disabled());
-	KASSERT(index < 255);
+	KASSERT(index < PDIR_SLOT_USERLIM);
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		cid = cpu_index(ci);
@@ -558,7 +558,7 @@ svs_pdir_switch(struct pmap *pmap)
 	mutex_enter(>ci_svs_mtx);
 
 	/* User slots. */
-	for (i = 0; i < 255; i++) {
+	for (i = 0; i < PDIR_SLOT_USERLIM; i++) {
 		pte = svs_pte_atomic_read(pmap, i);
 		ci->ci_svs_updir[i] = pte;
 	}

Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.125 src/sys/arch/xen/x86/cpu.c:1.126
--- src/sys/arch/xen/x86/cpu.c:1.125	Fri Jul 27 09:37:31 2018
+++ src/sys/arch/xen/x86/cpu.c	Sun Aug 12 12:23:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.125 2018/07/27 09:37:31 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.126 2018/08/12 12:23:33 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.125 2018/07/27 09:37:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.126 2018/08/12 12:23:33 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1136,7 +1136,7 @@ cpu_load_pmap(struct pmap *pmap, struct 
 	KASSERT(pmap == ci->ci_pmap);
 
 	/* Copy user pmap L4 PDEs (in user addr. range) to per-cpu L4 */
-	for (i = 0; i < PDIR_SLOT_PTE; i++) {
+	for (i = 0; i < PDIR_SLOT_USERLIM; i++) {
 		KASSERT(pmap != pmap_kernel() || new_pgd[i] == 0);
 		if (ci->ci_kpm_pdir[i] != new_pgd[i]) {
 			xpq_queue_pte_update(l4_pd_ma + i * sizeof(pd_entry_t),



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

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 11:51:42 UTC 2018

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

Log Message:
Reduce the minefield: zero out the pdir only once, at the beginning of
the function. This eliminates one assumption on the order of the VM
areas.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 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.298 src/sys/arch/x86/x86/pmap.c:1.299
--- src/sys/arch/x86/x86/pmap.c:1.298	Sun Aug 12 10:50:35 2018
+++ src/sys/arch/x86/x86/pmap.c	Sun Aug 12 11:51:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.298 2018/08/12 10:50:35 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.299 2018/08/12 11:51:42 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -157,7 +157,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.298 2018/08/12 10:50:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2018/08/12 11:51:42 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2318,6 +2318,8 @@ pmap_pdp_ctor(void *arg, void *v, int fl
 	int s;
 #endif
 
+	memset(pdir, 0, PDP_SIZE * PAGE_SIZE);
+
 	/*
 	 * NOTE: The `pmaps_lock' is held when the PDP is allocated.
 	 */
@@ -2326,9 +2328,6 @@ pmap_pdp_ctor(void *arg, void *v, int fl
 	/* Fetch the physical address of the page directory */
 	(void)pmap_extract(pmap_kernel(), (vaddr_t)pdir, );
 
-	/* Zero the area */
-	memset(pdir, 0, PAGE_SIZE); /* Xen wants a clean page */
-
 	/*
 	 * This pdir will NEVER be active in kernel mode, so mark
 	 * recursive entry invalid.
@@ -2345,9 +2344,6 @@ pmap_pdp_ctor(void *arg, void *v, int fl
 	pdir[PDIR_SLOT_KERN + nkptp[PTP_LEVELS - 1] - 1] =
 	 (pd_entry_t)-1 & PG_FRAME;
 #else /* XEN && __x86_64__*/
-	/* Zero the area */
-	memset(pdir, 0, PDIR_SLOT_PTE * sizeof(pd_entry_t));
-
 	object = (vaddr_t)v;
 	for (i = 0; i < PDP_SIZE; i++, object += PAGE_SIZE) {
 		/* Fetch the physical address of the page directory */
@@ -2367,10 +2363,6 @@ pmap_pdp_ctor(void *arg, void *v, int fl
 	memcpy([PDIR_SLOT_KERN], _BASE[PDIR_SLOT_KERN],
 	npde * sizeof(pd_entry_t));
 
-	/* Zero the rest */
-	memset([PDIR_SLOT_KERN + npde], 0, (PAGE_SIZE * PDP_SIZE) -
-	(PDIR_SLOT_KERN + npde) * sizeof(pd_entry_t));
-
 	if (VM_MIN_KERNEL_ADDRESS != KERNBASE) {
 		int idx = pl_i(KERNBASE, PTP_LEVELS);
 		pdir[idx] = PDP_BASE[idx];



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

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 11:51:42 UTC 2018

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

Log Message:
Reduce the minefield: zero out the pdir only once, at the beginning of
the function. This eliminates one assumption on the order of the VM
areas.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 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/share/mk

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 11:50:51 UTC 2018

Modified Files:
src/share/mk: bsd.README bsd.prog.mk

Log Message:
fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/share/mk/bsd.README
cvs rdiff -u -r1.317 -r1.318 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.381 src/share/mk/bsd.README:1.382
--- src/share/mk/bsd.README:1.381	Wed Jul 25 19:30:22 2018
+++ src/share/mk/bsd.README	Sun Aug 12 07:50:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.381 2018/07/25 23:30:22 kamil Exp $
+#	$NetBSD: bsd.README,v 1.382 2018/08/12 11:50:51 christos Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -403,7 +403,7 @@ MKRADEONFIRMWARE If "no", install the /l
 MKRELRO		If "partial", set the non-PLT GOT to read-only. If "full"
 		also force immediate symbol binding.
 		Default: no
-	
+
 MKREPRO If "yes", create reproducible builds. This enables
 		different switches to make two builds from the same source tree
 		result in the same build results.
@@ -491,7 +491,7 @@ MKUPDATE 	If not "no", 'make install' on
 		installed counterparts.
 		Default: no
 
-MKX11		If not "no", 'make build' also descends into 
+MKX11		If not "no", 'make build' also descends into
 		src/external/mit/xorg to cross-build X11 and automatically
 		enables creation of X sets.
 		Default: no
@@ -1141,7 +1141,7 @@ UUDECODE_FILES	List of files which are s
 
 UUDECODE_FILES_RENAME_
 		Rename the output from the decode to the provided name.
-		
+
 		*NOTE: These files are simply decoded, with no install or other
 		   rule applying implicitly except being added to the clean
 		   target.
@@ -1605,154 +1605,161 @@ DPADD		Additional dependencies for the p
 
 		The following system libraries are predefined for DPADD:
 
-		LIBARCHIVE?=	${DESTDIR}/usr/lib/libarchive.a
-		LIBASN1?=	${DESTDIR}/usr/lib/libasn1.a
-		LIBATF_C?=	${DESTDIR}/usr/lib/libatf-c.a
-		LIBATF_CXX?=	${DESTDIR}/usr/lib/libatf-c++.a
-		LIBBIND9?=	${DESTDIR}/usr/lib/libbind9.a
-		LIBBLUETOOTH?=	${DESTDIR}/usr/lib/libbluetooth.a
-		LIBBSDMALLOC?=	${DESTDIR}/usr/lib/libbsdmalloc.a
-		LIBBZ2?=	${DESTDIR}/usr/lib/libbz2.a
-		LIBC?=		${DESTDIR}/usr/lib/libc.a
-		LIBCOMPAT?=	${DESTDIR}/usr/lib/libcompat.a
-		LIBCOM_ERR?=	${DESTDIR}/usr/lib/libcom_err.a
-		LIBCRT0?=	${DESTDIR}/usr/lib/crt0.o
-		LIBCRTI?=	${DESTDIR}/usr/lib/crti.o
-		LIBCRYPT?=	${DESTDIR}/usr/lib/libcrypt.a
-		LIBCRYPTO?=	${DESTDIR}/usr/lib/libcrypto.a
-		LIBCURSES?=	${DESTDIR}/usr/lib/libcurses.a
-		LIBC_PIC?=	${DESTDIR}/usr/lib/libc_pic.a
-		LIBDBM?=	${DESTDIR}/usr/lib/libdbm.a
-		LIBDES?=	${DESTDIR}/usr/lib/libdes.a
-		LIBDNS?=	${DESTDIR}/usr/lib/libdns.a
-		LIBEDIT?=	${DESTDIR}/usr/lib/libedit.a
-		LIBEVENT?=	${DESTDIR}/usr/lib/libevent.a
+		LIBARCHIVE?=		${DESTDIR}/usr/lib/libarchive.a
+		LIBASN1?=		${DESTDIR}/usr/lib/libasn1.a
+		LIBATF_C?=		${DESTDIR}/usr/lib/libatf-c.a
+		LIBATF_CXX?=		${DESTDIR}/usr/lib/libatf-c++.a
+		LIBBIND9?=		${DESTDIR}/usr/lib/libbind9.a
+		LIBBLUETOOTH?=		${DESTDIR}/usr/lib/libbluetooth.a
+		LIBBSDMALLOC?=		${DESTDIR}/usr/lib/libbsdmalloc.a
+		LIBBZ2?=		${DESTDIR}/usr/lib/libbz2.a
+		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
+		LIBC?=			${DESTDIR}/usr/lib/libc.a
+		LIBCOMPAT?=		${DESTDIR}/usr/lib/libcompat.a
+		LIBCOM_ERR?=		${DESTDIR}/usr/lib/libcom_err.a
+		LIBCRYPT?=		${DESTDIR}/usr/lib/libcrypt.a
+		LIBCRYPTO?=		${DESTDIR}/usr/lib/libcrypto.a
+		LIBCURSES?=		${DESTDIR}/usr/lib/libcurses.a
+		LIBC_PIC?=		${DESTDIR}/usr/lib/libc_pic.a
+		LIBDBM?=		${DESTDIR}/usr/lib/libdbm.a
+		LIBDES?=		${DESTDIR}/usr/lib/libdes.a
+		LIBDNS?=		${DESTDIR}/usr/lib/libdns.a
+		LIBEDIT?=		${DESTDIR}/usr/lib/libedit.a
+		LIBEVENT?=		${DESTDIR}/usr/lib/libevent.a
 		LIBEVENT_OPENSSL?=	${DESTDIR}/usr/lib/libevent_openssl.a
 		LIBEVENT_PTHREADS?=	${DESTDIR}/usr/lib/libevent_pthreads.a
-		LIBEXECINFO?=	${DESTDIR}/usr/lib/libexecinfo.a
-		LIBEXPAT?=	${DESTDIR}/usr/lib/libexpat.a
-		LIBFETCH?=	${DESTDIR}/usr/lib/libfetch.a
-		LIBFORM?=	${DESTDIR}/usr/lib/libform.a
-		LIBFL?=		${DESTDIR}/usr/lib/libfl.a
-		LIBG2C?=	${DESTDIR}/usr/lib/libg2c.a
-		LIBGCC?=	${DESTDIR}/usr/lib/libgcc.a
-		LIBGNUMALLOC?=	${DESTDIR}/usr/lib/libgnumalloc.a
-		LIBGSSAPI?=	${DESTDIR}/usr/lib/libgssapi.a
-		LIBHDB?=	${DESTDIR}/usr/lib/libhdb.a
-		LIBHEIMBASE?=	${DESTDIR}/usr/lib/libheimbase.a
-		LIBHEIMNTLM?=	${DESTDIR}/usr/lib/libheimntlm.a
-		LIBHX500?=	${DESTDIR}/usr/lib/libhx500.a
-		LIBINTL?=	${DESTDIR}/usr/lib/libintl.a
-		LIBIPSEC?=	${DESTDIR}/usr/lib/libipsec.a
-		LIBISC?=	${DESTDIR}/usr/lib/libisc.a
-		LIBISCCC?=	${DESTDIR}/usr/lib/libisccc.a
-		LIBISCFG?=	${DESTDIR}/usr/lib/libiscfg.a
-		LIBKADM5CLNT?=	

CVS commit: src/share/mk

2018-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 11:50:51 UTC 2018

Modified Files:
src/share/mk: bsd.README bsd.prog.mk

Log Message:
fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/share/mk/bsd.README
cvs rdiff -u -r1.317 -r1.318 src/share/mk/bsd.prog.mk

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



CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 10:50:35 UTC 2018

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

Log Message:
Randomize the main memory on Xen, same as native. Tested on amd64-dom0.


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.297 -r1.298 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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.311 src/sys/arch/amd64/amd64/machdep.c:1.312
--- src/sys/arch/amd64/amd64/machdep.c:1.311	Sun Aug 12 09:05:52 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Aug 12 10:50:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.311 2018/08/12 09:05:52 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.312 2018/08/12 10:50:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.311 2018/08/12 09:05:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.312 2018/08/12 10:50:35 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -1592,6 +1592,9 @@ init_bootspace(void)
 void
 init_slotspace(void)
 {
+	vaddr_t slotspace_rand(int, size_t, size_t);
+	vaddr_t va;
+
 	memset(, 0, sizeof(slotspace));
 
 	/* User. */
@@ -1608,15 +1611,6 @@ init_slotspace(void)
 	slotspace.area[SLAREA_PTE].active = true;
 	slotspace.area[SLAREA_PTE].dropmax = false;
 
-#ifdef XEN
-	/* Main. */
-	slotspace.area[SLAREA_MAIN].sslot = PDIR_SLOT_KERN;
-	slotspace.area[SLAREA_MAIN].mslot = NKL4_MAX_ENTRIES;
-	slotspace.area[SLAREA_MAIN].nslot = 0 /* variable */;
-	slotspace.area[SLAREA_MAIN].active = true;
-	slotspace.area[SLAREA_MAIN].dropmax = false;
-#endif
-
 #ifdef __HAVE_PCPU_AREA
 	/* Per-CPU. */
 	slotspace.area[SLAREA_PCPU].sslot = PDIR_SLOT_PCPU;
@@ -1638,8 +1632,8 @@ init_slotspace(void)
 #ifdef XEN
 	/* Hypervisor. */
 	slotspace.area[SLAREA_HYPV].sslot = 256;
-	slotspace.area[SLAREA_HYPV].mslot = 16;
-	slotspace.area[SLAREA_HYPV].nslot = 16;
+	slotspace.area[SLAREA_HYPV].mslot = 17;
+	slotspace.area[SLAREA_HYPV].nslot = 17;
 	slotspace.area[SLAREA_HYPV].active = true;
 	slotspace.area[SLAREA_HYPV].dropmax = false;
 #endif
@@ -1651,19 +1645,13 @@ init_slotspace(void)
 	slotspace.area[SLAREA_KERN].active = true;
 	slotspace.area[SLAREA_KERN].dropmax = false;
 
-#ifndef XEN
-	vaddr_t slotspace_rand(int, size_t, size_t);
-	vaddr_t va;
-
 	/* Main. */
 	slotspace.area[SLAREA_MAIN].mslot = NKL4_MAX_ENTRIES+1;
 	slotspace.area[SLAREA_MAIN].dropmax = false;
 	va = slotspace_rand(SLAREA_MAIN, NKL4_MAX_ENTRIES * NBPD_L4,
 	NBPD_L4);
-
 	vm_min_kernel_address = va;
 	vm_max_kernel_address = va + NKL4_MAX_ENTRIES * NBPD_L4;
-#endif
 }
 
 void

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.49 src/sys/arch/amd64/include/pmap.h:1.50
--- src/sys/arch/amd64/include/pmap.h:1.49	Sun Aug 12 08:17:50 2018
+++ src/sys/arch/amd64/include/pmap.h	Sun Aug 12 10:50:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.49 2018/08/12 08:17:50 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.50 2018/08/12 10:50:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -138,12 +138,7 @@
 #define VA_SIGN_POS(va)		((va) & ~VA_SIGN_MASK)
 
 #define L4_SLOT_PTE		255
-#ifndef XEN
 #define L4_SLOT_KERN		slotspace.area[SLAREA_MAIN].sslot
-#else
-/* Xen use slots 256-272, let's move farther */
-#define L4_SLOT_KERN		320 /* pl4_i(VM_MIN_KERNEL_ADDRESS) */
-#endif
 #define L4_SLOT_KERNBASE	511 /* pl4_i(KERNBASE) */
 
 #define PDIR_SLOT_KERN	L4_SLOT_KERN

Index: src/sys/arch/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.46 src/sys/arch/amd64/include/vmparam.h:1.47
--- src/sys/arch/amd64/include/vmparam.h:1.46	Sun Aug 12 08:17:50 2018
+++ src/sys/arch/amd64/include/vmparam.h	Sun Aug 12 10:50:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.46 2018/08/12 08:17:50 maxv Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.47 2018/08/12 10:50:35 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -128,17 +128,16 @@
 #ifndef XEN
 #define VM_MIN_KERNEL_ADDRESS_DEFAULT	0x8000
 #define VM_MAX_KERNEL_ADDRESS_DEFAULT	0xa000
-extern vaddr_t vm_min_kernel_address;
-extern vaddr_t vm_max_kernel_address;
-#define VM_MIN_KERNEL_ADDRESS	vm_min_kernel_address
-#define VM_MAX_KERNEL_ADDRESS	vm_max_kernel_address
 #else
 #define VM_MIN_KERNEL_ADDRESS_DEFAULT	0xa000
 #define VM_MAX_KERNEL_ADDRESS_DEFAULT	

CVS commit: src/sys/arch

2018-08-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 12 10:50:35 UTC 2018

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

Log Message:
Randomize the main memory on Xen, same as native. Tested on amd64-dom0.


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.297 -r1.298 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.



  1   2   >