CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:56:17 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: merge duplicate code in parsing conditions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/usr.bin/make/cond.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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.288 src/usr.bin/make/cond.c:1.289
--- src/usr.bin/make/cond.c:1.288	Fri Dec 10 23:33:05 2021
+++ src/usr.bin/make/cond.c	Fri Dec 10 23:56:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.288 2021/12/10 23:33:05 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.289 2021/12/10 23:56:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.288 2021/12/10 23:33:05 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.289 2021/12/10 23:56:17 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -198,16 +198,6 @@ ToToken(bool cond)
 	return cond ? TOK_TRUE : TOK_FALSE;
 }
 
-/* Push back the most recent token read. We only need one level of this. */
-static void
-CondParser_PushBack(CondParser *par, Token t)
-{
-	assert(par->curr == TOK_NONE);
-	assert(t != TOK_NONE);
-
-	par->curr = t;
-}
-
 static void
 CondParser_SkipWhitespace(CondParser *par)
 {
@@ -933,6 +923,22 @@ CondParser_Token(CondParser *par, bool d
 	}
 }
 
+/* Skip the next token if it equals t. */
+static bool
+CondParser_Skip(CondParser *par, Token t)
+{
+	Token actual;
+
+	actual = CondParser_Token(par, false);
+	if (actual == t)
+		return true;
+
+	assert(par->curr == TOK_NONE);
+	assert(actual != TOK_NONE);
+	par->curr = actual;
+	return false;
+}
+
 /*
  * Term -> '(' Or ')'
  * Term -> '!' Term
@@ -979,7 +985,6 @@ static CondResult
 CondParser_And(CondParser *par, bool doEval)
 {
 	CondResult res, rhs;
-	Token op;
 
 	res = CR_TRUE;
 	do {
@@ -989,9 +994,8 @@ CondParser_And(CondParser *par, bool doE
 			res = CR_FALSE;
 			doEval = false;
 		}
-	} while ((op = CondParser_Token(par, false)) == TOK_AND);
+	} while (CondParser_Skip(par, TOK_AND));
 
-	CondParser_PushBack(par, op);
 	return res;
 }
 
@@ -1002,7 +1006,6 @@ static CondResult
 CondParser_Or(CondParser *par, bool doEval)
 {
 	CondResult res, rhs;
-	Token op;
 
 	res = CR_FALSE;
 	do {
@@ -1012,9 +1015,8 @@ CondParser_Or(CondParser *par, bool doEv
 			res = CR_TRUE;
 			doEval = false;
 		}
-	} while ((op = CondParser_Token(par, false)) == TOK_OR);
+	} while (CondParser_Skip(par, TOK_OR));
 
-	CondParser_PushBack(par, op);
 	return res;
 }
 



CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:56:17 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: merge duplicate code in parsing conditions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/usr.bin/make/cond.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/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:33:05 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: remove recursion from CondParser_And

No functional change intended.  Before cond.c 1.286 from today, there
would have been the functional change that in malformed conditions, the
extra expression would not be evaluated.  Now that CondParser_Token is
always called with doEval == false, there is no change in behavior to be
expected.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/usr.bin/make/cond.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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.287 src/usr.bin/make/cond.c:1.288
--- src/usr.bin/make/cond.c:1.287	Fri Dec 10 23:19:59 2021
+++ src/usr.bin/make/cond.c	Fri Dec 10 23:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.287 2021/12/10 23:19:59 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.288 2021/12/10 23:33:05 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,13 +95,12 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.287 2021/12/10 23:19:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.288 2021/12/10 23:33:05 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
  *	Or -> And ('||' And)*
- *	And -> Term
- *	And -> And '&&' Term
+ *	And -> Term ('&&' Term)*
  *	Term -> Function '(' Argument ')'
  *	Term -> Leaf Operator Leaf
  *	Term -> Leaf
@@ -974,27 +973,23 @@ CondParser_Term(CondParser *par, bool do
 }
 
 /*
- * And -> Term
- * And -> And '&&' Term
+ * And -> Term ('&&' Term)*
  */
 static CondResult
 CondParser_And(CondParser *par, bool doEval)
 {
-	CondResult res;
+	CondResult res, rhs;
 	Token op;
 
-	res = CondParser_Term(par, doEval);
-	if (res == CR_ERROR)
-		return CR_ERROR;
-
-	op = CondParser_Token(par, false);
-	if (op == TOK_AND) {
-		if (res == CR_TRUE)
-			return CondParser_And(par, doEval);
-		if (CondParser_And(par, false) == CR_ERROR)
+	res = CR_TRUE;
+	do {
+		if ((rhs = CondParser_Term(par, doEval)) == CR_ERROR)
 			return CR_ERROR;
-		return res;
-	}
+		if (rhs == CR_FALSE) {
+			res = CR_FALSE;
+			doEval = false;
+		}
+	} while ((op = CondParser_Token(par, false)) == TOK_AND);
 
 	CondParser_PushBack(par, op);
 	return res;



CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:33:05 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: remove recursion from CondParser_And

No functional change intended.  Before cond.c 1.286 from today, there
would have been the functional change that in malformed conditions, the
extra expression would not be evaluated.  Now that CondParser_Token is
always called with doEval == false, there is no change in behavior to be
expected.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/usr.bin/make/cond.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/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:19:59 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: do not expand operator token in CondParser_Or

At the point where CondParser_Or calls CondParser_Token, there was a
previous call to CondParser_And.  Due to this, the next token is already
stored in par->curr, and the parameter doEval is ignored.

Changing the argument from doEval to false makes the code similar to the
corresponding code in CondParser_And.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/usr.bin/make/cond.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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.286 src/usr.bin/make/cond.c:1.287
--- src/usr.bin/make/cond.c:1.286	Fri Dec 10 23:12:44 2021
+++ src/usr.bin/make/cond.c	Fri Dec 10 23:19:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.286 2021/12/10 23:12:44 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.287 2021/12/10 23:19:59 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.286 2021/12/10 23:12:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.287 2021/12/10 23:19:59 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -1017,7 +1017,7 @@ CondParser_Or(CondParser *par, bool doEv
 			res = CR_TRUE;
 			doEval = false;
 		}
-	} while ((op = CondParser_Token(par, doEval)) == TOK_OR);
+	} while ((op = CondParser_Token(par, false)) == TOK_OR);
 
 	CondParser_PushBack(par, op);
 	return res;



CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:19:59 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: do not expand operator token in CondParser_Or

At the point where CondParser_Or calls CondParser_Token, there was a
previous call to CondParser_And.  Due to this, the next token is already
stored in par->curr, and the parameter doEval is ignored.

Changing the argument from doEval to false makes the code similar to the
corresponding code in CondParser_And.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/usr.bin/make/cond.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/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:12:44 UTC 2021

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: cond-eof.exp cond-eof.mk cond-op.exp
cond-op.mk

Log Message:
make: do not evaluate misplaced expressions in malformed conditions

This change only affects the behavior for parse errors.  Syntactically
well-formed conditions work exactly as before.


To generate a diff of this commit:
cvs rdiff -u -r1.285 -r1.286 src/usr.bin/make/cond.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-eof.exp \
src/usr.bin/make/unit-tests/cond-eof.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-op.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/cond-op.mk

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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.285 src/usr.bin/make/cond.c:1.286
--- src/usr.bin/make/cond.c:1.285	Fri Dec 10 19:47:20 2021
+++ src/usr.bin/make/cond.c	Fri Dec 10 23:12:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.285 2021/12/10 19:47:20 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.286 2021/12/10 23:12:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.285 2021/12/10 19:47:20 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.286 2021/12/10 23:12:44 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -987,7 +987,7 @@ CondParser_And(CondParser *par, bool doE
 	if (res == CR_ERROR)
 		return CR_ERROR;
 
-	op = CondParser_Token(par, doEval);
+	op = CondParser_Token(par, false);
 	if (op == TOK_AND) {
 		if (res == CR_TRUE)
 			return CondParser_And(par, doEval);

Index: src/usr.bin/make/unit-tests/cond-eof.exp
diff -u src/usr.bin/make/unit-tests/cond-eof.exp:1.2 src/usr.bin/make/unit-tests/cond-eof.exp:1.3
--- src/usr.bin/make/unit-tests/cond-eof.exp:1.2	Mon Dec 14 20:28:09 2020
+++ src/usr.bin/make/unit-tests/cond-eof.exp	Fri Dec 10 23:12:44 2021
@@ -1,8 +1,5 @@
-side effect
 make: "cond-eof.mk" line 15: Malformed conditional (0 ${SIDE_EFFECT} ${SIDE_EFFECT2})
-side effect
 make: "cond-eof.mk" line 17: Malformed conditional (1 ${SIDE_EFFECT} ${SIDE_EFFECT2})
-side effect
 make: "cond-eof.mk" line 19: Malformed conditional ((0) ${SIDE_EFFECT} ${SIDE_EFFECT2})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/cond-eof.mk
diff -u src/usr.bin/make/unit-tests/cond-eof.mk:1.2 src/usr.bin/make/unit-tests/cond-eof.mk:1.3
--- src/usr.bin/make/unit-tests/cond-eof.mk:1.2	Mon Dec 14 20:28:09 2020
+++ src/usr.bin/make/unit-tests/cond-eof.mk	Fri Dec 10 23:12:44 2021
@@ -1,4 +1,4 @@
-# $NetBSD: cond-eof.mk,v 1.2 2020/12/14 20:28:09 rillig Exp $
+# $NetBSD: cond-eof.mk,v 1.3 2021/12/10 23:12:44 rillig Exp $
 #
 # Tests for parsing conditions, especially the end of such conditions, which
 # are represented as the token TOK_EOF.
@@ -7,11 +7,11 @@ SIDE_EFFECT=	${:!echo 'side effect' 1>&2
 SIDE_EFFECT2=	${:!echo 'side effect 2' 1>&2!}
 
 # In the following conditions, ${SIDE_EFFECT} is the position of the first
-# parse error.  It is always fully evaluated, even if it were not necessary
-# to expand the variable expression.  This is because these syntax errors are
-# an edge case that does not occur during normal operation, therefore there
-# is no need to optimize for this case, and it would slow down the common
-# case as well.
+# parse error.  Before cond.c 1.286 from 2021-12-10, it was always fully
+# evaluated, even if it was not necessary to expand the variable expression.
+# These syntax errors are an edge case that does not occur during normal
+# operation.  Still, it is easy to avoid evaluating these expressions, just in
+# case they have side effects.
 .if 0 ${SIDE_EFFECT} ${SIDE_EFFECT2}
 .endif
 .if 1 ${SIDE_EFFECT} ${SIDE_EFFECT2}

Index: src/usr.bin/make/unit-tests/cond-op.exp
diff -u src/usr.bin/make/unit-tests/cond-op.exp:1.10 src/usr.bin/make/unit-tests/cond-op.exp:1.11
--- src/usr.bin/make/unit-tests/cond-op.exp:1.10	Fri Dec 10 20:22:54 2021
+++ src/usr.bin/make/unit-tests/cond-op.exp	Fri Dec 10 23:12:44 2021
@@ -1,8 +1,8 @@
 make: "cond-op.mk" line 50: Malformed conditional ("!word" == !word)
 make: "cond-op.mk" line 76: Malformed conditional (0 ${ERR::=evaluated})
-make: "cond-op.mk" line 80: After detecting a parse error after 0, the rest is evaluated.
+make: "cond-op.mk" line 80: A misplaced expression after 0 is not evaluated.
 make: "cond-op.mk" line 84: Malformed conditional (1 ${ERR::=evaluated})
-make: "cond-op.mk" line 88: After detecting a parse error after 1, the rest is evaluated.
+make: "cond-op.mk" line 88: A misplaced expression after 1 is not evaluated.
 make: "cond-op.mk" line 92: Parsing continues until here.

CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 23:12:44 UTC 2021

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: cond-eof.exp cond-eof.mk cond-op.exp
cond-op.mk

Log Message:
make: do not evaluate misplaced expressions in malformed conditions

This change only affects the behavior for parse errors.  Syntactically
well-formed conditions work exactly as before.


To generate a diff of this commit:
cvs rdiff -u -r1.285 -r1.286 src/usr.bin/make/cond.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-eof.exp \
src/usr.bin/make/unit-tests/cond-eof.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-op.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/cond-op.mk

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 21:57:13 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
break down large, unaligned copies into chunks that CG14Copy8_short_*()
can handle, make sure destinations are aligned whenever possible
now we only fall back to byte-wise access for really small copies, which
we probably shouldn't bother throwing at SX in the first place


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.24 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.25
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.24	Fri Dec 10 19:42:07 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Dec 10 21:57:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.24 2021/12/10 19:42:07 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.25 2021/12/10 21:57:13 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -674,8 +674,6 @@ CG14Copy8(PixmapPtr pDstPixmap,
 	 * go backwards on SX so avoid as much as possible
 	 */
 	if ((p->xdir < 0) && (srcoff == dstoff) && (srcY == dstY)) {
-		srcstart += (w - 32);
-		dststart += (w - 32);
 		xinc = -32;
 	} else
 		xinc = 32;
@@ -695,6 +693,70 @@ CG14Copy8(PixmapPtr pDstPixmap,
 		return;
 	}
 
+	/*
+	 * if we make it here we either have something large and unaligned,
+	 * something we need to do right to left, or something tiny.
+	 * we handle the non-tiny cases by breaking them down into chunks that
+	 * Copy8_short_*() can handle, making sure the destinations are 32bit 
+	 * aligned whenever possible
+	 * since we copy by block, not by line we need to go backwards even if
+	 * we don't copy within the same line
+	 */
+	if (w > 8) {
+		int next, wi, end = dststart + w;
+		DPRINTF(X_ERROR, "%s %08x %08x %d\n", __func__, srcstart, dststart, w);
+		if ((p->xdir < 0) && (srcoff == dstoff)) {		
+			srcstart += w;
+			next = max((end - 120) & ~3, dststart);
+			wi = end - next;
+			srcstart -= wi;
+			while (wi > 0) {
+DPRINTF(X_ERROR, "%s RL %08x %08x %d\n", __func__, srcstart, next, wi);
+if (p->last_rop == 0xcc) {
+	CG14Copy8_short_norop(p, srcstart, next, wi, h, srcinc, dstinc);
+} else
+	CG14Copy8_short_rop(p, srcstart, next, wi, h, srcinc, dstinc);
+end = next;
+/*
+ * avoid extremely narrow copies so I don't
+ * have to deal with dangling start and end
+ * pixels in the same word
+ */
+if ((end - dststart) < 140) {
+	next = max((end - 80) & ~3, dststart);
+} else {
+	next = max((end - 120) & ~3, dststart);
+}
+wi = end - next;
+srcstart -= wi;
+			}
+		} else {
+			next = min(end, (dststart + 124) & ~3);
+			wi = next - dststart;
+			while (wi > 0) {
+DPRINTF(X_ERROR, "%s LR %08x %08x %d\n", __func__, srcstart, next, wi);
+if (p->last_rop == 0xcc) {
+	CG14Copy8_short_norop(p, srcstart, dststart, wi, h, srcinc, dstinc);
+} else
+	CG14Copy8_short_rop(p, srcstart, dststart, wi, h, srcinc, dstinc);
+srcstart += wi;
+dststart = next;
+if ((end - dststart) < 140) {
+	next = min(end, (dststart + 84) & ~3);
+} else {
+	next = min(end, (dststart + 124) & ~3);
+}
+wi = next - dststart;
+			}
+		}
+		return;
+	}
+	if (xinc < 0) {
+		srcstart += (w - 32);
+		dststart += (w - 32);
+	}
+
+	DPRINTF(X_ERROR, "%s fallback to byte-wise %d %d\n", __func__, w, h);
 	if (p->last_rop == 0xcc) {
 		/* plain old copy */
 		if ( xinc > 0) {



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 21:57:13 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
break down large, unaligned copies into chunks that CG14Copy8_short_*()
can handle, make sure destinations are aligned whenever possible
now we only fall back to byte-wise access for really small copies, which
we probably shouldn't bother throwing at SX in the first place


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: src

2021-12-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Dec 10 20:36:05 UTC 2021

Modified Files:
src/lib/libc/db/man: dbm_clearerr.3
src/lib/libc/gen: wordexp.3
src/lib/libc/sys: send.2
src/lib/libterminfo: term.h
src/libexec/httpd: bozohttpd.c
src/sys/arch/aarch64/aarch64: locore.S pmap.c
src/sys/arch/arm/xscale: ixp425_qmgr.c
src/sys/arch/ews4800mips/sbd: kbms_sbdio.c
src/sys/arch/luna68k/stand/boot: sc.c
src/sys/arch/mips/ingenic: ingenic_regs.h
src/sys/arch/sparc/dev: sxreg.h
src/sys/arch/sparc64/dev: psmreg.h
src/sys/arch/xen/xen: privcmd.c
src/sys/compat/common: compat_50_mod.c
src/sys/dev/audio: audio.c
src/sys/dev/hil: hil.c
src/sys/dev/ic: aacreg.h sl811hs.c
src/sys/dev/marvell: mvxpsec.c
src/sys/dev/pci: twa.c
src/sys/dev/pci/cxgb: cxgb_t3_hw.c
src/sys/dev/raidframe: rf_reconstruct.h
src/sys/fs/efs: efs_subr.c
src/sys/kern: subr_interrupt.c sys_select.c
src/sys/netinet: dccp_tfrc.c sctp_pcb.c
src/sys/sys: timex.h
src/sys/ufs/chfs: chfs_readinode.c
src/tests/dev/audio: audiotest.c
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
s/occured/occurred/ in comments, log messages and man pages.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/db/man/dbm_clearerr.3
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/wordexp.3
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/send.2
cvs rdiff -u -r1.24 -r1.25 src/lib/libterminfo/term.h
cvs rdiff -u -r1.136 -r1.137 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/ixp425_qmgr.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/luna68k/stand/boot/sc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/ingenic/ingenic_regs.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sparc/dev/sxreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/dev/psmreg.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/privcmd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_mod.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hil/hil.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/aacreg.h
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/marvell/mvxpsec.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/twa.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/cxgb/cxgb_t3_hw.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/raidframe/rf_reconstruct.h
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/efs/efs_subr.c
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_interrupt.c
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/sys_select.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netinet/dccp_tfrc.c
cvs rdiff -u -r1.22 -r1.23 src/sys/netinet/sctp_pcb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/timex.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ufs/chfs/chfs_readinode.c
cvs rdiff -u -r1.17 -r1.18 src/tests/dev/audio/audiotest.c
cvs rdiff -u -r1.45 -r1.46 src/tests/lib/libc/gen/t_siginfo.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/db/man/dbm_clearerr.3
diff -u src/lib/libc/db/man/dbm_clearerr.3:1.6 src/lib/libc/db/man/dbm_clearerr.3:1.7
--- src/lib/libc/db/man/dbm_clearerr.3:1.6	Sun May 26 06:18:13 2019
+++ src/lib/libc/db/man/dbm_clearerr.3	Fri Dec 10 20:36:02 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dbm_clearerr.3,v 1.6 2019/05/26 06:18:13 abhinav Exp $
+.\"	$NetBSD: dbm_clearerr.3,v 1.7 2021/12/10 20:36:02 andvar Exp $
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -236,7 +236,7 @@ function returns a content
 .Fa datum ;
 if no record matching
 .Fa key
-was found or if an error occured, its
+was found or if an error occurred, its
 .Fa dptr
 member is a null pointer.
 .Pp
@@ -263,7 +263,7 @@ and
 .Fn dbm_nextkey
 functions return a key
 .Fa datum .
-When the end of the database is reached or if an error occured, its
+When the end of the database is reached or if an error occurred, its
 .Fa dptr
 member is a null pointer.
 .Pp

Index: src/lib/libc/gen/wordexp.3
diff -u src/lib/libc/gen/wordexp.3:1.3 src/lib/libc/gen/wordexp.3:1.4
--- src/lib/libc/gen/wordexp.3:1.3	Mon Jul  3 21:32:49 2017
+++ src/lib/libc/gen/wordexp.3	Fri Dec 10 20:36:02 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wordexp.3,v 1.3 2017/07/03 21:32:49 wiz Exp $
+.\"	$NetBSD: wordexp.3,v 1.4 2021/12/10 20:36:02 andvar Exp $
 .\"
 .\" Copyright (c) 2002 Tim J. Robbins
 .\" All rights reserved.
@@ -163,7 +163,7 @@ Not enough memory to store the result.
 Shell syntax error in
 .Fa words .
 .It Dv WRDE_ERRNO
-An internal error occured and
+An internal error occurred and
 .Va errno
 is set to indicate the error.
 .El

Index: 

CVS commit: src

2021-12-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Dec 10 20:36:05 UTC 2021

Modified Files:
src/lib/libc/db/man: dbm_clearerr.3
src/lib/libc/gen: wordexp.3
src/lib/libc/sys: send.2
src/lib/libterminfo: term.h
src/libexec/httpd: bozohttpd.c
src/sys/arch/aarch64/aarch64: locore.S pmap.c
src/sys/arch/arm/xscale: ixp425_qmgr.c
src/sys/arch/ews4800mips/sbd: kbms_sbdio.c
src/sys/arch/luna68k/stand/boot: sc.c
src/sys/arch/mips/ingenic: ingenic_regs.h
src/sys/arch/sparc/dev: sxreg.h
src/sys/arch/sparc64/dev: psmreg.h
src/sys/arch/xen/xen: privcmd.c
src/sys/compat/common: compat_50_mod.c
src/sys/dev/audio: audio.c
src/sys/dev/hil: hil.c
src/sys/dev/ic: aacreg.h sl811hs.c
src/sys/dev/marvell: mvxpsec.c
src/sys/dev/pci: twa.c
src/sys/dev/pci/cxgb: cxgb_t3_hw.c
src/sys/dev/raidframe: rf_reconstruct.h
src/sys/fs/efs: efs_subr.c
src/sys/kern: subr_interrupt.c sys_select.c
src/sys/netinet: dccp_tfrc.c sctp_pcb.c
src/sys/sys: timex.h
src/sys/ufs/chfs: chfs_readinode.c
src/tests/dev/audio: audiotest.c
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
s/occured/occurred/ in comments, log messages and man pages.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/db/man/dbm_clearerr.3
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/wordexp.3
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/send.2
cvs rdiff -u -r1.24 -r1.25 src/lib/libterminfo/term.h
cvs rdiff -u -r1.136 -r1.137 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/xscale/ixp425_qmgr.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/luna68k/stand/boot/sc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/ingenic/ingenic_regs.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sparc/dev/sxreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/dev/psmreg.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/privcmd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_mod.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hil/hil.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/aacreg.h
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/marvell/mvxpsec.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/twa.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/cxgb/cxgb_t3_hw.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/raidframe/rf_reconstruct.h
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/efs/efs_subr.c
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_interrupt.c
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/sys_select.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netinet/dccp_tfrc.c
cvs rdiff -u -r1.22 -r1.23 src/sys/netinet/sctp_pcb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/timex.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ufs/chfs/chfs_readinode.c
cvs rdiff -u -r1.17 -r1.18 src/tests/dev/audio/audiotest.c
cvs rdiff -u -r1.45 -r1.46 src/tests/lib/libc/gen/t_siginfo.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/make/unit-tests

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 20:22:54 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: cond-op.exp cond-op.mk

Log Message:
tests/make: extend test for parse errors in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/cond-op.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/cond-op.mk

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



CVS commit: src/usr.bin/make/unit-tests

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 20:22:54 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: cond-op.exp cond-op.mk

Log Message:
tests/make: extend test for parse errors in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/cond-op.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/cond-op.mk

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/make/unit-tests/cond-op.exp
diff -u src/usr.bin/make/unit-tests/cond-op.exp:1.9 src/usr.bin/make/unit-tests/cond-op.exp:1.10
--- src/usr.bin/make/unit-tests/cond-op.exp:1.9	Tue Jan 19 18:13:37 2021
+++ src/usr.bin/make/unit-tests/cond-op.exp	Fri Dec 10 20:22:54 2021
@@ -1,20 +1,22 @@
 make: "cond-op.mk" line 50: Malformed conditional ("!word" == !word)
-make: "cond-op.mk" line 75: Malformed conditional (0 ${ERR::=evaluated})
-make: "cond-op.mk" line 79: After detecting a parse error, the rest is evaluated.
-make: "cond-op.mk" line 83: Parsing continues until here.
-make: "cond-op.mk" line 86: A B C   =>   (A || B) && C   A || B && C   A || (B && C)
-make: "cond-op.mk" line 93: 0 0 0   =>   0   0 0
-make: "cond-op.mk" line 93: 0 0 1   =>   0   0 0
-make: "cond-op.mk" line 93: 0 1 0   =>   0   0 0
-make: "cond-op.mk" line 93: 0 1 1   =>   1   1 1
-make: "cond-op.mk" line 93: 1 0 0   =>   0   1 1
-make: "cond-op.mk" line 93: 1 0 1   =>   1   1 1
-make: "cond-op.mk" line 93: 1 1 0   =>   0   1 1
-make: "cond-op.mk" line 93: 1 1 1   =>   1   1 1
-make: "cond-op.mk" line 104: Malformed conditional (1 &&)
-make: "cond-op.mk" line 112: Malformed conditional (0 &&)
-make: "cond-op.mk" line 120: Malformed conditional (1 ||)
-make: "cond-op.mk" line 129: Malformed conditional (0 ||)
+make: "cond-op.mk" line 76: Malformed conditional (0 ${ERR::=evaluated})
+make: "cond-op.mk" line 80: After detecting a parse error after 0, the rest is evaluated.
+make: "cond-op.mk" line 84: Malformed conditional (1 ${ERR::=evaluated})
+make: "cond-op.mk" line 88: After detecting a parse error after 1, the rest is evaluated.
+make: "cond-op.mk" line 92: Parsing continues until here.
+make: "cond-op.mk" line 95: A B C   =>   (A || B) && C   A || B && C   A || (B && C)
+make: "cond-op.mk" line 102: 0 0 0   =>   0   0 0
+make: "cond-op.mk" line 102: 0 0 1   =>   0   0 0
+make: "cond-op.mk" line 102: 0 1 0   =>   0   0 0
+make: "cond-op.mk" line 102: 0 1 1   =>   1   1 1
+make: "cond-op.mk" line 102: 1 0 0   =>   0   1 1
+make: "cond-op.mk" line 102: 1 0 1   =>   1   1 1
+make: "cond-op.mk" line 102: 1 1 0   =>   0   1 1
+make: "cond-op.mk" line 102: 1 1 1   =>   1   1 1
+make: "cond-op.mk" line 113: Malformed conditional (1 &&)
+make: "cond-op.mk" line 121: Malformed conditional (0 &&)
+make: "cond-op.mk" line 129: Malformed conditional (1 ||)
+make: "cond-op.mk" line 138: Malformed conditional (0 ||)
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-op.mk
diff -u src/usr.bin/make/unit-tests/cond-op.mk:1.13 src/usr.bin/make/unit-tests/cond-op.mk:1.14
--- src/usr.bin/make/unit-tests/cond-op.mk:1.13	Tue Jan 19 18:20:30 2021
+++ src/usr.bin/make/unit-tests/cond-op.mk	Fri Dec 10 20:22:54 2021
@@ -1,4 +1,4 @@
-# $NetBSD: cond-op.mk,v 1.13 2021/01/19 18:20:30 rillig Exp $
+# $NetBSD: cond-op.mk,v 1.14 2021/12/10 20:22:54 rillig Exp $
 #
 # Tests for operators like &&, ||, ! in .if conditions.
 #
@@ -72,11 +72,20 @@
 # This would add a good deal of complexity to the code though, for almost
 # no benefit, especially since most expressions and conditions are side
 # effect free.
+.undef ERR
 .if 0 ${ERR::=evaluated}
 .  error
 .endif
 .if ${ERR:Uundefined} == evaluated
-.  info After detecting a parse error, the rest is evaluated.
+.  info After detecting a parse error after 0, the rest is evaluated.
+.endif
+
+.undef ERR
+.if 1 ${ERR::=evaluated}
+.  error
+.endif
+.if ${ERR:Uundefined} == evaluated
+.  info After detecting a parse error after 1, the rest is evaluated.
 .endif
 
 # Just in case that parsing should ever stop on the first error.



CVS commit: src/usr.sbin/user

2021-12-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Dec 10 20:06:29 UTC 2021

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

Log Message:
useradd(8): Recognize Argon2 passwords as "valid" when they are given
on the command line.

Reported by Robert Nestor on current-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/usr.sbin/user/user.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/user/user.c
diff -u src/usr.sbin/user/user.c:1.133 src/usr.sbin/user/user.c:1.134
--- src/usr.sbin/user/user.c:1.133	Mon Jul 29 09:33:21 2019
+++ src/usr.sbin/user/user.c	Fri Dec 10 20:06:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.133 2019/07/29 09:33:21 wiz Exp $ */
+/* $NetBSD: user.c,v 1.134 2021/12/10 20:06:29 nia Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.133 2019/07/29 09:33:21 wiz Exp $");
+__RCSID("$NetBSD: user.c,v 1.134 2021/12/10 20:06:29 nia Exp $");
 #endif
 
 #include 
@@ -934,6 +934,9 @@ typedef struct passwd_type_t {
 } passwd_type_t;
 
 static passwd_type_t	passwd_types[] = {
+	{ "$argon2i",	8,	SIZE_MAX,	"\\$[^$]+\\$[^$]+\\$[^$]+\\$(.*)", 1 },	/* Argon2i */
+	{ "$argon2id",	9,	SIZE_MAX,	"\\$[^$]+\\$[^$]+\\$[^$]+\\$(.*)", 1 },	/* Argon2id */
+	{ "$argon2d",	8,	SIZE_MAX,	"\\$[^$]+\\$[^$]+\\$[^$]+\\$(.*)", 1 },	/* Argon2id */
 	{ "$sha1",	5,	28,	"\\$[^$]+\\$[^$]+\\$[^$]+\\$(.*)", 1 },	/* SHA1 */
 	{ "$2a",	3,	53,	"\\$[^$]+\\$[^$]+\\$(.*)",	1 },	/* Blowfish */
 	{ "$1",		2,	34,	NULL,0 },	/* MD5 */
@@ -953,14 +956,16 @@ valid_password_length(char *newpasswd)
 	for (pwtp = passwd_types; pwtp->desc_length != (size_t)~0; pwtp++) {
 		if (strncmp(newpasswd, pwtp->type, pwtp->desc_length) == 0) {
 			if (pwtp->regex == NULL) {
-return strlen(newpasswd) == pwtp->length;
+return pwtp->length == SIZE_MAX ||
+strlen(newpasswd) == pwtp->length;
 			}
 			(void)regcomp(, pwtp->regex, REG_EXTENDED);
 			if (regexec(, newpasswd, 10, matchv, 0) == 0) {
 regfree();
-return (int)(matchv[pwtp->re_sub].rm_eo -
-matchv[pwtp->re_sub].rm_so) ==
-pwtp->length;
+return pwtp->length == SIZE_MAX ||
+(int)(matchv[pwtp->re_sub].rm_eo -
+	matchv[pwtp->re_sub].rm_so) ==
+	pwtp->length;
 			}
 			regfree();
 		}



CVS commit: src/usr.sbin/user

2021-12-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Dec 10 20:06:29 UTC 2021

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

Log Message:
useradd(8): Recognize Argon2 passwords as "valid" when they are given
on the command line.

Reported by Robert Nestor on current-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/usr.sbin/user/user.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/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 19:47:20 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: simplify parsing of '||' in conditions

Previously, the grammar said 'Or -> Or || And', while the code looked
more like 'Or -> And || Or'.  Make the code look like the grammar and
keep track of the resulting value of the condition explicitly.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/usr.bin/make/cond.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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.284 src/usr.bin/make/cond.c:1.285
--- src/usr.bin/make/cond.c:1.284	Thu Dec  9 23:02:46 2021
+++ src/usr.bin/make/cond.c	Fri Dec 10 19:47:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.284 2021/12/09 23:02:46 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.285 2021/12/10 19:47:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,12 +95,11 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.284 2021/12/09 23:02:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.285 2021/12/10 19:47:20 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
- *	Or -> And
- *	Or -> Or '||' And
+ *	Or -> And ('||' And)*
  *	And -> Term
  *	And -> And '&&' Term
  *	Term -> Function '(' Argument ')'
@@ -1002,27 +1001,23 @@ CondParser_And(CondParser *par, bool doE
 }
 
 /*
- * Or -> And
- * Or -> Or '||' And
+ * Or -> And ('||' And)*
  */
 static CondResult
 CondParser_Or(CondParser *par, bool doEval)
 {
-	CondResult res;
+	CondResult res, rhs;
 	Token op;
 
-	res = CondParser_And(par, doEval);
-	if (res == CR_ERROR)
-		return CR_ERROR;
-
-	op = CondParser_Token(par, doEval);
-	if (op == TOK_OR) {
-		if (res == CR_FALSE)
-			return CondParser_Or(par, doEval);
-		if (CondParser_Or(par, false) == CR_ERROR)
+	res = CR_FALSE;
+	do {
+		if ((rhs = CondParser_And(par, doEval)) == CR_ERROR)
 			return CR_ERROR;
-		return res;
-	}
+		if (rhs == CR_TRUE) {
+			res = CR_TRUE;
+			doEval = false;
+		}
+	} while ((op = CondParser_Token(par, doEval)) == TOK_OR);
 
 	CondParser_PushBack(par, op);
 	return res;



CVS commit: src/usr.bin/make

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 19:47:20 UTC 2021

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: simplify parsing of '||' in conditions

Previously, the grammar said 'Or -> Or || And', while the code looked
more like 'Or -> And || Or'.  Make the code look like the grammar and
keep track of the resulting value of the condition explicitly.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/usr.bin/make/cond.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 19:42:07 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
skip reading destination fb if we're going to overwrite it, only read words
we need to partially write
while there write mask registers only if we're actually going to need them
another 20% speedup


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.23 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.24
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.23	Fri Dec 10 19:09:56 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Dec 10 19:42:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.23 2021/12/10 19:09:56 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.24 2021/12/10 19:42:07 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -439,25 +439,24 @@ CG14Copy8_short_rop(Cg14Ptr p, int srcst
 	 * mask out trailing pixels to avoid partial writes
 	 */
 	post = (dststart + w) & 3;
-	rmask = ~(0x >> (post * 8));
-	write_sx_reg(p, SX_QUEUED(7), rmask);	
-	write_sx_reg(p, SX_QUEUED(6), ~rmask);	
-	
+	if (post != 0) {
+		rmask = ~(0x >> (post * 8));
+		write_sx_reg(p, SX_QUEUED(7), rmask);	
+		write_sx_reg(p, SX_QUEUED(6), ~rmask);	
+	}
+
 	DPRINTF(X_ERROR, "%s %d %d, %d %d %08x %d %d %d %d %08x\n", __func__,
 	w, h, spre, pre, lmask, dist, sreg, wrds, post, rmask);
 
 	/* mask out the leading pixels in dst by using a mask and ROP */
-	write_sx_reg(p, SX_ROP_CONTROL, (p->last_rop & 0xf0) | 0xa);
-	write_sx_reg(p, SX_QUEUED(R_MASK), 0x);	
+	if (pre != 0) {
+		write_sx_reg(p, SX_ROP_CONTROL, (p->last_rop & 0xf0) | 0xa);
+		write_sx_reg(p, SX_QUEUED(R_MASK), 0x);	
+	}
 
 	saddr = srcstart & ~3;
 	daddr = dststart & ~3;
-	
-	/* TODO:
-	 * - skip reading the fb where we can get away with it, for example
-	 *   GXcopy, where we only need to read the destination for partials,
-	 *   everything in between is straight copy
-	 */
+
 	while (h > 0) {
 		write_sx_io(p, daddr & ~7, SX_LD(80, wrds - 1, daddr & 7));
 		write_sx_io(p, saddr & ~7, SX_LD(sreg, swrds - 1, saddr & 7));
@@ -517,6 +516,111 @@ CG14Copy8_short_rop(Cg14Ptr p, int srcst
 	}
 }
 
+/* up to 124 pixels so direction doesn't matter, unaligned, straight copy */
+static void
+CG14Copy8_short_norop(Cg14Ptr p, int srcstart, int dststart, int w, int h, int srcpitch, int dstpitch)
+{
+	int saddr, daddr, pre, dist, wrds, swrds, spre, sreg, restaddr, post;
+	int ssreg;
+#ifdef DEBUG
+	int taddr = 4 + dstpitch * 50;
+#endif
+	uint32_t lmask, rmask;
+	ENTER;
+	
+	pre = dststart & 3;
+	lmask = 0x >> pre;
+	spre = srcstart & 3;
+	/*
+	 * make sure we count all the words needed to cover the destination 
+	 * line, covering potential partials on both ends
+	 */
+	wrds = (w + pre + 3) >> 2;
+	swrds = (w + spre + 3) >> 2;
+
+	if (spre < pre) {
+		dist = 32 - (pre - spre) * 8;
+		sreg = 9;
+	} else {
+		dist = (spre - pre) * 8;
+		sreg = 8;
+	}
+
+	/*
+	 * mask out trailing pixels to avoid partial writes
+	 */
+	post = (dststart + w) & 3;
+	if (post != 0) {
+		rmask = ~(0x >> (post * 8));
+		write_sx_reg(p, SX_QUEUED(7), rmask);	
+		write_sx_reg(p, SX_QUEUED(6), ~rmask);	
+	}
+
+	DPRINTF(X_ERROR, "%s %d %d, %d %d %08x %d %d %d %d %08x\n", __func__,
+	w, h, spre, pre, lmask, dist, sreg, wrds, post, rmask);
+
+	/* mask out the leading pixels in dst by using a mask and ROP */
+	if (pre != 0) {
+		write_sx_reg(p, SX_ROP_CONTROL, 0xca);
+		write_sx_reg(p, SX_QUEUED(R_MASK), lmask);	
+	}
+
+	saddr = srcstart & ~3;
+	daddr = dststart & ~3;
+	
+	while (h > 0) {
+		write_sx_io(p, saddr & ~7, SX_LD(sreg, swrds - 1, saddr & 7));
+		if (wrds > 15) {
+			if (dist != 0) {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, 15));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(24, dist, 56, wrds - 16));
+/* shifted source pixels are now at register 40+ */
+ssreg = 40;
+			} else ssreg = 8;
+			if (pre != 0) {
+/* read only the first word */
+write_sx_io(p, daddr & ~7, SX_LD(80, 0, daddr & 7));
+/* mask out leading junk */
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, ssreg, 0));
+			}
+		} else {
+			if (dist != 0) {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, wrds));
+ssreg = 40;
+			} else ssreg = 8;
+			if (pre != 0) {
+/* read only the first word */
+write_sx_io(p, daddr & ~7, SX_LD(80, 0, daddr & 7));
+/* mask out leading junk */
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, ssreg, 0));
+			}
+		}
+		if (post != 0) {
+			int laddr = 

CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 19:42:07 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
skip reading destination fb if we're going to overwrite it, only read words
we need to partially write
while there write mask registers only if we're actually going to need them
another 20% speedup


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: src

2021-12-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Dec 10 19:30:05 UTC 2021

Modified Files:
src/lib/libc/gen: extattr_copy_file.3
src/share/man/man4: gpio.4
src/sys/fs/union: union_vnops.c

Log Message:
s/unaccessible/inaccessible/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/extattr_copy_file.3
cvs rdiff -u -r1.36 -r1.37 src/share/man/man4/gpio.4
cvs rdiff -u -r1.81 -r1.82 src/sys/fs/union/union_vnops.c

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

Modified files:

Index: src/lib/libc/gen/extattr_copy_file.3
diff -u src/lib/libc/gen/extattr_copy_file.3:1.3 src/lib/libc/gen/extattr_copy_file.3:1.4
--- src/lib/libc/gen/extattr_copy_file.3:1.3	Thu Mar 11 01:13:11 2021
+++ src/lib/libc/gen/extattr_copy_file.3	Fri Dec 10 19:30:05 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: extattr_copy_file.3,v 1.3 2021/03/11 01:13:11 msaitoh Exp $
+.\"	$NetBSD: extattr_copy_file.3,v 1.4 2021/12/10 19:30:05 andvar Exp $
 .\"
 .\" Copyright (c) 2001 Dima Dorfman 
 .\" Copyright (c) 2011 Emmanuel Dreyfus 
@@ -76,7 +76,7 @@ respectively work the same was as
 and
 .Fn extattr_copy_link ,
 but will copy extended attributes from all namespaces accessible to the user,
-silently skipping unaccessible namespaces.
+silently skipping inaccessible namespaces.
 .Pp
 Please note that none of the extended attribute copying functions are atomic.
 .Sh RETURN VALUES

Index: src/share/man/man4/gpio.4
diff -u src/share/man/man4/gpio.4:1.36 src/share/man/man4/gpio.4:1.37
--- src/share/man/man4/gpio.4:1.36	Tue May  4 17:47:51 2021
+++ src/share/man/man4/gpio.4	Fri Dec 10 19:30:05 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpio.4,v 1.36 2021/05/04 17:47:51 christos Exp $
+.\" $NetBSD: gpio.4,v 1.37 2021/12/10 19:30:05 andvar Exp $
 .\"	$OpenBSD: gpio.4,v 1.5 2004/11/23 09:39:29 reyk Exp $
 .\"
 .\" Copyright (c) 2004 Alexander Yurchenko 
@@ -187,7 +187,7 @@ Only GPIO pins that have been set using
 will be accessible at securelevels greater than 0.
 .Pp
 .It Dv GPIOUNSET ( struct gpio_set )
-Unset the specified pin, i.e. clear its name and make it unaccessible
+Unset the specified pin, i.e. clear its name and make it inaccessible
 at securelevels greater than 0.
 .Pp
 .It Dv GPIOATTACH ( struct gpio_attach )

Index: src/sys/fs/union/union_vnops.c
diff -u src/sys/fs/union/union_vnops.c:1.81 src/sys/fs/union/union_vnops.c:1.82
--- src/sys/fs/union/union_vnops.c:1.81	Fri Dec 10 09:20:38 2021
+++ src/sys/fs/union/union_vnops.c	Fri Dec 10 19:30:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vnops.c,v 1.81 2021/12/10 09:20:38 hannken Exp $	*/
+/*	$NetBSD: union_vnops.c,v 1.82 2021/12/10 19:30:05 andvar Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.81 2021/12/10 09:20:38 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.82 2021/12/10 19:30:05 andvar Exp $");
 
 #include 
 #include 
@@ -775,7 +775,7 @@ union_access(void *v)
 	 * Copy up to prevent checking (and failing) against
 	 * underlying file system mounted read only.
 	 * Check for read access first to prevent implicit
-	 * copy of unaccessible underlying vnode.
+	 * copy of inaccessible underlying vnode.
 	 */
 	if (un->un_uppervp == NULLVP &&
 	(un->un_lowervp->v_type == VREG) &&



CVS commit: src

2021-12-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Dec 10 19:30:05 UTC 2021

Modified Files:
src/lib/libc/gen: extattr_copy_file.3
src/share/man/man4: gpio.4
src/sys/fs/union: union_vnops.c

Log Message:
s/unaccessible/inaccessible/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/extattr_copy_file.3
cvs rdiff -u -r1.36 -r1.37 src/share/man/man4/gpio.4
cvs rdiff -u -r1.81 -r1.82 src/sys/fs/union/union_vnops.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/make/unit-tests

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 19:14:35 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: cond-op-and.exp cond-op-and.mk
cond-op-or.exp cond-op-or.mk

Log Message:
tests/make: add more comprehensive tests for short-circuit evaluation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-op-and.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/cond-op-and.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/cond-op-or.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-op-or.mk

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/make/unit-tests/cond-op-and.exp
diff -u src/usr.bin/make/unit-tests/cond-op-and.exp:1.2 src/usr.bin/make/unit-tests/cond-op-and.exp:1.3
--- src/usr.bin/make/unit-tests/cond-op-and.exp:1.2	Thu Sep 10 22:38:57 2020
+++ src/usr.bin/make/unit-tests/cond-op-and.exp	Fri Dec 10 19:14:35 2021
@@ -1,4 +1,7 @@
-make: "cond-op-and.mk" line 43: Malformed conditional (0 &&& 0)
+make: "cond-op-and.mk" line 36: Malformed conditional (0 || (${DEF} && ${UNDEF}))
+make: "cond-op-and.mk" line 40: Malformed conditional (0 || (${UNDEF} && ${UNDEF}))
+make: "cond-op-and.mk" line 42: Malformed conditional (0 || (!${UNDEF} && ${UNDEF}))
+make: "cond-op-and.mk" line 71: Malformed conditional (0 &&& 0)
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-op-and.mk
diff -u src/usr.bin/make/unit-tests/cond-op-and.mk:1.5 src/usr.bin/make/unit-tests/cond-op-and.mk:1.6
--- src/usr.bin/make/unit-tests/cond-op-and.mk:1.5	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/cond-op-and.mk	Fri Dec 10 19:14:35 2021
@@ -1,4 +1,4 @@
-# $NetBSD: cond-op-and.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: cond-op-and.mk,v 1.6 2021/12/10 19:14:35 rillig Exp $
 #
 # Tests for the && operator in .if conditions.
 
@@ -18,11 +18,39 @@
 .  error
 .endif
 
+
 # The right-hand side is not evaluated since the left-hand side is already
 # false.
 .if 0 && ${UNDEF}
 .endif
 
+# When an outer condition makes the inner '&&' condition irrelevant, neither
+# of its operands must be evaluated.
+#
+.if 1 || (${UNDEF} && ${UNDEF})
+.endif
+
+# Test combinations of outer '||' with inner '&&', to ensure that the operands
+# of the inner '&&' are only evaluated if necessary.
+DEF=	defined
+.if 0 || (${DEF} && ${UNDEF})
+.endif
+.if 0 || (!${DEF} && ${UNDEF})
+.endif
+.if 0 || (${UNDEF} && ${UNDEF})
+.endif
+.if 0 || (!${UNDEF} && ${UNDEF})
+.endif
+.if 1 || (${DEF} && ${UNDEF})
+.endif
+.if 1 || (!${DEF} && ${UNDEF})
+.endif
+.if 1 || (${UNDEF} && ${UNDEF})
+.endif
+.if 1 || (!${UNDEF} && ${UNDEF})
+.endif
+
+
 # The && operator may be abbreviated as &.  This is not widely known though
 # and is also not documented in the manual page.
 

Index: src/usr.bin/make/unit-tests/cond-op-or.exp
diff -u src/usr.bin/make/unit-tests/cond-op-or.exp:1.3 src/usr.bin/make/unit-tests/cond-op-or.exp:1.4
--- src/usr.bin/make/unit-tests/cond-op-or.exp:1.3	Thu Dec  9 23:57:19 2021
+++ src/usr.bin/make/unit-tests/cond-op-or.exp	Fri Dec 10 19:14:35 2021
@@ -1,4 +1,7 @@
-make: "cond-op-or.mk" line 51: Malformed conditional (0 ||| 0)
+make: "cond-op-or.mk" line 46: Malformed conditional (1 && (!${DEF} || ${UNDEF}))
+make: "cond-op-or.mk" line 48: Malformed conditional (1 && (${UNDEF} || ${UNDEF}))
+make: "cond-op-or.mk" line 50: Malformed conditional (1 && (!${UNDEF} || ${UNDEF}))
+make: "cond-op-or.mk" line 71: Malformed conditional (0 ||| 0)
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-op-or.mk
diff -u src/usr.bin/make/unit-tests/cond-op-or.mk:1.7 src/usr.bin/make/unit-tests/cond-op-or.mk:1.8
--- src/usr.bin/make/unit-tests/cond-op-or.mk:1.7	Thu Dec  9 23:57:19 2021
+++ src/usr.bin/make/unit-tests/cond-op-or.mk	Fri Dec 10 19:14:35 2021
@@ -1,4 +1,4 @@
-# $NetBSD: cond-op-or.mk,v 1.7 2021/12/09 23:57:19 rillig Exp $
+# $NetBSD: cond-op-or.mk,v 1.8 2021/12/10 19:14:35 rillig Exp $
 #
 # Tests for the || operator in .if conditions.
 
@@ -24,12 +24,32 @@
 .if 1 || ${UNDEF}
 .endif
 
-# When an outer condition makes the '||' expression irrelevant, neither of its
-# operands must be evaluated.  This had been wrong in cond.c 1.283 from
+# When an outer condition makes the inner '||' condition irrelevant, neither
+# of its operands must be evaluated.  This had been wrong in cond.c 1.283 from
 # 2021-12-09 and was reverted in cond.c 1.284 an hour later.
 .if 0 && (!defined(UNDEF) || ${UNDEF})
 .endif
 
+# Test combinations of outer '&&' with inner '||', to ensure that the operands
+# of the inner '||' is only evaluated if necessary.
+DEF=	defined
+.if 0 && (${DEF} || ${UNDEF})
+.endif
+.if 0 && (!${DEF} || ${UNDEF})
+.endif
+.if 0 && (${UNDEF} || ${UNDEF})
+.endif
+.if 0 && 

CVS commit: src/usr.bin/make/unit-tests

2021-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Dec 10 19:14:35 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: cond-op-and.exp cond-op-and.mk
cond-op-or.exp cond-op-or.mk

Log Message:
tests/make: add more comprehensive tests for short-circuit evaluation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-op-and.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/cond-op-and.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/cond-op-or.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-op-or.mk

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 19:09:56 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
CG14Copy8_short_rop(): skip the funnel shifter if source and destination are
aligned. Small but measurable speedup.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 19:09:56 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
CG14Copy8_short_rop(): skip the funnel shifter if source and destination are
aligned. Small but measurable speedup.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.22 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.23
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.22	Fri Dec 10 18:25:43 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Dec 10 19:09:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.22 2021/12/10 18:25:43 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.23 2021/12/10 19:09:56 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -410,6 +410,7 @@ static void
 CG14Copy8_short_rop(Cg14Ptr p, int srcstart, int dststart, int w, int h, int srcpitch, int dstpitch)
 {
 	int saddr, daddr, pre, dist, wrds, swrds, spre, sreg, restaddr, post;
+	int ssreg;
 #ifdef DEBUG
 	int taddr = 4 + dstpitch * 50;
 #endif
@@ -453,8 +454,6 @@ CG14Copy8_short_rop(Cg14Ptr p, int srcst
 	daddr = dststart & ~3;
 	
 	/* TODO:
-	 * - special case dist == 0 where we can skip the funnel shifter
-	 *   and only need to deal with leading / trailing garbage
 	 * - skip reading the fb where we can get away with it, for example
 	 *   GXcopy, where we only need to read the destination for partials,
 	 *   everything in between is straight copy
@@ -463,30 +462,35 @@ CG14Copy8_short_rop(Cg14Ptr p, int srcst
 		write_sx_io(p, daddr & ~7, SX_LD(80, wrds - 1, daddr & 7));
 		write_sx_io(p, saddr & ~7, SX_LD(sreg, swrds - 1, saddr & 7));
 		if (wrds > 15) {
-			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, 15));
-			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(24, dist, 56, wrds - 16));
-			/* shifted source pixels are now at register 40+ */
+			if (dist != 0) {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, 15));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(24, dist, 56, wrds - 16));
+/* shifted source pixels are now at register 40+ */
+ssreg = 40;
+			} else ssreg = 8;
 			if (pre != 0) {
 /* mask out leading junk */
 write_sx_reg(p, SX_QUEUED(R_MASK), lmask);
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 0));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, 8, 0));
 write_sx_reg(p, SX_QUEUED(R_MASK), 0x);
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(41, 81, 9, 14));	
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg + 1, 81, 9, 14));	
 			} else {
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 15));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, 8, 15));
 			}
-			write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(56, 96, 24, wrds - 16));
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg + 16, 96, 24, wrds - 16));
 		} else {
-			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, wrds));
-
+			if (dist != 0) {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, wrds));
+ssreg = 40;
+			} else ssreg = 8;
 			if (pre != 0) {
 /* mask out leading junk */
 write_sx_reg(p, SX_QUEUED(R_MASK), lmask);
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 0));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, 8, 0));
 write_sx_reg(p, SX_QUEUED(R_MASK), 0x);
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(41, 81, 9, wrds));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg + 1, 81, 9, wrds));
 			} else {
-write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, wrds));
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(ssreg, 80, 8, wrds));
 			}
 		}
 		if (post != 0) {



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 18:25:44 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
add another Copy8() variant:
- supports unaligned source and destination
- uses all 32bit accesses
- supports copies up to 124 pixels wide so an entire line fits into registers
  and we can ignore x direction
... mostly an exercise in learning how to use the funnel shifter
TODO:
- skip the funnel shifter if source and destination are aligned
- skip fb reads where possible, like straight GXcopy


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-10 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec 10 18:25:44 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
add another Copy8() variant:
- supports unaligned source and destination
- uses all 32bit accesses
- supports copies up to 124 pixels wide so an entire line fits into registers
  and we can ignore x direction
... mostly an exercise in learning how to use the funnel shifter
TODO:
- skip the funnel shifter if source and destination are aligned
- skip fb reads where possible, like straight GXcopy


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.21 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.22
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.21	Thu Dec  9 17:29:14 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Dec 10 18:25:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.21 2021/12/09 17:29:14 christos Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.22 2021/12/10 18:25:43 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -405,6 +405,114 @@ next:
 	}
 }
 
+/* up to 124 pixels so direction doesn't matter, unaligned, ROP */
+static void
+CG14Copy8_short_rop(Cg14Ptr p, int srcstart, int dststart, int w, int h, int srcpitch, int dstpitch)
+{
+	int saddr, daddr, pre, dist, wrds, swrds, spre, sreg, restaddr, post;
+#ifdef DEBUG
+	int taddr = 4 + dstpitch * 50;
+#endif
+	uint32_t lmask, rmask;
+	ENTER;
+	
+	pre = dststart & 3;
+	lmask = 0x >> pre;
+	spre = srcstart & 3;
+	/*
+	 * make sure we count all the words needed to cover the destination 
+	 * line, covering potential partials on both ends
+	 */
+	wrds = (w + pre + 3) >> 2;
+	swrds = (w + spre + 3) >> 2;
+
+	if (spre < pre) {
+		dist = 32 - (pre - spre) * 8;
+		sreg = 9;
+	} else {
+		dist = (spre - pre) * 8;
+		sreg = 8;
+	}
+
+	/*
+	 * mask out trailing pixels to avoid partial writes
+	 */
+	post = (dststart + w) & 3;
+	rmask = ~(0x >> (post * 8));
+	write_sx_reg(p, SX_QUEUED(7), rmask);	
+	write_sx_reg(p, SX_QUEUED(6), ~rmask);	
+	
+	DPRINTF(X_ERROR, "%s %d %d, %d %d %08x %d %d %d %d %08x\n", __func__,
+	w, h, spre, pre, lmask, dist, sreg, wrds, post, rmask);
+
+	/* mask out the leading pixels in dst by using a mask and ROP */
+	write_sx_reg(p, SX_ROP_CONTROL, (p->last_rop & 0xf0) | 0xa);
+	write_sx_reg(p, SX_QUEUED(R_MASK), 0x);	
+
+	saddr = srcstart & ~3;
+	daddr = dststart & ~3;
+	
+	/* TODO:
+	 * - special case dist == 0 where we can skip the funnel shifter
+	 *   and only need to deal with leading / trailing garbage
+	 * - skip reading the fb where we can get away with it, for example
+	 *   GXcopy, where we only need to read the destination for partials,
+	 *   everything in between is straight copy
+	 */
+	while (h > 0) {
+		write_sx_io(p, daddr & ~7, SX_LD(80, wrds - 1, daddr & 7));
+		write_sx_io(p, saddr & ~7, SX_LD(sreg, swrds - 1, saddr & 7));
+		if (wrds > 15) {
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, 15));
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(24, dist, 56, wrds - 16));
+			/* shifted source pixels are now at register 40+ */
+			if (pre != 0) {
+/* mask out leading junk */
+write_sx_reg(p, SX_QUEUED(R_MASK), lmask);
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 0));
+write_sx_reg(p, SX_QUEUED(R_MASK), 0x);
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(41, 81, 9, 14));	
+			} else {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 15));
+			}
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(56, 96, 24, wrds - 16));
+		} else {
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_FUNNEL_I(8, dist, 40, wrds));
+
+			if (pre != 0) {
+/* mask out leading junk */
+write_sx_reg(p, SX_QUEUED(R_MASK), lmask);
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, 0));
+write_sx_reg(p, SX_QUEUED(R_MASK), 0x);
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(41, 81, 9, wrds));
+			} else {
+write_sx_reg(p, SX_INSTRUCTIONS, SX_ROPB(40, 80, 8, wrds));
+			}
+		}
+		if (post != 0) {
+			/*
+			 * if the last word to be written out is a partial we 
+			 * mask out the leftovers and replace them with
+			 * background pixels
+			 * we could pull the same ROP * mask trick as we do on
+			 * the left end but it's less annoying this way and
+			 * the instruction count is the same
+			 */
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_ANDS(7 + wrds, 7, 5, 0));
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_ANDS(79 + wrds, 6, 4, 0));
+			write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(5, 4, 7 + wrds, 0));
+		}
+#ifdef DEBUG
+		write_sx_io(p, taddr & ~7, SX_ST(40, 

CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:39:49 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c ixgbe.c

Log Message:
Move PF mailbox initialization from ixgbe_attach() to ixgbe_init_iov().

  From FreeBSD ix-3.3.18. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/pci/ixgbe/ixgbe.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/pci/ixgbe/if_sriov.c
diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.13 src/sys/dev/pci/ixgbe/if_sriov.c:1.14
--- src/sys/dev/pci/ixgbe/if_sriov.c:1.13	Fri Dec 10 11:21:44 2021
+++ src/sys/dev/pci/ixgbe/if_sriov.c	Fri Dec 10 11:39:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sriov.c,v 1.13 2021/12/10 11:21:44 msaitoh Exp $ */
+/* $NetBSD: if_sriov.c,v 1.14 2021/12/10 11:39:48 msaitoh Exp $ */
 /**
 
   Copyright (c) 2001-2017, Intel Corporation
@@ -34,7 +34,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.13 2021/12/10 11:21:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.14 2021/12/10 11:39:48 msaitoh Exp $");
 
 #include "ixgbe.h"
 #include "ixgbe_sriov.h"
@@ -714,6 +714,7 @@ ixgbe_init_iov(device_t dev, u16 num_vfs
 	}
 
 	adapter->num_vfs = num_vfs;
+	ixgbe_init_mbx_params_pf(>hw);
 
 	/* set the SRIOV flag now as it's needed
 	 * by ixgbe_init_locked() */

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.296 src/sys/dev/pci/ixgbe/ixgbe.c:1.297
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.296	Fri Dec 10 11:33:11 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec 10 11:39:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.297 2021/12/10 11:39:48 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.297 2021/12/10 11:39:48 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -920,9 +920,6 @@ ixgbe_attach(device_t parent, device_t d
 	}
 	aprint_normal_dev(dev, "device %s\n", str);
 
-	if (hw->mbx.ops.init_params)
-		hw->mbx.ops.init_params(hw);
-
 	hw->allow_unsupported_sfp = allow_unsupported_sfp;
 
 	/* Pick up the 82599 settings */



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:39:49 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c ixgbe.c

Log Message:
Move PF mailbox initialization from ixgbe_attach() to ixgbe_init_iov().

  From FreeBSD ix-3.3.18. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/pci/ixgbe/ixgbe.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:33:12 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h

Log Message:
No functional change.

  - Sync with FreeBSD ix-3.3.18.
- Rename ixgbe_get_advertise() to ixgbe_get_default_advertise.
- Sort lines, modify comment and whitespace to reduce diff against FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/ixgbe/ixgbe.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.295 src/sys/dev/pci/ixgbe/ixgbe.c:1.296
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.295	Tue Dec  7 22:13:56 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec 10 11:33:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.295 2021/12/07 22:13:56 andvar Exp $ */
+/* $NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.295 2021/12/07 22:13:56 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -235,7 +235,7 @@ static void	ixgbe_add_hw_stats(struct ad
 static void	ixgbe_clear_evcnt(struct adapter *);
 static int	ixgbe_set_flowcntl(struct adapter *, int);
 static int	ixgbe_set_advertise(struct adapter *, int);
-static int	ixgbe_get_advertise(struct adapter *);
+static int	ixgbe_get_default_advertise(struct adapter *);
 
 /* Sysctl handlers */
 static void	ixgbe_set_sysctl_value(struct adapter *, const char *,
@@ -1229,7 +1229,7 @@ ixgbe_attach(device_t parent, device_t d
 	/* Set an initial dmac value */
 	adapter->dmac = 0;
 	/* Set initial advertised speeds (if applicable) */
-	adapter->advertise = ixgbe_get_advertise(adapter);
+	adapter->advertise = ixgbe_get_default_advertise(adapter);
 
 	if (adapter->feat_cap & IXGBE_FEATURE_SRIOV)
 		ixgbe_define_iov_schemas(dev, );
@@ -5536,10 +5536,10 @@ ixgbe_sysctl_advertise(SYSCTLFN_ARGS)
  *
  *   Flags:
  * 0x00 - Default (all capable link speed)
- * 0x01 - advertise 100 Mb
- * 0x02 - advertise 1G
- * 0x04 - advertise 10G
- * 0x08 - advertise 10 Mb
+ * 0x1  - advertise 100 Mb
+ * 0x2  - advertise 1G
+ * 0x4  - advertise 10G
+ * 0x8  - advertise 10 Mb (yes, Mb)
  * 0x10 - advertise 2.5G
  * 0x20 - advertise 5G
  /
@@ -5640,19 +5640,19 @@ ixgbe_set_advertise(struct adapter *adap
 } /* ixgbe_set_advertise */
 
 /
- * ixgbe_get_advertise - Get current advertised speed settings
+ * ixgbe_get_default_advertise - Get default advertised speed settings
  *
  *   Formatted for sysctl usage.
  *   Flags:
- * 0x01 - advertise 100 Mb
- * 0x02 - advertise 1G
- * 0x04 - advertise 10G
- * 0x08 - advertise 10 Mb (yes, Mb)
+ * 0x1  - advertise 100 Mb
+ * 0x2  - advertise 1G
+ * 0x4  - advertise 10G
+ * 0x8  - advertise 10 Mb (yes, Mb)
  * 0x10 - advertise 2.5G
  * 0x20 - advertise 5G
  /
 static int
-ixgbe_get_advertise(struct adapter *adapter)
+ixgbe_get_default_advertise(struct adapter *adapter)
 {
 	struct ixgbe_hw	 *hw = >hw;
 	int		 speed;
@@ -5673,15 +5673,15 @@ ixgbe_get_advertise(struct adapter *adap
 		return (0);
 
 	speed =
-	((link_caps & IXGBE_LINK_SPEED_10GB_FULL)  ? 0x04 : 0) |
-	((link_caps & IXGBE_LINK_SPEED_1GB_FULL)   ? 0x02 : 0) |
-	((link_caps & IXGBE_LINK_SPEED_100_FULL)   ? 0x01 : 0) |
-	((link_caps & IXGBE_LINK_SPEED_10_FULL)? 0x08 : 0) |
+	((link_caps & IXGBE_LINK_SPEED_10GB_FULL)  ? 0x4  : 0) |
+	((link_caps & IXGBE_LINK_SPEED_5GB_FULL)   ? 0x20 : 0) |
 	((link_caps & IXGBE_LINK_SPEED_2_5GB_FULL) ? 0x10 : 0) |
-	((link_caps & IXGBE_LINK_SPEED_5GB_FULL)   ? 0x20 : 0);
+	((link_caps & IXGBE_LINK_SPEED_1GB_FULL)   ? 0x2  : 0) |
+	((link_caps & IXGBE_LINK_SPEED_100_FULL)   ? 0x1  : 0) |
+	((link_caps & IXGBE_LINK_SPEED_10_FULL)? 0x8  : 0);
 
 	return speed;
-} /* ixgbe_get_advertise */
+} /* ixgbe_get_default_advertise */
 
 /
  * ixgbe_sysctl_dmac - Manage DMA Coalescing

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.83 src/sys/dev/pci/ixgbe/ixgbe.h:1.84
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.83	Wed Nov 17 06:37:44 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Fri Dec 10 11:33:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.83 2021/11/17 06:37:44 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.84 2021/12/10 11:33:11 msaitoh Exp $ */
 
 

CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:33:12 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h

Log Message:
No functional change.

  - Sync with FreeBSD ix-3.3.18.
- Rename ixgbe_get_advertise() to ixgbe_get_default_advertise.
- Sort lines, modify comment and whitespace to reduce diff against FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/ixgbe/ixgbe.h

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:31:22 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_common.c ixgbe_dcb.c ixgbe_mbx.c ixgbe_phy.c ixgbe_x540.c
ixgbe_x550.c

Log Message:
Whitespace fix. Sync with FreeBSD ix-3.3.14.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ixgbe/ixgbe_x550.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:30:10 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_type.h

Log Message:
Add some unused macros. Sync with FreeBSD ix-3.3.14.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/ixgbe/ixgbe_type.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.50 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.51
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.50	Mon Nov  1 21:28:03 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Fri Dec 10 11:30:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.50 2021/11/01 21:28:03 andvar Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.51 2021/12/10 11:30:09 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -1114,8 +1114,10 @@ struct ixgbe_dmac_config {
 #define IXGBE_HSMC0R		0x15F04
 #define IXGBE_HSMC1R		0x15F08
 #define IXGBE_SWSR		0x15F10
+#define IXGBE_FWRESETCNT	0x15F40
 #define IXGBE_HFDR		0x15FE8
 #define IXGBE_FLEX_MNG		0x15800 /* 0x15800 - 0x15EFC */
+#define IXGBE_FLEX_MNG_PTR(_i)	(IXGBE_FLEX_MNG + ((_i) * 4))
 
 #define IXGBE_HICR_EN		0x01  /* Enable bit - RO */
 /* Driver sets this bit when done to put command in RAM */
@@ -2406,6 +2408,17 @@ enum {
 #define IXGBE_ALT_MAC_ADDR_PTR		0x37
 #define IXGBE_FREE_SPACE_PTR		0X3E
 
+#if defined(PREBOOT_SUPPORT) || defined(QV_RELEASE)
+/* Minimum Rollback Revision offsets */
+#define IXGBE_MINRREV_PHY_ANALOG_LO	0x46
+#define IXGBE_MINRREV_PHY_ANALOG_HI	0x47
+#define IXGBE_MINRREV_OROM_LO		0x48
+#define IXGBE_MINRREV_OROM_HI		0x49
+#define IXGBE_MINRREV_FW_LO		0x4A
+#define IXGBE_MINRREV_FW_HI		0x4B
+#endif /* PREBOOT_SUPPORT || QV_RELEASE*/
+
+
 #define IXGBE_SAN_MAC_ADDR_PTR		0x28
 #define IXGBE_NVM_MAP_VER		0x29
 #define IXGBE_OEM_NVM_IMAGE_VER		0x2A



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:30:10 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_type.h

Log Message:
Add some unused macros. Sync with FreeBSD ix-3.3.14.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/ixgbe/ixgbe_type.h

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:28:40 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c

Log Message:
Move increments after evaluations.

  FreeBSD: dc11ba4eb3fe5cce615f361de83e85e07005ca24 or ix-3.3.14
  DPDK:390445ec30b4c52a3d2887c3d2a202d9cf37ea8e

The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixgbe_phy.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/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.25 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.26
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.25	Fri Dec 10 11:20:13 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Fri Dec 10 11:28:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_phy.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe_phy.c,v 1.26 2021/12/10 11:28:40 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.26 2021/12/10 11:28:40 msaitoh Exp $");
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -171,12 +171,12 @@ fail:
 		ixgbe_i2c_bus_clear(hw);
 		if (lock)
 			hw->mac.ops.release_swfw_sync(hw, swfw_mask);
-		retry++;
 		if (retry < max_retry)
 			DEBUGOUT("I2C byte read combined error - Retrying.\n");
 		else
 			DEBUGOUT("I2C byte read combined error.\n");
-	} while (retry < max_retry);
+		retry++;
+	} while (retry <= max_retry);
 
 	return IXGBE_ERR_I2C;
 }
@@ -236,12 +236,12 @@ fail:
 		ixgbe_i2c_bus_clear(hw);
 		if (lock)
 			hw->mac.ops.release_swfw_sync(hw, swfw_mask);
-		retry++;
 		if (retry < max_retry)
 			DEBUGOUT("I2C byte write combined error - Retrying.\n");
 		else
 			DEBUGOUT("I2C byte write combined error.\n");
-	} while (retry < max_retry);
+		retry++;
+	} while (retry <= max_retry);
 
 	return IXGBE_ERR_I2C;
 }
@@ -2137,13 +2137,13 @@ fail:
 			hw->mac.ops.release_swfw_sync(hw, swfw_mask);
 			msec_delay(100);
 		}
-		retry++;
 		if (retry < max_retry)
 			DEBUGOUT("I2C byte read error - Retrying.\n");
 		else
 			DEBUGOUT("I2C byte read error.\n");
+		retry++;
 
-	} while (retry < max_retry);
+	} while (retry <= max_retry);
 
 	return status;
 }
@@ -2241,12 +2241,12 @@ static s32 ixgbe_write_i2c_byte_generic_
 
 fail:
 		ixgbe_i2c_bus_clear(hw);
-		retry++;
 		if (retry < max_retry)
 			DEBUGOUT("I2C byte write error - Retrying.\n");
 		else
 			DEBUGOUT("I2C byte write error.\n");
-	} while (retry < max_retry);
+		retry++;
+	} while (retry <= max_retry);
 
 	if (lock)
 		hw->mac.ops.release_swfw_sync(hw, swfw_mask);



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:28:40 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c

Log Message:
Move increments after evaluations.

  FreeBSD: dc11ba4eb3fe5cce615f361de83e85e07005ca24 or ix-3.3.14
  DPDK:390445ec30b4c52a3d2887c3d2a202d9cf37ea8e

The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixgbe_phy.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:27:17 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_netmap.c

Log Message:
ifdef D(ebug)? From FreeBSD ix-3.3.14.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_netmap.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/pci/ixgbe/ixgbe_netmap.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_netmap.c:1.4 src/sys/dev/pci/ixgbe/ixgbe_netmap.c:1.5
--- src/sys/dev/pci/ixgbe/ixgbe_netmap.c:1.4	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_netmap.c	Fri Dec 10 11:27:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_netmap.c,v 1.4 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: ixgbe_netmap.c,v 1.5 2021/12/10 11:27:17 msaitoh Exp $ */
 /**
 
   Copyright (c) 2001-2017, Intel Corporation
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_netmap.c,v 1.4 2021/04/30 06:55:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_netmap.c,v 1.5 2021/12/10 11:27:17 msaitoh Exp $");
 
 #ifdef DEV_NETMAP
 /*
@@ -121,9 +121,11 @@ set_crcstrip(struct ixgbe_hw *hw, int on
 
 	hl = IXGBE_READ_REG(hw, IXGBE_HLREG0);
 	rxc = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
+#ifdef D
 	if (netmap_verbose)
 		D("%s read  HLREG 0x%x rxc 0x%x",
 			onoff ? "enter" : "exit", hl, rxc);
+#endif
 	/* hw requirements ... */
 	rxc &= ~IXGBE_RDRXCTL_RSCFRSTSIZE;
 	rxc |= IXGBE_RDRXCTL_RSCACKC;
@@ -136,9 +138,11 @@ set_crcstrip(struct ixgbe_hw *hw, int on
 		hl |= IXGBE_HLREG0_RXCRCSTRP;
 		rxc |= IXGBE_RDRXCTL_CRCSTRIP;
 	}
+#ifdef D
 	if (netmap_verbose)
 		D("%s write HLREG 0x%x rxc 0x%x",
 			onoff ? "enter" : "exit", hl, rxc);
+#endif
 	IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hl);
 	IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc);
 }
@@ -344,7 +348,9 @@ ixgbe_netmap_txsync(struct netmap_kring 
 		 */
 		nic_i = IXGBE_READ_REG(>hw, IXGBE_TDH(kring->ring_id));
 		if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
+#ifdef D
 			D("TDH wrap %d", nic_i);
+#endif
 			nic_i -= kring->nkr_num_slots;
 		}
 		if (nic_i != txr->next_to_clean) {



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:27:17 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_netmap.c

Log Message:
ifdef D(ebug)? From FreeBSD ix-3.3.14.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_netmap.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:25:22 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_common.c

Log Message:
Fix infinite recursion on PCIe link down.

  - FreeBSD: 8270b7174c48417a4d5f3effa4a4f4588205e687 or ix-3.3.14
  - DPDK:2d04b9e856125197ec8e967471426d56ab7efcf0

In some corner cases the functions ixgbe_clear_rar_generic and
ixgbe_clear_vmdq_generic may call one another leading to infinite
recursion.

When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL
flag, it's going to clear MPSAR registers, and proceed to call
ixgbe_clear_rar_generic, which in turn will clear the RAR registers,
and recursively call back ixgbe_clear_vmdq_generic. Normally, the
latter would detect that MPSAR registers have already been cleared
and terminate the recursion.

However, when PCIe link is down, and before the driver has had the
opportunity to shut itself down, all register reads return 0x,
and all register writes fail silently. In such case, because
ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers
succeeded, it's going to always call ixgbe_clear_rar_generic, which
in turn will always call back ixgbe_clear_vmdq_generic, creating
infinite recursion.

This patch re-reads MPSAR register values after they had been cleared.
In case of PCIe link failure, the values read will be non-zero, which
will terminate the recursion. On the other hand, under normal
circumstances the value read from MPSAR registers is going to be equal
to the value previously written, so this patch is expected not to cause
any regressions.

  - Note that NetBSD doesn't support VMDQ.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/ixgbe/ixgbe_common.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:25:22 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_common.c

Log Message:
Fix infinite recursion on PCIe link down.

  - FreeBSD: 8270b7174c48417a4d5f3effa4a4f4588205e687 or ix-3.3.14
  - DPDK:2d04b9e856125197ec8e967471426d56ab7efcf0

In some corner cases the functions ixgbe_clear_rar_generic and
ixgbe_clear_vmdq_generic may call one another leading to infinite
recursion.

When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL
flag, it's going to clear MPSAR registers, and proceed to call
ixgbe_clear_rar_generic, which in turn will clear the RAR registers,
and recursively call back ixgbe_clear_vmdq_generic. Normally, the
latter would detect that MPSAR registers have already been cleared
and terminate the recursion.

However, when PCIe link is down, and before the driver has had the
opportunity to shut itself down, all register reads return 0x,
and all register writes fail silently. In such case, because
ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers
succeeded, it's going to always call ixgbe_clear_rar_generic, which
in turn will always call back ixgbe_clear_vmdq_generic, creating
infinite recursion.

This patch re-reads MPSAR register values after they had been cleared.
In case of PCIe link failure, the values read will be non-zero, which
will terminate the recursion. On the other hand, under normal
circumstances the value read from MPSAR registers is going to be equal
to the value previously written, so this patch is expected not to cause
any regressions.

  - Note that NetBSD doesn't support VMDQ.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/ixgbe/ixgbe_common.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/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.36 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.37
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.36	Fri Dec 10 11:22:41 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Fri Dec 10 11:25:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.36 2021/12/10 11:22:41 msaitoh Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.37 2021/12/10 11:25:22 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.36 2021/12/10 11:22:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.37 2021/12/10 11:25:22 msaitoh Exp $");
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -3835,11 +3835,11 @@ s32 ixgbe_clear_vmdq_generic(struct ixgb
 	if (vmdq == IXGBE_CLEAR_VMDQ_ALL) {
 		if (mpsar_lo) {
 			IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0);
-			mpsar_lo = 0;
+			mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar));
 		}
 		if (mpsar_hi) {
 			IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0);
-			mpsar_hi = 0;
+			mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar));
 		}
 	} else if (vmdq < 32) {
 		mpsar_lo &= ~(1 << vmdq);



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:22:41 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_common.c

Log Message:
Remove debug error message.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/ixgbe/ixgbe_common.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/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.35 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.36
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.35	Fri Dec 10 11:20:13 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Fri Dec 10 11:22:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.35 2021/12/10 11:20:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.36 2021/12/10 11:22:41 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.35 2021/12/10 11:20:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.36 2021/12/10 11:22:41 msaitoh Exp $");
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -225,11 +225,6 @@ bool ixgbe_device_supports_autoneg_fc(st
 		break;
 	}
 
-	if (!supported)
-		ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
-			  "Device %x does not support flow control autoneg",
-			  hw->device_id);
-
 	return supported;
 }
 



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:22:41 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_common.c

Log Message:
Remove debug error message.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/ixgbe/ixgbe_common.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:21:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c

Log Message:
Change argument. No functional change. This file is not used in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/if_sriov.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/pci/ixgbe/if_sriov.c
diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.12 src/sys/dev/pci/ixgbe/if_sriov.c:1.13
--- src/sys/dev/pci/ixgbe/if_sriov.c:1.12	Fri Dec 10 11:18:30 2021
+++ src/sys/dev/pci/ixgbe/if_sriov.c	Fri Dec 10 11:21:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sriov.c,v 1.12 2021/12/10 11:18:30 msaitoh Exp $ */
+/* $NetBSD: if_sriov.c,v 1.13 2021/12/10 11:21:44 msaitoh Exp $ */
 /**
 
   Copyright (c) 2001-2017, Intel Corporation
@@ -34,7 +34,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.12 2021/12/10 11:18:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.13 2021/12/10 11:21:44 msaitoh Exp $");
 
 #include "ixgbe.h"
 #include "ixgbe_sriov.h"
@@ -255,8 +255,9 @@ ixgbe_vf_set_default_vlan(struct adapter
 
 
 static void
-ixgbe_clear_vfmbmem(struct ixgbe_hw *hw, struct ixgbe_vf *vf)
+ixgbe_clear_vfmbmem(struct adapter *adapter, struct ixgbe_vf *vf)
 {
+	struct ixgbe_hw *hw = >hw;
 	uint32_t vf_index = IXGBE_VF_INDEX(vf->pool);
 	uint16_t mbx_size = hw->mbx.size;
 	uint16_t i;
@@ -323,7 +324,7 @@ ixgbe_process_vf_reset(struct adapter *a
 	// XXX clear multicast addresses
 
 	ixgbe_clear_rar(>hw, vf->rar_index);
-	ixgbe_clear_vfmbmem(>hw, vf);
+	ixgbe_clear_vfmbmem(adapter, vf);
 	ixgbe_toggle_txdctl(>hw, IXGBE_VF_INDEX(vf->pool));
 
 	vf->api_ver = IXGBE_API_VER_UNKNOWN;



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:21:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c

Log Message:
Change argument. No functional change. This file is not used in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/if_sriov.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:20:13 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_82599.c ixgbe_common.c ixgbe_common.h
ixgbe_phy.c ixgbe_x540.c

Log Message:
Remove unnecessary return value check.

  FreeBSD: 3a89005394bc5d82ce9b6baa9e7f8dee362354ae
  DPDK:4b0ee6529b7897c2a08dd56669f07ac1f46a8474


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe_x540.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/pci/ixgbe/ixgbe_82599.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.24 src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.25
--- src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.24	Fri Dec 10 11:16:54 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_82599.c	Fri Dec 10 11:20:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_82599.c,v 1.24 2021/12/10 11:16:54 msaitoh Exp $ */
+/* $NetBSD: ixgbe_82599.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_82599.c,v 1.24 2021/12/10 11:16:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_82599.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $");
 
 #include "ixgbe_type.h"
 #include "ixgbe_82599.h"
@@ -2144,9 +2144,7 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw
 	if (ret_val != IXGBE_SUCCESS)
 		goto out;
 
-	ret_val = ixgbe_start_hw_gen2(hw);
-	if (ret_val != IXGBE_SUCCESS)
-		goto out;
+	ixgbe_start_hw_gen2(hw);
 
 	/* We need to run link autotry after the driver loads */
 	hw->mac.autotry_restart = TRUE;
Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.24 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.25
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.24	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Fri Dec 10 11:20:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_phy.c,v 1.24 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: ixgbe_phy.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.24 2021/04/30 06:55:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.25 2021/12/10 11:20:13 msaitoh Exp $");
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -46,10 +46,10 @@ __KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,
 
 static void ixgbe_i2c_start(struct ixgbe_hw *hw);
 static void ixgbe_i2c_stop(struct ixgbe_hw *hw);
-static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data);
+static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data);
 static s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data);
 static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw);
-static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data);
+static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data);
 static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data);
 static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl);
 static void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl);
@@ -84,11 +84,7 @@ static s32 ixgbe_out_i2c_byte_ack(struct
  */
 static s32 ixgbe_in_i2c_byte_ack(struct ixgbe_hw *hw, u8 *byte)
 {
-	s32 status;
-
-	status = ixgbe_clock_in_i2c_byte(hw, byte);
-	if (status)
-		return status;
+	ixgbe_clock_in_i2c_byte(hw, byte);
 	/* ACK */
 	return ixgbe_clock_out_i2c_bit(hw, FALSE);
 }
@@ -161,8 +157,7 @@ s32 ixgbe_read_i2c_combined_generic_int(
 		if (ixgbe_in_i2c_byte_ack(hw, _bits))
 			goto fail;
 		/* Get csum */
-		if (ixgbe_clock_in_i2c_byte(hw, _byte))
-			goto fail;
+		ixgbe_clock_in_i2c_byte(hw, _byte);
 		/* NACK */
 		if (ixgbe_clock_out_i2c_bit(hw, FALSE))
 			goto fail;
@@ -2125,9 +2120,7 @@ static s32 ixgbe_read_i2c_byte_generic_i
 		if (status != IXGBE_SUCCESS)
 			goto fail;
 
-		status = ixgbe_clock_in_i2c_byte(hw, data);
-		if (status != IXGBE_SUCCESS)
-			goto fail;
+		ixgbe_clock_in_i2c_byte(hw, data);
 
 		status = ixgbe_clock_out_i2c_bit(hw, nack);
 		if (status != IXGBE_SUCCESS)
@@ -2373,7 +2366,7 @@ static void ixgbe_i2c_stop(struct ixgbe_
  *
  *  Clocks in one byte data via I2C data/clock
  **/
-static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data)
+static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data)
 {
 	s32 i;
 	bool bit = 0;
@@ -2385,8 +2378,6 @@ static s32 ixgbe_clock_in_i2c_byte(struc
 		

CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:20:13 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_82599.c ixgbe_common.c ixgbe_common.h
ixgbe_phy.c ixgbe_x540.c

Log Message:
Remove unnecessary return value check.

  FreeBSD: 3a89005394bc5d82ce9b6baa9e7f8dee362354ae
  DPDK:4b0ee6529b7897c2a08dd56669f07ac1f46a8474


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe_x540.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:18:30 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c

Log Message:
Remove unused argument. Note that this file is not used in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/if_sriov.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/pci/ixgbe/if_sriov.c
diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.11 src/sys/dev/pci/ixgbe/if_sriov.c:1.12
--- src/sys/dev/pci/ixgbe/if_sriov.c:1.11	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/if_sriov.c	Fri Dec 10 11:18:30 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sriov.c,v 1.11 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: if_sriov.c,v 1.12 2021/12/10 11:18:30 msaitoh Exp $ */
 /**
 
   Copyright (c) 2001-2017, Intel Corporation
@@ -34,7 +34,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.11 2021/04/30 06:55:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.12 2021/12/10 11:18:30 msaitoh Exp $");
 
 #include "ixgbe.h"
 #include "ixgbe_sriov.h"
@@ -640,7 +640,7 @@ ixgbe_process_vf_msg(struct adapter *ada
 
 /* Tasklet for handling VF -> PF mailbox messages */
 void
-ixgbe_handle_mbx(void *context, int pending)
+ixgbe_handle_mbx(void *context)
 {
 	struct adapter *adapter = context;
 	struct ixgbe_hw *hw;
@@ -920,9 +920,9 @@ ixgbe_add_vf(device_t dev, u16 vfnum, co
 #else
 
 void
-ixgbe_handle_mbx(void *context, int pending)
+ixgbe_handle_mbx(void *context)
 {
-	UNREFERENCED_2PARAMETER(context, pending);
+	UNREFERENCED_1PARAMETER(context);
 } /* ixgbe_handle_mbx */
 
 inline int



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:18:30 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: if_sriov.c

Log Message:
Remove unused argument. Note that this file is not used in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/if_sriov.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:16:54 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_82599.c ixgbe_common.c ixgbe_dcb_82598.c
ixgbe_dcb_82599.c ixgbe_x550.c

Log Message:
Add typecast for type mismatch.

  FreeBSD: 994dd6328c66fc277438ad51ed074f3c52096147
  DPDK:d8e52b2cf771c31b523b46852fd86225b5a2c721


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ixgbe/ixgbe_x550.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/pci/ixgbe/ixgbe_82599.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.23 src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.24
--- src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.23	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_82599.c	Fri Dec 10 11:16:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_82599.c,v 1.23 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: ixgbe_82599.c,v 1.24 2021/12/10 11:16:54 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_82599.c,v 1.23 2021/04/30 06:55:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_82599.c,v 1.24 2021/12/10 11:16:54 msaitoh Exp $");
 
 #include "ixgbe_type.h"
 #include "ixgbe_82599.h"
@@ -1598,7 +1598,7 @@ void ixgbe_fdir_add_signature_filter_825
 	 * is for FDIRCMD.  Then do a 64-bit register write from FDIRHASH.
 	 */
 	fdirhashcmd = (u64)fdircmd << 32;
-	fdirhashcmd |= ixgbe_atr_compute_sig_hash_82599(input, common);
+	fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common);
 	IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd);
 
 	DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd);
@@ -1687,7 +1687,7 @@ static u32 ixgbe_get_fdirtcpm_82599(unio
 {
 	u32 mask = IXGBE_NTOHS(input_mask->formatted.dst_port);
 	mask <<= IXGBE_FDIRTCPM_DPORTM_SHIFT;
-	mask |= IXGBE_NTOHS(input_mask->formatted.src_port);
+	mask |= (u32)IXGBE_NTOHS(input_mask->formatted.src_port);
 	mask = ((mask & 0x) << 1) | ((mask & 0x) >> 1);
 	mask = ((mask & 0x) << 2) | ((mask & 0x) >> 2);
 	mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4);
@@ -1919,14 +1919,14 @@ s32 ixgbe_fdir_write_perfect_filter_8259
 		/* record source and destination port (little-endian)*/
 		fdirport = IXGBE_NTOHS(input->formatted.dst_port);
 		fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT;
-		fdirport |= IXGBE_NTOHS(input->formatted.src_port);
+		fdirport |= (u32)IXGBE_NTOHS(input->formatted.src_port);
 		IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport);
 	}
 
 	/* record VLAN (little-endian) and flex_bytes(big-endian) */
 	fdirvlan = IXGBE_STORE_AS_BE16(input->formatted.flex_bytes);
 	fdirvlan <<= IXGBE_FDIRVLAN_FLEX_SHIFT;
-	fdirvlan |= IXGBE_NTOHS(input->formatted.vlan_id);
+	fdirvlan |= (u32)IXGBE_NTOHS(input->formatted.vlan_id);
 	IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, fdirvlan);
 
 	if (cloud_mode) {

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.33 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.34
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.33	Mon Aug  2 12:56:24 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Fri Dec 10 11:16:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.33 2021/08/02 12:56:24 andvar Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.34 2021/12/10 11:16:54 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.33 2021/08/02 12:56:24 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.34 2021/12/10 11:16:54 msaitoh Exp $");
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -783,7 +783,7 @@ s32 ixgbe_read_pba_num_generic(struct ix
 		DEBUGOUT("NVM Read Error\n");
 		return ret_val;
 	}
-	*pba_num |= data;
+	*pba_num |= (u32)data;
 
 	return IXGBE_SUCCESS;
 }

Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.9 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.10
--- src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.9	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c	Fri Dec 10 11:16:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_dcb_82598.c,v 1.9 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: ixgbe_dcb_82598.c,v 1.10 2021/12/10 11:16:54 msaitoh Exp $ */
 

CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:16:54 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_82599.c ixgbe_common.c ixgbe_dcb_82598.c
ixgbe_dcb_82599.c ixgbe_x550.c

Log Message:
Add typecast for type mismatch.

  FreeBSD: 994dd6328c66fc277438ad51ed074f3c52096147
  DPDK:d8e52b2cf771c31b523b46852fd86225b5a2c721


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ixgbe/ixgbe_x550.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:14:18 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c

Log Message:
Initialize data field in struct buffer.

  FreeBSD: b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b or ix-3.3.14
  DPDK:40543be5376ca415b2a7e196315d0555725b8bdf

While sending request using ixgbe_hic_unlocked() the data field in
buffer struct is not used. It is set when the struct is overwritten by
FW to deliver the response. To not pass random data to FW the whole
structure should be zeroed before use.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixgbe_x550.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/pci/ixgbe/ixgbe_x550.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.20 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.21
--- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.20	Wed May 19 08:19:20 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Fri Dec 10 11:14:18 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_x550.c,v 1.20 2021/05/19 08:19:20 msaitoh Exp $ */
+/* $NetBSD: ixgbe_x550.c,v 1.21 2021/12/10 11:14:18 msaitoh Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.20 2021/05/19 08:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.21 2021/12/10 11:14:18 msaitoh Exp $");
 
 #include "ixgbe_x550.h"
 #include "ixgbe_x540.h"
@@ -3322,6 +3322,7 @@ s32 ixgbe_read_ee_hostif_X550(struct ixg
 	/* one word */
 	buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16));
 	buffer.pad2 = 0;
+	buffer.data = 0;
 	buffer.pad3 = 0;
 
 	status = hw->mac.ops.acquire_swfw_sync(hw, mask);
@@ -3382,6 +3383,7 @@ s32 ixgbe_read_ee_hostif_buffer_X550(str
 		buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2);
 		buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2);
 		buffer.pad2 = 0;
+		buffer.data = 0;
 		buffer.pad3 = 0;
 
 		status = ixgbe_hic_unlocked(hw, (u32 *), sizeof(buffer),



CVS commit: src/sys/dev/pci/ixgbe

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:14:18 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c

Log Message:
Initialize data field in struct buffer.

  FreeBSD: b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b or ix-3.3.14
  DPDK:40543be5376ca415b2a7e196315d0555725b8bdf

While sending request using ixgbe_hic_unlocked() the data field in
buffer struct is not used. It is set when the struct is overwritten by
FW to deliver the response. To not pass random data to FW the whole
structure should be zeroed before use.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixgbe_x550.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/acpitools/aml

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:09:52 UTC 2021

Modified Files:
src/usr.sbin/acpitools/aml: aml_evalobj.c

Log Message:
s/OCCURED/OCCURRED/ in a debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/acpitools/aml/aml_evalobj.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/acpitools/aml/aml_evalobj.c
diff -u src/usr.sbin/acpitools/aml/aml_evalobj.c:1.2 src/usr.sbin/acpitools/aml/aml_evalobj.c:1.3
--- src/usr.sbin/acpitools/aml/aml_evalobj.c:1.2	Sun Jan 14 05:33:18 2007
+++ src/usr.sbin/acpitools/aml/aml_evalobj.c	Fri Dec 10 11:09:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: aml_evalobj.c,v 1.2 2007/01/14 05:33:18 dogcow Exp $	*/
+/*	$NetBSD: aml_evalobj.c,v 1.3 2021/12/10 11:09:52 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999 Takanori Watanabe
@@ -30,7 +30,7 @@
  *	$FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_evalobj.c,v 1.4 2000/11/09 06:24:45 iwasaki Exp $
  */
 #include 
-__RCSID("$NetBSD: aml_evalobj.c,v 1.2 2007/01/14 05:33:18 dogcow Exp $");
+__RCSID("$NetBSD: aml_evalobj.c,v 1.3 2021/12/10 11:09:52 msaitoh Exp $");
 
 #include 
 
@@ -260,7 +260,7 @@ reevaluate:
 		tmp = aml_execute_method(copy);
 		obj = aml_eval_name(env, tmp);
 		if (copy->stat == aml_stat_panic) {
-			AML_DEBUGPRINT("PANIC OCCURED IN METHOD");
+			AML_DEBUGPRINT("PANIC OCCURRED IN METHOD");
 			env->stat = aml_stat_panic;
 			ret = NULL;
 			aml_local_stack_delete(aml_local_stack_pop());



CVS commit: src/usr.sbin/acpitools/aml

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:09:52 UTC 2021

Modified Files:
src/usr.sbin/acpitools/aml: aml_evalobj.c

Log Message:
s/OCCURED/OCCURRED/ in a debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/acpitools/aml/aml_evalobj.c

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



CVS commit: src/lib/libnvmm

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:08:46 UTC 2021

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

Log Message:
s/premissions/permissions/


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 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.27 src/lib/libnvmm/libnvmm.3:1.28
--- src/lib/libnvmm/libnvmm.3:1.27	Sat Sep  5 07:22:25 2020
+++ src/lib/libnvmm/libnvmm.3	Fri Dec 10 11:08:45 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnvmm.3,v 1.27 2020/09/05 07:22:25 maxv Exp $
+.\"	$NetBSD: libnvmm.3,v 1.28 2021/12/10 11:08:45 msaitoh Exp $
 .\"
 .\" Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 9, 2020
+.Dd December 10, 2021
 .Dt LIBNVMM 3
 .Os
 .Sh NAME
@@ -246,7 +246,7 @@ the guest virtual address given in
 .Fa gva
 into a guest physical address returned in
 .Fa gpa .
-The associated page premissions are returned in
+The associated page permissions are returned in
 .Fa prot .
 .Fa gva
 must be page-aligned.
@@ -258,7 +258,7 @@ the guest physical address indicated in
 .Fa gpa
 into a host virtual address returned in
 .Fa hva .
-The associated page premissions are returned in
+The associated page permissions are returned in
 .Fa prot .
 .Fa gpa
 must be page-aligned.



CVS commit: src/lib/libnvmm

2021-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 10 11:08:46 UTC 2021

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

Log Message:
s/premissions/permissions/


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

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



CVS commit: src/sys/fs/union

2021-12-10 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Dec 10 09:20:38 UTC 2021

Modified Files:
src/sys/fs/union: union_vnops.c

Log Message:
Fix previous, don't copy up if the underlying node is unreadable.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/fs/union/union_vnops.c

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

Modified files:

Index: src/sys/fs/union/union_vnops.c
diff -u src/sys/fs/union/union_vnops.c:1.80 src/sys/fs/union/union_vnops.c:1.81
--- src/sys/fs/union/union_vnops.c:1.80	Sun Dec  5 16:16:58 2021
+++ src/sys/fs/union/union_vnops.c	Fri Dec 10 09:20:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vnops.c,v 1.80 2021/12/05 16:16:58 hannken Exp $	*/
+/*	$NetBSD: union_vnops.c,v 1.81 2021/12/10 09:20:38 hannken Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.80 2021/12/05 16:16:58 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.81 2021/12/10 09:20:38 hannken Exp $");
 
 #include 
 #include 
@@ -771,10 +771,20 @@ union_access(void *v)
 		}
 	}
 
+	/*
+	 * Copy up to prevent checking (and failing) against
+	 * underlying file system mounted read only.
+	 * Check for read access first to prevent implicit
+	 * copy of unaccessible underlying vnode.
+	 */
 	if (un->un_uppervp == NULLVP &&
 	(un->un_lowervp->v_type == VREG) &&
 	(ap->a_accmode & VWRITE)) {
-		error = union_copyup(un, 1, ap->a_cred, curlwp);
+		vn_lock(un->un_lowervp, LK_EXCLUSIVE | LK_RETRY);
+		error = VOP_ACCESS(un->un_lowervp, VREAD, ap->a_cred);
+		VOP_UNLOCK(un->un_lowervp);
+		if (error == 0)
+			error = union_copyup(un, 1, ap->a_cred, curlwp);
 		if (error)
 			return error;
 	}



CVS commit: src/sys/fs/union

2021-12-10 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Dec 10 09:20:38 UTC 2021

Modified Files:
src/sys/fs/union: union_vnops.c

Log Message:
Fix previous, don't copy up if the underlying node is unreadable.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/fs/union/union_vnops.c

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