Re: CVS commit: [netbsd-8] src

2018-06-14 Thread David H. Gutteridge
On Fri, 2018-06-15 at 11:13 +0900, Masanobu SAITOH wrote:
> On 2018/06/15 10:52, David H. Gutteridge wrote:
> > > 
> > Hello,
> > 
> > This has broken the build for me, presumably because the pcidevs
> > regeneration process didn't happen. I'm getting:
> 
>   Updated. Please retry.

Confirming this is fixed for me now. Thanks!

Dave



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

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 15 02:13:50 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
 Regen for ticket #878.


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.7 -r1.1281.2.8 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.7 -r1.1280.2.8 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1281.2.7 src/sys/dev/pci/pcidevs.h:1.1281.2.8
--- src/sys/dev/pci/pcidevs.h:1.1281.2.7	Thu Jun  7 18:13:38 2018
+++ src/sys/dev/pci/pcidevs.h	Fri Jun 15 02:13:36 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1281.2.7 2018/06/07 18:13:38 martin Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1281.2.8 2018/06/15 02:13:36 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1289.2.7 2018/06/07 18:12:17 martin Exp
+ *	NetBSD: pcidevs,v 1.1289.2.8 2018/06/14 19:57:24 martin Exp
  */
 
 /*
@@ -6516,6 +6516,7 @@
 #define	PCI_PRODUCT_REALTEK_RTS5227	0x5227		/* RTS5227 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTS5229	0x5229		/* RTS5229 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTS5249	0x5249		/* RTS5249 PCI-E Card Reader */
+#define	PCI_PRODUCT_REALTEK_RTS525A	0x525A		/* RTS525A PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8402	0x5286		/* RTL8402 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8411B	0x5287		/* RTL8411B PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8411	0x5289		/* RTL8411 PCI-E Card Reader */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1280.2.7 src/sys/dev/pci/pcidevs_data.h:1.1280.2.8
--- src/sys/dev/pci/pcidevs_data.h:1.1280.2.7	Thu Jun  7 18:13:39 2018
+++ src/sys/dev/pci/pcidevs_data.h	Fri Jun 15 02:13:36 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1280.2.7 2018/06/07 18:13:39 martin Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1280.2.8 2018/06/15 02:13:36 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1289.2.7 2018/06/07 18:12:17 martin Exp
+ *	NetBSD: pcidevs,v 1.1289.2.8 2018/06/14 19:57:24 martin Exp
  */
 
 /*
@@ -11406,436 +11406,438 @@ static const uint16_t pci_products[] = {
 	29725, 16793, 11252, 15400, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTS5249, 
 	29733, 16793, 11252, 15400, 0,
-	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8402, 
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTS525A, 
 	29741, 16793, 11252, 15400, 0,
-	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411B, 
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8402, 
 	29749, 16793, 11252, 15400, 0,
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411B, 
+	29757, 16793, 11252, 15400, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411, 
-	29758, 16793, 11252, 15400, 0,
+	29766, 16793, 11252, 15400, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8029, 
-	29766, 5603, 0,
+	29774, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139D, 
-	29771, 5705, 5603, 0,
+	29779, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8100, 
-	29777, 5705, 5603, 0,
+	29785, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129, 
-	29782, 5705, 5603, 0,
+	29790, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8101E, 
-	29787, 5705, 5603, 0,
+	29795, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8138, 
-	29805, 5705, 5603, 0,
+	29813, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139, 
 	7475, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169SC, 
-	29810, 5618, 5603, 0,
+	29818, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8168, 
-	29824, 5618, 5603, 0,
+	29832, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169, 
-	29834, 5618, 5603, 0,
+	29842, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8188CE, 
-	29844, 4759, 4534, 29854, 16793, 17328, 0,
+	29852, 4759, 4534, 29862, 16793, 17328, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8192CE, 
-	29862, 4759, 4534, 29854, 16793, 17328, 0,
+	29870, 4759, 4534, 29862, 16793, 17328, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8188EE, 
-	29872, 4759, 4534, 29854, 16793, 17328, 0,
+	29880, 4759, 4534, 29862, 16793, 17328, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8180, 
-	29882, 7562, 0,
+	29890, 7562, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8185, 
-	29887, 29892, 0,
+	29895, 29900, 0,
 	PCI_VENDOR_REDHAT, PCI_PRODUCT_REDHAT_PPB, 
-	29904, 8258, 0,
+	29912, 8258, 0,
 	PCI_VENDOR_REDHAT, PCI_PRODUCT_REDHAT_QXL, 
-	29909, 234, 0,
+	29917, 234, 0,
 	

Re: CVS commit: [netbsd-8] src

2018-06-14 Thread Masanobu SAITOH

On 2018/06/15 10:52, David H. Gutteridge wrote:

Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:57:24 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: rtsx.4
src/sys/dev/ic [netbsd-8]: rtsx.c rtsxreg.h rtsxvar.h
src/sys/dev/pci [netbsd-8]: pcidevs rtsx_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #878):

share/man/man4/rtsx.4: revision 1.5
sys/dev/pci/pcidevs: revision 1.1331
sys/dev/ic/rtsxreg.h: revision 1.3
sys/dev/ic/rtsxvar.h: revision 1.3
sys/dev/pci/rtsx_pci.c: revision 1.7
sys/dev/ic/rtsx.c: revision 1.3

add realtek RT525A PCI-E card reader
found in my Dell XPS 15 9550.

rtsx(4): Add support for RT525A, from openbsd.
ok rkujawa

Denote RTS525A, bump date


Hello,

This has broken the build for me, presumably because the pcidevs
regeneration process didn't happen. I'm getting:


 Updated. Please retry.

 

--- rtsx_pci.o ---
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_match':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
   case PCI_PRODUCT_REALTEK_RTS525A:
^
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: note: each
undeclared identifier is reported only once for each function it appears
in
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_attach':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:121:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
   case PCI_PRODUCT_REALTEK_RTS525A:
^
*** [rtsx_pci.o] Error code 1

Regards,

Dave




--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


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

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 15 02:13:50 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
 Regen for ticket #878.


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.7 -r1.1281.2.8 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.7 -r1.1280.2.8 src/sys/dev/pci/pcidevs_data.h

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



Re: CVS commit: [netbsd-8] src

2018-06-14 Thread Paul Goyette
Looks like someone also needs to pullup the pcidevs database, and the 
two files that are generated from it.


On Thu, 14 Jun 2018, David H. Gutteridge wrote:


Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:57:24 UTC 2018

Modified Files:
   src/share/man/man4 [netbsd-8]: rtsx.4
   src/sys/dev/ic [netbsd-8]: rtsx.c rtsxreg.h rtsxvar.h
   src/sys/dev/pci [netbsd-8]: pcidevs rtsx_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #878):

   share/man/man4/rtsx.4: revision 1.5
   sys/dev/pci/pcidevs: revision 1.1331
   sys/dev/ic/rtsxreg.h: revision 1.3
   sys/dev/ic/rtsxvar.h: revision 1.3
   sys/dev/pci/rtsx_pci.c: revision 1.7
   sys/dev/ic/rtsx.c: revision 1.3

add realtek RT525A PCI-E card reader
found in my Dell XPS 15 9550.

rtsx(4): Add support for RT525A, from openbsd.
ok rkujawa

Denote RTS525A, bump date


Hello,

This has broken the build for me, presumably because the pcidevs
regeneration process didn't happen. I'm getting:

--- rtsx_pci.o ---
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_match':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
 case PCI_PRODUCT_REALTEK_RTS525A:
  ^
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: note: each
undeclared identifier is reported only once for each function it appears
in
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_attach':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:121:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
 case PCI_PRODUCT_REALTEK_RTS525A:
  ^
*** [rtsx_pci.o] Error code 1

Regards,

Dave


!DSPAM:5b231bed38441401249111!




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


Re: CVS commit: [netbsd-8] src

2018-06-14 Thread David H. Gutteridge
>Module Name:src
>Committed By:   martin
>Date:   Thu Jun 14 19:57:24 UTC 2018
>
>Modified Files:
>src/share/man/man4 [netbsd-8]: rtsx.4
>src/sys/dev/ic [netbsd-8]: rtsx.c rtsxreg.h rtsxvar.h
>src/sys/dev/pci [netbsd-8]: pcidevs rtsx_pci.c
>
>Log Message:
>Pull up following revision(s) (requested by maya in ticket #878):
>
>share/man/man4/rtsx.4: revision 1.5
>sys/dev/pci/pcidevs: revision 1.1331
>sys/dev/ic/rtsxreg.h: revision 1.3
>sys/dev/ic/rtsxvar.h: revision 1.3
>sys/dev/pci/rtsx_pci.c: revision 1.7
>sys/dev/ic/rtsx.c: revision 1.3
>
>add realtek RT525A PCI-E card reader
>found in my Dell XPS 15 9550.
>
>rtsx(4): Add support for RT525A, from openbsd.
>ok rkujawa
>
>Denote RTS525A, bump date

Hello,

This has broken the build for me, presumably because the pcidevs
regeneration process didn't happen. I'm getting:

--- rtsx_pci.o ---
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_match':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
  case PCI_PRODUCT_REALTEK_RTS525A:
   ^
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:82:7: note: each
undeclared identifier is reported only once for each function it appears
in
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c: In function
'rtsx_pci_attach':
/home/disciple/netbsd-8/src/sys/dev/pci/rtsx_pci.c:121:7: error:
'PCI_PRODUCT_REALTEK_RTS525A' undeclared (first use in this function)
  case PCI_PRODUCT_REALTEK_RTS525A:
   ^
*** [rtsx_pci.o] Error code 1

Regards,

Dave



CVS commit: src/sys/dev/pci

2018-06-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jun 15 01:37:40 UTC 2018

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Fix queue address setup bug introduced in 1.31.

This use-before-initialization problem resulted in non-zero queues never
being initialized with their virtqueue pointer, and queue zero's pointer
to be clobbered with the virtqueue pointer for the higest-indexed ring.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/virtio.c

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



CVS commit: src/sys/dev/pci

2018-06-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jun 15 01:37:40 UTC 2018

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Fix queue address setup bug introduced in 1.31.

This use-before-initialization problem resulted in non-zero queues never
being initialized with their virtqueue pointer, and queue zero's pointer
to be clobbered with the virtqueue pointer for the higest-indexed ring.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/virtio.c

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

Modified files:

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.33 src/sys/dev/pci/virtio.c:1.34
--- src/sys/dev/pci/virtio.c:1.33	Wed Jun  6 17:17:31 2018
+++ src/sys/dev/pci/virtio.c	Fri Jun 15 01:37:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.33 2018/06/06 17:17:31 jakllsch Exp $	*/
+/*	$NetBSD: virtio.c,v 1.34 2018/06/15 01:37:40 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.33 2018/06/06 17:17:31 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.34 2018/06/15 01:37:40 jakllsch Exp $");
 
 #include 
 #include 
@@ -404,7 +404,7 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	}
 
 	/* set the vq address */
-	sc->sc_ops->setup_queue(sc, vq->vq_index,
+	sc->sc_ops->setup_queue(sc, index,
 	vq->vq_dmamap->dm_segs[0].ds_addr / VIRTIO_PAGE_SIZE);
 
 	/* remember addresses and offsets for later use */
@@ -449,7 +449,7 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	return 0;
 
 err:
-	sc->sc_ops->setup_queue(sc, vq->vq_index, 0);
+	sc->sc_ops->setup_queue(sc, index, 0);
 	if (vq->vq_dmamap)
 		bus_dmamap_destroy(sc->sc_dmat, vq->vq_dmamap);
 	if (vq->vq_vaddr)



CVS commit: src/external/bsd/cron/dist

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 22:04:28 UTC 2018

Modified Files:
src/external/bsd/cron/dist: do_command.c entry.c funcs.h popen.c
structs.h

Log Message:
Add -n (don't send mail if command exited normally) option. From OpenBSD via
Job Snidjers.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/cron/dist/do_command.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/entry.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/cron/dist/funcs.h \
src/external/bsd/cron/dist/popen.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/structs.h

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



CVS commit: src/external/bsd/cron/dist

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 22:04:28 UTC 2018

Modified Files:
src/external/bsd/cron/dist: do_command.c entry.c funcs.h popen.c
structs.h

Log Message:
Add -n (don't send mail if command exited normally) option. From OpenBSD via
Job Snidjers.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/cron/dist/do_command.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/entry.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/cron/dist/funcs.h \
src/external/bsd/cron/dist/popen.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/structs.h

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/cron/dist/do_command.c
diff -u src/external/bsd/cron/dist/do_command.c:1.12 src/external/bsd/cron/dist/do_command.c:1.13
--- src/external/bsd/cron/dist/do_command.c:1.12	Sat Feb  3 22:37:59 2018
+++ src/external/bsd/cron/dist/do_command.c	Thu Jun 14 18:04:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: do_command.c,v 1.12 2018/02/04 03:37:59 christos Exp $	*/
+/*	$NetBSD: do_command.c,v 1.13 2018/06/14 22:04:28 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: do_command.c,v 1.9 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: do_command.c,v 1.12 2018/02/04 03:37:59 christos Exp $");
+__RCSID("$NetBSD: do_command.c,v 1.13 2018/06/14 22:04:28 christos Exp $");
 #endif
 #endif
 
@@ -50,7 +50,9 @@ do_command(entry *e, user *u) {
 	 * vfork() is unsuitable, since we have much to do, and the parent
 	 * needs to be able to run off and fork other processes.
 	 */
-	switch (fork()) {
+
+	pid_t	jobpid;
+	switch (jobpid = fork()) {
 	case -1:
 		log_it("CRON", getpid(), "error", "can't fork");
 		break;
@@ -144,7 +146,7 @@ write_data(char *volatile input_data, in
 
 static int
 read_data(entry *e, const char *mailto, const char *usernm, char **envp,
-int *stdout_pipe)
+int *stdout_pipe, pid_t jobpid)
 {
 	FILE	*in = fdopen(stdout_pipe[READ_PIPE], "r");
 	FILE	*mail = NULL;
@@ -241,14 +243,43 @@ read_data(entry *e, const char *mailto, 
 	 */
 
 	if (mailto) {
-		Debug(DPROC, ("[%ld] closing pipe to mail\n", (long)getpid()));
-		/* Note: the pclose will probably see
-		 * the termination of the grandchild
-		 * in addition to the mail process, since
-		 * it (the grandchild) is likely to exit
-		 * after closing its stdout.
-		 */
-		status = cron_pclose(mail);
+		if (e->flags & MAIL_WHEN_ERR) {
+			int jstatus = -1;
+			if (jobpid <= 0)
+log_it("CRON", getpid(), "error",
+"no job pid");
+			else {
+while (waitpid(jobpid, , WNOHANG) == -1)
+	if (errno != EINTR) {
+		log_it("CRON", getpid(),
+		"error", "no job pid");
+		break;
+	}
+			}
+			/* If everything went well, and -n was set, _and_ we
+			 * have mail, we won't be mailing... so shoot the
+			 * messenger!
+			 */
+			if (WIFEXITED(jstatus) && WEXITSTATUS(jstatus) == 0) {
+Debug(DPROC, ("[%ld] aborting pipe to mail\n",
+(long)getpid()));
+status = cron_pabort(mail);
+mailto = NULL;
+			}
+		}
+
+		if (mailto) {
+			Debug(DPROC, ("[%ld] closing pipe to mail\n",
+			(long)getpid()));
+			/* Note: the pclose will probably see
+			 * the termination of the grandchild
+			 * in addition to the mail process, since
+			 * it (the grandchild) is likely to exit
+			 * after closing its stdout.
+			 */
+			status = cron_pclose(mail);
+			mail = NULL;
+		}
 		(void) signal(SIGCHLD, oldchld);
 	}
 
@@ -273,15 +304,16 @@ out:
 extern char **environ;
 static int
 exec_user_command(entry *e, char **envp, char *usernm, int *stdin_pipe,
-int *stdout_pipe)
+int *stdout_pipe, pid_t *jobpid)
 {
 	char *homedir;
-	char * volatile *ep = envp;
+	char * volatile *ep;
 
-	switch (vfork()) {
+	switch (*jobpid = vfork()) {
 	case -1:
 		return -1;
 	case 0:
+		ep = envp;
 		Debug(DPROC, ("[%ld] grandchild process vfork()'ed\n",
 			  (long)getpid()));
 
@@ -455,6 +487,7 @@ child_process(entry *e) {
 	struct sigaction sact;
 	char **envp = e->envp;
 	int retval = OK_EXIT;
+	pid_t jobpid = 0;
 
 	Debug(DPROC, ("[%ld] child_process('%s')\n", (long)getpid(), e->cmd));
 
@@ -538,7 +571,8 @@ child_process(entry *e) {
 
 	/* fork again, this time so we can exec the user's command.
 	 */
-	if (exec_user_command(e, envp, usernm, stdin_pipe, stdout_pipe) == -1) {
+	if (exec_user_command(e, envp, usernm, stdin_pipe, stdout_pipe,
+	) == -1) {
 		retval = ERROR_EXIT;
 		goto child_process_end;
 	}
@@ -595,7 +629,7 @@ child_process(entry *e) {
 	Debug(DPROC, ("[%ld] child reading output from grandchild\n",
 		  (long)getpid()));
 
-	retval = read_data(e, mailto, usernm, envp, stdout_pipe);
+	retval = read_data(e, mailto, usernm, envp, stdout_pipe, jobpid);
 	if (retval)
 		goto child_process_end;
 

Index: src/external/bsd/cron/dist/entry.c
diff 

CVS commit: src/external/bsd/cron/dist

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 22:02:57 UTC 2018

Modified Files:
src/external/bsd/cron/dist: crontab.5

Log Message:
Replace with the OpenBSD man page. It removes some historical comparisons
that are not very useful (and trully if any they belong to a separate section
instead of being interspersed in the document), and organizes and formats
the information better.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/cron/dist/crontab.5

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/cron/dist/crontab.5
diff -u src/external/bsd/cron/dist/crontab.5:1.5 src/external/bsd/cron/dist/crontab.5:1.6
--- src/external/bsd/cron/dist/crontab.5:1.5	Tue Mar 18 14:20:36 2014
+++ src/external/bsd/cron/dist/crontab.5	Thu Jun 14 18:02:57 2018
@@ -1,25 +1,27 @@
-.\"	$NetBSD: crontab.5,v 1.5 2014/03/18 18:20:36 riastradh Exp $
+.\" $NetBSD: crontab.5,v 1.6 2018/06/14 22:02:57 christos Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
-.\" *
-.\" * Distribute freely, except: don't remove my name from the source or
-.\" * documentation (don't take credit for my work), mark your changes (don't
-.\" * get me blamed for your possible bugs), don't alter or remove this
-.\" * notice.  May be sold if buildable source is provided to buyer.  No
-.\" * warrantee of any kind, express or implied, is included with this
-.\" * software; use at your own risk, responsibility for damages (if any) to
-.\" * anyone resulting from the use of this software rests entirely with the
-.\" * user.
-.\" *
-.\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
-.\" * I'll try to keep a version up to date.  I can be reached as follows:
-.\" * Paul Vixieuunet!decwrl!vixie!paul
 .\" */
 .\"
-.\" Id: crontab.5,v 2.4 1994/01/15 20:43:43 vixie Exp
+.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
 .\"
-.Dd July 15, 2010
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.\" $OpenBSD: crontab.5,v 1.36 2018/06/13 13:27:37 jmc Exp $
+.\"
+.Dd June 14 2018
 .Dt CRONTAB 5
 .Os
 .Sh NAME
@@ -31,274 +33,302 @@ A
 file contains instructions to the
 .Xr cron 8
 daemon of the general form:
-.Dq run this command at this time on this date .
-Each user has their own crontab, and commands in any given crontab
-will be executed as the user who owns the crontab.
-Uucp and News will usually have their own crontabs, eliminating
-the need for explicitly running
-.Xr su 1
-as part of a cron command.
-.Pp
-Blank lines and leading spaces and tabs are ignored.
-Lines whose first non-space character is a pound-sign
-.Pq Sq #
+.Dq at these times on these dates run this command .
+There may be a system
+.Nm
+and each user may have their own
+.Nm .
+Commands in any given
+.Nm
+will be
+executed either as the user who owns the
+.Nm
+or, in the case of the system
+.Nm crontab ,
+as the user specified on the command line.
+.Pp
+While a
+.Nm
+is a text file, it is not intended to be directly edited.
+Creation, modification, and removal of a
+.Nm
+should be done using
+.Xr crontab 1 .
+.Pp
+Blank lines, leading spaces, and tabs are ignored.
+Lines whose first non-space character is a pound sign
+.Pq Ql #
 are comments, and are ignored.
-Note that comments are not allowed on the same line as cron commands, since
+Note that comments are not allowed on the same line as
+.Xr cron 8
+commands, since
 they will be taken to be part of the command.
 Similarly, comments are not
 allowed on the same line as environment variable settings.
 .Pp
-An active line in a crontab will be either an environment setting
-or a cron command.
-An environment setting is of the form,
-.Bd -literal
-name = value
-.Ed
-where the spaces around the equal-sign
-.Pq Sq =
+An active line in a
+.Nm
+is either an environment variable setting or a
+.Xr cron 8
+command.
+.Pp
+Environment variable settings create the environment
+any command in the
+.Nm
+is run in.
+An environment variable setting is of the form:
+.Pp
+.Dl name = value
+.Pp
+The spaces around the equal sign
+.Pq Ql =
 are optional, and any 

CVS commit: src/external/bsd/cron/dist

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 22:02:57 UTC 2018

Modified Files:
src/external/bsd/cron/dist: crontab.5

Log Message:
Replace with the OpenBSD man page. It removes some historical comparisons
that are not very useful (and trully if any they belong to a separate section
instead of being interspersed in the document), and organizes and formats
the information better.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/cron/dist/crontab.5

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



CVS commit: src/tests/lib/libm

2018-06-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 14 21:57:25 UTC 2018

Modified Files:
src/tests/lib/libm: t_ilogb.c

Log Message:
for consistency, print the statement that is true in the error case.
also add missing closing paren


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_ilogb.c

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



CVS commit: src/tests/lib/libm

2018-06-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 14 21:57:25 UTC 2018

Modified Files:
src/tests/lib/libm: t_ilogb.c

Log Message:
for consistency, print the statement that is true in the error case.
also add missing closing paren


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_ilogb.c

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

Modified files:

Index: src/tests/lib/libm/t_ilogb.c
diff -u src/tests/lib/libm/t_ilogb.c:1.8 src/tests/lib/libm/t_ilogb.c:1.9
--- src/tests/lib/libm/t_ilogb.c:1.8	Thu Jun 14 21:11:08 2018
+++ src/tests/lib/libm/t_ilogb.c	Thu Jun 14 21:57:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $ */
+/* $NetBSD: t_ilogb.c,v 1.9 2018/06/14 21:57:25 maya Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $");
+__RCSID("$NetBSD: t_ilogb.c,v 1.9 2018/06/14 21:57:25 maya Exp $");
 
 #include 
 #include 
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_ilogb.c,v 1.8 2018/0
 # define ATF_CHECK_RAISED_INVALID do { \
 	int r = fetestexcept(FE_ALL_EXCEPT); \
 	ATF_CHECK_MSG((r & FE_INVALID) != 0, \
-	"r & FE_INVALID !=0 (r=%#x, FE_INVALID=%#x\n", \
+	"r & FE_INVALID == 0 (r=%#x, FE_INVALID=%#x)\n", \
 	 r, FE_INVALID); \
 	(void)feclearexcept(FE_ALL_EXCEPT); \
 } while (/*CONSTCOND*/0)



CVS commit: src/tests/lib/libm

2018-06-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 14 21:11:08 UTC 2018

Modified Files:
src/tests/lib/libm: t_ilogb.c

Log Message:
Test for FE_INVALID in a way that works for powerpc too.

powerpc seems to return FE_INVALID | FE_VXSOFT rather than just FE_INVALID.
XXX need extra careful reading of standards


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_ilogb.c

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



CVS commit: src/tests/lib/libm

2018-06-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jun 14 21:11:08 UTC 2018

Modified Files:
src/tests/lib/libm: t_ilogb.c

Log Message:
Test for FE_INVALID in a way that works for powerpc too.

powerpc seems to return FE_INVALID | FE_VXSOFT rather than just FE_INVALID.
XXX need extra careful reading of standards


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_ilogb.c

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

Modified files:

Index: src/tests/lib/libm/t_ilogb.c
diff -u src/tests/lib/libm/t_ilogb.c:1.7 src/tests/lib/libm/t_ilogb.c:1.8
--- src/tests/lib/libm/t_ilogb.c:1.7	Fri Jan 13 19:23:40 2017
+++ src/tests/lib/libm/t_ilogb.c	Thu Jun 14 21:11:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ilogb.c,v 1.7 2017/01/13 19:23:40 christos Exp $ */
+/* $NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_ilogb.c,v 1.7 2017/01/13 19:23:40 christos Exp $");
+__RCSID("$NetBSD: t_ilogb.c,v 1.8 2018/06/14 21:11:08 maya Exp $");
 
 #include 
 #include 
@@ -44,7 +44,9 @@ __RCSID("$NetBSD: t_ilogb.c,v 1.7 2017/0
 #else
 # define ATF_CHECK_RAISED_INVALID do { \
 	int r = fetestexcept(FE_ALL_EXCEPT); \
-	ATF_CHECK_MSG(r == FE_INVALID, "r=%#x != %#x\n", r, FE_INVALID); \
+	ATF_CHECK_MSG((r & FE_INVALID) != 0, \
+	"r & FE_INVALID !=0 (r=%#x, FE_INVALID=%#x\n", \
+	 r, FE_INVALID); \
 	(void)feclearexcept(FE_ALL_EXCEPT); \
 } while (/*CONSTCOND*/0)
 



CVS commit: [netbsd-8] src/doc

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:11:02 UTC 2018

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

Log Message:
Tickets #877, #878, #879, #880, #881


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

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



CVS commit: [netbsd-8] src/doc

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:11:02 UTC 2018

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

Log Message:
Tickets #877, #878, #879, #880, #881


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.210 src/doc/CHANGES-8.0:1.1.2.211
--- src/doc/CHANGES-8.0:1.1.2.210	Tue Jun 12 16:36:26 2018
+++ src/doc/CHANGES-8.0	Thu Jun 14 20:11:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.210 2018/06/12 16:36:26 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.211 2018/06/14 20:11:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -13890,3 +13890,35 @@ tests/net/if_vlan/t_vlan.sh			1.9
 	PR kern/53357.
 	[ozaki-r, ticket #876]
 
+usr.sbin/user/user.c1.132
+
+	Fix handling of homeperm values in usermgmt.conf.
+	[zafer, ticket #877]
+
+share/man/man4/rtsx.41.5
+sys/dev/ic/rtsx.c1.3
+sys/dev/ic/rtsxreg.h1.3
+sys/dev/ic/rtsxvar.h1.3
+sys/dev/pci/pcidevs1.1331
+sys/dev/pci/rtsx_pci.c1.7
+
+	rtsx(4): Add support for RT525A.
+	[maya, ticket #878]
+
+sys/kern/subr_workqueue.c			1.37
+
+	Don't wait on workqueue_wait if called from worker itself.
+	[ozaki-r, ticket #879]
+
+sys/arch/macppc/conf/std.macppc			1.24
+
+	Set options ADBKBD_EMUL_USB by default, to allow co-existances
+	of ADB and USB keyboards.
+	[macallan, ticket #880]
+
+share/mk/bsd.sys.mk1.280, 1.281
+
+	Fix MKREPRO for more objdir variations.
+	[christos, ticket #881]
+
+



CVS commit: [netbsd-8] src/share/mk

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:08:37 UTC 2018

Modified Files:
src/share/mk [netbsd-8]: bsd.sys.mk

Log Message:
Pull up the following revisions, requestes by christos in ticket #881:

share/mk/bsd.sys.mk revision 1.280, 1.281

Create NETBSDOBJDIR to handle MAKEOBJDIRPREFIX, since that prepends the
prefix to the whole path.
Mention that we cannot handle MAKEOBJDIR

 -

Handle more objdir variations for MKREPRO (untested)


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

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.271.4.1 src/share/mk/bsd.sys.mk:1.271.4.2
--- src/share/mk/bsd.sys.mk:1.271.4.1	Thu Jun  7 15:59:27 2018
+++ src/share/mk/bsd.sys.mk	Thu Jun 14 20:08:36 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.271.4.1 2018/06/07 15:59:27 martin Exp $
+#	$NetBSD: bsd.sys.mk,v 1.271.4.2 2018/06/14 20:08:36 martin Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -26,11 +26,19 @@ REPROFLAGS+=	-fdebug-prefix-map=\$$DESTD
 CPPFLAGS+=	-Wp,-fno-canonical-system-headers
 CPPFLAGS+=	-Wp,-iremap,${NETBSDSRCDIR}:/usr/src
 CPPFLAGS+=	-Wp,-iremap,${X11SRCDIR}:/usr/xsrc
+
 REPROFLAGS+=	-fdebug-prefix-map=\$$NETBSDSRCDIR=/usr/src
 REPROFLAGS+=	-fdebug-prefix-map=\$$X11SRCDIR=/usr/xsrc
+.if defined(MAKEOBJDIRPREFIX)
+NETBSDOBJDIR=	${MAKEOBJDIRPREFIX}${NETBSDSRCDIR}
+.export NETBSDOBJDIR
+REPROFLAGS+=	-fdebug-prefix-map=\$$NETBSDOBJDIR=/usr/obj
+.endif
+
 LINTFLAGS+=	-R${NETBSDSRCDIR}=/usr/src -R${X11SRCDIR}=/usr/xsrc
 LINTFLAGS+=	-R${DESTDIR}=
 
+# XXX: Cannot handle MAKEOBJDIR, yet.
 REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj$$=/usr/obj/\1'
 REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj/(.*)=/usr/obj/\1/\2'
 REPROFLAGS+=	-fdebug-regex-map='/usr/src/(.*)/obj\..*=/usr/obj/\1'



CVS commit: [netbsd-8] src/share/mk

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:08:37 UTC 2018

Modified Files:
src/share/mk [netbsd-8]: bsd.sys.mk

Log Message:
Pull up the following revisions, requestes by christos in ticket #881:

share/mk/bsd.sys.mk revision 1.280, 1.281

Create NETBSDOBJDIR to handle MAKEOBJDIRPREFIX, since that prepends the
prefix to the whole path.
Mention that we cannot handle MAKEOBJDIR

 -

Handle more objdir variations for MKREPRO (untested)


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

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



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:01:28 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-8]: std.macppc

Log Message:
Pull up following revision(s) (requested by macallan in ticket #880):

sys/arch/macppc/conf/std.macppc: revision 1.24

set options ADBKBD_EMUL_USB by default

With this ADB and USB keyboards can coexist on the same mux, as needed by
built-in Bluetooth modules on some *Books

should fix PR53351


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.58.1 src/sys/arch/macppc/conf/std.macppc

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



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:01:28 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-8]: std.macppc

Log Message:
Pull up following revision(s) (requested by macallan in ticket #880):

sys/arch/macppc/conf/std.macppc: revision 1.24

set options ADBKBD_EMUL_USB by default

With this ADB and USB keyboards can coexist on the same mux, as needed by
built-in Bluetooth modules on some *Books

should fix PR53351


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.58.1 src/sys/arch/macppc/conf/std.macppc

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/macppc/conf/std.macppc
diff -u src/sys/arch/macppc/conf/std.macppc:1.23 src/sys/arch/macppc/conf/std.macppc:1.23.58.1
--- src/sys/arch/macppc/conf/std.macppc:1.23	Thu Dec 11 05:42:18 2008
+++ src/sys/arch/macppc/conf/std.macppc	Thu Jun 14 20:01:28 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.macppc,v 1.23 2008/12/11 05:42:18 alc Exp $
+#	$NetBSD: std.macppc,v 1.23.58.1 2018/06/14 20:01:28 martin Exp $
 #
 # Standard/required options for NetBSD/macppc.
 
@@ -17,5 +17,10 @@ options 	EXEC_SCRIPT	# shell script supp
 
 options 	INTSTK=0x2000
 
+# some *Books have both ADB keyboards and Bluetooth modules which pose as USB
+# HID devices - for them to coexist on the same mux we tell the adbkbd driver
+# pose as a USB keyboard
+options 	ADBKBD_EMUL_USB
+
 # Atheros HAL options
 include "external/isc/atheros_hal/conf/std.ath_hal"



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:59:18 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: subr_workqueue.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #879):

sys/kern/subr_workqueue.c: revision 1.37

Don't wait on workqueue_wait if called from worker itself

Otherwise workqueue_wait never return in such a case.  This treatment
is the same as callout_halt.


To generate a diff of this commit:
cvs rdiff -u -r1.33.30.2 -r1.33.30.3 src/sys/kern/subr_workqueue.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/subr_workqueue.c
diff -u src/sys/kern/subr_workqueue.c:1.33.30.2 src/sys/kern/subr_workqueue.c:1.33.30.3
--- src/sys/kern/subr_workqueue.c:1.33.30.2	Mon Feb  5 14:55:16 2018
+++ src/sys/kern/subr_workqueue.c	Thu Jun 14 19:59:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_workqueue.c,v 1.33.30.2 2018/02/05 14:55:16 martin Exp $	*/
+/*	$NetBSD: subr_workqueue.c,v 1.33.30.3 2018/06/14 19:59:18 martin Exp $	*/
 
 /*-
  * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.33.30.2 2018/02/05 14:55:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.33.30.3 2018/06/14 19:59:18 martin Exp $");
 
 #include 
 #include 
@@ -286,6 +286,8 @@ workqueue_q_wait(struct workqueue_queue 
 	bool found = false;
 
 	mutex_enter(>q_mutex);
+	if (q->q_worker == curlwp)
+		goto out;
 again:
 	SIMPLEQ_FOREACH(wk, >q_queue_pending, wk_entry) {
 		if (wk == wk_target)
@@ -305,6 +307,7 @@ workqueue_q_wait(struct workqueue_queue 
 	}
 	if (q->q_waiter != NULL)
 		q->q_waiter = NULL;
+out:
 	mutex_exit(>q_mutex);
 
 	return found;



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:59:18 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: subr_workqueue.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #879):

sys/kern/subr_workqueue.c: revision 1.37

Don't wait on workqueue_wait if called from worker itself

Otherwise workqueue_wait never return in such a case.  This treatment
is the same as callout_halt.


To generate a diff of this commit:
cvs rdiff -u -r1.33.30.2 -r1.33.30.3 src/sys/kern/subr_workqueue.c

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



CVS commit: [netbsd-8] src

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:57:24 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: rtsx.4
src/sys/dev/ic [netbsd-8]: rtsx.c rtsxreg.h rtsxvar.h
src/sys/dev/pci [netbsd-8]: pcidevs rtsx_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #878):

share/man/man4/rtsx.4: revision 1.5
sys/dev/pci/pcidevs: revision 1.1331
sys/dev/ic/rtsxreg.h: revision 1.3
sys/dev/ic/rtsxvar.h: revision 1.3
sys/dev/pci/rtsx_pci.c: revision 1.7
sys/dev/ic/rtsx.c: revision 1.3

add realtek RT525A PCI-E card reader
found in my Dell XPS 15 9550.

rtsx(4): Add support for RT525A, from openbsd.
ok rkujawa

Denote RTS525A, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 src/share/man/man4/rtsx.4
cvs rdiff -u -r1.2 -r1.2.12.1 src/sys/dev/ic/rtsx.c src/sys/dev/ic/rtsxreg.h \
src/sys/dev/ic/rtsxvar.h
cvs rdiff -u -r1.1289.2.7 -r1.1289.2.8 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/dev/pci/rtsx_pci.c

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/rtsx.4
diff -u src/share/man/man4/rtsx.4:1.4 src/share/man/man4/rtsx.4:1.4.8.1
--- src/share/man/man4/rtsx.4:1.4	Wed Oct 29 14:33:23 2014
+++ src/share/man/man4/rtsx.4	Thu Jun 14 19:57:23 2018
@@ -1,10 +1,10 @@
-.\"	$NetBSD: rtsx.4,v 1.4 2014/10/29 14:33:23 nonaka Exp $
+.\"	$NetBSD: rtsx.4,v 1.4.8.1 2018/06/14 19:57:23 martin Exp $
 .\"	$OpenBSD: rtsx.4,v 1.6 2014/05/18 10:52:17 stsp Exp $
 .\"
 .\" Theo de Raadt, 2006. Public Domain.
 .\" Stefan Sperling, 2012. Public Domain.
 .\"
-.Dd October 29, 2014
+.Dd April 24, 2018
 .Dt RTSX 4
 .Os
 .Sh NAME
@@ -17,7 +17,7 @@
 The
 .Nm
 driver provides support for the Realtek RTS5209, RTS5227, RTS5229,
-RTL8402, RTL8411 and RTL8411B SD card readers.
+RTS525A, RTL8402, RTL8411 and RTL8411B SD card readers.
 .Pp
 The
 .Xr sdmmc 4

Index: src/sys/dev/ic/rtsx.c
diff -u src/sys/dev/ic/rtsx.c:1.2 src/sys/dev/ic/rtsx.c:1.2.12.1
--- src/sys/dev/ic/rtsx.c:1.2	Wed Oct 29 14:24:09 2014
+++ src/sys/dev/ic/rtsx.c	Thu Jun 14 19:57:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsx.c,v 1.2 2014/10/29 14:24:09 nonaka Exp $	*/
+/*	$NetBSD: rtsx.c,v 1.2.12.1 2018/06/14 19:57:24 martin Exp $	*/
 /*	$OpenBSD: rtsx.c,v 1.10 2014/08/19 17:55:03 phessler Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.2 2014/10/29 14:24:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.2.12.1 2018/06/14 19:57:24 martin Exp $");
 
 #include 
 #include 
@@ -560,7 +560,9 @@ rtsx_bus_power_off(struct rtsx_softc *sc
 	disable3 = RTSX_PULL_CTL_DISABLE3;
 	if (RTSX_IS_RTS5209(sc))
 		RTSX_SET(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_OFF);
-	else if (RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	else if (RTSX_IS_RTS5227(sc)
+		|| RTSX_IS_RTS5229(sc)
+		|| RTSX_IS_RTS525A(sc)) {
 		RTSX_CLR(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_VCC1 |
 		RTSX_LDO3318_VCC2);
 		if (RTSX_IS_RTS5229_TYPE_C(sc))
@@ -578,7 +580,10 @@ rtsx_bus_power_off(struct rtsx_softc *sc
 	RTSX_CLR(sc, RTSX_CARD_PWR_CTL, RTSX_PMOS_STRG_800mA);
 
 	/* Disable pull control. */
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL1, RTSX_PULL_CTL_DISABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL2, RTSX_PULL_CTL_DISABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL3, disable3);
@@ -612,13 +617,23 @@ rtsx_bus_power_on(struct rtsx_softc *sc)
 {
 	uint8_t enable3;
 
+	if (RTSX_IS_RTS525A(sc)) {
+		int err = rtsx_write(sc, RTSX_LDO_VCC_CFG1, RTSX_LDO_VCC_TUNE_MASK,
+		RTSX_LDO_VCC_3V3);
+		if (err)
+			return err;
+	}
+
 	/* Select SD card. */
 	RTSX_WRITE(sc, RTSX_CARD_SELECT, RTSX_SD_MOD_SEL);
 	RTSX_WRITE(sc, RTSX_CARD_SHARE_MODE, RTSX_CARD_SHARE_48_SD);
 	RTSX_SET(sc, RTSX_CARD_CLK_EN, RTSX_SD_CLK_EN);
 
 	/* Enable pull control. */
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL1, RTSX_PULL_CTL_ENABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL2, RTSX_PULL_CTL_ENABLE12);
 		if (RTSX_IS_RTS5229_TYPE_C(sc))
@@ -653,7 +668,10 @@ rtsx_bus_power_on(struct rtsx_softc *sc)
 	 * delay in between.
 	 */
 
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		/* Partial power. */
 		RTSX_SET(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PARTIAL_PWR_ON);
 		if (RTSX_IS_RTS5209(sc))
Index: src/sys/dev/ic/rtsxreg.h
diff -u src/sys/dev/ic/rtsxreg.h:1.2 src/sys/dev/ic/rtsxreg.h:1.2.12.1
--- src/sys/dev/ic/rtsxreg.h:1.2	Wed Oct 29 14:24:09 

CVS commit: [netbsd-8] src

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:57:24 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: rtsx.4
src/sys/dev/ic [netbsd-8]: rtsx.c rtsxreg.h rtsxvar.h
src/sys/dev/pci [netbsd-8]: pcidevs rtsx_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #878):

share/man/man4/rtsx.4: revision 1.5
sys/dev/pci/pcidevs: revision 1.1331
sys/dev/ic/rtsxreg.h: revision 1.3
sys/dev/ic/rtsxvar.h: revision 1.3
sys/dev/pci/rtsx_pci.c: revision 1.7
sys/dev/ic/rtsx.c: revision 1.3

add realtek RT525A PCI-E card reader
found in my Dell XPS 15 9550.

rtsx(4): Add support for RT525A, from openbsd.
ok rkujawa

Denote RTS525A, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 src/share/man/man4/rtsx.4
cvs rdiff -u -r1.2 -r1.2.12.1 src/sys/dev/ic/rtsx.c src/sys/dev/ic/rtsxreg.h \
src/sys/dev/ic/rtsxvar.h
cvs rdiff -u -r1.1289.2.7 -r1.1289.2.8 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/dev/pci/rtsx_pci.c

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



CVS commit: [netbsd-8] src/usr.sbin/user

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:54:41 UTC 2018

Modified Files:
src/usr.sbin/user [netbsd-8]: user.c

Log Message:
Pull up following revision(s) (requested by zafer in ticket #877):

usr.sbin/user/user.c: revision 1.132

Set default homeperm values before writing usermgmt.conf file and
honor values in it instead of ignoring it.

Fixes PR bin/40324 by Guy Yur


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.131.22.1 src/usr.sbin/user/user.c

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



CVS commit: [netbsd-8] src/usr.sbin/user

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:54:41 UTC 2018

Modified Files:
src/usr.sbin/user [netbsd-8]: user.c

Log Message:
Pull up following revision(s) (requested by zafer in ticket #877):

usr.sbin/user/user.c: revision 1.132

Set default homeperm values before writing usermgmt.conf file and
honor values in it instead of ignoring it.

Fixes PR bin/40324 by Guy Yur


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.131.22.1 src/usr.sbin/user/user.c

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

Modified files:

Index: src/usr.sbin/user/user.c
diff -u src/usr.sbin/user/user.c:1.131 src/usr.sbin/user/user.c:1.131.22.1
--- src/usr.sbin/user/user.c:1.131	Wed Nov 28 11:31:27 2012
+++ src/usr.sbin/user/user.c	Thu Jun 14 19:54:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.131 2012/11/28 11:31:27 blymn Exp $ */
+/* $NetBSD: user.c,v 1.131.22.1 2018/06/14 19:54:40 martin Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.131 2012/11/28 11:31:27 blymn Exp $");
+__RCSID("$NetBSD: user.c,v 1.131.22.1 2018/06/14 19:54:40 martin Exp $");
 #endif
 
 #include 
@@ -819,6 +819,7 @@ read_defaults(def_t *dp)
 	NEWARRAY(range_t, up->u_rv, up->u_rsize, exit(1));
 	up->u_inactive = DEF_INACTIVE;
 	up->u_expire = DEF_EXPIRE;
+	up->u_homeperm = DEF_HOMEPERM;
 	gp->g_rsize = 16;
 	gp->g_defrc = 0;
 	NEWARRAY(range_t, gp->g_rv, gp->g_rsize, exit(1));
@@ -903,7 +904,6 @@ read_defaults(def_t *dp)
 		up->u_rc += 1;
 	}
 	up->u_defrc = up->u_rc;
-	up->u_homeperm = DEF_HOMEPERM;
 }
 
 /* return the next valid unused uid */



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:49:28 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Tickets #1612, #1615 and #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.106 -r1.1.2.107 src/doc/CHANGES-7.0.3

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-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.106 src/doc/CHANGES-7.0.3:1.1.2.107
--- src/doc/CHANGES-7.0.3:1.1.2.106	Wed Jun  6 14:51:16 2018
+++ src/doc/CHANGES-7.0.3	Thu Jun 14 19:49:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.106 2018/06/06 14:51:16 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.107 2018/06/14 19:49:28 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5448,3 +5448,19 @@ sys/netinet/udp_usrreq.c			1.237 (patch)
 	issues in NAT-T.
 	[maxv, ticket #1607]
 
+sbin/fsck_lfs/bufcache.c			1.20
+sbin/fsck_lfs/bufcache.h			1.14
+
+	Fix incore(), use a 64bit logical block number.
+	[maya, ticket #1612]
+
+usr.sbin/makefs/ffs.c1.70
+
+	Fix makefs UFS2 lazy inode initialization.
+	[maya, ticket #1615]
+
+share/i18n/esdb/ISO-8859/ISO-8859.alias		1.4
+
+	Add more aliases for Hebrew and Arabic ISO-8859-... encodings.
+	[maya, ticket #1616]
+



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:49:28 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Tickets #1612, #1615 and #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.106 -r1.1.2.107 src/doc/CHANGES-7.0.3

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



CVS commit: [netbsd-7-0] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:48:43 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7-0]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.56.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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

Modified files:

Index: src/share/i18n/esdb/ISO-8859/ISO-8859.alias
diff -u src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3 src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3.56.1
--- src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3	Wed Dec 13 15:46:34 2006
+++ src/share/i18n/esdb/ISO-8859/ISO-8859.alias	Thu Jun 14 19:48:43 2018
@@ -1,13 +1,13 @@
-# $NetBSD: ISO-8859.alias,v 1.3 2006/12/13 15:46:34 tnozaki Exp $
+# $NetBSD: ISO-8859.alias,v 1.3.56.1 2018/06/14 19:48:43 martin Exp $
 
 1	iso-8859-1 iso8859-1 iso_8859-1:1987 iso-ir-100 iso_8859-1 latin1 l1 ibm819 cp819
 2	iso-8859-2 iso8859-2 iso_8859-2:1987 iso-ir-101 iso_8859-2 latin2 l2 ibm912 cp912
 3	iso-8859-3 iso8859-3 iso_8859-3:1988 iso-ir-109 iso_8859-3 latin3 l3 ibm913 cp913
 4	iso-8859-4 iso8859-4 iso_8859-4:1988 iso-ir-110 iso_8859-4 latin4 l4 ibm914 cp914
 5	iso-8859-5 iso8859-5 iso_8859-5:1988 iso-ir-144 iso_8859-5 cyrillic ibm915 cp915
-6	iso-8859-6 iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
+6	iso-8859-6 iso-8859-6-i iso-8859-6-e iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
 7	iso-8859-7 iso8859-7 iso_8859-7:1987 iso-ir-126 iso_8859-7 elot_928 ecma-118 greek greek8 ibm813 cp813
-8	iso-8859-8 iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
+8	iso-8859-8 iso-8859-8-i iso-8859-8-e iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
 9	iso-8859-9 iso8859-9 iso_8859-9:1989 iso-ir-148 iso_8859-9 latin5 l5 ibm920 cp920
 10	iso-8859-10 iso8859-10 iso_8859-10:1992 iso-ir-157 iso_8859-10 latin6 l6
 11	iso-8859-11 iso8859-11 iso_8859-11 iso-ir-166 tis620 tis620-0



CVS commit: [netbsd-7-0] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:48:43 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7-0]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.56.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:48:06 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Tickets #1612, #1615 and #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-7.1.3

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



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

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:48:06 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Tickets #1612, #1615 and #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-7.1.3

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-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.13 src/doc/CHANGES-7.1.3:1.1.2.14
--- src/doc/CHANGES-7.1.3:1.1.2.13	Wed Jun  6 14:50:21 2018
+++ src/doc/CHANGES-7.1.3	Thu Jun 14 19:48:06 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.13 2018/06/06 14:50:21 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.14 2018/06/14 19:48:06 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -140,3 +140,19 @@ sys/netinet/udp_usrreq.c			1.237 (patch)
 	issues in NAT-T.
 	[maxv, ticket #1607]
 
+sbin/fsck_lfs/bufcache.c			1.20
+sbin/fsck_lfs/bufcache.h			1.14
+
+	Fix incore(), use a 64bit logical block number.
+	[maya, ticket #1612]
+
+usr.sbin/makefs/ffs.c1.70
+
+	Fix makefs UFS2 lazy inode initialization.
+	[maya, ticket #1615]
+
+share/i18n/esdb/ISO-8859/ISO-8859.alias		1.4
+
+	Add more aliases for Hebrew and Arabic ISO-8859-... encodings.
+	[maya, ticket #1616]
+



CVS commit: [netbsd-7-1] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:45:23 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7-1]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.64.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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

Modified files:

Index: src/share/i18n/esdb/ISO-8859/ISO-8859.alias
diff -u src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3 src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3.64.1
--- src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3	Wed Dec 13 15:46:34 2006
+++ src/share/i18n/esdb/ISO-8859/ISO-8859.alias	Thu Jun 14 19:45:23 2018
@@ -1,13 +1,13 @@
-# $NetBSD: ISO-8859.alias,v 1.3 2006/12/13 15:46:34 tnozaki Exp $
+# $NetBSD: ISO-8859.alias,v 1.3.64.1 2018/06/14 19:45:23 martin Exp $
 
 1	iso-8859-1 iso8859-1 iso_8859-1:1987 iso-ir-100 iso_8859-1 latin1 l1 ibm819 cp819
 2	iso-8859-2 iso8859-2 iso_8859-2:1987 iso-ir-101 iso_8859-2 latin2 l2 ibm912 cp912
 3	iso-8859-3 iso8859-3 iso_8859-3:1988 iso-ir-109 iso_8859-3 latin3 l3 ibm913 cp913
 4	iso-8859-4 iso8859-4 iso_8859-4:1988 iso-ir-110 iso_8859-4 latin4 l4 ibm914 cp914
 5	iso-8859-5 iso8859-5 iso_8859-5:1988 iso-ir-144 iso_8859-5 cyrillic ibm915 cp915
-6	iso-8859-6 iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
+6	iso-8859-6 iso-8859-6-i iso-8859-6-e iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
 7	iso-8859-7 iso8859-7 iso_8859-7:1987 iso-ir-126 iso_8859-7 elot_928 ecma-118 greek greek8 ibm813 cp813
-8	iso-8859-8 iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
+8	iso-8859-8 iso-8859-8-i iso-8859-8-e iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
 9	iso-8859-9 iso8859-9 iso_8859-9:1989 iso-ir-148 iso_8859-9 latin5 l5 ibm920 cp920
 10	iso-8859-10 iso8859-10 iso_8859-10:1992 iso-ir-157 iso_8859-10 latin6 l6
 11	iso-8859-11 iso8859-11 iso_8859-11 iso-ir-166 tis620 tis620-0



CVS commit: [netbsd-7] src/doc

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:44:56 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Ticket #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.91 -r1.1.2.92 src/doc/CHANGES-7.2

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



CVS commit: [netbsd-7-1] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:45:23 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7-1]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.64.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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



CVS commit: [netbsd-7] src/doc

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:44:56 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Ticket #1616


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.91 -r1.1.2.92 src/doc/CHANGES-7.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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.91 src/doc/CHANGES-7.2:1.1.2.92
--- src/doc/CHANGES-7.2:1.1.2.91	Wed Jun  6 15:50:23 2018
+++ src/doc/CHANGES-7.2	Thu Jun 14 19:44:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.91 2018/06/06 15:50:23 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.92 2018/06/14 19:44:56 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5540,3 +5540,8 @@ usr.sbin/makefs/ffs.c1.70
 	Fix makefs UFS2 lazy inode initialization.
 	[maya, ticket #1615]
 
+share/i18n/esdb/ISO-8859/ISO-8859.alias		1.4
+
+	Add more aliases for Hebrew and Arabic ISO-8859-... encodings.
+	[maya, ticket #1616]
+



CVS commit: [netbsd-7] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:44:16 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.54.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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

Modified files:

Index: src/share/i18n/esdb/ISO-8859/ISO-8859.alias
diff -u src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3 src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3.54.1
--- src/share/i18n/esdb/ISO-8859/ISO-8859.alias:1.3	Wed Dec 13 15:46:34 2006
+++ src/share/i18n/esdb/ISO-8859/ISO-8859.alias	Thu Jun 14 19:44:16 2018
@@ -1,13 +1,13 @@
-# $NetBSD: ISO-8859.alias,v 1.3 2006/12/13 15:46:34 tnozaki Exp $
+# $NetBSD: ISO-8859.alias,v 1.3.54.1 2018/06/14 19:44:16 martin Exp $
 
 1	iso-8859-1 iso8859-1 iso_8859-1:1987 iso-ir-100 iso_8859-1 latin1 l1 ibm819 cp819
 2	iso-8859-2 iso8859-2 iso_8859-2:1987 iso-ir-101 iso_8859-2 latin2 l2 ibm912 cp912
 3	iso-8859-3 iso8859-3 iso_8859-3:1988 iso-ir-109 iso_8859-3 latin3 l3 ibm913 cp913
 4	iso-8859-4 iso8859-4 iso_8859-4:1988 iso-ir-110 iso_8859-4 latin4 l4 ibm914 cp914
 5	iso-8859-5 iso8859-5 iso_8859-5:1988 iso-ir-144 iso_8859-5 cyrillic ibm915 cp915
-6	iso-8859-6 iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
+6	iso-8859-6 iso-8859-6-i iso-8859-6-e iso8859-6 iso_8859-6:1987 iso-ir-127 iso_8859-6 ecma-114 asmo-708 arabic ibm1089 cp1089
 7	iso-8859-7 iso8859-7 iso_8859-7:1987 iso-ir-126 iso_8859-7 elot_928 ecma-118 greek greek8 ibm813 cp813
-8	iso-8859-8 iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
+8	iso-8859-8 iso-8859-8-i iso-8859-8-e iso8859-8 iso_8859-8:1988 iso-ir-138 iso_8859-8 hebrew ibm916 cp916
 9	iso-8859-9 iso8859-9 iso_8859-9:1989 iso-ir-148 iso_8859-9 latin5 l5 ibm920 cp920
 10	iso-8859-10 iso8859-10 iso_8859-10:1992 iso-ir-157 iso_8859-10 latin6 l6
 11	iso-8859-11 iso8859-11 iso_8859-11 iso-ir-166 tis620 tis620-0



CVS commit: [netbsd-7] src/share/i18n/esdb/ISO-8859

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:44:16 UTC 2018

Modified Files:
src/share/i18n/esdb/ISO-8859 [netbsd-7]: ISO-8859.alias

Log Message:
Pull up following revision(s) (requested by maya in ticket #1616):

share/i18n/esdb/ISO-8859/ISO-8859.alias: revision 1.4

Add more aliases for Hebrew and Arabic ISO-8859-... encodings.

ISO-8859-8 is supposed to be visual order (i.e. legible if displayed ltr)
ISO-8859-8-i is supposed to be implicit logic order
ISO-8859-8-e is supposed to be explicit about order

In practice, ISO-8859-8 implying visual order is rare, and logic
order is used. ISO-8859-8-e is rarely used.

Same for Arabic, which uses ISO-8859-6-...

Mentioned in RFC 1555, RFC 1556.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.54.1 src/share/i18n/esdb/ISO-8859/ISO-8859.alias

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



CVS commit: [netbsd-7-0] src/usr.sbin/makefs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:40:38 UTC 2018

Modified Files:
src/usr.sbin/makefs [netbsd-7-0]: ffs.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #1615):

usr.sbin/makefs/ffs.c: revision 1.70

PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.

If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912


To generate a diff of this commit:
cvs rdiff -u -r1.63.6.1 -r1.63.6.1.2.1 src/usr.sbin/makefs/ffs.c

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

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.63.6.1 src/usr.sbin/makefs/ffs.c:1.63.6.1.2.1
--- src/usr.sbin/makefs/ffs.c:1.63.6.1	Tue Apr 14 05:08:09 2015
+++ src/usr.sbin/makefs/ffs.c	Thu Jun 14 19:40:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $	*/
+/*	$NetBSD: ffs.c,v 1.63.6.1.2.1 2018/06/14 19:40:38 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.63.6.1.2.1 2018/06/14 19:40:38 martin Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -1102,7 +1102,7 @@ ffs_write_inode(union dinode *dp, uint32
 	 * Initialize inode blocks on the fly for UFS2.
 	 */
 	initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap);
-	if (ffs_opts->version == 2 &&
+	while (ffs_opts->version == 2 &&
 	(uint32_t)(cgino + FFS_INOPB(fs)) > initediblk &&
 	initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
 		memset(buf, 0, fs->fs_bsize);



CVS commit: [netbsd-7-0] src/usr.sbin/makefs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:40:38 UTC 2018

Modified Files:
src/usr.sbin/makefs [netbsd-7-0]: ffs.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #1615):

usr.sbin/makefs/ffs.c: revision 1.70

PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.

If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912


To generate a diff of this commit:
cvs rdiff -u -r1.63.6.1 -r1.63.6.1.2.1 src/usr.sbin/makefs/ffs.c

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



CVS commit: [netbsd-7-1] src/usr.sbin/makefs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:40:07 UTC 2018

Modified Files:
src/usr.sbin/makefs [netbsd-7-1]: ffs.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #1615):

usr.sbin/makefs/ffs.c: revision 1.70

PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.

If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912


To generate a diff of this commit:
cvs rdiff -u -r1.63.6.1 -r1.63.6.1.6.1 src/usr.sbin/makefs/ffs.c

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

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.63.6.1 src/usr.sbin/makefs/ffs.c:1.63.6.1.6.1
--- src/usr.sbin/makefs/ffs.c:1.63.6.1	Tue Apr 14 05:08:09 2015
+++ src/usr.sbin/makefs/ffs.c	Thu Jun 14 19:40:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $	*/
+/*	$NetBSD: ffs.c,v 1.63.6.1.6.1 2018/06/14 19:40:07 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.63.6.1.6.1 2018/06/14 19:40:07 martin Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -1102,7 +1102,7 @@ ffs_write_inode(union dinode *dp, uint32
 	 * Initialize inode blocks on the fly for UFS2.
 	 */
 	initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap);
-	if (ffs_opts->version == 2 &&
+	while (ffs_opts->version == 2 &&
 	(uint32_t)(cgino + FFS_INOPB(fs)) > initediblk &&
 	initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) {
 		memset(buf, 0, fs->fs_bsize);



CVS commit: [netbsd-7-1] src/usr.sbin/makefs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:40:07 UTC 2018

Modified Files:
src/usr.sbin/makefs [netbsd-7-1]: ffs.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #1615):

usr.sbin/makefs/ffs.c: revision 1.70

PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.

If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912


To generate a diff of this commit:
cvs rdiff -u -r1.63.6.1 -r1.63.6.1.6.1 src/usr.sbin/makefs/ffs.c

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



CVS commit: [netbsd-7-0] src/sbin/fsck_lfs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:37:56 UTC 2018

Modified Files:
src/sbin/fsck_lfs [netbsd-7-0]: bufcache.c bufcache.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1612):

sbin/fsck_lfs/bufcache.h: revision 1.14
sbin/fsck_lfs/bufcache.c: revision 1.20

PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.11 -r1.11.40.1 src/sbin/fsck_lfs/bufcache.h

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

Modified files:

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.14 src/sbin/fsck_lfs/bufcache.c:1.14.6.1
--- src/sbin/fsck_lfs/bufcache.c:1.14	Sat Oct 19 01:09:58 2013
+++ src/sbin/fsck_lfs/bufcache.c	Thu Jun 14 19:37:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.14 2013/10/19 01:09:58 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.14.6.1 2018/06/14 19:37:56 martin Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -193,7 +193,7 @@ bremfree(struct ubuf * bp)
 
 /* Return a buffer if it is in the cache, otherwise return NULL. */
 struct ubuf *
-incore(struct uvnode * vp, int lbn)
+incore(struct uvnode * vp, daddr_t lbn)
 {
 	struct ubuf *bp;
 	int hash, depth;

Index: src/sbin/fsck_lfs/bufcache.h
diff -u src/sbin/fsck_lfs/bufcache.h:1.11 src/sbin/fsck_lfs/bufcache.h:1.11.40.1
--- src/sbin/fsck_lfs/bufcache.h:1.11	Fri May 16 09:21:59 2008
+++ src/sbin/fsck_lfs/bufcache.h	Thu Jun 14 19:37:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.h,v 1.11 2008/05/16 09:21:59 hannken Exp $	*/
+/*	$NetBSD: bufcache.h,v 1.11.40.1 2018/06/14 19:37:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@ void bufrehash(int);
 void bufstats(void);
 void buf_destroy(struct ubuf *);
 void bremfree(struct ubuf *);
-struct ubuf *incore(struct uvnode *, int);
+struct ubuf *incore(struct uvnode *, daddr_t);
 struct ubuf *getblk(struct uvnode *, daddr_t, int);
 void bwrite(struct ubuf *);
 void brelse(struct ubuf *, int);



CVS commit: [netbsd-7-0] src/sbin/fsck_lfs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:37:56 UTC 2018

Modified Files:
src/sbin/fsck_lfs [netbsd-7-0]: bufcache.c bufcache.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1612):

sbin/fsck_lfs/bufcache.h: revision 1.14
sbin/fsck_lfs/bufcache.c: revision 1.20

PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.11 -r1.11.40.1 src/sbin/fsck_lfs/bufcache.h

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



CVS commit: [netbsd-7-1] src/sbin/fsck_lfs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:36:53 UTC 2018

Modified Files:
src/sbin/fsck_lfs [netbsd-7-1]: bufcache.c bufcache.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1612):

sbin/fsck_lfs/bufcache.h: revision 1.14
sbin/fsck_lfs/bufcache.c: revision 1.20

PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.10.1 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.11 -r1.11.44.1 src/sbin/fsck_lfs/bufcache.h

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



CVS commit: [netbsd-7-1] src/sbin/fsck_lfs

2018-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 19:36:53 UTC 2018

Modified Files:
src/sbin/fsck_lfs [netbsd-7-1]: bufcache.c bufcache.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1612):

sbin/fsck_lfs/bufcache.h: revision 1.14
sbin/fsck_lfs/bufcache.c: revision 1.20

PR/51418: Jose Luis Rodriguez Garcia: Fix incore src/sbin/fsck_lfs/bufcache.c
XXX: pullup-8, pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.10.1 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.11 -r1.11.44.1 src/sbin/fsck_lfs/bufcache.h

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

Modified files:

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.14 src/sbin/fsck_lfs/bufcache.c:1.14.10.1
--- src/sbin/fsck_lfs/bufcache.c:1.14	Sat Oct 19 01:09:58 2013
+++ src/sbin/fsck_lfs/bufcache.c	Thu Jun 14 19:36:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.14 2013/10/19 01:09:58 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.14.10.1 2018/06/14 19:36:53 martin Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -193,7 +193,7 @@ bremfree(struct ubuf * bp)
 
 /* Return a buffer if it is in the cache, otherwise return NULL. */
 struct ubuf *
-incore(struct uvnode * vp, int lbn)
+incore(struct uvnode * vp, daddr_t lbn)
 {
 	struct ubuf *bp;
 	int hash, depth;

Index: src/sbin/fsck_lfs/bufcache.h
diff -u src/sbin/fsck_lfs/bufcache.h:1.11 src/sbin/fsck_lfs/bufcache.h:1.11.44.1
--- src/sbin/fsck_lfs/bufcache.h:1.11	Fri May 16 09:21:59 2008
+++ src/sbin/fsck_lfs/bufcache.h	Thu Jun 14 19:36:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.h,v 1.11 2008/05/16 09:21:59 hannken Exp $	*/
+/*	$NetBSD: bufcache.h,v 1.11.44.1 2018/06/14 19:36:53 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@ void bufrehash(int);
 void bufstats(void);
 void buf_destroy(struct ubuf *);
 void bremfree(struct ubuf *);
-struct ubuf *incore(struct uvnode *, int);
+struct ubuf *incore(struct uvnode *, daddr_t);
 struct ubuf *getblk(struct uvnode *, daddr_t, int);
 void bwrite(struct ubuf *);
 void brelse(struct ubuf *, int);



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

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 18:00:16 UTC 2018

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

Log Message:
Install the FPU state on the current CPU in setregs (execve).


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

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



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

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 18:00:16 UTC 2018

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

Log Message:
Install the FPU state on the current CPU in setregs (execve).


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

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

Modified files:

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.33 src/sys/arch/x86/x86/fpu.c:1.34
--- src/sys/arch/x86/x86/fpu.c:1.33	Thu Jun 14 14:36:46 2018
+++ src/sys/arch/x86/x86/fpu.c	Thu Jun 14 18:00:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.33 2018/06/14 14:36:46 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.33 2018/06/14 14:36:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -644,6 +644,14 @@ fpu_save_area_clear(struct lwp *l, unsig
 		fpu_save->sv_87.s87_cw = x87_cw;
 	}
 	pcb->pcb_fpu_dflt_cw = x87_cw;
+
+	/*
+	 * If using eager-switch, install the FPU state on the current
+	 * CPU.
+	 */
+	if (x86_fpu_eager) {
+		fpu_eagerswitch(NULL, l);
+	}
 }
 
 void



CVS commit: src/sys/arch/i386/i386

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 17:58:22 UTC 2018

Modified Files:
src/sys/arch/i386/i386: locore.S

Log Message:
Eager FPU on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/i386/i386/locore.S

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

Modified files:

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.156 src/sys/arch/i386/i386/locore.S:1.157
--- src/sys/arch/i386/i386/locore.S:1.156	Thu Jan  4 14:02:23 2018
+++ src/sys/arch/i386/i386/locore.S	Thu Jun 14 17:58:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.156 2018/01/04 14:02:23 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.157 2018/06/14 17:58:22 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.156 2018/01/04 14:02:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.157 2018/06/14 17:58:22 maxv Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1089,6 +1089,19 @@ ENTRY(cpu_switchto)
 	movl	%ebp,PCB_EBP(%eax)
 skip_save:
 
+#ifndef XEN
+	pushl	%edx
+	movb	_C_LABEL(x86_fpu_eager),%dl
+	testb	%dl,%dl
+	jz	.Lno_eagerfpu
+	pushl	%edi
+	pushl	%esi
+	call	_C_LABEL(fpu_eagerswitch)
+	addl	$8,%esp
+.Lno_eagerfpu:
+	popl	%edx
+#endif
+
 	/* Switch to newlwp's stack. */
 	movl	L_PCB(%edi),%ebx
 	movl	PCB_EBP(%ebx),%ebp



CVS commit: src/sys/arch/i386/i386

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 17:58:22 UTC 2018

Modified Files:
src/sys/arch/i386/i386: locore.S

Log Message:
Eager FPU on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/i386/i386/locore.S

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



CVS commit: src/sys/dev/pci

2018-06-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jun 14 17:41:27 UTC 2018

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
make this work on rv350 chips found in last generation *Books
Needs testing on non-Apple hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/radeonfb.c

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



CVS commit: src/sys/dev/pci

2018-06-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jun 14 17:41:27 UTC 2018

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
make this work on rv350 chips found in last generation *Books
Needs testing on non-Apple hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.95 src/sys/dev/pci/radeonfb.c:1.96
--- src/sys/dev/pci/radeonfb.c:1.95	Wed Jun  6 01:49:08 2018
+++ src/sys/dev/pci/radeonfb.c	Thu Jun 14 17:41:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.95 2018/06/06 01:49:08 maya Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.96 2018/06/14 17:41:27 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.95 2018/06/06 01:49:08 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.96 2018/06/14 17:41:27 macallan Exp $");
 
 #include 
 #include 
@@ -873,7 +873,7 @@ radeonfb_attach(device_t parent, device_
 		/* N.B.: radeon wants 64-byte aligned stride */
 		dp->rd_stride = dp->rd_virtx * dp->rd_bpp / 8;
 		dp->rd_stride = ROUNDUP(dp->rd_stride, RADEON_STRIDEALIGN);
-		DPRINTF(("stride: %d\n", dp->rd_stride));
+		DPRINTF(("stride: %d %d\n", dp->rd_stride, dp->rd_virtx));
 
 		dp->rd_offset = sc->sc_fboffset * i;
 		dp->rd_fbptr = (vaddr_t)bus_space_vaddr(sc->sc_memt,
@@ -1643,6 +1643,13 @@ radeonfb_calc_dividers(struct radeonfb_s
 	DPRINTF(("dot clock: %u\n", dotclock));
 	for (i = 0; (div = radeonfb_dividers[i].divider) != 0; i++) {
 		if ((flags & NO_ODD_FBDIV) && ((div & 1) != 0)) continue;
+		/*
+		 * XXX
+		 * the rv350 in my last generation 14" iBook G4 produces
+		 * garbage with dividers > 4. No idea if this is a hardware
+		 * limitation or an error in the divider table.
+		 */
+		if ((sc->sc_family == RADEON_RV350) && (div > 4)) continue;
 		outfreq = div * dotclock;
 		if ((outfreq >= sc->sc_minpll) &&
 		(outfreq <= sc->sc_maxpll)) {
@@ -1833,6 +1840,12 @@ nobios:
 			sc->sc_ports[0].rp_conn_type = RADEON_CONN_DVI_I;
 			sc->sc_ports[0].rp_tmds_type = RADEON_TMDS_INT;
 			sc->sc_ports[0].rp_number = 0;
+			sc->sc_ports[1].rp_mon_type = RADEON_MT_UNKNOWN;
+			sc->sc_ports[1].rp_ddc_type = RADEON_DDC_NONE;
+			sc->sc_ports[1].rp_dac_type = RADEON_DAC_UNKNOWN;
+			sc->sc_ports[1].rp_conn_type = RADEON_CONN_NONE;
+			sc->sc_ports[1].rp_tmds_type = RADEON_TMDS_UNKNOWN;
+			sc->sc_ports[1].rp_number = 1;
 		} else if IS_MOBILITY(sc) {
 			/* default, port 0 = internal TMDS, port 1 = CRT */
 			sc->sc_ports[0].rp_mon_type = RADEON_MT_UNKNOWN;
@@ -2035,25 +2048,38 @@ radeonfb_program_vclk(struct radeonfb_so
 {
 	uint32_t	pbit = 0;
 	uint32_t	feed = 0;
-	uint32_t	data, refdiv, div0;
+	uint32_t	data, refdiv, div0, r2xxref;
 
 	radeonfb_calc_dividers(sc, dotclock, , , flags);
 
 	if (crtc == 0) {
 
 		refdiv = GETPLL(sc, RADEON_PPLL_REF_DIV);
-		if (IS_R300(sc)) {
+		
+		/*
+		 * XXX
+		 * the RV350 in my last generation iBook G4 behaves like an
+		 * r2xx here - try to detect that and not screw up the reference
+		 * divider.
+		 * xf86-video-radeon just skips PLL programming altogether
+		 * on iBooks, probably for this reason.
+		 */
+		r2xxref = (refdiv & ~RADEON_PPLL_REF_DIV_MASK) | sc->sc_refdiv;
+		if (IS_R300(sc) && (r2xxref != refdiv)) {
 			refdiv = (refdiv & ~R300_PPLL_REF_DIV_ACC_MASK) |
 			(sc->sc_refdiv << R300_PPLL_REF_DIV_ACC_SHIFT);
 		} else {
 			refdiv = (refdiv & ~RADEON_PPLL_REF_DIV_MASK) |
 			sc->sc_refdiv;
 		}
+		DPRINTF(("refdiv %08x\n", refdiv));
 		div0 = GETPLL(sc, RADEON_PPLL_DIV_0);
+		DPRINTF(("div0 %08x\n", div0));
 		div0 &= ~(RADEON_PPLL_FB3_DIV_MASK |
 		RADEON_PPLL_POST3_DIV_MASK);
 		div0 |= pbit;
 		div0 |= (feed & RADEON_PPLL_FB3_DIV_MASK);
+		DPRINTF(("div0 %08x\n", div0));
 
 		if ((refdiv == GETPLL(sc, RADEON_PPLL_REF_DIV)) &&
 		(div0 == GETPLL(sc, RADEON_PPLL_DIV_0))) {
@@ -3026,10 +3052,8 @@ radeonfb_putchar_aa32(void *cookie, int 
 	}
 	if (rv == GC_ADD) {
 		glyphcache_add(>rd_gc, c, xd, yd);
-	} else
-		if (attr & 1)
-			radeonfb_rectfill(dp, xd, yd + h - 2, w, 1, fg);
-
+	} else if (attr & 1)
+		radeonfb_rectfill(dp, xd, yd + h - 2, w, 1, fg);
 }
 
 static void
@@ -3157,7 +3181,6 @@ radeonfb_putchar_aa8(void *cookie, int r
 	} else
 		if (attr & 1)
 			radeonfb_rectfill(dp, x, y + he - 2, wi, 1, fg);
-
 }
 
 /*
@@ -3321,7 +3344,6 @@ radeonfb_rectfill(struct radeonfb_displa
 	RADEON_DST_Y_TOP_TO_BOTTOM);
 	PUT32(sc, RADEON_DST_Y_X, (dsty << 16) | dstx);
 	PUT32(sc, RADEON_DST_WIDTH_HEIGHT, (width << 16) | (height));
-
 }
 
 static void



CVS commit: src/usr.sbin/route6d

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 16:17:19 UTC 2018

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

Log Message:
PR/53365: Thomas Barabosch: memory leak in route6d
XXX: pullup 7, 8


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/route6d/route6d.c

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

Modified files:

Index: src/usr.sbin/route6d/route6d.c
diff -u src/usr.sbin/route6d/route6d.c:1.71 src/usr.sbin/route6d/route6d.c:1.72
--- src/usr.sbin/route6d/route6d.c:1.71	Wed May  9 03:30:21 2018
+++ src/usr.sbin/route6d/route6d.c	Thu Jun 14 12:17:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route6d.c,v 1.71 2018/05/09 07:30:21 maxv Exp $	*/
+/*	$NetBSD: route6d.c,v 1.72 2018/06/14 16:17:18 christos Exp $	*/
 /*	$KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef	lint
-__RCSID("$NetBSD: route6d.c,v 1.71 2018/05/09 07:30:21 maxv Exp $");
+__RCSID("$NetBSD: route6d.c,v 1.72 2018/06/14 16:17:18 christos Exp $");
 #endif
 
 #include 
@@ -594,6 +594,7 @@ init(void)
 		fatal("rip IPV6_RECVPKTINFO");
 	}
 
+	freeaddrinfo(res);
 	memset(, 0, sizeof(hints));
 	hints.ai_family = PF_INET6;
 	hints.ai_socktype = SOCK_DGRAM;
@@ -605,6 +606,7 @@ init(void)
 		fatal("%s resolved to multiple address", RIP6_DEST);
 	}
 	memcpy(, res->ai_addr, res->ai_addrlen);
+	freeaddrinfo(res);
 
 	set[0].fd = ripsock;
 	set[0].events = POLLIN;



CVS commit: src/usr.sbin/route6d

2018-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 14 16:17:19 UTC 2018

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

Log Message:
PR/53365: Thomas Barabosch: memory leak in route6d
XXX: pullup 7, 8


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/route6d/route6d.c

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



CVS commit: src/doc

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 14:48:59 UTC 2018

Modified Files:
src/doc: CHANGES CHANGES.prev

Log Message:
SpectreV4, backports in NetBSD-8, no XSAVEOPT


To generate a diff of this commit:
cvs rdiff -u -r1.2397 -r1.2398 src/doc/CHANGES
cvs rdiff -u -r1.139 -r1.140 src/doc/CHANGES.prev

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
diff -u src/doc/CHANGES:1.2397 src/doc/CHANGES:1.2398
--- src/doc/CHANGES:1.2397	Thu Jun 14 10:57:42 2018
+++ src/doc/CHANGES	Thu Jun 14 14:48:59 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2397 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2398 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -80,7 +80,6 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	kernhist(9): Reworked the export-via-sysctl code to use uintptr_t
 		arguments, PR kern/52639.  Requires contemporaneous update
 		of vmstat(1). [pgoyette 20171028]
-	x86: Add support for XSAVEOPT [maxv 20171104]
 	acpi(4): Updated ACPICA to 20171110. [christos 2017]
 	sunxinand(4): Add driver for Allwinner NAND Flash Controller.
 		[jmcneill 20171113]
@@ -158,6 +157,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	gpio(4): Overhauled interrupt support.  Added GPIO interrupt
 		capability for Broadcom BCM283x SoCs (e.g.
 		Raspberry Pi). [thorpej 20180519]
+	x86: Add SpectreV4 mitigations. [maxv 20180522]
 	macppc: Enable ipsec(4) and ipsecif(4) support in GENERIC kernel by
 		default. [sevan 20180602]
 	dhcpcd: Import 7.0.5b. [roy 20180604]

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.139 src/doc/CHANGES.prev:1.140
--- src/doc/CHANGES.prev:1.139	Wed Apr 18 14:47:11 2018
+++ src/doc/CHANGES.prev	Thu Jun 14 14:48:59 2018
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.139 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.140 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12229,3 +12229,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	amd64: Backport SVS (Meltdown mitigation). [maxv 20180404]
 	x86: Backport retpoline (SpectreV2 mitigation). [mrg 20180411]
 	amd64: Backport SMAP. [maxv 20180414]
+	x86: Backport SpectreV2 mitigations (hardware). [maxv 20180609]
+	x86: Backport SpectreV4 mitigations. [maxv 20180609]



CVS commit: src/doc

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 14:48:59 UTC 2018

Modified Files:
src/doc: CHANGES CHANGES.prev

Log Message:
SpectreV4, backports in NetBSD-8, no XSAVEOPT


To generate a diff of this commit:
cvs rdiff -u -r1.2397 -r1.2398 src/doc/CHANGES
cvs rdiff -u -r1.139 -r1.140 src/doc/CHANGES.prev

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



CVS commit: src/sys/arch

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 14:36:46 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/x86/include: cpu.h fpu.h
src/sys/arch/x86/x86: fpu.c x86_machdep.c

Log Message:
Add some code to support eager fpu switch, INTEL-SA-00145. We restore the
FPU state of the lwp right away during context switches. This guarantees
that when the CPU executes in userland, the FPU doesn't contain secrets.

Maybe we also need to clear the FPU in setregs(), not sure about this one.

Can be enabled/disabled via:

machdep.fpu_eager = {0/1}

Not yet turned on automatically on affected CPUs (Intel Family 6).

More generally it would be good to turn it on automatically when XSAVEOPT
is supported, because in this case there is probably a non-negligible
performance gain; but we need to fix PR/52966.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/fpu.c
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x86/x86/x86_machdep.c

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



CVS commit: src/sys/arch

2018-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jun 14 14:36:46 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/x86/include: cpu.h fpu.h
src/sys/arch/x86/x86: fpu.c x86_machdep.c

Log Message:
Add some code to support eager fpu switch, INTEL-SA-00145. We restore the
FPU state of the lwp right away during context switches. This guarantees
that when the CPU executes in userland, the FPU doesn't contain secrets.

Maybe we also need to clear the FPU in setregs(), not sure about this one.

Can be enabled/disabled via:

machdep.fpu_eager = {0/1}

Not yet turned on automatically on affected CPUs (Intel Family 6).

More generally it would be good to turn it on automatically when XSAVEOPT
is supported, because in this case there is probably a non-negligible
performance gain; but we need to fix PR/52966.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/include/fpu.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/fpu.c
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.165 src/sys/arch/amd64/amd64/locore.S:1.166
--- src/sys/arch/amd64/amd64/locore.S:1.165	Mon Apr 23 22:53:04 2018
+++ src/sys/arch/amd64/amd64/locore.S	Thu Jun 14 14:36:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.165 2018/04/23 22:53:04 joerg Exp $	*/
+/*	$NetBSD: locore.S,v 1.166 2018/06/14 14:36:46 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1097,7 +1097,7 @@ ENTRY(cpu_switchto)
 .Lskip_svs:
 	popq	%rdx
 
-	/* Restore rdi/rsi for speculation_barrier */
+	/* RDI/RSI got clobbered. */
 	movq	%r13,%rdi
 	movq	%r12,%rsi
 #endif
@@ -1106,6 +1106,18 @@ ENTRY(cpu_switchto)
 	pushq	%rdx
 	callq	_C_LABEL(speculation_barrier)
 	popq	%rdx
+
+	/* RDI/RSI got clobbered. */
+	movq	%r13,%rdi
+	movq	%r12,%rsi
+
+	pushq	%rdx
+	movb	_C_LABEL(x86_fpu_eager),%dl
+	testb	%dl,%dl
+	jz	.Lno_eagerfpu
+	callq	_C_LABEL(fpu_eagerswitch)
+.Lno_eagerfpu:
+	popq	%rdx
 #endif
 
 	/* Switch to newlwp's stack. */

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.91 src/sys/arch/x86/include/cpu.h:1.92
--- src/sys/arch/x86/include/cpu.h:1.91	Wed Apr  4 12:59:49 2018
+++ src/sys/arch/x86/include/cpu.h	Thu Jun 14 14:36:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.91 2018/04/04 12:59:49 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.92 2018/06/14 14:36:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -417,6 +417,7 @@ extern int x86_fpu_save;
 #define	FPU_SAVE_XSAVEOPT	3
 extern unsigned int x86_fpu_save_size;
 extern uint64_t x86_xsave_features;
+extern bool x86_fpu_eager;
 
 extern void (*x86_cpu_idle)(void);
 #define	cpu_idle() (*x86_cpu_idle)()

Index: src/sys/arch/x86/include/fpu.h
diff -u src/sys/arch/x86/include/fpu.h:1.8 src/sys/arch/x86/include/fpu.h:1.9
--- src/sys/arch/x86/include/fpu.h:1.8	Wed May 23 07:45:35 2018
+++ src/sys/arch/x86/include/fpu.h	Thu Jun 14 14:36:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.h,v 1.8 2018/05/23 07:45:35 maxv Exp $	*/
+/*	$NetBSD: fpu.h,v 1.9 2018/06/14 14:36:46 maxv Exp $	*/
 
 #ifndef	_X86_FPU_H_
 #define	_X86_FPU_H_
@@ -16,6 +16,8 @@ void fpuinit_mxcsr_mask(void);
 void fpusave_lwp(struct lwp *, bool);
 void fpusave_cpu(bool);
 
+void fpu_eagerswitch(struct lwp *, struct lwp *);
+
 void fpu_set_default_cw(struct lwp *, unsigned int);
 
 void fputrap(struct trapframe *);

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.32 src/sys/arch/x86/x86/fpu.c:1.33
--- src/sys/arch/x86/x86/fpu.c:1.32	Wed May 23 10:21:43 2018
+++ src/sys/arch/x86/x86/fpu.c	Thu Jun 14 14:36:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.32 2018/05/23 10:21:43 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.33 2018/06/14 14:36:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.32 2018/05/23 10:21:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.33 2018/06/14 14:36:46 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -127,6 +127,8 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.32
 #define stts() HYPERVISOR_fpu_taskswitch(1)
 #endif
 
+bool x86_fpu_eager __read_mostly = false;
+
 static uint32_t x86_fpu_mxcsr_mask __read_mostly = 0;
 
 static inline union savefpu *
@@ -263,6 +265,109 @@ fpuinit_mxcsr_mask(void)
 #endif
 }
 
+static void
+fpu_clear_amd(void)
+{
+	/*
+	 * AMD FPUs do not restore FIP, FDP, and FOP on fxrstor and xrstor
+	 * when FSW.ES=0, leaking other threads' execution history.
+	 *
+	 * Clear them manually by loading a zero (fldummy). We do this
+	 * unconditionally, regardless of FSW.ES.
+	 *
+	 * Before that, clear the ES bit 

CVS commit: src/doc

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:57:42 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for QEMU ARM Virtual Machine ("virt").


To generate a diff of this commit:
cvs rdiff -u -r1.2396 -r1.2397 src/doc/CHANGES

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



CVS commit: src/doc

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:57:42 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for QEMU ARM Virtual Machine ("virt").


To generate a diff of this commit:
cvs rdiff -u -r1.2396 -r1.2397 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2396 src/doc/CHANGES:1.2397
--- src/doc/CHANGES:1.2396	Wed Jun 13 03:34:13 2018
+++ src/doc/CHANGES	Thu Jun 14 10:57:42 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2396 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2397 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -162,3 +162,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		default. [sevan 20180602]
 	dhcpcd: Import 7.0.5b. [roy 20180604]
 	virtio(4): Add MMIO transport and fdt(4) attachment. [jakllsch 20180606]
+	arm: Add support for QEMU ARM Virtual Machine ("virt"). [jmcneill 20180614]



CVS commit: src/sys/arch

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:56:39 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 files.generic64
Added Files:
src/sys/arch/arm/virt: files.virt virt_platform.c virt_platform.h
src/sys/arch/evbarm/conf: VIRT files.virt mk.virt std.virt
src/sys/arch/evbarm/virt: virt_start.S

Log Message:
Add support for QEMU ARM Virtual Machine ("virt").


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/virt/files.virt \
src/sys/arch/arm/virt/virt_platform.c \
src/sys/arch/arm/virt/virt_platform.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/VIRT \
src/sys/arch/evbarm/conf/files.virt src/sys/arch/evbarm/conf/mk.virt \
src/sys/arch/evbarm/conf/std.virt
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/files.generic64
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/virt/virt_start.S

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.15 src/sys/arch/evbarm/conf/GENERIC64:1.16
--- src/sys/arch/evbarm/conf/GENERIC64:1.15	Thu May 10 00:05:22 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Thu Jun 14 10:56:39 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.15 2018/05/10 00:05:22 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.16 2018/06/14 10:56:39 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -49,6 +49,7 @@ options 	SOC_TEGRA210
 options 	SOC_SUN50I_A64
 options 	SOC_SUN50I_H5
 options 	SOC_SUN50I_H6
+options 	SOC_VIRT
 #options 	MULTIPROCESSOR
 
 pseudo-device 	openfirm	# /dev/openfirm
@@ -63,6 +64,7 @@ options 	VERBOSE_INIT_ARM # verbose boot
 #options 	EARLYCONS=bcm2837
 #options 	EARLYCONS=sunxi, CONSADDR=0x01c28000
 #options 	EARLYCONS=tegra, CONSADDR=0x70006000
+#options 	EARLYCONS=virt
 
 makeoptions	DEBUG="-g"	# compile full symbol table
 makeoptions	COPY_SYMTAB=1

Index: src/sys/arch/evbarm/conf/files.generic64
diff -u src/sys/arch/evbarm/conf/files.generic64:1.1 src/sys/arch/evbarm/conf/files.generic64:1.2
--- src/sys/arch/evbarm/conf/files.generic64:1.1	Sun Apr  1 04:35:04 2018
+++ src/sys/arch/evbarm/conf/files.generic64	Thu Jun 14 10:56:39 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic64,v 1.1 2018/04/01 04:35:04 ryo Exp $
+#	$NetBSD: files.generic64,v 1.2 2018/06/14 10:56:39 jmcneill Exp $
 #
 
 defparam opt_arm_debug.h	EARLYCONS
@@ -13,3 +13,4 @@ include "arch/evbarm/conf/files.fdt"
 include "arch/arm/broadcom/files.bcm2835"
 include "arch/arm/nvidia/files.tegra"
 include "arch/arm/sunxi/files.sunxi"
+include "arch/arm/virt/files.virt"

Added files:

Index: src/sys/arch/arm/virt/files.virt
diff -u /dev/null src/sys/arch/arm/virt/files.virt:1.1
--- /dev/null	Thu Jun 14 10:56:40 2018
+++ src/sys/arch/arm/virt/files.virt	Thu Jun 14 10:56:39 2018
@@ -0,0 +1,9 @@
+#	$NetBSD: files.virt,v 1.1 2018/06/14 10:56:39 jmcneill Exp $
+#
+# Configuration info for QEMU virtual boards.
+#
+#
+
+file	arch/arm/virt/virt_platform.c		soc_virt
+
+defflag	opt_soc.hSOC_VIRT
Index: src/sys/arch/arm/virt/virt_platform.c
diff -u /dev/null src/sys/arch/arm/virt/virt_platform.c:1.1
--- /dev/null	Thu Jun 14 10:56:40 2018
+++ src/sys/arch/arm/virt/virt_platform.c	Thu Jun 14 10:56:39 2018
@@ -0,0 +1,130 @@
+/* $NetBSD: virt_platform.c,v 1.1 2018/06/14 10:56:39 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "opt_soc.h"
+#include "opt_multiprocessor.h"
+#include "opt_fdt_arm.h"
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: virt_platform.c,v 1.1 2018/06/14 10:56:39 jmcneill Exp $");
+

CVS commit: src/sys/arch

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:56:39 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 files.generic64
Added Files:
src/sys/arch/arm/virt: files.virt virt_platform.c virt_platform.h
src/sys/arch/evbarm/conf: VIRT files.virt mk.virt std.virt
src/sys/arch/evbarm/virt: virt_start.S

Log Message:
Add support for QEMU ARM Virtual Machine ("virt").


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/virt/files.virt \
src/sys/arch/arm/virt/virt_platform.c \
src/sys/arch/arm/virt/virt_platform.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/VIRT \
src/sys/arch/evbarm/conf/files.virt src/sys/arch/evbarm/conf/mk.virt \
src/sys/arch/evbarm/conf/std.virt
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/files.generic64
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/virt/virt_start.S

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



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

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:53:40 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Increase storage space for FDT data


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/fdt/fdt_machdep.c

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



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

2018-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 14 10:53:40 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Increase storage space for FDT data


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/fdt/fdt_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/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.21 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.22
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.21	Sun Apr  1 04:35:04 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Thu Jun 14 10:53:39 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.21 2018/04/01 04:35:04 ryo Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.22 2018/06/14 10:53:39 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.21 2018/04/01 04:35:04 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.22 2018/06/14 10:53:39 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -107,7 +107,7 @@ static uint64_t initrd_start, initrd_end
 
 #include 
 #include 
-#define FDT_BUF_SIZE	(128*1024)
+#define FDT_BUF_SIZE	(256*1024)
 static uint8_t fdt_data[FDT_BUF_SIZE];
 
 extern char KERNEL_BASE_phys[];



CVS commit: [pgoyette-compat] src/sys/dev/wscons

2018-06-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jun 14 10:36:01 UTC 2018

Modified Files:
src/sys/dev/wscons [pgoyette-compat]: wsevent_50.c

Log Message:
Keep up with HEAD.  The original change in the wsevent_50 compat code
has been moved to sys/time_types.h and will get picked up during the
next sync-with-HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/wscons/wsevent_50.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/wscons/wsevent_50.c
diff -u src/sys/dev/wscons/wsevent_50.c:1.1.2.2 src/sys/dev/wscons/wsevent_50.c:1.1.2.3
--- src/sys/dev/wscons/wsevent_50.c:1.1.2.2	Wed Jun 13 02:29:56 2018
+++ src/sys/dev/wscons/wsevent_50.c	Thu Jun 14 10:36:01 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: wsevent_50.c,v 1.1.2.2 2018/06/13 02:29:56 pgoyette Exp $ */
+/* $NetBSD: wsevent_50.c,v 1.1.2.3 2018/06/14 10:36:01 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2006, 2008 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsevent_50.c,v 1.1.2.2 2018/06/13 02:29:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsevent_50.c,v 1.1.2.3 2018/06/14 10:36:01 pgoyette Exp $");
 
 #include 
 #include 
@@ -134,9 +134,6 @@ wsevent_copyout_events50(const struct ws
 
 		ev50.type = ev->type;
 		ev50.value = ev->value;
-#if INT32_MAX < LONG_MAX	/* scrub padding */
-		memset(, 0, offsetof(struct timespec50, tv_nsec));
-#endif
 		timespec_to_timespec50(>time, );
 
 		error = uiomove(, sizeof(ev50), uio);



CVS commit: [pgoyette-compat] src/sys/dev/wscons

2018-06-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jun 14 10:36:01 UTC 2018

Modified Files:
src/sys/dev/wscons [pgoyette-compat]: wsevent_50.c

Log Message:
Keep up with HEAD.  The original change in the wsevent_50 compat code
has been moved to sys/time_types.h and will get picked up during the
next sync-with-HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/wscons/wsevent_50.c

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



CVS commit: src/sys

2018-06-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jun 14 10:30:56 UTC 2018

Modified Files:
src/sys/compat/sys: time_types.h
src/sys/dev/wscons: wsevent.c

Log Message:
timespec_to_timespec50 - don't leak kernel memory in struct padding.

On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment.  Scrub it.
The result is most likely about to be passed to the user space by the
caller, so do it here to take care of them all.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/time_types.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/wscons/wsevent.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/sys/time_types.h
diff -u src/sys/compat/sys/time_types.h:1.1 src/sys/compat/sys/time_types.h:1.2
--- src/sys/compat/sys/time_types.h:1.1	Thu Nov  5 16:59:01 2009
+++ src/sys/compat/sys/time_types.h	Thu Jun 14 10:30:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: time_types.h,v 1.1 2009/11/05 16:59:01 pooka Exp $	*/
+/*	$NetBSD: time_types.h,v 1.2 2018/06/14 10:30:55 uwe Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -89,6 +89,9 @@ static __inline void timespec50_to_times
 static __inline void timespec_to_timespec50(const struct timespec *ts,
 struct timespec50 *ts50)
 {
+#if INT32_MAX < LONG_MAX	/* scrub padding */
+	memset(ts50, 0, offsetof(struct timespec50, tv_nsec));
+#endif
 	ts50->tv_sec = (int32_t)ts->tv_sec;
 	ts50->tv_nsec = ts->tv_nsec;
 }

Index: src/sys/dev/wscons/wsevent.c
diff -u src/sys/dev/wscons/wsevent.c:1.38 src/sys/dev/wscons/wsevent.c:1.39
--- src/sys/dev/wscons/wsevent.c:1.38	Wed Jun 13 02:09:09 2018
+++ src/sys/dev/wscons/wsevent.c	Thu Jun 14 10:30:55 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: wsevent.c,v 1.38 2018/06/13 02:09:09 uwe Exp $ */
+/* $NetBSD: wsevent.c,v 1.39 2018/06/14 10:30:55 uwe Exp $ */
 
 /*-
  * Copyright (c) 2006, 2008 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsevent.c,v 1.38 2018/06/13 02:09:09 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsevent.c,v 1.39 2018/06/14 10:30:55 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -202,9 +202,6 @@ wsevent_copyout_events50(const struct ws
 
 		ev50.type = ev->type;
 		ev50.value = ev->value;
-#if INT32_MAX < LONG_MAX	/* scrub padding */
-		memset(, 0, offsetof(struct timespec50, tv_nsec));
-#endif
 		timespec_to_timespec50(>time, );
 
 		error = uiomove(, sizeof(ev50), uio);



CVS commit: src/sys

2018-06-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jun 14 10:30:56 UTC 2018

Modified Files:
src/sys/compat/sys: time_types.h
src/sys/dev/wscons: wsevent.c

Log Message:
timespec_to_timespec50 - don't leak kernel memory in struct padding.

On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment.  Scrub it.
The result is most likely about to be passed to the user space by the
caller, so do it here to take care of them all.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/time_types.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/wscons/wsevent.c

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



CVS commit: src/external/gpl2/grep/dist/lib

2018-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 14 10:14:39 UTC 2018

Modified Files:
src/external/gpl2/grep/dist/lib: obstack.c

Log Message:
Make the alignof() usage more portable in grep(1)

Remove NetBSD specific check and replace it with GCC extension __alignof__
that is available since GCC 2.x.

Requested by 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/grep/dist/lib/obstack.c

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

Modified files:

Index: src/external/gpl2/grep/dist/lib/obstack.c
diff -u src/external/gpl2/grep/dist/lib/obstack.c:1.2 src/external/gpl2/grep/dist/lib/obstack.c:1.3
--- src/external/gpl2/grep/dist/lib/obstack.c:1.2	Wed Jun 13 17:32:29 2018
+++ src/external/gpl2/grep/dist/lib/obstack.c	Thu Jun 14 10:14:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: obstack.c,v 1.2 2018/06/13 17:32:29 kamil Exp $	*/
+/*	$NetBSD: obstack.c,v 1.3 2018/06/14 10:14:39 kamil Exp $	*/
 
 /* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc.
@@ -61,23 +61,7 @@
 
 /* Determine default alignment.  */
 struct fooalign {char x; double d;};
-
-#if defined(__NetBSD__)
-#include 
-#endif
-
-#ifndef __NetBSD_Prereq__
-#define __NetBSD_Prereq__(a,b,c) 0
-#endif
-
-#if __NetBSD_Prereq__(8,0,0)
-#include 
-// Avoid Undefined Behavior
-#define DEFAULT_ALIGNMENT ((int)alignof(struct fooalign))
-#else
-#define DEFAULT_ALIGNMENT  \
-  ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
-#endif
+#define DEFAULT_ALIGNMENT ((int)__alignof__(struct fooalign))
 /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
But in fact it might be less smart and round addresses to as much as
DEFAULT_ROUNDING.  So we prepare for it to do that.  */



CVS commit: src/external/gpl2/grep/dist/lib

2018-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 14 10:14:39 UTC 2018

Modified Files:
src/external/gpl2/grep/dist/lib: obstack.c

Log Message:
Make the alignof() usage more portable in grep(1)

Remove NetBSD specific check and replace it with GCC extension __alignof__
that is available since GCC 2.x.

Requested by 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/grep/dist/lib/obstack.c

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



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 09:29:55 UTC 2018

Modified Files:
src/sys/dev/pci: if_msk.c

Log Message:
 Remove extra tabs. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/if_msk.c

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

Modified files:

Index: src/sys/dev/pci/if_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.64 src/sys/dev/pci/if_msk.c:1.65
--- src/sys/dev/pci/if_msk.c:1.64	Wed Jun 13 20:18:54 2018
+++ src/sys/dev/pci/if_msk.c	Thu Jun 14 09:29:55 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.64 2018/06/13 20:18:54 jdolecek Exp $ */
+/* $NetBSD: if_msk.c,v 1.65 2018/06/14 09:29:55 msaitoh Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.64 2018/06/13 20:18:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.65 2018/06/14 09:29:55 msaitoh Exp $");
 
 #include 
 #include 
@@ -241,7 +241,7 @@ msk_miibus_readreg(device_t dev, int phy
 
 	SK_YU_WRITE_2(sc_if, YUKON_SMICR, YU_SMICR_PHYAD(phy) |
 		  YU_SMICR_REGAD(reg) | YU_SMICR_OP_READ);
-	
+
 	for (i = 0; i < SK_TIMEOUT; i++) {
 		DELAY(1);
 		val = SK_YU_READ_2(sc_if, YUKON_SMICR);
@@ -253,7 +253,7 @@ msk_miibus_readreg(device_t dev, int phy
 		aprint_error_dev(sc_if->sk_dev, "phy failed to come ready\n");
 		return (0);
 	}
-	
+
  	DPRINTFN(9, ("msk_miibus_readreg: i=%d, timeout=%d\n", i,
 		 SK_TIMEOUT));
 
@@ -492,7 +492,7 @@ msk_newbuf(struct sk_if_softc *sc_if, in
 		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
 		if (m_new == NULL)
 			return (ENOBUFS);
-	
+
 		/* Allocate the jumbo buffer */
 		buf = msk_jalloc(sc_if);
 		if (buf == NULL) {
@@ -838,7 +838,7 @@ mskc_reset(struct sk_softc *sc)
 		uint32_t our;
 
 		CSR_WRITE_2(sc, SK_CSR, SK_CSR_WOL_ON);
-	
+
 		/* enable all clocks. */
 		sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG3), 0);
 		our = sk_win_read_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG4));



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 09:29:55 UTC 2018

Modified Files:
src/sys/dev/pci: if_msk.c

Log Message:
 Remove extra tabs. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/if_msk.c

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



CVS commit: src/tests/net/if_vlan

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:38:24 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
Update the error message in t_vlan (ENXIO => EINVAL)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_vlan/t_vlan.sh

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

Modified files:

Index: src/tests/net/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.10 src/tests/net/if_vlan/t_vlan.sh:1.11
--- src/tests/net/if_vlan/t_vlan.sh:1.10	Thu Jun 14 08:22:52 2018
+++ src/tests/net/if_vlan/t_vlan.sh	Thu Jun 14 08:38:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_vlan.sh,v 1.10 2018/06/14 08:22:52 yamaguchi Exp $
+#	$NetBSD: t_vlan.sh,v 1.11 2018/06/14 08:38:24 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -655,7 +655,7 @@ vlan_multicast_body_common()
 	atf_check -s exit:0 $HIJACKING $siocXmulti del vlan0 $mcaddr
 
 	# delete the address with invalid interface
-	atf_check -s not-exit:0 -e match:"Device not configured" \
+	atf_check -s not-exit:0 -e match:"Invalid argument" \
 	$HIJACKING $siocXmulti del vlan0 $mcaddr
 
 	atf_check -s exit:0 $HIJACKING $siocXmulti del vlan1 $mcaddr



CVS commit: src/tests/net/if_vlan

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:38:24 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
Update the error message in t_vlan (ENXIO => EINVAL)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_vlan/t_vlan.sh

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:33:18 UTC 2018

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

Log Message:
Fix to check whether the address has been added before delete

The list named ifv_mc_listhead saves multicast addresses that
are added through SIOCADDMULTI. Each nodes added to the list
are used for deleting the related address from a parent I/F
when remove the configuration of parent I/F.
In carp(4) and OpenBSD's vlan(4), the lists is used to check
a parameter of SIOCDELMULTI in addition to the use.
Based on them, the check is added to vlan(4)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/net/if_vlan.c

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:33:18 UTC 2018

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

Log Message:
Fix to check whether the address has been added before delete

The list named ifv_mc_listhead saves multicast addresses that
are added through SIOCADDMULTI. Each nodes added to the list
are used for deleting the related address from a parent I/F
when remove the configuration of parent I/F.
In carp(4) and OpenBSD's vlan(4), the lists is used to check
a parameter of SIOCDELMULTI in addition to the use.
Based on them, the check is added to vlan(4)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/net/if_vlan.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_vlan.c
diff -u src/sys/net/if_vlan.c:1.128 src/sys/net/if_vlan.c:1.129
--- src/sys/net/if_vlan.c:1.128	Thu Jun 14 08:06:07 2018
+++ src/sys/net/if_vlan.c	Thu Jun 14 08:33:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.128 2018/06/14 08:06:07 yamaguchi Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.129 2018/06/14 08:33:18 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.128 2018/06/14 08:06:07 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.129 2018/06/14 08:33:18 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1229,6 +1229,17 @@ vlan_ether_delmulti(struct ifvlan *ifv, 
 	ETHER_LOCK(>ifv_ec);
 	enm = ether_lookup_multi(addrlo, addrhi, >ifv_ec);
 	ETHER_UNLOCK(>ifv_ec);
+	if (enm == NULL)
+		return EINVAL;
+
+	LIST_FOREACH(mc, >ifv_mc_listhead, mc_entries) {
+		if (mc->mc_enm == enm)
+			break;
+	}
+
+	/* We woun't delete entries we didn't add */
+	if (mc == NULL)
+		return EINVAL;
 
 	error = ether_delmulti(sa, >ifv_ec);
 	if (error != ENETRESET)
@@ -1242,17 +1253,11 @@ vlan_ether_delmulti(struct ifvlan *ifv, 
 
 	if (error == 0) {
 		/* And forget about this address. */
-		for (mc = LIST_FIRST(>ifv_mc_listhead); mc != NULL;
-		mc = LIST_NEXT(mc, mc_entries)) {
-			if (mc->mc_enm == enm) {
-LIST_REMOVE(mc, mc_entries);
-free(mc, M_DEVBUF);
-break;
-			}
-		}
-		KASSERT(mc != NULL);
-	} else
+		LIST_REMOVE(mc, mc_entries);
+		free(mc, M_DEVBUF);
+	} else {
 		(void)ether_addmulti(sa, >ifv_ec);
+	}
 
 	return error;
 }
@@ -1276,7 +1281,7 @@ vlan_ether_purgemulti(struct ifvlan *ifv
 	while ((mc = LIST_FIRST(>ifv_mc_listhead)) != NULL) {
 		IFNET_LOCK(mib->ifvm_p);
 		(void)if_mcast_op(mib->ifvm_p, SIOCDELMULTI,
-		(const struct sockaddr *)>mc_addr);
+		sstocsa(>mc_addr));
 		IFNET_UNLOCK(mib->ifvm_p);
 		LIST_REMOVE(mc, mc_entries);
 		free(mc, M_DEVBUF);



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

2018-06-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jun 14 08:27:10 UTC 2018

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

Log Message:
Widen shift to the LHS type.
same as aarch64/db_interface.c r1.4, PR/53338.


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

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



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

2018-06-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jun 14 08:27:10 UTC 2018

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

Log Message:
Widen shift to the LHS type.
same as aarch64/db_interface.c r1.4, PR/53338.


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

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/disasm.c
diff -u src/sys/arch/aarch64/aarch64/disasm.c:1.1 src/sys/arch/aarch64/aarch64/disasm.c:1.2
--- src/sys/arch/aarch64/aarch64/disasm.c:1.1	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/aarch64/aarch64/disasm.c	Thu Jun 14 08:27:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: disasm.c,v 1.1 2018/04/01 04:35:03 ryo Exp $	*/
+/*	$NetBSD: disasm.c,v 1.2 2018/06/14 08:27:10 ryo Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disasm.c,v 1.1 2018/04/01 04:35:03 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disasm.c,v 1.2 2018/06/14 08:27:10 ryo Exp $");
 
 #include 
 #include 
@@ -568,7 +568,7 @@ sysregname(char *buf, size_t buflen, uin
 static uint64_t
 SignExtend(int bitwidth, uint64_t imm, unsigned int multiply)
 {
-	const uint64_t signbit = (1 << (bitwidth - 1));
+	const uint64_t signbit = ((uint64_t)1 << (bitwidth - 1));
 	const uint64_t immmax = signbit << 1;
 
 	if (imm & signbit)



CVS commit: src

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:22:52 UTC 2018

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/net/if_vlan: Makefile t_vlan.sh
Added Files:
src/tests/net/if_vlan: siocXmulti.c

Log Message:
Add test cases for multicast address handling of vlan(4)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.785 -r1.786 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_vlan/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/if_vlan/siocXmulti.c
cvs rdiff -u -r1.9 -r1.10 src/tests/net/if_vlan/t_vlan.sh

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



CVS commit: src

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:22:52 UTC 2018

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/net/if_vlan: Makefile t_vlan.sh
Added Files:
src/tests/net/if_vlan: siocXmulti.c

Log Message:
Add test cases for multicast address handling of vlan(4)

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.785 -r1.786 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_vlan/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/if_vlan/siocXmulti.c
cvs rdiff -u -r1.9 -r1.10 src/tests/net/if_vlan/t_vlan.sh

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.250 src/distrib/sets/lists/debug/mi:1.251
--- src/distrib/sets/lists/debug/mi:1.250	Mon May 28 21:05:00 2018
+++ src/distrib/sets/lists/debug/mi	Thu Jun 14 08:22:52 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.250 2018/05/28 21:05:00 chs Exp $
+# $NetBSD: mi,v 1.251 2018/06/14 08:22:52 yamaguchi Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2294,6 +2294,7 @@
 ./usr/libdata/debug/usr/tests/net/if/ifconf.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/if/t_compat.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/if_loop/t_pr.debug		tests-net-debug		debug,atf,rump
+./usr/libdata/debug/usr/tests/net/if_vlan/siocXmulti.debug	tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/in_cksum/in_cksum.debug	tests-net-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/net/ipsec/natt_terminator.debug	tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/mcast/mcast.debug		tests-net-debug		debug,atf,rump

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.785 src/distrib/sets/lists/tests/mi:1.786
--- src/distrib/sets/lists/tests/mi:1.785	Fri May 25 15:42:48 2018
+++ src/distrib/sets/lists/tests/mi	Thu Jun 14 08:22:52 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.785 2018/05/25 15:42:48 martin Exp $
+# $NetBSD: mi,v 1.786 2018/06/14 08:22:52 yamaguchi Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3332,6 +3332,7 @@
 ./usr/tests/net/if_vlantests-net-tests		compattestfile,atf
 ./usr/tests/net/if_vlan/Atffile			tests-net-tests		atf,rump
 ./usr/tests/net/if_vlan/Kyuafile		tests-net-tests		atf,rump,kyua
+./usr/tests/net/if_vlan/siocXmulti		tests-net-tests		atf,rump
 ./usr/tests/net/if_vlan/t_vlan			tests-net-tests		atf,rump
 ./usr/tests/net/in_cksum			tests-net-tests		compattestfile,atf
 ./usr/tests/net/in_cksum/Atffile		tests-net-tests		compattestfile,atf

Index: src/tests/net/if_vlan/Makefile
diff -u src/tests/net/if_vlan/Makefile:1.1 src/tests/net/if_vlan/Makefile:1.2
--- src/tests/net/if_vlan/Makefile:1.1	Sat Nov 26 03:19:49 2016
+++ src/tests/net/if_vlan/Makefile	Thu Jun 14 08:22:52 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2016/11/26 03:19:49 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.2 2018/06/14 08:22:52 yamaguchi Exp $
 #
 
 .include 
@@ -10,4 +10,8 @@ TESTS_SH+=		t_${name}
 TESTS_SH_SRC_t_${name}=	../net_common.sh t_${name}.sh
 .endfor
 
+PROGS=			siocXmulti
+MAN.siocXmulti=		#empty
+BINDIR.siocXmulti=	${TESTSDIR}
+
 .include 

Index: src/tests/net/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.9 src/tests/net/if_vlan/t_vlan.sh:1.10
--- src/tests/net/if_vlan/t_vlan.sh:1.9	Tue Jun 12 04:21:22 2018
+++ src/tests/net/if_vlan/t_vlan.sh	Thu Jun 14 08:22:52 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_vlan.sh,v 1.9 2018/06/12 04:21:22 ozaki-r Exp $
+#	$NetBSD: t_vlan.sh,v 1.10 2018/06/14 08:22:52 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -32,10 +32,14 @@ IP_LOCAL0=10.0.0.1
 IP_LOCAL1=10.0.1.1
 IP_REMOTE0=10.0.0.2
 IP_REMOTE1=10.0.1.2
+IP_MCADDR0=224.0.0.10
 IP6_LOCAL0=fc00:0::1
 IP6_LOCAL1=fc00:1::1
 IP6_REMOTE0=fc00:0::2
 IP6_REMOTE1=fc00:1::2
+IP6_MCADDR0=ff11::10
+ETH_IP_MCADDR0=01:00:5e:00:00:0a
+ETH_IP6_MCADDR0=33:33:00:00:00:10
 
 DEBUG=${DEBUG:-false}
 
@@ -598,6 +602,123 @@ vlan_bridge6_cleanup()
 	cleanup
 }
 
+vlan_multicast_body_common()
+{
+
+	local af="inet"
+	local local0=$IP_LOCAL0
+	local local1=$IP_LOCAL1
+	local mcaddr=$IP_MCADDR0
+	local eth_mcaddr=$ETH_IP_MCADDR0
+	local prefix=24
+	local siocXmulti="$(atf_get_srcdir)/siocXmulti"
+
+	if [ x"$1" =  x"inet6" ]; then
+		af="inet6"
+		prefix=64
+		local0=$IP6_LOCAL0
+		local1=$IP6_LOCAL1
+		mcaddr=$IP6_MCADDR0
+		eth_mcaddr=$ETH_IP6_MCADDR0
+	fi
+
+	export RUMP_SERVER=$SOCK_LOCAL
+
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 linkstr net0 up
+	atf_check -s 

CVS commit: src/sys

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:06:07 UTC 2018

Modified Files:
src/sys/net: if_vlan.c
src/sys/netinet: ip_carp.c

Log Message:
Add the lock to refer the list included in ethercom for safety

The lock is already held while adding and deleting
ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/net/if_vlan.c
cvs rdiff -u -r1.97 -r1.98 src/sys/netinet/ip_carp.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_vlan.c
diff -u src/sys/net/if_vlan.c:1.127 src/sys/net/if_vlan.c:1.128
--- src/sys/net/if_vlan.c:1.127	Thu Jun 14 07:54:57 2018
+++ src/sys/net/if_vlan.c	Thu Jun 14 08:06:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.127 2018/06/14 07:54:57 yamaguchi Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.128 2018/06/14 08:06:07 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.127 2018/06/14 07:54:57 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.128 2018/06/14 08:06:07 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1176,7 +1176,11 @@ vlan_ether_addmulti(struct ifvlan *ifv, 
 	 */
 	error = ether_multiaddr(sa, addrlo, addrhi);
 	KASSERT(error == 0);
+
+	ETHER_LOCK(>ifv_ec);
 	mc->mc_enm = ether_lookup_multi(addrlo, addrhi, >ifv_ec);
+	ETHER_UNLOCK(>ifv_ec);
+
 	KASSERT(mc->mc_enm != NULL);
 
 	memcpy(>mc_addr, sa, sa->sa_len);
@@ -1221,7 +1225,10 @@ vlan_ether_delmulti(struct ifvlan *ifv, 
 	 */
 	if ((error = ether_multiaddr(sa, addrlo, addrhi)) != 0)
 		return error;
+
+	ETHER_LOCK(>ifv_ec);
 	enm = ether_lookup_multi(addrlo, addrhi, >ifv_ec);
+	ETHER_UNLOCK(>ifv_ec);
 
 	error = ether_delmulti(sa, >ifv_ec);
 	if (error != ENETRESET)

Index: src/sys/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.97 src/sys/netinet/ip_carp.c:1.98
--- src/sys/netinet/ip_carp.c:1.97	Thu Jun 14 07:54:57 2018
+++ src/sys/netinet/ip_carp.c	Thu Jun 14 08:06:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.97 2018/06/14 07:54:57 yamaguchi Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.98 2018/06/14 08:06:07 yamaguchi Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.97 2018/06/14 07:54:57 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.98 2018/06/14 08:06:07 yamaguchi Exp $");
 
 /*
  * TODO:
@@ -2312,7 +2312,11 @@ carp_ether_addmulti(struct carp_softc *s
 	 * statement shouldn't fail.
 	 */
 	(void)ether_multiaddr(sa, addrlo, addrhi);
+
+	ETHER_LOCK(>sc_ac);
 	mc->mc_enm = ether_lookup_multi(addrlo, addrhi, >sc_ac);
+	ETHER_UNLOCK(>sc_ac);
+
 	memcpy(>mc_addr, sa, sa->sa_len);
 	LIST_INSERT_HEAD(>carp_mc_listhead, mc, mc_entries);
 
@@ -2351,7 +2355,10 @@ carp_ether_delmulti(struct carp_softc *s
 	 */
 	if ((error = ether_multiaddr(sa, addrlo, addrhi)) != 0)
 		return (error);
+
+	ETHER_LOCK(>sc_ac);
 	enm = ether_lookup_multi(addrlo, addrhi, >sc_ac);
+	ETHER_UNLOCK(>sc_ac);
 	if (enm == NULL)
 		return (EINVAL);
 



CVS commit: src/sys

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:06:07 UTC 2018

Modified Files:
src/sys/net: if_vlan.c
src/sys/netinet: ip_carp.c

Log Message:
Add the lock to refer the list included in ethercom for safety

The lock is already held while adding and deleting
ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/net/if_vlan.c
cvs rdiff -u -r1.97 -r1.98 src/sys/netinet/ip_carp.c

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:00:24 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Remove ETHER_LOOKUP_MULTI()

The macro has been replaced with a function.
ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/net/if_ether.h

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

Modified files:

Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.74 src/sys/net/if_ether.h:1.75
--- src/sys/net/if_ether.h:1.74	Thu Jun 14 07:44:31 2018
+++ src/sys/net/if_ether.h	Thu Jun 14 08:00:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.74 2018/06/14 07:44:31 yamaguchi Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.75 2018/06/14 08:00:24 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -268,12 +268,6 @@ ether_lookup_multi(const uint8_t *addrlo
 
 	return enm;
 }
-#define ETHER_LOOKUP_MULTI(addrlo, addrhi, ec, enm)			\
-	/* uint8_t addrlo[ETHER_ADDR_LEN]; */\
-	/* uint8_t addrhi[ETHER_ADDR_LEN]; */\
-	/* struct ethercom *ec; */	\
-	/* struct ether_multi *enm; */	\
-	(enm) = ether_lookup_multi((addrlo), (addrhi), (ec))
 
 /*
  * step through all of the ether_multi records, one at a time.



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 08:00:24 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Remove ETHER_LOOKUP_MULTI()

The macro has been replaced with a function.
ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/net/if_ether.h

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



CVS commit: src/sys

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:54:57 UTC 2018

Modified Files:
src/sys/net: if_ethersubr.c if_vlan.c
src/sys/netinet: ip_carp.c

Log Message:
Use ether_lookup_multi() instead of the macro

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.126 -r1.127 src/sys/net/if_vlan.c
cvs rdiff -u -r1.96 -r1.97 src/sys/netinet/ip_carp.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_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.269 src/sys/net/if_ethersubr.c:1.270
--- src/sys/net/if_ethersubr.c:1.269	Tue Jun 12 07:12:35 2018
+++ src/sys/net/if_ethersubr.c	Thu Jun 14 07:54:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.269 2018/06/12 07:12:35 ozaki-r Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.270 2018/06/14 07:54:57 yamaguchi Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.269 2018/06/12 07:12:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.270 2018/06/14 07:54:57 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1282,7 +1282,7 @@ ether_addmulti(const struct sockaddr *sa
 	/*
 	 * See if the address range is already in the list.
 	 */
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, ec, _enm);
+	_enm = ether_lookup_multi(addrlo, addrhi, ec);
 	if (_enm != NULL) {
 		/*
 		 * Found it; just increment the reference count.
@@ -1334,7 +1334,7 @@ ether_delmulti(const struct sockaddr *sa
 	/*
 	 * Look up the address in our list.
 	 */
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, ec, enm);
+	enm = ether_lookup_multi(addrlo, addrhi, ec);
 	if (enm == NULL) {
 		error = ENXIO;
 		goto error;

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.126 src/sys/net/if_vlan.c:1.127
--- src/sys/net/if_vlan.c:1.126	Tue Jun 12 04:20:36 2018
+++ src/sys/net/if_vlan.c	Thu Jun 14 07:54:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.126 2018/06/12 04:20:36 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.127 2018/06/14 07:54:57 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.126 2018/06/12 04:20:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.127 2018/06/14 07:54:57 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1176,7 +1176,7 @@ vlan_ether_addmulti(struct ifvlan *ifv, 
 	 */
 	error = ether_multiaddr(sa, addrlo, addrhi);
 	KASSERT(error == 0);
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, >ifv_ec, mc->mc_enm);
+	mc->mc_enm = ether_lookup_multi(addrlo, addrhi, >ifv_ec);
 	KASSERT(mc->mc_enm != NULL);
 
 	memcpy(>mc_addr, sa, sa->sa_len);
@@ -1221,7 +1221,7 @@ vlan_ether_delmulti(struct ifvlan *ifv, 
 	 */
 	if ((error = ether_multiaddr(sa, addrlo, addrhi)) != 0)
 		return error;
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, >ifv_ec, enm);
+	enm = ether_lookup_multi(addrlo, addrhi, >ifv_ec);
 
 	error = ether_delmulti(sa, >ifv_ec);
 	if (error != ENETRESET)

Index: src/sys/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.96 src/sys/netinet/ip_carp.c:1.97
--- src/sys/netinet/ip_carp.c:1.96	Fri May 18 18:58:51 2018
+++ src/sys/netinet/ip_carp.c	Thu Jun 14 07:54:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.96 2018/05/18 18:58:51 maxv Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.97 2018/06/14 07:54:57 yamaguchi Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.96 2018/05/18 18:58:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.97 2018/06/14 07:54:57 yamaguchi Exp $");
 
 /*
  * TODO:
@@ -2312,7 +2312,7 @@ carp_ether_addmulti(struct carp_softc *s
 	 * statement shouldn't fail.
 	 */
 	(void)ether_multiaddr(sa, addrlo, addrhi);
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, >sc_ac, mc->mc_enm);
+	mc->mc_enm = ether_lookup_multi(addrlo, addrhi, >sc_ac);
 	memcpy(>mc_addr, sa, sa->sa_len);
 	LIST_INSERT_HEAD(>carp_mc_listhead, mc, mc_entries);
 
@@ -2351,7 +2351,7 @@ carp_ether_delmulti(struct carp_softc *s
 	 */
 	if ((error = ether_multiaddr(sa, addrlo, addrhi)) != 0)
 		return (error);
-	ETHER_LOOKUP_MULTI(addrlo, addrhi, >sc_ac, enm);
+	enm = ether_lookup_multi(addrlo, addrhi, >sc_ac);
 	if (enm == NULL)
 		return (EINVAL);
 



CVS commit: src/sys

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:54:57 UTC 2018

Modified Files:
src/sys/net: if_ethersubr.c if_vlan.c
src/sys/netinet: ip_carp.c

Log Message:
Use ether_lookup_multi() instead of the macro

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.126 -r1.127 src/sys/net/if_vlan.c
cvs rdiff -u -r1.96 -r1.97 src/sys/netinet/ip_carp.c

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:44:31 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Replace macros related to multicast address with inline functions

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/net/if_ether.h

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

Modified files:

Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.73 src/sys/net/if_ether.h:1.74
--- src/sys/net/if_ether.h:1.73	Thu Jun 14 07:39:16 2018
+++ src/sys/net/if_ether.h	Thu Jun 14 07:44:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.73 2018/06/14 07:39:16 yamaguchi Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.74 2018/06/14 07:44:31 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -247,46 +247,71 @@ struct ether_multistep {
 };
 
 /*
- * Macro for looking up the ether_multi record for a given range of Ethernet
- * multicast addresses connected to a given ethercom structure.  If no matching
- * record is found, "enm" returns NULL.
- */
+ * lookup the ether_multi record for a given range of Ethernet
+ * multicast addresses connected to a given ethercom structure.
+ * If no matching record is found, NULL is returned.
+ */
+static __inline struct ether_multi *
+ether_lookup_multi(const uint8_t *addrlo, const uint8_t *addrhi,
+const struct ethercom *ec)
+{
+	struct ether_multi *enm;
+
+	LIST_FOREACH(enm, >ec_multiaddrs, enm_list) {
+		if (memcmp(enm->enm_addrlo, addrlo, ETHER_ADDR_LEN) != 0)
+			continue;
+		if (memcmp(enm->enm_addrhi, addrhi, ETHER_ADDR_LEN) != 0)
+			continue;
+
+		break;
+	}
+
+	return enm;
+}
 #define ETHER_LOOKUP_MULTI(addrlo, addrhi, ec, enm)			\
 	/* uint8_t addrlo[ETHER_ADDR_LEN]; */\
 	/* uint8_t addrhi[ETHER_ADDR_LEN]; */\
 	/* struct ethercom *ec; */	\
 	/* struct ether_multi *enm; */	\
-{	\
-	for ((enm) = LIST_FIRST(&(ec)->ec_multiaddrs);			\
-	(enm) != NULL &&		\
-	(memcmp((enm)->enm_addrlo, (addrlo), ETHER_ADDR_LEN) != 0 ||	\
-	 memcmp((enm)->enm_addrhi, (addrhi), ETHER_ADDR_LEN) != 0);	\
-		(enm) = LIST_NEXT((enm), enm_list));			\
-}
+	(enm) = ether_lookup_multi((addrlo), (addrhi), (ec))
 
 /*
- * Macro to step through all of the ether_multi records, one at a time.
+ * step through all of the ether_multi records, one at a time.
  * The current position is remembered in "step", which the caller must
- * provide.  ETHER_FIRST_MULTI(), below, must be called to initialize "step"
- * and get the first record.  Both macros return a NULL "enm" when there
+ * provide.  ether_first_multi(), below, must be called to initialize "step"
+ * and get the first record.  Both functions return a NULL when there
  * are no remaining records.
  */
+static __inline struct ether_multi *
+ether_next_multi(struct ether_multistep *step)
+{
+	struct ether_multi *enm;
+
+	enm = step->e_enm;
+	if (enm != NULL)
+		step->e_enm = LIST_NEXT(enm, enm_list);
+
+	return enm;
+}
 #define ETHER_NEXT_MULTI(step, enm) \
 	/* struct ether_multistep step; */  \
 	/* struct ether_multi *enm; */  \
-{ \
-	if (((enm) = (step).e_enm) != NULL) \
-		(step).e_enm = LIST_NEXT((enm), enm_list); \
+	(enm) = ether_next_multi(&(step))
+
+static __inline struct ether_multi *
+ether_first_multi(struct ether_multistep *step, const struct ethercom *ec)
+{
+
+	step->e_enm = LIST_FIRST(>ec_multiaddrs);
+
+	return ether_next_multi(step);
 }
 
 #define ETHER_FIRST_MULTI(step, ec, enm) \
 	/* struct ether_multistep step; */ \
 	/* struct ethercom *ec; */ \
 	/* struct ether_multi *enm; */ \
-{ \
-	(step).e_enm = LIST_FIRST(&(ec)->ec_multiaddrs); \
-	ETHER_NEXT_MULTI((step), (enm)); \
-}
+	(enm) = ether_first_multi(&(step), (ec))
 
 #define ETHER_LOCK(ec)		mutex_enter((ec)->ec_lock)
 #define ETHER_UNLOCK(ec)	mutex_exit((ec)->ec_lock)



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:44:31 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Replace macros related to multicast address with inline functions

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/net/if_ether.h

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:39:16 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Move macros related to multicast address into #ifdef _KERNEL

Those macros and structure are only used in the kernel.
reviewed by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/net/if_ether.h

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



CVS commit: src/sys/net

2018-06-14 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jun 14 07:39:16 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
Move macros related to multicast address into #ifdef _KERNEL

Those macros and structure are only used in the kernel.
reviewed by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/net/if_ether.h

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

Modified files:

Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.72 src/sys/net/if_ether.h:1.73
--- src/sys/net/if_ether.h:1.72	Thu Apr 19 21:20:43 2018
+++ src/sys/net/if_ether.h	Thu Jun 14 07:39:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.72 2018/04/19 21:20:43 christos Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.73 2018/06/14 07:39:16 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -205,6 +205,13 @@ struct eccapreq {
 	int		eccr_capenable;		/* capabilities enabled */
 };
 
+/* sysctl for Ethernet multicast addresses */
+struct ether_multi_sysctl {
+	u_int   enm_refcount;
+	uint8_t enm_addrlo[ETHER_ADDR_LEN];
+	uint8_t enm_addrhi[ETHER_ADDR_LEN];
+};
+
 #ifdef	_KERNEL
 extern const uint8_t etherbroadcastaddr[ETHER_ADDR_LEN];
 extern const uint8_t ethermulticastaddr_slowprotocols[ETHER_ADDR_LEN];
@@ -217,7 +224,6 @@ int	ether_addmulti(const struct sockaddr
 int	ether_delmulti(const struct sockaddr *, struct ethercom *);
 int	ether_multiaddr(const struct sockaddr *, uint8_t[], uint8_t[]);
 voidether_input(struct ifnet *, struct mbuf *);
-#endif /* _KERNEL */
 
 /*
  * Ethernet multicast address structure.  There is one of these for each
@@ -232,12 +238,6 @@ struct ether_multi {
 	LIST_ENTRY(ether_multi) enm_list;
 };
 
-struct ether_multi_sysctl {
-	u_int   enm_refcount;
-	uint8_t enm_addrlo[ETHER_ADDR_LEN];
-	uint8_t enm_addrhi[ETHER_ADDR_LEN];
-};
-
 /*
  * Structure used by macros below to remember position when stepping through
  * all of the ether_multi records.
@@ -288,8 +288,6 @@ struct ether_multistep {
 	ETHER_NEXT_MULTI((step), (enm)); \
 }
 
-#ifdef _KERNEL
-
 #define ETHER_LOCK(ec)		mutex_enter((ec)->ec_lock)
 #define ETHER_UNLOCK(ec)	mutex_exit((ec)->ec_lock)
 



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 07:19:47 UTC 2018

Modified Files:
src/sys/dev/pci: if_skreg.h

Log Message:
 s/regisrer/register/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_skreg.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_skreg.h
diff -u src/sys/dev/pci/if_skreg.h:1.20 src/sys/dev/pci/if_skreg.h:1.21
--- src/sys/dev/pci/if_skreg.h:1.20	Thu Jun 14 06:58:15 2018
+++ src/sys/dev/pci/if_skreg.h	Thu Jun 14 07:19:47 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skreg.h,v 1.20 2018/06/14 06:58:15 msaitoh Exp $ */
+/* $NetBSD: if_skreg.h,v 1.21 2018/06/14 07:19:47 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -1079,7 +1079,7 @@
 #define SK_RBCTL_STORENFWD_OFF	0x10
 #define SK_RBCTL_STORENFWD_ON	0x20
 
-/* Block 24 -- RX MAC FIFO 1 regisrers and LINK_SYNC counter */
+/* Block 24 -- RX MAC FIFO 1 registers and LINK_SYNC counter */
 #define SK_RXF1_END		0x0C00
 #define SK_RXF1_WPTR		0x0C04
 #define SK_RXF1_RPTR		0x0C0C
@@ -1128,7 +1128,7 @@
 
 #define SK_RFCTL_FIFO_THRESHOLD 0x0a/* flush threshold (default) */
 
-/* Block 25 -- RX MAC FIFO 2 regisrers and LINK_SYNC counter */
+/* Block 25 -- RX MAC FIFO 2 registers and LINK_SYNC counter */
 #define SK_RXF2_END		0x0C80
 #define SK_RXF2_WPTR		0x0C84
 #define SK_RXF2_RPTR		0x0C8C
@@ -1174,7 +1174,7 @@
 #define SK_LINKLED_BLINK_OFF		0x0010
 #define SK_LINKLED_BLINK_ON		0x0020
 
-/* Block 26 -- TX MAC FIFO 1 regisrers  */
+/* Block 26 -- TX MAC FIFO 1 registers  */
 #define SK_TXF1_END		0x0D00
 #define SK_TXF1_WPTR		0x0D04
 #define SK_TXF1_RPTR		0x0D0C
@@ -1213,7 +1213,7 @@
 #define SK_TFCTL_RESET_CLEAR	0x0002	/* MAC FIFO Reset Clear */
 #define SK_TFCTL_RESET_SET	0x0001	/* MAC FIFO Reset Set */
 
-/* Block 27 -- TX MAC FIFO 2 regisrers  */
+/* Block 27 -- TX MAC FIFO 2 registers  */
 #define SK_TXF2_END		0x0D80
 #define SK_TXF2_WPTR		0x0D84
 #define SK_TXF2_RPTR		0x0D8C



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 07:19:47 UTC 2018

Modified Files:
src/sys/dev/pci: if_skreg.h

Log Message:
 s/regisrer/register/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_skreg.h

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



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 06:58:15 UTC 2018

Modified Files:
src/sys/dev/pci: if_skreg.h

Log Message:
 The revision number of Yukon FE A2 is not 0x3 but 0x2. Same as other OSes.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_skreg.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_skreg.h
diff -u src/sys/dev/pci/if_skreg.h:1.19 src/sys/dev/pci/if_skreg.h:1.20
--- src/sys/dev/pci/if_skreg.h:1.19	Wed Jun 13 20:17:03 2018
+++ src/sys/dev/pci/if_skreg.h	Thu Jun 14 06:58:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skreg.h,v 1.19 2018/06/13 20:17:03 jdolecek Exp $ */
+/* $NetBSD: if_skreg.h,v 1.20 2018/06/14 06:58:15 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -426,7 +426,7 @@
 #define SK_YUKON_EC_U_REV_B1	0x5
 
 #define SK_YUKON_FE_REV_A1	0x1
-#define SK_YUKON_FE_REV_A2	0x3
+#define SK_YUKON_FE_REV_A2	0x2
 
 #define SK_YUKON_FE_P_REV_A0	0x0
 



CVS commit: src/sys/dev/pci

2018-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 14 06:58:15 UTC 2018

Modified Files:
src/sys/dev/pci: if_skreg.h

Log Message:
 The revision number of Yukon FE A2 is not 0x3 but 0x2. Same as other OSes.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_skreg.h

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