CVS commit: src/sys/net

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 24 05:27:29 UTC 2018

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

Log Message:
 Print "NET_MPSAFE enabled" if it's enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.423 -r1.424 src/sys/net/if.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/if.c
diff -u src/sys/net/if.c:1.423 src/sys/net/if.c:1.424
--- src/sys/net/if.c:1.423	Mon May 14 02:55:46 2018
+++ src/sys/net/if.c	Thu May 24 05:27:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.423 2018/05/14 02:55:46 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.424 2018/05/24 05:27:29 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.423 2018/05/14 02:55:46 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.424 2018/05/24 05:27:29 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -299,6 +299,11 @@ ifinit(void)
 void
 ifinit1(void)
 {
+
+#ifdef NET_MPSAFE
+	printf("NET_MPSAFE enabled\n");
+#endif
+
 	mutex_init(_clone_mtx, MUTEX_DEFAULT, IPL_NONE);
 
 	TAILQ_INIT(_list);



CVS commit: src/sys/net

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 24 05:27:29 UTC 2018

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

Log Message:
 Print "NET_MPSAFE enabled" if it's enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.423 -r1.424 src/sys/net/if.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

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 24 04:29:25 UTC 2018

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

Log Message:
 Add some Marvell Yukon devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1334 -r1.1335 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.1334 src/sys/dev/pci/pcidevs:1.1335
--- src/sys/dev/pci/pcidevs:1.1334	Mon May 21 03:45:50 2018
+++ src/sys/dev/pci/pcidevs	Thu May 24 04:29:25 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1334 2018/05/21 03:45:50 jnemeth Exp $
+$NetBSD: pcidevs,v 1.1335 2018/05/24 04:29:25 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2513,6 +2513,13 @@ product MARVELL YUKON_C032	0x4367	Yukon 
 product MARVELL YUKON_C034	0x4368	Yukon 88EC034
 product MARVELL YUKON_C042	0x4369	Yukon 88EC042
 product MARVELL YUKON_8058	0x436a	Yukon 88E8058
+product MARVELL YUKON_8071	0x436b	Yukon 88E8071
+product MARVELL YUKON_8072	0x436c	Yukon 88E8072
+product MARVELL YUKON_8055_2	0x436d	Yukon 88E8055
+product MARVELL YUKON_8075	0x4370	Yukon 88E8075
+product MARVELL YUKON_8057	0x4380	Yukon 88E8057
+product MARVELL YUKON_8059	0x4381	Yukon 88E8059
+product MARVELL YUKON_8079	0x4382	Yukon 88E8079
 product MARVELL GT64120		0x4620	GT-64120 System Controller
 product MARVELL BELKIN		0x5005	Belkin Gigabit Ethernet
 product MARVELL 88SX5040	0x5040	88SX5040 SATA



CVS commit: src/sys/dev/pci

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 24 04:29:25 UTC 2018

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

Log Message:
 Add some Marvell Yukon devices.


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

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

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 24 04:29:56 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
 Regen.


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

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



Re: CVS commit: src/tests/lib/libc/sys

2018-05-23 Thread Jason Thorpe
This change seems to have broken building on 32-bit platforms (certainly at 
least for 32-bit ARM):

#   compile  sys/t_ptrace_wait.o
/nbsd/tools/bin/armv6--netbsdelf-eabihf-gcc -O2   -std=gnu99-Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  
-Wsystem-headers   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type 
-Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter 
-Wno-sign-compare -Wsign-compare -Wformat=2  -Wno-format-zero-length  -Werror 
-Wno-missing-noreturn   -fPIE--sysroot=/nbsd/destdir/rpi 
-I/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/../../..  -c   
-D_KERNTYPES 
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.c
In file included from 
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.c:59:0:
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h: In 
function 'trigger_bus':
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:561:20: 
error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
  FORKEE_ASSERT_NEQ((uintmax_t)fp, (uintmax_t)NULL);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:158:18: 
note: in definition of macro 'FORKEE_ASSERT_NEQ'
  uintmax_t vx = (x);  \
  ^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:561:35: 
error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
  FORKEE_ASSERT_NEQ((uintmax_t)fp, (uintmax_t)NULL);
   ^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:159:18: 
note: in definition of macro 'FORKEE_ASSERT_NEQ'
  uintmax_t vy = (y);  \
  ^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:565:20: 
error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
  FORKEE_ASSERT_NEQ((uintmax_t)p, (uintmax_t)MAP_FAILED);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:158:18: 
note: in definition of macro 'FORKEE_ASSERT_NEQ'
  uintmax_t vx = (x);  \
  ^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:565:34: 
error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
  FORKEE_ASSERT_NEQ((uintmax_t)p, (uintmax_t)MAP_FAILED);
  ^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:159:18: 
note: in definition of macro 'FORKEE_ASSERT_NEQ'
  uintmax_t vy = (y);  \
  ^
cc1: all warnings being treated as errors

*** Failed target:  t_ptrace_wait.o


Maybe uintptr_t is a better type to cast to?


> On May 23, 2018, at 6:18 AM, Kamil Rytarowski  wrote:
> 
> Module Name:  src
> Committed By: kamil
> Date: Wed May 23 13:18:09 UTC 2018
> 
> Modified Files:
>   src/tests/lib/libc/sys: t_ptrace_wait.h
> 
> Log Message:
> Add new auxiliary functions in ATF ptrace(2) tests
> 
> Introduce:
> - trigger_trap()
> - trigger_segv()
> - trigger_ill()
> - trigger_fpe()
> - trigger_bus()
> 
> These functions generate appropriate signals caused by crashes.
> 
> A debugger is required to collect the crashes regardless of signal masking,
> catching or ignoring rules.
> 
> While there, append __used argument to can_we_set_dbregs().
> 
> Sponsored by 
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_wait.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



CVS commit: src/share/mk

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 02:06:31 UTC 2018

Modified Files:
src/share/mk: bsd.sys.mk

Log Message:
Be more selective about remapping object directories otherwise we pick
objdump and objcopy with the regex.

XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.276 src/share/mk/bsd.sys.mk:1.277
--- src/share/mk/bsd.sys.mk:1.276	Sat May 19 13:44:44 2018
+++ src/share/mk/bsd.sys.mk	Wed May 23 22:06:31 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.276 2018/05/19 17:44:44 christos Exp $
+#	$NetBSD: bsd.sys.mk,v 1.277 2018/05/24 02:06:31 christos Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -31,8 +31,10 @@ REPROFLAGS+=	-fdebug-prefix-map=\$$X11SR
 LINTFLAGS+=	-R${NETBSDSRCDIR}=/usr/src -R${X11SRCDIR}=/usr/xsrc
 LINTFLAGS+=	-R${DESTDIR}=
 
-REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj.*=/usr/obj/\1'
-REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj.*/(.*)=/usr/obj/\1/\2'
+REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj$$=/usr/obj/\1'
+REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj/(.*)=/usr/obj/\1/\2'
+REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj\..*=/usr/obj/\1'
+REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj\..*/(.*)=/usr/obj/\1/\2'
 
 CFLAGS+=	${REPROFLAGS}
 CXXFLAGS+=	${REPROFLAGS}



CVS commit: src/share/mk

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 02:06:31 UTC 2018

Modified Files:
src/share/mk: bsd.sys.mk

Log Message:
Be more selective about remapping object directories otherwise we pick
objdump and objcopy with the regex.

XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/share/mk/bsd.sys.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

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 00:27:25 UTC 2018

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

Log Message:
Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.218 src/usr.bin/make/var.c:1.219
--- src/usr.bin/make/var.c:1.218	Sat Feb 17 19:52:42 2018
+++ src/usr.bin/make/var.c	Wed May 23 20:27:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.218 2018/02/18 00:52:42 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.219 2018/05/24 00:27:24 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2347,6 +2347,8 @@ VarQuote(char *str)
 	if (isspace((unsigned char)*str) || ismeta((unsigned char)*str))
 	Buf_AddByte(, '\\');
 	Buf_AddByte(, *str);
+	if (*str == '$')
+	Buf_AddBytes(, 2, "\\$");
 }
 
 str = Buf_Destroy(, FALSE);



CVS commit: src/usr.bin/make

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 00:27:25 UTC 2018

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

Log Message:
Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8


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

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 00:25:44 UTC 2018

Modified Files:
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: varquote.exp varquote.mk

Log Message:
unit test for $ underquoting in :Q modifier


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varquote.exp \
src/usr.bin/make/unit-tests/varquote.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/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.52 src/usr.bin/make/unit-tests/Makefile:1.53
--- src/usr.bin/make/unit-tests/Makefile:1.52	Tue May  5 17:51:09 2015
+++ src/usr.bin/make/unit-tests/Makefile	Wed May 23 20:25:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $
+# $NetBSD: Makefile,v 1.53 2018/05/24 00:25:44 christos Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
@@ -50,6 +50,7 @@ TESTNAMES= \
 	unexport-env \
 	varcmd \
 	varmisc \
+	varquote \
 	varshell
 
 # these tests were broken by referting POSIX chanegs

Added files:

Index: src/usr.bin/make/unit-tests/varquote.exp
diff -u /dev/null src/usr.bin/make/unit-tests/varquote.exp:1.1
--- /dev/null	Wed May 23 20:25:44 2018
+++ src/usr.bin/make/unit-tests/varquote.exp	Wed May 23 20:25:44 2018
@@ -0,0 +1,2 @@
+-fdebug-prefix-map=$NETBSDSRCDIR=/usr/src -fdebug-regex-map=/usr/src/(.*)/obj$=/usr/obj/\1
+exit status 0
Index: src/usr.bin/make/unit-tests/varquote.mk
diff -u /dev/null src/usr.bin/make/unit-tests/varquote.mk:1.1
--- /dev/null	Wed May 23 20:25:44 2018
+++ src/usr.bin/make/unit-tests/varquote.mk	Wed May 23 20:25:44 2018
@@ -0,0 +1,13 @@
+# $NetBSD: varquote.mk,v 1.1 2018/05/24 00:25:44 christos Exp $
+#
+# Test VAR:Q modifier
+
+.if !defined(REPROFLAGS)
+REPROFLAGS+=-fdebug-prefix-map=\$$NETBSDSRCDIR=/usr/src
+REPROFLAGS+=-fdebug-regex-map='/usr/src/(.*)/obj$$=/usr/obj/\1'
+all:
+	@${MAKE} -f ${MAKEFILE} REPROFLAGS=${REPROFLAGS:Q}
+.else
+all:
+	@echo ${REPROFLAGS}
+.endif



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

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 24 00:25:44 UTC 2018

Modified Files:
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: varquote.exp varquote.mk

Log Message:
unit test for $ underquoting in :Q modifier


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varquote.exp \
src/usr.bin/make/unit-tests/varquote.mk

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



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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 23:56:08 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Merge the eventmask[1-6] ATF ptrace(2) tests into a shared function body

While there, rename the tests to:
 - eventmask_preserved_empty
 - eventmask_preserved_fork
 - eventmask_preserved_lwp_create
 - eventmask_preserved_lwp_exit
 - eventmask_preserved_vfork
 - eventmask_preserved_vfork_done

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.52 src/tests/lib/libc/sys/t_ptrace_wait.c:1.53
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.52	Wed May 23 13:51:27 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed May 23 23:56:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.52 2018/05/23 13:51:27 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.53 2018/05/23 23:56:07 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.52 2018/05/23 13:51:27 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.53 2018/05/23 23:56:07 kamil Exp $");
 
 #include 
 #include 
@@ -1379,234 +1379,8 @@ TRACEE_SEES_ITS_ORIGINAL_PARENT(
 
 /// 
 
-ATF_TC(eventmask1);
-ATF_TC_HEAD(eventmask1, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify that empty EVENT_MASK is preserved");
-}
-
-ATF_TC_BODY(eventmask1, tc)
-{
-	const int exitval = 5;
-	const int sigval = SIGSTOP;
-	pid_t child, wpid;
-#if defined(TWAIT_HAVE_STATUS)
-	int status;
-#endif
-	ptrace_event_t set_event, get_event;
-	const int len = sizeof(ptrace_event_t);
-
-	DPRINTF("Before forking process PID=%d\n", getpid());
-	SYSCALL_REQUIRE((child = fork()) != -1);
-	if (child == 0) {
-		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
-		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
-
-		DPRINTF("Before raising %s from child\n", strsignal(sigval));
-		FORKEE_ASSERT(raise(sigval) == 0);
-
-		DPRINTF("Before exiting of the child process\n");
-		_exit(exitval);
-	}
-	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
-
-	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, sigval);
-
-	set_event.pe_set_event = 0;
-	SYSCALL_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, _event, len) != -1);
-	SYSCALL_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, _event, len) != -1);
-	ATF_REQUIRE(memcmp(_event, _event, len) == 0);
-
-	DPRINTF("Before resuming the child process where it left off and "
-	"without signal to be sent\n");
-	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
-	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_exited(status, exitval);
-
-	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
-}
-
-ATF_TC(eventmask2);
-ATF_TC_HEAD(eventmask2, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify that PTRACE_FORK in EVENT_MASK is preserved");
-}
-
-ATF_TC_BODY(eventmask2, tc)
-{
-	const int exitval = 5;
-	const int sigval = SIGSTOP;
-	pid_t child, wpid;
-#if defined(TWAIT_HAVE_STATUS)
-	int status;
-#endif
-	ptrace_event_t set_event, get_event;
-	const int len = sizeof(ptrace_event_t);
-
-	DPRINTF("Before forking process PID=%d\n", getpid());
-	SYSCALL_REQUIRE((child = fork()) != -1);
-	if (child == 0) {
-		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
-		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
-
-		DPRINTF("Before raising %s from child\n", strsignal(sigval));
-		FORKEE_ASSERT(raise(sigval) == 0);
-
-		DPRINTF("Before exiting of the child process\n");
-		_exit(exitval);
-	}
-	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
-
-	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, sigval);
-
-	set_event.pe_set_event = PTRACE_FORK;
-	SYSCALL_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, _event, len) != -1);
-	SYSCALL_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, _event, len) != -1);
-	ATF_REQUIRE(memcmp(_event, _event, len) == 0);
-
-	DPRINTF("Before resuming the child process where it left off and "
-	"without signal to be sent\n");
-	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
-	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_exited(status, exitval);

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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 23:56:08 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Merge the eventmask[1-6] ATF ptrace(2) tests into a shared function body

While there, rename the tests to:
 - eventmask_preserved_empty
 - eventmask_preserved_fork
 - eventmask_preserved_lwp_create
 - eventmask_preserved_lwp_exit
 - eventmask_preserved_vfork
 - eventmask_preserved_vfork_done

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/lib/libc/stdlib

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:21:27 UTC 2018

Modified Files:
src/lib/libc/stdlib: merge.c

Log Message:
Simplify to avoid pointless null pointer arithmetic.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdlib/merge.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/stdlib/merge.c
diff -u src/lib/libc/stdlib/merge.c:1.15 src/lib/libc/stdlib/merge.c:1.16
--- src/lib/libc/stdlib/merge.c:1.15	Sat Aug 12 01:10:04 2017
+++ src/lib/libc/stdlib/merge.c	Wed May 23 21:21:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: merge.c,v 1.15 2017/08/12 01:10:04 ginsbach Exp $	*/
+/*	$NetBSD: merge.c,v 1.16 2018/05/23 21:21:27 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)merge.c	8.2 (Berkeley) 2/14/94";
 #else
-__RCSID("$NetBSD: merge.c,v 1.15 2017/08/12 01:10:04 ginsbach Exp $");
+__RCSID("$NetBSD: merge.c,v 1.16 2018/05/23 21:21:27 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -101,8 +101,7 @@ static void insertionsort(u_char *, size
  */
 /* Assumption: PSIZE is a power of 2. */
 #define EVAL(p) ((u_char **)(void *)	\
-((u_char *)0 +			\
-(((u_char *)(void *)(p) + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1
+(((u_char *)(void *)(p) + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1)))
 
 /*
  * Arguments are as for qsort.



CVS commit: src/lib/libc/stdlib

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:21:27 UTC 2018

Modified Files:
src/lib/libc/stdlib: merge.c

Log Message:
Simplify to avoid pointless null pointer arithmetic.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdlib/merge.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/mkdep

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:20:20 UTC 2018

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

Log Message:
deconst -> __UNCONST to avoid null pointer arithmetic


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/mkdep/mkdep.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/mkdep

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:20:20 UTC 2018

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

Log Message:
deconst -> __UNCONST to avoid null pointer arithmetic


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/mkdep/mkdep.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/mkdep/mkdep.c
diff -u src/usr.bin/mkdep/mkdep.c:1.44 src/usr.bin/mkdep/mkdep.c:1.45
--- src/usr.bin/mkdep/mkdep.c:1.44	Tue Jun 16 22:54:10 2015
+++ src/usr.bin/mkdep/mkdep.c	Wed May 23 21:20:20 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdep.c,v 1.44 2015/06/16 22:54:10 christos Exp $ */
+/* $NetBSD: mkdep.c,v 1.45 2018/05/23 21:20:20 joerg Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
  All rights reserved.");
-__RCSID("$NetBSD: mkdep.c,v 1.44 2015/06/16 22:54:10 christos Exp $");
+__RCSID("$NetBSD: mkdep.c,v 1.45 2018/05/23 21:20:20 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -82,12 +82,6 @@ static int verbose;
 static void save_for_optional(const char *, const char *);
 static size_t write_optional(int, opt_t *, size_t);
 
-static inline void *
-deconst(const void *p)
-{
-	return (const char *)p - (const char *)0 + (char *)0;
-}
-
 __dead static void
 usage(void)
 {
@@ -119,8 +113,8 @@ run_cc(int argc, char **argv, const char
 	if ((args = malloc((argc + 3) * sizeof(char *))) == NULL)
 		err(EXIT_FAILURE, "malloc");
 
-	args[0] = deconst(CC);
-	args[1] = deconst("-M");
+	args[0] = __UNCONST(CC);
+	args[1] = __UNCONST("-M");
 	(void)memcpy([2], argv, (argc + 1) * sizeof(char *));
 
 	if ((tmpdir = getenv("TMPDIR")) == NULL)



CVS commit: src/sys/external/bsd/acpica/dist/include

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:16:57 UTC 2018

Modified Files:
src/sys/external/bsd/acpica/dist/include: actypes.h

Log Message:
Replace null pointer arithmethic with direct cast


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/acpica/dist/include/actypes.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/external/bsd/acpica/dist/include/actypes.h
diff -u src/sys/external/bsd/acpica/dist/include/actypes.h:1.15 src/sys/external/bsd/acpica/dist/include/actypes.h:1.16
--- src/sys/external/bsd/acpica/dist/include/actypes.h:1.15	Sat Apr  7 15:49:51 2018
+++ src/sys/external/bsd/acpica/dist/include/actypes.h	Wed May 23 21:16:57 2018
@@ -550,8 +550,8 @@ typedef UINT64  
 
 /* Pointer/Integer type conversions */
 
-#define ACPI_TO_POINTER(i)  ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i))
-#define ACPI_TO_INTEGER(p)  ACPI_PTR_DIFF (p, (void *) 0)
+#define ACPI_TO_POINTER(i)  ((void *)((uintptr_t)(ACPI_SIZE) (i)))
+#define ACPI_TO_INTEGER(p)  ((uintptr_t)(p))
 #define ACPI_OFFSET(d, f)   ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
 #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
 #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)



CVS commit: src/sys/external/bsd/acpica/dist/include

2018-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 23 21:16:57 UTC 2018

Modified Files:
src/sys/external/bsd/acpica/dist/include: actypes.h

Log Message:
Replace null pointer arithmethic with direct cast


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/acpica/dist/include/actypes.h

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



CVS commit: src/sys/netinet

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 18:40:30 UTC 2018

Modified Files:
src/sys/netinet: tcp_subr.c

Log Message:
Add XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/netinet/tcp_subr.c

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



CVS commit: src/sys/netinet

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 18:40:30 UTC 2018

Modified Files:
src/sys/netinet: tcp_subr.c

Log Message:
Add XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/netinet/tcp_subr.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/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.279 src/sys/netinet/tcp_subr.c:1.280
--- src/sys/netinet/tcp_subr.c:1.279	Thu May  3 07:13:48 2018
+++ src/sys/netinet/tcp_subr.c	Wed May 23 18:40:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_subr.c,v 1.279 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: tcp_subr.c,v 1.280 2018/05/23 18:40:29 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.279 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.280 2018/05/23 18:40:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1918,6 +1918,10 @@ tcp_mss_from_peer(struct tcpcb *tp, int 
 	if (tp->t_in6pcb)
 		mss -= ip6_optlen(tp->t_in6pcb);
 #endif
+	/*
+	 * XXX XXX What if mss goes negative or zero? This can happen if a
+	 * socket has large IPv6 options. We crash below.
+	 */
 
 	/*
 	 * If there's a pipesize, change the socket buffer to that size.



Re: CVS commit: src/usr.bin/mail

2018-05-23 Thread Christos Zoulas
In article <20180523065522.ga18...@homeworld.netbsd.org>,
  wrote:
>You don't get to sneak a controversial change by omitting a real commit
>message.

το λακωνίζειν εστί φιλοσοφείν 

christos



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

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 23 16:04:13 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist: auth-pam.c sshd.c

Log Message:
Increase strictness of blacklistd patches to include timeouts, operating
system errors, and pam failures.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/crypto/external/bsd/openssh/dist/auth-pam.c
cvs rdiff -u -r1.30 -r1.31 src/crypto/external/bsd/openssh/dist/sshd.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/auth-pam.c
diff -u src/crypto/external/bsd/openssh/dist/auth-pam.c:1.14 src/crypto/external/bsd/openssh/dist/auth-pam.c:1.15
--- src/crypto/external/bsd/openssh/dist/auth-pam.c:1.14	Fri Apr  6 14:58:59 2018
+++ src/crypto/external/bsd/openssh/dist/auth-pam.c	Wed May 23 12:04:13 2018
@@ -50,7 +50,7 @@
 /*
  * NetBSD local changes
  */
-__RCSID("$NetBSD: auth-pam.c,v 1.14 2018/04/06 18:58:59 christos Exp $");
+__RCSID("$NetBSD: auth-pam.c,v 1.15 2018/05/23 16:04:13 christos Exp $");
 #undef USE_POSIX_THREADS /* Not yet */
 #define HAVE_SECURITY_PAM_APPL_H
 #define HAVE_PAM_GETENVLIST
@@ -552,6 +552,7 @@ sshpam_thread(void *ctxtp)
 		ssh_msg_send(ctxt->pam_csock, PAM_MAXTRIES, );
 	else
 		ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, );
+	pfilter_notify(1);
 	buffer_free();
 	pthread_exit(NULL);
 
@@ -830,6 +831,7 @@ sshpam_query(void *ctx, char **name, cha
 free(msg);
 return (0);
 			}
+			pfilter_notify(1);
 			error("PAM: %s for %s%.100s from %.100s", msg,
 			sshpam_authctxt->valid ? "" : "illegal user ",
 			sshpam_authctxt->user,

Index: src/crypto/external/bsd/openssh/dist/sshd.c
diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.30 src/crypto/external/bsd/openssh/dist/sshd.c:1.31
--- src/crypto/external/bsd/openssh/dist/sshd.c:1.30	Sun Apr  8 17:56:48 2018
+++ src/crypto/external/bsd/openssh/dist/sshd.c	Wed May 23 12:04:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshd.c,v 1.30 2018/04/08 21:56:48 joerg Exp $	*/
+/*	$NetBSD: sshd.c,v 1.31 2018/05/23 16:04:13 christos Exp $	*/
 /* $OpenBSD: sshd.c,v 1.506 2018/03/03 03:15:51 djm Exp $ */
 /*
  * Author: Tatu Ylonen 
@@ -44,7 +44,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sshd.c,v 1.30 2018/04/08 21:56:48 joerg Exp $");
+__RCSID("$NetBSD: sshd.c,v 1.31 2018/05/23 16:04:13 christos Exp $");
 #include 
 #include 
 #include 
@@ -344,6 +344,7 @@ main_sigchld_handler(int sig)
 __dead static void
 grace_alarm_handler(int sig)
 {
+	pfilter_notify(1);
 	if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0)
 		kill(pmonitor->m_pid, SIGALRM);
 
@@ -356,7 +357,6 @@ grace_alarm_handler(int sig)
 		killpg(0, SIGTERM);
 	}
 
-	pfilter_notify(1);
 	/* Log error and exit. */
 	sigdie("Timeout before authentication for %s port %d",
 	ssh_remote_ipaddr(active_state), ssh_remote_port(active_state));
@@ -2193,6 +2193,9 @@ cleanup_exit(int i)
 {
 	struct ssh *ssh = active_state; /* XXX */
 
+	if (i == 255)
+		pfilter_notify(1);
+
 	if (the_authctxt) {
 		do_cleanup(ssh, the_authctxt);
 		if (use_privsep && privsep_is_preauth &&



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

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 23 16:04:13 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist: auth-pam.c sshd.c

Log Message:
Increase strictness of blacklistd patches to include timeouts, operating
system errors, and pam failures.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/crypto/external/bsd/openssh/dist/auth-pam.c
cvs rdiff -u -r1.30 -r1.31 src/crypto/external/bsd/openssh/dist/sshd.c

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



CVS commit: src/external/bsd/blacklist/diff

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 23 16:03:07 UTC 2018

Modified Files:
src/external/bsd/blacklist/diff: ssh.diff

Log Message:
refresh the diffs to the latest portable


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/blacklist/diff/ssh.diff

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

Modified files:

Index: src/external/bsd/blacklist/diff/ssh.diff
diff -u src/external/bsd/blacklist/diff/ssh.diff:1.9 src/external/bsd/blacklist/diff/ssh.diff:1.10
--- src/external/bsd/blacklist/diff/ssh.diff:1.9	Mon Jun 26 13:12:05 2017
+++ src/external/bsd/blacklist/diff/ssh.diff	Wed May 23 12:03:07 2018
@@ -62,174 +62,89 @@ diff -u -u -r1.10 Makefile
 +
 +LDADD+=	-lblacklist
 +DPADD+=	${LIBBLACKLIST}
-Index: dist/auth.c
-===
-RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth.c,v
-retrieving revision 1.10
-diff -u -u -r1.10 auth.c
 dist/auth.c	19 Oct 2014 16:30:58 -	1.10
-+++ dist/auth.c	22 Jan 2015 21:39:22 -
-@@ -62,6 +62,7 @@
- #include "monitor_wrap.h"
- #include "krl.h"
- #include "compat.h"
-+#include "pfilter.h"
- 
- #ifdef HAVE_LOGIN_CAP
- #include 
-@@ -362,6 +363,8 @@
- 	compat20 ? "ssh2" : "ssh1",
- 	authctxt->info != NULL ? ": " : "",
- 	authctxt->info != NULL ? authctxt->info : "");
-+	if (!authctxt->postponed)
-+		pfilter_notify(!authenticated);
- 	free(authctxt->info);
- 	authctxt->info = NULL;
- }
-Index: dist/sshd.c
-===
-RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v
-retrieving revision 1.15
-diff -u -u -r1.15 sshd.c
 dist/sshd.c	28 Oct 2014 21:36:16 -	1.15
-+++ dist/sshd.c	22 Jan 2015 21:39:22 -
-@@ -109,6 +109,7 @@
- #include "roaming.h"
- #include "ssh-sandbox.h"
- #include "version.h"
-+#include "pfilter.h"
- 
- #ifdef LIBWRAP
- #include 
-@@ -364,6 +365,7 @@
- 		killpg(0, SIGTERM);
- 	}
- 
-+	pfilter_notify(1);
- 	/* Log error and exit. */
- 	sigdie("Timeout before authentication for %s", get_remote_ipaddr());
- }
-@@ -1160,6 +1162,7 @@
- 	for (i = 0; i < options.max_startups; i++)
- 		startup_pipes[i] = -1;
- 
-+	pfilter_init();
- 	/*
- 	 * Stay listening for connections until the system crashes or
- 	 * the daemon is killed with a signal.
-Index: auth1.c
-===
-RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth1.c,v
-retrieving revision 1.9
-diff -u -u -r1.9 auth1.c
 auth1.c	19 Oct 2014 16:30:58 -	1.9
-+++ auth1.c	14 Feb 2015 15:40:51 -
-@@ -41,6 +41,7 @@
+diff -ru openssh-7.7p1/auth-pam.c dist/auth-pam.c
+--- openssh-7.7p1/auth-pam.c	2018-04-02 01:38:28.0 -0400
 dist/auth-pam.c	2018-05-23 11:56:22.206661484 -0400
+@@ -103,6 +103,7 @@
+ #include "ssh-gss.h"
  #endif
  #include "monitor_wrap.h"
- #include "buffer.h"
 +#include "pfilter.h"
  
- /* import */
  extern ServerOptions options;
-@@ -445,6 +446,7 @@
- 	else {
- 		debug("do_authentication: invalid user %s", user);
- 		authctxt->pw = fakepw();
-+		pfilter_notify(1);
- 	}
+ extern Buffer loginmsg;
+@@ -526,6 +527,7 @@
+ 		ssh_msg_send(ctxt->pam_csock, PAM_MAXTRIES, );
+ 	else
+ 		ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, );
++	pfilter_notify(1);
+ 	buffer_free();
+ 	pthread_exit(NULL);
  
- 	/* Configuration may have changed as a result of Match */
-Index: auth2.c
-===
-RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth2.c,v
-retrieving revision 1.9
-diff -u -u -r1.9 auth2.c
 auth2.c	19 Oct 2014 16:30:58 -	1.9
-+++ auth2.c	14 Feb 2015 15:40:51 -
-@@ -52,6 +52,7 @@
+@@ -804,6 +806,7 @@
+ free(msg);
+ return (0);
+ 			}
++			pfilter_notify(1);
+ 			error("PAM: %s for %s%.100s from %.100s", msg,
+ 			sshpam_authctxt->valid ? "" : "illegal user ",
+ 			sshpam_authctxt->user,
+diff -ru openssh-7.7p1/auth2.c dist/auth2.c
+--- openssh-7.7p1/auth2.c	2018-04-02 01:38:28.0 -0400
 dist/auth2.c	2018-05-23 11:57:31.022197317 -0400
+@@ -51,6 +51,7 @@
+ #include "dispatch.h"
  #include "pathnames.h"
  #include "buffer.h"
- #include "canohost.h"
 +#include "pfilter.h"
  
  #ifdef GSSAPI
  #include "ssh-gss.h"
-@@ -256,6 +257,7 @@
+@@ -242,6 +243,7 @@
  		} else {
- 			logit("input_userauth_request: invalid user %s", user);
+ 			/* Invalid user, fake password information */
  			authctxt->pw = fakepw();
 +			pfilter_notify(1);
- 		}
- #ifdef USE_PAM
- 		if (options.use_pam)
-Index: sshd.c
-===
-RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v
-retrieving revision 1.16
-diff -u -r1.16 sshd.c
 sshd.c	25 Jan 2015 15:52:44 -	1.16
-+++ sshd.c	14 Feb 2015 09:55:06 -
-@@ -628,6 +628,8 @@
- 	explicit_bzero(pw->pw_passwd, 

CVS commit: src/external/bsd/blacklist/diff

2018-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 23 16:03:07 UTC 2018

Modified Files:
src/external/bsd/blacklist/diff: ssh.diff

Log Message:
refresh the diffs to the latest portable


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/blacklist/diff/ssh.diff

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



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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 13:51:28 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Extend traceme_vfork_breakpoint in ATF ptrace(2) tests for more scenarios

traceme_vfork_breakpoint used to test SIGTRAP event. Reuse its code for:
SIGSEGV, SIGILL, SIGFPE and SIGBUS.

The SIGILL case is disabled as of now as it required addition of
PTRACE_ILLEGAL_ASM in MD ptrace(2) headers.

Added tests:
 - traceme_vfork_crash_trap
 - traceme_vfork_crash_segv (renamed from traceme_vfork_breakpoint)
 - traceme_vfork_crash_ill (disabled)
 - traceme_vfork_crash_fpe
 - traceme_vfork_crash_bus

All enabled tests pass.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.51 src/tests/lib/libc/sys/t_ptrace_wait.c:1.52
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.51	Wed May 23 01:29:43 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed May 23 13:51:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.51 2018/05/23 01:29:43 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.52 2018/05/23 13:51:27 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.51 2018/05/23 01:29:43 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.52 2018/05/23 13:51:27 kamil Exp $");
 
 #include 
 #include 
@@ -746,15 +746,8 @@ TRACEME_VFORK_RAISE(traceme_vfork_raise8
 
 /// 
 
-ATF_TC(traceme_vfork_breakpoint);
-ATF_TC_HEAD(traceme_vfork_breakpoint, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify PT_TRACE_ME followed by a software breakpoint in a "
-	"vfork(2)ed child");
-}
-
-ATF_TC_BODY(traceme_vfork_breakpoint, tc)
+static void
+traceme_vfork_crash(int sig)
 {
 	pid_t child, wpid;
 #if defined(TWAIT_HAVE_STATUS)
@@ -767,12 +760,27 @@ ATF_TC_BODY(traceme_vfork_breakpoint, tc
 		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
 		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
-		DPRINTF("Before executing a software breakpoint\n");
-#ifdef PTRACE_BREAKPOINT_ASM
-		PTRACE_BREAKPOINT_ASM;
-#else
-		/* port me */
-#endif
+		DPRINTF("Before executing a trap\n");
+		switch (sig) {
+		case SIGTRAP:
+			trigger_trap();
+			break;
+		case SIGSEGV:
+			trigger_segv();
+			break;
+		case SIGILL:
+			trigger_ill();
+			break;
+		case SIGFPE:
+			trigger_fpe();
+			break;
+		case SIGBUS:
+			trigger_bus();
+			break;
+		default:
+			/* NOTREACHED */
+			FORKEE_ASSERTX(0 && "This shall not be reached");
+		}
 
 		/* NOTREACHED */
 		FORKEE_ASSERTX(0 && "This shall not be reached");
@@ -782,12 +790,33 @@ ATF_TC_BODY(traceme_vfork_breakpoint, tc
 	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
 	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
 
-	validate_status_signaled(status, SIGTRAP, 1);
+	validate_status_signaled(status, sig, 1);
 
 	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+#define TRACEME_VFORK_CRASH(test, sig)		\
+ATF_TC(test);	\
+ATF_TC_HEAD(test, tc)\
+{		\
+	atf_tc_set_md_var(tc, "descr",		\
+	"Verify PT_TRACE_ME followed by a crash signal " #sig " in a "	\
+	"vfork(2)ed child");		\
+}		\
+		\
+ATF_TC_BODY(test, tc)\
+{		\
+		\
+	traceme_vfork_crash(sig);		\
+}
+
+TRACEME_VFORK_CRASH(traceme_vfork_crash_trap, SIGTRAP)
+TRACEME_VFORK_CRASH(traceme_vfork_crash_segv, SIGSEGV)
+//TRACEME_VFORK_CRASH(traceme_vfork_crash_ill, SIGILL)
+TRACEME_VFORK_CRASH(traceme_vfork_crash_fpe, SIGFPE)
+TRACEME_VFORK_CRASH(traceme_vfork_crash_bus, SIGBUS)
+
 /// 
 
 ATF_TC(traceme_vfork_exec);
@@ -5783,12 +5812,7 @@ ATF_TC_BODY(signal3, tc)
 		FORKEE_ASSERT(raise(sigval) == 0);
 
 		DPRINTF("Before raising software breakpoint from child\n");
-
-#ifdef PTRACE_BREAKPOINT_ASM
-		PTRACE_BREAKPOINT_ASM;
-#else
-		/* port me */
-#endif
+		trigger_trap();
 
 		DPRINTF("Before exiting of the child process\n");
 		_exit(exitval);
@@ -7102,7 +7126,11 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, traceme_vfork_raise7);
 	ATF_TP_ADD_TC(tp, traceme_vfork_raise8);
 
-	ATF_TP_ADD_TC(tp, traceme_vfork_breakpoint);
+	ATF_TP_ADD_TC(tp, traceme_vfork_crash_trap);
+	ATF_TP_ADD_TC(tp, traceme_vfork_crash_segv);
+//	ATF_TP_ADD_TC(tp, traceme_vfork_crash_ill);
+	ATF_TP_ADD_TC(tp, traceme_vfork_crash_fpe);
+	ATF_TP_ADD_TC(tp, traceme_vfork_crash_bus);
 
 	ATF_TP_ADD_TC(tp, traceme_vfork_exec);
 



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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 13:51:28 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Extend traceme_vfork_breakpoint in ATF ptrace(2) tests for more scenarios

traceme_vfork_breakpoint used to test SIGTRAP event. Reuse its code for:
SIGSEGV, SIGILL, SIGFPE and SIGBUS.

The SIGILL case is disabled as of now as it required addition of
PTRACE_ILLEGAL_ASM in MD ptrace(2) headers.

Added tests:
 - traceme_vfork_crash_trap
 - traceme_vfork_crash_segv (renamed from traceme_vfork_breakpoint)
 - traceme_vfork_crash_ill (disabled)
 - traceme_vfork_crash_fpe
 - traceme_vfork_crash_bus

All enabled tests pass.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libc/sys/t_ptrace_wait.c

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



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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 13:18:09 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.h

Log Message:
Add new auxiliary functions in ATF ptrace(2) tests

Introduce:
 - trigger_trap()
 - trigger_segv()
 - trigger_ill()
 - trigger_fpe()
 - trigger_bus()

These functions generate appropriate signals caused by crashes.

A debugger is required to collect the crashes regardless of signal masking,
catching or ignoring rules.

While there, append __used argument to can_we_set_dbregs().

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_wait.h

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



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

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 13:18:09 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.h

Log Message:
Add new auxiliary functions in ATF ptrace(2) tests

Introduce:
 - trigger_trap()
 - trigger_segv()
 - trigger_ill()
 - trigger_fpe()
 - trigger_bus()

These functions generate appropriate signals caused by crashes.

A debugger is required to collect the crashes regardless of signal masking,
catching or ignoring rules.

While there, append __used argument to can_we_set_dbregs().

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.5 src/tests/lib/libc/sys/t_ptrace_wait.h:1.6
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.5	Sat May 19 05:04:09 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Wed May 23 13:18:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.5 2018/05/19 05:04:09 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.6 2018/05/23 13:18:09 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -476,7 +476,7 @@ check_happy(unsigned n)
 }
 
 #if defined(HAVE_DBREGS)
-static bool
+static bool __used
 can_we_set_dbregs(void)
 {
 	static long euid = -1;
@@ -504,6 +504,70 @@ can_we_set_dbregs(void)
 }
 #endif
 
+static void __used
+trigger_trap(void)
+{
+
+	/* Software breakpoint causes CPU trap, translated to SIGTRAP */
+#ifdef PTRACE_BREAKPOINT_ASM
+	PTRACE_BREAKPOINT_ASM;
+#else
+	/* port me */
+#endif
+}
+
+static void __used
+trigger_segv(void)
+{
+	static volatile char *ptr = NULL;
+
+	/* Access to unmapped memory causes CPU trap, translated to SIGSEGV */
+	*ptr = 1;
+}
+
+static void __used
+trigger_ill(void)
+{
+
+	/* Illegal instruction causes CPU trap, translated to SIGILL */
+#ifdef PTRACE_ILLEGAL_ASM
+	PTRACE_ILLEGAL_ASM;
+#else
+	/* port me */
+#endif
+}
+
+static int __used
+trigger_fpe(void)
+{
+	static volatile int a = 1;
+	static volatile int b = 0;
+	static volatile int c;
+
+	/* Division by zero causes CPU trap, translated to SIGFPE */
+	c = a / b;
+
+	return c;
+}
+
+static void __used
+trigger_bus(void)
+{
+	FILE *fp;
+	char *p;
+
+	/* Open an empty file for writing. */
+	fp = tmpfile();
+	FORKEE_ASSERT_NEQ((uintmax_t)fp, (uintmax_t)NULL);
+
+	/* Map an empty file with mmap(2) to a pointer. */
+	p = mmap(0, 1, PROT_WRITE, MAP_PRIVATE, fileno(fp), 0);
+	FORKEE_ASSERT_NEQ((uintmax_t)p, (uintmax_t)MAP_FAILED);
+
+	/* Invalid memory access causes CPU trap, translated to SIGBUS */
+	*p = 'a';
+}
+
 #if defined(TWAIT_HAVE_PID)
 #define ATF_TP_ADD_TC_HAVE_PID(a,b)	ATF_TP_ADD_TC(a,b)
 #else



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:16:13 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC(.old) sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4 src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.5
--- src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4	Mon Nov 13 08:05:22 2017
+++ src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Wed May 23 11:16:13 2018
@@ -103,7 +103,7 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags,
 int fd, u64 offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd,
+  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
 			  (long)0, offset);
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:16:13 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC(.old) sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc.old/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:14:49 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.16	Fri Feb 16 07:59:05 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Wed May 23 11:14:49 2018
@@ -113,7 +113,7 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
OFF_T offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd,
+  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
 			  (long)0, offset);
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:14:49 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



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

2018-05-23 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed May 23 10:42:05 UTC 2018

Modified Files:
src/sys/arch/arm/imx: imx6_ahcisata.c imx6_ccm.c imx6_ccmreg.h
imx6_pcie.c imx6_usb.c imx6_usdhc.c

Log Message:
Modified CCM register defines.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imx6_ahcisata.c \
src/sys/arch/arm/imx/imx6_ccmreg.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/imx6_ccm.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imx6_pcie.c \
src/sys/arch/arm/imx/imx6_usdhc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx6_usb.c

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



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

2018-05-23 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed May 23 10:42:05 UTC 2018

Modified Files:
src/sys/arch/arm/imx: imx6_ahcisata.c imx6_ccm.c imx6_ccmreg.h
imx6_pcie.c imx6_usb.c imx6_usdhc.c

Log Message:
Modified CCM register defines.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imx6_ahcisata.c \
src/sys/arch/arm/imx/imx6_ccmreg.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/imx6_ccm.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imx6_pcie.c \
src/sys/arch/arm/imx/imx6_usdhc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx6_usb.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/imx/imx6_ahcisata.c
diff -u src/sys/arch/arm/imx/imx6_ahcisata.c:1.6 src/sys/arch/arm/imx/imx6_ahcisata.c:1.7
--- src/sys/arch/arm/imx/imx6_ahcisata.c:1.6	Thu Nov  9 05:57:23 2017
+++ src/sys/arch/arm/imx/imx6_ahcisata.c	Wed May 23 10:42:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ahcisata.c,v 1.6 2017/11/09 05:57:23 hkenken Exp $	*/
+/*	$NetBSD: imx6_ahcisata.c,v 1.7 2018/05/23 10:42:05 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_ahcisata.c,v 1.6 2017/11/09 05:57:23 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ahcisata.c,v 1.7 2018/05/23 10:42:05 hkenken Exp $");
 
 #include "locators.h"
 #include "opt_imx.h"
@@ -264,7 +264,7 @@ ixm6_ahcisata_init(struct imx_ahci_softc
 
 	/* AHCISATA clock enable */
 	v = imx6_ccm_read(CCM_CCGR5);
-	imx6_ccm_write(CCM_CCGR5, v | CCM_CCGR5_100M_CLK_ENABLE(3));
+	imx6_ccm_write(CCM_CCGR5, v | __SHIFTIN(3, CCM_CCGR5_SATA_CLK_ENABLE));
 
 	/* PLL power up */
 	if (imx6_pll_power(CCM_ANALOG_PLL_ENET, 1,
Index: src/sys/arch/arm/imx/imx6_ccmreg.h
diff -u src/sys/arch/arm/imx/imx6_ccmreg.h:1.6 src/sys/arch/arm/imx/imx6_ccmreg.h:1.7
--- src/sys/arch/arm/imx/imx6_ccmreg.h:1.6	Thu Nov  9 05:57:23 2017
+++ src/sys/arch/arm/imx/imx6_ccmreg.h	Wed May 23 10:42:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_ccmreg.h,v 1.6 2017/11/09 05:57:23 hkenken Exp $	*/
+/*	$NetBSD: imx6_ccmreg.h,v 1.7 2018/05/23 10:42:05 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -163,7 +163,6 @@
 #define  CCM_CHSCCDR_IPU1_DI0_PODF		__BITS(5, 3)
 #define  CCM_CHSCCDR_IPU1_DI0_CLK_SEL		__BITS(2, 0)
 
-
 #define CCM_CSCDR20x0038
 #define  CCM_CSCDR2_ECSPI_CLK_PODF		__BITS(24, 19)
 #define  CCM_CSCDR2_IPU2_DI1_PRE_CLK_SEL	__BITS(17, 15)
@@ -189,65 +188,108 @@
 #define  CCM_CSCDR3_IPU1_HSP_CLK_SEL		__BITS(10, 9)
 
 #define CCM_CCOSR0x0060
-#define  CCM_CCOSR_CLKO2_EN	__BIT(24)
-#define  CCM_CCOSR_CLKO2_DIV	__BITS(23, 21)
-#define  CCM_CCOSR_CLKO2_SEL	__BITS(20, 16)
-#define  CCM_CCOSR_CLK_OUT_SEL	__BIT(8)
-#define  CCM_CCOSR_CLKO1_EN	__BIT(7)
-#define  CCM_CCOSR_CLKO1_DIV	__BITS(6, 4)
-#define  CCM_CCOSR_CLKO1_SEL	__BITS(3, 0)
-
-#define CCM_CCGR2		0x0070
-#define  CCM_CCGR2_IPSYNC_VDOA_IPG_CLK_ENABLE(n)		__SHIFTIN(n, __BITS(27, 26))
-#define  CCM_CCGR2_IPSYNC_IP2APB_TZASC2_IPG_CLK_ENABLE(n)   __SHIFTIN(n, __BITS(25, 24))
-#define  CCM_CCGR2_IPSYNC_IP2APB_TZASC1_IPG_CLK_ENABLE(n)   __SHIFTIN(n, __BITS(23, 22))
-#define  CCM_CCGR2_IPMUX3_CLK_ENABLE(n)__SHIFTIN(n, __BITS(21, 20))
-#define  CCM_CCGR2_IPMUX2_CLK_ENABLE(n)__SHIFTIN(n, __BITS(19, 18))
-#define  CCM_CCGR2_IPMUX1_CLK_ENABLE(n)__SHIFTIN(n, __BITS(17, 16))
-#define  CCM_CCGR2_IOMUX_IPT_CLK_IO_CLK_ENABLE(n)		__SHIFTIN(n, __BITS(15, 14))
-#define  CCM_CCGR2_IIM_CLK_ENABLE(n)__SHIFTIN(n, __BITS(13, 12))
-#define  CCM_CCGR2_I2C3_SERIAL_CLK_ENABLE(n)			__SHIFTIN(n, __BITS(11, 10))
-#define  CCM_CCGR2_I2C2_SERIAL_CLK_ENABLE(n)			__SHIFTIN(n, __BITS(9, 8))
-#define  CCM_CCGR2_I2C1_SERIAL_CLK_ENABLE(n)			__SHIFTIN(n, __BITS(7, 6))
-#define  CCM_CCGR2_HDMI_TX_ISFRCLK_ENABLE(n)			__SHIFTIN(n, __BITS(5, 4))
-#define  CCM_CCGR2_HDMI_TX_IAHBCLK_ENABLE(n)			__SHIFTIN(n, __BITS(1, 0))
-#define CCM_CCGR4	0x0078
-#define  CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_CLK_ENABLE(N)		__SHIFTIN(n, __BITS(31, 30))
-#define  CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_CLK_ENABLE(n) 	__SHIFTIN(n, __BITS(29, 28))
-#define  CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_CLK_ENABLE(n)		__SHIFTIN(n, __BITS(27, 26))
-#define  CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_CLK_ENABLE(n)		__SHIFTIN(n, __BITS(25, 24))
-#define  CCM_CCGR4_PWM4_CLK_ENABLE(n)	__SHIFTIN(n, __BITS(23, 22))
-#define  CCM_CCGR4_PWM3_CLK_ENABLE(n)	__SHIFTIN(n, __BITS(21, 20))
-#define  CCM_CCGR4_PWM2_CLK_ENABLE(n)	__SHIFTIN(n, __BITS(19, 18))
-#define  CCM_CCGR4_PWM1_CLK_ENABLE(n)	__SHIFTIN(n, __BITS(17, 16))
-#define  CCM_CCGR4_PL301_MX6QPER2_MAINCLK_ENABLE(n)			__SHIFTIN(n, __BITS(15, 14))
-#define  CCM_CCGR4_PL301_MX6QPER1_BCHCLK_ENABLE(n)			__SHIFTIN(n, __BITS(13, 12))
-#define  CCM_CCGR4_CG5_ENABLE(n)	__SHIFTIN(n, __BITS(11, 10))
-#define  

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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 10:21:43 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
Add a comment about recent AMD CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/fpu.c

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



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 10:21:43 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
Add a comment about recent AMD CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/fpu.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/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.31 src/sys/arch/x86/x86/fpu.c:1.32
--- src/sys/arch/x86/x86/fpu.c:1.31	Wed May 23 10:00:27 2018
+++ src/sys/arch/x86/x86/fpu.c	Wed May 23 10:21:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.31 2018/05/23 10:00:27 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.32 2018/05/23 10:21:43 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.31 2018/05/23 10:00:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.32 2018/05/23 10:21:43 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -352,6 +352,10 @@ fpu_clear_amd(void)
 	 * Before that, clear the ES bit in the x87 status word if it is
 	 * currently set, in order to avoid causing a fault in the
 	 * upcoming load.
+	 *
+	 * Newer generations of AMD CPUs have CPUID_Fn8008_EBX[2],
+	 * which indicates that FIP/FDP/FOP are restored (same behavior
+	 * as Intel). We're not using it though.
 	 */
 	if (fngetsw() & 0x80)
 		fnclex();



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

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 23 10:11:08 UTC 2018

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

Log Message:
 Add "bool txr_no_space" for TX descriptor shortage. Use it like IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.99 -r1.100 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.46 src/sys/dev/pci/ixgbe/ix_txrx.c:1.47
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.46	Wed May 23 04:45:24 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed May 23 10:11:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.46 2018/05/23 04:45:24 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.47 2018/05/23 10:11:07 msaitoh Exp $ */
 
 /**
 
@@ -146,7 +146,9 @@ ixgbe_legacy_start_locked(struct ifnet *
 	}
 	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return (ENETDOWN);
-
+	if (txr->txr_no_space)
+		return (ENETDOWN);
+	
 	while (!IFQ_IS_EMPTY(>if_snd)) {
 		if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE)
 			break;
@@ -291,6 +293,8 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 	}
 	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return (ENETDOWN);
+	if (txr->txr_no_space)
+		return (ENETDOWN);
 
 	/* Process the queue */
 	while ((next = pcq_get(txr->txr_interq)) != NULL) {
@@ -461,6 +465,7 @@ retry:
 
 	/* Make certain there are enough descriptors */
 	if (txr->tx_avail < (map->dm_nsegs + 2)) {
+		txr->txr_no_space = true;
 		txr->no_desc_avail.ev_count++;
 		ixgbe_dmamap_unload(txr->txtag, txbuf->map);
 		return EAGAIN;
@@ -1159,6 +1164,7 @@ ixgbe_txeof(struct tx_ring *txr)
 			buf->m_head = NULL;
 		}
 		buf->eop = NULL;
+		txr->txr_no_space = false;
 		++txr->tx_avail;
 
 		/* We clean the range if multi segment */

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.154 src/sys/dev/pci/ixgbe/ixgbe.c:1.155
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.154	Wed May 23 04:37:13 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed May 23 10:11:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.154 2018/05/23 04:37:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.155 2018/05/23 10:11:07 msaitoh Exp $ */
 
 /**
 
@@ -703,6 +703,8 @@ ixgbe_initialize_transmit_units(struct a
 		/* Cache the tail address */
 		txr->tail = IXGBE_TDT(j);
 
+		txr->txr_no_space = false;
+
 		/* Disable Head Writeback */
 		/*
 		 * Note: for X550 series devices, these registers are actually

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.48 src/sys/dev/pci/ixgbe/ixgbe.h:1.49
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.48	Fri May 18 10:09:02 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed May 23 10:11:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.48 2018/05/18 10:09:02 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.49 2018/05/23 10:11:07 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -368,6 +368,7 @@ struct tx_ring {
 	pcq_t			*txr_interq;
 	struct work		wq_cookie;
 	void			*txr_si;
+	bool			txr_no_space; /* Like IFF_OACTIVE */
 
 	/* Flow Director */
 	u16			atr_sample;

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.99 src/sys/dev/pci/ixgbe/ixv.c:1.100
--- src/sys/dev/pci/ixgbe/ixv.c:1.99	Wed May 23 04:37:13 2018
+++ src/sys/dev/pci/ixgbe/ixv.c	Wed May 23 10:11:07 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.99 2018/05/23 04:37:13 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.100 2018/05/23 10:11:07 msaitoh Exp $*/
 
 /**
 
@@ -1589,6 +1589,8 @@ ixv_initialize_transmit_units(struct ada
 		/* Set Tx Tail register */
 		txr->tail = IXGBE_VFTDT(j);
 
+		txr->txr_no_space = false;
+
 		/* Set Ring parameters */
 		IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(j),
 		(tdba & 0xULL));



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

2018-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 23 10:11:08 UTC 2018

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

Log Message:
 Add "bool txr_no_space" for TX descriptor shortage. Use it like IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.99 -r1.100 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.



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 10:00:27 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
Clarify and extend the fix for the AMD FPU leaks. We were clearing the x87
state only on FXRSTOR, but the same problem exists on XRSTOR, so clear the
state there too.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/x86/fpu.c

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



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 10:00:27 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
Clarify and extend the fix for the AMD FPU leaks. We were clearing the x87
state only on FXRSTOR, but the same problem exists on XRSTOR, so clear the
state there too.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/x86/fpu.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/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.30 src/sys/arch/x86/x86/fpu.c:1.31
--- src/sys/arch/x86/x86/fpu.c:1.30	Wed May 23 07:45:35 2018
+++ src/sys/arch/x86/x86/fpu.c	Wed May 23 10:00:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.30 2018/05/23 07:45:35 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.31 2018/05/23 10:00:27 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.30 2018/05/23 07:45:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.31 2018/05/23 10:00:27 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -109,6 +109,8 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.30
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -337,6 +339,25 @@ fputrap(struct trapframe *frame)
 	(*curlwp->l_proc->p_emul->e_trapsignal)(curlwp, );
 }
 
+static void
+fpu_clear_amd(void)
+{
+	/*
+	 * AMD FPUs do not restore FIP, FDP, and FOP on fxrstor and xrstor
+	 * when FSW.ES=0, leaking other threads' execution history.
+	 *
+	 * Clear them manually by loading a zero (fldummy). We do this
+	 * unconditionally, regardless of FSW.ES.
+	 *
+	 * Before that, clear the ES bit in the x87 status word if it is
+	 * currently set, in order to avoid causing a fault in the
+	 * upcoming load.
+	 */
+	if (fngetsw() & 0x80)
+		fnclex();
+	fldummy();
+}
+
 /*
  * Implement device not available (DNA) exception
  *
@@ -409,22 +430,14 @@ fpudna(struct trapframe *frame)
 		frstor(>pcb_savefpu);
 		break;
 	case FPU_SAVE_FXSAVE:
-		/*
-		 * AMD FPU's do not restore FIP, FDP, and FOP on
-		 * fxrstor, leaking other process's execution history.
-		 * Clear them manually by loading a zero.
-		 *
-		 * Clear the ES bit in the x87 status word if it is
-		 * currently set, in order to avoid causing a fault
-		 * in the upcoming load.
-		 */
-		if (fngetsw() & 0x80)
-			fnclex();
-		fldummy();
+		if (cpu_vendor == CPUVENDOR_AMD)
+			fpu_clear_amd();
 		fxrstor(>pcb_savefpu);
 		break;
 	case FPU_SAVE_XSAVE:
 	case FPU_SAVE_XSAVEOPT:
+		if (cpu_vendor == CPUVENDOR_AMD)
+			fpu_clear_amd();
 		xrstor(>pcb_savefpu, x86_xsave_features);
 		break;
 	}



CVS commit: src/external/gpl2/gmake/dist/glob

2018-05-23 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed May 23 09:52:27 UTC 2018

Modified Files:
src/external/gpl2/gmake/dist/glob: glob.c

Log Message:
gmake: __alloca and __stat are provided only when building with GLIBC.

Fix a build failure on Ubuntu 18.04.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/gmake/dist/glob/glob.c

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

Modified files:

Index: src/external/gpl2/gmake/dist/glob/glob.c
diff -u src/external/gpl2/gmake/dist/glob/glob.c:1.4 src/external/gpl2/gmake/dist/glob/glob.c:1.5
--- src/external/gpl2/gmake/dist/glob/glob.c:1.4	Mon Apr 16 16:11:40 2018
+++ src/external/gpl2/gmake/dist/glob/glob.c	Wed May 23 09:52:27 2018
@@ -207,7 +207,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ */
 
 
-#if !defined __alloca && !(defined __GNU_LIBRARY__ || defined __GLIBC__)
+#if !defined __alloca
 
 # ifdef	__GNUC__
 #  undef alloca
@@ -230,7 +230,7 @@ extern char *alloca ();
 
 #endif
 
-#ifndef __GNU_LIBRARY__
+#if !defined __stat
 # define __stat stat
 # ifdef STAT_MACROS_BROKEN
 #  undef S_ISDIR



CVS commit: src/external/gpl2/gmake/dist/glob

2018-05-23 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed May 23 09:52:27 UTC 2018

Modified Files:
src/external/gpl2/gmake/dist/glob: glob.c

Log Message:
gmake: __alloca and __stat are provided only when building with GLIBC.

Fix a build failure on Ubuntu 18.04.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/gmake/dist/glob/glob.c

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



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

2018-05-23 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed May 23 08:20:12 UTC 2018

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

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/aarch64_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/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.3 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.4
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.3	Thu May  3 15:47:22 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed May 23 08:20:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.3 2018/05/03 15:47:22 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.4 2018/05/23 08:20:12 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.3 2018/05/03 15:47:22 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.4 2018/05/23 08:20:12 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -268,11 +268,12 @@ static int
 aarch64_sysctl_machdep_sysreg_helper(SYSCTLFN_ARGS)
 {
 	struct sysctlnode node;
-	uint64_t databuf[8];
+#define MAX_SYSCTLREGS	8
+	uint64_t databuf[MAX_SYSCTLREGS];
 	void *data;
 
 	node = *rnode;
-	node.sysctl_data = data = 
+	node.sysctl_data = data = (void *)databuf;
 
 	/*
 	 * Don't keep values in advance due to system registers may have



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

2018-05-23 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed May 23 08:20:12 UTC 2018

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

Log Message:
style


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

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



CVS commit: src/sys/arch

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:45:35 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/include: fpu.h
src/sys/arch/x86/x86: fpu.c
src/sys/arch/xen/conf: files.xen
Removed Files:
src/sys/arch/x86/x86: convert_xmm_s87.c

Log Message:
Merge convert_xmm_s87.c into fpu.c. It contains only two functions, that
are used only in fpu.c.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.393 -r1.394 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/x86/x86/convert_xmm_s87.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/x86/fpu.c
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/xen/conf/files.xen

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/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.103 src/sys/arch/amd64/conf/files.amd64:1.104
--- src/sys/arch/amd64/conf/files.amd64:1.103	Tue May 22 11:09:57 2018
+++ src/sys/arch/amd64/conf/files.amd64	Wed May 23 07:45:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.103 2018/05/22 11:09:57 maxv Exp $
+#	$NetBSD: files.amd64,v 1.104 2018/05/23 07:45:35 maxv Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -56,7 +56,6 @@ file	arch/amd64/amd64/process_machdep.c	
 file	arch/amd64/amd64/trap.c			machdep
 file	arch/x86/x86/fpu.c			machdep
 file	arch/x86/x86/dbregs.c			machdep
-file	arch/x86/x86/convert_xmm_s87.c		machdep
 file	arch/x86/x86/spectre.c			machdep
 file	arch/amd64/amd64/lock_stubs.S		machdep
 file	dev/cons.cmachdep

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.393 src/sys/arch/i386/conf/files.i386:1.394
--- src/sys/arch/i386/conf/files.i386:1.393	Tue May 22 11:09:57 2018
+++ src/sys/arch/i386/conf/files.i386	Wed May 23 07:45:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.393 2018/05/22 11:09:57 maxv Exp $
+#	$NetBSD: files.i386,v 1.394 2018/05/23 07:45:35 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -73,7 +73,6 @@ file	arch/i386/i386/machdep.c
 file 	arch/i386/i386/longrun.c
 file	arch/i386/i386/mtrr_k6.c	mtrr
 file	arch/i386/i386/process_machdep.c
-file	arch/x86/x86/convert_xmm_s87.c
 file	arch/i386/i386/trap.c
 file	dev/cons.c
 file	arch/x86/x86/fpu.c

Index: src/sys/arch/x86/include/fpu.h
diff -u src/sys/arch/x86/include/fpu.h:1.7 src/sys/arch/x86/include/fpu.h:1.8
--- src/sys/arch/x86/include/fpu.h:1.7	Fri Nov  3 07:14:24 2017
+++ src/sys/arch/x86/include/fpu.h	Wed May 23 07:45:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.h,v 1.7 2017/11/03 07:14:24 maxv Exp $	*/
+/*	$NetBSD: fpu.h,v 1.8 2018/05/23 07:45:35 maxv Exp $	*/
 
 #ifndef	_X86_FPU_H_
 #define	_X86_FPU_H_
@@ -21,9 +21,6 @@ void fpu_set_default_cw(struct lwp *, un
 void fputrap(struct trapframe *);
 void fpudna(struct trapframe *);
 
-void process_xmm_to_s87(const struct fxsave *, struct save87 *);
-void process_s87_to_xmm(const struct save87 *, struct fxsave *);
-
 /* Set all to defaults (eg during exec) */
 void fpu_save_area_clear(struct lwp *, unsigned int);
 /* Reset control words only - for signal handlers */

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.29 src/sys/arch/x86/x86/fpu.c:1.30
--- src/sys/arch/x86/x86/fpu.c:1.29	Wed May 23 07:34:40 2018
+++ src/sys/arch/x86/x86/fpu.c	Wed May 23 07:45:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.29 2018/05/23 07:34:40 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.30 2018/05/23 07:45:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.29 2018/05/23 07:34:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.30 2018/05/23 07:45:35 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -613,6 +613,126 @@ fpu_save_area_fork(struct pcb *pcb2, con
 		memcpy(pcb2 + 1, pcb1 + 1, extra);
 }
 
+/* - */
+
+static void
+process_xmm_to_s87(const struct fxsave *sxmm, struct save87 *s87)
+{
+	unsigned int tag, ab_tag;
+	const struct fpaccfx *fx_reg;
+	struct fpacc87 *s87_reg;
+	int i;
+
+	/*
+	 * For historic reasons core dumps and ptrace all use the old save87
+	 * layout.  Convert the important parts.
+	 * getucontext gets what we give it.
+	 * setucontext should return something given by getucontext, but
+	 * we are (at the moment) willing to change it.
+	 *
+	 * It really isn't worth setting the 'tag' bits to 01 (zero) or
+	 * 10 (NaN etc) since the processor will set any internal bits
+	 * correctly when the value is loaded (the 287 believed them).
+	 *
+	 * Additionally the s87_tw and s87_tw are 'indexed' by the actual
+	 * register numbers, whereas the registers themselves have ST(0)
+	 * 

CVS commit: src/sys/arch

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:45:35 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/include: fpu.h
src/sys/arch/x86/x86: fpu.c
src/sys/arch/xen/conf: files.xen
Removed Files:
src/sys/arch/x86/x86: convert_xmm_s87.c

Log Message:
Merge convert_xmm_s87.c into fpu.c. It contains only two functions, that
are used only in fpu.c.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.393 -r1.394 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/x86/x86/convert_xmm_s87.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/x86/fpu.c
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/xen/conf/files.xen

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



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:34:40 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/fpu.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/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.28 src/sys/arch/x86/x86/fpu.c:1.29
--- src/sys/arch/x86/x86/fpu.c:1.28	Fri Feb  9 08:58:01 2018
+++ src/sys/arch/x86/x86/fpu.c	Wed May 23 07:34:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.28 2018/02/09 08:58:01 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.29 2018/05/23 07:34:40 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.28 2018/02/09 08:58:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.29 2018/05/23 07:34:40 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -135,11 +135,11 @@ process_fpframe(struct lwp *lwp)
 	return >pcb_savefpu;
 }
 
-/* 
+/*
  * The following table is used to ensure that the FPE_... value
  * that is passed as a trapcode to the signal handler of the user
  * process does not have more than one bit set.
- * 
+ *
  * Multiple bits may be set if SSE simd instructions generate errors
  * on more than one value or if the user process modifies the control
  * word while a status word bit is already set (which this is a sign
@@ -160,7 +160,7 @@ process_fpframe(struct lwp *lwp)
  * 2) Throw away the bits currently masked in the control word,
  *assuming the user isn't interested in them anymore.
  * 3) Reinsert status word bit 7 (stack fault) if it is set, which
- *cannot be masked but must be presered.
+ *cannot be masked but must be preserved.
  *'Stack fault' is a sub-class of 'invalid operation'.
  * 4) Use the remaining bits to point into the trapcode table.
  *
@@ -171,12 +171,12 @@ process_fpframe(struct lwp *lwp)
  * 1b   Stack overflow
  * 1c   Operand of unsupported format
  * 1d   SNaN operand.
- * 2  QNaN operand (not an exception, irrelavant here)
+ * 2  QNaN operand (not an exception, irrelevant here)
  * 3  Any other invalid-operation not mentioned above or zero divide
  *  (FP_X_INV, FP_X_DZ)
  * 4  Denormal operand (FP_X_DNML)
  * 5  Numeric over/underflow (FP_X_OFL, FP_X_UFL)
- * 6  Inexact result (FP_X_IMP) 
+ * 6  Inexact result (FP_X_IMP)
  *
  * NB: the above seems to mix up the mxscr error bits and the x87 ones.
  * They are in the same order, but there is no EN_SW_STACK_FAULT in the mmx
@@ -405,30 +405,28 @@ fpudna(struct trapframe *frame)
 	pcb->pcb_fpcpu = ci;
 
 	switch (x86_fpu_save) {
-		case FPU_SAVE_FSAVE:
-			frstor(>pcb_savefpu);
-			break;
-
-		case FPU_SAVE_FXSAVE:
-			/*
-			 * AMD FPU's do not restore FIP, FDP, and FOP on
-			 * fxrstor, leaking other process's execution history.
-			 * Clear them manually by loading a zero.
-			 *
-			 * Clear the ES bit in the x87 status word if it is
-			 * currently set, in order to avoid causing a fault
-			 * in the upcoming load.
-			 */
-			if (fngetsw() & 0x80)
-fnclex();
-			fldummy();
-			fxrstor(>pcb_savefpu);
-			break;
-
-		case FPU_SAVE_XSAVE:
-		case FPU_SAVE_XSAVEOPT:
-			xrstor(>pcb_savefpu, x86_xsave_features);
-			break;
+	case FPU_SAVE_FSAVE:
+		frstor(>pcb_savefpu);
+		break;
+	case FPU_SAVE_FXSAVE:
+		/*
+		 * AMD FPU's do not restore FIP, FDP, and FOP on
+		 * fxrstor, leaking other process's execution history.
+		 * Clear them manually by loading a zero.
+		 *
+		 * Clear the ES bit in the x87 status word if it is
+		 * currently set, in order to avoid causing a fault
+		 * in the upcoming load.
+		 */
+		if (fngetsw() & 0x80)
+			fnclex();
+		fldummy();
+		fxrstor(>pcb_savefpu);
+		break;
+	case FPU_SAVE_XSAVE:
+	case FPU_SAVE_XSAVEOPT:
+		xrstor(>pcb_savefpu, x86_xsave_features);
+		break;
 	}
 
 	KASSERT(ci == curcpu());
@@ -458,21 +456,18 @@ fpusave_cpu(bool save)
 		clts();
 
 		switch (x86_fpu_save) {
-			case FPU_SAVE_FSAVE:
-fnsave(>pcb_savefpu);
-break;
-
-			case FPU_SAVE_FXSAVE:
-fxsave(>pcb_savefpu);
-break;
-
-			case FPU_SAVE_XSAVE:
-xsave(>pcb_savefpu, x86_xsave_features);
-break;
-
-			case FPU_SAVE_XSAVEOPT:
-xsaveopt(>pcb_savefpu, x86_xsave_features);
-break;
+		case FPU_SAVE_FSAVE:
+			fnsave(>pcb_savefpu);
+			break;
+		case FPU_SAVE_FXSAVE:
+			fxsave(>pcb_savefpu);
+			break;
+		case FPU_SAVE_XSAVE:
+			xsave(>pcb_savefpu, x86_xsave_features);
+			break;
+		case FPU_SAVE_XSAVEOPT:
+			xsaveopt(>pcb_savefpu, x86_xsave_features);
+			break;
 		}
 	}
 



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:34:40 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/fpu.c

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



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

2018-05-23 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Wed May 23 07:33:55 UTC 2018

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

Log Message:
fix build

obsolete HMAC from cat3 as it was renamed to openssl_HMAC


To generate a diff of this commit:
cvs rdiff -u -r1.2194 -r1.2195 src/distrib/sets/lists/comp/mi

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



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

2018-05-23 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Wed May 23 07:33:55 UTC 2018

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

Log Message:
fix build

obsolete HMAC from cat3 as it was renamed to openssl_HMAC


To generate a diff of this commit:
cvs rdiff -u -r1.2194 -r1.2195 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2194 src/distrib/sets/lists/comp/mi:1.2195
--- src/distrib/sets/lists/comp/mi:1.2194	Wed May 23 02:06:03 2018
+++ src/distrib/sets/lists/comp/mi	Wed May 23 07:33:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2194 2018/05/23 02:06:03 christos Exp $
+#	$NetBSD: mi,v 1.2195 2018/05/23 07:33:55 para Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -4699,7 +4699,7 @@
 ./usr/share/man/cat3/GCQ_INIT.0			comp-sys-catman		.cat
 ./usr/share/man/cat3/GCQ_INIT_HEAD.0		comp-sys-catman		.cat
 ./usr/share/man/cat3/GCQ_ITEM.0			comp-sys-catman		.cat
-./usr/share/man/cat3/HMAC.0			comp-openssl		openssl
+./usr/share/man/cat3/HMAC.0			comp-obsolete		obsolete
 ./usr/share/man/cat3/IFTODT.0			comp-c-catman		.cat
 ./usr/share/man/cat3/LIST.0			comp-c-catman		.cat
 ./usr/share/man/cat3/LIST_EMPTY.0		comp-c-catman		.cat



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:24:38 UTC 2018

Modified Files:
src/sys/arch/x86/include: cpu_extended_state.h specialreg.h

Log Message:
Clean up the FPU headers.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/include/cpu_extended_state.h
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/x86/include/specialreg.h

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



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

2018-05-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 23 07:24:38 UTC 2018

Modified Files:
src/sys/arch/x86/include: cpu_extended_state.h specialreg.h

Log Message:
Clean up the FPU headers.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/include/cpu_extended_state.h
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/cpu_extended_state.h
diff -u src/sys/arch/x86/include/cpu_extended_state.h:1.15 src/sys/arch/x86/include/cpu_extended_state.h:1.16
--- src/sys/arch/x86/include/cpu_extended_state.h:1.15	Wed Nov  8 17:55:54 2017
+++ src/sys/arch/x86/include/cpu_extended_state.h	Wed May 23 07:24:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_extended_state.h,v 1.15 2017/11/08 17:55:54 maxv Exp $	*/
+/*	$NetBSD: cpu_extended_state.h,v 1.16 2018/05/23 07:24:37 maxv Exp $	*/
 
 #ifndef _X86_CPU_EXTENDED_STATE_H_
 #define _X86_CPU_EXTENDED_STATE_H_
@@ -18,8 +18,8 @@
  * This includes registers (etc) used by SSE/SSE2/SSE3/SSSE3/SSE4 and the later
  * AVX instructions.
  *
- * The definitions are such that any future 'extended state' should be handled
- * (provided the kernel doesn't need to know the actual contents).
+ * The definitions are such that any future 'extended state' should be handled,
+ * provided the kernel doesn't need to know the actual contents.
  *
  * The actual structures the cpu accesses must be aligned to 16 bytes for FXSAVE
  * and 64 for XSAVE. The types aren't aligned because copies do not need extra
@@ -30,18 +30,18 @@
  * support the fxsave instruction.
  *
  * Associated save instructions:
- * FNSAVE:   Saves x87 state in 108 bytes (original i387 layout).
- *   Then reinitializes the fpu.
+ * FNSAVE:   Saves x87 state in 108 bytes (original i387 layout). Then
+ *   reinitializes the fpu.
  * FSAVE:Encodes to FWAIT followed by FNSAVE.
- * FXSAVE:   Saves the x87 state and XMM (aka SSE) registers to the
- *   first 448 (max) bytes of a 512 byte area.
- *   This layout does not match that written by FNSAVE.
- * XSAVE:Uses the same layout for the x87 and XMM registers,
- *   followed by a 64byte header and separate save areas
- *   for additional extended cpu state.
- *   The x87 state is always saved, the others conditionally.
- * XSAVEOPT: As XSAVE but only writes the registers blocks that have been
- *   modified.
+ * FXSAVE:   Saves the x87 state and XMM (aka SSE) registers to the first
+ *   448 (max) bytes of a 512 byte area. This layout does not match
+ *   that written by FNSAVE.
+ * XSAVE:Uses the same layout for the x87 and XMM registers, followed by
+ *   a 64byte header and separate save areas for additional extended
+ *   cpu states. The x87 state is always saved, the others
+ *   conditionally.
+ * XSAVEOPT: Same as XSAVE but only writes the registers blocks that have
+ *   been modified.
  */
 
 /*
@@ -80,10 +80,11 @@ struct ymmreg {
 };
 
 /*
- * Floating point unit registers (fsave instruction).
- * The s87_ac[] and fx_87_ac[] are relative to the stack top.
- * The 'tag word' contains 2 bits per register and refers to absolute register
- * numbers.
+ * Floating point unit registers (FSAVE instruction).
+ *
+ * The s87_ac[] and fx_87_ac[] are relative to the stack top. The 'tag word'
+ * contains 2 bits per register and refers to absolute register numbers.
+ *
  * The cpu sets the tag values 0b01 (zero) and 0b10 (special) when a value
  * is loaded. The software need only set 0b00 (used) and 0xb11 (unused).
  * The fxsave 'Abridged tag word' in inverted.
@@ -100,7 +101,7 @@ struct save87 {
 __CTASSERT_NOLINT(sizeof(struct save87) == 108);
 
 /*
- * FPU/MMX/SSE/SSE2 context
+ * FPU/MMX/SSE/SSE2 context (FXSAVE instruction).
  */
 struct fxsave {
 	uint16_t fx_cw;		/* FPU Control Word */
@@ -122,7 +123,7 @@ __CTASSERT_NOLINT(sizeof(struct fxsave) 
  * For XSAVE, a 64byte header follows the fxsave data.
  */
 struct xsave_header {
-	uint8_t xsh_fxsave[512];	/* to align in the union */
+	uint8_t xsh_fxsave[512];	/* struct fxsave */
 	uint64_t xsh_xstate_bv;		/* bitmap of saved sub structures */
 	uint64_t xsh_xcomp_bv;		/* bitmap of compact sub structures */
 	uint8_t xsh_rsrvd[8];		/* must be zero */
@@ -145,10 +146,10 @@ __CTASSERT(sizeof(struct xsave_ymm) == 2
  * NB: Some userspace stuff (eg firefox) uses it to parse ucontext.
  */
 union savefpu {
-	struct save87		sv_87;
-	struct fxsave		sv_xmm;
+	struct save87 sv_87;
+	struct fxsave sv_xmm;
 #ifdef _KERNEL
-	struct xsave_header	sv_xsave_hdr;
+	struct xsave_header sv_xsave_hdr;
 #endif
 };
 

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.124 src/sys/arch/x86/include/specialreg.h:1.125
--- src/sys/arch/x86/include/specialreg.h:1.124	Tue 

CVS commit: src/share/man/man7

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 07:08:13 UTC 2018

Modified Files:
src/share/man/man7: audio.7

Log Message:
Mark up argument. Fix typo.


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

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



CVS commit: src/share/man/man7

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 07:08:13 UTC 2018

Modified Files:
src/share/man/man7: audio.7

Log Message:
Mark up argument. Fix typo.


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

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

Modified files:

Index: src/share/man/man7/audio.7
diff -u src/share/man/man7/audio.7:1.3 src/share/man/man7/audio.7:1.4
--- src/share/man/man7/audio.7:1.3	Tue May 22 01:35:49 2018
+++ src/share/man/man7/audio.7	Wed May 23 07:08:13 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.7,v 1.3 2018/05/22 01:35:49 nat Exp $
+.\"	$NetBSD: audio.7,v 1.4 2018/05/23 07:08:13 wiz Exp $
 .\"
 .\" Copyright (c) 2016 - 2018  Nathanial Sloss 
 .\" All rights reserved.
@@ -189,12 +189,12 @@ are numbered starting at zero (0).
 Not specifying
 .Fl p
 is the same as specifying
-.Fl p
-0 and will result in working with vchan 0 (the mix ring).
+.Fl p Ar 0
+and will result in working with vchan 0 (the mix ring).
 This will display the audio parameters of the mix ring and allow
 setting the hardware gain and balance.
 .Pp
-This is for compatibility with existing applications and shell scrpits
+This is for compatibility with existing applications and shell scripts
 that are unaware of the
 .Fl p
 switch.



CVS commit: src/share/man/man7

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 07:06:45 UTC 2018

Modified Files:
src/share/man/man7: signal.7

Log Message:
Add missing .El. Replace Ta outside its defined usage with No (no change
to text output).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man7/signal.7

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



CVS commit: src/share/man/man7

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 07:06:45 UTC 2018

Modified Files:
src/share/man/man7: signal.7

Log Message:
Add missing .El. Replace Ta outside its defined usage with No (no change
to text output).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man7/signal.7

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

Modified files:

Index: src/share/man/man7/signal.7
diff -u src/share/man/man7/signal.7:1.21 src/share/man/man7/signal.7:1.22
--- src/share/man/man7/signal.7:1.21	Tue May 22 02:31:57 2018
+++ src/share/man/man7/signal.7	Wed May 23 07:06:45 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: signal.7,v 1.21 2018/05/22 02:31:57 kamil Exp $
+.\"	$NetBSD: signal.7,v 1.22 2018/05/23 07:06:45 wiz Exp $
 .\"
 .\" Copyright (c) 1999, 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -152,10 +152,9 @@ These are numbered 1 to 32.
 no-op with some signal operations.)
 .Pp
 Detailed descriptions of these signals follow.
-.Pp
 .Bl -tag -width "aaa"
 .\" 
-.It Dv SIGHUP (Hangup)
+.It Dv SIGHUP No (Hangup)
 This signal is generated by the tty driver
 .Xr tty 4
 to indicate a hangup condition on a process's controlling terminal:
@@ -169,7 +168,7 @@ The number for
 .Dv SIGHUP
 is 1, which is quite well known.
 .\" 
-.It Dv SIGINT (Interrupt)
+.It Dv SIGINT No (Interrupt)
 This signal is generated by the tty driver
 .Xr tty 4
 when the user presses the interrupt character, normally control-C.
@@ -178,7 +177,7 @@ The number for
 .Dv SIGINT
 is 2.
 .\" 
-.It Dv SIGQUIT Ta (Quit)
+.It Dv SIGQUIT No (Quit)
 This signal is generated by the tty driver
 .Xr tty 4
 when the user presses the quit character, normally control-backspace.
@@ -187,7 +186,7 @@ The number for
 .Dv SIGQUIT
 is 3.
 .\" 
-.It Dv SIGILL Ta (Illegal instruction)
+.It Dv SIGILL No (Illegal instruction)
 This signal is generated synchronously by the kernel when the process
 executes an invalid instruction.
 The default action is to terminate the process and dump core.
@@ -198,7 +197,7 @@ The number for
 .Dv SIGILL
 is 4.
 .\" 
-.It Dv SIGTRAP Ta (Trace/BPT trap)
+.It Dv SIGTRAP No (Trace/BPT trap)
 This signal is used when a process is being traced
 (see
 .Xr ptrace 2 )
@@ -211,7 +210,7 @@ The number for
 .Dv SIGTRAP
 is 5.
 .\" 
-.It Dv SIGABRT Ta (Abort trap)
+.It Dv SIGABRT No (Abort trap)
 This signal is generated when the
 .Xr abort 3
 standard library function is called.
@@ -225,7 +224,7 @@ which is no longer defined,
 as it was specific to the PDP-11 instruction
 .Dv iot .
 .\" 
-.It Dv SIGEMT Ta (EMT trap)
+.It Dv SIGEMT No (EMT trap)
 In theory this signal is generated when an instruction needs to be
 emulated.
 .\"   XXX expand this -- I don't know, grep isn't helping much and
@@ -235,7 +234,7 @@ The number for
 .Dv SIGEMT
 is 7.
 .\" 
-.It Dv SIGFPE Ta (Floating point exception)
+.It Dv SIGFPE No (Floating point exception)
 This signal is generated when an invalid floating point operation is
 detected by hardware or by a soft-float library.
 The default action is to terminate the process and dump core.
@@ -243,7 +242,7 @@ The number for
 .Dv SIGFPE
 is 8.
 .\" 
-.It Dv SIGKILL Ta (Killed)
+.It Dv SIGKILL No (Killed)
 This signal cannot be caught or ignored.
 The (unconditional) action is to terminate the process.
 It is most often sent by system administrators, but is also generated
@@ -257,7 +256,7 @@ The number for
 .Dv SIGKILL
 is 9, which is extremely well known.
 .\" 
-.It Dv SIGBUS Ta (Bus error)
+.It Dv SIGBUS No (Bus error)
 This signal is generated synchronously by the kernel when the process
 performs certain kinds of invalid memory accesses.
 The most common cause of
@@ -273,7 +272,7 @@ The number for
 .Dv SIGBUS
 is 10.
 .\" 
-.It Dv SIGSEGV Ta (Segmentation fault)
+.It Dv SIGSEGV No (Segmentation fault)
 This signal is generated synchronously by the kernel when the process
 attempts to access unmapped memory, or access memory in a manner that
 the protection settings for that memory region do not permit.
@@ -294,7 +293,7 @@ The number for
 .Dv SIGSEGV
 is 11, which is very well known.
 .\" 
-.It Dv SIGSYS Ta (Bad system call)
+.It Dv SIGSYS No (Bad system call)
 This signal is generated by the kernel, in addition to failing with
 .Er ENOSYS ,
 when a system call is made using an invalid system call number.
@@ -304,7 +303,7 @@ The number for
 .Dv SIGSYS
 is 12.
 .\" 
-.It Dv SIGPIPE Ta (Broken pipe)
+.It Dv SIGPIPE No (Broken pipe)
 This signal is generated by the kernel, in addition to failing with
 .Er EPIPE ,
 when a
@@ -316,7 +315,7 @@ The number for
 .Dv SIGPIPE
 is 13.
 .\" 
-.It Dv SIGALRM Ta (Alarm clock)
+.It Dv SIGALRM No (Alarm clock)
 This signal is generated by the kernel when a real-time timer expires.
 See
 .Xr alarm 3 ,
@@ 

Re: CVS commit: src/usr.bin/mail

2018-05-23 Thread maya
You don't get to sneak a controversial change by omitting a real commit
message.

On Tue, May 22, 2018 at 09:03:47PM -0400, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Wed May 23 01:03:46 UTC 2018
> 
> Modified Files:
>   src/usr.bin/mail: Makefile mail.1
> 
> Log Message:
> Remove Mail
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.36 -r1.37 src/usr.bin/mail/Makefile
> cvs rdiff -u -r1.63 -r1.64 src/usr.bin/mail/mail.1
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

> Modified files:
> 
> Index: src/usr.bin/mail/Makefile
> diff -u src/usr.bin/mail/Makefile:1.36 src/usr.bin/mail/Makefile:1.37
> --- src/usr.bin/mail/Makefile:1.36Sat Jul  5 15:22:04 2014
> +++ src/usr.bin/mail/Makefile Tue May 22 21:03:46 2018
> @@ -1,4 +1,4 @@
> -#$NetBSD: Makefile,v 1.36 2014/07/05 19:22:04 dholland Exp $
> +#$NetBSD: Makefile,v 1.37 2018/05/23 01:03:46 christos Exp $
>  #@(#)Makefile8.3 (Berkeley) 4/20/95
>  
>  .include 
> @@ -26,8 +26,8 @@ SRCS=   version.c support.c cmd1.c cmd2.c 
>   dotlock.c edit.c fio.c format.c getname.c head.c v7.local.c lex.c \
>   list.c main.c names.c popen.c quit.c send.c sig.c strings.c temp.c \
>   tty.c vars.c
> -LINKS=   ${BINDIR}/mail ${BINDIR}/Mail ${BINDIR}/mail ${BINDIR}/mailx
> -MLINKS=  mail.1 Mail.1 mail.1 mailx.1
> +LINKS=   ${BINDIR}/mail ${BINDIR}/mailx
> +MLINKS=  mail.1 mailx.1
>  
>  LDADD+=  -lutil
>  DPADD+=  ${LIBUTIL}
> 
> Index: src/usr.bin/mail/mail.1
> diff -u src/usr.bin/mail/mail.1:1.63 src/usr.bin/mail/mail.1:1.64
> --- src/usr.bin/mail/mail.1:1.63  Mon Jul  3 17:34:20 2017
> +++ src/usr.bin/mail/mail.1   Tue May 22 21:03:46 2018
> @@ -1,4 +1,4 @@
> -.\"  $NetBSD: mail.1,v 1.63 2017/07/03 21:34:20 wiz Exp $
> +.\"  $NetBSD: mail.1,v 1.64 2018/05/23 01:03:46 christos Exp $
>  .\"
>  .\" Copyright (c) 1980, 1990, 1993
>  .\"  The Regents of the University of California.  All rights reserved.
> @@ -29,13 +29,12 @@
>  .\"
>  .\"  @(#)mail.1  8.8 (Berkeley) 4/28/95
>  .\"
> -.Dd December 15, 2014
> +.Dd May 22, 2018
>  .Dt MAIL 1
>  .Os
>  .Sh NAME
>  .Nm mail ,
> -.Nm mailx ,
> -.Nm Mail
> +.Nm mailx
>  .Nd send and receive mail
>  .Sh SYNOPSIS
>  .Nm
> @@ -2299,11 +2298,14 @@ originally written by Kurt Shoens.
>  There are some flags and commands that are not documented here.
>  Most are not useful to the general user.
>  .Pp
> -Usually,
> +Historically,
>  .Nm
> -is just a link to
> +was just a link to
>  .Nm Mail ,
> -which can be confusing.
> +which was confusing.
> +.Nm Mail
> +has been removed in
> +.Nx 9 .
>  .Pp
>  The name of the
>  .Ic alternates
> 



CVS commit: src/lib/libc/md

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 06:08:01 UTC 2018

Modified Files:
src/lib/libc/md: mdX.3

Log Message:
Use .An in authors section. Remove empty section.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/md/mdX.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/libc/md/mdX.3
diff -u src/lib/libc/md/mdX.3:1.11 src/lib/libc/md/mdX.3:1.12
--- src/lib/libc/md/mdX.3:1.11	Wed May 23 02:08:40 2018
+++ src/lib/libc/md/mdX.3	Wed May 23 06:08:01 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mdX.3,v 1.11 2018/05/23 02:08:40 christos Exp $
+.\"	$NetBSD: mdX.3,v 1.12 2018/05/23 06:08:01 wiz Exp $
 .\"
 .\" 
 .\" "THE BEER-WARE LICENSE" (Revision 42):
@@ -108,7 +108,7 @@ argument is non-null it must point to at
 .Xr md5 3 ,
 .Xr openssl_MD2 3 ,
 .Xr openssl_MD4 3 ,
-.Xr openssl_MD5 3 ,
+.Xr openssl_MD5 3
 .Rs
 .%A B. Kaliski
 .%T The MD2 Message-Digest Algorithm
@@ -132,15 +132,15 @@ argument is non-null it must point to at
 These functions appeared in
 .Nx 1.3 .
 .Sh AUTHORS
+.An -nosplit
 The original MDX routines were developed by
-.Tn RSA
-Data Security, Inc., and published in the above references.
-This code is derived directly from these implementations by Poul-Henning Kamp
-.Aq Li p...@login.dkuug.dk
+.An RSA Data Security, Inc. ,
+and published in the above references.
+This code is derived directly from these implementations by
+.An Poul-Henning Kamp Aq Mt p...@login.dkuug.dk .
 .Pp
 Phk ristede runen.
 .Sh BUGS
 No method is known to exist which finds two files having the same hash value,
 nor to find a file with a specific hash value.
 There is on the other hand no guarantee that such a method doesn't exist.
-.Sh COPYRIGHT



CVS commit: src/lib/libc/md

2018-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 23 06:08:01 UTC 2018

Modified Files:
src/lib/libc/md: mdX.3

Log Message:
Use .An in authors section. Remove empty section.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/md/mdX.3

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