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

2015-11-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 15 14:39:12 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_drm_mode.c

Log Message:
If we are going to be doing read/modify/write in triple-buffered mode, make 
sure we don't read back the buffered values and not the active ones


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_drm_mode.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_drm_mode.c
diff -u src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.7 src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.8
--- src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.7	Sat Nov 14 23:16:41 2015
+++ src/sys/arch/arm/nvidia/tegra_drm_mode.c	Sun Nov 15 14:39:12 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm_mode.c,v 1.7 2015/11/14 23:16:41 jmcneill Exp $ */
+/* $NetBSD: tegra_drm_mode.c,v 1.8 2015/11/15 14:39:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.7 2015/11/14 23:16:41 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.8 2015/11/15 14:39:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -680,8 +680,8 @@ tegra_crtc_prepare(struct drm_crtc *crtc
 	struct tegra_crtc *tegra_crtc = to_tegra_crtc(crtc);
 
 	/* Access control */
-	DC_WRITE(tegra_crtc, DC_CMD_STATE_ACCESS_REG,
-	DC_CMD_STATE_ACCESS_READ_MUX);
+	DC_WRITE(tegra_crtc, DC_CMD_STATE_ACCESS_REG, 0);
+
 	/* Enable window A programming */
 	DC_WRITE(tegra_crtc, DC_CMD_DISPLAY_WINDOW_HEADER_REG,
 	DC_CMD_DISPLAY_WINDOW_HEADER_WINDOW_A_SELECT);



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

2015-11-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 15 14:39:12 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_drm_mode.c

Log Message:
If we are going to be doing read/modify/write in triple-buffered mode, make 
sure we don't read back the buffered values and not the active ones


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_drm_mode.c

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




CVS commit: src

2015-11-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov 15 13:50:10 UTC 2015

Modified Files:
src/share/mk: bsd.own.mk
src/sys/rump: Makefile.rump

Log Message:
describe => rumpdescribe


To generate a diff of this commit:
cvs rdiff -u -r1.879 -r1.880 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.119 -r1.120 src/sys/rump/Makefile.rump

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.own.mk
diff -u src/share/mk/bsd.own.mk:1.879 src/share/mk/bsd.own.mk:1.880
--- src/share/mk/bsd.own.mk:1.879	Fri Nov  6 01:17:08 2015
+++ src/share/mk/bsd.own.mk	Sun Nov 15 13:50:10 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.879 2015/11/06 01:17:08 jmcneill Exp $
+#	$NetBSD: bsd.own.mk,v 1.880 2015/11/15 13:50:10 pooka Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -842,11 +842,13 @@ ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang
 GENASSYM_CPPFLAGS+=	${${ACTIVE_CC} == "clang":? -no-integrated-as :}
 
 TARGETS+=	all clean cleandir depend dependall includes \
-		install lint obj regress tags html analyze describe
+		install lint obj regress tags html analyze describe \
+		rumpdescribe
 PHONY_NOTMAIN =	all clean cleandir depend dependall distclean includes \
 		install lint obj regress beforedepend afterdepend \
 		beforeinstall afterinstall realinstall realdepend realall \
-		html subdir-all subdir-install subdir-depend analyze describe
+		html subdir-all subdir-install subdir-depend analyze describe \
+		rumpdescribe
 .PHONY:		${PHONY_NOTMAIN}
 .NOTMAIN:	${PHONY_NOTMAIN}
 

Index: src/sys/rump/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.119 src/sys/rump/Makefile.rump:1.120
--- src/sys/rump/Makefile.rump:1.119	Mon Oct 19 16:16:32 2015
+++ src/sys/rump/Makefile.rump	Sun Nov 15 13:50:10 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.119 2015/10/19 16:16:32 pooka Exp $
+#	$NetBSD: Makefile.rump,v 1.120 2015/11/15 13:50:10 pooka Exp $
 #
 
 .if !defined(_RUMP_MK)
@@ -243,7 +243,7 @@ __archivebuild: .USE
 .endif
 
 COMMENT?=	(no description)
-describe: .PHONY
+rumpdescribe: .PHONY
 	@printf '%-24s %s\n' '${LIB}' '${COMMENT}'
 
 _BSD_IOCONF_MK_USER_=1



CVS commit: src

2015-11-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov 15 13:50:10 UTC 2015

Modified Files:
src/share/mk: bsd.own.mk
src/sys/rump: Makefile.rump

Log Message:
describe => rumpdescribe


To generate a diff of this commit:
cvs rdiff -u -r1.879 -r1.880 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.119 -r1.120 src/sys/rump/Makefile.rump

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-11-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 15 13:59:52 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ohci.c

Log Message:
Remove unused fields from ohci_pipe


To generate a diff of this commit:
cvs rdiff -u -r1.254.2.27 -r1.254.2.28 src/sys/dev/usb/ohci.c

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



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-11-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 15 13:59:52 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ohci.c

Log Message:
Remove unused fields from ohci_pipe


To generate a diff of this commit:
cvs rdiff -u -r1.254.2.27 -r1.254.2.28 src/sys/dev/usb/ohci.c

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

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.254.2.27 src/sys/dev/usb/ohci.c:1.254.2.28
--- src/sys/dev/usb/ohci.c:1.254.2.27	Sat Nov 14 10:05:47 2015
+++ src/sys/dev/usb/ohci.c	Sun Nov 15 13:59:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.254.2.27 2015/11/14 10:05:47 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.254.2.28 2015/11/15 13:59:52 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.27 2015/11/14 10:05:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.28 2015/11/15 13:59:52 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -256,19 +256,12 @@ struct ohci_pipe {
 		/* Control pipe */
 		struct {
 			usb_dma_t reqdma;
-			u_int length;
-			ohci_soft_td_t *setup, *data, *stat;
 		} ctrl;
 		/* Interrupt pipe */
 		struct {
 			int nslots;
 			int pos;
 		} intr;
-		/* Bulk pipe */
-		struct {
-			u_int length;
-			int isread;
-		} bulk;
 		/* Isochronous pipe */
 		struct isoc {
 			int next, inuse;
@@ -2611,7 +2604,6 @@ ohci_device_ctrl_start(struct usbd_xfer 
 	tail->xfer = NULL;
 
 	sed = opipe->sed;
-	opipe->ctrl.length = len;
 
 	KASSERTMSG(OHCI_ED_GET_FA(O32TOH(sed->ed.ed_flags)) == dev->ud_addr,
 	"address ED %d pipe %d\n",
@@ -2820,9 +2812,6 @@ ohci_device_bulk_start(struct usbd_xfer 
 	xfer->ux_flags);
 	DPRINTFN(4, "endpt=%d", endpt, 0, 0, 0);
 
-	opipe->bulk.isread = isread;
-	opipe->bulk.length = len;
-
 	usb_syncmem(>dma, sed->offs, sizeof(sed->ed),
 	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	/* Update device address */



CVS commit: [netbsd-6] src/doc

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:16 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.226 -r1.1.2.227 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.226 src/doc/CHANGES-6.2:1.1.2.227
--- src/doc/CHANGES-6.2:1.1.2.226	Sat Nov  7 22:28:55 2015
+++ src/doc/CHANGES-6.2	Sun Nov 15 16:19:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.226 2015/11/07 22:28:55 snj Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.227 2015/11/15 16:19:16 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -12544,3 +12544,8 @@ external/bsd/ntp/scripts/mkver  
 	Update ntp to 4.2.8p4.
 	[christos, ticket #1342]
 
+external/bsd/ntp/scripts/mkver			1.8
+
+	PR/50426: Dave Tyson: Fix ntp reported version.
+	[christos, ticket #1346]
+



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:20 UTC 2015

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-6.0.7

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

Modified files:

Index: src/doc/CHANGES-6.0.7
diff -u src/doc/CHANGES-6.0.7:1.1.2.48 src/doc/CHANGES-6.0.7:1.1.2.49
--- src/doc/CHANGES-6.0.7:1.1.2.48	Sun Nov  8 00:17:11 2015
+++ src/doc/CHANGES-6.0.7	Sun Nov 15 16:19:20 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.48 2015/11/08 00:17:11 snj Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.49 2015/11/15 16:19:20 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -7010,3 +7010,8 @@ external/bsd/ntp/scripts/mkver  
 	Update ntp to 4.2.8p4.
 	[christos, ticket #1342]
 
+external/bsd/ntp/scripts/mkver			1.8
+
+	PR/50426: Dave Tyson: Fix ntp reported version.
+	[christos, ticket #1346]
+



CVS commit: [netbsd-6] src/doc

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:16 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.226 -r1.1.2.227 src/doc/CHANGES-6.2

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:38 UTC 2015

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-6.1.6

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



CVS commit: [netbsd-6] src/sbin/raidctl

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:30:38 UTC 2015

Modified Files:
src/sbin/raidctl [netbsd-6]: raidctl.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1304):
sbin/raidctl/raidctl.c: revision 1.58
Better sanity check numbers given to raidctl(8)
Replace atoi(3) by strtol(3), and check that numbers are valid,
positive, and in int32_t range. The previous lack of check could
silently lead to the same serial being set to all RAID volumes
for instance because given numbers were bigger than INT_MAX. The
consequence is in an awful mess when RAIDframe would mix volumes...


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.4.1 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.55 src/sbin/raidctl/raidctl.c:1.55.4.1
--- src/sbin/raidctl/raidctl.c:1.55	Wed Oct 12 16:45:37 2011
+++ src/sbin/raidctl/raidctl.c	Sun Nov 15 16:30:38 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $   */
+/*  $NetBSD: raidctl.c,v 1.55.4.1 2015/11/15 16:30:38 bouyer Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.55.4.1 2015/11/15 16:30:38 bouyer Exp $");
 #endif
 
 
@@ -85,6 +85,7 @@ static  void get_bar(char *, double, int
 static  void get_time_string(char *, int);
 static  void rf_output_pmstat(int, int);
 static  void rf_pm_configure(int, int, char *, int[]);
+static  unsigned int _strtoud(char *);
 
 int verbose;
 
@@ -183,7 +184,7 @@ main(int argc,char *argv[])
 			break;
 		case 'I':
 			action = RAIDFRAME_INIT_LABELS;
-			serial_number = atoi(optarg);
+			serial_number = _strtoud(optarg);
 			num_options++;
 			break;
 		case 'm':
@@ -195,11 +196,11 @@ main(int argc,char *argv[])
 			action = RAIDFRAME_PARITYMAP_SET_DISABLE;
 			parityconf = strdup(optarg);
 			num_options++;
-			/* XXXjld: should rf_pm_configure do the atoi()s? */
+			/* XXXjld: should rf_pm_configure do the strtol()s? */
 			i = 0;
 			while (i < 3 && optind < argc &&
 			isdigit((int)argv[optind][0]))
-parityparams[i++] = atoi(argv[optind++]);
+parityparams[i++] = _strtoud(argv[optind++]);
 			while (i < 3)
 parityparams[i++] = 0;
 			break;
@@ -1155,3 +1156,26 @@ usage(void)
 	exit(1);
 	/* NOTREACHED */
 }
+
+static unsigned int
+_strtoud(char *str)
+{
+	long num;
+	char *ep;
+
+	errno = 0;
+	num = strtol(str, , 10);
+	if (str[0] == '\0' || *ep != '\0')
+		errx(1, "Not a number: %s", str);
+
+	if (errno)
+		err(1, "Inavlid number %s", str);
+
+	if (num < 0)
+		errx(1, "Negative number: %s", str);
+
+	if (num > INT_MAX)
+		errx(1, "Number too large: %s", str);
+
+	return (unsigned int)num;
+}



CVS commit: [netbsd-6] src/sbin/raidctl

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:30:38 UTC 2015

Modified Files:
src/sbin/raidctl [netbsd-6]: raidctl.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1304):
sbin/raidctl/raidctl.c: revision 1.58
Better sanity check numbers given to raidctl(8)
Replace atoi(3) by strtol(3), and check that numbers are valid,
positive, and in int32_t range. The previous lack of check could
silently lead to the same serial being set to all RAID volumes
for instance because given numbers were bigger than INT_MAX. The
consequence is in an awful mess when RAIDframe would mix volumes...


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.4.1 src/sbin/raidctl/raidctl.c

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



CVS commit: [netbsd-6] src/usr.bin/tset

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:33:26 UTC 2015

Modified Files:
src/usr.bin/tset [netbsd-6]: set.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1308):
usr.bin/tset/set.c: revision 1.18
Restore logic for setting the VERASE character.
- use terminfo _unless_ the terminal does overstrike.
- use terminfo data not only for an unset tty.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/usr.bin/tset/set.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/tset/set.c
diff -u src/usr.bin/tset/set.c:1.16 src/usr.bin/tset/set.c:1.16.4.1
--- src/usr.bin/tset/set.c:1.16	Mon Oct  3 12:36:32 2011
+++ src/usr.bin/tset/set.c	Sun Nov 15 16:33:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: set.c,v 1.16 2011/10/03 12:36:32 roy Exp $	*/
+/*	$NetBSD: set.c,v 1.16.4.1 2015/11/15 16:33:26 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: set.c,v 1.16 2011/10/03 12:36:32 roy Exp $");
+__RCSID("$NetBSD: set.c,v 1.16.4.1 2015/11/15 16:33:26 bouyer Exp $");
 
 #include 
 #include 
@@ -151,18 +151,20 @@ reset_mode(void)
 void
 set_control_chars(int erasechar, int intrchar, int killchar)
 {
+	int bs_char;
+
+	if (key_backspace != NULL && key_backspace[1] == '\0')
+		bs_char = key_backspace[0];
+	else
+		bs_char = 0;
 	
-	if (mode.c_cc[VERASE] == 0 || erasechar != 0) {
-		if (erasechar == 0) {
-			if (over_strike &&
-			key_backspace != NULL &&
-			key_backspace[1] == '\0')
-mode.c_cc[VERASE] = key_backspace[1];
-			else
-mode.c_cc[VERASE] = CERASE;
-		} else
-			mode.c_cc[VERASE] = erasechar;
-	}
+	if (erasechar == 0 && bs_char != 0 && !over_strike)
+		erasechar = -1;
+	if (erasechar < 0)
+		erasechar = (bs_char != 0) ? bs_char : CTRL('h');
+
+	if (mode.c_cc[VERASE] == 0 || erasechar != 0)
+		 mode.c_cc[VERASE] = erasechar ? erasechar : CERASE;
 
 	if (mode.c_cc[VINTR] == 0 || intrchar != 0)
 		 mode.c_cc[VINTR] = intrchar ? intrchar : CINTR;



CVS commit: [netbsd-6] src/usr.bin/tset

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:33:26 UTC 2015

Modified Files:
src/usr.bin/tset [netbsd-6]: set.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1308):
usr.bin/tset/set.c: revision 1.18
Restore logic for setting the VERASE character.
- use terminfo _unless_ the terminal does overstrike.
- use terminfo data not only for an unset tty.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/usr.bin/tset/set.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/xen/xen

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 14:42:04 UTC 2015

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Fix typo which caused the kenrel thread to be created with a 0 priority.
This would cause the thread to be almost never scheduled when a userland
process could use all CPU.
Should fix the problem reported by Torbj�rn Granlund on port-xen@


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 14:42:04 UTC 2015

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Fix typo which caused the kenrel thread to be created with a 0 priority.
This would cause the thread to be almost never scheduled when a userland
process could use all CPU.
Should fix the problem reported by Torbj�rn Granlund on port-xen@


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.60 src/sys/arch/xen/xen/xbdback_xenbus.c:1.61
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.60	Sun Sep 21 12:46:15 2014
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Sun Nov 15 14:42:03 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.60 2014/09/21 12:46:15 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.61 2015/11/15 14:42:03 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.60 2014/09/21 12:46:15 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.61 2015/11/15 14:42:03 bouyer Exp $");
 
 #include 
 #include 
@@ -647,7 +647,7 @@ xbdback_connect(struct xbdback_instance 
 	hypervisor_enable_event(xbdi->xbdi_evtchn);
 	hypervisor_notify_via_evtchn(xbdi->xbdi_evtchn);
 
-	if (kthread_create(IPL_NONE, KTHREAD_MPSAFE, NULL,
+	if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
 	xbdback_thread, xbdi, NULL, "%s", xbdi->xbdi_name) == 0)
 		return 0;
 



CVS commit: [netbsd-6-1] src/external/bsd/ntp/scripts

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:17:03 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts [netbsd-6-1]: mkver

Log Message:
Pull up following revision(s) (requested by christos in ticket #1346):
external/bsd/ntp/scripts/mkver: revision 1.8
PR/50426: Dave Tyson: Fix ntp reported version.


To generate a diff of this commit:
cvs rdiff -u -r1.2.16.2 -r1.2.16.3 src/external/bsd/ntp/scripts/mkver

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/ntp/scripts/mkver
diff -u src/external/bsd/ntp/scripts/mkver:1.2.16.2 src/external/bsd/ntp/scripts/mkver:1.2.16.3
--- src/external/bsd/ntp/scripts/mkver:1.2.16.2	Sat Nov  7 22:46:29 2015
+++ src/external/bsd/ntp/scripts/mkver	Sun Nov 15 16:17:03 2015
@@ -3,7 +3,7 @@ PROG=${1-UNKNOWN}
 
 ConfStr="$PROG"
 
-ConfStr="$ConfStr 4.2.8p3"
+ConfStr="$ConfStr 4.2.8p4"
 
 case "$CSET" in
  '') ;;



CVS commit: [netbsd-6-0] src/external/bsd/ntp/scripts

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:17:00 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts [netbsd-6-0]: mkver

Log Message:
Pull up following revision(s) (requested by christos in ticket #1346):
external/bsd/ntp/scripts/mkver: revision 1.8
PR/50426: Dave Tyson: Fix ntp reported version.


To generate a diff of this commit:
cvs rdiff -u -r1.2.8.2 -r1.2.8.3 src/external/bsd/ntp/scripts/mkver

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/ntp/scripts/mkver
diff -u src/external/bsd/ntp/scripts/mkver:1.2.8.2 src/external/bsd/ntp/scripts/mkver:1.2.8.3
--- src/external/bsd/ntp/scripts/mkver:1.2.8.2	Sun Nov  8 00:16:11 2015
+++ src/external/bsd/ntp/scripts/mkver	Sun Nov 15 16:17:00 2015
@@ -3,7 +3,7 @@ PROG=${1-UNKNOWN}
 
 ConfStr="$PROG"
 
-ConfStr="$ConfStr 4.2.8p3"
+ConfStr="$ConfStr 4.2.8p4"
 
 case "$CSET" in
  '') ;;



CVS commit: [netbsd-6] src/external/bsd/ntp/scripts

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:16:53 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts [netbsd-6]: mkver

Log Message:
Pull up following revision(s) (requested by christos in ticket #1346):
external/bsd/ntp/scripts/mkver: revision 1.8
PR/50426: Dave Tyson: Fix ntp reported version.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/external/bsd/ntp/scripts/mkver

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/ntp/scripts/mkver
diff -u src/external/bsd/ntp/scripts/mkver:1.2.2.2 src/external/bsd/ntp/scripts/mkver:1.2.2.3
--- src/external/bsd/ntp/scripts/mkver:1.2.2.2	Sat Nov  7 22:26:48 2015
+++ src/external/bsd/ntp/scripts/mkver	Sun Nov 15 16:16:53 2015
@@ -3,7 +3,7 @@ PROG=${1-UNKNOWN}
 
 ConfStr="$PROG"
 
-ConfStr="$ConfStr 4.2.8p3"
+ConfStr="$ConfStr 4.2.8p4"
 
 case "$CSET" in
  '') ;;



CVS commit: [netbsd-6-0] src/external/bsd/ntp/scripts

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:17:00 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts [netbsd-6-0]: mkver

Log Message:
Pull up following revision(s) (requested by christos in ticket #1346):
external/bsd/ntp/scripts/mkver: revision 1.8
PR/50426: Dave Tyson: Fix ntp reported version.


To generate a diff of this commit:
cvs rdiff -u -r1.2.8.2 -r1.2.8.3 src/external/bsd/ntp/scripts/mkver

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



CVS commit: [netbsd-6] src/external/bsd/ntp/scripts

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:16:53 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts [netbsd-6]: mkver

Log Message:
Pull up following revision(s) (requested by christos in ticket #1346):
external/bsd/ntp/scripts/mkver: revision 1.8
PR/50426: Dave Tyson: Fix ntp reported version.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/external/bsd/ntp/scripts/mkver

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:20 UTC 2015

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-6.0.7

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:19:38 UTC 2015

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
ticket 1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-6.1.6

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

Modified files:

Index: src/doc/CHANGES-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.47 src/doc/CHANGES-6.1.6:1.1.2.48
--- src/doc/CHANGES-6.1.6:1.1.2.47	Sat Nov  7 22:50:18 2015
+++ src/doc/CHANGES-6.1.6	Sun Nov 15 16:19:38 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.47 2015/11/07 22:50:18 snj Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.48 2015/11/15 16:19:38 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -6731,3 +6731,8 @@ external/bsd/ntp/scripts/mkver  
 	Update ntp to 4.2.8p4.
 	[christos, ticket #1342]
 
+external/bsd/ntp/scripts/mkver			1.8
+
+	PR/50426: Dave Tyson: Fix ntp reported version.
+	[christos, ticket #1346]
+



CVS commit: [netbsd-6] src/sys/arch/powerpc

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:36:57 UTC 2015

Modified Files:
src/sys/arch/powerpc/include [netbsd-6]: psl.h userret.h
src/sys/arch/powerpc/oea [netbsd-6]: altivec.c oea_machdep.c
src/sys/arch/powerpc/powerpc [netbsd-6]: fpu.c

Log Message:
Pull up following revision(s) (requested by matt in ticket #1310):
sys/arch/powerpc/include/userret.h: revision 1.30
sys/arch/powerpc/powerpc/fpu.c: revision 1.36
sys/arch/powerpc/include/psl.h: revision 1.20
sys/arch/powerpc/include/userret.h: revision 1.29
sys/arch/powerpc/oea/oea_machdep.c: revision 1.72
sys/arch/powerpc/oea/altivec.c: revision 1.30
Add a check to make sure that if PSL_FP is set, we own the FPU.
Don't clear PSL_FP/PSL_VEC
Don't reload if just re-enabling
Don't reload the FPU register if this is just a re-enable.
Remove PSL_SPV from BOOKE PSL_USERMOD
Don't preserve PSL_FP/PSL_VEC in cpu_setmcontext.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.8.1 src/sys/arch/powerpc/include/psl.h
cvs rdiff -u -r1.22.8.1 -r1.22.8.2 src/sys/arch/powerpc/include/userret.h
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/powerpc/oea/altivec.c
cvs rdiff -u -r1.63 -r1.63.2.1 src/sys/arch/powerpc/oea/oea_machdep.c
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/arch/powerpc/powerpc/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/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.18 src/sys/arch/powerpc/include/psl.h:1.18.8.1
--- src/sys/arch/powerpc/include/psl.h:1.18	Mon Jun 20 07:23:36 2011
+++ src/sys/arch/powerpc/include/psl.h	Sun Nov 15 16:36:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2011/06/20 07:23:36 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.18.8.1 2015/11/15 16:36:57 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -111,7 +111,7 @@ extern register_t cpu_psluserset, cpu_ps
 #elif defined(PPC_BOOKE)
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IS | PSL_DS | PSL_ME | PSL_CE | PSL_DE)
 #define	PSL_USERMASK		(PSL_SPV | PSL_CE | 0x)
-#define	PSL_USERMOD		(PSL_SPV)
+#define	PSL_USERMOD		(0)
 #else /* PPC_IBM4XX */
 #ifdef PPC_IBM403
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IR | PSL_DR | PSL_ME)

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.22.8.1 src/sys/arch/powerpc/include/userret.h:1.22.8.2
--- src/sys/arch/powerpc/include/userret.h:1.22.8.1	Wed Jun 13 19:44:11 2012
+++ src/sys/arch/powerpc/include/userret.h	Sun Nov 15 16:36:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.22.8.1 2012/06/13 19:44:11 riz Exp $	*/
+/*	$NetBSD: userret.h,v 1.22.8.2 2015/11/15 16:36:57 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -58,7 +58,8 @@ userret(struct lwp *l, struct trapframe 
 	/* Invoke MI userret code */
 	mi_userret(l);
 
-	tf->tf_srr1 &= PSL_USERSRR1;	/* clear SRR1 status bits */
+	/* clear SRR1 status bits */
+	tf->tf_srr1 &= (PSL_USERSRR1|PSL_FP|PSL_VEC);
 
 #ifdef ALTIVEC
 	/*

Index: src/sys/arch/powerpc/oea/altivec.c
diff -u src/sys/arch/powerpc/oea/altivec.c:1.25 src/sys/arch/powerpc/oea/altivec.c:1.25.8.1
--- src/sys/arch/powerpc/oea/altivec.c:1.25	Tue Jun  7 01:01:43 2011
+++ src/sys/arch/powerpc/oea/altivec.c	Sun Nov 15 16:36:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: altivec.c,v 1.25 2011/06/07 01:01:43 matt Exp $	*/
+/*	$NetBSD: altivec.c,v 1.25.8.1 2015/11/15 16:36:57 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altivec.c,v 1.25 2011/06/07 01:01:43 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altivec.c,v 1.25.8.1 2015/11/15 16:36:57 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -82,18 +82,26 @@ vec_state_load(lwp_t *l, bool used)
 		vec_mark_used(l);
 	}
 
-	/*
-	 * Enable AltiVec temporarily (and disable interrupts).
-	 */
-	const register_t msr = mfmsr();
-	mtmsr((msr & ~PSL_EE) | PSL_VEC);
-	__asm volatile ("isync");
-
-	/*
-	 * Load the vector unit from vreg which is best done in
-	 * assembly.
-	 */
-	vec_load_from_vreg(>pcb_vr);
+	if ((flags & PCU_REENABLE) == 0) {
+		/*
+		 * Enable AltiVec temporarily (and disable interrupts).
+		 */
+		const register_t msr = mfmsr();
+		mtmsr((msr & ~PSL_EE) | PSL_VEC);
+		__asm volatile ("isync");
+
+		/*
+		 * Load the vector unit from vreg which is best done in
+		 * assembly.
+		 */
+		vec_load_from_vreg(>pcb_vr);
+
+		/*
+		 * Restore MSR (turn off AltiVec)
+		 */
+		mtmsr(msr);
+		__asm volatile ("isync");
+	}
 
 	/*
 	 * VRSAVE will be restored when trap frame returns
@@ -101,12 +109,6 @@ vec_state_load(lwp_t *l, bool used)
 	l->l_md.md_utf->tf_vrsave = pcb->pcb_vr.vrsave;
 
 	/*
-	 * Restore MSR (turn off AltiVec)
-	 */
-	mtmsr(msr);
-	__asm volatile ("isync");
-
-	/*
 	 * Mark vector registers as modified.
 	 */
 	l->l_md.md_flags |= MDLWP_USEDVEC|PSL_VEC;

Index: 

CVS commit: src/share/man/man4

2015-11-15 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Nov 15 19:44:31 UTC 2015

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

Log Message:
Antti is Kantee


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

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

Modified files:

Index: src/share/man/man4/iwm.4
diff -u src/share/man/man4/iwm.4:1.2 src/share/man/man4/iwm.4:1.3
--- src/share/man/man4/iwm.4:1.2	Tue Mar  3 09:59:20 2015
+++ src/share/man/man4/iwm.4	Sun Nov 15 19:44:31 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: iwm.4,v 1.2 2015/03/03 09:59:20 nonaka Exp $
+.\" $NetBSD: iwm.4,v 1.3 2015/11/15 19:44:31 plunky Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -67,4 +67,4 @@ For more information on configuring this
 The
 .Nm
 driver was written by
-.An Antti Kantte Aq Mt po...@netbsd.org .
+.An Antti Kantee Aq Mt po...@netbsd.org .



CVS commit: src/share/man/man4

2015-11-15 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Nov 15 19:44:31 UTC 2015

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

Log Message:
Antti is Kantee


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

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



CVS commit: [netbsd-6] src/usr.sbin/postinstall

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:43:54 UTC 2015

Modified Files:
src/usr.sbin/postinstall [netbsd-6]: postinstall

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1312):
usr.sbin/postinstall/postinstall: revision 1.196 via patch
PR install/50020: postinstall does not check for mandoc in /etc/man.conf.
Add a check, but ask the user to fix manually (the file could have local
modifications).


To generate a diff of this commit:
cvs rdiff -u -r1.129.2.11 -r1.129.2.12 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.129.2.11 src/usr.sbin/postinstall/postinstall:1.129.2.12
--- src/usr.sbin/postinstall/postinstall:1.129.2.11	Wed May 21 20:29:02 2014
+++ src/usr.sbin/postinstall/postinstall	Sun Nov 15 16:43:54 2015
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.129.2.11 2014/05/21 20:29:02 bouyer Exp $
+# $NetBSD: postinstall,v 1.129.2.12 2015/11/15 16:43:54 bouyer Exp $
 #
-# Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
+# Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -1691,6 +1691,33 @@ do_catpages()
 }
 
 #
+#	man.conf
+#
+additem manconf "check for a mandoc usage in /etc/man.conf"
+do_manconf()
+{
+	[ -n "$1" ] || err 3 "USAGE: do_manconf  fix|check"
+	op="$1"
+	failed=0
+
+	[ -f "${DEST_DIR}/etc/man.conf" ] || return 0
+	if ${GREP} -w "mandoc" "${DEST_DIR}/etc/man.conf" >/dev/null 2>&1;
+	then
+		failed=0;
+	else
+		failed=1
+		notfixed=""
+		if [ "${op}" = "fix" ]; then
+			notfixed="${NOT_FIXED}"
+		fi
+		msg "The file /etc/man.conf has not been adapted to mandoc usage, you"
+		msg "probably want to copy a new version over. ${notfixed}"
+	fi
+
+	return ${failed}
+}
+
+#
 #	obsolete
 #	(this item is last to allow other items to move obsolete files)
 #



CVS commit: [netbsd-6] src/usr.sbin/postinstall

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 16:43:54 UTC 2015

Modified Files:
src/usr.sbin/postinstall [netbsd-6]: postinstall

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1312):
usr.sbin/postinstall/postinstall: revision 1.196 via patch
PR install/50020: postinstall does not check for mandoc in /etc/man.conf.
Add a check, but ask the user to fix manually (the file could have local
modifications).


To generate a diff of this commit:
cvs rdiff -u -r1.129.2.11 -r1.129.2.12 src/usr.sbin/postinstall/postinstall

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



CVS commit: src/sys/rump

2015-11-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov 15 16:54:16 UTC 2015

Modified Files:
src/sys/rump/dev: Makefile.rumpdevcomp
src/sys/rump/fs: Makefile.rumpfscomp
src/sys/rump/kern: Makefile.rumpkerncomp
src/sys/rump/net: Makefile.rumpnetcomp

Log Message:
Always descend into component directories for rumpdescribe.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/dev/Makefile.rumpdevcomp
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/fs/Makefile.rumpfscomp
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/kern/Makefile.rumpkerncomp
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/net/Makefile.rumpnetcomp

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

Modified files:

Index: src/sys/rump/dev/Makefile.rumpdevcomp
diff -u src/sys/rump/dev/Makefile.rumpdevcomp:1.22 src/sys/rump/dev/Makefile.rumpdevcomp:1.23
--- src/sys/rump/dev/Makefile.rumpdevcomp:1.22	Sun Nov  1 09:03:28 2015
+++ src/sys/rump/dev/Makefile.rumpdevcomp	Sun Nov 15 16:54:16 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpdevcomp,v 1.22 2015/11/01 09:03:28 pooka Exp $
+#	$NetBSD: Makefile.rumpdevcomp,v 1.23 2015/11/15 16:54:16 pooka Exp $
 #
 
 RUMPDEVCOMP=	audio bpf cgd disk dm drvctl fss md netsmb		\
@@ -24,7 +24,8 @@ RUMPDEVLDADD+=-lrumpdev_${var}
 RUMPDEVLIBS+=lib${var}
 .endfor
 
-# Currently no NetBSD host support.
-#.for var in ${RUMPPCIDEVS}
-#RUMPDEVLIBS+=lib${var}
-#.endfor
+.if make(rumpdescribe)
+.for var in ${RUMPPCIDEVS}
+RUMPDEVLIBS+=lib${var}
+.endfor
+.endif

Index: src/sys/rump/fs/Makefile.rumpfscomp
diff -u src/sys/rump/fs/Makefile.rumpfscomp:1.5 src/sys/rump/fs/Makefile.rumpfscomp:1.6
--- src/sys/rump/fs/Makefile.rumpfscomp:1.5	Thu Apr 10 00:09:09 2014
+++ src/sys/rump/fs/Makefile.rumpfscomp	Sun Nov 15 16:54:16 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpfscomp,v 1.5 2014/04/10 00:09:09 pooka Exp $
+#	$NetBSD: Makefile.rumpfscomp,v 1.6 2015/11/15 16:54:16 pooka Exp $
 #
 
 .include 
@@ -7,7 +7,7 @@ RUMPFSCOMP=	cd9660 efs ext2fs fdesc ffs 
 		nfs nilfs ntfs null ptyfs smbfs syspuffs sysvbfs	\
 		tmpfs udf umap union v7fs
 
-.if ${MKZFS} != "no"
+.if ${MKZFS} != "no" || make(rumpdescribe)
 RUMPFSCOMP+=	zfs
 .endif
 

Index: src/sys/rump/kern/Makefile.rumpkerncomp
diff -u src/sys/rump/kern/Makefile.rumpkerncomp:1.11 src/sys/rump/kern/Makefile.rumpkerncomp:1.12
--- src/sys/rump/kern/Makefile.rumpkerncomp:1.11	Wed Jan  7 22:24:03 2015
+++ src/sys/rump/kern/Makefile.rumpkerncomp	Sun Nov 15 16:54:16 2015
@@ -1,15 +1,20 @@
-#	$NetBSD: Makefile.rumpkerncomp,v 1.11 2015/01/07 22:24:03 pooka Exp $
+#	$NetBSD: Makefile.rumpkerncomp,v 1.12 2015/11/15 16:54:16 pooka Exp $
 #
 
 .include 
 
 RUMPKERNCOMPS=	crypto sysproxy tty z
+RUMPSYSEMUS=	sys_cygwin sys_linux sys_sunos
 
-.if ${MKSLJIT} != "no"
+.if make(rumpdescribe)
+RUMPKERNCOMPS+=	${RUMPSYSEMUS}
+.endif
+
+.if ${MKSLJIT} != "no" || make(rumpdescribe)
 RUMPKERNCOMPS+=	sljit
 .endif
 
-.if ${MKZFS} != "no"
+.if ${MKZFS} != "no" || make(rumpdescribe)
 RUMPKERNCOMPS+=solaris
 .endif
 

Index: src/sys/rump/net/Makefile.rumpnetcomp
diff -u src/sys/rump/net/Makefile.rumpnetcomp:1.12 src/sys/rump/net/Makefile.rumpnetcomp:1.13
--- src/sys/rump/net/Makefile.rumpnetcomp:1.12	Wed Nov  4 23:57:06 2015
+++ src/sys/rump/net/Makefile.rumpnetcomp	Sun Nov 15 16:54:16 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpnetcomp,v 1.12 2015/11/04 23:57:06 knakahara Exp $
+#	$NetBSD: Makefile.rumpnetcomp,v 1.13 2015/11/15 16:54:16 pooka Exp $
 #
 
 .include 
@@ -6,11 +6,11 @@
 RUMPNETCOMP=	agr bridge net net80211 netbt netinet netinet6
 RUMPNETCOMP+=	gif netmpls npf local shmif tap
 
-.if ${MKSLJIT} != "no"
+.if ${MKSLJIT} != "no" || make(rumpdescribe)
 RUMPNETCOMP+=	bpfjit
 .endif
 
-.if ${RUMP_VIRTIF:Uyes} == "yes"
+.if ${RUMP_VIRTIF:Uyes} == "yes" || make(rumpdescribe)
 RUMPNETCOMP+=	virtif
 .endif
 



CVS commit: src/sys/rump

2015-11-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov 15 16:54:16 UTC 2015

Modified Files:
src/sys/rump/dev: Makefile.rumpdevcomp
src/sys/rump/fs: Makefile.rumpfscomp
src/sys/rump/kern: Makefile.rumpkerncomp
src/sys/rump/net: Makefile.rumpnetcomp

Log Message:
Always descend into component directories for rumpdescribe.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/dev/Makefile.rumpdevcomp
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/fs/Makefile.rumpfscomp
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/kern/Makefile.rumpkerncomp
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/net/Makefile.rumpnetcomp

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:36:32 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: sys_pset.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #1320):
sys/kern/sys_pset.c: revision 1.19
Don't forget to unlock the LWP.
ok rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.8.1 src/sys/kern/sys_pset.c

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

Modified files:

Index: src/sys/kern/sys_pset.c
diff -u src/sys/kern/sys_pset.c:1.17 src/sys/kern/sys_pset.c:1.17.8.1
--- src/sys/kern/sys_pset.c:1.17	Sun Aug  7 21:13:05 2011
+++ src/sys/kern/sys_pset.c	Sun Nov 15 17:36:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_pset.c,v 1.17 2011/08/07 21:13:05 rmind Exp $	*/
+/*	$NetBSD: sys_pset.c,v 1.17.8.1 2015/11/15 17:36:32 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2008, Mindaugas Rasiukevicius 
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_pset.c,v 1.17 2011/08/07 21:13:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pset.c,v 1.17.8.1 2015/11/15 17:36:32 bouyer Exp $");
 
 #include 
 
@@ -380,6 +380,7 @@ sys_pset_assign(struct lwp *l, const str
 mutex_exit(_lock);
 return EPERM;
 			}
+			lwp_unlock(t);
 		}
 		/*
 		 * Set the processor-set ID.



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:36:32 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: sys_pset.c

Log Message:
Pull up following revision(s) (requested by oster in ticket #1320):
sys/kern/sys_pset.c: revision 1.19
Don't forget to unlock the LWP.
ok rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.8.1 src/sys/kern/sys_pset.c

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



CVS commit: [netbsd-6-1] src/sys/dev/mii

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:45:59 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-6-1]: atphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1325):
sys/dev/mii/atphy.c: revision 1.17
  Fix incorrect argument of mii_anar(). Fixes PR#50206.
XXX pullup -[567]


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.14.1 src/sys/dev/mii/atphy.c

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

Modified files:

Index: src/sys/dev/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.11 src/sys/dev/mii/atphy.c:1.11.14.1
--- src/sys/dev/mii/atphy.c:1.11	Sun Oct  2 21:42:19 2011
+++ src/sys/dev/mii/atphy.c	Sun Nov 15 17:45:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.11 2011/10/02 21:42:19 jmcneill Exp $ */
+/*	$NetBSD: atphy.c,v 1.11.14.1 2015/11/15 17:45:59 bouyer Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.11 2011/10/02 21:42:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.11.14.1 2015/11/15 17:45:59 bouyer Exp $");
 
 #include 
 #include 
@@ -226,7 +226,7 @@ atphy_service(struct mii_softc *sc, stru
 			return EINVAL;
 		}
 
-		anar = mii_anar(ife->ifm_media);
+		anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
 		if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
 			bmcr |= BMCR_FDX;
 			/* Enable pause. */



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:46:34 UTC 2015

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
ticket 1325


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-6.1.6

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:46:41 UTC 2015

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
ticket 1325


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.49 -r1.1.2.50 src/doc/CHANGES-6.0.7

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

Modified files:

Index: src/doc/CHANGES-6.0.7
diff -u src/doc/CHANGES-6.0.7:1.1.2.49 src/doc/CHANGES-6.0.7:1.1.2.50
--- src/doc/CHANGES-6.0.7:1.1.2.49	Sun Nov 15 16:19:20 2015
+++ src/doc/CHANGES-6.0.7	Sun Nov 15 17:46:41 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.49 2015/11/15 16:19:20 bouyer Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.50 2015/11/15 17:46:41 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -7015,3 +7015,8 @@ external/bsd/ntp/scripts/mkver			1.8
 	PR/50426: Dave Tyson: Fix ntp reported version.
 	[christos, ticket #1346]
 
+sys/dev/mii/atphy.c1.17
+
+	Fix incorrect argument of mii_anar(). Fixes PR#50206.
+	[msaitoh, ticket #1325]
+



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:46:41 UTC 2015

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
ticket 1325


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.49 -r1.1.2.50 src/doc/CHANGES-6.0.7

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:46:34 UTC 2015

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
ticket 1325


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-6.1.6

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

Modified files:

Index: src/doc/CHANGES-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.48 src/doc/CHANGES-6.1.6:1.1.2.49
--- src/doc/CHANGES-6.1.6:1.1.2.48	Sun Nov 15 16:19:38 2015
+++ src/doc/CHANGES-6.1.6	Sun Nov 15 17:46:34 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.48 2015/11/15 16:19:38 bouyer Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.49 2015/11/15 17:46:34 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -6736,3 +6736,8 @@ external/bsd/ntp/scripts/mkver			1.8
 	PR/50426: Dave Tyson: Fix ntp reported version.
 	[christos, ticket #1346]
 
+sys/dev/mii/atphy.c1.17
+
+	Fix incorrect argument of mii_anar(). Fixes PR#50206.
+	[msaitoh, ticket #1325]
+



CVS commit: [netbsd-6] src/sys/dev/mii

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:45:44 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-6]: atphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1325):
sys/dev/mii/atphy.c: revision 1.17
  Fix incorrect argument of mii_anar(). Fixes PR#50206.
XXX pullup -[567]


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.2 -r1.11.8.3 src/sys/dev/mii/atphy.c

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

Modified files:

Index: src/sys/dev/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.11.8.2 src/sys/dev/mii/atphy.c:1.11.8.3
--- src/sys/dev/mii/atphy.c:1.11.8.2	Wed Feb  4 11:35:04 2015
+++ src/sys/dev/mii/atphy.c	Sun Nov 15 17:45:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.11.8.2 2015/02/04 11:35:04 martin Exp $ */
+/*	$NetBSD: atphy.c,v 1.11.8.3 2015/11/15 17:45:44 bouyer Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.11.8.2 2015/02/04 11:35:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.11.8.3 2015/11/15 17:45:44 bouyer Exp $");
 
 #include 
 #include 
@@ -226,7 +226,7 @@ atphy_service(struct mii_softc *sc, stru
 			return EINVAL;
 		}
 
-		anar = mii_anar(ife->ifm_media);
+		anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
 		if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
 			bmcr |= BMCR_FDX;
 			/* Enable pause. */



CVS commit: [netbsd-6-1] src/sys/dev/mii

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:45:59 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-6-1]: atphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1325):
sys/dev/mii/atphy.c: revision 1.17
  Fix incorrect argument of mii_anar(). Fixes PR#50206.
XXX pullup -[567]


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.14.1 src/sys/dev/mii/atphy.c

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



CVS commit: [netbsd-6] src/doc

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:52:49 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Tickets 1320 1321 1323 1324 1325 1327 1328


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.229 -r1.1.2.230 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.229 src/doc/CHANGES-6.2:1.1.2.230
--- src/doc/CHANGES-6.2:1.1.2.229	Sun Nov 15 16:59:29 2015
+++ src/doc/CHANGES-6.2	Sun Nov 15 17:52:49 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.229 2015/11/15 16:59:29 bouyer Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.230 2015/11/15 17:52:49 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -12603,3 +12603,43 @@ share/man/man5/login.conf.5			1.29 - 1.3
 	Closes PR xsrc/49912
 	[kamil, ticket #1317]
 
+sys/kern/sys_pset.c1.19
+
+	Don't forget to unlock the LWP.
+	[oster, ticket #1320]
+
+libexec/ftpd/logwtmp.c1.26, 1.27
+
+	Clear utmpx struct before writing it to wtmpx files
+	[shm, ticket #1321]
+
+bin/sh/jobs.c	1.74, 1.75
+bin/sh/trap.c	1.36, 1.37
+bin/sh/trap.h	1.21, 1.22
+
+	Process pending signals while waiting for a job, and report the
+	signal that wait was interrupted by, which is not always SIGINT
+	anymore.
+	[christos, ticket #1323]
+
+xsrc/xfree/xc/programs/xdm/access.c			1.2
+
+	Don't crash if the local hostname doesn't resolve. PR 26998
+	[dholland, ticket #1324]
+
+sys/dev/mii/atphy.c1.17
+
+	Fix incorrect argument of mii_anar(). Fixes PR#50206.
+	[msaitoh, ticket #1325]
+
+sys/netinet6/icmp6.c1.177
+
+	Update icmp6_redirect_timeout_q when changing
+	net.inet6.icmp6.redirtimeout. fixes PR kern/50240.
+	[ozaki-r, ticket #1327]
+
+sys/netinet/if_arp.c1.160
+
+	Add sysctl to selectively log arp packets from unknown network.
+	[ozaki-r, ticket #1328]
+



CVS commit: [netbsd-6] src/doc

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 17:52:49 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Tickets 1320 1321 1323 1324 1325 1327 1328


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.229 -r1.1.2.230 src/doc/CHANGES-6.2

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



CVS commit: [netbsd-6-0] src/external/bsd/bind

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 19:12:53 UTC 2015

Modified Files:
src/external/bsd/bind/dist [netbsd-6-0]: CHANGES COPYRIGHT FAQ.xml
README config.h.in config.h.win32 configure configure.in srcid
version
src/external/bsd/bind/dist/bin/check [netbsd-6-0]: named-checkconf.c
src/external/bsd/bind/dist/bin/dig [netbsd-6-0]: dig.1 dig.docbook
dig.html dighost.c host.c nslookup.c
src/external/bsd/bind/dist/bin/dig/include/dig [netbsd-6-0]: dig.h
src/external/bsd/bind/dist/bin/dnssec [netbsd-6-0]: dnssec-dsfromkey.c
dnssec-importkey.c dnssec-keyfromlabel.c dnssec-keygen.8
dnssec-keygen.c dnssec-keygen.docbook dnssec-keygen.html
dnssec-settime.8 dnssec-settime.c dnssec-settime.docbook
dnssec-settime.html dnssec-signzone.c dnssec-verify.c dnssectool.c
dnssectool.h
src/external/bsd/bind/dist/bin/named [netbsd-6-0]: client.c config.c
interfacemgr.c main.c named.html query.c server.c update.c
zoneconf.c
src/external/bsd/bind/dist/bin/named/include/named [netbsd-6-0]:
globals.h
src/external/bsd/bind/dist/bin/nsupdate [netbsd-6-0]: nsupdate.c
src/external/bsd/bind/dist/bin/rndc [netbsd-6-0]: rndc.c
src/external/bsd/bind/dist/bin/tests/system [netbsd-6-0]: conf.sh.in
genzone.sh start.pl
src/external/bsd/bind/dist/bin/tests/system/checkconf [netbsd-6-0]:
good.conf tests.sh
src/external/bsd/bind/dist/bin/tests/system/checkzone [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec/ns2 [netbsd-6-0]:
example.db.in sign.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec/ns3 [netbsd-6-0]:
named.conf sign.sh
src/external/bsd/bind/dist/bin/tests/system/emptyzones [netbsd-6-0]:
clean.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/emptyzones/ns1 [netbsd-6-0]:
named2.conf
src/external/bsd/bind/dist/bin/tests/system/forward [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/forward/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/forward/ns4 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/inline [netbsd-6-0]:
clean.sh setup.sh
src/external/bsd/bind/dist/bin/tests/system/inline/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/notify [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/notify/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/redirect [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/resolver [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/resolver/ns4 [netbsd-6-0]:
root.db tld1.db tld2.db
src/external/bsd/bind/dist/bin/tests/system/resolver/ns7 [netbsd-6-0]:
named1.conf named2.conf
src/external/bsd/bind/dist/bin/tests/system/rpz [netbsd-6-0]: tests.sh
src/external/bsd/bind/dist/bin/tests/system/upforwd [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns1 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns3 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/views [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/views/ns2 [netbsd-6-0]:
named2.conf
src/external/bsd/bind/dist/bin/tests/system/xfer [netbsd-6-0]:
dig1.good dig2.good
src/external/bsd/bind/dist/contrib/dlz/example [netbsd-6-0]: README
src/external/bsd/bind/dist/contrib/dlz/modules/bdbhpt [netbsd-6-0]:
README.md
src/external/bsd/bind/dist/contrib/dlz/modules/bdbhpt/testing 
[netbsd-6-0]:
dns-data.txt
src/external/bsd/bind/dist/contrib/sdb/ldap [netbsd-6-0]: ldapdb.c
src/external/bsd/bind/dist/doc/arm [netbsd-6-0]: Bv9ARM-book.xml
Bv9ARM.ch01.html Bv9ARM.ch02.html Bv9ARM.ch03.html Bv9ARM.ch04.html
Bv9ARM.ch05.html Bv9ARM.ch06.html Bv9ARM.ch07.html Bv9ARM.ch08.html
Bv9ARM.ch09.html Bv9ARM.ch10.html Bv9ARM.html Makefile.in
dnssec.xml latex-fixup.pl man.arpaname.html man.ddns-confgen.html
man.dig.html man.dnssec-checkds.html man.dnssec-coverage.html
man.dnssec-dsfromkey.html 

CVS commit: [netbsd-6-0] src/external/bsd/bind

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 19:12:53 UTC 2015

Modified Files:
src/external/bsd/bind/dist [netbsd-6-0]: CHANGES COPYRIGHT FAQ.xml
README config.h.in config.h.win32 configure configure.in srcid
version
src/external/bsd/bind/dist/bin/check [netbsd-6-0]: named-checkconf.c
src/external/bsd/bind/dist/bin/dig [netbsd-6-0]: dig.1 dig.docbook
dig.html dighost.c host.c nslookup.c
src/external/bsd/bind/dist/bin/dig/include/dig [netbsd-6-0]: dig.h
src/external/bsd/bind/dist/bin/dnssec [netbsd-6-0]: dnssec-dsfromkey.c
dnssec-importkey.c dnssec-keyfromlabel.c dnssec-keygen.8
dnssec-keygen.c dnssec-keygen.docbook dnssec-keygen.html
dnssec-settime.8 dnssec-settime.c dnssec-settime.docbook
dnssec-settime.html dnssec-signzone.c dnssec-verify.c dnssectool.c
dnssectool.h
src/external/bsd/bind/dist/bin/named [netbsd-6-0]: client.c config.c
interfacemgr.c main.c named.html query.c server.c update.c
zoneconf.c
src/external/bsd/bind/dist/bin/named/include/named [netbsd-6-0]:
globals.h
src/external/bsd/bind/dist/bin/nsupdate [netbsd-6-0]: nsupdate.c
src/external/bsd/bind/dist/bin/rndc [netbsd-6-0]: rndc.c
src/external/bsd/bind/dist/bin/tests/system [netbsd-6-0]: conf.sh.in
genzone.sh start.pl
src/external/bsd/bind/dist/bin/tests/system/checkconf [netbsd-6-0]:
good.conf tests.sh
src/external/bsd/bind/dist/bin/tests/system/checkzone [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec/ns2 [netbsd-6-0]:
example.db.in sign.sh
src/external/bsd/bind/dist/bin/tests/system/dnssec/ns3 [netbsd-6-0]:
named.conf sign.sh
src/external/bsd/bind/dist/bin/tests/system/emptyzones [netbsd-6-0]:
clean.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/emptyzones/ns1 [netbsd-6-0]:
named2.conf
src/external/bsd/bind/dist/bin/tests/system/forward [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/forward/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/forward/ns4 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/inline [netbsd-6-0]:
clean.sh setup.sh
src/external/bsd/bind/dist/bin/tests/system/inline/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/notify [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/notify/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/redirect [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/resolver [netbsd-6-0]:
tests.sh
src/external/bsd/bind/dist/bin/tests/system/resolver/ns4 [netbsd-6-0]:
root.db tld1.db tld2.db
src/external/bsd/bind/dist/bin/tests/system/resolver/ns7 [netbsd-6-0]:
named1.conf named2.conf
src/external/bsd/bind/dist/bin/tests/system/rpz [netbsd-6-0]: tests.sh
src/external/bsd/bind/dist/bin/tests/system/upforwd [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns1 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns2 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/upforwd/ns3 [netbsd-6-0]:
named.conf
src/external/bsd/bind/dist/bin/tests/system/views [netbsd-6-0]:
clean.sh setup.sh tests.sh
src/external/bsd/bind/dist/bin/tests/system/views/ns2 [netbsd-6-0]:
named2.conf
src/external/bsd/bind/dist/bin/tests/system/xfer [netbsd-6-0]:
dig1.good dig2.good
src/external/bsd/bind/dist/contrib/dlz/example [netbsd-6-0]: README
src/external/bsd/bind/dist/contrib/dlz/modules/bdbhpt [netbsd-6-0]:
README.md
src/external/bsd/bind/dist/contrib/dlz/modules/bdbhpt/testing 
[netbsd-6-0]:
dns-data.txt
src/external/bsd/bind/dist/contrib/sdb/ldap [netbsd-6-0]: ldapdb.c
src/external/bsd/bind/dist/doc/arm [netbsd-6-0]: Bv9ARM-book.xml
Bv9ARM.ch01.html Bv9ARM.ch02.html Bv9ARM.ch03.html Bv9ARM.ch04.html
Bv9ARM.ch05.html Bv9ARM.ch06.html Bv9ARM.ch07.html Bv9ARM.ch08.html
Bv9ARM.ch09.html Bv9ARM.ch10.html Bv9ARM.html Makefile.in
dnssec.xml latex-fixup.pl man.arpaname.html man.ddns-confgen.html
man.dig.html man.dnssec-checkds.html man.dnssec-coverage.html
man.dnssec-dsfromkey.html 

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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:27:35 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-6]: if_iwn.c if_iwnvar.h

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1330):
sys/dev/pci/if_iwnvar.h: revision 1.17
sys/dev/pci/if_iwn.c: revision 1.76
PR/50187: Don't use DS parameter set when 5GHz channel is scanning.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.2.1 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.13 -r1.13.10.1 src/sys/dev/pci/if_iwnvar.h

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.62 src/sys/dev/pci/if_iwn.c:1.62.2.1
--- src/sys/dev/pci/if_iwn.c:1.62	Mon Jan 30 19:41:20 2012
+++ src/sys/dev/pci/if_iwn.c	Sun Nov 15 20:27:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.62.2.1 2015/11/15 20:27:34 bouyer Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.62.2.1 2015/11/15 20:27:34 bouyer Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -301,7 +301,8 @@ static u_int8_t	*ieee80211_add_rates(u_i
 static u_int8_t	*ieee80211_add_xrates(u_int8_t *,
 const struct ieee80211_rateset *);
 
-static void	iwn_fix_channel(struct ieee80211com *, struct mbuf *);
+static void	iwn_fix_channel(struct ieee80211com *, struct mbuf *,
+		struct iwn_rx_stat *);
 
 #ifdef IWN_DEBUG
 #define DPRINTF(x)	do { if (iwn_debug > 0) printf x; } while (0)
@@ -1782,7 +1783,7 @@ iwn_newstate(struct ieee80211com *ic, en
 		/* XXX Not sure if call and flags are needed. */
 		ieee80211_node_table_reset(>ic_scan);
 		ic->ic_flags |= IEEE80211_F_SCAN | IEEE80211_F_ASCAN;
-		sc->sc_flags |= IWN_FLAG_SCANNING;
+		sc->sc_flags |= IWN_FLAG_SCANNING_2GHZ;
 
 		/* Make the link LED blink while we're scanning. */
 		iwn_set_led(sc, IWN_LED_LINK, 10, 10);
@@ -2005,7 +2006,7 @@ iwn_rx_done(struct iwn_softc *sc, struct
 
 	/* XXX Added for NetBSD: scans never stop without it */
 	if (ic->ic_state == IEEE80211_S_SCAN)
-		iwn_fix_channel(ic, m);
+		iwn_fix_channel(ic, m, stat);
 
 	if (sc->sc_drvbpf != NULL) {
 		struct iwn_rx_radiotap_header *tap = >sc_rxtap;
@@ -2432,6 +2433,8 @@ iwn_notif_intr(struct iwn_softc *sc)
  * We just finished scanning 2GHz channels,
  * start scanning 5GHz ones.
  */
+sc->sc_flags &= ~IWN_FLAG_SCANNING_2GHZ;
+sc->sc_flags |= IWN_FLAG_SCANNING_5GHZ;
 if (iwn_scan(sc, IEEE80211_CHAN_5GHZ) == 0)
 	break;
 			}
@@ -6078,8 +6081,10 @@ ieee80211_add_xrates(u_int8_t *frm, cons
  * XXX: Duplicated from if_iwi.c
  */
 static void
-iwn_fix_channel(struct ieee80211com *ic, struct mbuf *m)
+iwn_fix_channel(struct ieee80211com *ic, struct mbuf *m,
+struct iwn_rx_stat *stat)
 {
+	struct iwn_softc *sc = ic->ic_ifp->if_softc;
 	struct ieee80211_frame *wh;
 	uint8_t subtype;
 	uint8_t *frm, *efrm;
@@ -6095,6 +6100,13 @@ iwn_fix_channel(struct ieee80211com *ic,
 	subtype != IEEE80211_FC0_SUBTYPE_PROBE_RESP)
 		return;
 
+	if (sc->sc_flags & IWN_FLAG_SCANNING_5GHZ) {
+		int chan = le16toh(stat->chan);
+		if (chan < __arraycount(ic->ic_channels))
+			ic->ic_curchan = >ic_channels[chan];
+		return;
+	}
+
 	frm = (uint8_t *)(wh + 1);
 	efrm = mtod(m, uint8_t *) + m->m_len;
 

Index: src/sys/dev/pci/if_iwnvar.h
diff -u src/sys/dev/pci/if_iwnvar.h:1.13 src/sys/dev/pci/if_iwnvar.h:1.13.10.1
--- src/sys/dev/pci/if_iwnvar.h:1.13	Sun May 15 13:56:20 2011
+++ src/sys/dev/pci/if_iwnvar.h	Sun Nov 15 20:27:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwnvar.h,v 1.13 2011/05/15 13:56:20 christos Exp $	*/
+/*	$NetBSD: if_iwnvar.h,v 1.13.10.1 2015/11/15 20:27:34 bouyer Exp $	*/
 /*	$OpenBSD: if_iwnvar.h,v 1.19 2010/05/05 19:47:43 damien Exp $	*/
 
 /*-
@@ -220,8 +220,10 @@ struct iwn_softc {
 #define IWN_FLAG_HAS_11N	(1 << 6)
 #define IWN_FLAG_ENH_SENS	(1 << 7)
 /* Added for NetBSD */
-#define IWN_FLAG_SCANNING	(1 << 8)
-#define IWN_FLAG_HW_INITED	(1 << 9)
+#define IWN_FLAG_HW_INITED	(1 << 8)
+#define IWN_FLAG_SCANNING_2GHZ	(1 << 9)
+#define IWN_FLAG_SCANNING_5GHZ	(1 << 10)
+#define IWN_FLAG_SCANNING	(IWN_FLAG_SCANNING_2GHZ|IWN_FLAG_SCANNING_5GHZ)
 
 	uint8_t 		hw_type;
 



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:27:35 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-6]: if_iwn.c if_iwnvar.h

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1330):
sys/dev/pci/if_iwnvar.h: revision 1.17
sys/dev/pci/if_iwn.c: revision 1.76
PR/50187: Don't use DS parameter set when 5GHz channel is scanning.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.2.1 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.13 -r1.13.10.1 src/sys/dev/pci/if_iwnvar.h

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:37:04 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.9 -r1.339.2.10 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.3 -r1.236.2.4 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.2 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.339.2.9 src/sys/kern/kern_exec.c:1.339.2.10
--- src/sys/kern/kern_exec.c:1.339.2.9	Mon Apr 21 10:00:10 2014
+++ src/sys/kern/kern_exec.c	Sun Nov 15 20:37:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.339.2.9 2014/04/21 10:00:10 bouyer Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.339.2.10 2015/11/15 20:37:04 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.9 2014/04/21 10:00:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.10 2015/11/15 20:37:04 bouyer Exp $");
 
 #include "opt_exec.h"
 #include "opt_ktrace.h"
@@ -1412,7 +1412,7 @@ execve_runproc(struct lwp *l, struct exe
 	if (p->p_sflag & PS_STOPEXEC) {
 		KERNEL_UNLOCK_ALL(l, >l_biglocks);
 		p->p_pptr->p_nstopchild++;
-		p->p_pptr->p_waited = 0;
+		p->p_waited = 0;
 		mutex_enter(p->p_lock);
 		ksiginfo_queue_init();
 		sigclearall(p, , );
@@ -1849,6 +1849,7 @@ spawn_return(void *arg)
 	struct spawn_exec_data *spawn_data = arg;
 	struct lwp *l = curlwp;
 	int error, newfd;
+	int ostat;
 	size_t i;
 	const struct posix_spawn_file_actions_entry *fae;
 	pid_t ppid;
@@ -1921,7 +1922,6 @@ spawn_return(void *arg)
 
 	/* handle posix_spawnattr */
 	if (spawn_data->sed_attrs != NULL) {
-		int ostat;
 		struct sigaction sigact;
 		

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

2015-11-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 15 20:35:34 UTC 2015

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
PR 32999: adjust VM parameters for 64 bit kernel/userlands.
Limit old binaries (i.e. processes not using topdown VA layout) to 2 GB
data size.
Use the same limits as native sparc for netbsd32 emulation - we need to
revisit this, but currently automatic test runs in this environment
fail big time, so there is no easy way to verify any changes.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/include/vmparam.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/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.34 src/sys/arch/sparc64/include/vmparam.h:1.35
--- src/sys/arch/sparc64/include/vmparam.h:1.34	Mon Apr 14 10:54:08 2014
+++ src/sys/arch/sparc64/include/vmparam.h	Sun Nov 15 20:35:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.34 2014/04/14 10:54:08 martin Exp $ */
+/*	$NetBSD: vmparam.h,v 1.35 2015/11/15 20:35:33 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,7 @@
 /*
  * Virtual memory related constants, all in bytes
  */
-/* #ifdef __arch64__ */
-#if 0
+#if __arch64__
 /*
  * 64-bit limits:
  *
@@ -90,64 +89,69 @@
  * of that for data and the other half for stack.
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(4L*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ		(4UL*1024*1024*1024)	/* max text size */
 #endif
 #ifndef DFLDSIZ
-#define	DFLDSIZ		(128L*1024*1024)	/* initial data size limit */
+#define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(1L<<39)		/* max data size */
+#define	MAXDSIZ		(1UL<<39)		/* max data size */
+/*
+ * For processes not using topdown VA, we need to limit the data size -
+ * they probably have not been compiled with the proper compiler memory
+ * model.
+ */
+#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
+round_page((vaddr_t)(da) + (vsize_t)max(maxdmap,2UL*1024*1024*1024))
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		MAXDSIZ			/* max stack size */
+#define	MAXSSIZ		(128*1024*1024)		/* max stack size */
 #endif
 #else
 /*
  * 32-bit limits:
  *
- * We only have 4GB to play with.  Limit stack, data, and text
- * each to half of that.
+ * We only have 4GB to play with.  Limit data, and text
+ * each to half of that and set a reasonable stack limit.
  *
- * This is silly.  Apparently if we go above these numbers
- * integer overflows in other parts of the kernel cause hangs.
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(1*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ		(2UL*1024*1024*1024)	/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
+#define	MAXDSIZ		(2UL*1024*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(8*1024*1024)			/* max stack size */
+#define	MAXSSIZ		(64*1024*1024)		/* max stack size */
 #endif
 #endif
 
 /*
- * 32-bit emulation limits.
+ * 32-bit emulation limits (same as sparc - we could go bigger)
  */
 #ifndef MAXTSIZ32
-#define	MAXTSIZ32	(1*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ32	(64*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ32
-#define	DFLDSIZ32	(128*1024*1024)		/* initial data size limit */
+#define	DFLDSIZ32	(64*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ32
-#define	MAXDSIZ32	(1*1024*1024*1024)	/* max data size */
+#define	MAXDSIZ32	(512*1024*1024)		/* max data size */
 #endif
 #ifndef	DFLSSIZ32
 #define	DFLSSIZ32	(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ32
-#define	MAXSSIZ32	(8*1024*1024)			/* max stack size */
+#define	MAXSSIZ32	(32*1024*1024)		/* max stack size */
 #endif
 
 /*



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

2015-11-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 15 20:35:34 UTC 2015

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
PR 32999: adjust VM parameters for 64 bit kernel/userlands.
Limit old binaries (i.e. processes not using topdown VA layout) to 2 GB
data size.
Use the same limits as native sparc for netbsd32 emulation - we need to
revisit this, but currently automatic test runs in this environment
fail big time, so there is no easy way to verify any changes.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/include/vmparam.h

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:38:18 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.6.2.2 -r1.339.2.6.2.3 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.2 -r1.236.2.2.4.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.1.6.1 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.339.2.6.2.2 src/sys/kern/kern_exec.c:1.339.2.6.2.3
--- src/sys/kern/kern_exec.c:1.339.2.6.2.2	Mon Apr 21 10:00:33 2014
+++ src/sys/kern/kern_exec.c	Sun Nov 15 20:38:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.339.2.6.2.2 2014/04/21 10:00:33 bouyer Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.339.2.6.2.3 2015/11/15 20:38:17 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.6.2.2 2014/04/21 10:00:33 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.6.2.3 2015/11/15 20:38:17 bouyer Exp $");
 
 #include "opt_exec.h"
 #include "opt_ktrace.h"
@@ -1408,7 +1408,7 @@ execve_runproc(struct lwp *l, struct exe
 	if (p->p_sflag & PS_STOPEXEC) {
 		KERNEL_UNLOCK_ALL(l, >l_biglocks);
 		p->p_pptr->p_nstopchild++;
-		p->p_pptr->p_waited = 0;
+		p->p_waited = 0;
 		mutex_enter(p->p_lock);
 		ksiginfo_queue_init();
 		sigclearall(p, , );
@@ -1845,6 +1845,7 @@ spawn_return(void *arg)
 	struct spawn_exec_data *spawn_data = arg;
 	struct lwp *l = curlwp;
 	int error, newfd;
+	int ostat;
 	size_t i;
 	const struct posix_spawn_file_actions_entry *fae;
 	pid_t ppid;
@@ -1917,7 +1918,6 @@ spawn_return(void *arg)
 
 	/* handle posix_spawnattr */
 	if (spawn_data->sed_attrs != NULL) {
-		int ostat;
 		

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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:38:18 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.6.2.2 -r1.339.2.6.2.3 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.2 -r1.236.2.2.4.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.1.6.1 src/sys/kern/kern_synch.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:37:04 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.9 -r1.339.2.10 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.3 -r1.236.2.4 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.2 src/sys/kern/kern_synch.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:38:01 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.5.4.3 -r1.339.2.5.4.4 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.2 -r1.236.2.2.2.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.1.4.1 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.339.2.5.4.3 src/sys/kern/kern_exec.c:1.339.2.5.4.4
--- src/sys/kern/kern_exec.c:1.339.2.5.4.3	Mon Apr 21 10:00:35 2014
+++ src/sys/kern/kern_exec.c	Sun Nov 15 20:38:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.339.2.5.4.3 2014/04/21 10:00:35 bouyer Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.339.2.5.4.4 2015/11/15 20:38:01 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.5.4.3 2014/04/21 10:00:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.5.4.4 2015/11/15 20:38:01 bouyer Exp $");
 
 #include "opt_exec.h"
 #include "opt_ktrace.h"
@@ -1408,7 +1408,7 @@ execve_runproc(struct lwp *l, struct exe
 	if (p->p_sflag & PS_STOPEXEC) {
 		KERNEL_UNLOCK_ALL(l, >l_biglocks);
 		p->p_pptr->p_nstopchild++;
-		p->p_pptr->p_waited = 0;
+		p->p_waited = 0;
 		mutex_enter(p->p_lock);
 		ksiginfo_queue_init();
 		sigclearall(p, , );
@@ -1845,6 +1845,7 @@ spawn_return(void *arg)
 	struct spawn_exec_data *spawn_data = arg;
 	struct lwp *l = curlwp;
 	int error, newfd;
+	int ostat;
 	size_t i;
 	const struct posix_spawn_file_actions_entry *fae;
 	pid_t ppid;
@@ -1917,7 +1918,6 @@ spawn_return(void *arg)
 
 	/* handle posix_spawnattr */
 	if (spawn_data->sed_attrs != NULL) {
-		int ostat;
 		

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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:38:01 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_exec.c kern_exit.c kern_synch.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1333):
sys/kern/kern_exec.c: revision 1.420
sys/kern/kern_synch.c: revision 1.309
sys/kern/kern_exit.c: revision 1.246
sys/kern/kern_exit.c: revision 1.247
sys/kern/kern_exec.c: revision 1.419
In execve_runproc(), update the p_waited entry for the process being
moved to SSTOP state, not for its parent.  (It is correct to update
the parent's p_nstopchild count.)  If the value is not already zero,
it could prevent its parent from waiting for the process.
Fixes PR kern/50298
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.
Fixes PR kern/50318
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
Currently, if a process is exiting and its parent has indicated no intent
of reaping the process (nor any other children), the process wil get
reparented to init.  Since the state of the exiting process at this point
is SDEAD, proc_reparent() will not update either the old or new parent's
p_nstopchild counters.
This change causes both old and new parents to be properly updated.
Fixes PR kern/50300
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
For processes marked with PS_STOPEXIT, update the process's p_waited
value, and update its parent's p_nstopchild value when marking the
process's p_stat to SSTOP.  The process needed to be SACTIVE to get
here, so this transition represents an additional process for which
the parent needs to wait.
Fixes PR kern/50308
Pullups will be requested for:
NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2
In spawn_return() we temporarily move the process state to SSTOP, but
without updating its p_waited value or its parent's p_nstopchild
counter.  Later, we restore the original state, again without any
adjustment of the related values.  This leaves a relatively short
window when the values are inconsistent and could interfere with the
proper operation of sys_wait() for the parent (if it manages to be
scheduled;  it's not totally clear what, if anything, prevents
scheduling/execution of the parent).
If during this window, any of the checks being made result in an
error, we call exit1() which will eventually migrate the process's
state to SDEAD (with an intermediate transition to SDYING).  At
this point the other variables get updated, and we finally restore
a consistent state.
This change updates the p_waited and parent's p_nstopchild at each
step to eliminate any windows during which the values could lead to
incorrect decisions.
Fixes PR kern/50330
Pullups will be requested for NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.339.2.5.4.3 -r1.339.2.5.4.4 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.236.2.2 -r1.236.2.2.2.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.297.2.1 -r1.297.2.1.4.1 src/sys/kern/kern_synch.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:20 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.8.1 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.316 src/sys/kern/kern_sig.c:1.316.8.1
--- src/sys/kern/kern_sig.c:1.316	Fri Sep 16 22:07:17 2011
+++ src/sys/kern/kern_sig.c	Sun Nov 15 20:40:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.316.8.1 2015/11/15 20:40:20 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316.8.1 2015/11/15 20:40:20 bouyer Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -1461,14 +1461,13 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 		}
 		if ((prop & SA_CONT) != 0 || signo == SIGKILL) {
 			/*
-			 * Re-adjust p_nstopchild if the process wasn't
-			 * collected by its parent.
+			 * Re-adjust p_nstopchild if the process was
+			 * stopped but not yet collected by its parent.
 			 */
+			if (p->p_stat == SSTOP && !p->p_waited)
+p->p_pptr->p_nstopchild--;
 			p->p_stat = SACTIVE;
 			p->p_sflag &= ~PS_STOPPING;
-			if (!p->p_waited) {
-p->p_pptr->p_nstopchild--;
-			}
 			if (p->p_slflag & PSL_TRACED) {
 KASSERT(signo == SIGKILL);
 goto deliver;



CVS commit: [netbsd-6-1] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:39 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6-1]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6-1]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6-1]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.20.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.28.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.28.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.c

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



CVS commit: [netbsd-6-0] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:37 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6-0]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6-0]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6-0]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.18.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.20.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.20.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:26 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.12.1 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.316 src/sys/kern/kern_sig.c:1.316.12.1
--- src/sys/kern/kern_sig.c:1.316	Fri Sep 16 22:07:17 2011
+++ src/sys/kern/kern_sig.c	Sun Nov 15 20:40:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.316.12.1 2015/11/15 20:40:26 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316.12.1 2015/11/15 20:40:26 bouyer Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -1461,14 +1461,13 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 		}
 		if ((prop & SA_CONT) != 0 || signo == SIGKILL) {
 			/*
-			 * Re-adjust p_nstopchild if the process wasn't
-			 * collected by its parent.
+			 * Re-adjust p_nstopchild if the process was
+			 * stopped but not yet collected by its parent.
 			 */
+			if (p->p_stat == SSTOP && !p->p_waited)
+p->p_pptr->p_nstopchild--;
 			p->p_stat = SACTIVE;
 			p->p_sflag &= ~PS_STOPPING;
-			if (!p->p_waited) {
-p->p_pptr->p_nstopchild--;
-			}
 			if (p->p_slflag & PSL_TRACED) {
 KASSERT(signo == SIGKILL);
 goto deliver;



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:20 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.8.1 src/sys/kern/kern_sig.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:31 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.14.1 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.316 src/sys/kern/kern_sig.c:1.316.14.1
--- src/sys/kern/kern_sig.c:1.316	Fri Sep 16 22:07:17 2011
+++ src/sys/kern/kern_sig.c	Sun Nov 15 20:40:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.316.14.1 2015/11/15 20:40:31 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316.14.1 2015/11/15 20:40:31 bouyer Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -1461,14 +1461,13 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 		}
 		if ((prop & SA_CONT) != 0 || signo == SIGKILL) {
 			/*
-			 * Re-adjust p_nstopchild if the process wasn't
-			 * collected by its parent.
+			 * Re-adjust p_nstopchild if the process was
+			 * stopped but not yet collected by its parent.
 			 */
+			if (p->p_stat == SSTOP && !p->p_waited)
+p->p_pptr->p_nstopchild--;
 			p->p_stat = SACTIVE;
 			p->p_sflag &= ~PS_STOPPING;
-			if (!p->p_waited) {
-p->p_pptr->p_nstopchild--;
-			}
 			if (p->p_slflag & PSL_TRACED) {
 KASSERT(signo == SIGKILL);
 goto deliver;



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:31 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.14.1 src/sys/kern/kern_sig.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:40:26 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_sig.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.316.12.1 src/sys/kern/kern_sig.c

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



CVS commit: [netbsd-6-1] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:39 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6-1]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6-1]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6-1]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.20.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.28.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.28.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.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/compat/linux/arch/arm/linux_ptrace.c
diff -u src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16 src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16.20.1
--- src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16	Wed Jul  7 01:30:33 2010
+++ src/sys/compat/linux/arch/arm/linux_ptrace.c	Sun Nov 15 20:42:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.16.20.1 2015/11/15 20:42:39 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16.20.1 2015/11/15 20:42:39 bouyer Exp $");
 
 #include 
 #include 
@@ -140,7 +140,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		goto out;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -148,6 +147,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -160,9 +160,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/i386/linux_ptrace.c
diff -u src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26 src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26.28.1
--- src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26	Wed Jul  7 01:30:34 2010
+++ src/sys/compat/linux/arch/i386/linux_ptrace.c	Sun Nov 15 20:42:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.26.28.1 2015/11/15 20:42:39 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26.28.1 2015/11/15 20:42:39 bouyer Exp $");
 
 #include 
 #include 
@@ -184,7 +184,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		return ESRCH;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -192,6 +191,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -204,9 +204,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/powerpc/linux_ptrace.c
diff -u src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23 src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23.28.1
--- src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23	Thu Jul  1 02:38:28 2010
+++ src/sys/compat/linux/arch/powerpc/linux_ptrace.c	Sun Nov 15 20:42:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $ */
+/*	$NetBSD: linux_ptrace.c,v 1.23.28.1 2015/11/15 20:42:39 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $");
+__KERNEL_RCSID(0, 

CVS commit: [netbsd-6-0] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:37 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6-0]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6-0]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6-0]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.18.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.20.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.20.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.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/compat/linux/arch/arm/linux_ptrace.c
diff -u src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16 src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16.18.1
--- src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16	Wed Jul  7 01:30:33 2010
+++ src/sys/compat/linux/arch/arm/linux_ptrace.c	Sun Nov 15 20:42:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.16.18.1 2015/11/15 20:42:36 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16.18.1 2015/11/15 20:42:36 bouyer Exp $");
 
 #include 
 #include 
@@ -140,7 +140,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		goto out;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -148,6 +147,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -160,9 +160,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/i386/linux_ptrace.c
diff -u src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26 src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26.20.1
--- src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26	Wed Jul  7 01:30:34 2010
+++ src/sys/compat/linux/arch/i386/linux_ptrace.c	Sun Nov 15 20:42:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.26.20.1 2015/11/15 20:42:36 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26.20.1 2015/11/15 20:42:36 bouyer Exp $");
 
 #include 
 #include 
@@ -184,7 +184,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		return ESRCH;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -192,6 +191,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -204,9 +204,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/powerpc/linux_ptrace.c
diff -u src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23 src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23.20.1
--- src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23	Thu Jul  1 02:38:28 2010
+++ src/sys/compat/linux/arch/powerpc/linux_ptrace.c	Sun Nov 15 20:42:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $ */
+/*	$NetBSD: linux_ptrace.c,v 1.23.20.1 2015/11/15 20:42:36 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $");
+__KERNEL_RCSID(0, 

CVS commit: [netbsd-6] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:32 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.14.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.14.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.14.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.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/compat/linux/arch/arm/linux_ptrace.c
diff -u src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16 src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16.14.1
--- src/sys/compat/linux/arch/arm/linux_ptrace.c:1.16	Wed Jul  7 01:30:33 2010
+++ src/sys/compat/linux/arch/arm/linux_ptrace.c	Sun Nov 15 20:42:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.16.14.1 2015/11/15 20:42:32 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16 2010/07/07 01:30:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16.14.1 2015/11/15 20:42:32 bouyer Exp $");
 
 #include 
 #include 
@@ -140,7 +140,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		goto out;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -148,6 +147,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -160,9 +160,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/i386/linux_ptrace.c
diff -u src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26 src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26.14.1
--- src/sys/compat/linux/arch/i386/linux_ptrace.c:1.26	Wed Jul  7 01:30:34 2010
+++ src/sys/compat/linux/arch/i386/linux_ptrace.c	Sun Nov 15 20:42:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $	*/
+/*	$NetBSD: linux_ptrace.c,v 1.26.14.1 2015/11/15 20:42:32 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26 2010/07/07 01:30:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.26.14.1 2015/11/15 20:42:32 bouyer Exp $");
 
 #include 
 #include 
@@ -184,7 +184,6 @@ linux_sys_ptrace_arch(struct lwp *l, con
 		return ESRCH;
 	}
 	mutex_enter(t->p_lock);
-	mutex_exit(proc_lock);
 
 	/*
 	 * You cannot do what you want to the process if:
@@ -192,6 +191,7 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	 */
 	if (!ISSET(t->p_slflag, PSL_TRACED)) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EPERM;
 		goto out;
 	}
@@ -204,9 +204,11 @@ linux_sys_ptrace_arch(struct lwp *l, con
 	if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p ||
 	t->p_stat != SSTOP || !t->p_waited) {
 		mutex_exit(t->p_lock);
+		mutex_exit(proc_lock);
 		error = EBUSY;
 		goto out;
 	}
+	mutex_exit(proc_lock);
 	/* XXX: ptrace needs revamp for multi-threading support. */
 	if (t->p_nlwps > 1) {
 		mutex_exit(t->p_lock);

Index: src/sys/compat/linux/arch/powerpc/linux_ptrace.c
diff -u src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23 src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23.14.1
--- src/sys/compat/linux/arch/powerpc/linux_ptrace.c:1.23	Thu Jul  1 02:38:28 2010
+++ src/sys/compat/linux/arch/powerpc/linux_ptrace.c	Sun Nov 15 20:42:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $ */
+/*	$NetBSD: linux_ptrace.c,v 1.23.14.1 2015/11/15 20:42:32 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.23 2010/07/01 02:38:28 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: 

CVS commit: [netbsd-6] src/sys/compat/linux/arch

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:42:32 UTC 2015

Modified Files:
src/sys/compat/linux/arch/arm [netbsd-6]: linux_ptrace.c
src/sys/compat/linux/arch/i386 [netbsd-6]: linux_ptrace.c
src/sys/compat/linux/arch/powerpc [netbsd-6]: linux_ptrace.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.14.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.26 -r1.26.14.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.23 -r1.23.14.1 \
src/sys/compat/linux/arch/powerpc/linux_ptrace.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:10 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.2.2.1 -r1.236.2.2.2.2 src/sys/kern/kern_exit.c

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

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.236.2.2.2.1 src/sys/kern/kern_exit.c:1.236.2.2.2.2
--- src/sys/kern/kern_exit.c:1.236.2.2.2.1	Sun Nov 15 20:38:01 2015
+++ src/sys/kern/kern_exit.c	Sun Nov 15 20:44:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.236.2.2.2.1 2015/11/15 20:38:01 bouyer Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.236.2.2.2.2 2015/11/15 20:44:10 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.2.2.1 2015/11/15 20:38:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.2.2.2 2015/11/15 20:44:10 bouyer Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -248,8 +248,8 @@ exit1(struct lwp *l, int rv)
 		}
 		p->p_waited = 0;
 		p->p_pptr->p_nstopchild++;
-		mutex_exit(proc_lock);
 		p->p_stat = SSTOP;
+		mutex_exit(proc_lock);
 		lwp_lock(l);
 		p->p_nrlwps--;
 		l->l_stat = LSSTOP;



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:10 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.4 -r1.236.2.5 src/sys/kern/kern_exit.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:10 UTC 2015

Modified Files:
src/sys/kern [netbsd-6]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.4 -r1.236.2.5 src/sys/kern/kern_exit.c

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

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.236.2.4 src/sys/kern/kern_exit.c:1.236.2.5
--- src/sys/kern/kern_exit.c:1.236.2.4	Sun Nov 15 20:37:04 2015
+++ src/sys/kern/kern_exit.c	Sun Nov 15 20:44:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.236.2.4 2015/11/15 20:37:04 bouyer Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.236.2.5 2015/11/15 20:44:10 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.4 2015/11/15 20:37:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.5 2015/11/15 20:44:10 bouyer Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -248,8 +248,8 @@ exit1(struct lwp *l, int rv)
 		}
 		p->p_waited = 0;
 		p->p_pptr->p_nstopchild++;
-		mutex_exit(proc_lock);
 		p->p_stat = SSTOP;
+		mutex_exit(proc_lock);
 		lwp_lock(l);
 		p->p_nrlwps--;
 		l->l_stat = LSSTOP;



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:13 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.2.4.1 -r1.236.2.2.4.2 src/sys/kern/kern_exit.c

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

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.236.2.2.4.1 src/sys/kern/kern_exit.c:1.236.2.2.4.2
--- src/sys/kern/kern_exit.c:1.236.2.2.4.1	Sun Nov 15 20:38:18 2015
+++ src/sys/kern/kern_exit.c	Sun Nov 15 20:44:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.236.2.2.4.1 2015/11/15 20:38:18 bouyer Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.236.2.2.4.2 2015/11/15 20:44:13 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.2.4.1 2015/11/15 20:38:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.2.4.2 2015/11/15 20:44:13 bouyer Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -248,8 +248,8 @@ exit1(struct lwp *l, int rv)
 		}
 		p->p_waited = 0;
 		p->p_pptr->p_nstopchild++;
-		mutex_exit(proc_lock);
 		p->p_stat = SSTOP;
+		mutex_exit(proc_lock);
 		lwp_lock(l);
 		p->p_nrlwps--;
 		l->l_stat = LSSTOP;



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:10 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-0]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.2.2.1 -r1.236.2.2.2.2 src/sys/kern/kern_exit.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:44:13 UTC 2015

Modified Files:
src/sys/kern [netbsd-6-1]: kern_exit.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1336):
sys/kern/kern_exit.c: revision 1.248
Update value of p_stat before we release the proc_lock.  Thanks to
Robert Elz.
XXX Pull-ups for -7, -6{,-0,-1} and -5{,-0,-1,-2}


To generate a diff of this commit:
cvs rdiff -u -r1.236.2.2.4.1 -r1.236.2.2.4.2 src/sys/kern/kern_exit.c

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



CVS commit: [netbsd-6] src/lib/libcurses

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:47:11 UTC 2015

Modified Files:
src/lib/libcurses [netbsd-6]: toucholap.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1337):
lib/libcurses/toucholap.c: revision 1.16
Fix x/y edito.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.36.1 src/lib/libcurses/toucholap.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/libcurses/toucholap.c
diff -u src/lib/libcurses/toucholap.c:1.15 src/lib/libcurses/toucholap.c:1.15.36.1
--- src/lib/libcurses/toucholap.c:1.15	Sun Jan 21 13:25:36 2007
+++ src/lib/libcurses/toucholap.c	Sun Nov 15 20:47:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: toucholap.c,v 1.15 2007/01/21 13:25:36 jdc Exp $	*/
+/*	$NetBSD: toucholap.c,v 1.15.36.1 2015/11/15 20:47:11 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)toucholap.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: toucholap.c,v 1.15 2007/01/21 13:25:36 jdc Exp $");
+__RCSID("$NetBSD: toucholap.c,v 1.15.36.1 2015/11/15 20:47:11 bouyer Exp $");
 #endif
 #endif/* not lint */
 
@@ -55,7 +55,7 @@ touchoverlap(WINDOW *win1, WINDOW *win2)
 #endif
 	starty = max(win1->begy, win2->begy);
 	startx = max(win1->begx, win2->begx);
-	endy = min(win1->maxy + win1->begy, win2->maxy + win2->begx);
+	endy = min(win1->maxy + win1->begy, win2->maxy + win2->begy);
 	endx = min(win1->maxx + win1->begx, win2->maxx + win2->begx);
 #ifdef DEBUG
 	__CTRACE(__CTRACE_WINDOW, "touchoverlap: from (%d,%d) to (%d,%d)\n",



CVS commit: [netbsd-6] src/lib/libcurses

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:47:11 UTC 2015

Modified Files:
src/lib/libcurses [netbsd-6]: toucholap.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1337):
lib/libcurses/toucholap.c: revision 1.16
Fix x/y edito.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.36.1 src/lib/libcurses/toucholap.c

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



CVS commit: [netbsd-6-1] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:45 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6-1]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.28.1 src/sys/compat/osf1/osf1_socket.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/compat/osf1/osf1_socket.c
diff -u src/sys/compat/osf1/osf1_socket.c:1.20 src/sys/compat/osf1/osf1_socket.c:1.20.28.1
--- src/sys/compat/osf1/osf1_socket.c:1.20	Fri Apr 23 15:19:21 2010
+++ src/sys/compat/osf1/osf1_socket.c	Sun Nov 15 20:48:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $ */
+/* $NetBSD: osf1_socket.c,v 1.20.28.1 2015/11/15 20:48:45 bouyer Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20.28.1 2015/11/15 20:48:45 bouyer Exp $");
 
 #include 
 #include 
@@ -116,7 +116,7 @@ osf1_sys_sendmsg_xopen(struct lwp *l, co
 		return (EINVAL);
 
 	iov_len = bsd_msghdr.msg_iovlen;
-	if (iov_len > IOV_MAX)
+	if ((iov_len > IOV_MAX) || (iov_len == 0))
 		return EMSGSIZE;
 	bsd_iovec = kmem_alloc(iov_len * sizeof(struct iovec), KM_SLEEP);
 	bsd_msghdr.msg_iov = bsd_iovec;



CVS commit: [netbsd-6] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:49 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.14.1 src/sys/compat/osf1/osf1_socket.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/compat/osf1/osf1_socket.c
diff -u src/sys/compat/osf1/osf1_socket.c:1.20 src/sys/compat/osf1/osf1_socket.c:1.20.14.1
--- src/sys/compat/osf1/osf1_socket.c:1.20	Fri Apr 23 15:19:21 2010
+++ src/sys/compat/osf1/osf1_socket.c	Sun Nov 15 20:48:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $ */
+/* $NetBSD: osf1_socket.c,v 1.20.14.1 2015/11/15 20:48:49 bouyer Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20.14.1 2015/11/15 20:48:49 bouyer Exp $");
 
 #include 
 #include 
@@ -116,7 +116,7 @@ osf1_sys_sendmsg_xopen(struct lwp *l, co
 		return (EINVAL);
 
 	iov_len = bsd_msghdr.msg_iovlen;
-	if (iov_len > IOV_MAX)
+	if ((iov_len > IOV_MAX) || (iov_len == 0))
 		return EMSGSIZE;
 	bsd_iovec = kmem_alloc(iov_len * sizeof(struct iovec), KM_SLEEP);
 	bsd_msghdr.msg_iov = bsd_iovec;



CVS commit: [netbsd-6-0] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:44 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6-0]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.20.1 src/sys/compat/osf1/osf1_socket.c

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



CVS commit: [netbsd-6-1] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:45 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6-1]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.28.1 src/sys/compat/osf1/osf1_socket.c

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



CVS commit: [netbsd-6] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:49 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.14.1 src/sys/compat/osf1/osf1_socket.c

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



CVS commit: [netbsd-6-0] src/sys/compat/osf1

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:48:44 UTC 2015

Modified Files:
src/sys/compat/osf1 [netbsd-6-0]: osf1_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1338):
sys/compat/osf1/osf1_socket.c: revision 1.21
easy kmem_alloc(0)
ok shm@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.20.1 src/sys/compat/osf1/osf1_socket.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/compat/osf1/osf1_socket.c
diff -u src/sys/compat/osf1/osf1_socket.c:1.20 src/sys/compat/osf1/osf1_socket.c:1.20.20.1
--- src/sys/compat/osf1/osf1_socket.c:1.20	Fri Apr 23 15:19:21 2010
+++ src/sys/compat/osf1/osf1_socket.c	Sun Nov 15 20:48:44 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $ */
+/* $NetBSD: osf1_socket.c,v 1.20.20.1 2015/11/15 20:48:44 bouyer Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20.20.1 2015/11/15 20:48:44 bouyer Exp $");
 
 #include 
 #include 
@@ -116,7 +116,7 @@ osf1_sys_sendmsg_xopen(struct lwp *l, co
 		return (EINVAL);
 
 	iov_len = bsd_msghdr.msg_iovlen;
-	if (iov_len > IOV_MAX)
+	if ((iov_len > IOV_MAX) || (iov_len == 0))
 		return EMSGSIZE;
 	bsd_iovec = kmem_alloc(iov_len * sizeof(struct iovec), KM_SLEEP);
 	bsd_msghdr.msg_iov = bsd_iovec;



CVS commit: [netbsd-6] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:03 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.8.1 src/sys/arch/x86/x86/bus_dma.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/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.68 src/sys/arch/x86/x86/bus_dma.c:1.68.8.1
--- src/sys/arch/x86/x86/bus_dma.c:1.68	Fri Oct 14 18:28:04 2011
+++ src/sys/arch/x86/x86/bus_dma.c	Sun Nov 15 20:52:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.68.8.1 2015/11/15 20:52:03 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68.8.1 2015/11/15 20:52:03 bouyer Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -283,11 +283,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	error = 0;
 	mapsize = sizeof(struct x86_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
-	if ((mapstore = malloc(mapsize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mapstore = malloc(mapsize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL)
 		return (ENOMEM);
 
-	memset(mapstore, 0, mapsize);
 	map = (struct x86_bus_dmamap *)mapstore;
 	map->_dm_size = size;
 	map->_dm_segcnt = nsegments;
@@ -323,12 +322,11 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	/*
 	 * Allocate our cookie.
 	 */
-	if ((cookiestore = malloc(cookiesize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) {
+	if ((cookiestore = malloc(cookiesize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL) {
 		error = ENOMEM;
 		goto out;
 	}
-	memset(cookiestore, 0, cookiesize);
 	cookie = (struct x86_bus_dma_cookie *)cookiestore;
 	cookie->id_flags = cookieflags;
 	map->_dm_cookie = cookie;
@@ -391,6 +389,8 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	}
 	error = _bus_dmamap_load_buffer(t, map, buf, buflen, vm, flags);
 	if (error == 0) {
+		if (cookie != NULL)
+			cookie->id_flags &= ~X86_DMA_IS_BOUNCING;
 		map->dm_mapsize = buflen;
 		return 0;
 	}
@@ -789,7 +789,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 */
 	if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 &&
 	(ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0)
-		panic("_bus_dmamap_sync: mix PRE and POST");
+		panic("%s: mix PRE and POST", __func__);
 
 #ifdef DIAGNOSTIC
 	if ((ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTREAD)) != 0) {
@@ -916,16 +916,17 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	}
 
 	case X86_DMA_BUFTYPE_RAW:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_RAW");
+		panic("%s: X86_DMA_BUFTYPE_RAW", __func__);
 		break;
 
 	case X86_DMA_BUFTYPE_INVALID:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_INVALID");
+		panic("%s: X86_DMA_BUFTYPE_INVALID", __func__);
 		break;
 
 	default:
-		printf("unknown buffer type %d\n", cookie->id_buftype);
-		panic("_bus_dmamap_sync");
+		panic("%s: unknown buffer type %d", __func__,
+		cookie->id_buftype);
+		break;
 	}
 end:
 	if (ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTWRITE)) {
@@ -1233,19 +1234,20 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		curaddr = _BUS_VIRT_TO_BUS(pmap, vaddr);
 
 		/*
+		 * Compute the segment size, and adjust counts.
+		 */
+		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
+		if (buflen < sgsize)
+			sgsize = buflen;
+
+		/*
 		 * If we're beyond the bounce threshold, notify
 		 * the caller.
 		 */
 		if (map->_dm_bounce_thresh != 0 &&
-		curaddr >= map->_dm_bounce_thresh)
+		curaddr + sgsize >= map->_dm_bounce_thresh)
 			return (EINVAL);
 
-		/*
-		 * Compute the segment size, and adjust counts.
-		 */
-		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
-		if (buflen < sgsize)
-			sgsize = buflen;
 
 		error = _bus_dmamap_load_busaddr(t, map, curaddr, sgsize);
 		if (error)



CVS commit: [netbsd-6-0] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:09 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-0]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.14.1 src/sys/arch/x86/x86/bus_dma.c

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



CVS commit: [netbsd-6-0] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:09 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-0]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.14.1 src/sys/arch/x86/x86/bus_dma.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/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.68 src/sys/arch/x86/x86/bus_dma.c:1.68.14.1
--- src/sys/arch/x86/x86/bus_dma.c:1.68	Fri Oct 14 18:28:04 2011
+++ src/sys/arch/x86/x86/bus_dma.c	Sun Nov 15 20:52:09 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.68.14.1 2015/11/15 20:52:09 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68.14.1 2015/11/15 20:52:09 bouyer Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -283,11 +283,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	error = 0;
 	mapsize = sizeof(struct x86_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
-	if ((mapstore = malloc(mapsize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mapstore = malloc(mapsize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL)
 		return (ENOMEM);
 
-	memset(mapstore, 0, mapsize);
 	map = (struct x86_bus_dmamap *)mapstore;
 	map->_dm_size = size;
 	map->_dm_segcnt = nsegments;
@@ -323,12 +322,11 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	/*
 	 * Allocate our cookie.
 	 */
-	if ((cookiestore = malloc(cookiesize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) {
+	if ((cookiestore = malloc(cookiesize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL) {
 		error = ENOMEM;
 		goto out;
 	}
-	memset(cookiestore, 0, cookiesize);
 	cookie = (struct x86_bus_dma_cookie *)cookiestore;
 	cookie->id_flags = cookieflags;
 	map->_dm_cookie = cookie;
@@ -391,6 +389,8 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	}
 	error = _bus_dmamap_load_buffer(t, map, buf, buflen, vm, flags);
 	if (error == 0) {
+		if (cookie != NULL)
+			cookie->id_flags &= ~X86_DMA_IS_BOUNCING;
 		map->dm_mapsize = buflen;
 		return 0;
 	}
@@ -789,7 +789,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 */
 	if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 &&
 	(ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0)
-		panic("_bus_dmamap_sync: mix PRE and POST");
+		panic("%s: mix PRE and POST", __func__);
 
 #ifdef DIAGNOSTIC
 	if ((ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTREAD)) != 0) {
@@ -916,16 +916,17 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	}
 
 	case X86_DMA_BUFTYPE_RAW:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_RAW");
+		panic("%s: X86_DMA_BUFTYPE_RAW", __func__);
 		break;
 
 	case X86_DMA_BUFTYPE_INVALID:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_INVALID");
+		panic("%s: X86_DMA_BUFTYPE_INVALID", __func__);
 		break;
 
 	default:
-		printf("unknown buffer type %d\n", cookie->id_buftype);
-		panic("_bus_dmamap_sync");
+		panic("%s: unknown buffer type %d", __func__,
+		cookie->id_buftype);
+		break;
 	}
 end:
 	if (ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTWRITE)) {
@@ -1233,19 +1234,20 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		curaddr = _BUS_VIRT_TO_BUS(pmap, vaddr);
 
 		/*
+		 * Compute the segment size, and adjust counts.
+		 */
+		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
+		if (buflen < sgsize)
+			sgsize = buflen;
+
+		/*
 		 * If we're beyond the bounce threshold, notify
 		 * the caller.
 		 */
 		if (map->_dm_bounce_thresh != 0 &&
-		curaddr >= map->_dm_bounce_thresh)
+		curaddr + sgsize >= map->_dm_bounce_thresh)
 			return (EINVAL);
 
-		/*
-		 * Compute the segment size, and adjust counts.
-		 */
-		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
-		if (buflen < sgsize)
-			sgsize = buflen;
 
 		error = _bus_dmamap_load_busaddr(t, map, curaddr, sgsize);
 		if (error)



CVS commit: [netbsd-6-1] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:15 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-1]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.16.1 src/sys/arch/x86/x86/bus_dma.c

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



CVS commit: [netbsd-6] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:03 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.8.1 src/sys/arch/x86/x86/bus_dma.c

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



CVS commit: [netbsd-6-1] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:52:15 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-1]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1339):
sys/arch/x86/x86/bus_dma.c: revision 1.72
sys/arch/x86/x86/bus_dma.c: revision 1.73
sys/arch/x86/x86/bus_dma.c: revision 1.74
- If we succeeded allocating a buffer that did not need bouncing before, but
  the buffer in the previous mapping did, clear the bounce bit. Fixes the
  ld_virtio.c bug with machines 8GB and dd if=/dev/zero of=crash bs=1g count=4.
- Allocate with M_ZERO instead of doing memset
- The panic string can take a format, use it.
- When checking for the bounce buffer boundary check addr + len < limit, not
  addr < limit.
make sure we have a cookie before we try to clear it.
fix operator precedence.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.16.1 src/sys/arch/x86/x86/bus_dma.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/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.68 src/sys/arch/x86/x86/bus_dma.c:1.68.16.1
--- src/sys/arch/x86/x86/bus_dma.c:1.68	Fri Oct 14 18:28:04 2011
+++ src/sys/arch/x86/x86/bus_dma.c	Sun Nov 15 20:52:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.68.16.1 2015/11/15 20:52:15 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68.16.1 2015/11/15 20:52:15 bouyer Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -283,11 +283,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	error = 0;
 	mapsize = sizeof(struct x86_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
-	if ((mapstore = malloc(mapsize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mapstore = malloc(mapsize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL)
 		return (ENOMEM);
 
-	memset(mapstore, 0, mapsize);
 	map = (struct x86_bus_dmamap *)mapstore;
 	map->_dm_size = size;
 	map->_dm_segcnt = nsegments;
@@ -323,12 +322,11 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	/*
 	 * Allocate our cookie.
 	 */
-	if ((cookiestore = malloc(cookiesize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) {
+	if ((cookiestore = malloc(cookiesize, M_DMAMAP, M_ZERO |
+	((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK))) == NULL) {
 		error = ENOMEM;
 		goto out;
 	}
-	memset(cookiestore, 0, cookiesize);
 	cookie = (struct x86_bus_dma_cookie *)cookiestore;
 	cookie->id_flags = cookieflags;
 	map->_dm_cookie = cookie;
@@ -391,6 +389,8 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	}
 	error = _bus_dmamap_load_buffer(t, map, buf, buflen, vm, flags);
 	if (error == 0) {
+		if (cookie != NULL)
+			cookie->id_flags &= ~X86_DMA_IS_BOUNCING;
 		map->dm_mapsize = buflen;
 		return 0;
 	}
@@ -789,7 +789,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 */
 	if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 &&
 	(ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0)
-		panic("_bus_dmamap_sync: mix PRE and POST");
+		panic("%s: mix PRE and POST", __func__);
 
 #ifdef DIAGNOSTIC
 	if ((ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTREAD)) != 0) {
@@ -916,16 +916,17 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	}
 
 	case X86_DMA_BUFTYPE_RAW:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_RAW");
+		panic("%s: X86_DMA_BUFTYPE_RAW", __func__);
 		break;
 
 	case X86_DMA_BUFTYPE_INVALID:
-		panic("_bus_dmamap_sync: X86_DMA_BUFTYPE_INVALID");
+		panic("%s: X86_DMA_BUFTYPE_INVALID", __func__);
 		break;
 
 	default:
-		printf("unknown buffer type %d\n", cookie->id_buftype);
-		panic("_bus_dmamap_sync");
+		panic("%s: unknown buffer type %d", __func__,
+		cookie->id_buftype);
+		break;
 	}
 end:
 	if (ops & (BUS_DMASYNC_PREWRITE|BUS_DMASYNC_POSTWRITE)) {
@@ -1233,19 +1234,20 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		curaddr = _BUS_VIRT_TO_BUS(pmap, vaddr);
 
 		/*
+		 * Compute the segment size, and adjust counts.
+		 */
+		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
+		if (buflen < sgsize)
+			sgsize = buflen;
+
+		/*
 		 * If we're beyond the bounce threshold, notify
 		 * the caller.
 		 */
 		if (map->_dm_bounce_thresh != 0 &&
-		curaddr >= map->_dm_bounce_thresh)
+		curaddr + sgsize >= map->_dm_bounce_thresh)
 			return (EINVAL);
 
-		/*
-		 * Compute the segment size, and adjust counts.
-		 */
-		sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
-		if (buflen < sgsize)
-			sgsize = buflen;
 
 		error = _bus_dmamap_load_busaddr(t, map, curaddr, sgsize);
 		if (error)



CVS commit: [netbsd-6-0] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:08 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-0]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/arch/x86/x86/sys_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.25 src/sys/arch/x86/x86/sys_machdep.c:1.25.14.1
--- src/sys/arch/x86/x86/sys_machdep.c:1.25	Mon Oct 10 15:15:28 2011
+++ src/sys/arch/x86/x86/sys_machdep.c	Sun Nov 15 20:57:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.25.14.1 2015/11/15 20:57:08 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25.14.1 2015/11/15 20:57:08 bouyer Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_perfctrs.h"
@@ -657,7 +657,6 @@ x86_set_sdbase(void *arg, char which, lw
 #else
 	struct pcb *pcb;
 	vaddr_t base;
-	int error;
 
 	if (l->l_proc->p_flag & PK_32) {
 		return x86_set_sdbase32(arg, which, l, direct);
@@ -666,7 +665,7 @@ x86_set_sdbase(void *arg, char which, lw
 	if (direct) {
 		base = (vaddr_t)arg;
 	} else {
-		error = copyin(arg, , sizeof(base));
+		int error = copyin(arg, , sizeof(base));
 		if (error != 0)
 			return error;
 	}
@@ -674,10 +673,6 @@ x86_set_sdbase(void *arg, char which, lw
 	if (base >= VM_MAXUSER_ADDRESS)
 		return EINVAL;
 
-	if (error) {
-		return error;
-	}
-
 	pcb = lwp_getpcb(l);
 
 	kpreempt_disable();
@@ -697,7 +692,7 @@ x86_set_sdbase(void *arg, char which, lw
 	}
 	kpreempt_enable();
 
-	return error;
+	return 0;
 #endif
 }
 



CVS commit: [netbsd-6-1] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:11 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-1]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.16.1 src/sys/arch/x86/x86/sys_machdep.c

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



CVS commit: [netbsd-6-1] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:11 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-1]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.16.1 src/sys/arch/x86/x86/sys_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.25 src/sys/arch/x86/x86/sys_machdep.c:1.25.16.1
--- src/sys/arch/x86/x86/sys_machdep.c:1.25	Mon Oct 10 15:15:28 2011
+++ src/sys/arch/x86/x86/sys_machdep.c	Sun Nov 15 20:57:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.25.16.1 2015/11/15 20:57:11 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25.16.1 2015/11/15 20:57:11 bouyer Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_perfctrs.h"
@@ -657,7 +657,6 @@ x86_set_sdbase(void *arg, char which, lw
 #else
 	struct pcb *pcb;
 	vaddr_t base;
-	int error;
 
 	if (l->l_proc->p_flag & PK_32) {
 		return x86_set_sdbase32(arg, which, l, direct);
@@ -666,7 +665,7 @@ x86_set_sdbase(void *arg, char which, lw
 	if (direct) {
 		base = (vaddr_t)arg;
 	} else {
-		error = copyin(arg, , sizeof(base));
+		int error = copyin(arg, , sizeof(base));
 		if (error != 0)
 			return error;
 	}
@@ -674,10 +673,6 @@ x86_set_sdbase(void *arg, char which, lw
 	if (base >= VM_MAXUSER_ADDRESS)
 		return EINVAL;
 
-	if (error) {
-		return error;
-	}
-
 	pcb = lwp_getpcb(l);
 
 	kpreempt_disable();
@@ -697,7 +692,7 @@ x86_set_sdbase(void *arg, char which, lw
 	}
 	kpreempt_enable();
 
-	return error;
+	return 0;
 #endif
 }
 



CVS commit: [netbsd-6] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:03 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/x86/x86/sys_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.25 src/sys/arch/x86/x86/sys_machdep.c:1.25.8.1
--- src/sys/arch/x86/x86/sys_machdep.c:1.25	Mon Oct 10 15:15:28 2011
+++ src/sys/arch/x86/x86/sys_machdep.c	Sun Nov 15 20:57:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.25.8.1 2015/11/15 20:57:03 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25 2011/10/10 15:15:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.25.8.1 2015/11/15 20:57:03 bouyer Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_perfctrs.h"
@@ -657,7 +657,6 @@ x86_set_sdbase(void *arg, char which, lw
 #else
 	struct pcb *pcb;
 	vaddr_t base;
-	int error;
 
 	if (l->l_proc->p_flag & PK_32) {
 		return x86_set_sdbase32(arg, which, l, direct);
@@ -666,7 +665,7 @@ x86_set_sdbase(void *arg, char which, lw
 	if (direct) {
 		base = (vaddr_t)arg;
 	} else {
-		error = copyin(arg, , sizeof(base));
+		int error = copyin(arg, , sizeof(base));
 		if (error != 0)
 			return error;
 	}
@@ -674,10 +673,6 @@ x86_set_sdbase(void *arg, char which, lw
 	if (base >= VM_MAXUSER_ADDRESS)
 		return EINVAL;
 
-	if (error) {
-		return error;
-	}
-
 	pcb = lwp_getpcb(l);
 
 	kpreempt_disable();
@@ -697,7 +692,7 @@ x86_set_sdbase(void *arg, char which, lw
 	}
 	kpreempt_enable();
 
-	return error;
+	return 0;
 #endif
 }
 



CVS commit: [netbsd-6-0] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:08 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6-0]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/arch/x86/x86/sys_machdep.c

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



CVS commit: [netbsd-6] src/sys/arch/x86/x86

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 20:57:03 UTC 2015

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: sys_machdep.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1341):
sys/arch/x86/x86/sys_machdep.c: revision 1.29
fix broken error handling; error was used uninitialized. Changing the
compilation flags broke all threaded programs for me.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/x86/x86/sys_machdep.c

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



CVS commit: [netbsd-6-0] src/sys/arch/sparc64/sparc64

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:01:52 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-0]: locore.s netbsd32_machdep.c
vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1343):
sys/arch/sparc64/sparc64/locore.s: revision 1.386
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.101
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.105
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.106
Basically revert r1.246 of locore.s and r1.73 of vm_machdep.c:
Remove special case handling for userland lwps from cpu_lwp_fork,
instead do it in lwp_trampoline when we first return to userland.
which was a stupid idea - since we did now set all fork child's %tstate
(and thus %pstate when back in userland) to the current kernel's userland
default. This meant we lost the address mask bit for 32bit processes and
all memory model details for 64bit ones.
Move it back to cpu_lwp_fork and fix the condition to only do it once when
forking init.
Fix kmem_free() size mismatch
Convert siginfo to 32bit version before copying it out to 32bit userland.


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.2.4.1 -r1.338.8.2.4.2 \
src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.96.2.1 -r1.96.2.1.4.1 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.98 -r1.98.12.1 src/sys/arch/sparc64/sparc64/vm_machdep.c

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



CVS commit: [netbsd-6-0] src/sys/arch/sparc64/sparc64

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:01:52 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-0]: locore.s netbsd32_machdep.c
vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1343):
sys/arch/sparc64/sparc64/locore.s: revision 1.386
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.101
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.105
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.106
Basically revert r1.246 of locore.s and r1.73 of vm_machdep.c:
Remove special case handling for userland lwps from cpu_lwp_fork,
instead do it in lwp_trampoline when we first return to userland.
which was a stupid idea - since we did now set all fork child's %tstate
(and thus %pstate when back in userland) to the current kernel's userland
default. This meant we lost the address mask bit for 32bit processes and
all memory model details for 64bit ones.
Move it back to cpu_lwp_fork and fix the condition to only do it once when
forking init.
Fix kmem_free() size mismatch
Convert siginfo to 32bit version before copying it out to 32bit userland.


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.2.4.1 -r1.338.8.2.4.2 \
src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.96.2.1 -r1.96.2.1.4.1 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.98 -r1.98.12.1 src/sys/arch/sparc64/sparc64/vm_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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2.4.1 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2.4.2
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.2.4.1	Sat Dec 14 19:33:45 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Sun Nov 15 21:01:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.2.4.1 2013/12/14 19:33:45 bouyer Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.2.4.2 2015/11/15 21:01:52 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -5369,12 +5369,6 @@ ENTRY(lwp_trampoline)
 	 mov	%l1, %o0
 
 	/*
-	 * Going to userland - set proper tstate in trap frame
-	 */
-	set	(ASI_PRIMARY_NO_FAULT<ksi_signo;
 	ucontext32_t uc;
 	struct sparc32_sigframe_siginfo *fp;
+	siginfo32_t si32;	
 	netbsd32_intptr_t catcher;
 	struct trapframe64 *tf = l->l_md.md_tf;
 	struct rwindow32 *oldsp, *newsp;
@@ -342,15 +343,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	else
 		fp = (struct sparc32_sigframe_siginfo *)oldsp;
 	fp = (struct sparc32_sigframe_siginfo*)((u_long)(fp - 1) & ~7);
+
 	/*
 	 * Build the signal context to be used by sigreturn.
 	 */
+	memset(, 0, sizeof uc);
 	uc.uc_flags = _UC_SIGMASK |
 		((l->l_sigstk.ss_flags & SS_ONSTACK)
 			? _UC_SETSTACK : _UC_CLRSTACK);
 	uc.uc_sigmask = *mask;
 	uc.uc_link = (uint32_t)(uintptr_t)l->l_ctxlink;
-	memset(_stack, 0, sizeof(uc.uc_stack));
 
 	sendsig_reset(l, sig);
 
@@ -365,9 +367,10 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	 */
 	mutex_exit(p->p_lock);
 	cpu_getmcontext32(l, _mcontext, _flags);
+	netbsd32_si_to_si32(, (const siginfo_t *)>ksi_info);
 	ucsz = (int)(intptr_t)__uc_pad - (int)(intptr_t)
 	newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
-	error = (copyout(>ksi_info, >sf_si, sizeof ksi->ksi_info) ||
+	error = (copyout(, >sf_si, sizeof si32) ||
 	copyout(, >sf_uc, ucsz) ||
 	suword(>rw_in[6], (intptr_t)oldsp));
 	mutex_enter(p->p_lock);
@@ -1367,7 +1370,8 @@ startlwp32(void *arg)
 	error = cpu_setmcontext32(l, >uc_mcontext, uc->uc_flags);
 	KASSERT(error == 0);
 
-	kmem_free(uc, sizeof(ucontext32_t));
+	/* Note: we are freeing ucontext_t, not ucontext32_t. */
+	kmem_free(arg, sizeof(ucontext_t));
 	userret(l, 0, 0);
 }
 


CVS commit: [netbsd-6] src/sys/arch/sparc64/sparc64

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:02:13 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6]: locore.s netbsd32_machdep.c
vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1343):
sys/arch/sparc64/sparc64/locore.s: revision 1.386
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.101
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.105
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.106
Basically revert r1.246 of locore.s and r1.73 of vm_machdep.c:
Remove special case handling for userland lwps from cpu_lwp_fork,
instead do it in lwp_trampoline when we first return to userland.
which was a stupid idea - since we did now set all fork child's %tstate
(and thus %pstate when back in userland) to the current kernel's userland
default. This meant we lost the address mask bit for 32bit processes and
all memory model details for 64bit ones.
Move it back to cpu_lwp_fork and fix the condition to only do it once when
forking init.
Fix kmem_free() size mismatch
Convert siginfo to 32bit version before copying it out to 32bit userland.


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.6 -r1.338.8.7 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.96.2.1 -r1.96.2.2 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.98 -r1.98.8.1 src/sys/arch/sparc64/sparc64/vm_machdep.c

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



CVS commit: [netbsd-6] src/sys/arch/sparc64/sparc64

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:02:13 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6]: locore.s netbsd32_machdep.c
vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1343):
sys/arch/sparc64/sparc64/locore.s: revision 1.386
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.101
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.105
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.106
Basically revert r1.246 of locore.s and r1.73 of vm_machdep.c:
Remove special case handling for userland lwps from cpu_lwp_fork,
instead do it in lwp_trampoline when we first return to userland.
which was a stupid idea - since we did now set all fork child's %tstate
(and thus %pstate when back in userland) to the current kernel's userland
default. This meant we lost the address mask bit for 32bit processes and
all memory model details for 64bit ones.
Move it back to cpu_lwp_fork and fix the condition to only do it once when
forking init.
Fix kmem_free() size mismatch
Convert siginfo to 32bit version before copying it out to 32bit userland.


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.6 -r1.338.8.7 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.96.2.1 -r1.96.2.2 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.98 -r1.98.8.1 src/sys/arch/sparc64/sparc64/vm_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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.6 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.7
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.6	Tue Mar 24 08:51:14 2015
+++ src/sys/arch/sparc64/sparc64/locore.s	Sun Nov 15 21:02:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.6 2015/03/24 08:51:14 snj Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.7 2015/11/15 21:02:13 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -5368,12 +5368,6 @@ ENTRY(lwp_trampoline)
 	 mov	%l1, %o0
 
 	/*
-	 * Going to userland - set proper tstate in trap frame
-	 */
-	set	(ASI_PRIMARY_NO_FAULT<ksi_signo;
 	ucontext32_t uc;
 	struct sparc32_sigframe_siginfo *fp;
+	siginfo32_t si32;	
 	netbsd32_intptr_t catcher;
 	struct trapframe64 *tf = l->l_md.md_tf;
 	struct rwindow32 *oldsp, *newsp;
@@ -342,15 +343,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	else
 		fp = (struct sparc32_sigframe_siginfo *)oldsp;
 	fp = (struct sparc32_sigframe_siginfo*)((u_long)(fp - 1) & ~7);
+
 	/*
 	 * Build the signal context to be used by sigreturn.
 	 */
+	memset(, 0, sizeof uc);
 	uc.uc_flags = _UC_SIGMASK |
 		((l->l_sigstk.ss_flags & SS_ONSTACK)
 			? _UC_SETSTACK : _UC_CLRSTACK);
 	uc.uc_sigmask = *mask;
 	uc.uc_link = (uint32_t)(uintptr_t)l->l_ctxlink;
-	memset(_stack, 0, sizeof(uc.uc_stack));
 
 	sendsig_reset(l, sig);
 
@@ -365,9 +367,10 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	 */
 	mutex_exit(p->p_lock);
 	cpu_getmcontext32(l, _mcontext, _flags);
+	netbsd32_si_to_si32(, (const siginfo_t *)>ksi_info);
 	ucsz = (int)(intptr_t)__uc_pad - (int)(intptr_t)
 	newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
-	error = (copyout(>ksi_info, >sf_si, sizeof ksi->ksi_info) ||
+	error = (copyout(, >sf_si, sizeof si32) ||
 	copyout(, >sf_uc, ucsz) ||
 	suword(>rw_in[6], (intptr_t)oldsp));
 	mutex_enter(p->p_lock);
@@ -1367,7 +1370,8 @@ startlwp32(void *arg)
 	error = cpu_setmcontext32(l, >uc_mcontext, uc->uc_flags);
 	KASSERT(error == 0);
 
-	kmem_free(uc, sizeof(ucontext32_t));
+	/* Note: we are freeing ucontext_t, not ucontext32_t. */
+	kmem_free(arg, sizeof(ucontext_t));
 	userret(l, 0, 0);
 }
 

Index: src/sys/arch/sparc64/sparc64/vm_machdep.c
diff -u 

CVS commit: [netbsd-6-1] src/sys/arch/sparc64/sparc64

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:02:22 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64 [netbsd-6-1]: locore.s netbsd32_machdep.c
vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1343):
sys/arch/sparc64/sparc64/locore.s: revision 1.386
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.101
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.105
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.106
Basically revert r1.246 of locore.s and r1.73 of vm_machdep.c:
Remove special case handling for userland lwps from cpu_lwp_fork,
instead do it in lwp_trampoline when we first return to userland.
which was a stupid idea - since we did now set all fork child's %tstate
(and thus %pstate when back in userland) to the current kernel's userland
default. This meant we lost the address mask bit for 32bit processes and
all memory model details for 64bit ones.
Move it back to cpu_lwp_fork and fix the condition to only do it once when
forking init.
Fix kmem_free() size mismatch
Convert siginfo to 32bit version before copying it out to 32bit userland.


To generate a diff of this commit:
cvs rdiff -u -r1.338.8.4.2.1 -r1.338.8.4.2.2 \
src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.96.2.1 -r1.96.2.1.6.1 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.98 -r1.98.14.1 src/sys/arch/sparc64/sparc64/vm_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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4.2.1 src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4.2.2
--- src/sys/arch/sparc64/sparc64/locore.s:1.338.8.4.2.1	Sat Dec 14 19:33:54 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Sun Nov 15 21:02:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.338.8.4.2.1 2013/12/14 19:33:54 bouyer Exp $	*/
+/*	$NetBSD: locore.s,v 1.338.8.4.2.2 2015/11/15 21:02:22 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -5372,12 +5372,6 @@ ENTRY(lwp_trampoline)
 	 mov	%l1, %o0
 
 	/*
-	 * Going to userland - set proper tstate in trap frame
-	 */
-	set	(ASI_PRIMARY_NO_FAULT<ksi_signo;
 	ucontext32_t uc;
 	struct sparc32_sigframe_siginfo *fp;
+	siginfo32_t si32;	
 	netbsd32_intptr_t catcher;
 	struct trapframe64 *tf = l->l_md.md_tf;
 	struct rwindow32 *oldsp, *newsp;
@@ -342,15 +343,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	else
 		fp = (struct sparc32_sigframe_siginfo *)oldsp;
 	fp = (struct sparc32_sigframe_siginfo*)((u_long)(fp - 1) & ~7);
+
 	/*
 	 * Build the signal context to be used by sigreturn.
 	 */
+	memset(, 0, sizeof uc);
 	uc.uc_flags = _UC_SIGMASK |
 		((l->l_sigstk.ss_flags & SS_ONSTACK)
 			? _UC_SETSTACK : _UC_CLRSTACK);
 	uc.uc_sigmask = *mask;
 	uc.uc_link = (uint32_t)(uintptr_t)l->l_ctxlink;
-	memset(_stack, 0, sizeof(uc.uc_stack));
 
 	sendsig_reset(l, sig);
 
@@ -365,9 +367,10 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	 */
 	mutex_exit(p->p_lock);
 	cpu_getmcontext32(l, _mcontext, _flags);
+	netbsd32_si_to_si32(, (const siginfo_t *)>ksi_info);
 	ucsz = (int)(intptr_t)__uc_pad - (int)(intptr_t)
 	newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
-	error = (copyout(>ksi_info, >sf_si, sizeof ksi->ksi_info) ||
+	error = (copyout(, >sf_si, sizeof si32) ||
 	copyout(, >sf_uc, ucsz) ||
 	suword(>rw_in[6], (intptr_t)oldsp));
 	mutex_enter(p->p_lock);
@@ -1367,7 +1370,8 @@ startlwp32(void *arg)
 	error = cpu_setmcontext32(l, >uc_mcontext, uc->uc_flags);
 	KASSERT(error == 0);
 
-	kmem_free(uc, sizeof(ucontext32_t));
+	/* Note: we are freeing ucontext_t, not ucontext32_t. */
+	kmem_free(arg, sizeof(ucontext_t));
 	userret(l, 0, 0);
 }
 


CVS commit: [netbsd-6] src/sys/net

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:04:53 UTC 2015

Modified Files:
src/sys/net [netbsd-6]: if_gif.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1344):
sys/net/if_gif.c: revision 1.89
sys/net/if_gif.c: revision 1.90
CID 980463: Provide common error path for rollback. Remove extra check for
success.
correct mistake in previous


To generate a diff of this commit:
cvs rdiff -u -r1.80.8.1 -r1.80.8.2 src/sys/net/if_gif.c

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



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

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:13:29 UTC 2015

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
Tickets #1333 #1334 #1335 #1336 #1338 #1339 #1341 #1343


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/doc/CHANGES-6.1.6

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

Modified files:

Index: src/doc/CHANGES-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.50 src/doc/CHANGES-6.1.6:1.1.2.51
--- src/doc/CHANGES-6.1.6:1.1.2.50	Sun Nov 15 19:19:58 2015
+++ src/doc/CHANGES-6.1.6	Sun Nov 15 21:13:29 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.50 2015/11/15 19:19:58 bouyer Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.51 2015/11/15 21:13:29 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -6747,3 +6747,61 @@ external/bsd/bind/include			patch
 	Update bind to 9.9.7-P3
 	[spz, ticket #1329]
 
+sys/kern/kern_exec.c1.419, 1.420
+sys/kern/kern_exit.c1.246, 1.247
+sys/kern/kern_synch.c1.309
+
+	Various fixes related to proc's SSTOP state, related to wait(2)
+	in the parent, 
+	Fixes PR kern/50298, kern/50318 kern/50300, kern/50308 and kern/50330
+	[pgoyette, ticket #1333]
+
+sys/kern/kern_sig.c1.321
+
+	When delivering a signal, it's possible that the process's state in
+	p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
+	lwp's to stop).  In that case, we don't want to adjust the parent's
+	p_nstopchild count.
+	[pgoyette, ticket #1334]
+
+sys/compat/linux/arch/arm/linux_ptrace.c	1.19
+sys/compat/linux/arch/i386/linux_ptrace.c	1.31
+sys/compat/linux/arch/powerpc/linux_ptrace.c	1.29
+
+	Don't release proc_lock until we're done looking at things that are
+	protected by the lock, particularly p_stat and p_waited.
+	[pgoyette, ticket #1335]
+
+sys/kern/kern_exit.c1.248
+
+	Update value of p_stat before we release the proc_lock.
+	[pgoyette, ticket #1336]
+
+sys/compat/osf1/osf1_socket.c			1.21
+
+	Prevent a kernel panic in osf1's sendmsg().
+	[maxv, ticket #1338]
+
+sys/arch/x86/x86/bus_dma.c			1.72 - 1.74
+
+	- If we succeeded allocating a buffer that did not need bouncing
+	  before, but the buffer in the previous mapping did, clear the bounce
+	  bit. Fixes the ld_virtio.c bug with machines 8GB and
+	  dd if=/dev/zero of=crash bs=1g count=4.
+	- When checking for the bounce buffer boundary check
+	  addr + len < limit, not addr < limit.
+	[christos, ticket #1339]
+
+sys/arch/x86/x86/sys_machdep.c			1.29
+
+	fix broken error handling; error was used uninitialized. Changing the
+	compilation flags broke all threaded programs for me.
+	[christos, ticket #1341]
+
+sys/arch/sparc64/sparc64/locore.s		1.386
+sys/arch/sparc64/sparc64/netbsd32_machdep.c	1.105, 1.106
+sys/arch/sparc64/sparc64/vm_machdep.c		1.101
+
+	Fix various sparc64 compat_netbsd32 issues.
+	[martin, ticket #1343]
+



CVS commit: [netbsd-6] src/sys/net

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:09:37 UTC 2015

Modified Files:
src/sys/net [netbsd-6]: if_gif.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1345):
sys/net/if_gif.c: revision 1.91
sys/net/if_gif.c: revision 1.92
fix panic after "ifconfig gifX tunnel src dst" failed for the reason of address 
pair duplication.
e.g.

# ifconfig gif0 create
# ifconfig gif0 tunnel 192.168.0.1 192.168.0.2
# ifconfig gif0 inet 172.16.0.1/24 172.16.0.2
# route add 10.1.0.0/24 172.16.0.1
# ifconfig gif1 create
# ifconfig gif1 tunnel 192.168.0.1 192.168.0.3
# ifconfig gif0 tunnel 192.168.0.1 192.168.0.3
ifconfig: SIOCSLIFPHYADDR: Can't assign requested address # expected
# ping 10.1.0.1
(panic)

fix CID 980463


To generate a diff of this commit:
cvs rdiff -u -r1.80.8.2 -r1.80.8.3 src/sys/net/if_gif.c

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



CVS commit: [netbsd-6] src/sys/net

2015-11-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 15 21:04:53 UTC 2015

Modified Files:
src/sys/net [netbsd-6]: if_gif.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1344):
sys/net/if_gif.c: revision 1.89
sys/net/if_gif.c: revision 1.90
CID 980463: Provide common error path for rollback. Remove extra check for
success.
correct mistake in previous


To generate a diff of this commit:
cvs rdiff -u -r1.80.8.1 -r1.80.8.2 src/sys/net/if_gif.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_gif.c
diff -u src/sys/net/if_gif.c:1.80.8.1 src/sys/net/if_gif.c:1.80.8.2
--- src/sys/net/if_gif.c:1.80.8.1	Fri Feb  8 20:42:51 2013
+++ src/sys/net/if_gif.c	Sun Nov 15 21:04:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.80.8.1 2013/02/08 20:42:51 riz Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.80.8.2 2015/11/15 21:04:53 bouyer Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.80.8.1 2013/02/08 20:42:51 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.80.8.2 2015/11/15 21:04:53 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "opt_iso.h"
@@ -743,17 +743,24 @@ gif_set_tunnel(struct ifnet *ifp, struct
 #endif
 		}
 
+	osrc = sc->gif_psrc;
+	odst = sc->gif_pdst;
+	sc->gif_psrc = sc->gif_pdst = NULL;
 	sc->gif_si = softint_establish(SOFTINT_NET, gifintr, sc);
 	if (sc->gif_si == NULL) {
 		error = ENOMEM;
-		goto bad;
+		goto rollback;
 	}
 
-	osrc = sc->gif_psrc;
-	sc->gif_psrc = sockaddr_dup(src, M_WAITOK);
+	if ((sc->gif_psrc = sockaddr_dup(src, M_WAITOK)) == NULL) {
+		error = ENOMEM;
+		goto rollback;
+	}
 
-	odst = sc->gif_pdst;
-	sc->gif_pdst = sockaddr_dup(dst, M_WAITOK);
+	if ((sc->gif_pdst = sockaddr_dup(dst, M_WAITOK)) == NULL) {
+		error = ENOMEM;
+		goto rollback;
+	}
 
 	switch (sc->gif_psrc->sa_family) {
 #ifdef INET
@@ -770,33 +777,32 @@ gif_set_tunnel(struct ifnet *ifp, struct
 		error = EINVAL;
 		break;
 	}
-	if (error) {
-		/* rollback */
-		sockaddr_free(sc->gif_psrc);
-		sockaddr_free(sc->gif_pdst);
-		sc->gif_psrc = osrc;
-		sc->gif_pdst = odst;
-		goto bad;
-	}
+	if (error)
+		goto rollback;
 
 	if (osrc)
 		sockaddr_free(osrc);
 	if (odst)
 		sockaddr_free(odst);
 
-	if (sc->gif_psrc && sc->gif_pdst)
-		ifp->if_flags |= IFF_RUNNING;
-	else
-		ifp->if_flags &= ~IFF_RUNNING;
+	ifp->if_flags |= IFF_RUNNING;
 	splx(s);
 
 	return 0;
 
- bad:
+rollback:
+	if (sc->gif_psrc != NULL)
+		sockaddr_free(sc->gif_psrc);
+	if (sc->gif_pdst != NULL)
+		sockaddr_free(sc->gif_pdst);
+	sc->gif_psrc = osrc;
+	sc->gif_pdst = odst;
+bad:
 	if (sc->gif_si) {
 		softint_disestablish(sc->gif_si);
 		sc->gif_si = NULL;
 	}
+
 	if (sc->gif_psrc && sc->gif_pdst)
 		ifp->if_flags |= IFF_RUNNING;
 	else



  1   2   >