CVS commit: src/external/gpl3/gcc/usr.bin/backend

2018-04-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr  5 05:38:59 UTC 2018

Modified Files:
src/external/gpl3/gcc/usr.bin/backend: Makefile

Log Message:
pretty much everything depends upon insn-opinit.h via optabs-query.h
so set it in DPSRCS.  hopefully this fixes PR 53137.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/external/gpl3/gcc/usr.bin/backend/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.45 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.46
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.45	Mon Apr  2 22:35:26 2018
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Thu Apr  5 05:38:59 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45 2018/04/02 22:35:26 mrg Exp $
+#	$NetBSD: Makefile,v 1.46 2018/04/05 05:38:59 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -417,6 +417,8 @@ insn-opinit.c: genopinit ${G_md_file} in
 	mv ${.TARGET}.tmp ${.TARGET}
 CLEANFILES+=	insn-opinit.h insn-opinit.c
 
+DPSRCS+= insn-opinit.h
+
 LDFLAGS.genautomata+=	-lm
 
 # gencondmd outputs a special .md file



CVS commit: src/sys/net

2018-04-04 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Apr  5 03:39:14 UTC 2018

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

Log Message:
Kill remaining rt->rt_refcnt++


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/net/route.c

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

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.207 src/sys/net/route.c:1.208
--- src/sys/net/route.c:1.207	Fri Mar 23 04:09:41 2018
+++ src/sys/net/route.c	Thu Apr  5 03:39:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.207 2018/03/23 04:09:41 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.208 2018/04/05 03:39:14 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.207 2018/03/23 04:09:41 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.208 2018/04/05 03:39:14 ozaki-r Exp $");
 
 #include 
 #ifdef RTFLUSH_DEBUG
@@ -2124,7 +2124,7 @@ rt_delete_matched_entries(sa_family_t fa
 			RT_UNLOCK();
 			return;
 		}
-		rt->rt_refcnt++;
+		rt_ref(rt);
 		splx(s);
 		RT_UNLOCK();
 



CVS commit: src/usr.bin/make

2018-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  5 00:31:11 UTC 2018

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

Log Message:
Be more selective about detecting a SYSV include as opposed to a dependency
line. Dependency lines should contain a '::' operator or ':'.


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.227 src/usr.bin/make/parse.c:1.228
--- src/usr.bin/make/parse.c:1.227	Wed Feb 21 20:59:28 2018
+++ src/usr.bin/make/parse.c	Wed Apr  4 20:31:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $	*/
+/*	$NetBSD: parse.c,v 1.228 2018/04/05 00:31:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.228 2018/04/05 00:31:10 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.228 2018/04/05 00:31:10 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -365,9 +365,6 @@ static void ParseHasCommands(void *);
 static void ParseDoInclude(char *);
 static void ParseSetParseFile(const char *);
 static void ParseSetIncludedFile(void);
-#ifdef SYSVINCLUDE
-static void ParseTraditionalInclude(char *);
-#endif
 #ifdef GMAKEEXPORT
 static void ParseGmakeExport(char *);
 #endif
@@ -2504,8 +2501,73 @@ Parse_SetInput(const char *name, int lin
 ParseSetParseFile(name);
 }
 
+/*-
+ *---
+ * IsInclude --
+ *	Check if the line is an include directive
+ *
+ * Results:
+ *	TRUE if it is.
+ *
+ * Side Effects:
+ *	None
+ *
+ *---
+ */
+static Boolean
+IsInclude(const char *line, Boolean sysv)
+{
+	static const char inc[] = "include";
+	static const size_t inclen = sizeof(inc) - 1;
+
+	// 'd' is not valid for sysv
+	int o = strchr("ds-" + sysv, *line) != NULL;
+
+	if (strncmp(line + o, inc, inclen) != 0)
+		return FALSE;
+
+	// Space is not mandatory for BSD .include
+	return !sysv || isspace((unsigned char)line[inclen + o]);
+}
+
+
 #ifdef SYSVINCLUDE
 /*-
+ *---
+ * IsSysVInclude --
+ *	Check if the line is a SYSV include directive
+ *
+ * Results:
+ *	TRUE if it is.
+ *
+ * Side Effects:
+ *	None
+ *
+ *---
+ */
+static Boolean
+IsSysVInclude(const char *line)
+{
+	const char *p;
+
+	if (!IsInclude(line, TRUE))
+		return FALSE;
+
+	/* Avoid interpeting a dependency line as an include */
+	for (p = line; (p = strchr(p, ':')) != NULL;) {
+		if (*++p == '\0') {
+			/* end of line -> dependency */
+			return FALSE;
+		}
+		if (*p == ':' || isspace((unsigned char)*p)) {
+			/* :: operator or ': ' -> dependency */
+			return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+/*-
  *-
  * ParseTraditionalInclude  --
  *	Push to another file.
@@ -3004,9 +3066,7 @@ Parse_File(const char *name, int fd)
 		for (cp = line + 1; isspace((unsigned char)*cp); cp++) {
 		continue;
 		}
-		if (strncmp(cp, "include", 7) == 0 ||
-			((cp[0] == 'd' || cp[0] == 's' || cp[0] == '-') &&
-			strncmp(&cp[1], "include", 7) == 0)) {
+		if (IsInclude(cp, FALSE)) {
 		ParseDoInclude(cp);
 		continue;
 		}
@@ -3068,12 +3128,7 @@ Parse_File(const char *name, int fd)
 	}
 
 #ifdef SYSVINCLUDE
-	if (((strncmp(line, "include", 7) == 0 &&
-		isspace((unsigned char) line[7])) ||
-			((line[0] == 's' || line[0] == '-') &&
-			strncmp(&line[1], "include", 7) == 0 &&
-			isspace((unsigned char) line[8]))) &&
-		strchr(line, ':') == NULL) {
+	if (IsSysVInclude(line)) {
 		/*
 		 * It's an S3/S5-style "include".
 		 */



CVS commit: src/tests/usr.bin/c++

2018-04-04 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  4 23:53:26 UTC 2018

Modified Files:
src/tests/usr.bin/c++: Makefile
Added Files:
src/tests/usr.bin/c++: t_asan_double_free.sh
t_asan_global_buffer_overflow.sh t_asan_heap_overflow.sh
t_asan_off_by_one.sh t_asan_uaf.sh

Log Message:
Add new ATF tests for Address Sanitzier (ASan)

Add new C and C++ tests:
 - t_asan_double_free
 - t_asan_global_buffer_overflow
 - t_asan_heap_overflow
 - t_asan_off_by_one
 - t_asan_uaf

Each tests checks:
 - regular build
 - 32-bit
 - PIC
 - PIE
 - profile

These tests require paxctl(8) to disable ASLR in order to work in a
predictable way. This is especially true for all !regular builds with
additional compiler flags.

There are no static variations of these tests as this mode is not supported
in upstream ASan.

Enable these tests on amd64 and i386.

This is part two patch, adding the remaining C++ changes.

Patch submitted by 
Additional polishing by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/c++/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/t_asan_double_free.sh \
src/tests/usr.bin/c++/t_asan_global_buffer_overflow.sh \
src/tests/usr.bin/c++/t_asan_heap_overflow.sh \
src/tests/usr.bin/c++/t_asan_off_by_one.sh \
src/tests/usr.bin/c++/t_asan_uaf.sh

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

Modified files:

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.6 src/tests/usr.bin/c++/Makefile:1.7
--- src/tests/usr.bin/c++/Makefile:1.6	Wed Apr  4 15:53:04 2018
+++ src/tests/usr.bin/c++/Makefile	Wed Apr  4 23:53:26 2018
@@ -1,10 +1,15 @@
-# $NetBSD: Makefile,v 1.6 2018/04/04 15:53:04 kamil Exp $
+# $NetBSD: Makefile,v 1.7 2018/04/04 23:53:26 kamil Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/c++
 
 TESTS_SH=	#
+TESTS_SH+=	t_asan_double_free
+TESTS_SH+=	t_asan_global_buffer_overflow
+TESTS_SH+=	t_asan_heap_overflow
+TESTS_SH+=	t_asan_off_by_one
+TESTS_SH+=	t_asan_uaf
 TESTS_SH+=	t_call_once
 TESTS_SH+=	t_call_once2
 TESTS_SH+=	t_cxxruntime

Added files:

Index: src/tests/usr.bin/c++/t_asan_double_free.sh
diff -u /dev/null src/tests/usr.bin/c++/t_asan_double_free.sh:1.1
--- /dev/null	Wed Apr  4 23:53:27 2018
+++ src/tests/usr.bin/c++/t_asan_double_free.sh	Wed Apr  4 23:53:26 2018
@@ -0,0 +1,212 @@
+#	$NetBSD: t_asan_double_free.sh,v 1.1 2018/04/04 23:53:26 kamil Exp $
+#
+# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Siddharth Muralee.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+SUPPORT='n'
+test_target() {
+	if uname -m | grep -q "amd64"; then
+		SUPPORT='y'
+	fi
+
+	if uname -m | grep -q "i386"; then
+		SUPPORT='y'
+	fi
+}
+
+atf_test_case double_free
+double_free_head() {
+	atf_set "descr" "compile and run \"Double Free example\""
+	atf_set "require.progs" "c++ paxctl"
+}
+
+atf_test_case double_free_profile
+double_free_profile_head() {
+	atf_set "descr" "compile and run \"Double Free example\" with profiling option"
+	atf_set "require.progs" "c++ paxctl"
+}
+
+atf_test_case double_free_pic
+double_free_pic_head() {
+	atf_set "descr" "compile and run PIC \"Double Free example\""
+	atf_set "require.progs" "c++ paxctl"
+}
+
+atf_test_case double_free_pie
+double_free_pie_head() {
+	atf_set "descr" "compile and run position independent (PIE) \"Double Free example\""
+	atf_set "require.progs" "c++ paxctl"
+}
+
+atf_test_case double_free32
+double_free32_head() {
+	atf_set "descr" "compile and run \"Double Free example\" for/in netbsd32 emulation"
+	at

CVS commit: src

2018-04-04 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  4 23:51:35 UTC 2018

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/cc: Makefile
Added Files:
src/tests/usr.bin/cc: t_asan_double_free.sh
t_asan_global_buffer_overflow.sh t_asan_heap_overflow.sh
t_asan_off_by_one.sh t_asan_uaf.sh

Log Message:
Add new ATF tests for Address Sanitzier (ASan)

Add new C and C++ tests:
 - t_asan_double_free
 - t_asan_global_buffer_overflow
 - t_asan_heap_overflow
 - t_asan_off_by_one
 - t_asan_uaf

Each tests checks:
 - regular build
 - 32-bit
 - PIC
 - PIE
 - profile

These tests require paxctl(8) to disable ASLR in order to work in a
predictable way. This is especially true for all !regular builds with
additional compiler flags.

There are no static variations of these tests as this mode is not supported
in upstream ASan.

Enable these tests on amd64 and i386.

Patch submitted by 
Additional polishing by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.779 -r1.780 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/t_asan_double_free.sh \
src/tests/usr.bin/cc/t_asan_global_buffer_overflow.sh \
src/tests/usr.bin/cc/t_asan_heap_overflow.sh \
src/tests/usr.bin/cc/t_asan_off_by_one.sh \
src/tests/usr.bin/cc/t_asan_uaf.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.779 src/distrib/sets/lists/tests/mi:1.780
--- src/distrib/sets/lists/tests/mi:1.779	Wed Apr  4 16:42:48 2018
+++ src/distrib/sets/lists/tests/mi	Wed Apr  4 23:51:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.779 2018/04/04 16:42:48 kamil Exp $
+# $NetBSD: mi,v 1.780 2018/04/04 23:51:35 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3635,6 +3635,11 @@
 ./usr/tests/usr.bin/c++tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/Atffile			tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua,cxx
+./usr/tests/usr.bin/c++/t_asan_double_free	tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_asan_global_buffer_overflow	tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_asan_heap_overflow	tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_asan_off_by_one	tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_asan_uaf		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once2		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_cxxruntime		tests-usr.bin-tests	compattestfile,atf,cxx
@@ -3645,6 +3650,11 @@
 ./usr/tests/usr.bin/cc/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/Kyuafile			tests-usr.bin-tests	compattestfile,atf,kyua
 ./usr/tests/usr.bin/cc/t_hello			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_double_free	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_global_buffer_overflow	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_heap_overflow	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_off_by_one	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_uaf		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cmptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cmp/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cmp/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/tests/usr.bin/cc/Makefile
diff -u src/tests/usr.bin/cc/Makefile:1.1 src/tests/usr.bin/cc/Makefile:1.2
--- src/tests/usr.bin/cc/Makefile:1.1	Sat Mar 17 17:15:29 2012
+++ src/tests/usr.bin/cc/Makefile	Wed Apr  4 23:51:35 2018
@@ -1,9 +1,15 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 17:15:29 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2018/04/04 23:51:35 kamil Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/cc
 
-TESTS_SH=	t_hello
+TESTS_SH=	#
+TESTS_SH+=	t_asan_double_free
+TESTS_SH+=	t_asan_global_buffer_overflow
+TESTS_SH+=	t_asan_heap_overflow
+TESTS_SH+=	t_asan_off_by_one
+TESTS_SH+=	t_asan_uaf
+TESTS_SH+=	t_hello
 
 .include 

Added files:

Index: src/tests/usr.bin/cc/t_asan_double_free.sh
diff -u /dev/null src/tests/usr.bin/cc/t_asan_double_free.sh:1.1
--- /dev/null	Wed Apr  4 23:51:35 2018
+++ src/tests/usr.bin/cc/t_asan_double_free.sh	Wed Apr  4 23:51:35 2018
@@ -0,0 +1,211 @@
+#	$NetBSD: t_asan_double_free.sh,v 1.1 2018/04/04 23:51:35 kamil Exp $
+#
+# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Siddharth Muralee.
+#
+# Redistributio

CVS commit: src/sys/arch

2018-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  4 22:52:59 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: spl.S
src/sys/arch/i386/i386: spl.S
src/sys/arch/x86/include: intr.h
src/sys/arch/x86/x86: intr.c

Log Message:
Rename Xpreempt{recurse,resume} -> X{recurse,resume}_preempt so that
they fit the pattern. Also the debugger trap sniffer matches them
without adding special entries...
XXX: pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/spl.S
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/i386/spl.S
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/x86/x86/intr.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.33 src/sys/arch/amd64/amd64/spl.S:1.34
--- src/sys/arch/amd64/amd64/spl.S:1.33	Mon Apr  2 18:29:33 2018
+++ src/sys/arch/amd64/amd64/spl.S	Wed Apr  4 18:52:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.33 2018/04/02 22:29:33 mlelstv Exp $	*/
+/*	$NetBSD: spl.S,v 1.34 2018/04/04 22:52:58 christos Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -156,25 +156,25 @@ END(softint_trigger)
 
 
 /*
- * Xpreemptrecurse()
+ * Xrecurse_preempt()
  *
  * Handles preemption interrupts via Xspllower().
  */
-IDTVEC(preemptrecurse)
+IDTVEC(recurse_preempt)
 	movl	$IPL_PREEMPT,CPUVAR(ILEVEL)
 	sti
 	xorq	%rdi,%rdi
 	call	_C_LABEL(kpreempt)
 	cli
 	jmp	*%r13			/* back to Xspllower */
-IDTVEC_END(preemptrecurse)
+IDTVEC_END(recurse_preempt)
 
 /*
- * Xpreemptresume()
+ * Xresume_preempt()
  *
  * Handles preemption interrupts via Xdoreti().
  */
-IDTVEC(preemptresume)
+IDTVEC(resume_preempt)
 	movl	$IPL_PREEMPT,CPUVAR(ILEVEL)
 	sti
 	testq	$SEL_RPL,TF_CS(%rsp)
@@ -187,7 +187,7 @@ IDTVEC(preemptresume)
 	call	_C_LABEL(preempt)	/* from user */
 	cli
 	jmp	*%r13			/* back to Xdoreti */
-IDTVEC_END(preemptresume)
+IDTVEC_END(resume_preempt)
 
 /*
  * int splraise(int s);

Index: src/sys/arch/i386/i386/spl.S
diff -u src/sys/arch/i386/i386/spl.S:1.42 src/sys/arch/i386/i386/spl.S:1.43
--- src/sys/arch/i386/i386/spl.S:1.42	Sat Jan 27 13:44:19 2018
+++ src/sys/arch/i386/i386/spl.S	Wed Apr  4 18:52:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.42 2018/01/27 18:44:19 maxv Exp $	*/
+/*	$NetBSD: spl.S,v 1.43 2018/04/04 22:52:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.42 2018/01/27 18:44:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.43 2018/04/04 22:52:58 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_spldebug.h"
@@ -389,11 +389,11 @@ ENTRY(softint_trigger)
 END(softint_trigger)
 
 /*
- * Xpreemptrecurse()
+ * Xrecurse_preempt()
  *
  * Handles preemption interrupts via Xspllower().
  */
-IDTVEC(preemptrecurse)
+IDTVEC(recurse_preempt)
 	movl	$IPL_PREEMPT,CPUVAR(ILEVEL)
 	sti
 	pushl	$0
@@ -401,14 +401,14 @@ IDTVEC(preemptrecurse)
 	addl	$4,%esp
 	cli
 	jmp	*%esi
-IDTVEC_END(preemptrecurse)
+IDTVEC_END(recurse_preempt)
 
 /*
- * Xpreemptresume()
+ * Xresume_preempt()
  *
  * Handles preemption interrupts via Xdoreti().
  */
-IDTVEC(preemptresume)
+IDTVEC(resume_preempt)
 	movl	$IPL_PREEMPT,CPUVAR(ILEVEL)
 	sti
 	testb	$CHK_UPL,TF_CS(%esp)
@@ -423,5 +423,5 @@ IDTVEC(preemptresume)
 	call	_C_LABEL(preempt)		/* from user */
 	cli
 	jmp	*%esi
-IDTVEC_END(preemptresume)
+IDTVEC_END(resume_preempt)
 #endif /* !XEN */

Index: src/sys/arch/x86/include/intr.h
diff -u src/sys/arch/x86/include/intr.h:1.54 src/sys/arch/x86/include/intr.h:1.55
--- src/sys/arch/x86/include/intr.h:1.54	Sat Feb 17 13:51:53 2018
+++ src/sys/arch/x86/include/intr.h	Wed Apr  4 18:52:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.54 2018/02/17 18:51:53 maxv Exp $	*/
+/*	$NetBSD: intr.h,v 1.55 2018/04/04 22:52:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -194,8 +194,8 @@ splraiseipl(ipl_cookie_t icookie)
  */
 
 void Xsoftintr(void);
-void Xpreemptrecurse(void);
-void Xpreemptresume(void);
+void Xrecurse_preempt(void);
+void Xresume_preempt(void);
 
 extern struct intrstub legacy_stubs[];
 extern struct intrstub ioapic_edge_stubs[];

Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.124 src/sys/arch/x86/x86/intr.c:1.125
--- src/sys/arch/x86/x86/intr.c:1.124	Sun Mar 25 22:30:08 2018
+++ src/sys/arch/x86/x86/intr.c	Wed Apr  4 18:52:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.124 2018/03/26 02:30:08 knakahara Exp $	*/
+/*	$NetBSD: intr.c,v 1.125 2018/04/04 22:52:59 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.124 2018/03/26 02:30:08 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.125 2018/

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

2018-04-04 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Wed Apr  4 21:39:35 UTC 2018

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3
src/crypto/external/bsd/netpgp/dist/src/libbn: libnetpgpbn.3
src/crypto/external/bsd/netpgp/dist/src/libmj: libmj.3
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: netpgpverify.1

Log Message:
Drop superfluous zero prefix for single digit number days.

heads up by wiz


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.19 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.20
--- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.19	Tue Apr  3 21:57:14 2018
+++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3	Wed Apr  4 21:39:35 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgp.3,v 1.19 2018/04/03 21:57:14 sevan Exp $
+.\" $NetBSD: libnetpgp.3,v 1.20 2018/04/04 21:39:35 sevan Exp $
 .\"
 .\" Copyright (c) 2009,2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 03, 2018
+.Dd April 3, 2018
 .Dt LIBNETPGP 3
 .Os
 .Sh NAME

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.5 src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.6
--- src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.5	Tue Apr  3 21:57:14 2018
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3	Wed Apr  4 21:39:35 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgpbn.3,v 1.5 2018/04/03 21:57:14 sevan Exp $
+.\" $NetBSD: libnetpgpbn.3,v 1.6 2018/04/04 21:39:35 sevan Exp $
 .\"
 .\" Copyright (c) 2010 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 03, 2018
+.Dd April 3, 2018
 .Dt LIBNETPGPBN 3
 .Os
 .Sh NAME

Index: src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.8 src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.9
--- src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.8	Tue Apr  3 21:57:14 2018
+++ src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3	Wed Apr  4 21:39:35 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libmj.3,v 1.8 2018/04/03 21:57:14 sevan Exp $
+.\" $NetBSD: libmj.3,v 1.9 2018/04/04 21:39:35 sevan Exp $
 .\"
 .\" Copyright (c) 2010 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 03, 2018
+.Dd April 3, 2018
 .Dt LIBMJ 3
 .Os
 .Sh NAME

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.12 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.13
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.12	Tue Apr  3 21:57:14 2018
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1	Wed Apr  4 21:39:35 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: netpgpverify.1,v 1.12 2018/04/03 21:57:14 sevan Exp $
+.\" $NetBSD: netpgpverify.1,v 1.13 2018/04/04 21:39:35 sevan Exp $
 .\"
 .\" Copyright (c) 2013,2014,2015 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 03, 2018
+.Dd April 3, 2018
 .Dt NETPGPVERIFY 1
 .Os
 .Sh NAME



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

2018-04-04 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  4 16:42:48 UTC 2018

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Sort files in usr/tests/usr.bin/c++/

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.778 -r1.779 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.778 src/distrib/sets/lists/tests/mi:1.779
--- src/distrib/sets/lists/tests/mi:1.778	Sat Mar 24 00:26:51 2018
+++ src/distrib/sets/lists/tests/mi	Wed Apr  4 16:42:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.778 2018/03/24 00:26:51 kamil Exp $
+# $NetBSD: mi,v 1.779 2018/04/04 16:42:48 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3635,12 +3635,12 @@
 ./usr/tests/usr.bin/c++tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/Atffile			tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua,cxx
-./usr/tests/usr.bin/c++/t_cxxruntime		tests-usr.bin-tests	compattestfile,atf,cxx
-./usr/tests/usr.bin/c++/t_hello			tests-usr.bin-tests	compattestfile,atf,cxx
-./usr/tests/usr.bin/c++/t_static_destructor	tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once2		tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_cxxruntime		tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_hello			tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_pthread_once		tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_static_destructor	tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/cctests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/Kyuafile			tests-usr.bin-tests	compattestfile,atf,kyua



CVS commit: [netbsd-8] src/doc

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:42:03 UTC 2018

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

Log Message:
Tickets #692 and #693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.162 -r1.1.2.163 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.162 src/doc/CHANGES-8.0:1.1.2.163
--- src/doc/CHANGES-8.0:1.1.2.162	Wed Apr  4 16:29:24 2018
+++ src/doc/CHANGES-8.0	Wed Apr  4 16:42:03 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.162 2018/04/04 16:29:24 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.163 2018/04/04 16:42:03 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -10866,4 +10866,26 @@ sys/arch/amd64/conf/GENERIC			1.485
 	Enable SVS by default.
 	[maxv, #ticket #691]
 
+sys/arch/i386/stand/efiboot/TODO.efiboot	1.5
+sys/arch/i386/stand/efiboot/boot.c		1.9
+sys/arch/i386/stand/efiboot/devopen.c		1.4
+sys/arch/i386/stand/efiboot/devopen.h		1.2
+sys/arch/i386/stand/efiboot/efidisk.c		1.5
+sys/arch/i386/stand/efiboot/efidisk.h		1.3
+sys/arch/i386/stand/lib/biosdisk.c		1.49
+sys/arch/i386/stand/lib/biosdisk.h		1.10
+sys/arch/i386/stand/lib/bootmenu.c		1.17
+sys/arch/i386/stand/lib/bootmenu.h		1.6
+sys/lib/libsa/bootcfg.c1.3
+sys/lib/libsa/bootcfg.h1.2
+
+	efiboot: try to read boot.cfg from /EFI/NetBSD on ESP
+	of the booted disk.
+	[nonaka, ticket #692]
+
+sys/net/npf/npf.h1.55
+
+	Fix an integer overflow that allows incoming IPv6 packets
+	to bypass a certain number of filtering rules.
+	[maxv, ticket #693]
 



CVS commit: [netbsd-8] src/sys/net/npf

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:40:42 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-8]: npf.h

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

sys/net/npf/npf.h: revision 1.55

Fix a vulnerability in NPF, that allows whatever incoming IPv6 packet to
bypass a certain number of filtering rules.

Basically there is an integer overflow in npf_cache_ip: npc_hlen is a
8bit unsigned int, and can wrap to zero if the IPv6 packet being processed
has large extensions.

As a result of an overflow, (mbuf + npc_hlen) won't point at the real
protocol header, but instead at some garbage within the packet. That
garbage, is what NPF applies its rules on.

If these filtering rules allow the packet to enter, that packet is given
to the main IPv6 entry point. This entry point, however, is not subject to
an integer overflow, so it will actually parse the correct protocol header.

The result is: NPF read a wrong header, allowed the packet to enter, the
kernel read the correct header, and delivered the packet depending on this
correct header. So the offending packet was supposed to be kicked, but
still went through the firewall.

Simple example, a packet with:

packet +   0 = IP6 Header
packet +  40 = IP6 Routing header (ip6r_len = 31)
packet +  48 = Crafted UDP header (uh_dport = )
packet + 296 = IP6 Dest header (ip6e_len = 0)
packet + 304 = Real UDP header (uh_dport = )

Will bypass a rule of the kind "block port ". Here NPF reads the
crafted UDP header, sees , lets the packet in; later the kernel reads
the real UDP header, and delivers it on port .

Fix this by using uint32_t. While here, it seems to me there is also a
memory overflow: still in npf_cache_ip, npc_hlen may be incremented with
a value that goes beyond the mbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.6.1 src/sys/net/npf/npf.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/net/npf/npf.h
diff -u src/sys/net/npf/npf.h:1.54 src/sys/net/npf/npf.h:1.54.6.1
--- src/sys/net/npf/npf.h:1.54	Sun Jan 29 00:15:54 2017
+++ src/sys/net/npf/npf.h	Wed Apr  4 16:40:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.h,v 1.54 2017/01/29 00:15:54 christos Exp $	*/
+/*	$NetBSD: npf.h,v 1.54.6.1 2018/04/04 16:40:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -159,7 +159,7 @@ typedef struct {
 	uint8_t			npc_alen;
 
 	/* IP header length and L4 protocol. */
-	uint8_t			npc_hlen;
+	uint32_t		npc_hlen;
 	uint16_t		npc_proto;
 
 	/* IPv4, IPv6. */



CVS commit: [netbsd-8] src/sys

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:34:39 UTC 2018

Modified Files:
src/sys/arch/i386/stand/efiboot [netbsd-8]: TODO.efiboot boot.c
devopen.c devopen.h efidisk.c efidisk.h
src/sys/arch/i386/stand/lib [netbsd-8]: biosdisk.c biosdisk.h
bootmenu.c bootmenu.h
src/sys/lib/libsa [netbsd-8]: bootcfg.c bootcfg.h

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #692):

sys/arch/i386/stand/efiboot/devopen.c: revision 1.4
sys/arch/i386/stand/efiboot/efidisk.c: revision 1.5
sys/arch/i386/stand/efiboot/devopen.h: revision 1.2
sys/arch/i386/stand/efiboot/efidisk.h: revision 1.3
sys/lib/libsa/bootcfg.h: revision 1.2
sys/arch/i386/stand/efiboot/boot.c: revision 1.9
sys/lib/libsa/bootcfg.c: revision 1.3
sys/arch/i386/stand/lib/bootmenu.c: revision 1.17
sys/arch/i386/stand/lib/biosdisk.c: revision 1.49
sys/arch/i386/stand/efiboot/TODO.efiboot: revision 1.5
sys/arch/i386/stand/lib/bootmenu.h: revision 1.6
sys/arch/i386/stand/lib/biosdisk.h: revision 1.10

efiboot: try to read boot.cfg from /EFI/NetBSD on ESP of the booted disk.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 \
src/sys/arch/i386/stand/efiboot/TODO.efiboot
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/sys/arch/i386/stand/efiboot/boot.c
cvs rdiff -u -r1.1.12.2 -r1.1.12.3 src/sys/arch/i386/stand/efiboot/devopen.c
cvs rdiff -u -r1.1 -r1.1.12.1 src/sys/arch/i386/stand/efiboot/devopen.h
cvs rdiff -u -r1.1.12.3 -r1.1.12.4 src/sys/arch/i386/stand/efiboot/efidisk.c
cvs rdiff -u -r1.1.12.1 -r1.1.12.2 src/sys/arch/i386/stand/efiboot/efidisk.h
cvs rdiff -u -r1.46.6.2 -r1.46.6.3 src/sys/arch/i386/stand/lib/biosdisk.c
cvs rdiff -u -r1.8.52.1 -r1.8.52.2 src/sys/arch/i386/stand/lib/biosdisk.h
cvs rdiff -u -r1.16 -r1.16.10.1 src/sys/arch/i386/stand/lib/bootmenu.c
cvs rdiff -u -r1.5 -r1.5.20.1 src/sys/arch/i386/stand/lib/bootmenu.h
cvs rdiff -u -r1.2 -r1.2.22.1 src/sys/lib/libsa/bootcfg.c
cvs rdiff -u -r1.1 -r1.1.24.1 src/sys/lib/libsa/bootcfg.h

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

Modified files:

Index: src/sys/arch/i386/stand/efiboot/TODO.efiboot
diff -u src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3.10.1 src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3.10.2
--- src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3.10.1	Tue Mar 13 14:54:52 2018
+++ src/sys/arch/i386/stand/efiboot/TODO.efiboot	Wed Apr  4 16:34:39 2018
@@ -1,6 +1,5 @@
 - efiboot
  * handle UEFI variables
- * load boot.cfg from EFI system partition (FAT32)
 
 - kernel
  * handle UEFI variables (/dev/efivar)

Index: src/sys/arch/i386/stand/efiboot/boot.c
diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.5.2.3 src/sys/arch/i386/stand/efiboot/boot.c:1.5.2.4
--- src/sys/arch/i386/stand/efiboot/boot.c:1.5.2.3	Mon Apr  2 08:50:33 2018
+++ src/sys/arch/i386/stand/efiboot/boot.c	Wed Apr  4 16:34:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.5.2.3 2018/04/02 08:50:33 martin Exp $	*/
+/*	$NetBSD: boot.c,v 1.5.2.4 2018/04/04 16:34:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -55,7 +55,9 @@ static const char * const names[][2] = {
 #define NUMNAMES	__arraycount(names)
 #define DEFFILENAME	names[0][0]
 
-#define	MAXDEVNAME	16
+#ifndef	EFIBOOTCFG_FILENAME
+#define	EFIBOOTCFG_FILENAME	"esp:/EFI/NetBSD/boot.cfg"
+#endif
 
 void	command_help(char *);
 void	command_quit(char *);
@@ -273,6 +275,10 @@ boot(void)
 	default_filename = DEFFILENAME;
 
 	if (!(boot_params.bp_flags & X86_BP_FLAGS_NOBOOTCONF)) {
+#ifdef EFIBOOTCFG_FILENAME
+		int rv = parsebootconf(EFIBOOTCFG_FILENAME);
+		if (rv)
+#endif
 		parsebootconf(BOOTCFG_FILENAME);
 	} else {
 		bootcfg_info.timeout = boot_params.bp_timeout;

Index: src/sys/arch/i386/stand/efiboot/devopen.c
diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.1.12.2 src/sys/arch/i386/stand/efiboot/devopen.c:1.1.12.3
--- src/sys/arch/i386/stand/efiboot/devopen.c:1.1.12.2	Wed Mar 21 10:50:49 2018
+++ src/sys/arch/i386/stand/efiboot/devopen.c	Wed Apr  4 16:34:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.1.12.2 2018/03/21 10:50:49 martin Exp $	 */
+/*	$NetBSD: devopen.c,v 1.1.12.3 2018/04/04 16:34:39 martin Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -59,6 +59,7 @@
 #include 
 #include "devopen.h"
 #include 
+#include "efidisk.h"
 
 static int
 dev2bios(char *devname, int unit, int *biosdev)
@@ -103,9 +104,20 @@ devopen(struct open_file *f, const char 
 	int biosdev;
 	int error;
 
-	if ((error = parsebootfile(fname, &fsname, &devname,
-   &unit, &partition, (const char **) file))
-	|| (error = dev2bios(devname, unit, &biosdev)))
+	error = parsebootfile(fname, &fsname, &devname, &unit, &partition,
+	(const char **) file);
+	if (error)
+		return error;
+
+	if (strcmp(devname, "esp") == 0) {
+		bios2dev(boot_biosdev, boot_biossector, &devn

CVS commit: [netbsd-8] src/doc

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:29:24 UTC 2018

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

Log Message:
Tickets #689, #690, #691


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.161 -r1.1.2.162 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.161 src/doc/CHANGES-8.0:1.1.2.162
--- src/doc/CHANGES-8.0:1.1.2.161	Mon Apr  2 09:53:08 2018
+++ src/doc/CHANGES-8.0	Wed Apr  4 16:29:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.161 2018/04/02 09:53:08 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.162 2018/04/04 16:29:24 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -10835,3 +10835,35 @@ tests/net/ndp/t_ndp.sh1.31
 	Avoid setting IP addresses of the same subnet on different interface.
 	[ozaki-r, ticket #688]
 
+etc/rc.subr	1.101
+
+	Use posix command line arguments for ps(1) to enhance portability.
+	[kre, ticket #689]
+
+sys/dev/pci/ixgbe/ix_txrx.c			1.37,1.38
+sys/dev/pci/ixgbe/ixgbe.c			1.138-1.143
+sys/dev/pci/ixgbe/ixgbe.h			1.38-1.40
+sys/dev/pci/ixgbe/ixgbe_82599.c			1.17
+sys/dev/pci/ixgbe/ixgbe_api.h			1.12
+sys/dev/pci/ixgbe/ixgbe_common.c		1.19,1.20
+sys/dev/pci/ixgbe/ixgbe_common.h		1.11
+sys/dev/pci/ixgbe/ixgbe_x550.c			1.10,1.11
+sys/dev/pci/ixgbe/ixgbe_x550.h			1.4
+sys/dev/pci/ixgbe/ixv.c1.90
+
+	- Fix EITR setting to prevent hangup when link speed changed.
+	- Don't write EIMC directly. It is required to manage with struct
+	  ix_queue status. It's also required to stop queue 16 to 63 correctly.
+	- Add missing IFM_NONE support. If a interface support linkdown,
+	  "ifconfig ixgN media none" drops link.  Not all interface can do
+	  link down.
+	- Avoid issues caused by sending old packets at next link-up time.
+	- Fix a long standing bug that 82598 SFP+ panics in ixgbe_handle_mod().
+	[msaitoh, ticket #690]
+
+sys/arch/amd64/conf/GENERIC			1.485
+
+	Enable SVS by default.
+	[maxv, #ticket #691]
+
+



CVS commit: [netbsd-8] src/sys/arch/amd64/conf

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:25:23 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: GENERIC

Log Message:
Pull up the following revision, requested by maxv in tickt #691:

sys/arch/amd64/conf/GENERIC 1.485 (via patch)

Enable SVS by default.


To generate a diff of this commit:
cvs rdiff -u -r1.459.2.6 -r1.459.2.7 src/sys/arch/amd64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.459.2.6 src/sys/arch/amd64/conf/GENERIC:1.459.2.7
--- src/sys/arch/amd64/conf/GENERIC:1.459.2.6	Thu Mar 22 16:59:03 2018
+++ src/sys/arch/amd64/conf/GENERIC	Wed Apr  4 16:25:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.459.2.6 2018/03/22 16:59:03 martin Exp $
+# $NetBSD: GENERIC,v 1.459.2.7 2018/04/04 16:25:23 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.459.2.6 $"
+#ident		"GENERIC-$Revision: 1.459.2.7 $"
 
 maxusers	64		# estimated number of users
 
@@ -74,7 +74,7 @@ options 	USERCONF	# userconf(4) support
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
 # CPU-related options
-#options 	SVS		# Separate Virtual Space
+options 	SVS		# Separate Virtual Space
 
 # CPU features
 acpicpu*	at cpu?		# ACPI CPU (including frequency scaling)



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

2018-04-04 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  4 16:23:27 UTC 2018

Modified Files:
src/sys/arch/x86/x86: spectre.c x86_machdep.c

Log Message:
Add machdep.spectre_v2.method, a string that tells which method is
active.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/spectre.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/spectre.c
diff -u src/sys/arch/x86/x86/spectre.c:1.8 src/sys/arch/x86/x86/spectre.c:1.9
--- src/sys/arch/x86/x86/spectre.c:1.8	Wed Apr  4 12:59:49 2018
+++ src/sys/arch/x86/x86/spectre.c	Wed Apr  4 16:23:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spectre.c,v 1.8 2018/04/04 12:59:49 maxv Exp $	*/
+/*	$NetBSD: spectre.c,v 1.9 2018/04/04 16:23:27 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.8 2018/04/04 12:59:49 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.9 2018/04/04 16:23:27 maxv Exp $");
 
 #include 
 #include 
@@ -57,6 +57,7 @@ enum spec_mitigation {
 
 bool spec_mitigation_enabled __read_mostly = false;
 static enum spec_mitigation mitigation_method = MITIGATION_NONE;
+char spec_mitigation_name[64] = "(none)";
 
 void speculation_barrier(struct lwp *, struct lwp *);
 
@@ -269,6 +270,7 @@ mitigation_change(bool enabled)
 	struct cpu_info *ci = NULL;
 	CPU_INFO_ITERATOR cii;
 	uint64_t xc;
+	const char *name;
 
 	speculation_detect_method();
 
@@ -305,8 +307,18 @@ mitigation_change(bool enabled)
 		xc_wait(xc);
 		printf(" done!\n");
 		spec_mitigation_enabled = enabled;
-
 		mutex_exit(&cpu_lock);
+
+		if (!enabled) {
+			name = "(none)";
+		} else if (mitigation_method == MITIGATION_AMD_DIS_IND) {
+			name = "AMD DIS_IND";
+		} else {
+			name = "Intel IBRS";
+		}
+		strlcpy(spec_mitigation_name, name,
+		sizeof(spec_mitigation_name));
+
 		return 0;
 	default:
 		panic("impossible");

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.110 src/sys/arch/x86/x86/x86_machdep.c:1.111
--- src/sys/arch/x86/x86/x86_machdep.c:1.110	Sat Mar 31 08:43:52 2018
+++ src/sys/arch/x86/x86/x86_machdep.c	Wed Apr  4 16:23:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.110 2018/03/31 08:43:52 maxv Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.111 2018/04/04 16:23:27 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.110 2018/03/31 08:43:52 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.111 2018/04/04 16:23:27 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -1274,6 +1274,7 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 #ifndef XEN
 	int sysctl_machdep_spectreV2_mitigated(SYSCTLFN_ARGS);
 	extern bool spec_mitigation_enabled;
+	extern char spec_mitigation_name[];
 	const struct sysctlnode *spec_rnode;
 
 	/* SpectreV1 */
@@ -1297,13 +1298,20 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		   CTLTYPE_NODE, "spectre_v2", NULL,
 		   NULL, 0, NULL, 0,
 		   CTL_MACHDEP, CTL_CREATE);
-	sysctl_createv(clog, 0, &spec_rnode, &spec_rnode,
+	sysctl_createv(clog, 0, &spec_rnode, NULL,
 		   CTLFLAG_READWRITE,
 		   CTLTYPE_BOOL, "mitigated",
 		   SYSCTL_DESCR("Whether Spectre Variant 2 is mitigated"),
 		   sysctl_machdep_spectreV2_mitigated, 0,
 		   &spec_mitigation_enabled, 0,
 		   CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, &spec_rnode, NULL,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_STRING, "method",
+		   SYSCTL_DESCR("Mitigation method in use"),
+		   NULL, 0,
+		   spec_mitigation_name, 0,
+		   CTL_CREATE, CTL_EOL);
 #endif
 
 	/* None of these can ever change once the system has booted */



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:18:49 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_x550.c ixgbe_x550.h ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #690):
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.17
sys/dev/pci/ixgbe/ixgbe.c: revision 1.138
sys/dev/pci/ixgbe/ixv.c: revision 1.90
sys/dev/pci/ixgbe/ixgbe.c: revision 1.139
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.11
sys/dev/pci/ixgbe/ixgbe.h: revision 1.38
sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.12
sys/dev/pci/ixgbe/ixgbe.h: revision 1.39
sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.10
sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.11
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.37
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.38
sys/dev/pci/ixgbe/ixgbe.c: revision 1.140
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.20
sys/dev/pci/ixgbe/ixgbe.c: revision 1.141
sys/dev/pci/ixgbe/ixgbe.c: revision 1.142
sys/dev/pci/ixgbe/ixgbe.c: revision 1.143
sys/dev/pci/ixgbe/ixgbe.h: revision 1.40
sys/dev/pci/ixgbe/ixgbe_x550.h: revision 1.4

Fix the problem between eitr and link_speed.

In ixgbe_msix_que(), que->eitr_setting is limited to IXGBE_MIN_RSC_EITR_10G1G
when link_speed is 1Gbps or 10Gbps. However, que->eitr_setting is set to EITR
register in the *next* Tx/Rx interrupt. If link_speed changes from 100Mbps to
1Gbps ro 10Gbps, que->eitr_setting which is not limited can be set to EITR
register, that is, the problem fixed by ixgbe.c:r1.124 can occur in this case.

To fix this case, que->eitr_setting should be clear when link_speed is changed
or link state is changed.

Furthermore, expand the variants used for AIM (txr->bytes, txr->packets,
rxr->bytes and rxr->packets) from u32 to u64 to avoid wraparound which causes
que->eitr_setting calculation mistake.
XXX pullup-8

Don't write EIMC directly. It is required to manage with struct ix_queue status.
XXX pullup-8

-  Add missing IFM_NONE support. If a interface support linkdown,
  "ifconfig ixgN media none" drpos link.  Not all interface can do link down.
 Tested:
82598 AT2 (T)
92599 SF+(SFI) (X520-DA2)
X540
X550-T1
X550EM_x (X10SDV-8C-TLN4F)
X550EM_a (A2SDi-H-TP4F port 0, 1 (T))
 Doesn't work:
X550EM_a (A2SDi-H-TP4F port 2, 3 (SFP+ (KR)))
X550EM_a (MA10-ST0 port 2, 3 (SFP+ (SFI)))
(Denverton SFP+ can't force link down because SFP+'s TX_DISABLE pin is
pull down. Is there a way to shutdown SFP+ cage's power?)
 Not tested:
82598 fiber.
- Change some functions static.

Avoid issues caused by sending old packets at next link-up time.

This modification consists by the following two parts.
- drain packets in if_snd queue or corresponding txr->txr_interq
  when link_active == false in ifp->if_start(), ifp->if_transmit(),
  and deferred Tx processing
- drain packets in if_snd queue and all of txr->txr_interq's
  at link-down time
ok by msaitoh@n.o.

 Fix long standing bug that 82598 SFP+ panics in ixgbe_handle_mod() because
hw->mac.ops.setup_sfp is NULL. This change is a part of FreeBSD r327031.

Fix a bug that "ifconfig ixgN down up" forgot IFM_NONE setting.
 - Don't assume autoneg == 0 is the first call of ixgbe_config_link().
   Check ifm_media, too.
 - Don't override autoneg_advertised in ixgbe_get_phy_id_fw() to not to
   be inconsistent with if_media value.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.8 -r1.24.2.9 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.15 -r1.88.2.16 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.24.6.8 -r1.24.6.9 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.14.8.1 -r1.14.8.2 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.9.8.1 -r1.9.8.2 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.7.8.2 -r1.7.8.3 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.5.6.2 -r1.5.6.3 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.2.12.1 -r1.2.12.2 src/sys/dev/pci/ixgbe/ixgbe_x550.h
cvs rdiff -u -r1.56.2.12 -r1.56.2.13 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.8 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.9
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.8	Fri Mar 30 12:07:34 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Apr  4 16:18:49 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.8 2018/03/30 12:07:34 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.9 2018/04/04 16:18:49 martin Exp $ */
 
 /***

CVS commit: [netbsd-8] src/etc

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 16:07:33 UTC 2018

Modified Files:
src/etc [netbsd-8]: rc.subr

Log Message:
Pull up following revision(s) (requested by kre in ticket #689):
etc/rc.subr: revision 1.101

PR misc/53145 (Bruce Lilly)

Use ps -A instead of ps -ax (-A means -ax, but -A is posix, -x is not)
Use ps -o args instead of ps -o command (same reason).

This makes no difference when the ps used is /bin/ps on NetBSD, but
can make a difference when some other ps command gets invoked instead.

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.100.4.1 src/etc/rc.subr

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

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.100 src/etc/rc.subr:1.100.4.1
--- src/etc/rc.subr:1.100	Thu Apr 13 02:15:36 2017
+++ src/etc/rc.subr	Wed Apr  4 16:07:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.100 2017/04/13 02:15:36 christos Exp $
+# $NetBSD: rc.subr,v 1.100.4.1 2018/04/04 16:07:33 martin Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -235,7 +235,7 @@ check_process()
 	if [ -z "$_procname" ]; then
 		err 3 'USAGE: check_process procname [interpreter]'
 	fi
-	_find_processes $_procname ${_interpreter:-.} '-ax'
+	_find_processes $_procname ${_interpreter:-.} '-A'
 }
 
 #
@@ -294,7 +294,7 @@ _find_processes()
 	fi
 
 	_proccheck='
-		ps -o "pid,command" '"$_psargs"' |
+		ps -o "pid,args" '"$_psargs"' |
 		while read _npid '"$_fp_args"'; do
 			case "$_npid" in
 			PID)



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

2018-04-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Apr  4 16:01:05 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sunxi_tcon.c

Log Message:
Reset more regs at attach time, just in case.
As the mux is in unit 0 but is used by both units, we have to keep
  unit 0's ahb clock enabled.
Properly set sc_output_type.

Now pipeline 1 can be activated without activating pipeline 0 first.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_tcon.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_tcon.c
diff -u src/sys/arch/arm/sunxi/sunxi_tcon.c:1.3 src/sys/arch/arm/sunxi/sunxi_tcon.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_tcon.c:1.3	Tue Apr  3 16:17:59 2018
+++ src/sys/arch/arm/sunxi/sunxi_tcon.c	Wed Apr  4 16:01:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_tcon.c,v 1.3 2018/04/03 16:17:59 bouyer Exp $ */
+/* $NetBSD: sunxi_tcon.c,v 1.4 2018/04/04 16:01:05 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2018 Manuel Bouyer 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.3 2018/04/03 16:17:59 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.4 2018/04/04 16:01:05 bouyer Exp $");
 
 #include 
 #include 
@@ -210,18 +210,23 @@ sunxi_tcon_attach(device_t parent, devic
 	sc->sc_ports.dp_ep_enable = sunxi_tcon_ep_enable;
 	fdt_ports_register(&sc->sc_ports, self, phandle, EP_OTHER);
 
-	TCON_WRITE(sc, SUNXI_TCON_GCTL_REG, 0);
 	TCON_WRITE(sc, SUNXI_TCON_GINT0_REG, 0);
 	TCON_WRITE(sc, SUNXI_TCON_GINT1_REG,
 	__SHIFTIN(0x20, SUNXI_TCON_GINT1_TCON0_LINENO));
 	TCON_WRITE(sc, SUNXI_TCON0_DCLK_REG, 0xf000);
+	TCON_WRITE(sc, SUNXI_TCON0_LVDS_IF_REG, 0x0);
 	TCON_WRITE(sc, SUNXI_TCON0_CTL_REG, 0);
 	TCON_WRITE(sc, SUNXI_TCON0_IO_TRI_REG, 0x);
 	TCON_WRITE(sc, SUNXI_TCON1_CTL_REG, 0);
 	TCON_WRITE(sc, SUNXI_TCON1_IO_TRI_REG, 0x);
-	if (clk_disable(sc->sc_clk_ahb) != 0) {
-		aprint_error(": couldn't disable ahb clock\n");
-		return;
+	TCON_WRITE(sc, SUNXI_TCON_GCTL_REG, 0);
+
+	/* clock needed for the mux in unit 0 */
+	if (sc->sc_unit != 0) {
+		if (clk_disable(sc->sc_clk_ahb) != 0) {
+			aprint_error(": couldn't disable ahb clock\n");
+			return;
+		}
 	}
 }
 
@@ -268,9 +273,17 @@ sunxi_tcon_ep_connect(device_t self, str
 			aprint_verbose_dev(self, "tcon unit %d\n", sc->sc_unit);
 		if (!tcon_mux_inited && sc->sc_unit == 0) {
 			/* the mux register is only in LCD0 */
+			if (clk_enable(sc->sc_clk_ahb) != 0) {
+aprint_error_dev(self,
+"couldn't enable ahb clock\n");
+return;
+			}
 			bus_space_subregion(sc->sc_bst, sc->sc_bsh,
 			SUNXI_TCON_MUX_CTL_REG, 4, &tcon_mux_bsh);
 			tcon_mux_inited = true;
+			bus_space_write_4(sc->sc_bst, tcon_mux_bsh, 0,
+			__SHIFTIN(SUNXI_TCON_MUX_CTL_HDMI_OUTPUT_SRC_CLOSE,
+			SUNXI_TCON_MUX_CTL_HDMI_OUTPUT_SRC));
 		}
 	} else if (fdt_endpoint_port_index(ep) == 1) {
 		device_t rep_dev = fdt_endpoint_device(rep);
@@ -347,6 +360,8 @@ sunxi_tcon_ep_activate(device_t dev, str
 			sc->sc_out_ep = out_ep;
 			if (outi == 0)
 return sunxi_tcon0_set_video(sc);
+			/* XXX should check VGA here */
+			sc->sc_output_type = OUTPUT_HDMI;
 			return 0;
 		}
 	}
@@ -414,6 +429,7 @@ sunxi_tcon0_set_video(struct sunxi_tcon_
 	KASSERT(panel != NULL);
 	KASSERT(panel->panel_type == PANEL_DUAL_LVDS ||
 	panel->panel_type == PANEL_LVDS);
+	sc->sc_output_type = OUTPUT_LVDS;
 
 	lcd_x = panel->panel_timing.hactive;
 	lcd_y = panel->panel_timing.vactive;
@@ -506,7 +522,6 @@ sunxi_tcon0_set_video(struct sunxi_tcon_
 		val |= SUNXI_TCON0_LVDS_IF_18BITS;
 	TCON_WRITE(sc, SUNXI_TCON0_LVDS_IF_REG, val);
 
-
 	TCON_WRITE(sc, SUNXI_TCON0_IO_POL_REG, lcd_io_cfg0);
 	TCON_WRITE(sc, SUNXI_TCON0_IO_TRI_REG, 0);
 	TCON_WRITE(sc, SUNXI_TCON_GINT1_REG,
@@ -691,7 +706,6 @@ sunxi_tcon1_set_videomode(device_t dev, 
 	int error;
 
 	KASSERT(device_is_a(dev, "sunxitcon"));
-	sc = device_private(dev);
 	KASSERT((sc->sc_output_type == OUTPUT_HDMI) || 
 		(sc->sc_output_type == OUTPUT_VGA));
 



CVS commit: src/tests/usr.bin/c++

2018-04-04 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  4 15:53:04 UTC 2018

Modified Files:
src/tests/usr.bin/c++: Makefile

Log Message:
Correct a small regression typo in usr.bin/c++ ATF tests

TESTS_SH= changed to TESTS_SH+=


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/c++/Makefile

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

Modified files:

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.5 src/tests/usr.bin/c++/Makefile:1.6
--- src/tests/usr.bin/c++/Makefile:1.5	Wed Apr  4 15:08:59 2018
+++ src/tests/usr.bin/c++/Makefile	Wed Apr  4 15:53:04 2018
@@ -1,12 +1,13 @@
-# $NetBSD: Makefile,v 1.5 2018/04/04 15:08:59 kamil Exp $
+# $NetBSD: Makefile,v 1.6 2018/04/04 15:53:04 kamil Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/c++
 
+TESTS_SH=	#
 TESTS_SH+=	t_call_once
 TESTS_SH+=	t_call_once2
-TESTS_SH=	t_cxxruntime
+TESTS_SH+=	t_cxxruntime
 TESTS_SH+=	t_hello
 TESTS_SH+=	t_pthread_once
 TESTS_SH+=	t_static_destructor



CVS commit: src/tests/usr.bin/c++

2018-04-04 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  4 15:08:59 UTC 2018

Modified Files:
src/tests/usr.bin/c++: Makefile

Log Message:
Sort entries in ATF tests in tests/usr.bin/c++/Makefile

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/c++/Makefile

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

Modified files:

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.4 src/tests/usr.bin/c++/Makefile:1.5
--- src/tests/usr.bin/c++/Makefile:1.4	Sat Mar 24 00:26:51 2018
+++ src/tests/usr.bin/c++/Makefile	Wed Apr  4 15:08:59 2018
@@ -1,14 +1,14 @@
-# $NetBSD: Makefile,v 1.4 2018/03/24 00:26:51 kamil Exp $
+# $NetBSD: Makefile,v 1.5 2018/04/04 15:08:59 kamil Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/c++
 
-TESTS_SH=	t_cxxruntime
-TESTS_SH+=	t_hello
-TESTS_SH+=	t_static_destructor
 TESTS_SH+=	t_call_once
 TESTS_SH+=	t_call_once2
+TESTS_SH=	t_cxxruntime
+TESTS_SH+=	t_hello
 TESTS_SH+=	t_pthread_once
+TESTS_SH+=	t_static_destructor
 
 .include 



CVS commit: src/sys/arch

2018-04-04 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  4 12:59:49 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: cpu.c spectre.c

Log Message:
Enable the SpectreV2 mitigation by default at boot time.


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.153 -r1.154 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/spectre.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.302 src/sys/arch/amd64/amd64/machdep.c:1.303
--- src/sys/arch/amd64/amd64/machdep.c:1.302	Sat Mar 17 17:12:39 2018
+++ src/sys/arch/amd64/amd64/machdep.c	Wed Apr  4 12:59:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.302 2018/03/17 17:12:39 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.303 2018/04/04 12:59:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.302 2018/03/17 17:12:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.303 2018/04/04 12:59:49 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1603,6 +1603,9 @@ init_x86_64(paddr_t first_avail)
 	svs_init();
 #endif
 	cpu_init_msrs(&cpu_info_primary, true);
+#ifndef XEN
+	cpu_speculation_init(&cpu_info_primary);
+#endif
 
 	use_pae = 1; /* PAE always enabled in long mode */
 

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.90 src/sys/arch/x86/include/cpu.h:1.91
--- src/sys/arch/x86/include/cpu.h:1.90	Fri Mar 30 19:51:53 2018
+++ src/sys/arch/x86/include/cpu.h	Wed Apr  4 12:59:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.90 2018/03/30 19:51:53 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.91 2018/04/04 12:59:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -348,6 +348,7 @@ void cpu_kick(struct cpu_info *);
 
 void cpu_pcpuarea_init(struct cpu_info *);
 void cpu_svs_init(struct cpu_info *);
+void cpu_speculation_init(struct cpu_info *);
 
 #define	curcpu()		x86_curcpu()
 #define	curlwp			x86_curlwp()

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.153 src/sys/arch/x86/x86/cpu.c:1.154
--- src/sys/arch/x86/x86/cpu.c:1.153	Wed Mar 28 14:56:59 2018
+++ src/sys/arch/x86/x86/cpu.c	Wed Apr  4 12:59:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.153 2018/03/28 14:56:59 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.154 2018/04/04 12:59:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.153 2018/03/28 14:56:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.154 2018/04/04 12:59:49 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -848,6 +848,9 @@ cpu_hatch(void *v)
 
 	cpu_init_msrs(ci, true);
 	cpu_probe(ci);
+#ifdef __x86_64__
+	cpu_speculation_init(ci);
+#endif
 
 	ci->ci_data.cpu_cc_freq = cpu_info_primary.ci_data.cpu_cc_freq;
 	/* cpu_get_tsc_freq(ci); */

Index: src/sys/arch/x86/x86/spectre.c
diff -u src/sys/arch/x86/x86/spectre.c:1.7 src/sys/arch/x86/x86/spectre.c:1.8
--- src/sys/arch/x86/x86/spectre.c:1.7	Sat Mar 31 08:30:01 2018
+++ src/sys/arch/x86/x86/spectre.c	Wed Apr  4 12:59:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spectre.c,v 1.7 2018/03/31 08:30:01 maxv Exp $	*/
+/*	$NetBSD: spectre.c,v 1.8 2018/04/04 12:59:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.7 2018/03/31 08:30:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.8 2018/04/04 12:59:49 maxv Exp $");
 
 #include 
 #include 
@@ -313,6 +313,24 @@ mitigation_change(bool enabled)
 	}
 }
 
+void
+cpu_speculation_init(struct cpu_info *ci)
+{
+	/*
+	 * cpu0 is the one that detects the method and sets the global
+	 * variable.
+	 */
+	if (ci == &cpu_info_primary) {
+		speculation_detect_method();
+		spec_mitigation_enabled =
+		(mitigation_method != MITIGATION_NONE);
+	}
+
+	if (mitigation_method != MITIGATION_NONE) {
+		mitigation_apply_cpu(ci, true);
+	}
+}
+
 int sysctl_machdep_spectreV2_mitigated(SYSCTLFN_ARGS);
 
 int



CVS commit: src/sys/dev/pci

2018-04-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr  4 10:17:22 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
 Add Intel Coffee Lake internal graphics devices. From ark.intel.com.


To generate a diff of this commit:
cvs rdiff -u -r1.1324 -r1.1325 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1324 src/sys/dev/pci/pcidevs:1.1325
--- src/sys/dev/pci/pcidevs:1.1324	Mon Apr  2 07:30:34 2018
+++ src/sys/dev/pci/pcidevs	Wed Apr  4 10:17:22 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1324 2018/04/02 07:30:34 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1325 2018/04/04 10:17:22 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4465,6 +4465,12 @@ product INTEL E5_UNICAST	0x3ce8	E5 Unica
 product INTEL E5_SAD_1		0x3cf4	E5 SAD
 product INTEL E5_BROADCAST	0x3cf5	E5 Broadcast
 product INTEL E5_SAD_2		0x3cf6	E5 SAD
+product INTEL COFLK_IGD_1	0x3e90	UHD Graphics 610
+product INTEL COFLK_IGD_2	0x3e91	UHD Graphics 630
+product INTEL COFLK_IGD_3	0x3e92	UHD Graphics 630
+product INTEL COFLK_IGD_4	0x3e93	UHD Graphics 610
+product INTEL COFLK_IGD_5	0x3e9b	UHD Graphics 630
+product INTEL COFLK_IGD_6	0x3ea5	Iris Plus Graphics 655
 product INTEL 5400_HB		0x4000	5400 Host
 product INTEL 5400A_HB		0x4001	5400A Host
 product INTEL 5400B_HB		0x4003	5400B Host



CVS commit: src/sys/rump/net/lib/libshmif

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 09:19:33 UTC 2018

Modified Files:
src/sys/rump/net/lib/libshmif: shmif_user.c

Log Message:
Unconditionally include , as we use ftruncate() unconditionally
too.
Reported (with patch) by Antonio Huete Jimenez in PR 53153, slightly
modified by me.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libshmif/shmif_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/sys/rump/net/lib/libshmif/shmif_user.c
diff -u src/sys/rump/net/lib/libshmif/shmif_user.c:1.1 src/sys/rump/net/lib/libshmif/shmif_user.c:1.2
--- src/sys/rump/net/lib/libshmif/shmif_user.c:1.1	Thu Mar 13 01:42:59 2014
+++ src/sys/rump/net/lib/libshmif/shmif_user.c	Wed Apr  4 09:19:33 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: shmif_user.c,v 1.1 2014/03/13 01:42:59 pooka Exp $	*/
+/*  $NetBSD: shmif_user.c,v 1.2 2018/04/04 09:19:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -102,7 +103,6 @@ rumpcomp_shmif_watchwait(int kq)
 
 #include 
 #include 
-#include 
 
 int
 rumpcomp_shmif_watchsetup(int *inotifyp, int fd)
@@ -171,7 +171,6 @@ rumpcomp_shmif_watchwait(int kq)
 
 #else
 #include 
-#include 
 
 /* a polling default implementation */
 int



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

2018-04-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr  4 08:59:22 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_common.c ixgbe_common.h ixgbe_dcb.c ixgbe_dcb_82598.c
ixgbe_dcb_82599.c ixgbe_phy.c ixgbe_type.h ixgbe_vf.c ixgbe_x540.c
ixgbe_x550.c ixv.c

Log Message:
Sync with FreeBSD r331224 except ixv_if_update_admin_status()'s change:
 - Fix length of reading buffer when the command is Read Flash in
   ixgbe_host_interface_command().
 - Add missing start_hw() call in ixv_init_locked(). This is not a real bug
   because start_hw just set hw->adapter_stopped to false and anyone refer it.
 - Style change.
 - Update comment.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_phy.c \
src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/ixgbe/ixv.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.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.144 src/sys/dev/pci/ixgbe/ixgbe.c:1.145
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.144	Wed Apr  4 08:13:07 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Apr  4 08:59:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.144 2018/04/04 08:13:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.145 2018/04/04 08:59:22 msaitoh Exp $ */
 
 /**
 
@@ -32,7 +32,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 327031 2017-12-20 18:15:06Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 331224 2018-03-19 20:55:05Z erj $*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 /
  * Driver version
  /
-char ixgbe_driver_version[] = "4.0.0-k";
+char ixgbe_driver_version[] = "4.0.1-k";
 
 
 /

Index: src/sys/dev/pci/ixgbe/ixgbe_82598.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.11 src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.12
--- src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.11	Wed Apr  4 08:13:07 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_82598.c	Wed Apr  4 08:59:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_82598.c,v 1.11 2018/04/04 08:13:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe_82598.c,v 1.12 2018/04/04 08:59:22 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -33,7 +33,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 326022 2017-11-20 19:36:21Z pfg $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include "ixgbe_type.h"
 #include "ixgbe_82598.h"
@@ -552,6 +552,7 @@ out:
 /**
  *  ixgbe_start_mac_link_82598 - Configures MAC link settings
  *  @hw: pointer to hardware structure
+ *  @autoneg_wait_to_complete: TRUE when waiting for completion is needed
  *
  *  Configures link settings based on values in the ixgbe_hw struct.
  *  Restarts the link.  Performs autonegotiation if needed.
@@ -1209,7 +1210,7 @@ s32 ixgbe_read_i2c_eeprom_82598(struct i
  *  ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface.
  *  @hw: pointer to hardware structure
  *  @byte_offset: byte offset at address 0xA2
- *  @eeprom_data: value read
+ *  @sff8472_data: value read
  *
  *  Performs 8 byte read operation to SFP module's SFF-8472 data over I2C
  **/
Index: src/sys/dev/pci/ixgbe/ixgbe_x550.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.11 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.12
--- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.11	Wed Apr  4 06:30:09 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Wed Apr  4 08:59:22 2018
@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 32068

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

2018-04-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr  4 08:13:07 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: if_bypass.c if_fdir.c if_sriov.c ix_txrx.c
ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82598.h ixgbe_82599.c
ixgbe_82599.h ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_dcb.c ixgbe_dcb.h ixgbe_dcb_82598.c ixgbe_dcb_82598.h
ixgbe_dcb_82599.c ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_mbx.c
ixgbe_mbx.h ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h
ixgbe_rss.h ixgbe_sriov.h ixgbe_type.h ixgbe_vf.c ixgbe_vf.h
ixgbe_x540.c ixgbe_x540.h ixv.c

Log Message:
Sync with the remaining part of FreeBSD r328265 except sfp_reinit stuff:
 - Always schedule module intterrupt in ixgbe_config_link() when a device is
   SFP+ based.
 - Use not loop index but txr->me in ixv_initialize_{transmit,receive}_units().
   It's required for VMDQ but NetBSD doesn't use it, so it's not a bug in
   NetBSD.
 - Simplify ixgbe_bp_wd_set(). No functional change.
 - Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/if_bypass.c \
src/sys/dev/pci/ixgbe/ixgbe_osdep.c src/sys/dev/pci/ixgbe/ixgbe_rss.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/if_fdir.c \
src/sys/dev/pci/ixgbe/ixgbe_fdir.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/if_sriov.c \
src/sys/dev/pci/ixgbe/ixgbe_sriov.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_82599.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_api.h \
src/sys/dev/pci/ixgbe/ixgbe_mbx.h src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_dcb.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe_phy.c \
src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.90 -r1.91 src/sys/dev/pci/ixgbe/ixv.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_bypass.c
diff -u src/sys/dev/pci/ixgbe/if_bypass.c:1.3 src/sys/dev/pci/ixgbe/if_bypass.c:1.4
--- src/sys/dev/pci/ixgbe/if_bypass.c:1.3	Thu Mar 15 06:48:51 2018
+++ src/sys/dev/pci/ixgbe/if_bypass.c	Wed Apr  4 08:13:07 2018
@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 327031 2017-12-20 18:15:06Z erj $*/
 
 
 #include "ixgbe.h"
@@ -168,13 +168,13 @@ ixgbe_bp_set_state(SYSCTLFN_ARGS)
 	error = hw->mac.ops.bypass_rw(hw,
 	BYPASS_PAGE_CTL0, &state);
 	ixgbe_bypass_mutex_clear(adapter);
-	if (error)
+	if (error != 0)
 		return (error);
 	state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3;
 
 	node.sysctl_data = &state;
 	error = sysctl_lookup(SYSCTLFN_CALL(&node));
-	if ((error) || (newp == NULL))
+	if ((error != 0) || (newp == NULL))
 		return (error);
 
 	/* Sanity check new state */
@@ -452,7 +452,7 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS)
 	struct ixgbe_hw *hw = &adapter->hw;
 	int error, tmp;
 	static int  timeout = 0;
-	u32 mask, arg = BYPASS_PAGE_CTL0;
+	u32 mask, arg;
 
 	/* Get the current hardware value */
 	ixgbe_bypass_mutex_enter(adapter);
@@ -472,48 +472,38 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS)
 	if ((error) || (newp == NULL))
 		return (error);
 
-	mask = BYPASS_WDT_ENABLE_M;
+	arg = 0x1 << BYPASS_WDT_ENABLE_SHIFT;
+	mask = BYPASS_WDT_ENABLE_M | BYPASS_WDT_VALUE_M;
 	switch (timeout) {
 	case 0: /* disables the timer */
+		arg = BYPASS_PAGE_CTL0;
+		mask = BYPASS_WDT_ENABLE_M;
 		break;
 	case 1:
-		arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
-		arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
-		mask |= BYPASS_WDT_VALUE_M;
+		arg |= BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
 		break;
 	case 2:
-		arg = BYPASS_WDT_2 << BYPASS