CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul 30 05:58:15 UTC 2016

Modified Files:
src/sys/arch/mips/mips: vm_machdep.c

Log Message:
KASSERT for KX in __mips_n32 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/mips/mips/vm_machdep.c

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



CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul 30 05:58:15 UTC 2016

Modified Files:
src/sys/arch/mips/mips: vm_machdep.c

Log Message:
KASSERT for KX in __mips_n32 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/mips/mips/vm_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.147 src/sys/arch/mips/mips/vm_machdep.c:1.148
--- src/sys/arch/mips/mips/vm_machdep.c:1.147	Thu Jul 14 04:49:55 2016
+++ src/sys/arch/mips/mips/vm_machdep.c	Sat Jul 30 05:58:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.147 2016/07/14 04:49:55 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.148 2016/07/30 05:58:15 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.147 2016/07/14 04:49:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.148 2016/07/30 05:58:15 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_coredump.h"
@@ -143,7 +143,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	pcb2->pcb_context.val[_L_SP] = (intptr_t)tf;			/* SP */
 	pcb2->pcb_context.val[_L_RA] =
 	   mips_locore_jumpvec.ljv_lwp_trampoline;			/* RA */
-#ifdef _LP64
+#if defined(_LP64) || defined(__mips_n32)
 	KASSERT(pcb2->pcb_context.val[_L_SR] & MIPS_SR_KX);
 #endif
 	KASSERTMSG(pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE,



CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 05:55:34 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Fix typo.  N32 doesn't want UX on.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.273 src/sys/arch/mips/mips/mips_machdep.c:1.274
--- src/sys/arch/mips/mips/mips_machdep.c:1.273	Mon Jul 25 22:10:03 2016
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jul 30 05:55:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.273 2016/07/25 22:10:03 macallan Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.274 2016/07/30 05:55:34 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.273 2016/07/25 22:10:03 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.274 2016/07/30 05:55:34 matt Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2069,9 +2069,9 @@ mips_init_lwp0_uarea(void)
 
 	pcb->pcb_context.val[_L_SR] = MIPS_SR_INT_IE
 	| (ipl_sr_map.sr_bits[IPL_SCHED] ^ MIPS_INT_MASK);
-#ifdef _mips_n32
-	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX | MIPS_SR_UX;
-	l->l_md.md_utf->tf_regs[_R_SR] = MIPS_SR_KX | MIPS_SR_UX;
+#ifdef __mips_n32
+	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX;
+	l->l_md.md_utf->tf_regs[_R_SR] = MIPS_SR_KX;
 #endif
 #ifdef _LP64
 	pcb->pcb_context.val[_L_SR] |= MIPS_SR_KX | MIPS_SR_UX;



CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jul 30 05:55:34 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Fix typo.  N32 doesn't want UX on.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/mips/mips/mips_machdep.c

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



CVS commit: src/sys/net

2016-07-29 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Fri Jul 29 20:29:38 UTC 2016

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

Log Message:
Don't trigger BJ_ASSERT(false) on invalid BPF_Jxxx opcode in jmp_to_op().

This change helps survive AFL fuzzing without calling bpf_validate() first.

Also change alu_to_op() function to have a similar interface.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/net/bpfjit.c

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

Modified files:

Index: src/sys/net/bpfjit.c
diff -u src/sys/net/bpfjit.c:1.45 src/sys/net/bpfjit.c:1.46
--- src/sys/net/bpfjit.c:1.45	Sun May 29 17:20:22 2016
+++ src/sys/net/bpfjit.c	Fri Jul 29 20:29:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpfjit.c,v 1.45 2016/05/29 17:20:22 alnsn Exp $	*/
+/*	$NetBSD: bpfjit.c,v 1.46 2016/07/29 20:29:38 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 2011-2015 Alexander Nasonov.
@@ -31,9 +31,9 @@
 
 #include 
 #ifdef _KERNEL
-__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.45 2016/05/29 17:20:22 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.46 2016/07/29 20:29:38 alnsn Exp $");
 #else
-__RCSID("$NetBSD: bpfjit.c,v 1.45 2016/05/29 17:20:22 alnsn Exp $");
+__RCSID("$NetBSD: bpfjit.c,v 1.46 2016/07/29 20:29:38 alnsn Exp $");
 #endif
 
 #include 
@@ -1594,10 +1594,9 @@ optimize(const bpf_ctx_t *bc, const stru
 /*
  * Convert BPF_ALU operations except BPF_NEG and BPF_DIV to sljit operation.
  */
-static int
-bpf_alu_to_sljit_op(const struct bpf_insn *pc)
+static bool
+alu_to_op(const struct bpf_insn *pc, int *res)
 {
-	const int bad = SLJIT_UNUSED;
 	const uint32_t k = pc->k;
 
 	/*
@@ -1605,49 +1604,64 @@ bpf_alu_to_sljit_op(const struct bpf_ins
 	 * instruction so SLJIT_I32_OP doesn't have any overhead.
 	 */
 	switch (BPF_OP(pc->code)) {
-	case BPF_ADD: return SLJIT_ADD;
-	case BPF_SUB: return SLJIT_SUB;
-	case BPF_MUL: return SLJIT_MUL|SLJIT_I32_OP;
-	case BPF_OR:  return SLJIT_OR;
-	case BPF_XOR: return SLJIT_XOR;
-	case BPF_AND: return SLJIT_AND;
-	case BPF_LSH: return (k > 31) ? bad : SLJIT_SHL;
-	case BPF_RSH: return (k > 31) ? bad : SLJIT_LSHR|SLJIT_I32_OP;
+	case BPF_ADD:
+		*res = SLJIT_ADD;
+		return true;
+	case BPF_SUB:
+		*res = SLJIT_SUB;
+		return true;
+	case BPF_MUL:
+		*res = SLJIT_MUL|SLJIT_I32_OP;
+		return true;
+	case BPF_OR:
+		*res = SLJIT_OR;
+		return true;
+	case BPF_XOR:
+		*res = SLJIT_XOR;
+		return true;
+	case BPF_AND:
+		*res = SLJIT_AND;
+		return true;
+	case BPF_LSH:
+		*res = SLJIT_SHL;
+		return k < 32;
+	case BPF_RSH:
+		*res = SLJIT_LSHR|SLJIT_I32_OP;
+		return k < 32;
 	default:
-		return bad;
+		return false;
 	}
 }
 
 /*
  * Convert BPF_JMP operations except BPF_JA to sljit condition.
  */
-static int
-bpf_jmp_to_sljit_cond(const struct bpf_insn *pc, bool negate)
+static bool
+jmp_to_cond(const struct bpf_insn *pc, bool negate, int *res)
 {
+
 	/*
 	 * Note: all supported 64bit arches have 32bit comparison
 	 * instructions so SLJIT_I32_OP doesn't have any overhead.
 	 */
-	int rv = SLJIT_I32_OP;
+	*res = SLJIT_I32_OP;
 
 	switch (BPF_OP(pc->code)) {
 	case BPF_JGT:
-		rv |= negate ? SLJIT_LESS_EQUAL : SLJIT_GREATER;
-		break;
+		*res |= negate ? SLJIT_LESS_EQUAL : SLJIT_GREATER;
+		return true;
 	case BPF_JGE:
-		rv |= negate ? SLJIT_LESS : SLJIT_GREATER_EQUAL;
-		break;
+		*res |= negate ? SLJIT_LESS : SLJIT_GREATER_EQUAL;
+		return true;
 	case BPF_JEQ:
-		rv |= negate ? SLJIT_NOT_EQUAL : SLJIT_EQUAL;
-		break;
+		*res |= negate ? SLJIT_NOT_EQUAL : SLJIT_EQUAL;
+		return true;
 	case BPF_JSET:
-		rv |= negate ? SLJIT_EQUAL : SLJIT_NOT_EQUAL;
-		break;
+		*res |= negate ? SLJIT_EQUAL : SLJIT_NOT_EQUAL;
+		return true;
 	default:
-		BJ_ASSERT(false);
+		return false;
 	}
-
-	return rv;
 }
 
 /*
@@ -1695,9 +1709,9 @@ generate_insn_code(struct sljit_compiler
 	struct sljit_jump *to_mchain_jump;
 
 	size_t i;
-	int status;
-	int branching, negate;
 	unsigned int rval, mode, src, op;
+	int branching, negate;
+	int status, cond, op2;
 	uint32_t jt, jf;
 
 	bool unconditional_ret;
@@ -1935,10 +1949,9 @@ generate_insn_code(struct sljit_compiler
 
 			op = BPF_OP(pc->code);
 			if (op != BPF_DIV && op != BPF_MOD) {
-const int op2 = bpf_alu_to_sljit_op(pc);
-
-if (op2 == SLJIT_UNUSED)
+if (!alu_to_op(pc, ))
 	goto fail;
+
 status = sljit_emit_op2(compiler,
 op2, BJ_AREG, 0, BJ_AREG, 0,
 kx_to_reg(pc), kx_to_reg_arg(pc));
@@ -2005,9 +2018,10 @@ generate_insn_code(struct sljit_compiler
 
 			if (branching) {
 if (op != BPF_JSET) {
+	if (!jmp_to_cond(pc, negate, ))
+		goto fail;
 	jump = sljit_emit_cmp(compiler,
-	bpf_jmp_to_sljit_cond(pc, negate),
-	BJ_AREG, 0,
+	cond, BJ_AREG, 0,
 	kx_to_reg(pc), kx_to_reg_arg(pc));
 } else {
 	status = sljit_emit_op2(compiler,
@@ -2018,10 +2032,10 @@ generate_insn_code(struct sljit_compiler
 	if (status != SLJIT_SUCCESS)
 		goto fail;
 
+	if (!jmp_to_cond(pc, 

CVS commit: src/sys/net

2016-07-29 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Fri Jul 29 20:29:38 UTC 2016

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

Log Message:
Don't trigger BJ_ASSERT(false) on invalid BPF_Jxxx opcode in jmp_to_op().

This change helps survive AFL fuzzing without calling bpf_validate() first.

Also change alu_to_op() function to have a similar interface.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/net/bpfjit.c

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



CVS commit: src/tests/dev/fss

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 20:27:37 UTC 2016

Modified Files:
src/tests/dev/fss: t_fss.sh

Log Message:
Mount the snapshot read-only; otherwise we get a nasty panic.

Re-order the clean-up steps to properly undo what we did.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/fss/t_fss.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/dev/fss/t_fss.sh
diff -u src/tests/dev/fss/t_fss.sh:1.1 src/tests/dev/fss/t_fss.sh:1.2
--- src/tests/dev/fss/t_fss.sh:1.1	Fri Jul 29 06:13:39 2016
+++ src/tests/dev/fss/t_fss.sh	Fri Jul 29 20:27:37 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_fss.sh,v 1.1 2016/07/29 06:13:39 pgoyette Exp $
+# $NetBSD: t_fss.sh,v 1.2 2016/07/29 20:27:37 pgoyette Exp $
 #
 # Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -52,7 +52,7 @@ basic_body() {
 # configure and mount a snapshot of the file system
 
 	fssconfig -c fss0 ./m1 ./backup
-	mount /dev/fss0 ./m2
+	mount -o rdonly /dev/fss0 ./m2
 
 # Modify the data on the underlying file system
 
@@ -65,15 +65,17 @@ basic_body() {
 
 # Unmount our temporary stuff
 
-	umount /dev/vnd0a	|| true
 	umount /dev/fss0	|| true
+	fssconfig -u fss0	|| true
+	umount /dev/vnd0a	|| true
+	vndconfig -u vnd0	|| true
 }
 
 basic_cleanup() {
 	umount /dev/vnd0a	|| true
+	fssconfig -u fss0	|| true
 	umount /dev/fss0	|| true
 	vndconfig -u vnd0	|| true
-	fssconfig -u fss0	|| true
 }
 
 atf_init_test_cases()



CVS commit: src/tests/dev/fss

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 20:27:37 UTC 2016

Modified Files:
src/tests/dev/fss: t_fss.sh

Log Message:
Mount the snapshot read-only; otherwise we get a nasty panic.

Re-order the clean-up steps to properly undo what we did.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/fss/t_fss.sh

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



CVS commit: src/share/man/man9

2016-07-29 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Fri Jul 29 19:27:45 UTC 2016

Modified Files:
src/share/man/man9: scsipi.9

Log Message:
scsipi(9): Removed duplicate "for"


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/scsipi.9

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



CVS commit: src/share/man/man9

2016-07-29 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Fri Jul 29 19:27:45 UTC 2016

Modified Files:
src/share/man/man9: scsipi.9

Log Message:
scsipi(9): Removed duplicate "for"


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/scsipi.9

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/man9/scsipi.9
diff -u src/share/man/man9/scsipi.9:1.27 src/share/man/man9/scsipi.9:1.28
--- src/share/man/man9/scsipi.9:1.27	Wed Jun  1 08:17:47 2016
+++ src/share/man/man9/scsipi.9	Fri Jul 29 19:27:45 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: scsipi.9,v 1.27 2016/06/01 08:17:47 wiz Exp $
+.\"	$NetBSD: scsipi.9,v 1.28 2016/07/29 19:27:45 palle Exp $
 .\"
 .\"
 .\" Copyright (c) 2001 Manuel Bouyer.
@@ -339,7 +339,7 @@ This request is called from the kernel c
 .Fa arg
 must be ignored.
 .It Dv ADAPTER_REQ_SET_XFER_MODE
-set the xfer mode for a for I_T Nexus.
+set the xfer mode for a I_T Nexus.
 This will be called once all LUNs of a target have been probed.
 .Fa arg
 points to a



CVS commit: src/external/bsd/blacklist/lib

2016-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 29 17:13:09 UTC 2016

Modified Files:
src/external/bsd/blacklist/lib: bl.c

Log Message:
Use %s+strerro(errno) instead of %m (From Kurt Lidl)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/blacklist/lib/bl.c

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

Modified files:

Index: src/external/bsd/blacklist/lib/bl.c
diff -u src/external/bsd/blacklist/lib/bl.c:1.27 src/external/bsd/blacklist/lib/bl.c:1.28
--- src/external/bsd/blacklist/lib/bl.c:1.27	Wed Dec 30 11:42:48 2015
+++ src/external/bsd/blacklist/lib/bl.c	Fri Jul 29 13:13:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bl.c,v 1.27 2015/12/30 16:42:48 christos Exp $	*/
+/*	$NetBSD: bl.c,v 1.28 2016/07/29 17:13:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: bl.c,v 1.27 2015/12/30 16:42:48 christos Exp $");
+__RCSID("$NetBSD: bl.c,v 1.28 2016/07/29 17:13:09 christos Exp $");
 
 #include 
 #include 
@@ -152,8 +152,8 @@ bl_init(bl_t b, bool srv)
 		b->b_fd = socket(PF_LOCAL,
 		SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_NOSIGPIPE, 0);
 		if (b->b_fd == -1) {
-			bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%m)",
-			__func__);
+			bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%s)",
+			__func__, strerror(errno));
 			BL_UNLOCK(b);
 			return -1;
 		}
@@ -200,8 +200,8 @@ bl_init(bl_t b, bool srv)
 			 */
 			if (b->b_connected != 1) {
 bl_log(b->b_fun, LOG_DEBUG,
-"%s: connect failed for `%s' (%m)",
-__func__, sun->sun_path);
+"%s: connect failed for `%s' (%s)",
+__func__, sun->sun_path, strerror(errno));
 b->b_connected = 1;
 			}
 			BL_UNLOCK(b);
@@ -220,8 +220,8 @@ bl_init(bl_t b, bool srv)
 		errno = serrno;
 		if (rv == -1) {
 			bl_log(b->b_fun, LOG_ERR,
-			"%s: bind failed for `%s' (%m)",
-			__func__, sun->sun_path);
+			"%s: bind failed for `%s' (%s)",
+			__func__, sun->sun_path, strerror(errno));
 			goto out;
 		}
 	}
@@ -260,7 +260,8 @@ bl_init(bl_t b, bool srv)
 	if (setsockopt(b->b_fd, CRED_LEVEL, CRED_NAME,
 	, (socklen_t)sizeof(one)) == -1) {
 		bl_log(b->b_fun, LOG_ERR, "%s: setsockopt %s "
-		"failed (%m)", __func__, __STRING(CRED_NAME));
+		"failed (%s)", __func__, __STRING(CRED_NAME),
+		strerror(errno));
 		goto out;
 	}
 #endif
@@ -296,7 +297,8 @@ bl_create(bool srv, const char *path, vo
 	return b;
 out:
 	free(b);
-	bl_log(fun, LOG_ERR, "%s: malloc failed (%m)", __func__);
+	bl_log(fun, LOG_ERR, "%s: malloc failed (%s)", __func__,
+	strerror(errno));
 	return NULL;
 }
 
@@ -451,7 +453,8 @@ bl_recv(bl_t b)
 
 rlen = recvmsg(b->b_fd, , 0);
 if (rlen == -1) {
-		bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%m)", __func__);
+		bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%s)", __func__,
+		strerror(errno));
 		return NULL;
 }
 



CVS commit: src/external/bsd/blacklist/lib

2016-07-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 29 17:13:09 UTC 2016

Modified Files:
src/external/bsd/blacklist/lib: bl.c

Log Message:
Use %s+strerro(errno) instead of %m (From Kurt Lidl)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/blacklist/lib/bl.c

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



CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 15:43:02 UTC 2016

Modified Files:
src/sys/arch/mips/mips: pmap_machdep.c

Log Message:
Fix up va for pmap_md_map_ephemeral_page and so that cache ops get the
correct address


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

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



CVS commit: src/sys/arch/mips/mips

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 15:43:02 UTC 2016

Modified Files:
src/sys/arch/mips/mips: pmap_machdep.c

Log Message:
Fix up va for pmap_md_map_ephemeral_page and so that cache ops get the
correct address


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/mips/pmap_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/mips/mips/pmap_machdep.c
diff -u src/sys/arch/mips/mips/pmap_machdep.c:1.1 src/sys/arch/mips/mips/pmap_machdep.c:1.2
--- src/sys/arch/mips/mips/pmap_machdep.c:1.1	Mon Jul 11 16:15:36 2016
+++ src/sys/arch/mips/mips/pmap_machdep.c	Fri Jul 29 15:43:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_machdep.c,v 1.1 2016/07/11 16:15:36 matt Exp $	*/
+/*	$NetBSD: pmap_machdep.c,v 1.2 2016/07/29 15:43:02 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.1 2016/07/11 16:15:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.2 2016/07/29 15:43:02 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -181,7 +181,7 @@ pmap_md_map_ephemeral_page(struct vm_pag
 	KASSERT(!locked_p || VM_PAGEMD_PVLIST_LOCKED_P(mdpg));
 
 	if (!MIPS_CACHE_VIRTUAL_ALIAS || !mips_cache_badalias(pv->pv_va, pa)) {
-#ifndef __mips_o32
+#ifdef _LP64
 		va = MIPS_PHYS_TO_XKPHYS_CACHED(pa);
 #else
 		if (pa < MIPS_PHYS_MASK) {
@@ -198,13 +198,14 @@ pmap_md_map_ephemeral_page(struct vm_pag
 		struct cpu_info * const ci = curcpu();
 		KASSERT(ci->ci_pmap_dstbase != 0);
 
-		va = (prot & VM_PROT_WRITE
+		vaddr_t nva = (prot & VM_PROT_WRITE
 			? ci->ci_pmap_dstbase
 			: ci->ci_pmap_srcbase)
 		+ mips_cache_indexof(MIPS_CACHE_VIRTUAL_ALIAS
 			? pv->pv_va
 			: pa);
 
+		va = (intptr_t)nva;
 		/*
 		 * Now to make and write the new PTE to map the PA.
 		 */
@@ -229,8 +230,8 @@ pmap_md_map_ephemeral_page(struct vm_pag
 			(void)VM_PAGEMD_PVLIST_READLOCK(mdpg);
 		if (VM_PAGEMD_CACHED_P(mdpg)
 		&& mips_cache_badalias(pv->pv_va, va)) {
-			mips_dcache_wbinv_range_index(trunc_page(pv->pv_va),
-			PAGE_SIZE);
+			register_t ova = (intptr_t)trunc_page(pv->pv_va);
+			mips_dcache_wbinv_range_index(ova, PAGE_SIZE);
 			/*
 			 * If there is no active mapping, remember this new one.
 			 */



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

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 15:38:05 UTC 2016

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
more debug


To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.336 src/sys/arch/arm/arm32/pmap.c:1.337
--- src/sys/arch/arm/arm32/pmap.c:1.336	Fri Jul 29 09:47:09 2016
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jul 29 15:38:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.336 2016/07/29 09:47:09 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.337 2016/07/29 15:38:05 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.336 2016/07/29 09:47:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.337 2016/07/29 15:38:05 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -5000,6 +5000,11 @@ void
 pmap_update(pmap_t pm)
 {
 
+	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
+
+	UVMHIST_LOG(maphist, "pm=%#x remove_all %d", pm, pm->pm_remove_all, 0,
+	0);
+
 	if (pm->pm_remove_all) {
 #ifdef ARM_MMU_EXTENDED
 		KASSERT(pm != pmap_kernel());
@@ -5090,6 +5095,7 @@ pmap_update(pmap_t pm)
 	 * make sure TLB/cache operations have completed.
 	 */
 	cpu_cpwait();
+	UVMHIST_LOG(maphist, "  <-- done", 0, 0, 0, 0);
 }
 
 void
@@ -5115,11 +5121,16 @@ pmap_remove_all(pmap_t pm)
 void
 pmap_destroy(pmap_t pm)
 {
+	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
+
 	u_int count;
 
 	if (pm == NULL)
 		return;
 
+	UVMHIST_LOG(maphist, "pm=%#x remove_all %d", pm, pm->pm_remove_all, 0,
+	0);
+
 	if (pm->pm_remove_all) {
 #ifdef ARM_MMU_EXTENDED
 		pmap_tlb_asid_release_all(pm);
@@ -5176,6 +5187,7 @@ pmap_destroy(pmap_t pm)
 	uvm_obj_destroy(>pm_obj, false);
 	mutex_destroy(>pm_obj_lock);
 	pool_cache_put(_cache, pm);
+	UVMHIST_LOG(maphist, "  <-- done", 0, 0, 0, 0);
 }
 
 



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

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 15:38:05 UTC 2016

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
more debug


To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/sys/arch/arm/arm32/pmap.c

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



CVS commit: [pgoyette-localcount] src/tests/dev/fss

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 10:57:32 UTC 2016

Added Files:
src/tests/dev/fss [pgoyette-localcount]: Makefile t_fss.sh

Log Message:
Import the new fss(4) test here, too


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/tests/dev/fss/Makefile \
src/tests/dev/fss/t_fss.sh

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

Added files:

Index: src/tests/dev/fss/Makefile
diff -u /dev/null src/tests/dev/fss/Makefile:1.1.2.2
--- /dev/null	Fri Jul 29 10:57:32 2016
+++ src/tests/dev/fss/Makefile	Fri Jul 29 10:57:32 2016
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1.2.2 2016/07/29 10:57:32 pgoyette Exp $
+#
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/dev/fss
+
+TESTS_SH=	t_fss
+
+.include 
Index: src/tests/dev/fss/t_fss.sh
diff -u /dev/null src/tests/dev/fss/t_fss.sh:1.1.2.2
--- /dev/null	Fri Jul 29 10:57:32 2016
+++ src/tests/dev/fss/t_fss.sh	Fri Jul 29 10:57:32 2016
@@ -0,0 +1,82 @@
+# $NetBSD: t_fss.sh,v 1.1.2.2 2016/07/29 10:57:32 pgoyette Exp $
+#
+# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
+# 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+#
+
+#
+# Verify basic operation of fss(4) file system snapshot device
+#
+
+orig_data="Original data"
+repl_data="Replacement data"
+
+atf_test_case basic cleanup
+basic_body() {
+
+# create of mount-points for the file system and snapshot
+
+	mkdir ./m1
+	mkdir ./m2
+
+# create a small 4MB file, treat it as a disk, init a file-system on it,
+# and mount it
+
+	dd if=/dev/zero of=./image bs=32k count=64
+	vndconfig -c vnd0 ./image
+	newfs /dev/vnd0a
+	mount /dev/vnd0a ./m1
+
+	echo "${orig_data}" > ./m1/text
+
+# configure and mount a snapshot of the file system
+
+	fssconfig -c fss0 ./m1 ./backup
+	mount /dev/fss0 ./m2
+
+# Modify the data on the underlying file system
+
+	echo "${repl_data}" > ./m1/text || abort
+
+# Verify that original data is still visible in the snapshot
+
+	read test_data < ./m2/text
+	atf_check_equal "${orig_data}" "${test_data}"
+
+# Unmount our temporary stuff
+
+	umount /dev/vnd0a	|| true
+	umount /dev/fss0	|| true
+}
+
+basic_cleanup() {
+	umount /dev/vnd0a	|| true
+	umount /dev/fss0	|| true
+	vndconfig -u vnd0	|| true
+	fssconfig -u fss0	|| true
+}
+
+atf_init_test_cases()
+{
+atf_add_test_case basic
+}



CVS commit: [pgoyette-localcount] src/tests/dev/fss

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 10:57:32 UTC 2016

Added Files:
src/tests/dev/fss [pgoyette-localcount]: Makefile t_fss.sh

Log Message:
Import the new fss(4) test here, too


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/tests/dev/fss/Makefile \
src/tests/dev/fss/t_fss.sh

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



CVS commit: src/etc/mtree

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 10:09:38 UTC 2016

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add the real directory as well as the debug directory.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/etc/mtree/NetBSD.dist.tests

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.128 src/etc/mtree/NetBSD.dist.tests:1.129
--- src/etc/mtree/NetBSD.dist.tests:1.128	Fri Jul 29 09:52:46 2016
+++ src/etc/mtree/NetBSD.dist.tests	Fri Jul 29 10:09:38 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.128 2016/07/29 09:52:46 pgoyette Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.129 2016/07/29 10:09:38 pgoyette Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -187,6 +187,7 @@
 ./usr/tests/dev
 ./usr/tests/dev/audio
 ./usr/tests/dev/cgd
+./usr/tests/dev/fss
 ./usr/tests/dev/md
 ./usr/tests/dev/raidframe
 ./usr/tests/dev/scsipi



CVS commit: src/etc/mtree

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 10:09:38 UTC 2016

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add the real directory as well as the debug directory.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/etc/mtree/NetBSD.dist.tests

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



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

2016-07-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul 29 10:07:58 UTC 2016

Modified Files:
src/external/bsd/dhcpcd/dist: arp.c defs.h dhcp-common.c dhcp.c dhcp6.c
dhcp6.h dhcpcd-run-hooks.8.in dhcpcd.8.in dhcpcd.c dhcpcd.conf.5.in
dhcpcd.h duid.c if-bsd.c if-options.c if-options.h if.c if.h ipv4.c
ipv4.h ipv4ll.c ipv6.c ipv6.h ipv6nd.c ipv6nd.h
src/external/bsd/dhcpcd/dist/dhcpcd-hooks: 20-resolv.conf

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/arp.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/defs.h \
src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/dhcp-common.c \
src/external/bsd/dhcpcd/dist/dhcpcd.h src/external/bsd/dhcpcd/dist/ipv4.h
cvs rdiff -u -r1.43 -r1.44 src/external/bsd/dhcpcd/dist/dhcp.c
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/dhcpcd/dist/dhcp6.c \
src/external/bsd/dhcpcd/dist/if.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/dhcp6.h \
src/external/bsd/dhcpcd/dist/ipv6nd.h
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
cvs rdiff -u -r1.48 -r1.49 src/external/bsd/dhcpcd/dist/dhcpcd.8.in
cvs rdiff -u -r1.35 -r1.36 src/external/bsd/dhcpcd/dist/dhcpcd.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/duid.c
cvs rdiff -u -r1.31 -r1.32 src/external/bsd/dhcpcd/dist/if-bsd.c
cvs rdiff -u -r1.34 -r1.35 src/external/bsd/dhcpcd/dist/if-options.c
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/dhcpcd/dist/if-options.h \
src/external/bsd/dhcpcd/dist/ipv6.c src/external/bsd/dhcpcd/dist/ipv6.h
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/if.h \
src/external/bsd/dhcpcd/dist/ipv4ll.c
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/dhcpcd/dist/ipv4.c
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/dist/ipv6nd.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf

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



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

2016-07-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul 29 10:07:58 UTC 2016

Modified Files:
src/external/bsd/dhcpcd/dist: arp.c defs.h dhcp-common.c dhcp.c dhcp6.c
dhcp6.h dhcpcd-run-hooks.8.in dhcpcd.8.in dhcpcd.c dhcpcd.conf.5.in
dhcpcd.h duid.c if-bsd.c if-options.c if-options.h if.c if.h ipv4.c
ipv4.h ipv4ll.c ipv6.c ipv6.h ipv6nd.c ipv6nd.h
src/external/bsd/dhcpcd/dist/dhcpcd-hooks: 20-resolv.conf

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/arp.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/defs.h \
src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/dhcp-common.c \
src/external/bsd/dhcpcd/dist/dhcpcd.h src/external/bsd/dhcpcd/dist/ipv4.h
cvs rdiff -u -r1.43 -r1.44 src/external/bsd/dhcpcd/dist/dhcp.c
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/dhcpcd/dist/dhcp6.c \
src/external/bsd/dhcpcd/dist/if.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/dhcp6.h \
src/external/bsd/dhcpcd/dist/ipv6nd.h
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
cvs rdiff -u -r1.48 -r1.49 src/external/bsd/dhcpcd/dist/dhcpcd.8.in
cvs rdiff -u -r1.35 -r1.36 src/external/bsd/dhcpcd/dist/dhcpcd.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/duid.c
cvs rdiff -u -r1.31 -r1.32 src/external/bsd/dhcpcd/dist/if-bsd.c
cvs rdiff -u -r1.34 -r1.35 src/external/bsd/dhcpcd/dist/if-options.c
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/dhcpcd/dist/if-options.h \
src/external/bsd/dhcpcd/dist/ipv6.c src/external/bsd/dhcpcd/dist/ipv6.h
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/if.h \
src/external/bsd/dhcpcd/dist/ipv4ll.c
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/dhcpcd/dist/ipv4.c
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/dist/ipv6nd.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/arp.c
diff -u src/external/bsd/dhcpcd/dist/arp.c:1.20 src/external/bsd/dhcpcd/dist/arp.c:1.21
--- src/external/bsd/dhcpcd/dist/arp.c:1.20	Fri Jun 17 19:42:31 2016
+++ src/external/bsd/dhcpcd/dist/arp.c	Fri Jul 29 10:07:57 2016
@@ -1,5 +1,5 @@
 #include 
- __RCSID("$NetBSD: arp.c,v 1.20 2016/06/17 19:42:31 roy Exp $");
+ __RCSID("$NetBSD: arp.c,v 1.21 2016/07/29 10:07:57 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
@@ -122,32 +122,19 @@ arp_report_conflicted(const struct arp_s
 }
 
 static void
-arp_packet(void *arg)
+arp_packet(struct interface *ifp, uint8_t *data, size_t len)
 {
-	struct interface *ifp = arg;
 	const struct interface *ifn;
-	uint8_t buf[ARP_LEN];
 	struct arphdr ar;
 	struct arp_msg arm;
-	ssize_t bytes;
-	struct iarp_state *state;
+	const struct iarp_state *state;
 	struct arp_state *astate, *astaten;
-	unsigned char *hw_s, *hw_t;
-	int flags;
+	uint8_t *hw_s, *hw_t;
 
-	state = ARP_STATE(ifp);
-	flags = 0;
-	bytes = if_readraw(ifp, state->fd, buf, sizeof(buf), );
-	if (bytes == -1) {
-		logger(ifp->ctx, LOG_ERR,
-		"%s: arp if_readrawpacket: %m", ifp->name);
-		arp_close(ifp);
-		return;
-	}
 	/* We must have a full ARP header */
-	if ((size_t)bytes < sizeof(ar))
+	if (len < sizeof(ar))
 		return;
-	memcpy(, buf, sizeof(ar));
+	memcpy(, data, sizeof(ar));
 	/* Families must match */
 	if (ar.ar_hrd != htons(ifp->family))
 		return;
@@ -165,10 +152,10 @@ arp_packet(void *arg)
 		return;
 
 	/* Get pointers to the hardware addreses */
-	hw_s = buf + sizeof(ar);
+	hw_s = data + sizeof(ar);
 	hw_t = hw_s + ar.ar_hln + ar.ar_pln;
 	/* Ensure we got all the data */
-	if ((hw_t + ar.ar_hln + ar.ar_pln) - buf > bytes)
+	if ((size_t)((hw_t + ar.ar_hln + ar.ar_pln) - data) > len)
 		return;
 	/* Ignore messages from ourself */
 	TAILQ_FOREACH(ifn, ifp->ctx->ifaces, next) {
@@ -190,12 +177,39 @@ arp_packet(void *arg)
 	memcpy(_addr, hw_t + ar.ar_hln, ar.ar_pln);
 
 	/* Run the conflicts */
+	state = ARP_CSTATE(ifp);
 	TAILQ_FOREACH_SAFE(astate, >arp_states, next, astaten) {
 		if (astate->conflicted_cb)
 			astate->conflicted_cb(astate, );
 	}
 }
 
+static void
+arp_read(void *arg)
+{
+	struct interface *ifp = arg;
+	const struct iarp_state *state;
+	uint8_t buf[ARP_LEN];
+	int flags;
+	ssize_t bytes;
+
+	/* Some RAW mechanisms are generic file descriptors, not sockets.
+	 * This means we have no kernel call to just get one packet,
+	 * so we have to process the entire buffer. */
+	state = ARP_CSTATE(ifp);
+	flags = 0;
+	while (!(flags & RAW_EOF)) {
+		bytes = if_readraw(ifp, state->fd, buf, sizeof(buf), );
+		if (bytes == -1) {
+			logger(ifp->ctx, LOG_ERR,
+			"%s: arp if_readrawpacket: %m", ifp->name);
+			arp_close(ifp);
+			return;
+		}
+		arp_packet(ifp, buf, (size_t)bytes);
+	}
+}
+
 int
 arp_open(struct interface *ifp)
 {
@@ -209,7 +223,7 @@ 

CVS import: src/external/bsd/dhcpcd/dist

2016-07-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul 29 09:58:33 UTC 2016

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21586

Log Message:
Import dhcpcd-6.11.2 with the following changes:
  *  It's now possible to exclude the vendor-class option.
  *  Fixed a NULL pointer dereference when checking ARP conflicts.
  *  Revert a change in 6.11.1 which causes some packets not to be
 read correctly from the BPF socket.
  *  Commandline options are now applied to profiles.
  *  Simplified route handling on BSD.
  *  Fix expiration of IPv6 routers if a static route was present.
  *  --inactive now starts with all interfaces inactive.
 subsequent calls to dhcpcd can activate/deactivate them.

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-6-11-2

U src/external/bsd/dhcpcd/dist/common.c
U src/external/bsd/dhcpcd/dist/control.c
C src/external/bsd/dhcpcd/dist/dhcpcd.c
C src/external/bsd/dhcpcd/dist/duid.c
U src/external/bsd/dhcpcd/dist/eloop.c
C src/external/bsd/dhcpcd/dist/if.c
C src/external/bsd/dhcpcd/dist/if-options.c
U src/external/bsd/dhcpcd/dist/script.c
C src/external/bsd/dhcpcd/dist/dhcp-common.c
C src/external/bsd/dhcpcd/dist/if-bsd.c
C src/external/bsd/dhcpcd/dist/arp.c
C src/external/bsd/dhcpcd/dist/dhcp.c
C src/external/bsd/dhcpcd/dist/ipv4.c
C src/external/bsd/dhcpcd/dist/ipv4ll.c
C src/external/bsd/dhcpcd/dist/ipv6.c
C src/external/bsd/dhcpcd/dist/ipv6nd.c
C src/external/bsd/dhcpcd/dist/dhcp6.c
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/auth.c
U src/external/bsd/dhcpcd/dist/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in
C src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in
C src/external/bsd/dhcpcd/dist/dhcpcd.8.in
C src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/arp.h
U src/external/bsd/dhcpcd/dist/auth.h
U src/external/bsd/dhcpcd/dist/bpf-filter.h
U src/external/bsd/dhcpcd/dist/common.h
U src/external/bsd/dhcpcd/dist/config.h
U src/external/bsd/dhcpcd/dist/control.h
C src/external/bsd/dhcpcd/dist/defs.h
U src/external/bsd/dhcpcd/dist/dev.h
U src/external/bsd/dhcpcd/dist/dhcp-common.h
U src/external/bsd/dhcpcd/dist/dhcp.h
C src/external/bsd/dhcpcd/dist/dhcp6.h
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h
C src/external/bsd/dhcpcd/dist/dhcpcd.h
U src/external/bsd/dhcpcd/dist/duid.h
U src/external/bsd/dhcpcd/dist/eloop.h
C src/external/bsd/dhcpcd/dist/if-options.h
C src/external/bsd/dhcpcd/dist/if.h
C src/external/bsd/dhcpcd/dist/ipv4.h
U src/external/bsd/dhcpcd/dist/ipv4ll.h
C src/external/bsd/dhcpcd/dist/ipv6.h
C src/external/bsd/dhcpcd/dist/ipv6nd.h
U src/external/bsd/dhcpcd/dist/script.h
U src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c
U src/external/bsd/dhcpcd/dist/crypt/crypt.h
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump
C src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind

25 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2016-07-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jul 29 09:58:33 UTC 2016

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21586

Log Message:
Import dhcpcd-6.11.2 with the following changes:
  *  It's now possible to exclude the vendor-class option.
  *  Fixed a NULL pointer dereference when checking ARP conflicts.
  *  Revert a change in 6.11.1 which causes some packets not to be
 read correctly from the BPF socket.
  *  Commandline options are now applied to profiles.
  *  Simplified route handling on BSD.
  *  Fix expiration of IPv6 routers if a static route was present.
  *  --inactive now starts with all interfaces inactive.
 subsequent calls to dhcpcd can activate/deactivate them.

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-6-11-2

U src/external/bsd/dhcpcd/dist/common.c
U src/external/bsd/dhcpcd/dist/control.c
C src/external/bsd/dhcpcd/dist/dhcpcd.c
C src/external/bsd/dhcpcd/dist/duid.c
U src/external/bsd/dhcpcd/dist/eloop.c
C src/external/bsd/dhcpcd/dist/if.c
C src/external/bsd/dhcpcd/dist/if-options.c
U src/external/bsd/dhcpcd/dist/script.c
C src/external/bsd/dhcpcd/dist/dhcp-common.c
C src/external/bsd/dhcpcd/dist/if-bsd.c
C src/external/bsd/dhcpcd/dist/arp.c
C src/external/bsd/dhcpcd/dist/dhcp.c
C src/external/bsd/dhcpcd/dist/ipv4.c
C src/external/bsd/dhcpcd/dist/ipv4ll.c
C src/external/bsd/dhcpcd/dist/ipv6.c
C src/external/bsd/dhcpcd/dist/ipv6nd.c
C src/external/bsd/dhcpcd/dist/dhcp6.c
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/auth.c
U src/external/bsd/dhcpcd/dist/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in
C src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in
C src/external/bsd/dhcpcd/dist/dhcpcd.8.in
C src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/arp.h
U src/external/bsd/dhcpcd/dist/auth.h
U src/external/bsd/dhcpcd/dist/bpf-filter.h
U src/external/bsd/dhcpcd/dist/common.h
U src/external/bsd/dhcpcd/dist/config.h
U src/external/bsd/dhcpcd/dist/control.h
C src/external/bsd/dhcpcd/dist/defs.h
U src/external/bsd/dhcpcd/dist/dev.h
U src/external/bsd/dhcpcd/dist/dhcp-common.h
U src/external/bsd/dhcpcd/dist/dhcp.h
C src/external/bsd/dhcpcd/dist/dhcp6.h
U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h
C src/external/bsd/dhcpcd/dist/dhcpcd.h
U src/external/bsd/dhcpcd/dist/duid.h
U src/external/bsd/dhcpcd/dist/eloop.h
C src/external/bsd/dhcpcd/dist/if-options.h
C src/external/bsd/dhcpcd/dist/if.h
C src/external/bsd/dhcpcd/dist/ipv4.h
U src/external/bsd/dhcpcd/dist/ipv4ll.h
C src/external/bsd/dhcpcd/dist/ipv6.h
C src/external/bsd/dhcpcd/dist/ipv6nd.h
U src/external/bsd/dhcpcd/dist/script.h
U src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c
U src/external/bsd/dhcpcd/dist/crypt/crypt.h
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump
C src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind

25 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist



CVS commit: src/etc/mtree

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 09:52:46 UTC 2016

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add destination directory for new dev/fss test


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/etc/mtree/NetBSD.dist.tests

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



CVS commit: src/etc/mtree

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 09:52:46 UTC 2016

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add destination directory for new dev/fss test


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/etc/mtree/NetBSD.dist.tests

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.127 src/etc/mtree/NetBSD.dist.tests:1.128
--- src/etc/mtree/NetBSD.dist.tests:1.127	Fri Apr 15 01:38:17 2016
+++ src/etc/mtree/NetBSD.dist.tests	Fri Jul 29 09:52:46 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.127 2016/04/15 01:38:17 ozaki-r Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.128 2016/07/29 09:52:46 pgoyette Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -17,6 +17,7 @@
 ./usr/libdata/debug/usr/tests/dev
 ./usr/libdata/debug/usr/tests/dev/audio
 ./usr/libdata/debug/usr/tests/dev/cgd
+./usr/libdata/debug/usr/tests/dev/fss
 ./usr/libdata/debug/usr/tests/dev/md
 ./usr/libdata/debug/usr/tests/dev/scsipi
 ./usr/libdata/debug/usr/tests/dev/sysmon



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

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 09:47:09 UTC 2016

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Simplify ARM_MMU_EXTENDED #ifdefs

No functional change


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/arm/arm32/pmap.c

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



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

2016-07-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 29 09:47:09 UTC 2016

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Simplify ARM_MMU_EXTENDED #ifdefs

No functional change


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/arm/arm32/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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.335 src/sys/arch/arm/arm32/pmap.c:1.336
--- src/sys/arch/arm/arm32/pmap.c:1.335	Thu Jul 14 15:51:41 2016
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jul 29 09:47:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.335 2016/07/14 15:51:41 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.336 2016/07/29 09:47:09 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.335 2016/07/14 15:51:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.336 2016/07/29 09:47:09 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -818,12 +818,10 @@ pmap_tlb_flush_SE(pmap_t pm, vaddr_t va,
 #endif /* ARM_MMU_EXTENDED */
 }
 
+#ifndef ARM_MMU_EXTENDED
 static inline void
 pmap_tlb_flushID(pmap_t pm)
 {
-#ifdef ARM_MMU_EXTENDED
-	pmap_tlb_asid_release_all(pm);
-#else
 	if (pm->pm_cstate.cs_tlb_id) {
 		cpu_tlb_flushID();
 #if ARM_MMU_V7 == 0
@@ -837,10 +835,8 @@ pmap_tlb_flushID(pmap_t pm)
 		pm->pm_cstate.cs_tlb = 0;
 #endif /* ARM_MMU_V7 */
 	}
-#endif /* ARM_MMU_EXTENDED */
 }
 
-#ifndef ARM_MMU_EXTENDED
 static inline void
 pmap_tlb_flushD(pmap_t pm)
 {
@@ -5125,7 +5121,11 @@ pmap_destroy(pmap_t pm)
 		return;
 
 	if (pm->pm_remove_all) {
+#ifdef ARM_MMU_EXTENDED
+		pmap_tlb_asid_release_all(pm);
+#else
 		pmap_tlb_flushID(pm);
+#endif
 		pm->pm_remove_all = false;
 	}
 



CVS commit: src/sys/dev/pci

2016-07-29 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri Jul 29 07:28:53 UTC 2016

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1247 -r1.1248 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1246 -r1.1247 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2016-07-29 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri Jul 29 07:28:19 UTC 2016

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add MegaRAID SAS3008


To generate a diff of this commit:
cvs rdiff -u -r1.1255 -r1.1256 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1255 src/sys/dev/pci/pcidevs:1.1256
--- src/sys/dev/pci/pcidevs:1.1255	Thu Jul 28 03:08:39 2016
+++ src/sys/dev/pci/pcidevs	Fri Jul 29 07:28:19 2016
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1255 2016/07/28 03:08:39 nonaka Exp $
+$NetBSD: pcidevs,v 1.1256 2016/07/29 07:28:19 nonaka Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4716,6 +4716,7 @@ product SYMBIOS MEGARAID_2208		0x005B	Me
 product SYMBIOS SAS1064A		0x005C	SAS1064A
 product SYMBIOS MEGARAID_3108		0x005d	MegaRAID SAS3108
 product SYMBIOS SAS1066			0x005E	SAS1066
+product SYMBIOS MEGARAID_3008		0x005f	MegaRAID SAS3008
 product SYMBIOS SAS1078			0x0060	SAS1078 PCI
 product SYMBIOS SAS1078_PCIE		0x0062	SAS1078 PCI Express
 product SYMBIOS SAS2116_1		0x0064	SAS2116



CVS commit: src/sys/dev/pci

2016-07-29 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri Jul 29 07:28:19 UTC 2016

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add MegaRAID SAS3008


To generate a diff of this commit:
cvs rdiff -u -r1.1255 -r1.1256 src/sys/dev/pci/pcidevs

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



CVS commit: src/distrib/sets/lists/tests

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 07:02:24 UTC 2016

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add files for the new fss(4) test


To generate a diff of this commit:
cvs rdiff -u -r1.678 -r1.679 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.678 src/distrib/sets/lists/tests/mi:1.679
--- src/distrib/sets/lists/tests/mi:1.678	Wed Jul 13 15:58:37 2016
+++ src/distrib/sets/lists/tests/mi	Fri Jul 29 07:02:24 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.678 2016/07/13 15:58:37 matt Exp $
+# $NetBSD: mi,v 1.679 2016/07/29 07:02:24 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -25,6 +25,7 @@
 ./usr/libdata/debug/usr/tests/dev	tests-fs-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/dev/audio	tests-fs-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/dev/cgd	tests-fs-debug		compattestfile,atf
+./usr/libdata/debug/usr/tests/dev/fss	tests-fs-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/dev/cgd/h_img2cgdtests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/dev/md	tests-fs-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/dev/scsipitests-fs-debug		compattestfile,atf
@@ -1364,6 +1365,10 @@
 ./usr/tests/dev/cgd/h_img2cgd/h_img2cgd		tests-obsolete		obsolete
 ./usr/tests/dev/cgd/paramsfile			tests-fs-tests		compattestfile,atf
 ./usr/tests/dev/cgd/t_cgd			tests-fs-tests		compattestfile,atf
+./usr/tests/dev/fsstests-fs-tests		compattestfile,atf
+./usr/tests/dev/fss/Atffile			tests-fs-tests		compattestfile,atf
+./usr/tests/dev/fss/Kyuafile			tests-fs-tests		compattestfile,atf,kyua
+./usr/tests/dev/fss/t_fss			tests-fs-tests		compattestfile,atf
 ./usr/tests/dev/mdtests-fs-tests		compattestfile,atf
 ./usr/tests/dev/md/Atffile			tests-fs-tests		atf,rump
 ./usr/tests/dev/md/Kyuafile			tests-fs-tests		atf,rump,kyua



CVS commit: src/distrib/sets/lists/tests

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 07:02:24 UTC 2016

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add files for the new fss(4) test


To generate a diff of this commit:
cvs rdiff -u -r1.678 -r1.679 src/distrib/sets/lists/tests/mi

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



CVS commit: src/tests/dev

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 06:13:39 UTC 2016

Modified Files:
src/tests/dev: Makefile
Added Files:
src/tests/dev/fss: Makefile t_fss.sh

Log Message:
Add a basic test for fss(4)

XXX For now, we just create required files (including mount-points)
XXX in the test's working directory.  Eventually someone with more
XXX rump-foo than I should create a fss rump-component and then update
XXX the test to run under rump.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/dev/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/dev/fss/Makefile src/tests/dev/fss/t_fss.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/dev/Makefile
diff -u src/tests/dev/Makefile:1.10 src/tests/dev/Makefile:1.11
--- src/tests/dev/Makefile:1.10	Tue Jan  5 17:22:38 2016
+++ src/tests/dev/Makefile	Fri Jul 29 06:13:39 2016
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.10 2016/01/05 17:22:38 jakllsch Exp $
+#	$NetBSD: Makefile,v 1.11 2016/07/29 06:13:39 pgoyette Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/dev
 
-TESTS_SUBDIRS+=	cgd raidframe
+TESTS_SUBDIRS+=	cgd fss raidframe
 .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) 
 TESTS_SUBDIRS+=	audio md scsipi sysmon usb
 .endif

Added files:

Index: src/tests/dev/fss/Makefile
diff -u /dev/null src/tests/dev/fss/Makefile:1.1
--- /dev/null	Fri Jul 29 06:13:39 2016
+++ src/tests/dev/fss/Makefile	Fri Jul 29 06:13:39 2016
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile,v 1.1 2016/07/29 06:13:39 pgoyette Exp $
+#
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/dev/fss
+FILESDIR=	${TESTSDIR}
+
+TESTS_SH=	t_fss
+
+.include 
Index: src/tests/dev/fss/t_fss.sh
diff -u /dev/null src/tests/dev/fss/t_fss.sh:1.1
--- /dev/null	Fri Jul 29 06:13:39 2016
+++ src/tests/dev/fss/t_fss.sh	Fri Jul 29 06:13:39 2016
@@ -0,0 +1,82 @@
+# $NetBSD: t_fss.sh,v 1.1 2016/07/29 06:13:39 pgoyette Exp $
+#
+# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
+# 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+#
+
+#
+# Verify basic operation of fss(4) file system snapshot device
+#
+
+orig_data="Original data"
+repl_data="Replacement data"
+
+atf_test_case basic cleanup
+basic_body() {
+
+# create of mount-points for the file system and snapshot
+
+	mkdir ./m1
+	mkdir ./m2
+
+# create a small 4MB file, treat it as a disk, init a file-system on it,
+# and mount it
+
+	dd if=/dev/zero of=./image bs=32k count=64
+	vndconfig -c vnd0 ./image
+	newfs /dev/vnd0a
+	mount /dev/vnd0a ./m1
+
+	echo "${orig_data}" > ./m1/text
+
+# configure and mount a snapshot of the file system
+
+	fssconfig -c fss0 ./m1 ./backup
+	mount /dev/fss0 ./m2
+
+# Modify the data on the underlying file system
+
+	echo "${repl_data}" > ./m1/text || abort
+
+# Verify that original data is still visible in the snapshot
+
+	read test_data < ./m2/text
+	atf_check_equal "${orig_data}" "${test_data}"
+
+# Unmount our temporary stuff
+
+	umount /dev/vnd0a	|| true
+	umount /dev/fss0	|| true
+}
+
+basic_cleanup() {
+	umount /dev/vnd0a	|| true
+	umount /dev/fss0	|| true
+	vndconfig -u vnd0	|| true
+	fssconfig -u fss0	|| true
+}
+
+atf_init_test_cases()
+{
+atf_add_test_case basic
+}



CVS commit: src/tests/dev

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 06:13:39 UTC 2016

Modified Files:
src/tests/dev: Makefile
Added Files:
src/tests/dev/fss: Makefile t_fss.sh

Log Message:
Add a basic test for fss(4)

XXX For now, we just create required files (including mount-points)
XXX in the test's working directory.  Eventually someone with more
XXX rump-foo than I should create a fss rump-component and then update
XXX the test to run under rump.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/dev/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/dev/fss/Makefile src/tests/dev/fss/t_fss.sh

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



CVS commit: src/tests/dev

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 06:11:12 UTC 2016

Removed Files:
src/tests/dev: Makefile.inc

Log Message:
Remove.  Nothing here (or below) seems to refer to it, and it won't
work anyway due to the case of the 'l' in CPPFlAGS


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/tests/dev/Makefile.inc

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



CVS commit: src/tests/dev

2016-07-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 06:11:12 UTC 2016

Removed Files:
src/tests/dev: Makefile.inc

Log Message:
Remove.  Nothing here (or below) seems to refer to it, and it won't
work anyway due to the case of the 'l' in CPPFlAGS


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/tests/dev/Makefile.inc

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



CVS commit: src/sys/netinet6

2016-07-29 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jul 29 06:02:03 UTC 2016

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

Log Message:
Avoid memset and rtcache_free if unnecessary

It's the same as ip_output.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/netinet6/ip6_output.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_output.c
diff -u src/sys/netinet6/ip6_output.c:1.171 src/sys/netinet6/ip6_output.c:1.172
--- src/sys/netinet6/ip6_output.c:1.171	Mon Jun 27 18:35:54 2016
+++ src/sys/netinet6/ip6_output.c	Fri Jul 29 06:02:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.171 2016/06/27 18:35:54 christos Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.172 2016/07/29 06:02:03 ozaki-r Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.171 2016/06/27 18:35:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.172 2016/07/29 06:02:03 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -189,8 +189,6 @@ ip6_output(
 	int bound = curlwp_bind();
 	bool release_psref_ia = false;
 
-	memset(, 0, sizeof(ip6route));
-
 #ifdef  DIAGNOSTIC
 	if ((m->m_flags & M_PKTHDR) == 0)
 		panic("ip6_output: no HDR");
@@ -437,6 +435,7 @@ ip6_output(
 	 */
 	/* initialize cached route */
 	if (ro == NULL) {
+		memset(, 0, sizeof(ip6route));
 		ro = 
 	}
 	ro_pmtu = ro;
@@ -974,7 +973,8 @@ sendorfree:
 		IP6_STATINC(IP6_STAT_FRAGMENTED);
 
 done:
-	rtcache_free();
+	if (ro == )
+		rtcache_free();
 
 #ifdef IPSEC
 	if (sp != NULL)



CVS commit: src/sys/netinet6

2016-07-29 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jul 29 06:02:03 UTC 2016

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

Log Message:
Avoid memset and rtcache_free if unnecessary

It's the same as ip_output.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/netinet6/ip6_output.c

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