CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 20:09:55 UTC 2021

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

Log Message:
indent: let indent format the comments after previous refactoring

Before this refactoring, I had skipped this section of the code from
formatting since the 'default:' branch was enclosed in a block of its
own, and that block would have been indented one more level to the
right. Extracting that code into a separate function got rid of the
extra braces.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/indent/indent.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.91 src/usr.bin/indent/indent.c:1.92
--- src/usr.bin/indent/indent.c:1.91	Mon Sep 27 20:00:41 2021
+++ src/usr.bin/indent/indent.c	Mon Sep 27 20:09:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.91 2021/09/27 20:00:41 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.92 2021/09/27 20:09:55 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.91 2021/09/27 20:00:41 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.92 2021/09/27 20:09:55 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -171,13 +171,12 @@ search_brace_newline(bool *inout_force_n
 *sc_end++ = '\n';
 
 /*
- * We may have inherited a force_nl == true from the previous
- * token (like a semicolon). But once we know that a newline has
- * been scanned in this loop, force_nl should be false.
+ * We may have inherited a force_nl == true from the previous token (like
+ * a semicolon). But once we know that a newline has been scanned in this
+ * loop, force_nl should be false.
  *
- * However, the force_nl == true must be preserved if newline is
- * never scanned in this loop, so this assignment cannot be done
- * earlier.
+ * However, the force_nl == true must be preserved if newline is never
+ * scanned in this loop, so this assignment cannot be done earlier.
  */
 *inout_force_nl = false;
 }
@@ -188,8 +187,8 @@ search_brace_comment(bool *inout_comment
 if (sc_end == NULL) {
 	/*
 	 * Copy everything from the start of the line, because
-	 * process_comment() will use that to calculate original
-	 * indentation of a boxed comment.
+	 * process_comment() will use that to calculate original indentation
+	 * of a boxed comment.
 	 */
 	memcpy(sc_buf, in_buffer, (size_t)(buf_ptr - in_buffer) - 4);
 	save_com = sc_buf + (buf_ptr - in_buffer - 4);
@@ -197,14 +196,14 @@ search_brace_comment(bool *inout_comment
 	sc_end = _com[2];
 }
 *inout_comment_buffered = true;
-*sc_end++ = '/';	/* copy in start of comment */
+*sc_end++ = '/';		/* copy in start of comment */
 *sc_end++ = '*';
-for (;;) {		/* loop until the end of the comment */
+for (;;) {			/* loop until the end of the comment */
 	*sc_end = *buf_ptr++;
 	if (buf_ptr >= buf_end)
 	fill_buffer();
 	if (*sc_end++ == '*' && *buf_ptr == '/')
-	break;	/* we are at end of comment */
+	break;		/* we are at end of comment */
 	if (sc_end >= _com[sc_size]) {	/* check for temp buffer
 		 * overflow */
 	diag(1, "Internal buffer overflow - Move big comment from right after if, while, or whatever");
@@ -212,7 +211,7 @@ search_brace_comment(bool *inout_comment
 	exit(1);
 	}
 }
-*sc_end++ = '/';	/* add ending slash */
+*sc_end++ = '/';		/* add ending slash */
 if (++buf_ptr >= buf_end)	/* get past / in buffer */
 	fill_buffer();
 }
@@ -221,17 +220,16 @@ static bool
 search_brace_lbrace(void)
 {
 /*
- * Put KNF-style lbraces before the buffered up tokens and jump
- * out of this loop in order to avoid copying the token again
- * under the default case of the switch below.
+ * Put KNF-style lbraces before the buffered up tokens and jump out of
+ * this loop in order to avoid copying the token again under the default
+ * case of the switch below.
  */
 if (sc_end != NULL && opt.btype_2) {
 	save_com[0] = '{';
 	/*
-	 * Originally the lbrace may have been alone on its own line,
-	 * but it will be moved into "the else's line", so if there
-	 * was a newline resulting from the "{" before, it must be
-	 * scanned now and ignored.
+	 * Originally the lbrace may have been alone on its own line, but it
+	 * will be moved into "the else's line", so if there was a newline
+	 * resulting from the "{" before, it must be scanned now and ignored.
 	 */
 	while (isspace((unsigned char)*buf_ptr)) {
 	if (++buf_ptr >= buf_end)



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 20:09:55 UTC 2021

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

Log Message:
indent: let indent format the comments after previous refactoring

Before this refactoring, I had skipped this section of the code from
formatting since the 'default:' branch was enclosed in a block of its
own, and that block would have been indented one more level to the
right. Extracting that code into a separate function got rid of the
extra braces.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/indent/indent.c

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



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 20:00:41 UTC 2021

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

Log Message:
indent: split search_brace into smaller functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/indent/indent.c

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



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 20:00:41 UTC 2021

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

Log Message:
indent: split search_brace into smaller functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/indent/indent.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.90 src/usr.bin/indent/indent.c:1.91
--- src/usr.bin/indent/indent.c:1.90	Mon Sep 27 18:21:47 2021
+++ src/usr.bin/indent/indent.c	Mon Sep 27 20:00:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.90 2021/09/27 18:21:47 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.91 2021/09/27 20:00:41 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.90 2021/09/27 18:21:47 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.91 2021/09/27 20:00:41 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -161,184 +161,222 @@ init_capsicum(void)
 #endif
 
 static void
+search_brace_newline(bool *inout_force_nl)
+{
+if (sc_end == NULL) {
+	save_com = sc_buf;
+	save_com[0] = save_com[1] = ' ';
+	sc_end = _com[2];
+}
+*sc_end++ = '\n';
+
+/*
+ * We may have inherited a force_nl == true from the previous
+ * token (like a semicolon). But once we know that a newline has
+ * been scanned in this loop, force_nl should be false.
+ *
+ * However, the force_nl == true must be preserved if newline is
+ * never scanned in this loop, so this assignment cannot be done
+ * earlier.
+ */
+*inout_force_nl = false;
+}
+
+static void
+search_brace_comment(bool *inout_comment_buffered)
+{
+if (sc_end == NULL) {
+	/*
+	 * Copy everything from the start of the line, because
+	 * process_comment() will use that to calculate original
+	 * indentation of a boxed comment.
+	 */
+	memcpy(sc_buf, in_buffer, (size_t)(buf_ptr - in_buffer) - 4);
+	save_com = sc_buf + (buf_ptr - in_buffer - 4);
+	save_com[0] = save_com[1] = ' ';
+	sc_end = _com[2];
+}
+*inout_comment_buffered = true;
+*sc_end++ = '/';	/* copy in start of comment */
+*sc_end++ = '*';
+for (;;) {		/* loop until the end of the comment */
+	*sc_end = *buf_ptr++;
+	if (buf_ptr >= buf_end)
+	fill_buffer();
+	if (*sc_end++ == '*' && *buf_ptr == '/')
+	break;	/* we are at end of comment */
+	if (sc_end >= _com[sc_size]) {	/* check for temp buffer
+		 * overflow */
+	diag(1, "Internal buffer overflow - Move big comment from right after if, while, or whatever");
+	fflush(output);
+	exit(1);
+	}
+}
+*sc_end++ = '/';	/* add ending slash */
+if (++buf_ptr >= buf_end)	/* get past / in buffer */
+	fill_buffer();
+}
+
+static bool
+search_brace_lbrace(void)
+{
+/*
+ * Put KNF-style lbraces before the buffered up tokens and jump
+ * out of this loop in order to avoid copying the token again
+ * under the default case of the switch below.
+ */
+if (sc_end != NULL && opt.btype_2) {
+	save_com[0] = '{';
+	/*
+	 * Originally the lbrace may have been alone on its own line,
+	 * but it will be moved into "the else's line", so if there
+	 * was a newline resulting from the "{" before, it must be
+	 * scanned now and ignored.
+	 */
+	while (isspace((unsigned char)*buf_ptr)) {
+	if (++buf_ptr >= buf_end)
+		fill_buffer();
+	if (*buf_ptr == '\n')
+		break;
+	}
+	return true;
+}
+return false;
+}
+
+static bool
+search_brace_other(token_type ttype, bool *inout_force_nl,
+bool comment_buffered, bool last_else)
+{
+bool remove_newlines;
+
+remove_newlines =
+	/* "} else" */
+	(ttype == keyword_do_else && *token.s == 'e' &&
+	 code.e != code.s && code.e[-1] == '}')
+	/* "else if" */
+	|| (ttype == keyword_for_if_while &&
+		*token.s == 'i' && last_else && opt.else_if);
+if (remove_newlines)
+	*inout_force_nl = false;
+if (sc_end == NULL) {	/* ignore buffering if comment wasn't saved
+ * up */
+	ps.search_brace = false;
+	return false;
+}
+while (sc_end > save_com && isblank((unsigned char)sc_end[-1])) {
+	sc_end--;
+}
+if (opt.swallow_optional_blanklines ||
+	(!comment_buffered && remove_newlines)) {
+	*inout_force_nl = !remove_newlines;
+	while (sc_end > save_com && sc_end[-1] == '\n') {
+	sc_end--;
+	}
+}
+if (*inout_force_nl) {	/* if we should insert a nl here, put it into
+ * the buffer */
+	*inout_force_nl = false;
+	--line_no;		/* this will be re-increased when the newline
+ * is read from the buffer */
+	*sc_end++ = '\n';
+	*sc_end++ = ' ';
+	if (opt.verbose)	/* print error msg if the line was not already
+ * broken */
+	diag(0, "Line 

CVS commit: src/tests/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 19:02:44 UTC 2021

Modified Files:
src/tests/usr.bin/indent: label.0 label.0.stdout

Log Message:
tests/indent: document that label indentation is not configurable

For at least the past 27 years, labels have been indented 2 levels to
the left of the corresponding statement. See label_offset and
compute_label_indent (or compute_label_target in FreeBSD).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/label.0 \
src/tests/usr.bin/indent/label.0.stdout

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

Modified files:

Index: src/tests/usr.bin/indent/label.0
diff -u src/tests/usr.bin/indent/label.0:1.1 src/tests/usr.bin/indent/label.0:1.2
--- src/tests/usr.bin/indent/label.0:1.1	Thu Apr  4 15:27:35 2019
+++ src/tests/usr.bin/indent/label.0	Mon Sep 27 19:02:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.0,v 1.1 2019/04/04 15:27:35 kamil Exp $	*/
+/*	$NetBSD: label.0,v 1.2 2021/09/27 19:02:44 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/label.0 313544 2017-02-10 09:31:39Z pstef $ */
 /* See r303489 */
 void t(void) {
@@ -12,3 +12,33 @@ CLEANUP:
 V: ;
 U: ;
 }
+
+/*
+ * The indentation of statement labels is fixed to -2, it is not configurable.
+ */
+void
+label_indentation(void)
+{
+	if (level1) {
+	if (level2) {
+	if (level3) {
+	if (level4) {
+	if (level5) {
+	label5:
+	statement();
+	}
+	label4:
+	statement();
+	}
+	label3:
+	statement();
+	}
+	label2:
+	statement();
+	}
+	label1:
+	statement();
+	}
+	label0:
+	statement();
+}
Index: src/tests/usr.bin/indent/label.0.stdout
diff -u src/tests/usr.bin/indent/label.0.stdout:1.1 src/tests/usr.bin/indent/label.0.stdout:1.2
--- src/tests/usr.bin/indent/label.0.stdout:1.1	Thu Apr  4 15:27:35 2019
+++ src/tests/usr.bin/indent/label.0.stdout	Mon Sep 27 19:02:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $	*/
+/*	$NetBSD: label.0.stdout,v 1.2 2021/09/27 19:02:44 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/label.0.stdout 321381 2017-07-23 14:04:45Z pstef $ */
 /* See r303489 */
 void
@@ -13,3 +13,33 @@ CLEANUP:
 V:  ;
 U:  ;
 }
+
+/*
+ * The indentation of statement labels is fixed to -2, it is not configurable.
+ */
+void
+label_indentation(void)
+{
+if (level1) {
+if (level2) {
+if (level3) {
+if (level4) {
+if (level5) {
+label5:
+statement();
+}
+label4:
+statement();
+}
+label3:
+statement();
+}
+label2:
+statement();
+}
+label1:
+statement();
+}
+label0:
+statement();
+}



CVS commit: src/tests/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 19:02:44 UTC 2021

Modified Files:
src/tests/usr.bin/indent: label.0 label.0.stdout

Log Message:
tests/indent: document that label indentation is not configurable

For at least the past 27 years, labels have been indented 2 levels to
the left of the corresponding statement. See label_offset and
compute_label_indent (or compute_label_target in FreeBSD).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/label.0 \
src/tests/usr.bin/indent/label.0.stdout

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



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 18:21:47 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: use binary instead of linear search when adding types

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/indent/lexi.c

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



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 18:21:47 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: use binary instead of linear search when adding types

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.89 src/usr.bin/indent/indent.c:1.90
--- src/usr.bin/indent/indent.c:1.89	Mon Sep 27 16:56:35 2021
+++ src/usr.bin/indent/indent.c	Mon Sep 27 18:21:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.89 2021/09/27 16:56:35 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.90 2021/09/27 18:21:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.89 2021/09/27 16:56:35 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.90 2021/09/27 18:21:47 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -379,7 +379,6 @@ main_init_globals(void)
 buf_init();
 buf_init();
 buf_init();
-alloc_typenames();
 opt.else_if = true;		/* XXX: redundant? */
 
 in_buffer = xmalloc(10);

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.25 src/usr.bin/indent/indent.h:1.26
--- src/usr.bin/indent/indent.h:1.25	Sat Sep 25 22:14:21 2021
+++ src/usr.bin/indent/indent.h	Mon Sep 27 18:21:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.25 2021/09/25 22:14:21 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.26 2021/09/27 18:21:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #endif
 
 void		add_typename(const char *);
-void		alloc_typenames(void);
 int		compute_code_indent(void);
 int		compute_label_indent(void);
 int		indentation_after_range(int, const char *, const char *);

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.63 src/usr.bin/indent/lexi.c:1.64
--- src/usr.bin/indent/lexi.c:1.63	Mon Sep 27 17:33:07 2021
+++ src/usr.bin/indent/lexi.c	Mon Sep 27 18:21:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.63 2021/09/27 17:33:07 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.64 2021/09/27 18:21:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.63 2021/09/27 17:33:07 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.64 2021/09/27 18:21:47 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -106,9 +106,11 @@ static const struct keyword {
 {"while", kw_for_or_if_or_while}
 };
 
-static const char **typenames;
-static int typename_count;
-static int typename_top = -1;
+struct {
+const char **items;
+unsigned int len;
+unsigned int cap;
+} typenames;
 
 /*
  * The transition table below was rewritten by hand from lx's output, given
@@ -344,10 +346,10 @@ is_typename(void)
 	return true;
 }
 
-if (typename_top < 0)
+if (typenames.len == 0)
 	return false;
-return bsearch(token.s, typenames, (size_t)typename_top + 1,
-	sizeof(typenames[0]), cmp_type_by_name) != NULL;
+return bsearch(token.s, typenames.items, (size_t)typenames.len,
+	sizeof(typenames.items[0]), cmp_type_by_name) != NULL;
 }
 
 /* Reads the next token, placing it in the global variable "token". */
@@ -662,38 +664,38 @@ lexi(struct parser_state *state)
 return lexi_end(ttype);
 }
 
-void
-alloc_typenames(void)
-{
-
-typenames = xmalloc(sizeof(typenames[0]) * (typename_count = 16));
+static int
+insert_pos(const char *key, const char **arr, unsigned int len) {
+int lo = 0;
+int hi = (int)len - 1;
+
+while (lo <= hi) {
+	int mid = (lo + hi) >> 1;
+	int cmp = strcmp(arr[mid], key);
+	if (cmp < 0)
+	lo = mid + 1;
+	else if (cmp > 0)
+	hi = mid - 1;
+	else
+	return mid;
+}
+return -(lo + 1);
 }
 
 void
-add_typename(const char *key)
+add_typename(const char *name)
 {
-int comparison;
-
-if (typename_top + 1 >= typename_count) {
-	typenames = xrealloc((void *)typenames,
-	sizeof(typenames[0]) * (typename_count *= 2));
-}
-if (typename_top == -1)
-	typenames[++typename_top] = xstrdup(key);
-else if ((comparison = strcmp(key, typenames[typename_top])) >= 0) {
-	/* take advantage of sorted input */
-	if (comparison == 0)	/* remove duplicates */
-	return;
-	typenames[++typename_top] = xstrdup(key);
-} else {
-	int p;
-
-	for (p = 0; (comparison = 

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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:51:15 UTC 2021

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

Log Message:
remove unused code.
The syscall for 32bit uses aarch32_syscall.c, so there is no need to make 
syscall.c support it.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/aarch64/syscall.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/syscall.c
diff -u src/sys/arch/aarch64/aarch64/syscall.c:1.10 src/sys/arch/aarch64/aarch64/syscall.c:1.11
--- src/sys/arch/aarch64/aarch64/syscall.c:1.10	Mon Sep 27 17:40:39 2021
+++ src/sys/arch/aarch64/aarch64/syscall.c	Mon Sep 27 17:51:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $	*/
+/*	$NetBSD: syscall.c,v 1.11 2021/09/27 17:51:15 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -49,9 +49,6 @@
 #define	NARGREG		8		/* 8 args are in registers */
 #endif
 #define	MOREARGS(sp)	((const void *)(uintptr_t)(sp)) /* more args go here */
-#ifndef REGISTER_T
-#define REGISTER_T	register_t
-#endif
 
 #ifndef EMULNAME
 #include 
@@ -61,7 +58,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.11 2021/09/27 17:51:15 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -143,52 +140,10 @@ EMULNAME(syscall)(struct trapframe *tf)
 	if (__predict_false(callp->sy_narg > nargs)) {
 		const size_t diff = callp->sy_narg - nargs;
 		memcpy(args, params, nargs * sizeof(params[0]));
-		if (sizeof(params[0]) == sizeof(REGISTER_T)) {
-			error = copyin(MOREARGS(tf->tf_sp), [nargs],
-			diff * sizeof(register_t));
-			if (error)
-goto bad;
-		} else {
-			/*
-			 * If the register_t used by the process isn't the
-			 * as the one used by the kernel, we can't directly
-			 * copy the arguments off the stack into args.  We
-			 * need to buffer them in a REGISTER_T array and
-			 * then move them individually into args.
-			 */
-			REGISTER_T args32[10];
-			error = copyin(MOREARGS(tf->tf_sp), args32,
-			diff * sizeof(REGISTER_T));
-			if (error)
-goto bad;
-			for (size_t i = 0; i < diff; i++) {
-args[nargs + i] = args32[i];
-			}
-		}
-		params = args;
-	}
-
-#ifdef __AARCH64EB__
-#define SYCALL_ARG_64(a, b)	(((register_t) (a) << 32) | (uint32_t)(b))
-#else
-#define SYCALL_ARG_64(a, b)	(((register_t) (b) << 32) | (uint32_t)(a))
-#endif
-
-	/*
-	 * If the syscall used a different (smaller) register size,
-	 * reconstruct the 64-bit arguments from two 32-bit registers.
-	 */
-	if (__predict_false(sizeof(register_t) != sizeof(REGISTER_T)
-			&& SYCALL_NARGS64(callp) > 0)) {
-		for (size_t i = 0, j = 0; i < callp->sy_narg; i++, j++) {
-			if (SYCALL_ARG_64_P(callp, i)) {
-register_t *inp = [j];
-args[i] = SYCALL_ARG_64(inp[0], inp[1]);
-j++;
-			} else if (i != j) {
-args[i] = params[j];
-			}
-		}
+		error = copyin(MOREARGS(tf->tf_sp), [nargs],
+		diff * sizeof(register_t));
+		if (error)
+			goto bad;
 		params = args;
 	}
 
@@ -197,21 +152,10 @@ EMULNAME(syscall)(struct trapframe *tf)
 	error = sy_invoke(callp, l, params, rval, code);
 
 	if (__predict_true(error == 0)) {
-		if (__predict_false(sizeof(register_t) != sizeof(REGISTER_T)
-&& SYCALL_RET_64_P(callp))) {
-#ifdef __AARCH64EB__
-			tf->tf_reg[0] = (uint32_t) (rval[0] >> 32);
-			tf->tf_reg[1] = (uint32_t) (rval[0] >>  0);
-#else
-			tf->tf_reg[0] = (uint32_t) (rval[0] >>  0);
-			tf->tf_reg[1] = (uint32_t) (rval[0] >> 32);
-#endif
-		} else {
-			tf->tf_reg[0] = rval[0];
+		tf->tf_reg[0] = rval[0];
 #ifndef SYSCALL_NO_RVAL1
-			tf->tf_reg[1] = rval[1];
+		tf->tf_reg[1] = rval[1];
 #endif
-		}
 		tf->tf_spsr &= ~NZCV_C;
 	} else {
 		switch (error) {



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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:51:15 UTC 2021

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

Log Message:
remove unused code.
The syscall for 32bit uses aarch32_syscall.c, so there is no need to make 
syscall.c support it.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/aarch64/syscall.c

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



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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:40:39 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: linux_syscall.c syscall.c

Log Message:
linux syscall should not break x1 register


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/linux_syscall.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/syscall.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/linux_syscall.c
diff -u src/sys/arch/aarch64/aarch64/linux_syscall.c:1.1 src/sys/arch/aarch64/aarch64/linux_syscall.c:1.2
--- src/sys/arch/aarch64/aarch64/linux_syscall.c:1.1	Thu Sep 23 06:56:26 2021
+++ src/sys/arch/aarch64/aarch64/linux_syscall.c	Mon Sep 27 17:40:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_syscall.c,v 1.1 2021/09/23 06:56:26 ryo Exp $	*/
+/*	$NetBSD: linux_syscall.c,v 1.2 2021/09/27 17:40:39 ryo Exp $	*/
 
 /*
  * Copyright (c) 2021 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.1 2021/09/23 06:56:26 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.2 2021/09/27 17:40:39 ryo Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_linux.h"
@@ -54,5 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscal
 /* used when __HAVE_MINIMAL_EMUL is not defined */
 #define SYSCALL_EMUL_ERRNO(x)	native_to_linux_errno[x]
 
+/* don't update x1 register with rval[1] */
+#define SYSCALL_NO_RVAL1
 
 #include "syscall.c"

Index: src/sys/arch/aarch64/aarch64/syscall.c
diff -u src/sys/arch/aarch64/aarch64/syscall.c:1.9 src/sys/arch/aarch64/aarch64/syscall.c:1.10
--- src/sys/arch/aarch64/aarch64/syscall.c:1.9	Mon Sep 27 17:37:59 2021
+++ src/sys/arch/aarch64/aarch64/syscall.c	Mon Sep 27 17:40:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $	*/
+/*	$NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -208,7 +208,9 @@ EMULNAME(syscall)(struct trapframe *tf)
 #endif
 		} else {
 			tf->tf_reg[0] = rval[0];
+#ifndef SYSCALL_NO_RVAL1
 			tf->tf_reg[1] = rval[1];
+#endif
 		}
 		tf->tf_spsr &= ~NZCV_C;
 	} else {



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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:40:39 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: linux_syscall.c syscall.c

Log Message:
linux syscall should not break x1 register


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/linux_syscall.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/syscall.c

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



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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:37:59 UTC 2021

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

Log Message:
In order to prevent uninitialized values from being reflected in the registers 
after syscall, rval[] must be initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/syscall.c

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



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

2021-09-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 27 17:37:59 UTC 2021

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

Log Message:
In order to prevent uninitialized values from being reflected in the registers 
after syscall, rval[] must be initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/syscall.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/syscall.c
diff -u src/sys/arch/aarch64/aarch64/syscall.c:1.8 src/sys/arch/aarch64/aarch64/syscall.c:1.9
--- src/sys/arch/aarch64/aarch64/syscall.c:1.8	Thu Sep 23 15:19:03 2021
+++ src/sys/arch/aarch64/aarch64/syscall.c	Mon Sep 27 17:37:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $	*/
+/*	$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -192,6 +192,8 @@ EMULNAME(syscall)(struct trapframe *tf)
 		params = args;
 	}
 
+	rval[0] = 0;
+	rval[1] = tf->tf_reg[1];
 	error = sy_invoke(callp, l, params, rval, code);
 
 	if (__predict_true(error == 0)) {



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 17:33:07 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: extract is_typename from lexi

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/indent/lexi.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/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.62 src/usr.bin/indent/lexi.c:1.63
--- src/usr.bin/indent/lexi.c:1.62	Mon Sep 27 16:56:35 2021
+++ src/usr.bin/indent/lexi.c	Mon Sep 27 17:33:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.62 2021/09/27 16:56:35 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.63 2021/09/27 17:33:07 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.62 2021/09/27 16:56:35 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.63 2021/09/27 17:33:07 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -335,6 +335,21 @@ probably_typedef(const struct parser_sta
 	state->last_token == rbrace);
 }
 
+static bool
+is_typename(void)
+{
+if (opt.auto_typedefs) {
+	const char *u;
+	if ((u = strrchr(token.s, '_')) != NULL && strcmp(u, "_t") == 0)
+	return true;
+}
+
+if (typename_top < 0)
+	return false;
+return bsearch(token.s, typenames, (size_t)typename_top + 1,
+	sizeof(typenames[0]), cmp_type_by_name) != NULL;
+}
+
 /* Reads the next token, placing it in the global variable "token". */
 token_type
 lexi(struct parser_state *state)
@@ -391,13 +406,7 @@ lexi(struct parser_state *state)
 	kw = bsearch(token.s, keywords, nitems(keywords),
 	sizeof(keywords[0]), cmp_keyword_by_name);
 	if (kw == NULL) {
-	char *u;
-
-	/* ... so maybe a type_t or a typedef */
-	if ((opt.auto_typedefs && ((u = strrchr(token.s, '_')) != NULL) &&
-		strcmp(u, "_t") == 0) || (typename_top >= 0 &&
-		bsearch(token.s, typenames, (size_t)typename_top + 1,
-			sizeof(typenames[0]), cmp_type_by_name) != NULL)) {
+	if (is_typename()) {
 		state->keyword = kw_type;
 		state->last_u_d = true;
 		goto found_typename;



CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 17:33:07 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: extract is_typename from lexi

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/indent/lexi.c

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



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 17:05:58 UTC 2021

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

Log Message:
Improve variable sized TLB's output.

 - Fix a bug that STLB is printed as DTLB.
 - If a TLB is variable sized, print the max size instead of error message.
   XXX This is temporary solution.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.120 src/usr.sbin/cpuctl/arch/i386.c:1.121
--- src/usr.sbin/cpuctl/arch/i386.c:1.120	Mon Sep 27 16:52:15 2021
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Sep 27 17:05:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.121 2021/09/27 17:05:58 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.121 2021/09/27 17:05:58 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -1145,24 +1145,35 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 			else if (type == CPUID_DATP_TCTYPE_D)
 caitype = CAI_L2_DTLB;
 			else if (type == CPUID_DATP_TCTYPE_U) {
-switch (pgsize) {
-case CPUID_DATP_PGSIZE_4KB:
+if (pgsize == CPUID_DATP_PGSIZE_4KB)
 	caitype = CAI_L2_STLB;
-	break;
-case CPUID_DATP_PGSIZE_4KB
-| CPUID_DATP_PGSIZE_2MB:
+else if (pgsize == (CPUID_DATP_PGSIZE_4KB
+	| CPUID_DATP_PGSIZE_2MB))
 	caitype = CAI_L2_STLB2;
-	break;
-case CPUID_DATP_PGSIZE_2MB
-| CPUID_DATP_PGSIZE_4MB:
+else if (pgsize == (CPUID_DATP_PGSIZE_2MB
+	| CPUID_DATP_PGSIZE_4MB))
 	caitype = CAI_L2_STLB3;
-	break;
-default:
-	aprint_error_dev(ci->ci_dev,
-	"error: unknown L2 STLB size (%d)\n",
+else if ((pgsize & CPUID_DATP_PGSIZE_1GB)
+!= 0) {
+	/* FIXME: 1GB max TLB */
+	caitype = CAI_L2_STLB3;
+	linesize = 1024 * 1024 * 1024;
+} else if ((pgsize & CPUID_DATP_PGSIZE_4MB)
+!= 0) {
+	/* FIXME: 4MB max TLB */
+	caitype = CAI_L2_STLB3;
+	linesize = 4 * 1024 * 1024;
+} else if ((pgsize & CPUID_DATP_PGSIZE_2MB)
+!= 0) {
+	/* FIXME: 2MB max TLB */
+	caitype = CAI_L2_STLB2;
+	linesize = 2 * 1024 * 1024;
+} else {
+	aprint_error_dev(ci->ci_dev, "error: "
+	"unknown L2 STLB size (%d)\n",
 	pgsize);
-	caitype = CAI_DTLB;
-	break;
+	caitype = CAI_L2_STLB;
+	linesize = 4 * 1024;
 }
 			} else
 caitype = -1;
@@ -1194,15 +1205,19 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 		case CPUID_DATP_PGSIZE_1GB:
 			linesize = 1024 * 1024 * 1024;
 			break;
-		case CPUID_DATP_PGSIZE_2MB | CPUID_DATP_PGSIZE_4MB:
-			aprint_error_dev(ci->ci_dev,
-			"WARINING: Currently 2M/4M info can't print correctly\n");
-			linesize = 4 * 1024 * 1024;
-			break;
 		default:
-			aprint_error_dev(ci->ci_dev,
-			"error: Unknown size combination\n");
-			linesize = 4 * 1024;
+			if ((pgsize & CPUID_DATP_PGSIZE_1GB) != 0)
+linesize = 1024 * 1024 * 1024; /* MAX 1G */
+			else if ((pgsize & CPUID_DATP_PGSIZE_4MB) != 0)
+linesize = 4 * 1024 * 1024; /* MAX 4M */
+			else if ((pgsize & CPUID_DATP_PGSIZE_2MB) != 0)
+linesize = 2 * 1024 * 1024; /* MAX 2M */
+			else
+linesize = 4 * 1024;	/* XXX default to 4K */
+			aprint_error_dev(ci->ci_dev, "WARNING: Currently "
+			"this info can't print correctly "
+			"(level = %d, pgsize = %d)\n",
+			level, pgsize);
 			break;
 		}
 		ways = __SHIFTOUT(descs[1], CPUID_DATP_WAYS);



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 17:05:58 UTC 2021

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

Log Message:
Improve variable sized TLB's output.

 - Fix a bug that STLB is printed as DTLB.
 - If a TLB is variable sized, print the max size instead of error message.
   XXX This is temporary solution.


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

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



CVS commit: src/doc

2021-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 27 17:04:12 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1816 -r1.1817 src/doc/3RDPARTY
cvs rdiff -u -r1.2833 -r1.2834 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/3RDPARTY
diff -u src/doc/3RDPARTY:1.1816 src/doc/3RDPARTY:1.1817
--- src/doc/3RDPARTY:1.1816	Mon Sep 27 07:13:12 2021
+++ src/doc/3RDPARTY	Mon Sep 27 13:04:12 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1816 2021/09/27 11:13:12 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1817 2021/09/27 17:04:12 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1070,12 +1070,12 @@ Notes:
 Patch applied after OpenSSH import.
 
 Package:	OpenSSH
-Version:	8.7
+Version:	8.8
 Current Vers:	8.8 / portable 8.8p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html
-Date:		2021-09-02
+Date:		2021-09-27
 Mailing List:	openssh-unix-annou...@mindrot.org
 Responsible:	thorpej, christos, elric
 License:	BSD. See src/crypto/external/bsd/openssh/dist/LICENSE

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2833 src/doc/CHANGES:1.2834
--- src/doc/CHANGES:1.2833	Fri Sep 24 09:14:49 2021
+++ src/doc/CHANGES	Mon Sep 27 13:04:12 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2833 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2834 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -428,3 +428,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	aarch64: Add initial COMPAT_LINUX support. [ryo 20210923]
 	libfido2: Import 1.8.0 [christos 20210924]
 	pam-u2f: Import pam u2f 1.2.0 [christos 20210924]
+	OpenSSH: Import 8.8. [christos 20210927]



CVS commit: src/doc

2021-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 27 17:04:12 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1816 -r1.1817 src/doc/3RDPARTY
cvs rdiff -u -r1.2833 -r1.2834 src/doc/CHANGES

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



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Christos Zoulas
_or_none(options.proxy_command) &&
 	options.jump_host == NULL;
-	if (addrs == NULL && options.num_permitted_cnames != 0 && (direct ||
+	if (addrs == NULL && config_has_permitted_cnames() && (direct ||
 	options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) {
 		if ((addrs = resolve_host(host, options.port,
 		direct, cname, sizeof(cname))) == NULL) {
@@ -1783,7 +1784,8 @@ ssh_confirm_remote_forward(struct ssh *s
 rfwd->allocated_port = (int)port;
 logit("Allocated port %u for remote "
 "forward to %s:%d",
-rfwd->allocated_port, rfwd->connect_host,
+rfwd->allocated_port, rfwd->connect_path ?
+rfwd->connect_path : rfwd->connect_host,
 rfwd->connect_port);
 channel_update_permission(ssh,
 rfwd->handle, rfwd->allocated_port);
Index: src/crypto/external/bsd/openssh/dist/version.h
diff -u src/crypto/external/bsd/openssh/dist/version.h:1.37 src/crypto/external/bsd/openssh/dist/version.h:1.38
--- src/crypto/external/bsd/openssh/dist/version.h:1.37	Thu Sep  2 07:26:18 2021
+++ src/crypto/external/bsd/openssh/dist/version.h	Mon Sep 27 13:03:13 2021
@@ -1,8 +1,8 @@
-/*	$NetBSD: version.h,v 1.37 2021/09/02 11:26:18 christos Exp $	*/
-/* $OpenBSD: version.h,v 1.91 2021/08/20 03:22:55 djm Exp $ */
+/*	$NetBSD: version.h,v 1.38 2021/09/27 17:03:13 christos Exp $	*/
+/* $OpenBSD: version.h,v 1.92 2021/09/26 14:01:11 djm Exp $ */
 
-#define __OPENSSH_VERSION	"OpenSSH_8.7"
-#define __NETBSDSSH_VERSION	"NetBSD_Secure_Shell-20210902"
+#define __OPENSSH_VERSION	"OpenSSH_8.8"
+#define __NETBSDSSH_VERSION	"NetBSD_Secure_Shell-20210927"
 #define SSH_HPN "-hpn13v14"
 #define SSH_LPK		"-lpk"
 /*

Index: src/crypto/external/bsd/openssh/dist/sftp-client.c
diff -u src/crypto/external/bsd/openssh/dist/sftp-client.c:1.28 src/crypto/external/bsd/openssh/dist/sftp-client.c:1.29
--- src/crypto/external/bsd/openssh/dist/sftp-client.c:1.28	Thu Sep  2 07:26:18 2021
+++ src/crypto/external/bsd/openssh/dist/sftp-client.c	Mon Sep 27 13:03:13 2021
@@ -1,5 +1,5 @@
-/*	$NetBSD: sftp-client.c,v 1.28 2021/09/02 11:26:18 christos Exp $	*/
-/* $OpenBSD: sftp-client.c,v 1.154 2021/08/09 23:47:44 djm Exp $ */
+/*	$NetBSD: sftp-client.c,v 1.29 2021/09/27 17:03:13 christos Exp $	*/
+/* $OpenBSD: sftp-client.c,v 1.155 2021/09/03 05:12:25 dtucker Exp $ */
 
 /*
  * Copyright (c) 2001-2004 Damien Miller 
@@ -23,7 +23,7 @@
 /* XXX: copy between two remote sites */
 
 #include "includes.h"
-__RCSID("$NetBSD: sftp-client.c,v 1.28 2021/09/02 11:26:18 christos Exp $");
+__RCSID("$NetBSD: sftp-client.c,v 1.29 2021/09/27 17:03:13 christos Exp $");
 
 #include 	/* MIN MAX */
 #include 
@@ -2021,7 +2021,6 @@ upload_dir_internal(struct sftp_conn *co
 	if (print_flag && print_flag != SFTP_PROGRESS_ONLY)
 		mprintf("Entering %s\n", src);
 
-	attrib_clear();
 	stat_to_attrib(, );
 	a.flags &= ~SSH2_FILEXFER_ATTR_SIZE;
 	a.flags &= ~SSH2_FILEXFER_ATTR_UIDGID;

Index: src/crypto/external/bsd/openssh/dist/sftp-realpath.c
diff -u src/crypto/external/bsd/openssh/dist/sftp-realpath.c:1.2 src/crypto/external/bsd/openssh/dist/sftp-realpath.c:1.3
--- src/crypto/external/bsd/openssh/dist/sftp-realpath.c:1.2	Wed Feb 26 19:24:40 2020
+++ src/crypto/external/bsd/openssh/dist/sftp-realpath.c	Mon Sep 27 13:03:13 2021
@@ -1,4 +1,4 @@
-/*	$OpenBSD: sftp-realpath.c,v 1.1 2019/07/05 04:55:40 djm Exp $ */
+/*	$OpenBSD: sftp-realpath.c,v 1.2 2021/09/02 21:03:54 deraadt Exp $ */
 /*
  * Copyright (c) 2003 Constantin S. Svintsoff 
  *
@@ -27,10 +27,9 @@
  * SUCH DAMAGE.
  */
 #include "includes.h"
-__RCSID("$NetBSD: sftp-realpath.c,v 1.2 2020/02/27 00:24:40 christos Exp $");
+__RCSID("$NetBSD: sftp-realpath.c,v 1.3 2021/09/27 17:03:13 christos Exp $");
 
 #include 
-#include 
 #include 
 
 #include 

Index: src/crypto/external/bsd/openssh/dist/ssh-keygen.c
diff -u src/crypto/external/bsd/openssh/dist/ssh-keygen.c:1.40 src/crypto/external/bsd/openssh/dist/ssh-keygen.c:1.41
--- src/crypto/external/bsd/openssh/dist/ssh-keygen.c:1.40	Thu Sep  2 07:26:18 2021
+++ src/crypto/external/bsd/openssh/dist/ssh-keygen.c	Mon Sep 27 13:03:13 2021
@@ -1,5 +1,5 @@
-/*	$NetBSD: ssh-keygen.c,v 1.40 2021/09/02 11:26:18 christos Exp $	*/
-/* $OpenBSD: ssh-keygen.c,v 1.435 2021/08/11 08:54:17 djm Exp $ */
+/*	$NetBSD: ssh-keygen.c,v 1.41 2021/09/27 17:03:13 christos Exp $	*/
+/* $OpenBSD: ssh-keygen.c,v 1.437 2021/09/08 03:23:44 djm Exp $ */
 
 /*
  * Author: Tatu Ylonen 
@@ -15,7 +15,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: ssh-keygen.c,v 1.40 2021/09/02 11:26:18 christos Exp $");
+__RCSID("$NetBSD: ssh-keygen.c,v 1.41 2021/09/27 17:03:13 christos Exp $");
 #include 
 #include 
 #include 
@@ -2661,7 +2661,8 @@ sig_process_opts(char * const *opts, siz
 	tim

CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 27 17:03:13 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: channels.c clientloop.c compat.c
log.c misc.c myproposal.h readconf.c readconf.h scp.1 scp.c
servconf.c sftp-client.c sftp-realpath.c sftp.c ssh-keygen.c ssh.1
ssh.c ssh_config.5 sshd.8 sshd_config.5 version.h

Log Message:
Merge conflicts between OpenSSH 8.7 and 8.8


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/crypto/external/bsd/openssh/dist/channels.c \
src/crypto/external/bsd/openssh/dist/ssh_config.5
cvs rdiff -u -r1.33 -r1.34 src/crypto/external/bsd/openssh/dist/clientloop.c \
src/crypto/external/bsd/openssh/dist/sftp.c
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/dist/compat.c
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/log.c \
src/crypto/external/bsd/openssh/dist/scp.1
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssh/dist/misc.c \
src/crypto/external/bsd/openssh/dist/readconf.h
cvs rdiff -u -r1.21 -r1.22 src/crypto/external/bsd/openssh/dist/myproposal.h
cvs rdiff -u -r1.36 -r1.37 src/crypto/external/bsd/openssh/dist/readconf.c
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/dist/scp.c
cvs rdiff -u -r1.37 -r1.38 src/crypto/external/bsd/openssh/dist/servconf.c \
src/crypto/external/bsd/openssh/dist/ssh.c \
src/crypto/external/bsd/openssh/dist/version.h
cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssh/dist/sftp-client.c
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/sftp-realpath.c
cvs rdiff -u -r1.40 -r1.41 src/crypto/external/bsd/openssh/dist/ssh-keygen.c
cvs rdiff -u -r1.30 -r1.31 src/crypto/external/bsd/openssh/dist/ssh.1
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/dist/sshd.8
cvs rdiff -u -r1.35 -r1.36 src/crypto/external/bsd/openssh/dist/sshd_config.5

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



CVS import: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 27 17:01:01 UTC 2021

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv4363

Log Message:
Import OpenSSH-8.8:

Future deprecation notice
=

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

This creates one area of potential incompatibility: scp(1) when using
the SFTP protocol no longer requires this finicky and brittle quoting,
and attempts to use it may cause transfers to fail. We consider the
removal of the need for double-quoting shell characters in file names
to be a benefit and do not intend to introduce bug- compatibility for
legacy scp/rcp in scp(1) when using the SFTP protocol.

Another area of potential incompatibility relates to the use of remote
paths relative to other user's home directories, for example -
"scp host:~user/file /tmp". The SFTP protocol has no native way to
expand a ~user path. However, sftp-server(8) in OpenSSH 8.7 and later
support a protocol extension "expand-p...@openssh.com" to support
this.

Security


sshd(8) from OpenSSH 6.2 through 8.7 failed to correctly initialise
supplemental groups when executing an AuthorizedKeysCommand or
AuthorizedPrincipalsCommand, where a AuthorizedKeysCommandUser or
AuthorizedPrincipalsCommandUser directive has been set to run the
command as a different user. Instead these commands would inherit
the groups that sshd(8) was started with.

Depending on system configuration, inherited groups may allow
AuthorizedKeysCommand/AuthorizedPrincipalsCommand helper programs to
gain unintended privilege.

Neither AuthorizedKeysCommand nor AuthorizedPrincipalsCommand are
enabled by default in sshd_config(5).

Potentially-incompatible changes


This release disables RSA signatures using the SHA-1 hash algorithm
by default. This change has been made as the SHA-1 hash algorithm is
cryptographically broken, and it is possible to create chosen-prefix
hash collisions for https://eprint.iacr.org/2020/014.pdf

Changes since OpenSSH 8.7
=

This release is motivated primarily by the above deprecation and
security fix.

New features

 * ssh(1): allow the ssh_config(5) CanonicalizePermittedCNAMEs
   directive to accept a "none" argument to specify the default
   behaviour.

Bugfixes


 * scp(1): when using the SFTP protocol, continue transferring files
   after a transfer error occurs, better matching original scp/rcp
   behaviour.

 * ssh(1): fixed a number of memory leaks in multiplexing,

 * ssh-keygen(1): avoid crash when using the -Y find-principals
   command.

 * A number of documentation and manual improvements, including
   bz#3340, PR#139, PR#215, PR#241, PR#257

Portability
---

 * ssh-agent(1): on FreeBSD, use procctl to disable ptrace(2)

 * ssh(1)/sshd(8): some fixes to the pselect(2) replacement
   compatibility code. bz#3345

Status:

Vendor Tag: OPENSSH
Release Tags:   v88-20210926

U src/crypto/external/bsd/openssh/dist/LICENCE
U src/crypto/external/bsd/openssh/dist/OVERVIEW
U src/crypto/external/bsd/openssh/dist/PROTOCOL
U src/crypto/external/bsd/openssh/dist/PROTOCOL.agent
U src/crypto/external/bsd/openssh/dist/PROTOCOL.certkeys
U src/crypto/external/bsd/openssh/dist/PROTOCOL.chacha20poly1305
U src/crypto/external/bsd/openssh/dist/PROTOCOL.key
U src/crypto/external/bsd/openssh/dist/PROTOCOL.krl
U src/crypto/external/bsd/openssh/dist/PROTOCOL.mux
U src/crypto/external/bsd/openssh/dist/PROTOCOL.sshsig
U src/crypto/external/bsd/openssh/dist/PROTOCOL.u2f
U src/crypto/external/bsd/openssh/dist/README
U src/crypto/external/bsd/openssh/dist/addr.c
U src/crypto/external/bsd/openssh/dist/addr.h
U src/crypto/external/bsd/openssh/dist/addrmatch.c
U src/crypto/external/bsd/openssh/dist/atomicio.c
U src/crypto/external/bsd/openssh/dist/atomicio.h
U src/crypto/external/bsd/openssh/dist/auth-bsdauth.c
U src/crypto/external/bsd/openssh/dist/auth-krb5.c
U src/crypto/external/bsd/openssh/dist/auth-options.c
U src/crypto/external/bsd/openssh/dist/auth-options.h
U src/crypto/external/bsd/openssh/dist/auth-passwd.c
U src/crypto/external/bsd/openssh/dist/auth-rhosts.c
U src/crypto/external/bsd/openssh/dist/auth.c
U src/crypto/external/bsd/openssh/dist/auth.h
U src/crypto/external/bsd/openssh/dist/auth2-chall.c
U src/crypto/external/bsd/openssh/dist/auth2-gss.c
U src/crypto/external/bsd/openssh/dist/auth2-hostbased.c
U src/crypto/external/bsd/openssh/dist/auth2-kbdint.c
U src/crypto/external/bsd/openssh/dist/auth2-none.c
U 

CVS import: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 27 17:01:01 UTC 2021

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv4363

Log Message:
Import OpenSSH-8.8:

Future deprecation notice
=

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

This creates one area of potential incompatibility: scp(1) when using
the SFTP protocol no longer requires this finicky and brittle quoting,
and attempts to use it may cause transfers to fail. We consider the
removal of the need for double-quoting shell characters in file names
to be a benefit and do not intend to introduce bug- compatibility for
legacy scp/rcp in scp(1) when using the SFTP protocol.

Another area of potential incompatibility relates to the use of remote
paths relative to other user's home directories, for example -
"scp host:~user/file /tmp". The SFTP protocol has no native way to
expand a ~user path. However, sftp-server(8) in OpenSSH 8.7 and later
support a protocol extension "expand-p...@openssh.com" to support
this.

Security


sshd(8) from OpenSSH 6.2 through 8.7 failed to correctly initialise
supplemental groups when executing an AuthorizedKeysCommand or
AuthorizedPrincipalsCommand, where a AuthorizedKeysCommandUser or
AuthorizedPrincipalsCommandUser directive has been set to run the
command as a different user. Instead these commands would inherit
the groups that sshd(8) was started with.

Depending on system configuration, inherited groups may allow
AuthorizedKeysCommand/AuthorizedPrincipalsCommand helper programs to
gain unintended privilege.

Neither AuthorizedKeysCommand nor AuthorizedPrincipalsCommand are
enabled by default in sshd_config(5).

Potentially-incompatible changes


This release disables RSA signatures using the SHA-1 hash algorithm
by default. This change has been made as the SHA-1 hash algorithm is
cryptographically broken, and it is possible to create chosen-prefix
hash collisions for https://eprint.iacr.org/2020/014.pdf

Changes since OpenSSH 8.7
=

This release is motivated primarily by the above deprecation and
security fix.

New features

 * ssh(1): allow the ssh_config(5) CanonicalizePermittedCNAMEs
   directive to accept a "none" argument to specify the default
   behaviour.

Bugfixes


 * scp(1): when using the SFTP protocol, continue transferring files
   after a transfer error occurs, better matching original scp/rcp
   behaviour.

 * ssh(1): fixed a number of memory leaks in multiplexing,

 * ssh-keygen(1): avoid crash when using the -Y find-principals
   command.

 * A number of documentation and manual improvements, including
   bz#3340, PR#139, PR#215, PR#241, PR#257

Portability
---

 * ssh-agent(1): on FreeBSD, use procctl to disable ptrace(2)

 * ssh(1)/sshd(8): some fixes to the pselect(2) replacement
   compatibility code. bz#3345

Status:

Vendor Tag: OPENSSH
Release Tags:   v88-20210926

U src/crypto/external/bsd/openssh/dist/LICENCE
U src/crypto/external/bsd/openssh/dist/OVERVIEW
U src/crypto/external/bsd/openssh/dist/PROTOCOL
U src/crypto/external/bsd/openssh/dist/PROTOCOL.agent
U src/crypto/external/bsd/openssh/dist/PROTOCOL.certkeys
U src/crypto/external/bsd/openssh/dist/PROTOCOL.chacha20poly1305
U src/crypto/external/bsd/openssh/dist/PROTOCOL.key
U src/crypto/external/bsd/openssh/dist/PROTOCOL.krl
U src/crypto/external/bsd/openssh/dist/PROTOCOL.mux
U src/crypto/external/bsd/openssh/dist/PROTOCOL.sshsig
U src/crypto/external/bsd/openssh/dist/PROTOCOL.u2f
U src/crypto/external/bsd/openssh/dist/README
U src/crypto/external/bsd/openssh/dist/addr.c
U src/crypto/external/bsd/openssh/dist/addr.h
U src/crypto/external/bsd/openssh/dist/addrmatch.c
U src/crypto/external/bsd/openssh/dist/atomicio.c
U src/crypto/external/bsd/openssh/dist/atomicio.h
U src/crypto/external/bsd/openssh/dist/auth-bsdauth.c
U src/crypto/external/bsd/openssh/dist/auth-krb5.c
U src/crypto/external/bsd/openssh/dist/auth-options.c
U src/crypto/external/bsd/openssh/dist/auth-options.h
U src/crypto/external/bsd/openssh/dist/auth-passwd.c
U src/crypto/external/bsd/openssh/dist/auth-rhosts.c
U src/crypto/external/bsd/openssh/dist/auth.c
U src/crypto/external/bsd/openssh/dist/auth.h
U src/crypto/external/bsd/openssh/dist/auth2-chall.c
U src/crypto/external/bsd/openssh/dist/auth2-gss.c
U src/crypto/external/bsd/openssh/dist/auth2-hostbased.c
U src/crypto/external/bsd/openssh/dist/auth2-kbdint.c
U src/crypto/external/bsd/openssh/dist/auth2-none.c
U 

CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 16:56:35 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent_codes.h indent_globs.h lexi.c

Log Message:
indent: rename rwcode to keyword_kind, various cleanup

No idea what the 'rw' in 'rwcode' meant, it had been imported that way
28 years ago. Since rwcode specifies the kind of a keyword, the prefix
'kw_' makes sense.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/indent/indent_codes.h
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/indent/indent_globs.h
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.88 src/usr.bin/indent/indent.c:1.89
--- src/usr.bin/indent/indent.c:1.88	Sun Sep 26 21:23:31 2021
+++ src/usr.bin/indent/indent.c	Mon Sep 27 16:56:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.88 2021/09/26 21:23:31 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.89 2021/09/27 16:56:35 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.88 2021/09/26 21:23:31 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.89 2021/09/27 16:56:35 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -577,8 +577,8 @@ process_lparen_or_lbracket(int dec_ind, 
 } else if (ps.want_blank &&
 	((ps.last_token != ident && ps.last_token != funcname) ||
 	opt.proc_calls_space ||
-	(ps.keyword == rw_sizeof ? opt.blank_after_sizeof :
-	ps.keyword != rw_0 && ps.keyword != rw_offsetof)))
+	(ps.keyword == kw_sizeof ? opt.blank_after_sizeof :
+	ps.keyword != kw_0 && ps.keyword != kw_offsetof)))
 	*code.e++ = ' ';
 ps.want_blank = false;
 *code.e++ = token.s[0];
@@ -603,7 +603,7 @@ process_lparen_or_lbracket(int dec_ind, 
  * initialization */
 }
 /* parenthesized type following sizeof or offsetof is not a cast */
-if (ps.keyword == rw_offsetof || ps.keyword == rw_sizeof)
+if (ps.keyword == kw_offsetof || ps.keyword == kw_sizeof)
 	ps.not_cast_mask |= 1 << ps.p_l_follow;
 }
 

Index: src/usr.bin/indent/indent_codes.h
diff -u src/usr.bin/indent/indent_codes.h:1.11 src/usr.bin/indent/indent_codes.h:1.12
--- src/usr.bin/indent/indent_codes.h:1.11	Tue Mar  9 19:23:08 2021
+++ src/usr.bin/indent/indent_codes.h	Mon Sep 27 16:56:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent_codes.h,v 1.11 2021/03/09 19:23:08 rillig Exp $	*/
+/*	$NetBSD: indent_codes.h,v 1.12 2021/09/27 16:56:35 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -54,7 +54,7 @@ typedef enum token_type {
 semicolon,
 lbrace,
 rbrace,
-ident,
+ident,			/* identifier, constant or string */
 comma,
 comment,
 switch_expr,		/* 'switch' '('  ')' */

Index: src/usr.bin/indent/indent_globs.h
diff -u src/usr.bin/indent/indent_globs.h:1.40 src/usr.bin/indent/indent_globs.h:1.41
--- src/usr.bin/indent/indent_globs.h:1.40	Sun Sep 26 21:32:58 2021
+++ src/usr.bin/indent/indent_globs.h	Mon Sep 27 16:56:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent_globs.h,v 1.40 2021/09/26 21:32:58 rillig Exp $	*/
+/*	$NetBSD: indent_globs.h,v 1.41 2021/09/27 16:56:35 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -155,20 +155,20 @@ extern struct options {
  * are printed */
 } opt;
 
-enum rwcode {
-rw_0,
-rw_offsetof,
-rw_sizeof,
-rw_struct_or_union_or_enum,
-rw_type,
-rw_for_or_if_or_while,
-rw_do_or_else,
-rw_switch,
-rw_case_or_default,
-rw_jump,
-rw_storage_class,
-rw_typedef,
-rw_inline_or_restrict
+enum keyword_kind {
+kw_0,
+kw_offsetof,
+kw_sizeof,
+kw_struct_or_union_or_enum,
+kw_type,
+kw_for_or_if_or_while,
+kw_do_or_else,
+kw_switch,
+kw_case_or_default,
+kw_jump,
+kw_storage_class,
+kw_typedef,
+kw_inline_or_restrict
 };
 
 
@@ -251,7 +251,7 @@ extern struct parser_state {
 bool	want_blank;	/* whether the following token should
  * be prefixed by a blank. (Said prefixing is
  * ignored in some cases.) */
-enum rwcode keyword;	/* the type of a keyword or 0 */
+enum keyword_kind keyword;
 bool	dumped_decl_indent;
 bool	in_parameter_declaration;
 int tos;		/* pointer to top of stack */

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.61 src/usr.bin/indent/lexi.c:1.62
--- src/usr.bin/indent/lexi.c:1.61	Sun Sep 26 21:23:31 2021
+++ src/usr.bin/indent/lexi.c	Mon Sep 27 16:56:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.61 2021/09/26 21:23:31 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.62 2021/09/27 

CVS commit: src/usr.bin/indent

2021-09-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 27 16:56:35 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent_codes.h indent_globs.h lexi.c

Log Message:
indent: rename rwcode to keyword_kind, various cleanup

No idea what the 'rw' in 'rwcode' meant, it had been imported that way
28 years ago. Since rwcode specifies the kind of a keyword, the prefix
'kw_' makes sense.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/indent/indent_codes.h
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/indent/indent_globs.h
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/indent/lexi.c

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



CVS commit: src

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:52:15 UTC 2021

Modified Files:
src/sys/arch/x86/include: cacheinfo.h
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Load Only TLB and Store Only TLB.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/cacheinfo.h
cvs rdiff -u -r1.119 -r1.120 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/sys/arch/x86/include/cacheinfo.h
diff -u src/sys/arch/x86/include/cacheinfo.h:1.28 src/sys/arch/x86/include/cacheinfo.h:1.29
--- src/sys/arch/x86/include/cacheinfo.h:1.28	Fri Jul 26 10:03:40 2019
+++ src/sys/arch/x86/include/cacheinfo.h	Mon Sep 27 16:52:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cacheinfo.h,v 1.28 2019/07/26 10:03:40 msaitoh Exp $	*/
+/*	$NetBSD: cacheinfo.h,v 1.29 2021/09/27 16:52:15 msaitoh Exp $	*/
 
 #ifndef _X86_CACHEINFO_H_
 #define _X86_CACHEINFO_H_
@@ -37,8 +37,10 @@ struct x86_cache_info {
 #define CAI_L2_STLB2	17		/* Shared L2 TLB (4K/2M pages) */
 #define CAI_L2_STLB3	18		/* Shared L2 TLB (2M/4M pages) */
 #define CAI_PREFETCH	19		/* Prefetch */
+#define CAI_L1_LD_TLB	20		/* L1 Load Only TLB */
+#define CAI_L1_ST_TLB	21		/* L1 Store Only TLB */
+#define	CAI_COUNT	22
 
-#define	CAI_COUNT	20
 
 /*
  * AMD Cache Info:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.119 src/usr.sbin/cpuctl/arch/i386.c:1.120
--- src/usr.sbin/cpuctl/arch/i386.c:1.119	Mon Sep 27 16:47:15 2021
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Sep 27 16:52:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.120 2021/09/27 16:52:15 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -1132,7 +1132,11 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 	caitype = CAI_DTLB;
 	break;
 }
-			} else
+			} else if (type == CPUID_DATP_TCTYPE_L)
+caitype = CAI_L1_LD_TLB;
+			else if (type == CPUID_DATP_TCTYPE_S)
+caitype = CAI_L1_ST_TLB;
+			else
 caitype = -1;
 			break;
 		case 2:
@@ -2488,6 +2492,14 @@ x86_print_cache_and_tlb_info(struct cpu_
 	if (sep != NULL)
 		aprint_verbose("\n");
 
+	sep = print_tlb_config(ci, CAI_L1_LD_TLB, "Load only TLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L1_ST_TLB, "Store only TLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
 	sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB:", NULL);
 	sep = print_tlb_config(ci, CAI_L2_ITLB2, "L2 ITLB:", sep);
 	if (sep != NULL)



CVS commit: src

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:52:15 UTC 2021

Modified Files:
src/sys/arch/x86/include: cacheinfo.h
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Load Only TLB and Store Only TLB.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/cacheinfo.h
cvs rdiff -u -r1.119 -r1.120 src/usr.sbin/cpuctl/arch/i386.c

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



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:47:15 UTC 2021

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

Log Message:
Fix a bug that some TLB related lines were not printed.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.118 src/usr.sbin/cpuctl/arch/i386.c:1.119
--- src/usr.sbin/cpuctl/arch/i386.c:1.118	Mon Sep 27 16:22:58 2021
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Sep 27 16:47:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.118 2021/09/27 16:22:58 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.118 2021/09/27 16:22:58 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.119 2021/09/27 16:47:15 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -2421,7 +2421,7 @@ print_tlb_config(struct cpu_info *ci, in
 		aprint_verbose_dev(ci->ci_dev, "");
 	else
 		aprint_verbose("%s", sep);
-	if (name != NULL)
+	if ((name != NULL) && (sep == NULL))
 		aprint_verbose("%s ", name);
 
 	if (cai->cai_string != NULL) {
@@ -2477,61 +2477,48 @@ x86_print_cache_and_tlb_info(struct cpu_
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
-	if (ci->ci_cinfo[CAI_ITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_ITLB, "ITLB:", NULL);
-		sep = print_tlb_config(ci, CAI_ITLB2, NULL, sep);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_DTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_DTLB, "DTLB:", NULL);
-		sep = print_tlb_config(ci, CAI_DTLB2, NULL, sep);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L2_ITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB:", NULL);
-		sep = print_tlb_config(ci, CAI_L2_ITLB2, NULL, sep);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L2_DTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_DTLB, "L2 DTLB:", NULL);
-		sep = print_tlb_config(ci, CAI_L2_DTLB2, NULL, sep);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L2_STLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_STLB, "L2 STLB:", NULL);
-		sep = print_tlb_config(ci, CAI_L2_STLB2, NULL, sep);
-		sep = print_tlb_config(ci, CAI_L2_STLB3, NULL, sep);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L1_1GBITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L1_1GBITLB, "L1 1GB page ITLB:",
-		NULL);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L1_1GBDTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L1_1GBDTLB, "L1 1GB page DTLB:",
-		NULL);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L2_1GBITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_1GBITLB, "L2 1GB page ITLB:",
-		NULL);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
-	if (ci->ci_cinfo[CAI_L2_1GBDTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_1GBDTLB, "L2 1GB page DTLB:",
-		NULL);
-		if (sep != NULL)
-			aprint_verbose("\n");
-	}
+
+	sep = print_tlb_config(ci, CAI_ITLB, "ITLB:", NULL);
+	sep = print_tlb_config(ci, CAI_ITLB2, "ITLB:", sep);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_DTLB, "DTLB:", NULL);
+	sep = print_tlb_config(ci, CAI_DTLB2, "DTLB:", sep);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB:", NULL);
+	sep = print_tlb_config(ci, CAI_L2_ITLB2, "L2 ITLB:", sep);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L2_DTLB, "L2 DTLB:", NULL);
+	sep = print_tlb_config(ci, CAI_L2_DTLB2, "L2 DTLB:", sep);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L2_STLB, "L2 STLB:", NULL);
+	sep = print_tlb_config(ci, CAI_L2_STLB2, "L2 STLB:", sep);
+	sep = print_tlb_config(ci, CAI_L2_STLB3, "L2 STLB:", sep);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L1_1GBITLB, "L1 1GB page ITLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L1_1GBDTLB, "L1 1GB page DTLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L2_1GBITLB, "L2 1GB page ITLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
+
+	sep = print_tlb_config(ci, CAI_L2_1GBDTLB, "L2 1GB page DTLB:", NULL);
+	if (sep != NULL)
+		aprint_verbose("\n");
 }
 
 static void



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:47:15 UTC 2021

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

Log Message:
Fix a bug that some TLB related lines were not printed.


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

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



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:22:58 UTC 2021

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

Log Message:
Add ':' for readability.


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

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



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

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 16:22:58 UTC 2021

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

Log Message:
Add ':' for readability.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.117 src/usr.sbin/cpuctl/arch/i386.c:1.118
--- src/usr.sbin/cpuctl/arch/i386.c:1.117	Mon Jul 12 12:56:52 2021
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Sep 27 16:22:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.117 2021/07/12 12:56:52 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.118 2021/09/27 16:22:58 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.117 2021/07/12 12:56:52 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.118 2021/09/27 16:22:58 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -2456,18 +2456,18 @@ x86_print_cache_and_tlb_info(struct cpu_
 
 	if (ci->ci_cinfo[CAI_ICACHE].cai_totalsize != 0 ||
 	ci->ci_cinfo[CAI_DCACHE].cai_totalsize != 0) {
-		sep = print_cache_config(ci, CAI_ICACHE, "I-cache", NULL);
-		sep = print_cache_config(ci, CAI_DCACHE, "D-cache", sep);
+		sep = print_cache_config(ci, CAI_ICACHE, "I-cache:", NULL);
+		sep = print_cache_config(ci, CAI_DCACHE, "D-cache:", sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2CACHE].cai_totalsize != 0) {
-		sep = print_cache_config(ci, CAI_L2CACHE, "L2 cache", NULL);
+		sep = print_cache_config(ci, CAI_L2CACHE, "L2 cache:", NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L3CACHE].cai_totalsize != 0) {
-		sep = print_cache_config(ci, CAI_L3CACHE, "L3 cache", NULL);
+		sep = print_cache_config(ci, CAI_L3CACHE, "L3 cache:", NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
@@ -2478,56 +2478,56 @@ x86_print_cache_and_tlb_info(struct cpu_
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_ITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_ITLB, "ITLB", NULL);
+		sep = print_tlb_config(ci, CAI_ITLB, "ITLB:", NULL);
 		sep = print_tlb_config(ci, CAI_ITLB2, NULL, sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_DTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_DTLB, "DTLB", NULL);
+		sep = print_tlb_config(ci, CAI_DTLB, "DTLB:", NULL);
 		sep = print_tlb_config(ci, CAI_DTLB2, NULL, sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2_ITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB", NULL);
+		sep = print_tlb_config(ci, CAI_L2_ITLB, "L2 ITLB:", NULL);
 		sep = print_tlb_config(ci, CAI_L2_ITLB2, NULL, sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2_DTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_DTLB, "L2 DTLB", NULL);
+		sep = print_tlb_config(ci, CAI_L2_DTLB, "L2 DTLB:", NULL);
 		sep = print_tlb_config(ci, CAI_L2_DTLB2, NULL, sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2_STLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_STLB, "L2 STLB", NULL);
+		sep = print_tlb_config(ci, CAI_L2_STLB, "L2 STLB:", NULL);
 		sep = print_tlb_config(ci, CAI_L2_STLB2, NULL, sep);
 		sep = print_tlb_config(ci, CAI_L2_STLB3, NULL, sep);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L1_1GBITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L1_1GBITLB, "L1 1GB page ITLB",
+		sep = print_tlb_config(ci, CAI_L1_1GBITLB, "L1 1GB page ITLB:",
 		NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L1_1GBDTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L1_1GBDTLB, "L1 1GB page DTLB",
+		sep = print_tlb_config(ci, CAI_L1_1GBDTLB, "L1 1GB page DTLB:",
 		NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2_1GBITLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_1GBITLB, "L2 1GB page ITLB",
+		sep = print_tlb_config(ci, CAI_L2_1GBITLB, "L2 1GB page ITLB:",
 		NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");
 	}
 	if (ci->ci_cinfo[CAI_L2_1GBDTLB].cai_totalsize != 0) {
-		sep = print_tlb_config(ci, CAI_L2_1GBDTLB, "L2 1GB page DTLB",
+		sep = print_tlb_config(ci, CAI_L2_1GBDTLB, "L2 1GB page DTLB:",
 		NULL);
 		if (sep != NULL)
 			aprint_verbose("\n");



CVS commit: src/doc

2021-09-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep 27 11:13:12 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
openssh 8.8 is out


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1815 src/doc/3RDPARTY:1.1816
--- src/doc/3RDPARTY:1.1815	Fri Sep 24 15:48:35 2021
+++ src/doc/3RDPARTY	Mon Sep 27 11:13:12 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1815 2021/09/24 15:48:35 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1816 2021/09/27 11:13:12 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1071,7 +1071,7 @@ Patch applied after OpenSSH import.
 
 Package:	OpenSSH
 Version:	8.7
-Current Vers:	8.7 / portable 8.7p1
+Current Vers:	8.8 / portable 8.8p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html



CVS commit: src/doc

2021-09-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep 27 11:13:12 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
openssh 8.8 is out


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

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



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Mon Sep 27 11:05:50 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: readconf.c

Log Message:
OpenSSH: Restore ChallengeResponseAuthentication as an alias

OpenSSH 8.7 has deprecated ChallengeResponseAuthentication, but not removed
it. It is now an alias for KbdInteractiveAuthentication (as are the prior
aliases of ChallengeResponseAuthentication).

I think this chunk was accidentally dropped in the OpenSSH 8.7 merge.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/crypto/external/bsd/openssh/dist/readconf.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/readconf.c
diff -u src/crypto/external/bsd/openssh/dist/readconf.c:1.35 src/crypto/external/bsd/openssh/dist/readconf.c:1.36
--- src/crypto/external/bsd/openssh/dist/readconf.c:1.35	Thu Sep  2 11:26:18 2021
+++ src/crypto/external/bsd/openssh/dist/readconf.c	Mon Sep 27 11:05:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readconf.c,v 1.35 2021/09/02 11:26:18 christos Exp $	*/
+/*	$NetBSD: readconf.c,v 1.36 2021/09/27 11:05:50 kim Exp $	*/
 /* $OpenBSD: readconf.c,v 1.361 2021/07/23 04:04:52 djm Exp $ */
 
 /*
@@ -15,7 +15,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: readconf.c,v 1.35 2021/09/02 11:26:18 christos Exp $");
+__RCSID("$NetBSD: readconf.c,v 1.36 2021/09/27 11:05:50 kim Exp $");
 #include 
 #include 
 #include 
@@ -248,6 +248,9 @@ static struct {
 	{ "passwordauthentication", oPasswordAuthentication },
 	{ "kbdinteractiveauthentication", oKbdInteractiveAuthentication },
 	{ "kbdinteractivedevices", oKbdInteractiveDevices },
+	{ "challengeresponseauthentication", oKbdInteractiveAuthentication }, /* alias */
+	{ "skeyauthentication", oKbdInteractiveAuthentication }, /* alias */
+	{ "tisauthentication", oKbdInteractiveAuthentication },  /* alias */
 	{ "pubkeyauthentication", oPubkeyAuthentication },
 	{ "dsaauthentication", oPubkeyAuthentication },		/* alias */
 	{ "hostbasedauthentication", oHostbasedAuthentication },



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-27 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Mon Sep 27 11:05:50 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: readconf.c

Log Message:
OpenSSH: Restore ChallengeResponseAuthentication as an alias

OpenSSH 8.7 has deprecated ChallengeResponseAuthentication, but not removed
it. It is now an alias for KbdInteractiveAuthentication (as are the prior
aliases of ChallengeResponseAuthentication).

I think this chunk was accidentally dropped in the OpenSSH 8.7 merge.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/crypto/external/bsd/openssh/dist/readconf.c

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



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

2021-09-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 27 09:54:52 UTC 2021

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

Log Message:
No longer need to call arm_pmu_init on all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/fdt/pmu_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/pmu_fdt.c
diff -u src/sys/arch/arm/fdt/pmu_fdt.c:1.8 src/sys/arch/arm/fdt/pmu_fdt.c:1.9
--- src/sys/arch/arm/fdt/pmu_fdt.c:1.8	Wed Jan 27 03:10:19 2021
+++ src/sys/arch/arm/fdt/pmu_fdt.c	Mon Sep 27 09:54:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
+/* $NetBSD: pmu_fdt.c,v 1.9 2021/09/27 09:54:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.9 2021/09/27 09:54:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -113,19 +113,12 @@ pmu_fdt_attach(device_t parent, device_t
 }
 
 static void
-pmu_fdt_init_cpu(void *arg1, void *arg2)
-{
-	arm_pmu_init();
-}
-
-static void
 pmu_fdt_init(device_t self)
 {
 	struct pmu_fdt_softc * const sc = device_private(self);
 	const int phandle = sc->sc_phandle;
 	char intrstr[128];
 	int error, n;
-	uint64_t xc;
 	void **ih;
 
 	if (pmu_fdt_uses_ppi && pmu_fdt_count > 0) {
@@ -140,8 +133,7 @@ pmu_fdt_init(device_t self)
 	}
 
 	if (pmu_fdt_count == 0) {
-		xc = xc_broadcast(0, pmu_fdt_init_cpu, NULL, NULL);
-		xc_wait(xc);
+		arm_pmu_init();
 	}
 
 	ih = kmem_zalloc(sizeof(void *) * ncpu, KM_SLEEP);



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

2021-09-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 27 09:54:52 UTC 2021

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

Log Message:
No longer need to call arm_pmu_init on all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/fdt/pmu_fdt.c

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



CVS commit: src/sys/net

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 07:13:30 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior in pppasyncstart().

Reported-by: syzbot+7c8c7977e2756ac13...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/net/ppp_tty.c

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

Modified files:

Index: src/sys/net/ppp_tty.c
diff -u src/sys/net/ppp_tty.c:1.67 src/sys/net/ppp_tty.c:1.68
--- src/sys/net/ppp_tty.c:1.67	Wed Jan 29 04:28:27 2020
+++ src/sys/net/ppp_tty.c	Mon Sep 27 07:13:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppp_tty.c,v 1.67 2020/01/29 04:28:27 thorpej Exp $	*/
+/*	$NetBSD: ppp_tty.c,v 1.68 2021/09/27 07:13:30 msaitoh Exp $	*/
 /*	Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp 	*/
 
 /*
@@ -93,7 +93,7 @@
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.67 2020/01/29 04:28:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.68 2021/09/27 07:13:30 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "ppp.h"
@@ -168,7 +168,7 @@ static void	pppdumpframe(struct ppp_soft
 /*
  * Does c need to be escaped?
  */
-#define ESCAPE_P(c)	(sc->sc_asyncmap[(c) >> 5] & (1 << ((c) & 0x1F)))
+#define ESCAPE_P(c)	(sc->sc_asyncmap[(c) >> 5] & (1U << ((c) & 0x1F)))
 
 /*
  * Procedures for using an async tty interface for PPP.



CVS commit: src/sys/net

2021-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep 27 07:13:30 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior in pppasyncstart().

Reported-by: syzbot+7c8c7977e2756ac13...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/net/ppp_tty.c

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