CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 06:47:54 UTC 2017

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

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.94 src/sys/net/if_vlan.c:1.95
--- src/sys/net/if_vlan.c:1.94	Fri Jan 13 06:11:56 2017
+++ src/sys/net/if_vlan.c	Mon Jan 23 06:47:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.94 2017/01/13 06:11:56 msaitoh Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.95 2017/01/23 06:47:54 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.94 2017/01/13 06:11:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.95 2017/01/23 06:47:54 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -733,7 +733,7 @@ vlan_start(struct ifnet *ifp)
 
 #ifdef ALTQ
 		/*
-		 * KERNEL_LOCK is required for ALTQ even if NET_MPSAFE if defined.
+		 * KERNEL_LOCK is required for ALTQ even if NET_MPSAFE is defined.
 		 */
 		KERNEL_LOCK(1, NULL);
 		/*



CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 06:47:54 UTC 2017

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

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/net/if_vlan.c

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



Re: CVS commit: src/sys

2017-01-22 Thread Ryota Ozaki
On Sun, Jan 22, 2017 at 7:02 AM, Nick Hudson  wrote:
> On 01/16/17 09:28, Ryo Shimizu wrote:
>>
>> Module Name:src
>> Committed By:   ryo
>> Date:   Mon Jan 16 09:28:41 UTC 2017
>>
>> Modified Files:
>> src/sys/kern: init_main.c
>> src/sys/net: pfil.c pfil.h
>> src/sys/rump/net/lib/libnet: net_component.c
>>
>> Log Message:
>> Make pfil(9) MP-safe (applying psref(9))
>
>
> My bpi/rpi (and probably other machines) don't boot after this change
>
>
> pserialize_perform's kpause never completes as softclk threads are blocked
> (forever) on softnet_lock

pserialize_perform is now disabled by default as well as other places.
I think the problem should be fixed.

Thanks,
  ozaki-r


CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 02:32:54 UTC 2017

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

Log Message:
Call pserialize_perform and psref_target_destroy only if NET_MPSAFE

They shouldn't be used with holding softnet_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/net/pfil.c

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

Modified files:

Index: src/sys/net/pfil.c
diff -u src/sys/net/pfil.c:1.33 src/sys/net/pfil.c:1.34
--- src/sys/net/pfil.c:1.33	Mon Jan 23 02:30:47 2017
+++ src/sys/net/pfil.c	Mon Jan 23 02:32:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfil.c,v 1.33 2017/01/23 02:30:47 ozaki-r Exp $	*/
+/*	$NetBSD: pfil.c,v 1.34 2017/01/23 02:32:54 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2013 Mindaugas Rasiukevicius 
@@ -28,7 +28,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.33 2017/01/23 02:30:47 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.34 2017/01/23 02:32:54 ozaki-r Exp $");
+
+#if defined(_KERNEL_OPT)
+#include "opt_net_mpsafe.h"
+#endif
 
 #include 
 #include 
@@ -230,11 +234,15 @@ pfil_list_add(pfil_listset_t *phlistset,
 	/* switch from oldlist to newlist */
 	phlistset->active = newlist;
 	membar_producer();
+#ifdef NET_MPSAFE
 	pserialize_perform(pfil_psz);
+#endif
 	mutex_exit(_mtx);
 
 	/* Wait for all readers */
+#ifdef NET_MPSAFE
 	psref_target_destroy(>psref, pfil_psref_class);
+#endif
 
 	return 0;
 }
@@ -330,11 +338,15 @@ pfil_list_remove(pfil_listset_t *phlists
 		/* switch from oldlist to newlist */
 		phlistset->active = newlist;
 		membar_producer();
+#ifdef NET_MPSAFE
 		pserialize_perform(pfil_psz);
+#endif
 		mutex_exit(_mtx);
 
 		/* Wait for all readers */
+#ifdef NET_MPSAFE
 		psref_target_destroy(>psref, pfil_psref_class);
+#endif
 
 		return 0;
 	}



CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 02:32:54 UTC 2017

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

Log Message:
Call pserialize_perform and psref_target_destroy only if NET_MPSAFE

They shouldn't be used with holding softnet_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/net/pfil.c

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



CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 02:30:47 UTC 2017

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

Log Message:
Add curlwp_bind

It is necessary for example when we use tun(4). Without it the following
panic occurs:

  panic: kernel diagnostic assertion "(kpreempt_disabled() || cpu_softintr_p() 
|| ISSET(curlwp->l_pflag, LP_BOUND))" failed: file 
"/usr/src/sys/kern/subr_psref.c", line 291 passive references are CPU-local, 
but preemption is enabled and the caller is not in a softint or CPU-bound LWP
  Backtrace:
  vpanic()
  ch_voltag_convert_in()
  psref_release()
  pfil_run_arg.isra.0()
  if_initialize()
  if_attach()
  tun_clone_create()
  tunopen()
  cdev_open()
  spec_open()
  VOP_OPEN()
  vn_open()
  do_open()
  do_sys_openat()
  sys_open()
  syscall()


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/pfil.c

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



CVS commit: src/sys/net

2017-01-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jan 23 02:30:47 UTC 2017

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

Log Message:
Add curlwp_bind

It is necessary for example when we use tun(4). Without it the following
panic occurs:

  panic: kernel diagnostic assertion "(kpreempt_disabled() || cpu_softintr_p() 
|| ISSET(curlwp->l_pflag, LP_BOUND))" failed: file 
"/usr/src/sys/kern/subr_psref.c", line 291 passive references are CPU-local, 
but preemption is enabled and the caller is not in a softint or CPU-bound LWP
  Backtrace:
  vpanic()
  ch_voltag_convert_in()
  psref_release()
  pfil_run_arg.isra.0()
  if_initialize()
  if_attach()
  tun_clone_create()
  tunopen()
  cdev_open()
  spec_open()
  VOP_OPEN()
  vn_open()
  do_open()
  do_sys_openat()
  sys_open()
  syscall()


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/pfil.c

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

Modified files:

Index: src/sys/net/pfil.c
diff -u src/sys/net/pfil.c:1.32 src/sys/net/pfil.c:1.33
--- src/sys/net/pfil.c:1.32	Mon Jan 16 09:28:40 2017
+++ src/sys/net/pfil.c	Mon Jan 23 02:30:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfil.c,v 1.32 2017/01/16 09:28:40 ryo Exp $	*/
+/*	$NetBSD: pfil.c,v 1.33 2017/01/23 02:30:47 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2013 Mindaugas Rasiukevicius 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.32 2017/01/16 09:28:40 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.33 2017/01/23 02:30:47 ozaki-r Exp $");
 
 #include 
 #include 
@@ -384,7 +384,7 @@ pfil_run_hooks(pfil_head_t *ph, struct m
 	pfil_listset_t *phlistset;
 	pfil_list_t *phlist;
 	struct psref psref;
-	int s;
+	int s, bound;
 	int ret = 0;
 
 	KASSERT(dir == PFIL_IN || dir == PFIL_OUT);
@@ -392,6 +392,7 @@ pfil_run_hooks(pfil_head_t *ph, struct m
 		return ret;
 	}
 
+	bound = curlwp_bind();
 	s = pserialize_read_enter();
 	phlist = phlistset->active;
 	membar_datadep_consumer();
@@ -406,6 +407,7 @@ pfil_run_hooks(pfil_head_t *ph, struct m
 			break;
 	}
 	psref_release(, >psref, pfil_psref_class);
+	curlwp_bindx(bound);
 
 	if (mp) {
 		*mp = m;
@@ -418,8 +420,9 @@ pfil_run_arg(pfil_listset_t *phlistset, 
 {
 	pfil_list_t *phlist;
 	struct psref psref;
-	int s;
+	int s, bound;
 
+	bound = curlwp_bind();
 	s = pserialize_read_enter();
 	phlist = phlistset->active;
 	membar_datadep_consumer();
@@ -431,6 +434,7 @@ pfil_run_arg(pfil_listset_t *phlistset, 
 		(*func)(pfh->pfil_arg, cmd, arg);
 	}
 	psref_release(, >psref, pfil_psref_class);
+	curlwp_bindx(bound);
 }
 
 void



CVS commit: src/doc

2017-01-22 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Jan 23 00:30:52 UTC 2017

Removed Files:
src/doc: ROADMAP

Log Message:
Remove ROADMAP file which was last updated 9 years ago.

Our roadmap information is now kept in src/doc/roadmaps/* -- avoid confusion
by deleting out of date information.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r0 src/doc/ROADMAP

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



CVS commit: src/doc

2017-01-22 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Jan 23 00:30:52 UTC 2017

Removed Files:
src/doc: ROADMAP

Log Message:
Remove ROADMAP file which was last updated 9 years ago.

Our roadmap information is now kept in src/doc/roadmaps/* -- avoid confusion
by deleting out of date information.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r0 src/doc/ROADMAP

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



CVS commit: src/sys/dev

2017-01-22 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jan 23 00:21:34 UTC 2017

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

Log Message:
Only call audio_initbufs and start playback if there were no errors.

Addresses PR kern/51707.


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

2017-01-22 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jan 23 00:21:34 UTC 2017

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

Log Message:
Only call audio_initbufs and start playback if there were no errors.

Addresses PR kern/51707.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.295 src/sys/dev/audio.c:1.296
--- src/sys/dev/audio.c:1.295	Sun Jan 22 19:52:02 2017
+++ src/sys/dev/audio.c	Mon Jan 23 00:21:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.295 2017/01/22 19:52:02 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.296 2017/01/23 00:21:34 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.295 2017/01/22 19:52:02 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.296 2017/01/23 00:21:34 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -4506,7 +4506,7 @@ audiosetinfo(struct audio_softc *sc, str
 	vc->sc_lastinfovalid = true;
 
 cleanup:
-	if (cleared || pausechange|| reset) {
+	if (error == 0 && (cleared || pausechange|| reset)) {
 		int init_error;
 
 		mutex_enter(sc->sc_intr_lock);



CVS commit: src/doc

2017-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 22 22:26:16 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
misc updates and consistency fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1399 -r1.1400 src/doc/3RDPARTY

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.1399 src/doc/3RDPARTY:1.1400
--- src/doc/3RDPARTY:1.1399	Sun Jan 22 09:41:19 2017
+++ src/doc/3RDPARTY	Sun Jan 22 17:26:16 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1399 2017/01/22 14:41:19 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1400 2017/01/22 22:26:16 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -375,7 +375,7 @@ which nouveau2netbsd adds them).  For th
 them!
 
 Package:	gmake
-Version:	3.81
+Version:	3.81 (Last GPlv2+ version)
 Current Vers:	4.0
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/make/
@@ -427,7 +427,7 @@ Please use "expat" as the vendor tag for
 
 Package:	file
 Version:	5.22
-Current Vers:	5.22
+Current Vers:	5.29
 Maintainer:	Christos Zoulas 
 Archive Site:	ftp://ftp.astron.com/pub/file/
 Home Page:	http://www.darwinsys.com/file/



CVS commit: src/doc

2017-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 22 22:26:16 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
misc updates and consistency fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1399 -r1.1400 src/doc/3RDPARTY

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



CVS commit: src/share/dict

2017-01-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Jan 22 21:31:21 UTC 2017

Modified Files:
src/share/dict: web2

Log Message:
Fix spelling of themself


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/dict/web2

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



CVS commit: src/share/dict

2017-01-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Jan 22 21:31:21 UTC 2017

Modified Files:
src/share/dict: web2

Log Message:
Fix spelling of themself


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/dict/web2

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

Modified files:

Index: src/share/dict/web2
diff -u src/share/dict/web2:1.21 src/share/dict/web2:1.22
--- src/share/dict/web2:1.21	Sat Jun 25 22:54:46 2016
+++ src/share/dict/web2	Sun Jan 22 21:31:20 2017
@@ -200626,7 +200626,7 @@ themer
 Themis
 themis
 Themistian
-themsel
+themself
 themselves
 then
 thenabouts



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 20:17:10 UTC 2017

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

Log Message:
Use xpmap_pg_nx. Not tested (due to some unrelated panic I'm getting), but
obvious enough.


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

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

Modified files:

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.776 src/sys/arch/i386/i386/machdep.c:1.777
--- src/sys/arch/i386/i386/machdep.c:1.776	Mon Dec 26 17:54:06 2016
+++ src/sys/arch/i386/i386/machdep.c	Sun Jan 22 20:17:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.776 2016/12/26 17:54:06 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.777 2017/01/22 20:17:10 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.776 2016/12/26 17:54:06 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.777 2017/01/22 20:17:10 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1006,11 +1006,11 @@ initgdt(union descriptor *tgdt)
 		 * which are in the callpath of pmap_kenter_pa().
 		 * So we mash up our own - this is MD code anyway.
 		 */
+		extern pt_entry_t xpmap_pg_nx;
 		pt_entry_t pte;
-		pt_entry_t pg_nx = (cpu_feature[2] & CPUID_NOX ? PG_NX : 0);
 
 		pte = pmap_pa2pte((vaddr_t)gdt - KERNBASE);
-		pte |= PG_k | PG_RO | pg_nx | PG_V;
+		pte |= PG_k | PG_RO | xpmap_pg_nx | PG_V;
 
 		if (HYPERVISOR_update_va_mapping((vaddr_t)gdt, pte, UVMF_INVLPG) < 0) {
 			panic("gdt page RO update failed.\n");
@@ -1208,11 +1208,11 @@ init386(paddr_t first_avail)
 
 	/* Reclaim the boot gdt page - see locore.s */
 	{
+		extern pt_entry_t xpmap_pg_nx;
 		pt_entry_t pte;
-		pt_entry_t pg_nx = (cpu_feature[2] & CPUID_NOX ? PG_NX : 0);
 
 		pte = pmap_pa2pte((vaddr_t)tmpgdt - KERNBASE);
-		pte |= PG_k | PG_RW | pg_nx | PG_V;
+		pte |= PG_k | PG_RW | xpmap_pg_nx | PG_V;
 
 		if (HYPERVISOR_update_va_mapping((vaddr_t)tmpgdt, pte, UVMF_INVLPG) < 0) {
 			panic("tmpgdt page relaim RW update failed.\n");



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 20:17:10 UTC 2017

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

Log Message:
Use xpmap_pg_nx. Not tested (due to some unrelated panic I'm getting), but
obvious enough.


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

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



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 20:04:35 UTC 2017

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

Log Message:
Put pmap_pg_nx into the dummy Xen page. While here, do some KNF and
localify a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/sys/arch/x86/x86/pmap.c

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



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 20:04:35 UTC 2017

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

Log Message:
Put pmap_pg_nx into the dummy Xen page. While here, do some KNF and
localify a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 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.236 src/sys/arch/x86/x86/pmap.c:1.237
--- src/sys/arch/x86/x86/pmap.c:1.236	Fri Jan  6 09:04:06 2017
+++ src/sys/arch/x86/x86/pmap.c	Sun Jan 22 20:04:35 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: pmap.c,v 1.236 2017/01/06 09:04:06 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.237 2017/01/22 20:04:35 maxv Exp $	*/
 
 /*-
- * Copyright (c) 2008, 2010, 2016 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.236 2017/01/06 09:04:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.237 2017/01/22 20:04:35 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -398,13 +398,9 @@ paddr_t avail_start __read_mostly; /* PA
 paddr_t avail_end __read_mostly; /* PA of last available physical page */
 
 #ifdef XEN
-#ifdef __x86_64__
-/* Dummy PGD for user cr3, used between pmap_deactivate() and pmap_activate() */
-static paddr_t xen_dummy_user_pgd;
-#endif /* __x86_64__ */
 paddr_t pmap_pa_start; /* PA of first physical page for this domain */
 paddr_t pmap_pa_end;   /* PA of last physical page for this domain */
-#endif /* XEN */
+#endif
 
 #define	VM_PAGE_TO_PP(pg)	(&(pg)->mdpage.mp_pp)
 
@@ -1390,10 +1386,12 @@ pmap_bootstrap(vaddr_t kva_start)
 
 #if defined(XEN) && defined(__x86_64__)
 	extern vaddr_t xen_dummy_page;
+	paddr_t xen_dummy_user_pgd;
+
 	/*
-	 * We want a dummy page directory for Xen: when deactivating a pmap, Xen
-	 * will still consider it active. So we set user PGD to this one to lift
-	 * all protection on the now inactive page tables set.
+	 * We want a dummy page directory for Xen: when deactivating a pmap,
+	 * Xen will still consider it active. So we set user PGD to this one
+	 * to lift all protection on the now inactive page tables set.
 	 */
 	xen_dummy_user_pgd = xen_dummy_page - KERNBASE;
 
@@ -1401,7 +1399,8 @@ pmap_bootstrap(vaddr_t kva_start)
 	memset((void *)(xen_dummy_user_pgd + KERNBASE), 0, PAGE_SIZE);
 	/* Mark read-only */
 	HYPERVISOR_update_va_mapping(xen_dummy_user_pgd + KERNBASE,
-	pmap_pa2pte(xen_dummy_user_pgd) | PG_u | PG_V, UVMF_INVLPG);
+	pmap_pa2pte(xen_dummy_user_pgd) | PG_u | PG_V | pmap_pg_nx,
+	UVMF_INVLPG);
 	/* Pin as L4 */
 	xpq_queue_pin_l4_table(xpmap_ptom_masked(xen_dummy_user_pgd));
 #endif



CVS commit: src/sys/dev

2017-01-22 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jan 22 19:52:02 UTC 2017

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

Log Message:
Don't call initbufs before audio_set_defaults.  It is called in
audiosetinfo anyway.

Addresses PR kern/51707.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.294 src/sys/dev/audio.c:1.295
--- src/sys/dev/audio.c:1.294	Sat Jan 21 23:37:17 2017
+++ src/sys/dev/audio.c	Sun Jan 22 19:52:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.294 2017/01/21 23:37:17 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.295 2017/01/22 19:52:02 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.294 2017/01/21 23:37:17 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.295 2017/01/22 19:52:02 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1926,8 +1926,6 @@ audio_open(dev_t dev, struct audio_softc
 		return error;
 	}
 
-	audio_initbufs(sc, n);
-
 	if (sc->sc_opens == 0) {
 		if (hw->open != NULL) {
 			mutex_enter(sc->sc_intr_lock);



CVS commit: src/sys/dev

2017-01-22 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jan 22 19:52:02 UTC 2017

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

Log Message:
Don't call initbufs before audio_set_defaults.  It is called in
audiosetinfo anyway.

Addresses PR kern/51707.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/dev/audio.c

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



CVS commit: src/doc/roadmaps

2017-01-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 22 19:47:00 UTC 2017

Modified Files:
src/doc/roadmaps: desktop

Log Message:
Mention nvidia drmkms (will be in -8, people are arguing over -7)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/doc/roadmaps/desktop

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

Modified files:

Index: src/doc/roadmaps/desktop
diff -u src/doc/roadmaps/desktop:1.3 src/doc/roadmaps/desktop:1.4
--- src/doc/roadmaps/desktop:1.3	Fri Jan 13 10:44:27 2017
+++ src/doc/roadmaps/desktop	Sun Jan 22 19:47:00 2017
@@ -1,4 +1,4 @@
-$NetBSD: desktop,v 1.3 2017/01/13 10:44:27 leot Exp $
+$NetBSD: desktop,v 1.4 2017/01/22 19:47:00 dholland Exp $
 
 NetBSD Desktop Roadmap
 ==
@@ -51,6 +51,7 @@ into one of the following three broad ca
 
 The following elements, projects, and goals are relatively near-term:
 
+ 0. dmrkms for nvidia cards (will be in -8)
  1. Don't ship twm as the default X window manager
  2. Making removable media work using GNOME/KDE infrastructure
  3. Making wireless config work using GNOME/KDE infrastructure
@@ -80,6 +81,15 @@ Explanations
 
 
 
+ 0. drmkms for nvidia cards
+
+Until recently the nvidia drmkms driver (nouveau) was disabled by
+default. This is no longer the case in -current and it is believed to
+more or less work. This change will be in -8. It might also make it
+into a future release of -7; it is not currently clear what would be
+involved in that.
+
+
  1. Don't ship twm as the default X window manager
 
 It's embarrassing that in 2016 we were still shipping twm as the



CVS commit: src/doc/roadmaps

2017-01-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 22 19:47:00 UTC 2017

Modified Files:
src/doc/roadmaps: desktop

Log Message:
Mention nvidia drmkms (will be in -8, people are arguing over -7)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/doc/roadmaps/desktop

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



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 19:42:48 UTC 2017

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

Log Message:
Import xpmap_pg_nx, and put it in the per-cpu recursive slot on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 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/xen/x86

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 19:42:48 UTC 2017

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

Log Message:
Import xpmap_pg_nx, and put it in the per-cpu recursive slot on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 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/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.105 src/sys/arch/xen/x86/cpu.c:1.106
--- src/sys/arch/xen/x86/cpu.c:1.105	Fri Nov 25 12:20:03 2016
+++ src/sys/arch/xen/x86/cpu.c	Sun Jan 22 19:42:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.105 2016/11/25 12:20:03 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.106 2017/01/22 19:42:48 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.105 2016/11/25 12:20:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.106 2017/01/22 19:42:48 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1218,20 +1218,19 @@ pmap_cpu_init_late(struct cpu_info *ci)
 	KASSERT(ci->ci_kpm_pdirpa != 0);
 
 #if defined(__x86_64__)
-	/*
-	 * Copy over the pmap_kernel() shadow L4 entries 
-	 */
+	extern pt_entry_t xpmap_pg_nx;
 
+	/* Copy over the pmap_kernel() shadow L4 entries */
 	memcpy(ci->ci_kpm_pdir, pmap_kernel()->pm_pdir, PAGE_SIZE);
 
 	/* Recursive kernel mapping */
 	ci->ci_kpm_pdir[PDIR_SLOT_PTE] = xpmap_ptom_masked(ci->ci_kpm_pdirpa)
-	| PG_k | PG_V;
+	| PG_k | PG_V | xpmap_pg_nx;
 #elif defined(PAE)
-	/* Copy over the pmap_kernel() shadow L2 entries that map the kernel */
+	/* Copy over the pmap_kernel() shadow L2 entries */
 	memcpy(ci->ci_kpm_pdir, pmap_kernel()->pm_pdir + PDIR_SLOT_KERN,
 	nkptp[PTP_LEVELS - 1] * sizeof(pd_entry_t));
-#endif /* __x86_64__ else PAE */
+#endif
 
 	/* Xen wants a RO pdir. */
 	pmap_protect(pmap_kernel(), (vaddr_t)ci->ci_kpm_pdir,



CVS commit: src/doc/roadmaps

2017-01-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 22 19:29:38 UTC 2017

Modified Files:
src/doc/roadmaps: ports

Log Message:
Restore xhci support. It is not in a release yet.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/roadmaps/ports

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



CVS commit: src/doc/roadmaps

2017-01-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 22 19:29:38 UTC 2017

Modified Files:
src/doc/roadmaps: ports

Log Message:
Restore xhci support. It is not in a release yet.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/roadmaps/ports

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

Modified files:

Index: src/doc/roadmaps/ports
diff -u src/doc/roadmaps/ports:1.4 src/doc/roadmaps/ports:1.5
--- src/doc/roadmaps/ports:1.4	Wed Jan 18 18:39:56 2017
+++ src/doc/roadmaps/ports	Sun Jan 22 19:29:38 2017
@@ -1,4 +1,4 @@
-NetBSD: ports,v 1.3 2017/01/18 18:22:13 dholland Exp $
+$NetBSD: ports,v 1.5 2017/01/22 19:29:38 dholland Exp $
 
 NetBSD Ports Roadmap
 
@@ -10,14 +10,15 @@ The following elements, projects, and go
 priorities for the project:
 
  1. EFI boot for x86
- 2. Get arm64/aarch64 working
+ 2. xhci support (done and will be in -8)
+ 3. Get arm64/aarch64 working
 
 The following elements, projects, and goals are not strategic
 priorities but are still important undertakings worth doing:
 
- 3. USER_LDT for amd64
- 4. riscv and/or or1k ports
- 5. cheri port
+ 4. USER_LDT for amd64
+ 5. riscv and/or or1k ports
+ 6. cheri port
 
 The following elements, projects, and goals are perhaps less pressing;
 this doesn't mean one shouldn't work on them but the expected payoff
@@ -41,7 +42,12 @@ it done, though it's not yet committed.
  - Contact agc for further information.
 
 
- 2. Get arm64/aarch64 working
+ 2. xhci support
+
+xhci is also critical for new x86 hardware. skrll@ says this is done;
+it will be -8.
+
+ 3. Get arm64/aarch64 working
 
 We have some arm64 code but apparently it doesn't really work yet.
 
@@ -50,7 +56,7 @@ We have some arm64 code but apparently i
  - Contact: ? (XXX)
 
 
- 3. USER_LDT for amd64
+ 4. USER_LDT for amd64
 
 The amd64 port is lacking the USER_LDT bits needed to be able to run
 Wine. Adding these bits does not seem to be a particularly large job
@@ -62,7 +68,7 @@ doesn't get done. Money's been offered i
  - Contact ? (XXX) for further information.
 
 
- 4. riscv and/or or1k ports
+ 5. riscv and/or or1k ports
 
 We have some riscv code and a bit of or1k code, but neither is done.
 
@@ -71,7 +77,7 @@ We have some riscv code and a bit of or1
  - Contact matt@ for further information.
 
 
- 5. cheri port
+ 6. cheri port
 
 http://cheri-cpu.org
 There are a number of reasons to tackle this; it will serve as a code



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 19:24:52 UTC 2017

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

Log Message:
Export xpmap_pg_nx, and put it in the page table pages. It does not change
anything, since Xen removes the X bit on these; but it is better for
consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/xen/x86/x86_xpmap.c

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



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

2017-01-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 22 19:24:52 UTC 2017

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

Log Message:
Export xpmap_pg_nx, and put it in the page table pages. It does not change
anything, since Xen removes the X bit on these; but it is better for
consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/xen/x86/x86_xpmap.c

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

Modified files:

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.69 src/sys/arch/xen/x86/x86_xpmap.c:1.70
--- src/sys/arch/xen/x86/x86_xpmap.c:1.69	Fri Jan  6 08:32:26 2017
+++ src/sys/arch/xen/x86/x86_xpmap.c	Sun Jan 22 19:24:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.69 2017/01/06 08:32:26 maxv Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.70 2017/01/22 19:24:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert 
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.69 2017/01/06 08:32:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.70 2017/01/22 19:24:51 maxv Exp $");
 
 #include "opt_xen.h"
 #include "opt_ddb.h"
@@ -105,6 +105,8 @@ unsigned long *xpmap_phys_to_machine_map
 kmutex_t pte_lock;
 vaddr_t xen_dummy_page;
 
+pt_entry_t xpmap_pg_nx;
+
 void xen_failsafe_handler(void);
 
 #define HYPERVISOR_mmu_update_self(req, count, success_count) \
@@ -609,6 +611,7 @@ xen_locore(void)
 {
 	size_t count, oldcount, mapsize;
 	vaddr_t bootstrap_tables, init_tables;
+	u_int descs[4];
 
 	xen_init_features();
 
@@ -617,6 +620,10 @@ xen_locore(void)
 	xpmap_phys_to_machine_mapping =
 	(unsigned long *)xen_start_info.mfn_list;
 
+	/* Set the NX/XD bit, if available. descs[3] = %edx. */
+	x86_cpuid(0x8001, descs);
+	xpmap_pg_nx = (descs[3] & CPUID_NOX) ? PG_NX : 0;
+
 	/* Space after Xen boostrap tables should be free */
 	init_tables = xen_start_info.pt_base;
 	bootstrap_tables = init_tables +
@@ -738,14 +745,6 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 	extern char __data_start;
 	extern char __kernel_end;
 	extern char *early_zerop; /* from pmap.c */
-	pt_entry_t pg_nx;
-	u_int descs[4];
-
-	/*
-	 * Set the NX/XD bit, if available. descs[3] = %edx.
-	 */
-	x86_cpuid(0x8001, descs);
-	pg_nx = (descs[3] & CPUID_NOX) ? PG_NX : 0;
 
 	/*
 	 * Layout of RW area after the kernel image:
@@ -895,7 +894,7 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 			page < (vaddr_t)atdevbase + IOM_SIZE) {
 pte[pl1_pi(page)] =
 IOM_BEGIN + (page - (vaddr_t)atdevbase);
-pte[pl1_pi(page)] |= pg_nx;
+pte[pl1_pi(page)] |= xpmap_pg_nx;
 			}
 #endif
 
@@ -906,15 +905,15 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 			} else if (page >= (vaddr_t)&__rodata_start &&
 			page < (vaddr_t)&__data_start) {
 /* Map the kernel rodata R. */
-pte[pl1_pi(page)] |= PG_RO | pg_nx;
+pte[pl1_pi(page)] |= PG_RO | xpmap_pg_nx;
 			} else if (page >= old_pgd &&
 			page < old_pgd + (old_count * PAGE_SIZE)) {
 /* Map the old page tables R. */
-pte[pl1_pi(page)] |= PG_RO | pg_nx;
+pte[pl1_pi(page)] |= PG_RO | xpmap_pg_nx;
 			} else if (page >= new_pgd &&
 			page < new_pgd + ((new_count + l2_4_count) * PAGE_SIZE)) {
 /* Map the new page tables R. */
-pte[pl1_pi(page)] |= PG_RO | pg_nx;
+pte[pl1_pi(page)] |= PG_RO | xpmap_pg_nx;
 #ifdef i386
 			} else if (page == (vaddr_t)tmpgdt) {
 /*
@@ -928,10 +927,10 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 			} else if (page >= (vaddr_t)&__data_start &&
 			page < (vaddr_t)&__kernel_end) {
 /* Map the kernel data+bss RW. */
-pte[pl1_pi(page)] |= PG_RW | pg_nx;
+pte[pl1_pi(page)] |= PG_RW | xpmap_pg_nx;
 			} else {
 /* Map the page RW. */
-pte[pl1_pi(page)] |= PG_RW | pg_nx;
+pte[pl1_pi(page)] |= PG_RW | xpmap_pg_nx;
 			}
 
 			page += PAGE_SIZE;
@@ -962,7 +961,7 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 	addr = (u_long)pde - KERNBASE;
 	for (i = 0; i < 3; i++, addr += PAGE_SIZE) {
 		pde[PDIR_SLOT_PTE + i] = xpmap_ptom_masked(addr) | PG_k | PG_V |
-		pg_nx;
+		xpmap_pg_nx;
 	}
 
 	/* Mark tables RO, and pin L2 KERN SHADOW. */
@@ -978,11 +977,11 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 
 	/* Recursive entry in pmap_kernel(). */
 	bt_pgd[PDIR_SLOT_PTE] = xpmap_ptom_masked((paddr_t)bt_pgd - KERNBASE)
-	| PG_k | PG_RO | PG_V | pg_nx;
+	| PG_k | PG_RO | PG_V | xpmap_pg_nx;
 #ifdef __x86_64__
 	/* Recursive entry in higher-level per-cpu PD. */
 	bt_cpu_pgd[PDIR_SLOT_PTE] = xpmap_ptom_masked((paddr_t)bt_cpu_pgd - KERNBASE)
-	| PG_k | PG_RO | PG_V | pg_nx;
+	| PG_k | PG_RO | PG_V | xpmap_pg_nx;
 #endif
 
 	/* Mark tables RO */
@@ -1061,23 +1060,16 @@ xen_bootstrap_tables(vaddr_t old_pgd, va
 	xpq_flush_queue();
 }
 
-
 /*
- * Bootstrap helper functions
+ * Mark a page read-only, assuming vaddr = paddr + KERNBASE.
  */
-
-/*
- * Mark a page readonly
- * XXX: 

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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:46:20 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_usbreg.h

Log Message:
Add TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_REG and bit definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_usbreg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_usbreg.h
diff -u src/sys/arch/arm/nvidia/tegra_usbreg.h:1.1 src/sys/arch/arm/nvidia/tegra_usbreg.h:1.2
--- src/sys/arch/arm/nvidia/tegra_usbreg.h:1.1	Wed Oct 21 20:02:12 2015
+++ src/sys/arch/arm/nvidia/tegra_usbreg.h	Sun Jan 22 17:46:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_usbreg.h,v 1.1 2015/10/21 20:02:12 jmcneill Exp $ */
+/* $NetBSD: tegra_usbreg.h,v 1.2 2017/01/22 17:46:20 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -75,6 +75,15 @@
 #define TEGRA_EHCI_PHY_VBUS_SENSORS_B_VLD_SW_VALUE __BIT(12)
 #define TEGRA_EHCI_PHY_VBUS_SENSORS_B_VLD_SW_EN	__BIT(11)
 
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_REG	0x408
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_PU		__BIT(6)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_DEB_SEL_B	__BIT(5)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_SW_VALUE	__BIT(4)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_SW_EN		__BIT(3)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_STS		__BIT(2)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_CHG_DET	__BIT(1)
+#define TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_ID_INT_EN		__BIT(0)
+
 #define TEGRA_EHCI_UTMIP_XCVR_CFG0_REG		0x808
 #define TEGRA_EHCI_UTMIP_XCVR_CFG0_HSSLEW_MSB	__BITS(31,25)
 #define TEGRA_EHCI_UTMIP_XCVR_CFG0_SETUP_MSB	__BITS(24,22)



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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:46:20 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_usbreg.h

Log Message:
Add TEGRA_EHCI_PHY_VBUS_WAKEUP_ID_REG and bit definitions.


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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:43:23 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_mcreg.h

Log Message:
Add some SMMU registers and bit definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_mcreg.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/arm/nvidia

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:43:23 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_mcreg.h

Log Message:
Add some SMMU registers and bit definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_mcreg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_mcreg.h
diff -u src/sys/arch/arm/nvidia/tegra_mcreg.h:1.2 src/sys/arch/arm/nvidia/tegra_mcreg.h:1.3
--- src/sys/arch/arm/nvidia/tegra_mcreg.h:1.2	Sat Nov 21 16:48:33 2015
+++ src/sys/arch/arm/nvidia/tegra_mcreg.h	Sun Jan 22 17:43:23 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_mcreg.h,v 1.2 2015/11/21 16:48:33 jakllsch Exp $ */
+/* $NetBSD: tegra_mcreg.h,v 1.3 2017/01/22 17:43:23 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -78,4 +78,12 @@
 #define MC_EMEM_CFG_0_EMEM_BOM		__BIT(31)
 #define MC_EMEM_CFG_0_EMEM_SIZE_MB	__BITS(13,0)
 
+#define MC_SMMU_TRANSLATION_ENABLE_0_REG	0x228
+#define MC_SMMU_AFIR_ENABLE	__BIT(14)
+#define MC_SMMU_TRANSLATION_ENABLE_1_REG	0x22c
+#define MC_SMMU_AFIW_ENABLE	__BIT(17)
+#define MC_SMMU_TRANSLATION_ENABLE_2_REG	0x230
+#define MC_SMMU_TRANSLATION_ENABLE_3_REG	0x234
+#define MC_SMMU_AFI_ASID_REG	0x238
+
 #endif /* _ARM_TEGRA_MCREG_H */



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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:40:06 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_carreg.h

Log Message:
Whitespace adjustment.


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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:40:06 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_carreg.h

Log Message:
Whitespace adjustment.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra124_carreg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra124_carreg.h
diff -u src/sys/arch/arm/nvidia/tegra124_carreg.h:1.4 src/sys/arch/arm/nvidia/tegra124_carreg.h:1.5
--- src/sys/arch/arm/nvidia/tegra124_carreg.h:1.4	Sun Jan 22 17:39:18 2017
+++ src/sys/arch/arm/nvidia/tegra124_carreg.h	Sun Jan 22 17:40:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_carreg.h,v 1.4 2017/01/22 17:39:18 jakllsch Exp $ */
+/* $NetBSD: tegra124_carreg.h,v 1.5 2017/01/22 17:40:06 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -473,7 +473,7 @@
 #define CAR_UTMIP_PLL_CFG1_ENABLE_DLY_COUNT	__BITS(31,27)
 #define CAR_UTMIP_PLL_CFG1_PLLU_POWERUP		__BIT(17)
 #define CAR_UTMIP_PLL_CFG1_PLLU_POWERDOWN	__BIT(16)
-#define CAR_UTMIP_PLL_CFG1_PLL_ENABLE_POWERUP 	__BIT(15)
+#define CAR_UTMIP_PLL_CFG1_PLL_ENABLE_POWERUP	__BIT(15)
 #define CAR_UTMIP_PLL_CFG1_PLL_ENABLE_POWERDOWN	__BIT(14)
 #define CAR_UTMIP_PLL_CFG1_XTAL_FREQ_COUNT	__BITS(11,0)
 



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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:39:18 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_carreg.h

Log Message:
Define bits in CAR_PLLP_OUTA_REG.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra124_carreg.h

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra124_carreg.h
diff -u src/sys/arch/arm/nvidia/tegra124_carreg.h:1.3 src/sys/arch/arm/nvidia/tegra124_carreg.h:1.4
--- src/sys/arch/arm/nvidia/tegra124_carreg.h:1.3	Thu Sep  8 00:38:23 2016
+++ src/sys/arch/arm/nvidia/tegra124_carreg.h	Sun Jan 22 17:39:18 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_carreg.h,v 1.3 2016/09/08 00:38:23 jakllsch Exp $ */
+/* $NetBSD: tegra124_carreg.h,v 1.4 2017/01/22 17:39:18 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -54,6 +54,14 @@
 #define CAR_PLLP_BASE_DIVM		__BITS(4,0)
 
 #define CAR_PLLP_OUTA_REG	0xa4
+#define CAR_PLLP_OUTA_OUT2_RATIO	__BITS(31,24)
+#define CAR_PLLP_OUTA_OUT2_OVRRIDE	__BIT(18)
+#define CAR_PLLP_OUTA_OUT2_CLKEN	__BIT(17)
+#define CAR_PLLP_OUTA_OUT2_RSTN		__BIT(16)
+#define CAR_PLLP_OUTA_OUT1_RATIO	__BITS(15,8)
+#define CAR_PLLP_OUTA_OUT1_OVRRIDE	__BIT(2)
+#define CAR_PLLP_OUTA_OUT1_CLKEN	__BIT(1)
+#define CAR_PLLP_OUTA_OUT1_RSTN		__BIT(0)
 #define CAR_PLLP_OUTB_REG	0xa8
 #define CAR_PLLP_OUTB_OUT4_RATIO	__BITS(31,24)
 #define CAR_PLLP_OUTB_OUT4_OVRRIDE	__BIT(18)



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

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:39:18 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_carreg.h

Log Message:
Define bits in CAR_PLLP_OUTA_REG.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra124_carreg.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/shark/ofw

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:27:31 UTC 2017

Modified Files:
src/sys/arch/shark/ofw: igsfb_ofbus.c

Log Message:
Call OF to bring up the CyberPro if it's not the console.

Avoids igsfb crash later with serial console due to
inaccessible hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/shark/ofw/igsfb_ofbus.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/shark/ofw

2017-01-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jan 22 17:27:31 UTC 2017

Modified Files:
src/sys/arch/shark/ofw: igsfb_ofbus.c

Log Message:
Call OF to bring up the CyberPro if it's not the console.

Avoids igsfb crash later with serial console due to
inaccessible hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/shark/ofw/igsfb_ofbus.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/shark/ofw/igsfb_ofbus.c
diff -u src/sys/arch/shark/ofw/igsfb_ofbus.c:1.16 src/sys/arch/shark/ofw/igsfb_ofbus.c:1.17
--- src/sys/arch/shark/ofw/igsfb_ofbus.c:1.16	Tue Jun 30 03:52:54 2015
+++ src/sys/arch/shark/ofw/igsfb_ofbus.c	Sun Jan 22 17:27:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $ */
+/*	$NetBSD: igsfb_ofbus.c,v 1.17 2017/01/22 17:27:31 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.17 2017/01/22 17:27:31 jakllsch Exp $");
 
 #include 
 #include 
@@ -133,8 +133,17 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot
 	stdout_ihandle = of_decode_int((void *)_ihandle);
 	stdout_phandle = OF_instance_to_package(stdout_ihandle);
 
-	if (stdout_phandle != igs_node)
+	if (stdout_phandle != igs_node) {
+		/*
+		 * If we aren't the boot console, the CyberPro probably
+		 * hasn't been brought up yet.  Bring it up now, it's
+		 * still early enough to do so.
+		 */
+		const int handle = OF_open("/vlbus/display");
+		if (handle != -1)
+			OF_close(handle);
 		return ENXIO;
+	}
 
 	/* ok, now setup and attach the console */
 	dc = _console_dc;



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

2017-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 22 17:19:32 UTC 2017

Modified Files:
src/sys/arch/evbarm/gumstix: gxio.c

Log Message:
PR/51905: GXIO Expension boards arn't configured if GXIO_DEFAULT_EXPANSION
isn't defined. Fix a bunch of issues with the original code.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/gumstix/gxio.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/gumstix/gxio.c
diff -u src/sys/arch/evbarm/gumstix/gxio.c:1.24 src/sys/arch/evbarm/gumstix/gxio.c:1.25
--- src/sys/arch/evbarm/gumstix/gxio.c:1.24	Fri Oct 28 15:00:48 2016
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sun Jan 22 12:19:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $ */
+/*	$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -88,7 +88,7 @@ CFATTACH_DECL_NEW(gxio, sizeof(struct gx
 #endif
 
 void gxio_config(void);
-void gxio_config_expansion(char *);
+void gxio_config_expansion(const char *);
 #if defined(GUMSTIX)
 static void basix_config(void);
 static void cfstix_config(void);
@@ -662,48 +662,54 @@ gxio_config(void)
 }
 #endif
 
-void
-gxio_config_expansion(char *expansion)
+static int
+gxio_find_default_expansion(void)
 {
-	int i, d, s;
-
-	if (expansion == NULL) {
-		printf("not specified 'expansion=' in the boot args.\n");
-		s = -1;
-	} else {
-		for (i = 0; gxioconflist[i].name != NULL; i++)
-			if (strncasecmp(gxioconflist[i].name, expansion,
-	strlen(gxioconflist[i].name) + 1) == 0)
-break;
-		if (gxioconflist[i].name == NULL)
-			printf("unknown expansion specified: %s\n", expansion);
-		s = i;
-	}
 #ifdef GXIO_DEFAULT_EXPANSION
+	int i;
+
+	/* Find out the default expansion */
 	for (i = 0; gxioconflist[i].name != NULL; i++)
 		if (strncasecmp(gxioconflist[i].name, GXIO_DEFAULT_EXPANSION,
-	strlen(gxioconflist[i].name) + 1) == 0)
+		strlen(gxioconflist[i].name) + 1) == 0)
 			break;
-	d = i;
+	return gxioconflist[i].name == NULL ? -1 : i;
 #else
-	d = -1;
+	return -1;
 #endif
+}
+
+void
+gxio_config_expansion(const char *expansion)
+{
+	int i, d;
+
+	d = gxio_find_default_expansion();
+
+	/* Print information about expansions */
 	printf("supported expansions:\n");
 	for (i = 0; gxioconflist[i].name != NULL; i++)
-		printf("  %s%s\n",
-		gxioconflist[i].name,
+		printf("  %s%s\n", gxioconflist[i].name,
 		i == d ? " (DEFAULT)" : "");
 
-	if (s < 0 || gxioconflist[i].name == NULL) {
-#ifdef GXIO_DEFAULT_EXPANSION
-		expansion = __UNCONST(GXIO_DEFAULT_EXPANSION);
-#else
-		return;
-#endif
+	
+	if (expansion == NULL) {
+		printf("not specified 'expansion=' in the boot args.\n");
+		i = -1;
+	} else {
+		for (i = 0; gxioconflist[i].name != NULL; i++)
+			if (strncasecmp(gxioconflist[i].name, expansion,
+			strlen(gxioconflist[i].name) + 1) == 0)
+break;
+		if (gxioconflist[i].name == NULL) {
+			printf("unknown expansion specified: %s\n", expansion);
+			i = -1;
+		}
 	}
 
+	/* Do some magic stuff for PEPPER */
 #if defined(PEPPER)
-	if (s < 0) {
+	if (i < 0) {
 		struct pepper_board_id {
 			unsigned int device_vendor;
 #define GUMSTIX_PEPPER  0x3200	/* 1st gen */
@@ -730,10 +736,29 @@ gxio_config_expansion(char *expansion)
 	}
 #endif
 
-	printf("configure %s expansion (%s)\n",
-	(s < 0 || gxioconflist[i].name == NULL) ? "default" : "specified",
-	expansion);
-	gxioconflist[(s < 0 || gxioconflist[i].name == NULL) ? d : s].config();
+	/*
+	 * Now proceed to configure the default expansion if one was
+	 * specified (and found) or return.
+	 */
+	const char *toconfigure;
+	if (i < 0) {
+#ifdef GXIO_DEFAULT_EXPANSION
+		if (d == -1) {
+			printf("default expansion (%s) not found\n", 
+			GXIO_DEFAULT_EXPANSION);
+			return;
+		}
+		expansion = GXIO_DEFAULT_EXPANSION;
+		i = d;
+		toconfigure = "default";
+#else
+		return;
+#endif
+	} else
+		toconfigure = "specified";
+
+	printf("configure %s expansion (%s)\n", toconfigure, expansion);
+	gxioconflist[i].config();
 }
 
 



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

2017-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 22 17:19:32 UTC 2017

Modified Files:
src/sys/arch/evbarm/gumstix: gxio.c

Log Message:
PR/51905: GXIO Expension boards arn't configured if GXIO_DEFAULT_EXPANSION
isn't defined. Fix a bunch of issues with the original code.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/gumstix/gxio.c

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



CVS commit: src/doc

2017-01-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 22 14:41:19 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
gdb-7.12.1 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1398 -r1.1399 src/doc/3RDPARTY

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.1398 src/doc/3RDPARTY:1.1399
--- src/doc/3RDPARTY:1.1398	Mon Jan 16 23:22:19 2017
+++ src/doc/3RDPARTY	Sun Jan 22 14:41:19 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1398 2017/01/16 23:22:19 snj Exp $
+#	$NetBSD: 3RDPARTY,v 1.1399 2017/01/22 14:41:19 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -484,7 +484,7 @@ Before importing a new version of extern
 
 Package:	gdb
 Version:	7.12
-Current Vers:	7.12
+Current Vers:	7.12.1
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gdb/
 Home Page:	http://www.gnu.org/software/gdb/



CVS commit: src/doc

2017-01-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 22 14:41:19 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
gdb-7.12.1 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1398 -r1.1399 src/doc/3RDPARTY

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