CVS commit: src/sys/netinet6

2016-08-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Aug  2 04:50:16 UTC 2016

Modified Files:
src/sys/netinet6: files.netinet6 ip6_flow.c ip6_input.c

Log Message:
ip6flow refactor like ipflow.

- move ip6flow sysctls into ip6_flow.c like ip_flow.c:r1.64
- build ip6_flow.c only if GATEWAY kernel option is enabled


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/netinet6/files.netinet6
cvs rdiff -u -r1.29 -r1.30 src/sys/netinet6/ip6_flow.c
cvs rdiff -u -r1.165 -r1.166 src/sys/netinet6/ip6_input.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/files.netinet6
diff -u src/sys/netinet6/files.netinet6:1.11 src/sys/netinet6/files.netinet6:1.12
--- src/sys/netinet6/files.netinet6:1.11	Tue Oct 13 21:28:35 2015
+++ src/sys/netinet6/files.netinet6	Tue Aug  2 04:50:16 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netinet6,v 1.11 2015/10/13 21:28:35 rjs Exp $
+#	$NetBSD: files.netinet6,v 1.12 2016/08/02 04:50:16 knakahara Exp $
 
 defflag	opt_inet6.h	RFC2292	
 
@@ -15,7 +15,7 @@ file	netinet6/in6_pcb.c		inet6
 file	netinet6/in6_print.c
 file	netinet6/in6_proto.c		inet6
 file	netinet6/in6_src.c		inet6
-file	netinet6/ip6_flow.c		inet6
+file	netinet6/ip6_flow.c		inet6 & gateway
 file	netinet6/ip6_forward.c		inet6
 file	netinet6/ip6_id.c		inet6
 file	netinet6/ip6_input.c		inet6

Index: src/sys/netinet6/ip6_flow.c
diff -u src/sys/netinet6/ip6_flow.c:1.29 src/sys/netinet6/ip6_flow.c:1.30
--- src/sys/netinet6/ip6_flow.c:1.29	Tue Jul 26 05:53:30 2016
+++ src/sys/netinet6/ip6_flow.c	Tue Aug  2 04:50:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_flow.c,v 1.29 2016/07/26 05:53:30 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_flow.c,v 1.30 2016/08/02 04:50:16 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.29 2016/07/26 05:53:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.30 2016/08/02 04:50:16 knakahara Exp $");
 
 #include 
 #include 
@@ -106,6 +106,10 @@ static void ip6flow_slowtimo_work(struct
 static struct workqueue	*ip6flow_slowtimo_wq;
 static struct work	ip6flow_slowtimo_wk;
 
+static int sysctl_net_inet6_ip6_hashsize(SYSCTLFN_PROTO);
+static int sysctl_net_inet6_ip6_maxflows(SYSCTLFN_PROTO);
+static void ip6flow_sysctl_init(struct sysctllog **);
+
 /*
  * Insert an ip6flow into the list.
  */
@@ -235,6 +239,7 @@ ip6flow_init(int table_size)
 	mutex_enter(_lock);
 	ret = ip6flow_init_locked(table_size);
 	mutex_exit(_lock);
+	ip6flow_sysctl_init(NULL);
 
 	return ret;
 }
@@ -618,3 +623,94 @@ ip6flow_invalidate_all(int new_size)
 
 	return error;
 }
+
+/*
+ * sysctl helper routine for net.inet.ip6.maxflows. Since
+ * we could reduce this value, call ip6flow_reap();
+ */
+static int
+sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS)
+{
+	int error;
+
+	error = sysctl_lookup(SYSCTLFN_CALL(rnode));
+	if (error || newp == NULL)
+		return (error);
+
+	mutex_enter(softnet_lock);
+	KERNEL_LOCK(1, NULL);
+
+	ip6flow_reap(0);
+
+	KERNEL_UNLOCK_ONE(NULL);
+	mutex_exit(softnet_lock);
+
+	return (0);
+}
+
+static int
+sysctl_net_inet6_ip6_hashsize(SYSCTLFN_ARGS)
+{
+	int error, tmp;
+	struct sysctlnode node;
+
+	node = *rnode;
+	tmp = ip6_hashsize;
+	node.sysctl_data = 
+	error = sysctl_lookup(SYSCTLFN_CALL());
+	if (error || newp == NULL)
+		return (error);
+
+	if ((tmp & (tmp - 1)) == 0 && tmp != 0) {
+		/*
+		 * Can only fail due to malloc()
+		 */
+		mutex_enter(softnet_lock);
+		KERNEL_LOCK(1, NULL);
+
+		error = ip6flow_invalidate_all(tmp);
+
+		KERNEL_UNLOCK_ONE(NULL);
+		mutex_exit(softnet_lock);
+	} else {
+		/*
+		 * EINVAL if not a power of 2
+		 */
+		error = EINVAL;
+	}
+
+	return error;
+}
+
+static void
+ip6flow_sysctl_init(struct sysctllog **clog)
+{
+
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_NODE, "inet6",
+		   SYSCTL_DESCR("PF_INET6 related settings"),
+		   NULL, 0, NULL, 0,
+		   CTL_NET, PF_INET6, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_NODE, "ip6",
+		   SYSCTL_DESCR("IPv6 related settings"),
+		   NULL, 0, NULL, 0,
+		   CTL_NET, PF_INET6, IPPROTO_IPV6, CTL_EOL);
+
+	sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+			CTLTYPE_INT, "maxflows",
+			SYSCTL_DESCR("Number of flows for fast forwarding (IPv6)"),
+			sysctl_net_inet6_ip6_maxflows, 0, _maxflows, 0,
+			CTL_NET, PF_INET6, IPPROTO_IPV6,
+			CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+			CTLTYPE_INT, "hashsize",
+			SYSCTL_DESCR("Size of hash table for fast forwarding (IPv6)"),
+			sysctl_net_inet6_ip6_hashsize, 0, _hashsize, 0,
+			CTL_NET, PF_INET6, IPPROTO_IPV6,
+			CTL_CREATE, CTL_EOL);
+}

Index: src/sys/netinet6/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.165 

CVS commit: src/distrib/notes/common

2016-08-01 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Aug  1 19:06:32 UTC 2016

Modified Files:
src/distrib/notes/common: main

Log Message:
Add myself


To generate a diff of this commit:
cvs rdiff -u -r1.530 -r1.531 src/distrib/notes/common/main

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.530 src/distrib/notes/common/main:1.531
--- src/distrib/notes/common/main:1.530	Tue Jun 28 16:45:06 2016
+++ src/distrib/notes/common/main	Mon Aug  1 19:06:32 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.530 2016/06/28 16:45:06 maya Exp $
+.\"	$NetBSD: main,v 1.531 2016/08/01 19:06:32 scole Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -1144,6 +1144,7 @@ If you're one of them, and would like to
 .It Ta Mihai Chelaru Ta Mt kef...@netbsd.org
 .It Ta Aleksey Cheusov Ta Mt cheu...@netbsd.org
 .It Ta Bill Coldwell Ta Mt bi...@netbsd.org
+.It Ta Sean Cole Ta Mt sc...@netbsd.org
 .It Ta Julian Coleman Ta Mt j...@netbsd.org
 .It Ta Marcus Comstedt Ta Mt mar...@netbsd.org
 .It Ta Jeremy Cooper Ta Mt jer...@netbsd.org



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

2016-08-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Aug  1 19:05:24 UTC 2016

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

Log Message:
Add pointer to bus_space_set_region_4 implemenation in armv7_generic_bs_tag.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/arm32/armv7_generic_space.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/armv7_generic_space.c
diff -u src/sys/arch/arm/arm32/armv7_generic_space.c:1.2 src/sys/arch/arm/arm32/armv7_generic_space.c:1.3
--- src/sys/arch/arm/arm32/armv7_generic_space.c:1.2	Sun Oct 18 00:37:56 2015
+++ src/sys/arch/arm/arm32/armv7_generic_space.c	Mon Aug  1 19:05:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv7_generic_space.c,v 1.2 2015/10/18 00:37:56 jmcneill Exp $	*/
+/*	$NetBSD: armv7_generic_space.c,v 1.3 2016/08/01 19:05:24 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.2 2015/10/18 00:37:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: armv7_generic_space.c,v 1.3 2016/08/01 19:05:24 jakllsch Exp $");
 
 #include 
 #include 
@@ -121,7 +121,7 @@ struct bus_space armv7_generic_bs_tag = 
 	/* set region */
 	generic_bs_sr_1,
 	NSWAP(generic_armv4_bs_sr_2),
-	bs_notimpl_bs_sr_4,
+	NSWAP(generic_bs_sr_4),
 	bs_notimpl_bs_sr_8,
 
 	/* copy */



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

2016-08-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug  1 18:28:38 UTC 2016

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

Log Message:
pm_remove_all needs handling in pmap_destroy as well as pmap_update


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 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.337 src/sys/arch/arm/arm32/pmap.c:1.338
--- src/sys/arch/arm/arm32/pmap.c:1.337	Fri Jul 29 15:38:05 2016
+++ src/sys/arch/arm/arm32/pmap.c	Mon Aug  1 18:28:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.337 2016/07/29 15:38:05 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.338 2016/08/01 18:28:38 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.337 2016/07/29 15:38:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.338 2016/08/01 18:28:38 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -4996,6 +4996,45 @@ pmap_deactivate(struct lwp *l)
 	UVMHIST_LOG(maphist, "  <-- done", 0, 0, 0, 0);
 }
 
+#ifdef ARM_MMU_EXTENDED
+static inline void
+pmap_remove_all_complete(pmap_t pm)
+{
+	KASSERT(pm != pmap_kernel());
+
+	KASSERTMSG(curcpu()->ci_pmap_cur != pm
+	|| pm->pm_pai[0].pai_asid == curcpu()->ci_pmap_asid_cur,
+	"pmap/asid %p/%#x != %s cur pmap/asid %p/%#x", pm,
+	pm->pm_pai[0].pai_asid, curcpu()->ci_data.cpu_name,
+	curcpu()->ci_pmap_cur, curcpu()->ci_pmap_asid_cur);
+
+	/*
+	 * Finish up the pmap_remove_all() optimisation by flushing
+	 * all our ASIDs.
+	 */
+#ifdef MULTIPROCESSOR
+	// This should be the last CPU with this pmap onproc
+	KASSERT(!kcpuset_isotherset(pm->pm_onproc, cpu_index(curcpu(;
+	if (kcpuset_isset(pm->pm_onproc, cpu_index(curcpu( {
+		struct cpu_info * const ci = curcpu();
+		KASSERT(!cpu_intr_p());
+		/*
+		 * The bits in pm_onproc that belong to this
+		 * TLB can be changed while this TLBs lock is
+		 * not held as long as we use atomic ops.
+		 */
+		kcpuset_atomic_clear(pm->pm_onproc, cpu_index(ci));
+	}
+	KASSERT(kcpuset_iszero(pm->pm_onproc));
+#endif /* MULTIPROCESSOR */
+
+	struct pmap_asid_info * const pai =
+	PMAP_PAI(pm, cpu_tlb_info(ci));
+
+	tlb_invalidate_asids(pai->pai_asid, pai->pai_asid);
+}
+#endif
+
 void
 pmap_update(pmap_t pm)
 {
@@ -5007,41 +5046,7 @@ pmap_update(pmap_t pm)
 
 	if (pm->pm_remove_all) {
 #ifdef ARM_MMU_EXTENDED
-		KASSERT(pm != pmap_kernel());
-
-		KASSERTMSG(curcpu()->ci_pmap_cur != pm
-		|| pm->pm_pai[0].pai_asid == curcpu()->ci_pmap_asid_cur,
-		"pmap/asid %p/%#x != %s cur pmap/asid %p/%#x", pm,
-		pm->pm_pai[0].pai_asid, curcpu()->ci_data.cpu_name,
-		curcpu()->ci_pmap_cur, curcpu()->ci_pmap_asid_cur);
-
-#ifdef MULTIPROCESSOR
-		/*
-		 * Finish up the pmap_remove_all() optimisation by flushing
-		 * all our ASIDs.
-		 */
-		// This should be the last CPU with this pmap onproc
-		KASSERT(!kcpuset_isotherset(pm->pm_onproc, cpu_index(curcpu(;
-		if (kcpuset_isset(pm->pm_onproc, cpu_index(curcpu( {
-			if (pm != pmap_kernel()) {
-struct cpu_info * const ci = curcpu();
-KASSERT(!cpu_intr_p());
-/*
- * The bits in pm_onproc that belong to this
- * TLB can be changed while this TLBs lock is
- * not held as long as we use atomic ops.
- */
-kcpuset_atomic_clear(pm->pm_onproc,
-cpu_index(ci));
-			}
-		}
-		KASSERT(kcpuset_iszero(pm->pm_onproc));
-#endif
-		struct pmap_asid_info * const pai =
-		PMAP_PAI(pm, cpu_tlb_info(ci));
-
-		tlb_invalidate_asids(pai->pai_asid, pai->pai_asid);
-
+		pmap_remove_all_complete(pm);
 #else
 		/*
 		 * Finish up the pmap_remove_all() optimisation by flushing
@@ -5133,7 +5138,8 @@ pmap_destroy(pmap_t pm)
 
 	if (pm->pm_remove_all) {
 #ifdef ARM_MMU_EXTENDED
-		pmap_tlb_asid_release_all(pm);
+		pmap_remove_all_complete(pm);
+ 		pmap_tlb_asid_release_all(pm);
 #else
 		pmap_tlb_flushID(pm);
 #endif



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

2016-08-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Aug  1 18:09:50 UTC 2016

Modified Files:
src/sys/arch/mips/rmi: rmixl_intr.c

Log Message:
PR 51384 David Binderman: don't shift into the void


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/rmi/rmixl_intr.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/rmi/rmixl_intr.c
diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.10 src/sys/arch/mips/rmi/rmixl_intr.c:1.11
--- src/sys/arch/mips/rmi/rmixl_intr.c:1.10	Sat Apr 23 10:15:30 2016
+++ src/sys/arch/mips/rmi/rmixl_intr.c	Mon Aug  1 18:09:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.c,v 1.10 2016/04/23 10:15:30 skrll Exp $	*/
+/*	$NetBSD: rmixl_intr.c,v 1.11 2016/08/01 18:09:50 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.10 2016/04/23 10:15:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.11 2016/08/01 18:09:50 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -978,7 +978,7 @@ static int
 rmixl_ipi_intr(void *arg)
 {
 	struct cpu_info * const ci = curcpu();
-	const uint64_t ipi_mask = 1 << (uintptr_t)arg;
+	const uint64_t ipi_mask = 1ULL << (uintptr_t)arg;
 
 	KASSERT(ci->ci_cpl >= IPL_SCHED);
 	KASSERT((uintptr_t)arg < NIPIS);



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

2016-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Aug  1 16:07:39 UTC 2016

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

Log Message:
This panic is wrong. There could be two consecutive clusters below
avail_start.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.74 src/sys/arch/x86/x86/x86_machdep.c:1.75
--- src/sys/arch/x86/x86/x86_machdep.c:1.74	Sun Jul 17 10:46:43 2016
+++ src/sys/arch/x86/x86/x86_machdep.c	Mon Aug  1 16:07:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.74 2016/07/17 10:46:43 maxv Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.74 2016/07/17 10:46:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -881,8 +881,6 @@ init_x86_vm(paddr_t pa_kend)
 			continue;
 
 		if (seg_start <= avail_start && avail_start < seg_end) {
-			if (seg_start != 0)
-panic("init_x86_64: memory doesn't start at 0");
 			seg_start = avail_start;
 			if (seg_start == seg_end)
 continue;



CVS commit: src/sys/kern

2016-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Aug  1 15:41:05 UTC 2016

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

Log Message:
Don't fail if a module does not have a data or rodata section. Small
modules don't have data.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/subr_kobj.c

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

Modified files:

Index: src/sys/kern/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.57 src/sys/kern/subr_kobj.c:1.58
--- src/sys/kern/subr_kobj.c:1.57	Wed Jul 20 13:36:19 2016
+++ src/sys/kern/subr_kobj.c	Mon Aug  1 15:41:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.57 2016/07/20 13:36:19 maxv Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.58 2016/08/01 15:41:05 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.57 2016/07/20 13:36:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.58 2016/08/01 15:41:05 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -424,16 +424,38 @@ kobj_load(kobj_t ko)
 		error = ENOEXEC;
  		goto out;
  	}
-	if (map_data_size == 0) {
-		kobj_error(ko, "no data/bss");
-		error = ENOEXEC;
- 		goto out;
- 	}
-	if (map_rodata_size == 0) {
-		kobj_error(ko, "no rodata");
-		error = ENOEXEC;
- 		goto out;
- 	}
+
+	if (map_data_size != 0) {
+		map_data_base = uvm_km_alloc(module_map, round_page(map_data_size),
+			0, UVM_KMF_WIRED);
+		if (map_data_base == 0) {
+			kobj_error(ko, "out of memory");
+			error = ENOMEM;
+			goto out;
+		}
+		ko->ko_data_address = map_data_base;
+		ko->ko_data_size = map_data_size;
+ 	} else {
+		map_data_base = 0;
+		ko->ko_data_address = 0;
+		ko->ko_data_size = 0;
+	}
+
+	if (map_rodata_size != 0) {
+		map_rodata_base = uvm_km_alloc(module_map, round_page(map_rodata_size),
+			0, UVM_KMF_WIRED);
+		if (map_rodata_base == 0) {
+			kobj_error(ko, "out of memory");
+			error = ENOMEM;
+			goto out;
+		}
+		ko->ko_rodata_address = map_rodata_base;
+		ko->ko_rodata_size = map_rodata_size;
+ 	} else {
+		map_rodata_base = 0;
+		ko->ko_rodata_address = 0;
+		ko->ko_rodata_size = 0;
+	}
 
 	map_text_base = uvm_km_alloc(module_map, round_page(map_text_size),
 	0, UVM_KMF_WIRED | UVM_KMF_EXEC);
@@ -445,26 +467,6 @@ kobj_load(kobj_t ko)
 	ko->ko_text_address = map_text_base;
 	ko->ko_text_size = map_text_size;
 
-	map_data_base = uvm_km_alloc(module_map, round_page(map_data_size),
-	0, UVM_KMF_WIRED);
-	if (map_data_base == 0) {
-		kobj_error(ko, "out of memory");
-		error = ENOMEM;
-		goto out;
-	}
-	ko->ko_data_address = map_data_base;
-	ko->ko_data_size = map_data_size;
-
-	map_rodata_base = uvm_km_alloc(module_map, round_page(map_rodata_size),
-	0, UVM_KMF_WIRED);
-	if (map_rodata_base == 0) {
-		kobj_error(ko, "out of memory");
-		error = ENOMEM;
-		goto out;
-	}
-	ko->ko_rodata_address = map_rodata_base;
-	ko->ko_rodata_size = map_rodata_size;
-
 	/*
 	 * Now load code/data(progbits), zero bss(nobits), allocate space
 	 * for and load relocs
@@ -649,16 +651,22 @@ kobj_unload(kobj_t ko)
 		if (error != 0)
 			kobj_error(ko, "machine dependent deinit failed (text) %d",
 			error);
-		error = kobj_machdep(ko, (void *)ko->ko_data_address,
-		ko->ko_data_size, false);
- 		if (error != 0)
-			kobj_error(ko, "machine dependent deinit failed (data) %d",
- 			error);
-		error = kobj_machdep(ko, (void *)ko->ko_rodata_address,
-		ko->ko_rodata_size, false);
- 		if (error != 0)
-			kobj_error(ko, "machine dependent deinit failed (rodata) %d",
- 			error);
+
+		if (ko->ko_data_address != 0) {
+			error = kobj_machdep(ko, (void *)ko->ko_data_address,
+			ko->ko_data_size, false);
+	 		if (error != 0)
+kobj_error(ko, "machine dependent deinit failed"
+"(data) %d", error);
+		}
+
+		if (ko->ko_rodata_address != 0) {
+			error = kobj_machdep(ko, (void *)ko->ko_rodata_address,
+			ko->ko_rodata_size, false);
+	 		if (error != 0)
+kobj_error(ko, "machine dependent deinit failed"
+"(rodata) %d", error);
+		}
 	}
 	if (ko->ko_text_address != 0) {
 		uvm_km_free(module_map, ko->ko_text_address,
@@ -752,8 +760,11 @@ kobj_affix(kobj_t ko, const char *name)
 	/* Change the memory protections, when needed. */
 	uvm_km_protect(module_map, ko->ko_text_address, ko->ko_text_size,
 	VM_PROT_READ|VM_PROT_EXECUTE);
-	uvm_km_protect(module_map, ko->ko_rodata_address, ko->ko_rodata_size,
-	VM_PROT_READ);
+	if (ko->ko_rodata_address != 0) {
+		uvm_km_protect(module_map, ko->ko_rodata_address,
+		ko->ko_rodata_size, VM_PROT_READ);
+	}
+
 
 	/*
 	 * Notify MD code that a module has been loaded.
@@ -766,16 +777,23 @@ kobj_affix(kobj_t ko, const char *name)
 		if (error != 0)
 			kobj_error(ko, "machine dependent init failed (text) %d",
 			error);
-		error = kobj_machdep(ko, (void *)ko->ko_data_address,
-		ko->ko_data_size, true);
-		if (error != 0)
-			

CVS commit: src/doc

2016-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug  1 15:01:50 UTC 2016

Modified Files:
src/doc: 3RDPARTY

Log Message:
OpenSSH-7.3 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1347 -r1.1348 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1347 src/doc/3RDPARTY:1.1348
--- src/doc/3RDPARTY:1.1347	Tue Jul 19 01:04:09 2016
+++ src/doc/3RDPARTY	Mon Aug  1 15:01:49 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1347 2016/07/19 01:04:09 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.1348 2016/08/01 15:01:49 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1004,7 +1004,7 @@ Patch applied after OpenSSH import.
 
 Package:	OpenSSH
 Version:	7.2
-Current Vers:	7.2 / portable 7.2p2
+Current Vers:	7.3 / portable 7.3p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html



CVS commit: [pgoyette-localcount] src/share/man/man9

2016-08-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Aug  1 12:02:00 UTC 2016

Modified Files:
src/share/man/man9 [pgoyette-localcount]: localcount.9

Log Message:
Add a BUGS section, which is really a RESTRICTIONS section (but mdoclint
doesn't like RESTRICTIONS!)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/share/man/man9/localcount.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/localcount.9
diff -u src/share/man/man9/localcount.9:1.1.2.4 src/share/man/man9/localcount.9:1.1.2.5
--- src/share/man/man9/localcount.9:1.1.2.4	Sat Jul 16 23:42:35 2016
+++ src/share/man/man9/localcount.9	Mon Aug  1 12:02:00 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: localcount.9,v 1.1.2.4 2016/07/16 23:42:35 pgoyette Exp $
+.\"	$NetBSD: localcount.9,v 1.1.2.5 2016/08/01 12:02:00 pgoyette Exp $
 .\"
 .\" Copyright (c) 2016
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July xx, 2016
+.Dd August 2, 2016
 .Dt LOCALCOUNT 9
 .Os
 .Sh NAME
@@ -173,3 +173,17 @@ was written by
 .An Taylor R. Campbell .
 This manual page was compiled by
 .An Paul Goyette .
+.Sh BUGS
+The
+.Nm
+facility does not provide any way to examine the reference count without
+actually waiting for the count to reach zero.
+.Pp
+Waiting for a
+.Nm
+reference count to reach zero is a one-shot operation.
+Once the
+.Nm
+has been waited for, no further operations are allowed until the
+.Nm
+has been re-initialized.



CVS commit: src/external/gpl3/binutils

2016-08-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug  1 11:22:35 UTC 2016

Modified Files:
src/external/gpl3/binutils/lib/libbfd/arch/earm: bfd_stdint.h bfdver.h
config.h
src/external/gpl3/binutils/lib/libopcodes/arch/earm: config.h
src/external/gpl3/binutils/usr.bin/common/arch/earm: config.h defs.mk
src/external/gpl3/binutils/usr.bin/gas/arch/earm: config.h
src/external/gpl3/binutils/usr.bin/gprof/arch/earm: gconfig.h
src/external/gpl3/binutils/usr.bin/ld/arch/earm: config.h

Log Message:
Re-run mknative


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h \
src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/common/arch/earm/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/binutils/usr.bin/common/arch/earm/defs.mk
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/binutils/usr.bin/gas/arch/earm/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/binutils/usr.bin/gprof/arch/earm/gconfig.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/ld/arch/earm/config.h

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

Modified files:

Index: src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h:1.3 src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h:1.4
--- src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h:1.3	Fri Jan 29 20:41:25 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h	Mon Aug  1 11:22:35 2016
@@ -2,7 +2,7 @@
 /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp  */
 
-/* generated for  arm--netbsdelf-eabi-gcc (NetBSD nb2 20150115) 4.8.5 */
+/* generated for  arm--netbsdelf-eabi-gcc (NetBSD nb1 20160606) 5.4.0 */
 
 #ifndef GCC_GENERATED_STDINT_H
 #define GCC_GENERATED_STDINT_H 1
Index: src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h:1.3 src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h:1.4
--- src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h:1.3	Fri Jan 29 20:41:25 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h	Mon Aug  1 11:22:35 2016
@@ -2,7 +2,7 @@
 /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp  */
 
-#define BFD_VERSION_DATE 20160125
-#define BFD_VERSION 22600
-#define BFD_VERSION_STRING  "(NetBSD Binutils nb1) " "2.26.20160125"
+#define BFD_VERSION_DATE 20160629
+#define BFD_VERSION 22601
+#define BFD_VERSION_STRING  "(NetBSD Binutils nb1) " "2.26.1"
 #define REPORT_BUGS_TO ""

Index: src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h:1.4 src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h:1.5
--- src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h:1.4	Fri Jan 29 20:41:25 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/earm/config.h	Mon Aug  1 11:22:35 2016
@@ -298,7 +298,7 @@
 #define PACKAGE_NAME "bfd"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "bfd 2.26"
+#define PACKAGE_STRING "bfd 2.26.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "bfd"
@@ -307,7 +307,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.26"
+#define PACKAGE_VERSION "2.26.1"
 
 /* The size of `char', as computed by sizeof. */
 /* #undef SIZEOF_CHAR */
@@ -352,7 +352,7 @@
 /* #undef USE_MMAP */
 
 /* Define if we should default to creating read-only plt entries */
-#define USE_SECUREPLT 1
+/* #undef USE_SECUREPLT */
 
 /* Define if we may generate symbols with ELF's STT_COMMON type */
 /* #undef USE_STT_COMMON */
@@ -380,7 +380,7 @@
 
 
 /* Version number of package */
-#define VERSION "2.26"
+#define VERSION "2.26.1"
 
 /* Number of bits in a file offset, on hosts where this is settable. */
 /* #undef _FILE_OFFSET_BITS */

Index: src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h
diff -u src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h:1.3 src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h:1.4
--- src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h:1.3	Fri Jan 29 20:41:26 2016
+++ src/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h	Mon Aug  1 11:22:35 2016
@@ -74,7 

CVS commit: src/sys/netinet

2016-08-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Aug  1 10:22:53 UTC 2016

Modified Files:
src/sys/netinet: ip_flow.c ip_var.h

Log Message:
improve fast-forward performance when the number of flows exceeds IPFLOW_MAX.

In the fast-forward case, when the number of flows exceeds IPFLOW_MAX, the
performmance degraded to about 50% compared to the case less than IPFLOW_MAX
flows. This modification suppresses the degradation to 65%. Furthermore,
the modified kernel is about the same performance as the original kernel
when the number of flows is less than IPFLOW_MAX.

The original patch is implemented by ryo@n.o. Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/netinet/ip_flow.c
cvs rdiff -u -r1.114 -r1.115 src/sys/netinet/ip_var.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/ip_flow.c
diff -u src/sys/netinet/ip_flow.c:1.75 src/sys/netinet/ip_flow.c:1.76
--- src/sys/netinet/ip_flow.c:1.75	Wed Jul 27 04:23:42 2016
+++ src/sys/netinet/ip_flow.c	Mon Aug  1 10:22:53 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_flow.c,v 1.75 2016/07/27 04:23:42 knakahara Exp $	*/
+/*	$NetBSD: ip_flow.c,v 1.76 2016/08/01 10:22:53 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.75 2016/07/27 04:23:42 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.76 2016/08/01 10:22:53 knakahara Exp $");
 
 #include 
 #include 
@@ -69,7 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 
 
 static struct pool ipflow_pool;
 
-LIST_HEAD(ipflowhead, ipflow);
+TAILQ_HEAD(ipflowhead, ipflow);
 
 #define	IPFLOW_TIMER		(5 * PR_SLOWHZ)
 #define	IPFLOW_DEFAULT_HASHSIZE	(1 << IPFLOW_HASHBITS)
@@ -86,16 +86,17 @@ static struct ipflowhead *ipflowtable = 
 static struct ipflowhead ipflowlist;
 static int ipflow_inuse;
 
-#define	IPFLOW_INSERT(bucket, ipf) \
+#define	IPFLOW_INSERT(hashidx, ipf) \
 do { \
-	LIST_INSERT_HEAD((bucket), (ipf), ipf_hash); \
-	LIST_INSERT_HEAD(, (ipf), ipf_list); \
+	(ipf)->ipf_hashidx = (hashidx); \
+	TAILQ_INSERT_HEAD([(hashidx)], (ipf), ipf_hash); \
+	TAILQ_INSERT_HEAD(, (ipf), ipf_list); \
 } while (/*CONSTCOND*/ 0)
 
-#define	IPFLOW_REMOVE(ipf) \
+#define	IPFLOW_REMOVE(hashidx, ipf) \
 do { \
-	LIST_REMOVE((ipf), ipf_hash); \
-	LIST_REMOVE((ipf), ipf_list); \
+	TAILQ_REMOVE([(hashidx)], (ipf), ipf_hash); \
+	TAILQ_REMOVE(, (ipf), ipf_list); \
 } while (/*CONSTCOND*/ 0)
 
 #ifndef IPFLOW_MAX
@@ -135,7 +136,7 @@ ipflow_lookup(const struct ip *ip)
 
 	hash = ipflow_hash(ip);
 
-	LIST_FOREACH(ipf, [hash], ipf_hash) {
+	TAILQ_FOREACH(ipf, [hash], ipf_hash) {
 		if (ip->ip_dst.s_addr == ipf->ipf_dst.s_addr
 		&& ip->ip_src.s_addr == ipf->ipf_src.s_addr
 		&& ip->ip_tos == ipf->ipf_tos)
@@ -172,9 +173,9 @@ ipflow_reinit(int table_size)
 	ipflowtable = new_table;
 	ip_hashsize = table_size;
 
-	LIST_INIT();
+	TAILQ_INIT();
 	for (i = 0; i < ip_hashsize; i++)
-		LIST_INIT([i]);
+		TAILQ_INIT([i]);
 
 	return 0;
 }
@@ -328,6 +329,18 @@ ipflow_fastforward(struct mbuf *m)
 	 * Send the packet on its way.  All we can get back is ENOBUFS
 	 */
 	ipf->ipf_uses++;
+
+#if 0
+	/*
+	 * Sorting list is too heavy for fast path(packet processing path).
+	 * It degrades about 10% performance. So, we does not sort ipflowtable,
+	 * and then we use FIFO cache replacement instead fo LRU.
+	 */
+	/* move to head (LRU) for ipflowlist. ipflowtable ooes not care LRU. */
+	TAILQ_REMOVE(, ipf, ipf_list);
+	TAILQ_INSERT_HEAD(, ipf, ipf_list);
+#endif
+
 	PRT_SLOW_ARM(ipf->ipf_timer, IPFLOW_TIMER);
 
 	if (rt->rt_flags & RTF_GATEWAY)
@@ -375,7 +388,7 @@ ipflow_free(struct ipflow *ipf)
 	 * Once it's off the list, we can deal with it at normal
 	 * network IPL.
 	 */
-	IPFLOW_REMOVE(ipf);
+	IPFLOW_REMOVE(ipf->ipf_hashidx, ipf);
 
 	ipflow_addstats(ipf);
 	rtcache_free(>ipf_ro);
@@ -386,14 +399,34 @@ ipflow_free(struct ipflow *ipf)
 static struct ipflow *
 ipflow_reap(bool just_one)
 {
+	struct ipflow *ipf;
 
 	KASSERT(mutex_owned(_lock));
 
-	while (just_one || ipflow_inuse > ip_maxflows) {
-		struct ipflow *ipf, *maybe_ipf = NULL;
+	/*
+	 * This case must remove one ipflow. Furthermore, this case is used in
+	 * fast path(packet processing path). So, simply remove TAILQ_LAST one.
+	 */
+	if (just_one) {
+		ipf = TAILQ_LAST(, ipflowhead);
+		KASSERT(ipf != NULL);
+
+		IPFLOW_REMOVE(ipf->ipf_hashidx, ipf);
+
+		ipflow_addstats(ipf);
+		rtcache_free(>ipf_ro);
+		return ipf;
+	}
+
+	/*
+	 * This case is used in slow path(sysctl).
+	 * At first, remove invalid rtcache ipflow, and then remove TAILQ_LAST
+	 * ipflow if it is ensured least recently used by comparing last_uses.
+	 */
+	while (ipflow_inuse > ip_maxflows) {
+		struct ipflow *maybe_ipf = TAILQ_LAST(, ipflowhead);
 
-		ipf = LIST_FIRST();
-		while (ipf != NULL) {
+		TAILQ_FOREACH(ipf, , ipf_list) {
 			/*
 			 * If this no longer 

CVS commit: [pgoyette-localcount] src/tests/lib/libpthread

2016-08-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Aug  1 07:39:23 UTC 2016

Modified Files:
src/tests/lib/libpthread [pgoyette-localcount]: t_mutex.c

Log Message:
Import test fix from HEAD.

With this, a complete test run on HEAD vs the localcount branch yields
identical lists of "Failed test cases" and "Expected failures"


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.2.1 src/tests/lib/libpthread/t_mutex.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.9 src/tests/lib/libpthread/t_mutex.c:1.9.2.1
--- src/tests/lib/libpthread/t_mutex.c:1.9	Wed Jul  6 14:42:53 2016
+++ src/tests/lib/libpthread/t_mutex.c	Mon Aug  1 07:39:23 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.9 2016/07/06 14:42:53 christos Exp $ */
+/* $NetBSD: t_mutex.c,v 1.9.2.1 2016/08/01 07:39:23 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.9 2016/07/06 14:42:53 christos Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.9.2.1 2016/08/01 07:39:23 pgoyette Exp $");
 
 #include 
 #include 
@@ -318,7 +318,7 @@ child_func(void* arg)
 
 	printf("child is waiting\n");
 	res = _sched_protect(-2);
-	ATF_REQUIRE_EQ(res, -1);
+	ATF_REQUIRE_EQ_MSG(res, -1, "sched_protect returned %d", res);
 	ATF_REQUIRE_EQ(errno, ENOENT);
 	PTHREAD_REQUIRE(pthread_mutex_lock());
 	printf("child is owning resource\n");
@@ -334,6 +334,7 @@ ATF_TC(mutex5);
 ATF_TC_HEAD(mutex5, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Checks mutexes for priority setting");
+	atf_tc_set_md_var(tc, "require.user", "root");
 }
 
 ATF_TC_BODY(mutex5, tc)
@@ -352,7 +353,8 @@ ATF_TC_BODY(mutex5, tc)
 	printf("previous policy used = %d\n", res);
 
 	res = sched_getscheduler(getpid());
-	ATF_REQUIRE_EQ(res, 1);
+	ATF_REQUIRE_EQ_MSG(res, SCHED_FIFO, "sched %d != FIFO %d", res, 
+	SCHED_FIFO);
 
 	PTHREAD_REQUIRE(pthread_mutexattr_init());
 	PTHREAD_REQUIRE(pthread_mutexattr_setprotocol(,
@@ -444,6 +446,7 @@ ATF_TC_HEAD(mutex6, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
 	"Checks scheduling for priority ceiling");
+	atf_tc_set_md_var(tc, "require.user", "root");
 }
 
 /*