CVS commit: src/sys/dev/wsfb

2018-03-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Mar  6 07:49:36 UTC 2018

Modified Files:
src/sys/dev/wsfb: genfb.c

Log Message:
Fix cmap bounds checking.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/wsfb/genfb.c

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

Modified files:

Index: src/sys/dev/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.62 src/sys/dev/wsfb/genfb.c:1.63
--- src/sys/dev/wsfb/genfb.c:1.62	Sun Jan 21 04:20:10 2018
+++ src/sys/dev/wsfb/genfb.c	Tue Mar  6 07:49:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $ */
+/*	$NetBSD: genfb.c,v 1.63 2018/03/06 07:49:36 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.63 2018/03/06 07:49:36 mlelstv Exp $");
 
 #include 
 #include 
@@ -611,8 +611,9 @@ genfb_putcmap(struct genfb_softc *sc, st
 #ifdef GENFB_DEBUG
 	aprint_debug("putcmap: %d %d\n",index, count);
 #endif
-	if (index + count > 256)
+	if (index >= 256 || count > 256 || index + count > 256)
 		return EINVAL;
+
 	error = copyin(cm->red, [index], count);
 	if (error)
 		return error;
@@ -646,7 +647,7 @@ genfb_getcmap(struct genfb_softc *sc, st
 	u_int count = cm->count;
 	int error;
 
-	if (index >= 255 || count > 256 || index + count > 256)
+	if (index >= 256 || count > 256 || index + count > 256)
 		return EINVAL;
 
 	error = copyout(>sc_cmap_red[index],   cm->red,   count);



CVS commit: src/usr.sbin/dumpfs

2018-03-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Mar  6 07:45:38 UTC 2018

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

Log Message:
print quota pointers in superblock


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/dumpfs/dumpfs.c

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

Modified files:

Index: src/usr.sbin/dumpfs/dumpfs.c
diff -u src/usr.sbin/dumpfs/dumpfs.c:1.63 src/usr.sbin/dumpfs/dumpfs.c:1.64
--- src/usr.sbin/dumpfs/dumpfs.c:1.63	Tue Sep  3 04:02:13 2013
+++ src/usr.sbin/dumpfs/dumpfs.c	Tue Mar  6 07:45:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumpfs.c,v 1.63 2013/09/03 04:02:13 dholland Exp $	*/
+/*	$NetBSD: dumpfs.c,v 1.64 2018/03/06 07:45:38 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)dumpfs.c	8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: dumpfs.c,v 1.63 2013/09/03 04:02:13 dholland Exp $");
+__RCSID("$NetBSD: dumpfs.c,v 1.64 2018/03/06 07:45:38 mlelstv Exp $");
 #endif
 #endif /* not lint */
 
@@ -52,6 +52,7 @@ __RCSID("$NetBSD: dumpfs.c,v 1.63 2013/0
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -405,6 +406,8 @@ print_superblock(struct fs *fs, uint16_t
 	fs->fs_journallocs[0], fs->fs_journallocs[1]);
 	printf("\tloc2 %" PRIu64 "\tloc3 %" PRIu64 "\n",
 	fs->fs_journallocs[2], fs->fs_journallocs[3]);
+	printf("usrquota %" PRIu64 "\tgrpquota %" PRIu64 "\n",
+		fs->fs_quotafile[USRQUOTA], fs->fs_quotafile[GRPQUOTA]);
 	printf("flags\t");
 	if (fs->fs_flags == 0)
 		printf("none");



CVS commit: src/sys/dev/sdmmc

2018-03-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Mar  6 07:41:55 UTC 2018

Modified Files:
src/sys/dev/sdmmc: sdmmc.c

Log Message:
correct whitespace in attach message


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sdmmc/sdmmc.c

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

Modified files:

Index: src/sys/dev/sdmmc/sdmmc.c
diff -u src/sys/dev/sdmmc/sdmmc.c:1.34 src/sys/dev/sdmmc/sdmmc.c:1.35
--- src/sys/dev/sdmmc/sdmmc.c:1.34	Fri Feb 17 10:51:48 2017
+++ src/sys/dev/sdmmc/sdmmc.c	Tue Mar  6 07:41:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc.c,v 1.34 2017/02/17 10:51:48 nonaka Exp $	*/
+/*	$NetBSD: sdmmc.c,v 1.35 2018/03/06 07:41:55 mlelstv Exp $	*/
 /*	$OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $	*/
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.34 2017/02/17 10:51:48 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.35 2018/03/06 07:41:55 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -524,6 +524,7 @@ sdmmc_print(void *aux, const char *pnp)
 printf("standard function interface code 0x%x",
 sf->interface);
 			printf(")");
+			i = 1;
 		}
 		printf("%sat %s", i ? " " : "", pnp);
 	}



CVS commit: src/sys/arch/aarch64/include

2018-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  6 07:36:10 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Another harmless typo


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/armreg.h

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

Modified files:

Index: src/sys/arch/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.4 src/sys/arch/aarch64/include/armreg.h:1.5
--- src/sys/arch/aarch64/include/armreg.h:1.4	Tue Mar  6 07:31:57 2018
+++ src/sys/arch/aarch64/include/armreg.h	Tue Mar  6 07:36:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.4 2018/03/06 07:31:57 skrll Exp $ */
+/* $NetBSD: armreg.h,v 1.5 2018/03/06 07:36:09 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -207,7 +207,7 @@ static const uintmax_t
  ESR_EC_CP15_RRT	= 4,	// A32: MCRR/MRRC access to CP15 !EC=0
  ESR_EC_CP14_RT	= 5,	// A32: MCR/MRC access to CP14
  ESR_EC_CP14_DT	= 6,	// A32: LDC/STC access to CP14
- ESR_EC_FP_ACCCES	= 7,	// AXX: Access to SIMD/FP Registers
+ ESR_EC_FP_ACCESS	= 7,	// AXX: Access to SIMD/FP Registers
  ESR_EC_FPID	= 8,	// A32: MCR/MRC access to CP10 !EC=7
  ESR_EC_CP14_RRT	= 12,	// A32: MRRC access to CP14
  ESR_EC_ILL_STATE	= 14,	// AXX: Illegal Execution State



CVS commit: src/sys/arch/aarch64/include

2018-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  6 07:31:57 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Fix harmless typo


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/include/armreg.h

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

Modified files:

Index: src/sys/arch/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.3 src/sys/arch/aarch64/include/armreg.h:1.4
--- src/sys/arch/aarch64/include/armreg.h:1.3	Wed Dec 20 14:58:08 2017
+++ src/sys/arch/aarch64/include/armreg.h	Tue Mar  6 07:31:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.3 2017/12/20 14:58:08 skrll Exp $ */
+/* $NetBSD: armreg.h,v 1.4 2018/03/06 07:31:57 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -201,7 +201,7 @@ AARCH64REG_WRITE_INLINE(esr_el1)
 
 static const uintmax_t
 ESR_EC = 		__BITS(31,26), // Exception Cause
- ESR_EC_UNKOWN	= 0,	// AXX: Unknown Reason
+ ESR_EC_UNKNOWN	= 0,	// AXX: Unknown Reason
  ESR_EC_WFX		= 1,	// AXX: WFI or WFE instruction execution
  ESR_EC_CP15_RT	= 3,	// A32: MCR/MRC access to CP15 !EC=0
  ESR_EC_CP15_RRT	= 4,	// A32: MCRR/MRRC access to CP15 !EC=0



CVS commit: src/sys

2018-03-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Mar  6 07:27:55 UTC 2018

Modified Files:
src/sys/net: if_llatbl.c if_llatbl.h
src/sys/netinet: in.c
src/sys/netinet6: in6.c

Log Message:
Use pool(9) for llentry allocations

llentry is easy to be leaked and pool suits for it because pool is usable to
detect leaks.

Also sweep unnecessary wrappers for llentry, in_llentry and in6_llentry.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/net/if_llatbl.c
cvs rdiff -u -r1.13 -r1.14 src/sys/net/if_llatbl.h
cvs rdiff -u -r1.222 -r1.223 src/sys/netinet/in.c
cvs rdiff -u -r1.263 -r1.264 src/sys/netinet6/in6.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/if_llatbl.c
diff -u src/sys/net/if_llatbl.c:1.25 src/sys/net/if_llatbl.c:1.26
--- src/sys/net/if_llatbl.c:1.25	Tue Mar  6 07:25:27 2018
+++ src/sys/net/if_llatbl.c	Tue Mar  6 07:27:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.c,v 1.25 2018/03/06 07:25:27 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.c,v 1.26 2018/03/06 07:27:55 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -67,6 +67,7 @@
 
 static SLIST_HEAD(, lltable) lltables;
 krwlock_t lltable_rwlock;
+static struct pool llentry_pool;
 
 static void lltable_unlink(struct lltable *llt);
 static void llentries_unlink(struct lltable *llt, struct llentries *head);
@@ -335,6 +336,24 @@ lltable_drop_entry_queue(struct llentry 
 	return (pkts_dropped);
 }
 
+struct llentry *
+llentry_pool_get(int flags)
+{
+	struct llentry *lle;
+
+	lle = pool_get(_pool, flags);
+	if (lle != NULL)
+		memset(lle, 0, sizeof(*lle));
+	return lle;
+}
+
+void
+llentry_pool_put(struct llentry *lle)
+{
+
+	pool_put(_pool, lle);
+}
+
 /*
  * Deletes an address from the address table.
  * This function is called by the timer functions
@@ -747,6 +766,9 @@ lltableinit(void)
 
 	SLIST_INIT();
 	rw_init(_rwlock);
+
+	pool_init(_pool, sizeof(struct llentry), 0, 0, 0, "llentrypl",
+	NULL, IPL_SOFTNET);
 }
 
 #ifdef __FreeBSD__

Index: src/sys/net/if_llatbl.h
diff -u src/sys/net/if_llatbl.h:1.13 src/sys/net/if_llatbl.h:1.14
--- src/sys/net/if_llatbl.h:1.13	Fri Nov 10 07:24:28 2017
+++ src/sys/net/if_llatbl.h	Tue Mar  6 07:27:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.h,v 1.13 2017/11/10 07:24:28 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.h,v 1.14 2018/03/06 07:27:55 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -266,6 +266,9 @@ size_t		llentry_free(struct llentry *);
 struct llentry  *llentry_alloc(struct ifnet *, struct lltable *,
 		struct sockaddr_storage *);
 
+struct llentry  *llentry_pool_get(int);
+void		llentry_pool_put(struct llentry *);
+
 /* helper functions */
 size_t lltable_drop_entry_queue(struct llentry *);
 

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.222 src/sys/netinet/in.c:1.223
--- src/sys/netinet/in.c:1.222	Tue Mar  6 07:25:27 2018
+++ src/sys/netinet/in.c	Tue Mar  6 07:27:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.222 2018/03/06 07:25:27 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.223 2018/03/06 07:27:55 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.222 2018/03/06 07:25:27 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.223 2018/03/06 07:27:55 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -1918,10 +1918,6 @@ in_tunnel_validate(const struct ip *ip, 
 
 #if NARP > 0
 
-struct in_llentry {
-	struct llentry		base;
-};
-
 #define	IN_LLTBL_DEFAULT_HSIZE	32
 #define	IN_LLTBL_HASH(k, h) \
 	(((k >> 8) ^ k) >> 8) ^ k) >> 8) ^ k) & ((h) - 1))
@@ -1939,15 +1935,15 @@ in_lltable_destroy_lle(struct llentry *l
 
 	LLE_WUNLOCK(lle);
 	LLE_LOCK_DESTROY(lle);
-	kmem_intr_free(lle, sizeof(*lle));
+	llentry_pool_put(lle);
 }
 
 static struct llentry *
 in_lltable_new(struct in_addr addr4, u_int flags)
 {
-	struct in_llentry *lle;
+	struct llentry *lle;
 
-	lle = kmem_intr_zalloc(sizeof(*lle), KM_NOSLEEP);
+	lle = llentry_pool_get(PR_NOWAIT);
 	if (lle == NULL)		/* NB: caller generates msg */
 		return NULL;
 
@@ -1955,14 +1951,14 @@ in_lltable_new(struct in_addr addr4, u_i
 	 * For IPv4 this will trigger "arpresolve" to generate
 	 * an ARP request.
 	 */
-	lle->base.la_expire = time_uptime; /* mark expired */
-	lle->base.r_l3addr.addr4 = addr4;
-	lle->base.lle_refcnt = 1;
-	lle->base.lle_free = in_lltable_destroy_lle;
-	LLE_LOCK_INIT(>base);
-	callout_init(>base.la_timer, CALLOUT_MPSAFE);
+	lle->la_expire = time_uptime; /* mark expired */
+	lle->r_l3addr.addr4 = addr4;
+	lle->lle_refcnt = 1;
+	lle->lle_free = in_lltable_destroy_lle;
+	LLE_LOCK_INIT(lle);
+	callout_init(>la_timer, CALLOUT_MPSAFE);
 
-	return (>base);
+	return lle;
 

CVS commit: src/sys

2018-03-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Mar  6 07:25:27 UTC 2018

Modified Files:
src/sys/net: if_llatbl.c
src/sys/netinet: in.c
src/sys/netinet6: in6.c

Log Message:
Fix memory leaks on arp -d and ndp -d for static entries

We have to delete entries on in_lltable_delete and in6_lltable_delete
unconditionally.  Note that we don't need to worry about LLE_IFADDR because
there is no such entries now.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/net/if_llatbl.c
cvs rdiff -u -r1.221 -r1.222 src/sys/netinet/in.c
cvs rdiff -u -r1.262 -r1.263 src/sys/netinet6/in6.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/if_llatbl.c
diff -u src/sys/net/if_llatbl.c:1.24 src/sys/net/if_llatbl.c:1.25
--- src/sys/net/if_llatbl.c:1.24	Tue Mar  6 07:24:01 2018
+++ src/sys/net/if_llatbl.c	Tue Mar  6 07:25:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.c,v 1.24 2018/03/06 07:24:01 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.c,v 1.25 2018/03/06 07:25:27 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -351,6 +351,8 @@ llentry_free(struct llentry *lle)
 
 	LLE_WLOCK_ASSERT(lle);
 
+	lle->la_flags |= LLE_DELETED;
+
 	if ((lle->la_flags & LLE_LINKED) != 0) {
 		llt = lle->lle_tbl;
 

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.221 src/sys/netinet/in.c:1.222
--- src/sys/netinet/in.c:1.221	Tue Mar  6 07:24:01 2018
+++ src/sys/netinet/in.c	Tue Mar  6 07:25:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.221 2018/03/06 07:24:01 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.222 2018/03/06 07:25:27 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.221 2018/03/06 07:24:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.222 2018/03/06 07:25:27 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -2135,7 +2135,6 @@ in_lltable_delete(struct lltable *llt, u
 	}
 
 	LLE_WLOCK(lle);
-	lle->la_flags |= LLE_DELETED;
 #ifdef LLTABLE_DEBUG
 	{
 		char buf[64];
@@ -2144,10 +2143,7 @@ in_lltable_delete(struct lltable *llt, u
 		__func__, buf, lle);
 	}
 #endif
-	if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
-		llentry_free(lle);
-	else
-		LLE_WUNLOCK(lle);
+	llentry_free(lle);
 
 	return (0);
 }

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.262 src/sys/netinet6/in6.c:1.263
--- src/sys/netinet6/in6.c:1.262	Tue Mar  6 07:24:01 2018
+++ src/sys/netinet6/in6.c	Tue Mar  6 07:25:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.262 2018/03/06 07:24:01 ozaki-r Exp $	*/
+/*	$NetBSD: in6.c,v 1.263 2018/03/06 07:25:27 ozaki-r Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.262 2018/03/06 07:24:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.263 2018/03/06 07:25:27 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2549,7 +2549,6 @@ in6_lltable_delete(struct lltable *llt, 
 	}
 
 	LLE_WLOCK(lle);
-	lle->la_flags |= LLE_DELETED;
 #ifdef LLTABLE_DEBUG
 	{
 		char buf[64];
@@ -2558,10 +2557,7 @@ in6_lltable_delete(struct lltable *llt, 
 		__func__, buf, lle);
 	}
 #endif
-	if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
-		llentry_free(lle);
-	else
-		LLE_WUNLOCK(lle);
+	llentry_free(lle);
 
 	return 0;
 }



CVS commit: src/sys

2018-03-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Mar  6 07:24:01 UTC 2018

Modified Files:
src/sys/net: if_llatbl.c
src/sys/netinet: if_arp.c in.c
src/sys/netinet6: in6.c nd6.c

Log Message:
Fix reference leaks of llentry

callout_reset and callout_halt can cancel a pending callout without telling us.
Detect a cancel and remove a reference by using callout_pending and
callout_stop (it's a bit tricy though, we can detect it).

While here, we can remove remaining abuses of mutex_owned for softnet_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/net/if_llatbl.c
cvs rdiff -u -r1.269 -r1.270 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.220 -r1.221 src/sys/netinet/in.c
cvs rdiff -u -r1.261 -r1.262 src/sys/netinet6/in6.c
cvs rdiff -u -r1.245 -r1.246 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/net/if_llatbl.c
diff -u src/sys/net/if_llatbl.c:1.23 src/sys/net/if_llatbl.c:1.24
--- src/sys/net/if_llatbl.c:1.23	Wed Feb 14 14:15:53 2018
+++ src/sys/net/if_llatbl.c	Tue Mar  6 07:24:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.c,v 1.23 2018/02/14 14:15:53 maxv Exp $	*/
+/*	$NetBSD: if_llatbl.c,v 1.24 2018/03/06 07:24:01 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -358,6 +358,18 @@ llentry_free(struct llentry *lle)
 		llt->llt_unlink_entry(lle);
 	}
 
+	/*
+	 * Stop a pending callout if one exists.  If we cancel one, we have to
+	 * remove a reference to avoid a leak.  callout_pending is required to
+	 * to exclude the case that the callout has never been scheduled.
+	 */
+	/* XXX once softnet_lock goes away, we should use callout_halt */
+	if (callout_pending(>la_timer)) {
+		bool expired = callout_stop(>la_timer);
+		if (!expired)
+			LLE_REMREF(lle);
+	}
+
 	pkts_dropped = lltable_drop_entry_queue(lle);
 
 	LLE_FREE_LOCKED(lle);
@@ -428,28 +440,8 @@ lltable_purge_entries(struct lltable *ll
 	llentries_unlink(llt, );
 	IF_AFDATA_WUNLOCK(llt->llt_ifp);
 
-	LIST_FOREACH_SAFE(lle, , lle_chain, next) {
-		/*
-		 * We need to release the lock here to lle_timer proceeds;
-		 * lle_timer should stop immediately if LLE_LINKED isn't set.
-		 * Note that we cannot pass lle->lle_lock to callout_halt
-		 * because it's a rwlock.
-		 */
-		LLE_ADDREF(lle);
-		LLE_WUNLOCK(lle);
-#ifdef NET_MPSAFE
-		callout_halt(>la_timer, NULL);
-#else
-		if (mutex_owned(softnet_lock))
-			callout_halt(>la_timer, softnet_lock);
-		else
-			callout_halt(>la_timer, NULL);
-#endif
-		LLE_WLOCK(lle);
-		LLE_REMREF(lle);
-		llentry_free(lle);
-	}
-
+	LIST_FOREACH_SAFE(lle, , lle_chain, next)
+		(void)llentry_free(lle);
 }
 
 /*

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.269 src/sys/netinet/if_arp.c:1.270
--- src/sys/netinet/if_arp.c:1.269	Tue Mar  6 07:19:03 2018
+++ src/sys/netinet/if_arp.c	Tue Mar  6 07:24:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.269 2018/03/06 07:19:03 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.270 2018/03/06 07:24:01 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.269 2018/03/06 07:19:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.270 2018/03/06 07:24:01 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -318,28 +318,17 @@ arptimer(void *arg)
 	KASSERT((lle->la_flags & LLE_STATIC) == 0);
 
 	LLE_WLOCK(lle);
-	if (callout_pending(>la_timer)) {
-		/*
-		 * Here we are a bit odd in the treatment of
-		 * active/pending. If the pending bit is set, it got
-		 * rescheduled before I ran. The active
-		 * bit we ignore, since if it was stopped
-		 * in ll_tablefree() and was currently running
-		 * it would have return 0 so the code would
-		 * not have deleted it since the callout could
-		 * not be stopped so we want to go through
-		 * with the delete here now. If the callout
-		 * was restarted, the pending bit will be back on and
-		 * we just want to bail since the callout_reset would
-		 * return 1 and our reference would have been removed
-		 * by arpresolve() below.
-		 */
-		LLE_WUNLOCK(lle);
+
+	/*
+	 * This shortcut is required to avoid trying to touch ifp that may be
+	 * being destroyed.
+	 */
+	if ((lle->la_flags & LLE_LINKED) == 0) {
+		LLE_FREE_LOCKED(lle);
 		return;
 	}
-	ifp = lle->lle_tbl->llt_ifp;
 
-	callout_stop(>la_timer);
+	ifp = lle->lle_tbl->llt_ifp;
 
 	/* XXX: LOR avoidance. We still have ref on lle. */
 	LLE_WUNLOCK(lle);
@@ -369,6 +358,19 @@ arp_settimer(struct llentry *la, int sec
 	LLE_WLOCK_ASSERT(la);
 	KASSERT((la->la_flags & LLE_STATIC) == 0);
 
+	/*
+	 * We have to take care of a reference leak which occurs if
+	 * callout_reset overwrites a pending callout schedule.  Unfortunately
+	 * we don't have a mean to know the overwrite, 

CVS commit: src/sys

2018-03-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Mar  6 07:20:41 UTC 2018

Modified Files:
src/sys/netinet: in.c
src/sys/netinet6: in6.c

Log Message:
Add assertions

We must not destroy llentries holding mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/netinet/in.c
cvs rdiff -u -r1.260 -r1.261 src/sys/netinet6/in6.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.219 src/sys/netinet/in.c:1.220
--- src/sys/netinet/in.c:1.219	Sat Feb 24 07:37:09 2018
+++ src/sys/netinet/in.c	Tue Mar  6 07:20:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.219 2018/02/24 07:37:09 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.220 2018/03/06 07:20:41 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.219 2018/02/24 07:37:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.220 2018/03/06 07:20:41 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -1935,6 +1935,8 @@ static void
 in_lltable_destroy_lle(struct llentry *lle)
 {
 
+	KASSERT(lle->la_numheld == 0);
+
 	LLE_WUNLOCK(lle);
 	LLE_LOCK_DESTROY(lle);
 	kmem_intr_free(lle, sizeof(*lle));

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.260 src/sys/netinet6/in6.c:1.261
--- src/sys/netinet6/in6.c:1.260	Sat Feb 24 07:37:09 2018
+++ src/sys/netinet6/in6.c	Tue Mar  6 07:20:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.260 2018/02/24 07:37:09 ozaki-r Exp $	*/
+/*	$NetBSD: in6.c,v 1.261 2018/03/06 07:20:41 ozaki-r Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.260 2018/02/24 07:37:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.261 2018/03/06 07:20:41 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2403,6 +2403,8 @@ static void
 in6_lltable_destroy_lle(struct llentry *lle)
 {
 
+	KASSERT(lle->la_numheld == 0);
+
 	LLE_WUNLOCK(lle);
 	LLE_LOCK_DESTROY(lle);
 	kmem_intr_free(lle, sizeof(struct in6_llentry));



CVS commit: src/sys/netinet

2018-03-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Mar  6 07:19:03 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Tweak sanity checks

Scheduling a timer of static entries is wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.268 src/sys/netinet/if_arp.c:1.269
--- src/sys/netinet/if_arp.c:1.268	Thu Mar  1 14:40:57 2018
+++ src/sys/netinet/if_arp.c	Tue Mar  6 07:19:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.268 2018/03/01 14:40:57 roy Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.269 2018/03/06 07:19:03 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.268 2018/03/01 14:40:57 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.269 2018/03/06 07:19:03 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -315,11 +315,7 @@ arptimer(void *arg)
 	struct llentry *lle = arg;
 	struct ifnet *ifp;
 
-	if (lle == NULL)
-		return;
-
-	if (lle->la_flags & LLE_STATIC)
-		return;
+	KASSERT((lle->la_flags & LLE_STATIC) == 0);
 
 	LLE_WLOCK(lle);
 	if (callout_pending(>la_timer)) {
@@ -371,6 +367,8 @@ arp_settimer(struct llentry *la, int sec
 {
 
 	LLE_WLOCK_ASSERT(la);
+	KASSERT((la->la_flags & LLE_STATIC) == 0);
+
 	LLE_ADDREF(la);
 	callout_reset(>la_timer, hz * sec, arptimer, la);
 }



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

2018-03-05 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Tue Mar  6 06:04:21 UTC 2018

Modified Files:
src/sys/arch/amiga/conf: files.amiga

Log Message:
if_xsh needs mii_bitbang; make a pared down kernel build


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/arch/amiga/conf/files.amiga

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/amiga/conf/files.amiga
diff -u src/sys/arch/amiga/conf/files.amiga:1.178 src/sys/arch/amiga/conf/files.amiga:1.179
--- src/sys/arch/amiga/conf/files.amiga:1.178	Mon Oct  3 14:26:02 2016
+++ src/sys/arch/amiga/conf/files.amiga	Tue Mar  6 06:04:21 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amiga,v 1.178 2016/10/03 14:26:02 rkujawa Exp $
+#	$NetBSD: files.amiga,v 1.179 2018/03/06 06:04:21 spz Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -254,7 +254,7 @@ device	xsh: xshbus
 attach	xsh at zbus
 file	arch/amiga/dev/xsh.c		xsh needs-flag
 
-attach	ne at xshbus with ne_xsh: ax88190
+attach	ne at xshbus with ne_xsh: ax88190, mii_bitbang
 file	arch/amiga/dev/if_ne_xsh.c	ne_xsh needs-flag
 
 # Hydra ethernet card



CVS commit: [pgoyette-compat] src/sys

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:46:06 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_mod.c
uipc_syscalls_40.c
src/sys/net [pgoyette-compat]: if.c

Log Message:
Untangle some networking compat code so we can build a kernel with
networking and MODULAR, but without any actual COMPAT_* code (ie,
assuming that all the compat stuff can be added later via modules).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.14.1 src/sys/compat/common/compat_mod.c
cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/compat/common/uipc_syscalls_40.c
cvs rdiff -u -r1.419 -r1.419.2.1 src/sys/net/if.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/compat/common/compat_mod.c
diff -u src/sys/compat/common/compat_mod.c:1.24 src/sys/compat/common/compat_mod.c:1.24.14.1
--- src/sys/compat/common/compat_mod.c:1.24	Sat Nov  5 23:30:22 2016
+++ src/sys/compat/common/compat_mod.c	Tue Mar  6 05:46:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_mod.c,v 1.24 2016/11/05 23:30:22 pgoyette Exp $	*/
+/*	$NetBSD: compat_mod.c,v 1.24.14.1 2018/03/06 05:46:06 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24 2016/11/05 23:30:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.1 2018/03/06 05:46:06 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -65,6 +65,16 @@ __KERNEL_RCSID(0, "$NetBSD: compat_mod.c
 static struct sysctllog *compat_clog = NULL;
 #endif
 
+#ifdef COMPAT_40
+void if_40_init(void);
+void if_40_fini(void);
+#endif
+
+#ifdef COMPAT_50
+void if_50_init(void);
+void if_50_fini(void);
+#endif
+
 MODULE(MODULE_CLASS_EXEC, compat, NULL);
 
 int	ttcompat(struct tty *, u_long, void *, int, struct lwp *);
@@ -238,6 +248,12 @@ compat_modcmd(modcmd_t cmd, void *arg)
 		ttcompatvec = ttcompat;
 		if_43_init();
 #endif
+#ifdef COMPAT_40
+		if_40_init();
+#endif
+#ifdef COMPAT_50
+		if_50_init();
+#endif
 #ifdef COMPAT_16
 #if defined(COMPAT_SIGCONTEXT)
 		KASSERT(emul_netbsd.e_sigobject == NULL);
@@ -337,4 +353,7 @@ compat_sysctl_fini(void)
 #if defined(COMPAT_43)
 	if_43_fini();
 #endif
+#ifdef COMPAT_50
+	if_50_fini();
+#endif
 }

Index: src/sys/compat/common/uipc_syscalls_40.c
diff -u src/sys/compat/common/uipc_syscalls_40.c:1.15 src/sys/compat/common/uipc_syscalls_40.c:1.15.2.1
--- src/sys/compat/common/uipc_syscalls_40.c:1.15	Wed Nov 22 15:25:34 2017
+++ src/sys/compat/common/uipc_syscalls_40.c	Tue Mar  6 05:46:06 2018
@@ -1,9 +1,9 @@
-/*	$NetBSD: uipc_syscalls_40.c,v 1.15 2017/11/22 15:25:34 martin Exp $	*/
+/*	$NetBSD: uipc_syscalls_40.c,v 1.15.2.1 2018/03/06 05:46:06 pgoyette Exp $	*/
 
 /* written by Pavel Cahyna, 2006. Public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.15 2017/11/22 15:25:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.15.2.1 2018/03/06 05:46:06 pgoyette Exp $");
 
 /*
  * System call interface to the socket abstraction.
@@ -151,3 +151,22 @@ release_exit:
 	return error;
 }
 #endif
+#if defined(COMPAT_40)
+static int (*orig_compat_ifconf)(u_long, void *);
+static void (*orig_compat_ifconf(u_long, void *);
+ 
+void  
+if_40_init(void)
+{
+ 
+	orig_compat_ifconf = vec_compat_ifconf; 
+	vec_compat_ifconf = compat_ifconf;
+}
+ 
+void
+if_40_fini(void)
+{
+ 
+	vec_compat_ifconf = orig_compat_ifconf;
+}
+#endif /* defined(COMPAT_40) */

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.419 src/sys/net/if.c:1.419.2.1
--- src/sys/net/if.c:1.419	Tue Jan 30 10:40:02 2018
+++ src/sys/net/if.c	Tue Mar  6 05:46:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.419 2018/01/30 10:40:02 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.419.2.1 2018/03/06 05:46:06 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.419 2018/01/30 10:40:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.419.2.1 2018/03/06 05:46:06 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -254,6 +254,20 @@ u_long (*vec_compat_cvtcmd)(u_long) = st
 int (*vec_compat_ifioctl)(struct socket *, u_long, u_long, void *,
 	struct lwp *) = NULL;
 
+/*
+ * And a few more
+ */
+int stub_compat_ifdatareq(struct lwp *, u_long, void *);
+int (*vec_compat_ifdatareq)(struct lwp *, u_long, void *) =
+stub_compat_ifdatareq;
+
+void stub_compat_ifreqo2n(struct oifreq *, struct ifreq *);
+void (*vec_compat_ifreqo2n)(struct oifreq *, struct ifreq *) =
+stub_compat_ifreqo2n;
+
+int stub_compat_ifconf(u_long, void *);
+int (*vec_compat_ifconf)(u_long, void *) = stub_compat_ifconf;
+
 /* The stub version of compat_cvtcmd() */
 u_long stub_compat_cvtcmd(u_long cmd)
 {
@@ -261,6 +275,26 @@ u_long stub_compat_cvtcmd(u_long cmd)
 	return cmd;
 }
 

CVS commit: [pgoyette-compat] src/sys/kern

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:44:37 UTC 2018

Modified Files:
src/sys/kern [pgoyette-compat]: files.kern

Log Message:
Don't include the compat_mod.c here


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.2.1 src/sys/kern/files.kern

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

Modified files:

Index: src/sys/kern/files.kern
diff -u src/sys/kern/files.kern:1.16 src/sys/kern/files.kern:1.16.2.1
--- src/sys/kern/files.kern:1.16	Sat Dec 16 10:15:12 2017
+++ src/sys/kern/files.kern	Tue Mar  6 05:44:37 2018
@@ -1,12 +1,11 @@
-#	$NetBSD: files.kern,v 1.16 2017/12/16 10:15:12 maxv Exp $
+#	$NetBSD: files.kern,v 1.16.2.1 2018/03/06 05:44:37 pgoyette Exp $
 
 #
 # kernel sources
 #
 define	kern:	machdep, uvm
 defflag	opt_kern.h			KERN
-file	compat/common/compat_util.c	kern
-file	compat/common/compat_mod.c	compat_netbsd | compat_netbsd32
+#file	compat/common/compat_util.c	kern
 file	conf/debugsyms.c		kern
 file	conf/param.c			kern
 file	kern/bufq_disksort.c		bufq_disksort



CVS commit: [pgoyette-compat] src/sys/conf

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:43:02 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: std

Log Message:
Include utilities required by compat stuff


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/conf/std

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

Modified files:

Index: src/sys/conf/std
diff -u src/sys/conf/std:1.22 src/sys/conf/std:1.22.14.1
--- src/sys/conf/std:1.22	Wed Nov  2 00:11:59 2016
+++ src/sys/conf/std	Tue Mar  6 05:43:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: std,v 1.22 2016/11/02 00:11:59 pgoyette Exp $
+# $NetBSD: std,v 1.22.14.1 2018/03/06 05:43:02 pgoyette Exp $
 #
 # standard MI 'options'
 #
@@ -34,6 +34,13 @@ options	AIO		# POSIX asynchronous I/O
 options	MQUEUE		# POSIX message queues
 
 #
+# Common compatibility functions. They happen to be needed even when
+# no compatibility option is explicitly enabled.
+#
+options 	COMPAT_UTILS
+
+#
+
 # Security model.
 #
 options	secmodel_bsd44	# Traditional 4.4BSD security model



CVS commit: [pgoyette-compat] src/sys/conf

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:41:51 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: files

Log Message:
Include the list of compat files


To generate a diff of this commit:
cvs rdiff -u -r1.1196 -r1.1196.2.1 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1196 src/sys/conf/files:1.1196.2.1
--- src/sys/conf/files:1.1196	Tue Feb 27 14:28:01 2018
+++ src/sys/conf/files	Tue Mar  6 05:41:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1196 2018/02/27 14:28:01 maxv Exp $
+#	$NetBSD: files,v 1.1196.2.1 2018/03/06 05:41:51 pgoyette Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -164,6 +164,8 @@ defflagCOMPAT_VAX1K
 defflagCOMPAT_43
 defflag	opt_compat_netbsd.h	COMPAT_NOMID
 
+include	"compat/common/files.common"
+
 define	machdep
 defflag	opt_machdep.h		MACHDEP
 



CVS commit: [pgoyette-compat] src/sys/conf

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:40:32 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: Makefile.kern.inc

Log Message:
No longer build the libcompat.o which ends up including most of the
compat_netbsd code without creating the module entry that other
modules are depending on, which in turn causes the modules to fail
to load because of redefined symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.264.2.1 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.264 src/sys/conf/Makefile.kern.inc:1.264.2.1
--- src/sys/conf/Makefile.kern.inc:1.264	Sat Feb 17 22:47:14 2018
+++ src/sys/conf/Makefile.kern.inc	Tue Mar  6 05:40:32 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.264 2018/02/17 22:47:14 joerg Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.264.2.1 2018/03/06 05:40:32 pgoyette Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -155,7 +155,7 @@ LINK_O?=	@${_MKSHMSG} "   link  ${.CURDI
 		${KLINK.o}
 
 ##
-## (3) libkern and compat
+## (3) libkern
 ##
 ## Set KERN_AS in the port Makefile to "obj" or "library".  The
 ## default is "library", as documented in $S/lib/libkern/Makefile.inc.
@@ -171,16 +171,6 @@ LIBKERN?=	${KERNLIB_PROF}
 
 LIBKERNLN?=	${KERNLIBLN}
 
-### find out what to use for libcompat
-.include "$S/compat/common/Makefile.inc"
-.ifndef PROF
-SYSLIBCOMPAT?=	${COMPATLIB}
-.else
-SYSLIBCOMPAT?=	${COMPATLIB_PROF}
-.endif
-
-SYSLIBCOMPATLN?=	${COMPATLIBLN}
-
 ##
 ## (4) local objects, compile rules, and dependencies
 ##
@@ -205,7 +195,7 @@ _MD_OBJS=	${MD_OBJS}
 # load lines for config "xxx" will be emitted as:
 # xxx: ${SYSTEM_DEP} swap.o vers.o build_kernel
 
-SYSTEM_LIB=	${MD_LIBS} ${SYSLIBCOMPAT} ${LIBKERN}
+SYSTEM_LIB=	${MD_LIBS} ${LIBKERN}
 SYSTEM_OBJ?=	${_MD_OBJS} ${OBJS} ${SYSTEM_LIB}
 SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ:O}
 .if defined(CTFMERGE)



CVS commit: [pgoyette-compat] src/sys/compat/common

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 05:38:20 UTC 2018

Added Files:
src/sys/compat/common [pgoyette-compat]: files.common

Log Message:
Add a files.common to list all the compat source files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/compat/common/files.common

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

Added files:

Index: src/sys/compat/common/files.common
diff -u /dev/null src/sys/compat/common/files.common:1.1.2.1
--- /dev/null	Tue Mar  6 05:38:20 2018
+++ src/sys/compat/common/files.common	Tue Mar  6 05:38:20 2018
@@ -0,0 +1,89 @@
+#	$NetBSD: files.common,v 1.1.2.1 2018/03/06 05:38:20 pgoyette Exp $
+
+#
+# Generic files, used by all compat options.
+#
+file	compat/common/compat_mod.c		compat_netbsd
+file	compat/common/compat_exec.c		compat_netbsd
+file	compat/common/compat_util.c		compat_netbsd
+
+#
+# Sources for syscall and ioctl compatibility across the versions.
+#
+
+# Compatibility code for 4.3BSD
+file	compat/common/kern_exit_43.c		compat_netbsd
+file	compat/common/kern_info_43.c		compat_netbsd
+file	compat/common/kern_resource_43.c	compat_netbsd
+file	compat/common/kern_sig_43.c		compat_netbsd
+file	compat/common/tty_43.c			compat_netbsd
+file	compat/common/uipc_syscalls_43.c	compat_netbsd
+file	compat/common/vfs_syscalls_43.c		compat_netbsd
+file	compat/common/vm_43.c			compat_netbsd
+file	compat/common/if_43.c			compat_netbsd
+
+# Compatibility code for NetBSD 0.9
+file	compat/common/kern_info_09.c		compat_netbsd
+
+# Compatibility code for NetBSD 1.2
+file	compat/common/kern_xxx_12.c		compat_netbsd
+file	compat/common/vfs_syscalls_12.c		compat_netbsd
+file	compat/common/vm_12.c			compat_netbsd
+
+# Compatibility code for NetBSD 1.3
+file	compat/common/kern_sig_13.c		compat_netbsd
+
+# Compatibility code for NetBSD 1.4
+file	compat/common/rtsock_14.c		compat_netbsd
+
+# Compatibility code for NetBSD 1.6
+file	compat/common/kern_sig_16.c		compat_netbsd
+
+# Compatibility code for NetBSD 2.0
+file	compat/common/vfs_syscalls_20.c		compat_netbsd
+
+# Compatibility code for NetBSD 3.0
+file	compat/common/kern_time_30.c		compat_netbsd
+file	compat/common/vfs_syscalls_30.c		compat_netbsd
+file	compat/common/uipc_syscalls_30.c	compat_netbsd
+
+# Compatibility code for NetBSD 4.0
+file	compat/common/vfs_syscalls_40.c		compat_netbsd
+file	compat/common/uipc_syscalls_40.c	compat_netbsd
+
+# Compatibility code for NetBSD 5.0
+file	compat/common/kern_50.c			compat_netbsd
+file	compat/common/kern_time_50.c		compat_netbsd
+file	compat/common/kern_select_50.c		compat_netbsd
+file	compat/common/rndpseudo_50.c		compat_netbsd
+file	compat/common/rtsock_50.c		compat_netbsd
+file	compat/common/vfs_syscalls_50.c		compat_netbsd
+file	compat/common/uipc_syscalls_50.c	compat_netbsd
+
+# Compatibility code for NetBSD 6.0
+file	compat/common/kern_sa_60.c		compat_netbsd
+file	compat/common/tty_60.c			compat_netbsd
+file	compat/common/kern_time_60.c		compat_netbsd
+
+# Compatibility code for NetBSD 7.0
+file	compat/common/rtsock_70.c		compat_netbsd
+file	compat/common/uipc_usrreq_70.c		compat_netbsd
+
+#
+# Sources for sysv ipc compatibility across the versions.
+#
+
+# Compatibility code for NetBSD 1.0
+file	compat/common/kern_ipc_10.c		compat_netbsd
+
+# Compatibility code for NetBSD 1.4
+file	compat/common/sysv_msg_14.c		compat_netbsd
+file	compat/common/sysv_sem_14.c		compat_netbsd
+file	compat/common/sysv_shm_14.c		compat_netbsd
+
+# Compatibility code for NetBSD 5.0
+file	compat/common/sysv_ipc_50.c		compat_netbsd
+file	compat/common/sysv_msg_50.c		compat_netbsd
+file	compat/common/sysv_sem_50.c		compat_netbsd
+file	compat/common/sysv_shm_50.c		compat_netbsd
+



CVS commit: [pgoyette-compat] src/sys/arch/amd64/conf

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 04:45:04 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [pgoyette-compat]: GENERIC
Added Files:
src/sys/arch/amd64/conf [pgoyette-compat]: NOCOMPAT

Log Message:
Add a NOCOMPAT kernel definition to serve as a baseline for getting
the incremental COMPAT_xx options working.

While here, add some additional "requires COMPAT_xxx" to some of the
options in GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.485 -r1.485.2.1 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/amd64/conf/NOCOMPAT

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.485 src/sys/arch/amd64/conf/GENERIC:1.485.2.1
--- src/sys/arch/amd64/conf/GENERIC:1.485	Mon Feb 26 05:52:50 2018
+++ src/sys/arch/amd64/conf/GENERIC	Tue Mar  6 04:45:04 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.485 2018/02/26 05:52:50 maxv Exp $
+# $NetBSD: GENERIC,v 1.485.2.1 2018/03/06 04:45:04 pgoyette Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.485 $"
+#ident		"GENERIC-$Revision: 1.485.2.1 $"
 
 maxusers	64		# estimated number of users
 
@@ -131,8 +131,9 @@ include 	"conf/compat_netbsd15.config"
 options 	COMPAT_OSSAUDIO
 options 	COMPAT_NETBSD32
 options 	COMPAT_LINUX
-options 	COMPAT_LINUX32	# req. COMPAT_LINUX and COMPAT_NETBSD32
-options 	EXEC_ELF32
+options 	COMPAT_LINUX32	# requires COMPAT_LINUX and COMPAT_NETBSD32
+# and COMPAT_50 (or older)
+options 	EXEC_ELF32	# requires COMPAT_NETBSD32
 
 # Wedge support
 options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances

Added files:

Index: src/sys/arch/amd64/conf/NOCOMPAT
diff -u /dev/null src/sys/arch/amd64/conf/NOCOMPAT:1.1.2.1
--- /dev/null	Tue Mar  6 04:45:04 2018
+++ src/sys/arch/amd64/conf/NOCOMPAT	Tue Mar  6 04:45:04 2018
@@ -0,0 +1,1366 @@
+# $NetBSD: NOCOMPAT,v 1.1.2.1 2018/03/06 04:45:04 pgoyette Exp $
+#
+# GENERIC machine description file
+#
+# This machine description file is used to generate the default NetBSD
+# kernel.  The generic kernel does not include all options, subsystems
+# and device drivers, but should be useful for most applications.
+#
+# The machine description file can be customised for your specific
+# machine to reduce the kernel size and improve its performance.
+#
+# For further information on compiling NetBSD kernels, see the config(8)
+# man page.
+#
+# For further information on hardware support for this architecture, see
+# the intro(4) man page.  For further information about kernel options
+# for this architecture, see the options(4) man page.  For an explanation
+# of each device driver in this file see the section 4 man page for the
+# device.
+
+include 	"arch/amd64/conf/std.amd64"
+
+options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+#ident		"GENERIC-$Revision: 1.1.2.1 $"
+
+maxusers	64		# estimated number of users
+
+# delay between "rebooting ..." message and hardware reset, in milliseconds
+#options 	CPURESET_DELAY=2000
+
+# This option allows you to force a serial console at the specified
+# I/O address.   see console(4) for details.
+#options 	CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600
+#	you don't want the option below ON iff you are using the
+#	serial console option of the new boot strap code.
+#options 	CONS_OVERRIDE	# Always use above! independent of boot info
+
+# The following options override the memory sizes passed in from the boot
+# block.  Use them *only* if the boot block is unable to determine the correct
+# values.  Note that the BIOS may *correctly* report less than 640k of base
+# memory if the extended BIOS data area is located at the top of base memory
+# (as is the case on most recent systems).
+#options 	REALBASEMEM=639		# size of base memory (in KB)
+#options 	REALEXTMEM=15360	# size of extended memory (in KB)
+
+# The following options limit the overall size of physical memory
+# and/or the maximum address used by the system.
+# Contrary to REALBASEMEM and REALEXTMEM, they still use the BIOS memory map
+# and can deal with holes in the memory layout.
+#options 	PHYSMEM_MAX_SIZE=64	# max size of physical memory (in MB)
+#options 	PHYSMEM_MAX_ADDR=2048	# don't use memory above this (in MB)
+
+# Standard system options
+
+options 	INSECURE	# disable kernel security levels - X needs this
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+options 	NTP		# NTP phase/frequency locked loop
+
+options 	KTRACE		# system call tracing via ktrace(1)
+
+options 	CPU_UCODE	# cpu ucode loading support
+
+# Note: SysV IPC parameters could be changed dynamically, see sysctl(8).
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like 

CVS commit: src/sys/dev/pci/ixgbe

2018-03-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Mar  6 03:47:23 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
 Move the location of "struct work" as FreeBSD's "struct task" in ixgbe.h.
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ixgbe.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.32 src/sys/dev/pci/ixgbe/ixgbe.h:1.33
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.32	Fri Mar  2 10:19:20 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Tue Mar  6 03:47:23 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.32 2018/03/02 10:19:20 knakahara Exp $ */
+/* $NetBSD: ixgbe.h,v 1.33 2018/03/06 03:47:23 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -332,6 +332,7 @@ struct ix_queue {
 	int  busy;
 	struct tx_ring   *txr;
 	struct rx_ring   *rxr;
+	struct work  wq_cookie;
 	void *que_si;
 	struct evcnt irqs;
 	char namebuf[32];
@@ -339,8 +340,6 @@ struct ix_queue {
 
 	kmutex_t im_mtx;	/* lock for im_nest and this queue's EIMS/EIMC bit */
 	int  im_nest;
-
-	struct work  wq_cookie;
 };
 
 /*
@@ -363,6 +362,7 @@ struct tx_ring {
 	ixgbe_dma_tag_t		*txtag;
 	char			mtx_name[16];
 	pcq_t			*txr_interq;
+	struct work		wq_cookie;
 	void			*txr_si;
 
 	/* Flow Director */
@@ -376,8 +376,6 @@ struct tx_ring {
 	struct evcnt		no_desc_avail;
 	struct evcnt		total_packets;
 	struct evcnt		pcq_drops;
-
-	struct work		wq_cookie;
 };
 
 



CVS commit: src/usr.bin/tail

2018-03-05 Thread Eitan Adler
Module Name:src
Committed By:   eadler
Date:   Tue Mar  6 03:33:26 UTC 2018

Modified Files:
src/usr.bin/tail: tail.c

Log Message:
[tail] Fix type of 'len'

ok pgoyette


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/tail/tail.c

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

Modified files:

Index: src/usr.bin/tail/tail.c
diff -u src/usr.bin/tail/tail.c:1.19 src/usr.bin/tail/tail.c:1.20
--- src/usr.bin/tail/tail.c:1.19	Mon Oct  2 08:23:23 2017
+++ src/usr.bin/tail/tail.c	Tue Mar  6 03:33:26 2018
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)tail.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tail.c,v 1.19 2017/10/02 08:23:23 wiz Exp $");
+__RCSID("$NetBSD: tail.c,v 1.20 2018/03/06 03:33:26 eadler Exp $");
 #endif /* not lint */
 
 #include 
@@ -235,7 +235,7 @@ static void
 obsolete(char *argv[])
 {
 	char *ap, *p, *t;
-	int len;
+	size_t len;
 	char *start;
 
 	while ((ap = *++argv) != NULL) {



CVS commit: src/lib/libm/noieee_src

2018-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  6 01:14:41 UTC 2018

Modified Files:
src/lib/libm/noieee_src: n_exp2.c

Log Message:
avoid negative shift


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/noieee_src/n_exp2.c

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

Modified files:

Index: src/lib/libm/noieee_src/n_exp2.c
diff -u src/lib/libm/noieee_src/n_exp2.c:1.3 src/lib/libm/noieee_src/n_exp2.c:1.4
--- src/lib/libm/noieee_src/n_exp2.c:1.3	Sun Mar 23 11:26:47 2014
+++ src/lib/libm/noieee_src/n_exp2.c	Mon Mar  5 20:14:41 2018
@@ -25,7 +25,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: n_exp2.c,v 1.3 2014/03/23 15:26:47 martin Exp $");
+__RCSID("$NetBSD: n_exp2.c,v 1.4 2018/03/06 01:14:41 christos Exp $");
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $");
 #endif
@@ -372,7 +372,8 @@ exp2(double x)
 	/* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */
 	t = tbl[i0];		/* exp2t[i0] */
 	z -= tbl[i0 + 1];	/* eps[i0]   */
-	big = k >= -1021 << 20;
+	/* -1021 << 20 == 3075 << 20 */
+	big = k >= 3075 << 20;
 	if (big) {
 		temp = 0x3ff0+k;
 		twopk = 0.0;



CVS commit: src/doc

2018-03-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar  6 00:15:24 UTC 2018

Modified Files:
src/doc: BRANCHES

Log Message:
Add new branch pgoyette-compat for cleaning up the compat modules

While here, note that prg-localcount2 core content was merged a
while ago, and no further activity is expected.


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.344 src/doc/BRANCHES:1.345
--- src/doc/BRANCHES:1.344	Wed Nov  8 20:24:53 2017
+++ src/doc/BRANCHES	Tue Mar  6 00:15:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.344 2017/11/08 20:24:53 matt Exp $
+#	$NetBSD: BRANCHES,v 1.345 2018/03/06 00:15:24 pgoyette Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -887,10 +887,25 @@ Scope:		src/sys and src/common
 Notes:		Used as experiment sandbox and if successful hopefully one day
 		to be integrated.
 
+Branch:		pgoyette-compat
+Description:	clean-up of compat module
+Status:		Active
+Start Date:	Tues Mar 6, 2018
+End Date:
+Base Tag:	pgoyette-compat-base
+Maintainer:	pgoyette
+Scope:		src/
+Notes:
+
+
+
+# Individual developers' branches (Terminated):
+
+
 Branch:		prg-localcount2
 Description:	Implement localcount reference counting as proposed by
 		riastradh@ - supersedes abandonded pgoyette-localcount
-Status:		Active
+Status:		Suspended - core of the changes were merged to HEAD
 Start Date:	Wed Apr 26 2017
 End Date:	
 Base Tag:	prg-localcount2-base
@@ -898,11 +913,6 @@ Maintainer:	pgoyette
 Scope:		src/sys/
 Notes:		
 
-
-
-# Individual developers' branches (Terminated):
-
-
 Branch:		pgoyette-localcount
 Description:	Implement localcount reference counting as proposed by
 		riastradh@



CVS commit: src/lib/libm/noieee_src

2018-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  5 23:00:55 UTC 2018

Modified Files:
src/lib/libm/noieee_src: n_jn.c

Log Message:
comment out unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_jn.c

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

Modified files:

Index: src/lib/libm/noieee_src/n_jn.c
diff -u src/lib/libm/noieee_src/n_jn.c:1.7 src/lib/libm/noieee_src/n_jn.c:1.8
--- src/lib/libm/noieee_src/n_jn.c:1.7	Tue Nov  1 22:34:56 2011
+++ src/lib/libm/noieee_src/n_jn.c	Mon Mar  5 18:00:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: n_jn.c,v 1.7 2011/11/02 02:34:56 christos Exp $	*/
+/*	$NetBSD: n_jn.c,v 1.8 2018/03/05 23:00:55 christos Exp $	*/
 /*-
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -102,7 +102,9 @@ static char sccsid[] = "@(#)jn.c	8.2 (Be
 #endif
 
 static const double
+#if _IEEE
 invsqrtpi= 5.641895835477562869480794515607725858441e-0001,
+#endif
 two  = 2.0,
 zero = 0.0,
 one  = 1.0;



CVS commit: src/share/mk

2018-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  5 21:14:34 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch everyone but vax to OpenSSL1.1.


To generate a diff of this commit:
cvs rdiff -u -r1.1045 -r1.1046 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1045 src/share/mk/bsd.own.mk:1.1046
--- src/share/mk/bsd.own.mk:1.1045	Mon Mar  5 04:17:42 2018
+++ src/share/mk/bsd.own.mk	Mon Mar  5 16:14:34 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1045 2018/03/05 09:17:42 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1046 2018/03/05 21:14:34 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -100,13 +100,7 @@ MKGCCCMDS?=	no
 #
 # What OpenSSL is used?
 # 
-.if ${MACHINE} == "amd64" || \
-${MACHINE} == "arm" || \
-${MACHINE} == "i386" || \
-${MACHINE_CPU} == "powerpc" || \
-${MACHINE_CPU} == "sh3" || \
-${MACHINE} == "sparc" || \
-${MACHINE} == "sparc64"
+.if ${MACHINE} != "vax"
 HAVE_OPENSSL?=  11
 .else
 HAVE_OPENSSL?=  10



CVS commit: src/sys/netipsec

2018-03-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Mar  5 12:42:28 UTC 2018

Modified Files:
src/sys/netipsec: ipsec_mbuf.c

Log Message:
Improve stupid check, style, and fix leak (m, not m0).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/netipsec/ipsec_mbuf.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/netipsec/ipsec_mbuf.c
diff -u src/sys/netipsec/ipsec_mbuf.c:1.20 src/sys/netipsec/ipsec_mbuf.c:1.21
--- src/sys/netipsec/ipsec_mbuf.c:1.20	Mon Feb 26 06:17:01 2018
+++ src/sys/netipsec/ipsec_mbuf.c	Mon Mar  5 12:42:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_mbuf.c,v 1.20 2018/02/26 06:17:01 maxv Exp $	*/
+/*	$NetBSD: ipsec_mbuf.c,v 1.21 2018/03/05 12:42:28 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.20 2018/02/26 06:17:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.21 2018/03/05 12:42:28 maxv Exp $");
 
 /*
  * IPsec-specific mbuf routines.
@@ -317,10 +317,8 @@ m_pad(struct mbuf *m, int n)
 	register int len, pad;
 	void *retval;
 
-	if (n <= 0) {  /* No stupid arguments. */
-		IPSECLOG(LOG_DEBUG, "pad length invalid (%d)\n", n);
-		m_freem(m);
-		return NULL;
+	if (__predict_false(n > MLEN)) {
+		panic("%s: %d > MLEN", __func__, n);
 	}
 
 	len = m->m_pkthdr.len;
@@ -329,7 +327,7 @@ m_pad(struct mbuf *m, int n)
 
 	while (m0->m_len < len) {
 		KASSERTMSG(m0->m_next != NULL,
-		"m0 null, len %u m_len %u", len, m0->m_len);/*XXX*/
+		"m0 null, len %u m_len %u", len, m0->m_len);
 		len -= m0->m_len;
 		m0 = m0->m_next;
 	}
@@ -338,7 +336,6 @@ m_pad(struct mbuf *m, int n)
 		IPSECLOG(LOG_DEBUG,
 		"length mismatch (should be %d instead of %d)\n",
 		m->m_pkthdr.len, m->m_pkthdr.len + m0->m_len - len);
-
 		m_freem(m);
 		return NULL;
 	}
@@ -350,7 +347,6 @@ m_pad(struct mbuf *m, int n)
 			"length mismatch (should be %d instead of %d)\n",
 			m->m_pkthdr.len,
 			m->m_pkthdr.len + m1->m_next->m_len);
-
 			m_freem(m);
 			return NULL;
 		}
@@ -361,8 +357,8 @@ m_pad(struct mbuf *m, int n)
 	if (pad > M_TRAILINGSPACE(m0)) {
 		/* Add an mbuf to the chain. */
 		MGET(m1, M_DONTWAIT, MT_DATA);
-		if (m1 == 0) {
-			m_freem(m0);
+		if (m1 == NULL) {
+			m_freem(m);
 			IPSECLOG(LOG_DEBUG, "unable to get extra mbuf\n");
 			return NULL;
 		}



CVS commit: src/sys/netipsec

2018-03-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Mar  5 11:50:25 UTC 2018

Modified Files:
src/sys/netipsec: ipsec_output.c

Log Message:
Call m_pullup earlier, fixes one branch.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/netipsec/ipsec_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/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.70 src/sys/netipsec/ipsec_output.c:1.71
--- src/sys/netipsec/ipsec_output.c:1.70	Sat Mar  3 09:39:29 2018
+++ src/sys/netipsec/ipsec_output.c	Mon Mar  5 11:50:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.70 2018/03/03 09:39:29 maxv Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.71 2018/03/05 11:50:25 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.70 2018/03/03 09:39:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.71 2018/03/05 11:50:25 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -485,6 +485,12 @@ ipsec4_process_packet(struct mbuf *m, co
 	}
 	KASSERT(sav != NULL);
 
+	if (m->m_len < sizeof(struct ip) &&
+	(m = m_pullup(m, sizeof(struct ip))) == NULL) {
+		error = ENOBUFS;
+		goto unrefsav;
+	}
+
 	/*
 	 * Check if we need to handle NAT-T fragmentation.
 	 */
@@ -509,11 +515,6 @@ noneed:
 	 * Collect IP_DF state from the outer header.
 	 */
 	if (dst->sa.sa_family == AF_INET) {
-		if (m->m_len < sizeof(struct ip) &&
-		(m = m_pullup(m, sizeof(struct ip))) == NULL) {
-			error = ENOBUFS;
-			goto unrefsav;
-		}
 		ip = mtod(m, struct ip *);
 		/* Honor system-wide control of how to handle IP_DF */
 		switch (ip4_ipsec_dfbit) {
@@ -545,11 +546,6 @@ noneed:
 		struct mbuf *mp;
 
 		/* Fix IPv4 header checksum and length */
-		if (m->m_len < sizeof(struct ip) &&
-		(m = m_pullup(m, sizeof(struct ip))) == NULL) {
-			error = ENOBUFS;
-			goto unrefsav;
-		}
 		ip = mtod(m, struct ip *);
 		ip->ip_len = htons(m->m_pkthdr.len);
 		ip->ip_sum = 0;



CVS commit: src

2018-03-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Mar  5 11:24:35 UTC 2018

Modified Files:
src/doc: CHANGES.prev
src/lib/libc/sys: ptrace.2
src/sys/kern: sys_ptrace_common.c
src/sys/sys: ptrace.h
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Remove PT_GET_SIGMASK / PT_SET_SIGMASK

These operations cloned Linux's specific PTRACE_GETSIGMASK / PTRACE_SETSIGMASK.
This feature was useful in applications like rr/criu/reptyr-like, where
the ptrace(2) interface is abused for the purpose of constructing an arbitrary
process. It's not reliable and not portable. For the NetBSD case it will be
better to invent something dedicated for serializing and deserializing a
process with threads.

Noted on tech-toolchain@ and blog entry

"LLDB restoration and return to ptrace(2)"
https://blog.netbsd.org/tnf/entry/lldb_restoration_and_return_to


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/doc/CHANGES.prev
cvs rdiff -u -r1.67 -r1.68 src/lib/libc/sys/ptrace.2
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.62 -r1.63 src/sys/sys/ptrace.h
cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.137 src/doc/CHANGES.prev:1.138
--- src/doc/CHANGES.prev:1.137	Thu Feb  8 08:32:30 2018
+++ src/doc/CHANGES.prev	Mon Mar  5 11:24:35 2018
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.137 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.138 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12169,8 +12169,6 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	bpf(4): Make it MP-safe [ozaki-r 20170209]
 	file(1): Upgraded to 5.30. [christos 20170210]
 	byacc: update to 20170201 [christos 20170211]
-	ptrace(2): Add signal mask information accessors API:
-		PT_GET_SIGMASK and PT_SET_SIGMASK [kamil 20170212]
 	postfix(1): Import version 3.1.4. [christos 20170213]
 	l2tp(4): Add L2TPv3 interface. [knakahara 20170216]
 	siginfo(2): Add new si_code for SIGTRAP: TRAP_DBREG [kamil 20170217]
@@ -12228,4 +12226,3 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	opencrypto(9): Complete MP-ification [knakahara 20170731]
 	ipsec(4): Make it MP-safe [ozaki-r 20170809]
 	evbmips: Merge sbmips port into evbmips. [mrg 20170815]
-

Index: src/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.67 src/lib/libc/sys/ptrace.2:1.68
--- src/lib/libc/sys/ptrace.2:1.67	Sat Jun  3 19:41:14 2017
+++ src/lib/libc/sys/ptrace.2	Mon Mar  5 11:24:35 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ptrace.2,v 1.67 2017/06/03 19:41:14 abhinav Exp $
+.\"	$NetBSD: ptrace.2,v 1.68 2018/03/05 11:24:35 kamil Exp $
 .\"
 .\" This file is in the public domain.
 .Dd April 7, 2017
@@ -561,31 +561,6 @@ The
 .Fa data
 argument should be set to
 .Li sizeof(struct ptrace_siginfo) .
-.It Dv PT_SET_SIGMASK
-This request loads the traced process' signal mask from
-.Dq Li "sigset_t"
-(defined in
-.In sys/sigtypes.h )
-pointed to by
-.Fa addr .
-The
-.Fa data
-argument contains the LWP ID of the thread whose registers are to
-be written.
-If zero is supplied, the first thread of the process is written.
-.It Dv PT_GET_SIGMASK
-This request is the converse of
-.Dv PT_SET_SIGMASK ;
-it reads the traced process' signal mask into
-.Dq Li "sigset_t"
-(defined in
-.In sys/sigtypes.h )
-pointed to by
-.Fa addr .
-The
-.Fa data
-argument contains the LWP ID of the thread whose mask is to be read.
-If zero is supplied, the first thread of the process is read.
 .It Dv PT_RESUME
 Allow execution of a specified thread,
 change its state from suspended to continued.

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.34 src/sys/kern/sys_ptrace_common.c:1.35
--- src/sys/kern/sys_ptrace_common.c:1.34	Mon Jan  8 06:10:30 2018
+++ src/sys/kern/sys_ptrace_common.c	Mon Mar  5 11:24:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.34 2018/01/08 06:10:30 christos Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.35 2018/03/05 11:24:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.34 2018/01/08 06:10:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.35 2018/03/05 11:24:34 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -249,8 +249,6 @@ ptrace_listener_cb(kauth_cred_t cred, ka
 	case PT_GET_PROCESS_STATE:
 	case PT_SET_SIGINFO:
 	case PT_GET_SIGINFO:
-	case PT_SET_SIGMASK:
-	case PT_GET_SIGMASK:
 #ifdef __HAVE_PTRACE_MACHDEP
 	PTRACE_MACHDEP_REQUEST_CASES
 #endif
@@ -411,8 +409,6 @@ ptrace_allowed(struct lwp *l, int req, s
 	case PT_IO:
 	case PT_SET_SIGINFO:
 	case PT_GET_SIGINFO:
-	case PT_SET_SIGMASK:
-	case PT_GET_SIGMASK:
 	case_PT_GETREGS
 	case_PT_SETREGS
 	

CVS commit: src/usr.sbin/cpuctl/arch

2018-03-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar  5 10:54:05 UTC 2018

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
 Calculate way and number of entries correctly from CPUID leaf 18H.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.81 src/usr.sbin/cpuctl/arch/i386.c:1.82
--- src/usr.sbin/cpuctl/arch/i386.c:1.81	Mon Mar  5 05:50:37 2018
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Mar  5 10:54:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.81 2018/03/05 05:50:37 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.82 2018/03/05 10:54:05 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.81 2018/03/05 05:50:37 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.82 2018/03/05 10:54:05 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -1094,6 +1094,8 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 	x86_cpuid(0x18, descs);
 	iterations = descs[0];
 	for (i = 0; i <= iterations; i++) {
+		bool full;
+
 		x86_cpuid2(0x18, i, descs);
 		type = __SHIFTOUT(descs[3], CPUID_DATP_TCTYPE);
 		if (type == CPUID_DATP_TCTYPE_N)
@@ -1158,8 +1160,11 @@ intel_cpu_cacheinfo(struct cpu_info *ci)
 		}
 		ways = __SHIFTOUT(descs[1], CPUID_DATP_WAYS);
 		sets = descs[2];
-		ci->ci_cinfo[caitype].cai_totalsize = sets; /* entries */
-		ci->ci_cinfo[caitype].cai_associativity = ways;
+		full = descs[3] & CPUID_DATP_FULLASSOC;
+		ci->ci_cinfo[caitype].cai_totalsize
+		= ways * sets; /* entries */
+		ci->ci_cinfo[caitype].cai_associativity
+		= full ? 0xff : ways;
 		ci->ci_cinfo[caitype].cai_linesize = linesize; /* page size */
 	}
 }



CVS commit: src/share/man/man4

2018-03-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Mar  5 10:23:44 UTC 2018

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/share/man/man4/ugen.4

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

Modified files:

Index: src/share/man/man4/ugen.4
diff -u src/share/man/man4/ugen.4:1.35 src/share/man/man4/ugen.4:1.36
--- src/share/man/man4/ugen.4:1.35	Mon Mar  5 09:37:30 2018
+++ src/share/man/man4/ugen.4	Mon Mar  5 10:23:44 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: ugen.4,v 1.35 2018/03/05 09:37:30 ws Exp $
+.\" $NetBSD: ugen.4,v 1.36 2018/03/05 10:23:44 wiz Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" 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 December 23, 2009
+.Dd March 5, 2018
 .Dt UGEN 4
 .Os
 .Sh NAME



CVS commit: src/share/man/man4

2018-03-05 Thread Wolfgang Solfrank
Module Name:src
Committed By:   ws
Date:   Mon Mar  5 09:37:30 UTC 2018

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

Log Message:
Adapt to the new device name for interface attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/share/man/man4/ugen.4

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

Modified files:

Index: src/share/man/man4/ugen.4
diff -u src/share/man/man4/ugen.4:1.34 src/share/man/man4/ugen.4:1.35
--- src/share/man/man4/ugen.4:1.34	Tue Feb 20 15:56:43 2018
+++ src/share/man/man4/ugen.4	Mon Mar  5 09:37:30 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: ugen.4,v 1.34 2018/02/20 15:56:43 wiz Exp $
+.\" $NetBSD: ugen.4,v 1.35 2018/03/05 09:37:30 ws Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .Nd USB generic device support
 .Sh SYNOPSIS
 .Cd "ugen* at uhub? flags N"
-.Cd "ugen* at uhub? vendor V product P configuration C interface I flags 1"
+.Cd "ugenif* at uhub? vendor V product P configuration C interface I"
 .Sh DESCRIPTION
 The
 .Nm
@@ -66,16 +66,20 @@ The second form of attachment can be use
 only one interface from some device for use by the
 .Nm
 driver.
-Be sure to include
-.Dq flags 1
-on the attachment.
+Most likely you want to explicitily specify at least vendor,
+product and interface with this form,
+as otherwise the
+.Nm
+driver would capture all of your
+.Nm usb
+devices.
 .Em NOTE :
 You have to be extremely careful,
-when using this,
+when using this form,
 as the attached
 .Nm
 driver has access to all of the device
-and can easily interfere with the driver used for
+and can easily interfere with the driver(s) used for
 the other interface(s).
 .Pp
 As an example of this second form of attachment there are
@@ -84,16 +88,15 @@ where one interface is used for JTAG deb
 and the other is used as a serial interface.
 In this case you want to attach the
 .Nm
-driver to interface 0
-while using
+driver to interface 0 of this particular board identified by
+.Cd vendor
+and
+.Cd product
+while letting
 .Xr uftdi 4
 together with
 .Xr ucom 4
-at interface 1 of this particular board
-identified by
-.Cd vendor
-and
-.Cd product .
+to attach at interface 1.
 .Pp
 There can be up to 127 USB devices connected to a USB bus.
 Each USB device can have up to 16 endpoints.



CVS commit: src/sys/dev/usb

2018-03-05 Thread Wolfgang Solfrank
Module Name:src
Committed By:   ws
Date:   Mon Mar  5 09:35:01 UTC 2018

Modified Files:
src/sys/dev/usb: files.usb ugen.c

Log Message:
Fix last:

Since config(1) could not distinguish between device and
interface attachments, it was generating only the latter.
Thus devices without their own driver wouldn't match the
ugen driver anymore.

Fix this by using a different device name for interface attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/ugen.c

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

Modified files:

Index: src/sys/dev/usb/files.usb
diff -u src/sys/dev/usb/files.usb:1.149 src/sys/dev/usb/files.usb:1.150
--- src/sys/dev/usb/files.usb:1.149	Tue Feb 20 15:48:37 2018
+++ src/sys/dev/usb/files.usb	Mon Mar  5 09:35:01 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.usb,v 1.149 2018/02/20 15:48:37 ws Exp $
+#	$NetBSD: files.usb,v 1.150 2018/03/05 09:35:01 ws Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -138,8 +138,9 @@ file	dev/usb/ucom.c			ucom | ucombus		ne
 # Generic devices
 device	ugen
 attach	ugen at usbdevif
-attach	ugen at usbifif with ugenif
-file	dev/usb/ugen.c			ugen			needs-flag
+device	ugenif
+attach	ugenif at usbifif
+file	dev/usb/ugen.c			ugen | ugenif		needs-flag
 
 
 # HID

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.138 src/sys/dev/usb/ugen.c:1.139
--- src/sys/dev/usb/ugen.c:1.138	Tue Feb 20 15:48:37 2018
+++ src/sys/dev/usb/ugen.c	Mon Mar  5 09:35:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.138 2018/02/20 15:48:37 ws Exp $	*/
+/*	$NetBSD: ugen.c,v 1.139 2018/03/05 09:35:01 ws Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.138 2018/02/20 15:48:37 ws Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.139 2018/03/05 09:35:01 ws Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -218,10 +218,8 @@ ugen_match(device_t parent, cfdata_t mat
 int
 ugenif_match(device_t parent, cfdata_t match, void *aux)
 {
-	if (match->cf_flags & 1)
-		return UMATCH_HIGHEST;
-	else
-		return UMATCH_NONE;
+	/* Assume that they knew what they configured! (see ugenif(4)) */
+	return UMATCH_HIGHEST;
 }
 
 void



CVS commit: src/share/mk

2018-03-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Mar  5 09:17:42 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch sh3 to GCC 6.  tested on landisk in emul and hardware.

actually do this by reversing the check to look for m68* and vax
to choose GCC 5, and otherwise default to GCC 6.


To generate a diff of this commit:
cvs rdiff -u -r1.1044 -r1.1045 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1044 src/share/mk/bsd.own.mk:1.1045
--- src/share/mk/bsd.own.mk:1.1044	Mon Mar  5 08:08:06 2018
+++ src/share/mk/bsd.own.mk	Mon Mar  5 09:17:42 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1044 2018/03/05 08:08:06 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1045 2018/03/05 09:17:42 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -68,19 +68,12 @@ MKGCC?=		no
 ${MACHINE_CPU} == "aarch64"
 HAVE_GCC?=	0
 .elif \
-${MACHINE_CPU} == "alpha" || \
-${MACHINE_CPU} == "arm" || \
-${MACHINE_CPU} == "hppa" || \
-${MACHINE_CPU} == "ia64" || \
-${MACHINE_CPU} == "i386" || \
-${MACHINE_CPU} == "mips" || \
-${MACHINE_CPU} == "powerpc" || \
-${MACHINE_CPU} == "sparc" || \
-${MACHINE_CPU} == "sparc64" || \
-${MACHINE_CPU} == "x86_64"
-HAVE_GCC?=	6
-.else
+${MACHINE_CPU} == "m68000" || \
+${MACHINE_CPU} == "m68k" || \
+${MACHINE_CPU} == "vax"
 HAVE_GCC?=	5
+.else
+HAVE_GCC?=	6
 .endif
 
 #



CVS commit: src/sys/dev/mii

2018-03-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar  5 08:56:49 UTC 2018

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
 KNF in comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/mii/mii_physubr.c

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

Modified files:

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.80 src/sys/dev/mii/mii_physubr.c:1.81
--- src/sys/dev/mii/mii_physubr.c:1.80	Thu Jun 20 13:56:29 2013
+++ src/sys/dev/mii/mii_physubr.c	Mon Mar  5 08:56:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.80 2013/06/20 13:56:29 roy Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.81 2018/03/05 08:56:49 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.80 2013/06/20 13:56:29 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.81 2018/03/05 08:56:49 msaitoh Exp $");
 
 #include 
 #include 
@@ -237,9 +237,9 @@ mii_phy_auto(struct mii_softc *sc, int w
 			}
 
 			/*
-			 *for 1000-base-T, autonegotiation mus be enabled, but 
-			 *if we're not set to auto, only advertise
-			 *1000-base-T with the link partner.
+			 *  For 1000-base-T, autonegotiation must be enabled,
+			 * but if we're not set to auto, only advertise
+			 * 1000-base-T with the link partner.
 			 */
 			if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
 anar &= ~(ANAR_T4|ANAR_TX_FD|ANAR_TX|ANAR_10_FD|ANAR_10);



CVS commit: src/share/mk

2018-03-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Mar  5 08:08:06 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch arm ports to GCC 6.

this is the last GCC that will support these ports:
- epoc32
- netwinder
- shark
- acorn32
- cats
- most hpcarm systems (only NETBOOKPRO and WZERO3 remain)


To generate a diff of this commit:
cvs rdiff -u -r1.1043 -r1.1044 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1043 src/share/mk/bsd.own.mk:1.1044
--- src/share/mk/bsd.own.mk:1.1043	Mon Mar  5 07:03:27 2018
+++ src/share/mk/bsd.own.mk	Mon Mar  5 08:08:06 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1043 2018/03/05 07:03:27 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1044 2018/03/05 08:08:06 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -69,6 +69,7 @@ MKGCC?=		no
 HAVE_GCC?=	0
 .elif \
 ${MACHINE_CPU} == "alpha" || \
+${MACHINE_CPU} == "arm" || \
 ${MACHINE_CPU} == "hppa" || \
 ${MACHINE_CPU} == "ia64" || \
 ${MACHINE_CPU} == "i386" || \