CVS commit: [netbsd-9] src/sys/arch/cobalt/dev

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 07:58:57 UTC 2020

Modified Files:
src/sys/arch/cobalt/dev [netbsd-9]: gt.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #751):

sys/arch/cobalt/dev/gt.c: revision 1.30

The PCI I/O space extent map needs to reflect the BUS_{START,END}
not the SYS_{START,END}.

This fixes mapping of the viaide DMA registers on my Qube2.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.8.1 src/sys/arch/cobalt/dev/gt.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/cobalt/dev/gt.c
diff -u src/sys/arch/cobalt/dev/gt.c:1.29 src/sys/arch/cobalt/dev/gt.c:1.29.8.1
--- src/sys/arch/cobalt/dev/gt.c:1.29	Sat Jan 20 13:56:09 2018
+++ src/sys/arch/cobalt/dev/gt.c	Mon Mar  2 07:58:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gt.c,v 1.29 2018/01/20 13:56:09 skrll Exp $	*/
+/*	$NetBSD: gt.c,v 1.29.8.1 2020/03/02 07:58:57 martin Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.29 2018/01/20 13:56:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.29.8.1 2020/03/02 07:58:57 martin Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -132,7 +132,7 @@ gt_attach(device_t parent, device_t self
 	pc->pc_bsh = sc->sc_bsh;
 
 #ifdef PCI_NETBSD_CONFIGURE
-	pc->pc_ioext = extent_create("pciio", 0x10001000, 0x11ff,
+	pc->pc_ioext = extent_create("pciio", 0x1000, 0x01ff,
 	NULL, 0, EX_NOWAIT);
 	pc->pc_memext = extent_create("pcimem", 0x1200, 0x13ff,
 	NULL, 0, EX_NOWAIT);



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

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 07:55:24 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-9]: db_interface.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #750):

sys/arch/amd64/amd64/db_interface.c: revision 1.37

Fix boot -c or -d by avoiding ipi handling before the vector is initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/arch/amd64/amd64/db_interface.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/db_interface.c
diff -u src/sys/arch/amd64/amd64/db_interface.c:1.36 src/sys/arch/amd64/amd64/db_interface.c:1.36.4.1
--- src/sys/arch/amd64/amd64/db_interface.c:1.36	Thu Feb 14 07:12:40 2019
+++ src/sys/arch/amd64/amd64/db_interface.c	Mon Mar  2 07:55:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.36.4.1 2020/03/02 07:55:24 martin Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.36.4.1 2020/03/02 07:55:24 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -150,7 +150,9 @@ db_suspend_others(void)
 		xen_broadcast_ipi(XEN_IPI_DDB);
 #else
 #if NLAPIC > 0
-		x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+		if (ddb_vec != 0)
+			x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL,
+			LAPIC_DLMODE_FIXED);
 #endif
 #endif /* XENPV */
 	}



CVS commit: src/sys/dev/pci

2020-03-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar  2 06:38:06 UTC 2020

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

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_gem_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/sys/dev/pci/if_gem_pci.c
diff -u src/sys/dev/pci/if_gem_pci.c:1.49 src/sys/dev/pci/if_gem_pci.c:1.50
--- src/sys/dev/pci/if_gem_pci.c:1.49	Sun Mar  1 05:51:46 2020
+++ src/sys/dev/pci/if_gem_pci.c	Mon Mar  2 06:38:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $ */
+/*	$NetBSD: if_gem_pci.c,v 1.50 2020/03/02 06:38:06 msaitoh Exp $ */
 
 /*
  *
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.50 2020/03/02 06:38:06 msaitoh Exp $");
 
 #include 
 #include 
@@ -105,7 +105,7 @@ gem_pci_match(device_t parent, cfdata_t 
 	(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC ||
 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC2 ||
 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC3 ||
- 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
+	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_K2_GMAC ||
 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
 	 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_INTREPID2_GMAC))
@@ -219,12 +219,14 @@ gem_pci_attach(device_t parent, device_t
 	PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
 	&sc->sc_bustag, &sc->sc_h1, NULL, &sc->sc_size) != 0)
 	{
-		aprint_error_dev(sc->sc_dev, "unable to map device registers\n");
+		aprint_error_dev(sc->sc_dev,
+		"unable to map device registers\n");
 		return;
 	}
 	if (bus_space_subregion(sc->sc_bustag, sc->sc_h1,
 	GEM_PCI_BANK2_OFFSET, GEM_PCI_BANK2_SIZE, &sc->sc_h2)) {
-		aprint_error_dev(sc->sc_dev, "unable to create bank 2 subregion\n");
+		aprint_error_dev(sc->sc_dev,
+		"unable to create bank 2 subregion\n");
 		return;
 	}
 
@@ -233,7 +235,7 @@ gem_pci_attach(device_t parent, device_t
 		memcpy(enaddr, prop_data_data_nocopy(data), ETHER_ADDR_LEN);
 		got_addr = 1;
 		if ((data = prop_dictionary_get(device_properties(sc->sc_dev),
-		"shared-pins")) != NULL) {
+		"shared-pins")) != NULL) {
 			memcpy(buf, prop_data_data_nocopy(data),
 			prop_data_size(data));
 			if (isserdes(buf)) {
@@ -242,12 +244,12 @@ gem_pci_attach(device_t parent, device_t
 		}
 	} else {
 		/*
-		 * Dig out VPD (vital product data) and acquire Ethernet address.
-		 * The VPD of gem resides in the PCI PROM (PCI FCode).
+		 * Dig out VPD (vital product data) and acquire Ethernet
+		 * address. The VPD of gem resides in the PCI PROM (PCI FCode).
 		 */
 		/*
-		 * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later)
-		 * chapter 2 describes the data structure.
+		 * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and
+		 * later) chapter 2 describes the data structure.
 		 */
 
 		enp = NULL;
@@ -279,8 +281,8 @@ gem_pci_attach(device_t parent, device_t
 			}
 #ifdef GEM_DEBUG
 			/* PROM dump */
-			printf("%s: PROM dump (0x to %04zx)\n", device_xname(sc->sc_dev),
-			(sizeof buf) - 1);
+			printf("%s: PROM dump (0x to %04zx)\n",
+			device_xname(sc->sc_dev), (sizeof buf) - 1);
 			i = 0;
 			j = 0;
 			printf("  %04x  ", i);
@@ -310,23 +312,24 @@ gem_pci_attach(device_t parent, device_t
 (buf[PROMHDR_PTR_DATA + 1] << 8))) >= 0x1c) {
 
 /* read PCI Expansion PROM Data */
-bus_space_read_region_1(sc->sc_bustag, romh, dataoff,
-buf, 64);
+bus_space_read_region_1(sc->sc_bustag, romh,
+dataoff, buf, 64);
 if (memcmp(buf, promdat, sizeof promdat) == 0 &&
 gempromvalid(buf + PROMDATA_DATA2) &&
 (vpdoff = (buf[PROMDATA_PTR_VPD] |
 	(buf[PROMDATA_PTR_VPD + 1] << 8))) >= 0x1c) {
 
 	/*
-	 * The VPD of gem is not in PCI 2.2 standard
-	 * format.  The length in the resource header
-	 * is in big endian, and resources are not
-	 * properly terminated (only one resource
-	 * and no end tag).
+	 * The VPD of gem is not in PCI 2.2
+	 * standard format.  The length in the
+	 * resource header is in big endian,
+	 * and resources are not properly
+	 * terminated (only one resource and no
+	 * end tag).
 	 */
 	/* read PCI VPD */
-	bus_space_read_region_1(sc->sc_bustag, romh,
-	vpdoff, buf, 64);
+	bus_space_read_region_1(sc->sc_bustag,
+	romh, vpdoff, buf, 64);
 	vpd = (void *)(buf + 3);
 	if (PCI_VPDRES_ISLARGE(buf[0]) &&
 	PCI_VPDRES_LARGE_NAME(buf[0])
@@ -349,7 +352,8 @@ gem_pci_attach(device_t parent, device_t
 		}
 	}
 	if (!got_addr) {
-		printf("%s: no Ethernet address foun

CVS commit: src/tests/dev/audio

2020-03-01 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Mar  2 04:25:08 UTC 2020

Modified Files:
src/tests/dev/audio: Makefile

Log Message:
Re-add -lrumpdev dropped in the previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/dev/audio/Makefile

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

Modified files:

Index: src/tests/dev/audio/Makefile
diff -u src/tests/dev/audio/Makefile:1.8 src/tests/dev/audio/Makefile:1.9
--- src/tests/dev/audio/Makefile:1.8	Sun Mar  1 18:08:12 2020
+++ src/tests/dev/audio/Makefile	Mon Mar  2 04:25:08 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2020/03/01 18:08:12 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2020/03/02 04:25:08 isaki Exp $
 #
 
 .include 
@@ -21,7 +21,7 @@ BINDIR=		${TESTSDIR}
 MKMAN=no
 
 CPPFLAGS+=	-D_KERNTYPES
-LDADD+=	-lrumpdev_pad -lrumpdev_audio ${LIBRUMPBASE}
+LDADD+=	-lrumpdev_pad -lrumpdev_audio -lrumpdev ${LIBRUMPBASE}
 
 WARNS=	4
 NOMAN=



CVS commit: src/sys/arch/powerpc/booke

2020-03-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Mar  2 03:34:28 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyin.c

Log Message:
Let copyinstr(9) return ENAMETOOLONG correctly if source is not
NUL-terminated; it cannot be determined by (uint8_t)data == '\0'
since data is right shifted at the end of loop.

Found by POOL_REDZONE.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/copyin.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/copyin.c
diff -u src/sys/arch/powerpc/booke/copyin.c:1.7 src/sys/arch/powerpc/booke/copyin.c:1.8
--- src/sys/arch/powerpc/booke/copyin.c:1.7	Sun Apr  7 05:25:55 2019
+++ src/sys/arch/powerpc/booke/copyin.c	Mon Mar  2 03:34:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $	*/
+/*	$NetBSD: copyin.c,v 1.8 2020/03/02 03:34:28 rin Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.8 2020/03/02 03:34:28 rin Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 
@@ -306,6 +306,7 @@ copyinstr(const void *usaddr, void *kdad
 {
 	struct pcb * const pcb = lwp_getpcb(curlwp);
 	struct faultbuf env;
+	int rv;
 
 	if (__predict_false(len == 0)) {
 		if (done)
@@ -313,7 +314,7 @@ copyinstr(const void *usaddr, void *kdad
 		return 0;
 	}
 
-	int rv = setfault(&env);
+	rv = setfault(&env);
 	if (rv != 0) {
 		pcb->pcb_onfault = NULL;
 		if (done)
@@ -346,15 +347,14 @@ copyinstr(const void *usaddr, void *kdad
 		*kdaddr8++ = data;
 		if ((uint8_t) data == 0) {
 			copylen++;
-			break;
+			goto out;
 		}
 	}
+	rv = ENAMETOOLONG;
 
+out:
 	pcb->pcb_onfault = NULL;
 	if (done)
 		*done = copylen;
-	/*
-	 * If the last byte is not NUL (0), then the name is too long.
-	 */
-	return (uint8_t)data ? ENAMETOOLONG : 0;
+	return rv;
 }



CVS commit: src/sys/arch/cobalt/dev

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Mar  2 01:46:02 UTC 2020

Modified Files:
src/sys/arch/cobalt/dev: gt.c

Log Message:
The PCI I/O space extent map needs to reflect the BUS_{START,END}
not the SYS_{START,END}.

This fixes mapping of the viaide DMA registers on my Qube2.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/cobalt/dev/gt.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/cobalt/dev/gt.c
diff -u src/sys/arch/cobalt/dev/gt.c:1.29 src/sys/arch/cobalt/dev/gt.c:1.30
--- src/sys/arch/cobalt/dev/gt.c:1.29	Sat Jan 20 13:56:09 2018
+++ src/sys/arch/cobalt/dev/gt.c	Mon Mar  2 01:46:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gt.c,v 1.29 2018/01/20 13:56:09 skrll Exp $	*/
+/*	$NetBSD: gt.c,v 1.30 2020/03/02 01:46:02 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.29 2018/01/20 13:56:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.30 2020/03/02 01:46:02 thorpej Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -132,7 +132,7 @@ gt_attach(device_t parent, device_t self
 	pc->pc_bsh = sc->sc_bsh;
 
 #ifdef PCI_NETBSD_CONFIGURE
-	pc->pc_ioext = extent_create("pciio", 0x10001000, 0x11ff,
+	pc->pc_ioext = extent_create("pciio", 0x1000, 0x01ff,
 	NULL, 0, EX_NOWAIT);
 	pc->pc_memext = extent_create("pcimem", 0x1200, 0x13ff,
 	NULL, 0, EX_NOWAIT);



CVS commit: src

2020-03-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  1 23:23:36 UTC 2020

Modified Files:
src/common/lib/libc/arch/powerpc/atomic: atomic_cas.S atomic_op_asm.h
atomic_swap.S
src/sys/arch/evbppc/conf: std.obs200 std.obs266 std.virtex std.walnut
src/sys/arch/powerpc/ibm4xx: 4xx_trap_subr.S trap_subr.S
src/sys/arch/powerpc/include: asm.h lock.h
src/sys/arch/powerpc/powerpc: lock_stubs.S locore_subr.S trap_subr.S

Log Message:
Implement workaround for IBM405 Errata 77 (aka CPU_210), where
interrupted stwcx. may errantly write data to memory:

https://elinux.org/images/1/1d/Ppc405gp-errata.pdf

This is because stwcx. is split into two pieces in the pipeline.

We need to
(1) insert dcbt before every stwcx. instruction, as well as
(2) insert sync before every rfi/rfci instruction.

It is unclear which processors are affected, but according to Linux,
all 405-based cores up until 405GPR and 405EP are affected:


https://github.com/torvalds/linux/blob/master/arch/powerpc/platforms/40x/Kconfig#L140

For kernel, this workaround can be restricted to affected processors.
However, for kernel modules and userland, we have to enable it for all
32bit powerpc archs in order to share common binaries as before.

Proposed on port-powerpc:

http://mail-index.netbsd.org/port-powerpc/2020/02/21/msg003583.html


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h
cvs rdiff -u -r1.7 -r1.8 \
src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/conf/std.obs200
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/conf/std.obs266
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/conf/std.virtex
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbppc/conf/std.walnut
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/ibm4xx/trap_subr.S
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/include/asm.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/lock.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/powerpc/lock_stubs.S
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/powerpc/powerpc/locore_subr.S
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/powerpc/powerpc/trap_subr.S

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

Modified files:

Index: src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S
diff -u src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S:1.8 src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S:1.9
--- src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S:1.8	Fri Mar  7 07:17:54 2014
+++ src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S	Sun Mar  1 23:23:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas.S,v 1.8 2014/03/07 07:17:54 matt Exp $	*/
+/*	$NetBSD: atomic_cas.S,v 1.9 2020/03/01 23:23:36 rin Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "atomic_op_asm.h"
 
-__RCSID("$NetBSD: atomic_cas.S,v 1.8 2014/03/07 07:17:54 matt Exp $")
+__RCSID("$NetBSD: atomic_cas.S,v 1.9 2020/03/01 23:23:36 rin Exp $")
 
 	.text
 ENTRY(_atomic_cas_32)
@@ -39,6 +39,7 @@ ENTRY(_atomic_cas_32)
 1:	lwarx	%r3,0,%r10
 	cmpw	%r3,%r4
 	bnelr-
+	IBM405_ERRATA77_DCBT(0,%r10)
 	stwcx.	%r5,0,%r10
 	beqlr+
 	b	1b

Index: src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h
diff -u src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h:1.6 src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h:1.7
--- src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h:1.6	Fri Mar  7 07:17:54 2014
+++ src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h	Sun Mar  1 23:23:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_op_asm.h,v 1.6 2014/03/07 07:17:54 matt Exp $	*/
+/*	$NetBSD: atomic_op_asm.h,v 1.7 2020/03/01 23:23:36 rin Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@ ENTRY(_atomic_##op##_32)	; \
 	mr	%r10,%r3	; \
 1:	lwarx	%r3,0,%r10	; \
 	insn	%r5,%r3,arg	; \
+	IBM405_ERRATA77_DCBT(0,%r10) ; \
 	stwcx.	%r5,0,%r10	; \
 	beqlr+			; \
 	b	1b		; \
@@ -71,6 +72,7 @@ ENTRY(_atomic_##op##_32_nv)	; \
 	mr	%r10,%r3	; \
 1:	lwarx	%r3,0,%r10	; \
 	insn	%r3,%r3,arg	; \
+	IBM405_ERRATA77_DCBT(0,%r10) ; \
 	stwcx.	%r3,0,%r10	; \
 	beqlr+			; \
 	b	1b		; \

Index: src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S
diff -u src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S:1.7 src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S:1.8
--- src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S:1.7	Fri Mar  7 07:17:54 2014
+++ src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S	Sun Mar  1 23:23:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_swap.S,v 1.7 2014/03/07 07:17:54 matt Exp $	*/
+/*	$NetBSD: atomic_swap.S,v 1.8 2020/03/01 23:23:36 rin Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -31,12 

CVS commit: src/distrib/utils/libhack

2020-03-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Mar  1 22:47:26 UTC 2020

Modified Files:
src/distrib/utils/libhack: Makefile.inc

Log Message:
libhack: build with -D_REENTRANT

Some tools that use libhack expect thread locking.
An example of this is zpool(8).

Without it, it randomly crashes. As such, force _REENTRANT to avoid
debugging future random crashes from any other applications which
rely on this.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/utils/libhack/Makefile.inc

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

Modified files:

Index: src/distrib/utils/libhack/Makefile.inc
diff -u src/distrib/utils/libhack/Makefile.inc:1.32 src/distrib/utils/libhack/Makefile.inc:1.33
--- src/distrib/utils/libhack/Makefile.inc:1.32	Sun Jul 28 10:27:57 2019
+++ src/distrib/utils/libhack/Makefile.inc	Sun Mar  1 22:47:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.32 2019/07/28 10:27:57 martin Exp $
+# $NetBSD: Makefile.inc,v 1.33 2020/03/01 22:47:26 roy Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -20,6 +20,13 @@
 
 CPPFLAGS+=	-DSMALL
 CPPFLAGS+=	-DLIBHACK
+
+# Build as re-entrant.
+# A few tool using libhack, such as zpool on the ramdisk-zfsroot,
+# expect this and it's simpler just to set it globally rather than
+# debugging why stuff randomly crashes.
+CPPFLAGS+=	-D_REENTRANT
+
 HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
 		nl_langinfo.o strcasecmp.o \



CVS commit: src/include

2020-03-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar  1 22:08:17 UTC 2020

Modified Files:
src/include: stddef.h

Log Message:
Revert previous

Requested by joerg who wants to fix (ab)users.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/include/stddef.h

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

Modified files:

Index: src/include/stddef.h
diff -u src/include/stddef.h:1.22 src/include/stddef.h:1.23
--- src/include/stddef.h:1.22	Sun Mar  1 15:18:34 2020
+++ src/include/stddef.h	Sun Mar  1 22:08:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stddef.h,v 1.22 2020/03/01 15:18:34 kamil Exp $	*/
+/*	$NetBSD: stddef.h,v 1.23 2020/03/01 22:08:17 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -67,8 +67,7 @@ typedef	_BSD_WCHAR_T_	wchar_t;
 (&reinterpret_cast(static_cast(0)->member
 #endif  
 
-#if (__STDC_VERSION__ - 0) > 199901L || defined(__cplusplus)
-/* Introduced in C11/C++11, as an extension exposed to C99/C++98 */
+#if (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
 typedef union {
 	void *_v;
 	long double _ld;



CVS commit: src/sys/uvm

2020-03-01 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  1 21:43:56 UTC 2020

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
uvm_pglistalloc() / uvm_pglistfree() musn't be called from interrupt
context.  Assert it.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.80 src/sys/uvm/uvm_pglist.c:1.81
--- src/sys/uvm/uvm_pglist.c:1.80	Thu Feb 20 04:54:47 2020
+++ src/sys/uvm/uvm_pglist.c	Sun Mar  1 21:43:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.81 2020/03/01 21:43:56 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.81 2020/03/01 21:43:56 ad Exp $");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -514,6 +515,8 @@ uvm_pglistalloc(psize_t size, paddr_t lo
 {
 	int num, res;
 
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
 	KASSERT((alignment & (alignment - 1)) == 0);
 	KASSERT((boundary & (boundary - 1)) == 0);
 
@@ -562,6 +565,9 @@ uvm_pglistfree(struct pglist *list)
 	struct vm_page *pg;
 	int c, b;
 
+	KASSERT(!cpu_intr_p());
+	KASSERT(!cpu_softintr_p());
+
 	/*
 	 * Lock the free list and free each page.
 	 */



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

2020-03-01 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  1 21:42:58 UTC 2020

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

Log Message:
- Give pmap uvm_objects an empty pagerops to avoid special casing in UVM.
  (This use of uvm_object causes a disproportionate amount of work.)

- Undo the pmap_destroy()/pmap_delref() split.  I misunderstood the flow of
  control, and there's no need for this.

- For pmap_remove_pv(), always look up the pv_entry in advance as those
  calls will need to be covered by lock again soon.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/sys/arch/x86/x86/pmap.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/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.360 src/sys/arch/x86/x86/pmap.c:1.361
--- src/sys/arch/x86/x86/pmap.c:1.360	Sat Feb 29 20:17:11 2020
+++ src/sys/arch/x86/x86/pmap.c	Sun Mar  1 21:42:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.361 2020/03/01 21:42:58 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.360 2020/02/29 20:17:11 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.361 2020/03/01 21:42:58 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -252,6 +252,10 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3
 #define	PMAP_DUMMY_UNLOCK(pm)
 #endif
 
+static const struct uvm_pagerops pmap_pager = {
+	/* nothing */
+};
+
 const vaddr_t ptp_masks[] = PTP_MASK_INITIALIZER;
 const vaddr_t ptp_frames[] = PTP_FRAME_INITIALIZER;
 const int ptp_shifts[] = PTP_SHIFT_INITIALIZER;
@@ -444,7 +448,6 @@ static void pmap_alloc_level(struct pmap
 
 static void pmap_load1(struct lwp *, struct pmap *, struct pmap *);
 static void pmap_reactivate(struct pmap *);
-static void pmap_dropref(struct pmap *);
 
 /*
  * p m a p   h e l p e r   f u n c t i o n s
@@ -677,7 +680,7 @@ pmap_unmap_ptes(struct pmap *pmap, struc
 
 	/* Toss reference to other pmap taken earlier. */
 	if (pmap2 != NULL) {
-		pmap_dropref(pmap2);
+		pmap_destroy(pmap2);
 	}
 }
 
@@ -1024,16 +1027,12 @@ pmap_bootstrap(vaddr_t kva_start)
 	 *
 	 * The kernel pmap's pm_obj is not used for much. However, in user pmaps
 	 * the pm_obj contains the list of active PTPs.
-	 *
-	 * The pm_obj currently does not have a pager. It might be possible to
-	 * add a pager that would allow a process to read-only mmap its own page
-	 * tables (fast user-level vtophys?). This may or may not be useful.
 	 */
 	kpm = pmap_kernel();
 	mutex_init(&kpm->pm_lock, MUTEX_DEFAULT, IPL_NONE);
 	rw_init(&kpm->pm_dummy_lock);
 	for (i = 0; i < PTP_LEVELS - 1; i++) {
-		uvm_obj_init(&kpm->pm_obj[i], NULL, false, 1);
+		uvm_obj_init(&kpm->pm_obj[i], &pmap_pager, false, 1);
 		uvm_obj_setlock(&kpm->pm_obj[i], &kpm->pm_dummy_lock);
 		kpm->pm_ptphint[i] = NULL;
 	}
@@ -1930,7 +1929,7 @@ pmap_enter_pv(struct pmap *pmap, struct 
  * => we return the removed pve
  * => caller can optionally supply pve, if looked up already
  */
-static struct pv_entry *
+static void
 pmap_remove_pv(struct pmap *pmap, struct pmap_page *pp, struct vm_page *ptp,
 vaddr_t va, struct pv_entry *pve)
 {
@@ -1947,19 +1946,13 @@ pmap_remove_pv(struct pmap *pmap, struct
 		pp->pp_flags &= ~PP_EMBEDDED;
 		pp->pp_pte.pte_ptp = NULL;
 		pp->pp_pte.pte_va = 0;
-		return NULL;
-	}
-
-	if (pve == NULL) {
-		pve = pmap_pvmap_lookup(pmap, va);
-		KASSERT(pve != NULL);
 	} else {
+		KASSERT(pve != NULL);
 		KASSERT(pve == pmap_pvmap_lookup(pmap, va));
+		KASSERT(pve->pve_pte.pte_ptp == ptp);
+		KASSERT(pve->pve_pte.pte_va == va);
+		LIST_REMOVE(pve, pve_list);
 	}
-	KASSERT(pve->pve_pte.pte_ptp == ptp);
-	KASSERT(pve->pve_pte.pte_va == va);
-	LIST_REMOVE(pve, pve_list);
-	return pve;
 }
 
 /*
@@ -2487,7 +2480,7 @@ pmap_create(void)
 
 	/* init uvm_object */
 	for (i = 0; i < PTP_LEVELS - 1; i++) {
-		uvm_obj_init(&pmap->pm_obj[i], NULL, false, 1);
+		uvm_obj_init(&pmap->pm_obj[i], &pmap_pager, false, 1);
 		uvm_obj_setlock(&pmap->pm_obj[i], &pmap->pm_dummy_lock);
 		pmap->pm_ptphint[i] = NULL;
 	}
@@ -2545,7 +2538,7 @@ pmap_check_inuse(struct pmap *pmap)
 		for (int i = 0; i < PDIR_SLOT_USERLIM; i++) {
 			if (pmap->pm_pdir[i] != 0 &&
 			ci->ci_kpm_pdir[i] == pmap->pm_pdir[i]) {
-printf("pmap_dropref(%p) pmap_kernel %p "
+printf("pmap_destroy(%p) pmap_kernel %p "
 "curcpu %d cpu %d ci_pmap %p "
 "ci->ci_kpm_pdir[%d]=%" PRIx64
 " pmap->pm_pdir[%d]=%" PRIx64 "\n",
@@ -2562,29 +2555,22 @@ pmap_check_inuse(struct pmap *pmap)
 }
 
 /*
- * pmap_destroy:  pmap is being destroyed by UVM.
- */
-void
-pmap_destroy(struct pmap *pmap)
-{
-
-	/* Undo pmap_remove_all(), then drop the reference. */
-	pmap_update(pmap);
-	pmap_dropref(pmap);
-}
-
-/*
- * pmap_dropref:  drop reference count on pmap.  free pmap if ref

CVS commit: src/sys/arch/hppa/hppa

2020-03-01 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  1 21:40:45 UTC 2020

Modified Files:
src/sys/arch/hppa/hppa: pmap.c

Log Message:
Give pmap uvm_objects an empty pagerops to avoid special casing in UVM.
(This use of uvm_object causes a disproportionate amount of work.)


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.104 src/sys/arch/hppa/hppa/pmap.c:1.105
--- src/sys/arch/hppa/hppa/pmap.c:1.104	Mon Feb 24 20:42:18 2020
+++ src/sys/arch/hppa/hppa/pmap.c	Sun Mar  1 21:40:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.104 2020/02/24 20:42:18 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 2020/02/24 20:42:18 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $");
 
 #include "opt_cputype.h"
 
@@ -158,6 +158,10 @@ static kmutex_t	pmaps_lock;
 u_int	hppa_prot[8];
 u_int	sid_counter;
 
+static const struct uvm_pagerops pmap_pager = {
+	/* nothing */
+};
+
 /*
  * Page 3-6 of the "PA-RISC 1.1 Architecture and Instruction Set
  * Reference Manual" (HP part number 09740-90039) defines equivalent
@@ -696,7 +700,7 @@ pmap_bootstrap(vaddr_t vstart)
 	memset(kpm, 0, sizeof(*kpm));
 
 	rw_init(&kpm->pm_obj_lock);
-	uvm_obj_init(&kpm->pm_obj, NULL, false, 1);
+	uvm_obj_init(&kpm->pm_obj, &pmap_pager, false, 1);
 	uvm_obj_setlock(&kpm->pm_obj, &kpm->pm_obj_lock);
 
 	kpm->pm_space = HPPA_SID_KERNEL;
@@ -1059,7 +1063,7 @@ pmap_create(void)
 	DPRINTF(PDB_FOLLOW|PDB_PMAP, ("%s: pmap = %p\n", __func__, pmap));
 
 	rw_init(&pmap->pm_obj_lock);
-	uvm_obj_init(&pmap->pm_obj, NULL, false, 1);
+	uvm_obj_init(&pmap->pm_obj, &pmap_pager, false, 1);
 	uvm_obj_setlock(&pmap->pm_obj, &pmap->pm_obj_lock);
 
 	mutex_enter(&pmaps_lock);



CVS commit: src/sys/kern

2020-03-01 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  1 21:39:07 UTC 2020

Modified Files:
src/sys/kern: vfs_subr.c

Log Message:
reassignbuf(), brelvp(): VI_WRMAPDIRTY is always clear if the object has no
pages, so assert that instead of trying to clear it.


To generate a diff of this commit:
cvs rdiff -u -r1.482 -r1.483 src/sys/kern/vfs_subr.c

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

Modified files:

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.482 src/sys/kern/vfs_subr.c:1.483
--- src/sys/kern/vfs_subr.c:1.482	Thu Feb 27 22:12:54 2020
+++ src/sys/kern/vfs_subr.c	Sun Mar  1 21:39:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.482 2020/02/27 22:12:54 ad Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.483 2020/03/01 21:39:07 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.482 2020/02/27 22:12:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.483 2020/03/01 21:39:07 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -423,12 +423,7 @@ brelvp(struct buf *bp)
 
 	if ((vp->v_iflag & (VI_ONWORKLST | VI_PAGES)) == VI_ONWORKLST &&
 	LIST_FIRST(&vp->v_dirtyblkhd) == NULL) {
-		/*
-		 * Okay to clear VI_WRMAPDIRTY without the uvm_object locked
-		 * here, because new pages can't be inserted without first
-		 * taking v_interlock (which is held here).
-		 */
-		vp->v_iflag &= ~VI_WRMAPDIRTY;
+		KASSERT((vp->v_iflag & VI_WRMAPDIRTY) == 0);
 		vn_syncer_remove_from_worklist(vp);
 	}
 
@@ -469,13 +464,7 @@ reassignbuf(struct buf *bp, struct vnode
 		if ((vp->v_iflag & (VI_ONWORKLST | VI_PAGES)) ==
 		VI_ONWORKLST &&
 		LIST_FIRST(&vp->v_dirtyblkhd) == NULL) {
-			/*
-			 * Okay to clear VI_WRMAPDIRTY without the
-			 * uvm_object locked here, because new pages can't
-			 * be inserted without first taking v_interlock
-			 * (which is held here).
-			 */
-			vp->v_iflag &= ~VI_WRMAPDIRTY;
+			KASSERT((vp->v_iflag & VI_WRMAPDIRTY) == 0);
 			vn_syncer_remove_from_worklist(vp);
 		}
 	} else {



CVS commit: src/sys/kern

2020-03-01 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar  1 21:37:27 UTC 2020

Modified Files:
src/sys/kern: kern_fork.c

Log Message:
child_return():

- This was assuming arg == curlwp, but NULL is passed to lwp_create(), as
  evidenced by a random panic during testing.  How did this ever work?

- Replace a goto.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/kern/kern_fork.c

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

Modified files:

Index: src/sys/kern/kern_fork.c
diff -u src/sys/kern/kern_fork.c:1.218 src/sys/kern/kern_fork.c:1.219
--- src/sys/kern/kern_fork.c:1.218	Wed Jan 29 15:47:52 2020
+++ src/sys/kern/kern_fork.c	Sun Mar  1 21:37:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_fork.c,v 1.218 2020/01/29 15:47:52 ad Exp $	*/
+/*	$NetBSD: kern_fork.c,v 1.219 2020/03/01 21:37:26 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008, 2019
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.218 2020/01/29 15:47:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.219 2020/03/01 21:37:26 ad Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -627,23 +627,20 @@ fork1(struct lwp *l1, int flags, int exi
 void
 child_return(void *arg)
 {
-	struct lwp *l = arg;
+	struct lwp *l = curlwp;
 	struct proc *p = l->l_proc;
 
-	if (p->p_slflag & PSL_TRACED) {
+	if ((p->p_slflag & PSL_TRACED) != 0) {
 		/* Paranoid check */
 		mutex_enter(proc_lock);
-		if (!(p->p_slflag & PSL_TRACED)) {
+		if ((p->p_slflag & PSL_TRACED) != 0) {
+			mutex_enter(p->p_lock);
+			eventswitch(TRAP_CHLD, ISSET(p->p_lflag, PL_PPWAIT) ?
+			PTRACE_VFORK : PTRACE_FORK, p->p_opptr->p_pid);
+		} else
 			mutex_exit(proc_lock);
-			goto my_tracer_is_gone;
-		}
-		mutex_enter(p->p_lock);
-		eventswitch(TRAP_CHLD,
-		ISSET(p->p_lflag, PL_PPWAIT) ? PTRACE_VFORK : PTRACE_FORK,
-		p->p_opptr->p_pid);
 	}
 
-my_tracer_is_gone:
 	md_child_return(l);
 
 	/*



CVS commit: src

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 20:59:54 UTC 2020

Modified Files:
src/crypto/external/bsd/openssh/bin/scp: Makefile
src/crypto/external/bsd/openssh/bin/sftp: Makefile
src/crypto/external/bsd/openssh/bin/sftp-server: Makefile
src/crypto/external/bsd/openssh/bin/ssh: Makefile
src/crypto/external/bsd/openssh/bin/ssh-add: Makefile
src/crypto/external/bsd/openssh/bin/ssh-agent: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keygen: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keyscan: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keysign: Makefile
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper: Makefile
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/lib: Makefile
src/distrib/evbarm/instkernel/sshramdisk: Makefile list
src/lib/libpam/modules/pam_ssh: Makefile
src/rescue: Makefile

Log Message:
Redo the sshsk_sign() stuff properly, but putting the helper in libssh.so


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/bin/scp/Makefile
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssh/bin/sftp/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssh/bin/sftp-server/Makefile
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/openssh/bin/ssh/Makefile
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/bin/ssh-add/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssh/bin/ssh-keysign/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/lib/Makefile
cvs rdiff -u -r1.22 -r1.23 src/distrib/evbarm/instkernel/sshramdisk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/evbarm/instkernel/sshramdisk/list
cvs rdiff -u -r1.12 -r1.13 src/lib/libpam/modules/pam_ssh/Makefile
cvs rdiff -u -r1.40 -r1.41 src/rescue/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssh/bin/scp/Makefile
diff -u src/crypto/external/bsd/openssh/bin/scp/Makefile:1.2 src/crypto/external/bsd/openssh/bin/scp/Makefile:1.3
--- src/crypto/external/bsd/openssh/bin/scp/Makefile:1.2	Wed Feb 26 19:24:38 2020
+++ src/crypto/external/bsd/openssh/bin/scp/Makefile	Sun Mar  1 15:59:52 2020
@@ -1,8 +1,7 @@
-#	$NetBSD: Makefile,v 1.2 2020/02/27 00:24:38 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2020/03/01 20:59:52 christos Exp $
 
 BINDIR=/usr/bin
 
 PROG=	scp
-SRCS=	scp.c ssh-sk-client.c
 
 .include 

Index: src/crypto/external/bsd/openssh/bin/sftp/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sftp/Makefile:1.8 src/crypto/external/bsd/openssh/bin/sftp/Makefile:1.9
--- src/crypto/external/bsd/openssh/bin/sftp/Makefile:1.8	Wed Feb 26 19:24:38 2020
+++ src/crypto/external/bsd/openssh/bin/sftp/Makefile	Sun Mar  1 15:59:52 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.8 2020/02/27 00:24:38 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2020/03/01 20:59:52 christos Exp $
 
 BINDIR=	/usr/bin
 
 PROG=	sftp
-SRCS=	sftp.c sftp-client.c sftp-common.c sftp-glob.c ssh-sk-client.c
+SRCS=	sftp.c sftp-client.c sftp-common.c sftp-glob.c
 MAN=	sftp.1
 
 LDADD+=	-ledit -lterminfo

Index: src/crypto/external/bsd/openssh/bin/sftp-server/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sftp-server/Makefile:1.3 src/crypto/external/bsd/openssh/bin/sftp-server/Makefile:1.4
--- src/crypto/external/bsd/openssh/bin/sftp-server/Makefile:1.3	Wed Feb 26 19:24:39 2020
+++ src/crypto/external/bsd/openssh/bin/sftp-server/Makefile	Sun Mar  1 15:59:52 2020
@@ -1,10 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2020/02/27 00:24:39 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2020/03/01 20:59:52 christos Exp $
 
 BINDIR=	/usr/libexec
 
 PROG=	sftp-server
-SRCS=	sftp-server.c sftp-common.c sftp-server-main.c sftp-realpath.c \
-	ssh-sk-client.c
+SRCS=	sftp-server.c sftp-common.c sftp-server-main.c sftp-realpath.c
 MAN=	sftp-server.8
 
 .include 

Index: src/crypto/external/bsd/openssh/bin/ssh/Makefile
diff -u src/crypto/external/bsd/openssh/bin/ssh/Makefile:1.16 src/crypto/external/bsd/openssh/bin/ssh/Makefile:1.17
--- src/crypto/external/bsd/openssh/bin/ssh/Makefile:1.16	Wed Feb 26 19:24:39 2020
+++ src/crypto/external/bsd/openssh/bin/ssh/Makefile	Sun Mar  1 15:59:53 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2020/02/27 00:24:39 christos Exp $
+#	$NetBSD: Makefile,v 1.17 2020/03/01 20:59:53 christos Exp $
 
 .include 
 
@@ -6,8 +6,7 @@ BINDIR = /usr/bin
 
 PRO

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

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 20:24:07 UTC 2020

Modified Files:
src/tests/lib/libc/sys: Makefile

Log Message:
fix variable name


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/tests/lib/libc/sys/Makefile

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

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.59 src/tests/lib/libc/sys/Makefile:1.60
--- src/tests/lib/libc/sys/Makefile:1.59	Sun Mar  1 13:08:15 2020
+++ src/tests/lib/libc/sys/Makefile	Sun Mar  1 15:24:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2020/03/01 18:08:15 christos Exp $
+# $NetBSD: Makefile,v 1.60 2020/03/01 20:24:07 christos Exp $
 
 MKMAN=	no
 
@@ -98,7 +98,7 @@ LDADD.t_ptrace_waitpid+=	-pthread -lm -l
 .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE)
 CPPFLAGS.t_posix_fadvise.c += -D_KERNTYPES
 TESTS_C+=		t_posix_fadvise
-LDADD.t_posix_fadvise+= ${RUMPVFSLIB}
+LDADD.t_posix_fadvise+= ${LIBRUMPBASE}
 .endif
 
 CPPFLAGS.t_lwp_create.c		+= -D_KERNTYPES



CVS commit: src/tests/dev/usb

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 20:19:55 UTC 2020

Modified Files:
src/tests/dev/usb/t_hid: Makefile
Added Files:
src/tests/dev/usb: Makefile.inc

Log Message:
fix build by adding a Makefile.inc that chains up.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/dev/usb/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/tests/dev/usb/t_hid/Makefile

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

Modified files:

Index: src/tests/dev/usb/t_hid/Makefile
diff -u src/tests/dev/usb/t_hid/Makefile:1.4 src/tests/dev/usb/t_hid/Makefile:1.5
--- src/tests/dev/usb/t_hid/Makefile:1.4	Sun Mar  1 13:08:13 2020
+++ src/tests/dev/usb/t_hid/Makefile	Sun Mar  1 15:19:54 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2020/03/01 18:08:13 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2020/03/01 20:19:54 christos Exp $
 #
 
 NOMAN=
@@ -18,8 +18,8 @@ LIBHIDDIR!= cd ${.CURDIR}/../libhid && $
 LDFLAGS+= -L${LIBHIDDIR}
 LDADD+= -Wl,--whole-archive -lrumpdev_hid -Wl,--no-whole-archive
 DPADD+= ${LIBHIDDIR}/librumpdev_hid.a
-DPADD+= ${ATF_C}
+DPADD+= ${ATF_C} 
 
-LDADD+= -latf-c ${LIBRUMPBASE}
+LDADD+= ${LIBRUMPBASE} -latf-c
 
 .include 

Added files:

Index: src/tests/dev/usb/Makefile.inc
diff -u /dev/null src/tests/dev/usb/Makefile.inc:1.1
--- /dev/null	Sun Mar  1 15:19:55 2020
+++ src/tests/dev/usb/Makefile.inc	Sun Mar  1 15:19:54 2020
@@ -0,0 +1,2 @@
+# $NetBSD: Makefile.inc,v 1.1 2020/03/01 20:19:54 christos Exp $
+.include "../Makefile.inc"



CVS commit: src/usr.bin/rump_allserver

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 18:30:05 UTC 2020

Modified Files:
src/usr.bin/rump_allserver: Makefile

Log Message:
Fix sun2


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/rump_allserver/Makefile

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

Modified files:

Index: src/usr.bin/rump_allserver/Makefile
diff -u src/usr.bin/rump_allserver/Makefile:1.11 src/usr.bin/rump_allserver/Makefile:1.12
--- src/usr.bin/rump_allserver/Makefile:1.11	Thu May 11 00:33:14 2017
+++ src/usr.bin/rump_allserver/Makefile	Sun Mar  1 13:30:05 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2017/05/11 04:33:14 sevan Exp $
+#	$NetBSD: Makefile,v 1.12 2020/03/01 18:30:05 christos Exp $
 #
 
 PROG=	rump_allserver
@@ -12,6 +12,6 @@ RUMPTOP=${.CURDIR}/../../sys/rump
 .include "${RUMPTOP}/net/Makefile.rumpnetcomp"
 
 LDADD+=	${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD}
-LDADD+= -lrumpdev -lrumpvfs -lrumpnet -lrump -lrumpuser -lpthread
+LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrump -lrumpuser -lpthread
 
 .include 



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

2020-03-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar  1 18:22:00 UTC 2020

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

Log Message:
Add new signal trap entry tests in t_ptrace_wait*

New tests:
 - syscall_signal_on_sce
 - syscall_detach_on_sce

The first one fails as a signal emitted to the child is caught by the
debugger.

The second one passes.


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.166 src/tests/lib/libc/sys/t_ptrace_wait.c:1.167
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.166	Mon Feb 24 23:46:45 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Mar  1 18:22:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.166 2020/02/24 23:46:45 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.167 2020/03/01 18:22:00 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.166 2020/02/24 23:46:45 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.167 2020/03/01 18:22:00 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -7458,8 +7458,23 @@ ATF_TC_BODY(resume, tc)
 
 /// 
 
+static int test_syscall_caught;
+
+static void
+syscall_sighand(int arg)
+{
+
+	DPRINTF("Caught a signal %d in process %d\n", arg, getpid());
+
+	FORKEE_ASSERT_EQ(arg, SIGINFO);
+
+	++test_syscall_caught;
+
+	FORKEE_ASSERT_EQ(test_syscall_caught, 1);
+}
+
 static void
-syscall_body(bool killed)
+syscall_body(const char *op)
 {
 	const int exitval = 5;
 	const int sigval = SIGSTOP;
@@ -7468,19 +7483,32 @@ syscall_body(bool killed)
 	int status;
 #endif
 	struct ptrace_siginfo info;
+
 	memset(&info, 0, sizeof(info));
 
+#if defined(TWAIT_HAVE_STATUS)
+	if (strstr(op, "signal") != NULL) {
+		atf_tc_expect_fail("XXX: behavior under investigation");
+	}
+#endif
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
 		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
 		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
+		signal(SIGINFO, syscall_sighand);
+
 		DPRINTF("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
 		syscall(SYS_getpid);
 
+		if (strstr(op, "signal") != NULL) {
+			FORKEE_ASSERT_EQ(test_syscall_caught, 1);
+		}
+
 		DPRINTF("Before exiting of the child process\n");
 		_exit(exitval);
 	}
@@ -7508,7 +7536,7 @@ syscall_body(bool killed)
 	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
 	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_SCE);
 
-	if (killed) {
+	if (strstr(op, "killed") != NULL) {
 		SYSCALL_REQUIRE(ptrace(PT_KILL, child, NULL, 0) != -1);
 
 		DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
@@ -7517,29 +7545,45 @@ syscall_body(bool killed)
 
 		validate_status_signaled(status, SIGKILL, 0);
 	} else {
-		DPRINTF("Before resuming the child process where it left off "
-		"and without signal to be sent\n");
-		SYSCALL_REQUIRE(ptrace(PT_SYSCALL, child, (void *)1, 0) != -1);
+		if (strstr(op, "signal") != NULL) {
+			DPRINTF("Before resuming the child %d and sending a "
+			"signal SIGINFO\n", child);
+			SYSCALL_REQUIRE(
+			ptrace(PT_CONTINUE, child, (void *)1, SIGINFO)
+			!= -1);
+		} else if (strstr(op, "detach") != NULL) {
+			DPRINTF("Before detaching the child %d\n", child);
+			SYSCALL_REQUIRE(
+			ptrace(PT_DETACH, child, (void *)1, 0) != -1);
+		} else {
+			DPRINTF("Before resuming the child process where it "
+			"left off and without signal to be sent\n");
+			SYSCALL_REQUIRE(
+			ptrace(PT_SYSCALL, child, (void *)1, 0) != -1);
 
-		DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
-		TWAIT_REQUIRE_SUCCESS(
-		wpid = TWAIT_GENERIC(child, &status, 0), child);
+			DPRINTF("Before calling %s() for the child\n",
+			TWAIT_FNAME);
+			TWAIT_REQUIRE_SUCCESS(
+			wpid = TWAIT_GENERIC(child, &status, 0), child);
 
-		validate_status_stopped(status, SIGTRAP);
+			validate_status_stopped(status, SIGTRAP);
 
-		DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for "
-		"child\n");
-		SYSCALL_REQUIRE(
-		ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+			DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO "
+			"for child\n");
+			SYSCALL_REQUIRE(
+			ptrace(PT_GET_SIGINFO, child, &info, sizeof(info))
+			!= -1);
 
-		DPRINTF("Before checking siginfo_t and lwpid\n");
-		ATF_REQUIRE_EQ(info.psi_lwpid, 1);
-		ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
-		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_SCX);
+			DPRINTF("Before checking siginfo_t and lwpid\n");
+			ATF_REQUIRE_

CVS commit: src/tests

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 18:08:16 UTC 2020

Modified Files:
src/tests: Makefile.inc
src/tests/dev/audio: Makefile
src/tests/dev/cgd: Makefile
src/tests/dev/dm: Makefile
src/tests/dev/md: Makefile
src/tests/dev/scsipi: Makefile
src/tests/dev/sysmon: Makefile
src/tests/dev/usb/t_hid: Makefile
src/tests/fs/ffs: Makefile
src/tests/fs/hfs: Makefile
src/tests/fs/kernfs: Makefile
src/tests/fs/lfs: Makefile
src/tests/fs/msdosfs: Makefile
src/tests/fs/nfs: Makefile
src/tests/fs/nfs/nfsservice: Makefile
src/tests/fs/nullfs: Makefile
src/tests/fs/ptyfs: Makefile
src/tests/fs/puffs: Makefile
src/tests/fs/tmpfs: Makefile
src/tests/fs/umapfs: Makefile
src/tests/fs/union: Makefile
src/tests/fs/vfs: Makefile
src/tests/include/sys: Makefile
src/tests/kernel: Makefile
src/tests/kernel/tty: Makefile
src/tests/lib/libc/sys: Makefile
src/tests/lib/semaphore/pthread: Makefile
src/tests/modules: Makefile
src/tests/net/bpf: Makefile
src/tests/net/bpfilter: Makefile
src/tests/net/bpfjit: Makefile
src/tests/net/can: Makefile
src/tests/net/icmp: Makefile
src/tests/net/if: Makefile
src/tests/net/if_loop: Makefile
src/tests/net/net: Makefile
src/tests/rump/rumpkern: Makefile
src/tests/rump/rumpkern/h_server: Makefile
src/tests/rump/rumpvfs: Makefile

Log Message:
Centralize the base rump libraries into a variable used by all the other
Makefiles so that we can make changes to it centrally as needed and have
less mess. Fixes the sun2 build that needs rumpvfs after librump after
the latest changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/audio/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/dev/cgd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/dev/dm/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/md/Makefile
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/scsipi/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/dev/sysmon/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/dev/usb/t_hid/Makefile
cvs rdiff -u -r1.19 -r1.20 src/tests/fs/ffs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/hfs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/kernfs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/lfs/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/msdosfs/Makefile
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/nfs/Makefile
cvs rdiff -u -r1.14 -r1.15 src/tests/fs/nfs/nfsservice/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/nullfs/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/ptyfs/Makefile
cvs rdiff -u -r1.14 -r1.15 src/tests/fs/puffs/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/tmpfs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/umapfs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/union/Makefile
cvs rdiff -u -r1.25 -r1.26 src/tests/fs/vfs/Makefile
cvs rdiff -u -r1.14 -r1.15 src/tests/include/sys/Makefile
cvs rdiff -u -r1.65 -r1.66 src/tests/kernel/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/kernel/tty/Makefile
cvs rdiff -u -r1.58 -r1.59 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/semaphore/pthread/Makefile
cvs rdiff -u -r1.17 -r1.18 src/tests/modules/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/net/bpf/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tests/net/bpfilter/Makefile
cvs rdiff -u -r1.8 -r1.9 src/tests/net/bpfjit/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tests/net/can/Makefile
cvs rdiff -u -r1.11 -r1.12 src/tests/net/icmp/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/net/if/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/net/if_loop/Makefile
cvs rdiff -u -r1.22 -r1.23 src/tests/net/net/Makefile
cvs rdiff -u -r1.18 -r1.19 src/tests/rump/rumpkern/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/rumpkern/h_server/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/rump/rumpvfs/Makefile

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

Modified files:

Index: src/tests/Makefile.inc
diff -u src/tests/Makefile.inc:1.5 src/tests/Makefile.inc:1.6
--- src/tests/Makefile.inc:1.5	Fri Jan 13 20:33:32 2017
+++ src/tests/Makefile.inc	Sun Mar  1 13:08:12 2020
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.5 2017/01/14 01:33:32 christos Exp $
+# $NetBSD: Makefile.inc,v 1.6 2020/03/01 18:08:12 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
 TOOLSSRCDIR:= ${.PARSEDIR}
 CPPFLAGS+= -I${TOOLSSRCDIR}
+LIBRUMPBASE = -lrumpvfs -lrump -lrumpvfs -lrumpuser -lrump -lpthread
+

Index: src/tests/dev/audio/Makefile
diff -u src/tests/dev/audio/Makefile:1.7 src/tests/dev/audio/Makefile:1.8
--- src/tests/dev/audio/Makefile:1.7	Tue Feb 11 02:03:16 2020
+++ src/tests/dev/audio/Makefile	Sun Mar  1 13:08:12 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2020/02/11 07:03:16 isaki Exp $
+#	$Net

CVS commit: src/tests/dev/cgd

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 17:06:26 UTC 2020

Modified Files:
src/tests/dev/cgd: Makefile

Log Message:
librump depends on vfs so add a dependency on for sun2.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/dev/cgd/Makefile

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

Modified files:

Index: src/tests/dev/cgd/Makefile
diff -u src/tests/dev/cgd/Makefile:1.8 src/tests/dev/cgd/Makefile:1.9
--- src/tests/dev/cgd/Makefile:1.8	Sun May 21 11:28:42 2017
+++ src/tests/dev/cgd/Makefile	Sun Mar  1 12:06:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2017/05/21 15:28:42 riastradh Exp $
+#	$NetBSD: Makefile,v 1.9 2020/03/01 17:06:26 christos Exp $
 #
 
 .include 
@@ -15,7 +15,7 @@ TESTS_C=	t_cgd_3des t_cgd_aes t_cgd_blow
 WARNS=	4
 CPPFLAGS+=	-D_KERNTYPES
 LDADD+=	-lrumpdev -lrumpdev_disk -lrumpdev_cgd -lrumpkern_crypto -lrumpvfs
-LDADD+=	-lrump
+LDADD+=	-lrump -lrumpvfs
 LDADD+=	-lrumpuser
 LDADD+=	-lrump -lutil
 LDADD+=	-lpthread



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

2020-03-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar  1 16:38:59 UTC 2020

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

Log Message:
bus_dmatag_subregion isn't supported on (compiled into) arm so ifdef its
use in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/nvidia/tegra_sdhc.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.25 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.26
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.25	Sat Feb 15 12:45:05 2020
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Sun Mar  1 16:38:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.25 2020/02/15 12:45:05 skrll Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.26 2020/03/01 16:38:59 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.25 2020/02/15 12:45:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.26 2020/03/01 16:38:59 skrll Exp $");
 
 #include 
 #include 
@@ -111,13 +111,16 @@ tegra_sdhc_attach(device_t parent, devic
 		bus_width = 4;
 
 	sc->sc.sc_dev = self;
+	sc->sc.sc_dmat = faa->faa_dmat;
 
+#ifdef _LP64
 	error = bus_dmatag_subregion(faa->faa_dmat, 0, 0x,
 	&sc->sc.sc_dmat, BUS_DMA_WAITOK);
 	if (error != 0) {
 		aprint_error(": couldn't create DMA tag: %d\n", error);
 		return;
 	}
+#endif
 
 	sc->sc.sc_flags = SDHC_FLAG_32BIT_ACCESS |
 			  SDHC_FLAG_NO_PWR0 |



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 16:31:01 UTC 2020

Modified Files:
src/sys/dev/pci: if_nfe.c if_stge.c

Log Message:
Add explicit casts in bus_dmatag_subregion() calls to avoid overflow /
truncation warnings on 32-bit platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_stge.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_nfe.c
diff -u src/sys/dev/pci/if_nfe.c:1.75 src/sys/dev/pci/if_nfe.c:1.76
--- src/sys/dev/pci/if_nfe.c:1.75	Sun Mar  1 15:43:58 2020
+++ src/sys/dev/pci/if_nfe.c	Sun Mar  1 16:31:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_nfe.c,v 1.75 2020/03/01 15:43:58 thorpej Exp $	*/
+/*	$NetBSD: if_nfe.c,v 1.76 2020/03/01 16:31:01 thorpej Exp $	*/
 /*	$OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $	*/
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.75 2020/03/01 15:43:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.76 2020/03/01 16:31:01 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -324,7 +324,7 @@ nfe_attach(device_t parent, device_t sel
 	if (pci_dma64_available(pa) && (sc->sc_flags & NFE_40BIT_ADDR) != 0) {
 		if (bus_dmatag_subregion(pa->pa_dmat64,
 	 0,
-	 (1ULL << 40),
+	 (bus_addr_t)(1ULL << 40),
 	 &sc->sc_dmat,
 	 BUS_DMA_WAITOK) != 0) {
 			aprint_error_dev(self,

Index: src/sys/dev/pci/if_stge.c
diff -u src/sys/dev/pci/if_stge.c:1.81 src/sys/dev/pci/if_stge.c:1.82
--- src/sys/dev/pci/if_stge.c:1.81	Sun Mar  1 15:46:32 2020
+++ src/sys/dev/pci/if_stge.c	Sun Mar  1 16:31:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_stge.c,v 1.81 2020/03/01 15:46:32 thorpej Exp $	*/
+/*	$NetBSD: if_stge.c,v 1.82 2020/03/01 16:31:01 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.81 2020/03/01 15:46:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.82 2020/03/01 16:31:01 thorpej Exp $");
 
 
 #include 
@@ -450,7 +450,7 @@ stge_attach(device_t parent, device_t se
 	if (pci_dma64_available(pa)) {
 		if (bus_dmatag_subregion(pa->pa_dmat64,
 	 0,
-	 FRAG_ADDR_MASK + 1ULL,
+	 (bus_addr_t)(FRAG_ADDR_MASK + 1ULL),
 	 &sc->sc_dmat,
 	 BUS_DMA_WAITOK) != 0) {
 			aprint_error_dev(self,



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 15:54:18 UTC 2020

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

Log Message:
Use the 64-bit PCI DMA tag if available.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_xge.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_xge.c
diff -u src/sys/dev/pci/if_xge.c:1.33 src/sys/dev/pci/if_xge.c:1.34
--- src/sys/dev/pci/if_xge.c:1.33	Thu Jan 30 06:10:26 2020
+++ src/sys/dev/pci/if_xge.c	Sun Mar  1 15:54:18 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xge.c,v 1.33 2020/01/30 06:10:26 thorpej Exp $ */
+/*  $NetBSD: if_xge.c,v 1.34 2020/03/01 15:54:18 thorpej Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.33 2020/01/30 06:10:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.34 2020/03/01 15:54:18 thorpej Exp $");
 
 
 #include 
@@ -287,7 +287,11 @@ xge_attach(device_t parent, device_t sel
 
 	sc = device_private(self);
 	sc->sc_dev = self;
-	sc->sc_dmat = pa->pa_dmat;
+
+	if (pci_dma64_available(pa))
+		sc->sc_dmat = pa->pa_dmat64;
+	else
+		sc->sc_dmat = pa->pa_dmat;
 
 	/* Get BAR0 address */
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, XGE_PIF_BAR);



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 15:46:32 UTC 2020

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

Log Message:
Harmonize bus_dmatag_subregion() handling with other drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/pci/if_stge.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_stge.c
diff -u src/sys/dev/pci/if_stge.c:1.80 src/sys/dev/pci/if_stge.c:1.81
--- src/sys/dev/pci/if_stge.c:1.80	Sat Feb 29 20:39:09 2020
+++ src/sys/dev/pci/if_stge.c	Sun Mar  1 15:46:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_stge.c,v 1.80 2020/02/29 20:39:09 thorpej Exp $	*/
+/*	$NetBSD: if_stge.c,v 1.81 2020/03/01 15:46:32 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.80 2020/02/29 20:39:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.81 2020/03/01 15:46:32 thorpej Exp $");
 
 
 #include 
@@ -454,8 +454,8 @@ stge_attach(device_t parent, device_t se
 	 &sc->sc_dmat,
 	 BUS_DMA_WAITOK) != 0) {
 			aprint_error_dev(self,
-			"unable to create 40-bit DMA tag\n");
-			return;
+			"WARNING: failed to restrict dma range,"
+			" falling back to parent bus dma range\n");
 		}
 	} else {
 		sc->sc_dmat = pa->pa_dmat;



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 15:43:59 UTC 2020

Modified Files:
src/sys/dev/pci: if_nfe.c if_nfevar.h

Log Message:
- Range-limit our DMA tag to 40-bit.
- Eliminate __LP64__ ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_nfevar.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_nfe.c
diff -u src/sys/dev/pci/if_nfe.c:1.74 src/sys/dev/pci/if_nfe.c:1.75
--- src/sys/dev/pci/if_nfe.c:1.74	Tue Feb  4 05:44:14 2020
+++ src/sys/dev/pci/if_nfe.c	Sun Mar  1 15:43:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_nfe.c,v 1.74 2020/02/04 05:44:14 thorpej Exp $	*/
+/*	$NetBSD: if_nfe.c,v 1.75 2020/03/01 15:43:58 thorpej Exp $	*/
 /*	$OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $	*/
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.74 2020/02/04 05:44:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.75 2020/03/01 15:43:58 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -145,10 +145,6 @@ int nfedebug = 0;
 #define	PCI_PRODUCT_NVIDIA_MCP51_LAN2 \
 	PCI_PRODUCT_NVIDIA_NFORCE430_LAN2
 
-#ifdef	_LP64
-#define	__LP64__ 1
-#endif
-
 const struct nfe_product {
 	pci_vendor_id_t		vendor;
 	pci_product_id_t	product;
@@ -325,9 +321,18 @@ nfe_attach(device_t parent, device_t sel
 		break;
 	}
 
-	if (pci_dma64_available(pa) && (sc->sc_flags & NFE_40BIT_ADDR) != 0)
-		sc->sc_dmat = pa->pa_dmat64;
-	else
+	if (pci_dma64_available(pa) && (sc->sc_flags & NFE_40BIT_ADDR) != 0) {
+		if (bus_dmatag_subregion(pa->pa_dmat64,
+	 0,
+	 (1ULL << 40),
+	 &sc->sc_dmat,
+	 BUS_DMA_WAITOK) != 0) {
+			aprint_error_dev(self,
+			"unable to create 40-bit DMA tag\n");
+			sc->sc_dmat = pa->pa_dmat64;
+		} else
+			sc->sc_dmat_needs_free = true;
+	} else
 		sc->sc_dmat = pa->pa_dmat;
 
 	nfe_poweron(self);
@@ -458,6 +463,9 @@ nfe_detach(device_t self, int flags)
 	mutex_destroy(&sc->rxq.mtx);
 	nfe_free_tx_ring(sc, &sc->txq);
 
+	if (sc->sc_dmat_needs_free)
+		bus_dmatag_destroy(sc->sc_dmat);
+
 	if (sc->sc_ih != NULL) {
 		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
 		sc->sc_ih = NULL;
@@ -958,9 +966,8 @@ mbufcopied:
 skip1:
 		/* update mapping address in h/w descriptor */
 		if (sc->sc_flags & NFE_40BIT_ADDR) {
-#if defined(__LP64__)
-			desc64->physaddr[0] = htole32(physaddr >> 32);
-#endif
+			desc64->physaddr[0] =
+			htole32(((uint64_t)physaddr) >> 32);
 			desc64->physaddr[1] = htole32(physaddr & 0x);
 		} else {
 			desc32->physaddr = htole32(physaddr);
@@ -1123,10 +1130,8 @@ nfe_encap(struct nfe_softc *sc, struct m
 
 		if (sc->sc_flags & NFE_40BIT_ADDR) {
 			desc64 = &sc->txq.desc64[sc->txq.cur];
-#if defined(__LP64__)
 			desc64->physaddr[0] =
-			htole32(map->dm_segs[i].ds_addr >> 32);
-#endif
+			htole32(((uint64_t)map->dm_segs[i].ds_addr) >> 32);
 			desc64->physaddr[1] =
 			htole32(map->dm_segs[i].ds_addr & 0x);
 			desc64->length = htole16(map->dm_segs[i].ds_len - 1);
@@ -1291,13 +1296,9 @@ nfe_init(struct ifnet *ifp)
 	nfe_set_macaddr(sc, sc->sc_enaddr);
 
 	/* tell MAC where rings are in memory */
-#ifdef __LP64__
-	NFE_WRITE(sc, NFE_RX_RING_ADDR_HI, sc->rxq.physaddr >> 32);
-#endif
+	NFE_WRITE(sc, NFE_RX_RING_ADDR_HI, ((uint64_t)sc->rxq.physaddr) >> 32);
 	NFE_WRITE(sc, NFE_RX_RING_ADDR_LO, sc->rxq.physaddr & 0x);
-#ifdef __LP64__
-	NFE_WRITE(sc, NFE_TX_RING_ADDR_HI, sc->txq.physaddr >> 32);
-#endif
+	NFE_WRITE(sc, NFE_TX_RING_ADDR_HI, ((uint64_t)sc->txq.physaddr) >> 32);
 	NFE_WRITE(sc, NFE_TX_RING_ADDR_LO, sc->txq.physaddr & 0x);
 
 	NFE_WRITE(sc, NFE_RING_SIZE,
@@ -1516,9 +1517,8 @@ nfe_alloc_rx_ring(struct nfe_softc *sc, 
 
 		if (sc->sc_flags & NFE_40BIT_ADDR) {
 			desc64 = &sc->rxq.desc64[i];
-#if defined(__LP64__)
-			desc64->physaddr[0] = htole32(physaddr >> 32);
-#endif
+			desc64->physaddr[0] =
+			htole32(((uint64_t)physaddr) >> 32);
 			desc64->physaddr[1] = htole32(physaddr & 0x);
 			desc64->length = htole16(sc->rxq.bufsz);
 			desc64->flags = htole16(NFE_RX_READY);

Index: src/sys/dev/pci/if_nfevar.h
diff -u src/sys/dev/pci/if_nfevar.h:1.11 src/sys/dev/pci/if_nfevar.h:1.12
--- src/sys/dev/pci/if_nfevar.h:1.11	Fri Sep 13 07:55:07 2019
+++ src/sys/dev/pci/if_nfevar.h	Sun Mar  1 15:43:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_nfevar.h,v 1.11 2019/09/13 07:55:07 msaitoh Exp $	*/
+/*	$NetBSD: if_nfevar.h,v 1.12 2020/03/01 15:43:58 thorpej Exp $	*/
 /*	$OpenBSD: if_nfevar.h,v 1.13 2007/12/05 08:30:33 jsg Exp $	*/
 
 /*-
@@ -77,6 +77,7 @@ struct nfe_softc {
 	bus_size_t		sc_mems;
 	void			*sc_ih;
 	bus_dma_tag_t		sc_dmat;
+	bool			sc_dmat_needs_free;
 	struct mii_data		sc_mii;
 	struct callout		sc_tick_ch;
 



CVS commit: src/etc/rc.d

2020-03-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Mar  1 15:22:56 UTC 2020

Modified Files:
src/etc/rc.d: mountall

Log Message:
mountall: Mount ZFS filesystems before fstab

This allows null mounts in fstab to reference fstab mounts.
It's highly unlikely ZFS mounts would reference anything outside of ZFS.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/etc/rc.d/mountall

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

Modified files:

Index: src/etc/rc.d/mountall
diff -u src/etc/rc.d/mountall:1.12 src/etc/rc.d/mountall:1.13
--- src/etc/rc.d/mountall:1.12	Sun Feb 23 08:53:25 2020
+++ src/etc/rc.d/mountall	Sun Mar  1 15:22:55 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: mountall,v 1.12 2020/02/23 08:53:25 riastradh Exp $
+# $NetBSD: mountall,v 1.13 2020/03/01 15:22:55 roy Exp $
 #
 
 # REQUIRE: mountcritremote named ypbind
@@ -15,23 +15,27 @@ stop_cmd="mountall_stop"
 mountall_start()
 {
 	echo 'Mounting all file systems...'
-	# Mount file systems noted in fstab.
-	mount -a
+
+	# Mount ZFS filesystems first because fstab
+	# may try and null mount paths on ZFS.
 	if checkyesno zfs; then
-		# Mount ZFS file systems.
 		zfs mount -a
 	fi
+
+	# Mount file systems noted in fstab.
+	mount -a
 }
 
 mountall_stop()
 {
 	echo 'Unmounting all file systems...'
+	# Unmount file systems noted in fstab.
+	umount -a
+
+	# Unmount ZFS file systems.
 	if checkyesno zfs; then
-		# Unmount ZFS file systems.
 		zfs unmount -a
 	fi
-	# Unmount file systems noted in fstab.
-	umount -a
 }
 
 load_rc_config $name



CVS commit: src/include

2020-03-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar  1 15:18:34 UTC 2020

Modified Files:
src/include: stddef.h

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/include/stddef.h

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

Modified files:

Index: src/include/stddef.h
diff -u src/include/stddef.h:1.21 src/include/stddef.h:1.22
--- src/include/stddef.h:1.21	Sun Mar  1 15:08:16 2020
+++ src/include/stddef.h	Sun Mar  1 15:18:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stddef.h,v 1.21 2020/03/01 15:08:16 kamil Exp $	*/
+/*	$NetBSD: stddef.h,v 1.22 2020/03/01 15:18:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -68,7 +68,7 @@ typedef	_BSD_WCHAR_T_	wchar_t;
 #endif  
 
 #if (__STDC_VERSION__ - 0) > 199901L || defined(__cplusplus)
-/* Introduced in C99/C++11, as an extension exposed to C99/C++98 */
+/* Introduced in C11/C++11, as an extension exposed to C99/C++98 */
 typedef union {
 	void *_v;
 	long double _ld;



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 15:15:49 UTC 2020

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

Log Message:
Use the 64-bit PCI DMA tag if available.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_et.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_et.c
diff -u src/sys/dev/pci/if_et.c:1.31 src/sys/dev/pci/if_et.c:1.32
--- src/sys/dev/pci/if_et.c:1.31	Fri Feb 28 05:13:19 2020
+++ src/sys/dev/pci/if_et.c	Sun Mar  1 15:15:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.31 2020/02/28 05:13:19 msaitoh Exp $	*/
+/*	$NetBSD: if_et.c,v 1.32 2020/03/01 15:15:49 thorpej Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.31 2020/02/28 05:13:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.32 2020/03/01 15:15:49 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -230,10 +230,14 @@ et_attach(device_t parent, device_t self
 	}
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
-	sc->sc_dmat = pa->pa_dmat;
 	sc->sc_pct = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 
+	if (pci_dma64_available(pa))
+		sc->sc_dmat = pa->pa_dmat64;
+	else
+		sc->sc_dmat = pa->pa_dmat;
+
 	if (pa->pa_id == PCI_PRODUCT_LUCENT_ET1301)
 		sc->sc_flags |= ET_FLAG_FASTETHER;
 



CVS commit: src/sys/dev/pci

2020-03-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar  1 15:11:31 UTC 2020

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

Log Message:
Support 64-bit DMA addressing, and use the 64-bit PCI DMA tag if available.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/if_dge.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_dge.c
diff -u src/sys/dev/pci/if_dge.c:1.57 src/sys/dev/pci/if_dge.c:1.58
--- src/sys/dev/pci/if_dge.c:1.57	Thu Jan 30 05:24:53 2020
+++ src/sys/dev/pci/if_dge.c	Sun Mar  1 15:11:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dge.c,v 1.57 2020/01/30 05:24:53 thorpej Exp $ */
+/*	$NetBSD: if_dge.c,v 1.58 2020/03/01 15:11:31 thorpej Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.57 2020/01/30 05:24:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.58 2020/03/01 15:11:31 thorpej Exp $");
 
 
 
@@ -403,10 +403,11 @@ do {	\
 	struct dge_rxsoft *__rxs = &(sc)->sc_rxsoft[(x)];		\
 	struct dge_rdes *__rxd = &(sc)->sc_rxdescs[(x)];		\
 	struct mbuf *__m = __rxs->rxs_mbuf;\
+	const bus_addr_t __rxaddr = sc->sc_bugmap->dm_segs[0].ds_addr +	\
+	(mtod((__m), char *) - (char *)sc->sc_bugbuf);		\
 	\
-	__rxd->dr_baddrl = htole32(sc->sc_bugmap->dm_segs[0].ds_addr +	\
-	(mtod((__m), char *) - (char *)sc->sc_bugbuf));		\
-	__rxd->dr_baddrh = 0;		\
+	__rxd->dr_baddrl = htole32(__rxaddr);\
+	__rxd->dr_baddrh = htole32(((uint64_t)__rxaddr) >> 32);		\
 	__rxd->dr_len = 0;		\
 	__rxd->dr_cksum = 0;		\
 	__rxd->dr_status = 0;		\
@@ -439,10 +440,12 @@ do {	\
 	 */\
 	__m->m_data = __m->m_ext.ext_buf + (sc)->sc_align_tweak;	\
 	\
-	__rxd->dr_baddrl =		\
-	htole32(__rxs->rxs_dmamap->dm_segs[0].ds_addr +		\
-		(sc)->sc_align_tweak);	\
-	__rxd->dr_baddrh = 0;		\
+	const bus_addr_t __rxaddr =	\
+	__rxs->rxs_dmamap->dm_segs[0].ds_addr +			\
+	(sc)->sc_align_tweak;	\
+	\
+	__rxd->dr_baddrl = htole32(__rxaddr);\
+	__rxd->dr_baddrh = htole32(((uint64_t)__rxaddr) >> 32);		\
 	__rxd->dr_len = 0;		\
 	__rxd->dr_cksum = 0;		\
 	__rxd->dr_status = 0;		\
@@ -713,10 +716,14 @@ dge_attach(device_t parent, device_t sel
 	}
 
 	sc->sc_dev = self;
-	sc->sc_dmat = pa->pa_dmat;
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pt = pa->pa_tag;
 
+	if (pci_dma64_available(pa))
+		sc->sc_dmat = pa->pa_dmat64;
+	else
+		sc->sc_dmat = pa->pa_dmat;
+
 	pci_aprint_devinfo_fancy(pa, "Ethernet controller",
 		dgep->dgep_name, 1);
 
@@ -1332,11 +1339,8 @@ dge_start(struct ifnet *ifp)
 		for (nexttx = sc->sc_txnext, seg = 0;
 		 seg < dmamap->dm_nsegs;
 		 seg++, nexttx = DGE_NEXTTX(nexttx)) {
-			/*
-			 * Note: we currently only use 32-bit DMA
-			 * addresses.
-			 */
-			sc->sc_txdescs[nexttx].dt_baddrh = 0;
+			sc->sc_txdescs[nexttx].dt_baddrh =
+			htole32(((uint64_t)dmamap->dm_segs[seg].ds_addr) >> 32);
 			sc->sc_txdescs[nexttx].dt_baddrl =
 			htole32(dmamap->dm_segs[seg].ds_addr);
 			sc->sc_txdescs[nexttx].dt_ctl =
@@ -1347,10 +1351,11 @@ dge_start(struct ifnet *ifp)
 			lasttx = nexttx;
 
 			DPRINTF(DGE_DEBUG_TX,
-			("%s: TX: desc %d: low 0x%08lx, len 0x%04lx\n",
+			("%s: TX: desc %d: high 0x%08lx, low 0x%08lx, len 0x%04lx\n",
 			device_xname(sc->sc_dev), nexttx,
-			(unsigned long)le32toh(dmamap->dm_segs[seg].ds_addr),
-			(unsigned long)le32toh(dmamap->dm_segs[seg].ds_len)));
+			(unsigned long)(((uint64_t)dmamap->dm_segs[seg].ds_addr) >> 32),
+			(unsigned long)((uint32_t)dmamap->dm_segs[seg].ds_addr),
+			(unsigned long)dmamap->dm_segs[seg].ds_len));
 		}
 
 		KASSERT(lasttx != -1);
@@ -1924,7 +1929,7 @@ dge_init(struct ifnet *ifp)
 	sc->sc_txctx_ipcs = 0x;
 	sc->sc_txctx_tucs = 0x;
 
-	CSR_WRITE(sc, DGE_TDBAH, 0);
+	CSR_WRITE(sc, DGE_TDBAH, ((uint64_t)DGE_CDTXADDR(sc, 0)) >> 32);
 	CSR_WRITE(sc, DGE_TDBAL, DGE_CDTXADDR(sc, 0));
 	CSR_WRITE(sc, DGE_TDLEN, sizeof(sc->sc_txdescs));
 	CSR_WRITE(sc, DGE_TDH, 0);
@@ -1951,7 +1956,7 @@ dge_init(struct ifnet *ifp)
 	 * Initialize the receive descriptor and receive job
 	 * descriptor rings.
 	 */
-	CSR_WRITE(sc, DGE_RDBAH, 0);
+	CSR_WRITE(sc, DGE_RDBAH, ((uint64_t)DGE_CDRXADDR(sc, 0)) >> 32);
 	CSR_WRITE(sc, DGE_RDBAL, DGE_CDRXADDR(sc, 0));
 	CSR_WRITE(sc, DGE_RDLEN, sizeof(sc->sc_rxdescs));
 	CSR_WRITE(sc, DGE_RDH, DGE_RXSPACE);



CVS commit: src/include

2020-03-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar  1 15:08:16 UTC 2020

Modified Files:
src/include: stddef.h

Log Message:
Expose max_align_t to C99/C++

max_align_t does not depend on any pre-C99 or !C++ language feature.

This structure is in use in 3rd party essential C++ code as an extension
for older language revisions and in gnu99 code in the NetBSD distribution
(RTLD's build rules define -std=gnu11 just for exposing this struct).

Exposing max_align_t from the central NetBSD header avoid duplicate
definition in 3rd party code that could differ and produce ABI mismatched
binaries between -std= revisions.

This problem does not exist on OSs like Linux as they get this namespace
visibility defined inside LLVM or GNU toolchain headers. NetBSD ships with
its own stddef.h, rather than relying on a toolchain and its internal
extensions.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/include/stddef.h

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

Modified files:

Index: src/include/stddef.h
diff -u src/include/stddef.h:1.20 src/include/stddef.h:1.21
--- src/include/stddef.h:1.20	Sun Mar 20 16:26:06 2016
+++ src/include/stddef.h	Sun Mar  1 15:08:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stddef.h,v 1.20 2016/03/20 16:26:06 christos Exp $	*/
+/*	$NetBSD: stddef.h,v 1.21 2020/03/01 15:08:16 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -67,7 +67,8 @@ typedef	_BSD_WCHAR_T_	wchar_t;
 (&reinterpret_cast(static_cast(0)->member
 #endif  
 
-#if (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
+#if (__STDC_VERSION__ - 0) > 199901L || defined(__cplusplus)
+/* Introduced in C99/C++11, as an extension exposed to C99/C++98 */
 typedef union {
 	void *_v;
 	long double _ld;



CVS commit: src/lib/libpam/modules/pam_ssh

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 14:50:43 UTC 2020

Modified Files:
src/lib/libpam/modules/pam_ssh: Makefile

Log Message:
Add the sign client part.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libpam/modules/pam_ssh/Makefile

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

Modified files:

Index: src/lib/libpam/modules/pam_ssh/Makefile
diff -u src/lib/libpam/modules/pam_ssh/Makefile:1.11 src/lib/libpam/modules/pam_ssh/Makefile:1.12
--- src/lib/libpam/modules/pam_ssh/Makefile:1.11	Sat Feb  3 22:19:53 2018
+++ src/lib/libpam/modules/pam_ssh/Makefile	Sun Mar  1 09:50:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2018/02/04 03:19:53 christos Exp $
+# $NetBSD: Makefile,v 1.12 2020/03/01 14:50:43 christos Exp $
 # PAM module for SSH
 # $FreeBSD: src/lib/libpam/modules/pam_ssh/Makefile,v 1.18 2004/08/06 07:27:04 cperciva Exp $
 
@@ -10,9 +10,10 @@ NOPICINSTALL=	# don't install _pic.a lib
 
 SSHSRC=	${NETBSDSRCDIR}/crypto/external/bsd/openssh/dist
 
+.PATH: ${SSHSRC}
 LIB=	pam_ssh
 MAN=	pam_ssh.8
-SRCS=	pam_ssh.c
+SRCS=	pam_ssh.c ssh-sk-client.c
 
 CPPFLAGS+= -I${SSHSRC}
 



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

2020-03-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar  1 14:51:06 UTC 2020

Modified Files:
src/crypto/external/bsd/openssh/dist: ssh-sk-client.c

Log Message:
fix a sign-compare issue (for the pam module)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/ssh-sk-client.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/ssh-sk-client.c
diff -u src/crypto/external/bsd/openssh/dist/ssh-sk-client.c:1.2 src/crypto/external/bsd/openssh/dist/ssh-sk-client.c:1.3
--- src/crypto/external/bsd/openssh/dist/ssh-sk-client.c:1.2	Wed Feb 26 19:24:40 2020
+++ src/crypto/external/bsd/openssh/dist/ssh-sk-client.c	Sun Mar  1 09:51:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssh-sk-client.c,v 1.2 2020/02/27 00:24:40 christos Exp $	*/
+/*	$NetBSD: ssh-sk-client.c,v 1.3 2020/03/01 14:51:06 christos Exp $	*/
 /* $OpenBSD: ssh-sk-client.c,v 1.7 2020/01/23 07:10:22 dtucker Exp $ */
 /*
  * Copyright (c) 2019 Google LLC
@@ -16,7 +16,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include "includes.h"
-__RCSID("$NetBSD: ssh-sk-client.c,v 1.2 2020/02/27 00:24:40 christos Exp $");
+__RCSID("$NetBSD: ssh-sk-client.c,v 1.3 2020/03/01 14:51:06 christos Exp $");
 
 #include 
 #include 
@@ -160,7 +160,7 @@ client_converse(struct sshbuf *msg, stru
 	ll = log_level_get();
 	if ((r = sshbuf_put_u32(req, type)) != 0 ||
 	   (r = sshbuf_put_u8(req, log_is_on_stderr() != 0)) != 0 ||
-	   (r = sshbuf_put_u32(req, ll < 0 ? 0 : ll)) != 0 ||
+	   (r = sshbuf_put_u32(req, (uint32_t)(ll < 0 ? 0 : ll))) != 0 ||
 	   (r = sshbuf_putb(req, msg)) != 0) {
 		error("%s: build: %s", __func__, ssh_err(r));
 		goto out;



CVS commit: [netbsd-9] src/doc

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:52:01 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.1

Log Message:
Tickets #743 - #749


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-9.1

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-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.6 src/doc/CHANGES-9.1:1.1.2.7
--- src/doc/CHANGES-9.1:1.1.2.6	Sun Mar  1 11:52:35 2020
+++ src/doc/CHANGES-9.1	Sun Mar  1 12:52:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.6 2020/03/01 11:52:35 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.7 2020/03/01 12:52:01 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -245,3 +245,54 @@ sys/arch/arm/include/arm32/pmap.h		1.161
 	Remove workaround for unaligned access faults.
 	[skrll, ticket #742]
 
+etc/rc.d/random_seed1.8
+
+	Allow random seed on zfs.
+	[riastradh, ticket #743]
+
+sys/arch/mips/adm5120/dev/ahci.c		1.18-1.20
+sys/dev/ic/sl811hs.c1.103
+sys/dev/usb/ehci.c1.270-1.273
+sys/dev/usb/motg.c1.26-1.33
+sys/dev/usb/ohci.c1.293-1.295
+sys/dev/usb/uhci.c1.289-1.293
+sys/dev/usb/usb.c1.181,1.182
+sys/dev/usb/usbdi.c1.190-1.192
+sys/dev/usb/usbdi.h1.99-1.101
+sys/dev/usb/usbdivar.h1.121,1.122
+sys/dev/usb/xhci.c1.116-1.118
+sys/external/bsd/dwc2/dwc2.c			1.67-1.71
+sys/external/bsd/dwc2/dwc2var.h			1.7
+
+	Fix various race conditions in USB abort and timeout.
+	[riastradh, ticket #744]
+
+sys/dev/usb/umass.c1.177-1.179
+
+	Abort default pipe too on detach before detaching children.
+	Consolidate logic to call the transfer callback.
+	Make sure the umass transfer callback is run in error branches.
+	[riastradh, ticket #745]
+
+sys/ddb/db_lex.c1.25
+
+	Fix crash(8) prompt.
+	[riastradh, ticket #746]
+
+sys/dev/pci/if_mcx.c1.11
+
+	mcx(4): use 64-bit PCI DMA if available.
+	[thorpej, ticket #747]
+
+sys/dev/pci/ichsmb.c1.61
+
+	If attach fails, don't panic on detach.
+	[riastradh, ticket #748]
+
+sys/external/bsd/drm2/nouveau/nouveau_pci.c	1.25
+
+	List the PCI ID range for new nvidia TU117 and TU116.
+	Adjust the check to simply be >= 0x1580, which is the
+	first pciid not supported. Fixes PR 54600.
+	[mrg, ticket #749]
+



CVS commit: [netbsd-9] src/sys/external/bsd/drm2/nouveau

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:50:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/nouveau [netbsd-9]: nouveau_pci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #749):

sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.25

list the PCI ID range for new nvidia TU117 and TU116.

adjust the check to simply be >= 0x1580, which is the
first pciid not support.

should fix PR#54600.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 \
src/sys/external/bsd/drm2/nouveau/nouveau_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/sys/external/bsd/drm2/nouveau/nouveau_pci.c
diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.24 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.24.2.1
--- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.24	Wed Jul  3 20:47:22 2019
+++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c	Sun Mar  1 12:50:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_pci.c,v 1.24 2019/07/03 20:47:22 wiz Exp $	*/
+/*	$NetBSD: nouveau_pci.c,v 1.24.2.1 2020/03/01 12:50:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.24 2019/07/03 20:47:22 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.24.2.1 2020/03/01 12:50:42 martin Exp $");
 
 #include 
 #include 
@@ -97,8 +97,6 @@ nouveau_pci_match(device_t parent, cfdat
 	if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY)
 		return 0;
 
-#define IS_BETWEEN(x,y) \
-	(PCI_PRODUCT(pa->pa_id) >= (x) && PCI_PRODUCT(pa->pa_id) <= (y))
 	/*
 	 * NetBSD drm2 doesn't support Pascal, Volta or Turing based cards:
 	 *   0x1580-0x15ff 	GP100
@@ -111,20 +109,16 @@ nouveau_pci_match(device_t parent, cfdat
 	 *   0x1e00-0x1e7f 	TU102
 	 *   0x1e80-0x1eff 	TU104
 	 *   0x1f00-0x1f7f 	TU106
+	 *   0x1f80-0x1fff 	TU117
+	 *   0x2180-0x21ff 	TU116
+	 *
+	 * reduce this to >= 1580, so that new chipsets not explictly
+	 * listed above will be picked up.
+	 *
+	 * XXX perhaps switch this to explicitly match known list.
 	 */
-
-	if (IS_BETWEEN(0x1580, 0x15ff) ||
-	IS_BETWEEN(0x1b00, 0x1b7f) ||
-	IS_BETWEEN(0x1b80, 0x1bff) ||
-	IS_BETWEEN(0x1c00, 0x1c7f) ||
-	IS_BETWEEN(0x1c80, 0x1cff) ||
-	IS_BETWEEN(0x1d00, 0x1d7f) ||
-	IS_BETWEEN(0x1d80, 0x1dff) ||
-	IS_BETWEEN(0x1e00, 0x1e7f) ||
-	IS_BETWEEN(0x1e80, 0x1eff) ||
-	IS_BETWEEN(0x1f00, 0x1f7f))
+	if (PCI_PRODUCT(pa->pa_id) >= 0x1580)
 		return 0;
-#undef IS_BETWEEN
 
 	linux_pci_dev_init(&pdev, parent /* XXX bogus */, parent, pa, 0);
 	ret = nvkm_device_pci_new(&pdev, NULL, "error",



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

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:48:25 UTC 2020

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #748):

sys/dev/pci/ichsmb.c: revision 1.61

If attach fails, don't panic on detach.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.60.4.1 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.60 src/sys/dev/pci/ichsmb.c:1.60.4.1
--- src/sys/dev/pci/ichsmb.c:1.60	Mon Dec 10 06:23:54 2018
+++ src/sys/dev/pci/ichsmb.c	Sun Mar  1 12:48:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.60 2018/12/10 06:23:54 jdolecek Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.60.4.1 2020/03/01 12:48:25 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60 2018/12/10 06:23:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.1 2020/03/01 12:48:25 martin Exp $");
 
 #include 
 #include 
@@ -265,7 +265,8 @@ ichsmb_detach(device_t self, int flags)
 		sc->sc_pihp = NULL;
 	}
 
-	bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size);
+	if (sc->sc_size != 0)
+		bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size);
 
 	return 0;
 }



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

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:47:10 UTC 2020

Modified Files:
src/sys/dev/pci [netbsd-9]: if_mcx.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #747):

sys/dev/pci/if_mcx.c: revision 1.11

Use the 64-bit PCI DMA tag if available.  Otherwise, we are needlessly
allocating (and using) bounce buffers on sytems with >4GB of RAM.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.1.2.8 src/sys/dev/pci/if_mcx.c:1.1.2.9
--- src/sys/dev/pci/if_mcx.c:1.1.2.8	Fri Jan 31 11:14:50 2020
+++ src/sys/dev/pci/if_mcx.c	Sun Mar  1 12:47:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.1.2.8 2020/01/31 11:14:50 martin Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.1.2.9 2020/03/01 12:47:10 martin Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 
 /*
@@ -2215,7 +2215,10 @@ mcx_attach(device_t parent, device_t sel
 	sc->sc_dev = self;
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_tag = pa->pa_tag;
-	sc->sc_dmat = pa->pa_dmat;
+	if (pci_dma64_available(pa))
+		sc->sc_dmat = pa->pa_dmat64;
+	else
+		sc->sc_dmat = pa->pa_dmat;
 
 	/* Map the PCI memory space */
 	memtype = pci_mapreg_type(sc->sc_pc, sc->sc_tag, MCX_HCA_BAR);



CVS commit: [netbsd-9] src/sys/ddb

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:45:09 UTC 2020

Modified Files:
src/sys/ddb [netbsd-9]: db_lex.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #746):

sys/ddb/db_lex.c: revision 1.25

Fix crash(8).  Will revisit.


To generate a diff of this commit:
cvs rdiff -u -r1.22.60.1 -r1.22.60.2 src/sys/ddb/db_lex.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/ddb/db_lex.c
diff -u src/sys/ddb/db_lex.c:1.22.60.1 src/sys/ddb/db_lex.c:1.22.60.2
--- src/sys/ddb/db_lex.c:1.22.60.1	Sun Jan 26 11:25:22 2020
+++ src/sys/ddb/db_lex.c	Sun Mar  1 12:45:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_lex.c,v 1.22.60.1 2020/01/26 11:25:22 martin Exp $	*/
+/*	$NetBSD: db_lex.c,v 1.22.60.2 2020/03/01 12:45:09 martin Exp $	*/
 
 /*
  * Mach Operating System
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.22.60.1 2020/01/26 11:25:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_lex.c,v 1.22.60.2 2020/03/01 12:45:09 martin Exp $");
 
 #include 
 #include 
@@ -62,11 +62,18 @@ db_read_line(void)
 {
 	int	i;
 
+#ifdef _KERNEL
+	/*
+	 * crash(8) prints the prompt using libedit.  That's why we used to
+	 * print it in db_readline().  But now people are using db_read_line()
+	 * for general purpose input, so..
+	 */
 #ifdef MULTIPROCESSOR
 	db_printf("db{%ld}> ", (long)cpu_number());
 #else
 	db_printf("db> ");
 #endif
+#endif
 	i = db_readline(db_line, sizeof(db_line));
 	if (i == 0)
 		return (0);	/* EOI */



CVS commit: [netbsd-9] src/sys/dev/usb

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:38:59 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: umass.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #745):

sys/dev/usb/umass.c: revision 1.177
sys/dev/usb/umass.c: revision 1.178
sys/dev/usb/umass.c: revision 1.179

Abort default pipe too on detach before detaching children.

This ensures that pending xfers on the default pipe will be aborted
before we wait for children, which, in the case of scsibus -> sd,
means waiting for pending xfers to complete -- xfers that may never
complete if something is wedged.

Consolidate logic to call the transfer callback.
No functional change intended.

Make sure the umass transfer callback is run in error branches.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.175.2.1 src/sys/dev/usb/umass.c

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

Modified files:

Index: src/sys/dev/usb/umass.c
diff -u src/sys/dev/usb/umass.c:1.175 src/sys/dev/usb/umass.c:1.175.2.1
--- src/sys/dev/usb/umass.c:1.175	Sun May  5 03:17:54 2019
+++ src/sys/dev/usb/umass.c	Sun Mar  1 12:38:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.175 2019/05/05 03:17:54 mrg Exp $	*/
+/*	$NetBSD: umass.c,v 1.175.2.1 2020/03/01 12:38:59 martin Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.175 2019/05/05 03:17:54 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.175.2.1 2020/03/01 12:38:59 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -236,6 +236,8 @@ Static usbd_status umass_setup_ctrl_tran
 struct usbd_xfer *);
 Static void umass_clear_endpoint_stall(struct umass_softc *, int,
 struct usbd_xfer *);
+Static void umass_transfer_done(struct umass_softc *, int, int);
+Static void umass_transfer_reset(struct umass_softc *);
 #if 0
 Static void umass_reset(struct umass_softc *, transfer_cb_f, void *);
 #endif
@@ -809,6 +811,7 @@ umass_detach(device_t self, int flags)
 		if (sc->sc_pipe[i] != NULL)
 			usbd_abort_pipe(sc->sc_pipe[i]);
 	}
+	usbd_abort_default_pipe(sc->sc_udev);
 
 	/* Do we really need reference counting?  Perhaps in ioctl() */
 	mutex_enter(&sc->sc_lock);
@@ -992,8 +995,11 @@ umass_clear_endpoint_stall(struct umass_
 {
 	UMASSHIST_FUNC(); UMASSHIST_CALLED();
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
 		return;
+	}
 
 	DPRINTFM(UDMASS_BBB, "Clear endpoint 0x%02jx stall",
 	sc->sc_epaddr[endpt], 0, 0, 0);
@@ -1005,7 +1011,29 @@ umass_clear_endpoint_stall(struct umass_
 	USETW(sc->sc_req.wValue, UF_ENDPOINT_HALT);
 	USETW(sc->sc_req.wIndex, sc->sc_epaddr[endpt]);
 	USETW(sc->sc_req.wLength, 0);
-	umass_setup_ctrl_transfer(sc, &sc->sc_req, NULL, 0, 0, xfer);
+	if (umass_setup_ctrl_transfer(sc, &sc->sc_req, NULL, 0, 0, xfer))
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
+}
+
+Static void
+umass_transfer_done(struct umass_softc *sc, int residue, int status)
+{
+	UMASSHIST_FUNC(); UMASSHIST_CALLED();
+
+	sc->transfer_state = TSTATE_IDLE;
+	sc->transfer_cb(sc, sc->transfer_priv, residue, status);
+}
+
+Static void
+umass_transfer_reset(struct umass_softc *sc)
+{
+	UMASSHIST_FUNC(); UMASSHIST_CALLED();
+
+	sc->transfer_state = TSTATE_IDLE;
+	if (sc->transfer_priv)
+		sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen,
+		sc->transfer_status);
 }
 
 #if 0
@@ -1032,8 +1060,10 @@ umass_bbb_reset(struct umass_softc *sc, 
 		   "sc->sc_wire == 0x%02x wrong for umass_bbb_reset\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 		return;
+	}
 
 	/*
 	 * Reset recovery (5.3.4 in Universal Serial Bus Mass Storage Class)
@@ -1062,8 +1092,9 @@ umass_bbb_reset(struct umass_softc *sc, 
 	USETW(sc->sc_req.wValue, 0);
 	USETW(sc->sc_req.wIndex, sc->sc_ifaceno);
 	USETW(sc->sc_req.wLength, 0);
-	umass_setup_ctrl_transfer(sc, &sc->sc_req, NULL, 0, 0,
-  sc->transfer_xfer[XFER_BBB_RESET1]);
+	if (umass_setup_ctrl_transfer(sc, &sc->sc_req, NULL, 0, 0,
+		sc->transfer_xfer[XFER_BBB_RESET1]))
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 }
 
 Static void
@@ -1081,8 +1112,10 @@ umass_bbb_transfer(struct umass_softc *s
 		   "sc->sc_wire == 0x%02x wrong for umass_bbb_transfer\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		cb(sc, priv, datalen, STATUS_WIRE_FAILED);
 		return;
+	}
 
 	/* Be a little generous. */
 	sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
@@ -1216,13 +1249,15 @@ umass_bbb_state(struct usbd_xfer *xfer, 
 		DPRINTFM(UDMASS_BBB, "sc %#jx xfer %#jx cancelled",
 		(uintptr_t)sc, (uintptr_t)xfer, 0, 0);
 
-		sc->transfer_state = TSTATE_IDLE;
-		sc->transfer_cb(sc, sc->transfer_priv, 0, STATUS_TIMEOUT);
+		umass_transfer_do

CVS commit: [netbsd-9] src/sys

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 12:35:16 UTC 2020

Modified Files:
src/sys/arch/mips/adm5120/dev [netbsd-9]: ahci.c
src/sys/dev/ic [netbsd-9]: sl811hs.c
src/sys/dev/usb [netbsd-9]: ehci.c motg.c ohci.c uhci.c usb.c usbdi.c
usbdi.h usbdivar.h xhci.c
src/sys/external/bsd/dwc2 [netbsd-9]: dwc2.c dwc2var.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #744):

sys/dev/usb/uhci.c: revision 1.292
sys/dev/usb/uhci.c: revision 1.293
sys/dev/usb/usbdi.h: revision 1.99
sys/dev/usb/motg.c: revision 1.26
sys/dev/usb/motg.c: revision 1.27
sys/dev/usb/motg.c: revision 1.28
sys/dev/usb/motg.c: revision 1.29
sys/external/bsd/dwc2/dwc2.c: revision 1.70
sys/external/bsd/dwc2/dwc2.c: revision 1.71
sys/dev/usb/usb.c: revision 1.181
sys/arch/mips/adm5120/dev/ahci.c: revision 1.20
sys/dev/usb/usb.c: revision 1.182
sys/dev/usb/xhci.c: revision 1.116
sys/dev/usb/xhci.c: revision 1.117
sys/dev/usb/xhci.c: revision 1.118
sys/dev/usb/uhci.c: revision 1.289
sys/dev/usb/usbdivar.h: revision 1.121
sys/dev/usb/usbdi.c: revision 1.190
sys/dev/usb/usbdivar.h: revision 1.122
sys/dev/usb/usbdi.c: revision 1.191
sys/dev/usb/usbdi.c: revision 1.192
sys/external/bsd/dwc2/dwc2var.h: revision 1.7
sys/dev/usb/motg.c: revision 1.30
sys/dev/usb/motg.c: revision 1.31
sys/dev/usb/motg.c: revision 1.32
sys/dev/usb/motg.c: revision 1.33
sys/external/bsd/dwc2/dwc2.c: revision 1.67
sys/external/bsd/dwc2/dwc2.c: revision 1.68
sys/dev/usb/ehci.c: revision 1.270
sys/external/bsd/dwc2/dwc2.c: revision 1.69
sys/dev/usb/usbdi.h: revision 1.100
sys/dev/usb/ehci.c: revision 1.271
sys/arch/mips/adm5120/dev/ahci.c: revision 1.18
sys/dev/usb/usbdi.h: revision 1.101
sys/dev/usb/ehci.c: revision 1.272
sys/dev/ic/sl811hs.c: revision 1.103
sys/arch/mips/adm5120/dev/ahci.c: revision 1.19
sys/dev/usb/ehci.c: revision 1.273
sys/dev/usb/ohci.c: revision 1.293
sys/dev/usb/uhci.c: revision 1.290
sys/dev/usb/ohci.c: revision 1.294
sys/dev/usb/uhci.c: revision 1.291
sys/dev/usb/ohci.c: revision 1.295

Teach usb_rem_task to return whether removed from queue or not.

New function usb_task_pending for diagnostic assertions.
Usable only for negative diagnostic assertions:

KASSERT(!usb_task_pending(dev, task))

If you can think of a better name for this than !usb_task_pending,
I'm all ears.

 -

Nothing guarantees xfer's timeout has completed.

Wait for it when we free the xfer.

 -

New xfer state variables ux_timeout_set and ux_timeout_reset.

These are needed because:
- The host controller interrupt cannot wait for the callout or task
  to finish running.
- Nothing in the USBD API as is waits for the callout or task to
  finish running.
- Callers expect to be able to resubmit USB xfers from xfer callbacks
  without waiting for anything to finish running.

The variable ux_timeout_set can be used by a host controller to
decide on submission whether to schedule the callout or to ask an
already-scheduled callout or already-queued task to reschedule the
callout, by setting the variable ux_timeout_reset to true.

When the callout or task runs and sees that ux_timeout_reset is true,
rather than queue the task or abort the xfer, it can instead just
schedule the callout anew.

 -

Fix steady state of timeouts in ehci.

This is complicated because:
1. There are three ways that an xfer can be completed:
   (a) hardware interrupt completes xfer
   (b) software decision aborts xfer with USBD_CANCELLED
   (c) timeout aborts xfer with USBD_TIMEOUT
2. The timeout abort can't be done in callout because ehci_sync_hc,
   called unconditionally by ehci_abort_xfer to wait until the device
   has finished using any references to the xfer, may sleep.  So we
   have to schedule a callout that, when run, will schedule a usb_task.
3. The hardware completion interrupt can't sleep waiting for a callout
   or task to finish -- can't use callout_halt or usb_rem_task_wait.
   So the callout and usb_task must be able to run _after_ the hardware
   completion interrupt, and recognize that they're late to the party.
   (Note, though, that usbd_free_xfer does wait for the callout and
   task to complete, so there's no danger they may use themselves after
   free.)
4. The xfer may resubmitted -- and the timeout may be rescheduled --
   immediately after the hardware completion interrupt, _while_ the
   callout and/or usb_task may still be scheduled.  Specifically, we
   may have the following sequence of events:
   (a) hardware completion interrupt
   (b) callout or usb_task fires
   (c) driver resubmits xfer
   (d) callout or usb_task acquires lock and loo

CVS commit: src/sys/dev/usb

2020-03-01 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sun Mar  1 12:23:12 UTC 2020

Modified Files:
src/sys/dev/usb: if_axe.c

Log Message:
introduce AXE_IS_172() conditional to highlight odd ball 172 and invert most 
IF-THEN-ELSE.  consistent white spaces.


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

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.128 src/sys/dev/usb/if_axe.c:1.129
--- src/sys/dev/usb/if_axe.c:1.128	Sun Mar  1 10:16:17 2020
+++ src/sys/dev/usb/if_axe.c	Sun Mar  1 12:23:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.128 2020/03/01 10:16:17 nisimura Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.129 2020/03/01 12:23:12 nisimura Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.128 2020/03/01 10:16:17 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.129 2020/03/01 12:23:12 nisimura Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -123,12 +123,14 @@ struct axe_softc {
 
 };
 
-#define	AXE_IS_178_FAMILY(un)\
-	((un)->un_flags & (AX772 | AX772A | AX772B | AX178))
+#define AXE_IS_178_FAMILY(un)\
+	((un)->un_flags & (AX178 | AX772 | AX772A | AX772B))
 
-#define	AXE_IS_772(un)	\
+#define AXE_IS_772(un)	\
 	((un)->un_flags & (AX772 | AX772A | AX772B))
 
+#define AXE_IS_172(un) (AXE_IS_178_FAMILY(un) == 0)
+
 #define AX_RXCSUM	\
 (IFCAP_CSUM_IPv4_Rx | \
  IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx |	\
@@ -200,42 +202,42 @@ fail:
  * Various supported device vendors/products.
  */
 static const struct axe_type axe_devs[] = {
-	{ { USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_UFE2000}, 0 },
-	{ { USB_VENDOR_ACERCM,		USB_PRODUCT_ACERCM_EP1427X2}, 0 },
+	{ { USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_UFE2000 }, 0 },
+	{ { USB_VENDOR_ACERCM,		USB_PRODUCT_ACERCM_EP1427X2 }, 0 },
 	{ { USB_VENDOR_APPLE,		USB_PRODUCT_APPLE_ETHERNET }, AX772 },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88172}, 0 },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772}, AX772 },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772A}, AX772 },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772B}, AX772B },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772B_1}, AX772B },
-	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88178}, AX178 },
-	{ { USB_VENDOR_ATEN,		USB_PRODUCT_ATEN_UC210T}, 0 },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88172 }, 0 },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772 }, AX772 },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772A }, AX772 },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772B }, AX772B },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88772B_1 }, AX772B },
+	{ { USB_VENDOR_ASIX,		USB_PRODUCT_ASIX_AX88178 }, AX178 },
+	{ { USB_VENDOR_ATEN,		USB_PRODUCT_ATEN_UC210T }, 0 },
 	{ { USB_VENDOR_BELKIN,		USB_PRODUCT_BELKIN_F5D5055 }, AX178 },
-	{ { USB_VENDOR_BILLIONTON,	USB_PRODUCT_BILLIONTON_USB2AR}, 0},
-	{ { USB_VENDOR_CISCOLINKSYS,	USB_PRODUCT_CISCOLINKSYS_USB200MV2}, AX772A },
-	{ { USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_FETHER_USB2_TX }, 0},
-	{ { USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_DUBE100}, 0 },
+	{ { USB_VENDOR_BILLIONTON,	USB_PRODUCT_BILLIONTON_USB2AR }, 0},
+	{ { USB_VENDOR_CISCOLINKSYS,	USB_PRODUCT_CISCOLINKSYS_USB200MV2 }, AX772A },
+	{ { USB_VENDOR_COREGA,		USB_PRODUCT_COREGA_FETHER_USB2_TX }, 0 },
+	{ { USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_DUBE100 }, 0 },
 	{ { USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_DUBE100B1 }, AX772 },
 	{ { USB_VENDOR_DLINK2,		USB_PRODUCT_DLINK2_DUBE100B1 }, AX772 },
 	{ { USB_VENDOR_DLINK,		USB_PRODUCT_DLINK_DUBE100C1 }, AX772B },
-	{ { USB_VENDOR_GOODWAY,		USB_PRODUCT_GOODWAY_GWUSB2E}, 0 },
+	{ { USB_VENDOR_GOODWAY,		USB_PRODUCT_GOODWAY_GWUSB2E }, 0 },
 	{ { USB_VENDOR_IODATA,		USB_PRODUCT_IODATA_ETGUS2 }, AX178 },
-	{ { USB_VENDOR_JVC,		USB_PRODUCT_JVC_MP_PRX1}, 0 },
+	{ { USB_VENDOR_JVC,		USB_PRODUCT_JVC_MP_PRX1 }, 0 },
 	{ { USB_VENDOR_LENOVO,		USB_PRODUCT_LENOVO_ETHERNET }, AX772B },
-	{ { USB_VENDOR_LINKSYS,		USB_PRODUCT_LINKSYS_HG20F9}, AX772B },
-	{ { USB_VENDOR_LINKSYS2,	USB_PRODUCT_LINKSYS2_USB200M}, 0 },
+	{ { USB_VENDOR_LINKSYS,		USB_PRODUCT_LINKSYS_HG20F9 }, AX772B },
+	{ { USB_VENDOR_LINKSYS2,	USB_PRODUCT_LINKSYS2_USB200M }, 0 },
 	{ { USB_VENDOR_LINKSYS4,	USB_PRODUCT_LINKSYS4_USB1000 }, AX178 },
-	{ { USB_VENDOR_LOGITEC,		USB_PRODUCT_LOGITEC_LAN_GTJU2}, AX178 },
-	{ { USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_LUAU2GT}, AX178 },
-	{ { USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_LUAU2KTX}, 0 },
-	{ { USB_VENDOR_MSI,		USB_PRODUCT_MSI_AX88772A}, AX772 },
-	{ { USB_VENDOR_NETGEAR,		USB_PRODUCT_NETGEAR_FA120}, 0 },
+	{ { USB_VENDOR_LOGITEC,		USB_PRODUCT_LOGITEC_LAN_GTJU2 }, AX178 },
+	{ { USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_LUAU2GT }, AX178 },
+	{ { USB_VENDOR_MELCO,		USB_PRODUCT_MELCO_LUAU2KTX }, 0 },
+	{ { USB_VENDOR_MSI,		USB_PRODUCT_MSI_A

CVS commit: [netbsd-9] src/etc/rc.d

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 11:53:09 UTC 2020

Modified Files:
src/etc/rc.d [netbsd-9]: random_seed

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #743):

etc/rc.d/random_seed: revision 1.8

Allow random seed on zfs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.26.1 src/etc/rc.d/random_seed

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

Modified files:

Index: src/etc/rc.d/random_seed
diff -u src/etc/rc.d/random_seed:1.7 src/etc/rc.d/random_seed:1.7.26.1
--- src/etc/rc.d/random_seed:1.7	Tue Jul 22 17:11:09 2014
+++ src/etc/rc.d/random_seed	Sun Mar  1 11:53:09 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: random_seed,v 1.7 2014/07/22 17:11:09 wiz Exp $
+# $NetBSD: random_seed,v 1.7.26.1 2020/03/01 11:53:09 martin Exp $
 #
 
 # PROVIDE: random_seed
@@ -47,7 +47,7 @@ fs_safe()
 	#
 	fstype="$(getfstype "$1")"
 	case "${fstype}" in
-	ffs|lfs|ext2fs|msdos|v7fs)
+	ffs|lfs|ext2fs|msdos|v7fs|zfs)
 		return 0
 		;;
 	*)



CVS commit: [netbsd-9] src/doc

2020-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  1 11:52:35 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.1

Log Message:
Fix description for #725


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/doc/CHANGES-9.1

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-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.5 src/doc/CHANGES-9.1:1.1.2.6
--- src/doc/CHANGES-9.1:1.1.2.5	Thu Feb 27 19:08:09 2020
+++ src/doc/CHANGES-9.1	Sun Mar  1 11:52:35 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.5 2020/02/27 19:08:09 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.6 2020/03/01 11:52:35 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -121,7 +121,6 @@ external/cddl/osnet/sys/kern/misc.c		1.8
 
 	- Make block device nodes with /dev on zfs work.
 	- Mount zfs if zfs=YES whether or not /etc/zfs/zpool.cache is there.
-	- Allow random seed to be stored on zfs.
 	- Mark our changes to zpools as NetBSD, not OpenSolaris.
 	[riastradh, ticket #725]
 



CVS commit: src/sys/dev/usb

2020-03-01 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sun Mar  1 10:16:17 UTC 2020

Modified Files:
src/sys/dev/usb: if_axe.c

Log Message:
use DOPAUSE. 772B Lenovo now has working rxpause,txpause


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/usb/if_axe.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.127 src/sys/dev/usb/if_axe.c:1.128
--- src/sys/dev/usb/if_axe.c:1.127	Sun Mar  1 08:32:15 2020
+++ src/sys/dev/usb/if_axe.c	Sun Mar  1 10:16:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.127 2020/03/01 08:32:15 nisimura Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.128 2020/03/01 10:16:17 nisimura Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.127 2020/03/01 08:32:15 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.128 2020/03/01 10:16:17 nisimura Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1000,14 +1000,9 @@ axe_attach(device_t parent, device_t sel
 		 * not possible to announce IFCAP_VLAN_HWTAGGING.
 		 */
 	}
-	u_int adv_pause;
 	if (un->un_flags & (AX772A | AX772B | AX178))
-		adv_pause = MIIF_DOPAUSE;
-	else
-		adv_pause = 0;
-	adv_pause = 0;
+		unm.un_mii_flags = MIIF_DOPAUSE;
 
-	unm.un_mii_flags = adv_pause;
 	usbnet_attach_ifp(un, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST,
 	0, &unm);
 }



CVS commit: src/sys/dev/usb

2020-03-01 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sun Mar  1 08:32:15 UTC 2020

Modified Files:
src/sys/dev/usb: if_axe.c

Log Message:
simplify single bit tests. no code difference is observed


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/usb/if_axe.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.126 src/sys/dev/usb/if_axe.c:1.127
--- src/sys/dev/usb/if_axe.c:1.126	Sat Feb 29 04:27:53 2020
+++ src/sys/dev/usb/if_axe.c	Sun Mar  1 08:32:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.126 2020/02/29 04:27:53 nisimura Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.127 2020/03/01 08:32:15 nisimura Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.126 2020/02/29 04:27:53 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.127 2020/03/01 08:32:15 nisimura Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -387,14 +387,12 @@ axe_mii_statchg(struct ifnet *ifp)
 		return;
 
 	val = 0;
-	if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) {
+	if (mii->mii_media_active & IFM_FDX) {
 		val |= AXE_MEDIA_FULL_DUPLEX;
 		if (AXE_IS_178_FAMILY(un)) {
-			if ((IFM_OPTIONS(mii->mii_media_active) &
-			IFM_ETH_TXPAUSE) != 0)
+			if (mii->mii_media_active & IFM_ETH_TXPAUSE)
 val |= AXE_178_MEDIA_TXFLOW_CONTROL_EN;
-			if ((IFM_OPTIONS(mii->mii_media_active) &
-			IFM_ETH_RXPAUSE) != 0)
+			if (mii->mii_media_active & IFM_ETH_RXPAUSE)
 val |= AXE_178_MEDIA_RXFLOW_CONTROL_EN;
 		}
 	}



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

2020-03-01 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Sun Mar  1 08:21:38 UTC 2020

Modified Files:
src/crypto/external/bsd/openssh/dist: ssh_config sshd_config

Log Message:
Sync with OpenSSH 8.2p1 sample configs

- Add GSSAPIAuthentication and related options
- Add KerberosAuthentication and related options
- Bring in the lengthy but useful comment block about
  the side-effect of UsePAM with regards to PermitRootLogin.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/crypto/external/bsd/openssh/dist/ssh_config
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/sshd_config

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/ssh_config
diff -u src/crypto/external/bsd/openssh/dist/ssh_config:1.13 src/crypto/external/bsd/openssh/dist/ssh_config:1.14
--- src/crypto/external/bsd/openssh/dist/ssh_config:1.13	Fri Feb 28 10:41:48 2020
+++ src/crypto/external/bsd/openssh/dist/ssh_config	Sun Mar  1 08:21:38 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: ssh_config,v 1.13 2020/02/28 10:41:48 kim Exp $
+#	$NetBSD: ssh_config,v 1.14 2020/03/01 08:21:38 kim Exp $
 #	$OpenBSD: ssh_config,v 1.34 2019/02/04 02:39:42 dtucker Exp $
 
 # This is the ssh client system-wide configuration file.  See
@@ -27,6 +27,8 @@ Host *.netbsd.org *.NetBSD.org
 #   ForwardX11 no
 #   PasswordAuthentication yes
 #   HostbasedAuthentication no
+#   GSSAPIAuthentication no
+#   GSSAPIDelegateCredentials no
 #   BatchMode no
 #   CheckHostIP yes
 #   AddressFamily any

Index: src/crypto/external/bsd/openssh/dist/sshd_config
diff -u src/crypto/external/bsd/openssh/dist/sshd_config:1.24 src/crypto/external/bsd/openssh/dist/sshd_config:1.25
--- src/crypto/external/bsd/openssh/dist/sshd_config:1.24	Fri Feb 28 10:59:58 2020
+++ src/crypto/external/bsd/openssh/dist/sshd_config	Sun Mar  1 08:21:38 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: sshd_config,v 1.24 2020/02/28 10:59:58 kim Exp $
+#	$NetBSD: sshd_config,v 1.25 2020/03/01 08:21:38 kim Exp $
 #	$OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
 
 # This is the sshd server system-wide configuration file.  See
@@ -60,6 +60,27 @@ AuthorizedKeysFile	.ssh/authorized_keys
 # Change to no to disable s/key passwords
 #ChallengeResponseAuthentication yes
 
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM yes
+
 #AllowAgentForwarding yes
 #AllowTcpForwarding yes
 #GatewayPorts no
@@ -72,7 +93,6 @@ AuthorizedKeysFile	.ssh/authorized_keys
 #PrintMotd yes
 #PrintLastLog yes
 #TCPKeepAlive yes
-UsePAM yes
 #PermitUserEnvironment no
 #Compression delayed
 #ClientAliveInterval 0