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

2020-01-25 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 26 06:51:06 UTC 2020

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

Log Message:
enable bwfm at sdio.

known to now work on pinebook pro and banana pi m2 zero.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.134 -r1.135 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/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.71 src/sys/arch/evbarm/conf/GENERIC:1.72
--- src/sys/arch/evbarm/conf/GENERIC:1.71	Sat Jan 25 12:26:58 2020
+++ src/sys/arch/evbarm/conf/GENERIC	Sun Jan 26 06:51:06 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.71 2020/01/25 12:26:58 jmcneill Exp $
+#	$NetBSD: GENERIC,v 1.72 2020/01/26 06:51:06 mrg Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -640,6 +640,7 @@ ld1 		at sdmmc1
 ld2 		at sdmmc2
 ld3 		at sdmmc3
 ld* 		at sdmmc?
+bwfm*		at sdmmc?		# Broadcom BCM43xxx WiFi Interface
 
 # NAND Flash
 sunxinand* 	at fdt?			# Allwinner NAND flash controller

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.134 src/sys/arch/evbarm/conf/GENERIC64:1.135
--- src/sys/arch/evbarm/conf/GENERIC64:1.134	Sat Jan 25 12:26:58 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Jan 26 06:51:06 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.134 2020/01/25 12:26:58 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.135 2020/01/26 06:51:06 mrg Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -432,6 +432,7 @@ ld1		at sdmmc1
 ld2		at sdmmc2
 ld3		at sdmmc3
 ld*		at sdmmc?
+bwfm*		at sdmmc?		# Broadcom BCM43xxx WiFi Interface
 
 # SATA
 ahcisata*	at fdt?			# AHCI SATA



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

2020-01-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 26 06:50:19 UTC 2020

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

Log Message:
Add builtin WiFi and Bluetooth.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/evbarm/conf/RPI

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/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.88 src/sys/arch/evbarm/conf/RPI:1.89
--- src/sys/arch/evbarm/conf/RPI:1.88	Sun Jan 19 01:25:04 2020
+++ src/sys/arch/evbarm/conf/RPI	Sun Jan 26 06:50:18 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.88 2020/01/19 01:25:04 thorpej Exp $
+#	$NetBSD: RPI,v 1.89 2020/01/26 06:50:18 mlelstv Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -134,6 +134,7 @@ bcmsdhost* 	at fdt?
 sdmmc* 		at bcmsdhost?
 
 ld* at sdmmc?
+bwfm*   at  sdmmc?
 
 # On-board USB
 dwctwo* 	at fdt?
@@ -238,7 +239,6 @@ pseudo-device	wsfont
 # local configuration
 cinclude "arch/evbarm/conf/RPI.local"
 
-# Bluetooth serial UART devices
-pseudo-device btuart
-pseudo-device bcsp
-pseudo-device bthfive
+# Bluetooth devices
+include "dev/bluetooth/bluetoothdevices.config"
+



CVS commit: src/doc

2020-01-25 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Sun Jan 26 02:55:47 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
Update current version of BIND and ISC DHCP.


To generate a diff of this commit:
cvs rdiff -u -r1.1686 -r1.1687 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.1686 src/doc/3RDPARTY:1.1687
--- src/doc/3RDPARTY:1.1686	Thu Jan 23 02:57:25 2020
+++ src/doc/3RDPARTY	Sun Jan 26 02:55:47 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1686 2020/01/23 02:57:25 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1687 2020/01/26 02:55:47 taca Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -121,7 +121,7 @@ bc includes dc, both of which are in the
 
 Package:	bind [named and utils]
 Version:	9.14.8/MPL
-Current Vers:	9.14.8/MPL
+Current Vers:	9.14.10/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/
@@ -311,7 +311,7 @@ src/lib/libc/db/db2netbsd.
 
 Package:	dhcp
 Version:	4.4.1
-Current Vers:	4.4.1
+Current Vers:	4.4.2
 Maintainer:	mellon
 Archive Site:	ftp://ftp.isc.org/isc/dhcp/
 Home Page:	http://www.isc.org/software/dhcp/



CVS commit: src/sys/ddb

2020-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 26 01:42:55 UTC 2020

Modified Files:
src/sys/ddb: db_output.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/ddb/db_output.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/ddb/db_output.c
diff -u src/sys/ddb/db_output.c:1.35 src/sys/ddb/db_output.c:1.36
--- src/sys/ddb/db_output.c:1.35	Thu Sep 12 18:43:02 2019
+++ src/sys/ddb/db_output.c	Sun Jan 26 01:42:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_output.c,v 1.35 2019/09/12 18:43:02 uwe Exp $	*/
+/*	$NetBSD: db_output.c,v 1.36 2020/01/26 01:42:55 uwe Exp $	*/
 
 /*
  * Mach Operating System
@@ -35,7 +35,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_output.c,v 1.35 2019/09/12 18:43:02 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_output.c,v 1.36 2020/01/26 01:42:55 uwe Exp $");
 
 #include 
 #include 
@@ -105,7 +105,7 @@ db_force_whitespace(void)
 
 
 /*
- * End the current line if we it exceeds $maxwidth
+ * End the current line if it exceeds $maxwidth
  */
 static void
 db_check_wrap(void)



CVS commit: [ad-namecache] src/sys

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 21:45:00 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: kern_rwlock.c kern_synch.c
src/sys/rump/include/rump [ad-namecache]: rump_namei.h
src/sys/sys [ad-namecache]: rwlock.h

Log Message:
Remove unintentional differences to base.


To generate a diff of this commit:
cvs rdiff -u -r1.59.2.4 -r1.59.2.5 src/sys/kern/kern_rwlock.c
cvs rdiff -u -r1.334.2.3 -r1.334.2.4 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.37.2.3 -r1.37.2.4 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.12.2.2 -r1.12.2.3 src/sys/sys/rwlock.h

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

Modified files:

Index: src/sys/kern/kern_rwlock.c
diff -u src/sys/kern/kern_rwlock.c:1.59.2.4 src/sys/kern/kern_rwlock.c:1.59.2.5
--- src/sys/kern/kern_rwlock.c:1.59.2.4	Wed Jan 22 11:40:17 2020
+++ src/sys/kern/kern_rwlock.c	Sat Jan 25 21:45:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rwlock.c,v 1.59.2.4 2020/01/22 11:40:17 ad Exp $	*/
+/*	$NetBSD: kern_rwlock.c,v 1.59.2.5 2020/01/25 21:45:00 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.59.2.4 2020/01/22 11:40:17 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.59.2.5 2020/01/25 21:45:00 ad Exp $");
 
 #include "opt_lockdebug.h"
 
@@ -206,15 +206,10 @@ void
 _rw_init(krwlock_t *rw, uintptr_t return_address)
 {
 
-#ifdef LOCKDEBUG
-	/* XXX only because the assembly stubs can't handle RW_NODEBUG */
 	if (LOCKDEBUG_ALLOC(rw, _lockops, return_address))
 		rw->rw_owner = 0;
 	else
 		rw->rw_owner = RW_NODEBUG;
-#else
-	rw->rw_owner = 0;
-#endif
 }
 
 void
@@ -650,7 +645,7 @@ rw_downgrade(krwlock_t *rw)
 			RW_ASSERT(rw, (rw->rw_owner & RW_HAS_WAITERS) != 0);
 
 			newown = owner & RW_NODEBUG;
-			newown |= RW_READ_INCR | RW_HAS_WAITERS |
+			newown = RW_READ_INCR | RW_HAS_WAITERS |
 			RW_WRITE_WANTED;
 			next = rw_cas(rw, owner, newown);
 			turnstile_exit(rw);
@@ -792,26 +787,3 @@ rw_owner(wchan_t obj)
 
 	return (void *)(owner & RW_THREAD);
 }
-
-/*
- * rw_owner_running:
- *
- *	Return true if a RW lock is unheld, or write held and the owner is
- *	running on a CPU.  For the pagedaemon.
- */
-bool
-rw_owner_running(const krwlock_t *rw)
-{
-#ifdef MULTIPROCESSOR
-	uintptr_t owner;
-	bool rv;
-
-	kpreempt_disable();
-	owner = rw->rw_owner;
-	rv = (owner & RW_THREAD) == 0 || rw_oncpu(owner);
-	kpreempt_enable();
-	return rv;
-#else
-	return rw_owner(rw) == curlwp;
-#endif
-}

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.334.2.3 src/sys/kern/kern_synch.c:1.334.2.4
--- src/sys/kern/kern_synch.c:1.334.2.3	Thu Jan 23 12:17:08 2020
+++ src/sys/kern/kern_synch.c	Sat Jan 25 21:45:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.334.2.3 2020/01/23 12:17:08 ad Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.334.2.4 2020/01/25 21:45:00 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.334.2.3 2020/01/23 12:17:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.334.2.4 2020/01/25 21:45:00 ad Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -83,7 +83,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_synch.c
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.37.2.3 src/sys/rump/include/rump/rump_namei.h:1.37.2.4
--- src/sys/rump/include/rump/rump_namei.h:1.37.2.3	Fri Jan 17 21:47:36 2020
+++ src/sys/rump/include/rump/rump_namei.h	Sat Jan 25 21:45:00 2020
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.37.2.3 2020/01/17 21:47:36 ad Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.37.2.4 2020/01/25 21:45:00 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.47.2.3 2020/01/14 11:07:40 ad Exp 
+ *   from: NetBSD: namei.src,v 1.48 2020/01/08 12:04:56 ad Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_

Index: src/sys/sys/rwlock.h
diff -u src/sys/sys/rwlock.h:1.12.2.2 src/sys/sys/rwlock.h:1.12.2.3
--- src/sys/sys/rwlock.h:1.12.2.2	Wed Jan 22 11:40:17 2020
+++ src/sys/sys/rwlock.h	Sat Jan 25 21:45:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rwlock.h,v 1.12.2.2 2020/01/22 11:40:17 ad Exp $	*/
+/*	$NetBSD: rwlock.h,v 1.12.2.3 2020/01/25 21:45:00 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -63,10 +63,10 @@ typedef struct krwlock krwlock_t;
  * WRITE_LOCKED bit is clear, then the owner field is actually a count of
  * the number of readers.  The rw_owner field is laid out like so:
  *
- *  N 543210
- *  

CVS commit: src/sys/kern

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 20:29:43 UTC 2020

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

Log Message:
For secondary CPUs, the idle LWP is the first to run, and it's directly
entered from MD code without a trip through mi_switch().  Make the picture
look good in case the CPU takes an interrupt before it calls idle_loop().


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

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

Modified files:

Index: src/sys/kern/kern_idle.c
diff -u src/sys/kern/kern_idle.c:1.30 src/sys/kern/kern_idle.c:1.31
--- src/sys/kern/kern_idle.c:1.30	Wed Jan  8 17:38:42 2020
+++ src/sys/kern/kern_idle.c	Sat Jan 25 20:29:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_idle.c,v 1.30 2020/01/08 17:38:42 ad Exp $	*/
+/*	$NetBSD: kern_idle.c,v 1.31 2020/01/25 20:29:43 ad Exp $	*/
 
 /*-
  * Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.30 2020/01/08 17:38:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.31 2020/01/25 20:29:43 ad Exp $");
 
 #include 
 #include 
@@ -49,17 +49,15 @@ idle_loop(void *dummy)
 	struct schedstate_percpu *spc;
 	struct lwp *l = curlwp;
 
-	kcpuset_atomic_set(kcpuset_running, cpu_index(ci));
-	spc = >ci_schedstate;
-	ci->ci_onproc = l;
-
-	/* Update start time for this thread. */
 	lwp_lock(l);
+	spc = >ci_schedstate;
 	KASSERT(lwp_locked(l, spc->spc_lwplock));
+	kcpuset_atomic_set(kcpuset_running, cpu_index(ci));
+	/* Update start time for this thread. */
 	binuptime(>l_stime);
 	spc->spc_flags |= SPCF_RUNNING;
-	l->l_stat = LSONPROC;
-	l->l_flag |= LW_RUNNING;
+	KASSERT(l->l_stat == LSONPROC);
+	KASSERT((l->l_flag & LW_RUNNING) != 0);
 	lwp_unlock(l);
 
 	/*
@@ -114,6 +112,17 @@ create_idle_lwp(struct cpu_info *ci)
 		panic("create_idle_lwp: error %d", error);
 	lwp_lock(l);
 	l->l_flag |= LW_IDLE;
+	if (ci != lwp0.l_cpu) {
+		/*
+		 * For secondary CPUs, the idle LWP is the first to run, and
+		 * it's directly entered from MD code without a trip through
+		 * mi_switch().  Make the picture look good in case the CPU
+		 * takes an interrupt before it calls idle_loop().
+		 */
+		l->l_stat = LSONPROC;
+		l->l_flag |= LW_RUNNING;
+		ci->ci_onproc = l;
+	}
 	lwp_unlock(l);
 	ci->ci_data.cpu_idlelwp = l;
 



CVS commit: src/sys/dev

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 19:22:05 UTC 2020

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

Log Message:
defopt -> defparam (oops)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/files.audio

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/files.audio
diff -u src/sys/dev/files.audio:1.13 src/sys/dev/files.audio:1.14
--- src/sys/dev/files.audio:1.13	Sat Jan 25 12:15:35 2020
+++ src/sys/dev/files.audio	Sat Jan 25 19:22:05 2020
@@ -1,6 +1,6 @@
-#	$NetBSD: files.audio,v 1.13 2020/01/25 12:15:35 jmcneill Exp $
+#	$NetBSD: files.audio,v 1.14 2020/01/25 19:22:05 jmcneill Exp $
 
-defopt	opt_audio.h	AUDIO_BLK_MS
+defparam opt_audio.h	AUDIO_BLK_MS
 
 define	audiobus	{ }
 define	midibus		{ }



CVS commit: src/sys/arch/mips/cavium/dev

2020-01-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 25 19:20:24 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_gmx.c

Log Message:
Remove the IFETHER_DOT3STATS stuff in this driver.  ifi_dot3stats does
not exist in NetBSD's "struct if_data", and what this driver does with
it is incompatible with upcoming network stack changes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_gmx.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/mips/cavium/dev/octeon_gmx.c
diff -u src/sys/arch/mips/cavium/dev/octeon_gmx.c:1.6 src/sys/arch/mips/cavium/dev/octeon_gmx.c:1.7
--- src/sys/arch/mips/cavium/dev/octeon_gmx.c:1.6	Sun Nov 10 21:16:30 2019
+++ src/sys/arch/mips/cavium/dev/octeon_gmx.c	Sat Jan 25 19:20:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_gmx.c,v 1.6 2019/11/10 21:16:30 chs Exp $	*/
+/*	$NetBSD: octeon_gmx.c,v 1.7 2020/01/25 19:20:24 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_gmx.c,v 1.6 2019/11/10 21:16:30 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_gmx.c,v 1.7 2020/01/25 19:20:24 thorpej Exp $");
 
 #include "opt_octeon.h"
 
@@ -1080,20 +1080,10 @@ octeon_gmx_stats(struct octeon_gmx_port_
 	ifp->if_oerrors +=
 	(uint32_t)tmp + ((uint32_t)(tmp >> 32) * 16);
 	ifp->if_collisions += (uint32_t)tmp;
-#if IFETHER_DOT3STATS
-	/* dot3StatsExcessiveCollisions */
-	ifp->if_data.ifi_dot3stats.if_oexsvcols += (uint32_t)tmp;
-#endif
 
 	tmp = _GMX_PORT_RD8(sc, GMX0_TX0_STAT1);
 	ifp->if_collisions +=
 	(uint32_t)tmp + (uint32_t)(tmp >> 32);
-#if IFETHER_DOT3STATS
-	/* dot3StatsSingleCollisionFrames */
-	ifp->if_data.ifi_dot3stats.if_oscols += (uint32_t)(tmp >> 32);
-	/* dot3StatsMultipleCollisionFrames */
-	ifp->if_data.ifi_dot3stats.if_omcols += (uint32_t)tmp;
-#endif
 
 	tmp = _GMX_PORT_RD8(sc, GMX0_TX0_STAT9);
 	ifp->if_oerrors += (uint32_t)(tmp >> 32);



CVS commit: src/distrib/i386/installimage

2020-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 25 19:09:38 UTC 2020

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
grow for clang


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/distrib/i386/installimage/Makefile

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

Modified files:

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.15 src/distrib/i386/installimage/Makefile:1.16
--- src/distrib/i386/installimage/Makefile:1.15	Tue May 14 11:41:23 2019
+++ src/distrib/i386/installimage/Makefile	Sat Jan 25 14:09:38 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.15 2019/05/14 15:41:23 christos Exp $
+#	$NetBSD: Makefile,v 1.16 2020/01/25 19:09:38 christos Exp $
 
 .include 
 
 INSTIMGBASE=	NetBSD-${DISTRIBVER}-i386-install	# gives ${IMGBASE}.img
 
-INSTIMAGEMB?=	1750			# for all installation binaries
+INSTIMAGEMB?=	1790			# for all installation binaries
 
 PRIMARY_BOOT=		bootxx_ffsv1
 SECONDARY_BOOT=		boot



CVS commit: src/external/mit/xorg/lib/dri

2020-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 25 19:05:08 UTC 2020

Modified Files:
src/external/mit/xorg/lib/dri: Makefile

Log Message:
try to fix the clang build


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/external/mit/xorg/lib/dri/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/mit/xorg/lib/dri/Makefile
diff -u src/external/mit/xorg/lib/dri/Makefile:1.35 src/external/mit/xorg/lib/dri/Makefile:1.36
--- src/external/mit/xorg/lib/dri/Makefile:1.35	Sat Jan 18 19:58:14 2020
+++ src/external/mit/xorg/lib/dri/Makefile	Sat Jan 25 14:05:08 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2020/01/19 00:58:14 jmcneill Exp $
+# $NetBSD: Makefile,v 1.36 2020/01/25 19:05:08 christos Exp $
 
 # Link the mesa_dri_drivers mega driver.
 
@@ -421,6 +421,7 @@ SRCS+=	${DRI_SOURCES.${_d}}
 .PATH: ${X11SRCDIR.Mesa}/src/mesa/drivers/dri/${_d}
 .endfor
 
+
 LIBDPLIBS+=	expat		${NETBSDSRCDIR}/external/mit/expat/lib/libexpat
 LIBDPLIBS+=	m		${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+=	pthread		${NETBSDSRCDIR}/lib/libpthread
@@ -441,6 +442,8 @@ CPPFLAGS.streaming-load-memcpy.c+=	-msse
 CPPFLAGS.isl_tiled_memcpy_sse41.c+=	-msse4.1
 .endif
 
+CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=atomic-alignment :}
+
 .include "../driver.mk"
 
 .for _d in ${DRIVERS}



CVS commit: src/sys/dev/pci

2020-01-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 25 18:59:43 UTC 2020

Modified Files:
src/sys/dev/pci: files.pci
Removed Files:
src/sys/dev/pci: if_le_pci.c if_levar.h

Log Message:
Retire the le@pci attachment.  It has been superseded (and matched at a
higher priority) by the pcn(4) driver since NetBSD 1.6.


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54 -r0 src/sys/dev/pci/if_le_pci.c
cvs rdiff -u -r1.9 -r0 src/sys/dev/pci/if_levar.h

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

Modified files:

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.424 src/sys/dev/pci/files.pci:1.425
--- src/sys/dev/pci/files.pci:1.424	Mon Jan 20 18:38:17 2020
+++ src/sys/dev/pci/files.pci	Sat Jan 25 18:59:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.424 2020/01/20 18:38:17 thorpej Exp $
+#	$NetBSD: files.pci,v 1.425 2020/01/25 18:59:43 thorpej Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -183,13 +183,7 @@ file	dev/pci/if_ep_pci.c		ep_pci
 attach	ex at pci with ex_pci
 file	dev/pci/if_ex_pci.c		ex_pci
 
-# AMD am7990 (LANCE) -based Ethernet controllers
-# device declaration in sys/conf/files
-attach	le at pci with le_pci: le32
-file	dev/pci/if_le_pci.c		le_pci
-
 # AMD PCnet-PCI Ethernet controller family
-# Supersedes if_le_pci.c
 device	pcn: ether, ifnet, arp, mii
 attach	pcn at pci
 file	dev/pci/if_pcn.c		pcn



CVS commit: src/share/man/man4

2020-01-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 25 18:53:31 UTC 2020

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

Log Message:
Remove references to le@pci, and direct users to pcn(4) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man4/le.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/le.4
diff -u src/share/man/man4/le.4:1.23 src/share/man/man4/le.4:1.24
--- src/share/man/man4/le.4:1.23	Sun Aug 10 14:43:53 2008
+++ src/share/man/man4/le.4	Sat Jan 25 18:53:31 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: le.4,v 1.23 2008/08/10 14:43:53 fair Exp $
+.\"	$NetBSD: le.4,v 1.24 2020/01/25 18:53:31 thorpej Exp $
 .\"
 .\" Copyright (c) 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -34,12 +34,12 @@
 .\"	from: Header: le.4,v 1.2 92/10/13 05:31:33 leres Exp
 .\"	from: @(#)le.4	8.1 (Berkeley) 6/9/93
 .\"
-.Dd April 27, 2001
+.Dd January 25, 2020
 .Dt LE 4
 .Os
 .Sh NAME
 .Nm le
-.Nd AMD 7990, 79C90, 79C960, 79C970 LANCE Ethernet interface driver
+.Nd AMD 7990, 79C90, 79C960 LANCE Ethernet interface driver
 .Sh SYNOPSIS
 .Ss ISA boards
 .Cd "nele0 at isa? port 0x320 irq 9 drq 7# NE2100"
@@ -54,8 +54,6 @@
 .Cd "le* at depca?"
 .Ss MCA boards
 .Cd "le* at mca? slot ?  # SKNET Personal/MC2+"
-.Ss PCI boards and mainboard adapters
-.Cd "le* at pci? dev? function ?"
 .Ss TURBOchannel PMAD-A or onboard (alpha, pmax)
 .Cd "le* at tc? slot ? offset ?"
 .Ss alpha
@@ -96,15 +94,22 @@ Am7990 and Am79C90 (CMOS, pin-compatible
 .Tn LANCE
 (Local Area Network Controller - Ethernet) chip set.
 .Pp
-The
+In previous releases of
+.Nx ,
+the
 .Nm
-driver also supports PCnet-PCI cards based on the
+driver also supported PCnet-PCI cards based on the
 .Tn AMD 79c970
-chipset, which is a single-chip implementation of a
+chipset, which is a single-chip implementation of an
+Ethernet interface that has a
 .Tn LANCE
-chip and
+compatibility mode combined with a
 .Tn PCI
 bus interface.
+PCnet-PCI interfaces have been supported by the
+.Xr pcn 4
+driver since
+.Nx 1.6 .
 .Pp
 Each of the host's network addresses
 is specified at boot time with an
@@ -344,6 +349,7 @@ transmitter was turned off due to an err
 .Xr inet 4 ,
 .Xr intro 4 ,
 .Xr mca 4 ,
+.Xr pcn 4 ,
 .Xr ifconfig 8
 .Rs
 .%R "Am79C90 - CMOS Local Area Network Controller for Ethernet"



CVS commit: [ad-namecache] src/sys/kern

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 18:42:24 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_cwd.c

Log Message:
Add a missing membar to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.4.62.1 -r1.4.62.2 src/sys/kern/vfs_cwd.c

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

Modified files:

Index: src/sys/kern/vfs_cwd.c
diff -u src/sys/kern/vfs_cwd.c:1.4.62.1 src/sys/kern/vfs_cwd.c:1.4.62.2
--- src/sys/kern/vfs_cwd.c:1.4.62.1	Sat Jan 25 15:54:03 2020
+++ src/sys/kern/vfs_cwd.c	Sat Jan 25 18:42:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cwd.c,v 1.4.62.1 2020/01/25 15:54:03 ad Exp $	*/
+/*	$NetBSD: vfs_cwd.c,v 1.4.62.2 2020/01/25 18:42:24 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cwd.c,v 1.4.62.1 2020/01/25 15:54:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cwd.c,v 1.4.62.2 2020/01/25 18:42:24 ad Exp $");
 
 #include 
 #include 
@@ -183,8 +183,10 @@ cwdenter(krw_t op)
 		 * changes while the caller is pondering the cwdinfo.
 		 */
 		kpreempt_disable();
-		if (__predict_true(mutex_owner(>cwdi_lock) == NULL))
+		if (__predict_true(mutex_owner(>cwdi_lock) == NULL)) {
+			membar_consumer();
 			return cwdi;
+		}
 		kpreempt_enable();
 		mutex_enter(>cwdi_lock);
 	} else {



CVS commit: src/sys/arch

2020-01-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 25 18:38:36 UTC 2020

Modified Files:
src/sys/arch/algor/conf: P4032 P5064
src/sys/arch/alpha/conf: GENERIC INSTALL
src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0
src/sys/arch/arc/conf: GENERIC MIMORI
src/sys/arch/cats/conf: GENERIC INSTALL
src/sys/arch/cobalt/conf: GENERIC INSTALL
src/sys/arch/evbarm/conf: IXDP425 ZAO425
src/sys/arch/evbmips/conf: MALTA
src/sys/arch/evbppc/conf: PMPPC
src/sys/arch/hppa/conf: GENERIC
src/sys/arch/i386/conf: ALL GENERIC GENERIC_TINY INSTALL_FLOPPY
INSTALL_TINY XEN3PAE_DOM0
src/sys/arch/macppc/conf: GENERIC
src/sys/arch/sgimips/conf: GENERIC32_IP3x
src/sys/arch/sparc64/conf: GENERIC

Log Message:
Retire "le* at pci?" from the shipped kernel configs:
- If the config had both an le@pci and a pcn, simply remove le@pci
  (pcn would match at a higher priority anyway).
- If the config had le@pci enabled, but no pcn, change le@pci to pcn.
- If the config had le@pci commented out, but no pcn, change le@pci
  to pcn and leave it commented out.

The pcn driver supports more chips than le@pci and does DMA directly
to/from mbufs rather than memory copies.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/algor/conf/P4032
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/algor/conf/P5064
cvs rdiff -u -r1.399 -r1.400 src/sys/arch/alpha/conf/GENERIC
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/alpha/conf/INSTALL
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.559 -r1.560 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/arc/conf/GENERIC
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/arc/conf/MIMORI
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/cats/conf/INSTALL
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/cobalt/conf/GENERIC
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/cobalt/conf/INSTALL
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/conf/IXDP425
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbarm/conf/ZAO425
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/evbmips/conf/MALTA
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbppc/conf/PMPPC
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hppa/conf/GENERIC
cvs rdiff -u -r1.485 -r1.486 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1222 -r1.1223 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/i386/conf/GENERIC_TINY
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/conf/INSTALL_FLOPPY
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/i386/conf/INSTALL_TINY
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.362 -r1.363 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/sgimips/conf/GENERIC32_IP3x
cvs rdiff -u -r1.222 -r1.223 src/sys/arch/sparc64/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/algor/conf/P4032
diff -u src/sys/arch/algor/conf/P4032:1.80 src/sys/arch/algor/conf/P4032:1.81
--- src/sys/arch/algor/conf/P4032:1.80	Mon Jan 20 18:38:19 2020
+++ src/sys/arch/algor/conf/P4032	Sat Jan 25 18:38:34 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: P4032,v 1.80 2020/01/20 18:38:19 thorpej Exp $
+#	$NetBSD: P4032,v 1.81 2020/01/25 18:38:34 thorpej Exp $
 #
 # Algorithmics P-4032 kernel.
 #
@@ -7,7 +7,7 @@ include	"arch/algor/conf/std.algor"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P4032-$Revision: 1.80 $"
+#ident 		"P4032-$Revision: 1.81 $"
 
 maxusers 32
 
@@ -137,7 +137,7 @@ pci*	at	vtpbc?
 #fxp*	at	pci? dev ? function ?		# Intel EEPRO 10+/100B
 #gsip*	at	pci? dev ? function ?		# NS DP83820 Gigabit Ethernet
 #isp*	at	pci? dev ? function ?		# Qlogic ISP 10x0 SCSI
-#le*	at	pci? dev ? function ?		# PCI LANCE Ethernet (untested)
+#pcn*	at	pci? dev ? function ?		# PCnet-PCI Ethernet
 #pcib*	at	pci? dev ? function ?		# Intel PCI-ISA Bridges
 #siop*	at	pci? dev ? function ?		# Symbios 53c8xx SCSI
 #mlx*	at	pci? dev ? function ?		# Mylex DAC960 / DEC SWXCR (untested)

Index: src/sys/arch/algor/conf/P5064
diff -u src/sys/arch/algor/conf/P5064:1.91 src/sys/arch/algor/conf/P5064:1.92
--- src/sys/arch/algor/conf/P5064:1.91	Mon Jan 20 18:38:19 2020
+++ src/sys/arch/algor/conf/P5064	Sat Jan 25 18:38:34 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: P5064,v 1.91 2020/01/20 18:38:19 thorpej Exp $
+#	$NetBSD: P5064,v 1.92 2020/01/25 18:38:34 thorpej Exp $
 #
 # Algorithmics P-5064 kernel.
 #
@@ -7,7 +7,7 @@ include	"arch/algor/conf/std.algor"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P5064-$Revision: 1.91 $"
+#ident 		"P5064-$Revision: 1.92 $"
 
 maxusers 32
 
@@ -133,7 +133,7 @@ pci*	at	vtpbc?
 #fxp*	at	pci? dev ? function ?		# Intel EEPRO 10+/100B
 #gsip*	at	pci? dev ? function ?		# NS DP83820 Gigabit 

CVS commit: src/lib/libpthread

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 18:30:41 UTC 2020

Modified Files:
src/lib/libpthread: pthread_mutex.c

Log Message:
Adjustment to previous: don't call _lwp_unpark_all() with nwaiters == 0.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libpthread/pthread_mutex.c

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

Modified files:

Index: src/lib/libpthread/pthread_mutex.c
diff -u src/lib/libpthread/pthread_mutex.c:1.67 src/lib/libpthread/pthread_mutex.c:1.68
--- src/lib/libpthread/pthread_mutex.c:1.67	Sat Jan 25 17:58:28 2020
+++ src/lib/libpthread/pthread_mutex.c	Sat Jan 25 18:30:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $	*/
+/*	$NetBSD: pthread_mutex.c,v 1.68 2020/01/25 18:30:41 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.68 2020/01/25 18:30:41 ad Exp $");
 
 #include 
 #include 
@@ -529,7 +529,7 @@ pthread__mutex_unlock_slow(pthread_mutex
 			(void)_lwp_unpark(self->pt_waiters[0],
 			__UNVOLATILE(>ptm_waiters));
 		}
-	} else {
+	} else if (self->pt_nwaiters > 0) {
 		(void)_lwp_unpark_all(self->pt_waiters, self->pt_nwaiters,
 		__UNVOLATILE(>ptm_waiters));
 	}



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

2020-01-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 25 18:21:37 UTC 2020

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

Log Message:
Wrap a long line


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/fdt/cpu_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/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.31 src/sys/arch/arm/fdt/cpu_fdt.c:1.32
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.31	Sun Jan 12 09:29:18 2020
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Sat Jan 25 18:21:37 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.31 2020/01/12 09:29:18 mrg Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.32 2020/01/25 18:21:37 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.31 2020/01/12 09:29:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.32 2020/01/25 18:21:37 skrll Exp $");
 
 #include 
 #include 
@@ -310,7 +310,8 @@ arm_fdt_cpu_mpstart(void)
 
 		error = arm_fdt_cpu_enable(child, acm);
 		if (error != 0) {
-			aprint_error("%s: failed to enable CPU %#" PRIx64 "\n", __func__, mpidr);
+			aprint_error("%s: failed to enable CPU %#" PRIx64 "\n",
+			__func__, mpidr);
 			continue;
 		}
 



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

2020-01-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 25 18:18:31 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/aarch64/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/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.35 src/sys/arch/aarch64/aarch64/cpu.c:1.36
--- src/sys/arch/aarch64/aarch64/cpu.c:1.35	Mon Jan 20 12:32:04 2020
+++ src/sys/arch/aarch64/aarch64/cpu.c	Sat Jan 25 18:18:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.35 2020/01/20 12:32:04 skrll Exp $ */
+/* $NetBSD: cpu.c,v 1.36 2020/01/25 18:18:31 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.35 2020/01/20 12:32:04 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.36 2020/01/25 18:18:31 skrll Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -161,7 +161,7 @@ cpu_attach(device_t dv, cpuid_t id)
 	cpu_identify1(dv, ci);
 #if 0
 	/* already done in locore */
-	aarch64_getcacheinfo(unit); 
+	aarch64_getcacheinfo(unit);
 #endif
 	aarch64_printcacheinfo(dv);
 	cpu_identify2(dv, ci);
@@ -229,7 +229,7 @@ cpu_identify(device_t self, struct cpu_i
 	const char *m;
 
 	identify_aarch64_model(ci->ci_id.ac_midr, model, sizeof(model));
-	if (ci->ci_index == 0) { 
+	if (ci->ci_index == 0) {
 		m = cpu_getmodel();
 		if (m == NULL || *m == 0)
 			cpu_setmodel("%s", model);



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

2020-01-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 25 18:10:12 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: std.generic

Log Message:
Sort


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.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/evbarm/conf/std.generic
diff -u src/sys/arch/evbarm/conf/std.generic:1.6 src/sys/arch/evbarm/conf/std.generic:1.7
--- src/sys/arch/evbarm/conf/std.generic:1.6	Wed Nov 14 11:02:52 2018
+++ src/sys/arch/evbarm/conf/std.generic	Sat Jan 25 18:10:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic,v 1.6 2018/11/14 11:02:52 jmcneill Exp $
+#	$NetBSD: std.generic,v 1.7 2020/01/25 18:10:11 skrll Exp $
 #
 # 	generic NetBSD/evbarm with FDT support
 
@@ -26,9 +26,9 @@ options 	TPIDRPRW_IS_CURCPU
 options 	__BUS_SPACE_HAS_STREAM_METHODS
 options 	__HAVE_CPU_COUNTER
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
+options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_GENERIC_START
 options 	__HAVE_GENERIC_CPU_INITCLOCKS
-options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_PCI_CONF_HOOK
 options 	__HAVE_PCI_MSI_MSIX
 



CVS commit: src/lib/libpthread

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 18:01:28 UTC 2020

Modified Files:
src/lib/libpthread: pthread.c

Log Message:
pthread_exit(): it looks there there is at least one path through which
a thread can exit with waiters still hanging off it (cancellation when
waiting on a condvar) so deal with all/any crappy failure like that and
make sure there are never any waiters left before exiting.  Maybe of help
for:

PR: bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/lib/libpthread/pthread.c

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

Modified files:

Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.155 src/lib/libpthread/pthread.c:1.156
--- src/lib/libpthread/pthread.c:1.155	Sat Jan 25 15:41:52 2020
+++ src/lib/libpthread/pthread.c	Sat Jan 25 18:01:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.155 2020/01/25 15:41:52 ad Exp $	*/
+/*	$NetBSD: pthread.c,v 1.156 2020/01/25 18:01:28 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.155 2020/01/25 15:41:52 ad Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.156 2020/01/25 18:01:28 ad Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -621,6 +621,23 @@ pthread_resume_np(pthread_t thread)
 	return errno;
 }
 
+/*
+ * In case the thread is exiting at an inopportune time leaving waiters not
+ * awoken (because cancelled, for instance) make sure we have no waiters
+ * left.
+ */
+static void
+pthread__clear_waiters(pthread_t self)
+{
+
+	if (self->pt_nwaiters != 0) {
+		(void)_lwp_unpark_all(self->pt_waiters, self->pt_nwaiters,
+		NULL);
+		self->pt_nwaiters = 0;
+	}
+	self->pt_willpark = 0;
+}
+
 void
 pthread_exit(void *retval)
 {
@@ -658,7 +675,10 @@ pthread_exit(void *retval)
 	/* Perform cleanup of thread-specific data */
 	pthread__destroy_tsd(self);
 
-	/* Signal our exit. */
+	/*
+	 * Signal our exit.  Our stack and pthread_t won't be reused until
+	 * pthread_create() can see from kernel info that this LWP is gone.
+	 */
 	self->pt_exitval = retval;
 	if (self->pt_flags & PT_FLAG_DETACHED) {
 		self->pt_state = PT_STATE_DEAD;
@@ -670,11 +690,13 @@ pthread_exit(void *retval)
 		pthread_mutex_lock(__deadqueue_lock);
 		PTQ_INSERT_TAIL(__deadqueue, self, pt_deadq);
 		pthread_mutex_unlock(__deadqueue_lock);
+		pthread__clear_waiters(self);
 		_lwp_exit();
 	} else {
 		self->pt_state = PT_STATE_ZOMBIE;
 		pthread_cond_broadcast(>pt_joiners);
 		pthread_mutex_unlock(>pt_lock);
+		pthread__clear_waiters(self);
 		/* Note: name will be freed by the joiner. */
 		_lwp_exit();
 	}



CVS commit: src/lib/libpthread

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 17:58:28 UTC 2020

Modified Files:
src/lib/libpthread: pthread_mutex.c

Log Message:
pthread__mutex_unlock_slow(): ignore the DEFERRED bit.  It's only purpose
is to get the thread to go through the slow path.  If there are waiters,
process them there and then.  Should not affect well behaved apps.  Maybe
of help for:

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/lib/libpthread/pthread_mutex.c

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

Modified files:

Index: src/lib/libpthread/pthread_mutex.c
diff -u src/lib/libpthread/pthread_mutex.c:1.66 src/lib/libpthread/pthread_mutex.c:1.67
--- src/lib/libpthread/pthread_mutex.c:1.66	Mon Jan 13 18:22:56 2020
+++ src/lib/libpthread/pthread_mutex.c	Sat Jan 25 17:58:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_mutex.c,v 1.66 2020/01/13 18:22:56 ad Exp $	*/
+/*	$NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_mutex.c,v 1.66 2020/01/13 18:22:56 ad Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $");
 
 #include 
 #include 
@@ -466,7 +466,7 @@ NOINLINE static int
 pthread__mutex_unlock_slow(pthread_mutex_t *ptm)
 {
 	pthread_t self, owner, new;
-	int weown, error, deferred;
+	int weown, error;
 
 	pthread__error(EINVAL, "Invalid mutex",
 	ptm->ptm_magic == _PT_MUTEX_MAGIC);
@@ -474,7 +474,6 @@ pthread__mutex_unlock_slow(pthread_mutex
 	self = pthread__self();
 	owner = ptm->ptm_owner;
 	weown = (MUTEX_OWNER(owner) == (uintptr_t)self);
-	deferred = (int)((uintptr_t)owner & MUTEX_DEFERRED_BIT);
 	error = 0;
 
 	if (__SIMPLELOCK_LOCKED_P(>ptm_errorcheck)) {
@@ -516,15 +515,9 @@ pthread__mutex_unlock_slow(pthread_mutex
 			pthread__mutex_wakeup(self, ptm);
 			return 0;
 		}
+		error = 0;
 	}
 
-	/*
-	 * There were no waiters, but we may have deferred waking
-	 * other threads until mutex unlock - we must wake them now.
-	 */
-	if (!deferred)
-		return error;
-
 	if (self->pt_nwaiters == 1) {
 		/*
 		 * If the calling thread is about to block, defer



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

2020-01-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 25 16:19:30 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
A fix and an optimisation to pmap_l1tt_free
- in the !__HAVE_MM_MD_DIRECT_MAPPED_PHYS case pass UVM_KMF_WIRED so that
  the mappings are removed and the KVA is released.  Fixes the KASSERT
  seen in the automated test runs.
- in the __HAVE_MM_MD_DIRECT_MAPPED_PHYS case we can work out pa much
  easier than caling pmap_extract.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.381 src/sys/arch/arm/arm32/pmap.c:1.382
--- src/sys/arch/arm/arm32/pmap.c:1.381	Sun Jan 19 10:59:56 2020
+++ src/sys/arch/arm/arm32/pmap.c	Sat Jan 25 16:19:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.381 2020/01/19 10:59:56 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.382 2020/01/25 16:19:29 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.381 2020/01/19 10:59:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.382 2020/01/25 16:19:29 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -6627,12 +6627,13 @@ pmap_l1tt_free(struct pool *pp, void *v)
 	vaddr_t va = (vaddr_t)v;
 
 #if !defined( __HAVE_MM_MD_DIRECT_MAPPED_PHYS)
-	uvm_km_free(kernel_map, va, L1TT_SIZE, 0);
+	uvm_km_free(kernel_map, va, L1TT_SIZE, UVM_KMF_WIRED);
 #else
-	paddr_t pa;
-
-	bool ok = pmap_extract(pmap_kernel(), va, );
-	KASSERT(ok);
+#if defined(KERNEL_BASE_VOFFSET)
+	paddr_t pa = va - KERNEL_BASE_VOFFSET;
+#else
+	paddr_t pa = va - KERNEL_BASE + physical_start;
+#endif
 	const paddr_t epa = pa + L1TT_SIZE;
 
 	for (; pa < epa; pa += PAGE_SIZE) {



CVS commit: src/sys/dev/videomode

2020-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jan 25 15:59:11 UTC 2020

Modified Files:
src/sys/dev/videomode: edid.c

Log Message:
Fix uninitialized variable. There may not be a TYPE_ASCII block. Found by
kMSan with nouveau.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/videomode/edid.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/videomode/edid.c
diff -u src/sys/dev/videomode/edid.c:1.14 src/sys/dev/videomode/edid.c:1.15
--- src/sys/dev/videomode/edid.c:1.14	Tue Jul 10 01:44:30 2018
+++ src/sys/dev/videomode/edid.c	Sat Jan 25 15:59:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: edid.c,v 1.14 2018/07/10 01:44:30 macallan Exp $ */
+/* $NetBSD: edid.c,v 1.15 2020/01/25 15:59:11 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */ 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: edid.c,v 1.14 2018/07/10 01:44:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edid.c,v 1.15 2020/01/25 15:59:11 maxv Exp $");
 
 #include 
 #include 
@@ -467,6 +467,7 @@ edid_block(struct edid_info *edid, uint8
 		break;
 
 	case EDID_DESC_BLOCK_TYPE_ASCII:
+		memset(edid->edid_comment, 0, sizeof(edid->edid_comment));
 		memcpy(edid->edid_comment, data + EDID_DESC_ASCII_DATA_OFFSET,
 		EDID_DESC_ASCII_DATA_LEN);
 		edid->edid_comment[sizeof(edid->edid_comment) - 1] = 0;
@@ -562,6 +563,8 @@ edid_parse(uint8_t *data, struct edid_in
 	snprintf(edid->edid_serial, sizeof(edid->edid_serial), "%08x",
 	EDID_SERIAL_NUMBER(data));
 
+	edid->edid_comment[0] = '\0';
+
 	edid->edid_week = EDID_WEEK(data);
 	edid->edid_year = EDID_YEAR(data);
 



CVS commit: src/sys/kern

2020-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jan 25 15:55:33 UTC 2020

Modified Files:
src/sys/kern: subr_asan.c subr_msan.c

Log Message:
Actually, uio_vmspace is never NULL, the check should be against
pmap_kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_msan.c

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

Modified files:

Index: src/sys/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.16 src/sys/kern/subr_asan.c:1.17
--- src/sys/kern/subr_asan.c:1.16	Thu Oct 10 13:45:14 2019
+++ src/sys/kern/subr_asan.c	Sat Jan 25 15:55:33 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.17 2020/01/25 15:55:33 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.17 2020/01/25 15:55:33 maxv Exp $");
 
 #include 
 #include 
@@ -1077,11 +1077,11 @@ kasan_dma_sync_uio(struct uio *uio, bus_
 	struct iovec *iov;
 	int i;
 
-	if (uio->uio_vmspace != NULL)
-		return;
-
 	kasan_shadow_check((uintptr_t)uio, sizeof(struct uio), false, pc);
 
+	if (!VMSPACE_IS_KERNEL_P(uio->uio_vmspace))
+		return;
+
 	resid = uio->uio_resid;
 	iov = uio->uio_iov;
 
@@ -1233,13 +1233,15 @@ ASAN_SET_SHADOW(f8);
 void __asan_poison_stack_memory(const void *, size_t);
 void __asan_unpoison_stack_memory(const void *, size_t);
 
-void __asan_poison_stack_memory(const void *addr, size_t size)
+void
+__asan_poison_stack_memory(const void *addr, size_t size)
 {
 	size = roundup(size, KASAN_SHADOW_SCALE_SIZE);
 	kasan_shadow_Nbyte_fill(addr, size, KASAN_USE_AFTER_SCOPE);
 }
 
-void __asan_unpoison_stack_memory(const void *addr, size_t size)
+void
+__asan_unpoison_stack_memory(const void *addr, size_t size)
 {
 	kasan_shadow_Nbyte_markvalid(addr, size);
 }

Index: src/sys/kern/subr_msan.c
diff -u src/sys/kern/subr_msan.c:1.5 src/sys/kern/subr_msan.c:1.6
--- src/sys/kern/subr_msan.c:1.5	Sun Dec  8 11:53:54 2019
+++ src/sys/kern/subr_msan.c	Sat Jan 25 15:55:33 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_msan.c,v 1.5 2019/12/08 11:53:54 maxv Exp $	*/
+/*	$NetBSD: subr_msan.c,v 1.6 2020/01/25 15:55:33 maxv Exp $	*/
 
 /*
- * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.5 2019/12/08 11:53:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.6 2020/01/25 15:55:33 maxv Exp $");
 
 #include 
 #include 
@@ -1538,7 +1538,7 @@ kmsan_dma_sync_uio(struct uio *uio, bus_
 	struct iovec *iov;
 	int i;
 
-	if (uio->uio_vmspace != NULL)
+	if (!VMSPACE_IS_KERNEL_P(uio->uio_vmspace))
 		return;
 
 	resid = uio->uio_resid;



CVS commit: [ad-namecache] src/sys

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:54:04 UTC 2020

Modified Files:
src/sys/compat/netbsd32 [ad-namecache]: netbsd32_fs.c
src/sys/kern [ad-namecache]: kern_exec.c kern_proc.c uipc_usrreq.c
vfs_cwd.c vfs_getcwd.c vfs_lookup.c vfs_mount.c vfs_subr.c
vfs_syscalls.c vfs_vnode.c
src/sys/miscfs/procfs [ad-namecache]: procfs_vnops.c
src/sys/sys [ad-namecache]: filedesc.h vfs_syscalls.h

Log Message:
Make cwdinfo use mostly lockless, and largely hide the details in vfs_cwd.c.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.85.2.1 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.485.2.1 -r1.485.2.2 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.239 -r1.239.2.1 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.194 -r1.194.4.1 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.4 -r1.4.62.1 src/sys/kern/vfs_cwd.c
cvs rdiff -u -r1.53.2.3 -r1.53.2.4 src/sys/kern/vfs_getcwd.c
cvs rdiff -u -r1.212.4.8 -r1.212.4.9 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.73.2.1 -r1.73.2.2 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.478.2.2 -r1.478.2.3 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.539.2.2 -r1.539.2.3 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.105.2.5 -r1.105.2.6 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.207 -r1.207.2.1 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.65 -r1.65.2.1 src/sys/sys/filedesc.h
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/sys/vfs_syscalls.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/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.85 src/sys/compat/netbsd32/netbsd32_fs.c:1.85.2.1
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.85	Thu Sep 26 01:32:09 2019
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Jan 25 15:54:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.85.2.1 2020/01/25 15:54:03 ad Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.85.2.1 2020/01/25 15:54:03 ad Exp $");
 
 #include 
 #include 
@@ -740,13 +740,12 @@ netbsd32___getcwd(struct lwp *l, const s
 		syscallarg(char *) bufp;
 		syscallarg(size_t) length;
 	} */
-	struct proc *p = l->l_proc;
 	int error;
 	char   *path;
 	char   *bp, *bend;
 	int len = (int)SCARG(uap, length);
 	int	lenused;
-	struct	cwdinfo *cwdi;
+	struct	vnode *dvp;
 
 	if (len > MAXPATHLEN*4)
 		len = MAXPATHLEN*4;
@@ -764,11 +763,10 @@ netbsd32___getcwd(struct lwp *l, const s
 	 * limit it to N/2 vnodes for an N byte buffer.
 	 */
 #define GETCWD_CHECK_ACCESS 0x0001
-	cwdi = p->p_cwdi;
-	rw_enter(>cwdi_lock, RW_READER);
-	error = getcwd_common (cwdi->cwdi_cdir, NULL, , path, len/2,
+	dvp = cwdcdir();
+	error = getcwd_common (dvp, NULL, , path, len/2,
 			   GETCWD_CHECK_ACCESS, l);
-	rw_exit(>cwdi_lock);
+	vrele(dvp);
 
 	if (error)
 		goto out;

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.485.2.1 src/sys/kern/kern_exec.c:1.485.2.2
--- src/sys/kern/kern_exec.c:1.485.2.1	Fri Jan 17 21:47:35 2020
+++ src/sys/kern/kern_exec.c	Sat Jan 25 15:54:03 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: kern_exec.c,v 1.485.2.1 2020/01/17 21:47:35 ad Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.485.2.2 2020/01/25 15:54:03 ad Exp $	*/
 
 /*-
- * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.485.2.1 2020/01/17 21:47:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.485.2.2 2020/01/25 15:54:03 ad Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -664,7 +664,7 @@ exec_makepathbuf(struct lwp *l, const ch
 	char *path, *bp;
 	size_t len, tlen;
 	int error;
-	struct cwdinfo *cwdi;
+	struct vnode *dvp;
 
 	path = PNBUF_GET();
 	if (seg == UIO_SYSSPACE) {
@@ -690,11 +690,10 @@ exec_makepathbuf(struct lwp *l, const ch
 	memmove(bp, path, len);
 	*(--bp) = '/';
 
-	cwdi = l->l_proc->p_cwdi;
-	rw_enter(>cwdi_lock, RW_READER);
-	error = getcwd_common(cwdi->cwdi_cdir, NULL, , path, MAXPATHLEN / 2,
+	dvp = cwdcdir();
+	error = getcwd_common(dvp, NULL, , path, MAXPATHLEN / 2,
 	GETCWD_CHECK_ACCESS, l);
-	rw_exit(>cwdi_lock);
+	vrele(dvp);
 
 	if (error)
 		goto err;
@@ -,6 +1110,7 @@ static void
 emulexec(struct lwp *l, struct exec_package *epp)
 {
 	struct proc		*p = l->l_proc;
+	struct cwdinfo		*cwdi;
 
 	/* The emulation root will usually have been found when we looked
 	 * for the elf interpreter (or similar), if not look now. */
@@ -1119,9 +1119,10 @@ emulexec(struct lwp *l, struct exec_pack
 		emul_find_root(l, epp);
 
 	/* Any 

CVS commit: src

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:41:52 UTC 2020

Modified Files:
src/lib/libpthread: pthread.c
src/sys/compat/netbsd32: netbsd32_lwp.c
src/sys/kern: sys_lwp.c
src/sys/sys: lwp.h

Log Message:
- Fix a race between the kernel and libpthread, where a new thread can start
  life without its self->pt_lid being filled in.

- Fix an error path in _lwp_create().  If the new LID can't be copied out,
  then get rid of the new LWP (i.e. either succeed or fail, not both).

- Mark l_dopreempt and l_nopreempt volatile in struct lwp.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_lwp.c
cvs rdiff -u -r1.71 -r1.72 src/sys/kern/sys_lwp.c
cvs rdiff -u -r1.197 -r1.198 src/sys/sys/lwp.h

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

Modified files:

Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.154 src/lib/libpthread/pthread.c:1.155
--- src/lib/libpthread/pthread.c:1.154	Mon Jan 13 18:22:56 2020
+++ src/lib/libpthread/pthread.c	Sat Jan 25 15:41:52 2020
@@ -1,7 +1,8 @@
-/*	$NetBSD: pthread.c,v 1.154 2020/01/13 18:22:56 ad Exp $	*/
+/*	$NetBSD: pthread.c,v 1.155 2020/01/25 15:41:52 ad Exp $	*/
 
 /*-
- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
+ * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.154 2020/01/13 18:22:56 ad Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.155 2020/01/25 15:41:52 ad Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -571,10 +572,6 @@ pthread__create_tramp(void *cookie)
 	 * thrash.  May help for SMT processors.  XXX We should not
 	 * be allocating stacks on fixed 2MB boundaries.  Needs a
 	 * thread register or decent thread local storage.
-	 *
-	 * Note that we may race with the kernel in _lwp_create(),
-	 * and so pt_lid can be unset at this point, but we don't
-	 * care.
 	 */
 	(void)alloca(((unsigned)self->pt_lid & 7) << 8);
 

Index: src/sys/compat/netbsd32/netbsd32_lwp.c
diff -u src/sys/compat/netbsd32/netbsd32_lwp.c:1.19 src/sys/compat/netbsd32/netbsd32_lwp.c:1.20
--- src/sys/compat/netbsd32/netbsd32_lwp.c:1.19	Fri Apr 21 15:10:34 2017
+++ src/sys/compat/netbsd32/netbsd32_lwp.c	Sat Jan 25 15:41:52 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: netbsd32_lwp.c,v 1.19 2017/04/21 15:10:34 christos Exp $	*/
+/*	$NetBSD: netbsd32_lwp.c,v 1.20 2020/01/25 15:41:52 ad Exp $	*/
 
 /*
- *  Copyright (c) 2005, 2006, 2007 The NetBSD Foundation.
+ *  Copyright (c) 2005, 2006, 2007, 2020 The NetBSD Foundation.
  *  All rights reserved.
  *
  *  Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_lwp.c,v 1.19 2017/04/21 15:10:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_lwp.c,v 1.20 2020/01/25 15:41:52 ad Exp $");
 
 #include 
 #include 
@@ -55,7 +55,7 @@ netbsd32__lwp_create(struct lwp *l, cons
 	} */
 	struct proc *p = l->l_proc;
 	ucontext32_t *newuc = NULL;
-	lwpid_t lid;
+	lwp_t *l2;
 	int error;
 
 	KASSERT(p->p_emul->e_ucsize == sizeof(*newuc));
@@ -77,18 +77,20 @@ netbsd32__lwp_create(struct lwp *l, cons
 	const sigset_t *sigmask = newuc->uc_flags & _UC_SIGMASK ?
 	>uc_sigmask : >l_sigmask;
 
-	error = do_lwp_create(l, newuc, SCARG(uap, flags), , sigmask,
+	error = do_lwp_create(l, newuc, SCARG(uap, flags), , sigmask,
 	_INIT);
-	if (error)
+	if (error != 0)
 		goto fail;
 
-	/*
-	 * do not free ucontext in case of an error here,
-	 * the lwp will actually run and access it
-	 */
-	return copyout(, SCARG_P32(uap, new_lwp), sizeof(lid));
+	error = copyout(>l_lid, SCARG_P32(uap, new_lwp),
+	sizeof(l2->l_lid));
+	if (error != 0)
+		lwp_exit(l2);
+	else
+		lwp_start(l2, SCARG(uap, flags));
+	return error;
 
-fail:
+ fail:
 	kmem_free(newuc, sizeof(ucontext_t));
 	return error;
 }

Index: src/sys/kern/sys_lwp.c
diff -u src/sys/kern/sys_lwp.c:1.71 src/sys/kern/sys_lwp.c:1.72
--- src/sys/kern/sys_lwp.c:1.71	Sat Nov 23 19:42:52 2019
+++ src/sys/kern/sys_lwp.c	Sat Jan 25 15:41:52 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: sys_lwp.c,v 1.71 2019/11/23 19:42:52 ad Exp $	*/
+/*	$NetBSD: sys_lwp.c,v 1.72 2020/01/25 15:41:52 ad Exp $	*/
 
 /*-
- * Copyright (c) 2001, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.71 2019/11/23 19:42:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.72 2020/01/25 15:41:52 ad Exp $");
 
 #include 
 #include 
@@ -97,11 

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

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:38:24 UTC 2020

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

Log Message:
cpu_lwp_free() can be called with (l != curlwp) in error paths, so don't
detonate.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/x86/vm_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/x86/x86/vm_machdep.c
diff -u src/sys/arch/x86/x86/vm_machdep.c:1.40 src/sys/arch/x86/x86/vm_machdep.c:1.41
--- src/sys/arch/x86/x86/vm_machdep.c:1.40	Sun Jan 12 13:01:11 2020
+++ src/sys/arch/x86/x86/vm_machdep.c	Sat Jan 25 15:38:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.40 2020/01/12 13:01:11 ad Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.41 2020/01/25 15:38:24 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.40 2020/01/12 13:01:11 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.41 2020/01/25 15:38:24 ad Exp $");
 
 #include "opt_mtrr.h"
 
@@ -237,12 +237,16 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 /*
  * cpu_lwp_free is called from exit() to let machine-dependent
  * code free machine-dependent resources.  Note that this routine
- * must not block.
+ * must not block.  NB: this may be called with l != curlwp in
+ * error paths.
  */
 void
 cpu_lwp_free(struct lwp *l, int proc)
 {
 
+	if (l != curlwp)
+		return;
+
 	/* Abandon the FPU state. */
 	fpu_lwp_abandon(l);
 



CVS commit: src/sys/kern

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:12:47 UTC 2020

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

Log Message:
softint_execute(): don't hang onto the kernel_lock hold longer than
needed.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/kern_softint.c

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

Modified files:

Index: src/sys/kern/kern_softint.c
diff -u src/sys/kern/kern_softint.c:1.57 src/sys/kern/kern_softint.c:1.58
--- src/sys/kern/kern_softint.c:1.57	Wed Jan  8 17:38:42 2020
+++ src/sys/kern/kern_softint.c	Sat Jan 25 15:12:47 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: kern_softint.c,v 1.57 2020/01/08 17:38:42 ad Exp $	*/
+/*	$NetBSD: kern_softint.c,v 1.58 2020/01/25 15:12:47 ad Exp $	*/
 
 /*-
- * Copyright (c) 2007, 2008, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.57 2020/01/08 17:38:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.58 2020/01/25 15:12:47 ad Exp $");
 
 #include 
 #include 
@@ -544,7 +544,6 @@ static inline void
 softint_execute(softint_t *si, lwp_t *l, int s)
 {
 	softhand_t *sh;
-	bool havelock;
 
 #ifdef __HAVE_FAST_SOFTINTS
 	KASSERT(si->si_lwp == curlwp);
@@ -555,8 +554,6 @@ softint_execute(softint_t *si, lwp_t *l,
 	KASSERT(si->si_lwp->l_wchan == NULL);
 	KASSERT(si->si_active);
 
-	havelock = false;
-
 	/*
 	 * Note: due to priority inheritance we may have interrupted a
 	 * higher priority LWP.  Since the soft interrupt must be quick
@@ -577,17 +574,14 @@ softint_execute(softint_t *si, lwp_t *l,
 		splx(s);
 
 		/* Run the handler. */
-		if (sh->sh_flags & SOFTINT_MPSAFE) {
-			if (havelock) {
-KERNEL_UNLOCK_ONE(l);
-havelock = false;
-			}
-		} else if (!havelock) {
+		if (__predict_true((sh->sh_flags & SOFTINT_MPSAFE) != 0)) {
+			(*sh->sh_func)(sh->sh_arg);
+		} else {
 			KERNEL_LOCK(1, l);
-			havelock = true;
+			(*sh->sh_func)(sh->sh_arg);
+			KERNEL_UNLOCK_ONE(l);
 		}
-		(*sh->sh_func)(sh->sh_arg);
-
+		
 		/* Diagnostic: check that spin-locks have not leaked. */
 		KASSERTMSG(curcpu()->ci_mtx_count == 0,
 		"%s: ci_mtx_count (%d) != 0, sh_func %p\n",
@@ -603,10 +597,6 @@ softint_execute(softint_t *si, lwp_t *l,
 
 	PSREF_DEBUG_BARRIER();
 
-	if (havelock) {
-		KERNEL_UNLOCK_ONE(l);
-	}
-
 	CPU_COUNT(CPU_COUNT_NSOFT, 1);
 
 	KASSERT(si->si_cpu == curcpu());



CVS commit: src/sys/kern

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:09:54 UTC 2020

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

Log Message:
sched_takecpu(): for vfork(), when looking at curcpu's runqueue consider
maximum priority waiting to run and not count of LWPs.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/kern/kern_runq.c

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

Modified files:

Index: src/sys/kern/kern_runq.c
diff -u src/sys/kern/kern_runq.c:1.61 src/sys/kern/kern_runq.c:1.62
--- src/sys/kern/kern_runq.c:1.61	Sat Jan 18 13:53:50 2020
+++ src/sys/kern/kern_runq.c	Sat Jan 25 15:09:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.61 2020/01/18 13:53:50 ad Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.62 2020/01/25 15:09:54 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.61 2020/01/18 13:53:50 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.62 2020/01/25 15:09:54 ad Exp $");
 
 #include "opt_dtrace.h"
 
@@ -557,8 +557,8 @@ sched_takecpu(struct lwp *l)
 	 */
 	if (l->l_stat == LSIDL) {
 		if (curlwp->l_vforkwaiting && l->l_class == SCHED_OTHER) {
-			if (sched_migratable(l, curlwp->l_cpu) &&
-			curlwp->l_cpu->ci_schedstate.spc_count == 0) {
+			if (sched_migratable(l, curlwp->l_cpu) && eprio >
+			curlwp->l_cpu->ci_schedstate.spc_maxpriority) {
 return curlwp->l_cpu;
 			}
 		} else {



CVS commit: src/sys/kern

2020-01-25 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Jan 25 15:08:40 UTC 2020

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

Log Message:
- Pad kmem cache names with zeros so vmstat -m and -C are readable.
- Exclude caches with size not a factor or multiple of the coherency unit.

Proposed on tech-kern@.  Also:

Reported-by: syzbot+c024c50570cccac51...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/kern/subr_kmem.c

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

Modified files:

Index: src/sys/kern/subr_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.77 src/sys/kern/subr_kmem.c:1.78
--- src/sys/kern/subr_kmem.c:1.77	Thu Nov 14 16:23:52 2019
+++ src/sys/kern/subr_kmem.c	Sat Jan 25 15:08:40 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_kmem.c,v 1.77 2019/11/14 16:23:52 maxv Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.78 2020/01/25 15:08:40 ad Exp $	*/
 
 /*
- * Copyright (c) 2009-2015 The NetBSD Foundation, Inc.
+ * Copyright (c) 2009-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.77 2019/11/14 16:23:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.78 2020/01/25 15:08:40 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kmem.h"
@@ -105,35 +105,35 @@ struct kmem_cache_info {
 };
 
 static const struct kmem_cache_info kmem_cache_sizes[] = {
-	{  8, "kmem-8" },
-	{ 16, "kmem-16" },
-	{ 24, "kmem-24" },
-	{ 32, "kmem-32" },
-	{ 40, "kmem-40" },
-	{ 48, "kmem-48" },
-	{ 56, "kmem-56" },
-	{ 64, "kmem-64" },
-	{ 80, "kmem-80" },
-	{ 96, "kmem-96" },
-	{ 112, "kmem-112" },
-	{ 128, "kmem-128" },
-	{ 160, "kmem-160" },
-	{ 192, "kmem-192" },
-	{ 224, "kmem-224" },
-	{ 256, "kmem-256" },
-	{ 320, "kmem-320" },
-	{ 384, "kmem-384" },
-	{ 448, "kmem-448" },
-	{ 512, "kmem-512" },
-	{ 768, "kmem-768" },
-	{ 1024, "kmem-1024" },
+	{  8, "kmem-8" },
+	{ 16, "kmem-00016" },
+	{ 24, "kmem-00024" },
+	{ 32, "kmem-00032" },
+	{ 40, "kmem-00040" },
+	{ 48, "kmem-00048" },
+	{ 56, "kmem-00056" },
+	{ 64, "kmem-00064" },
+	{ 80, "kmem-00080" },
+	{ 96, "kmem-00096" },
+	{ 112, "kmem-00112" },
+	{ 128, "kmem-00128" },
+	{ 160, "kmem-00160" },
+	{ 192, "kmem-00192" },
+	{ 224, "kmem-00224" },
+	{ 256, "kmem-00256" },
+	{ 320, "kmem-00320" },
+	{ 384, "kmem-00384" },
+	{ 448, "kmem-00448" },
+	{ 512, "kmem-00512" },
+	{ 768, "kmem-00768" },
+	{ 1024, "kmem-01024" },
 	{ 0, NULL }
 };
 
 static const struct kmem_cache_info kmem_cache_big_sizes[] = {
-	{ 2048, "kmem-2048" },
-	{ 4096, "kmem-4096" },
-	{ 8192, "kmem-8192" },
+	{ 2048, "kmem-02048" },
+	{ 4096, "kmem-04096" },
+	{ 8192, "kmem-08192" },
 	{ 16384, "kmem-16384" },
 	{ 0, NULL }
 };
@@ -359,22 +359,28 @@ kmem_create_caches(const struct kmem_cac
 		pool_cache_t pc;
 		size_t align;
 
-		if ((cache_size & (CACHE_LINE_SIZE - 1)) == 0)
-			align = CACHE_LINE_SIZE;
-		else if ((cache_size & (PAGE_SIZE - 1)) == 0)
-			align = PAGE_SIZE;
-		else
-			align = KMEM_ALIGN;
-
-		if (cache_size < CACHE_LINE_SIZE)
-			flags |= PR_NOTOUCH;
-
 		/* check if we reached the requested size */
 		if (cache_size > maxsize || cache_size > PAGE_SIZE) {
 			break;
 		}
-		if ((cache_size >> shift) > maxidx) {
-			maxidx = cache_size >> shift;
+
+		/*
+		 * Exclude caches with size not a factor or multiple of the
+		 * coherency unit.
+		 */
+		if (cache_size < COHERENCY_UNIT) {
+			if (COHERENCY_UNIT % cache_size > 0) {
+				continue;
+			}
+			flags |= PR_NOTOUCH;
+			align = KMEM_ALIGN;
+		} else if ((cache_size & (PAGE_SIZE - 1)) == 0) {
+			align = PAGE_SIZE;
+		} else {
+			if ((cache_size % COHERENCY_UNIT) > 0) {
+continue;
+			}
+			align = COHERENCY_UNIT;
 		}
 
 		if ((cache_size >> shift) > maxidx) {



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

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 12:26:58 UTC 2020

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

Log Message:
Follow amd64 and set AUDIO_BLK_MS=4 by default


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.133 -r1.134 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/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.70 src/sys/arch/evbarm/conf/GENERIC:1.71
--- src/sys/arch/evbarm/conf/GENERIC:1.70	Sat Jan  4 14:53:11 2020
+++ src/sys/arch/evbarm/conf/GENERIC	Sat Jan 25 12:26:58 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.70 2020/01/04 14:53:11 skrll Exp $
+#	$NetBSD: GENERIC,v 1.71 2020/01/25 12:26:58 jmcneill Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -622,6 +622,7 @@ sun8icodec* 	at fdt?			# Audio codec (su
 sunxicodec* 	at fdt?			# Allwinner audio codec
 sunxii2s* 	at fdt?			# I2S/PCM
 audio* 		at audiobus?
+options 	AUDIO_BLK_MS=4
 spkr* 		at audio?
 
 # SDMMC

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.133 src/sys/arch/evbarm/conf/GENERIC64:1.134
--- src/sys/arch/evbarm/conf/GENERIC64:1.133	Wed Jan 15 11:36:48 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Sat Jan 25 12:26:58 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.133 2020/01/15 11:36:48 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.134 2020/01/25 12:26:58 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -471,6 +471,7 @@ h3codec*	at fdt?			# Allwinner H3 audio 
 a64acodec*	at fdt?			# Allwinner A64 audio codec (analog part)
 sunxii2s*	at fdt?			# Allwinner I2S/PCM
 audio*		at audiobus?
+options 	AUDIO_BLK_MS=4
 
 spkr*		at audio?		# PC speaker (synthesized)
 



CVS commit: src/sys/dev

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 12:15:35 UTC 2020

Modified Files:
src/sys/dev: files.audio
src/sys/dev/audio: audiodef.h

Log Message:
defopt AUDIO_BLK_MS


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/files.audio
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/audio/audiodef.h

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

Modified files:

Index: src/sys/dev/files.audio
diff -u src/sys/dev/files.audio:1.12 src/sys/dev/files.audio:1.13
--- src/sys/dev/files.audio:1.12	Wed May  8 13:40:17 2019
+++ src/sys/dev/files.audio	Sat Jan 25 12:15:35 2020
@@ -1,4 +1,6 @@
-#	$NetBSD: files.audio,v 1.12 2019/05/08 13:40:17 isaki Exp $
+#	$NetBSD: files.audio,v 1.13 2020/01/25 12:15:35 jmcneill Exp $
+
+defopt	opt_audio.h	AUDIO_BLK_MS
 
 define	audiobus	{ }
 define	midibus		{ }

Index: src/sys/dev/audio/audiodef.h
diff -u src/sys/dev/audio/audiodef.h:1.7 src/sys/dev/audio/audiodef.h:1.8
--- src/sys/dev/audio/audiodef.h:1.7	Sat Jul  6 12:58:58 2019
+++ src/sys/dev/audio/audiodef.h	Sat Jan 25 12:15:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiodef.h,v 1.7 2019/07/06 12:58:58 isaki Exp $	*/
+/*	$NetBSD: audiodef.h,v 1.8 2020/01/25 12:15:35 jmcneill Exp $	*/
 
 /*
  * Copyright (C) 2017 Tetsuya Isaki. All rights reserved.
@@ -29,6 +29,10 @@
 #ifndef _SYS_DEV_AUDIO_AUDIODEF_H_
 #define _SYS_DEV_AUDIO_AUDIODEF_H_
 
+#ifdef _KERNEL_OPT
+#include "opt_audio.h"
+#endif
+
 /* Number of HW buffer's blocks. */
 #define NBLKHW (3)
 



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

2020-01-25 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Jan 25 11:26:40 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: ad.aarch64

Log Message:
These directories may not be installed for aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/sets/lists/comp/ad.aarch64

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/comp/ad.aarch64
diff -u src/distrib/sets/lists/comp/ad.aarch64:1.35 src/distrib/sets/lists/comp/ad.aarch64:1.36
--- src/distrib/sets/lists/comp/ad.aarch64:1.35	Mon Nov 11 22:44:56 2019
+++ src/distrib/sets/lists/comp/ad.aarch64	Sat Jan 25 11:26:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ad.aarch64,v 1.35 2019/11/11 22:44:56 joerg Exp $
+# $NetBSD: ad.aarch64,v 1.36 2020/01/25 11:26:39 roy Exp $
 ./usr/include/aarch64comp-c-include
 ./usr/include/aarch64/ansi.h			comp-c-include
 ./usr/include/aarch64/aout_machdep.h		comp-c-include
@@ -130,9 +130,9 @@
 ./usr/include/evbarm64comp-obsolete		obsolete
 ./usr/include/evbarm64/disklabel.h		comp-obsolete		obsolete
 ./usr/include/evbarm64/intr.h			comp-obsolete		obsolete
-./usr/include/g++/bits/aarch64			comp-c-include
+./usr/include/g++/bits/aarch64			comp-c-include		gcc,libstdcxx,compat
 ./usr/include/g++/bits/aarch64/c++config.h	comp-c-include		gcc,libstdcxx,compat
-./usr/include/g++/bits/arm			comp-c-include
+./usr/include/g++/bits/arm			comp-c-include		gcc,libstdcxx,compat
 ./usr/include/g++/bits/arm/c++config.h		comp-c-include		gcc,libstdcxx,compat
 ./usr/include/gcc-4.8/arm_neon.h		comp-c-include		gcc=48
 ./usr/include/gcc-4.8/mmintrin.h		comp-c-include		gcc=48



CVS commit: src/sys/stand/efiboot

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 11:24:20 UTC 2020

Modified Files:
src/sys/stand/efiboot: Makefile.efiboot boot.c efiacpi.c
src/sys/stand/efiboot/bootaa64: Makefile
src/sys/stand/efiboot/bootarm: Makefile

Log Message:
Clean up the banner so it fits in 80 columns and add some extra details
to the "version" command output.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.19 -r1.20 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/efiacpi.c
cvs rdiff -u -r1.6 -r1.7 src/sys/stand/efiboot/bootaa64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/bootarm/Makefile

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

Modified files:

Index: src/sys/stand/efiboot/Makefile.efiboot
diff -u src/sys/stand/efiboot/Makefile.efiboot:1.9 src/sys/stand/efiboot/Makefile.efiboot:1.10
--- src/sys/stand/efiboot/Makefile.efiboot:1.9	Sat Nov 30 13:02:18 2019
+++ src/sys/stand/efiboot/Makefile.efiboot	Sat Jan 25 11:24:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.9 2019/11/30 13:02:18 jmcneill Exp $
+# $NetBSD: Makefile.efiboot,v 1.10 2020/01/25 11:24:20 jmcneill Exp $
 
 S=		${.CURDIR}/../../..
 
@@ -8,7 +8,7 @@ NOLIBCSANITIZER=# defined
 NOSANITIZER=	# defined
 NORELRO=	# defined
 PROG?=		boot.efi
-NEWVERSWHAT?=	"EFI Boot"
+NEWVERSWHAT?=	"efiboot"
 
 EFIDIR= ${S}/external/bsd/gnu-efi/dist
 GNUEFIARCH?= ${MACHINE_CPU}

Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.19 src/sys/stand/efiboot/boot.c:1.20
--- src/sys/stand/efiboot/boot.c:1.19	Wed Dec 18 21:46:03 2019
+++ src/sys/stand/efiboot/boot.c	Sat Jan 25 11:24:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.19 2019/12/18 21:46:03 riastradh Exp $	*/
+/*	$NetBSD: boot.c,v 1.20 2020/01/25 11:24:20 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -115,6 +115,7 @@ const struct boot_command commands[] = {
 	{ "reboot",	command_reset,		"reboot|reset" },
 	{ "reset",	command_reset,		NULL },
 	{ "version",	command_version,	"version" },
+	{ "ver",	command_version,	NULL },
 	{ "help",	command_help,		"help|?" },
 	{ "?",		command_help,		NULL },
 	{ "quit",	command_quit,		"quit" },
@@ -271,12 +272,13 @@ command_version(char *arg)
 	char *ufirmware;
 	int rv;
 
-	printf("EFI version: %d.%02d\n",
+	printf("Version: %s (%s)\n", bootprog_rev, bootprog_kernrev);
+	printf("EFI: %d.%02d\n",
 	ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0x);
 	ufirmware = NULL;
 	rv = ucs2_to_utf8(ST->FirmwareVendor, );
 	if (rv == 0) {
-		printf("EFI Firmware: %s (rev 0x%x)\n", ufirmware,
+		printf("Firmware: %s (rev 0x%x)\n", ufirmware,
 		ST->FirmwareRevision);
 		FreePool(ufirmware);
 	}
@@ -393,8 +395,8 @@ void
 print_banner(void)
 {
 	printf("\n\n"
-	">> %s, Revision %s (from NetBSD %s)\n",
-	bootprog_name, bootprog_rev, bootprog_kernrev);
+	">> %s, Revision %s\n",
+	bootprog_name, bootprog_rev);
 }
 
 static void

Index: src/sys/stand/efiboot/efiacpi.c
diff -u src/sys/stand/efiboot/efiacpi.c:1.5 src/sys/stand/efiboot/efiacpi.c:1.6
--- src/sys/stand/efiboot/efiacpi.c:1.5	Sat Nov 30 13:02:18 2019
+++ src/sys/stand/efiboot/efiacpi.c	Sat Jan 25 11:24:20 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.c,v 1.5 2019/11/30 13:02:18 jmcneill Exp $ */
+/* $NetBSD: efiacpi.c,v 1.6 2020/01/25 11:24:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,6 +34,18 @@
 #include "efifdt.h"
 #include "smbios.h"
 
+struct acpi_rdsp {
+	char signature[8];
+	uint8_t checksum;
+	char oemid[6];
+	uint8_t revision;
+	uint32_t rsdtphys;
+	uint32_t length;
+	uint64_t xsdtphys;
+	uint8_t extcsum;
+	uint8_t reserved[3];
+};
+
 #include 
 
 #define	ACPI_FDT_SIZE	(128 * 1024)
@@ -66,18 +78,6 @@ efi_acpi_available(void)
 	return acpi_root != NULL;
 }
 
-void
-efi_acpi_show(void)
-{
-	if (!efi_acpi_available())
-		return;
-
-	printf("ACPI: RSDP %p", acpi_root);
-	if (smbios3_table)
-		printf(", SMBIOS %p", smbios3_table);
-	printf("\n");
-}
-
 static char model_buf[128];
 
 static const char *
@@ -111,6 +111,22 @@ efi_acpi_get_model(void)
 	return model_buf;
 }
 
+void
+efi_acpi_show(void)
+{
+	struct acpi_rdsp *rsdp = acpi_root;
+
+	if (!efi_acpi_available())
+		return;
+
+	printf("ACPI: v%02d %c%c%c%c%c%c\n", rsdp->revision,
+	rsdp->oemid[0], rsdp->oemid[1], rsdp->oemid[2],
+	rsdp->oemid[3], rsdp->oemid[4], rsdp->oemid[5]);
+
+	if (smbios3_table)
+		printf("SMBIOS: %s", efi_acpi_get_model());
+}
+
 int
 efi_acpi_create_fdt(void)
 {

Index: src/sys/stand/efiboot/bootaa64/Makefile
diff -u src/sys/stand/efiboot/bootaa64/Makefile:1.6 src/sys/stand/efiboot/bootaa64/Makefile:1.7
--- src/sys/stand/efiboot/bootaa64/Makefile:1.6	Mon Sep 23 13:42:37 2019
+++ src/sys/stand/efiboot/bootaa64/Makefile	Sat Jan 25 11:24:20 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2019/09/23 13:42:37 christos Exp $
+# 

CVS commit: src/sys/stand/efiboot

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 10:53:13 UTC 2020

Modified Files:
src/sys/stand/efiboot: exec.c

Log Message:
Hide the twiddle while loading efiboot plist


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/exec.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/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.12 src/sys/stand/efiboot/exec.c:1.13
--- src/sys/stand/efiboot/exec.c:1.12	Wed Dec 18 21:46:03 2019
+++ src/sys/stand/efiboot/exec.c	Sat Jan 25 10:53:13 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.12 2019/12/18 21:46:03 riastradh Exp $ */
+/* $NetBSD: exec.c,v 1.13 2020/01/25 10:53:13 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -34,6 +34,8 @@
 
 #include 
 
+extern char twiddle_toggle;
+
 u_long load_offset = 0;
 
 #define	FDT_SPACE	(4 * 1024 * 1024)
@@ -127,6 +129,7 @@ load_efibootplist(bool default_fallback)
 	u_long plist_size = 0;
 	prop_dictionary_t plist = NULL, oplist = NULL;
 	bool load_quietly = false;
+	bool old_twiddle_toggle = twiddle_toggle;
 
 	const char *path = get_efibootplist_path();
 	if (path == NULL || strlen(path) == 0) {
@@ -136,6 +139,8 @@ load_efibootplist(bool default_fallback)
 		load_quietly = true;
 	}
 
+	twiddle_toggle = load_quietly;
+
 	/*
 	 * Fudge the size so we can ensure the resulting buffer
 	 * is NUL-terminated for convenience.
@@ -157,6 +162,8 @@ load_efibootplist(bool default_fallback)
 out:
 	oplist = efibootplist;
 
+	twiddle_toggle = old_twiddle_toggle;
+
 	/*
 	 * If we had a failure, create an empty one for
 	 * convenience.  But a failure should not clobber



CVS commit: src/sys/stand/efiboot

2020-01-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 25 10:09:46 UTC 2020

Modified Files:
src/sys/stand/efiboot: prompt.c

Log Message:
Fix for disappearing counters on graphics consoles


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/prompt.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/stand/efiboot/prompt.c
diff -u src/sys/stand/efiboot/prompt.c:1.5 src/sys/stand/efiboot/prompt.c:1.6
--- src/sys/stand/efiboot/prompt.c:1.5	Sun Sep 29 00:52:26 2019
+++ src/sys/stand/efiboot/prompt.c	Sat Jan 25 10:09:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: prompt.c,v 1.5 2019/09/29 00:52:26 jakllsch Exp $	*/
+/*	$NetBSD: prompt.c,v 1.6 2020/01/25 10:09:46 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997
@@ -75,23 +75,27 @@ awaitkey(int timeout, int tell)
 {
 	int i = timeout * POLL_FREQ;
 	int last_secs = -1, secs;
+	int last_len = -1, n;
+	char buf[32];
 	char c = 0;
 
 	for (;;) {
 		if (tell) {
-			char buf[32];
 			int len;
 
 			secs = (i + POLL_FREQ - 1) / POLL_FREQ;
 			if (secs != last_secs) {
-len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
-if (len > 0 && len < sizeof(buf)) {
+if (last_len != -1) {
 	char *p = buf;
-	printf("%s", buf);
-	while (*p)
+	for (n = 0; n < last_len; n++)
 		*p++ = '\b';
+	*p = '\0';
 	printf("%s", buf);
 }
+len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
+if (len > 0 && len < sizeof(buf))
+	printf("%s", buf);
+last_len = len;
 last_secs = secs;
 			}
 		}
@@ -109,8 +113,16 @@ awaitkey(int timeout, int tell)
 	}
 
 out:
-	if (tell)
+	if (tell) {
+		if (last_len != -1) {
+			char *p = buf;
+			for (n = 0; n < last_len; n++)
+*p++ = '\b';
+			*p = '\0';
+			printf("%s", buf);
+		}
 		printf("0 seconds. \n");
+	}
 
 	return c;
 }



CVS commit: src/sys/dev/pci

2020-01-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 25 08:13:39 UTC 2020

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

Log Message:
Add PCIe 4.0 stuff a little:

 - 10-bit Tag Requester/Completer.
 - Add Data link Feature extended capability.
 - Add Physical Layer 16.0 GT/s extended capability. Not decode yet.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.220 src/sys/dev/pci/pci_subr.c:1.221
--- src/sys/dev/pci/pci_subr.c:1.220	Sat Jan 25 07:59:14 2020
+++ src/sys/dev/pci/pci_subr.c	Sat Jan 25 08:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.220 2020/01/25 07:59:14 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.221 2020/01/25 08:13:39 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.220 2020/01/25 07:59:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.221 2020/01/25 08:13:39 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -2165,6 +2165,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		printf("Reserved\n");
 		break;
 	}
+	onoff("10-bit Tag Completer Supported", reg, PCIE_DCAP2_TBT_COMP);
+	onoff("10-bit Tag Requester Supported", reg, PCIE_DCAP2_TBT_REQ);
 	printf("  OBFF Supported: ");
 	switch (__SHIFTOUT(reg, PCIE_DCAP2_OBFF)) {
 	case 0x0:
@@ -2217,6 +2219,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	onoff("LTR Mechanism Enabled", reg, PCIE_DCSR2_LTR_MEC);
 	onoff("Emergency Power Reduction Request", reg,
 	PCIE_DCSR2_EMGPWRRED_REQ);
+	onoff("10-bit Tag Requester Enabled", reg, PCIE_DCSR2_TBT_REQ);
 	printf("  OBFF: ");
 	switch (__SHIFTOUT(reg, PCIE_DCSR2_OBFF_EN)) {
 	case 0x0:
@@ -4165,6 +4168,24 @@ pci_conf_print_ptm_cap(const pcireg_t *r
 /* XXX pci_conf_print_rtr_cap */
 /* XXX pci_conf_print_desigvndsp_cap */
 /* XXX pci_conf_print_vf_resizbar_cap */
+
+static void
+pci_conf_print_dlf_cap(const pcireg_t *regs, int extcapoff)
+{
+	pcireg_t reg;
+
+	printf("\n  Data link Feature Register\n");
+	reg = regs[o2i(extcapoff + PCI_DLF_CAP)];
+	printf("Capability register: 0x%08x\n", reg);
+	onoff("Scaled Flow Control", reg, PCI_DLF_LFEAT_SCLFCTL);
+	onoff("DLF Exchange enable", reg, PCI_DLF_CAP_XCHG);
+
+	reg = regs[o2i(extcapoff + PCI_DLF_STAT)];
+	printf("Status register: 0x%08x\n", reg);
+	onoff("Scaled Flow Control", reg, PCI_DLF_LFEAT_SCLFCTL);
+	onoff("Remote DLF supported Valid", reg, PCI_DLF_STAT_RMTVALID);
+}
+
 /* XXX pci_conf_print_hierarchyid_cap */
 /* XXX pci_conf_print_npem_cap */
 
@@ -4251,8 +4272,8 @@ static struct {
 	  NULL },
 	{ PCI_EXTCAP_VF_RESIZBAR, "VF Resizable BARs",
 	  NULL },
-	{ 0x25, "unknown", NULL },
-	{ 0x26, "unknown", NULL },
+	{ PCI_EXTCAP_DLF, "Data link Feature", pci_conf_print_dlf_cap },
+	{ PCI_EXTCAP_PYSLAY_16GT, "Physical Layer 16.0 GT/s", NULL },
 	{ 0x27, "unknown", NULL },
 	{ PCI_EXTCAP_HIERARCHYID, "Hierarchy ID",
 	  NULL },

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.149 src/sys/dev/pci/pcireg.h:1.150
--- src/sys/dev/pci/pcireg.h:1.149	Wed Jan 22 02:51:38 2020
+++ src/sys/dev/pci/pcireg.h	Sat Jan 25 08:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.149 2020/01/22 02:51:38 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.150 2020/01/25 08:13:39 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1097,6 +1097,8 @@ typedef u_int8_t pci_revision_t;
 #define PCIE_DCAP2_LTR_MEC	__BIT(11)  /* LTR Mechanism Supported */
 #define PCIE_DCAP2_TPH_COMP	__BITS(13, 12) /* TPH Completer Supported */
 #define PCIE_DCAP2_LNSYSCLS	__BITS(15, 14) /* LN System CLS */
+#define PCIE_DCAP2_TBT_COMP	__BIT(16)  /* 10-bit Tag Completer Supp. */
+#define PCIE_DCAP2_TBT_REQ	__BIT(17)  /* 10-bit Tag Requester Supp. */
 #define PCIE_DCAP2_OBFF		__BITS(19, 18) /* Optimized Buffer Flush/Fill*/
 #define PCIE_DCAP2_EXTFMT_FLD	__BIT(20)  /* Extended Fmt Field Support */
 #define PCIE_DCAP2_EETLP_PREF	__BIT(21)  /* End-End TLP Prefix Support */
@@ -1114,6 +1116,7 @@ typedef u_int8_t pci_revision_t;
 #define PCIE_DCSR2_IDO_COMP	__BIT(9)   /* IDO Completion Enable */
 #define PCIE_DCSR2_LTR_MEC	__BIT(10)  /* LTR Mechanism Enable */
 #define PCIE_DCSR2_EMGPWRRED_REQ __BIT(11) /* Emergency Power Reduc. Req */
+#define PCIE_DCSR2_TBT_REQ	__BIT(12)  /* 10-bit Tag Requester Ena. */
 #define PCIE_DCSR2_OBFF_EN	__BITS(14, 13) /* OBFF Enable */
 #define PCIE_DCSR2_EETLP	__BIT(15)  /* End-End TLP Prefix Blcking */
 #define PCIE_LCAP2	0x2c	/* Link Capabilities 2 Register */
@@ -1525,6 +1528,8 @@ struct pci_rom {
 #define	PCI_EXTCAP_RTR		0x0022	/* Readiness Time Reporting */
 #define	PCI_EXTCAP_DESIGVNDSP	0x0023	/*