CVS commit: src/lib/libcurses

2020-03-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Mar 15 01:18:43 UTC 2020

Modified Files:
src/lib/libcurses: clrtobot.c clrtoeol.c erase.c

Log Message:
werase, wclrtobot, wclrtoeol - make code even more similar.
Rename attr to battr to match bch and WINDOW::battr.
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libcurses/clrtobot.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/clrtoeol.c
cvs rdiff -u -r1.31 -r1.32 src/lib/libcurses/erase.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/libcurses/clrtobot.c
diff -u src/lib/libcurses/clrtobot.c:1.26 src/lib/libcurses/clrtobot.c:1.27
--- src/lib/libcurses/clrtobot.c:1.26	Fri Mar 13 02:57:26 2020
+++ src/lib/libcurses/clrtobot.c	Sun Mar 15 01:18:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtobot.c,v 1.26 2020/03/13 02:57:26 roy Exp $	*/
+/*	$NetBSD: clrtobot.c,v 1.27 2020/03/15 01:18:43 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtobot.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtobot.c,v 1.26 2020/03/13 02:57:26 roy Exp $");
+__RCSID("$NetBSD: clrtobot.c,v 1.27 2020/03/15 01:18:43 uwe Exp $");
 #endif
 #endif/* not lint */
 
@@ -66,7 +66,17 @@ wclrtobot(WINDOW *win)
 	int	 minx, startx, starty, y;
 	__LDATA	*sp, *end, *maxx;
 	wchar_t bch;
-	attr_t	attr;
+	attr_t	battr;
+
+#ifdef HAVE_WCHAR
+	bch = (wchar_t)btowc((int)win->bch);
+#else
+	bch = win->bch;
+#endif
+	if (win != curscr)
+		battr = win->battr & __ATTRIBUTES;
+	else
+		battr = 0;
 
 #ifdef __GNUC__
 	maxx = NULL;		/* XXX gcc -Wuninitialized */
@@ -78,28 +88,20 @@ wclrtobot(WINDOW *win)
 		starty = win->cury;
 		startx = win->curx;
 	}
-#ifdef HAVE_WCHAR
-	bch = (wchar_t)btowc((int)win->bch);
-#else
-	bch = win->bch;
-#endif
-	if (win != curscr)
-		attr = win->battr & __ATTRIBUTES;
-	else
-		attr = 0;
 
 	for (y = starty; y < win->maxy; y++) {
 		minx = -1;
 		end = >alines[y]->line[win->maxx];
 		for (sp = >alines[y]->line[startx]; sp < end; sp++) {
-			if (!(__NEED_ERASE(sp, bch, attr)))
+			if (!(__NEED_ERASE(sp, bch, battr)))
 continue;
 
 			maxx = sp;
 			if (minx == -1)
 minx = (int)(sp - win->alines[y]->line);
-			sp->attr = attr | (sp->attr & __ALTCHARSET);
+
 			sp->ch = bch;
+			sp->attr = battr | (sp->attr & __ALTCHARSET);
 #ifdef HAVE_WCHAR
 			if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)
 return ERR;

Index: src/lib/libcurses/clrtoeol.c
diff -u src/lib/libcurses/clrtoeol.c:1.30 src/lib/libcurses/clrtoeol.c:1.31
--- src/lib/libcurses/clrtoeol.c:1.30	Fri Mar 13 02:57:26 2020
+++ src/lib/libcurses/clrtoeol.c	Sun Mar 15 01:18:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtoeol.c,v 1.30 2020/03/13 02:57:26 roy Exp $	*/
+/*	$NetBSD: clrtoeol.c,v 1.31 2020/03/15 01:18:43 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtoeol.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtoeol.c,v 1.30 2020/03/13 02:57:26 roy Exp $");
+__RCSID("$NetBSD: clrtoeol.c,v 1.31 2020/03/15 01:18:43 uwe Exp $");
 #endif
 #endif/* not lint */
 
@@ -66,7 +66,17 @@ wclrtoeol(WINDOW *win)
 	int minx, x, y;
 	__LDATA *end, *maxx, *sp;
 	wchar_t bch;
-	attr_t	attr;
+	attr_t	battr;
+
+#ifdef HAVE_WCHAR
+	bch = (wchar_t)btowc((int)win->bch);
+#else
+	bch = win->bch;
+#endif
+	if (win != curscr)
+		battr = win->battr & __ATTRIBUTES;
+	else
+		battr = 0;
 
 	y = win->cury;
 	x = win->curx;
@@ -83,24 +93,17 @@ wclrtoeol(WINDOW *win)
 	end = >alines[y]->line[win->maxx];
 	minx = -1;
 	maxx = >alines[y]->line[x];
-#ifdef HAVE_WCHAR
-	bch = (wchar_t)btowc((int)win->bch);
-#else
-	bch = win->bch;
-#endif
-	if (win != curscr)
-		attr = win->battr & __ATTRIBUTES;
-	else
-		attr = 0;
 
 	for (sp = maxx; sp < end; sp++) {
-		if (!(__NEED_ERASE(sp, bch, attr)))
+		if (!(__NEED_ERASE(sp, bch, battr)))
 			continue;
+
 		maxx = sp;
 		if (minx == -1)
 			minx = (int)(sp - win->alines[y]->line);
-		sp->attr = attr | (sp->attr & __ALTCHARSET);
+
 		sp->ch = bch;
+		sp->attr = battr | (sp->attr & __ALTCHARSET);
 #ifdef HAVE_WCHAR
 		if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)
 			return ERR;

Index: src/lib/libcurses/erase.c
diff -u src/lib/libcurses/erase.c:1.31 src/lib/libcurses/erase.c:1.32
--- src/lib/libcurses/erase.c:1.31	Fri Mar 13 02:57:26 2020
+++ src/lib/libcurses/erase.c	Sun Mar 15 01:18:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: erase.c,v 1.31 2020/03/13 02:57:26 roy Exp $	*/
+/*	$NetBSD: erase.c,v 1.32 2020/03/15 01:18:43 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)erase.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: erase.c,v 1.31 2020/03/13 02:57:26 roy Exp $");
+__RCSID("$NetBSD: erase.c,v 1.32 2020/03/15 01:18:43 uwe Exp $");
 #endif
 #endif/* not lint */
 
@@ -67,7 +67,7 @@ werase(WINDOW *win)
 	int y;
 	__LDATA *sp, *end, 

CVS commit: src/lib/libcurses

2020-03-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Mar 15 01:12:47 UTC 2020

Modified Files:
src/lib/libcurses: curses_private.h

Log Message:
__NEED_ERASE - don't shadow __LDATA::attr with macro parameter name.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/lib/libcurses/curses_private.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/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.72 src/lib/libcurses/curses_private.h:1.73
--- src/lib/libcurses/curses_private.h:1.72	Fri Mar 13 02:57:26 2020
+++ src/lib/libcurses/curses_private.h	Sun Mar 15 01:12:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.72 2020/03/13 02:57:26 roy Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.73 2020/03/15 01:12:47 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -339,14 +339,14 @@ void	 __CTRACE(int, const char *, ...) _
 
 /* Common erase logic */
 #ifdef HAVE_WCHAR
-#define __NEED_ERASE(sp, bch, attr)\
-	((sp)->ch != (bch) ||	\
-	((sp)->attr & WA_ATTRIBUTES) != (attr) ||		\
-	(sp)->nsp != NULL ||\
-	WCOL(*sp) < 0)
+#define __NEED_ERASE(_sp, _bch, _battr)\
+	((_sp)->ch != (_bch) ||	\
+	((_sp)->attr & WA_ATTRIBUTES) != (_battr) ||	\
+	(_sp)->nsp != NULL ||\
+	WCOL(*_sp) < 0)
 #else
-#define __NEED_ERASE(sp, bch, attr)\
-	((sp)->ch != (bch) || (sp)->attr != (attr))
+#define __NEED_ERASE(_sp, _bch, _battr)\
+	((_sp)->ch != (_bch) || (_sp)->attr != (_battr))
 #endif
 
 /* Private functions. */



CVS commit: src/sbin/route

2020-03-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Mar 14 22:26:39 UTC 2020

Modified Files:
src/sbin/route: route.c

Log Message:
route: Enable receive error reporting on the routing socket


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.166 src/sbin/route/route.c:1.167
--- src/sbin/route/route.c:1.166	Sat Feb 22 00:42:15 2020
+++ src/sbin/route/route.c	Sat Mar 14 22:26:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.166 2020/02/22 00:42:15 kamil Exp $	*/
+/*	$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.166 2020/02/22 00:42:15 kamil Exp $");
+__RCSID("$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -208,8 +208,14 @@ main(int argc, char * const *argv)
 	pid = prog_getpid();
 	if (tflag)
 		sock = prog_open("/dev/null", O_WRONLY, 0);
-	else
+	else {
+		int on = 1;
+
 		sock = prog_socket(PF_ROUTE, SOCK_RAW, 0);
+		if (setsockopt(sock, SOL_SOCKET, SO_RERROR,
+		, sizeof(on)) == -1)
+			warn("SO_RERROR");
+	}
 	if (sock < 0)
 		err(EXIT_FAILURE, "socket");
 



CVS commit: src/sys/dev/pckbport

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 22:23:17 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Detect multiple fingers outside the gesture period

I suspect this code doesn't make any sense if we want two-finger scrolling


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.59 src/sys/dev/pckbport/synaptics.c:1.60
--- src/sys/dev/pckbport/synaptics.c:1.59	Sat Mar 14 21:56:08 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 22:23:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.60 2020/03/14 22:23:17 nia Exp $");
 
 #include 
 #include 
@@ -1285,13 +1285,7 @@ synaptics_finger_detect(struct synaptics
 		return (0);
 	}
 
-	/*
-	 * Detect 2 and 3 fingers if supported, but only if multiple
-	 * fingers appear within the tap gesture time period.
-	 */
-	if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER &&
-	SYN_TIME(sc, sc->gesture_start_packet,
-	sp->sp_finger) < synaptics_gesture_length) {
+	if (sc->flags & SYN_FLAG_HAS_MULTI_FINGER) {
 		switch (sp->sp_w) {
 		case SYNAPTICS_WIDTH_TWO_FINGERS:
 			fingers = 2;



CVS commit: src/sys/dev/pckbport

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 21:56:08 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Automatically scroll when multiple fingers are detected

This will mean we automatically get two-finger scrolling on multitouch
pads.

This works, but the scrolling is janky. Why does it eventually move the
mouse cursor (only one finger detected, but two are still there), and why
does it jump up slightly?


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.58 src/sys/dev/pckbport/synaptics.c:1.59
--- src/sys/dev/pckbport/synaptics.c:1.58	Sat Mar 14 21:23:32 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 21:56:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.59 2020/03/14 21:56:08 nia Exp $");
 
 #include 
 #include 
@@ -118,7 +118,7 @@ static int synaptics_scale_y = 16;
 static int synaptics_scale_z = 32;
 static int synaptics_max_speed_x = 32;
 static int synaptics_max_speed_y = 32;
-static int synaptics_max_speed_z = 2;
+static int synaptics_max_speed_z = 1;
 static int synaptics_movement_threshold = 4;
 static int synaptics_fscroll_min = 13;
 static int synaptics_fscroll_max = 14;
@@ -1745,6 +1745,14 @@ pms_synaptics_process_packet(struct pms_
 
 			synaptics_movement(sc, sp, sp->sp_finger,
 z_emul, , , );
+		} else if (fingers > 1) {
+			/*
+			 * Multiple finger movement. Interpret it as scrolling.
+			 */
+			synaptics_movement(sc, sp, sp->sp_finger, 1,
+, , );
+			sc->rem_x[0] = sc->rem_y[0] = 0;
+			dx = dy = 0;
 		} else {
 			/*
 			 * No valid finger. Therefore no movement.



CVS commit: src/sys/miscfs/genfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 21:47:41 UTC 2020

Modified Files:
src/sys/miscfs/genfs: genfs_node.h

Log Message:
Update a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/miscfs/genfs/genfs_node.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/miscfs/genfs/genfs_node.h
diff -u src/sys/miscfs/genfs/genfs_node.h:1.23 src/sys/miscfs/genfs/genfs_node.h:1.24
--- src/sys/miscfs/genfs/genfs_node.h:1.23	Wed Jan 15 17:55:44 2020
+++ src/sys/miscfs/genfs/genfs_node.h	Sat Mar 14 21:47:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_node.h,v 1.23 2020/01/15 17:55:44 ad Exp $ */
+/* $NetBSD: genfs_node.h,v 1.24 2020/03/14 21:47:41 ad Exp $ */
 
 /*
  * Copyright (c) 2001 Chuck Silvers.
@@ -61,7 +61,7 @@ struct genfs_ops {
 /*
  * GOP_MARKUPDATE: mark vnode's timestamps for update.
  *
- * => called with v_interlock (and possibly other locks) held.
+ * => called with vmobjlock (and possibly other locks) held.
  * => used for accesses via mmap.
  */
 



CVS commit: src/sys/dev/pckbport

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 21:23:32 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: fix syntax


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.57 src/sys/dev/pckbport/synaptics.c:1.58
--- src/sys/dev/pckbport/synaptics.c:1.57	Sat Mar 14 21:18:50 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 21:23:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.58 2020/03/14 21:23:32 nia Exp $");
 
 #include 
 #include 
@@ -862,7 +862,7 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG
 	} else
 	if (node.sysctl_num == synaptics_gesture_length_nodenum ||
 	node.sysctl_num == synaptics_edge_motion_delta_nodenum ||
-	node.sysctl_num == synaptics_up_down_motion_delta_nodenum) {
+	node.sysctl_num == synaptics_up_down_motion_delta_nodenum ||
 	node.sysctl_num == synaptics_max_speed_x_nodenum ||
 	node.sysctl_num == synaptics_max_speed_y_nodenum ||
 	node.sysctl_num == synaptics_max_speed_z_nodenum) {



CVS commit: src/sys/dev/pckbport

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 21:18:50 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Allow the max_speed sysctls to be set


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.56 src/sys/dev/pckbport/synaptics.c:1.57
--- src/sys/dev/pckbport/synaptics.c:1.56	Sat Mar 14 19:29:39 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 21:18:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.57 2020/03/14 21:18:50 nia Exp $");
 
 #include 
 #include 
@@ -863,6 +863,9 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG
 	if (node.sysctl_num == synaptics_gesture_length_nodenum ||
 	node.sysctl_num == synaptics_edge_motion_delta_nodenum ||
 	node.sysctl_num == synaptics_up_down_motion_delta_nodenum) {
+	node.sysctl_num == synaptics_max_speed_x_nodenum ||
+	node.sysctl_num == synaptics_max_speed_y_nodenum ||
+	node.sysctl_num == synaptics_max_speed_z_nodenum) {
 		if (t < 0)
 			return (EINVAL);
 	} else



CVS commit: src/sys/uvm

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 21:06:35 UTC 2020

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
Don't require a write lock for page enqueue/activate/deactivate.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.231 src/sys/uvm/uvm_page.c:1.232
--- src/sys/uvm/uvm_page.c:1.231	Sat Mar 14 20:23:51 2020
+++ src/sys/uvm/uvm_page.c	Sat Mar 14 21:06:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.231 2020/03/14 20:23:51 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.232 2020/03/14 21:06:35 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.231 2020/03/14 20:23:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.232 2020/03/14 21:06:35 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -1908,7 +1908,7 @@ void
 uvm_pagedeactivate(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 	if (pg->wire_count == 0) {
 		KASSERT(uvmpdpol_pageisqueued_p(pg));
@@ -1927,7 +1927,7 @@ void
 uvm_pageactivate(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 #if defined(READAHEAD_STATS)
 	if ((pg->flags & PG_READAHEAD) != 0) {
@@ -1968,7 +1968,7 @@ void
 uvm_pageenqueue(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 	if (pg->wire_count == 0 && !uvmpdpol_pageisqueued_p(pg)) {
 		uvmpdpol_pageenqueue(pg);



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

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 20:48:40 UTC 2020

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

Log Message:
Re: kern/55071 (Panic shortly after running X11 due to kernel diagnostic 
assertion "mutex_owned(>pp_lock)")

pmap_pp_remove(): get rid of a "goto" to make it clearer what's going on.


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 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.366 src/sys/arch/x86/x86/pmap.c:1.367
--- src/sys/arch/x86/x86/pmap.c:1.366	Sat Mar 14 18:24:10 2020
+++ src/sys/arch/x86/x86/pmap.c	Sat Mar 14 20:48:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.366 2020/03/14 18:24:10 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.367 2020/03/14 20:48:40 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.366 2020/03/14 18:24:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.367 2020/03/14 20:48:40 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -4115,15 +4115,19 @@ pmap_pp_remove(struct pmap_page *pp, pad
 
 	count = SPINLOCK_BACKOFF_MIN;
 	kpreempt_disable();
-startover:
-	mutex_spin_enter(>pp_lock);
-	while ((pvpte = pv_pte_first(pp)) != NULL) {
+	for (;;) {
 		struct pmap *pmap;
 		struct pv_entry *pve;
 		pt_entry_t opte;
 		vaddr_t va;
 		int error;
 
+		mutex_spin_enter(>pp_lock);
+		if ((pvpte = pv_pte_first(pp)) == NULL) {
+			mutex_spin_exit(>pp_lock);
+			break;
+		}
+
 		/*
 		 * Add a reference to the pmap before clearing the pte.
 		 * Otherwise the pmap can disappear behind us.
@@ -4150,7 +4154,7 @@ startover:
 			if (ptp != NULL) {
 pmap_destroy(pmap);
 			}
-			goto startover;
+			continue;
 		}
 
 		error = pmap_sync_pv(pvpte, pa, ~0, , );
@@ -4167,7 +4171,7 @@ startover:
 			}
 			SPINLOCK_BACKOFF(count);
 			KERNEL_LOCK(hold_count, curlwp);
-			goto startover;
+			continue;
 		}
 
 		va = pvpte->pte_va;
@@ -4196,9 +4200,7 @@ startover:
 		if (ptp != NULL) {
 			pmap_destroy(pmap);
 		}
-		mutex_spin_enter(>pp_lock);
 	}
-	mutex_spin_exit(>pp_lock);
 	kpreempt_enable();
 }
 



CVS commit: src

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 20:45:24 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/sys/kern: vfs_subr.c
src/sys/miscfs/genfs: genfs_io.c
src/sys/sys: vnode.h
src/sys/ufs/lfs: lfs_pages.c
src/sys/uvm: uvm_object.h uvm_page_status.c uvm_pager.h uvm_vnode.c

Log Message:
Make uvm_pagemarkdirty() responsible for putting vnodes onto the syncer
work list.  Proposed on tech-kern@.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.483 -r1.484 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.92 -r1.93 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.292 -r1.293 src/sys/sys/vnode.h
cvs rdiff -u -r1.23 -r1.24 src/sys/ufs/lfs/lfs_pages.c
cvs rdiff -u -r1.37 -r1.38 src/sys/uvm/uvm_object.h
cvs rdiff -u -r1.3 -r1.4 src/sys/uvm/uvm_page_status.c
cvs rdiff -u -r1.45 -r1.46 src/sys/uvm/uvm_pager.h
cvs rdiff -u -r1.109 -r1.110 src/sys/uvm/uvm_vnode.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.63 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.64
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.63	Sun Mar  8 19:59:45 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Sat Mar 14 20:45:23 2020
@@ -6028,19 +6028,9 @@ zfs_netbsd_getpages(void *v)
 		pg->flags &= ~(PG_FAKE);
 	}
 
-	if (memwrite) {
-		if (uvm_pagegetdirty(pg) == UVM_PAGE_STATUS_CLEAN) {
-			/* For write faults, start dirtiness tracking. */
-			uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_UNKNOWN);
-		}
-		mutex_enter(vp->v_interlock);
-		if ((vp->v_iflag & VI_ONWORKLST) == 0) {
-			vn_syncer_add_to_worklist(vp, filedelay);
-		}
-		if ((vp->v_iflag & (VI_WRMAP|VI_WRMAPDIRTY)) == VI_WRMAP) {
-			vp->v_iflag |= VI_WRMAPDIRTY;
-		}
-		mutex_exit(vp->v_interlock);
+	if (memwrite && uvm_pagegetdirty(pg) == UVM_PAGE_STATUS_CLEAN) {
+		/* For write faults, start dirtiness tracking. */
+		uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_UNKNOWN);
 	}
 	rw_exit(rw);
 	ap->a_m[ap->a_centeridx] = pg;

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.483 src/sys/kern/vfs_subr.c:1.484
--- src/sys/kern/vfs_subr.c:1.483	Sun Mar  1 21:39:07 2020
+++ src/sys/kern/vfs_subr.c	Sat Mar 14 20:45:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.483 2020/03/01 21:39:07 ad Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.484 2020/03/14 20:45:23 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.483 2020/03/01 21:39:07 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.484 2020/03/14 20:45:23 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -422,10 +422,8 @@ brelvp(struct buf *bp)
 		bufremvn(bp);
 
 	if ((vp->v_iflag & (VI_ONWORKLST | VI_PAGES)) == VI_ONWORKLST &&
-	LIST_FIRST(>v_dirtyblkhd) == NULL) {
-		KASSERT((vp->v_iflag & VI_WRMAPDIRTY) == 0);
+	LIST_FIRST(>v_dirtyblkhd) == NULL)
 		vn_syncer_remove_from_worklist(vp);
-	}
 
 	bp->b_objlock = _lock;
 	bp->b_vp = NULL;
@@ -463,10 +461,8 @@ reassignbuf(struct buf *bp, struct vnode
 		listheadp = >v_cleanblkhd;
 		if ((vp->v_iflag & (VI_ONWORKLST | VI_PAGES)) ==
 		VI_ONWORKLST &&
-		LIST_FIRST(>v_dirtyblkhd) == NULL) {
-			KASSERT((vp->v_iflag & VI_WRMAPDIRTY) == 0);
+		LIST_FIRST(>v_dirtyblkhd) == NULL)
 			vn_syncer_remove_from_worklist(vp);
-		}
 	} else {
 		listheadp = >v_dirtyblkhd;
 		if ((vp->v_iflag & VI_ONWORKLST) == 0) {

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.92 src/sys/miscfs/genfs/genfs_io.c:1.93
--- src/sys/miscfs/genfs/genfs_io.c:1.92	Sat Mar 14 20:23:51 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Mar 14 20:45:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.92 2020/03/14 20:23:51 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.93 2020/03/14 20:45:23 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.92 2020/03/14 20:23:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.93 2020/03/14 20:45:23 ad Exp $");
 
 #include 
 #include 
@@ -61,7 +61,6 @@ static int genfs_getpages_read(struct vn
 static int genfs_do_io(struct vnode *, off_t, vaddr_t, size_t, int, enum uio_rw,
 void (*)(struct buf *));
 static void genfs_rel_pages(struct vm_page **, unsigned int);
-static void genfs_markdirty(struct vnode *);
 
 int genfs_maxdio = MAXPHYS;
 
@@ -83,22 +82,6 @@ genfs_rel_pages(struct vm_page **pgs, un
 	uvm_page_unbusy(pgs, npages);
 }
 
-static void
-genfs_markdirty(struct vnode *vp)
-{
-
-	KASSERT(rw_write_held(vp->v_uobj.vmobjlock));
-
-	mutex_enter(vp->v_interlock);
-	if 

CVS commit: src/tests/rump/kernspace

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 20:25:47 UTC 2020

Modified Files:
src/tests/rump/kernspace: busypage.c

Log Message:
Catch up with reality.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/kernspace/busypage.c

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

Modified files:

Index: src/tests/rump/kernspace/busypage.c
diff -u src/tests/rump/kernspace/busypage.c:1.6 src/tests/rump/kernspace/busypage.c:1.7
--- src/tests/rump/kernspace/busypage.c:1.6	Sun Feb 23 15:46:43 2020
+++ src/tests/rump/kernspace/busypage.c	Sat Mar 14 20:25:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: busypage.c,v 1.6 2020/02/23 15:46:43 ad Exp $	*/
+/*	$NetBSD: busypage.c,v 1.7 2020/03/14 20:25:46 ad Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: busypage.c,v 1.6 2020/02/23 15:46:43 ad Exp $");
+__RCSID("$NetBSD: busypage.c,v 1.7 2020/03/14 20:25:46 ad Exp $");
 #endif /* !lint */
 
 #include 
@@ -52,15 +52,14 @@ static void
 thread(void *arg)
 {
 
-	rw_enter(uobj->vmobjlock, RW_WRITER);
+	mutex_enter(>interlock);
 	threadrun = true;
-#ifdef notyet
 	cv_signal();
-#else
-	wakeup();
-#endif
-	testpg->flags |= PG_WANTED;
-	UVM_UNLOCK_AND_WAIT_RW(testpg, uobj->vmobjlock, false, "tw", 0);
+	mutex_exit(>interlock);
+
+	rw_enter(uobj->vmobjlock, RW_READER);
+	uvm_pagewait(testpg, uobj->vmobjlock, "tw");
+
 	kthread_exit(0);
 }
 
@@ -84,16 +83,17 @@ rumptest_busypage()
 	if (rv)
 		panic("thread creation failed: %d", rv);
 
-	rw_enter(uobj->vmobjlock, RW_WRITER);
-#ifdef notyet
-	while (!threadrun)
-		cv_wait(, uobj->vmobjlock);
-#else
+	kpause("lolgic", false, mstohz(100), NULL);
+
+	mutex_enter(>interlock);
 	while (!threadrun)
-		rwtsleep(, 0, "nutter", 0, uobj->vmobjlock);
-#endif
+		cv_wait(, >interlock);
+	mutex_exit(>interlock);
 
-	uvm_page_unbusy(, 1);
+	rw_enter(uobj->vmobjlock, RW_WRITER);
+	mutex_enter(>interlock);
+	uvm_pageunbusy(testpg);
+	mutex_exit(>interlock);
 	rw_exit(uobj->vmobjlock);
 
 	rv = kthread_join(newl);



CVS commit: src/sys

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 20:23:51 UTC 2020

Modified Files:
src/sys/kern: kern_synch.c
src/sys/miscfs/genfs: genfs_io.c
src/sys/rump/librump/rumpkern: ltsleep.c vm.c
src/sys/sys: proc.h
src/sys/ufs/lfs: lfs_pages.c lfs_vfsops.c
src/sys/uvm: uvm.h uvm_amap.c uvm_anon.c uvm_aobj.c uvm_bio.c
uvm_fault.c uvm_km.c uvm_loan.c uvm_page.c uvm_page.h uvm_vnode.c

Log Message:
Make page waits (WANTED vs BUSY) interlocked by pg->interlock.  Gets RW
locks out of the equation for sleep/wakeup, and allows observing+waiting
for busy pages when holding only a read lock.  Proposed on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.343 -r1.344 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.91 -r1.92 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/librump/rumpkern/ltsleep.c
cvs rdiff -u -r1.185 -r1.186 src/sys/rump/librump/rumpkern/vm.c
cvs rdiff -u -r1.359 -r1.360 src/sys/sys/proc.h
cvs rdiff -u -r1.22 -r1.23 src/sys/ufs/lfs/lfs_pages.c
cvs rdiff -u -r1.375 -r1.376 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.75 -r1.76 src/sys/uvm/uvm.h
cvs rdiff -u -r1.117 -r1.118 src/sys/uvm/uvm_amap.c
cvs rdiff -u -r1.74 -r1.75 src/sys/uvm/uvm_anon.c
cvs rdiff -u -r1.136 -r1.137 src/sys/uvm/uvm_aobj.c
cvs rdiff -u -r1.104 -r1.105 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.217 -r1.218 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.156 -r1.157 src/sys/uvm/uvm_km.c
cvs rdiff -u -r1.96 -r1.97 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.230 -r1.231 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.99 -r1.100 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.108 -r1.109 src/sys/uvm/uvm_vnode.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_synch.c
diff -u src/sys/kern/kern_synch.c:1.343 src/sys/kern/kern_synch.c:1.344
--- src/sys/kern/kern_synch.c:1.343	Sat Mar 14 18:08:39 2020
+++ src/sys/kern/kern_synch.c	Sat Mar 14 20:23:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.343 2020/03/14 18:08:39 ad Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.344 2020/03/14 20:23:51 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.343 2020/03/14 18:08:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.344 2020/03/14 20:23:51 ad Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -220,46 +220,6 @@ mtsleep(wchan_t ident, pri_t priority, c
 }
 
 /*
- * XXXAD Temporary - for use of UVM only.  PLEASE DO NOT USE ELSEWHERE. 
- * Will go once there is a better solution, eg waits interlocked by
- * pg->interlock.  To wake an LWP sleeping with this, you need to hold a
- * write lock.
- */
-int
-rwtsleep(wchan_t ident, pri_t priority, const char *wmesg, int timo,
-	 krwlock_t *rw)
-{
-	struct lwp *l = curlwp;
-	sleepq_t *sq;
-	kmutex_t *mp;
-	int error;
-	krw_t op;
-
-	KASSERT((l->l_pflag & LP_INTR) == 0);
-	KASSERT(ident != );
-
-	if (sleepq_dontsleep(l)) {
-		(void)sleepq_abort(NULL, (priority & PNORELOCK) != 0);
-		if ((priority & PNORELOCK) != 0)
-			rw_exit(rw);
-		return 0;
-	}
-
-	l->l_kpriority = true;
-	sq = sleeptab_lookup(, ident, );
-	sleepq_enter(sq, l, mp);
-	sleepq_enqueue(sq, ident, wmesg, _syncobj);
-	op = rw_lock_op(rw);
-	rw_exit(rw);
-	error = sleepq_block(timo, priority & PCATCH);
-
-	if ((priority & PNORELOCK) == 0)
-		rw_enter(rw, op);
-
-	return error;
-}
-
-/*
  * General sleep call for situations where a wake-up is not expected.
  */
 int

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.91 src/sys/miscfs/genfs/genfs_io.c:1.92
--- src/sys/miscfs/genfs/genfs_io.c:1.91	Sat Mar 14 19:07:22 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Mar 14 20:23:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.91 2020/03/14 19:07:22 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.92 2020/03/14 20:23:51 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.91 2020/03/14 19:07:22 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.92 2020/03/14 20:23:51 ad Exp $");
 
 #include 
 #include 
@@ -524,9 +524,6 @@ out:
 		if (i < ridx || i >= ridx + orignmempages || async) {
 			UVMHIST_LOG(ubchist, "unbusy pg %#jx offset 0x%jx",
 			(uintptr_t)pg, pg->offset,0,0);
-			if (pg->flags & PG_WANTED) {
-wakeup(pg);
-			}
 			if (pg->flags & PG_FAKE) {
 KASSERT(overwrite);
 uvm_pagezero(pg);
@@ -537,8 +534,9 @@ out:
 			}
 			uvm_pagelock(pg);
 			uvm_pageenqueue(pg);
+			uvm_pageunbusy(pg);
 			uvm_pageunlock(pg);
-			pg->flags &= ~(PG_WANTED|PG_BUSY|PG_FAKE);
+			pg->flags &= ~PG_FAKE;
 			UVM_PAGE_OWN(pg, NULL);
 		} else if (memwrite && !overwrite &&
 		uvm_pagegetdirty(pg) == UVM_PAGE_STATUS_CLEAN) {
@@ -1093,8 +1091,7 @@ retry:
 continue;
 			}
 			nextoff = pg->offset; /* visit this 

CVS commit: src/sys/rump/librump/rumpkern

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 19:54:06 UTC 2020

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
rump - page/object dirtyness tracking corrections.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/rump/librump/rumpkern/vm.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.184 src/sys/rump/librump/rumpkern/vm.c:1.185
--- src/sys/rump/librump/rumpkern/vm.c:1.184	Sun Feb 23 15:46:42 2020
+++ src/sys/rump/librump/rumpkern/vm.c	Sat Mar 14 19:54:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.184 2020/02/23 15:46:42 ad Exp $	*/
+/*	$NetBSD: vm.c,v 1.185 2020/03/14 19:54:06 ad Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.184 2020/02/23 15:46:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.185 2020/03/14 19:54:06 ad Exp $");
 
 #include 
 #include 
@@ -172,9 +172,11 @@ uvm_pagealloc_strat(struct uvm_object *u
 	pg->offset = off;
 	pg->uobject = uobj;
 
-	pg->flags = PG_CLEAN|PG_BUSY|PG_FAKE;
-	if (flags & UVM_PGA_ZERO) {
-		uvm_pagezero(pg);
+	if (UVM_OBJ_IS_VNODE(uobj) && uobj->uo_npages == 0) {
+		struct vnode *vp = (struct vnode *)uobj;
+		mutex_enter(vp->v_interlock);
+		vp->v_iflag |= VI_PAGES;
+		mutex_exit(vp->v_interlock);
 	}
 
 	if (radix_tree_insert_node(>uo_pages, off >> PAGE_SHIFT,
@@ -182,6 +184,12 @@ uvm_pagealloc_strat(struct uvm_object *u
 		pool_cache_put(, pg);
 		return NULL;
 	}
+	uobj->uo_npages++;
+
+	pg->flags = PG_CLEAN|PG_BUSY|PG_FAKE;
+	if (flags & UVM_PGA_ZERO) {
+		uvm_pagezero(pg);
+	}
 
 	/*
 	 * Don't put anons on the LRU page queue.  We can't flush them
@@ -195,8 +203,6 @@ uvm_pagealloc_strat(struct uvm_object *u
 		mutex_exit(_lruqueue_lock);
 	}
 
-	uobj->uo_npages++;
-
 	return pg;
 }
 
@@ -227,6 +233,13 @@ uvm_pagefree(struct vm_page *pg)
 		atomic_dec_uint(_onqueue);
 	}
 
+	if (UVM_OBJ_IS_VNODE(uobj) && uobj->uo_npages == 0) {
+		struct vnode *vp = (struct vnode *)uobj;
+		mutex_enter(vp->v_interlock);
+		vp->v_iflag &= ~VI_PAGES;
+		mutex_exit(vp->v_interlock);
+	}
+
 	mutex_destroy(>interlock);
 	pool_cache_put(, pg);
 }



CVS commit: src

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 19:29:39 UTC 2020

Modified Files:
src/share/man/man4: pms.4
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Set up_down_emulation=3 by default.

It's a less surprising default for modern hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/share/man/man4/pms.4
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pckbport/synaptics.c

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/pms.4
diff -u src/share/man/man4/pms.4:1.35 src/share/man/man4/pms.4:1.36
--- src/share/man/man4/pms.4:1.35	Sat Mar 14 13:08:18 2020
+++ src/share/man/man4/pms.4	Sat Mar 14 19:29:39 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.35 2020/03/14 13:08:18 nia Exp $
+.\" $NetBSD: pms.4,v 1.36 2020/03/14 19:29:39 nia Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd February 11, 2020
+.Dd March 14, 2020
 .Dt PMS 4
 .Os
 .Sh NAME
@@ -102,19 +102,21 @@ The following
 variables control behavior of Synaptics touchpads:
 .Bl -tag -width 8n
 .It Dv hw.synaptics.up_down_emulation
-If the touchpad reports the existence of Up/Down buttons, this value
-determines if they should be reported as button 4 and 5 events or if
-they should be used to emulate some other event.
+If the touchpad reports the existence of extra ("Up/Down") buttons, this
+value determines what kind of mouse events they should generate.
+On certain clickpads, the Up/Down buttons may be physical buttons that
+can be used instead of pressing the pad down, or used as additional
+buttons.
 .Bl -bullet
 .It
 If set to 0, Up/Down events generate button 4 and 5 clicks.
 .It
 If set to 1, Up/Down events generate middle button clicks.
 .It
-If set to 2 (default), the Up and Down buttons are used for Z-axis
-emulation, which more closely resembles how mouse wheels operate.
+If set to 2, the Up and Down buttons are used for Z-axis emulation,
+which more closely resembles how mouse wheels operate.
 .It
-If set to 3, Up/Down events generate left/right clicks.
+If set to 3 (default), Up/Down events generate left/right clicks.
 .El
 .It Dv hw.synaptics.up_down_motion_delta
 When the Up/Down buttons are used for Z-axis emulation, this value specifies

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.55 src/sys/dev/pckbport/synaptics.c:1.56
--- src/sys/dev/pckbport/synaptics.c:1.55	Sat Mar 14 13:08:18 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 19:29:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.55 2020/03/14 13:08:18 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.55 2020/03/14 13:08:18 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.56 2020/03/14 19:29:39 nia Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ static void pms_sysctl_synaptics(struct 
 static int pms_sysctl_synaptics_verify(SYSCTLFN_ARGS);
 
 /* Controlled by sysctl. */
-static int synaptics_up_down_emul = 2;
+static int synaptics_up_down_emul = 3;
 static int synaptics_up_down_motion_delta = 1;
 static int synaptics_gesture_move = 200;
 static int synaptics_gesture_length = 20;



CVS commit: src/sys/miscfs/genfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 19:07:22 UTC 2020

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.90 src/sys/miscfs/genfs/genfs_io.c:1.91
--- src/sys/miscfs/genfs/genfs_io.c:1.90	Sat Mar 14 18:08:39 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Mar 14 19:07:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.90 2020/03/14 18:08:39 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.91 2020/03/14 19:07:22 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.90 2020/03/14 18:08:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.91 2020/03/14 19:07:22 ad Exp $");
 
 #include 
 #include 
@@ -884,7 +884,6 @@ genfs_do_putpages(struct vnode *vp, off_
 	bool wasclean, needs_clean;
 	bool async = (origflags & PGO_SYNCIO) == 0;
 	bool pagedaemon = curlwp == uvm.pagedaemon_lwp;
-	struct lwp * const l = curlwp ? curlwp : 
 	struct mount *trans_mp;
 	int flags;
 	bool modified;		/* if we write out any pages */



CVS commit: src/sys/arch/x86

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 18:24:10 UTC 2020

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

Log Message:
PR kern/55071 (Panic shortly after running X11 due to kernel diagnostic 
assertion "mutex_owned(>pp_lock)")

- Fix a locking bug in pmap_pp_clear_attrs() and in pmap_pp_remove() do the
  TLB shootdown while still holding the target pmap's lock.

Also:

- Finish PV list locking for x86 & update comments around same.

- Keep track of the min/max index of PTEs inserted into each PTP, and use
  that to clip ranges of VAs passed to pmap_remove_ptes().

- Based on the above, implement a pmap_remove_all() for x86 that clears out
  the pmap in a single pass.  Makes exit() / fork() much cheaper.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/include/pmap_pv.h
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.112 src/sys/arch/x86/include/pmap.h:1.113
--- src/sys/arch/x86/include/pmap.h:1.112	Sat Mar 14 14:05:44 2020
+++ src/sys/arch/x86/include/pmap.h	Sat Mar 14 18:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.112 2020/03/14 14:05:44 ad Exp $	*/
+/*	$NetBSD: pmap.h,v 1.113 2020/03/14 18:24:10 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -248,6 +248,8 @@ extern struct pool_cache pmap_cache;
  * (the other object locks are only used when uvm_pagealloc is called)
  */
 
+struct pv_page;
+
 struct pmap {
 	struct uvm_object pm_obj[PTP_LEVELS-1];/* objects for lvl >= 1) */
 	LIST_ENTRY(pmap) pm_list;	/* list of all pmaps */
@@ -256,11 +258,11 @@ struct pmap {
 	struct vm_page *pm_ptphint[PTP_LEVELS-1];
 	/* pointer to a PTP in our pmap */
 	struct pmap_statistics pm_stats;  /* pmap stats */
+	struct pv_entry *pm_pve;	/* spare pv_entry */
 
 #if !defined(__x86_64__)
 	vaddr_t pm_hiexec;		/* highest executable mapping */
 #endif /* !defined(__x86_64__) */
-	struct lwp *pm_remove_all;	/* who's emptying the pmap */
 
 	union descriptor *pm_ldt;	/* user-set LDT */
 	size_t pm_ldt_len;		/* size of LDT in bytes */

Index: src/sys/arch/x86/include/pmap_pv.h
diff -u src/sys/arch/x86/include/pmap_pv.h:1.13 src/sys/arch/x86/include/pmap_pv.h:1.14
--- src/sys/arch/x86/include/pmap_pv.h:1.13	Tue Mar 10 22:38:41 2020
+++ src/sys/arch/x86/include/pmap_pv.h	Sat Mar 14 18:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_pv.h,v 1.13 2020/03/10 22:38:41 ad Exp $	*/
+/*	$NetBSD: pmap_pv.h,v 1.14 2020/03/14 18:24:10 ad Exp $	*/
 
 /*-
  * Copyright (c)2008 YAMAMOTO Takashi,
@@ -34,6 +34,7 @@
 #include 
 
 struct vm_page;
+struct pmap_page;
 
 /*
  * structures to track P->V mapping
@@ -51,14 +52,14 @@ struct pv_pte {
 };
 
 /*
- * pv_entry: plug pv_pte into lists.
+ * pv_entry: plug pv_pte into lists.  32 bytes on i386, 64 on amd64.
  */
 
 struct pv_entry {
 	struct pv_pte pve_pte;		/* should be the first member */
 	LIST_ENTRY(pv_entry) pve_list;	/* on pmap_page::pp_pvlist */
 	rb_node_t pve_rb;		/* red-black tree node */
-	uintptr_t pve_padding;		/* unused */
+	struct pmap_page *pve_pp;	/* backpointer to mapped page */
 };
 #define	pve_next	pve_list.le_next
 
@@ -71,16 +72,14 @@ struct pmap_page {
 		/* PTPs */
 		rb_tree_t rb;
 
-		/* PTPs */
+		/* PTPs, when being freed */
 		LIST_ENTRY(vm_page) link;
 
-		/* Non-PTPs */
+		/* Non-PTPs (i.e. normal pages) */
 		struct {
-			/* PP_EMBEDDED */
 			struct pv_pte pte;
-
 			LIST_HEAD(, pv_entry) pvlist;
-			uint8_t flags;
+			uint8_t embedded;
 			uint8_t attrs;
 		} s;
 	} pp_u;
@@ -89,7 +88,7 @@ struct pmap_page {
 #define	pp_link		pp_u.link
 #define	pp_pte		pp_u.s.pte
 #define pp_pvlist	pp_u.s.pvlist
-#define	pp_pflags	pp_u.s.flags
+#define	pp_embedded	pp_u.s.embedded
 #define	pp_attrs	pp_u.s.attrs
 };
 
@@ -97,10 +96,6 @@ struct pmap_page {
 #define PP_ATTRS_A	0x02	/* Accessed */
 #define PP_ATTRS_W	0x04	/* Writable */
 
-/* pp_flags */
-#define	PP_EMBEDDED	1
-#define	PP_FREEING	2
-
 #define	PMAP_PAGE_INIT(pp) \
 do { \
 	LIST_INIT(&(pp)->pp_pvlist); \

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.365 src/sys/arch/x86/x86/pmap.c:1.366
--- src/sys/arch/x86/x86/pmap.c:1.365	Sat Mar 14 14:05:44 2020
+++ src/sys/arch/x86/x86/pmap.c	Sat Mar 14 18:24:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.365 2020/03/14 14:05:44 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.366 2020/03/14 18:24:10 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.365 2020/03/14 14:05:44 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.366 2020/03/14 18:24:10 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include 

CVS commit: src/sys

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 18:08:40 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/x86/x86: bus_dma.c
src/sys/compat/linux/common: linux_futex.c
src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c
src/sys/dev/pci/qat: qatvar.h
src/sys/external/bsd/drm2/include/linux: sched.h
src/sys/kern: kern_ktrace.c kern_synch.c subr_copy.c vfs_bio.c
src/sys/miscfs/genfs: genfs_io.c
src/sys/nfs: nfs_syscalls.c
src/sys/rump/librump/rumpkern: scheduler.c
src/sys/sys: sched.h
src/sys/ufs/ext2fs: ext2fs_lookup.c
src/sys/ufs/lfs: ulfs_dirhash.c ulfs_lookup.c
src/sys/ufs/ufs: ufs_dirhash.c ufs_lookup.c
src/sys/uvm: uvm_amap.c

Log Message:
- Hide the details of SPCF_SHOULDYIELD and related behind a couple of small
  functions: preempt_point() and preempt_needed().

- preempt(): if the LWP has exceeded its timeslice in kernel, strip it of
  any priority boost gained earlier from blocking.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/linux/common/linux_futex.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/qat/qatvar.h
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/include/linux/sched.h
cvs rdiff -u -r1.175 -r1.176 src/sys/kern/kern_ktrace.c
cvs rdiff -u -r1.342 -r1.343 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/subr_copy.c
cvs rdiff -u -r1.289 -r1.290 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.89 -r1.90 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.161 -r1.162 src/sys/nfs/nfs_syscalls.c
cvs rdiff -u -r1.50 -r1.51 src/sys/rump/librump/rumpkern/scheduler.c
cvs rdiff -u -r1.87 -r1.88 src/sys/sys/sched.h
cvs rdiff -u -r1.88 -r1.89 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.17 -r1.18 src/sys/ufs/lfs/ulfs_dirhash.c
cvs rdiff -u -r1.41 -r1.42 src/sys/ufs/lfs/ulfs_lookup.c
cvs rdiff -u -r1.38 -r1.39 src/sys/ufs/ufs/ufs_dirhash.c
cvs rdiff -u -r1.150 -r1.151 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.116 -r1.117 src/sys/uvm/uvm_amap.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/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.120 src/sys/arch/arm/arm32/bus_dma.c:1.121
--- src/sys/arch/arm/arm32/bus_dma.c:1.120	Sat Feb 22 08:22:09 2020
+++ src/sys/arch/arm/arm32/bus_dma.c	Sat Mar 14 18:08:38 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: bus_dma.c,v 1.120 2020/02/22 08:22:09 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.121 2020/03/14 18:08:38 ad Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -36,7 +36,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.120 2020/02/22 08:22:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.121 2020/03/14 18:08:38 ad Exp $");
 
 #include 
 #include 
@@ -1790,10 +1790,8 @@ _bus_dma_uiomove(void *buf, struct uio *
 			continue;
 		cnt = MIN(resid, iov->iov_len);
 
-		if (!VMSPACE_IS_KERNEL_P(vm) &&
-		(curlwp->l_cpu->ci_schedstate.spc_flags & SPCF_SHOULDYIELD)
-		!= 0) {
-			preempt();
+		if (!VMSPACE_IS_KERNEL_P(vm)) {
+			preempt_point();
 		}
 		if (direction == UIO_READ) {
 			error = copyout_vmspace(vm, cp, iov->iov_base, cnt);

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.39 src/sys/arch/mips/mips/bus_dma.c:1.40
--- src/sys/arch/mips/mips/bus_dma.c:1.39	Fri Mar 13 03:49:39 2020
+++ src/sys/arch/mips/mips/bus_dma.c	Sat Mar 14 18:08:38 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: bus_dma.c,v 1.39 2020/03/13 03:49:39 thorpej Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.40 2020/03/14 18:08:38 ad Exp $	*/
 
 /*-
- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997, 1998, 2001, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.39 2020/03/13 03:49:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.40 2020/03/14 18:08:38 ad Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -1291,10 +1291,8 @@ _bus_dma_uiomove(void *buf, struct uio *
 			continue;
 		cnt = MIN(resid, iov->iov_len);
 
-		if (!VMSPACE_IS_KERNEL_P(vm) &&
-		(curlwp->l_cpu->ci_schedstate.spc_flags & SPCF_SHOULDYIELD)
-		!= 0) {
-	

CVS commit: src/sys/uvm

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 17:29:53 UTC 2020

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map_lookup_entry(): save the hint even on failure, since code elsewhere
relies on it pointing to the previous entry.


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/sys/uvm/uvm_map.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/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.373 src/sys/uvm/uvm_map.c:1.374
--- src/sys/uvm/uvm_map.c:1.373	Sat Mar 14 14:15:43 2020
+++ src/sys/uvm/uvm_map.c	Sat Mar 14 17:29:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.373 2020/03/14 14:15:43 ad Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.374 2020/03/14 17:29:53 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.373 2020/03/14 14:15:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.374 2020/03/14 17:29:53 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1719,6 +1719,7 @@ uvm_map_lookup_entry(struct vm_map *map,
 		return (true);
 	}
 
+	SAVE_HINT(map, map->hint, *entry);
 	UVMHIST_LOG(maphist,"<- failed!",0,0,0,0);
 	KDASSERT((*entry) == >header || (*entry)->end <= address);
 	KDASSERT((*entry)->next == >header ||



CVS commit: src/sys/arch/hppa/hppa

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 16:55:17 UTC 2020

Modified Files:
src/sys/arch/hppa/hppa: genassym.cf

Log Message:
Remove unused RW lock defs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/genassym.cf

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/hppa/hppa/genassym.cf
diff -u src/sys/arch/hppa/hppa/genassym.cf:1.3 src/sys/arch/hppa/hppa/genassym.cf:1.4
--- src/sys/arch/hppa/hppa/genassym.cf:1.3	Thu Feb 20 08:27:38 2020
+++ src/sys/arch/hppa/hppa/genassym.cf	Sat Mar 14 16:55:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.3 2020/02/20 08:27:38 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.4 2020/03/14 16:55:17 ad Exp $
 
 #	$OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $
 
@@ -38,7 +38,6 @@ include "opt_multiprocessor.h"
 endif
 
 quote #define __MUTEX_PRIVATE
-quote #define __RWLOCK_PRIVATE
 
 include 
 include 
@@ -48,7 +47,6 @@ include 
 include 
 include 
 include 
-include 
 include 
 
 include 
@@ -108,15 +106,6 @@ define	MTX_LOCK		offsetof(struct kmutex,
 define	MTX_OWNER		offsetof(struct kmutex, mtx_owner)
 define	MTX_WAITERS		offsetof(struct kmutex, mtx_waiters)
 
-define	RW_OWNER		offsetof(struct krwlock, rw_owner)
-define	RW_WRITE_LOCKED		RW_WRITE_LOCKED
-define	RW_WRITE_WANTED		RW_WRITE_WANTED
-define	RW_READ_INCR		RW_READ_INCR
-define	RW_HAS_WAITERS		RW_HAS_WAITERS
-define	RW_THREAD		RW_THREAD
-define	RW_READER		RW_READER
-define	RW_WRITER		RW_WRITER
-
 # saved state fields
 struct	trapframe
 member	TF_FLAGS	tf_flags



CVS commit: src/etc/etc.amiga

2020-03-14 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Sat Mar 14 16:27:19 UTC 2020

Modified Files:
src/etc/etc.amiga: Makefile.inc

Log Message:
provide both miniroot.fs (for people wanting to install NetBSD without
more 3rdparty software than what's provided on our ISO) and .fs.tz (for
people downloading over slow links).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/etc/etc.amiga/Makefile.inc

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

Modified files:

Index: src/etc/etc.amiga/Makefile.inc
diff -u src/etc/etc.amiga/Makefile.inc:1.29 src/etc/etc.amiga/Makefile.inc:1.30
--- src/etc/etc.amiga/Makefile.inc:1.29	Fri Mar 13 10:01:07 2020
+++ src/etc/etc.amiga/Makefile.inc	Sat Mar 14 16:27:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.29 2020/03/13 10:01:07 is Exp $
+#	$NetBSD: Makefile.inc,v 1.30 2020/03/14 16:27:19 is Exp $
 #
 #	etc.amiga/Makefile.inc -- amiga-specific etc Makefile targets
 #
@@ -15,5 +15,7 @@ INSTALLATION_DIRS+=	installation/miniroo
 
 snap_md_post:
 	${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc '*'
-	${TOOL_GZIP} -fd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot/miniroot.fs.gz
+	rm		${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot/miniroot.fs
+	${TOOL_GZIP} -cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot/miniroot.fs.gz > \
+			${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot/miniroot.fs
 	${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot '*.fs*'



CVS commit: src/sys/arch/riscv

2020-03-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 14 16:12:16 UTC 2020

Modified Files:
src/sys/arch/riscv/conf: Makefile.riscv majors.riscv
src/sys/arch/riscv/include: asm.h elf_machdep.h fenv.h frame.h ieeefp.h
locore.h mcontext.h pte.h sysreg.h types.h
src/sys/arch/riscv/riscv: db_machdep.c kobj_machdep.c locore.S
netbsd32_machdep.c pmap_machdep.c process_machdep.c
procfs_machdep.c riscv_machdep.c sig_machdep.c spl.S syscall.c
trap.c vm_machdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/conf/Makefile.riscv
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/conf/majors.riscv
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/asm.h \
src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/include/elf_machdep.h \
src/sys/arch/riscv/include/types.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/fenv.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/frame.h \
src/sys/arch/riscv/include/ieeefp.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/locore.h \
src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/include/mcontext.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/db_machdep.c \
src/sys/arch/riscv/riscv/netbsd32_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/kobj_machdep.c \
src/sys/arch/riscv/riscv/process_machdep.c \
src/sys/arch/riscv/riscv/sig_machdep.c src/sys/arch/riscv/riscv/spl.S \
src/sys/arch/riscv/riscv/vm_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/pmap_machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/procfs_machdep.c \
src/sys/arch/riscv/riscv/syscall.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/trap.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/riscv/conf/Makefile.riscv
diff -u src/sys/arch/riscv/conf/Makefile.riscv:1.5 src/sys/arch/riscv/conf/Makefile.riscv:1.6
--- src/sys/arch/riscv/conf/Makefile.riscv:1.5	Sun Jun 16 07:42:52 2019
+++ src/sys/arch/riscv/conf/Makefile.riscv	Sat Mar 14 16:12:15 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.riscv,v 1.5 2019/06/16 07:42:52 maxv Exp $
+#	$NetBSD: Makefile.riscv,v 1.6 2020/03/14 16:12:15 skrll Exp $
 
 # Makefile for NetBSD
 #
@@ -99,7 +99,7 @@ RAMDISKDIR!=cd ${NETBSDSRCDIR}/distr
 
 .if defined(NEED_MDSETIMAGE) && ${NEED_MDSETIMAGE} != "no" \
 && defined(RAMDISKDIR) && exists(${RAMDISKDIR}/ramdisk.fs)
-SYSTEM_DEP+=${RAMDISKDIR}/ramdisk.fs 
+SYSTEM_DEP+=${RAMDISKDIR}/ramdisk.fs
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs; \
 	${TOOL_MDSETIMAGE} -s $@ ${RAMDISKDIR}/ramdisk.fs

Index: src/sys/arch/riscv/conf/majors.riscv
diff -u src/sys/arch/riscv/conf/majors.riscv:1.7 src/sys/arch/riscv/conf/majors.riscv:1.8
--- src/sys/arch/riscv/conf/majors.riscv:1.7	Mon Jan 28 02:29:00 2019
+++ src/sys/arch/riscv/conf/majors.riscv	Sat Mar 14 16:12:15 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.riscv,v 1.7 2019/01/28 02:29:00 dholland Exp $
+#	$NetBSD: majors.riscv,v 1.8 2020/03/14 16:12:15 skrll Exp $
 #
 # Device majors for riscv
 #
@@ -32,7 +32,7 @@ device-major	kttcp		char 71			kttcp
 #device-major	aucom		char 73			aucom
 
 # Majors up to 143 are reserved for machine-dependent drivers.
-# New machine-independent driver majors are assigned in 
+# New machine-independent driver majors are assigned in
 # sys/conf/majors.
 
 include "conf/majors.ws"

Index: src/sys/arch/riscv/include/asm.h
diff -u src/sys/arch/riscv/include/asm.h:1.3 src/sys/arch/riscv/include/asm.h:1.4
--- src/sys/arch/riscv/include/asm.h:1.3	Sat Apr 13 12:41:36 2019
+++ src/sys/arch/riscv/include/asm.h	Sat Mar 14 16:12:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.3 2019/04/13 12:41:36 maya Exp $	*/
+/*	$NetBSD: asm.h,v 1.4 2020/03/14 16:12:16 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
 	REG_L	ra, CALLFRAME_RA(sp);\
 	REG_L	a0, CALLFRAME_S0(sp);\
 	addi	sp, sp, CALLFRAME_SIZ;\
-	.set	pop;	
+	.set	pop;
 
 #ifdef GPROF
 #define	_PROF_PROLOGUE _KERN_MCOUNT
Index: src/sys/arch/riscv/include/pte.h
diff -u src/sys/arch/riscv/include/pte.h:1.3 src/sys/arch/riscv/include/pte.h:1.4
--- src/sys/arch/riscv/include/pte.h:1.3	Sun Jun 16 07:42:52 2019
+++ src/sys/arch/riscv/include/pte.h	Sat Mar 14 16:12:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.3 2019/06/16 07:42:52 maxv Exp $ */
+/* $NetBSD: pte.h,v 1.4 2020/03/14 16:12:16 skrll Exp $ */
 
 /*
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -125,8 +125,8 @@ pte_wire_entry(pt_entry_t pte)
 {
 	return pte | PTE_WIRED;
 }
-
-static inline pt_entry_t   
+
+static inline pt_entry_t
 

CVS commit: src/sys/ufs/lfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 15:35:35 UTC 2020

Modified Files:
src/sys/ufs/lfs: lfs_bio.c lfs_vfsops.c

Log Message:
OR into bp->b_cflags; don't overwrite.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -u -r1.374 -r1.375 src/sys/ufs/lfs/lfs_vfsops.c

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

Modified files:

Index: src/sys/ufs/lfs/lfs_bio.c
diff -u src/sys/ufs/lfs/lfs_bio.c:1.146 src/sys/ufs/lfs/lfs_bio.c:1.147
--- src/sys/ufs/lfs/lfs_bio.c:1.146	Sun Feb 23 08:39:28 2020
+++ src/sys/ufs/lfs/lfs_bio.c	Sat Mar 14 15:35:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_bio.c,v 1.146 2020/02/23 08:39:28 riastradh Exp $	*/
+/*	$NetBSD: lfs_bio.c,v 1.147 2020/03/14 15:35:35 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.146 2020/02/23 08:39:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.147 2020/03/14 15:35:35 ad Exp $");
 
 #include 
 #include 
@@ -735,7 +735,7 @@ lfs_newbuf(struct lfs *fs, struct vnode 
 	bp->b_error = 0;
 	bp->b_resid = 0;
 	bp->b_iodone = lfs_free_aiodone;
-	bp->b_cflags = BC_BUSY | BC_NOCACHE;
+	bp->b_cflags |= BC_BUSY | BC_NOCACHE;
 	bp->b_private = fs;
 
 	mutex_enter(_lock);

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.374 src/sys/ufs/lfs/lfs_vfsops.c:1.375
--- src/sys/ufs/lfs/lfs_vfsops.c:1.374	Sun Feb 23 15:46:42 2020
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sat Mar 14 15:35:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.374 2020/02/23 15:46:42 ad Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.375 2020/03/14 15:35:35 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.374 2020/02/23 15:46:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.375 2020/03/14 15:35:35 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -2127,7 +2127,7 @@ lfs_gop_write(struct vnode *vp, struct v
 	mbp->b_bufsize = npages << PAGE_SHIFT;
 	mbp->b_data = (void *)kva;
 	mbp->b_resid = mbp->b_bcount = bytes;
-	mbp->b_cflags = BC_BUSY|BC_AGE;
+	mbp->b_cflags |= BC_BUSY|BC_AGE;
 	mbp->b_iodone = uvm_aio_aiodone;
 
 	bp = NULL;



CVS commit: src/sys/miscfs/genfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 15:34:24 UTC 2020

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
OR into bp->b_cflags; don't overwrite.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.88 src/sys/miscfs/genfs/genfs_io.c:1.89
--- src/sys/miscfs/genfs/genfs_io.c:1.88	Thu Feb 27 22:12:54 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Mar 14 15:34:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.88 2020/02/27 22:12:54 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.89 2020/03/14 15:34:24 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.88 2020/02/27 22:12:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.89 2020/03/14 15:34:24 ad Exp $");
 
 #include 
 #include 
@@ -615,7 +615,7 @@ genfs_getpages_read(struct vnode *vp, st
 	mbp->b_bufsize = totalbytes;
 	mbp->b_data = (void *)kva;
 	mbp->b_resid = mbp->b_bcount = bytes;
-	mbp->b_cflags = BC_BUSY;
+	mbp->b_cflags |= BC_BUSY;
 	if (async) {
 		mbp->b_flags = B_READ | B_ASYNC;
 		mbp->b_iodone = uvm_aio_aiodone;
@@ -1497,7 +1497,7 @@ genfs_do_io(struct vnode *vp, off_t off,
 	mbp->b_bufsize = len;
 	mbp->b_data = (void *)kva;
 	mbp->b_resid = mbp->b_bcount = bytes;
-	mbp->b_cflags = BC_BUSY | BC_AGE;
+	mbp->b_cflags |= BC_BUSY | BC_AGE;
 	if (async) {
 		mbp->b_flags = brw | B_ASYNC;
 		mbp->b_iodone = iodone;
@@ -1735,7 +1735,7 @@ genfs_compat_gop_write(struct vnode *vp,
 	mutex_exit(vp->v_interlock);
 
 	bp = getiobuf(vp, true);
-	bp->b_cflags = BC_BUSY | BC_AGE;
+	bp->b_cflags |= BC_BUSY | BC_AGE;
 	bp->b_lblkno = offset >> vp->v_mount->mnt_fs_bshift;
 	bp->b_data = (char *)kva;
 	bp->b_bcount = npages << PAGE_SHIFT;



CVS commit: src/sys/kern

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 15:32:51 UTC 2020

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

Log Message:
OR into bp->b_cflags; don't overwrite.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/vfs_wapbl.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_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.104 src/sys/kern/vfs_wapbl.c:1.105
--- src/sys/kern/vfs_wapbl.c:1.104	Sun Mar  8 18:26:59 2020
+++ src/sys/kern/vfs_wapbl.c	Sat Mar 14 15:32:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.104 2020/03/08 18:26:59 ad Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.105 2020/03/14 15:32:51 ad Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.104 2020/03/08 18:26:59 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.105 2020/03/14 15:32:51 ad Exp $");
 
 #include 
 #include 
@@ -922,7 +922,7 @@ wapbl_doio(void *data, size_t len, struc
 
 	bp = getiobuf(devvp, true);
 	bp->b_flags = flags;
-	bp->b_cflags = BC_BUSY;	/* mandatory, asserted by biowait() */
+	bp->b_cflags |= BC_BUSY;	/* mandatory, asserted by biowait() */
 	bp->b_dev = devvp->v_rdev;
 	bp->b_data = data;
 	bp->b_bufsize = bp->b_resid = bp->b_bcount = len;
@@ -997,7 +997,7 @@ wapbl_buffered_write_async(struct wapbl 
 	TAILQ_REMOVE(>wl_iobufs, bp, b_wapbllist);
 
 	bp->b_flags |= B_WRITE;
-	bp->b_cflags = BC_BUSY;	/* mandatory, asserted by biowait() */
+	bp->b_cflags |= BC_BUSY;	/* mandatory, asserted by biowait() */
 	bp->b_oflags = 0;
 	bp->b_bcount = bp->b_resid;
 	BIO_SETPRIO(bp, BPRIO_TIMECRITICAL);



CVS commit: src/sys/kern

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 15:31:29 UTC 2020

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

Log Message:
OR into bp->b_cflags; don't overwrite.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/kern_physio.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_physio.c
diff -u src/sys/kern/kern_physio.c:1.97 src/sys/kern/kern_physio.c:1.98
--- src/sys/kern/kern_physio.c:1.97	Sun Dec  8 19:52:37 2019
+++ src/sys/kern/kern_physio.c	Sat Mar 14 15:31:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_physio.c,v 1.97 2019/12/08 19:52:37 ad Exp $	*/
+/*	$NetBSD: kern_physio.c,v 1.98 2020/03/14 15:31:29 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.97 2019/12/08 19:52:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.98 2020/03/14 15:31:29 ad Exp $");
 
 #include 
 #include 
@@ -283,7 +283,7 @@ physio(void (*strategy)(struct buf *), s
 bp = obp;
 			} else {
 bp = getiobuf(NULL, true);
-bp->b_cflags = BC_BUSY;
+bp->b_cflags |= BC_BUSY;
 			}
 			bp->b_dev = dev;
 			bp->b_proc = p;
@@ -296,7 +296,7 @@ physio(void (*strategy)(struct buf *), s
 			 * raw transfers".
 			 */
 			bp->b_oflags = 0;
-			bp->b_cflags = BC_BUSY;
+			bp->b_cflags |= BC_BUSY;
 			bp->b_flags = flags | B_PHYS | B_RAW;
 			bp->b_iodone = physio_biodone;
 



CVS commit: src/sys/uvm

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 14:15:43 UTC 2020

Modified Files:
src/sys/uvm: uvm_map.c uvm_map.h

Log Message:
- uvmspace_exec(), uvmspace_free(): if pmap_remove_all() returns true the
  pmap is emptied.  Pass UVM_FLAG_VAONLY when clearing out the map and avoid
  needless extra work to tear down each mapping individually.

- uvm_map_lookup_entry(): remove the code to do a linear scan of map entries
  for small maps, in preference to using the RB tree.  It's questionable,
  and I think the code is almost never triggered because the average number
  of map entries has probably exceeded the hard-coded threshold for quite
  some time.

- vm_map_entry: get it aligned on a cacheline boundary, and cluster fields
  used during rbtree lookup at the beginning.


To generate a diff of this commit:
cvs rdiff -u -r1.372 -r1.373 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.78 -r1.79 src/sys/uvm/uvm_map.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/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.372 src/sys/uvm/uvm_map.c:1.373
--- src/sys/uvm/uvm_map.c:1.372	Sun Feb 23 15:46:43 2020
+++ src/sys/uvm/uvm_map.c	Sat Mar 14 14:15:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.372 2020/02/23 15:46:43 ad Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.373 2020/03/14 14:15:43 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.372 2020/02/23 15:46:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.373 2020/03/14 14:15:43 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -141,10 +141,8 @@ UVMMAP_EVCNT_DEFINE(knomerge)
 UVMMAP_EVCNT_DEFINE(map_call)
 UVMMAP_EVCNT_DEFINE(mlk_call)
 UVMMAP_EVCNT_DEFINE(mlk_hint)
-UVMMAP_EVCNT_DEFINE(mlk_list)
 UVMMAP_EVCNT_DEFINE(mlk_tree)
 UVMMAP_EVCNT_DEFINE(mlk_treeloop)
-UVMMAP_EVCNT_DEFINE(mlk_listloop)
 
 const char vmmapbsy[] = "vmmapbsy";
 
@@ -823,8 +821,8 @@ static inline void
 uvm_mapent_copy(struct vm_map_entry *src, struct vm_map_entry *dst)
 {
 
-	memcpy(dst, src, ((char *)>uvm_map_entry_stop_copy) -
-	((char *)src));
+	memcpy(dst, src, sizeof(*dst));
+	dst->flags = 0;
 }
 
 #if defined(DEBUG)
@@ -940,7 +938,7 @@ uvm_map_init_caches(void)
 	 */
 
 	pool_cache_bootstrap(_map_entry_cache, sizeof(struct vm_map_entry),
-	0, 0, 0, "vmmpepl", NULL, IPL_NONE, NULL, NULL, NULL);
+	coherency_unit, 0, 0, "vmmpepl", NULL, IPL_NONE, NULL, NULL, NULL);
 	pool_cache_bootstrap(_vmspace_cache, sizeof(struct vmspace),
 	0, 0, 0, "vmsppl", NULL, IPL_NONE, NULL, NULL, NULL);
 }
@@ -1679,7 +1677,6 @@ uvm_map_lookup_entry(struct vm_map *map,
 struct vm_map_entry **entry	/* OUT */)
 {
 	struct vm_map_entry *cur;
-	bool use_tree = false;
 	UVMHIST_FUNC("uvm_map_lookup_entry");
 	UVMHIST_CALLED(maphist);
 
@@ -1687,95 +1684,41 @@ uvm_map_lookup_entry(struct vm_map *map,
 	(uintptr_t)map, address, (uintptr_t)entry, 0);
 
 	/*
-	 * start looking either from the head of the
-	 * list, or from the hint.
+	 * make a quick check to see if we are already looking at
+	 * the entry we want (which is usually the case).  note also
+	 * that we don't need to save the hint here...  it is the
+	 * same hint (unless we are at the header, in which case the
+	 * hint didn't buy us anything anyway).
 	 */
 
 	cur = map->hint;
-
-	if (cur == >header)
-		cur = cur->next;
-
 	UVMMAP_EVCNT_INCR(mlk_call);
-	if (address >= cur->start) {
-
-		/*
-		 * go from hint to end of list.
-		 *
-		 * but first, make a quick check to see if
-		 * we are already looking at the entry we
-		 * want (which is usually the case).
-		 * note also that we don't need to save the hint
-		 * here... it is the same hint (unless we are
-		 * at the header, in which case the hint didn't
-		 * buy us anything anyway).
-		 */
-
-		if (cur != >header && cur->end > address) {
-			UVMMAP_EVCNT_INCR(mlk_hint);
-			*entry = cur;
-			UVMHIST_LOG(maphist,"<- got it via hint (%#jx)",
-			(uintptr_t)cur, 0, 0, 0);
-			uvm_mapent_check(*entry);
-			return (true);
-		}
-
-		if (map->nentries > 15)
-			use_tree = true;
-	} else {
-
-		/*
-		 * invalid hint.  use tree.
-		 */
-		use_tree = true;
+	if (cur != >header &&
+	address >= cur->start && cur->end > address) {
+		UVMMAP_EVCNT_INCR(mlk_hint);
+		*entry = cur;
+		UVMHIST_LOG(maphist,"<- got it via hint (%#jx)",
+		(uintptr_t)cur, 0, 0, 0);
+		uvm_mapent_check(*entry);
+		return (true);
 	}
-
 	uvm_map_check(map, __func__);
 
-	if (use_tree) {
-		/*
-		 * Simple lookup in the tree.  Happens when the hint is
-		 * invalid, or nentries reach a threshold.
-		 */
-		UVMMAP_EVCNT_INCR(mlk_tree);
-		if (uvm_map_lookup_entry_bytree(map, address, entry)) {
-			goto got;
-		} else {
-			goto failed;
-		}
-	}
-
 	/*
-	 * search linearly
+	 * lookup in the tree.
 	 */
 
-	UVMMAP_EVCNT_INCR(mlk_list);
-	while (cur != >header) {
-		

CVS commit: src

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 14:05:44 UTC 2020

Modified Files:
src/share/man/man9: pmap.9
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/alpha/include: pmap.h
src/sys/arch/arm/arm32: pmap.c
src/sys/arch/arm/include/arm32: pmap.h
src/sys/arch/hppa/include: pmap.h
src/sys/arch/ia64/ia64: pmap.c
src/sys/arch/m68k/include: pmap_motorola.h
src/sys/arch/powerpc/include/ibm4xx: pmap.h
src/sys/arch/powerpc/include/oea: pmap.h
src/sys/arch/sh3/include: pmap.h
src/sys/arch/sparc/include: pmap.h
src/sys/arch/sparc/sparc: pmap.c
src/sys/arch/sparc64/sparc64: pmap.c
src/sys/arch/sun2/include: pmap.h
src/sys/arch/sun3/include: pmap3.h pmap3x.h
src/sys/arch/usermode/usermode: pmap.c
src/sys/arch/vax/include: pmap.h
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c
src/sys/uvm: uvm_pmap.h
src/sys/uvm/pmap: pmap.c

Log Message:
pmap_remove_all(): Return a boolean value to indicate the behaviour.  If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/share/man/man9/pmap.9
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/alpha/include/pmap.h
cvs rdiff -u -r1.398 -r1.399 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hppa/include/pmap.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/m68k/include/pmap_motorola.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/ibm4xx/pmap.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/include/oea/pmap.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sh3/include/pmap.h
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/sparc/include/pmap.h
cvs rdiff -u -r1.366 -r1.367 src/sys/arch/sparc/sparc/pmap.c
cvs rdiff -u -r1.311 -r1.312 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sun2/include/pmap.h
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sun3/include/pmap3.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sun3/include/pmap3x.h
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/usermode/usermode/pmap.c
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/vax/include/pmap.h
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.364 -r1.365 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.39 -r1.40 src/sys/uvm/uvm_pmap.h
cvs rdiff -u -r1.47 -r1.48 src/sys/uvm/pmap/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/share/man/man9/pmap.9
diff -u src/share/man/man9/pmap.9:1.46 src/share/man/man9/pmap.9:1.47
--- src/share/man/man9/pmap.9:1.46	Mon Jan 14 15:56:06 2019
+++ src/share/man/man9/pmap.9	Sat Mar 14 14:05:42 2020
@@ -1,6 +1,6 @@
-.\"	$NetBSD: pmap.9,v 1.46 2019/01/14 15:56:06 wiz Exp $
+.\"	$NetBSD: pmap.9,v 1.47 2020/03/14 14:05:42 ad Exp $
 .\"
-.\" Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2000, 2001, 2002, 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 13, 2019
+.Dd March 14, 2020
 .Dt PMAP 9
 .Os
 .Sh NAME
@@ -63,7 +63,7 @@
 "u_int flags"
 .Ft void
 .Fn "pmap_remove" "pmap_t pmap" "vaddr_t sva" "vaddr_t eva"
-.Ft void
+.Ft bool
 .Fn "pmap_remove_all" "pmap_t pmap"
 .Ft void
 .Fn "pmap_protect" "pmap_t pmap" "vaddr_t sva" "vaddr_t eva" "vm_prot_t prot"
@@ -549,7 +549,7 @@ Remove mappings from the virtual address
 to
 .Fa eva
 from the specified physical map.
-.It void Fn "pmap_remove_all" "pmap_t pmap"
+.It bool Fn "pmap_remove_all" "pmap_t pmap"
 This function is a hint to the
 .Nm pmap
 implementation that all entries in
@@ -581,6 +581,21 @@ mappings immediately in
 or to use the knowledge of the upcoming
 .Fn pmap_remove
 calls to optimize the removals (or to just ignore this call).
+.Pp
+If  all mappings in the address space have been removed,
+.Fn pmap_remove_all
+should return
+.Dv true
+to indicate that that the pmap is now empty.
+In this case UVM will skip all subsequent calls to
+.Fn pmap_remove
+and
+.Fn pmap_update
+for the pmap, that would otherwise be required to clean it out.
+If any mappings could possibly remain,
+.Fn pmap_remove_all
+must return
+.Dv false .
 .It void Fn "pmap_protect" "pmap_t pmap" "vaddr_t sva" "vaddr_t eva" \
 "vm_prot_t prot"
 Set the protection of the mappings in the virtual address range

Index: 

CVS commit: src/sys/uvm

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 13:53:26 UTC 2020

Modified Files:
src/sys/uvm: uvm_pdpolicy_clock.c uvm_pdpolicy_clockpro.c

Log Message:
uvm_pdpolicy: Require a write lock on the object only for dequeue.
No sense in requiring that for enqueue/activate/deactivate.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/uvm/uvm_pdpolicy_clock.c
cvs rdiff -u -r1.23 -r1.24 src/sys/uvm/uvm_pdpolicy_clockpro.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/uvm/uvm_pdpolicy_clock.c
diff -u src/sys/uvm/uvm_pdpolicy_clock.c:1.34 src/sys/uvm/uvm_pdpolicy_clock.c:1.35
--- src/sys/uvm/uvm_pdpolicy_clock.c:1.34	Sun Mar  8 15:01:50 2020
+++ src/sys/uvm/uvm_pdpolicy_clock.c	Sat Mar 14 13:53:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.34 2020/03/08 15:01:50 ad Exp $	*/
+/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $	*/
 /*	NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $	*/
 
 /*-
@@ -98,7 +98,7 @@
 #else /* defined(PDSIM) */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.34 2020/03/08 15:01:50 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $");
 
 #include 
 #include 
@@ -463,7 +463,7 @@ void
 uvmpdpol_pagedeactivate(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 
 	/*
@@ -495,7 +495,7 @@ void
 uvmpdpol_pageactivate(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 
 	uvmpdpol_set_intent(pg, PQ_INTENT_A);
@@ -536,7 +536,7 @@ void
 uvmpdpol_pageenqueue(struct vm_page *pg)
 {
 
-	KASSERT(uvm_page_owner_locked_p(pg, true));
+	KASSERT(uvm_page_owner_locked_p(pg, false));
 	KASSERT(mutex_owned(>interlock));
 
 	uvmpdpol_set_intent(pg, PQ_INTENT_E);

Index: src/sys/uvm/uvm_pdpolicy_clockpro.c
diff -u src/sys/uvm/uvm_pdpolicy_clockpro.c:1.23 src/sys/uvm/uvm_pdpolicy_clockpro.c:1.24
--- src/sys/uvm/uvm_pdpolicy_clockpro.c:1.23	Thu Jan 30 12:28:51 2020
+++ src/sys/uvm/uvm_pdpolicy_clockpro.c	Sat Mar 14 13:53:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdpolicy_clockpro.c,v 1.23 2020/01/30 12:28:51 ad Exp $	*/
+/*	$NetBSD: uvm_pdpolicy_clockpro.c,v 1.24 2020/03/14 13:53:26 ad Exp $	*/
 
 /*-
  * Copyright (c)2005, 2006 YAMAMOTO Takashi,
@@ -43,7 +43,7 @@
 #else /* defined(PDSIM) */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clockpro.c,v 1.23 2020/01/30 12:28:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clockpro.c,v 1.24 2020/03/14 13:53:26 ad Exp $");
 
 #include "opt_ddb.h"
 
@@ -645,7 +645,7 @@ clockpro_movereferencebit(struct vm_page
 	bool referenced;
 
 	KASSERT(mutex_owned());
-	KASSERT(!locked || uvm_page_owner_locked_p(pg));
+	KASSERT(!locked || uvm_page_owner_locked_p(pg, false));
 	if (!locked) {
 		/*
 		 * acquire interlock to stablize page identity.



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

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 13:50:46 UTC 2020

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Put ACPI idle under ACPICPU_ENABLE_C3 until the wrinkles are ironed out.
This seems well written and basically all good, but currently doesn't enter
a low power state, and imposes a big performance penalty.  Proposed on
port-i386 & port-amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/x86/acpi/acpi_cpu_md.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/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.81 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.82
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.81	Tue Nov  5 20:21:34 2019
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Sat Mar 14 13:50:46 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.81 2019/11/05 20:21:34 maxv Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.81 2019/11/05 20:21:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $");
 
 #include 
 #include 
@@ -103,8 +103,10 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.
 
 #define FID_TO_VCO_FID(fidd)	(((fid) < 8) ? (8 + ((fid) << 1)) : (fid))
 
+#ifdef ACPICPU_ENABLE_C3
 static char	  native_idle_text[16];
 void		(*native_idle)(void) = NULL;
+#endif
 
 static int	 acpicpu_md_quirk_piix4(const struct pci_attach_args *);
 static void	 acpicpu_md_pstate_hwf_reset(void *, void *);
@@ -348,6 +350,12 @@ acpicpu_md_quirk_c1e(void)
 int
 acpicpu_md_cstate_start(struct acpicpu_softc *sc)
 {
+#ifdef ACPICPU_ENABLE_C3
+	/*
+	 * XXX There are performance problems with the ACPI idle loop, and
+	 * it does not enter deep sleep.  Once those are resolved it'll be
+	 * re-enabled.
+	 */
 	const size_t size = sizeof(native_idle_text);
 	struct acpicpu_cstate *cs;
 	bool ipi = false;
@@ -369,6 +377,7 @@ acpicpu_md_cstate_start(struct acpicpu_s
 	}
 
 	x86_cpu_idle_set(acpicpu_cstate_idle, "acpi", ipi);
+#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }
@@ -376,6 +385,12 @@ acpicpu_md_cstate_start(struct acpicpu_s
 int
 acpicpu_md_cstate_stop(void)
 {
+#ifdef ACPICPU_ENABLE_C3
+	/*
+	 * XXX There are performance problems with the ACPI idle loop, and
+	 * it does not enter deep sleep.  Once those are resolved it'll be
+	 * re-enabled.
+	 */
 	static char text[16];
 	void (*func)(void);
 	bool ipi;
@@ -393,6 +408,7 @@ acpicpu_md_cstate_stop(void)
 	 * out from the ACPI idle-loop before detachment.
 	 */
 	xc_barrier(0);
+#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }



CVS commit: src/sys/fs/tmpfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 13:39:36 UTC 2020

Modified Files:
src/sys/fs/tmpfs: tmpfs_vnops.c

Log Message:
tmpfs_inactive(): do like other file systems and truncate the file if it
has been deleted.  Otherwise VFS will try to write cached data "back to
disc", which in the case of a UAO means needless page deactivations and
the resulting TLB shootdowns.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/fs/tmpfs/tmpfs_vnops.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.134 src/sys/fs/tmpfs/tmpfs_vnops.c:1.135
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.134	Sun Feb 23 15:46:40 2020
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Sat Mar 14 13:39:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.134 2020/02/23 15:46:40 ad Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.135 2020/03/14 13:39:36 ad Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.134 2020/02/23 15:46:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.135 2020/03/14 13:39:36 ad Exp $");
 
 #include 
 #include 
@@ -1040,6 +1040,7 @@ tmpfs_inactive(void *v)
 	} */ *ap = v;
 	vnode_t *vp = ap->a_vp;
 	tmpfs_node_t *node;
+	int error = 0;
 
 	KASSERT(VOP_ISLOCKED(vp));
 
@@ -1049,12 +1050,21 @@ tmpfs_inactive(void *v)
 		 * Mark node as dead by setting its generation to zero.
 		 */
 		atomic_and_32(>tn_gen, ~TMPFS_NODE_GEN_MASK);
+
+		/*
+		 * If the file has been deleted, truncate it, otherwise VFS
+		 * will quite rightly try to write back dirty data, which in
+		 * the case of tmpfs/UAO means needless page deactivations.
+		 */
+		if (vp->v_type == VREG) {
+			error = tmpfs_reg_resize(vp, 0);
+		}
 		*ap->a_recycle = true;
 	} else {
 		*ap->a_recycle = false;
 	}
 
-	return 0;
+	return error;
 }
 
 int



CVS commit: src/sys/fs/tmpfs

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 13:37:49 UTC 2020

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
tmpfs_reg_resize(): do nothing if newsize == oldsize.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/fs/tmpfs/tmpfs_subr.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.106 src/sys/fs/tmpfs/tmpfs_subr.c:1.107
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.106	Sun Feb 23 15:46:40 2020
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Sat Mar 14 13:37:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.106 2020/02/23 15:46:40 ad Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.107 2020/03/14 13:37:49 ad Exp $	*/
 
 /*
  * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.106 2020/02/23 15:46:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.107 2020/03/14 13:37:49 ad Exp $");
 
 #include 
 #include 
@@ -914,6 +914,10 @@ tmpfs_reg_resize(struct vnode *vp, off_t
 	newpages = round_page(newsize) >> PAGE_SHIFT;
 	KASSERT(oldpages == node->tn_spec.tn_reg.tn_aobj_pages);
 
+	if (newsize == oldsize) {
+		return 0;
+	}
+
 	if (newpages > oldpages) {
 		/* Increase the used-memory counter if getting extra pages. */
 		if (!tmpfs_mem_incr(tmp, (newpages - oldpages) << PAGE_SHIFT)) {



CVS commit: src/sys/arch/sparc/sparc

2020-03-14 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 14 13:34:44 UTC 2020

Modified Files:
src/sys/arch/sparc/sparc: intr.c

Log Message:
sparc cpu_intr_p(): try to work around l_cpu not being set early on by
using curcpu().


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/sparc/sparc/intr.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/intr.c
diff -u src/sys/arch/sparc/sparc/intr.c:1.123 src/sys/arch/sparc/sparc/intr.c:1.124
--- src/sys/arch/sparc/sparc/intr.c:1.123	Tue Dec  3 15:20:59 2019
+++ src/sys/arch/sparc/sparc/intr.c	Sat Mar 14 13:34:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.123 2019/12/03 15:20:59 riastradh Exp $ */
+/*	$NetBSD: intr.c,v 1.124 2020/03/14 13:34:43 ad Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.123 2019/12/03 15:20:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.124 2020/03/14 13:34:43 ad Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_sparc_arch.h"
@@ -897,7 +897,7 @@ cpu_intr_p(void)
 	do {
 		ncsw = l->l_ncsw;
 		__insn_barrier();
-		idepth = l->l_cpu->ci_idepth;
+		idepth = curcpu()->ci_idepth;
 		__insn_barrier();
 	} while (__predict_false(ncsw != l->l_ncsw));
 



CVS commit: src

2020-03-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 14 13:08:18 UTC 2020

Modified Files:
src/share/man/man4: pms.4
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Make up_down_emulation useful for single-button clickpads

On devices such as the Thinkpad X250, the clickpad can be pressed
to generate mouse button events 1 and 2. There are also additional
physical buttons which the pms(4) driver recognizes as "up/down" buttons
(mouse buttons 3 and 4). Allow these to be remapped to buttons 1 and 2
and used like normal touchpad buttons with the following sysctl:

# sysctl -w hw.synaptics.up_down_emulation=3

While here, adjust the existing "middle button emulation"
(hw.synaptics.up_down_emulation=1) so it works with single-button
clickpads.

XXX: 3 may be a more useful default than the current default,
depending on hardware availability of touchpads with "up/down buttons".

Update the documentation accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/share/man/man4/pms.4
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pckbport/synaptics.c

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/pms.4
diff -u src/share/man/man4/pms.4:1.34 src/share/man/man4/pms.4:1.35
--- src/share/man/man4/pms.4:1.34	Mon Feb 10 16:13:48 2020
+++ src/share/man/man4/pms.4	Sat Mar 14 13:08:18 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.34 2020/02/10 16:13:48 ryoon Exp $
+.\" $NetBSD: pms.4,v 1.35 2020/03/14 13:08:18 nia Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -105,10 +105,17 @@ variables control behavior of Synaptics 
 If the touchpad reports the existence of Up/Down buttons, this value
 determines if they should be reported as button 4 and 5 events or if
 they should be used to emulate some other event.
-When set to 0, report Up/Down events as buttons 4 and 5.
-When set to 1, the Up and Down buttons are both mapped to the middle button.
-When set to 2 (default), the Up and Down buttons are used for Z-axis
+.Bl -bullet
+.It
+If set to 0, Up/Down events generate button 4 and 5 clicks.
+.It
+If set to 1, Up/Down events generate middle button clicks.
+.It
+If set to 2 (default), the Up and Down buttons are used for Z-axis
 emulation, which more closely resembles how mouse wheels operate.
+.It
+If set to 3, Up/Down events generate left/right clicks.
+.El
 .It Dv hw.synaptics.up_down_motion_delta
 When the Up/Down buttons are used for Z-axis emulation, this value specifies
 the emulated delta-Z value per click.
@@ -139,9 +146,14 @@ reported pressure drops below this value
 More recent touchpads can report the presence of more than one finger
 on the pad.
 This value determines how such events are used.
+.Bl -bullet
+.It
 If set to 0 (default), two-finger events are ignored.
+.It
 If set to 1, two-finger events generate a right button click.
+.It
 If set to 2, two-finger events generate a middle button click.
+.El
 .It Dv hw.synaptics.scale_x
 .It Dv hw.synaptics.scale_y
 .It Dv hw.synaptics.scale_z

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.54 src/sys/dev/pckbport/synaptics.c:1.55
--- src/sys/dev/pckbport/synaptics.c:1.54	Tue Feb 25 21:41:38 2020
+++ src/sys/dev/pckbport/synaptics.c	Sat Mar 14 13:08:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.54 2020/02/25 21:41:38 ryoon Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.55 2020/03/14 13:08:18 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.54 2020/02/25 21:41:38 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.55 2020/03/14 13:08:18 nia Exp $");
 
 #include 
 #include 
@@ -852,8 +852,11 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG
 		return error;
 
 	/* Sanity check the params. */
-	if (node.sysctl_num == synaptics_up_down_emul_nodenum ||
-	node.sysctl_num == synaptics_two_fingers_emul_nodenum) {
+	if (node.sysctl_num == synaptics_up_down_emul_nodenum) {
+		if (t < 0 || t > 3)
+			return (EINVAL);
+	} else
+	if (node.sysctl_num == synaptics_two_fingers_emul_nodenum) {
 		if (t < 0 || t > 2)
 			return (EINVAL);
 	} else
@@ -1092,13 +1095,29 @@ pms_synaptics_parse(struct pms_softc *ps
 			/* Old style Middle Button. */
 			sp.sp_middle = (psc->packet[0] & PMS_LBUTMASK) ^
 			(psc->packet[3] & PMS_LBUTMASK);
-		} else if (synaptics_up_down_emul == 1) {
+		} else if (synaptics_up_down_emul != 1) {
+			sp.sp_middle = 0;
+		}
+
+		switch (synaptics_up_down_emul) {
+		case 1:
 			/* Do middle button emulation using up/down buttons */
 			sp.sp_middle = sp.sp_up | sp.sp_down;
 			sp.sp_up = sp.sp_down = 0;
-		} else
-			sp.sp_middle = 0;
-
+			break;
+		case 3:
+			/* Do left/right button emulation using up/down buttons */
+			sp.sp_left = sp.sp_up;
+			sp.sp_right = sp.sp_down;
+			sp.sp_up = sp.sp_down = 0;
+			

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

2020-03-14 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Mar 14 11:52:13 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennet_checksum.c

Log Message:
make the packet length check less strict, allow the physical packet longer
than IP payload

this fixes problem where checksum was not recomputed for short
packets coming from Windows DOMU on same physical host, seems Windows
does some padding; reported by sborrill@

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/xen/xennet_checksum.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/xen/xennet_checksum.c
diff -u src/sys/arch/xen/xen/xennet_checksum.c:1.3 src/sys/arch/xen/xen/xennet_checksum.c:1.4
--- src/sys/arch/xen/xen/xennet_checksum.c:1.3	Thu Nov 22 16:17:10 2007
+++ src/sys/arch/xen/xen/xennet_checksum.c	Sat Mar 14 11:52:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xennet_checksum.c,v 1.3 2007/11/22 16:17:10 bouyer Exp $	*/
+/*	$NetBSD: xennet_checksum.c,v 1.4 2020/03/14 11:52:12 jdolecek Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.3 2007/11/22 16:17:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.4 2020/03/14 11:52:12 jdolecek Exp $");
 
 #include 
 #include 
@@ -124,7 +124,7 @@ xennet_checksum_fill(struct mbuf **mp)
 	nxt = iph->ip_p;
 	iphlen = iph->ip_hl * 4;
 	iplen = ntohs(iph->ip_len);
-	if (ehlen + iplen != m->m_pkthdr.len) {
+	if (ehlen + iplen > m->m_pkthdr.len) {
 		return EINVAL;
 	}
 	if (nxt == IPPROTO_UDP) {



CVS commit: src/usr.bin/midirecord

2020-03-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Mar 14 09:01:11 UTC 2020

Modified Files:
src/usr.bin/midirecord: midirecord.1

Log Message:
Sort sections. Fix date.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/midirecord/midirecord.1

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

Modified files:

Index: src/usr.bin/midirecord/midirecord.1
diff -u src/usr.bin/midirecord/midirecord.1:1.7 src/usr.bin/midirecord/midirecord.1:1.8
--- src/usr.bin/midirecord/midirecord.1:1.7	Sat Mar 14 08:09:55 2020
+++ src/usr.bin/midirecord/midirecord.1	Sat Mar 14 09:01:11 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: midirecord.1,v 1.7 2020/03/14 08:09:55 mrg Exp $
+.\"	$NetBSD: midirecord.1,v 1.8 2020/03/14 09:01:11 wiz Exp $
 .\"
 .\" Copyright (c) 1998, 1999, 2001, 2002, 2010, 2014, 2015, 2020 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Friday 13, 2020
+.Dd March 13, 2020
 .Dt MIDIRECORD 1
 .Os
 .Sh NAME
@@ -105,6 +105,11 @@ Format is [hh:]mm:ss[.dd].
 .It Fl V
 Be verbose.
 .El
+.Sh ENVIRONMENT
+.Bl -tag -width MIDIDEVICE
+.It Ev MIDIDEVICE
+the midi device to be used.
+.El
 .Sh EXAMPLES
 You can use
 .Nm
@@ -134,11 +139,6 @@ set to CC#6 (Control Data Entry MSB) tur
 For completeness, setting both CC#62 and CC#63 for the parameter
 number, as well as CC#6 and CC#26 (Control Data Entry MSB) to 0
 provides a complete NRPN control message.
-.Sh ENVIRONMENT
-.Bl -tag -width MIDIDEVICE
-.It Ev MIDIDEVICE
-the midi device to be used.
-.El
 .Sh SEE ALSO
 .Xr midiplay 1 ,
 .Xr midi 4 ,



CVS commit: src/usr.bin/midirecord

2020-03-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Mar 14 08:09:55 UTC 2020

Modified Files:
src/usr.bin/midirecord: midirecord.1

Log Message:
add an example of using midirecord(1) to learn about how device
specific MIDI messages are formed, allowing their use from MIDI
input files, not just the device controls.

using this method, i can now control the voice mode type on my
new synth.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/midirecord/midirecord.1

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

Modified files:

Index: src/usr.bin/midirecord/midirecord.1
diff -u src/usr.bin/midirecord/midirecord.1:1.6 src/usr.bin/midirecord/midirecord.1:1.7
--- src/usr.bin/midirecord/midirecord.1:1.6	Sun Dec 11 08:40:10 2016
+++ src/usr.bin/midirecord/midirecord.1	Sat Mar 14 08:09:55 2020
@@ -1,6 +1,6 @@
-.\"	$NetBSD: midirecord.1,v 1.6 2016/12/11 08:40:10 mrg Exp $
+.\"	$NetBSD: midirecord.1,v 1.7 2020/03/14 08:09:55 mrg Exp $
 .\"
-.\" Copyright (c) 1998, 1999, 2001, 2002, 2010, 2014, 2015 Matthew R. Green
+.\" Copyright (c) 1998, 1999, 2001, 2002, 2010, 2014, 2015, 2020 Matthew R. Green
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 22, 2015
+.Dd Friday 13, 2020
 .Dt MIDIRECORD 1
 .Os
 .Sh NAME
@@ -105,6 +105,35 @@ Format is [hh:]mm:ss[.dd].
 .It Fl V
 Be verbose.
 .El
+.Sh EXAMPLES
+You can use
+.Nm
+to observe activity on a MIDI bus using the
+.Fl D
+and
+.Fl V
+options and learn about device-specific MIDI messages.
+.Pp
+For instance, to determine the MIDI messages needed to switch to ARP mode
+on a Korg minilogue XD synthesizer, which does not document any control
+change or non-registered parameter numbers for this function but does
+document that ARP is part of the
+.Dq VOICE TYPE MODE ,
+parameter these messages were seen:
+.Pp
+.Dl midi_event_chn_common_to_output:444: MIDI_CTL_CHANGE: channel 0 ctrl 62 val 10
+.Dl midi_event_chn_common_to_output:444: MIDI_CTL_CHANGE: channel 0 ctrl 6 val 1
+.Pp
+which shows that CC#62 (hexadecimal) was set to value 10 (also
+hexadecimal), and that CC#6 was set to value 1.
+As CC#62 is also the least significant byte of the non-registered
+parameter number, we can guess that NRPN 0,62 controls the
+.Dq VOICE MODE TYPE
+parameter documented in the synthesizer manual, and that the value 1
+set to CC#6 (Control Data Entry MSB) turns on ARP mode.
+For completeness, setting both CC#62 and CC#63 for the parameter
+number, as well as CC#6 and CC#26 (Control Data Entry MSB) to 0
+provides a complete NRPN control message.
 .Sh ENVIRONMENT
 .Bl -tag -width MIDIDEVICE
 .It Ev MIDIDEVICE
@@ -129,3 +158,7 @@ SYSEX, LOCAL and FULLSIZE messages are n
 .Nx
 .Xr sequencer 4
 device does not generate them.
+.Pp
+.Nm
+will hang after the timeout waiting for the very next message before
+it will exit and finish writing the file.



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

2020-03-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 14 06:39:20 UTC 2020

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

Log Message:
hopefully fix builds


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.238 src/distrib/sets/lists/debug/shl.mi:1.239
--- src/distrib/sets/lists/debug/shl.mi:1.238	Sun Mar  8 22:42:35 2020
+++ src/distrib/sets/lists/debug/shl.mi	Sat Mar 14 06:39:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.238 2020/03/08 22:42:35 mgorny Exp $
+# $NetBSD: shl.mi,v 1.239 2020/03/14 06:39:20 skrll Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
@@ -26,7 +26,8 @@
 ./usr/libdata/debug/lib/libradius.so.4.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/librumpclient.so.0.0.debug		comp-rump-debug	debug,dynamicroot,rump
 ./usr/libdata/debug/lib/librumpres.so.0.0.debug			comp-rump-debug	debug,dynamicroot,rump
-./usr/libdata/debug/lib/libterminfo.so.1.0.debug		comp-sys-debug	debug,dynamicroot
+./usr/libdata/debug/lib/libterminfo.so.1.0.debug		comp-sys-debug	debug,obsolete,dynamicroot
+./usr/libdata/debug/lib/libterminfo.so.2.0.debug		comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libumem.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
 ./usr/libdata/debug/lib/libutil.so.7.23.debug			comp-obsolete	debug,obsolete,compatfile
 ./usr/libdata/debug/lib/libutil.so.7.24.debug			comp-sys-debug	debug,dynamicroot
@@ -93,7 +94,8 @@
 ./usr/libdata/debug/usr/lib/libcurses.so.7.0.debug		comp-obsolete	debug,obsolete,compatfile
 ./usr/libdata/debug/usr/lib/libcurses.so.7.1.debug		comp-obsolete	debug,obsolete,compatfile
 ./usr/libdata/debug/usr/lib/libcurses.so.7.2.debug		comp-sys-debug	debug,obsolete,compatfile
-./usr/libdata/debug/usr/lib/libcurses.so.8.2.debug		comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libcurses.so.8.2.debug		comp-sys-debug	debug,obsolete,compatfile
+./usr/libdata/debug/usr/lib/libcurses.so.9.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libdes.so.12.0.debug			comp-crypto-debug	debug,compatfile,openssl=10
 ./usr/libdata/debug/usr/lib/libdes.so.14.0.debug			comp-crypto-debug	debug,compatfile,openssl=11
 ./usr/libdata/debug/usr/lib/libdevmapper.so.1.0.debug		comp-lvm-debug	debug,compatfile,lvm
@@ -112,7 +114,8 @@
 ./usr/libdata/debug/usr/lib/libfetch.so.3.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libfido2.so.2.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libform.so.6.0.debug		comp-sys-debug	debug,obsolete,compatfile
-./usr/libdata/debug/usr/lib/libform.so.7.0.debug		comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libform.so.7.0.debug		comp-sys-debug	debug,obsolete,compatfile
+./usr/libdata/debug/usr/lib/libform.so.8.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libg2c.so.2.0.debug			comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/libgcc_s.so.1.0.debug		comp-sys-debug	debug,compatfile,gcc
 ./usr/libdata/debug/usr/lib/libgmp.so.10.2.debug		comp-obsolete	obsolete
@@ -159,7 +162,8 @@
 ./usr/libdata/debug/usr/lib/libm.so.0.12.debug			comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmagic.so.6.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmenu.so.6.0.debug		comp-sys-debug	debug,obsolete,compatfile
-./usr/libdata/debug/usr/lib/libmenu.so.7.0.debug		comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libmenu.so.7.0.debug		comp-sys-debug	debug,obsolete,compatfile
+./usr/libdata/debug/usr/lib/libmenu.so.8.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmj.so.1.0.debug			comp-crypto-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmpc.so.2.0.debug			comp-obsolete	debug,compatfile,obsolete
 ./usr/libdata/debug/usr/lib/libmpfr.so.4.1.debug		comp-obsolete	debug,compatfile,obsolete
@@ -174,7 +178,8 @@
 ./usr/libdata/debug/usr/lib/libp2k.so.2.0.debug			comp-puffs-debug	debug,compatfile,rump
 ./usr/libdata/debug/usr/lib/libpam.so.4.1.debug			comp-sys-debug	debug,compatfile,pam
 ./usr/libdata/debug/usr/lib/libpanel.so.1.0.debug		comp-sys-debug	debug,obsolete,compatfile
-./usr/libdata/debug/usr/lib/libpanel.so.2.0.debug		comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libpanel.so.2.0.debug		comp-sys-debug	debug,obsolete,compatfile
+./usr/libdata/debug/usr/lib/libpanel.so.3.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libpcap.so.8.0.debug		comp-net-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libpci.so.2.2.debug			comp-sys-debug	debug,compatfile