CVS commit: src/sys/dev/pci

2020-01-05 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Mon Jan  6 07:57:06 UTC 2020

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

Log Message:
correct bogus comparison. pointed by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/if_kse.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_kse.c
diff -u src/sys/dev/pci/if_kse.c:1.46 src/sys/dev/pci/if_kse.c:1.47
--- src/sys/dev/pci/if_kse.c:1.46	Sat Dec 14 04:12:49 2019
+++ src/sys/dev/pci/if_kse.c	Mon Jan  6 07:57:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kse.c,v 1.46 2019/12/14 04:12:49 nisimura Exp $	*/
+/*	$NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.46 2019/12/14 04:12:49 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.47 2020/01/06 07:57:06 nisimura Exp $");
 
 #include 
 #include 
@@ -63,7 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1
 #include 
 #include 
 
-#define KSE_LINKDEBUG 1
+#define KSE_LINKDEBUG 0
 
 #define CSR_READ_4(sc, off) \
 	bus_space_read_4(sc->sc_st, sc->sc_sh, off)
@@ -1100,7 +1100,7 @@ kse_set_filter(struct kse_softc *sc)
 	sc->sc_rxc &= ~(RXC_MHTE | RXC_RM | RXC_RA);
 	ifp->if_flags &= ~IFF_ALLMULTI;
 
-	if ((ifp->if_flags & IFF_PROMISC) || ec->ec_multicnt > 0) {
+	if (ifp->if_flags & IFF_PROMISC) {
 		ifp->if_flags |= IFF_ALLMULTI;
 		goto update;
 	}



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

2020-01-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  6 07:40:45 UTC 2020

Modified Files:
src/sys/arch/arm/conf: Makefile.arm

Log Message:
Use CFLAGS instead of COPTS for -mapcs-frame when using DDB.

Discussed with mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/arm/conf/Makefile.arm

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/conf/Makefile.arm
diff -u src/sys/arch/arm/conf/Makefile.arm:1.52 src/sys/arch/arm/conf/Makefile.arm:1.53
--- src/sys/arch/arm/conf/Makefile.arm:1.52	Thu Jan  2 14:33:55 2020
+++ src/sys/arch/arm/conf/Makefile.arm	Mon Jan  6 07:40:45 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.arm,v 1.52 2020/01/02 14:33:55 skrll Exp $
+#	$NetBSD: Makefile.arm,v 1.53 2020/01/06 07:40:45 skrll Exp $
 
 # Makefile for NetBSD
 #
@@ -78,7 +78,7 @@ CFLAGS+=	-mno-unaligned-access
 
 OPT_DDB=	%DDB%
 .if !empty(OPT_DDB) && ${HAVE_GCC:U0} > 0
-COPTS+=		-mapcs-frame
+CFLAGS+=	-mapcs-frame
 .endif
 
 ##



CVS commit: src/sys

2020-01-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  6 07:15:03 UTC 2020

Modified Files:
src/sys/arch/x86/pci: if_vmx.c
src/sys/dev/isa: if_iy.c
src/sys/dev/pci: if_de.c
src/sys/dev/pcmcia: if_ray.c if_xi.c

Log Message:
Protect ec_multicnt.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/pci/if_vmx.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.164 -r1.165 src/sys/dev/pci/if_de.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pcmcia/if_xi.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/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.53 src/sys/arch/x86/pci/if_vmx.c:1.54
--- src/sys/arch/x86/pci/if_vmx.c:1.53	Tue Dec 24 10:21:08 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Jan  6 07:15:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.53 2019/12/24 10:21:08 knakahara Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.54 2020/01/06 07:15:03 msaitoh Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.53 2019/12/24 10:21:08 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.54 2020/01/06 07:15:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -3313,16 +3313,15 @@ vmxnet3_set_rxfilter(struct vmxnet3_soft
 	 */
 	mode = VMXNET3_RXMODE_BCAST | VMXNET3_RXMODE_UCAST;
 
+	ETHER_LOCK(ec);
 	if (ISSET(ifp->if_flags, IFF_PROMISC) ||
 	ec->ec_multicnt > VMXNET3_MULTICAST_MAX)
 		goto allmulti;
 
 	p = sc->vmx_mcast;
-	ETHER_LOCK(ec);
 	ETHER_FIRST_MULTI(step, ec, enm);
 	while (enm != NULL) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
-			ETHER_UNLOCK(ec);
 			/*
 			 * We must listen to a range of multicast addresses.
 			 * For now, just accept all multicasts, rather than
@@ -3339,17 +3338,16 @@ vmxnet3_set_rxfilter(struct vmxnet3_soft
 
 		ETHER_NEXT_MULTI(step, enm);
 	}
-	ETHER_UNLOCK(ec);
 
 	if (ec->ec_multicnt > 0) {
 		SET(mode, VMXNET3_RXMODE_MCAST);
 		ds->mcast_tablelen = p - sc->vmx_mcast;
 	}
+	ETHER_UNLOCK(ec);
 
 	goto setit;
 
 allmulti:
-	ETHER_LOCK(ec);
 	SET(ec->ec_flags, ETHER_F_ALLMULTI);
 	ETHER_UNLOCK(ec);
 	SET(mode, (VMXNET3_RXMODE_ALLMULTI | VMXNET3_RXMODE_MCAST));

Index: src/sys/dev/isa/if_iy.c
diff -u src/sys/dev/isa/if_iy.c:1.111 src/sys/dev/isa/if_iy.c:1.112
--- src/sys/dev/isa/if_iy.c:1.111	Tue Nov 12 13:17:44 2019
+++ src/sys/dev/isa/if_iy.c	Mon Jan  6 07:15:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iy.c,v 1.111 2019/11/12 13:17:44 msaitoh Exp $	*/
+/*	$NetBSD: if_iy.c,v 1.112 2020/01/06 07:15:03 msaitoh Exp $	*/
 /* #define IYDEBUG */
 /* #define IYMEMDEBUG */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.111 2019/11/12 13:17:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.112 2020/01/06 07:15:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -1305,6 +1305,7 @@ iy_mc_setup(struct iy_softc *sc)
 	iot = sc->sc_iot;
 	ioh = sc->sc_ioh;
 
+	ETHER_LOCK(ecp);
 	len = 6 * ecp->ec_multicnt;
 
 	avail = sc->tx_start - sc->tx_end;
@@ -1330,7 +1331,6 @@ iy_mc_setup(struct iy_softc *sc)
 	bus_space_write_2(iot, ioh, MEM_PORT_REG, 0);
 	bus_space_write_stream_2(iot, ioh, MEM_PORT_REG, htole16(len));
 
-	ETHER_LOCK(ecp);
 	ETHER_FIRST_MULTI(step, ecp, enm);
 	while (enm) {
 		/*

Index: src/sys/dev/pci/if_de.c
diff -u src/sys/dev/pci/if_de.c:1.164 src/sys/dev/pci/if_de.c:1.165
--- src/sys/dev/pci/if_de.c:1.164	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pci/if_de.c	Mon Jan  6 07:15:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_de.c,v 1.164 2019/11/10 21:16:36 chs Exp $	*/
+/*	$NetBSD: if_de.c,v 1.165 2020/01/06 07:15:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1994-1997 Matt Thomas (m...@3am-software.com)
@@ -37,7 +37,7 @@
  *   board which support 21040, 21041, or 21140 (mostly).
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.164 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.165 2020/01/06 07:15:03 msaitoh Exp $");
 
 #define	TULIP_HDR_DATA
 
@@ -3218,6 +3218,7 @@ tulip_addr_filter(tulip_softc_t * const 
 	sc->tulip_if.if_flags &= ~IFF_ALLMULTI;
 #endif
 	sc->tulip_if.if_start = tulip_ifstart;	/* so the setup packet gets queued */
+	ETHER_LOCK(ec);
 	if (sc->tulip_multicnt > 14) {
 		uint32_t *sp = sc->tulip_setupdata;
 		unsigned hash;
@@ -3238,7 +3239,6 @@ tulip_addr_filter(tulip_softc_t * const 
 		 * hardware).
 		 */
 		memset(sc->tulip_setupdata, 0, sizeof(sc->tulip_setupdata));
-		ETHER_LOCK(ec);
 		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
 			if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) == 0) {
@@ -3256,7 +3256,6 @@ tulip_addr_filter(tulip_softc_t * const 
 			}
 			ETHER_NEXT_MULTI(step, enm);
 		}
-		ETHER_UNLOCK(ec);
 		/*
 		 * No reason to use a hash if we are going to be
 		 * receiving every multicast.
@@ 

CVS commit: src/sys/arch/arm

2020-01-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  6 06:50:00 UTC 2020

Modified Files:
src/sys/arch/arm/omap: if_cpsw.c
src/sys/arch/arm/ti: if_cpsw.c

Log Message:
Add ETHER_LOCK() and ETHER_UNLOCK() to protect ec_multiaddrs.

XXX These drivers don't check whether enm_addrlo and enm_addrhi are the same
or not, so it won't work correctly if an multicast address entry has a range.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/omap/if_cpsw.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/ti/if_cpsw.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/omap/if_cpsw.c
diff -u src/sys/arch/arm/omap/if_cpsw.c:1.25 src/sys/arch/arm/omap/if_cpsw.c:1.26
--- src/sys/arch/arm/omap/if_cpsw.c:1.25	Wed May 29 06:17:27 2019
+++ src/sys/arch/arm/omap/if_cpsw.c	Mon Jan  6 06:50:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.25 2019/05/29 06:17:27 msaitoh Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.26 2020/01/06 06:50:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.25 2019/05/29 06:17:27 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.26 2020/01/06 06:50:00 msaitoh Exp $");
 
 #include 
 #include 
@@ -1543,9 +1543,11 @@ cpsw_ale_update_addresses(struct cpsw_so
 		cpsw_ale_remove_all_mc_entries(sc);
 
 	/* Set other multicast addrs desired. */
+	ETHER_LOCK(ec);
 	LIST_FOREACH(ifma, >ec_multiaddrs, enm_list) {
 		cpsw_ale_mc_entry_set(sc, ALE_PORT_MASK_ALL, ifma->enm_addrlo);
 	}
+	ETHER_UNLOCK(ec);
 
 	return 0;
 }

Index: src/sys/arch/arm/ti/if_cpsw.c
diff -u src/sys/arch/arm/ti/if_cpsw.c:1.9 src/sys/arch/arm/ti/if_cpsw.c:1.10
--- src/sys/arch/arm/ti/if_cpsw.c:1.9	Sun Nov 24 09:37:05 2019
+++ src/sys/arch/arm/ti/if_cpsw.c	Mon Jan  6 06:50:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.10 2020/01/06 06:50:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.10 2020/01/06 06:50:00 msaitoh Exp $");
 
 #include 
 #include 
@@ -1550,9 +1550,11 @@ cpsw_ale_update_addresses(struct cpsw_so
 		cpsw_ale_remove_all_mc_entries(sc);
 
 	/* Set other multicast addrs desired. */
+	ETHER_LOCK(ec);
 	LIST_FOREACH(ifma, >ec_multiaddrs, enm_list) {
 		cpsw_ale_mc_entry_set(sc, ALE_PORT_MASK_ALL, ifma->enm_addrlo);
 	}
+	ETHER_UNLOCK(ec);
 
 	return 0;
 }



CVS commit: src/doc

2020-01-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  6 05:38:59 UTC 2020

Modified Files:
src/doc: TODO.smpnet

Log Message:
 Add aq(4) and ixl(4) to the MPSAFE component list.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/doc/TODO.smpnet

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

Modified files:

Index: src/doc/TODO.smpnet
diff -u src/doc/TODO.smpnet:1.29 src/doc/TODO.smpnet:1.30
--- src/doc/TODO.smpnet:1.29	Wed Mar 27 06:56:37 2019
+++ src/doc/TODO.smpnet	Mon Jan  6 05:38:59 2020
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.29 2019/03/27 06:56:37 ozaki-r Exp $
+$NetBSD: TODO.smpnet,v 1.30 2020/01/06 05:38:59 msaitoh Exp $
 
 MP-safe components
 ==
@@ -7,10 +7,12 @@ They work without the big kernel lock (K
 kernel option.  Some components scale up and some don't.
 
  - Device drivers
+   - aq(4)
- vioif(4)
- vmx(4)
- wm(4)
- ixg(4)
+   - ixl(4)
- ixv(4)
  - Layer 2
- Ethernet (if_ethersubr.c)



CVS commit: src/sys/sys

2020-01-05 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Mon Jan  6 01:37:57 UTC 2020

Modified Files:
src/sys/sys: sched.h

Log Message:
Build fix.  Add back inclusion of , which was previously
included via .


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/sys/sched.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/sys/sched.h
diff -u src/sys/sys/sched.h:1.83 src/sys/sys/sched.h:1.84
--- src/sys/sys/sched.h:1.83	Sun Jan  5 20:26:56 2020
+++ src/sys/sys/sched.h	Mon Jan  6 01:37:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched.h,v 1.83 2020/01/05 20:26:56 ad Exp $	*/
+/*	$NetBSD: sched.h,v 1.84 2020/01/06 01:37:57 oster Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2007, 2008, 2019
@@ -71,6 +71,7 @@
 #define	_SYS_SCHED_H_
 
 #include 
+#include 
 #include 
 
 #if defined(_KERNEL_OPT)



CVS commit: src/sys/uvm

2020-01-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jan  5 22:01:09 UTC 2020

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

Log Message:
Page allocator:

The method for assigning pages to buckets in the non-NUMA case sucks.  It
can defeat memory interleaving in the hardware, and not distribute pages
fairly by colour.  To fix this and make things more deterministic, take the
physical PFN and colour into account.

Then when freeing pages, in the non-NUMA case don't change the page's bucket
either.  Keeping the bucket number stable will also permit partitioning page
replacement state by CPU package / NUMA node.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/uvm/uvm_page.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_page.c
diff -u src/sys/uvm/uvm_page.c:1.220 src/sys/uvm/uvm_page.c:1.221
--- src/sys/uvm/uvm_page.c:1.220	Tue Dec 31 22:42:51 2019
+++ src/sys/uvm/uvm_page.c	Sun Jan  5 22:01:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.220 2019/12/31 22:42:51 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.221 2020/01/05 22:01:09 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.220 2019/12/31 22:42:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.221 2020/01/05 22:01:09 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -806,9 +806,12 @@ uvm_page_redim(int newncolors, int newnb
 	 * Here we decide on the NEW color &
 	 * bucket for the page.  For NUMA
 	 * we'll use the info that the
-	 * hardware gave us.  Otherwise we
-	 * just do a round-robin among the
-	 * buckets.
+	 * hardware gave us.  For non-NUMA
+	 * assign take physical page frame
+	 * number and cache color into
+	 * account.  We do this to try and
+	 * avoid defeating any memory
+	 * interleaving in the hardware.
 	 */
 	KASSERT(
 	uvm_page_get_bucket(pg) == ob);
@@ -816,10 +819,10 @@ uvm_page_redim(int newncolors, int newnb
 	uvm_page_get_freelist(pg));
 	if (uvm.numa_alloc) {
 		nb = uvm_page_numa_lookup(pg);
-	} else if (nb + 1 < newnbuckets) {
-		nb = nb + 1;
 	} else {
-		nb = 0;
+		nb = atop(VM_PAGE_TO_PHYS(pg))
+		/ uvmexp.ncolors / 8
+		% newnbuckets;
 	}
 	uvm_page_set_bucket(pg, nb);
 	npgb = npgfl.pgfl_buckets[nb];
@@ -1575,22 +1578,10 @@ uvm_pagefree(struct vm_page *pg)
 		uvm_pagezerocheck(pg);
 #endif /* DEBUG */
 
+	/* Try to send the page to the per-CPU cache. */
 	s = splvm();
 	ucpu = curcpu()->ci_data.cpu_uvm;
-
-	/*
-	 * If we're using the NUMA strategy, we'll only cache this page if
-	 * it came from the local CPU's NUMA node.  Otherwise we're using
-	 * the L2/L3 cache locality strategy and we'll cache anything.
-	 */
-	if (uvm.numa_alloc) {
-		bucket = uvm_page_get_bucket(pg);
-	} else {
-		bucket = ucpu->pgflbucket;
-		uvm_page_set_bucket(pg, bucket);
-	}
-
-	/* Try to send the page to the per-CPU cache. */
+	bucket = uvm_page_get_bucket(pg);
 	if (bucket == ucpu->pgflbucket && uvm_pgflcache_free(ucpu, pg)) {
 		splx(s);
 		return;



CVS commit: src/sys/kern

2020-01-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan  5 21:12:34 UTC 2020

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

Log Message:
When reading from /dev/ksyms we need to skip over entries that have
been marked as sd_gone.  Otherwise we might try to uiomove() data from
memory that has been unmapped, resulting in EFAULT.

XXX This (along with other pre-existing checks st->sd_gone) is still
racy, but it's an improvement over current code.  Ideally we would
make a complete copy of the symbol table when we open /dev/ksyms so
we could ignore any changes that occur.

ad@ says "good enough for now"

XXX Pullup to -9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/kern_ksyms.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_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.87 src/sys/kern/kern_ksyms.c:1.88
--- src/sys/kern/kern_ksyms.c:1.87	Sat Nov  4 22:17:55 2017
+++ src/sys/kern/kern_ksyms.c	Sun Jan  5 21:12:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.87 2017/11/04 22:17:55 christos Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.88 2020/01/05 21:12:34 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.87 2017/11/04 22:17:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.88 2020/01/05 21:12:34 pgoyette Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_copy_symtab.h"
@@ -765,9 +765,9 @@ ksyms_modunload(const char *name)
 		if (strcmp(name, st->sd_name) != 0)
 			continue;
 		st->sd_gone = true;
+		ksyms_sizes_calc();
 		if (!ksyms_isopen) {
 			TAILQ_REMOVE(_symtabs, st, sd_queue);
-			ksyms_sizes_calc();
 			kmem_free(st->sd_nmap,
   st->sd_nmapsize * sizeof(uint32_t));
 			kmem_free(st, sizeof(*st));
@@ -856,6 +856,8 @@ ksyms_sizes_calc(void)
 
 	ksyms_symsz = ksyms_strsz = 0;
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		delta = ksyms_strsz - st->sd_usroffset;
 		if (delta != 0) {
 			for (i = 0; i < st->sd_symsize/sizeof(Elf_Sym); i++)
@@ -1034,6 +1036,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	 */
 	filepos = sizeof(struct ksyms_hdr);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_symsize + filepos) {
@@ -1052,6 +1056,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	KASSERT(filepos == sizeof(struct ksyms_hdr) +
 	ksyms_hdr.kh_shdr[SYMTAB].sh_size);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_strsize + filepos) {



CVS commit: src/sys/sys

2020-01-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jan  5 20:52:15 UTC 2020

Modified Files:
src/sys/sys: param.h

Log Message:
NetBSD 9.99.34 - schedstate_percpu changed.


To generate a diff of this commit:
cvs rdiff -u -r1.634 -r1.635 src/sys/sys/param.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/sys/param.h
diff -u src/sys/sys/param.h:1.634 src/sys/sys/param.h:1.635
--- src/sys/sys/param.h:1.634	Thu Jan  2 15:43:11 2020
+++ src/sys/sys/param.h	Sun Jan  5 20:52:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.634 2020/01/02 15:43:11 thorpej Exp $	*/
+/*	$NetBSD: param.h,v 1.635 2020/01/05 20:52:15 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999003300	/* NetBSD 9.99.33 */
+#define	__NetBSD_Version__	999003400	/* NetBSD 9.99.34 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/kern

2020-01-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jan  5 20:27:43 UTC 2020

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

Log Message:
mi_cpu_init(): provide fake topology info for early boot.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_cpu.c

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

Modified files:

Index: src/sys/kern/subr_cpu.c
diff -u src/sys/kern/subr_cpu.c:1.4 src/sys/kern/subr_cpu.c:1.5
--- src/sys/kern/subr_cpu.c:1.4	Thu Jan  2 01:31:17 2020
+++ src/sys/kern/subr_cpu.c	Sun Jan  5 20:27:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cpu.c,v 1.4 2020/01/02 01:31:17 ad Exp $	*/
+/*	$NetBSD: subr_cpu.c,v 1.5 2020/01/05 20:27:43 ad Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.4 2020/01/02 01:31:17 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.5 2020/01/05 20:27:43 ad Exp $");
 
 #include 
 #include 
@@ -71,6 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v
 #include 
 #include 
 
+static void	cpu_topology_fake1(struct cpu_info *);
+
 kmutex_t	cpu_lock		__cacheline_aligned;
 int		ncpu			__read_mostly;
 int		ncpuonline		__read_mostly;
@@ -104,7 +106,7 @@ mi_cpu_init(void)
 	kcpuset_set(kcpuset_running, 0);
 
 	ci = curcpu();
-	ci->ci_smt_primary = ci;
+	cpu_topology_fake1(ci);
 }
 
 int
@@ -207,6 +209,27 @@ cpu_topology_dump(void)
 
 /*
  * Fake up topology info if we have none, or if what we got was bogus.
+ * Used early in boot, and by cpu_topology_fake().
+ */
+static void
+cpu_topology_fake1(struct cpu_info *ci)
+{
+	enum cpu_rel rel;
+
+	for (rel = 0; rel < __arraycount(ci->ci_sibling); rel++) {
+		ci->ci_sibling[rel] = ci;
+		ci->ci_nsibling[rel] = 1;
+	}
+	if (!cpu_topology_present) {
+		ci->ci_package_id = cpu_index(ci);
+	}
+	ci->ci_smt_primary = ci;
+	ci->ci_schedstate.spc_flags |= SPCF_SMTPRIMARY;
+	cpu_topology_dump();
+}
+
+/*
+ * Fake up topology info if we have none, or if what we got was bogus.
  * Don't override ci_package_id, etc, if cpu_topology_present is set.
  * MD code also uses these.
  */
@@ -215,18 +238,9 @@ cpu_topology_fake(void)
 {
 	CPU_INFO_ITERATOR cii;
 	struct cpu_info *ci;
-	enum cpu_rel rel;
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		for (rel = 0; rel < __arraycount(ci->ci_sibling); rel++) {
-			ci->ci_sibling[rel] = ci;
-			ci->ci_nsibling[rel] = 1;
-		}
-		if (!cpu_topology_present) {
-			ci->ci_package_id = cpu_index(ci);
-		}
-		ci->ci_smt_primary = ci;
-		ci->ci_schedstate.spc_flags |= SPCF_SMTPRIMARY;
+		cpu_topology_fake1(ci);
 	}
 	cpu_topology_dump();
 }



CVS commit: src/sys

2020-01-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jan  5 20:26:56 UTC 2020

Modified Files:
src/sys/kern: kern_runq.c
src/sys/sys: sched.h

Log Message:
- Another tweak for SMT: if a new LWP is starting life, try to make it run
  on a different CPU in the same CPU core as the parent, because both parent
  and child share lots of state.  (I want to come back later and do
  something different for _lwp_create() and maybe execve().)

- Remove the runqueue evcnts, which are racy and impose a penalty for very
  little payoff.

- Break out of the loop in sched_takecpu() as soon as we have a CPU that can
  run the LWP.  There's no need to look at all CPUs.

- SPCF_IDLE in sched_enqueue() so we know the CPU is not idle sooner.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/kern/kern_runq.c
cvs rdiff -u -r1.82 -r1.83 src/sys/sys/sched.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/kern/kern_runq.c
diff -u src/sys/kern/kern_runq.c:1.54 src/sys/kern/kern_runq.c:1.55
--- src/sys/kern/kern_runq.c:1.54	Sat Jan  4 22:46:01 2020
+++ src/sys/kern/kern_runq.c	Sun Jan  5 20:26:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.54 2020/01/04 22:46:01 ad Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.55 2020/01/05 20:26:56 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.54 2020/01/04 22:46:01 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.55 2020/01/05 20:26:56 ad Exp $");
 
 #include "opt_dtrace.h"
 
@@ -178,15 +178,6 @@ sched_cpuattach(struct cpu_info *ci)
 	spc->spc_mutex = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SCHED);
 	for (i = 0; i < PRI_COUNT; i++)
 		TAILQ_INIT(>spc_queue[i]);
-
-	evcnt_attach_dynamic(>spc_ev_pull, EVCNT_TYPE_MISC, NULL,
-	   cpu_name(ci), "runqueue pull");
-	evcnt_attach_dynamic(>spc_ev_push, EVCNT_TYPE_MISC, NULL,
-	   cpu_name(ci), "runqueue push");
-	evcnt_attach_dynamic(>spc_ev_stay, EVCNT_TYPE_MISC, NULL,
-	   cpu_name(ci), "runqueue stay");
-	evcnt_attach_dynamic(>spc_ev_localize, EVCNT_TYPE_MISC, NULL,
-	   cpu_name(ci), "runqueue localize");
 }
 
 /*
@@ -235,6 +226,7 @@ sched_enqueue(struct lwp *l)
 	} else {
 		TAILQ_INSERT_TAIL(q_head, l, l_runq);
 	}
+	spc->spc_flags &= ~SPCF_IDLE;
 	spc->spc_count++;
 	if ((l->l_pflag & LP_BOUND) == 0)
 		spc->spc_mcount++;
@@ -474,15 +466,33 @@ sched_takecpu(struct lwp *l)
 	spc = >ci_schedstate;
 	eprio = lwp_eprio(l);
 
+	/*
+	 * For new LWPs (LSIDL), l_cpu was inherited from the parent when
+	 * the LWP was created (and is probably still curcpu at this point).
+	 * The child will initially be in close communication with the
+	 * parent and share VM context and cache state.  Look for an idle
+	 * SMT sibling to run it, and failing that run on the same CPU as
+	 * the parent.
+	 */
+	if (l->l_stat == LSIDL) {
+		tci = ci->ci_sibling[CPUREL_CORE];
+		while (tci != ci) {
+			ici_spc = >ci_schedstate;
+			if (l->l_psid == ici_spc->spc_psid &&
+			(ici_spc->spc_flags & SPCF_IDLE) != 0) {
+return tci;
+			}
+			tci = tci->ci_sibling[CPUREL_CORE];
+		}
+		if (spc->spc_psid == l->l_psid) {
+			return ci;
+		}
+	}
+
 	/* If SMT primary is idle, send it back there. */
 	tci = ci->ci_smt_primary;
 	if ((tci->ci_schedstate.spc_flags & SPCF_IDLE) != 0 &&
 	sched_migratable(l, tci)) {
-		if (tci != ci) {
-			spc->spc_ev_push.ev_count++;
-		} else {
-			spc->spc_ev_stay.ev_count++;
-		}
 		return tci;
 	}
 
@@ -490,23 +500,11 @@ sched_takecpu(struct lwp *l)
 	if (__predict_true(spc->spc_psid == l->l_psid)) {
 		/* If CPU of this thread is idling - run there */
 		if (spc->spc_count == 0) {
-			spc->spc_ev_stay.ev_count++;
 			return ci;
 		}
-		/*
-		 * New LWPs must start on the same CPU as the parent (l_cpu
-		 * was inherited when the LWP was created).  Doing otherwise
-		 * is bad for performance and repeatability, and agitates
-		 * buggy programs.  Also, we want the child to have a good
-		 * chance of reusing the VM context from the parent.
-		 */
-		if (l->l_stat == LSIDL) {
-			spc->spc_ev_stay.ev_count++;
-			return ci;
-		}		 
+
 		/* Stay if thread is cache-hot */
 		if (lwp_cache_hot(l) && eprio >= spc->spc_curpriority) {
-			spc->spc_ev_stay.ev_count++;
 			return ci;
 		}
 	}
@@ -515,8 +513,6 @@ sched_takecpu(struct lwp *l)
 	ci = curcpu();
 	spc = >ci_schedstate;
 	if (eprio > spc->spc_curpriority && sched_migratable(l, ci)) {
-		/* XXXAD foreign CPU not locked */
-		spc->spc_ev_localize.ev_count++;
 		return ci;
 	}
 
@@ -543,7 +539,7 @@ sched_takecpu(struct lwp *l)
 
 		if (pri == lpri) {
 			/* Pick the least busy CPU. */
-			if (spc->spc_count < ici_spc->spc_count)
+			if (spc->spc_count <= ici_spc->spc_count)
 continue;
 
 			/* Prefer SMT primaries over secondaries. */
@@ -555,11 +551,13 @@ sched_takecpu(struct lwp *l)
 		lpri = pri;
 		tci = ci;
 		spc = ici_spc;
-	} while (ci 

CVS commit: src/sys/arch/aarch64

2020-01-05 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jan  5 20:17:43 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: trap.c
src/sys/arch/aarch64/include: cpu.h

Log Message:
Give aarch64 a preemption safe cpu_intr_p().


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/include/cpu.h

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.22 src/sys/arch/aarch64/aarch64/trap.c:1.23
--- src/sys/arch/aarch64/aarch64/trap.c:1.22	Tue Dec  3 22:02:43 2019
+++ src/sys/arch/aarch64/aarch64/trap.c	Sun Jan  5 20:17:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.22 2019/12/03 22:02:43 jmcneill Exp $ */
+/* $NetBSD: trap.c,v 1.23 2020/01/05 20:17:43 ad Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.22 2019/12/03 22:02:43 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.23 2020/01/05 20:17:43 ad Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -619,3 +619,31 @@ void do_trapsignal1(
 #endif
 	(*l->l_proc->p_emul->e_trapsignal)(l, );
 }
+
+bool
+cpu_intr_p(void)
+{
+	uint64_t ncsw;
+	int idepth;
+	lwp_t *l;
+
+#ifdef __HAVE_PIC_FAST_SOFTINTS
+	/* XXX Copied from cpu.h.  Looks incomplete - needs fixing. */
+	if (ci->ci_cpl < IPL_VM)
+		return false;
+#endif
+
+	l = curlwp;
+	if (__predict_false(l->l_cpu == NULL)) {
+		KASSERT(l == );
+		return false;
+	}
+	do {
+		ncsw = l->l_ncsw;
+		__insn_barrier();
+		idepth = l->l_cpu->ci_idepth;
+		__insn_barrier();
+	} while (__predict_false(ncsw != l->l_ncsw));
+
+	return idepth > 0;
+}

Index: src/sys/arch/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.16 src/sys/arch/aarch64/include/cpu.h:1.17
--- src/sys/arch/aarch64/include/cpu.h:1.16	Mon Dec  2 18:35:07 2019
+++ src/sys/arch/aarch64/include/cpu.h	Sun Jan  5 20:17:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.16 2019/12/02 18:35:07 ad Exp $ */
+/* $NetBSD: cpu.h,v 1.17 2020/01/05 20:17:43 ad Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -157,16 +157,6 @@ cpu_dosoftints(void)
 #endif
 }
 
-static inline bool
-cpu_intr_p(void)
-{
-#ifdef __HAVE_PIC_FAST_SOFTINTS
-	if (ci->ci_cpl < IPL_VM)
-		return false;
-#endif
-	return curcpu()->ci_intr_depth > 0;
-}
-
 void	cpu_attach(device_t, cpuid_t);
 
 #endif /* _KERNEL || _KMEMUSER */



CVS commit: src/distrib/notes

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 18:37:55 UTC 2020

Modified Files:
src/distrib/notes: Makefile.inc

Log Message:
PR install/54836: fix broken conditional, passing the wrong set name suffix
to groff.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/notes/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/notes/Makefile.inc
diff -u src/distrib/notes/Makefile.inc:1.52 src/distrib/notes/Makefile.inc:1.53
--- src/distrib/notes/Makefile.inc:1.52	Sat Nov 30 00:28:27 2019
+++ src/distrib/notes/Makefile.inc	Sun Jan  5 18:37:54 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.52 2019/11/30 00:28:27 uwe Exp $
+#	$NetBSD: Makefile.inc,v 1.53 2020/01/05 18:37:54 martin Exp $
 #
 
 # Ross Harvey 
@@ -29,7 +29,7 @@ whatis: .OPTIONAL
 
 PRESET=	${GFLAGS} -U -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1
 PRESET+=	-rmajor=${DISTRIBVER:C/\..*$//}
-.if ${USE_XZ_SETS}
+.if ${USE_XZ_SETS:Uno} == "yes"
 PRESET+=	-dsetsuffix=tar.xz
 .else
 PRESET+=	-dsetsuffix=tgz



CVS commit: src/sys/arch

2020-01-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan  5 17:26:31 UTC 2020

Modified Files:
src/sys/arch/arm/fdt: files.fdt
src/sys/arch/evbarm/conf: files.generic64
Added Files:
src/sys/arch/arm/fdt: arm_platform.c
Removed Files:
src/sys/arch/arm/fdt: arm64_platform.c

Log Message:
Make the generic Arm platform available for arm32 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/fdt/arm64_platform.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/arm_platform.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/files.generic64

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/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.29 src/sys/arch/arm/fdt/files.fdt:1.30
--- src/sys/arch/arm/fdt/files.fdt:1.29	Sat Aug 10 17:03:59 2019
+++ src/sys/arch/arm/fdt/files.fdt	Sun Jan  5 17:26:31 2020
@@ -1,10 +1,11 @@
-# $NetBSD: files.fdt,v 1.29 2019/08/10 17:03:59 skrll Exp $
+# $NetBSD: files.fdt,v 1.30 2020/01/05 17:26:31 jmcneill Exp $
 
 include	"dev/pckbport/files.pckbport"
 
 device	armfdt { }: bus_space_generic, fdt
 attach	armfdt at root with arm_fdt
 file	arch/arm/fdt/arm_fdt.c			arm_fdt
+file	arch/arm/fdt/arm_platform.c		arm_fdt
 
 attach	cpu at fdt with cpu_fdt
 file	arch/arm/fdt/cpu_fdt.c			cpu_fdt

Index: src/sys/arch/evbarm/conf/files.generic64
diff -u src/sys/arch/evbarm/conf/files.generic64:1.13 src/sys/arch/evbarm/conf/files.generic64:1.14
--- src/sys/arch/evbarm/conf/files.generic64:1.13	Sun Jan  5 17:16:07 2020
+++ src/sys/arch/evbarm/conf/files.generic64	Sun Jan  5 17:26:31 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic64,v 1.13 2020/01/05 17:16:07 jmcneill Exp $
+#	$NetBSD: files.generic64,v 1.14 2020/01/05 17:26:31 jmcneill Exp $
 #
 # A generic (aarch64) kernel configuration info
 #
@@ -8,8 +8,6 @@ include "arch/arm/cortex/files.cortex"
 
 include "arch/evbarm/conf/files.fdt"
 
-file	arch/arm/fdt/arm64_platform.c
-
 # Add other board files here
 #
 include "arch/arm/acpi/files.acpi"

Added files:

Index: src/sys/arch/arm/fdt/arm_platform.c
diff -u /dev/null src/sys/arch/arm/fdt/arm_platform.c:1.1
--- /dev/null	Sun Jan  5 17:26:31 2020
+++ src/sys/arch/arm/fdt/arm_platform.c	Sun Jan  5 17:26:31 2020
@@ -0,0 +1,122 @@
+/* $NetBSD: arm_platform.c,v 1.1 2020/01/05 17:26:31 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2020 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * This is the default Arm FDT platform implementation. It assumes the
+ * following:
+ *
+ *  - Generic timer
+ *  - PSCI support
+ *  - Console UART is pre-configured by firmware
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: arm_platform.c,v 1.1 2020/01/05 17:26:31 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+extern struct arm32_bus_dma_tag arm_generic_dma_tag;
+extern struct bus_space arm_generic_bs_tag;
+extern struct bus_space arm_generic_a4x_bs_tag;
+
+static void
+arm_platform_init_attach_args(struct fdt_attach_args *faa)
+{
+	faa->faa_bst = _generic_bs_tag;
+	faa->faa_a4x_bst = _generic_a4x_bs_tag;
+	faa->faa_dmat = _generic_dma_tag;
+}
+
+static void
+arm_platform_device_register(device_t self, void *aux)
+{
+}
+
+static const struct pmap_devmap *
+arm_platform_devmap(void)
+{
+	static const struct pmap_devmap devmap_empty[] = {
+		DEVMAP_ENTRY_END
+	};
+	static struct pmap_devmap devmap_uart[] = {
+		DEVMAP_ENTRY(KERNEL_IO_VBASE, 0, L3_SIZE),
+		DEVMAP_ENTRY_END
+	};
+	

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

2020-01-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan  5 17:20:01 UTC 2020

Modified Files:
src/sys/arch/arm/fdt: arm64_platform.c

Log Message:
Use arm_fdt_cpu_bootstrap


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/arm64_platform.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/fdt/arm64_platform.c
diff -u src/sys/arch/arm/fdt/arm64_platform.c:1.1 src/sys/arch/arm/fdt/arm64_platform.c:1.2
--- src/sys/arch/arm/fdt/arm64_platform.c:1.1	Sun Jan  5 17:16:07 2020
+++ src/sys/arch/arm/fdt/arm64_platform.c	Sun Jan  5 17:20:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: arm64_platform.c,v 1.1 2020/01/05 17:16:07 jmcneill Exp $ */
+/* $NetBSD: arm64_platform.c,v 1.2 2020/01/05 17:20:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_console.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm64_platform.c,v 1.1 2020/01/05 17:16:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm64_platform.c,v 1.2 2020/01/05 17:20:01 jmcneill Exp $");
 
 #include 
 #include 
@@ -73,11 +73,6 @@ arm64_platform_device_register(device_t 
 {
 }
 
-static void
-arm64_platform_bootstrap(void)
-{
-}
-
 static const struct pmap_devmap *
 arm64_platform_devmap(void)
 {
@@ -110,7 +105,7 @@ arm64_platform_uart_freq(void)
 
 static const struct arm_platform arm64_platform = {
 	.ap_devmap = arm64_platform_devmap,
-	.ap_bootstrap = arm64_platform_bootstrap,
+	.ap_bootstrap = arm_fdt_cpu_bootstrap,
 	.ap_init_attach_args = arm64_platform_init_attach_args,
 	.ap_device_register = arm64_platform_device_register,
 	.ap_reset = psci_fdt_reset,



CVS commit: src/sys/arch

2020-01-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan  5 17:16:07 UTC 2020

Modified Files:
src/sys/arch/arm/fdt: arm_fdt.c arm_fdtvar.h
src/sys/arch/evbarm/conf: files.generic64
Added Files:
src/sys/arch/arm/fdt: arm64_platform.c

Log Message:
Add a generic Arm64 platform definition that is used as a fallback.

The generic platform assumes PSCI, a generic timer, pre-initialized UART
clocks, and adds a 4KB entry to the devmap for the console UART device.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/arm64_platform.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/fdt/arm_fdt.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/fdt/arm_fdtvar.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/files.generic64

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/fdt/arm_fdt.c
diff -u src/sys/arch/arm/fdt/arm_fdt.c:1.9 src/sys/arch/arm/fdt/arm_fdt.c:1.10
--- src/sys/arch/arm/fdt/arm_fdt.c:1.9	Thu Jan  3 12:54:25 2019
+++ src/sys/arch/arm/fdt/arm_fdt.c	Sun Jan  5 17:16:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdt.c,v 1.9 2019/01/03 12:54:25 jmcneill Exp $ */
+/* $NetBSD: arm_fdt.c,v 1.10 2020/01/05 17:16:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_arm_timer.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.9 2019/01/03 12:54:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.10 2020/01/05 17:16:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -87,10 +87,10 @@ const struct arm_platform *
 arm_fdt_platform(void)
 {
 	static const struct arm_platform_info *booted_platform = NULL;
+	__link_set_decl(arm_platforms, struct arm_platform_info);
+	struct arm_platform_info * const *info;
 
 	if (booted_platform == NULL) {
-		__link_set_decl(arm_platforms, struct arm_platform_info);
-		struct arm_platform_info * const *info;
 		const struct arm_platform_info *best_info = NULL;
 		const int phandle = OF_peer(0);
 		int match, best_match = 0;
@@ -107,6 +107,19 @@ arm_fdt_platform(void)
 		booted_platform = best_info;
 	}
 
+	/*
+	 * No SoC specific platform was found. Try to find a generic
+	 * platform definition and use that if available.
+	 */
+	if (booted_platform == NULL) {
+		__link_set_foreach(info, arm_platforms) {
+			if (strcmp((*info)->api_compat, ARM_PLATFORM_DEFAULT) == 0) {
+booted_platform = *info;
+break;
+			}
+		}
+	}
+
 	return booted_platform == NULL ? NULL : booted_platform->api_ops;
 }
 

Index: src/sys/arch/arm/fdt/arm_fdtvar.h
diff -u src/sys/arch/arm/fdt/arm_fdtvar.h:1.15 src/sys/arch/arm/fdt/arm_fdtvar.h:1.16
--- src/sys/arch/arm/fdt/arm_fdtvar.h:1.15	Thu Jan 31 13:06:10 2019
+++ src/sys/arch/arm/fdt/arm_fdtvar.h	Sun Jan  5 17:16:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdtvar.h,v 1.15 2019/01/31 13:06:10 skrll Exp $ */
+/* $NetBSD: arm_fdtvar.h,v 1.16 2020/01/05 17:16:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -52,6 +52,8 @@ struct arm_platform_info {
 	const struct arm_platform *	api_ops;
 };
 
+#define ARM_PLATFORM_DEFAULT		""
+
 #define _ARM_PLATFORM_REGISTER(name)	\
 	__link_set_add_rodata(arm_platforms, __CONCAT(name,_platinfo));
 

Index: src/sys/arch/evbarm/conf/files.generic64
diff -u src/sys/arch/evbarm/conf/files.generic64:1.12 src/sys/arch/evbarm/conf/files.generic64:1.13
--- src/sys/arch/evbarm/conf/files.generic64:1.12	Sun Mar 17 08:17:56 2019
+++ src/sys/arch/evbarm/conf/files.generic64	Sun Jan  5 17:16:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic64,v 1.12 2019/03/17 08:17:56 skrll Exp $
+#	$NetBSD: files.generic64,v 1.13 2020/01/05 17:16:07 jmcneill Exp $
 #
 # A generic (aarch64) kernel configuration info
 #
@@ -8,6 +8,8 @@ include "arch/arm/cortex/files.cortex"
 
 include "arch/evbarm/conf/files.fdt"
 
+file	arch/arm/fdt/arm64_platform.c
+
 # Add other board files here
 #
 include "arch/arm/acpi/files.acpi"

Added files:

Index: src/sys/arch/arm/fdt/arm64_platform.c
diff -u /dev/null src/sys/arch/arm/fdt/arm64_platform.c:1.1
--- /dev/null	Sun Jan  5 17:16:07 2020
+++ src/sys/arch/arm/fdt/arm64_platform.c	Sun Jan  5 17:16:07 2020
@@ -0,0 +1,122 @@
+/* $NetBSD: arm64_platform.c,v 1.1 2020/01/05 17:16:07 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2020 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, 

CVS commit: src/distrib/utils/embedded/conf

2020-01-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  5 16:41:08 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
Use make_label_evbarm instead of home grown


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/utils/embedded/conf/rpi_inst.conf

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/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.13 src/distrib/utils/embedded/conf/rpi_inst.conf:1.14
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.13	Wed Jan  1 14:16:51 2020
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Jan  5 16:41:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.13 2020/01/01 14:16:51 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.14 2020/01/05 16:41:07 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -19,50 +19,7 @@ size=$(( 10485760 + ${swap} * 1024 * 512
 msdosid=12
 
 make_label() {
-	# compute all sizes in terms of sectors
-	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
-
-	local swapsize=$(( ${swap} * 1024 ))
-	local bootsize=$(( ${boot} * 1024 ))
-
-	local bootoffset=$(( ${init} * 1024 ))
-	local swapoffset=$(( ${bootoffset} + ${bootsize} ))
-
-	local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} ))
-	local aoffset=$(( ${swapoffset} + ${swapsize} ))
-
-	local bps=512
-	local spt=32
-	local tpc=64
-	local spc=2048
-	local cylinders=$(( ${totalsize} / ${spc} ))
-
-	cat << EOF
-type: SCSI
-disk: STORAGE DEVICE
-label: fictitious
-flags: removable
-bytes/sector: ${bps}
-sectors/track: ${spt}
-tracks/cylinder: ${tpc}
-sectors/cylinder: ${spc}
-cylinders: ${cylinders}
-total sectors: ${totalsize}
-rpm: 3600
-interleave: 1
-trackskew: 0
-cylinderskew: 0
-headswitch: 0   # microseconds
-track-to-track seek: 0  # microseconds
-drivedata: 0 
-
-8 partitions:
-# size offsetfstype [fsize bsize cpg/sgs]
- a:   ${asize} ${aoffset}4.2BSD  ${fsize} ${bsize} 0  # 
- b:   ${swapsize}  ${swapoffset} swap #
- d:   ${totalsize} 0 unused  0 0  #
- e:   ${bootsize}  ${bootoffset} MSDOS#
-EOF
+	make_label_evbarm
 }
 
 customize() {



CVS commit: src/sys

2020-01-05 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Sun Jan  5 15:57:15 UTC 2020

Modified Files:
src/sys/rump/librump/rumpkern: vm.c
src/sys/uvm: uvm_map.c uvm_map.h

Log Message:
remove unused predicate function

likely unused since kmem changes


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/rump/librump/rumpkern/vm.c
cvs rdiff -u -r1.369 -r1.370 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.75 -r1.76 src/sys/uvm/uvm_map.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.181 src/sys/rump/librump/rumpkern/vm.c:1.182
--- src/sys/rump/librump/rumpkern/vm.c:1.181	Thu Jan  2 16:56:58 2020
+++ src/sys/rump/librump/rumpkern/vm.c	Sun Jan  5 15:57:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.181 2020/01/02 16:56:58 ad Exp $	*/
+/*	$NetBSD: vm.c,v 1.182 2020/01/05 15:57:15 para Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.181 2020/01/02 16:56:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.182 2020/01/05 15:57:15 para Exp $");
 
 #include 
 #include 
@@ -684,16 +684,6 @@ uvm_estimatepageable(int *active, int *i
 	*inactive = 1024;
 }
 
-bool
-vm_map_starved_p(struct vm_map *map)
-{
-
-	if (map->flags & VM_MAP_WANTVA)
-		return true;
-
-	return false;
-}
-
 int
 uvm_loan(struct vm_map *map, vaddr_t start, vsize_t len, void *v, int flags)
 {

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.369 src/sys/uvm/uvm_map.c:1.370
--- src/sys/uvm/uvm_map.c:1.369	Tue Dec 31 22:42:51 2019
+++ src/sys/uvm/uvm_map.c	Sun Jan  5 15:57:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.369 2019/12/31 22:42:51 ad Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.370 2020/01/05 15:57:15 para Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.369 2019/12/31 22:42:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.370 2020/01/05 15:57:15 para Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4788,20 +4788,6 @@ uvm_map_reference(struct vm_map *map)
 	mutex_exit(>misc_lock);
 }
 
-bool
-vm_map_starved_p(struct vm_map *map)
-{
-
-	if ((map->flags & VM_MAP_WANTVA) != 0) {
-		return true;
-	}
-	/* XXX */
-	if ((vm_map_max(map) - vm_map_min(map)) / 16 * 15 < map->size) {
-		return true;
-	}
-	return false;
-}
-
 void
 uvm_map_lock_entry(struct vm_map_entry *entry)
 {

Index: src/sys/uvm/uvm_map.h
diff -u src/sys/uvm/uvm_map.h:1.75 src/sys/uvm/uvm_map.h:1.76
--- src/sys/uvm/uvm_map.h:1.75	Thu Aug  1 02:28:55 2019
+++ src/sys/uvm/uvm_map.h	Sun Jan  5 15:57:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.h,v 1.75 2019/08/01 02:28:55 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.h,v 1.76 2020/01/05 15:57:15 para Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -316,8 +316,6 @@ int		uvm_mapent_trymerge(struct vm_map *
 		struct vm_map_entry *, int);
 #define	UVM_MERGE_COPYING	1
 
-bool		vm_map_starved_p(struct vm_map *);
-
 /*
  * VM map locking operations.
  */



CVS commit: [netbsd-8] src/doc

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 15:12:40 UTC 2020

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

Log Message:
Annotate ticket #1480 for additional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.86 -r1.1.2.87 src/doc/CHANGES-8.2

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.86 src/doc/CHANGES-8.2:1.1.2.87
--- src/doc/CHANGES-8.2:1.1.2.86	Thu Jan  2 09:55:10 2020
+++ src/doc/CHANGES-8.2	Sun Jan  5 15:12:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.86 2020/01/02 09:55:10 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.87 2020/01/05 15:12:40 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1835,7 +1835,7 @@ xsrc/external/mit/xf86-video-wsfb/dist/s
 
 sys/dev/usb/ucycom.c1.49
 sys/dev/usb/uhid.c1.111
-sys/dev/usb/uthum.c1.18
+sys/dev/usb/uthum.c1.18 (adapted)
 
 	Fix buffer overflows. Add missing mutex_exit.
 	[maxv, ticket #1480]



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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 15:11:29 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-8]: uthum.c

Log Message:
use min() instead of uimin() - the latter does not exist on this branch.


To generate a diff of this commit:
cvs rdiff -u -r1.13.8.1 -r1.13.8.2 src/sys/dev/usb/uthum.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/uthum.c
diff -u src/sys/dev/usb/uthum.c:1.13.8.1 src/sys/dev/usb/uthum.c:1.13.8.2
--- src/sys/dev/usb/uthum.c:1.13.8.1	Thu Jan  2 09:43:56 2020
+++ src/sys/dev/usb/uthum.c	Sun Jan  5 15:11:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uthum.c,v 1.13.8.1 2020/01/02 09:43:56 martin Exp $   */
+/*	$NetBSD: uthum.c,v 1.13.8.2 2020/01/05 15:11:29 martin Exp $   */
 /*	$OpenBSD: uthum.c,v 1.6 2010/01/03 18:43:02 deraadt Exp $   */
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uthum.c,v 1.13.8.1 2020/01/02 09:43:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uthum.c,v 1.13.8.2 2020/01/05 15:11:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -267,7 +267,7 @@ uthum_read_data(struct uthum_softc *sc, 
 	if ((buf == NULL) || len == 0)
 		return 0;
 
-	olen = uimin(sc->sc_olen, sizeof(cmdbuf));
+	olen = min(sc->sc_olen, sizeof(cmdbuf));
 
 	/* issue query */
 	memset(cmdbuf, 0, sizeof(cmdbuf));
@@ -298,7 +298,7 @@ uthum_read_data(struct uthum_softc *sc, 
 		tsleep(>sc_sme, 0, "uthum", (need_delay*hz+999)/1000 + 1);
 
 	/* get answer */
-	flen = uimin(sc->sc_flen, sizeof(report));
+	flen = min(sc->sc_flen, sizeof(report));
 	if (uhidev_get_report(>sc_hdev, UHID_FEATURE_REPORT,
 	report, flen))
 		return EIO;



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

2020-01-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan  5 12:14:35 UTC 2020

Modified Files:
src/sys/arch/arm/rockchip: rk_vop.c

Log Message:
in rk_vop_dpms() set or unset the VOP_STANDBY_EN bit in VOP_SYS_CTRL
depending on the dpms mode requested.

this makes pinebook pro display actually turn off when dpms asks.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_vop.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/rockchip/rk_vop.c
diff -u src/sys/arch/arm/rockchip/rk_vop.c:1.5 src/sys/arch/arm/rockchip/rk_vop.c:1.6
--- src/sys/arch/arm/rockchip/rk_vop.c:1.5	Tue Dec 17 18:30:51 2019
+++ src/sys/arch/arm/rockchip/rk_vop.c	Sun Jan  5 12:14:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $ */
+/* $NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.5 2019/12/17 18:30:51 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.6 2020/01/05 12:14:35 mrg Exp $");
 
 #include 
 #include 
@@ -265,6 +265,27 @@ static const struct drm_crtc_funcs rk_vo
 static void
 rk_vop_dpms(struct drm_crtc *crtc, int mode)
 {
+	struct rk_vop_crtc *mixer_crtc = to_rk_vop_crtc(crtc);
+	struct rk_vop_softc * const sc = mixer_crtc->sc;
+	uint32_t val;
+
+	val = RD4(sc, VOP_SYS_CTRL);
+
+	switch (mode) {
+	case DRM_MODE_DPMS_ON:
+		val &= ~VOP_STANDBY_EN;
+		break;
+	case DRM_MODE_DPMS_STANDBY:
+	case DRM_MODE_DPMS_SUSPEND:
+	case DRM_MODE_DPMS_OFF:
+		val |= VOP_STANDBY_EN;
+		break;
+	}
+
+	WR4(sc, VOP_SYS_CTRL, val);
+
+	/* Commit settings */
+	WR4(sc, VOP_REG_CFG_DONE, REG_LOAD_EN);
 }
 
 static bool



CVS commit: [netbsd-9] src/doc

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 11:07:04 UTC 2020

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

Log Message:
Ticket #607


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.153 -r1.1.2.154 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.153 src/doc/CHANGES-9.0:1.1.2.154
--- src/doc/CHANGES-9.0:1.1.2.153	Sun Jan  5 09:56:59 2020
+++ src/doc/CHANGES-9.0	Sun Jan  5 11:07:04 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.153 2020/01/05 09:56:59 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.154 2020/01/05 11:07:04 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7617,3 +7617,10 @@ sys/netinet6/ip6_mroute.c			1.131
 	Don't forget to initialize 'sin6_len'.
 	[maxv, ticket #606]
 
+sys/external/bsd/drm2/dist/drm/drm_panel.c	1.3
+sys/external/bsd/drm2/drm/files.drmkms		1.33
+
+	Workaround netbsd incompatible LIST_HEAD.
+	Build drm_panel.c with drmkms.
+	[jmcneill, ticket #607]
+



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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 11:05:53 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm [netbsd-9]: drm_panel.c
src/sys/external/bsd/drm2/drm [netbsd-9]: files.drmkms

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #607):

sys/external/bsd/drm2/drm/files.drmkms: revision 1.33
sys/external/bsd/drm2/dist/drm/drm_panel.c: revision 1.3

workaround netbsd incompatible LIST_HEAD
adapted from drm_bridge.c r1.3

build drm_panel.c w/ drmkms


To generate a diff of this commit:
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 \
src/sys/external/bsd/drm2/dist/drm/drm_panel.c
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/external/bsd/drm2/drm/files.drmkms

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/dist/drm/drm_panel.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2.4.1 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2.4.2
--- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2.4.1	Sun Jan  5 09:42:05 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c	Sun Jan  5 11:05:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_panel.c,v 1.2.4.1 2020/01/05 09:42:05 martin Exp $	*/
+/*	$NetBSD: drm_panel.c,v 1.2.4.2 2020/01/05 11:05:53 martin Exp $	*/
 
 /*
  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2.4.1 2020/01/05 09:42:05 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2.4.2 2020/01/05 11:05:53 martin Exp $");
 
 #include 
 #include 
@@ -32,8 +32,13 @@ __KERNEL_RCSID(0, "$NetBSD: drm_panel.c,
 #include 
 #include 
 
+#ifdef __NetBSD__
+static struct mutex panel_lock;
+static struct list_head panel_list = LIST_HEAD_INIT(panel_list);
+#else
 static DEFINE_MUTEX(panel_lock);
 static LIST_HEAD(panel_list);
+#endif
 
 #ifdef __NetBSD__
 void drm_panel_init_lock(void)

Index: src/sys/external/bsd/drm2/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.30 src/sys/external/bsd/drm2/drm/files.drmkms:1.30.4.1
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.30	Tue Aug 28 03:41:39 2018
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Sun Jan  5 11:05:53 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.30 2018/08/28 03:41:39 riastradh Exp $
+#	$NetBSD: files.drmkms,v 1.30.4.1 2020/01/05 11:05:53 martin Exp $
 
 include "external/bsd/drm2/linux/files.drmkms_linux"
 
@@ -89,6 +89,7 @@ file	external/bsd/drm2/drm/drm_memory.c	
 file	external/bsd/drm2/dist/drm/drm_mm.c	drmkms
 file	external/bsd/drm2/dist/drm/drm_modes.c	drmkms
 file	external/bsd/drm2/dist/drm/drm_modeset_lock.c	drmkms
+file	external/bsd/drm2/dist/drm/drm_panel.c	drmkms
 #file	external/bsd/drm2/dist/drm/drm_pci.c	drmkms	# drmkms_pci
 file	external/bsd/drm2/dist/drm/drm_plane_helper.c	drmkms
 #file	external/bsd/drm2/dist/drm/drm_platform.c	drmkms



CVS commit: [netbsd-9] src/doc

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:56:59 UTC 2020

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

Log Message:
Tickets #600 - #606


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.152 -r1.1.2.153 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.152 src/doc/CHANGES-9.0:1.1.2.153
--- src/doc/CHANGES-9.0:1.1.2.152	Thu Jan  2 10:02:26 2020
+++ src/doc/CHANGES-9.0	Sun Jan  5 09:56:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.152 2020/01/02 10:02:26 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.153 2020/01/05 09:56:59 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7422,3 +7422,198 @@ sys/arch/arm/broadcom/bcm283x_platform.c
 	Fix early console output on the rpi0w.
 	[skrll, ticket #599]
 
+sys/dev/usb/umidi.c1.82
+
+	Fix locking mistake.
+	[maxv, ticket #600]
+
+sbin/dmesg/dmesg.c1.44,1.45
+
+	PR/54729: fix dmesg(8) to preserve leading whitespaces of kernel
+	messages.
+	[tsutsui, ticket #601]
+
+external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.4
+external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.36
+external/bsd/dhcpcd/dist/src/dhcp.c up to 1.31
+external/bsd/dhcpcd/dist/src/dhcp.h up to 1.1.1.14
+external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.15
+external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c  up to 1.1.1.3
+external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.31
+external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.16
+external/bsd/dhcpcd/dist/src/if-options.c   up to 1.20
+external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.20
+external/bsd/dhcpcd/dist/src/ipv6.c up to 1.7
+external/bsd/dhcpcd/dist/src/ipv6.h up to 1.7
+external/bsd/dhcpcd/dist/src/ipv6nd.c   up to 1.15
+doc/3RDPARTY	(manually edited)
+
+	Import dhcpcd 8.1.5.
+	[roy, ticket #602]
+
+sys/external/bsd/drm2/dist/drm/drm_bridge.c	1.4
+sys/external/bsd/drm2/dist/drm/drm_panel.c	1.4
+sys/external/bsd/drm2/dist/include/drm/drm_crtc.h 1.8
+sys/external/bsd/drm2/dist/include/drm/drm_panel.h 1.3
+sys/external/bsd/drm2/drm/drm_module.c		1.17
+
+	Initialize drm_bridge and drm_panel locks.
+	[jmcneill, ticket #603]
+
+external/bsd/unbound/dist/ipset/ipset.c up to 1.1.1.1
+external/bsd/unbound/dist/ipset/ipset.h up to 1.1.1.1
+external/bsd/unbound/dist/compat/getentropy_freebsd.c up to 1.1.1.1
+external/bsd/unbound/dist/contrib/drop-tld.diff up to 1.1.1.1
+external/bsd/unbound/dist/contrib/unbound-fuzzers.tar.bz2 up to 1.1.1.1
+external/bsd/unbound/dist/doc/README.ipset.md   up to 1.1.1.1
+external/bsd/unbound/dist/pythonmod/examples/avahi-resolver.py up to 1.1.1.1
+external/bsd/unbound/dist/testdata/auth_nsec3_ent.rpl up to 1.1.1.1
+external/bsd/unbound/dist/testdata/fwd_minimal.rpl up to 1.1.1.1
+external/bsd/unbound/dist/.travis.yml   up to 1.1.1.1
+external/bsd/unbound/dist/README.md up to 1.1.1.1
+external/bsd/unbound/dist/.gitattributesdelete
+external/bsd/unbound/dist/.gitignoredelete
+external/bsd/unbound/dist/Makefile.in   up to 1.1.1.5
+external/bsd/unbound/dist/aclocal.m4up to 1.1.1.4
+external/bsd/unbound/dist/config.guess  up to 1.4
+external/bsd/unbound/dist/config.h.in   up to 1.1.1.5
+external/bsd/unbound/dist/config.subup to 1.4
+external/bsd/unbound/dist/configure up to 1.1.1.5
+external/bsd/unbound/dist/configure.ac  up to 1.1.1.5
+external/bsd/unbound/dist/install-shup to 1.1.1.3
+external/bsd/unbound/dist/cachedb/cachedb.c up to 1.1.1.5
+external/bsd/unbound/dist/compat/getentropy_linux.c up to 1.1.1.3
+external/bsd/unbound/dist/compat/getentropy_osx.c up to 1.1.1.2
+external/bsd/unbound/dist/compat/getentropy_solaris.c up to 1.1.1.2
+external/bsd/unbound/dist/compat/getentropy_win.c up to 1.1.1.2
+external/bsd/unbound/dist/compat/malloc.c   up to 1.1.1.2
+external/bsd/unbound/dist/compat/sha512.c   up to 1.1.1.3
+external/bsd/unbound/dist/compat/snprintf.c up to 1.1.1.2
+external/bsd/unbound/dist/contrib/READMEup to 1.1.1.5
+external/bsd/unbound/dist/contrib/create_unbound_ad_servers.sh up to 1.1.1.2
+external/bsd/unbound/dist/contrib/fastrpz.patch up to 1.1.1.4
+external/bsd/unbound/dist/contrib/unbound.init  up to 1.1.1.3
+external/bsd/unbound/dist/contrib/unbound.init_fedora up to 1.1.1.2
+external/bsd/unbound/dist/contrib/unbound.service.in up to 1.1.1.3
+external/bsd/unbound/dist/daemon/daemon.c   up to 1.1.1.5
+external/bsd/unbound/dist/daemon/remote.c   up to 1.1.1.5
+external/bsd/unbound/dist/daemon/stats.cup to 1.1.1.5
+external/bsd/unbound/dist/daemon/unbound.c  up to 1.1.1.5
+external/bsd/unbound/dist/daemon/worker.c   up to 

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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:54:52 UTC 2020

Modified Files:
src/sys/netinet6 [netbsd-9]: ip6_mroute.c

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

sys/netinet6/ip6_mroute.c: revision 1.131

Don't forget to initialize 'sin6_len'. With kASan, from time to time the
value will be bigger than the size of the source, and we get a read
overflow. With kMSan the uninitialized access is detected immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.130.2.1 src/sys/netinet6/ip6_mroute.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/netinet6/ip6_mroute.c
diff -u src/sys/netinet6/ip6_mroute.c:1.130 src/sys/netinet6/ip6_mroute.c:1.130.2.1
--- src/sys/netinet6/ip6_mroute.c:1.130	Wed Jul 24 02:38:29 2019
+++ src/sys/netinet6/ip6_mroute.c	Sun Jan  5 09:54:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_mroute.c,v 1.130 2019/07/24 02:38:29 msaitoh Exp $	*/
+/*	$NetBSD: ip6_mroute.c,v 1.130.2.1 2020/01/05 09:54:52 martin Exp $	*/
 /*	$KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $	*/
 
 /*
@@ -117,7 +117,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.130 2019/07/24 02:38:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.130.2.1 2020/01/05 09:54:52 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -540,9 +540,8 @@ ip6_mrouter_done(void)
 		for (mifi = 0; mifi < nummifs; mifi++) {
 			if (mif6table[mifi].m6_ifp &&
 			!(mif6table[mifi].m6_flags & MIFF_REGISTER)) {
-sin6.sin6_family = AF_INET6;
-sin6.sin6_addr = in6addr_any;
 ifp = mif6table[mifi].m6_ifp;
+sockaddr_in6_init(, _any, 0, 0, 0);
 if_mcast_op(ifp, SIOCDELMULTI,
 sin6tocsa());
 			}
@@ -674,8 +673,7 @@ add_m6if(struct mif6ctl *mifcp)
 		 * Enable promiscuous reception of all IPv6 multicasts
 		 * from the interface.
 		 */
-		sin6.sin6_family = AF_INET6;
-		sin6.sin6_addr = in6addr_any;
+		sockaddr_in6_init(, _any, 0, 0, 0);
 		error = if_mcast_op(ifp, SIOCADDMULTI, sin6tosa());
 		splx(s);
 		if (error)
@@ -732,8 +730,7 @@ del_m6if(mifi_t *mifip)
 		 */
 		ifp = mifp->m6_ifp;
 
-		sin6.sin6_family = AF_INET6;
-		sin6.sin6_addr = in6addr_any;
+		sockaddr_in6_init(, _any, 0, 0, 0);
 		if_mcast_op(ifp, SIOCDELMULTI, sin6tosa());
 	} else {
 		if (reg_mif_num != (mifi_t)-1) {



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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:53:18 UTC 2020

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

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

sys/dev/hid/hid.c: revision 1.4

Fix small read overflows when parsing HID tables. Noticed by kASan the
other day while I was playing with vHCI.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/dev/hid/hid.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/hid/hid.c
diff -u src/sys/dev/hid/hid.c:1.3 src/sys/dev/hid/hid.c:1.3.4.1
--- src/sys/dev/hid/hid.c:1.3	Thu Nov 15 23:01:45 2018
+++ src/sys/dev/hid/hid.c	Sun Jan  5 09:53:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.c,v 1.3 2018/11/15 23:01:45 jakllsch Exp $	*/
+/*	$NetBSD: hid.c,v 1.3.4.1 2020/01/05 09:53:18 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.3 2018/11/15 23:01:45 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.3.4.1 2020/01/05 09:53:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -149,27 +149,33 @@ hid_get_item(struct hid_data *s, struct 
 	}
 	for (;;) {
 		p = s->p;
-		if (p >= s->end)
-			return 0;
 
+		if (p + 1 > s->end)
+			return 0;
 		bSize = *p++;
+
 		if (bSize == 0xfe) {
 			/* long item */
+			if (p + 3 > s->end)
+return 0;
 			bSize = *p++;
 			bSize |= *p++ << 8;
 			bTag = *p++;
-			data = p;
-			p += bSize;
 			bType = 0xff; /* XXX what should it be */
 		} else {
 			/* short item */
 			bTag = bSize >> 4;
 			bType = (bSize >> 2) & 3;
 			bSize &= 3;
-			if (bSize == 3) bSize = 4;
-			data = p;
-			p += bSize;
+			if (bSize == 3)
+bSize = 4;
 		}
+
+		data = p;
+		if (p + bSize > s->end)
+			return 0;
+		p += bSize;
+
 		s->p = p;
 		switch(bSize) {
 		case 0:



CVS commit: [netbsd-9] src

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:51:50 UTC 2020

Modified Files:
src/doc [netbsd-9]: 3RDPARTY
src/external/bsd/unbound/dist [netbsd-9]: Makefile.in aclocal.m4
config.guess config.h.in config.sub configure configure.ac
install-sh
src/external/bsd/unbound/dist/cachedb [netbsd-9]: cachedb.c
src/external/bsd/unbound/dist/compat [netbsd-9]: getentropy_linux.c
getentropy_osx.c getentropy_solaris.c getentropy_win.c malloc.c
sha512.c snprintf.c
src/external/bsd/unbound/dist/contrib [netbsd-9]: README
create_unbound_ad_servers.sh fastrpz.patch unbound.init
unbound.init_fedora unbound.service.in
src/external/bsd/unbound/dist/daemon [netbsd-9]: daemon.c remote.c
stats.c unbound.c worker.c
src/external/bsd/unbound/dist/dns64 [netbsd-9]: dns64.c
src/external/bsd/unbound/dist/dnscrypt [netbsd-9]: dnscrypt.c
src/external/bsd/unbound/dist/doc [netbsd-9]: Changelog README TODO
example.conf.in libunbound.3.in unbound-anchor.8.in
unbound-checkconf.8.in unbound-control.8.in unbound-host.1.in
unbound.8.in unbound.conf.5.in unbound.doxygen
src/external/bsd/unbound/dist/edns-subnet [netbsd-9]: subnetmod.c
src/external/bsd/unbound/dist/ipsecmod [netbsd-9]: ipsecmod.c
src/external/bsd/unbound/dist/iterator [netbsd-9]: iter_scrub.c
iter_utils.c iter_utils.h iterator.c
src/external/bsd/unbound/dist/libunbound [netbsd-9]: context.c
context.h libunbound.c libworker.c
src/external/bsd/unbound/dist/libunbound/python [netbsd-9]:
libunbound.i
src/external/bsd/unbound/dist/pythonmod [netbsd-9]: interface.i
pythonmod.c
src/external/bsd/unbound/dist/pythonmod/doc/examples [netbsd-9]:
example0-1.py example0.rst
src/external/bsd/unbound/dist/pythonmod/examples [netbsd-9]: calc.py
edns.py inplace_callbacks.py
src/external/bsd/unbound/dist/respip [netbsd-9]: respip.c
src/external/bsd/unbound/dist/services [netbsd-9]: authzone.c
authzone.h listen_dnsport.c localzone.c mesh.c modstack.c
outside_network.c outside_network.h
src/external/bsd/unbound/dist/services/cache [netbsd-9]: dns.c
src/external/bsd/unbound/dist/sldns [netbsd-9]: parse.c rrdef.c
sbuffer.c sbuffer.h str2wire.c wire2str.c wire2str.h
src/external/bsd/unbound/dist/smallapp [netbsd-9]: unbound-anchor.c
unbound-checkconf.c unbound-control.c unbound-host.c
src/external/bsd/unbound/dist/testcode [netbsd-9]: asynclook.c
delayer.c fake_event.c memstats.c mini_tdir.sh perf.c petal.c
streamtcp.c testbound.c testpkts.c unitmain.c unitmsgparse.c
unitregional.c
src/external/bsd/unbound/dist/testdata [netbsd-9]: auth_nsec3_wild.rpl
src/external/bsd/unbound/dist/util [netbsd-9]: alloc.c config_file.c
config_file.h configlexer.c configlexer.lex configparser.c
configparser.h configparser.y fptr_wlist.c iana_ports.inc log.c
mini_event.c net_help.c net_help.h netevent.c random.c random.h
regional.c ub_event.c ub_event_pluggable.c winsock_event.c
src/external/bsd/unbound/dist/util/data [netbsd-9]: dname.c msgencode.c
msgencode.h msgparse.c msgreply.c msgreply.h
src/external/bsd/unbound/dist/util/shm_side [netbsd-9]: shm_main.c
src/external/bsd/unbound/dist/util/storage [netbsd-9]: lookup3.c
src/external/bsd/unbound/dist/validator [netbsd-9]: autotrust.c
val_anchor.c val_secalgo.c val_sigcrypt.c validator.c
src/external/bsd/unbound/include [netbsd-9]: config.h
Added Files:
src/external/bsd/unbound/dist [netbsd-9]: .travis.yml README.md
src/external/bsd/unbound/dist/compat [netbsd-9]: getentropy_freebsd.c
src/external/bsd/unbound/dist/contrib [netbsd-9]: drop-tld.diff
unbound-fuzzers.tar.bz2
src/external/bsd/unbound/dist/doc [netbsd-9]: README.ipset.md
src/external/bsd/unbound/dist/ipset [netbsd-9]: ipset.c ipset.h
src/external/bsd/unbound/dist/pythonmod/examples [netbsd-9]:
avahi-resolver.py
src/external/bsd/unbound/dist/testdata [netbsd-9]: auth_nsec3_ent.rpl
fwd_minimal.rpl
Removed Files:
src/external/bsd/unbound/dist [netbsd-9]: .gitattributes .gitignore

Log Message:
Pull up the following, requested by christos in ticket #604:

external/bsd/unbound/dist/ipset/ipset.c up to 1.1.1.1
external/bsd/unbound/dist/ipset/ipset.h up to 1.1.1.1
external/bsd/unbound/dist/compat/getentropy_freebsd.c up to 1.1.1.1
external/bsd/unbound/dist/contrib/drop-tld.diff up to 1.1.1.1
external/bsd/unbound/dist/contrib/unbound-fuzzers.tar.bz2 up to 

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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:42:06 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm [netbsd-9]: drm_bridge.c drm_panel.c
src/sys/external/bsd/drm2/dist/include/drm [netbsd-9]: drm_crtc.h
drm_panel.h
src/sys/external/bsd/drm2/drm [netbsd-9]: drm_module.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #603):

sys/external/bsd/drm2/dist/drm/drm_bridge.c: revision 1.4
sys/external/bsd/drm2/drm/drm_module.c: revision 1.17
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: revision 1.8
sys/external/bsd/drm2/dist/drm/drm_panel.c: revision 1.4
sys/external/bsd/drm2/dist/include/drm/drm_panel.h: revision 1.3

Initialize drm_bridge and drm_panel locks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.8.1 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/external/bsd/drm2/dist/drm/drm_panel.c
cvs rdiff -u -r1.7 -r1.7.4.1 \
src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
cvs rdiff -u -r1.2 -r1.2.4.1 \
src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h
cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/external/bsd/drm2/drm/drm_module.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/dist/drm/drm_bridge.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3.8.1
--- src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3	Mon Aug 27 06:43:47 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_bridge.c	Sun Jan  5 09:42:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $	*/
+/*	$NetBSD: drm_bridge.c,v 1.3.8.1 2020/01/05 09:42:05 martin Exp $	*/
 
 /*
  * Copyright (c) 2014 Samsung Electronics Co., Ltd
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.3.8.1 2020/01/05 09:42:05 martin Exp $");
 
 #include 
 #include 
@@ -66,6 +66,17 @@ static DEFINE_MUTEX(bridge_lock);
 static LIST_HEAD(bridge_list);
 #endif
 
+#ifdef __NetBSD__
+void drm_bridge_init_lock(void)
+{
+	linux_mutex_init(_lock);
+}
+void drm_bridge_fini_lock(void)
+{
+	linux_mutex_destroy(_lock);
+}
+#endif
+
 /**
  * drm_bridge_add - add the given bridge to the global bridge list
  *

Index: src/sys/external/bsd/drm2/dist/drm/drm_panel.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2.4.1
--- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2	Mon Aug 27 04:58:19 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c	Sun Jan  5 09:42:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $	*/
+/*	$NetBSD: drm_panel.c,v 1.2.4.1 2020/01/05 09:42:05 martin Exp $	*/
 
 /*
  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2.4.1 2020/01/05 09:42:05 martin Exp $");
 
 #include 
 #include 
@@ -35,6 +35,17 @@ __KERNEL_RCSID(0, "$NetBSD: drm_panel.c,
 static DEFINE_MUTEX(panel_lock);
 static LIST_HEAD(panel_list);
 
+#ifdef __NetBSD__
+void drm_panel_init_lock(void)
+{
+	linux_mutex_init(_lock);
+}
+void drm_panel_fini_lock(void)
+{
+	linux_mutex_destroy(_lock);
+}
+#endif
+
 void drm_panel_init(struct drm_panel *panel)
 {
 	INIT_LIST_HEAD(>list);

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7 src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7.4.1
--- src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7	Mon Aug 27 06:46:02 2018
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h	Sun Jan  5 09:42:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_crtc.h,v 1.7 2018/08/27 06:46:02 riastradh Exp $	*/
+/*	$NetBSD: drm_crtc.h,v 1.7.4.1 2020/01/05 09:42:05 martin Exp $	*/
 
 /*
  * Copyright © 2006 Keith Packard
@@ -1224,6 +1224,11 @@ extern unsigned int drm_connector_index(
 /* helper to unplug all connectors from sysfs for device */
 extern void drm_connector_unplug_all(struct drm_device *dev);
 
+#ifdef __NetBSD__
+extern void drm_bridge_init_lock(void);
+extern void drm_bridge_fini_lock(void);
+#endif
+
 extern int drm_bridge_add(struct drm_bridge *bridge);
 extern void drm_bridge_remove(struct drm_bridge *bridge);
 extern struct drm_bridge *of_drm_find_bridge(struct device_node *np);

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2.4.1
--- src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2	Mon Aug 27 04:58:38 2018
+++ 

CVS commit: [netbsd-9] src

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:38:29 UTC 2020

Modified Files:
src/doc [netbsd-9]: 3RDPARTY
src/external/bsd/dhcpcd/dist/hooks [netbsd-9]: dhcpcd-run-hooks.in
src/external/bsd/dhcpcd/dist/src [netbsd-9]: defs.h dhcp.c dhcp.h
dhcp6.c dhcpcd-embedded.c dhcpcd.c dhcpcd.conf.5.in if-options.c
ipv4.c ipv6.c ipv6.h ipv6nd.c

Log Message:
Pull up the following, requested by roy in ticket #602:

external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in up to 1.4
external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.36
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.31
external/bsd/dhcpcd/dist/src/dhcp.h up to 1.1.1.14
external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.15
external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c  up to 1.1.1.3
external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.31
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.16
external/bsd/dhcpcd/dist/src/if-options.c   up to 1.20
external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.20
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.7
external/bsd/dhcpcd/dist/src/ipv6.h up to 1.7
external/bsd/dhcpcd/dist/src/ipv6nd.c   up to 1.15
doc/3RDPARTY(manually updated)

Import dhcpcd 8.1.5, which fixes:

 * IPv6ND: Fix reachable test
 * DHCP6: Work better with infinite addresses
 * DHCP6: Suboption 3 of NTP Server is a FQDN
 * DHCP6: Fix deprecating a delegated prefix
 * DHCP: Ensure we have a lease to extract options from

 * options: Fix allocating the script option

 * inet: Allow forcing a host route from an interface without a lease
 * dhcpcd: Don't wait for an address family to complete if not using it


To generate a diff of this commit:
cvs rdiff -u -r1.1640.2.8 -r1.1640.2.9 src/doc/3RDPARTY
cvs rdiff -u -r1.3 -r1.3.2.1 \
src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
cvs rdiff -u -r1.1.1.25.2.4 -r1.1.1.25.2.5 \
src/external/bsd/dhcpcd/dist/src/defs.h
cvs rdiff -u -r1.23.2.4 -r1.23.2.5 src/external/bsd/dhcpcd/dist/src/dhcp.c \
src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.1.1.10.2.1 -r1.1.1.10.2.2 \
src/external/bsd/dhcpcd/dist/src/dhcp.h
cvs rdiff -u -r1.11.2.3 -r1.11.2.4 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.1.1.2.2.2 -r1.1.1.2.2.3 \
src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
cvs rdiff -u -r1.1.1.13.2.2 -r1.1.1.13.2.3 \
src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
cvs rdiff -u -r1.16.2.2 -r1.16.2.3 \
src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.1.1.16.2.3 -r1.1.1.16.2.4 \
src/external/bsd/dhcpcd/dist/src/ipv4.c
cvs rdiff -u -r1.3.2.3 -r1.3.2.4 src/external/bsd/dhcpcd/dist/src/ipv6.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/external/bsd/dhcpcd/dist/src/ipv6.h
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/external/bsd/dhcpcd/dist/src/ipv6nd.c

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1640.2.8 src/doc/3RDPARTY:1.1640.2.9
--- src/doc/3RDPARTY:1.1640.2.8	Sun Nov 24 08:30:27 2019
+++ src/doc/3RDPARTY	Sun Jan  5 09:38:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1640.2.8 2019/11/24 08:30:27 martin Exp $
+#	$NetBSD: 3RDPARTY,v 1.1640.2.9 2020/01/05 09:38:28 martin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -341,12 +341,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.2
-Current Vers:	8.1.2
+Version:	8.1.5
+Current Vers:	8.1.5
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-11-13
+Date:		2020-01-03
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
diff -u src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in:1.3 src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in:1.3.2.1
--- src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in:1.3	Thu Feb  7 21:37:36 2019
+++ src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in	Sun Jan  5 09:38:28 2020
@@ -212,7 +212,7 @@ valid_domainname_list()
 
 # With the advent of alternative init systems, it's possible to have
 # more than one installed. So we need to try and guess what one we're
-# using unless overriden by configure.
+# using unless overridden by configure.
 detect_init()
 {
 	_service_exists="@SERVICEEXISTS@"

Index: src/external/bsd/dhcpcd/dist/src/defs.h
diff -u src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.4 src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.5
--- src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.4	Fri Nov 22 08:01:49 2019
+++ 

CVS commit: [netbsd-9] src/sbin/dmesg

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:32:10 UTC 2020

Modified Files:
src/sbin/dmesg [netbsd-9]: dmesg.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #601):

sbin/dmesg/dmesg.c: revision 1.44
sbin/dmesg/dmesg.c: revision 1.45

Fix dmesg(8) to preserve leading whitespaces of kernel messages.
Closes PR/54729.

Make recent change build for SMALL builds as well as normal ones.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.2.1 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.43 src/sbin/dmesg/dmesg.c:1.43.2.1
--- src/sbin/dmesg/dmesg.c:1.43	Tue Jun  4 11:59:05 2019
+++ src/sbin/dmesg/dmesg.c	Sun Jan  5 09:32:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.43 2019/06/04 11:59:05 kre Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.43.2.1 2020/01/05 09:32:10 martin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.43 2019/06/04 11:59:05 kre Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.43.2.1 2020/01/05 09:32:10 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -157,7 +157,7 @@ main(int argc, char *argv[])
 	long nsec, fsec;
 	int scale;
 	int deltas, quiet, humantime;
-	bool frac;
+	bool frac, postts;
 
 	static const int bmib[] = { CTL_KERN, KERN_BOOTTIME };
 	size = sizeof(boottime);
@@ -262,6 +262,7 @@ main(int argc, char *argv[])
 	 */
 #ifndef SMALL
 	frac = false;
+	postts = false;
 	scale = 0;
 #endif
 	for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
@@ -310,6 +311,7 @@ main(int argc, char *argv[])
 ADDC(ch);
 ADDC('\0');
 tstamp = 0;
+postts = true;
 sec = fsec = 0;
 switch (sscanf(tbuf, "[%jd.%ld]", , )){
 case EOF:
@@ -375,8 +377,14 @@ main(int argc, char *argv[])
 continue;
 #endif
 			case ' ':
-if (!tstamp)
+#ifndef SMALL
+if (!tstamp && postts) {
+	postts = false;
+#else
+if (!tstamp) {
+#endif
 	continue;
+}
 /*FALLTHROUGH*/
 			default:
 #ifndef SMALL



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

2020-01-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  5 09:30:04 UTC 2020

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

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

sys/dev/usb/umidi.c: revision 1.82

Remove the call to KERNEL_UNLOCK_ONE(), it was forgotten when the biglock
was dropped in rev1.63. Found via vHCI.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.78.2.1 src/sys/dev/usb/umidi.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/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.78 src/sys/dev/usb/umidi.c:1.78.2.1
--- src/sys/dev/usb/umidi.c:1.78	Wed May  8 13:40:19 2019
+++ src/sys/dev/usb/umidi.c	Sun Jan  5 09:30:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.78 2019/05/08 13:40:19 isaki Exp $	*/
+/*	$NetBSD: umidi.c,v 1.78.2.1 2020/01/05 09:30:04 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2012, 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.78 2019/05/08 13:40:19 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.78.2.1 2020/01/05 09:30:04 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -414,7 +414,6 @@ out_free_endpoints:
 out:
 	aprint_error_dev(self, "disabled.\n");
 	sc->sc_dying = 1;
-	KERNEL_UNLOCK_ONE(curlwp);
 	return;
 }
 



CVS commit: src/sys/dev/dm

2020-01-05 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Jan  5 08:11:10 UTC 2020

Modified Files:
src/sys/dev/dm: dm_target_flakey.c

Log Message:
dm: Add "Copyright (c) 2015 The DragonFly Project." to dm-flakey

which I missed in my initial dm-flakey commit.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/dm/dm_target_flakey.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/dm/dm_target_flakey.c
diff -u src/sys/dev/dm/dm_target_flakey.c:1.1 src/sys/dev/dm/dm_target_flakey.c:1.2
--- src/sys/dev/dm/dm_target_flakey.c:1.1	Thu Jan  2 06:22:23 2020
+++ src/sys/dev/dm/dm_target_flakey.c	Sun Jan  5 08:11:10 2020
@@ -1,7 +1,8 @@
-/*$NetBSD: dm_target_flakey.c,v 1.1 2020/01/02 06:22:23 tkusumi Exp $  */
+/*$NetBSD: dm_target_flakey.c,v 1.2 2020/01/05 08:11:10 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * Copyright (c) 2015 The DragonFly Project.  All rights reserved.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -29,7 +30,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target_flakey.c,v 1.1 2020/01/02 06:22:23 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_flakey.c,v 1.2 2020/01/05 08:11:10 tkusumi Exp $");
 
 #include 
 #include 



CVS commit: src/sys/dev/dm

2020-01-05 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sun Jan  5 08:08:26 UTC 2020

Modified Files:
src/sys/dev/dm: dm.h dm_target.c
Added Files:
src/sys/dev/dm: dm_target_delay.c

Log Message:
dm: Add dm-delay target

Ported from DragonFlyBSD, but this target had originally existed in
Linux kernel. See below for details.
https://www.kernel.org/doc/Documentation/device-mapper/delay.txt

Due to "tick" in hz(9) not working (which results in dmdlthread spinning
forever in _submit_queue() without dp extracted from delayed list
and queued into submit list), this hasn't been hooked to dm.kmod yet.

taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/dm/dm.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/dm/dm_target.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/dm/dm_target_delay.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/dm/dm.h
diff -u src/sys/dev/dm/dm.h:1.53 src/sys/dev/dm/dm.h:1.54
--- src/sys/dev/dm/dm.h:1.53	Thu Jan  2 06:22:23 2020
+++ src/sys/dev/dm/dm.h	Sun Jan  5 08:08:26 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: dm.h,v 1.53 2020/01/02 06:22:23 tkusumi Exp $  */
+/*$NetBSD: dm.h,v 1.54 2020/01/05 08:08:26 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -273,6 +273,18 @@ int dm_target_zero_destroy(dm_table_entr
 int dm_target_zero_upcall(dm_table_entry_t *, struct buf *);
 
 #if 0
+/* dm_target_delay.c */
+void dm_target_delay_pool_create(void);
+void dm_target_delay_pool_destroy(void);
+int dm_target_delay_init(dm_table_entry_t *, int, char **);
+char *dm_target_delay_info(void *);
+char *dm_target_delay_table(void *);
+int dm_target_delay_strategy(dm_table_entry_t *, struct buf *);
+int dm_target_delay_sync(dm_table_entry_t *);
+int dm_target_delay_destroy(dm_table_entry_t *);
+int dm_target_delay_upcall(dm_table_entry_t *, struct buf *);
+int dm_target_delay_secsize(dm_table_entry_t *, unsigned int *);
+
 /* dm_target_flakey.c */
 int dm_target_flakey_init(dm_table_entry_t *, int, char **);
 char *dm_target_flakey_table(void *);

Index: src/sys/dev/dm/dm_target.c
diff -u src/sys/dev/dm/dm_target.c:1.38 src/sys/dev/dm/dm_target.c:1.39
--- src/sys/dev/dm/dm_target.c:1.38	Thu Jan  2 06:22:23 2020
+++ src/sys/dev/dm/dm_target.c	Sun Jan  5 08:08:26 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target.c,v 1.38 2020/01/02 06:22:23 tkusumi Exp $  */
+/*$NetBSD: dm_target.c,v 1.39 2020/01/05 08:08:26 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.38 2020/01/02 06:22:23 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.39 2020/01/05 08:08:26 tkusumi Exp $");
 
 #include 
 #include 
@@ -238,7 +238,10 @@ dm_target_destroy(void)
 	mutex_exit(_target_mutex);
 
 	mutex_destroy(_target_mutex);
-
+#if 0
+	/* Target specific module destroy routine. */
+	dm_target_delay_pool_destroy();
+#endif
 	return 0;
 }
 
@@ -359,6 +362,22 @@ dm_target_init(void)
 	if (dm_target_insert(dmt))
 		printf("Failed to insert zero\n");
 #if 0
+	dmt = dm_target_alloc("delay");
+	dmt->version[0] = 1;
+	dmt->version[1] = 0;
+	dmt->version[2] = 0;
+	dmt->init = _target_delay_init;
+	dmt->info = _target_delay_info;
+	dmt->table = _target_delay_table;
+	dmt->strategy = _target_delay_strategy;
+	dmt->sync = _target_delay_sync;
+	dmt->destroy = _target_delay_destroy;
+	dmt->upcall = _target_delay_upcall;
+	dmt->secsize = _target_delay_secsize;
+	if (dm_target_insert(dmt))
+		printf("Failed to insert delay\n");
+	dm_target_delay_pool_create();
+
 	dmt = dm_target_alloc("flakey");
 	dmt->version[0] = 1;
 	dmt->version[1] = 0;

Added files:

Index: src/sys/dev/dm/dm_target_delay.c
diff -u /dev/null src/sys/dev/dm/dm_target_delay.c:1.1
--- /dev/null	Sun Jan  5 08:08:26 2020
+++ src/sys/dev/dm/dm_target_delay.c	Sun Jan  5 08:08:26 2020
@@ -0,0 +1,513 @@
+/*$NetBSD: dm_target_delay.c,v 1.1 2020/01/05 08:08:26 tkusumi Exp $  */
+
+/*
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * Copyright (c) 2015 The DragonFly Project.  All rights reserved.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Tomohiro Kusumi .
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ *