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

2018-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Dec 17 07:10:07 UTC 2018

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

Log Message:
Remove dead checks, they were already pointless when I fixed them a few
years ago, and now they are wrong because the PTE space is randomized.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 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.314 src/sys/arch/x86/x86/pmap.c:1.315
--- src/sys/arch/x86/x86/pmap.c:1.314	Mon Dec 17 06:58:54 2018
+++ src/sys/arch/x86/x86/pmap.c	Mon Dec 17 07:10:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.314 2018/12/17 06:58:54 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.315 2018/12/17 07:10:07 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.314 2018/12/17 06:58:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.315 2018/12/17 07:10:07 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -3484,7 +3484,6 @@ pmap_remove(struct pmap *pmap, vaddr_t s
 	pd_entry_t * const *pdes;
 	struct pv_entry *pv_tofree = NULL;
 	bool result;
-	int i;
 	paddr_t ptppa;
 	vaddr_t blkendva, va = sva;
 	struct vm_page *ptp;
@@ -3537,20 +3536,6 @@ pmap_remove(struct pmap *pmap, vaddr_t s
 		if (blkendva > eva)
 			blkendva = eva;
 
-		/*
-		 * Our PTE mappings should never be removed with pmap_remove.
-		 *
-		 * XXXmaxv: still needed?
-		 *
-		 * A long term solution is to move the PTEs out of user address
-		 * space, and into kernel address space. Then we can set
-		 * VM_MAXUSER_ADDRESS to be VM_MAX_ADDRESS.
-		 */
-		for (i = 0; i < PDP_SIZE; i++) {
-			if (pl_i(va, PTP_LEVELS) == PDIR_SLOT_PTE+i)
-panic("PTE space accessed");
-		}
-
 		lvl = pmap_pdes_invalid(va, pdes, &pde);
 		if (lvl != 0) {
 			/* Skip a range corresponding to an invalid pde. */
@@ -3983,26 +3968,11 @@ pmap_write_protect(struct pmap *pmap, va
 
 	for (va = sva ; va < eva; va = blockend) {
 		pt_entry_t *spte, *epte;
-		int i;
 
 		blockend = x86_round_pdr(va + 1);
 		if (blockend > eva)
 			blockend = eva;
 
-		/*
-		 * Our PTE mappings should never be write-protected.
-		 *
-		 * XXXmaxv: still needed?
-		 *
-		 * A long term solution is to move the PTEs out of user address
-		 * space, and into kernel address space. Then we can set
-		 * VM_MAXUSER_ADDRESS to be VM_MAX_ADDRESS.
-		 */
-		for (i = 0; i < PDP_SIZE; i++) {
-			if (pl_i(va, PTP_LEVELS) == PDIR_SLOT_PTE+i)
-panic("PTE space accessed");
-		}
-
 		/* Is it a valid block? */
 		if (!pmap_pdes_valid(va, pdes, NULL)) {
 			continue;
@@ -4142,8 +4112,6 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	npte |= PG_W;
 	if (va < VM_MAXUSER_ADDRESS)
 		npte |= PG_u;
-	else if (va < VM_MAX_ADDRESS)
-		panic("PTE space accessed");	/* XXXmaxv: no longer needed? */
 
 	if (pmap == pmap_kernel())
 		npte |= pmap_pg_g;



CVS commit: src/sys/arch/x86

2018-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Dec 17 06:58:54 UTC 2018

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

Log Message:
Add two pmap fields, will be used by NVMM-VMX. Also apply a few cosmetic
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.313 -r1.314 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/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.92 src/sys/arch/x86/include/pmap.h:1.93
--- src/sys/arch/x86/include/pmap.h:1.92	Thu Dec  6 17:26:18 2018
+++ src/sys/arch/x86/include/pmap.h	Mon Dec 17 06:58:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.92 2018/12/06 17:26:18 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.93 2018/12/17 06:58:54 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -261,6 +261,8 @@ struct pmap {
 	struct vm_page *pm_gc_ptp;	/* pages from pmap g/c */
 
 	/* Used by NVMM. */
+	int (*pm_enter)(struct pmap *, vaddr_t, paddr_t, vm_prot_t, u_int);
+	void (*pm_remove)(struct pmap *, vaddr_t, vaddr_t);
 	void (*pm_tlb_flush)(struct pmap *);
 	void *pm_data;
 };

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.313 src/sys/arch/x86/x86/pmap.c:1.314
--- src/sys/arch/x86/x86/pmap.c:1.313	Fri Dec  7 15:47:11 2018
+++ src/sys/arch/x86/x86/pmap.c	Mon Dec 17 06:58:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.313 2018/12/07 15:47:11 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.314 2018/12/17 06:58:54 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.313 2018/12/07 15:47:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.314 2018/12/17 06:58:54 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2177,7 +2177,7 @@ pmap_get_ptp(struct pmap *pmap, vaddr_t 
 	return ptp;
 
 	/*
-	 * Allocation of a ptp failed, free any others that we just allocated.
+	 * Allocation of a PTP failed, free any others that we just allocated.
 	 */
 fail:
 	for (i = PTP_LEVELS; i > 1; i--) {
@@ -2386,7 +2386,11 @@ pmap_create(void)
 #endif
 	pmap->pm_flags = 0;
 	pmap->pm_gc_ptp = NULL;
+
+	pmap->pm_enter = NULL;
+	pmap->pm_remove = NULL;
 	pmap->pm_tlb_flush = NULL;
+	pmap->pm_data = NULL;
 
 	kcpuset_create(&pmap->pm_cpus, true);
 	kcpuset_create(&pmap->pm_kernel_cpus, true);
@@ -3486,6 +3490,11 @@ pmap_remove(struct pmap *pmap, vaddr_t s
 	struct vm_page *ptp;
 	struct pmap *pmap2;
 
+	if (__predict_false(pmap->pm_remove != NULL)) {
+		(*pmap->pm_remove)(pmap, sva, eva);
+		return;
+	}
+
 	kpreempt_disable();
 	pmap_map_ptes(pmap, &pmap2, &ptes, &pdes);	/* locks pmap */
 
@@ -3544,9 +3553,7 @@ pmap_remove(struct pmap *pmap, vaddr_t s
 
 		lvl = pmap_pdes_invalid(va, pdes, &pde);
 		if (lvl != 0) {
-			/*
-			 * skip a range corresponding to an invalid pde.
-			 */
+			/* Skip a range corresponding to an invalid pde. */
 			blkendva = (va & ptp_frames[lvl - 1]) + nbpd[lvl - 1];
  			continue;
 		}
@@ -3567,7 +3574,7 @@ pmap_remove(struct pmap *pmap, vaddr_t s
 		pmap_remove_ptes(pmap, ptp, (vaddr_t)&ptes[pl1_i(va)], va,
 		blkendva, &pv_tofree);
 
-		/* if PTP is no longer being used, free it! */
+		/* If PTP is no longer being used, free it. */
 		if (ptp && ptp->wire_count <= 1) {
 			pmap_free_ptp(pmap, ptp, va, ptes, pdes);
 		}
@@ -4086,6 +4093,10 @@ int
 pmap_enter_default(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot,
 u_int flags)
 {
+	if (__predict_false(pmap->pm_enter != NULL)) {
+		return (*pmap->pm_enter)(pmap, va, pa, prot, flags);
+	}
+
 	return pmap_enter_ma(pmap, va, pa, pa, prot, flags, 0);
 }
 
@@ -4196,10 +4207,9 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	/*
 	 * Check if there is an existing mapping.  If we are now sure that
 	 * we need pves and we failed to allocate them earlier, handle that.
-	 * Caching the value of oldpa here is safe because only the mod/ref bits
-	 * can change while the pmap is locked.
+	 * Caching the value of oldpa here is safe because only the mod/ref
+	 * bits can change while the pmap is locked.
 	 */
-
 	ptep = &ptes[pl1_i(va)];
 	opte = *ptep;
 	bool have_oldpa = pmap_valid_entry(opte);
@@ -4216,9 +4226,8 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	}
 
 	/*
-	 * update the pte.
+	 * Update the pte.
 	 */
-
 	do {
 		opte = *ptep;
 
@@ -4252,9 +4261,8 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	} while (pmap_pte_cas(ptep, opte, npte) != opte);
 
 	/*
-	 * update statistics and PTP's reference count.
+	 * Update statistics and PTP's reference count.
 	 */
-
 	pmap_stats_update_bypte(pmap, npte, opte);
 	if (ptp != NULL && !have_oldpa) {
 		ptp->wire_count++;
@@ -4262,18 +4270,16 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	KASSERT(ptp == NULL || ptp->wire_count > 1);
 
 	

CVS commit: src/sys/uvm

2018-12-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 17 06:53:01 UTC 2018

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

Log Message:
Raise the fill_vmentries() E2BIG limit from 1MB to 10MB

The previous limit was not enough for libFuzzer as it requires up to 2.5MB
in test-suite.

Alternative approaches to retrieve larger address map during happened to be
worse during the evaluation due to difficulties in locking and atomicity.

Discussed with 


To generate a diff of this commit:
cvs rdiff -u -r1.356 -r1.357 src/sys/uvm/uvm_map.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_map.c
diff -u src/sys/uvm/uvm_map.c:1.356 src/sys/uvm/uvm_map.c:1.357
--- src/sys/uvm/uvm_map.c:1.356	Wed Sep 12 15:58:08 2018
+++ src/sys/uvm/uvm_map.c	Mon Dec 17 06:53:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.356 2018/09/12 15:58:08 maxv Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.357 2018/12/17 06:53:01 kamil Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.356 2018/09/12 15:58:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.357 2018/12/17 06:53:01 kamil Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4963,7 +4963,7 @@ fill_vmentries(struct lwp *l, pid_t pid,
 		return EINVAL;
 
 	if (oldp) {
-		if (*oldlenp > 1024 * 1024)
+		if (*oldlenp > 10UL * 1024UL * 1024UL)
 			return E2BIG;
 		count = *oldlenp / elem_size;
 		if (count == 0)



CVS commit: src/sys/conf

2018-12-16 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 17 04:37:15 UTC 2018

Modified Files:
src/sys/conf: dts.mk

Log Message:
Add support for building overlay DT blobs specified in the kernel
config file like so:

makeoptions DTS_OVERLAYDIR="${THISARM}/conf"
makeoptions DTS_OVERLAYS="
my-cool-overlay.dts
"

The result is my-cool-overlay.dtbo in the kernel compile directory.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/conf/dts.mk

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

Modified files:

Index: src/sys/conf/dts.mk
diff -u src/sys/conf/dts.mk:1.9 src/sys/conf/dts.mk:1.10
--- src/sys/conf/dts.mk:1.9	Fri May 25 19:48:12 2018
+++ src/sys/conf/dts.mk	Mon Dec 17 04:37:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: dts.mk,v 1.9 2018/05/25 19:48:12 jakllsch Exp $
+# $NetBSD: dts.mk,v 1.10 2018/12/17 04:37:15 thorpej Exp $
 
 DTSARCH?=${MACHINE_CPU}
 DTSGNUARCH?=${DTSARCH}
@@ -25,9 +25,9 @@ DTSDIR+=$S/external/gpl2/dts/dist/arch/$
 .endfor
 .endfor
 
-DTSPATH=${DTSINC} ${DTSDIR} dts
+DTSPATH=${DTSINC} ${DTSDIR} ${DTS_OVERLAYDIR} dts
 
-.SUFFIXES: .dtd .dtb .dts
+.SUFFIXES: .dtd .dtdo .dtb .dtbo .dts
 
 .dts.dtd:
 	(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
@@ -41,6 +41,17 @@ DTSPATH=${DTSINC} ${DTSDIR} dts
 	${TOOL_SED} -e 's@null.o@${.TARGET:.dtd=.dtb}@' \
 	-e 's@/dev/null@@') > ${.TARGET}
 
+.dts.dtdo:
+	(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+	-include ${.IMPSRC} /dev/null | \
+	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
+	-@ -o /dev/null -d /dev/stdout | \
+	${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtdo=.dtbo}@' \
+	-e 's@@${.IMPSRC}@' && \
+	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+	-include ${.IMPSRC} -M /dev/null | \
+	${TOOL_SED} -e 's@null.o@${.TARGET:.dtdo=.dtbo}@' \
+	-e 's@/dev/null@@') > ${.TARGET}
 
 .dts.dtb:
 	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
@@ -48,9 +59,17 @@ DTSPATH=${DTSINC} ${DTSDIR} dts
 	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
 	-p ${DTSPADDING} -b 0 -@ -o ${.TARGET}
 
-.PATH.dts: ${DTSDIR}
+.dts.dtbo:
+	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+	-include ${.IMPSRC} /dev/null | \
+	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
+	-@ -o ${.TARGET}
+
+.PATH.dts: ${DTSDIR} ${DTS_OVERLAYDIR}
 
 DEPS+= ${DTS:.dts=.dtd}
-DTB= ${DTS:.dts=.dtb}
+DEPS+= ${DTS_OVERLAYS:.dts=.dtdo}
+DTB=  ${DTS:.dts=.dtb}
+DTBO= ${DTS_OVERLAYS:.dts=.dtbo}
 
-all: ${DTB}
+all: ${DTB} ${DTBO}



CVS commit: src/sys/dev/pci

2018-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 17 04:21:45 UTC 2018

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

Log Message:
 When sc->phy.acquire() failed, it's not required to call sc->phy.release().


To generate a diff of this commit:
cvs rdiff -u -r1.606 -r1.607 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.606 src/sys/dev/pci/if_wm.c:1.607
--- src/sys/dev/pci/if_wm.c:1.606	Mon Dec 17 04:14:40 2018
+++ src/sys/dev/pci/if_wm.c	Mon Dec 17 04:21:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.606 2018/12/17 04:14:40 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.607 2018/12/17 04:21:44 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.606 2018/12/17 04:14:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.607 2018/12/17 04:21:44 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -14192,7 +14192,7 @@ wm_ulp_disable(struct wm_softc *sc)
 	if (rv != 0) {
 		DPRINTF(WM_DEBUG_INIT, ("%s: %s: failed\n",
 		device_xname(sc->sc_dev), __func__));
-		goto release;
+		return -1;
 	}
 
 	/* Toggle LANPHYPC */
@@ -14428,7 +14428,7 @@ wm_resume_workarounds_pchlan(struct wm_s
 		uint16_t phy_reg;
 
 		if (sc->phy.acquire(sc) != 0)
-			goto release;
+			return -1;
 
 		/* Clear Auto Enable LPI after link up */
 		sc->phy.readreg_locked(dev, 1, I217_LPI_GPIO_CTRL, &phy_reg);



CVS commit: src/sys/dev/pci

2018-12-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Dec 17 04:14:40 UTC 2018

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

Log Message:
Fix txqueue assignment. Pointed out by yamaguchi@n.o, thanks.

E.g. When ncpu is six and nqueue is four, the sequence error occurs.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.605 -r1.606 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.605 src/sys/dev/pci/if_wm.c:1.606
--- src/sys/dev/pci/if_wm.c:1.605	Sat Dec 15 05:40:10 2018
+++ src/sys/dev/pci/if_wm.c	Mon Dec 17 04:14:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.605 2018/12/15 05:40:10 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.606 2018/12/17 04:14:40 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.605 2018/12/15 05:40:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.606 2018/12/17 04:14:40 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -7298,7 +7298,7 @@ wm_select_txqueue(struct ifnet *ifp, str
 	 * TODO:
 	 * distribute by flowid(RSS has value).
 	 */
-	return (cpuid + ncpu - sc->sc_affinity_offset) % sc->sc_nqueues;
+	return ((cpuid + ncpu - sc->sc_affinity_offset) % ncpu) % sc->sc_nqueues;
 }
 
 /*



CVS commit: src/share/man/man4

2018-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 17 04:11:34 UTC 2018

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

Log Message:
 Add IO-DATA WN-G150UMW.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/urtwn.4

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

Modified files:

Index: src/share/man/man4/urtwn.4
diff -u src/share/man/man4/urtwn.4:1.15 src/share/man/man4/urtwn.4:1.16
--- src/share/man/man4/urtwn.4:1.15	Wed Oct 12 03:23:29 2016
+++ src/share/man/man4/urtwn.4	Mon Dec 17 04:11:34 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: urtwn.4,v 1.15 2016/10/12 03:23:29 nat Exp $
+.\" $NetBSD: urtwn.4,v 1.16 2018/12/17 04:11:34 msaitoh Exp $
 .\" $OpenBSD: urtwn.4,v 1.15 2011/11/26 06:39:33 ckuethe Exp $
 .\"
 .\" Copyright (c) 2010 Damien Bergamini 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd July 25, 2014
+.Dd December 17, 2018
 .Dt URTWN 4
 .Os
 .Sh NAME
@@ -117,6 +117,7 @@ The following adapters should work:
 .It ELECOM WDC-150SU2M
 .It Full River FR-W100NUL
 .It Hercules Wireless N USB Pico HWNUp-150
+.It IO-DATA WN-G150UMW
 .It Netgear WNA1000A
 .It Planex GW-USEco300
 .It Planex GW-USNano2



CVS commit: src/usr.bin/make

2018-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 17 02:06:00 UTC 2018

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

Log Message:
PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/make/parse.c

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

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.229 src/usr.bin/make/parse.c:1.230
--- src/usr.bin/make/parse.c:1.229	Thu Apr  5 12:31:54 2018
+++ src/usr.bin/make/parse.c	Sun Dec 16 21:06:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.230 2018/12/17 02:06:00 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -681,11 +681,11 @@ ParseVErrorInternal(FILE *f, const char 
 
 			/*
 			 * Nothing is more annoying than not knowing
-			 * which Makefile is the culprit.
+			 * which Makefile is the culprit; we try ${.PARSEDIR}
+			 * first and if that's not absolute, we try ${.CURDIR}
 			 */
 			dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp);
-			if (dir == NULL || *dir == '\0' ||
-			(*dir == '.' && dir[1] == '\0'))
+			if (dir == NULL || *dir == '\0' || *dir != '/')
 dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp);
 			if (dir == NULL)
 dir = ".";



CVS commit: src/usr.sbin/sysinst

2018-12-16 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec 17 01:16:49 UTC 2018

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
Fix line continuations in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/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/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.15 src/usr.sbin/sysinst/Makefile.inc:1.16
--- src/usr.sbin/sysinst/Makefile.inc:1.15	Sun Dec 16 11:36:08 2018
+++ src/usr.sbin/sysinst/Makefile.inc	Mon Dec 17 01:16:49 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.15 2018/12/16 11:36:08 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.16 2018/12/17 01:16:49 uwe Exp $
 #
 # Makefile for sysinst
 
@@ -57,8 +57,8 @@ CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.C
 		${NODISKLABEL:D-DNO_DISKLABEL} \
 		${NOPARTMAN:D-DNO_PARTMAN}
 
-.if ${MACHINE} == "evbarm"
-|| ${MACHINE} == "evbmips"
+.if ${MACHINE} == "evbarm" \
+|| ${MACHINE} == "evbmips" \
 || ${MACHINE} == "evbsh3"
 CPPFLAGS+=	-DARCH_SUBDIR="\"${MACHINE}-${MACHINE_ARCH}\""
 CPPFLAGS+=	-DPKG_ARCH_SUBDIR="\"${MACHINE_ARCH}\""



CVS commit: src/sys

2018-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Dec 16 21:03:35 UTC 2018

Modified Files:
src/sys/kern: subr_pool.c
src/sys/sys: pool.h

Log Message:
Add support for detecting use-after-frees in KASAN. We poison each freed
buffer, any subsequent read or write will be detected as illegal.

 * Add POOL_CHECK_MAGIC, which is disabled under KASAN, because the same
   detection is done in a better way.

 * Register the size+redzone in the pool structure, to reduce the overhead.

 * Fix the CTOR/DTOR check in KLEAK, the fields are never NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.82 -r1.83 src/sys/sys/pool.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/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.228 src/sys/kern/subr_pool.c:1.229
--- src/sys/kern/subr_pool.c:1.228	Sun Dec  2 21:00:13 2018
+++ src/sys/kern/subr_pool.c	Sun Dec 16 21:03:35 2018
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_pool.c,v 1.228 2018/12/02 21:00:13 maxv Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.229 2018/12/16 21:03:35 maxv Exp $	*/
 
-/*-
- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015
+/*
+ * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
  * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.228 2018/12/02 21:00:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.229 2018/12/16 21:03:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -100,10 +100,12 @@ static struct pool psppool;
 static void pool_redzone_init(struct pool *, size_t);
 static void pool_redzone_fill(struct pool *, void *);
 static void pool_redzone_check(struct pool *, void *);
+static void pool_cache_redzone_check(pool_cache_t, void *);
 #else
-# define pool_redzone_init(pp, sz)	/* NOTHING */
-# define pool_redzone_fill(pp, ptr)	/* NOTHING */
-# define pool_redzone_check(pp, ptr)	/* NOTHING */
+# define pool_redzone_init(pp, sz)		__nothing
+# define pool_redzone_fill(pp, ptr)		__nothing
+# define pool_redzone_check(pp, ptr)		__nothing
+# define pool_cache_redzone_check(pc, ptr)	__nothing
 #endif
 
 #ifdef KLEAK
@@ -114,6 +116,11 @@ static void pool_cache_kleak_fill(pool_c
 #define pool_cache_kleak_fill(pc, ptr)	__nothing
 #endif
 
+#define pc_has_ctor(pc) \
+	(pc->pc_ctor != (int (*)(void *, void *, int))nullop)
+#define pc_has_dtor(pc) \
+	(pc->pc_dtor != (void (*)(void *, void *))nullop)
+
 static void *pool_page_alloc_meta(struct pool *, int);
 static void pool_page_free_meta(struct pool *, void *);
 
@@ -170,8 +177,12 @@ struct pool_item_header {
 #define	ph_itemlist	ph_u.phu_normal.phu_itemlist
 #define	ph_bitmap	ph_u.phu_notouch.phu_bitmap
 
+#if defined(DIAGNOSTIC) && !defined(KASAN)
+#define POOL_CHECK_MAGIC
+#endif
+
 struct pool_item {
-#ifdef DIAGNOSTIC
+#ifdef POOL_CHECK_MAGIC
 	u_int pi_magic;
 #endif
 #define	PI_MAGIC 0xdeaddeadU
@@ -890,10 +901,12 @@ pool_get(struct pool *pp, int flags)
 		KASSERTMSG((pp->pr_nitems > 0),
 		"%s: [%s] nitems %u inconsistent on itemlist",
 		__func__, pp->pr_wchan, pp->pr_nitems);
+#ifdef POOL_CHECK_MAGIC
 		KASSERTMSG((pi->pi_magic == PI_MAGIC),
 		"%s: [%s] free list modified: "
 		"magic=%x; page %p; item addr %p", __func__,
 		pp->pr_wchan, pi->pi_magic, ph->ph_page, pi);
+#endif
 
 		/*
 		 * Remove from item list.
@@ -977,7 +990,7 @@ pool_do_put(struct pool *pp, void *v, st
 	if (pp->pr_roflags & PR_NOTOUCH) {
 		pr_item_notouch_put(pp, ph, v);
 	} else {
-#ifdef DIAGNOSTIC
+#ifdef POOL_CHECK_MAGIC
 		pi->pi_magic = PI_MAGIC;
 #endif
 #ifdef DEBUG
@@ -989,6 +1002,13 @@ pool_do_put(struct pool *pp, void *v, st
 			}
 		}
 #endif
+		if (pp->pr_redzone) {
+			/*
+			 * Mark the pool_item as valid. The rest is already
+			 * invalid.
+			 */
+			kasan_alloc(pi, sizeof(*pi), sizeof(*pi));
+		}
 
 		LIST_INSERT_HEAD(&ph->ph_itemlist, pi, pi_list);
 	}
@@ -1237,7 +1257,7 @@ pool_prime_page(struct pool *pp, void *s
 
 			/* Insert on page list */
 			LIST_INSERT_HEAD(&ph->ph_itemlist, pi, pi_list);
-#ifdef DIAGNOSTIC
+#ifdef POOL_CHECK_MAGIC
 			pi->pi_magic = PI_MAGIC;
 #endif
 			cp = (char *)cp + pp->pr_size;
@@ -1540,12 +1560,12 @@ pool_print_pagelist(struct pool *pp, str
 void (*pr)(const char *, ...))
 {
 	struct pool_item_header *ph;
-	struct pool_item *pi __diagused;
 
 	LIST_FOREACH(ph, pl, ph_pagelist) {
 		(*pr)("\t\tpage %p, nmissing %d, time %" PRIu32 "\n",
 		ph->ph_page, ph->ph_nmissing, ph->ph_time);
-#ifdef DIAGNOSTIC
+#ifdef POOL_CHECK_MAGIC
+		struct pool_item *pi;
 		if (!(pp->pr_roflags & PR_NOTOUCH)) {
 			LIST_FOREACH(pi, &ph->ph_itemlist, pi_list) {
 if (pi->pi_magic != PI_MAGIC) {
@@ -1700,7 +1720,7 @@ pool_chk_page(struct pool *pp, const cha
 	 pi != NULL;
 	 pi = LIST_NEXT(pi,pi_list), n++) {
 
-#ifdef DIAGNOSTIC
+

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

2018-12-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Dec 16 20:58:00 UTC 2018

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

Log Message:
use ci_ipending instead of ci_istate.ipending, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/x86/x86/lapic.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/lapic.c
diff -u src/sys/arch/x86/x86/lapic.c:1.67 src/sys/arch/x86/x86/lapic.c:1.68
--- src/sys/arch/x86/x86/lapic.c:1.67	Sun Sep 23 00:59:59 2018
+++ src/sys/arch/x86/x86/lapic.c	Sun Dec 16 20:58:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lapic.c,v 1.67 2018/09/23 00:59:59 cherry Exp $	*/
+/*	$NetBSD: lapic.c,v 1.68 2018/12/16 20:58:00 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.67 2018/09/23 00:59:59 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.68 2018/12/16 20:58:00 jdolecek Exp $");
 
 #include "acpica.h"
 #include "ioapic.h"
@@ -535,7 +535,7 @@ lapic_get_timecount(struct timecounter *
 		if (lapic_readreg(reg) & (1 << (LAPIC_TIMER_VECTOR % 32))) {
 			cur_timer -= lapic_tval;
 		}
-	} else if (ci->ci_istate.ipending & (1 << LIR_TIMER))
+	} else if (ci->ci_ipending & (1 << LIR_TIMER))
 		cur_timer = lapic_gettick() - lapic_tval;
 	cur_timer = ci->ci_lapic_counter - cur_timer;
 	splx(s);



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

2018-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 16 18:53:34 UTC 2018

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

Log Message:
use %s formats to avoid -flag confusion (from sjg)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varquote.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/varquote.mk
diff -u src/usr.bin/make/unit-tests/varquote.mk:1.3 src/usr.bin/make/unit-tests/varquote.mk:1.4
--- src/usr.bin/make/unit-tests/varquote.mk:1.3	Sun Dec 16 12:30:57 2018
+++ src/usr.bin/make/unit-tests/varquote.mk	Sun Dec 16 13:53:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: varquote.mk,v 1.3 2018/12/16 17:30:57 christos Exp $
+# $NetBSD: varquote.mk,v 1.4 2018/12/16 18:53:34 christos Exp $
 #
 # Test VAR:q modifier
 
@@ -10,5 +10,5 @@ all:
 	@${MAKE} -f ${MAKEFILE} REPROFLAGS=${REPROFLAGS:q}
 .else
 all:
-	@printf ${REPROFLAGS}
+	@printf "%s %s\n" ${REPROFLAGS}
 .endif



CVS commit: src/sys

2018-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 16 17:46:58 UTC 2018

Modified Files:
src/sys/netinet: dccp_usrreq.c tcp_usrreq.c
src/sys/sys: socketvar.h

Log Message:
sbspace() does not return negative values anymore and that broke OOB data
sending. Instead of depending on negative values, account for the 1024
bytes sosend() adds so that it can use all the space here in a separate
function sbspace_oob(). Idea from mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.221 -r1.222 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.158 -r1.159 src/sys/sys/socketvar.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/netinet/dccp_usrreq.c
diff -u src/sys/netinet/dccp_usrreq.c:1.20 src/sys/netinet/dccp_usrreq.c:1.21
--- src/sys/netinet/dccp_usrreq.c:1.20	Fri Sep 14 01:09:51 2018
+++ src/sys/netinet/dccp_usrreq.c	Sun Dec 16 12:46:58 2018
@@ -1,5 +1,5 @@
 /*	$KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $	*/
-/*	$NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $ */
+/*	$NetBSD: dccp_usrreq.c,v 1.21 2018/12/16 17:46:58 christos Exp $ */
 
 /*
  * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson 
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.21 2018/12/16 17:46:58 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2157,7 +2157,7 @@ dccp_send(struct socket *so, struct mbuf
 		}
 	}
 
-	if (sbspace(&so->so_snd) < -512) {
+	if (sbspace_oob(&so->so_snd) == 0) {
 		INP_UNLOCK(inp);
 		error = ENOBUFS;
 		goto release;

Index: src/sys/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.221 src/sys/netinet/tcp_usrreq.c:1.222
--- src/sys/netinet/tcp_usrreq.c:1.221	Sat Nov 24 12:05:54 2018
+++ src/sys/netinet/tcp_usrreq.c	Sun Dec 16 12:46:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.222 2018/12/16 17:46:58 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.222 2018/12/16 17:46:58 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1154,7 +1154,7 @@ tcp_sendoob(struct socket *so, struct mb
 	ostate = tcp_debug_capture(tp, PRU_SENDOOB);
 
 	s = splsoftnet();
-	if (sbspace(&so->so_snd) < -512) {
+	if (sbspace_oob(&so->so_snd) == 0) {
 		m_freem(m);
 		splx(s);
 		return ENOBUFS;

Index: src/sys/sys/socketvar.h
diff -u src/sys/sys/socketvar.h:1.158 src/sys/sys/socketvar.h:1.159
--- src/sys/sys/socketvar.h:1.158	Wed Aug  1 19:35:32 2018
+++ src/sys/sys/socketvar.h	Sun Dec 16 12:46:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: socketvar.h,v 1.158 2018/08/01 23:35:32 rjs Exp $	*/
+/*	$NetBSD: socketvar.h,v 1.159 2018/12/16 17:46:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -412,6 +412,21 @@ sbspace(const struct sockbuf *sb)
 	return lmin(sb->sb_hiwat - sb->sb_cc, sb->sb_mbmax - sb->sb_mbcnt);
 }
 
+static __inline u_long
+sbspace_oob(const struct sockbuf *sb)
+{
+	u_long hiwat = sb->sb_hiwat;
+
+	if (hiwat < ULONG_MAX - 1024)
+		hiwat += 1024;
+
+	KASSERT(solocked(sb->sb_so));
+
+	if (hiwat <= sb->sb_cc || sb->sb_mbmax <= sb->sb_mbcnt)
+		return 0;
+	return lmin(hiwat - sb->sb_cc, sb->sb_mbmax - sb->sb_mbcnt);
+}
+
 /* do we have to send all at once on a socket? */
 static __inline int
 sosendallatonce(const struct socket *so)



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

2018-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 16 17:30:57 UTC 2018

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

Log Message:
Use printf instead of echo since we can't portably use \ in string (from sjg@)
http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varquote.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/varquote.mk
diff -u src/usr.bin/make/unit-tests/varquote.mk:1.2 src/usr.bin/make/unit-tests/varquote.mk:1.3
--- src/usr.bin/make/unit-tests/varquote.mk:1.2	Sat May 26 21:14:51 2018
+++ src/usr.bin/make/unit-tests/varquote.mk	Sun Dec 16 12:30:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: varquote.mk,v 1.2 2018/05/27 01:14:51 christos Exp $
+# $NetBSD: varquote.mk,v 1.3 2018/12/16 17:30:57 christos Exp $
 #
 # Test VAR:q modifier
 
@@ -10,5 +10,5 @@ all:
 	@${MAKE} -f ${MAKEFILE} REPROFLAGS=${REPROFLAGS:q}
 .else
 all:
-	@echo ${REPROFLAGS}
+	@printf ${REPROFLAGS}
 .endif



CVS commit: src/tests/lib/libc/net/getaddrinfo

2018-12-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Dec 16 17:08:19 UTC 2018

Modified Files:
src/tests/lib/libc/net/getaddrinfo: no_serv_v4.exp

Log Message:
Update error string


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/net/getaddrinfo/no_serv_v4.exp

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/net/getaddrinfo/no_serv_v4.exp
diff -u src/tests/lib/libc/net/getaddrinfo/no_serv_v4.exp:1.1 src/tests/lib/libc/net/getaddrinfo/no_serv_v4.exp:1.2
--- src/tests/lib/libc/net/getaddrinfo/no_serv_v4.exp:1.1	Wed Jan 12 02:58:40 2011
+++ src/tests/lib/libc/net/getaddrinfo/no_serv_v4.exp	Sun Dec 16 17:08:19 2018
@@ -11,4 +11,4 @@ ai1: flags 0x2 family 2 socktype 2 proto
 ai2: flags 0x2 family 2 socktype 1 protocol 6 addrlen 16 host 127.0.0.1 serv 0
 
 arg: flags 0x2 family 0 socktype 0 protocol 0 addrlen 0 host (empty) serv (empty)
-hostname nor servname provided, or not known
+hostname or servname not provided or not known



CVS commit: src/sys/arch

2018-12-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 16 16:46:13 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: scu_reg.h
src/sys/arch/evbarm/nitrogen6: nitrogen6_machdep.c

Log Message:
Move register definiton to header


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/scu_reg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c

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

Modified files:

Index: src/sys/arch/arm/cortex/scu_reg.h
diff -u src/sys/arch/arm/cortex/scu_reg.h:1.2 src/sys/arch/arm/cortex/scu_reg.h:1.3
--- src/sys/arch/arm/cortex/scu_reg.h:1.2	Tue Oct  4 15:15:27 2016
+++ src/sys/arch/arm/cortex/scu_reg.h	Sun Dec 16 16:46:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: scu_reg.h,v 1.2 2016/10/04 15:15:27 kiyohara Exp $ */
+/* $NetBSD: scu_reg.h,v 1.3 2018/12/16 16:46:12 skrll Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -42,11 +42,14 @@
 #define	SCU_CFG			0x04	// SCU Configuration Register
 #define	SCU_CPU_PWR_STS		0x08	// SCU CPU Power Status
 #define	SCU_INV_ALL_REG		0x0c	// SCU Invalidate All Registers in Secure State
+#define	SCU_DIAG_CONTROL	0x30	// SCU Diag Control - undocumented
 #define	SCU_FILTER_START	0x40	// Filtering Start Address
 #define	SCU_FILTER_END		0x44	// Filtering End Address
 #define	SCU_ACCESS_CONTROL	0x50	// SCU Access Control
 #define	SCU_NS_ACCESS_CONTROL	0x54	// SCU Non-Secure Access Control
 
+
+
 #define	SCU_CTL_IC_STANDBY_ENA			__BIT(6)
 #define	SCU_CTL_SCU_STANDBY_ENA			__BIT(5)
 #define	SCU_CTL_FORCE_PORT0_ENA			__BIT(4)
@@ -70,4 +73,6 @@
 #define	SCU_CFG_CPU0_SMP		__BIT(4)
 #define	SCU_CFG_CPUMAX			__BITS(0,1)	// # of CPU - 1
 
+#define SCU_DIAG_DISABLE_MIGBIT		__BIT(0)
+
 #endif /* _ARM_CORTEX_SCUREG_H_ */

Index: src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c
diff -u src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c:1.13 src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c:1.14
--- src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c:1.13	Sat Nov  3 15:02:32 2018
+++ src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c	Sun Dec 16 16:46:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nitrogen6_machdep.c,v 1.13 2018/11/03 15:02:32 skrll Exp $	*/
+/*	$NetBSD: nitrogen6_machdep.c,v 1.14 2018/12/16 16:46:12 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nitrogen6_machdep.c,v 1.13 2018/11/03 15:02:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nitrogen6_machdep.c,v 1.14 2018/12/16 16:46:12 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -191,11 +191,6 @@ nitrogen6_platform_early_putchar(char c)
 	}
 }
 
-
-#define	SCU_DIAG_CONTROL		0x30
-#define	  SCU_DIAG_DISABLE_MIGBIT	  __BIT(0)
-
-
 void
 nitrogen6_mpstart(void)
 {



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

2018-12-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 16 16:45:12 UTC 2018

Modified Files:
src/sys/arch/arm/imx: imx6_pcie.c

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imx6_pcie.c

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

Modified files:

Index: src/sys/arch/arm/imx/imx6_pcie.c
diff -u src/sys/arch/arm/imx/imx6_pcie.c:1.6 src/sys/arch/arm/imx/imx6_pcie.c:1.7
--- src/sys/arch/arm/imx/imx6_pcie.c:1.6	Wed May 23 10:42:05 2018
+++ src/sys/arch/arm/imx/imx6_pcie.c	Sun Dec 16 16:45:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_pcie.c,v 1.6 2018/05/23 10:42:05 hkenken Exp $	*/
+/*	$NetBSD: imx6_pcie.c,v 1.7 2018/12/16 16:45:11 skrll Exp $	*/
 
 /*
  * Copyright (c) 2016  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.6 2018/05/23 10:42:05 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.7 2018/12/16 16:45:11 skrll Exp $");
 
 #include "opt_pci.h"
 
@@ -136,7 +136,8 @@ static const char *imx6pcie_intr_string(
 	  char *, size_t);
 const struct evcnt *imx6pcie_intr_evcnt(void *, pci_intr_handle_t);
 static void * imx6pcie_intr_establish(void *, pci_intr_handle_t,
-	 int, int (*)(void *), void *);
+	 int, int (*)(void *), void *,
+ const char *);
 static void imx6pcie_intr_disestablish(void *, void *);
 
 CFATTACH_DECL_NEW(imxpcie, sizeof(struct imx6pcie_softc),
@@ -921,7 +922,7 @@ imx6pcie_intr_evcnt(void *v, pci_intr_ha
 
 static void *
 imx6pcie_intr_establish(void *v, pci_intr_handle_t ih, int ipl,
-int (*callback)(void *), void *arg)
+int (*callback)(void *), void *arg, const char *xname)
 {
 	struct imx6pcie_softc *sc = v;
 	struct imx6pcie_ih *pcie_ih;



CVS commit: src/lib/libtelnet

2018-12-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Dec 16 16:06:39 UTC 2018

Modified Files:
src/lib/libtelnet: auth.c

Log Message:
unifdef RSA_ENCPWD. The matching code does not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libtelnet/auth.c

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

Modified files:

Index: src/lib/libtelnet/auth.c
diff -u src/lib/libtelnet/auth.c:1.23 src/lib/libtelnet/auth.c:1.24
--- src/lib/libtelnet/auth.c:1.23	Sat Dec 15 23:22:51 2018
+++ src/lib/libtelnet/auth.c	Sun Dec 16 16:06:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth.c,v 1.23 2018/12/15 23:22:51 maya Exp $	*/
+/*	$NetBSD: auth.c,v 1.24 2018/12/16 16:06:39 maya Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)auth.c	8.3 (Berkeley) 5/30/95"
 #else
-__RCSID("$NetBSD: auth.c,v 1.23 2018/12/15 23:22:51 maya Exp $");
+__RCSID("$NetBSD: auth.c,v 1.24 2018/12/16 16:06:39 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -80,15 +80,6 @@ __RCSID("$NetBSD: auth.c,v 1.23 2018/12/
 
 #define	typemask(x)		(1<<((x)-1))
 
-#ifdef	RSA_ENCPWD
-extern rsaencpwd_init();
-extern rsaencpwd_send();
-extern rsaencpwd_is();
-extern rsaencpwd_reply();
-extern rsaencpwd_status();
-extern rsaencpwd_printsub();
-#endif
-
 int auth_debug_mode = 0;
 static 	const char	*Name = "Noname";
 static	int	Server = 0;
@@ -124,15 +115,6 @@ Authenticator authenticators[] = {
 kerberos5_status,
 kerberos5_printsub },
 #endif
-#ifdef	RSA_ENCPWD
-	{ AUTHTYPE_RSA_ENCPWD, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
-rsaencpwd_init,
-rsaencpwd_send,
-rsaencpwd_is,
-rsaencpwd_reply,
-rsaencpwd_status,
-rsaencpwd_printsub },
-#endif
 #ifdef SRA
 	{ AUTHTYPE_SRA, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
 sra_init,



CVS commit: src/lib/libc/hash/md2

2018-12-16 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Dec 16 14:08:49 UTC 2018

Modified Files:
src/lib/libc/hash/md2: md2.3

Log Message:
Remove self reference in SEE ALSO
Add references consistent with those in md4(3) and md5(3)

Reported by kamil


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/hash/md2/md2.3

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

Modified files:

Index: src/lib/libc/hash/md2/md2.3
diff -u src/lib/libc/hash/md2/md2.3:1.1 src/lib/libc/hash/md2/md2.3:1.2
--- src/lib/libc/hash/md2/md2.3:1.1	Sat Sep 24 20:51:14 2005
+++ src/lib/libc/hash/md2/md2.3	Sun Dec 16 14:08:48 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: md2.3,v 1.1 2005/09/24 20:51:14 elad Exp $
+.\" $NetBSD: md2.3,v 1.2 2018/12/16 14:08:48 abhinav Exp $
 .\"
 .\" 
 .\" "THE BEER-WARE LICENSE" (Revision 42):
@@ -99,7 +99,11 @@ If the
 .Ar buf
 argument is non-null it must point to at least 33 characters of buffer space.
 .Sh SEE ALSO
-.Xr md2 3 ,
+.Xr md4 3 ,
+.Xr md5 3 ,
+.Xr openssl_MD2 3 ,
+.Xr openssl_MD4 3 ,
+.Xr openssl_MD5 3 ,
 .Rs
 .%A B. Kaliski
 .%T The MD2 Message-Digest Algorithm



CVS commit: src/sys

2018-12-16 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Dec 16 14:06:56 UTC 2018

Modified Files:
src/sys/kern: files.kern
src/sys/rump/librump/rumpkern: Makefile.rumpkern
Added Files:
src/sys/kern: subr_thmap.c
src/sys/sys: thmap.h

Log Message:
Import thmap -- a concurrent trie-hash map, combining the elements of
hashing and radix trie.  It supports lock-free lookups and concurrent
inserts/deletes.  It is designed to be optimal as a general purpose
*concurrent* associative array.

Upstream: https://github.com/rmind/thmap
Discussed on tech-kern@


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/files.kern
cvs rdiff -u -r0 -r1.1 src/sys/kern/subr_thmap.c
cvs rdiff -u -r1.171 -r1.172 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r0 -r1.1 src/sys/sys/thmap.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/files.kern
diff -u src/sys/kern/files.kern:1.27 src/sys/kern/files.kern:1.28
--- src/sys/kern/files.kern:1.27	Mon Dec  3 00:11:02 2018
+++ src/sys/kern/files.kern	Sun Dec 16 14:06:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.kern,v 1.27 2018/12/03 00:11:02 christos Exp $
+#	$NetBSD: files.kern,v 1.28 2018/12/16 14:06:56 rmind Exp $
 
 #
 # kernel sources
@@ -142,6 +142,7 @@ file	kern/subr_psref.c		kern
 file	kern/subr_specificdata.c	kern
 file	kern/subr_tftproot.c		tftproot
 file	kern/subr_time.c		kern
+file	kern/subr_thmap.c		kern
 file	kern/subr_userconf.c		userconf
 file	kern/subr_vmem.c		kern
 file	kern/subr_workqueue.c		kern

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.171 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.172
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.171	Fri Sep 14 01:55:20 2018
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Sun Dec 16 14:06:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.171 2018/09/14 01:55:20 mrg Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.172 2018/12/16 14:06:56 rmind Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -122,6 +122,7 @@ SRCS+=	init_sysctl_base.c	\
 	subr_psref.c		\
 	subr_specificdata.c	\
 	subr_time.c		\
+	subr_thmap.c		\
 	subr_vmem.c		\
 	subr_workqueue.c	\
 	subr_xcall.c		\

Added files:

Index: src/sys/kern/subr_thmap.c
diff -u /dev/null src/sys/kern/subr_thmap.c:1.1
--- /dev/null	Sun Dec 16 14:06:56 2018
+++ src/sys/kern/subr_thmap.c	Sun Dec 16 14:06:56 2018
@@ -0,0 +1,934 @@
+/*-
+ * Copyright (c) 2018 Mindaugas Rasiukevicius 
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * Upstream: https://github.com/rmind/thmap/
+ */
+
+/*
+ * Concurrent trie-hash map.
+ *
+ * The data structure is conceptually a radix trie on hashed keys.
+ * Keys are hashed using a 32-bit function.  The root level is a special
+ * case: it is managed using the compare-and-swap (CAS) atomic operation
+ * and has a fanout of 64.  The subsequent levels are constructed using
+ * intermediate nodes with a fanout of 16 (using 4 bits).  As more levels
+ * are created, more blocks of the 32-bit hash value might be generated
+ * by incrementing the seed parameter of the hash function.
+ *
+ * Concurrency
+ *
+ * - READERS: Descending is simply walking through the slot values of
+ *   the intermediate nodes.  It is lock-free as there is no intermediate
+ *   state: the slot is either empty or has a pointer to the child node.
+ *   The main assumptions here are the following:
+ *
+ *   i) modifications must preserve consistency with the respect to the
+ *   readers i.e. the readers can only see the valid node values;
+ *
+ *   ii) any invalid view 

CVS commit: src/tests/fs

2018-12-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Dec 16 14:04:14 UTC 2018

Modified Files:
src/tests/fs/common: fstest_zfs.c
src/tests/fs/zfs: t_zpool.sh

Log Message:
Have to hijack sysctl() and modctl() for zfs commands.

Should fix PR kern/53422


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_zfs.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/zfs/t_zpool.sh

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

Modified files:

Index: src/tests/fs/common/fstest_zfs.c
diff -u src/tests/fs/common/fstest_zfs.c:1.1 src/tests/fs/common/fstest_zfs.c:1.2
--- src/tests/fs/common/fstest_zfs.c:1.1	Mon Aug 20 16:37:35 2012
+++ src/tests/fs/common/fstest_zfs.c	Sun Dec 16 14:04:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_zfs.c,v 1.1 2012/08/20 16:37:35 pooka Exp $	*/
+/*	$NetBSD: fstest_zfs.c,v 1.2 2018/12/16 14:04:14 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011  The NetBSD Foundation, Inc.
@@ -104,8 +104,8 @@ zfs_fstest_mount(const atf_tc_t *tc, voi
 
 	/* set up the hijack env for running zpool */
 	setenv("RUMP_SERVER", SRVURL, 1);
-	snprintf(tmpbuf, sizeof(tmpbuf)-1, "blanket=/dev/zfs:%s:%s",
-	ZFSDEV, path);
+	snprintf(tmpbuf, sizeof(tmpbuf)-1,
+	"blanket=/dev/zfs:%s:%s,sysctl=yes,modctl=yes", ZFSDEV, path);
 	setenv("RUMPHIJACK", tmpbuf, 1);
 	setenv("LD_PRELOAD", "/usr/lib/librumphijack.so", 1);
 

Index: src/tests/fs/zfs/t_zpool.sh
diff -u src/tests/fs/zfs/t_zpool.sh:1.3 src/tests/fs/zfs/t_zpool.sh:1.4
--- src/tests/fs/zfs/t_zpool.sh:1.3	Tue Dec  6 18:18:59 2011
+++ src/tests/fs/zfs/t_zpool.sh	Sun Dec 16 14:04:14 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_zpool.sh,v 1.3 2011/12/06 18:18:59 njoly Exp $
+#	$NetBSD: t_zpool.sh,v 1.4 2018/12/16 14:04:14 hannken Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -46,7 +46,7 @@ create_body()
 	atf_check -s exit:0 -o ignore -e ignore ${server} ${RUMP_SERVER}
 
 	export LD_PRELOAD=/usr/lib/librumphijack.so
-	export RUMPHIJACK=blanket=/dev/zfs:/dk:/jippo
+	export RUMPHIJACK=blanket=/dev/zfs:/dk:/jippo,sysctl=yes,modctl=yes
 	atf_check -s exit:0 zpool create jippo /dk
 
 	export RUMPHIJACK=vfs=all



CVS commit: src/lib/librumphijack

2018-12-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Dec 16 14:03:37 UTC 2018

Modified Files:
src/lib/librumphijack: hijack.c rumphijack.3

Log Message:
Add an option "modctl" to capture modctl().


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/lib/librumphijack/hijack.c
cvs rdiff -u -r1.12 -r1.13 src/lib/librumphijack/rumphijack.3

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.125 src/lib/librumphijack/hijack.c:1.126
--- src/lib/librumphijack/hijack.c:1.125	Thu Jun 28 06:20:36 2018
+++ src/lib/librumphijack/hijack.c	Sun Dec 16 14:03:37 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.125 2018/06/28 06:20:36 ozaki-r Exp $	*/
+/*  $NetBSD: hijack.c,v 1.126 2018/12/16 14:03:37 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.125 2018/06/28 06:20:36 ozaki-r Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.126 2018/12/16 14:03:37 hannken Exp $");
 #endif
 
 #include 
@@ -138,6 +138,7 @@ enum dualcall {
 
 #ifdef __NetBSD__
 	DUALCALL___SYSCTL,
+	DUALCALL_MODCTL,
 #endif
 
 #ifdef __NetBSD__
@@ -351,6 +352,7 @@ struct sysnames {
 
 #ifdef __NetBSD__
 	{ DUALCALL___SYSCTL,	"__sysctl",	RSYS_NAME(__SYSCTL)	},
+	{ DUALCALL_MODCTL,	"modctl",	RSYS_NAME(MODCTL)	},
 #endif
 
 #ifdef __NetBSD__
@@ -814,6 +816,30 @@ sysctlparser(char *buf)
 	errx(1, "sysctl value should be y(es)/n(o), gave: %s", buf);
 }
 
+static bool rumpmodctl = false;
+
+static void
+modctlparser(char *buf)
+{
+
+	if (buf == NULL) {
+		rumpmodctl = true;
+		return;
+	}
+
+	if (strcasecmp(buf, "y") == 0 || strcasecmp(buf, "yes") == 0 ||
+	strcasecmp(buf, "yep") == 0 || strcasecmp(buf, "tottakai") == 0) {
+		rumpmodctl = true;
+		return;
+	}
+	if (strcasecmp(buf, "n") == 0 || strcasecmp(buf, "no") == 0) {
+		rumpmodctl = false;
+		return;
+	}
+
+	errx(1, "modctl value should be y(es)/n(o), gave: %s", buf);
+}
+
 static void
 fdoffparser(char *buf)
 {
@@ -841,6 +867,7 @@ static struct {
 	{ blanketparser, "blanket", true },
 	{ vfsparser, "vfs", true },
 	{ sysctlparser, "sysctl", false },
+	{ modctlparser, "modctl", false },
 	{ fdoffparser, "fdoff", true },
 	{ NULL, NULL, false },
 };
@@ -2334,6 +2361,20 @@ __sysctl(const int *name, unsigned int n
 
 	return op___sysctl(name, namelen, old, oldlenp, new, newlen);
 }
+int modctl(int, void *);
+int
+modctl(int operation, void *argp)
+{
+	int (*op_modctl)(int operation, void *argp);
+
+	if (rumpmodctl) {
+		op_modctl = GETSYSCALL(rump, MODCTL);
+	} else {
+		op_modctl = GETSYSCALL(host, MODCTL);
+	}
+
+	return op_modctl(operation, argp);
+}
 #endif
 
 /*

Index: src/lib/librumphijack/rumphijack.3
diff -u src/lib/librumphijack/rumphijack.3:1.12 src/lib/librumphijack/rumphijack.3:1.13
--- src/lib/librumphijack/rumphijack.3:1.12	Mon Mar 14 15:21:22 2011
+++ src/lib/librumphijack/rumphijack.3	Sun Dec 16 14:03:37 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: rumphijack.3,v 1.12 2011/03/14 15:21:22 pooka Exp $
+.\" $NetBSD: rumphijack.3,v 1.13 2018/12/16 14:03:37 hannken Exp $
 .\"
 .\" Copyright (c) 2011 Antti Kantee.  All rights reserved.
 .\"
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 14, 2011
+.Dd December 16, 2018
 .Dt RUMPHIJACK 3
 .Os
 .Sh NAME
@@ -173,6 +173,15 @@ Acceptable values are
 and
 .Dq no ,
 meaning to call the rump or the host kernel, respectively.
+.It Dq modctl
+Direct the
+.Fn modctl
+call to the rump kernel.
+Acceptable values are
+.Dq yes
+and
+.Dq no ,
+meaning to call the rump or the host kernel, respectively.
 .It Dq fdoff
 Adjust the library's fd offset to the specified value.
 All rump kernel descriptors have the offset added to them



CVS commit: src/usr.sbin/sysinst

2018-12-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec 16 11:40:09 UTC 2018

Modified Files:
src/usr.sbin/sysinst: main.c

Log Message:
Editor mishap in previous, pointed out by leot


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/main.c

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

Modified files:

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.14 src/usr.sbin/sysinst/main.c:1.15
--- src/usr.sbin/sysinst/main.c:1.14	Sun Dec 16 11:36:08 2018
+++ src/usr.sbin/sysinst/main.c	Sun Dec 16 11:40:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.14 2018/12/16 11:36:08 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.15 2018/12/16 11:40:09 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -88,7 +88,7 @@ struct f_arg {
 static const struct f_arg fflagopts[] = {
 	{"release", REL, rel, sizeof rel},
 	{"machine", MACH, machine, sizeof machine},
-	{"xfer dir", "/unsr/INSTALL", xfer_dir, sizeof xfer_dir},
+	{"xfer dir", "/usr/INSTALL", xfer_dir, sizeof xfer_dir},
 	{"ext dir", "", ext_dir_bin, sizeof ext_dir_bin},
 	{"ext src dir", "", ext_dir_src, sizeof ext_dir_src},
 	{"ftp host", SYSINST_FTP_HOST, ftp.xfer_host[XFER_FTP], sizeof ftp.xfer_host[XFER_FTP]},



CVS commit: src/usr.sbin/sysinst

2018-12-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec 16 11:36:08 UTC 2018

Modified Files:
src/usr.sbin/sysinst: Makefile.inc defs.h main.c

Log Message:
Separate binary sets and binary pkg prefix from the machine, and set
it explicitly for evbarm*, evbmips* and evbsh3 so we get the correct
64bit pkgs on aarch64 and also have working defaults on the other
variants.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/main.c

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

Modified files:

Index: src/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.14 src/usr.sbin/sysinst/Makefile.inc:1.15
--- src/usr.sbin/sysinst/Makefile.inc:1.14	Sat Oct  6 18:45:37 2018
+++ src/usr.sbin/sysinst/Makefile.inc	Sun Dec 16 11:36:08 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2018/10/06 18:45:37 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2018/12/16 11:36:08 martin Exp $
 #
 # Makefile for sysinst
 
@@ -57,6 +57,13 @@ CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.C
 		${NODISKLABEL:D-DNO_DISKLABEL} \
 		${NOPARTMAN:D-DNO_PARTMAN}
 
+.if ${MACHINE} == "evbarm"
+|| ${MACHINE} == "evbmips"
+|| ${MACHINE} == "evbsh3"
+CPPFLAGS+=	-DARCH_SUBDIR="\"${MACHINE}-${MACHINE_ARCH}\""
+CPPFLAGS+=	-DPKG_ARCH_SUBDIR="\"${MACHINE_ARCH}\""
+.endif
+
 .if defined(NETBSD_OFFICIAL_RELEASE) && ${NETBSD_OFFICIAL_RELEASE} == "yes"
 CPPFLAGS+= -DSYSINST_FTP_HOST=\"ftp.NetBSD.org\" -DNETBSD_OFFICIAL_RELEASE
 CPPFLAGS+= -DSYSINST_HTTP_HOST=\"cdn.NetBSD.org\" -DNETBSD_OFFICIAL_RELEASE

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.28 src/usr.sbin/sysinst/defs.h:1.29
--- src/usr.sbin/sysinst/defs.h:1.28	Tue Nov 27 17:13:41 2018
+++ src/usr.sbin/sysinst/defs.h	Sun Dec 16 11:36:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.28 2018/11/27 17:13:41 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.29 2018/12/16 11:36:08 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -362,6 +362,13 @@ int  clean_xfer_dir;
 #endif
 #endif
 
+#if !defined(ARCH_SUBDIR)
+#define	ARCH_SUBDIR	MACH
+#endif
+#if !defined(PKG_ARCH_SUBDIR)
+#define	PKG_ARCH_SUBDIR	MACH
+#endif
+
 #if !defined(SYSINST_PKG_HOST)
 #define SYSINST_PKG_HOST	"ftp.NetBSD.org"
 #endif

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.13 src/usr.sbin/sysinst/main.c:1.14
--- src/usr.sbin/sysinst/main.c:1.13	Wed Nov  7 21:20:23 2018
+++ src/usr.sbin/sysinst/main.c	Sun Dec 16 11:36:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.13 2018/11/07 21:20:23 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.14 2018/12/16 11:36:08 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -88,13 +88,13 @@ struct f_arg {
 static const struct f_arg fflagopts[] = {
 	{"release", REL, rel, sizeof rel},
 	{"machine", MACH, machine, sizeof machine},
-	{"xfer dir", "/usr/INSTALL", xfer_dir, sizeof xfer_dir},
+	{"xfer dir", "/unsr/INSTALL", xfer_dir, sizeof xfer_dir},
 	{"ext dir", "", ext_dir_bin, sizeof ext_dir_bin},
 	{"ext src dir", "", ext_dir_src, sizeof ext_dir_src},
 	{"ftp host", SYSINST_FTP_HOST, ftp.xfer_host[XFER_FTP], sizeof ftp.xfer_host[XFER_FTP]},
 	{"http host", SYSINST_HTTP_HOST, ftp.xfer_host[XFER_HTTP], sizeof ftp.xfer_host[XFER_HTTP]},
 	{"ftp dir", SYSINST_FTP_DIR, ftp.dir, sizeof ftp.dir},
-	{"ftp prefix", "/" MACH "/binary/sets", set_dir_bin, sizeof set_dir_bin},
+	{"ftp prefix", "/" ARCH_SUBDIR "/binary/sets", set_dir_bin, sizeof set_dir_bin},
 	{"ftp src prefix", "/source/sets", set_dir_src, sizeof set_dir_src},
 	{"ftp user", "ftp", ftp.user, sizeof ftp.user},
 	{"ftp pass", "", ftp.pass, sizeof ftp.pass},
@@ -113,7 +113,7 @@ static const struct f_arg fflagopts[] = 
 	{"pkg host", SYSINST_PKG_HOST, pkg.xfer_host[XFER_FTP], sizeof pkg.xfer_host[XFER_FTP]},
 	{"pkg http host", SYSINST_PKG_HTTP_HOST, pkg.xfer_host[XFER_HTTP], sizeof pkg.xfer_host[XFER_HTTP]},
 	{"pkg dir", SYSINST_PKG_DIR, pkg.dir, sizeof pkg.dir},
-	{"pkg prefix", "/" MACH "/" PKG_SUBDIR "/All", pkg_dir, sizeof pkg_dir},
+	{"pkg prefix", "/" PKG_ARCH_SUBDIR "/" PKG_SUBDIR "/All", pkg_dir, sizeof pkg_dir},
 	{"pkg user", "ftp", pkg.user, sizeof pkg.user},
 	{"pkg pass", "", pkg.pass, sizeof pkg.pass},
 	{"pkg proxy", "", pkg.proxy, sizeof pkg.proxy},



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

2018-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Dec 16 10:42:32 UTC 2018

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

Log Message:
Explicitly disable ALTINST on VIA, in case it isn't disabled by default
already (the 'VIA cpu backdoor').


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/identcpu.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/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.83 src/sys/arch/x86/x86/identcpu.c:1.84
--- src/sys/arch/x86/x86/identcpu.c:1.83	Mon Nov 19 22:21:32 2018
+++ src/sys/arch/x86/x86/identcpu.c	Sun Dec 16 10:42:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.83 2018/11/19 22:21:32 jdolecek Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.84 2018/12/16 10:42:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.83 2018/11/19 22:21:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.84 2018/12/16 10:42:32 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -601,6 +601,12 @@ cpu_probe_c3(struct cpu_info *ci)
 		}
 	}
 
+	/* Explicitly disable unsafe ALTINST mode. */
+	if (ci->ci_feat_val[4] & CPUID_VIA_DO_ACE) {
+		msr = rdmsr(MSR_VIA_ACE);
+		wrmsr(MSR_VIA_ACE, msr & ~VIA_ACE_ALTINST);
+	} 
+
 	/*
 	 * Determine L1 cache/TLB info.
 	 */



CVS commit: src/distrib/amd64/liveimage/emuimage

2018-12-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Dec 16 08:58:21 UTC 2018

Modified Files:
src/distrib/amd64/liveimage/emuimage: Makefile

Log Message:
Fix previous: set EMUIMAGEMB, not USBIMAGEMB.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/amd64/liveimage/emuimage/Makefile

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

Modified files:

Index: src/distrib/amd64/liveimage/emuimage/Makefile
diff -u src/distrib/amd64/liveimage/emuimage/Makefile:1.4 src/distrib/amd64/liveimage/emuimage/Makefile:1.5
--- src/distrib/amd64/liveimage/emuimage/Makefile:1.4	Sat Dec 15 18:03:17 2018
+++ src/distrib/amd64/liveimage/emuimage/Makefile	Sun Dec 16 08:58:21 2018
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.4 2018/12/15 18:03:17 gson Exp $
+#	$NetBSD: Makefile,v 1.5 2018/12/16 08:58:21 gson Exp $
 
 LIVEIMGBASE=	NetBSD-${DISTRIBVER}-amd64-live	# gives ${IMGBASE}.img
 
-USBIMAGEMB?=	1536	# 2GB USB flash memories aren't 2GiB
+EMUIMAGEMB?=	1536	# 2GB USB flash memories aren't 2GiB
 LIVEIMAGEMB=	${EMUIMAGEMB}
 
 .include "${.CURDIR}/../Makefile.liveimage"



CVS commit: src/sys/netinet6

2018-12-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Dec 16 08:54:58 UTC 2018

Modified Files:
src/sys/netinet6: nd6.c

Log Message:
netinet6: only flush prefixes and routers for the given interface.

Unless it's lo0, where we then flush the lot.
The maintains the status-quo with ndp(8) and allows dhcpcd(8) to at least
try and work with kernel RA on one interface and dhcpcd on another.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/netinet6/nd6.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/nd6.c
diff -u src/sys/netinet6/nd6.c:1.251 src/sys/netinet6/nd6.c:1.252
--- src/sys/netinet6/nd6.c:1.251	Tue Oct 30 05:54:41 2018
+++ src/sys/netinet6/nd6.c	Sun Dec 16 08:54:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.251 2018/10/30 05:54:41 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.252 2018/12/16 08:54:58 roy Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.251 2018/10/30 05:54:41 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.252 2018/12/16 08:54:58 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1884,6 +1884,10 @@ nd6_ioctl(u_long cmd, void *data, struct
 			struct in6_ifaddr *ia, *ia_next;
 			int _s;
 
+			/* Only flush prefixes for the given interface. */
+			if (ifp != lo0ifp && ifp != pfx->ndpr_ifp)
+continue;
+
 			if (IN6_IS_ADDR_LINKLOCAL(&pfx->ndpr_prefix.sin6_addr))
 continue; /* XXX */
 
@@ -1953,8 +1957,15 @@ nd6_ioctl(u_long cmd, void *data, struct
 		struct nd_defrouter *drtr, *next;
 
 		ND6_WLOCK();
+#if 0
+		/* XXX Is this really needed? */
 		nd6_defrouter_reset();
+#endif
 		ND_DEFROUTER_LIST_FOREACH_SAFE(drtr, next) {
+			/* Only flush routers for the given interface. */
+			if (ifp != lo0ifp && ifp != drtr->ifp)
+continue;
+
 			nd6_defrtrlist_del(drtr, NULL);
 		}
 		nd6_defrouter_select();



CVS commit: src/usr.sbin/ndp

2018-12-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Dec 16 08:47:43 UTC 2018

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

Log Message:
ndp: SIOCSPFXFLUSH_IN6 and SIOCSRTRFLUSH_IN6 expect struct in6_ifreq

And not just a character string of the interface name.
This only worked before because the interface name is the first member
of the structure.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/ndp/ndp.c

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

Modified files:

Index: src/usr.sbin/ndp/ndp.c
diff -u src/usr.sbin/ndp/ndp.c:1.54 src/usr.sbin/ndp/ndp.c:1.55
--- src/usr.sbin/ndp/ndp.c:1.54	Thu Jul 12 08:20:49 2018
+++ src/usr.sbin/ndp/ndp.c	Sun Dec 16 08:47:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ndp.c,v 1.54 2018/07/12 08:20:49 nonaka Exp $	*/
+/*	$NetBSD: ndp.c,v 1.55 2018/12/16 08:47:43 roy Exp $	*/
 /*	$KAME: ndp.c,v 1.121 2005/07/13 11:30:13 keiichi Exp $	*/
 
 /*
@@ -1400,13 +1400,14 @@ plist(void)
 static void
 pfx_flush(void)
 {
-	char dummyif[IFNAMSIZ+8];
 	int s;
+	struct in6_ifreq ifr;
 
 	if ((s = prog_socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
 		err(1, "socket");
-	(void)strlcpy(dummyif, "lo0", sizeof(dummyif)); /* dummy */
-	if (prog_ioctl(s, SIOCSPFXFLUSH_IN6, (caddr_t)&dummyif) < 0)
+	memset(&ifr, 0, sizeof(ifr));
+	strcpy(ifr.ifr_name, "lo0");
+	if (prog_ioctl(s, SIOCSPFXFLUSH_IN6, &ifr) < 0)
 		err(1, "ioctl(SIOCSPFXFLUSH_IN6)");
 	(void)prog_close(s);
 }
@@ -1414,15 +1415,15 @@ pfx_flush(void)
 static void
 rtr_flush(void)
 {
-	char dummyif[IFNAMSIZ+8];
 	int s;
+	struct in6_ifreq ifr;
 
 	if ((s = prog_socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
 		err(1, "socket");
-	(void)strlcpy(dummyif, "lo0", sizeof(dummyif)); /* dummy */
-	if (prog_ioctl(s, SIOCSRTRFLUSH_IN6, (caddr_t)&dummyif) < 0)
+	memset(&ifr, 0, sizeof(ifr));
+	strcpy(ifr.ifr_name, "lo0");
+	if (prog_ioctl(s, SIOCSRTRFLUSH_IN6, &ifr) < 0)
 		err(1, "ioctl(SIOCSRTRFLUSH_IN6)");
-
 	(void)prog_close(s);
 }
 



CVS commit: src/doc

2018-12-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 16 08:19:51 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
Note NVIDIA Tegra X1 SoC SATA support


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2465 src/doc/CHANGES:1.2466
--- src/doc/CHANGES:1.2465	Wed Dec 12 23:40:02 2018
+++ src/doc/CHANGES	Sun Dec 16 08:19:51 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2465 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2466 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -264,3 +264,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	sh(1): Many bug fixes and enhancements.  [kre 20181212]
 	amdtemp(4): Add support for AMD family 16h temperature sensors.
 		[is 20181213]
+	arm: Add support for NVIDIA Tegra X1 SoC SATA. [skrll 20181214]