CVS commit: src/tests/lib/libcurses/check_files

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:37:24 UTC 2019

Modified Files:
src/tests/lib/libcurses/check_files: wprintw_refresh.chk

Log Message:
Provide correct validation after curses change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/tests/lib/libcurses/check_files/wprintw_refresh.chk

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

Modified files:

Index: src/tests/lib/libcurses/check_files/wprintw_refresh.chk
diff -u src/tests/lib/libcurses/check_files/wprintw_refresh.chk:1.1 src/tests/lib/libcurses/check_files/wprintw_refresh.chk:1.2
--- src/tests/lib/libcurses/check_files/wprintw_refresh.chk:1.1	Sun Apr 10 09:55:09 2011
+++ src/tests/lib/libcurses/check_files/wprintw_refresh.chk	Sun May 12 02:37:24 2019
@@ -1 +1,2 @@
-cup3;6Xhellocup3;10X
\ No newline at end of file
+cup3;6Xhello
+ 
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:37:24 UTC 2019

Modified Files:
src/tests/lib/libcurses/check_files: wprintw_refresh.chk

Log Message:
Provide correct validation after curses change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/tests/lib/libcurses/check_files/wprintw_refresh.chk

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



CVS commit: src/lib/libcurses

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:29:00 UTC 2019

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Fix _cursesi_addwchar so that it performs line wrap. SUSv2 says
add_wch line wraps and updates position.  Since wrap is done we are
not past EOL.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libcurses/addbytes.c

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



CVS commit: src/lib/libcurses

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:29:00 UTC 2019

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Fix _cursesi_addwchar so that it performs line wrap. SUSv2 says
add_wch line wraps and updates position.  Since wrap is done we are
not past EOL.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libcurses/addbytes.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/addbytes.c
diff -u src/lib/libcurses/addbytes.c:1.49 src/lib/libcurses/addbytes.c:1.50
--- src/lib/libcurses/addbytes.c:1.49	Thu Nov 15 03:17:51 2018
+++ src/lib/libcurses/addbytes.c	Sun May 12 02:29:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.49 2018/11/15 03:17:51 uwe Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.50 2019/05/12 02:29:00 blymn Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c	8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.49 2018/11/15 03:17:51 uwe Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.50 2019/05/12 02:29:00 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -564,6 +564,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 	lp->nsp);
 	__CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: add rest columns (%d:%d)\n",
 		sx + 1, sx + cw - 1);
+	__CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: *x = %d, win->maxx = %d\n", *x, win->maxx);
 #endif /* DEBUG */
 	for (tp = lp + 1, *x = sx + 1; *x - sx <= cw - 1; tp++, (*x)++) {
 		if (tp->nsp) {
@@ -577,12 +578,27 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 	}
 
 	if (*x == win->maxx) {
-		(*lnp)->flags |= __ISPASTEOL;
+#ifdef DEBUG
+	__CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: do line wrap\n");
+#endif /* DEBUG */
 		newx = win->maxx - 1 + win->ch_off;
 		if (newx > *(*lnp)->lastchp)
 			*(*lnp)->lastchp = newx;
 		__touchline(win, *y, sx, (int) win->maxx - 1);
-		*x = win->curx = sx;
+		*x = sx = 0;
+		if (*y == win->scr_b) {
+			if (!(win->flags & __SCROLLOK))
+return ERR;
+			PSYNCH_OUT;
+			scroll(win);
+			PSYNCH_IN;
+		} else {
+			(*y)++;
+		}
+		lp = >alines[*y]->line[0];
+		(*lnp) = win->alines[*y];
+		win->curx = *x;
+		win->cury = *y;
 	} else {
 		win->curx = *x;
 
@@ -612,7 +628,8 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 	}
 
 #ifdef DEBUG
-	__CTRACE(__CTRACE_INPUT, "add_wch: %d : 0x%x\n", lp->ch, lp->attr);
+	__CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: %d : 0x%x\n", lp->ch, lp->attr);
+	__CTRACE(__CTRACE_INPUT, "_cursesi_addwchar: *x = %d, *y = %d, win->maxx = %d\n", *x, *y, win->maxx);
 #endif /* DEBUG */
 	__sync(win);
 	return OK;



CVS commit: src/lib/libcurses

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:19:23 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Add more debug to _wnoutrefresh


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/lib/libcurses/refresh.c

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



CVS commit: src/lib/libcurses

2019-05-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun May 12 02:19:23 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Add more debug to _wnoutrefresh


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/lib/libcurses/refresh.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/refresh.c
diff -u src/lib/libcurses/refresh.c:1.108 src/lib/libcurses/refresh.c:1.109
--- src/lib/libcurses/refresh.c:1.108	Wed Apr 24 07:09:44 2019
+++ src/lib/libcurses/refresh.c	Sun May 12 02:19:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.108 2019/04/24 07:09:44 blymn Exp $	*/
+/*	$NetBSD: refresh.c,v 1.109 2019/05/12 02:19:23 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.108 2019/04/24 07:09:44 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.109 2019/05/12 02:19:23 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -100,7 +100,7 @@ wnoutrefresh(WINDOW *win)
 {
 
 #ifdef DEBUG
-	__CTRACE(__CTRACE_REFRESH, "wnoutrefresh: win %p\n", win);
+	__CTRACE(__CTRACE_REFRESH, "wnoutrefresh: win %p, begy %d, begx %d, maxy %d, maxx %d\n", win, win->begy, win->begx, win->maxy, win->maxx);
 #endif
 
 	return _wnoutrefresh(win, 0, 0, win->begy, win->begx,
@@ -262,12 +262,18 @@ _wnoutrefresh(WINDOW *win, int begy, int
 		"_wnoutrefresh: %s wy %d\tf %d\tl %d\tflags %x\n",
 		_wintype, dy_off, *dwlp->firstchp, *dwlp->lastchp, dwlp->flags);
 		__CTRACE(__CTRACE_REFRESH,
-		"_wnoutrefresh: %s maxx %d\tch_off %d\n",
-		_wintype, dwin->maxx, dwin->ch_off);
+		"_wnoutrefresh: %s maxx %d\tch_off %d wlp %p\n",
+		_wintype, dwin->maxx, dwin->ch_off, wlp);
 #endif
 		if (((wlp->flags & (__ISDIRTY | __ISFORCED)) == 0) &&
 		((dwlp->flags & (__ISDIRTY | __ISFORCED)) == 0))
 			continue;
+#ifdef DEBUG
+		__CTRACE(__CTRACE_REFRESH,
+		"_wnoutrefresh: line is dirty\n");
+#endif
+
+		wlp = swin->alines[wy];
 		vlp = screen->__virtscr->alines[y_off];
 
 		if ((*wlp->firstchp < maxx + swin->ch_off &&
@@ -308,6 +314,9 @@ _wnoutrefresh(WINDOW *win, int begy, int
 wy, wx, y_off, x_off,
 unctrl(wlp->line[wx].ch),
 wlp->line[wx].attr);
+__CTRACE(__CTRACE_REFRESH, " (curdest %s, 0x%x)",
+unctrl(vlp->line[x_off].ch),
+vlp->line[x_off].attr);
 #endif
 /* Copy character */
 vlp->line[x_off].ch = wlp->line[wx].ch;



CVS commit: src/etc/rc.d

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 01:50:14 UTC 2019

Modified Files:
src/etc/rc.d: Makefile

Log Message:
No change...   Previous log message should have said:

Install rc.d/smtoff


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/etc/rc.d/Makefile

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

Modified files:

Index: src/etc/rc.d/Makefile
diff -u src/etc/rc.d/Makefile:1.103 src/etc/rc.d/Makefile:1.104
--- src/etc/rc.d/Makefile:1.103	Sun May 12 01:33:47 2019
+++ src/etc/rc.d/Makefile	Sun May 12 01:50:14 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.103 2019/05/12 01:33:47 kre Exp $
+# $NetBSD: Makefile,v 1.104 2019/05/12 01:50:14 kre Exp $
 
 .include 
 



CVS commit: src/etc/rc.d

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 01:50:14 UTC 2019

Modified Files:
src/etc/rc.d: Makefile

Log Message:
No change...   Previous log message should have said:

Install rc.d/smtoff


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/etc/rc.d/Makefile

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



CVS commit: src/etc/defaults

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 01:45:25 UTC 2019

Modified Files:
src/etc/defaults: rc.conf

Log Message:
revert previous.   somehowI failedto see that was already done.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/etc/defaults/rc.conf

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.149 src/etc/defaults/rc.conf:1.150
--- src/etc/defaults/rc.conf:1.149	Sun May 12 01:33:47 2019
+++ src/etc/defaults/rc.conf	Sun May 12 01:45:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.149 2019/05/12 01:33:47 kre Exp $
+#	$NetBSD: rc.conf,v 1.150 2019/05/12 01:45:25 kre Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -340,7 +340,6 @@ autofs=NO		automount_flags=""
 apmd=NO			apmd_flags=""		# APM power management daemon.
 powerd=NO		powerd_flags=""		# power management daemon
 screenblank=NO		screenblank_flags=""	# wscons and FBIO screenblanker
-smtoff=NO
 
 moused=NO	# serial mouse handler
 			moused_flags="-p /dev/tty00"



CVS commit: src/etc/defaults

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 01:45:25 UTC 2019

Modified Files:
src/etc/defaults: rc.conf

Log Message:
revert previous.   somehowI failedto see that was already done.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/etc/defaults/rc.conf

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



Re: CVS commit: src/etc

2019-05-11 Thread Robert Elz
Sorry about commit msg.  should have said...

install rc.d/smtoff and provide defaults/rc.conf
setting for it

Attempting to work from my phone while waiting
for car to be serviced



CVS commit: src/etc

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 01:33:47 UTC 2019

Modified Files:
src/etc/defaults: rc.conf
src/etc/rc.d: Makefile

Log Message:
install rc.d


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/etc/defaults/rc.conf
cvs rdiff -u -r1.102 -r1.103 src/etc/rc.d/Makefile

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.148 src/etc/defaults/rc.conf:1.149
--- src/etc/defaults/rc.conf:1.148	Sat May 11 19:31:03 2019
+++ src/etc/defaults/rc.conf	Sun May 12 01:33:47 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.148 2019/05/11 19:31:03 maxv Exp $
+#	$NetBSD: rc.conf,v 1.149 2019/05/12 01:33:47 kre Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -340,6 +340,7 @@ autofs=NO		automount_flags=""
 apmd=NO			apmd_flags=""		# APM power management daemon.
 powerd=NO		powerd_flags=""		# power management daemon
 screenblank=NO		screenblank_flags=""	# wscons and FBIO screenblanker
+smtoff=NO
 
 moused=NO	# serial mouse handler
 			moused_flags="-p /dev/tty00"

Index: src/etc/rc.d/Makefile
diff -u src/etc/rc.d/Makefile:1.102 src/etc/rc.d/Makefile:1.103
--- src/etc/rc.d/Makefile:1.102	Thu Apr 25 11:21:34 2019
+++ src/etc/rc.d/Makefile	Sun May 12 01:33:47 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.102 2019/04/25 11:21:34 roy Exp $
+# $NetBSD: Makefile,v 1.103 2019/05/12 01:33:47 kre Exp $
 
 .include 
 
@@ -37,7 +37,7 @@ CONFIGFILES=\
 		racoon rpcbind raidframe raidframeparity random_seed rarpd \
 		rbootd resize_root rndctl root route6d routed rtadvd \
 		rtclocaltime rwho \
-		savecore screenblank securelevel sshd \
+		savecore screenblank securelevel smtoff sshd \
 		staticroute swap1 swap2 sysctl sysdb syslogd \
 		timed tpctl ttys \
 		veriexec virecover wdogctl wpa_supplicant wscons wsmoused



CVS commit: src/etc/rc.d

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun May 12 00:24:03 UTC 2019

Modified Files:
src/etc/rc.d: smtoff

Log Message:
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/smtoff

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



CVS commit: src

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 19:31:04 UTC 2019

Modified Files:
src/distrib/sets/lists/etc: mi
src/etc/defaults: rc.conf
src/etc/mtree: special
src/share/man/man5: rc.conf.5
src/usr.sbin/postinstall: postinstall
Added Files:
src/etc/rc.d: smtoff

Log Message:
Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.258 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.147 -r1.148 src/etc/defaults/rc.conf
cvs rdiff -u -r1.166 -r1.167 src/etc/mtree/special
cvs rdiff -u -r0 -r1.1 src/etc/rc.d/smtoff
cvs rdiff -u -r1.179 -r1.180 src/share/man/man5/rc.conf.5
cvs rdiff -u -r1.225 -r1.226 src/usr.sbin/postinstall/postinstall

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/etc/mi
diff -u src/distrib/sets/lists/etc/mi:1.257 src/distrib/sets/lists/etc/mi:1.258
--- src/distrib/sets/lists/etc/mi:1.257	Thu Apr 25 08:56:21 2019
+++ src/distrib/sets/lists/etc/mi	Sat May 11 19:31:03 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.257 2019/04/25 08:56:21 roy Exp $
+# $NetBSD: mi,v 1.258 2019/05/11 19:31:03 maxv Exp $
 #
 # Note: end-user configuration files that are moved to another location
 #	should not be marked "obsolete"; they should just be removed from
@@ -299,6 +299,7 @@
 ./etc/rc.d/screenblanketc-sys-rc
 ./etc/rc.d/sdpd	etc-obsolete		obsolete
 ./etc/rc.d/secureleveletc-sys-rc
+./etc/rc.d/smtoffetc-sys-rc
 ./etc/rc.d/sshd	etc-secsh-rc
 ./etc/rc.d/staticrouteetc-sys-rc
 ./etc/rc.d/swap1etc-sys-rc

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.147 src/etc/defaults/rc.conf:1.148
--- src/etc/defaults/rc.conf:1.147	Sat Jan 12 17:38:36 2019
+++ src/etc/defaults/rc.conf	Sat May 11 19:31:03 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.147 2019/01/12 17:38:36 roy Exp $
+#	$NetBSD: rc.conf,v 1.148 2019/05/11 19:31:03 maxv Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -385,6 +385,9 @@ random_seed=YES
 # Creating / updating of man page index on boot
 makemandb=YES
 
+# Disable Simultaneous Multi-Threading
+smtoff=NO
+
 # blacklist daemon, needs npf
 blacklistd=NO
 

Index: src/etc/mtree/special
diff -u src/etc/mtree/special:1.166 src/etc/mtree/special:1.167
--- src/etc/mtree/special:1.166	Sat May  4 08:26:51 2019
+++ src/etc/mtree/special	Sat May 11 19:31:03 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: special,v 1.166 2019/05/04 08:26:51 mrg Exp $
+#	$NetBSD: special,v 1.167 2019/05/11 19:31:03 maxv Exp $
 #	@(#)special	8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -286,6 +286,7 @@
 ./etc/rc.d/savecore		type=file mode=0555
 ./etc/rc.d/screenblank		type=file mode=0555
 ./etc/rc.d/securelevel		type=file mode=0555
+./etc/rc.d/smtoff		type=file mode=0555
 ./etc/rc.d/sshd			type=file mode=0555
 ./etc/rc.d/staticroute		type=file mode=0555
 ./etc/rc.d/swap1		type=file mode=0555

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.179 src/share/man/man5/rc.conf.5:1.180
--- src/share/man/man5/rc.conf.5:1.179	Sat Oct 20 08:47:03 2018
+++ src/share/man/man5/rc.conf.5	Sat May 11 19:31:03 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.179 2018/10/20 08:47:03 wiz Exp $
+.\"	$NetBSD: rc.conf.5,v 1.180 2019/05/11 19:31:03 maxv Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -55,7 +55,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 19, 2018
+.Dd May 11, 2019
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -673,6 +673,9 @@ A string.
 Flags to pass to the
 .Nm veriexecctl
 command.
+.It Sy smtoff
+Boolean value.
+Disables SMT (Simultaneous Multi-Threading).
 .El
 .Ss Networking startup
 .Bl -tag -width net_interfaces

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.225 src/usr.sbin/postinstall/postinstall:1.226
--- src/usr.sbin/postinstall/postinstall:1.225	Thu Apr 11 14:45:58 2019
+++ src/usr.sbin/postinstall/postinstall	Sat May 11 19:31:03 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.225 2019/04/11 14:45:58 martin Exp $
+# $NetBSD: postinstall,v 1.226 2019/05/11 19:31:03 maxv Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1473,6 +1473,7 @@ rwho
 savecore
 screenblank
 securelevel
+smtoff
 sshd
 staticroute
 swap1

Added files:

Index: src/etc/rc.d/smtoff
diff -u /dev/null src/etc/rc.d/smtoff:1.1
--- /dev/null	Sat May 11 19:31:04 2019
+++ src/etc/rc.d/smtoff	Sat May 11 19:31:03 2019
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# $NetBSD: smtoff,v 1.1 2019/05/11 19:31:03 maxv Exp $
+#
+# Public Domain.
+#
+
+# PROVIDE: smtoff

CVS commit: src

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 19:31:04 UTC 2019

Modified Files:
src/distrib/sets/lists/etc: mi
src/etc/defaults: rc.conf
src/etc/mtree: special
src/share/man/man5: rc.conf.5
src/usr.sbin/postinstall: postinstall
Added Files:
src/etc/rc.d: smtoff

Log Message:
Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.258 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.147 -r1.148 src/etc/defaults/rc.conf
cvs rdiff -u -r1.166 -r1.167 src/etc/mtree/special
cvs rdiff -u -r0 -r1.1 src/etc/rc.d/smtoff
cvs rdiff -u -r1.179 -r1.180 src/share/man/man5/rc.conf.5
cvs rdiff -u -r1.225 -r1.226 src/usr.sbin/postinstall/postinstall

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



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-05-11 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat May 11 18:50:15 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_atomic.c

Log Message:
try again to get it working for clang


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c

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



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-05-11 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat May 11 18:50:15 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_atomic.c

Log Message:
try again to get it working for clang


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c

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

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c
diff -u xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.4 xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.5
--- xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c:1.4	Thu May  2 16:56:21 2019
+++ xsrc/external/mit/MesaLib/dist/src/util/u_atomic.c	Sat May 11 14:50:15 2019
@@ -62,12 +62,9 @@ __atomic_fetch_sub_8(volatile long long 
return r;
 }
 
+#ifndef __clang__
 WEAK long long
-__sync_val_compare_and_swap_8(volatile long long *ptr, long long oldval, long long newval
-#ifdef __clang__
-	, ...
-#endif
-)
+__sync_val_compare_and_swap_8(volatile long long *ptr, long long oldval, long long newval)
 {
long long r;
 
@@ -79,5 +76,6 @@ __sync_val_compare_and_swap_8(volatile l
 
return r;
 }
+#endif
 
 #endif



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 17:44:16 UTC 2019

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

Log Message:
elide clang warnings


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/external/mit/xorg/lib/gallium/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.25 src/external/mit/xorg/lib/gallium/Makefile:1.26
--- src/external/mit/xorg/lib/gallium/Makefile:1.25	Tue Apr 16 13:29:09 2019
+++ src/external/mit/xorg/lib/gallium/Makefile	Sat May 11 13:44:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2019/04/16 17:29:09 christos Exp $
+# $NetBSD: Makefile,v 1.26 2019/05/11 17:44:16 christos Exp $
 
 # Link the gallium mega driver.
 
@@ -15,6 +15,8 @@ DRIDEBUGDIR=	${DEBUGDIR}${X11USRLIBDIR}/
 
 LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/bsd/llvm/include && ${PRINTOBJDIR}
 
+CWARNFLAGS.clang += -Wno-atomic-alignment -Wno-unknown-warning-option
+
 CXXFLAGS+=	-std=c++11
 CFLAGS+=	-std=gnu11
 CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm \



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 17:44:16 UTC 2019

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

Log Message:
elide clang warnings


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/external/mit/xorg/lib/gallium/Makefile

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



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

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat May 11 17:21:07 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Undo previous.   Not needed (and file included isn't installed anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/usr.sbin/cpuctl/arch/i386.c

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



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

2019-05-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat May 11 17:21:07 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Undo previous.   Not needed (and file included isn't installed anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.97 src/usr.sbin/cpuctl/arch/i386.c:1.98
--- src/usr.sbin/cpuctl/arch/i386.c:1.97	Sat May 11 12:59:50 2019
+++ src/usr.sbin/cpuctl/arch/i386.c	Sat May 11 17:21:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.97 2019/05/11 12:59:50 christos Exp $	*/
+/*	$NetBSD: i386.c,v 1.98 2019/05/11 17:21:07 kre Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.97 2019/05/11 12:59:50 christos Exp $");
+__RCSID("$NetBSD: i386.c,v 1.98 2019/05/11 17:21:07 kre Exp $");
 #endif /* not lint */
 
 #include 
@@ -81,7 +81,6 @@ __RCSID("$NetBSD: i386.c,v 1.97 2019/05/
 
 #include 
 #include 
-#include 
 #include 
 #include 
 



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:41:53 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: md.i386

Log Message:
Undo previous


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/distrib/sets/lists/comp/md.i386

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



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:41:53 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: md.i386

Log Message:
Undo previous


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/distrib/sets/lists/comp/md.i386

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

Modified files:

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.188 src/distrib/sets/lists/comp/md.i386:1.189
--- src/distrib/sets/lists/comp/md.i386:1.188	Sat May 11 09:04:40 2019
+++ src/distrib/sets/lists/comp/md.i386	Sat May 11 09:41:52 2019
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.188 2019/05/11 13:04:40 christos Exp $
+# $NetBSD: md.i386,v 1.189 2019/05/11 13:41:52 christos Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -684,7 +684,6 @@
 ./usr/include/x86/cpu_extended_state.h		comp-c-include
 ./usr/include/x86/cpu_rng.h			comp-c-include
 ./usr/include/x86/cpu_ucode.h			comp-c-include
-./usr/include/x86/cpufunc.h			comp-c-include
 ./usr/include/x86/cputypes.h			comp-c-include
 ./usr/include/x86/cpuvar.h			comp-c-include
 ./usr/include/x86/dbregs.h			comp-obsolete		obsolete



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:40:26 UTC 2019

Modified Files:
src/sys/arch/x86/include: Makefile cpufunc.h

Log Message:
Undo previous, fixed in userland.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/include/Makefile
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/include/cpufunc.h

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



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:40:26 UTC 2019

Modified Files:
src/sys/arch/x86/include: Makefile cpufunc.h

Log Message:
Undo previous, fixed in userland.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/include/Makefile
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/include/cpufunc.h

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

Modified files:

Index: src/sys/arch/x86/include/Makefile
diff -u src/sys/arch/x86/include/Makefile:1.23 src/sys/arch/x86/include/Makefile:1.24
--- src/sys/arch/x86/include/Makefile:1.23	Sat May 11 08:58:17 2019
+++ src/sys/arch/x86/include/Makefile	Sat May 11 09:40:26 2019
@@ -1,4 +1,4 @@
-# 	$NetBSD: Makefile,v 1.23 2019/05/11 12:58:17 christos Exp $
+# 	$NetBSD: Makefile,v 1.24 2019/05/11 13:40:26 christos Exp $
 
 INCSDIR=/usr/include/x86
 
@@ -9,7 +9,6 @@ INCS=	aout_machdep.h \
 	cpu_extended_state.h \
 	cpu_rng.h \
 	cpu_ucode.h \
-	cpufunc.h \
 	cputypes.h \
 	cpuvar.h \
 	float.h \

Index: src/sys/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.29 src/sys/arch/x86/include/cpufunc.h:1.30
--- src/sys/arch/x86/include/cpufunc.h:1.29	Sat May 11 08:58:17 2019
+++ src/sys/arch/x86/include/cpufunc.h	Sat May 11 09:40:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.29 2019/05/11 12:58:17 christos Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.30 2019/05/11 13:40:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
@@ -329,12 +329,6 @@ void	x86_reset(void);
  */
 #define	OPTERON_MSR_PASSCODE	0x9c5a203aU
 
-uint64_t	rdmsr_locked(u_int);
-int		rdmsr_safe(u_int, uint64_t *);
-void		wrmsr_locked(u_int, uint64_t);
-
-#endif /* _KERNEL */
-
 static inline uint64_t
 rdmsr(u_int msr)
 {
@@ -349,6 +343,9 @@ rdmsr(u_int msr)
 	return (low | ((uint64_t)high << 32));
 }
 
+uint64_t	rdmsr_locked(u_int);
+int		rdmsr_safe(u_int, uint64_t *);
+
 static inline void
 wrmsr(u_int msr, uint64_t val)
 {
@@ -363,4 +360,8 @@ wrmsr(u_int msr, uint64_t val)
 	);
 }
 
+void		wrmsr_locked(u_int, uint64_t);
+
+#endif /* _KERNEL */
+
 #endif /* !_X86_CPUFUNC_H_ */



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:04:40 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: md.i386

Log Message:
Add cpufunc.h


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/distrib/sets/lists/comp/md.i386

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



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 13:04:40 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: md.i386

Log Message:
Add cpufunc.h


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/distrib/sets/lists/comp/md.i386

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

Modified files:

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.187 src/distrib/sets/lists/comp/md.i386:1.188
--- src/distrib/sets/lists/comp/md.i386:1.187	Wed Apr  3 11:12:44 2019
+++ src/distrib/sets/lists/comp/md.i386	Sat May 11 09:04:40 2019
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.187 2019/04/03 15:12:44 joerg Exp $
+# $NetBSD: md.i386,v 1.188 2019/05/11 13:04:40 christos Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -684,6 +684,7 @@
 ./usr/include/x86/cpu_extended_state.h		comp-c-include
 ./usr/include/x86/cpu_rng.h			comp-c-include
 ./usr/include/x86/cpu_ucode.h			comp-c-include
+./usr/include/x86/cpufunc.h			comp-c-include
 ./usr/include/x86/cputypes.h			comp-c-include
 ./usr/include/x86/cpuvar.h			comp-c-include
 ./usr/include/x86/dbregs.h			comp-obsolete		obsolete



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 12:59:50 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
need cpufunc.h for rdmsr


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.96 src/usr.sbin/cpuctl/arch/i386.c:1.97
--- src/usr.sbin/cpuctl/arch/i386.c:1.96	Fri May 10 12:42:57 2019
+++ src/usr.sbin/cpuctl/arch/i386.c	Sat May 11 08:59:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.96 2019/05/10 16:42:57 mlelstv Exp $	*/
+/*	$NetBSD: i386.c,v 1.97 2019/05/11 12:59:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.96 2019/05/10 16:42:57 mlelstv Exp $");
+__RCSID("$NetBSD: i386.c,v 1.97 2019/05/11 12:59:50 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -81,6 +81,7 @@ __RCSID("$NetBSD: i386.c,v 1.96 2019/05/
 
 #include 
 #include 
+#include 
 #include 
 #include 
 



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 12:59:50 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
need cpufunc.h for rdmsr


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.sbin/cpuctl/arch/i386.c

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



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

2019-05-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 11 12:58:17 UTC 2019

Modified Files:
src/sys/arch/x86/include: Makefile cpufunc.h

Log Message:
expose the {rd,wr}msr functions to userland and install the header for
the benefit of cpuctl (fix the build).


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/include/Makefile
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/cpufunc.h

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

Modified files:

Index: src/sys/arch/x86/include/Makefile
diff -u src/sys/arch/x86/include/Makefile:1.22 src/sys/arch/x86/include/Makefile:1.23
--- src/sys/arch/x86/include/Makefile:1.22	Sat Feb 17 08:01:23 2018
+++ src/sys/arch/x86/include/Makefile	Sat May 11 08:58:17 2019
@@ -1,4 +1,4 @@
-# 	$NetBSD: Makefile,v 1.22 2018/02/17 13:01:23 kamil Exp $
+# 	$NetBSD: Makefile,v 1.23 2019/05/11 12:58:17 christos Exp $
 
 INCSDIR=/usr/include/x86
 
@@ -9,6 +9,7 @@ INCS=	aout_machdep.h \
 	cpu_extended_state.h \
 	cpu_rng.h \
 	cpu_ucode.h \
+	cpufunc.h \
 	cputypes.h \
 	cpuvar.h \
 	float.h \

Index: src/sys/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.28 src/sys/arch/x86/include/cpufunc.h:1.29
--- src/sys/arch/x86/include/cpufunc.h:1.28	Thu May  9 13:09:50 2019
+++ src/sys/arch/x86/include/cpufunc.h	Sat May 11 08:58:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.28 2019/05/09 17:09:50 bouyer Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.29 2019/05/11 12:58:17 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
@@ -329,6 +329,12 @@ void	x86_reset(void);
  */
 #define	OPTERON_MSR_PASSCODE	0x9c5a203aU
 
+uint64_t	rdmsr_locked(u_int);
+int		rdmsr_safe(u_int, uint64_t *);
+void		wrmsr_locked(u_int, uint64_t);
+
+#endif /* _KERNEL */
+
 static inline uint64_t
 rdmsr(u_int msr)
 {
@@ -343,9 +349,6 @@ rdmsr(u_int msr)
 	return (low | ((uint64_t)high << 32));
 }
 
-uint64_t	rdmsr_locked(u_int);
-int		rdmsr_safe(u_int, uint64_t *);
-
 static inline void
 wrmsr(u_int msr, uint64_t val)
 {
@@ -360,8 +363,4 @@ wrmsr(u_int msr, uint64_t val)
 	);
 }
 
-void		wrmsr_locked(u_int, uint64_t);
-
-#endif /* _KERNEL */
-
 #endif /* !_X86_CPUFUNC_H_ */



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

2019-05-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May 11 12:24:42 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386-asm.S

Log Message:
Fix copy error, the function is named rdmsr().

Found by kre@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/cpuctl/arch/i386-asm.S

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



CVS commit: src/usr.sbin/cpuctl

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 11:59:22 UTC 2019

Modified Files:
src/usr.sbin/cpuctl: cpuctl.c

Log Message:
Check the return value of cpuset_set(), to prevent future surprises.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/cpuctl/cpuctl.c

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

Modified files:

Index: src/usr.sbin/cpuctl/cpuctl.c
diff -u src/usr.sbin/cpuctl/cpuctl.c:1.29 src/usr.sbin/cpuctl/cpuctl.c:1.30
--- src/usr.sbin/cpuctl/cpuctl.c:1.29	Tue Jan 16 08:23:18 2018
+++ src/usr.sbin/cpuctl/cpuctl.c	Sat May 11 11:59:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuctl.c,v 1.29 2018/01/16 08:23:18 mrg Exp $	*/
+/*	$NetBSD: cpuctl.c,v 1.30 2019/05/11 11:59:21 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2012, 2015 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #ifndef lint
 #include 
-__RCSID("$NetBSD: cpuctl.c,v 1.29 2018/01/16 08:23:18 mrg Exp $");
+__RCSID("$NetBSD: cpuctl.c,v 1.30 2019/05/11 11:59:21 maxv Exp $");
 #endif /* not lint */
 
 #include 
@@ -239,7 +239,8 @@ cpu_ucode(char **argv)
 		if (cpuset == NULL)
 			err(EXIT_FAILURE, "cpuset_create");
 		cpuset_zero(cpuset);
-		cpuset_set(id, cpuset);
+		if (cpuset_set(id, cpuset) < 0)
+			err(EXIT_FAILURE, "cpuset_set");
 		if (_sched_setaffinity(0, 0, cpuset_size(cpuset), cpuset) < 0) {
 			err(EXIT_FAILURE, "_sched_setaffinity");
 		}
@@ -271,7 +272,8 @@ cpu_identify(char **argv)
 			if (cpuset == NULL)
 err(EXIT_FAILURE, "cpuset_create");
 			cpuset_zero(cpuset);
-			cpuset_set(id, cpuset);
+			if (cpuset_set(id, cpuset) < 0)
+err(EXIT_FAILURE, "cpuset_set");
 			if (_sched_setaffinity(0, 0, cpuset_size(cpuset), cpuset) < 0) {
 if (errno == EPERM) {
 	printf("Cannot bind to target CPU.  Output "



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

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 11:53:55 UTC 2019

Modified Files:
src/common/lib/libc/sys: cpuset.c

Log Message:
Fix bug, the computation of cpuset_nentries was incorrect, we must do +1
to be able to address the last 32 bits.

On a machine with 80 CPUs, this caused "cpuctl identify >64" to return
garbage.


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

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



CVS commit: src/lib/libnvmm

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 07:44:00 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.3

Log Message:
Replace "VMM" by "emulator", clearer.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libnvmm/libnvmm.3

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



CVS commit: src/lib/libnvmm

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 07:40:38 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.3

Log Message:
Sync with reality.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libnvmm/libnvmm.3

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

Modified files:

Index: src/lib/libnvmm/libnvmm.3
diff -u src/lib/libnvmm/libnvmm.3:1.16 src/lib/libnvmm/libnvmm.3:1.17
--- src/lib/libnvmm/libnvmm.3:1.16	Mon Apr 29 19:03:17 2019
+++ src/lib/libnvmm/libnvmm.3	Sat May 11 07:40:38 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnvmm.3,v 1.16 2019/04/29 19:03:17 maxv Exp $
+.\"	$NetBSD: libnvmm.3,v 1.17 2019/05/11 07:40:38 maxv Exp $
 .\"
 .\" Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -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 April 29, 2019
+.Dd May 11, 2019
 .Dt LIBNVMM 3
 .Os
 .Sh NAME
@@ -78,8 +78,6 @@
 .Ft int
 .Fn nvmm_gpa_to_hva "struct nvmm_machine *mach" "gpaddr_t gpa" \
 "uintptr_t *hva" "nvmm_prot_t *prot"
-.Ft void
-.Fn nvmm_callbacks_register "const struct nvmm_callbacks *cbs"
 .Ft int
 .Fn nvmm_assist_io "struct nvmm_machine *mach" "nvmm_cpuid_t cpuid" \
 "struct nvmm_exit *exit"
@@ -246,11 +244,6 @@ The associated page premissions are retu
 .Fa gpa
 must be page-aligned.
 .Pp
-.Fn nvmm_callbacks_register
-registers in
-.Nm
-the callbacks descriptor passed as argument.
-.Pp
 .Fn nvmm_assist_io
 emulates the I/O operation described in
 .Fa exit
@@ -295,6 +288,16 @@ For example, the
 field indicates the maximum number of virtual machines supported, while
 .Cd max_vcpus
 indicates the maximum number of VCPUs supported per virtual machine.
+.Ss Machine Configuration
+VMM software can configure several parameters of a virtual machine by using
+.Fn nvmm_machine_configure ,
+which can take the following operations:
+.Bd -literal
+#define NVMM_MACH_CONF_CALLBACKS	0
+	...
+.Ed
+.Pp
+The higher fields depend on the architecture.
 .Ss Guest-Host Mappings
 Each virtual machine has an associated guest physical memory.
 VMM software is allowed to modify this guest physical memory by mapping
@@ -474,7 +477,7 @@ of interrupts.
 In order to assist emulation of certain operations,
 .Nm
 requires VMM software to register, via
-.Fn nvmm_callbacks_register ,
+.Fn nvmm_machine_configure ,
 a set of callbacks described in the following structure:
 .Bd -literal
 struct nvmm_callbacks {



CVS commit: src/lib/libnvmm

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 07:40:38 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.3

Log Message:
Sync with reality.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libnvmm/libnvmm.3

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



CVS commit: src

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 07:31:57 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/sys/dev/nvmm: nvmm.c nvmm.h
src/sys/dev/nvmm/x86: nvmm_x86.h nvmm_x86_svm.c nvmm_x86_vmx.c
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Rework the machine configuration interface.

Provide three ranges in the conf space: ,  and
. Remove nvmm_callbacks_register(), and replace it by the conf
op NVMM_MACH_CONF_CALLBACKS, handled by libnvmm. The callbacks are now
per-machine, and the emulators should now do:

-   nvmm_callbacks_register();
+   nvmm_machine_configure(, NVMM_MACH_CONF_CALLBACKS, );

This provides more granularity, for example if the process runs two VMs
and wants different callbacks for each.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/nvmm/nvmm.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nvmm/nvmm.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libnvmm/h_mem_assist.c

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



CVS commit: src

2019-05-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat May 11 07:31:57 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/sys/dev/nvmm: nvmm.c nvmm.h
src/sys/dev/nvmm/x86: nvmm_x86.h nvmm_x86_svm.c nvmm_x86_vmx.c
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Rework the machine configuration interface.

Provide three ranges in the conf space: ,  and
. Remove nvmm_callbacks_register(), and replace it by the conf
op NVMM_MACH_CONF_CALLBACKS, handled by libnvmm. The callbacks are now
per-machine, and the emulators should now do:

-   nvmm_callbacks_register();
+   nvmm_machine_configure(, NVMM_MACH_CONF_CALLBACKS, );

This provides more granularity, for example if the process runs two VMs
and wants different callbacks for each.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/nvmm/nvmm.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nvmm/nvmm.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libnvmm/h_mem_assist.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/libnvmm/libnvmm.c
diff -u src/lib/libnvmm/libnvmm.c:1.12 src/lib/libnvmm/libnvmm.c:1.13
--- src/lib/libnvmm/libnvmm.c:1.12	Wed May  1 09:20:21 2019
+++ src/lib/libnvmm/libnvmm.c	Sat May 11 07:31:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm.c,v 1.12 2019/05/01 09:20:21 maxv Exp $	*/
+/*	$NetBSD: libnvmm.c,v 1.13 2019/05/11 07:31:57 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -44,7 +44,6 @@
 
 #include "nvmm.h"
 
-static struct nvmm_callbacks __callbacks;
 static struct nvmm_capability __capability;
 
 #ifdef __x86_64__
@@ -255,6 +254,12 @@ nvmm_machine_configure(struct nvmm_machi
 	struct nvmm_ioc_machine_configure args;
 	int ret;
 
+	switch (op) {
+	case NVMM_MACH_CONF_CALLBACKS:
+		memcpy(>cbs, conf, sizeof(mach->cbs));
+		return 0;
+	}
+
 	args.machid = mach->machid;
 	args.op = op;
 	args.conf = conf;
@@ -510,12 +515,6 @@ nvmm_gpa_to_hva(struct nvmm_machine *mac
  * nvmm_assist_mem(): architecture-specific.
  */
 
-void
-nvmm_callbacks_register(const struct nvmm_callbacks *cbs)
-{
-	memcpy(&__callbacks, cbs, sizeof(__callbacks));
-}
-
 int
 nvmm_ctl(int op, void *data, size_t size)
 {

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.29 src/lib/libnvmm/libnvmm_x86.c:1.30
--- src/lib/libnvmm/libnvmm_x86.c:1.29	Sun Apr 28 14:22:13 2019
+++ src/lib/libnvmm/libnvmm_x86.c	Sat May 11 07:31:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.29 2019/04/28 14:22:13 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.30 2019/05/11 07:31:57 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -606,7 +606,7 @@ read_guest_memory(struct nvmm_machine *m
 		mem.gpa = gpa;
 		mem.write = false;
 		mem.size = size;
-		(*__callbacks.mem)();
+		(*mach->cbs.mem)();
 	} else {
 		if (__predict_false(!(prot & NVMM_PROT_READ))) {
 			errno = EFAULT;
@@ -660,7 +660,7 @@ write_guest_memory(struct nvmm_machine *
 		mem.gpa = gpa;
 		mem.write = true;
 		mem.size = size;
-		(*__callbacks.mem)();
+		(*mach->cbs.mem)();
 	} else {
 		if (__predict_false(!(prot & NVMM_PROT_WRITE))) {
 			errno = EFAULT;
@@ -706,7 +706,7 @@ assist_io_batch(struct nvmm_machine *mac
 	}
 
 	for (i = 0; i < iocnt; i++) {
-		(*__callbacks.io)(io);
+		(*mach->cbs.io)(io);
 		io->data += io->size;
 	}
 
@@ -816,7 +816,7 @@ nvmm_assist_io(struct nvmm_machine *mach
 		}
 	}
 
-	(*__callbacks.io)();
+	(*mach->cbs.io)();
 
 	if (io.in) {
 		if (!exit->u.io.str) {
@@ -865,19 +865,19 @@ out:
 struct x86_emul {
 	bool read;
 	bool notouch;
-	void (*func)(struct nvmm_mem *, uint64_t *);
+	void (*func)(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 };
 
-static void x86_func_or(struct nvmm_mem *, uint64_t *);
-static void x86_func_and(struct nvmm_mem *, uint64_t *);
-static void x86_func_sub(struct nvmm_mem *, uint64_t *);
-static void x86_func_xor(struct nvmm_mem *, uint64_t *);
-static void x86_func_cmp(struct nvmm_mem *, uint64_t *);
-static void x86_func_test(struct nvmm_mem *, uint64_t *);
-static void x86_func_mov(struct nvmm_mem *, uint64_t *);
-static void x86_func_stos(struct nvmm_mem *, uint64_t *);
-static void x86_func_lods(struct nvmm_mem *, uint64_t *);
-static void x86_func_movs(struct nvmm_mem *, uint64_t *);
+static void x86_func_or(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
+static void x86_func_and(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
+static void x86_func_sub(struct nvmm_machine *, 

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

2019-05-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 06:50:42 UTC 2019

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
#define for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/mips/include/mips_param.h

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



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

2019-05-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 06:50:42 UTC 2019

Modified Files:
src/sys/arch/mips/include: mips_param.h

Log Message:
#define for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/mips/include/mips_param.h

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

Modified files:

Index: src/sys/arch/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.38 src/sys/arch/mips/include/mips_param.h:1.39
--- src/sys/arch/mips/include/mips_param.h:1.38	Mon Jul 11 16:15:35 2016
+++ src/sys/arch/mips/include/mips_param.h	Sat May 11 06:50:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.38 2016/07/11 16:15:35 matt Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.39 2019/05/11 06:50:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -98,16 +98,16 @@
 #define	PTPLENGTH	(PGSHIFT-PTPSHIFT)
 #define	NPTEPG		(1 << PTPLENGTH)
 
-#define	SEGSHIFT	(PGSHIFT+PTPLENGTH)	/* LOG2(NBSEG) */
+#define SEGSHIFT	(PGSHIFT+PTPLENGTH)	/* LOG2(NBSEG) */
 #define NBSEG		(1 << SEGSHIFT)	/* bytes/segment */
 #define	SEGOFSET	(NBSEG-1)	/* byte offset into segment */
 
 #ifdef _LP64
-#define SEGLENGTH	(PGSHIFT-3)
+#define	SEGLENGTH	(PGSHIFT-3)
 #define	XSEGSHIFT	(SEGSHIFT+SEGLENGTH)	/* LOG2(NBXSEG) */
-#define NBXSEG		(1UL << XSEGSHIFT)	/* bytes/xsegment */
+#define	NBXSEG		(1UL << XSEGSHIFT)	/* bytes/xsegment */
 #define	XSEGOFSET	(NBXSEG-1)	/* byte offset into xsegment */
-#define XSEGLENGTH	(PGSHIFT-3)
+#define	XSEGLENGTH	(PGSHIFT-3)
 #define	NXSEGPG		(1 << XSEGLENGTH)
 #else
 #define	SEGLENGTH	(31-SEGSHIFT)