CVS commit: src/usr.sbin/mtree

2018-12-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 13 07:34:03 UTC 2018

Modified Files:
src/usr.sbin/mtree: mtree.8

Log Message:
Use \(en.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/mtree/mtree.8

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/mtree/mtree.8
diff -u src/usr.sbin/mtree/mtree.8:1.73 src/usr.sbin/mtree/mtree.8:1.74
--- src/usr.sbin/mtree/mtree.8:1.73	Thu Dec 13 03:18:18 2018
+++ src/usr.sbin/mtree/mtree.8	Thu Dec 13 07:34:03 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mtree.8,v 1.73 2018/12/13 03:18:18 dholland Exp $
+.\"	$NetBSD: mtree.8,v 1.74 2018/12/13 07:34:03 wiz Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -235,7 +235,7 @@ will match less stringent ones.
 For example, a file marked mode 0444
 will pass a check for mode 0644.
 .Dq Loose
-checks apply only to read, write and execute permissions -- in
+checks apply only to read, write and execute permissions \(em in
 particular, if other bits like the sticky bit or suid/sgid bits are
 set either in the specification or the file, exact checking will be
 performed.



CVS commit: src/usr.bin/telnet

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec 13 05:22:15 UTC 2018

Modified Files:
src/usr.bin/telnet: externs.h sys_bsd.c telnet.c types.h

Log Message:
Remove unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/telnet/externs.h
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/telnet/sys_bsd.c
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/telnet/telnet.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/telnet/types.h

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/telnet/externs.h
diff -u src/usr.bin/telnet/externs.h:1.40 src/usr.bin/telnet/externs.h:1.41
--- src/usr.bin/telnet/externs.h:1.40	Thu Dec 13 05:07:03 2018
+++ src/usr.bin/telnet/externs.h	Thu Dec 13 05:22:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.40 2018/12/13 05:07:03 maya Exp $	*/
+/*	$NetBSD: externs.h,v 1.41 2018/12/13 05:22:14 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -247,7 +247,6 @@ void TerminalFlushOutput(void);
 void TerminalSaveState(void);
 cc_t *tcval(int);
 void TerminalDefaultChars(void);
-void TerminalRestoreState(void);
 void TerminalNewMode(int);
 void TerminalSpeeds(long *, long *);
 int TerminalWindowSize(long *, long *);

Index: src/usr.bin/telnet/sys_bsd.c
diff -u src/usr.bin/telnet/sys_bsd.c:1.35 src/usr.bin/telnet/sys_bsd.c:1.36
--- src/usr.bin/telnet/sys_bsd.c:1.35	Thu Dec 13 04:49:19 2018
+++ src/usr.bin/telnet/sys_bsd.c	Thu Dec 13 05:22:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_bsd.c,v 1.35 2018/12/13 04:49:19 maya Exp $	*/
+/*	$NetBSD: sys_bsd.c,v 1.36 2018/12/13 05:22:14 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 from: static char sccsid[] = "@(#)sys_bsd.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: sys_bsd.c,v 1.35 2018/12/13 04:49:19 maya Exp $");
+__RCSID("$NetBSD: sys_bsd.c,v 1.36 2018/12/13 05:22:14 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -243,13 +243,6 @@ TerminalDefaultChars(void)
 memmove(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
 }
 
-#ifdef notdef
-void
-TerminalRestoreState(void)
-{
-}
-#endif
-
 /*
  * TerminalNewMode - set up terminal to a specific mode.
  *	MODE_ECHO: do local terminal echo

Index: src/usr.bin/telnet/telnet.c
diff -u src/usr.bin/telnet/telnet.c:1.38 src/usr.bin/telnet/telnet.c:1.39
--- src/usr.bin/telnet/telnet.c:1.38	Thu Dec 13 04:49:19 2018
+++ src/usr.bin/telnet/telnet.c	Thu Dec 13 05:22:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnet.c,v 1.38 2018/12/13 04:49:19 maya Exp $	*/
+/*	$NetBSD: telnet.c,v 1.39 2018/12/13 05:22:14 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)telnet.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnet.c,v 1.38 2018/12/13 04:49:19 maya Exp $");
+__RCSID("$NetBSD: telnet.c,v 1.39 2018/12/13 05:22:14 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -162,18 +162,6 @@ static void doflush(void);
  */
 
 Clocks clocks;
-
-#ifdef	notdef
-Modelist modelist[] = {
-	{ "telnet command mode", COMMAND_LINE },
-	{ "character-at-a-time mode", 0 },
-	{ "character-at-a-time mode (local echo)", LOCAL_ECHO|LOCAL_CHARS },
-	{ "line-by-line mode (remote echo)", LINE | LOCAL_CHARS },
-	{ "line-by-line mode", LINE | LOCAL_ECHO | LOCAL_CHARS },
-	{ "line-by-line mode (local echoing suppressed)", LINE | LOCAL_CHARS },
-	{ "3270 mode", 0 },
-};
-#endif
 
 
 /*

Index: src/usr.bin/telnet/types.h
diff -u src/usr.bin/telnet/types.h:1.6 src/usr.bin/telnet/types.h:1.7
--- src/usr.bin/telnet/types.h:1.6	Thu Aug  7 11:16:12 2003
+++ src/usr.bin/telnet/types.h	Thu Dec 13 05:22:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.6 2003/08/07 11:16:12 agc Exp $	*/
+/*	$NetBSD: types.h,v 1.7 2018/12/13 05:22:14 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -32,13 +32,6 @@
  */
 
 typedef struct {
-char *modedescriptions;
-char modetype;
-} Modelist;
-
-extern Modelist modelist[];
-
-typedef struct {
 int
 	system,			/* what the current time is */
 	echotoggle,		/* last time user entered echo character */



CVS commit: src/sys/dev/mii

2018-12-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 13 05:22:45 UTC 2018

Modified Files:
src/sys/dev/mii: inbmphyreg.h

Log Message:
 Fix a wrong access to I217_PROXY_CTRL which was added in inbmphreg.h rev. 1.13
and if_wm.c rev. 1.603.


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

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

Modified files:

Index: src/sys/dev/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.13 src/sys/dev/mii/inbmphyreg.h:1.14
--- src/sys/dev/mii/inbmphyreg.h:1.13	Wed Dec 12 08:49:33 2018
+++ src/sys/dev/mii/inbmphyreg.h	Thu Dec 13 05:22:44 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: inbmphyreg.h,v 1.13 2018/12/12 08:49:33 msaitoh Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.14 2018/12/13 05:22:44 msaitoh Exp $	*/
 /***
-Copyright (c) 2001-2005, Intel Corporation 
+Copyright (c) 2001-2015, Intel Corporation 
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without 
@@ -39,12 +39,16 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	_DEV_MII_INBMPHYREG_H_
 
 /* Bits...
- * 15-5: page
- * 4-0: register offset
+ * 31-16: register offset (high)
+ * 15-5:  page
+ * 4-0:   register offset (low)
  */
-#define BME1000_PAGE_SHIFT5
+#define BME1000_PAGE_SHIFT	5
+#define BM_PHY_UPPER_SHIFT	21
 #define BME1000_REG(page, reg)\
-(((page) << BME1000_PAGE_SHIFT) | ((reg) & MII_ADDRMASK))
+(((reg) & MII_ADDRMASK) | 			\
+	(((page) & 0x) << BME1000_PAGE_SHIFT) |	\
+	(((reg) & ~MII_ADDRMASK) << (BM_PHY_UPPER_SHIFT - BME1000_PAGE_SHIFT)))
 
 #define BME1000_MAX_MULTI_PAGE_REG 0xf   /* Registers equal on all pages */
 
@@ -52,7 +56,7 @@ POSSIBILITY OF SUCH DAMAGE.
 	((uint16_t)(((offset) >> BME1000_PAGE_SHIFT) & 0x))
 #define	BM_PHY_REG_NUM(offset)\
 	((uint16_t)((offset) & MII_ADDRMASK)		\
-	| (((offset) >> (21 - BME1000_PAGE_SHIFT)) & ~MII_ADDRMASK))
+	| (((offset) >> (BM_PHY_UPPER_SHIFT - BME1000_PAGE_SHIFT)) & ~MII_ADDRMASK))
 
 /* BME1000 Specific Registers */
 #define BME1000_PHY_SPEC_CTRL	BME1000_REG(0, 16) /* PHY Specific Control */



CVS commit: src/usr.bin/telnet

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec 13 05:15:11 UTC 2018

Modified Files:
src/usr.bin/telnet: utilities.c

Log Message:
ExitString is used for error exit, do the minimum necessary here.
Avoid infinite loop:
telrcv->suboption->ExitString->SetForExit->telrcv

Reported by hacker fantastic, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/telnet/utilities.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.bin/telnet/utilities.c
diff -u src/usr.bin/telnet/utilities.c:1.26 src/usr.bin/telnet/utilities.c:1.27
--- src/usr.bin/telnet/utilities.c:1.26	Thu Dec 13 05:07:03 2018
+++ src/usr.bin/telnet/utilities.c	Thu Dec 13 05:15:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: utilities.c,v 1.26 2018/12/13 05:07:03 maya Exp $	*/
+/*	$NetBSD: utilities.c,v 1.27 2018/12/13 05:15:11 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c	8.3 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.26 2018/12/13 05:07:03 maya Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.27 2018/12/13 05:15:11 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -907,7 +907,6 @@ Exit(int returnCode)
 void
 ExitString(const char *string, int returnCode)
 {
-SetForExit();
 fwrite(string, 1, strlen(string), stderr);
 exit(returnCode);
 }



CVS commit: src/usr.bin/telnet

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec 13 05:07:03 UTC 2018

Modified Files:
src/usr.bin/telnet: externs.h utilities.c

Log Message:
static-ify.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/telnet/externs.h
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/telnet/utilities.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.bin/telnet/externs.h
diff -u src/usr.bin/telnet/externs.h:1.39 src/usr.bin/telnet/externs.h:1.40
--- src/usr.bin/telnet/externs.h:1.39	Thu Dec 13 04:49:19 2018
+++ src/usr.bin/telnet/externs.h	Thu Dec 13 05:07:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.39 2018/12/13 04:49:19 maya Exp $	*/
+/*	$NetBSD: externs.h,v 1.40 2018/12/13 05:07:03 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -328,7 +328,6 @@ void printoption(const char *, int, int 
 void optionstatus(void);
 void printsub(int, unsigned char *, int);
 void EmptyTerminal(void);
-void SetForExit(void);
 void Exit(int) __attribute__((__noreturn__));
 void ExitString(const char *, int) __attribute__((__noreturn__));
 

Index: src/usr.bin/telnet/utilities.c
diff -u src/usr.bin/telnet/utilities.c:1.25 src/usr.bin/telnet/utilities.c:1.26
--- src/usr.bin/telnet/utilities.c:1.25	Thu Dec 13 04:49:19 2018
+++ src/usr.bin/telnet/utilities.c	Thu Dec 13 05:07:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: utilities.c,v 1.25 2018/12/13 04:49:19 maya Exp $	*/
+/*	$NetBSD: utilities.c,v 1.26 2018/12/13 05:07:03 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c	8.3 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.25 2018/12/13 04:49:19 maya Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.26 2018/12/13 05:07:03 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -63,6 +63,8 @@ __RCSID("$NetBSD: utilities.c,v 1.25 201
 #include 
 #endif
 
+static void SetForExit(void);
+
 FILE	*NetTrace = 0;		/* Not in bss, since needs to stay */
 int	prettydump;
 
@@ -879,7 +881,7 @@ EmptyTerminal(void)
 }
 }
 
-void
+static void
 SetForExit(void)
 {
 setconnmode(0);



CVS commit: src/usr.bin/telnet

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec 13 04:49:19 UTC 2018

Modified Files:
src/usr.bin/telnet: Makefile commands.c defines.h externs.h main.c
sys_bsd.c telnet.c utilities.c
Removed Files:
src/usr.bin/telnet: tn3270.c

Log Message:
unifdef TN3270 which is never defined (and wouldn't build if it was)
delete tn3270 file no longer needed.
SetIn3270(); expands to nothing now, so remove it.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/telnet/Makefile
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/telnet/commands.c
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/telnet/defines.h
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/telnet/externs.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/telnet/main.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/telnet/sys_bsd.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/telnet/telnet.c
cvs rdiff -u -r1.22 -r0 src/usr.bin/telnet/tn3270.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/telnet/utilities.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.bin/telnet/Makefile
diff -u src/usr.bin/telnet/Makefile:1.53 src/usr.bin/telnet/Makefile:1.54
--- src/usr.bin/telnet/Makefile:1.53	Sun Feb 25 00:16:49 2018
+++ src/usr.bin/telnet/Makefile	Thu Dec 13 04:49:19 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.53 2018/02/25 00:16:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.54 2018/12/13 04:49:19 maya Exp $
 #
 # Copyright (c) 1990 The Regents of the University of California.
 # All rights reserved.
@@ -50,7 +50,7 @@ LDADD+= -lterminfo ${LIBTELNETDIR}/libte
 DPADD+=	${LIBTERMINFO} ${LIBTELNETDIR}/libtelnet.a
 
 SRCS=	authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
-	terminal.c tn3270.c utilities.c
+	terminal.c utilities.c
 
 CPPFLAGS+=-I${NETBSDSRCDIR}/lib
 CPPFLAGS+=-DIPSEC

Index: src/usr.bin/telnet/commands.c
diff -u src/usr.bin/telnet/commands.c:1.70 src/usr.bin/telnet/commands.c:1.71
--- src/usr.bin/telnet/commands.c:1.70	Tue Oct  4 14:36:11 2016
+++ src/usr.bin/telnet/commands.c	Thu Dec 13 04:49:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.70 2016/10/04 14:36:11 joerg Exp $	*/
+/*	$NetBSD: commands.c,v 1.71 2018/12/13 04:49:19 maya Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)commands.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: commands.c,v 1.70 2016/10/04 14:36:11 joerg Exp $");
+__RCSID("$NetBSD: commands.c,v 1.71 2018/12/13 04:49:19 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -160,9 +160,6 @@ static struct envlist *getenvcmd(char *)
 #ifdef AUTHENTICATION
 static int auth_help(char *);
 #endif
-#ifdef TN3270
-static void filestuff(int);
-#endif
 static int status(int, char *[]);
 static const char *sockaddr_ntop (struct sockaddr *);
 typedef int (*intrtn_t)(int, char **);
@@ -743,18 +740,6 @@ static struct togglelist Togglelist[] = 
 		,
 		"recognize certain control characters" },
 { " ", "", 0, NULL, NULL },		/* empty line */
-#ifdef TN3270
-{ "apitrace",
-	"(debugging) toggle tracing of API transactions",
-	0,
-		,
-		"trace API transactions" },
-{ "cursesdata",
-	"(debugging) toggle printing of hexadecimal curses data",
-	0,
-		,
-		"print hexadecimal representation of curses data" },
-#endif	/* defined(TN3270) */
 { "debug",
 	"debugging",
 	togdebug,
@@ -1355,7 +1340,6 @@ suspend(int argc, char *argv[])
 return 1;
 }
 
-#ifndef TN3270
 /*ARGSUSED*/
 int
 shell(int argc, char *argv[])
@@ -1403,7 +1387,6 @@ shell(int argc, char *argv[])
 }
 return 1;
 }
-#endif	/* !defined(TN3270) */
 
 /*VARARGS*/
 static int
@@ -1422,9 +1405,6 @@ bye(int  argc, char *argv[])
 #endif	/* defined(AUTHENTICATION) */
 	/* reset options */
 	tninit();
-#ifdef TN3270
-	SetIn3270();		/* Get out of 3270 mode */
-#endif	/* defined(TN3270) */
 }
 if ((argc != 2) || (strcmp(argv[1], "fromquit") != 0)) {
 	longjmp(toplevel, 1);
@@ -2035,35 +2015,6 @@ encrypt_cmd(int argc, char *argv[])
 }
 #endif	/* ENCRYPTION */
 
-#ifdef TN3270
-static void
-filestuff(int fd)
-{
-int res;
-
-setconnmode(0);
-res = fcntl(fd, F_GETOWN, 0);
-setcommandmode();
-
-if (res == -1) {
-	perror("fcntl");
-	return;
-}
-printf("\tOwner is %d.\n", res);
-
-setconnmode(0);
-res = fcntl(fd, F_GETFL, 0);
-setcommandmode();
-
-if (res == -1) {
-	perror("fcntl");
-	return;
-}
-#ifdef notdef
-printf("\tFlags are 0x%x: %s\n", res, decodeflags(res));
-#endif
-}
-#endif /* defined(TN3270) */
 
 /*
  * Print status about the connection.
@@ -2102,35 +2053,8 @@ status(int argc, char *argv[])
 } else {
 	printf("No connection.\n");
 }
-#   ifndef TN3270
 printf("Escape character is '%s'.\n", control(escape));
 (void) fflush(stdout);
-#   else /* !defined(TN3270) */
-if ((!In3270) && ((argc < 2) || strcmp(argv[1], "notmuch"))) {
-	printf("Escape character is 

CVS commit: src/lib/libc/net

2018-12-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Dec 13 04:41:41 UTC 2018

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Adjust English usage in message for EAI_NONAME.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/lib/libc/net/getaddrinfo.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/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.118 src/lib/libc/net/getaddrinfo.c:1.119
--- src/lib/libc/net/getaddrinfo.c:1.118	Thu Dec 13 04:30:55 2018
+++ src/lib/libc/net/getaddrinfo.c	Thu Dec 13 04:41:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.118 2018/12/13 04:30:55 dholland Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.119 2018/12/13 04:41:41 dholland Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.118 2018/12/13 04:30:55 dholland Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.119 2018/12/13 04:41:41 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -302,7 +302,7 @@ static const char * const ai_errlist[] =
 	"ai_family not supported",			/* EAI_FAMILY	  */
 	"Memory allocation failure",			/* EAI_MEMORY	  */
 	"No address associated with hostname",		/* EAI_NODATA	  */
-	"hostname nor servname provided, or not known", /* EAI_NONAME	  */
+	"hostname or servname not provided or not known", /* EAI_NONAME	  */
 	"servname not supported for ai_socktype",	/* EAI_SERVICE	  */
 	"ai_socktype not supported",			/* EAI_SOCKTYPE	  */
 	"System error returned in errno",		/* EAI_SYSTEM	  */



CVS commit: src/lib/libc/net

2018-12-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Dec 13 04:30:56 UTC 2018

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Return EAI_NODATA, not EAI_NONAME, for nonexistent hosts.

This causes e.g. "ssh nosuchname" to print "No address associated with
hostname", which is correct, rather than "hostname nor servname
provided, or not known", which is not.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/lib/libc/net/getaddrinfo.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/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.117 src/lib/libc/net/getaddrinfo.c:1.118
--- src/lib/libc/net/getaddrinfo.c:1.117	Thu Dec 28 15:12:15 2017
+++ src/lib/libc/net/getaddrinfo.c	Thu Dec 13 04:30:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.117 2017/12/28 15:12:15 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.118 2018/12/13 04:30:55 dholland Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.117 2017/12/28 15:12:15 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.118 2018/12/13 04:30:55 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -1188,7 +1188,7 @@ explore_fqdn(const struct addrinfo *pai,
 		error = EAI_FAIL;
 		goto free;
 	case NS_NOTFOUND:
-		error = EAI_NONAME;
+		error = EAI_NODATA;
 		goto free;
 	case NS_SUCCESS:
 		error = 0;



CVS commit: src/libexec/telnetd

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec 13 04:29:18 UTC 2018

Modified Files:
src/libexec/telnetd: sys_term.c

Log Message:
Remove unused macros.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/libexec/telnetd/sys_term.c

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

Modified files:

Index: src/libexec/telnetd/sys_term.c
diff -u src/libexec/telnetd/sys_term.c:1.47 src/libexec/telnetd/sys_term.c:1.48
--- src/libexec/telnetd/sys_term.c:1.47	Fri Jun 28 15:48:02 2013
+++ src/libexec/telnetd/sys_term.c	Thu Dec 13 04:29:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_term.c,v 1.47 2013/06/28 15:48:02 christos Exp $	*/
+/*	$NetBSD: sys_term.c,v 1.48 2018/12/13 04:29:18 maya Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)sys_term.c	8.4+1 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: sys_term.c,v 1.47 2013/06/28 15:48:02 christos Exp $");
+__RCSID("$NetBSD: sys_term.c,v 1.48 2018/12/13 04:29:18 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -51,9 +51,6 @@ __RCSID("$NetBSD: sys_term.c,v 1.47 2013
 #include 
 #endif
 
-#define SCPYN(a, b)	(void) strncpy(a, b, sizeof(a))
-#define SCMPN(a, b)	strncmp(a, b, sizeof(a))
-
 struct termios termbuf, termbuf2;	/* pty control structure */
 
 void getptyslave(void);



CVS commit: src/usr.sbin/mtree

2018-12-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Dec 13 03:18:18 UTC 2018

Modified Files:
src/usr.sbin/mtree: mtree.8

Log Message:
Fix naming inconsistency; PR 53769 from silas.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/usr.sbin/mtree/mtree.8

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/mtree/mtree.8
diff -u src/usr.sbin/mtree/mtree.8:1.72 src/usr.sbin/mtree/mtree.8:1.73
--- src/usr.sbin/mtree/mtree.8:1.72	Wed Feb 22 14:15:15 2017
+++ src/usr.sbin/mtree/mtree.8	Thu Dec 13 03:18:18 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mtree.8,v 1.72 2017/02/22 14:15:15 abhinav Exp $
+.\"	$NetBSD: mtree.8,v 1.73 2018/12/13 03:18:18 dholland Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -374,7 +374,7 @@ the starting directory); otherwise,
 it will be matched against basenames only.
 Comments are permitted in
 the
-.Ar exclude-list
+.Ar exclude-file
 file.
 .It Fl x
 Don't descend below mount points in the file hierarchy.



CVS commit: src/usr.bin/vmstat

2018-12-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Dec 13 01:58:04 UTC 2018

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
typo


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/vmstat/vmstat.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.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.224 src/usr.bin/vmstat/vmstat.c:1.225
--- src/usr.bin/vmstat/vmstat.c:1.224	Mon Dec  4 03:05:57 2017
+++ src/usr.bin/vmstat/vmstat.c	Thu Dec 13 01:58:04 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.224 2017/12/04 03:05:57 mrg Exp $ */
+/* $NetBSD: vmstat.c,v 1.225 2018/12/13 01:58:04 sevan Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.224 2017/12/04 03:05:57 mrg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.225 2018/12/13 01:58:04 sevan Exp $");
 #endif
 #endif /* not lint */
 
@@ -1439,7 +1439,7 @@ dopool_sysctl(int verbose, int wide)
 
 	data = asysctlbyname("kern.pool", );
 	if (data == NULL)
-		err(1, "failed to reead kern.pool");
+		err(1, "failed to read kern.pool");
 
 	memset(_totals, 0, sizeof pool_totals);
 	total = inuse = 0;
@@ -1725,7 +1725,7 @@ dopoolcache_sysctl(int verbose)
 
 	data = asysctlbyname("kern.pool", );
 	if (data == NULL)
-		err(1, "failed to reead kern.pool");
+		err(1, "failed to read kern.pool");
 	len /= sizeof(*data);
 
 	for (i = 0; i < len; ++i) {



CVS commit: src/sys/dev/usb

2018-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 13 01:40:02 UTC 2018

Modified Files:
src/sys/dev/usb: uchcom.c

Log Message:
Calculate uchcom(4) dividers differently; usually the same, but sometimes 
better.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/usb/uchcom.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/usb/uchcom.c
diff -u src/sys/dev/usb/uchcom.c:1.26 src/sys/dev/usb/uchcom.c:1.27
--- src/sys/dev/usb/uchcom.c:1.26	Thu Dec 13 00:36:30 2018
+++ src/sys/dev/usb/uchcom.c	Thu Dec 13 01:40:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uchcom.c,v 1.26 2018/12/13 00:36:30 jakllsch Exp $	*/
+/*	$NetBSD: uchcom.c,v 1.27 2018/12/13 01:40:02 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.26 2018/12/13 00:36:30 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.27 2018/12/13 01:40:02 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -91,8 +91,6 @@ int	uchcomdebug = 0;
 #define UCHCOM_VER_20		0x20
 #define UCHCOM_VER_30		0x30
 
-#define UCHCOM_BASE_UNKNOWN	0
-
 #define UCHCOM_BPS_PRE_IMM	0x80	/* CH341: immediate RX forwarding */
 
 #define UCHCOM_DTR_MASK		0x20
@@ -154,24 +152,13 @@ struct uchcom_divider
 	uint8_t		dv_div;
 };
 
-struct uchcom_divider_record
-{
-	uint32_t		dvr_high;
-	uint32_t		dvr_low;
-	uint32_t		dvr_base_clock;
-	struct uchcom_divider	dvr_divider;
-};
-
-static const struct uchcom_divider_record dividers[] =
-{
-	{  307200, 307200, UCHCOM_BASE_UNKNOWN, { 7, 0xD9 } },
-	{  921600, 921600, UCHCOM_BASE_UNKNOWN, { 7, 0xF3 } },
-	{ 299,  23530, 600, { 3,0 } },
-	{   23529,   2942,  75, { 2,0 } },
-	{2941,368,   93750, { 1,0 } },
-	{ 367,  1,   11719, { 0,0 } },
+static const uint32_t rates4x[8] = {
+	[0] = 4 * 1200 / 1024,
+	[1] = 4 * 1200 / 128,
+	[2] = 4 * 1200 / 16,
+	[3] = 4 * 1200 / 2,
+	[7] = 4 * 1200,
 };
-#define NUM_DIVIDERS	(sizeof (dividers) / sizeof (dividers[0]))
 
 static const struct usb_devno uchcom_devs[] = {
 	{ USB_VENDOR_QINHENG2, USB_PRODUCT_QINHENG2_CH341SER },
@@ -646,33 +633,41 @@ set_break(struct uchcom_softc *sc, int o
 static int
 calc_divider_settings(struct uchcom_divider *dp, uint32_t rate)
 {
-	int i;
-	const struct uchcom_divider_record *rp;
-	uint32_t div, rem;
-
-	/* find record */
-	for (i=0; i= rate &&
-		dividers[i].dvr_low <= rate) {
-			rp = [i];
-			goto found;
+	size_t i;
+	uint32_t best, div, pre;
+	const uint32_t rate4x = rate * 4U;
+
+	if (rate == 0 || rate > 300)
+		return -1;
+
+	pre = __arraycount(rates4x);
+	best = UINT32_MAX;
+
+	for (i = 0; i < __arraycount(rates4x); i++) {
+		uint32_t score, try;
+		try = rates4x[i] * 2 / rate4x;
+		try = (try / 2) + (try & 1);
+		if (try < 2)
+			continue;
+		if (try > 255)
+			try = 255;
+		score = abs((int)rate4x - rates4x[i] / try);
+		if (score < best) {
+			best = score;
+			pre = i;
+			div = try;
 		}
 	}
-	return -1;
 
-found:
-	dp->dv_prescaler = rp->dvr_divider.dv_prescaler;
-	if (rp->dvr_base_clock == UCHCOM_BASE_UNKNOWN)
-		dp->dv_div = rp->dvr_divider.dv_div;
-	else {
-		div = rp->dvr_base_clock / rate;
-		rem = rp->dvr_base_clock % rate;
-		if (div==0 || div>=0xFF)
-			return -1;
-		if ((rem<<1) >= rate)
-			div += 1;
-		dp->dv_div = (uint8_t)-div;
-	}
+	if (pre >= __arraycount(rates4x))
+		return -1;
+	if ((rates4x[pre] / div / 4) < (rate * 99 / 100))
+		return -1;
+	if ((rates4x[pre] / div / 4) > (rate * 101 / 100))
+		return -1;
+
+	dp->dv_prescaler = pre;
+	dp->dv_div = (uint8_t)-div;
 
 	return 0;
 }



CVS commit: src/usr.bin/vmstat

2018-12-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Dec 13 01:29:11 UTC 2018

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

Log Message:
Describe what happens when you run vmstat witout any options aka the first line
of vmstat.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.1
diff -u src/usr.bin/vmstat/vmstat.1:1.22 src/usr.bin/vmstat/vmstat.1:1.23
--- src/usr.bin/vmstat/vmstat.1:1.22	Wed Dec  5 23:42:23 2018
+++ src/usr.bin/vmstat/vmstat.1	Thu Dec 13 01:29:10 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmstat.1,v 1.22 2018/12/05 23:42:23 sevan Exp $
+.\"	$NetBSD: vmstat.1,v 1.23 2018/12/13 01:29:10 sevan Exp $
 .\"
 .\" Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
 .\"
-.Dd December 5, 2018
+.Dd December 13, 2018
 .Dt VMSTAT 1
 .Os
 .Sh NAME
@@ -73,6 +73,12 @@
 .Nm
 reports certain kernel statistics kept about process, virtual memory,
 disk, trap, and CPU activity.
+If
+.Nm
+is invoked without any options, it displays the summary of statistics since
+boot and exits.
+This is also referred to as the first line of
+.Nm .
 .Pp
 The options are as follows:
 .Bl -tag -width xxxhistname



CVS commit: src/sys/dev/usb

2018-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 13 00:36:30 UTC 2018

Modified Files:
src/sys/dev/usb: uchcom.c

Log Message:
Fix uchcom(4) line parameter settings.

Enables support for line modes other than 8-bit/no-parity/1-stop on
modern chips, and should also work on older chips.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/uchcom.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/usb/uchcom.c
diff -u src/sys/dev/usb/uchcom.c:1.25 src/sys/dev/usb/uchcom.c:1.26
--- src/sys/dev/usb/uchcom.c:1.25	Wed Dec 12 23:26:00 2018
+++ src/sys/dev/usb/uchcom.c	Thu Dec 13 00:36:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uchcom.c,v 1.25 2018/12/12 23:26:00 jakllsch Exp $	*/
+/*	$NetBSD: uchcom.c,v 1.26 2018/12/13 00:36:30 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.25 2018/12/12 23:26:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.26 2018/12/13 00:36:30 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -84,9 +84,8 @@ int	uchcomdebug = 0;
 #define UCHCOM_REG_STAT2	0x07
 #define UCHCOM_REG_BPS_PRE	0x12
 #define UCHCOM_REG_BPS_DIV	0x13
-#define UCHCOM_REG_BREAK1	0x05
-#define UCHCOM_REG_BREAK2	0x18
-#define UCHCOM_REG_LCR1		0x18
+#define UCHCOM_REG_BREAK	0x05
+#define UCHCOM_REG_LCR		0x18
 #define UCHCOM_REG_LCR2		0x25
 
 #define UCHCOM_VER_20		0x20
@@ -99,16 +98,20 @@ int	uchcomdebug = 0;
 #define UCHCOM_DTR_MASK		0x20
 #define UCHCOM_RTS_MASK		0x40
 
-#define UCHCOM_BRK1_MASK	0x01
-#define UCHCOM_BRK2_MASK	0x40
+#define UCHCOM_BREAK_MASK	0x01
 
-#define UCHCOM_LCR1_MASK	0xAF
-#define UCHCOM_LCR2_MASK	0x07
-#define UCHCOM_LCR1_PARENB	0x80
-#define UCHCOM_LCR2_PAREVEN	0x07
-#define UCHCOM_LCR2_PARODD	0x06
-#define UCHCOM_LCR2_PARMARK	0x05
-#define UCHCOM_LCR2_PARSPACE	0x04
+#define UCHCOM_LCR_CS5		0x00
+#define UCHCOM_LCR_CS6		0x01
+#define UCHCOM_LCR_CS7		0x02
+#define UCHCOM_LCR_CS8		0x03
+#define UCHCOM_LCR_STOPB	0x04
+#define UCHCOM_LCR_PARENB	0x08
+#define UCHCOM_LCR_PARODD	0x00
+#define UCHCOM_LCR_PAREVEN	0x10
+#define UCHCOM_LCR_PARMARK	0x20
+#define UCHCOM_LCR_PARSPACE	0x30
+#define UCHCOM_LCR_TXE		0x40
+#define UCHCOM_LCR_RXE		0x80
 
 #define UCHCOM_INTR_STAT1	0x02
 #define UCHCOM_INTR_STAT2	0x03
@@ -619,21 +622,21 @@ static int
 set_break(struct uchcom_softc *sc, int onoff)
 {
 	usbd_status err;
-	uint8_t brk1, brk2;
+	uint8_t brk, lcr;
 
-	err = read_reg(sc, UCHCOM_REG_BREAK1, , UCHCOM_REG_BREAK2, );
+	err = read_reg(sc, UCHCOM_REG_BREAK, , UCHCOM_REG_LCR, );
 	if (err)
 		return EIO;
 	if (onoff) {
 		/* on - clear bits */
-		brk1 &= ~UCHCOM_BRK1_MASK;
-		brk2 &= ~UCHCOM_BRK2_MASK;
+		brk &= ~UCHCOM_BREAK_MASK;
+		lcr &= ~UCHCOM_LCR_TXE;
 	} else {
 		/* off - set bits */
-		brk1 |= UCHCOM_BRK1_MASK;
-		brk2 |= UCHCOM_BRK2_MASK;
+		brk |= UCHCOM_BREAK_MASK;
+		lcr |= UCHCOM_LCR_TXE;
 	}
-	err = write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_BREAK2, brk2);
+	err = write_reg(sc, UCHCOM_REG_BREAK, brk, UCHCOM_REG_LCR, lcr);
 	if (err)
 		return EIO;
 
@@ -698,52 +701,48 @@ set_dte_rate(struct uchcom_softc *sc, ui
 static int
 set_line_control(struct uchcom_softc *sc, tcflag_t cflag)
 {
-	if (sc->sc_version < UCHCOM_VER_30) {
-		usbd_status err;
-		uint8_t lcr1val = 0, lcr2val = 0;
+	usbd_status err;
+	uint8_t lcr = 0, lcr2 = 0;
 
-		err = read_reg(sc, UCHCOM_REG_LCR1, , UCHCOM_REG_LCR2, );
-		if (err) {
-			device_printf(sc->sc_dev, "cannot get LCR: %s\n",
-			usbd_errstr(err));
-			return EIO;
-		}
+	err = read_reg(sc, UCHCOM_REG_LCR, , UCHCOM_REG_LCR2, );
+	if (err) {
+		device_printf(sc->sc_dev, "cannot get LCR: %s\n",
+		usbd_errstr(err));
+		return EIO;
+	}
 
-		lcr1val &= ~UCHCOM_LCR1_MASK;
-		lcr2val &= ~UCHCOM_LCR2_MASK;
+	lcr = UCHCOM_LCR_RXE | UCHCOM_LCR_TXE;
 
-		/*
-		 * XXX: it is difficult to handle the line control appropriately:
-		 *   - CS8, !CSTOPB and any parity mode seems ok, but
-		 *   - the chip doesn't have the function to calculate parity
-		 * in !CS8 mode.
-		 *   - it is unclear that the chip supports CS5,6 mode.
-		 *   - it is unclear how to handle stop bits.
-		 */
-
-		switch (ISSET(cflag, CSIZE)) {
-		case CS5:
-		case CS6:
-		case CS7:
-			return EINVAL;
-		case CS8:
-			break;
-		}
+	switch (ISSET(cflag, CSIZE)) {
+	case CS5:
+		lcr |= UCHCOM_LCR_CS5;
+		break;
+	case CS6:
+		lcr |= UCHCOM_LCR_CS6;
+		break;
+	case CS7:
+		lcr |= UCHCOM_LCR_CS7;
+		break;
+	case CS8:
+		lcr |= UCHCOM_LCR_CS8;
+		break;
+	}
 
-		if (ISSET(cflag, PARENB)) {
-			lcr1val |= UCHCOM_LCR1_PARENB;
-			if (ISSET(cflag, PARODD))
-lcr2val |= UCHCOM_LCR2_PARODD;
-			else
-lcr2val |= UCHCOM_LCR2_PAREVEN;
-		}
+	if (ISSET(cflag, PARENB)) {
+		lcr |= UCHCOM_LCR_PARENB;
+		if (!ISSET(cflag, PARODD))
+			lcr |= UCHCOM_LCR_PAREVEN;
+	}
 
-		err = write_reg(sc, UCHCOM_REG_LCR1, lcr1val, 

CVS commit: src/doc

2018-12-12 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Wed Dec 12 23:40:02 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
amdtemp +16h


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2464 src/doc/CHANGES:1.2465
--- src/doc/CHANGES:1.2464	Wed Dec 12 13:02:35 2018
+++ src/doc/CHANGES	Wed Dec 12 23:40:02 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2464 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2465 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -262,3 +262,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	kernel: Remove the lmc(4) driver, and its associated lmcconfig(8)
 		tool. [maxv 20181212]
 	sh(1): Many bug fixes and enhancements.  [kre 20181212]
+	amdtemp(4): Add support for AMD family 16h temperature sensors.
+		[is 20181213]



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

2018-12-12 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Wed Dec 12 23:35:04 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdnb_misc.c amdtemp.c

Log Message:
Added support for AMD family 16h cpu sensors - (just like 10h-14h).
(Tested on netbsd-8.0 release.)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/amdnb_misc.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x86/pci/amdtemp.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/pci/amdnb_misc.c
diff -u src/sys/arch/x86/pci/amdnb_misc.c:1.2 src/sys/arch/x86/pci/amdnb_misc.c:1.3
--- src/sys/arch/x86/pci/amdnb_misc.c:1.2	Mon Apr 16 16:07:24 2012
+++ src/sys/arch/x86/pci/amdnb_misc.c	Wed Dec 12 23:35:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdnb_misc.c,v 1.2 2012/04/16 16:07:24 cegger Exp $ */
+/*	$NetBSD: amdnb_misc.c,v 1.3 2018/12/12 23:35:04 is Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.2 2012/04/16 16:07:24 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.3 2018/12/12 23:35:04 is Exp $");
 
 #include 
 #include 
@@ -67,6 +67,8 @@ amdnb_misc_match(device_t parent, cfdata
 	case PCI_PRODUCT_AMD_AMD64_F11_MISC:
 	case PCI_PRODUCT_AMD_F14_NB:		/* Family 12h, too */
 	case PCI_PRODUCT_AMD_F15_MISC:
+	case PCI_PRODUCT_AMD_F16_NB:
+	case PCI_PRODUCT_AMD_F16_30_NB:
 		break;
 	default:
 		return 0;

Index: src/sys/arch/x86/pci/amdtemp.c
diff -u src/sys/arch/x86/pci/amdtemp.c:1.21 src/sys/arch/x86/pci/amdtemp.c:1.22
--- src/sys/arch/x86/pci/amdtemp.c:1.21	Thu Sep 27 14:59:43 2018
+++ src/sys/arch/x86/pci/amdtemp.c	Wed Dec 12 23:35:04 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdtemp.c,v 1.21 2018/09/27 14:59:43 maxv Exp $ */
+/*  $NetBSD: amdtemp.c,v 1.22 2018/12/12 23:35:04 is Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 1.21 2018/09/27 14:59:43 maxv Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 1.22 2018/12/12 23:35:04 is Exp $ ");
 
 #include 
 #include 
@@ -206,7 +206,7 @@ amdtemp_match(device_t parent, cfdata_t 
 	}
 
 	/* Not yet supported CPUs. */
-	if (family > 0x15)
+	if (family > 0x16)
 		return 0;
 
 	return 1;
@@ -251,6 +251,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x12: /* AMD Lynx/Sabine (Llano) */
 	case 0x14: /* AMD Brazos (Ontario/Zacate/Desna) */
 	case 0x15:
+	case 0x16:
 		amdtemp_family10_init(sc);
 		break;
 
@@ -278,6 +279,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x12:
 	case 0x14:
 	case 0x15:
+	case 0x16:
 		amdtemp_family10_setup_sensors(sc, device_unit(self));
 		break;
 	}
@@ -305,6 +307,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x12:
 	case 0x14:
 	case 0x15:
+	case 0x16:
 		sc->sc_sme->sme_refresh = amdtemp_family10_refresh;
 		break;
 	}



CVS commit: src/sys/dev/usb

2018-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Dec 12 23:26:00 UTC 2018

Modified Files:
src/sys/dev/usb: uchcom.c

Log Message:
remove unneeded variables in uchcom_softc


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/uchcom.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/usb/uchcom.c
diff -u src/sys/dev/usb/uchcom.c:1.24 src/sys/dev/usb/uchcom.c:1.25
--- src/sys/dev/usb/uchcom.c:1.24	Wed Dec 12 23:21:36 2018
+++ src/sys/dev/usb/uchcom.c	Wed Dec 12 23:26:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uchcom.c,v 1.24 2018/12/12 23:21:36 jakllsch Exp $	*/
+/*	$NetBSD: uchcom.c,v 1.25 2018/12/12 23:26:00 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.24 2018/12/12 23:21:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.25 2018/12/12 23:26:00 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -135,8 +135,6 @@ struct uchcom_softc
 	int			sc_rts;
 	u_char			sc_lsr;
 	u_char			sc_msr;
-	int			sc_lcr1;
-	int			sc_lcr2;
 };
 
 struct uchcom_endpoints



CVS commit: src/sys/dev/usb

2018-12-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Dec 12 23:21:36 UTC 2018

Modified Files:
src/sys/dev/usb: uchcom.c

Log Message:
omit irrelevant #includes


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/uchcom.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/usb/uchcom.c
diff -u src/sys/dev/usb/uchcom.c:1.23 src/sys/dev/usb/uchcom.c:1.24
--- src/sys/dev/usb/uchcom.c:1.23	Tue Dec 11 01:07:29 2018
+++ src/sys/dev/usb/uchcom.c	Wed Dec 12 23:21:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uchcom.c,v 1.23 2018/12/11 01:07:29 jakllsch Exp $	*/
+/*	$NetBSD: uchcom.c,v 1.24 2018/12/12 23:21:36 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.23 2018/12/11 01:07:29 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1.24 2018/12/12 23:21:36 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -54,12 +54,10 @@ __KERNEL_RCSID(0, "$NetBSD: uchcom.c,v 1
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 



CVS commit: src/share/misc

2018-12-12 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Dec 12 22:27:03 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
+DYAC


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.275 src/share/misc/acronyms:1.276
--- src/share/misc/acronyms:1.275	Wed Sep 19 18:50:39 2018
+++ src/share/misc/acronyms	Wed Dec 12 22:27:03 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.275 2018/09/19 18:50:39 ginsbach Exp $
+$NetBSD: acronyms,v 1.276 2018/12/12 22:27:03 dholland Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -125,6 +125,7 @@ DSTM	don't shoot the messenger
 DTRT	do the right thing
 DTWT	do the wrong thing
 DWIM	do what I mean
+DYAC	damn you autocorrect
 DYK	do you know?
 EA	early adopter
 ECR	electronic cash register



CVS commit: src/bin

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 20:22:43 UTC 2018

Modified Files:
src/bin/kill: kill.c
src/bin/sh: sh.1 trap.c

Log Message:
Reverse a decision made when the printsignals() routines from
kill and sh were merged so that the shell (for trap -l) and
kill (for kill -l) can use the same routine, and site that function
in the shell, rather than in kill (use the code that is in kill as
the basis for that routine).   This allows access to sh internals,
and in particular to the posix option, so the builtin kill can
operate in posix mode where the standard requires just a single
character (space of newline) between successive signal names (and
we prefer nicely aligned columns instead)..

In a SMALL shell, use the ancient sh printsignals routine instead,
it is smaller (and very much dumber).

/bin/kill still uses the routine that is in its source, and is
not posix compliant.   A task for some other day...


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/bin/kill/kill.c
cvs rdiff -u -r1.215 -r1.216 src/bin/sh/sh.1
cvs rdiff -u -r1.49 -r1.50 src/bin/sh/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/bin/kill/kill.c
diff -u src/bin/kill/kill.c:1.29 src/bin/kill/kill.c:1.30
--- src/bin/kill/kill.c:1.29	Sun Oct 28 18:26:52 2018
+++ src/bin/kill/kill.c	Wed Dec 12 20:22:43 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: kill.c,v 1.29 2018/10/28 18:26:52 kre Exp $ */
+/* $NetBSD: kill.c,v 1.30 2018/12/12 20:22:43 kre Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kill.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kill.c,v 1.29 2018/10/28 18:26:52 kre Exp $");
+__RCSID("$NetBSD: kill.c,v 1.30 2018/12/12 20:22:43 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -254,6 +254,7 @@ nosig(const char *name)
 	/* NOTREACHED */
 }
 
+#ifndef SHELL
 /*
  * Print the names of all the signals (neatly) to fp
  * "len" gives the number of chars already printed to
@@ -302,6 +303,7 @@ printsignals(FILE *fp, int len)
 	if (len != 0)
 		fprintf(fp, "\n");
 }
+#endif
 
 static void
 usage(void)

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.215 src/bin/sh/sh.1:1.216
--- src/bin/sh/sh.1:1.215	Wed Dec 12 12:56:17 2018
+++ src/bin/sh/sh.1	Wed Dec 12 20:22:43 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.215 2018/12/12 12:56:17 kre Exp $
+.\"	$NetBSD: sh.1,v 1.216 2018/12/12 20:22:43 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -530,11 +530,16 @@ whether a colon (:) terminates the user 
 other than in assignment statements
 .Dq ( no
 in posix mode),
+the format of the output of the
+.Ic kill Fl l
+command, where posix mode causes the names of the signals
+be separated by either a single space or newline, and where otherwise
+sufficient spaces are inserted to generate nice looking columns,
 and whether the shell treats
 an empty brace-list compound statement as a syntax error
 (expected by POSIX) or permits it.
 Such statements
-.Dq "{ }"
+.Dq "{\ }"
 can be useful when defining dummy functions.
 Lastly, in posix mode, only one
 .Dq \&!

Index: src/bin/sh/trap.c
diff -u src/bin/sh/trap.c:1.49 src/bin/sh/trap.c:1.50
--- src/bin/sh/trap.c:1.49	Wed Dec  5 22:25:38 2018
+++ src/bin/sh/trap.c	Wed Dec 12 20:22:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.49 2018/12/05 22:25:38 kre Exp $	*/
+/*	$NetBSD: trap.c,v 1.50 2018/12/12 20:22:43 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)trap.c	8.5 (Berkeley) 6/5/95";
 #else
-__RCSID("$NetBSD: trap.c,v 1.49 2018/12/05 22:25:38 kre Exp $");
+__RCSID("$NetBSD: trap.c,v 1.50 2018/12/12 20:22:43 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -46,7 +46,11 @@ __RCSID("$NetBSD: trap.c,v 1.49 2018/12/
 #include 
 #include 
 #include 
+#include 
 
+#undef	CEOF	/* from  but concflicts with sh use */
+
+#include 
 #include 
 
 #include "shell.h"
@@ -135,7 +139,7 @@ trap_signame(int signo)
 	return nbuf;
 }
 
-#if 0		/* Share the version of this in src/bin/kill/kill.c */
+#ifdef SMALL
 /*
  * Print a list of valid signal names
  */
@@ -154,7 +158,62 @@ printsignals(struct output *out, int len
 			outc(' ', out);
 	}
 }
-#endif
+#else /* !SMALL */
+/*
+ * Print the names of all the signals (neatly) to fp
+ * "len" gives the number of chars already printed to
+ * the current output line (in kill.c, always 0)
+ */
+void
+printsignals(struct output *out, int len)
+{
+	int sig;
+	int nl, pad;
+	const char *name;
+	int termwidth = 80;
+
+	if ((name = bltinlookup("COLUMNS", 1)) != NULL)
+		termwidth = (int)strtol(name, NULL, 10);
+	else if (isatty(1)) {
+		struct winsize win;
+
+		if (ioctl(1, TIOCGWINSZ, ) == 0 && win.ws_col > 0)
+			termwidth = win.ws_col;
+	}
+
+	if (posix)
+		pad = 1;
+	else
+		pad = (len | 7) + 1 - len;
+
+	for (sig 

CVS commit: src/usr.bin/telnet

2018-12-12 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Dec 12 19:05:32 UTC 2018

Modified Files:
src/usr.bin/telnet: telnet.c utilities.c

Log Message:
switch sprintf to snprintf in places.

Reported by hacker fantastic, thanks!

ok xtos.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/telnet/telnet.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/telnet/utilities.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.bin/telnet/telnet.c
diff -u src/usr.bin/telnet/telnet.c:1.36 src/usr.bin/telnet/telnet.c:1.37
--- src/usr.bin/telnet/telnet.c:1.36	Tue Jan 10 13:49:32 2012
+++ src/usr.bin/telnet/telnet.c	Wed Dec 12 19:05:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnet.c,v 1.36 2012/01/10 13:49:32 christos Exp $	*/
+/*	$NetBSD: telnet.c,v 1.37 2018/12/12 19:05:32 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)telnet.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnet.c,v 1.36 2012/01/10 13:49:32 christos Exp $");
+__RCSID("$NetBSD: telnet.c,v 1.37 2018/12/12 19:05:32 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -856,8 +856,8 @@ suboption(void)
 	name = gettermname();
 	len = strlen(name) + 4 + 2;
 	if (len < NETROOM()) {
-		sprintf((char *)temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE,
-TELQUAL_IS, name, IAC, SE);
+		snprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", IAC, SB,
+TELOPT_TTYPE, TELQUAL_IS, name, IAC, SE);
 		ring_supply_data(, temp, len);
 		printsub('>', [2], len-2);
 	} else {
@@ -878,8 +878,8 @@ suboption(void)
 
 	TerminalSpeeds(, );
 
-	sprintf((char *)temp, "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED,
-		TELQUAL_IS, osp, isp, IAC, SE);
+	snprintf((char *)temp, sizeof(temp), "%c%c%c%c%ld,%ld%c%c", IAC, SB,
+		TELOPT_TSPEED, TELQUAL_IS, osp, isp, IAC, SE);
 	len = strlen((char *)temp+4) + 4;	/* temp[3] is 0 ... */
 
 	if (len < NETROOM()) {
@@ -983,8 +983,8 @@ suboption(void)
 		send_wont(TELOPT_XDISPLOC, 1);
 		break;
 	}
-	sprintf((char *)temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_XDISPLOC,
-		TELQUAL_IS, dp, IAC, SE);
+	snprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", IAC, SB,
+		TELOPT_XDISPLOC, TELQUAL_IS, dp, IAC, SE);
 	len = strlen((char *)temp+4) + 4;	/* temp[3] is 0 ... */
 
 	if (len < NETROOM()) {

Index: src/usr.bin/telnet/utilities.c
diff -u src/usr.bin/telnet/utilities.c:1.23 src/usr.bin/telnet/utilities.c:1.24
--- src/usr.bin/telnet/utilities.c:1.23	Mon Jan  9 16:08:55 2012
+++ src/usr.bin/telnet/utilities.c	Wed Dec 12 19:05:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: utilities.c,v 1.23 2012/01/09 16:08:55 christos Exp $	*/
+/*	$NetBSD: utilities.c,v 1.24 2018/12/12 19:05:32 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c	8.3 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.23 2012/01/09 16:08:55 christos Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.24 2018/12/12 19:05:32 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -633,7 +633,7 @@ printsub(
 		}
 		{
 		char tbuf[64];
-		sprintf(tbuf, "%s%s%s%s%s",
+		snprintf(tbuf, sizeof(tbuf), "%s%s%s%s%s",
 			pointer[2]_EDIT ? "|EDIT" : "",
 			pointer[2]_TRAPSIG ? "|TRAPSIG" : "",
 			pointer[2]_SOFT_TAB ? "|SOFT_TAB" : "",



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

2018-12-12 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Dec 12 18:11:00 UTC 2018

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

Log Message:
need space


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/aarch64/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/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.12 src/sys/arch/aarch64/aarch64/trap.c:1.13
--- src/sys/arch/aarch64/aarch64/trap.c:1.12	Fri Dec  7 18:46:27 2018
+++ src/sys/arch/aarch64/aarch64/trap.c	Wed Dec 12 18:11:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.12 2018/12/07 18:46:27 ryo Exp $ */
+/* $NetBSD: trap.c,v 1.13 2018/12/12 18:11:00 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.12 2018/12/07 18:46:27 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.13 2018/12/12 18:11:00 ryo Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -218,8 +218,8 @@ trap_el1h_sync(struct trapframe *tf)
 	case ESR_EC_SP_ALIGNMENT:
 	case ESR_EC_ILL_STATE:
 	default:
-		panic("Trap: fatal %s: pc=%016" PRIx64 "sp=%016" PRIx64
-		"esr=%08x", eclass_trapname(eclass), tf->tf_pc, tf->tf_sp,
+		panic("Trap: fatal %s: pc=%016" PRIx64 " sp=%016" PRIx64
+		" esr=%08x", eclass_trapname(eclass), tf->tf_pc, tf->tf_sp,
 		esr);
 		break;
 	}



CVS commit: src/doc

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 13:02:36 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
Note that sh(1) has changed since NetBSD 8.   Correct formatting of
some of my earlier entries.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2463 src/doc/CHANGES:1.2464
--- src/doc/CHANGES:1.2463	Wed Dec 12 08:02:17 2018
+++ src/doc/CHANGES	Wed Dec 12 13:02:35 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2463 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2464 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -74,7 +74,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	tmux(1): Imported 2.6. [christos 20171012]
 	amd64: Add support for SMAP. [maxv 20171017]
 	amd64: Add support for USER_LDT. [maxv 20171021]
-	tzdata updated to 2017c [kre 20171024]
+	tzdata Updated to 2017c. [kre 20171024]
 	libc: Update to tzcode2017c. [christos 20171024]
 	bwfm(4): Add driver for Broadcom BCM43xxx "FullMAC" USB wireless
 		adapters. [jmcneill 20171025]
@@ -130,7 +130,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lm(4): Add NCT6796D support. [msaitoh 20180308]
 	macppc: Enable Bluetooth support by default in GENERIC kernel.
 		[sevan 20180316]
-	tzdata: updated to 2017d [kre 20180324]
+	tzdata: Updated to 2017d. [kre 20180324]
 	dhcpcd: Import 7.0.2. [roy 20180327]
 	aarch64: Add initial support for aarch64. [ryo 20180401]
 	amd64: Add SpectreV2 mitigations, based on IBRS and the DIS_IND
@@ -152,7 +152,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	dhcpcd: Import 7.0.4. [roy 20180502]
 	libbozohttpd(3): Add the embeddable version of bozohttpd [sevan 20180503]
 	bozohttpd(3lua): Add Lua binding for libbozohttpd(3lua) [sevan 20180503]
-	tzdata: updated to 2017e [kre 20180504]
+	tzdata: Updated to 2017e. [kre 20180504]
 	libc: Update to tzcode2018e. [christos 20180504]
 	acpi(4): Updated ACPICA to 20180427. [christos 20180504]
 	gpio(4): Overhauled interrupt support.  Added GPIO interrupt
@@ -236,11 +236,11 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	file(1): Upgraded to 5.35. [christos 20181013]
 	arm: Provide generic start code that allows a GENERIC kernel to be used
 		on FDTised boards. [skrll 20181018]
-	tzdata: updated to 2018f [kre 20181019]
+	tzdata: Updated to 2018f. [kre 20181019]
 	amdccp(4): Add driver for AMD Cryptographic Coprocessor RNG.
 		[jakllsch 20181019]
 	libc: Update to tzcode2018f. [christos 20181019]
-	tzdata: updated to 2018g [kre 20181027]
+	tzdata: Updated to 2018g. [kre 20181027]
 	libc: Update to tzcode2018g. [christos 20181027]
 	kernel: Add NVMM, the NetBSD virtualization driver, with initial
 		support for x86. [maxv 20181107]
@@ -261,3 +261,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	OpenSSL: Imported 1.1.1a. [christos 20181208]
 	kernel: Remove the lmc(4) driver, and its associated lmcconfig(8)
 		tool. [maxv 20181212]
+	sh(1): Many bug fixes and enhancements.  [kre 20181212]



CVS commit: src/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 12:56:17 UTC 2018

Modified Files:
src/bin/sh: sh.1

Log Message:
More fixes for the SYNPOSIS of the readonly built-in.
The SYNOPSIS for "readonly -q" cannot have the -q be
optional ...   Also harmonise the output appearance with
that of the export command.

wiz: have at it...


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.214 src/bin/sh/sh.1:1.215
--- src/bin/sh/sh.1:1.214	Wed Dec 12 12:30:59 2018
+++ src/bin/sh/sh.1	Wed Dec 12 12:56:17 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.214 2018/12/12 12:30:59 kre Exp $
+.\"	$NetBSD: sh.1,v 1.215 2018/12/12 12:56:17 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3169,9 +3169,9 @@ literally.
 If a backslash is followed by a newline, the backslash and the
 newline will be deleted.
 .\"
-.It Ic readonly Ar name Ns Oo =value Oc Ns ...
-.It Ic readonly Oo Fl p Oo name... Oc Oc
-.It Ic readonly Oo Fl q Oc name...
+.It Ic readonly Ar name Ns Oo =value Oc ...
+.It Ic readonly Oo Fl p Oo Ar name ... Oc Oc
+.It Ic readonly Fl q Ar name ...
 With no options,
 the specified names are marked as read only, so that they cannot be
 subsequently modified or unset.



CVS commit: src/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 12:30:59 UTC 2018

Modified Files:
src/bin/sh: sh.1

Log Message:
Fix Oo Op Oc syntax error (which seemed to work OK to me)
Pointed out by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.213 src/bin/sh/sh.1:1.214
--- src/bin/sh/sh.1:1.213	Wed Dec 12 11:51:33 2018
+++ src/bin/sh/sh.1	Wed Dec 12 12:30:59 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.213 2018/12/12 11:51:33 kre Exp $
+.\"	$NetBSD: sh.1,v 1.214 2018/12/12 12:30:59 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3170,7 +3170,7 @@ If a backslash is followed by a newline,
 newline will be deleted.
 .\"
 .It Ic readonly Ar name Ns Oo =value Oc Ns ...
-.It Ic readonly Oo Fl p Op name... Oc
+.It Ic readonly Oo Fl p Oo name... Oc Oc
 .It Ic readonly Oo Fl q Oc name...
 With no options,
 the specified names are marked as read only, so that they cannot be



CVS commit: src/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 12:16:43 UTC 2018

Modified Files:
src/bin/sh: version.h

Log Message:
The time has come, the Walrus said...  (but no shoes,
ships, or sealing wax required).   No oysters either.

I have not taken the Magical Mystery Tour, but I
say it anyway...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/bin/sh/version.h

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

Modified files:

Index: src/bin/sh/version.h
diff -u src/bin/sh/version.h:1.2 src/bin/sh/version.h:1.3
--- src/bin/sh/version.h:1.2	Thu Mar 31 16:28:23 2016
+++ src/bin/sh/version.h	Wed Dec 12 12:16:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: version.h,v 1.2 2016/03/31 16:28:23 christos Exp $	*/
+/*	$NetBSD: version.h,v 1.3 2018/12/12 12:16:42 kre Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,4 +33,4 @@
  * when a new (shell only) release is to be exported.  This should not be
  * updated just because a new NetBSD release is to include this code.
  */
-#define	NETBSD_SHELL	"20160401"
+#define	NETBSD_SHELL	"20181212"



CVS commit: src/tests/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 11:52:05 UTC 2018

Modified Files:
src/tests/bin/sh: t_builtins.sh

Log Message:
Add a new test case for NetBSD specific readonly tests.
Add more sub-tests to the export_nbsd test case.
In both cases the new -q and -p VAR options are tested.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/bin/sh/t_builtins.sh

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

Modified files:

Index: src/tests/bin/sh/t_builtins.sh
diff -u src/tests/bin/sh/t_builtins.sh:1.3 src/tests/bin/sh/t_builtins.sh:1.4
--- src/tests/bin/sh/t_builtins.sh:1.3	Wed Dec 12 08:10:39 2018
+++ src/tests/bin/sh/t_builtins.sh	Wed Dec 12 11:52:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: t_builtins.sh,v 1.3 2018/12/12 08:10:39 kre Exp $
+# $NetBSD: t_builtins.sh,v 1.4 2018/12/12 11:52:05 kre Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -416,6 +416,45 @@ export_nbsd_body() {
 
 	atf_check -s not-exit:0 -e not-empty -o empty ${TEST_SH} -c \
 		'export VAR=exported; export -x VAR; export VAR=FOO'
+
+	have_builtin export '' 'export VAR;' '-q VAR' ' -q'  || return 0
+
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'unset VAR; VAR=set; export -q VAR'
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'export VAR=set; export -q VAR'
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'VAR=set; RW=set; export -q VAR RW'
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'VAR=set; export RO=set; export -q VAR RO'
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'export VAR=set RO=set; export -q VAR RO'
+
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'unset VAR; export -q VAR'
+	# next one is the same as the have_builtin test, so "cannot" fail...
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'unset VAR; export VAR; export -q VAR'
+
+	# if we have -q we should also have -p var...
+	# What's more, we are testing NetBSD sh, so we know output format.
+
+	atf_check -s exit:0 -e empty -o match:VAR=foobar \
+		${TEST_SH} -c \
+			'VAR=foobar ; export VAR ; export -p VAR'
+	atf_check -s exit:0 -e empty -o inline:1 \
+		${TEST_SH} -c \
+			'VAR=foobar ; export VAR ;
+			printf %d $(export -p VAR | wc -l)'
+	atf_check -s exit:0 -e empty \
+		-o inline:'export VAR=foobar\nexport OTHER\n' \
+		${TEST_SH} -c \
+			'VAR=foobar; export VAR OTHER; export -p VAR OTHER'
+	atf_check -s exit:0 -e empty \
+		-o inline:'export A=aaa\nexport B\nexport D='"''"'\n' \
+		${TEST_SH} -c \
+			'A=aaa D= C=foo; unset B; export A B D;
+			 export -p A B C D'
 }
 
 atf_test_case getopts
@@ -516,6 +555,51 @@ readonly_body() {
 		'unset VAR; readonly VAR=set; unset VAR; printf %s ${VAR-unset}'
 }
 
+atf_test_case readonly_nbsd
+readonly_nbsd_head() {
+	atf_set "descr" "Tests NetBSD extensions to 'readonly'"
+}
+readonly_nbsd_body() {
+	have_builtin readonly '' 'readonly VAR;' '-q VAR' ' -q'  || return 0
+
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'VAR=set; readonly -q VAR'
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'readonly VAR=set; readonly -q VAR'
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'VAR=set; RW=set; readonly -q VAR RW'
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'VAR=set; readonly RO=set; readonly -q VAR RO'
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'readonly VAR=set RO=set; readonly -q VAR RO'
+
+	atf_check -s exit:1 -o empty -e empty ${TEST_SH} -c \
+		'unset VAR; readonly -q VAR'
+	# next one is the same as the have_builtin test, so "cannot" fail...
+	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c \
+		'unset VAR; readonly VAR; readonly -q VAR'
+
+	# if we have -q we should also have -p var...
+	# What's more, we are testing NetBSD sh, so we know output format.
+
+	atf_check -s exit:0 -e empty -o match:VAR=foobar \
+		${TEST_SH} -c \
+			'VAR=foobar ; readonly VAR ; readonly -p VAR'
+	atf_check -s exit:0 -e empty -o inline:1 \
+		${TEST_SH} -c \
+			'VAR=foobar ; readonly VAR ;
+			printf %d $(readonly -p VAR | wc -l)'
+	atf_check -s exit:0 -e empty \
+		-o inline:'readonly VAR=foobar\nreadonly OTHER\n' \
+		${TEST_SH} -c \
+			'VAR=foobar; readonly VAR OTHER; readonly -p VAR OTHER'
+	atf_check -s exit:0 -e empty \
+		-o inline:'readonly A=aaa\nreadonly B\nreadonly D='"''"'\n' \
+		${TEST_SH} -c \
+			'A=aaa D= C=foo; unset B; readonly A B D;
+			 readonly -p A B C D'
+}
+
 atf_test_case cd_pwd
 cd_pwd_head() {
 	atf_set "descr" "Tests the shell builtins 'cd' & 'pwd'"
@@ -830,6 +914,7 @@ atf_init_test_cases() {
 	atf_add_test_case jobid
 	atf_add_test_case let
 	atf_add_test_case local
+	atf_add_test_case readonly_nbsd
 	atf_add_test_case setvar
 	# inputrc should probably be tested in libedit tests (somehow)
 



CVS commit: src/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 11:51:33 UTC 2018

Modified Files:
src/bin/sh: sh.1 var.c

Log Message:
Implement:
readonly -q VAR...
readonly -p VAR...
export -q [-x] VAR...
export -p [-x] VAR...

all available only in !SMALL shells - and while here, limit
"export -x" to full sized shells as well.

Also, do a better job of arg checking and validating of the
export and readonly commands (which is really just one built-in)
and of issuing error messages when something bogus is detected.

Since these commands are special builtin commands, any error
causes shell exit (for non-interactive shells).


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/bin/sh/sh.1
cvs rdiff -u -r1.73 -r1.74 src/bin/sh/var.c

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.212 src/bin/sh/sh.1:1.213
--- src/bin/sh/sh.1:1.212	Tue Dec 11 13:31:20 2018
+++ src/bin/sh/sh.1	Wed Dec 12 11:51:33 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.212 2018/12/11 13:31:20 kre Exp $
+.\"	$NetBSD: sh.1,v 1.213 2018/12/12 11:51:33 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\"	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\"
-.Dd December 11, 2018
+.Dd December 12, 2018
 .Dt SH 1
 .\" everything except c o and s (keep them ordered)
 .ds flags abCEeFfhIiLmnpquVvXx
@@ -2274,6 +2274,7 @@ etc).
 .It Ic \&: Op Ar arg ...
 A null command that returns a 0 (true) exit value.
 Any arguments or redirects are evaluated, then ignored.
+.\"
 .It Ic \&. Ar file
 The dot command reads and executes the commands from the specified
 .Ar file
@@ -2293,6 +2294,7 @@ and continue) behave across a dot comman
 This implementation allows them to control loops surrounding the dot command,
 but obviously such behavior should not be relied on.
 It is now permitted by the standard, but not required.
+.\"
 .It Ic alias Op Ar name Ns Op Li = Ns Ar string ...
 If
 .Ar name Ns Li = Ns Ar string
@@ -2310,9 +2312,11 @@ With no arguments, the
 built-in prints the
 names and values of all defined aliases (see
 .Ic unalias ) .
+.\"
 .It Ic bg Op Ar job ...
 Continue the specified jobs (or the current job if no
 jobs are given) in the background.
+.\"
 .It Ic command Oo Fl pVv Oc Ar command Op Ar arg ...
 Execute the specified command but ignore shell functions when searching
 for it.
@@ -2335,6 +2339,7 @@ Do not execute the command but
 search for the command and print the absolute pathname
 of utilities, the name for built-ins or the expansion of aliases.
 .El
+.\"
 .It Ic cd Oo Fl P Oc Op Ar directory Op Ar replace
 Switch to the specified directory (default
 .Ev $HOME ) .
@@ -2402,9 +2407,11 @@ mechanism was used
 or if the
 .Ar replace
 argument was used.
+.\"
 .It Ic eval Ar string ...
 Concatenate all the arguments with spaces.
 Then re-parse and execute the command.
+.\"
 .It Ic exec Op Ar command Op Ar arg ...
 Unless
 .Ar command
@@ -2447,14 +2454,17 @@ Alternatively, see the
 .Ic fdflags
 command below, which can set, or clear, this, and other,
 file descriptor flags.
+.\"
 .It Ic exit Op Ar exitstatus
 Terminate the shell process.
 If
 .Ar exitstatus
 is given it is used as the exit status of the shell; otherwise the
 exit status of the preceding command (the current value of $?) is used.
-.It Ic export Oo Fl npx Oc Ar name ...
-.It Ic export Fl p Op Fl x
+.\"
+.It Ic export Oo Fl nx Oc Ar name Ns Oo =value Oc ...
+.It Ic export Oo Fl x Oc Oo Fl p Oo Ar name ... Oc Oc
+.It Ic export Fl q Oo Fl x Oc Ar name ...
 With no options,
 but one or more names,
 the specified names are exported so that they will appear in the
@@ -2477,6 +2487,7 @@ provided the variable is not also read-o
 That is
 .Bd -literal -offset indent
 export -x FOO # FOO will now not be exported by default
+export FOO# this command will fail (non-fatally)
 FOO=some_value my_command
 .Ed
 .Pp
@@ -2487,30 +2498,57 @@ to
 through the environment.
 .Pp
 The shell allows the value of a variable to be set at the
-same time it is exported by writing
+same time it is exported (or unexported, etc) by writing
 .Pp
-.Dl export name=value
+.Dl export [-nx] name=value
 .Pp
-With no arguments the export command lists the names of all exported variables,
+With no arguments the export command lists the names of all
+set exported variables,
 or if
 .Fl x
-was given, all variables marked not for export.
+was given, all set variables marked not for export.
 With the
 .Fl p
-option specified the output will be formatted suitably for non-interactive use.
+option specified, the output will be formatted suitably for
+non-interactive use, and unset variables are included.
+When
+.Fl p
+is given, variable names, but not values, may also be
+given, in which case output is limited to the variables named.
 .Pp
-The
+With
+.Fl q
+and a 

CVS commit: src/lib/libnvmm

2018-12-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec 12 11:40:08 UTC 2018

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

Log Message:
Remove superfluous dot.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/lib/libnvmm/libnvmm.3:1.4
--- src/lib/libnvmm/libnvmm.3:1.3	Wed Dec 12 09:09:08 2018
+++ src/lib/libnvmm/libnvmm.3	Wed Dec 12 11:40:08 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnvmm.3,v 1.3 2018/12/12 09:09:08 maxv Exp $
+.\"	$NetBSD: libnvmm.3,v 1.4 2018/12/12 11:40:08 wiz Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -513,7 +513,7 @@ uses the following error codes:
 The VCPU cannot receive the event immediately.
 .El
 .Sh SEE ALSO
-.Xr nvmm 4 .
+.Xr nvmm 4
 .Sh AUTHORS
 NVMM was designed and implemented by
 .An Maxime Villard .



CVS commit: [netbsd-7-0] src/doc

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:38:09 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Ticket #1664


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.120 -r1.1.2.121 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.120 src/doc/CHANGES-7.0.3:1.1.2.121
--- src/doc/CHANGES-7.0.3:1.1.2.120	Tue Dec  4 19:18:44 2018
+++ src/doc/CHANGES-7.0.3	Wed Dec 12 11:38:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.120 2018/12/04 19:18:44 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.121 2018/12/12 11:38:09 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5619,3 +5619,8 @@ sys/arch/amd64/amd64/machdep.c			1.321
 	Fix stack info leak.
 	[maxv, ticket #1662]
 
+sys/kern/sys_sig.c1.47
+
+	Fix kernel info leak, 4 bytes of padding in struct _ksiginfo.
+	[maxv, ticket #1664]
+



CVS commit: [netbsd-7-0] src/sys/kern

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:37:42 UTC 2018

Modified Files:
src/sys/kern [netbsd-7-0]: sys_sig.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1664):

sys/kern/sys_sig.c: revision 1.47

Fix kernel info leak, 4 bytes of padding in struct _ksiginfo. Maybe we
should just set _pad to zero on LP64?

+ Possible info leak: [len=40, leaked=4]
| #0 0x80baf397 in kleak_copyout
| #1 0x80bda817 in sigtimedwait1
| #2 0x80bdab95 in sys_sigtimedwait50
| #3 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.6.1 src/sys/kern/sys_sig.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/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.42 src/sys/kern/sys_sig.c:1.42.6.1
--- src/sys/kern/sys_sig.c:1.42	Fri Feb 14 16:35:11 2014
+++ src/sys/kern/sys_sig.c	Wed Dec 12 11:37:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $	*/
+/*	$NetBSD: sys_sig.c,v 1.42.6.1 2018/12/12 11:37:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42.6.1 2018/12/12 11:37:42 martin Exp $");
 
 #include 
 #include 
@@ -759,6 +759,8 @@ sigtimedwait1(struct lwp *l, const struc
 	 */
 	sigminusset(, >l_sigwaitset);
 
+	memset(_info, 0, sizeof(ksi.ksi_info));
+
 	mutex_enter(p->p_lock);
 
 	/* Check for pending signals in the process, if no - then in LWP. */



CVS commit: [netbsd-7-1] src/sys/kern

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:36:47 UTC 2018

Modified Files:
src/sys/kern [netbsd-7-1]: sys_sig.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1664):

sys/kern/sys_sig.c: revision 1.47

Fix kernel info leak, 4 bytes of padding in struct _ksiginfo. Maybe we
should just set _pad to zero on LP64?

+ Possible info leak: [len=40, leaked=4]
| #0 0x80baf397 in kleak_copyout
| #1 0x80bda817 in sigtimedwait1
| #2 0x80bdab95 in sys_sigtimedwait50
| #3 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.10.1 src/sys/kern/sys_sig.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/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.42 src/sys/kern/sys_sig.c:1.42.10.1
--- src/sys/kern/sys_sig.c:1.42	Fri Feb 14 16:35:11 2014
+++ src/sys/kern/sys_sig.c	Wed Dec 12 11:36:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $	*/
+/*	$NetBSD: sys_sig.c,v 1.42.10.1 2018/12/12 11:36:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42.10.1 2018/12/12 11:36:46 martin Exp $");
 
 #include 
 #include 
@@ -759,6 +759,8 @@ sigtimedwait1(struct lwp *l, const struc
 	 */
 	sigminusset(, >l_sigwaitset);
 
+	memset(_info, 0, sizeof(ksi.ksi_info));
+
 	mutex_enter(p->p_lock);
 
 	/* Check for pending signals in the process, if no - then in LWP. */



CVS commit: [netbsd-7-1] src/doc

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:37:15 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Ticket #1664


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-7.1.3

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.27 src/doc/CHANGES-7.1.3:1.1.2.28
--- src/doc/CHANGES-7.1.3:1.1.2.27	Tue Dec  4 19:17:46 2018
+++ src/doc/CHANGES-7.1.3	Wed Dec 12 11:37:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.27 2018/12/04 19:17:46 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.28 2018/12/12 11:37:15 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -311,3 +311,8 @@ sys/arch/amd64/amd64/machdep.c			1.321
 	Fix stack info leak.
 	[maxv, ticket #1662]
 
+sys/kern/sys_sig.c1.47
+
+	Fix kernel info leak, 4 bytes of padding in struct _ksiginfo.
+	[maxv, ticket #1664]
+



CVS commit: [netbsd-7] src/sys/kern

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:35:41 UTC 2018

Modified Files:
src/sys/kern [netbsd-7]: sys_sig.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1664):

sys/kern/sys_sig.c: revision 1.47

Fix kernel info leak, 4 bytes of padding in struct _ksiginfo. Maybe we
should just set _pad to zero on LP64?

+ Possible info leak: [len=40, leaked=4]
| #0 0x80baf397 in kleak_copyout
| #1 0x80bda817 in sigtimedwait1
| #2 0x80bdab95 in sys_sigtimedwait50
| #3 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.4.1 src/sys/kern/sys_sig.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/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.42 src/sys/kern/sys_sig.c:1.42.4.1
--- src/sys/kern/sys_sig.c:1.42	Fri Feb 14 16:35:11 2014
+++ src/sys/kern/sys_sig.c	Wed Dec 12 11:35:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $	*/
+/*	$NetBSD: sys_sig.c,v 1.42.4.1 2018/12/12 11:35:41 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42.4.1 2018/12/12 11:35:41 martin Exp $");
 
 #include 
 #include 
@@ -759,6 +759,8 @@ sigtimedwait1(struct lwp *l, const struc
 	 */
 	sigminusset(, >l_sigwaitset);
 
+	memset(_info, 0, sizeof(ksi.ksi_info));
+
 	mutex_enter(p->p_lock);
 
 	/* Check for pending signals in the process, if no - then in LWP. */



CVS commit: [netbsd-7] src/doc

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:35:59 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.3

Log Message:
Ticket #1664


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-7.3

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

Modified files:

Index: src/doc/CHANGES-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.23 src/doc/CHANGES-7.3:1.1.2.24
--- src/doc/CHANGES-7.3:1.1.2.23	Mon Dec 10 17:21:21 2018
+++ src/doc/CHANGES-7.3	Wed Dec 12 11:35:59 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.23 2018/12/10 17:21:21 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.24 2018/12/12 11:35:59 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -324,3 +324,8 @@ bin/sh/parser.c	1.152 (patch)
 	Avoid crash from redirect on null compound command.
 	[kre, ticket #1663]
 
+sys/kern/sys_sig.c1.47
+
+	Fix kernel info leak, 4 bytes of padding in struct _ksiginfo.
+	[maxv, ticket #1664]
+



CVS commit: [netbsd-8] src/sys/kern

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:33:29 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: sys_sig.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1134):

sys/kern/sys_sig.c: revision 1.47

Fix kernel info leak, 4 bytes of padding in struct _ksiginfo. Maybe we
should just set _pad to zero on LP64?

+ Possible info leak: [len=40, leaked=4]
| #0 0x80baf397 in kleak_copyout
| #1 0x80bda817 in sigtimedwait1
| #2 0x80bdab95 in sys_sigtimedwait50
| #3 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.8.1 src/sys/kern/sys_sig.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/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.46 src/sys/kern/sys_sig.c:1.46.8.1
--- src/sys/kern/sys_sig.c:1.46	Thu Aug  4 06:43:43 2016
+++ src/sys/kern/sys_sig.c	Wed Dec 12 11:33:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_sig.c,v 1.46 2016/08/04 06:43:43 christos Exp $	*/
+/*	$NetBSD: sys_sig.c,v 1.46.8.1 2018/12/12 11:33:29 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.46 2016/08/04 06:43:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.46.8.1 2018/12/12 11:33:29 martin Exp $");
 
 #include "opt_dtrace.h"
 
@@ -766,6 +766,8 @@ sigtimedwait1(struct lwp *l, const struc
 	 */
 	sigminusset(, >l_sigwaitset);
 
+	memset(_info, 0, sizeof(ksi.ksi_info));
+
 	mutex_enter(p->p_lock);
 
 	/* Check for pending signals in the process, if no - then in LWP. */



CVS commit: [netbsd-8] src/doc

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 11:34:11 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Ticket #1134


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.74 -r1.1.2.75 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.74 src/doc/CHANGES-8.1:1.1.2.75
--- src/doc/CHANGES-8.1:1.1.2.74	Mon Dec 10 17:17:08 2018
+++ src/doc/CHANGES-8.1	Wed Dec 12 11:34:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.74 2018/12/10 17:17:08 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.75 2018/12/12 11:34:11 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2042,3 +2042,8 @@ sys/dev/vnd.c	1.270
 	fstrans_start_lazy() / fstrans_done() bracket.
 	[hannken, ticket #1133]
 
+sys/kern/sys_sig.c1.47
+
+	Fix kernel info leak, 4 bytes of padding in struct _ksiginfo.
+	[maxv, ticket #1134]
+



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

2018-12-12 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Dec 12 11:14:51 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S idle_machdep.S

Log Message:
- need to save/restore interrupt mask when entering/exiting to/from 
cpu_switchto_softint().
- when call dosoftints from cpu_idle, interrupts should be disabled.

rarely, lwp stack had been exhausted when high interrupts.
reported by alnsn@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/cpuswitch.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/idle_machdep.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.8 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.9
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.8	Tue Dec 11 18:11:33 2018
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Wed Dec 12 11:14:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.8 2018/12/11 18:11:33 ryo Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.9 2018/12/12 11:14:51 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_ddb.h"
 #include "opt_kasan.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.8 2018/12/11 18:11:33 ryo Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.9 2018/12/12 11:14:51 ryo Exp $")
 
 /*
  * At IPL_SCHED:
@@ -123,6 +123,7 @@ ENTRY_NP(cpu_switchto_softint)
 	sub	sp, sp, #TF_SIZE	/* make switchframe */
 	adr	x2, softint_cleanup	/* return address for cpu_switchto() */
 	mov	x20, lr			/* x20 := original lr */
+	mrs	x19, daif		/* x19 := original interrupt mask */
 	stp	x19, x20, [sp, #TF_X19]
 	stp	x21, x22, [sp, #TF_X21]
 	stp	x23, x24, [sp, #TF_X23]
@@ -172,8 +173,11 @@ ENTRY_NP(cpu_switchto_softint)
 #endif
 	mov	sp, x4			/* restore pinned_lwp sp */
 	msr	cpacr_el1, x5		/* restore pinned_lwp cpacr */
-	ENABLE_INTERRUPT
+
+	ldp	x19, x20, [sp, #TF_X19]
+	msr	daif, x19		/* restore interrupt mask */
 	mov	lr, x20			/* restore pinned_lwp lr */
+
 	add	sp, sp, #TF_SIZE	/* unwind switchframe */
 	ldp	x19, x20, [sp], #16	/* restore */
 	ret
@@ -199,7 +203,8 @@ ENTRY_NP(softint_cleanup)
 	str	w2, [x3, #CI_MTX_COUNT]
 	str	wzr, [x0, #L_CTXSWTCH]	/* softlwp->l_ctxswtch = 0 */
 
-	ldp	x19, x20, [sp], #16
+	msr	daif, x19		/* restore interrupt mask */
+	ldp	x19, x20, [sp], #16	/* restore */
 	ret
 END(softint_cleanup)
 

Index: src/sys/arch/aarch64/aarch64/idle_machdep.S
diff -u src/sys/arch/aarch64/aarch64/idle_machdep.S:1.2 src/sys/arch/aarch64/aarch64/idle_machdep.S:1.3
--- src/sys/arch/aarch64/aarch64/idle_machdep.S:1.2	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/aarch64/aarch64/idle_machdep.S	Wed Dec 12 11:14:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: idle_machdep.S,v 1.2 2018/04/01 04:35:03 ryo Exp $ */
+/* $NetBSD: idle_machdep.S,v 1.3 2018/12/12 11:14:51 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_arm_intr_impl.h"
 #include "opt_ddb.h"
 
-RCSID("$NetBSD: idle_machdep.S,v 1.2 2018/04/01 04:35:03 ryo Exp $");
+RCSID("$NetBSD: idle_machdep.S,v 1.3 2018/12/12 11:14:51 ryo Exp $");
 
 #ifdef ARM_INTR_IMPL
 #include ARM_INTR_IMPL
@@ -89,20 +89,21 @@ ENTRY(cpu_idle)
 	mrs	x1, tpidr_el1			/* get curcpu() */
 	str	w28, [x1, #CI_INTR_DEPTH]	/* ci->ci_intr_depth = old */
 
-	ldr	x28, [sp, #TF_X28]		/* restore x28 */
-	ldp	x29, x30, [sp, #TF_X29]		/* restore x29,x30 */
-	add	sp, sp, #TF_SIZE		/* pop trapframe */
-
-	ENABLE_INTERRUPT
-
 #if defined(__HAVE_FAST_SOFTINTS) && !defined(__HAVE_PIC_FAST_SOFTINTS)
 	ldr	w3, [x1, #CI_SOFTINTS]		/* Get pending softint mask */
 	/* CPL should be 0 */
 	ldr	w2, [x1, #CI_CPL]		/* Get current priority level */
 	lsr	w3, w3, w2			/* shift mask by cpl */
-	cbnz	w3, _C_LABEL(dosoftints)	/* tailcall dosoftints() */
+	cbz	w3, 1f
+	bl	_C_LABEL(dosoftints)		/* dosoftints() */
+1:
 #endif /* __HAVE_FAST_SOFTINTS && !__HAVE_PIC_FAST_SOFTINTS */
 
+	ldr	x28, [sp, #TF_X28]		/* restore x28 */
+	ldp	x29, x30, [sp, #TF_X29]		/* restore x29,x30 */
+	add	sp, sp, #TF_SIZE		/* pop trapframe */
+
+	ENABLE_INTERRUPT
 #endif /* LAZY_CPUIDLE */
 
 	ret



CVS commit: src/lib/libnvmm

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 10:42:34 UTC 2018

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

Log Message:
Change the map/unmap functions, again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libnvmm/libnvmm.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.3 src/lib/libnvmm/libnvmm.c:1.4
--- src/lib/libnvmm/libnvmm.c:1.3	Thu Nov 29 19:55:20 2018
+++ src/lib/libnvmm/libnvmm.c	Wed Dec 12 10:42:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm.c,v 1.3 2018/11/29 19:55:20 maxv Exp $	*/
+/*	$NetBSD: libnvmm.c,v 1.4 2018/12/12 10:42:34 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -57,89 +57,40 @@ static size_t nvmm_page_size = 0;
 
 /* -- */
 
-static int
-__area_unmap(struct nvmm_machine *mach, uintptr_t hva, gpaddr_t gpa,
- size_t size)
-{
-	struct nvmm_ioc_gpa_unmap args;
-	int ret;
-
-	args.machid = mach->machid;
-	args.gpa = gpa;
-	args.size = size;
-
-	ret = ioctl(nvmm_fd, NVMM_IOC_GPA_UNMAP, );
-	if (ret == -1)
-		return -1;
-
-	ret = munmap((void *)hva, size);
-
-	return ret;
-}
-
-static int
-__area_dig_hole(struct nvmm_machine *mach, uintptr_t hva, gpaddr_t gpa,
+static bool
+__area_isvalid(struct nvmm_machine *mach, uintptr_t hva, gpaddr_t gpa,
 size_t size)
 {
 	area_list_t *areas = mach->areas;
-	area_t *ent, *tmp, *nxt;
-	size_t diff;
+	area_t *ent;
 
-	LIST_FOREACH_SAFE(ent, areas, list, nxt) {
-		/* Case 1. */
-		if ((gpa < ent->gpa) && (gpa + size > ent->gpa)) {
-			diff = (gpa + size) - ent->gpa;
-			if (__area_unmap(mach, ent->hva, ent->gpa, diff) == -1) {
-return -1;
-			}
-			ent->gpa  += diff;
-			ent->hva  += diff;
-			ent->size -= diff;
+	LIST_FOREACH(ent, areas, list) {
+		/* Collision on HVA */
+		if (hva >= ent->hva && hva < ent->hva + ent->size) {
+			return false;
 		}
-
-		/* Case 2. */
-		if ((gpa >= ent->gpa) && (gpa + size <= ent->gpa + ent->size)) {
-			/* First half. */
-			tmp = malloc(sizeof(*tmp));
-			tmp->gpa = ent->gpa;
-			tmp->hva = ent->hva;
-			tmp->size = (gpa - ent->gpa);
-			LIST_INSERT_BEFORE(ent, tmp, list);
-			/* Second half. */
-			ent->gpa  += tmp->size;
-			ent->hva  += tmp->size;
-			ent->size -= tmp->size;
-			diff = size;
-			if (__area_unmap(mach, ent->hva, ent->gpa, diff) == -1) {
-return -1;
-			}
-			ent->gpa  += diff;
-			ent->hva  += diff;
-			ent->size -= diff;
+		if (hva + size >= ent->hva &&
+		hva + size < ent->hva + ent->size) {
+			return false;
 		}
-
-		/* Case 3. */
-		if ((gpa < ent->gpa + ent->size) &&
-		(gpa + size > ent->gpa + ent->size)) {
-			diff = (ent->gpa + ent->size) - gpa;
-			if (__area_unmap(mach, hva, gpa, diff) == -1) {
-return -1;
-			}
-			ent->size -= diff;
+		if (hva <= ent->hva && hva + size >= ent->hva + ent->size) {
+			return false;
 		}
 
-		/* Case 4. */
-		if ((gpa < ent->gpa + ent->size) &&
-		(gpa + size > ent->gpa + ent->size)) {
-			if (__area_unmap(mach, ent->hva, ent->gpa, ent->size) == -1) {
-return -1;
-			}
-			LIST_REMOVE(ent, list);
-			free(ent);
+		/* Collision on GPA */
+		if (gpa >= ent->gpa && gpa < ent->gpa + ent->size) {
+			return false;
+		}
+		if (gpa + size >= ent->gpa &&
+		gpa + size < ent->gpa + ent->size) {
+			return false;
+		}
+		if (gpa <= ent->gpa && gpa + size >= ent->gpa + ent->size) {
+			return false;
 		}
 	}
 
-	return 0;
+	return true;
 }
 
 static int
@@ -147,7 +98,11 @@ __area_add(struct nvmm_machine *mach, ui
 {
 	area_list_t *areas = mach->areas;
 	area_t *area;
-	int ret;
+
+	if (!__area_isvalid(mach, hva, gpa, size)) {
+		errno = EINVAL;
+		return -1;
+	}
 
 	area = malloc(sizeof(*area));
 	if (area == NULL)
@@ -156,16 +111,29 @@ __area_add(struct nvmm_machine *mach, ui
 	area->hva = hva;
 	area->size = size;
 
-	ret = __area_dig_hole(mach, hva, gpa, size);
-	if (ret == -1) {
-		free(area);
-		return -1;
-	}
-
 	LIST_INSERT_HEAD(areas, area, list);
+
 	return 0;
 }
 
+static int
+__area_delete(struct nvmm_machine *mach, uintptr_t hva, gpaddr_t gpa,
+size_t size)
+{
+	area_list_t *areas = mach->areas;
+	area_t *ent, *nxt;
+
+	LIST_FOREACH_SAFE(ent, areas, list, nxt) {
+		if (hva == ent->hva && gpa == ent->gpa && size == ent->size) {
+			LIST_REMOVE(ent, list);
+			free(ent);
+			return 0;
+		}
+	}
+
+	return -1;
+}
+
 static void
 __area_remove_all(struct nvmm_machine *mach)
 {
@@ -450,11 +418,28 @@ int
 nvmm_gpa_unmap(struct nvmm_machine *mach, uintptr_t hva, gpaddr_t gpa,
 size_t size)
 {
+	struct nvmm_ioc_gpa_unmap args;
+	int ret;
+
 	if (nvmm_init() == -1) {
 		return -1;
 	}
 
-	return __area_dig_hole(mach, hva, gpa, size);
+	ret = __area_delete(mach, hva, gpa, size);
+	if (ret == -1)
+		return -1;
+
+	args.machid = mach->machid;
+	args.gpa = gpa;
+	args.size = size;
+
+	ret = ioctl(nvmm_fd, 

CVS commit: src/rescue

2018-12-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 12 10:25:29 UTC 2018

Modified Files:
src/rescue: list

Log Message:
Retire lmcconfig here too.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/rescue/list

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

Modified files:

Index: src/rescue/list
diff -u src/rescue/list:1.51 src/rescue/list:1.52
--- src/rescue/list:1.51	Sun Sep 23 07:24:19 2018
+++ src/rescue/list	Wed Dec 12 10:25:29 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.51 2018/09/23 07:24:19 maxv Exp $
+#	$NetBSD: list,v 1.52 2018/12/12 10:25:29 martin Exp $
 
 SRCDIRS	bin
 
@@ -64,7 +64,6 @@ PROG	fsirand
 PROG	gpt
 PROG	ifconfig
 PROG	init		init.bak
-PROG	lmcconfig
 PROG	mbrlabel
 PROG	mknod
 PROG	modload



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

2018-12-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 12 09:55:34 UTC 2018

Modified Files:
src/sys/arch/arm/nvidia: tegra210_car.c tegra210_xusbpad.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/nvidia/tegra210_car.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra210_xusbpad.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/nvidia/tegra210_car.c
diff -u src/sys/arch/arm/nvidia/tegra210_car.c:1.21 src/sys/arch/arm/nvidia/tegra210_car.c:1.22
--- src/sys/arch/arm/nvidia/tegra210_car.c:1.21	Wed Sep 26 22:33:35 2018
+++ src/sys/arch/arm/nvidia/tegra210_car.c	Wed Dec 12 09:55:34 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_car.c,v 1.21 2018/09/26 22:33:35 jmcneill Exp $ */
+/* $NetBSD: tegra210_car.c,v 1.22 2018/12/12 09:55:34 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.21 2018/09/26 22:33:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.22 2018/12/12 09:55:34 skrll Exp $");
 
 #include 
 #include 
@@ -554,17 +554,17 @@ static struct tegra_clk tegra210_car_clo
 	CLK_DIV("DIV_SDMMC4", "MUX_SDMMC4",
 		CAR_CLKSRC_SDMMC4_REG, CAR_CLKSRC_SDMMC_DIV),
 
-	CLK_DIV("DIV_I2C1", "MUX_I2C1", 
+	CLK_DIV("DIV_I2C1", "MUX_I2C1",
 		CAR_CLKSRC_I2C1_REG, CAR_CLKSRC_I2C_DIV),
-	CLK_DIV("DIV_I2C2", "MUX_I2C2", 
+	CLK_DIV("DIV_I2C2", "MUX_I2C2",
 		CAR_CLKSRC_I2C2_REG, CAR_CLKSRC_I2C_DIV),
-	CLK_DIV("DIV_I2C3", "MUX_I2C3", 
+	CLK_DIV("DIV_I2C3", "MUX_I2C3",
 		CAR_CLKSRC_I2C3_REG, CAR_CLKSRC_I2C_DIV),
-	CLK_DIV("DIV_I2C4", "MUX_I2C4", 
+	CLK_DIV("DIV_I2C4", "MUX_I2C4",
 		CAR_CLKSRC_I2C4_REG, CAR_CLKSRC_I2C_DIV),
-	CLK_DIV("DIV_I2C5", "MUX_I2C5", 
+	CLK_DIV("DIV_I2C5", "MUX_I2C5",
 		CAR_CLKSRC_I2C5_REG, CAR_CLKSRC_I2C_DIV),
-	CLK_DIV("DIV_I2C6", "MUX_I2C6", 
+	CLK_DIV("DIV_I2C6", "MUX_I2C6",
 		CAR_CLKSRC_I2C6_REG, CAR_CLKSRC_I2C_DIV),
 
 	CLK_DIV("XUSB_HOST_SRC", "MUX_XUSB_HOST",

Index: src/sys/arch/arm/nvidia/tegra210_xusbpad.c
diff -u src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.9 src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.10
--- src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.9	Mon Jul 16 23:11:47 2018
+++ src/sys/arch/arm/nvidia/tegra210_xusbpad.c	Wed Dec 12 09:55:34 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_xusbpad.c,v 1.9 2018/07/16 23:11:47 christos Exp $ */
+/* $NetBSD: tegra210_xusbpad.c,v 1.10 2018/12/12 09:55:34 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.9 2018/07/16 23:11:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.10 2018/12/12 09:55:34 skrll Exp $");
 
 #include 
 #include 
@@ -459,7 +459,7 @@ static const struct tegra210_xusbpad_por
 	XUSBPAD_PORT("usb3-1", 1, 0x14, __BITS(8,5), __BIT(9)),
 	XUSBPAD_PORT("usb3-2", 2, 0x14, __BITS(13,10), __BIT(14)),
 	XUSBPAD_PORT("usb3-3", 3, 0x14, __BITS(18,15), __BIT(19)),
-}; 
+};
 
 static const struct tegra210_xusbpad_port tegra210_xusbpad_hsic_ports[] = {
 	XUSBPAD_PORT("hsic-0", 0, 0, 0, 0),
@@ -847,7 +847,7 @@ static int
 tegra210_xusbpad_phy_enable(device_t dev, void *priv, bool enable)
 {
 	struct tegra210_xusbpad_phy_softc * const sc = device_private(dev);
-	
+
 	if (enable == false)
 		return ENXIO;	/* not implemented */
 



CVS commit: src/lib/libnvmm

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 09:09:08 UTC 2018

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

Log Message:
Change the "FILES" section, in the end I don't want to commit toyvirt
and smallkern, there is little interest installing them by default,
rather they can be downloaded from www. It's better this way.

While here add NVMM(4) in "SEE ALSO".


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/lib/libnvmm/libnvmm.3:1.3
--- src/lib/libnvmm/libnvmm.3:1.2	Sat Nov 10 10:57:06 2018
+++ src/lib/libnvmm/libnvmm.3	Wed Dec 12 09:09:08 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnvmm.3,v 1.2 2018/11/10 10:57:06 maxv Exp $
+.\"	$NetBSD: libnvmm.3,v 1.3 2018/12/12 09:09:08 maxv Exp $
 .\"
 .\" Copyright (c) 2018 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 November 10, 2018
+.Dd December 12, 2018
 .Dt LIBNVMM 3
 .Os
 .Sh NAME
@@ -473,14 +473,18 @@ variable
 .Va errno
 is set to indicate the error.
 .Sh FILES
-Functional examples:
-.Pp
 .Bl -tag -width  -compact
-.It Pa src/share/examples/nvmm/toyvirt/
-Example of virtualizer.
-Launches the binary given as argument in a virtual machine.
-.It Pa src/share/examples/nvmm/smallkern/
-Example of a kernel that can be executed by toyvirt.
+.It Lk https://www.netbsd.org/~maxv/nvmm/nvmm-demo.zip
+Functional example (demonstrator).
+Contains a virtualizer that uses the
+.Nm
+API, and a small kernel that exercises this virtualizer.
+.It Pa src/sys/dev/nvmm/
+Source code of the kernel NVMM driver.
+.It Pa src/lib/libnvmm/
+Source code of the
+.Nm
+library.
 .El
 .Sh ERRORS
 These functions will fail if:
@@ -508,6 +512,8 @@ uses the following error codes:
 .It Bq Er EAGAIN
 The VCPU cannot receive the event immediately.
 .El
+.Sh SEE ALSO
+.Xr nvmm 4 .
 .Sh AUTHORS
 NVMM was designed and implemented by
 .An Maxime Villard .



CVS commit: src/sys/dev

2018-12-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 12 08:49:33 UTC 2018

Modified Files:
src/sys/dev/mii: inbmphyreg.h
src/sys/dev/pci: if_wm.c

Log Message:
Add some code for suspend/resume:
- Rename wm_smbustopci() to wm_init_phy_workarounds_pchlan(). It will also
  called when resume.
- Call wm_phy_resetisblocked() after PHY reset in
  wm_init_phy_workarounds_pchlan() to wait for the PHY to quiesce to an
  accessible state.
- Add new wm_resume_workarounds_pchlan() function and use it in wm_resume().
  This workaround is only for PCH2 and newer.
- Don't call wm_disable_aspm() neither in wm_attach() nor in wm_resume()
  but in wm_reset().
- Do some initialization in wm_resume() when IFF_UP is NOT set.
- Don't continue when it failed to acquire semaphore in wm_ulp_disable().
- Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.602 -r1.603 src/sys/dev/pci/if_wm.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/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.12 src/sys/dev/mii/inbmphyreg.h:1.13
--- src/sys/dev/mii/inbmphyreg.h:1.12	Thu Nov 22 15:09:45 2018
+++ src/sys/dev/mii/inbmphyreg.h	Wed Dec 12 08:49:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.12 2018/11/22 15:09:45 msaitoh Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.13 2018/12/12 08:49:33 msaitoh Exp $	*/
 /***
 Copyright (c) 2001-2005, Intel Corporation 
 All rights reserved.
@@ -126,6 +126,20 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	IGP3_KMRN_DIAG		BME1000_REG(770, 19)
 #define	IGP3_KMRN_DIAG_PCS_LOCK_LOSS	(1 << 1)
 
+#define	I217_LPI_GPIO_CTRL	BME1000_REG(772, 18)
+#define	I217_LPI_GPIO_CTRL_AUTO_EN_LPI	__BIT(11)
+
+#define	I82579_LPI_CTRL		BME1000_REG(772, 20)
+#define	I82579_LPI_CTRL_ENABLE	__BITS(14, 13)
+#define	I82579_LPI_CTRL_EN_100	__BIT(13)
+#define	I82579_LPI_CTRL_EN_1000	__BIT(14)
+
+#define	I217_MEMPWR		BME1000_REG(772, 26)
+#define	I217_MEMPWR_DISABLE_SMB_RELEASE		0x0010
+
+#define	I217_CFGREG		BME1000_REG(772, 29)
+#define I217_CGFREG_ENABLE_MTA_RESET	0x0002
+
 #define HV_MUX_DATA_CTRL	BME1000_REG(776, 16)
 #define HV_MUX_DATA_CTRL_FORCE_SPEED	(1 << 2)
 #define HV_MUX_DATA_CTRL_GEN_TO_MAC	(1 << 10)
@@ -151,4 +165,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	BM_WUC_HOST_WU_BIT	(1 << 4)
 #define	BM_WUC_ME_WU_BIT	(1 << 5)
 
+#define	I217_PROXY_CTRL		BME1000_REG(BM_WUC_PAGE, 70)
+#define I217_PROXY_CTRL_AUTO_DISABLE	0x0080
 #endif /* _DEV_MII_INBMPHYREG_H_ */

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.602 src/sys/dev/pci/if_wm.c:1.603
--- src/sys/dev/pci/if_wm.c:1.602	Wed Nov 28 08:19:19 2018
+++ src/sys/dev/pci/if_wm.c	Wed Dec 12 08:49:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.602 2018/11/28 08:19:19 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.603 2018/12/12 08:49:33 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.602 2018/11/28 08:19:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.603 2018/12/12 08:49:33 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -723,7 +723,7 @@ static void	wm_init_lcd_from_nvm(struct 
 static int	wm_oem_bits_config_ich8lan(struct wm_softc *, bool);
 static void	wm_initialize_hardware_bits(struct wm_softc *);
 static uint32_t	wm_rxpbs_adjust_82580(uint32_t);
-static void	wm_reset_phy(struct wm_softc *);
+static int	wm_reset_phy(struct wm_softc *);
 static void	wm_flush_desc_rings(struct wm_softc *);
 static void	wm_reset(struct wm_softc *);
 static int	wm_add_rxbuf(struct wm_rxqueue *, int);
@@ -949,7 +949,7 @@ static bool	wm_phy_resetisblocked(struct
 static void	wm_get_hw_control(struct wm_softc *);
 static void	wm_release_hw_control(struct wm_softc *);
 static void	wm_gate_hw_phy_config_ich8lan(struct wm_softc *, bool);
-static void	wm_smbustopci(struct wm_softc *);
+static int	wm_init_phy_workarounds_pchlan(struct wm_softc *);
 static void	wm_init_manageability(struct wm_softc *);
 static void	wm_release_manageability(struct wm_softc *);
 static void	wm_get_wakeup(struct wm_softc *);
@@ -957,6 +957,7 @@ static int	wm_ulp_disable(struct wm_soft
 static void	wm_enable_phy_wakeup(struct wm_softc *);
 static void	wm_igp3_phy_powerdown_workaround_ich8lan(struct wm_softc *);
 static void	wm_suspend_workarounds_ich8lan(struct wm_softc *);
+static int	wm_resume_workarounds_pchlan(struct wm_softc *);
 static void	wm_enable_wakeup(struct wm_softc *);
 static void	wm_disable_aspm(struct wm_softc *);
 /* LPLU (Low Power Link Up) */
@@ -2099,9 +2100,6 @@ alloc_retry:
 		(sc->sc_flags & WM_F_PCIX) ? "PCIX" : "PCI");
 	}
 
-	/* Disable ASPM L0s and/or L1 for workaround */
-	wm_disable_aspm(sc);
-
 	/* clear interesting stat counters */
 	CSR_READ(sc, 

CVS commit: src/share/man/man4

2018-12-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec 12 08:28:44 UTC 2018

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

Log Message:
Sort sections. Remove superfluous El. Insert Xr.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/nvmm.4

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

Modified files:

Index: src/share/man/man4/nvmm.4
diff -u src/share/man/man4/nvmm.4:1.1 src/share/man/man4/nvmm.4:1.2
--- src/share/man/man4/nvmm.4:1.1	Wed Dec 12 08:20:53 2018
+++ src/share/man/man4/nvmm.4	Wed Dec 12 08:28:44 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: nvmm.4,v 1.1 2018/12/12 08:20:53 maxv Exp $
+.\"	$NetBSD: nvmm.4,v 1.2 2018/12/12 08:28:44 wiz Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -51,12 +51,6 @@ The following backends are supported:
 .It
 x86-SVM, for x86 AMD CPUs
 .El
-.Sh CAVEATS
-Currently,
-.Nm
-cannot be enabled in a kernel configuration, and must rather be modloaded
-dynamically from the filesystem.
-.El
 .Sh SEE ALSO
 .Xr libnvmm 3
 .Sh AUTHORS
@@ -64,3 +58,9 @@ The
 .Nm
 driver was written by
 .An Maxime Villard .
+.Sh CAVEATS
+Currently,
+.Nm
+cannot be enabled in a kernel configuration, and must rather be
+.Xr modload 8 Ns ed
+dynamically from the filesystem.



CVS commit: src/share/man/man4

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 08:28:19 UTC 2018

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

Log Message:
Say that on x86 you also have to modload tprof_x86.


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

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

Modified files:

Index: src/share/man/man4/tprof.4
diff -u src/share/man/man4/tprof.4:1.3 src/share/man/man4/tprof.4:1.4
--- src/share/man/man4/tprof.4:1.3	Sat Jul 21 06:25:29 2018
+++ src/share/man/man4/tprof.4	Wed Dec 12 08:28:19 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tprof.4,v 1.3 2018/07/21 06:25:29 maxv Exp $
+.\"	$NetBSD: tprof.4,v 1.4 2018/12/12 08:28:19 maxv Exp $
 .\"
 .\" Copyright (c)2011 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" 
-.Dd July 21, 2018
+.Dd December 12, 2018
 .Dt TPROF 4
 .Os
 .\" 
@@ -47,6 +47,10 @@ provide them to the userland consumer.
 .Pp
 The API/ABI is currently undocumented and will likely change in future
 without keeping compatibility.
+.Pp
+On x86, the tprof_x86 module must be loaded in addition to the
+.Nm
+driver.
 .\" 
 .\".Sh EXAMPLES
 .\" 



CVS commit: src/share/man/man8

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 08:24:50 UTC 2018

Modified Files:
src/share/man/man8: MAKEDEV.8

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/share/man/man8/MAKEDEV.8

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/man8/MAKEDEV.8
diff -u src/share/man/man8/MAKEDEV.8:1.51 src/share/man/man8/MAKEDEV.8:1.52
--- src/share/man/man8/MAKEDEV.8:1.51	Wed Nov  7 07:49:10 2018
+++ src/share/man/man8/MAKEDEV.8	Wed Dec 12 08:24:50 2018
@@ -6,7 +6,7 @@
 .\" *** DO NOT EDIT - any changes will be lost!!!
 .\" *** --
 .\"
-.\" $NetBSD: MAKEDEV.8,v 1.51 2018/11/07 07:49:10 maxv Exp $
+.\" $NetBSD: MAKEDEV.8,v 1.52 2018/12/12 08:24:50 maxv Exp $
 .\"
 .\" Copyright (c) 2001, 2003, 2007, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November  2, 2018
+.Dd December 12, 2018
 .Dt MAKEDEV 8
 .Os
 .Sh NAME
@@ -786,7 +786,8 @@ Non-Volatile Memory Host Controller Inte
 . It Ar nvme#ns*
 Non-Volatile Memory namespace
 . It Ar nvmm
-NetBSD Virtual Machine Monitor
+NetBSD Virtual Machine Monitor, see
+.Xr \ 4
 . It Ar openfirm
 OpenFirmware accessor
 . It Ar pad#



CVS commit: src

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 08:20:53 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: nvmm.4

Log Message:
Add a NVMM(4) man page.


To generate a diff of this commit:
cvs rdiff -u -r1.1631 -r1.1632 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.675 -r1.676 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/nvmm.4

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1631 src/distrib/sets/lists/man/mi:1.1632
--- src/distrib/sets/lists/man/mi:1.1631	Wed Dec 12 07:04:05 2018
+++ src/distrib/sets/lists/man/mi	Wed Dec 12 08:20:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1631 2018/12/12 07:04:05 maxv Exp $
+# $NetBSD: mi,v 1.1632 2018/12/12 08:20:53 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1505,6 +1505,7 @@
 ./usr/share/man/cat4/ntwoc.0			man-sys-catman		.cat
 ./usr/share/man/cat4/null.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nvme.0			man-sys-catman		.cat
+./usr/share/man/cat4/nvmm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nxt2k.0			man-sys-catman		.cat
 ./usr/share/man/cat4/oak.0			man-sys-catman		.cat
 ./usr/share/man/cat4/oboe.0			man-sys-catman		.cat
@@ -4617,6 +4618,7 @@
 ./usr/share/man/html4/ntwoc.html		man-sys-htmlman		html
 ./usr/share/man/html4/null.html			man-sys-htmlman		html
 ./usr/share/man/html4/nvme.html			man-sys-htmlman		html
+./usr/share/man/html4/nvmm.html			man-sys-htmlman		html
 ./usr/share/man/html4/nxt2k.html		man-sys-htmlman		html
 ./usr/share/man/html4/oak.html			man-sys-htmlman		html
 ./usr/share/man/html4/oboe.html			man-sys-htmlman		html
@@ -7587,6 +7589,7 @@
 ./usr/share/man/man4/ntwoc.4			man-sys-man		.man
 ./usr/share/man/man4/null.4			man-sys-man		.man
 ./usr/share/man/man4/nvme.4			man-sys-man		.man
+./usr/share/man/man4/nvmm.4			man-sys-man		.man
 ./usr/share/man/man4/nxt2k.4			man-sys-man		.man
 ./usr/share/man/man4/oak.4			man-sys-man		.man
 ./usr/share/man/man4/oboe.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.675 src/share/man/man4/Makefile:1.676
--- src/share/man/man4/Makefile:1.675	Wed Dec 12 07:04:05 2018
+++ src/share/man/man4/Makefile	Wed Dec 12 08:20:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.675 2018/12/12 07:04:05 maxv Exp $
+#	$NetBSD: Makefile,v 1.676 2018/12/12 08:20:53 maxv Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -44,7 +44,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	mpu.4 mtd.4 mtio.4 msm6242b.4 multicast.4 mvsata.4 \
 	nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 \
 	nsclpcsio.4 nside.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 nsmb.4 \
-	nvme.4 \
+	nvme.4 nvmm.4 \
 	oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 otus.4 \
 	pad.4 pas.4 pcdisplay.4 pcf8563rtc.4 pciide.4 pckbc.4 pckbd.4 pcn.4 \
 	pcppi.4 pcscp.4 pcweasel.4 pdcide.4 pdcsata.4 piixide.4 piixpcib.4 \

Added files:

Index: src/share/man/man4/nvmm.4
diff -u /dev/null src/share/man/man4/nvmm.4:1.1
--- /dev/null	Wed Dec 12 08:20:53 2018
+++ src/share/man/man4/nvmm.4	Wed Dec 12 08:20:53 2018
@@ -0,0 +1,66 @@
+.\"	$NetBSD: nvmm.4,v 1.1 2018/12/12 08:20:53 maxv Exp $
+.\"
+.\" Copyright (c) 2018 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Maxime Villard.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd December 12, 2018
+.Dt NVMM 4

CVS commit: src/share/man/man4

2018-12-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec 12 08:12:18 UTC 2018

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

Log Message:
Fix reference to en(4) and remove reference to viapm(4), which does
not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/share/man/man4/pci.4

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

Modified files:

Index: src/share/man/man4/pci.4
diff -u src/share/man/man4/pci.4:1.99 src/share/man/man4/pci.4:1.100
--- src/share/man/man4/pci.4:1.99	Wed Dec 12 07:04:05 2018
+++ src/share/man/man4/pci.4	Wed Dec 12 08:12:18 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.99 2018/12/12 07:04:05 maxv Exp $
+.\"	$NetBSD: pci.4,v 1.100 2018/12/12 08:12:18 wiz Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -78,7 +78,7 @@ for additional information.
 Fixup PCI I/O and memory addresses.
 .Pp
 Some i386 and amd64 BIOS implementations don't allocate I/O space and
-memory space for some PCI devices -- primarily BIOS in PnP mode, or laptops
+memory space for some PCI devices \(em primarily BIOS in PnP mode, or laptops
 that expect devices to be configured via ACPI.
 Since necessary space isn't allocated, those devices
 will not work without special handling.
@@ -451,7 +451,6 @@ VGA graphics boards.
 .Xr eap 4 ,
 .Xr ehci 4 ,
 .Xr emuxki 4 ,
-.Xr en 4 ,
 .Xr ep 4 ,
 .Xr epic 4 ,
 .Xr esa 4 ,
@@ -506,9 +505,10 @@ VGA graphics boards.
 .Xr trm 4 ,
 .Xr twe 4 ,
 .Xr uhci 4 ,
+.Xr vax/en 4 ,
 .Xr vga 4 ,
 .Xr vge 4 ,
-.Xr viapm 4 ,
+.\" .Xr viapm 4 ,
 .Xr vr 4 ,
 .Xr wi 4 ,
 .Xr wm 4 ,



CVS commit: src/tests/bin/sh

2018-12-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Dec 12 08:10:39 UTC 2018

Modified Files:
src/tests/bin/sh: t_builtins.sh

Log Message:
Add more subtests to the export and readonly built-in commands test cases.

In particular, add a readonly test to detect the bug that was just fixed...
(but there is more than that one added here).

Also, allow zsh to run more of these tests than it did, what is a builtin
command most places (including in POSIX) can be a reserved word in zsh!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/bin/sh/t_builtins.sh

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

Modified files:

Index: src/tests/bin/sh/t_builtins.sh
diff -u src/tests/bin/sh/t_builtins.sh:1.2 src/tests/bin/sh/t_builtins.sh:1.3
--- src/tests/bin/sh/t_builtins.sh:1.2	Wed Dec  5 02:48:04 2018
+++ src/tests/bin/sh/t_builtins.sh	Wed Dec 12 08:10:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: t_builtins.sh,v 1.2 2018/12/05 02:48:04 kre Exp $
+# $NetBSD: t_builtins.sh,v 1.3 2018/12/12 08:10:39 kre Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -62,6 +62,7 @@ have_builtin()
 	LC_ALL=C ${TEST_SH} -c \
 	'case "$( (type '"$1"') 2>&1)" in
 		(*built*)	exit 0 ;;
+		(*reserved*)	exit 0 ;;   # zsh!! (reserved words are builtin)
 	 esac
 	 exit 1'	||
 	{
@@ -346,6 +347,32 @@ export_body() {
 		'unset VAR || exit 7; export VAR;
 		 VAR=ABC; printenv VAR; VAR=XYZ; printenv VAR'
 
+	# don't check VAR=value, some shells provide meaningless quoting...
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:foobar \
+		${TEST_SH} -c \
+			'VAR=foobar ; export VAR ; export -p'
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:foobar \
+		${TEST_SH} -c \
+			'export VAR=foobar ; export -p'
+	atf_check -s exit:0 -e empty -o match:VAR\$ ${TEST_SH} -c \
+			'unset VAR ; export VAR ; export -p'
+	atf_check -s exit:0 -e empty -o not-match:VAR ${TEST_SH} -c \
+			'export VAR ; unset VAR ; export -p'
+	atf_check -s exit:0 -e empty -o not-match:VAR -o not-match:foobar \
+		${TEST_SH} -c \
+			'VAR=foobar; export VAR ; unset VAR ; export -p'
+
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:FOUND=foobar \
+		${TEST_SH} -c \
+			'export VAR=foobar; V=$(export -p);
+			 unset VAR; eval "$V"; export -p;
+			 printf %s\\n FOUND=${VAR-unset}'
+	atf_check -s exit:0 -e empty -o match:VAR -o match:FOUND=unset \
+		${TEST_SH} -c \
+			'export VAR; V=$(export -p);
+			 unset VAR; eval "$V"; export -p;
+			 printf %s\\n FOUND=${VAR-unset}'
+
 	atf_check -s exit:1 -e empty -o inline:ABC\\nXYZ\\n ${TEST_SH} -c \
 		'VAR=ABC; export VAR; printenv VAR; VAR=XYZ; printenv VAR;
 		unset VAR; printenv VAR; VAR=PQR; printenv VAR'
@@ -441,9 +468,42 @@ readonly_body() {
 		'unset VAR; readonly VAR; printf %s ${VAR-unset}'
 	atf_check -s exit:0 -e empty -o inline:set ${TEST_SH} -c \
 		'unset VAR; readonly VAR=set; printf %s ${VAR-unset}'
+	atf_check -s exit:0 -e empty -o inline:set ${TEST_SH} -c \
+		'VAR=initial; readonly VAR=set; printf %s ${VAR-unset}'
 	atf_check -s not-exit:0 -e not-empty -o empty ${TEST_SH} -c \
 		'readonly VAR=initial; VAR=new; printf %s "${VAR}"'
 
+	# don't check VAR=value, some shells provide meaningless quoting...
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:foobar \
+		${TEST_SH} -c \
+			'VAR=foobar ; readonly VAR ; readonly -p'
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:foobar \
+		${TEST_SH} -c \
+			'readonly VAR=foobar ; readonly -p'
+	atf_check -s exit:0 -e empty -o match:VAR= -o match:foobar \
+		-o not-match:badvalue ${TEST_SH} -c \
+			'VAR=badvalue; readonly VAR=foobar ; readonly -p'
+	atf_check -s exit:0 -e empty -o match:VAR\$ ${TEST_SH} -c \
+			'unset VAR ; readonly VAR ; readonly -p'
+
+	# checking that readonly -p works (to reset stuff) is a pain...
+	# particularly since not all shells say "readonly..." by default
+	atf_check -s exit:0 -e empty -o match:MYVAR= -o match:FOUND=foobar \
+		${TEST_SH} -c \
+			'V=$(readonly MYVAR=foobar; readonly -p | grep " MYVAR")
+			 unset MYVAR; eval "$V"; readonly -p;
+			 printf %s\\n FOUND=${MYVAR-unset}'
+	atf_check -s exit:0 -e empty -o match:MYVAR\$ -o match:FOUND=unset \
+		${TEST_SH} -c \
+			'V=$(readonly MYVAR; readonly -p | grep " MYVAR")
+			 unset MYVAR; eval "$V"; readonly -p;
+			 printf %s\\n "FOUND=${MYVAR-unset}"'
+	atf_check -s exit:0 -e empty -o match:MYVAR= -o match:FOUND=empty \
+		${TEST_SH} -c \
+			'V=$(readonly MYVAR=; readonly -p | grep " MYVAR")
+			 unset VAR; eval "$V"; readonly -p;
+			 printf %s\\n "FOUND=${MYVAR-unset&}${MYVAR:-empty}"'
+
 	# don't test stderr, some shells inist on generating a message for an
 	# unset of a readonly var (rather than simply having unset make $?=1)
 



CVS commit: src/doc

2018-12-12 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 12 08:02:17 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
note kleak


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2462 src/doc/CHANGES:1.2463
--- src/doc/CHANGES:1.2462	Wed Dec 12 07:07:30 2018
+++ src/doc/CHANGES	Wed Dec 12 08:02:17 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2462 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2463 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -254,6 +254,8 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		GENERIC64 kernel config. [jmcneill 20181124]
 	ena(4): Add support for Amazon.com Elastic Network Adapter (ENA).
 		[netbsd 20181130]
+	kernel: Add KLEAK, a feature that can detect kernel information
+		leaks. [maxv 20181202]
 	atactl(8): Add support to automatically detect Micron/Crucial devices
 		and their vendor-specific SMART status values.  [mrg 20181205]
 	OpenSSL: Imported 1.1.1a. [christos 20181208]