CVS commit: src/crypto/external/bsd/openssl/dist/include/openssl

2020-03-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 22 02:30:16 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/include/openssl: safestack.h

Log Message:
Add more casts.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h
diff -u src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h:1.5 src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h:1.6
--- src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h:1.5	Sat Mar 21 20:53:10 2020
+++ src/crypto/external/bsd/openssl/dist/include/openssl/safestack.h	Sat Mar 21 22:30:15 2020
@@ -28,7 +28,7 @@ extern "C" {
 { \
 return OPENSSL_sk_num((const OPENSSL_STACK *)(const void *)sk); \
 } \
-static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
+static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1)*sk, int idx) \
 { \
 return (t2 *)(void *)OPENSSL_sk_value((const OPENSSL_STACK *)(const void *)sk, idx); \
 } \
@@ -42,11 +42,11 @@ extern "C" {
 } \
 static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
 { \
-return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
+return (STACK_OF(t1) *)(void *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
 } \
 static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
 { \
-return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
+return OPENSSL_sk_reserve((OPENSSL_STACK *)(void *)sk, n); \
 } \
 static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
 { \



CVS commit: [ad-namecache] src/sys/kern

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar 22 01:58:22 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_cache.c

Log Message:
- rb_tree_insert_node() refuses to insert duplicate nodes.  It always
  returns a pointer to the current node in the tree for the given key.
  Therefore the call to rb_tree_lookup_node() in cache_enter() is not
  needed.

- Adjust a comment and move some code for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.15 -r1.126.2.16 src/sys/kern/vfs_cache.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/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.126.2.15 src/sys/kern/vfs_cache.c:1.126.2.16
--- src/sys/kern/vfs_cache.c:1.126.2.15	Sun Mar 22 00:34:31 2020
+++ src/sys/kern/vfs_cache.c	Sun Mar 22 01:58:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.126.2.15 2020/03/22 00:34:31 ad Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.126.2.16 2020/03/22 01:58:22 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.15 2020/03/22 00:34:31 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.16 2020/03/22 01:58:22 ad Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -416,8 +416,6 @@ cache_lookup_entry(struct vnode *dvp, co
 	 * Search the RB tree for the key.  This is an inlined lookup
 	 * tailored for exactly what's needed here (64-bit key and so on)
 	 * that is quite a bit faster than using rb_tree_find_node(). 
-	 * Elsewhere during entry/removal the usual functions are used as it
-	 * doesn't matter there.
 	 */
 	for (;;) {
 		if (__predict_false(RB_SENTINEL_P(node))) {
@@ -525,6 +523,9 @@ cache_lookup(struct vnode *dvp, const ch
 		return false;
 	}
 
+	/* Compute the key up front - don't need the lock. */
+	key = cache_key(name, namelen);
+
 	/* Could the entry be purged below? */
 	if ((cnflags & ISLASTCN) != 0 &&
 	((cnflags & MAKEENTRY) == 0 || nameiop == CREATE)) {
@@ -533,9 +534,6 @@ cache_lookup(struct vnode *dvp, const ch
 		op = RW_READER;
 	}
 
-	/* Compute the key up front - don't need the lock. */
-	key = cache_key(name, namelen);
-
 	/* Now look for the name. */
 	rw_enter(>vi_nc_lock, op);
 	ncp = cache_lookup_entry(dvp, name, namelen, key);
@@ -890,18 +888,20 @@ cache_enter(struct vnode *dvp, struct vn
 	/*
 	 * Insert to the directory.  Concurrent lookups in the same
 	 * directory may race for a cache entry.  There can also be hash
-	 * value collisions.  If there's a entry there already, free it.
+	 * value collisions.  If there's a entry there already, purge it.
 	 */
 	rw_enter(>vi_nc_lock, RW_WRITER);
-	oncp = rb_tree_find_node(>vi_nc_tree, >nc_key);
-	if (oncp) {
+	oncp = rb_tree_insert_node(>vi_nc_tree, ncp);
+	if (oncp != ncp) {
+		KASSERT(oncp->nc_key == ncp->nc_key);
 		KASSERT(oncp->nc_nlen == ncp->nc_nlen);
 		if (cache_namecmp(oncp, name, namelen)) {
 			COUNT(ncs_collisions);
 		}
 		cache_remove(oncp, true);
+		oncp = rb_tree_insert_node(>vi_nc_tree, ncp);
+		KASSERT(oncp == ncp);
 	}
-	rb_tree_insert_node(>vi_nc_tree, ncp);
 
 	/* Then insert to the vnode. */
 	if (vp == NULL) {



CVS commit: src/doc

2020-03-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 22 00:56:45 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
Update date


To generate a diff of this commit:
cvs rdiff -u -r1.1702 -r1.1703 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.1702 src/doc/3RDPARTY:1.1703
--- src/doc/3RDPARTY:1.1702	Sat Mar 21 20:56:18 2020
+++ src/doc/3RDPARTY	Sat Mar 21 20:56:45 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1702 2020/03/22 00:56:18 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1703 2020/03/22 00:56:45 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1092,7 +1092,7 @@ Current Vers:	1.0.2t/1.1.1e
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/
-Date:		2019-10-09
+Date:		2020-03-21
 Mailing List:	openssl-annou...@openssl.org
 Responsible:	christos, mjf, tls, riastradh, spz
 License:	OpenSSL and SSLeay license (both BSD-like)



CVS commit: src/doc

2020-03-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 22 00:56:18 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1701 -r1.1702 src/doc/3RDPARTY
cvs rdiff -u -r1.2658 -r1.2659 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1701 src/doc/3RDPARTY:1.1702
--- src/doc/3RDPARTY:1.1701	Fri Mar 20 19:01:24 2020
+++ src/doc/3RDPARTY	Sat Mar 21 20:56:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1701 2020/03/20 23:01:24 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1702 2020/03/22 00:56:18 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1087,7 +1087,7 @@ markus is very cooperative about it):
 - adjust the DEFAULT_PKCS11_WHITELIST for ssh-agent
 
 Package:	OpenSSL
-Version:	1.0.2o/1.1.1d
+Version:	1.0.2o/1.1.1e
 Current Vers:	1.0.2t/1.1.1e
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2658 src/doc/CHANGES:1.2659
--- src/doc/CHANGES:1.2658	Wed Mar 18 15:07:29 2020
+++ src/doc/CHANGES	Sat Mar 21 20:56:18 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2658 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2659 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -154,3 +154,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	pam-u2f: Import token authenticator [christos 20200302]
 	terminfo: Support numeric parameters as int [roy 20200313]
 	postfix(1): Import version 3.5.0. [christos 20200318]
+	OpenSSL: Imported 1.1.1e. [christos 20200321]



CVS commit: src/crypto

2020-03-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 22 00:54:04 UTC 2020

Modified Files:
src/crypto: Makefile.openssl

Log Message:
remove defines now defined in crypto/dso_conf.h


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/crypto/Makefile.openssl

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

Modified files:

Index: src/crypto/Makefile.openssl
diff -u src/crypto/Makefile.openssl:1.11 src/crypto/Makefile.openssl:1.12
--- src/crypto/Makefile.openssl:1.11	Sat Feb  3 22:19:51 2018
+++ src/crypto/Makefile.openssl	Sat Mar 21 20:54:03 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.openssl,v 1.11 2018/02/04 03:19:51 christos Exp $
+#	$NetBSD: Makefile.openssl,v 1.12 2020/03/22 00:54:03 christos Exp $
 
 .ifndef _MAKEFILE_OPENSSL_INCLUDED
 _MAKEFILE_OPENSSL_INCLUDED=1
@@ -8,6 +8,5 @@ _MAKEFILE_OPENSSL_INCLUDED=1
 OPENSSLSRC=	${CRYPTODIST}/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/dist
 CPPFLAGS+=	-DOPENSSLDIR=\"/etc/openssl\"
 CPPFLAGS+=	-DENGINESDIR=\"/usr/lib/openssl\"
-CPPFLAGS+=	-DDSO_DLFCN -DHAVE_DLFCN_H
 
 .endif



CVS commit: [ad-namecache] src/sys/kern

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar 22 00:34:31 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_cache.c

Log Message:
- Fold the "doingcache" conditional into the max length conditional.
- Mark the tunables __read_mostly.


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.14 -r1.126.2.15 src/sys/kern/vfs_cache.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/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.126.2.14 src/sys/kern/vfs_cache.c:1.126.2.15
--- src/sys/kern/vfs_cache.c:1.126.2.14	Sat Mar 21 22:00:55 2020
+++ src/sys/kern/vfs_cache.c	Sun Mar 22 00:34:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.126.2.14 2020/03/21 22:00:55 ad Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.126.2.15 2020/03/22 00:34:31 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.14 2020/03/21 22:00:55 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.15 2020/03/22 00:34:31 ad Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -235,10 +235,13 @@ struct nchstats	nchstats __cacheline_ali
 	KPREEMPT_ENABLE(l); \
 } while (/* CONSTCOND */ 0);
 
-/* Tunables */
-static const int cache_lru_maxdeact = 2;	/* max # to deactivate */
-static const int cache_lru_maxscan = 64;	/* max # to scan/reclaim */
-static int doingcache = 1;			/* 1 => enable the cache */
+/*
+ * Tunables.  cache_maxlen replaces the historical doingcache:
+ * set it zero to disable caching for debugging purposes.
+ */
+int cache_lru_maxdeact __read_mostly = 2;	/* max # to deactivate */
+int cache_lru_maxscan __read_mostly = 64;	/* max # to scan/reclaim */
+int cache_maxlen __read_mostly = USHRT_MAX;	/* max name length to cache */
 
 /* sysctl */
 static struct	sysctllog *cache_sysctllog;
@@ -515,11 +518,7 @@ cache_lookup(struct vnode *dvp, const ch
 	}
 	*vn_ret = NULL;
 
-	if (__predict_false(!doingcache)) {
-		return false;
-	}
-
-	if (__predict_false(namelen > USHRT_MAX)) {
+	if (__predict_false(namelen > cache_maxlen)) {
 		SDT_PROBE(vfs, namecache, lookup, toolong, dvp,
 		name, namelen, 0, 0);
 		COUNT(ncs_long);
@@ -644,7 +643,7 @@ cache_lookup_linked(struct vnode *dvp, c
 	*vn_ret = NULL;
 
 	/* If disabled, or file system doesn't support this, bail out. */
-	if (__predict_false(!doingcache ||
+	if (__predict_false(cache_maxlen == 0 ||
 	(dvp->v_mount->mnt_iflag & IMNT_NCLOOKUP) == 0)) {
 		return false;
 	}
@@ -753,7 +752,7 @@ cache_revlookup(struct vnode *vp, struct
 
 	KASSERT(vp != NULL);
 
-	if (!doingcache)
+	if (cache_maxlen == 0)
 		goto out;
 
 	rw_enter(>vi_nc_listlock, RW_READER);
@@ -855,7 +854,7 @@ cache_enter(struct vnode *dvp, struct vn
 
 	/* First, check whether we can/should add a cache entry. */
 	if ((cnflags & MAKEENTRY) == 0 ||
-	__predict_false(namelen > USHRT_MAX || !doingcache)) {
+	__predict_false(namelen > cache_maxlen)) {
 		SDT_PROBE(vfs, namecache, enter, toolong, vp, name, namelen,
 		0, 0);
 		return;



CVS commit: src/sys/sys

2020-03-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Mar 22 00:25:01 UTC 2020

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

Log Message:
Revert previous

Clang protests:

error: 'no_sanitize' attribute only applies to functions and methods


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/sys/cdefs_elf.h

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

Modified files:

Index: src/sys/sys/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.54 src/sys/sys/cdefs_elf.h:1.55
--- src/sys/sys/cdefs_elf.h:1.54	Sat Mar 21 22:52:48 2020
+++ src/sys/sys/cdefs_elf.h	Sun Mar 22 00:25:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.54 2020/03/21 22:52:48 kamil Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.55 2020/03/22 00:25:01 kamil Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -160,10 +160,10 @@
 #ifndef __lint__
 #define	__link_set_make_entry(set, sym)	\
 	static void const * const __link_set_##set##_sym_##sym		\
-	__section("link_set_" #set) __noasan __used = (const void *)
+	__section("link_set_" #set) __used = (const void *)
 #define	__link_set_make_entry2(set, sym, n)\
 	static void const * const __link_set_##set##_sym_##sym##_##n	\
-	__section("link_set_" #set) __noasan __used = (const void *)[n]
+	__section("link_set_" #set) __used = (const void *)[n]
 #else
 #define	__link_set_make_entry(set, sym)	\
 	extern void const * const __link_set_##set##_sym_##sym



CVS commit: src/sys

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Mar 22 00:16:16 UTC 2020

Modified Files:
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c x86_tlb.c
src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c

Log Message:
x86 pmap:

- Give pmap_remove_all() its own version of pmap_remove_ptes() that on native
  x86 does the bare minimum needed to clear out PTPs.  Cuts ~4% sys time on
  'build.sh release' for me.

- pmap_sync_pv(): there's no need to issue a redundant TLB shootdown.  The
  caller waits for the competing operation to finish.

- Bring 'options TLBSTATS' up to date.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/x86_tlb.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

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

Modified files:

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.115 src/sys/arch/x86/include/pmap.h:1.116
--- src/sys/arch/x86/include/pmap.h:1.115	Tue Mar 17 22:29:19 2020
+++ src/sys/arch/x86/include/pmap.h	Sun Mar 22 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.115 2020/03/17 22:29:19 ad Exp $	*/
+/*	$NetBSD: pmap.h,v 1.116 2020/03/22 00:16:16 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -399,18 +399,15 @@ vaddr_t		slotspace_rand(int, size_t, siz
 vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */
 
 typedef enum tlbwhy {
-	TLBSHOOT_APTE,
+	TLBSHOOT_REMOVE_ALL,
 	TLBSHOOT_KENTER,
 	TLBSHOOT_KREMOVE,
-	TLBSHOOT_FREE_PTP1,
-	TLBSHOOT_FREE_PTP2,
+	TLBSHOOT_FREE_PTP,
 	TLBSHOOT_REMOVE_PTE,
-	TLBSHOOT_REMOVE_PTES,
-	TLBSHOOT_SYNC_PV1,
-	TLBSHOOT_SYNC_PV2,
+	TLBSHOOT_SYNC_PV,
 	TLBSHOOT_WRITE_PROTECT,
 	TLBSHOOT_ENTER,
-	TLBSHOOT_UPDATE,
+	TLBSHOOT_NVMM,
 	TLBSHOOT_BUS_DMA,
 	TLBSHOOT_BUS_SPACE,
 	TLBSHOOT__MAX,

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.379 src/sys/arch/x86/x86/pmap.c:1.380
--- src/sys/arch/x86/x86/pmap.c:1.379	Fri Mar 20 19:06:14 2020
+++ src/sys/arch/x86/x86/pmap.c	Sun Mar 22 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.379 2020/03/20 19:06:14 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.380 2020/03/22 00:16:16 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.379 2020/03/20 19:06:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.380 2020/03/22 00:16:16 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -579,6 +579,32 @@ pv_pte_next(struct pmap_page *pp, struct
 	return pve_to_pvpte(LIST_NEXT(pvpte_to_pve(pvpte), pve_list));
 }
 
+static inline uint8_t
+pmap_pte_to_pp_attrs(pt_entry_t pte)
+{
+	uint8_t ret = 0;
+	if (pte & PTE_D)
+		ret |= PP_ATTRS_D;
+	if (pte & PTE_A)
+		ret |= PP_ATTRS_A;
+	if (pte & PTE_W)
+		ret |= PP_ATTRS_W;
+	return ret;
+}
+
+static inline pt_entry_t
+pmap_pp_attrs_to_pte(uint8_t attrs)
+{
+	pt_entry_t pte = 0;
+	if (attrs & PP_ATTRS_D)
+		pte |= PTE_D;
+	if (attrs & PP_ATTRS_A)
+		pte |= PTE_A;
+	if (attrs & PP_ATTRS_W)
+		pte |= PTE_W;
+	return pte;
+}
+
 /*
  * pmap_is_curpmap: is this pmap the one currently loaded [in %cr3]?
  * of course the kernel is always loaded
@@ -2033,7 +2059,7 @@ pmap_lookup_pv(const struct pmap *pmap, 
 	 * [This mostly deals with shared mappings, for example shared libs
 	 * and executables.]
 	 *
-	 * Optimise for pmap_remove_all() which works by ascending scan:
+	 * Optimise for pmap_remove_ptes() which works by ascending scan:
 	 * look at the lowest numbered node in the tree first.  The tree is
 	 * known non-empty because of the check above.  For short lived
 	 * processes where pmap_remove() isn't used much this gets close to
@@ -2287,7 +2313,7 @@ pmap_free_ptp(struct pmap *pmap, struct 
 		invaladdr = level == 1 ? (vaddr_t)ptes :
 		(vaddr_t)pdes[level - 2];
 		pmap_tlb_shootdown(pmap, invaladdr + index * PAGE_SIZE,
-		opde, TLBSHOOT_FREE_PTP1);
+		opde, TLBSHOOT_FREE_PTP);
 
 #if defined(XENPV)
 		pmap_tlb_shootnow();
@@ -2858,6 +2884,134 @@ pmap_destroy(struct pmap *pmap)
 }
 
 /*
+ * pmap_zap_ptp: clear out an entire PTP without modifying PTEs
+ *
+ * => caller must hold pmap's lock
+ * => PTP must be mapped into KVA
+ * => must be called with kernel preemption disabled
+ * => does as little work as possible
+ */
+static void
+pmap_zap_ptp(struct pmap *pmap, struct vm_page *ptp, pt_entry_t *pte,
+vaddr_t startva, vaddr_t blkendva, struct pv_entry **pv_tofree)
+{
+#ifndef XEN
+	struct pv_entry *pve;
+	struct vm_page *pg;
+	struct pmap_page *pp;
+	pt_entry_t opte;
+	rb_tree_t *tree;
+	vaddr_t va;
+	int wired;
+	uint8_t oattrs;
+	u_int cnt;
+
+	KASSERT(mutex_owned(>pm_lock));

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

2020-03-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sun Mar 22 00:14:16 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
improve comments


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sociox/if_ave.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/sociox/if_ave.c
diff -u src/sys/arch/arm/sociox/if_ave.c:1.9 src/sys/arch/arm/sociox/if_ave.c:1.10
--- src/sys/arch/arm/sociox/if_ave.c:1.9	Sun Mar 22 00:05:17 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Sun Mar 22 00:14:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ave.c,v 1.9 2020/03/22 00:05:17 nisimura Exp $	*/
+/*	$NetBSD: if_ave.c,v 1.10 2020/03/22 00:14:16 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.9 2020/03/22 00:05:17 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.10 2020/03/22 00:14:16 nisimura Exp $");
 
 #include 
 #include 
@@ -82,13 +82,13 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define  GISR_RXDROP	(1U<<6)		/* PAUSE frame has been dropped */
 #define  GISR_RXIT	(1U<<5)		/* receive itimer notify */
 #define AVETXC		0x200		/* transmit control */
-#define  TXC_FCE	(1U<<18)	/* enable Tx flow control */
+#define  TXC_FCE	(1U<<18)	/* generate PAUSE to moderate Rx lvl */
 #define  TXC_SPD1000	(1U<<17)	/* use 1000Mbps */
 #define  TXC_SPD100	(1U<<16)	/* use 100Mbps */
 #define AVERXC		0x204		/* receive control */
 #define  RXC_EN		(1U<<30)	/* enable receive circuit */
 #define  RXC_USEFDX	(1U<<22)	/* use full-duplex */
-#define  RXC_FCE	(1U<<21)	/* enable Rx flow control */
+#define  RXC_FCE	(1U<<21)	/* accept PAUSE to throttle Tx */
 #define  RXC_AFE	(1U<<19)	/* use address filter (!promisc) */
 #define  RXC_DRPEN	(1U<<18)	/* drop receiving PAUSE frames */
 /* RXC 15:0 max frame length to accept */
@@ -287,7 +287,7 @@ static int add_rxbuf(struct ave_softc *,
 	bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (off), (val))
 
 static const struct of_compat_data compat_data[] = {
-	{ "socionext,unifier-ld20-ave4", 64 },
+	{ "socionext,unifier-ld20-ave4", 64 },	/* XXX only this for now */
 	{ "socionext,unifier-pro4-ave4", 32 },
 	{ "socionext,unifier-pxs2-ave4", 32 },
 	{ "socionext,unifier-ld11-ave4", 32 },



CVS commit: src/sys/arch/xen/xen

2020-03-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Mar 22 00:11:02 UTC 2020

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c xennet_checksum.c
xennetback_xenbus.c

Log Message:
add support for skipping IPv6 checksum validation aka offloading -
for xennet(4) both Rx and Tx, for xvif(4) only Tx for now


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/xen/xennet_checksum.c
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.92 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.93
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.92	Thu Mar 19 10:53:43 2020
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Sun Mar 22 00:11:02 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.92 2020/03/19 10:53:43 jdolecek Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.93 2020/03/22 00:11:02 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.92 2020/03/19 10:53:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.93 2020/03/22 00:11:02 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -389,7 +389,14 @@ xennet_xenbus_attach(device_t parent, de
 	ifp->if_capabilities =
 		IFCAP_CSUM_IPv4_Rx | IFCAP_CSUM_IPv4_Tx
 		| IFCAP_CSUM_UDPv4_Rx | IFCAP_CSUM_UDPv4_Tx
-		| IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_TCPv4_Tx;
+		| IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_TCPv4_Tx
+		| IFCAP_CSUM_UDPv6_Rx | IFCAP_CSUM_UDPv6_Tx
+		| IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_TCPv6_Tx;
+#define XN_M_CSUM_SUPPORTED (	\
+		M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4	\
+		| M_CSUM_TCPv6 | M_CSUM_UDPv6			\
+	)
+
 	IFQ_SET_READY(>if_snd);
 	if_attach(ifp);
 	ether_ifattach(ifp, sc->sc_enaddr);
@@ -1229,8 +1236,7 @@ xennet_softstart(void *arg)
 			break;
 		}
 
-		if ((m->m_pkthdr.csum_flags &
-		(M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4)) != 0) {
+		if ((m->m_pkthdr.csum_flags & XN_M_CSUM_SUPPORTED) != 0) {
 			txflags = NETTXF_csum_blank;
 		} else {
 			txflags = NETTXF_data_validated;

Index: src/sys/arch/xen/xen/xennet_checksum.c
diff -u src/sys/arch/xen/xen/xennet_checksum.c:1.8 src/sys/arch/xen/xen/xennet_checksum.c:1.9
--- src/sys/arch/xen/xen/xennet_checksum.c:1.8	Thu Mar 19 10:53:43 2020
+++ src/sys/arch/xen/xen/xennet_checksum.c	Sun Mar 22 00:11:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xennet_checksum.c,v 1.8 2020/03/19 10:53:43 jdolecek Exp $	*/
+/*	$NetBSD: xennet_checksum.c,v 1.9 2020/03/22 00:11:02 jdolecek Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.8 2020/03/19 10:53:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.9 2020/03/22 00:11:02 jdolecek Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_inet.h"
+#endif
 
 #include 
 #include 
@@ -43,6 +47,8 @@ __KERNEL_RCSID(0, "$NetBSD: xennet_check
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -57,16 +63,15 @@ EVCNT_ATTACH_STATIC(xn_cksum_defer);
 EVCNT_ATTACH_STATIC(xn_cksum_undefer);
 EVCNT_ATTACH_STATIC(xn_cksum_valid);
 
+#ifdef XENNET_DEBUG
 /* ratecheck(9) for checksum validation failures */
 static const struct timeval xn_cksum_errintvl = { 600, 0 };  /* 10 min, each */
+#endif
 
 static void *
 m_extract(struct mbuf *m, int off, int len)
 {
-	KASSERT(m->m_pkthdr.len >= off + len);
-	KASSERT(m->m_len >= off + len);
-
-	if (m->m_pkthdr.len >= off + len)
+	if (m->m_len >= off + len)
 		return mtod(m, char *) + off;
 	else
 		return NULL;
@@ -80,7 +85,10 @@ int
 xennet_checksum_fill(struct ifnet *ifp, struct mbuf *m, bool data_validated)
 {
 	const struct ether_header *eh;
-	struct ip *iph;
+	struct ip *iph = NULL;
+#ifdef INET6
+	struct ip6_hdr *ip6h = NULL;
+#endif
 	int ehlen;
 	int iphlen;
 	int iplen;
@@ -98,27 +106,49 @@ xennet_checksum_fill(struct ifnet *ifp, 
 		return EINVAL;
 	}
 	etype = eh->ether_type;
-	if (etype == htobe16(ETHERTYPE_VLAN)) {
-		ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
-	} else if (etype == htobe16(ETHERTYPE_IP)) {
-		ehlen = ETHER_HDR_LEN;
-	} else {
-		static struct timeval lasttime;
-		if (ratecheck(, _cksum_errintvl))
-			printf("%s: unknown etype %#x passed%s\n",
-			ifp->if_xname, ntohs(etype),
-			data_validated ? "" : " no checksum");
-		return EINVAL;
+	ehlen = ETHER_HDR_LEN;
+	if (__predict_false(etype == htons(ETHERTYPE_VLAN))) {
+		struct ether_vlan_header *evl = m_extract(m, 0, sizeof(*evl));
+		if (evl == NULL) {
+			/* Too short, packet will be dropped by upper layer */
+			return EINVAL;
+		}
+		ehlen += ETHER_VLAN_ENCAP_LEN;
+		etype = ntohs(evl->evl_proto);
 	}
 
-	iph = m_extract(m, 

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

2020-03-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sun Mar 22 00:05:17 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
- move sc_flowflags = 0 line at earlier place.
- handle a set of speed selection operations.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sociox/if_ave.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/sociox/if_ave.c
diff -u src/sys/arch/arm/sociox/if_ave.c:1.8 src/sys/arch/arm/sociox/if_ave.c:1.9
--- src/sys/arch/arm/sociox/if_ave.c:1.8	Sat Mar 21 11:46:36 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Sun Mar 22 00:05:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ave.c,v 1.8 2020/03/21 11:46:36 nisimura Exp $	*/
+/*	$NetBSD: if_ave.c,v 1.9 2020/03/22 00:05:17 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.8 2020/03/21 11:46:36 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.9 2020/03/22 00:05:17 nisimura Exp $");
 
 #include 
 #include 
@@ -387,6 +387,9 @@ ave_fdt_attach(device_t parent, device_t
 	aprint_normal_dev(self,
 	"Ethernet address %s\n", ether_sprintf(enaddr));
 
+	sc->sc_flowflags = 0;
+	sc->sc_rxc = 0;
+
 	mii->mii_ifp = ifp;
 	mii->mii_readreg = mii_readreg;
 	mii->mii_writereg = mii_writereg;
@@ -414,9 +417,6 @@ ave_fdt_attach(device_t parent, device_t
 	ifp->if_stop = ave_stop;
 	IFQ_SET_READY(>if_snd);
 
-	sc->sc_flowflags = 0;
-	sc->sc_rxc = 0;
-
 	sc->sc_ethercom.ec_capabilities = ETHERCAP_VLAN_MTU;
 	ifp->if_capabilities = IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx;
 
@@ -531,8 +531,12 @@ ave_init(struct ifnet *ifp)
 	sc->sc_txd32 =   (void *)((uintptr_t)sc->sc_sh + AVE32TDB);
 	sc->sc_rxd32 =   (void *)((uintptr_t)sc->sc_sh + AVE32RDB);
 
-	/* build sane and loaded Tx/Rx descriptors */
-	memset(sc->sc_txdescs, 0, sizeof(struct tdes)*AVE_NTXDESC);
+	/* build sane Tx and loaded Rx descriptors */
+	for (i = 0; i < AVE_NTXDESC; i++) {
+		struct tdes *tdes = >sc_txdescs[i];
+		tdes->t2 = tdes->t1 = 0;
+		tdes->t0 = T0_OWN;
+	}
 	for (i = 0; i < AVE_NRXDESC; i++)
 		(void)add_rxbuf(sc, i);
 
@@ -550,6 +554,8 @@ ave_init(struct ifnet *ifp)
 	/* accept multicast frame or run promisc mode */
 	ave_set_rcvfilt(sc);
 
+	(void)ave_ifmedia_upd(ifp);
+
 	csr = CSR_READ(sc, AVECFG);
 	if (ifp->if_capenable & IFCAP_CSUM_IPv4_Tx) {
 		sc->sc_t0csum = 0;
@@ -603,7 +609,7 @@ ave_ifmedia_upd(struct ifnet *ifp)
 {
 	struct ave_softc *sc = ifp->if_softc;
 	struct ifmedia *ifm = >sc_mii.mii_media;
-	uint32_t txcr, rxcr;
+	uint32_t txcr, rxcr, csr;
 
 	txcr = CSR_READ(sc, AVETXC);
 	rxcr = CSR_READ(sc, AVERXC);
@@ -615,14 +621,25 @@ ave_ifmedia_upd(struct ifnet *ifp)
 		; /* advertise flow control pause */
 		; /* adv. 1000FDX,100FDX,100HDX,10FDX,10HDX */
 	} else {
+#if 1 /* XXX not sure to belong here XXX */
 		txcr &= ~(TXC_SPD1000 | TXC_SPD100);
 		rxcr &= ~RXC_USEFDX;
-		if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_1000_T)
+		if ((sc->sc_phymode & CFG_MII) == 0 /* RGMII model */
+		 && IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_1000_T)
 			txcr |= TXC_SPD1000;
 		else if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
 			txcr |= TXC_SPD100;
 		if (ifm->ifm_media & IFM_FDX)
-			rxcr |= RXC_USEFDX;
+			rxcr |= RXC_USEFDX;	
+
+		/* adjust LINKSEL when MII/RMII too */
+		if (sc->sc_phymode & CFG_MII) {
+			csr = CSR_READ(sc, AVELINKSEL) &~ LINKSEL_SPD100;;
+			if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
+csr |= LINKSEL_SPD100;
+			CSR_WRITE(sc, AVELINKSEL, csr);
+		}
+#endif
 	}
 	sc->sc_rxc = rxcr;
 	CSR_WRITE(sc, AVETXC, txcr);
@@ -647,10 +664,9 @@ mii_statchg(struct ifnet *ifp)
 {
 	struct ave_softc *sc = ifp->if_softc;
 	struct mii_data *mii = >sc_mii;
-	struct ifmedia * const ifm = >mii_media;
-	uint32_t txcr, rxcr, csr;
+	uint32_t txcr, rxcr;
 
-	/* get flow control negotiation result */
+	/* Get flow control negotiation result. */
 	if (IFM_SUBTYPE(mii->mii_media.ifm_cur->ifm_media) == IFM_AUTO &&
 	(mii->mii_media_active & IFM_ETH_FMASK) != sc->sc_flowflags)
 		sc->sc_flowflags = mii->mii_media_active & IFM_ETH_FMASK;
@@ -659,32 +675,14 @@ mii_statchg(struct ifnet *ifp)
 	rxcr = CSR_READ(sc, AVERXC);
 	CSR_WRITE(sc, AVERXC, rxcr &~ RXC_EN); /* stop Rx first */
 
-	/* adjust 802.3x PAUSE flow control */
-	if ((mii->mii_media_active & IFM_FDX)
-	&& (sc->sc_flowflags & IFM_ETH_TXPAUSE))
-		txcr |= TXC_FCE;
-	else
-		txcr &= ~TXC_FCE;
-	if ((mii->mii_media_active & IFM_FDX)
-	&& (sc->sc_flowflags & IFM_ETH_RXPAUSE))
-		rxcr |= RXC_FCE;
-	else
-		rxcr &= ~RXC_FCE;
-
-	/* HW does not handle automatic speed adjustment */
-	txcr &= ~(TXC_SPD1000 | TXC_SPD100);
-	if ((sc->sc_phymode & CFG_MII) == 0 /* RGMII model */
-	 && IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_1000_T)
-		txcr |= TXC_SPD1000;
-	else if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == 

CVS commit: src/sys/arch/xen/xen

2020-03-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Mar 21 23:25:53 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
need to retain csum_flags in xennetback_copymbuf() when creating
new mbuf for the COPY transmit path, so that later NETRXF_csum_blank
flag is set correctly when passing request over to DomU

fixes bad checksums in DomU when xvif(4) TX offload is enabled;
problem observed when testing new IPv6 offloading, but it should
affect also existing IPv4 offloading

Note: code in xennet(4) is unaffected, there code consults the original
mbuf, rather than the new_m one


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.82 src/sys/arch/xen/xen/xennetback_xenbus.c:1.83
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.82	Thu Mar 19 11:19:25 2020
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Mar 21 23:25:53 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.83 2020/03/21 23:25:53 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -1224,6 +1224,13 @@ xennetback_copymbuf(struct mbuf *m)
 	mtod(new_m, void *));
 	new_m->m_len = new_m->m_pkthdr.len =
 	m->m_pkthdr.len;
+
+	/*
+	 * Need to retain csum flags to know if csum was actually computed.
+	 * This is used to set NETRXF_csum_blank/NETRXF_data_validated.
+	 */
+	new_m->m_pkthdr.csum_flags = m->m_pkthdr.csum_flags;
+
 	return new_m;
 }
 



CVS commit: src/sys/sys

2020-03-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Mar 21 22:52:48 UTC 2020

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

Log Message:
Disable Address Sanitizer instrumentation of the link_set objects

The link_set array must contain consecutive elements that can be iterated.

GCC disables instrumentation of globals for user-defined sections and this
__noasan attribute is implicit for this compiler. For Clang it is required
to be specified explicitly.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/sys/cdefs_elf.h

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

Modified files:

Index: src/sys/sys/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.53 src/sys/sys/cdefs_elf.h:1.54
--- src/sys/sys/cdefs_elf.h:1.53	Thu Aug 10 19:03:27 2017
+++ src/sys/sys/cdefs_elf.h	Sat Mar 21 22:52:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.53 2017/08/10 19:03:27 joerg Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.54 2020/03/21 22:52:48 kamil Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -160,10 +160,10 @@
 #ifndef __lint__
 #define	__link_set_make_entry(set, sym)	\
 	static void const * const __link_set_##set##_sym_##sym		\
-	__section("link_set_" #set) __used = (const void *)
+	__section("link_set_" #set) __noasan __used = (const void *)
 #define	__link_set_make_entry2(set, sym, n)\
 	static void const * const __link_set_##set##_sym_##sym##_##n	\
-	__section("link_set_" #set) __used = (const void *)[n]
+	__section("link_set_" #set) __noasan __used = (const void *)[n]
 #else
 #define	__link_set_make_entry(set, sym)	\
 	extern void const * const __link_set_##set##_sym_##sym



CVS commit: src/sys/sys

2020-03-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Mar 21 22:45:47 UTC 2020

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

Log Message:
Expand the support of __no[sanitizer] attributes

Add support for RUMPKERNEL that can reuse these attributes in the same code.
These macros are not intended to be used by userland and are still disabled
there. They are a NetBSD specific extension.

Add proper support for clang and GCC.

Set __no[sanitizer] only under a sanitizer, as otherwise there are build
warnings about unused compiler attributes.

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/sys/cdefs.h

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

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.150 src/sys/sys/cdefs.h:1.151
--- src/sys/sys/cdefs.h:1.150	Sun Dec  8 11:48:15 2019
+++ src/sys/sys/cdefs.h	Sat Mar 21 22:45:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.150 2019/12/08 11:48:15 maxv Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.151 2020/03/21 22:45:47 kamil Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,9 +38,6 @@
 
 #ifdef _KERNEL_OPT
 #include "opt_diagnostic.h"
-#include "opt_kasan.h"
-#include "opt_kcsan.h"
-#include "opt_kmsan.h"
 #endif
 
 /*
@@ -336,28 +333,32 @@
 #define	__unreachable()	do {} while (/*CONSTCOND*/0)
 #endif
 
-#if defined(_KERNEL)
-#if __GNUC_PREREQ__(4, 9) && defined(KASAN)
+#if defined(_KERNEL) || defined(_RUMPKERNEL)
+#if defined(__clang__) && __has_feature(address_sanitizer)
+#define	__noasan	__attribute__((no_sanitize("kernel-address", "address")))
+#elif __GNUC_PREREQ__(4, 9) && defined(__SANITIZE_ADDRESS__)
 #define	__noasan	__attribute__((no_sanitize_address))
 #else
 #define	__noasan	/* nothing */
 #endif
 
-#if __GNUC_PREREQ__(4, 9) && defined(KCSAN)
+#if defined(__clang__) && __has_feature(thread_sanitizer)
+#define	__nocsan	__attribute__((no_sanitize("thread")))
+#elif __GNUC_PREREQ__(4, 9) && defined(__SANITIZE_THREAD__)
 #define	__nocsan	__attribute__((no_sanitize_thread))
 #else
 #define	__nocsan	/* nothing */
 #endif
 
-#if defined(__clang__) && defined(KMSAN)
-#define	__nomsan	__attribute__((no_sanitize("kernel-memory")))
+#if defined(__clang__) && __has_feature(memory_sanitizer)
+#define	__nomsan	__attribute__((no_sanitize("kernel-memory", "memory")))
 #else
 #define	__nomsan	/* nothing */
 #endif
 
-#if defined(__clang__)
+#if defined(__clang__) && __has_feature(undefined_behavior_sanitizer)
 #define __noubsan	__attribute__((no_sanitize("undefined")))
-#elif __GNUC_PREREQ__(4, 9)
+#elif __GNUC_PREREQ__(4, 9) && defined(__SANITIZE_UNDEFINED__)
 #define __noubsan	__attribute__((no_sanitize_undefined))
 #else
 #define __noubsan	/* nothing */



CVS commit: [ad-namecache] src/sys/sys

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 21 22:04:17 UTC 2020

Modified Files:
src/sys/sys [ad-namecache]: namei.src

Log Message:
Move nc_key up, so cache_lookup_entry() only needs to touch one cache line
at each step.


To generate a diff of this commit:
cvs rdiff -u -r1.47.2.7 -r1.47.2.8 src/sys/sys/namei.src

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

Modified files:

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.47.2.7 src/sys/sys/namei.src:1.47.2.8
--- src/sys/sys/namei.src:1.47.2.7	Wed Mar  4 20:21:05 2020
+++ src/sys/sys/namei.src	Sat Mar 21 22:04:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.47.2.7 2020/03/04 20:21:05 ad Exp $	*/
+/*	$NetBSD: namei.src,v 1.47.2.8 2020/03/21 22:04:17 ad Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -199,11 +199,12 @@ NAMEIFL	PARAMASK	0x02ef800	/* mask of pa
 #define	NCHNAMLEN	sizeof(((struct namecache *)NULL)->nc_name)
 
 /*
- * Namecache entry.  
+ * Namecache entry.
  *
  * This structure describes the elements in the cache of recent names looked
  * up by namei.  It's carefully sized to take up 128 bytes on _LP64, to make
- * good use of space and the CPU caches.
+ * good use of space and the CPU caches.  Items used during RB tree lookup
+ * (nc_tree, nc_key) are clustered at the start of the structure.
  *
  * Field markings and their corresponding locks:
  *
@@ -216,11 +217,11 @@ NAMEIFL	PARAMASK	0x02ef800	/* mask of pa
 struct nchnode;
 struct namecache {
 	struct	rb_node nc_tree;	/* d  red-black tree, must be first */
+	int64_t	nc_key;			/* -  hash key */
 	TAILQ_ENTRY(namecache) nc_list;	/* v  vp's list of cache entries */
 	TAILQ_ENTRY(namecache) nc_lru;	/* l  pseudo-lru chain */
 	struct	vnode *nc_dvp;		/* -  vnode of parent of name */
 	struct	vnode *nc_vp;		/* -  vnode the name refers to */
-	int64_t	nc_key;			/* -  hash key */
 	int	nc_lrulist;		/* l  which LRU list its on */
 	short	nc_nlen;		/* -  length of the name */
 	char	nc_whiteout;		/* -  true if a whiteout */



CVS commit: [ad-namecache] src/sys/kern

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 21 22:00:56 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_cache.c

Log Message:
- Include sys/types.h for vax.
- Use macro versions of kpreempt_disable()/enable().
- Use atomic_load_relaxed().
- Make cache_key() inline.


To generate a diff of this commit:
cvs rdiff -u -r1.126.2.13 -r1.126.2.14 src/sys/kern/vfs_cache.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/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.126.2.13 src/sys/kern/vfs_cache.c:1.126.2.14
--- src/sys/kern/vfs_cache.c:1.126.2.13	Tue Mar 10 21:53:45 2020
+++ src/sys/kern/vfs_cache.c	Sat Mar 21 22:00:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.126.2.13 2020/03/10 21:53:45 ad Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.126.2.14 2020/03/21 22:00:55 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.13 2020/03/10 21:53:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126.2.14 2020/03/21 22:00:55 ad Exp $");
 
 #define __NAMECACHE_PRIVATE
 #ifdef _KERNEL_OPT
@@ -179,6 +179,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,
 #include "opt_dtrace.h"
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -228,9 +229,10 @@ static kmutex_t cache_lru_lock __cacheli
 struct nchstats	nchstats __cacheline_aligned;
 
 #define	COUNT(f)	do { \
-	kpreempt_disable(); \
+	lwp_t *l = curlwp; \
+	KPREEMPT_DISABLE(l); \
 	((struct nchstats_percpu *)curcpu()->ci_data.cpu_nch)->f++; \
-	kpreempt_enable(); \
+	KPREEMPT_ENABLE(l); \
 } while (/* CONSTCOND */ 0);
 
 /* Tunables */
@@ -314,7 +316,7 @@ cache_compare_key(void *context, const v
  * the key value to try and improve uniqueness, and so that length doesn't
  * need to be compared separately for string comparisons.
  */
-static int64_t
+static inline int64_t
 cache_key(const char *name, size_t nlen)
 {
 	int64_t key;
@@ -403,6 +405,7 @@ cache_lookup_entry(struct vnode *dvp, co
 	vnode_impl_t *dvi = VNODE_TO_VIMPL(dvp);
 	struct rb_node *node = dvi->vi_nc_tree.rbt_root;
 	struct namecache *ncp;
+	int lrulist;
 
 	KASSERT(rw_lock_held(>vi_nc_lock));
 
@@ -436,7 +439,8 @@ cache_lookup_entry(struct vnode *dvp, co
 	 * unlocked check, but it will rarely be wrong and even then there
 	 * will be no harm caused.
 	 */
-	if (__predict_false(ncp->nc_lrulist != LRU_ACTIVE)) {
+	lrulist = atomic_load_relaxed(>nc_lrulist);
+	if (__predict_false(lrulist != LRU_ACTIVE)) {
 		cache_activate(ncp);
 	}
 	return ncp;
@@ -744,8 +748,8 @@ cache_revlookup(struct vnode *vp, struct
 	vnode_impl_t *vi = VNODE_TO_VIMPL(vp);
 	struct namecache *ncp;
 	struct vnode *dvp;
+	int error, nlen, lrulist;
 	char *bp;
-	int error, nlen;
 
 	KASSERT(vp != NULL);
 
@@ -793,7 +797,8 @@ cache_revlookup(struct vnode *vp, struct
 		}
 
 		/* Record a hit on the entry.  This is an unlocked read. */
-		if (ncp->nc_lrulist != LRU_ACTIVE) {
+		lrulist = atomic_load_relaxed(>nc_lrulist);
+		if (lrulist != LRU_ACTIVE) {
 			cache_activate(ncp);
 		}
 
@@ -863,7 +868,8 @@ cache_enter(struct vnode *dvp, struct vn
 	 * but it doesn't matter.  Just need to catch up with things
 	 * eventually: it doesn't matter if we go over temporarily.
 	 */
-	total = cache_lru.count[LRU_ACTIVE] + cache_lru.count[LRU_INACTIVE];
+	total = atomic_load_relaxed(_lru.count[LRU_ACTIVE]);
+	total += atomic_load_relaxed(_lru.count[LRU_INACTIVE]);
 	if (__predict_false(total > desiredvnodes)) {
 		cache_reclaim();
 	}



CVS commit: [netbsd-9] src/doc

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:25:42 UTC 2020

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

Log Message:
Tickets #796 - #800


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-9.1

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.21 src/doc/CHANGES-9.1:1.1.2.22
--- src/doc/CHANGES-9.1:1.1.2.21	Sat Mar 21 16:02:38 2020
+++ src/doc/CHANGES-9.1	Sat Mar 21 20:25:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.21 2020/03/21 16:02:38 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.22 2020/03/21 20:25:42 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -672,3 +672,38 @@ sys/dev/dkvar.h	(apply patch)
 	Additional patches to provide ABI compatibility.
 	[riastradh, ticket #795]
 
+sys/arch/arm/samsung/exynos5410_clock.c		1.6
+sys/arch/arm/samsung/exynos5422_clock.c		1.15
+sys/arch/arm/samsung/exynos_gpio.c		1.26
+sys/arch/arm/samsung/exynos_pinctrl.c		1.16
+sys/arch/arm/samsung/exynos_uart.c		1.3
+
+	Whitespace cosmetics in preparation for further pullups.
+	[skrll, ticket #796]
+
+sys/arch/arm/altera/cycv_dwcmmc.c		1.5
+sys/arch/arm/samsung/exynos_dwcmmc.c		1.10
+
+	Fix some dwcmmc attachments (broken by ticket #717).
+	[skrll, ticket #797]
+
+sys/arch/arm/samsung/exynos_gpio.c		1.27-1.29
+sys/arch/arm/samsung/exynos_pinctrl.c		1.17
+sys/arch/arm/samsung/exynos_pinctrl.h		1.3
+sys/arch/arm/samsung/exynos_var.h		1.28
+
+	Support Exynos 5410 GPIO.
+	[skrll, ticket #798]
+
+sys/arch/arm/samsung/exynos_platform.c		1.28
+
+	Bring back EXYNOS5422_DISABLE_CA7_CLUSTER.
+	[skrll, ticket #799]
+
+sys/dev/ic/dwc_mmc.c1.23-1.26
+sys/dev/ic/dwc_mmc_reg.h			1.10
+sys/dev/ic/dwc_mmc_var.h			1.14
+
+	Fix dwc_mmc.
+	[skrll, ticket #800]
+



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

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:24:36 UTC 2020

Modified Files:
src/sys/dev/ic [netbsd-9]: dwc_mmc.c dwc_mmc_reg.h dwc_mmc_var.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #800):

sys/dev/ic/dwc_mmc_var.h: revision 1.14
sys/dev/ic/dwc_mmc_reg.h: revision 1.10
sys/dev/ic/dwc_mmc.c: revision 1.23
sys/dev/ic/dwc_mmc.c: revision 1.24
sys/dev/ic/dwc_mmc.c: revision 1.25
sys/dev/ic/dwc_mmc.c: revision 1.26

Release the sc_intr_lock on error

Trailing whitespace

Add DWC_MMC_VERID_280A

Remember / use sc_verid

Disable thrctrl or now and note why


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/dev/ic/dwc_mmc.c
cvs rdiff -u -r1.7.8.1 -r1.7.8.2 src/sys/dev/ic/dwc_mmc_reg.h
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/sys/dev/ic/dwc_mmc_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/dev/ic/dwc_mmc.c
diff -u src/sys/dev/ic/dwc_mmc.c:1.17.2.2 src/sys/dev/ic/dwc_mmc.c:1.17.2.3
--- src/sys/dev/ic/dwc_mmc.c:1.17.2.2	Tue Feb 25 18:40:43 2020
+++ src/sys/dev/ic/dwc_mmc.c	Sat Mar 21 20:24:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.17.2.2 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.17.2.3 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17.2.2 2020/02/25 18:40:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17.2.3 2020/03/21 20:24:36 martin Exp $");
 
 #include 
 #include 
@@ -439,7 +439,7 @@ dwc_mmc_bus_width(sdmmc_chipset_handle_t
 	}
 
 	sc->sc_mmc_width = width;
-	
+
 	return 0;
 }
 
@@ -662,11 +662,21 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 		MMC_WRITE(sc, DWC_MMC_BLKSZ, cmd->c_blklen);
 		MMC_WRITE(sc, DWC_MMC_BYTECNT,
 		nblks > 1 ? nblks * cmd->c_blklen : cmd->c_datalen);
+
+#if 0
+		/*
+		 * The following doesn't work on the 250a verid IP in Odroid-XU4.
+		*
+		 * thrctl should only be used for UHS/HS200 and faster timings on
+		 * >=240a
+		 */
+
 		if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
 			MMC_WRITE(sc, DWC_MMC_CARDTHRCTL,
 			__SHIFTIN(cmd->c_blklen, DWC_MMC_CARDTHRCTL_RDTHR) |
 			DWC_MMC_CARDTHRCTL_RDTHREN);
 		}
+#endif
 	}
 
 	MMC_WRITE(sc, DWC_MMC_IMASK, imask | sc->sc_intr_card);
@@ -717,6 +727,7 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 		if (error != 0) {
 			cmd->c_error = error;
 			SET(cmd->c_flags, SCF_ITSDONE);
+			mutex_exit(>sc_intr_lock);
 			goto done;
 		}
 	}
@@ -806,11 +817,11 @@ dwc_mmc_init(struct dwc_mmc_softc *sc)
 {
 	uint32_t val;
 
-	if (sc->sc_fifo_reg == 0) {
-		val = MMC_READ(sc, DWC_MMC_VERID);
-		const u_int id = __SHIFTOUT(val, DWC_MMC_VERID_ID);
+	val = MMC_READ(sc, DWC_MMC_VERID);
+	sc->sc_verid = __SHIFTOUT(val, DWC_MMC_VERID_ID);
 
-		if (id < DWC_MMC_VERID_240A)
+	if (sc->sc_fifo_reg == 0) {
+		if (sc->sc_verid < DWC_MMC_VERID_240A)
 			sc->sc_fifo_reg = 0x100;
 		else
 			sc->sc_fifo_reg = 0x200;

Index: src/sys/dev/ic/dwc_mmc_reg.h
diff -u src/sys/dev/ic/dwc_mmc_reg.h:1.7.8.1 src/sys/dev/ic/dwc_mmc_reg.h:1.7.8.2
--- src/sys/dev/ic/dwc_mmc_reg.h:1.7.8.1	Tue Feb 25 18:40:43 2020
+++ src/sys/dev/ic/dwc_mmc_reg.h	Sat Mar 21 20:24:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc_reg.h,v 1.7.8.1 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc_reg.h,v 1.7.8.2 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -153,6 +153,7 @@
 
 #define DWC_MMC_VERID_ID		__BITS(15,0)
 #define DWC_MMC_VERID_240A		0x240a
+#define DWC_MMC_VERID_280A		0x280a
 
 #define DWC_MMC_IDST_HOST_ABT		__BIT(10)
 #define DWC_MMC_IDST_ABNORMAL_INT_SUM	__BIT(9)

Index: src/sys/dev/ic/dwc_mmc_var.h
diff -u src/sys/dev/ic/dwc_mmc_var.h:1.8.2.2 src/sys/dev/ic/dwc_mmc_var.h:1.8.2.3
--- src/sys/dev/ic/dwc_mmc_var.h:1.8.2.2	Tue Feb 25 18:40:43 2020
+++ src/sys/dev/ic/dwc_mmc_var.h	Sat Mar 21 20:24:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc_var.h,v 1.8.2.2 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc_var.h,v 1.8.2.3 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -45,6 +45,7 @@ struct dwc_mmc_softc {
 	u_int sc_clock_freq;
 	u_int sc_bus_width;
 	bool sc_card_inited;
+	u_int sc_verid;
 
 	void *sc_ih;
 	kmutex_t sc_lock;



CVS commit: [netbsd-9] src/sys/arch/arm/samsung

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:21:58 UTC 2020

Modified Files:
src/sys/arch/arm/samsung [netbsd-9]: exynos_platform.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #799):

sys/arch/arm/samsung/exynos_platform.c: revision 1.28

Bring back EXYNOS5422_DISABLE_CA7_CLUSTER the bug is back


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/arch/arm/samsung/exynos_platform.c

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

Modified files:

Index: src/sys/arch/arm/samsung/exynos_platform.c
diff -u src/sys/arch/arm/samsung/exynos_platform.c:1.26 src/sys/arch/arm/samsung/exynos_platform.c:1.26.4.1
--- src/sys/arch/arm/samsung/exynos_platform.c:1.26	Tue Apr  9 07:37:16 2019
+++ src/sys/arch/arm/samsung/exynos_platform.c	Sat Mar 21 20:21:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.26 2019/04/09 07:37:16 skrll Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.26.4.1 2020/03/21 20:21:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -35,7 +35,14 @@
 #include "ukbd.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.26 2019/04/09 07:37:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.26.4.1 2020/03/21 20:21:58 martin Exp $");
+
+
+/*
+ * Booting a CA7 core on Exynos5422 is currently broken, disable starting CA7 secondaries.
+ */
+#defineEXYNOS5422_DISABLE_CA7_CLUSTER
+
 
 #include 
 #include 
@@ -143,6 +150,11 @@ exynos5800_mpstart(void)
 		const u_int aff0 = __SHIFTOUT(mpidr, MPIDR_AFF0);
 		const u_int cpu = cluster * 4 + aff0;
 
+#if defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+		if (cluster == 1)
+			continue;
+#endif
+
 		val = bus_space_read_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_STATUS(cpu));
 		bus_space_write_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_CONFIG(cpu),
 		EXYNOS5800_PMU_CORE_POWER_EN);
@@ -327,6 +339,27 @@ exynos5_platform_bootstrap(void)
 
 	exynos_bootstrap(5);
 
+#if defined(MULTIPROCESSOR) && defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+	const struct of_compat_data *cd = of_search_compatible(OF_finddevice("/"), mp_compat_data);
+	if (cd && cd->data == (uintptr_t)exynos5800_mpstart) {
+		void *fdt_data = __UNCONST(fdtbus_get_data());
+		int cpu_off, cpus_off, len;
+
+		cpus_off = fdt_path_offset(fdt_data, "/cpus");
+		if (cpus_off < 0)
+			return;
+
+		fdt_for_each_subnode(cpu_off, fdt_data, cpus_off) {
+			const void *prop = fdt_getprop(fdt_data, cpu_off, "reg", );
+			if (len != 4)
+continue;
+			const uint32_t mpidr = be32dec(prop);
+			if (mpidr != cpu_mpidr_aff_read() && __SHIFTOUT(mpidr, MPIDR_AFF1) == 1)
+fdt_setprop_string(fdt_data, cpu_off, "status", "fail");
+		}
+	}
+#endif
+
 	arm_fdt_cpu_bootstrap();
 }
 



CVS commit: src/etc

2020-03-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 21 20:20:59 UTC 2020

Modified Files:
src/etc: named.conf

Log Message:
remove obsolete option


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/etc/named.conf

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

Modified files:

Index: src/etc/named.conf
diff -u src/etc/named.conf:1.7 src/etc/named.conf:1.8
--- src/etc/named.conf:1.7	Thu Apr 25 16:28:05 2013
+++ src/etc/named.conf	Sat Mar 21 16:20:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: named.conf,v 1.7 2013/04/25 20:28:05 christos Exp $
+# $NetBSD: named.conf,v 1.8 2020/03/21 20:20:59 christos Exp $
 
 # boot file for secondary name server
 # Note that there should be one primary entry for each SOA record.
@@ -12,7 +12,6 @@ options {
 	directory "/etc/namedb";
 	dnssec-enable yes;
 	dnssec-validation auto;
-	dnssec-lookaside auto;
 	managed-keys-directory "keys";
 	bindkeys-file "bind.keys";
 	allow-recursion { localhost; localnets; };



CVS commit: [netbsd-9] src/sys/arch/arm/samsung

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:20:02 UTC 2020

Modified Files:
src/sys/arch/arm/samsung [netbsd-9]: exynos_gpio.c exynos_pinctrl.c
exynos_pinctrl.h exynos_var.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #798):

sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.17
sys/arch/arm/samsung/exynos_pinctrl.h: revision 1.3
sys/arch/arm/samsung/exynos_gpio.c: revision 1.27
sys/arch/arm/samsung/exynos_gpio.c: revision 1.28
sys/arch/arm/samsung/exynos_gpio.c: revision 1.29
sys/arch/arm/samsung/exynos_var.h: revision 1.28

Use __BIT/__SHIFTOUT some more.  NFCI.

G/C

Support Exynos 5410 GPIO


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/sys/arch/arm/samsung/exynos_gpio.c
cvs rdiff -u -r1.13.4.2 -r1.13.4.3 src/sys/arch/arm/samsung/exynos_pinctrl.c
cvs rdiff -u -r1.2 -r1.2.26.1 src/sys/arch/arm/samsung/exynos_pinctrl.h
cvs rdiff -u -r1.27 -r1.27.4.1 src/sys/arch/arm/samsung/exynos_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/arch/arm/samsung/exynos_gpio.c
diff -u src/sys/arch/arm/samsung/exynos_gpio.c:1.25.4.1 src/sys/arch/arm/samsung/exynos_gpio.c:1.25.4.2
--- src/sys/arch/arm/samsung/exynos_gpio.c:1.25.4.1	Sat Mar 21 20:01:01 2020
+++ src/sys/arch/arm/samsung/exynos_gpio.c	Sat Mar 21 20:20:02 2020
@@ -1,11 +1,11 @@
-/*	$NetBSD: exynos_gpio.c,v 1.25.4.1 2020/03/21 20:01:01 martin Exp $ */
+/*	$NetBSD: exynos_gpio.c,v 1.25.4.2 2020/03/21 20:20:02 martin Exp $ */
 
 /*-
-* Copyright (c) 2014 The NetBSD Foundation, Inc.
+* Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
-* by Reinoud Zandijk
+* by Reinoud Zandijk, and by Nick Hudson
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
@@ -34,7 +34,7 @@
 #include "gpio.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.25.4.1 2020/03/21 20:01:01 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.25.4.2 2020/03/21 20:20:02 martin Exp $");
 
 #include 
 #include 
@@ -63,11 +63,7 @@ struct exynos_gpio_bank {
 	const bus_addr_t	bank_core_offset;
 	const uint8_t		bank_bits;
 
-	uint8_t			bank_pin_mask;
-	uint8_t			bank_pin_inuse_mask;
-	bus_space_handle_t	bank_bsh;
 	struct exynos_gpio_pin_cfg bank_cfg;
-	struct exynos_gpio_bank * bank_next;
 };
 
 struct exynos_gpio_pin {
@@ -88,7 +84,30 @@ struct exynos_gpio_pin {
 		.bank_bits = b, \
 	}
 
-static struct exynos_gpio_bank exynos5_banks[] = {
+#define GPIO_GRP_INTR(o, n, b, i)			\
+	{ 		\
+		.bank_name = #n,			\
+		.bank_core_offset = GPIO_REG(v,s,o),	\
+		.bank_bits = b,\
+	}
+
+#define GPIO_GRP_NONE(o, n, b)	\
+	{ \
+		.bank_name = #n, \
+		.bank_core_offset = GPIO_REG(v,s,o), \
+		.bank_bits = b, \
+	}
+
+#define GPIO_GRP_WAKEUP(o, n, b, i)			\
+	{ 		\
+		.bank_name = #n,			\
+		.bank_core_offset = GPIO_REG(v,s,o),	\
+		.bank_bits = b,\
+	}
+
+
+
+static struct exynos_gpio_bank exynos5420_banks[] = {
 	GPIO_GRP(5, MUXA, 0x, gpy7, 8),
 	GPIO_GRP(5, MUXA, 0x0C00, gpx0, 8),
 	GPIO_GRP(5, MUXA, 0x0C20, gpx1, 8),
@@ -129,10 +148,78 @@ static struct exynos_gpio_bank exynos5_b
 	GPIO_GRP(5, MUXD, 0x0100, gph0, 4),
 
 	GPIO_GRP(5, MUXE, 0x, gpz, 7),
+};
+
+struct exynos_pinctrl_banks exynos5420_pinctrl_banks = {
+	.epb_banks = exynos5420_banks,
+	.epb_nbanks = __arraycount(exynos5420_banks)
+};
+
+static struct exynos_gpio_bank exynos5410_banks[] = {
+	/* pin-controller 0 */
+	GPIO_GRP_INTR(0x000, gpa0, 8, 0x00),
+	GPIO_GRP_INTR(0x020, gpa1, 6, 0x04),
+	GPIO_GRP_INTR(0x040, gpa2, 8, 0x08),
+	GPIO_GRP_INTR(0x060, gpb0, 5, 0x0c),
+	GPIO_GRP_INTR(0x080, gpb1, 5, 0x10),
+	GPIO_GRP_INTR(0x0A0, gpb2, 4, 0x14),
+	GPIO_GRP_INTR(0x0C0, gpb3, 4, 0x18),
+	GPIO_GRP_INTR(0x0E0, gpc0, 7, 0x1c),
+	GPIO_GRP_INTR(0x100, gpc3, 4, 0x20),
+	GPIO_GRP_INTR(0x120, gpc1, 7, 0x24),
+	GPIO_GRP_INTR(0x140, gpc2, 7, 0x28),
+	GPIO_GRP_INTR(0x180, gpd1, 8, 0x2c),
+	GPIO_GRP_INTR(0x1A0, gpe0, 8, 0x30),
+	GPIO_GRP_INTR(0x1C0, gpe1, 2, 0x34),
+	GPIO_GRP_INTR(0x1E0, gpf0, 6, 0x38),
+	GPIO_GRP_INTR(0x200, gpf1, 8, 0x3c),
+	GPIO_GRP_INTR(0x220, gpg0, 8, 0x40),
+	GPIO_GRP_INTR(0x240, gpg1, 8, 0x44),
+	GPIO_GRP_INTR(0x260, gpg2, 2, 0x48),
+	GPIO_GRP_INTR(0x280, gph0, 4, 0x4c),
+	GPIO_GRP_INTR(0x2A0, gph1, 8, 0x50),
+	GPIO_GRP_NONE(0x160, gpm5, 2),
+	GPIO_GRP_NONE(0x2C0, gpm7, 8),
+	GPIO_GRP_NONE(0x2E0, gpy0, 6),
+	GPIO_GRP_NONE(0x300, gpy1, 4),
+	GPIO_GRP_NONE(0x320, gpy2, 6),
+	GPIO_GRP_NONE(0x340, gpy3, 8),
+	GPIO_GRP_NONE(0x360, gpy4, 8),
+	GPIO_GRP_NONE(0x380, gpy5, 8),
+	GPIO_GRP_NONE(0x3A0, gpy6, 8),
+	GPIO_GRP_NONE(0x3C0, gpy7, 8),
+	GPIO_GRP_WAKEUP(0xC00, gpx0, 8, 0x00),
+	GPIO_GRP_WAKEUP(0xC20, gpx1, 8, 0x04),
+	GPIO_GRP_WAKEUP(0xC40, gpx2, 8, 

CVS commit: [netbsd-9] src/sys/arch/arm

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:17:49 UTC 2020

Modified Files:
src/sys/arch/arm/altera [netbsd-9]: cycv_dwcmmc.c
src/sys/arch/arm/samsung [netbsd-9]: exynos_dwcmmc.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #797):

sys/arch/arm/altera/cycv_dwcmmc.c: revision 1.5
sys/arch/arm/samsung/exynos_dwcmmc.c: revision 1.10

Provide a sc_intr_cardmask to restore the value used to that before
http://mail-index.netbsd.org/source-changes/2020/01/22/msg113182.html


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/arch/arm/altera/cycv_dwcmmc.c
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/arm/samsung/exynos_dwcmmc.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/altera/cycv_dwcmmc.c
diff -u src/sys/arch/arm/altera/cycv_dwcmmc.c:1.3 src/sys/arch/arm/altera/cycv_dwcmmc.c:1.3.4.1
--- src/sys/arch/arm/altera/cycv_dwcmmc.c:1.3	Fri May 24 10:37:39 2019
+++ src/sys/arch/arm/altera/cycv_dwcmmc.c	Sat Mar 21 20:17:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cycv_dwcmmc.c,v 1.3 2019/05/24 10:37:39 jmcneill Exp $ */
+/* $NetBSD: cycv_dwcmmc.c,v 1.3.4.1 2020/03/21 20:17:49 martin Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.3 2019/05/24 10:37:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.3.4.1 2020/03/21 20:17:49 martin Exp $");
 
 #include 
 #include 
@@ -134,6 +134,7 @@ cycv_dwcmmc_attach(device_t parent, devi
 	sc->sc_fifo_depth = fifo_depth;
 	sc->sc_fifo_reg = FIFO_REG;
 	sc->sc_flags = DWC_MMC_F_USE_HOLD_REG | DWC_MMC_F_DMA;
+	sc->sc_intr_cardmask = DWC_MMC_INT_SDIO_INT(8);
 
 	sc->sc_card_detect = cycv_dwcmmc_card_detect;
 	sc->sc_write_protect = NULL;

Index: src/sys/arch/arm/samsung/exynos_dwcmmc.c
diff -u src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.8 src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.8.4.1
--- src/sys/arch/arm/samsung/exynos_dwcmmc.c:1.8	Tue Apr  9 05:59:24 2019
+++ src/sys/arch/arm/samsung/exynos_dwcmmc.c	Sat Mar 21 20:17:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_dwcmmc.c,v 1.8 2019/04/09 05:59:24 skrll Exp $ */
+/* $NetBSD: exynos_dwcmmc.c,v 1.8.4.1 2020/03/21 20:17:49 martin Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.8 2019/04/09 05:59:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.8.4.1 2020/03/21 20:17:49 martin Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: exynos_dwcmm
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -130,6 +131,7 @@ exynos_dwcmmc_attach(device_t parent, de
 	sc->sc_dev = self;
 	sc->sc_bst = faa->faa_bst;
 	sc->sc_dmat = faa->faa_dmat;
+	sc->sc_intr_cardmask = DWC_MMC_INT_SDIO_INT(8);
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
 		aprint_error(": couldn't map %#llx: %d\n",



CVS commit: [netbsd-9] src/sys/arch/arm/samsung

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 20:01:01 UTC 2020

Modified Files:
src/sys/arch/arm/samsung [netbsd-9]: exynos5410_clock.c
exynos5422_clock.c exynos_gpio.c exynos_pinctrl.c exynos_uart.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #796):

sys/arch/arm/samsung/exynos_pinctrl.c: revision 1.16
sys/arch/arm/samsung/exynos5410_clock.c: revision 1.6
sys/arch/arm/samsung/exynos_gpio.c: revision 1.26
sys/arch/arm/samsung/exynos_uart.c: revision 1.3
sys/arch/arm/samsung/exynos5422_clock.c: revision 1.15

Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/arch/arm/samsung/exynos5410_clock.c
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/arm/samsung/exynos5422_clock.c
cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/arch/arm/samsung/exynos_gpio.c
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/sys/arch/arm/samsung/exynos_pinctrl.c
cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/arm/samsung/exynos_uart.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/samsung/exynos5410_clock.c
diff -u src/sys/arch/arm/samsung/exynos5410_clock.c:1.4 src/sys/arch/arm/samsung/exynos5410_clock.c:1.4.4.1
--- src/sys/arch/arm/samsung/exynos5410_clock.c:1.4	Sun Sep  9 07:21:18 2018
+++ src/sys/arch/arm/samsung/exynos5410_clock.c	Sat Mar 21 20:01:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos5410_clock.c,v 1.4 2018/09/09 07:21:18 aymeric Exp $ */
+/* $NetBSD: exynos5410_clock.c,v 1.4.4.1 2020/03/21 20:01:01 martin Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.4 2018/09/09 07:21:18 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.4.4.1 2020/03/21 20:01:01 martin Exp $");
 
 #include 
 #include 
@@ -448,7 +448,7 @@ exynos5410_clock_attach(device_t parent,
 
 	sc->sc_dev = self;
 	sc->sc_bst = faa->faa_bst;
-	
+
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
 		aprint_error(": couldn't map %#llx: %d",
@@ -583,7 +583,7 @@ exynos5410_clock_get_rate_pll(struct exy
 	_parent->base);
 
 	const uint32_t v = CLOCK_READ(sc, epll->con0_reg);
-	
+
 	return PLL_FREQ(rate_parent, v);
 }
 

Index: src/sys/arch/arm/samsung/exynos5422_clock.c
diff -u src/sys/arch/arm/samsung/exynos5422_clock.c:1.13 src/sys/arch/arm/samsung/exynos5422_clock.c:1.13.4.1
--- src/sys/arch/arm/samsung/exynos5422_clock.c:1.13	Sun Sep  9 07:21:18 2018
+++ src/sys/arch/arm/samsung/exynos5422_clock.c	Sat Mar 21 20:01:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos5422_clock.c,v 1.13 2018/09/09 07:21:18 aymeric Exp $ */
+/* $NetBSD: exynos5422_clock.c,v 1.13.4.1 2020/03/21 20:01:01 martin Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.13 2018/09/09 07:21:18 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.13.4.1 2020/03/21 20:01:01 martin Exp $");
 
 #include 
 #include 
@@ -625,7 +625,7 @@ exynos5422_clock_attach(device_t parent,
 
 	sc->sc_dev = self;
 	sc->sc_bst = faa->faa_bst;
-	
+
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
 		aprint_error(": couldn't map %#llx: %d",
@@ -760,7 +760,7 @@ exynos5422_clock_get_rate_pll(struct exy
 	_parent->base);
 
 	const uint32_t v = CLOCK_READ(sc, epll->con0_reg);
-	
+
 	return PLL_FREQ(rate_parent, v);
 }
 

Index: src/sys/arch/arm/samsung/exynos_gpio.c
diff -u src/sys/arch/arm/samsung/exynos_gpio.c:1.25 src/sys/arch/arm/samsung/exynos_gpio.c:1.25.4.1
--- src/sys/arch/arm/samsung/exynos_gpio.c:1.25	Wed Jul  4 22:16:42 2018
+++ src/sys/arch/arm/samsung/exynos_gpio.c	Sat Mar 21 20:01:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_gpio.c,v 1.25 2018/07/04 22:16:42 jmcneill Exp $ */
+/*	$NetBSD: exynos_gpio.c,v 1.25.4.1 2020/03/21 20:01:01 martin Exp $ */
 
 /*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "gpio.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.25 2018/07/04 22:16:42 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_gpio.c,v 1.25.4.1 2020/03/21 20:01:01 martin Exp $");
 
 #include 
 #include 
@@ -292,7 +292,7 @@ exynos_gpio_bank_config(struct exynos_pi
 		result);
 		return NULL;
 	}
-	
+
 	sc->sc_dev = parent->sc_dev;
 	sc->sc_bst = _generic_bs_tag;
 	sc->sc_bsh = parent->sc_bsh;

Index: src/sys/arch/arm/samsung/exynos_pinctrl.c
diff -u src/sys/arch/arm/samsung/exynos_pinctrl.c:1.13.4.1 src/sys/arch/arm/samsung/exynos_pinctrl.c:1.13.4.2
--- src/sys/arch/arm/samsung/exynos_pinctrl.c:1.13.4.1	Thu Oct  3 17:23:11 2019
+++ src/sys/arch/arm/samsung/exynos_pinctrl.c	Sat Mar 21 20:01:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_pinctrl.c,v 1.13.4.1 2019/10/03 17:23:11 martin Exp $ */
+/*	$NetBSD: exynos_pinctrl.c,v 1.13.4.2 

CVS commit: src/sys/rump/fs/lib/liblfs

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 18:58:43 UTC 2020

Modified Files:
src/sys/rump/fs/lib/liblfs: Makefile

Log Message:
Suppress spurious address-of-packed error in rump lfs too.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/fs/lib/liblfs/Makefile

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

Modified files:

Index: src/sys/rump/fs/lib/liblfs/Makefile
diff -u src/sys/rump/fs/lib/liblfs/Makefile:1.14 src/sys/rump/fs/lib/liblfs/Makefile:1.15
--- src/sys/rump/fs/lib/liblfs/Makefile:1.14	Wed Mar 23 21:38:51 2016
+++ src/sys/rump/fs/lib/liblfs/Makefile	Sat Mar 21 18:58:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2016/03/23 21:38:51 christos Exp $
+#	$NetBSD: Makefile,v 1.15 2020/03/21 18:58:43 riastradh Exp $
 #
 
 .PATH:  ${.CURDIR}/../../../../ufs/lfs
@@ -21,5 +21,10 @@ CFLAGS+=-DLFS_KERNEL_RFW
 COPTS.lfs_inode.c+=-O0
 .endif
 
+# Follow the suit of Makefile.kern.inc; needed for the lfs64 union
+# accessors -- they don't actually dereference the resulting pointer,
+# just use it for type-checking.
+CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
+
 .include 
 .include 



CVS commit: src/sys/arch/vax

2020-03-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Mar 21 18:47:54 UTC 2020

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

Log Message:
PR port-vax/55094: vax pmap needs locking adjustments

Make the adjustments noted in the PR and don't call uvm_wait() or do
WAITOK ever - UVM takes care of that.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/vax/include/pmap.h
cvs rdiff -u -r1.189 -r1.190 src/sys/arch/vax/vax/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/vax/include/pmap.h
diff -u src/sys/arch/vax/include/pmap.h:1.81 src/sys/arch/vax/include/pmap.h:1.82
--- src/sys/arch/vax/include/pmap.h:1.81	Sat Mar 14 14:05:44 2020
+++ src/sys/arch/vax/include/pmap.h	Sat Mar 21 18:47:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.81 2020/03/14 14:05:44 ad Exp $	   */
+/*	$NetBSD: pmap.h,v 1.82 2020/03/21 18:47:54 ad Exp $	   */
 
 /* 
  * Copyright (c) 1991 Regents of the University of California.
@@ -189,9 +189,6 @@ pmap_extract(pmap_t pmap, vaddr_t va, pa
 	return (false);
 }
 
-bool pmap_clear_modify_long(const struct pv_entry *);
-bool pmap_clear_reference_long(const struct pv_entry *);
-bool pmap_is_modified_long_p(const struct pv_entry *);
 void pmap_page_protect_long(struct pv_entry *, vm_prot_t);
 void pmap_protect_long(pmap_t, vaddr_t, vaddr_t, vm_prot_t);
 
@@ -209,38 +206,6 @@ pmap_is_referenced(struct vm_page *pg)
 	return (pv->pv_attr & PG_V) != 0;
 }
 
-static __inline bool
-pmap_clear_reference(struct vm_page *pg)
-{
-	struct pv_entry * const pv = pmap_pg_to_pv(pg);
-	bool rv = (pv->pv_attr & PG_V) != 0;
-
-	pv->pv_attr &= ~PG_V;
-	if (pv->pv_pmap != NULL || pv->pv_next != NULL)
-		rv |= pmap_clear_reference_long(pv);
-	return rv;
-}
-
-static __inline bool
-pmap_clear_modify(struct vm_page *pg)
-{
-	struct pv_entry * const pv = pmap_pg_to_pv(pg);
-	bool rv = (pv->pv_attr & PG_M) != 0;
-
-	pv->pv_attr &= ~PG_M;
-	if (pv->pv_pmap != NULL || pv->pv_next != NULL)
-		rv |= pmap_clear_modify_long(pv);
-	return rv;
-}
-
-static __inline bool
-pmap_is_modified(struct vm_page *pg)
-{
-	const struct pv_entry * const pv = pmap_pg_to_pv(pg);
-
-	return (pv->pv_attr & PG_M) != 0 || pmap_is_modified_long_p(pv);
-}
-
 static __inline void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {

Index: src/sys/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.189 src/sys/arch/vax/vax/pmap.c:1.190
--- src/sys/arch/vax/vax/pmap.c:1.189	Sat Feb 15 18:12:14 2020
+++ src/sys/arch/vax/vax/pmap.c	Sat Mar 21 18:47:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.189 2020/02/15 18:12:14 ad Exp $	   */
+/*	$NetBSD: pmap.c,v 1.190 2020/03/21 18:47:54 ad Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.189 2020/02/15 18:12:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.190 2020/03/21 18:47:54 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -114,29 +114,9 @@ extern	void *msgbufaddr;
 static inline void
 pmap_decrement_stats(struct pmap *pm, bool wired)
 {
-#if defined(MULTIPROCESSOR)
-	atomic_dec_ulong(>pm_stats.resident_count);
-	if (wired)
-		atomic_dec_ulong(>pm_stats.wired_count);
-#else
 	pm->pm_stats.resident_count--;
 	if (wired)
 		pm->pm_stats.wired_count--;
-#endif
-}
-
-static inline void
-pmap_increment_stats(struct pmap *pm, bool wired)
-{
-#if defined(MULTIPROCESSOR)
-	atomic_inc_ulong(>pm_stats.resident_count);
-	if (wired)
-		atomic_inc_ulong(>pm_stats.wired_count);
-#else
-	pm->pm_stats.resident_count++;
-	if (wired)
-		pm->pm_stats.wired_count++;
-#endif
 }
 
 /*
@@ -171,27 +151,18 @@ ptpinuse(void *pte)
 }
 
 #ifdef PMAPDEBUG
-volatile int recurse;
-#define RECURSESTART {			\
-	if (recurse)			\
-		printf("enter at %d, previous %d\n", __LINE__, recurse);\
-	recurse = __LINE__;		\
-}
-#define RECURSEEND {recurse = 0; }
 #define PMDEBUG(x) if (startpmapdebug)printf x
 #else
-#define RECURSESTART
-#define RECURSEEND
 #define PMDEBUG(x)
 #endif
 
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
-static kmutex_t pvtable_lock;
-#define PVTABLE_LOCK	mutex_spin_enter(_lock);
-#define PVTABLE_UNLOCK	mutex_spin_enter(_lock);
+static kmutex_t pmap_lock;
+#define PMAP_LOCK	mutex_spin_enter(_lock);
+#define PMAP_UNLOCK	mutex_spin_enter(_lock);
 #else
-#define PVTABLE_LOCK
-#define PVTABLE_UNLOCK
+#define PMAP_LOCK
+#define PMAP_UNLOCK
 #endif
 
 #ifdef PMAPDEBUG
@@ -204,7 +175,7 @@ vaddr_t	  virtual_avail, virtual_end; /*
 struct pv_entry *get_pventry(void);
 void free_pventry(struct pv_entry *);
 void more_pventries(void);
-vaddr_t get_ptp(bool);
+vaddr_t get_ptp(void);
 void free_ptp(paddr_t);
 
 /*
@@ -434,7 +405,7 @@ pmap_bootstrap(void)
 	SIMPLEQ_FIRST() = ci;
 #endif
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
-	mutex_init(_lock, 

CVS commit: src/sys/arch/i386/stand/efiboot/bootx64

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 18:43:47 UTC 2020

Modified Files:
src/sys/arch/i386/stand/efiboot/bootx64: Makefile

Log Message:
Fix clang build after packed lfs64 accessor change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/bootx64/Makefile

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/i386/stand/efiboot/bootx64/Makefile
diff -u src/sys/arch/i386/stand/efiboot/bootx64/Makefile:1.2 src/sys/arch/i386/stand/efiboot/bootx64/Makefile:1.3
--- src/sys/arch/i386/stand/efiboot/bootx64/Makefile:1.2	Fri Sep 13 02:19:46 2019
+++ src/sys/arch/i386/stand/efiboot/bootx64/Makefile	Sat Mar 21 18:43:47 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2019/09/13 02:19:46 manu Exp $
+#	$NetBSD: Makefile,v 1.3 2020/03/21 18:43:47 riastradh Exp $
 
 PROG=		bootx64.efi
 OBJFMT=		pei-x86-64
@@ -9,4 +9,9 @@ EXTRA_SOURCES=	efibootx64.c startprog64.
 COPTS+=		-mno-red-zone
 CPPFLAGS+=	-DEFI_FUNCTION_WRAPPER
 
+# Follow the suit of Makefile.kern.inc; needed for the lfs64 union
+# accessors -- they don't actually dereference the resulting pointer,
+# just use it for type-checking.
+CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
+
 .include "${.CURDIR}/../Makefile.efiboot"



CVS commit: src/sys/dev/pci

2020-03-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar 21 17:09:29 UTC 2020

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

Log Message:
When parsing Enhanced Allocation entries, use the correct calulation for
finding the next entry.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/dev/pci/pci_subr.c

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.221 src/sys/dev/pci/pci_subr.c:1.222
--- src/sys/dev/pci/pci_subr.c:1.221	Sat Jan 25 08:13:39 2020
+++ src/sys/dev/pci/pci_subr.c	Sat Mar 21 17:09:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.221 2020/01/25 08:13:39 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.222 2020/03/21 17:09:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.221 2020/01/25 08:13:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.222 2020/03/21 17:09:29 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -2566,9 +2566,7 @@ pci_conf_print_ea_cap(const pcireg_t *re
 		printf("range: 0x%016" PRIx64 "-0x%016" PRIx64
 			"\n", base, base + offset);
 
-		entoff += 4;
-		entoff += baseis64 ? 8 : 4;
-		entoff += offsetis64 ? 8 : 4;
+		entoff += 4 + (4 * entry_size);
 	}
 }
 



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

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 17:00:48 UTC 2020

Modified Files:
src/sys/arch/hppa/include: param.h

Log Message:
Revert another historic $Hdr$ collapse.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hppa/include/param.h

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

Modified files:

Index: src/sys/arch/hppa/include/param.h
diff -u src/sys/arch/hppa/include/param.h:1.25 src/sys/arch/hppa/include/param.h:1.26
--- src/sys/arch/hppa/include/param.h:1.25	Thu Mar  5 15:18:54 2020
+++ src/sys/arch/hppa/include/param.h	Sat Mar 21 17:00:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.25 2020/03/05 15:18:54 riastradh Exp $	*/
+/*	$NetBSD: param.h,v 1.26 2020/03/21 17:00:47 riastradh Exp $	*/
 
 /*	$OpenBSD: param.h,v 1.12 2001/07/06 02:07:41 provos Exp $	*/
 
@@ -22,7 +22,7 @@
  * CSL requests users of this software to return to csl-d...@cs.utah.edu any
  * improvements that they make and grant CSL redistribution rights.
  *
- * 	Utah $Hdr$
+ * 	Utah $Hdr: param.h 1.18 94/12/16$
  */
 
 #ifdef _KERNEL



CVS commit: src/sys/dev/pci

2020-03-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar 21 16:56:00 UTC 2020

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

Log Message:
Use the 64-bit DMA tag, if available, with some constraints:
- The data buffers can come from anywhere in the 64-bit region, but
  the upper 16 bits of the data buffer address is stored in a single
  register, so just treat that as 0 and create a 48-bit restricted
  DMA tag.
- The descriptor address registers share a single register for the
  upper 32-bits, so enforce a 4G boundary when allocating memory
  for the descriptors.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/if_vge.c

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

Modified files:

Index: src/sys/dev/pci/if_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.79 src/sys/dev/pci/if_vge.c:1.80
--- src/sys/dev/pci/if_vge.c:1.79	Thu Jan 30 05:24:53 2020
+++ src/sys/dev/pci/if_vge.c	Sat Mar 21 16:56:00 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.79 2020/01/30 05:24:53 thorpej Exp $ */
+/* $NetBSD: if_vge.c,v 1.80 2020/03/21 16:56:00 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.79 2020/01/30 05:24:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.80 2020/03/21 16:56:00 thorpej Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -75,11 +75,14 @@ __KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1
  * The other issue has to do with the way 64-bit addresses are handled.
  * The DMA descriptors only allow you to specify 48 bits of addressing
  * information. The remaining 16 bits are specified using one of the
- * I/O registers. If you only have a 32-bit system, then this isn't
- * an issue, but if you have a 64-bit system and more than 4GB of
- * memory, you must have to make sure your network data buffers reside
+ * I/O registers (VGE_DATABUF_HIADDR). If you only have a 32-bit system,
+ * then this isn't an issue, but if you have a 64-bit system and more than
+ * 4GB of memory, you must have to make sure your network data buffers reside
  * in the same 48-bit 'segment.'
  *
+ * Furthermore, the descriptors must also all reside within the same 32-bit
+ * 'segment' (see VGE_TXDESC_HIADDR).
+ *
  * Special thanks to Ryan Fu at VIA Networking for providing documentation
  * and sample NICs for testing.
  */
@@ -128,8 +131,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1
 #define VGE_NEXT_RXDESC(x)	((x + 1) & VGE_NRXDESC_MASK)
 #define VGE_PREV_RXDESC(x)	((x - 1) & VGE_NRXDESC_MASK)
 
-#define VGE_ADDR_LO(y)		((uint64_t)(y) & 0x)
-#define VGE_ADDR_HI(y)		((uint64_t)(y) >> 32)
+#define VGE_ADDR_LO(y)		BUS_ADDR_LO32(y)
+#define VGE_ADDR_HI(y)		BUS_ADDR_HI32(y)
 #define VGE_BUFLEN(y)		((y) & 0x7FFF)
 #define ETHER_PAD_LEN		(ETHER_MIN_LEN - ETHER_CRC_LEN)
 
@@ -781,10 +784,17 @@ vge_allocmem(struct vge_softc *sc)
 
 	/*
 	 * Allocate memory for control data.
+	 *
+	 * NOTE: This must all fit within the same 4GB segment.  The
+	 * "boundary" argument to bus_dmamem_alloc() will end up as
+	 * 4GB on 64-bit platforms and 0 ("no boundary constraint") on
+	 * 32-bit platformds.
 	 */
 
 	error = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct vge_control_data),
-	 VGE_RING_ALIGN, 0, , 1, , BUS_DMA_NOWAIT);
+	 VGE_RING_ALIGN,
+	 (bus_size_t)(1ULL << 32),
+	 , 1, , BUS_DMA_NOWAIT);
 	if (error) {
 		aprint_error_dev(sc->sc_dev,
 		"could not allocate control data dma memory\n");
@@ -958,10 +968,24 @@ vge_attach(device_t parent, device_t sel
 	vge_clrwol(sc);
 
 	/*
-	 * Use the 32bit tag. Hardware supports 48bit physical addresses,
-	 * but we don't use that for now.
-	 */
-	sc->sc_dmat = pa->pa_dmat;
+	 * The hardware supports 64-bit DMA addresses, but it's a little
+	 * complicated (see large comment about the hardware near the top
+	 * of the file).  TL;DR -- restrict ourselves to 48-bit.
+	 */
+	if (pci_dma64_available(pa)) {
+		if (bus_dmatag_subregion(pa->pa_dmat64,
+	 0,
+	 (bus_addr_t)(1ULL << 48),
+	 >sc_dmat,
+	 BUS_DMA_WAITOK) != 0) {
+			aprint_error_dev(self,
+			"WARNING: failed to restrict dma range,"
+			" falling back to parent bus dma range\n");
+			sc->sc_dmat = pa->pa_dmat64;
+		}
+	} else {
+		sc->sc_dmat = pa->pa_dmat;
+	}
 
 	if (vge_allocmem(sc) != 0)
 		return;
@@ -1793,6 +1817,7 @@ vge_init(struct ifnet *ifp)
 	 * Note that we only use one transmit queue.
 	 */
 
+	CSR_WRITE_4(sc, VGE_TXDESC_HIADDR, VGE_ADDR_HI(VGE_CDTXADDR(sc, 0)));
 	CSR_WRITE_4(sc, VGE_TXDESC_ADDR_LO0, VGE_ADDR_LO(VGE_CDTXADDR(sc, 0)));
 	CSR_WRITE_2(sc, VGE_TXDESCNUM, VGE_NTXDESC - 1);
 



CVS commit: src/sys/dev/pci

2020-03-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar 21 16:47:05 UTC 2020

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

Log Message:
Don't bother with IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.669 -r1.670 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.669 src/sys/dev/pci/if_wm.c:1.670
--- src/sys/dev/pci/if_wm.c:1.669	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/pci/if_wm.c	Sat Mar 21 16:47:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.669 2020/03/15 23:04:50 thorpej Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.670 2020/03/21 16:47:05 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.669 2020/03/15 23:04:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.670 2020/03/21 16:47:05 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -796,7 +796,7 @@ static void	wm_start_locked(struct ifnet
 static int	wm_transmit(struct ifnet *, struct mbuf *);
 static void	wm_transmit_locked(struct ifnet *, struct wm_txqueue *);
 static void	wm_send_common_locked(struct ifnet *, struct wm_txqueue *,
-bool);
+		bool);
 static int	wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *,
 struct wm_txsoft *, uint32_t *, uint32_t *, bool *);
 static void	wm_nq_start(struct ifnet *);
@@ -804,7 +804,7 @@ static void	wm_nq_start_locked(struct if
 static int	wm_nq_transmit(struct ifnet *, struct mbuf *);
 static void	wm_nq_transmit_locked(struct ifnet *, struct wm_txqueue *);
 static void	wm_nq_send_common_locked(struct ifnet *, struct wm_txqueue *,
-bool);
+		bool);
 static void	wm_deferred_start_locked(struct wm_txqueue *);
 static void	wm_handle_queue(void *);
 static void	wm_handle_queue_work(struct work *, void *);
@@ -6383,7 +6383,6 @@ wm_init_locked(struct ifnet *ifp)
 
 	/* ...all done! */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
  out:
 	/* Save last flags for the callback */
@@ -6504,7 +6503,7 @@ wm_stop_locked(struct ifnet *ifp, bool d
 	}
 
 	/* Mark the interface as down and cancel the watchdog timer. */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 
 	if (disable) {
 		for (i = 0; i < sc->sc_nqueues; i++) {
@@ -7663,8 +7662,6 @@ wm_send_common_locked(struct ifnet *ifp,
 
 	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return;
-	if ((ifp->if_flags & IFF_OACTIVE) != 0 && !is_transmit)
-		return;
 	if ((txq->txq_flags & WM_TXQ_NO_SPACE) != 0)
 		return;
 
@@ -7787,8 +7784,6 @@ retry:
 			("%s: TX: need %d (%d) descriptors, have %d\n",
 device_xname(sc->sc_dev), dmamap->dm_nsegs,
 segs_needed, txq->txq_free - 1));
-			if (!is_transmit)
-ifp->if_flags |= IFF_OACTIVE;
 			txq->txq_flags |= WM_TXQ_NO_SPACE;
 			bus_dmamap_unload(sc->sc_dmat, dmamap);
 			WM_Q_EVCNT_INCR(txq, txdstall);
@@ -7805,8 +7800,6 @@ retry:
 			DPRINTF(WM_DEBUG_TX,
 			("%s: TX: 82547 Tx FIFO bug detected\n",
 device_xname(sc->sc_dev)));
-			if (!is_transmit)
-ifp->if_flags |= IFF_OACTIVE;
 			txq->txq_flags |= WM_TXQ_NO_SPACE;
 			bus_dmamap_unload(sc->sc_dmat, dmamap);
 			WM_Q_EVCNT_INCR(txq, fifo_stall);
@@ -7951,8 +7944,6 @@ retry:
 	}
 
 	if (m0 != NULL) {
-		if (!is_transmit)
-			ifp->if_flags |= IFF_OACTIVE;
 		txq->txq_flags |= WM_TXQ_NO_SPACE;
 		WM_Q_EVCNT_INCR(txq, descdrop);
 		DPRINTF(WM_DEBUG_TX, ("%s: TX: error after IFQ_DEQUEUE\n",
@@ -7962,8 +7953,6 @@ retry:
 
 	if (txq->txq_sfree == 0 || txq->txq_free <= 2) {
 		/* No more slots; notify upper layer. */
-		if (!is_transmit)
-			ifp->if_flags |= IFF_OACTIVE;
 		txq->txq_flags |= WM_TXQ_NO_SPACE;
 	}
 
@@ -8277,8 +8266,6 @@ wm_nq_send_common_locked(struct ifnet *i
 
 	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return;
-	if ((ifp->if_flags & IFF_OACTIVE) != 0 && !is_transmit)
-		return;
 	if ((txq->txq_flags & WM_TXQ_NO_SPACE) != 0)
 		return;
 
@@ -8379,8 +8366,6 @@ retry:
 			("%s: TX: need %d (%d) descriptors, have %d\n",
 device_xname(sc->sc_dev), dmamap->dm_nsegs,
 segs_needed, txq->txq_free - 1));
-			if (!is_transmit)
-ifp->if_flags |= IFF_OACTIVE;
 			txq->txq_flags |= WM_TXQ_NO_SPACE;
 			bus_dmamap_unload(sc->sc_dmat, dmamap);
 			WM_Q_EVCNT_INCR(txq, txdstall);
@@ -8536,8 +8521,6 @@ retry:
 	}
 
 	if (m0 != NULL) {
-		if (!is_transmit)
-			ifp->if_flags |= IFF_OACTIVE;
 		txq->txq_flags |= WM_TXQ_NO_SPACE;
 		WM_Q_EVCNT_INCR(txq, descdrop);
 		DPRINTF(WM_DEBUG_TX, ("%s: TX: error after IFQ_DEQUEUE\n",
@@ -8547,8 +8530,6 @@ retry:
 
 	if (txq->txq_sfree == 0 || txq->txq_free <= 2) {
 		/* No more slots; notify upper layer. */
-		if (!is_transmit)
-			ifp->if_flags |= IFF_OACTIVE;
 		txq->txq_flags |= WM_TXQ_NO_SPACE;
 	}
 
@@ -8603,7 +8584,6 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	int count = 0;
 	int i;
 	

CVS commit: src/sys/miscfs

2020-03-21 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Mar 21 16:30:39 UTC 2020

Modified Files:
src/sys/miscfs/fdesc: fdesc_vfsops.c
src/sys/miscfs/overlay: overlay_vfsops.c

Log Message:
Finish the transition to SYSCTL_SETUP by removing local sysctllog
in favor of the one provided by the module infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/miscfs/fdesc/fdesc_vfsops.c
cvs rdiff -u -r1.69 -r1.70 src/sys/miscfs/overlay/overlay_vfsops.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/miscfs/fdesc/fdesc_vfsops.c
diff -u src/sys/miscfs/fdesc/fdesc_vfsops.c:1.94 src/sys/miscfs/fdesc/fdesc_vfsops.c:1.95
--- src/sys/miscfs/fdesc/fdesc_vfsops.c:1.94	Mon Mar 16 21:20:11 2020
+++ src/sys/miscfs/fdesc/fdesc_vfsops.c	Sat Mar 21 16:30:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdesc_vfsops.c,v 1.94 2020/03/16 21:20:11 pgoyette Exp $	*/
+/*	$NetBSD: fdesc_vfsops.c,v 1.95 2020/03/21 16:30:39 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1995
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.94 2020/03/16 21:20:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.95 2020/03/21 16:30:39 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -68,8 +68,6 @@ MODULE(MODULE_CLASS_VFS, fdesc, NULL);
 
 VFS_PROTOS(fdesc);
 
-static struct sysctllog *fdesc_sysctl_log;
-
 /*
  * Mount the per-process file descriptors (/dev/fd)
  */
@@ -266,7 +264,7 @@ struct vfsops fdesc_vfsops = {
 SYSCTL_SETUP(fdesc_sysctl_setup, "fdesc sysctl")
 {
 
-		sysctl_createv(_sysctl_log, 0, NULL, NULL,
+		sysctl_createv(clog, 0, NULL, NULL,
 			   CTLFLAG_PERMANENT,
 			   CTLTYPE_NODE, "fdesc",
 			   SYSCTL_DESCR("File-descriptor file system"),

Index: src/sys/miscfs/overlay/overlay_vfsops.c
diff -u src/sys/miscfs/overlay/overlay_vfsops.c:1.69 src/sys/miscfs/overlay/overlay_vfsops.c:1.70
--- src/sys/miscfs/overlay/overlay_vfsops.c:1.69	Mon Mar 16 21:20:11 2020
+++ src/sys/miscfs/overlay/overlay_vfsops.c	Sat Mar 21 16:30:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: overlay_vfsops.c,v 1.69 2020/03/16 21:20:11 pgoyette Exp $	*/
+/*	$NetBSD: overlay_vfsops.c,v 1.70 2020/03/21 16:30:39 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.69 2020/03/16 21:20:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.70 2020/03/21 16:30:39 pgoyette Exp $");
 
 #include 
 #include 
@@ -92,8 +92,6 @@ MODULE(MODULE_CLASS_VFS, overlay, "layer
 
 VFS_PROTOS(ov);
 
-static struct sysctllog *overlay_sysctl_log;
-
 #define	NOVERLAYNODECACHE	16
 
 /*
@@ -273,7 +271,7 @@ struct vfsops overlay_vfsops = {
 SYSCTL_SETUP(overlay_sysctl_setup, "overlay fs sysctl")
 {
 
-	sysctl_createv(_sysctl_log, 0, NULL, NULL,
+	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT, CTLTYPE_NODE, "overlay",
 		   SYSCTL_DESCR("Overlay file system"),
 		   NULL, 0, NULL, 0,



CVS commit: src/sys/compat

2020-03-21 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Mar 21 16:28:57 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_mod.c linux_sysctl.c linux_sysctl.h
src/sys/compat/linux32/common: linux32_mod.c linux32_sysctl.c
linux32_sysctl.h

Log Message:
Deal with having to teardown sysctl entries in multiple sub-trees.

(This used to work, but I broke it recently.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/linux/common/linux_sysctl.c
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_sysctl.h
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_mod.c
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/linux32/common/linux32_sysctl.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux32/common/linux32_sysctl.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/compat/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.12 src/sys/compat/linux/common/linux_mod.c:1.13
--- src/sys/compat/linux/common/linux_mod.c:1.12	Mon Mar 16 21:20:09 2020
+++ src/sys/compat/linux/common/linux_mod.c	Sat Mar 21 16:28:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.12 2020/03/16 21:20:09 pgoyette Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.13 2020/03/21 16:28:56 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.12 2020/03/16 21:20:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.13 2020/03/21 16:28:56 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -171,6 +171,7 @@ compat_linux_modcmd(modcmd_t cmd, void *
 		error = exec_remove(linux_execsw, __arraycount(linux_execsw));
 		if (error)
 			return error;
+		linux_sysctl_fini();
 		linux_futex_fini();
 		return 0;
 

Index: src/sys/compat/linux/common/linux_sysctl.c
diff -u src/sys/compat/linux/common/linux_sysctl.c:1.45 src/sys/compat/linux/common/linux_sysctl.c:1.46
--- src/sys/compat/linux/common/linux_sysctl.c:1.45	Mon Mar 16 21:20:09 2020
+++ src/sys/compat/linux/common/linux_sysctl.c	Sat Mar 21 16:28:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sysctl.c,v 1.45 2020/03/16 21:20:09 pgoyette Exp $	*/
+/*	$NetBSD: linux_sysctl.c,v 1.46 2020/03/21 16:28:56 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.45 2020/03/16 21:20:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.46 2020/03/21 16:28:56 pgoyette Exp $");
 
 #include 
 #include 
@@ -70,26 +70,41 @@ struct sysctlnode linux_sysctl_root = {
 
 extern int linux_enabled;
 
+/*
+ * We need an additional sysctllog here since each log can only
+ * deal with a single root node.
+ */
+
+static struct sysctllog *linux_clog;
+
+void
+linux_sysctl_fini(void)
+{
+
+	sysctl_teardown(_clog);
+	sysctl_free(_sysctl_root);
+}
+
 SYSCTL_SETUP(linux_sysctl_setup, "linux emulation sysctls")
 {
 	const struct sysctlnode *node = _sysctl_root;
 
-	sysctl_createv(clog, 0, , ,
+	sysctl_createv(_clog, 0, , ,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_NODE, "kern", NULL,
 		   NULL, 0, NULL, 0,
 		   LINUX_CTL_KERN, CTL_EOL);
-	sysctl_createv(clog, 0, , NULL,
+	sysctl_createv(_clog, 0, , NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_STRING, "ostype", NULL,
 		   NULL, 0, linux_sysname, sizeof(linux_sysname),
 		   LINUX_KERN_OSTYPE, CTL_EOL);
-	sysctl_createv(clog, 0, , NULL,
+	sysctl_createv(_clog, 0, , NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_STRING, "osrelease", NULL,
 		   NULL, 0, linux_release, sizeof(linux_release),
 		   LINUX_KERN_OSRELEASE, CTL_EOL);
-	sysctl_createv(clog, 0, , NULL,
+	sysctl_createv(_clog, 0, , NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_STRING, "version", NULL,
 		   NULL, 0, linux_version, sizeof(linux_version),

Index: src/sys/compat/linux/common/linux_sysctl.h
diff -u src/sys/compat/linux/common/linux_sysctl.h:1.7 src/sys/compat/linux/common/linux_sysctl.h:1.8
--- src/sys/compat/linux/common/linux_sysctl.h:1.7	Mon Mar 16 21:20:09 2020
+++ src/sys/compat/linux/common/linux_sysctl.h	Sat Mar 21 16:28:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sysctl.h,v 1.7 2020/03/16 21:20:09 pgoyette Exp $	*/
+/*	$NetBSD: linux_sysctl.h,v 1.8 2020/03/21 16:28:56 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -466,6 +466,8 @@
 #define	LINUX_BUS_ISA_PORT_BASE	2
 #define	LINUX_BUS_ISA_PORT_SHIFT3
 
+void	linux_sysctl_fini(void);
+
 int	linux_sysctl_enable(SYSCTLFN_PROTO);
 
 #endif /* !_LINUX_SYSCTL_H */

Index: src/sys/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.13 src/sys/compat/linux32/common/linux32_mod.c:1.14
--- 

CVS commit: src/sys/compat/netbsd32

2020-03-21 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Mar 21 16:17:08 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_mod.c netbsd32_sysctl.c
Added Files:
src/sys/compat/netbsd32: netbsd32_sysctl.h

Log Message:
Restore code to sysctl_free() the compat32 shadow tree


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/netbsd32/netbsd32_mod.c
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_sysctl.c
cvs rdiff -u -r0 -r1.3 src/sys/compat/netbsd32/netbsd32_sysctl.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/compat/netbsd32/netbsd32_mod.c
diff -u src/sys/compat/netbsd32/netbsd32_mod.c:1.21 src/sys/compat/netbsd32/netbsd32_mod.c:1.22
--- src/sys/compat/netbsd32/netbsd32_mod.c:1.21	Sun Mar 15 14:15:12 2020
+++ src/sys/compat/netbsd32/netbsd32_mod.c	Sat Mar 21 16:17:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_mod.c,v 1.21 2020/03/15 14:15:12 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_mod.c,v 1.22 2020/03/21 16:17:08 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.21 2020/03/15 14:15:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.22 2020/03/21 16:17:08 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -76,6 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mod
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -180,6 +181,7 @@ compat_netbsd32_modcmd(modcmd_t cmd, voi
 		MODULE_HOOK_UNSET(amd64_oosyscall_hook);
 #endif /* defined(__amd64__) */
 		netbsd32_machdep_md_fini();
+		netbsd32_sysctl_fini();
 		netbsd32_kern_proc_32_fini();
 
 		error = exec_remove(netbsd32_execsw,

Index: src/sys/compat/netbsd32/netbsd32_sysctl.c
diff -u src/sys/compat/netbsd32/netbsd32_sysctl.c:1.43 src/sys/compat/netbsd32/netbsd32_sysctl.c:1.44
--- src/sys/compat/netbsd32/netbsd32_sysctl.c:1.43	Tue Mar 17 17:16:26 2020
+++ src/sys/compat/netbsd32/netbsd32_sysctl.c	Sat Mar 21 16:17:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_sysctl.c,v 1.43 2020/03/17 17:16:26 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_sysctl.c,v 1.44 2020/03/21 16:17:08 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.43 2020/03/17 17:16:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.44 2020/03/21 16:17:08 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sys
 #include 
 #include 
 #include 
+#include 
 
 #if defined(DDB)
 #include 
@@ -180,6 +181,13 @@ SYSCTL_SETUP(netbsd32_sysctl_emul_setup,
 		   CTL_HW, HW_MACHINE_ARCH, CTL_EOL);
 }
 
+void
+netbsd32_sysctl_fini(void)
+{
+
+	sysctl_free(_sysctl_root);
+}
+
 int
 netbsd32___sysctl(struct lwp *l, const struct netbsd32___sysctl_args *uap, register_t *retval)
 {

Added files:

Index: src/sys/compat/netbsd32/netbsd32_sysctl.h
diff -u /dev/null src/sys/compat/netbsd32/netbsd32_sysctl.h:1.3
--- /dev/null	Sat Mar 21 16:17:08 2020
+++ src/sys/compat/netbsd32/netbsd32_sysctl.h	Sat Mar 21 16:17:08 2020
@@ -0,0 +1,37 @@
+/*	$NetBSD: netbsd32_sysctl.h,v 1.3 2020/03/21 16:17:08 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Andrew Doran.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _NETBSD32_SYSCTL_H
+#define _NETBSD32_SYSCTL_H
+
+void	netbsd32_sysctl_fini(void);
+
+#endif /* 

CVS commit: [netbsd-9] src/doc

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 16:02:38 UTC 2020

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

Log Message:
Tickets #788 - #795


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/doc/CHANGES-9.1

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.20 src/doc/CHANGES-9.1:1.1.2.21
--- src/doc/CHANGES-9.1:1.1.2.20	Thu Mar 19 19:47:39 2020
+++ src/doc/CHANGES-9.1	Sat Mar 21 16:02:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.20 2020/03/19 19:47:39 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.21 2020/03/21 16:02:38 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -603,3 +603,72 @@ sys/net/zlib.h	1.15
 	Fix kernel ctf type duplication.
 	[riastradh, ticket #787]
 
+external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c 1.14,1.15
+sys/dev/ata/wd.c1.459
+sys/dev/ata/wdvar.h1.50
+sys/dev/cgd.c	1.121
+sys/dev/dkwedge/dk.c1.100
+sys/kern/subr_disk_open.c			1.15
+sys/sys/disk.h	1.75
+sys/sys/dkio.h	1.26
+
+	New ioctl DIOCGSECTORALIGN to query sector alignment parameters.
+	Make zfs zpool(8) use it to detect ata disks with native 4096-byte
+	sectors.
+	[riastradh, ticket #788]
+
+sys/miscfs/deadfs/dead_vnops.c			1.62
+
+	Fix missing biodone from VOP_BWRITE on revoked device vnode.
+	[riastradh, ticket #789]
+
+sys/ufs/ffs/ffs_alloc.c1.165
+
+	Fix non-DIAGNOSTIC build with UVM_PAGE_TRKOWN.
+	[riastradh, ticket #790]
+
+sys/external/bsd/drm2/include/drm/bus_dma_hacks.h 1.20
+
+	PR 54817: in bus_dmamap_load_pglist() try a 32-element array of
+	bus_dma_segment_t's before attempting to allocate.
+	[mrg, ticket #791]
+
+sys/arch/amiga/dev/aucc.c			1.48
+sys/dev/pci/auacer.c1.39
+sys/dev/pci/auich.c1.159
+sys/dev/pci/auixp.c1.49
+sys/dev/pci/auvia.c1.85
+sys/dev/pci/gcscaudio.c1.19
+sys/dev/sbus/dbri.c1.42
+
+	PR 55017: fix audio round_blocksize mismatch.
+	[isaki, ticket #792]
+
+sys/dev/audio/audio.c1.42,1.47
+sys/dev/audio/audiodef.h			1.9
+
+	Remove incorrect assertion and improve messages for others.
+	[isaki, ticket #793]
+
+sys/dev/audio/audio.c1.38, 1.56 (patch), 1.57
+sys/dev/audio/audiodef.h			1.10
+sys/dev/audio/audiovar.h			1.8
+
+	PR 54427: fix panic when closing before pad.
+	[isaki, ticket #794]
+
+sys/arch/xen/xen/xbd_xenbus.c			1.95
+sys/dev/ata/wd.c1.458
+sys/dev/cgd.c	1.120
+sys/dev/dksubr.c1.112
+sys/dev/dkvar.h	1.32
+sys/dev/ld.c	1.109
+sys/dev/raidframe/rf_netbsdkintf.c		1.380
+sys/dev/scsipi/sd.c1.328
+sys/dev/dksubr.c(apply patch)
+sys/dev/dkvar.h	(apply patch)
+
+	Fix dump on nested virtual disk devices.
+	Additional patches to provide ABI compatibility.
+	[riastradh, ticket #795]
+



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

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 16:00:39 UTC 2020

Modified Files:
src/sys/dev [netbsd-9]: dksubr.c dkvar.h

Log Message:
Apply patch, requested by riastradh in ticket #795, to keep ABI compatibility.


To generate a diff of this commit:
cvs rdiff -u -r1.109.2.1 -r1.109.2.2 src/sys/dev/dksubr.c
cvs rdiff -u -r1.30.10.1 -r1.30.10.2 src/sys/dev/dkvar.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/dksubr.c
diff -u src/sys/dev/dksubr.c:1.109.2.1 src/sys/dev/dksubr.c:1.109.2.2
--- src/sys/dev/dksubr.c:1.109.2.1	Sat Mar 21 15:52:09 2020
+++ src/sys/dev/dksubr.c	Sat Mar 21 16:00:39 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $ */
+/* $NetBSD: dksubr.c,v 1.109.2.2 2020/03/21 16:00:39 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109.2.2 2020/03/21 16:00:39 martin Exp $");
+
+#define	_DKSUBR_PRIVATE
 
 #include 
 #include 
@@ -758,9 +760,17 @@ dk_ioctl(struct dk_softc *dksc, dev_t de
 #define DKFF_READYFORDUMP(x)	(((x) & DKF_READYFORDUMP) == DKF_READYFORDUMP)
 static volatile int	dk_dumping = 0;
 
-/* ARGSUSED */
 int
 dk_dump(struct dk_softc *dksc, dev_t dev,
+daddr_t blkno, void *vav, size_t size)
+{
+
+	return dk_dump_flags(dksc, dev, blkno, vav, size, 0);
+}
+
+/* ARGSUSED */
+int
+dk_dump_flags(struct dk_softc *dksc, dev_t dev,
 daddr_t blkno, void *vav, size_t size, int flags)
 {
 	const struct dkdriver *dkd = dksc->sc_dkdev.dk_driver;

Index: src/sys/dev/dkvar.h
diff -u src/sys/dev/dkvar.h:1.30.10.1 src/sys/dev/dkvar.h:1.30.10.2
--- src/sys/dev/dkvar.h:1.30.10.1	Sat Mar 21 15:52:09 2020
+++ src/sys/dev/dkvar.h	Sat Mar 21 16:00:39 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dkvar.h,v 1.30.10.1 2020/03/21 15:52:09 martin Exp $ */
+/* $NetBSD: dkvar.h,v 1.30.10.2 2020/03/21 16:00:39 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -108,10 +108,16 @@ int	dk_size(struct dk_softc *, dev_t);
 int	dk_ioctl(struct dk_softc *, dev_t,
 		 u_long, void *, int, struct lwp *);
 int	dk_dump(struct dk_softc *, dev_t,
+		daddr_t, void *, size_t);
+int	dk_dump_flags(struct dk_softc *, dev_t,
 		daddr_t, void *, size_t, int);
 void	dk_getdisklabel(struct dk_softc *, dev_t);
 void	dk_getdefaultlabel(struct dk_softc *, struct disklabel *);
 
 int	dk_lookup(struct pathbuf *, struct lwp *, struct vnode **);
 
+#ifndef _DKSUBR_PRIVATE
+#define	dk_dump	dk_dump_flags
+#endif
+
 #endif /* ! _DEV_DKVAR_H_ */   



CVS commit: [netbsd-9] src/sys

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:52:10 UTC 2020

Modified Files:
src/sys/arch/xen/xen [netbsd-9]: xbd_xenbus.c
src/sys/dev [netbsd-9]: cgd.c dksubr.c dkvar.h ld.c
src/sys/dev/ata [netbsd-9]: wd.c
src/sys/dev/raidframe [netbsd-9]: rf_netbsdkintf.c
src/sys/dev/scsipi [netbsd-9]: sd.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #795):

sys/dev/dksubr.c: revision 1.112
sys/arch/xen/xen/xbd_xenbus.c: revision 1.95
sys/dev/scsipi/sd.c: revision 1.328
sys/dev/dkvar.h: revision 1.32
sys/dev/ld.c: revision 1.109
sys/dev/cgd.c: revision 1.120
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.380
sys/dev/ata/wd.c: revision 1.458

Add a flag to dk_dump for virtual disk devices.

If a disk is backed by a physical medium other than itself, such as
cgd(4), then it passes DK_DUMP_RECURSIVE to disable the recursion
detection for dk_dump.

If, however, a device represents a physical medium on its own, such
as wd(4), then it passes 0 instead.

With this, I can now dump to dk on cgd on dk on wd.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.92.4.1 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.116.10.1 -r1.116.10.2 src/sys/dev/cgd.c
cvs rdiff -u -r1.109 -r1.109.2.1 src/sys/dev/dksubr.c
cvs rdiff -u -r1.30 -r1.30.10.1 src/sys/dev/dkvar.h
cvs rdiff -u -r1.106.4.1 -r1.106.4.2 src/sys/dev/ld.c
cvs rdiff -u -r1.452.2.1 -r1.452.2.2 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.376 -r1.376.4.1 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.327 -r1.327.4.1 src/sys/dev/scsipi/sd.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/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.92 src/sys/arch/xen/xen/xbd_xenbus.c:1.92.4.1
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.92	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Mar 21 15:52:09 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.92.4.1 2020/03/21 15:52:09 martin Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.92.4.1 2020/03/21 15:52:09 martin Exp $");
 
 #include "opt_xen.h"
 
@@ -930,7 +930,7 @@ xbddump(dev_t dev, daddr_t blkno, void *
 
 	DPRINTF(("xbddump(%d, %" PRId64 ", %p, %lu)\n", dev, blkno, va,
 	(unsigned long)size));
-	return dk_dump(>sc_dksc, dev, blkno, va, size);
+	return dk_dump(>sc_dksc, dev, blkno, va, size, 0);
 }
 
 static int

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.116.10.1 src/sys/dev/cgd.c:1.116.10.2
--- src/sys/dev/cgd.c:1.116.10.1	Sat Mar 21 15:18:57 2020
+++ src/sys/dev/cgd.c	Sat Mar 21 15:52:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.116.10.1 2020/03/21 15:18:57 martin Exp $ */
+/* $NetBSD: cgd.c,v 1.116.10.2 2020/03/21 15:52:09 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.1 2020/03/21 15:18:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.2 2020/03/21 15:52:09 martin Exp $");
 
 #include 
 #include 
@@ -770,7 +770,7 @@ cgddump(dev_t dev, daddr_t blkno, void *
 	DPRINTF_FOLLOW(("cgddump(0x%"PRIx64", %" PRId64 ", %p, %lu)\n",
 	dev, blkno, va, (unsigned long)size));
 	GETCGD_SOFTC(cs, dev);
-	return dk_dump(>sc_dksc, dev, blkno, va, size);
+	return dk_dump(>sc_dksc, dev, blkno, va, size, DK_DUMP_RECURSIVE);
 }
 
 /*

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.109 src/sys/dev/dksubr.c:1.109.2.1
--- src/sys/dev/dksubr.c:1.109	Fri Jun 28 14:56:46 2019
+++ src/sys/dev/dksubr.c	Sat Mar 21 15:52:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $ */
+/* $NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $");
 
 #include 
 #include 
@@ -761,7 +761,7 @@ static volatile int	dk_dumping = 0;
 /* ARGSUSED */
 int
 dk_dump(struct dk_softc *dksc, dev_t dev,
-daddr_t blkno, void *vav, size_t size)
+daddr_t blkno, void *vav, size_t size, int flags)
 {
 	const struct dkdriver *dkd = dksc->sc_dkdev.dk_driver;
 	struct disk_geom *dg = >sc_dkdev.dk_geom;
@@ -784,7 +784,8 @@ dk_dump(struct dk_softc *dksc, dev_t dev
 	/* ensure that we are not already dumping */
 	if (dk_dumping)
 		return EFAULT;
-	dk_dumping = 1;
+	if ((flags & DK_DUMP_RECURSIVE) == 0)
+		dk_dumping = 1;
 
 	if 

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

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:47:01 UTC 2020

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c audiodef.h audiovar.h

Log Message:
Pull up following revision(s) (requested by isaki in ticket #794):

sys/dev/audio/audiodef.h: revision 1.10
sys/dev/audio/audio.c: revision 1.56 (via patch)
sys/dev/audio/audio.c: revision 1.57
sys/dev/audio/audiovar.h: revision 1.8
sys/dev/audio/audio.c: revision 1.38

Remove obsoleted comment.

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@

Release memories on audiobellclose.
It's rest of the last commit.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.8 -r1.28.2.9 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/sys/dev/audio/audiodef.h
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/sys/dev/audio/audiovar.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.28.2.8 src/sys/dev/audio/audio.c:1.28.2.9
--- src/sys/dev/audio/audio.c:1.28.2.8	Sat Mar 21 15:41:18 2020
+++ src/sys/dev/audio/audio.c	Sat Mar 21 15:47:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.28.2.8 2020/03/21 15:41:18 martin Exp $	*/
+/*	$NetBSD: audio.c,v 1.28.2.9 2020/03/21 15:47:00 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.8 2020/03/21 15:41:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.9 2020/03/21 15:47:00 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -499,6 +499,8 @@ static void audio_softintr_wr(void *);
 
 static int  audio_enter_exclusive(struct audio_softc *);
 static void audio_exit_exclusive(struct audio_softc *);
+static struct audio_softc *audio_file_enter(audio_file_t *, struct psref *);
+static void audio_file_exit(struct audio_softc *, struct psref *);
 static int audio_track_waitio(struct audio_softc *, audio_track_t *);
 
 static int audioclose(struct file *);
@@ -519,6 +521,7 @@ static int  filt_audioread_event(struct 
 static int audio_open(dev_t, struct audio_softc *, int, int, struct lwp *,
 	audio_file_t **);
 static int audio_close(struct audio_softc *, audio_file_t *);
+static int audio_unlink(struct audio_softc *, audio_file_t *);
 static int audio_read(struct audio_softc *, struct uio *, int, audio_file_t *);
 static int audio_write(struct audio_softc *, struct uio *, int, audio_file_t *);
 static void audio_file_clear(struct audio_softc *, audio_file_t *);
@@ -530,7 +533,6 @@ static int audio_mmap(struct audio_softc
 	struct uvm_object **, int *, audio_file_t *);
 
 static int audioctl_open(dev_t, struct audio_softc *, int, int, struct lwp *);
-static int audioctl_close(struct audio_softc *, audio_file_t *);
 
 static void audio_pintr(void *);
 static void audio_rintr(void *);
@@ -811,6 +813,8 @@ static const struct portname otable[] = 
 	{ 0, 0 }
 };
 
+static struct psref_class *audio_psref_class __read_mostly;
+
 CFATTACH_DECL3_NEW(audio, sizeof(struct audio_softc),
 audiomatch, audioattach, audiodetach, audioactivate, audiorescan,
 audiochilddet, DVF_DETACH_SHUTDOWN);
@@ -963,6 +967,9 @@ audioattach(device_t parent, device_t se
 		goto bad;
 	}
 
+	sc->sc_psz = pserialize_create();
+	psref_target_init(>sc_psref, audio_psref_class);
+
 	selinit(>sc_wsel);
 	selinit(>sc_rsel);
 
@@ -1220,7 +1227,7 @@ static int
 audiodetach(device_t self, int flags)
 {
 	struct audio_softc *sc;
-	int maj, mn;
+	struct audio_file *file;
 	int error;
 
 	sc = device_private(self);
@@ -1235,6 +1242,9 @@ audiodetach(device_t self, int flags)
 	if (error)
 		return error;
 
+	/* delete sysctl nodes */
+	sysctl_teardown(>sc_log);
+
 	mutex_enter(sc->sc_lock);
 	sc->sc_dying = true;
 	cv_broadcast(>sc_exlockcv);
@@ -1242,23 +1252,36 @@ audiodetach(device_t self, int flags)
 		cv_broadcast(>sc_pmixer->outcv);
 	if (sc->sc_rmixer)
 		cv_broadcast(>sc_rmixer->outcv);
-	mutex_exit(sc->sc_lock);
 
-	/* delete sysctl nodes */
-	sysctl_teardown(>sc_log);
+	/* Prevent new users */
+	SLIST_FOREACH(file, >sc_files, entry) {
+		atomic_store_relaxed(>dying, true);
+	}
+
+	/*
+	 * Wait for existing users to drain.
+	 * - pserialize_perform waits for all pserialize_read sections on
+	 *   all CPUs; after this, no more new psref_acquire can happen.
+	 * - psref_target_destroy waits for all extant acquired psrefs to
+	 *   be psref_released.
+	 */
+	pserialize_perform(sc->sc_psz);
+	mutex_exit(sc->sc_lock);
+	psref_target_destroy(>sc_psref, audio_psref_class);
 
-	/* locate the major number */
-	maj = cdevsw_lookup_major(_cdevsw);
+	/*
+	 * We are now guaranteed that there are no calls to audio fileops
+	 * that hold sc, and any new calls with files that were for sc will
+	 * fail.  Thus, we now have exclusive access to the softc.
+	 */
 

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

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:41:19 UTC 2020

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c audiodef.h

Log Message:
Pull up following revision(s) (requested by isaki in ticket #793):

sys/dev/audio/audio.c: revision 1.42
sys/dev/audio/audio.c: revision 1.47
sys/dev/audio/audiodef.h: revision 1.9

Remove incorrect KASSERT(!mutex_owned()).
Pointed out by riastradh@.

Improve KASSERT messages.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.7 -r1.28.2.8 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.7.2.1 -r1.7.2.2 src/sys/dev/audio/audiodef.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.28.2.7 src/sys/dev/audio/audio.c:1.28.2.8
--- src/sys/dev/audio/audio.c:1.28.2.7	Tue Jan 21 11:19:19 2020
+++ src/sys/dev/audio/audio.c	Sat Mar 21 15:41:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.28.2.7 2020/01/21 11:19:19 martin Exp $	*/
+/*	$NetBSD: audio.c,v 1.28.2.8 2020/03/21 15:41:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.7 2020/01/21 11:19:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.8 2020/03/21 15:41:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1357,14 +1357,13 @@ audio_attach_mi(const struct audio_hw_if
 /*
  * Acquire sc_lock and enter exlock critical section.
  * If successful, it returns 0.  Otherwise returns errno.
+ * Must be called without sc_lock held.
  */
 static int
 audio_enter_exclusive(struct audio_softc *sc)
 {
 	int error;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 	mutex_enter(sc->sc_lock);
 	if (sc->sc_dying) {
 		mutex_exit(sc->sc_lock);
@@ -2062,7 +2061,7 @@ audio_open(dev_t dev, struct audio_softc
 		*bellfile = af;
 	} else {
 		error = fd_clone(fp, fd, flags, _fileops, af);
-		KASSERT(error == EMOVEFD);
+		KASSERTMSG(error == EMOVEFD, "error=%d", error);
 	}
 
 	TRACEF(3, af, "done");
@@ -2095,7 +2094,7 @@ bad1:
 }
 
 /*
- * Must NOT called with sc_lock nor sc_exlock held.
+ * Must be called without sc_lock nor sc_exlock held.
  */
 int
 audio_close(struct audio_softc *sc, audio_file_t *file)
@@ -2103,8 +2102,6 @@ audio_close(struct audio_softc *sc, audi
 	audio_track_t *oldtrack;
 	int error;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 	TRACEF(1, file, "%spid=%d.%d po=%d ro=%d",
 	(audiodebug >= 3) ? "start " : "",
 	(int)curproc->p_pid, (int)curlwp->l_lid,
@@ -2205,6 +2202,9 @@ audio_close(struct audio_softc *sc, audi
 	return 0;
 }
 
+/*
+ * Must be called without sc_lock nor sc_exlock held.
+ */
 int
 audio_read(struct audio_softc *sc, struct uio *uio, int ioflag,
 	audio_file_t *file)
@@ -2214,8 +2214,6 @@ audio_read(struct audio_softc *sc, struc
 	audio_ring_t *input;
 	int error;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 	/*
 	 * On half-duplex hardware, O_RDWR is treated as O_WRONLY.
 	 * However read() system call itself can be called because it's
@@ -2332,6 +2330,9 @@ audio_file_clear(struct audio_softc *sc,
 		audio_track_clear(sc, file->rtrack);
 }
 
+/*
+ * Must be called without sc_lock nor sc_exlock held.
+ */
 int
 audio_write(struct audio_softc *sc, struct uio *uio, int ioflag,
 	audio_file_t *file)
@@ -2341,8 +2342,6 @@ audio_write(struct audio_softc *sc, stru
 	audio_ring_t *outbuf;
 	int error;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 	track = file->ptrack;
 	KASSERT(track);
 
@@ -2454,6 +2453,9 @@ abort:
 	return error;
 }
 
+/*
+ * Must be called without sc_lock nor sc_exlock held.
+ */
 int
 audio_ioctl(dev_t dev, struct audio_softc *sc, u_long cmd, void *addr, int flag,
 	struct lwp *l, audio_file_t *file)
@@ -2469,8 +2471,6 @@ audio_ioctl(dev_t dev, struct audio_soft
 	int index;
 	int error;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 #if defined(AUDIO_DEBUG)
 	const char *ioctlnames[] = {
 		" AUDIO_GETINFO",	/* 21 */
@@ -2762,6 +2762,9 @@ audio_track_readablebytes(const audio_tr
 	return bytes;
 }
 
+/*
+ * Must be called without sc_lock nor sc_exlock held.
+ */
 int
 audio_poll(struct audio_softc *sc, int events, struct lwp *l,
 	audio_file_t *file)
@@ -2771,8 +2774,6 @@ audio_poll(struct audio_softc *sc, int e
 	bool in_is_valid;
 	bool out_is_valid;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 #if defined(AUDIO_DEBUG)
 #define POLLEV_BITMAP "\177\020" \
 	"b\10WRBAND\0" \
@@ -2920,13 +2921,14 @@ filt_audiowrite_event(struct knote *kn, 
 	return (track->usrbuf.used < track->usrbuf_usedlow);
 }
 
+/*
+ * Must be called without sc_lock nor sc_exlock held.
+ */
 int
 audio_kqfilter(struct audio_softc *sc, audio_file_t *file, struct knote *kn)
 {
 	struct klist *klist;
 
-	KASSERT(!mutex_owned(sc->sc_lock));
-
 	TRACEF(3, file, "kn=%p kn_filter=%x", kn, (int)kn->kn_filter);
 
 	switch (kn->kn_filter) {
@@ -2953,6 +2955,9 @@ audio_kqfilter(struct 

CVS commit: [netbsd-9] src/sys

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:31:51 UTC 2020

Modified Files:
src/sys/arch/amiga/dev [netbsd-9]: aucc.c
src/sys/dev/pci [netbsd-9]: auacer.c auich.c auixp.c auvia.c
gcscaudio.c
src/sys/dev/sbus [netbsd-9]: dbri.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #792):

sys/arch/amiga/dev/aucc.c: revision 1.48
sys/dev/pci/auixp.c: revision 1.49
sys/dev/pci/gcscaudio.c: revision 1.19
sys/dev/pci/auich.c: revision 1.159
sys/dev/sbus/dbri.c: revision 1.42
sys/dev/pci/auvia.c: revision 1.85
sys/dev/pci/auacer.c: revision 1.39

Drop 512 bytes limit on auvia_round_blocksize().

This fixes attach on 6 channels device.
PR kern/55017.

round_blocksize must return a multiple of the framesize.
aucc(4) supports 3 channels mode.

round_blocksize must return a multiple of the framesize
even if passed blocksize is greater than the upper limit.

round_blocksize must return a multiple of the framesize.

It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
round_blocksize must return a multiple of the framesize
even if 6 channels mode.

I believe that keeping "good alignment" is just a wish, not constraint.


To generate a diff of this commit:
cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/sys/arch/amiga/dev/aucc.c
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/pci/auacer.c
cvs rdiff -u -r1.157 -r1.157.2.1 src/sys/dev/pci/auich.c
cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/dev/pci/auixp.c
cvs rdiff -u -r1.84 -r1.84.2.1 src/sys/dev/pci/auvia.c
cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/dev/pci/gcscaudio.c
cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/dev/sbus/dbri.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/amiga/dev/aucc.c
diff -u src/sys/arch/amiga/dev/aucc.c:1.46.2.1 src/sys/arch/amiga/dev/aucc.c:1.46.2.2
--- src/sys/arch/amiga/dev/aucc.c:1.46.2.1	Sat Sep  7 18:04:48 2019
+++ src/sys/arch/amiga/dev/aucc.c	Sat Mar 21 15:31:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: aucc.c,v 1.46.2.1 2019/09/07 18:04:48 snj Exp $ */
+/*	$NetBSD: aucc.c,v 1.46.2.2 2020/03/21 15:31:50 martin Exp $ */
 
 /*
  * Copyright (c) 1999 Bernardo Innocenti
@@ -46,7 +46,7 @@
 #if NAUCC > 0
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.46.2.1 2019/09/07 18:04:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.46.2.2 2020/03/21 15:31:50 martin Exp $");
 
 #include 
 #include 
@@ -404,8 +404,11 @@ aucc_round_blocksize(void *addr, int blk
 		 int mode, const audio_params_t *param)
 {
 
-	/* round up to even size */
-	return blk > AUDIO_BUF_SIZE ? AUDIO_BUF_SIZE : blk;
+	if (blk > AUDIO_BUF_SIZE)
+		blk = AUDIO_BUF_SIZE;
+
+	blk = rounddown(blk, param->channels * param->precision / NBBY);
+	return blk;
 }
 
 int

Index: src/sys/dev/pci/auacer.c
diff -u src/sys/dev/pci/auacer.c:1.38 src/sys/dev/pci/auacer.c:1.38.2.1
--- src/sys/dev/pci/auacer.c:1.38	Sat Jun  8 08:02:38 2019
+++ src/sys/dev/pci/auacer.c	Sat Mar 21 15:31:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: auacer.c,v 1.38 2019/06/08 08:02:38 isaki Exp $	*/
+/*	$NetBSD: auacer.c,v 1.38.2.1 2020/03/21 15:31:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2008 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auacer.c,v 1.38 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auacer.c,v 1.38.2.1 2020/03/21 15:31:50 martin Exp $");
 
 #include 
 #include 
@@ -154,8 +154,6 @@ static int	auacer_query_format(void *, a
 static int	auacer_set_format(void *, int,
  const audio_params_t *, const audio_params_t *,
  audio_filter_reg_t *, audio_filter_reg_t *);
-static int	auacer_round_blocksize(void *, int, int,
-   const audio_params_t *);
 static int	auacer_halt_output(void *);
 static int	auacer_halt_input(void *);
 static int	auacer_getdev(void *, struct audio_device *);
@@ -188,7 +186,6 @@ static void auacer_reset(struct auacer_s
 static const struct audio_hw_if auacer_hw_if = {
 	.query_format		= auacer_query_format,
 	.set_format		= auacer_set_format,
-	.round_blocksize	= auacer_round_blocksize,
 	.halt_output		= auacer_halt_output,
 	.halt_input		= auacer_halt_input,
 	.getdev			= auacer_getdev,
@@ -562,14 +559,6 @@ auacer_set_format(void *v, int setmode,
 	return 0;
 }
 
-static int
-auacer_round_blocksize(void *v, int blk, int mode,
-const audio_params_t *param)
-{
-
-	return blk & ~0x3f;		/* keep good alignment */
-}
-
 static void
 auacer_halt(struct auacer_softc *sc, struct auacer_chan *chan)
 {

Index: src/sys/dev/pci/auich.c
diff -u src/sys/dev/pci/auich.c:1.157 src/sys/dev/pci/auich.c:1.157.2.1
--- src/sys/dev/pci/auich.c:1.157	Sat Jun  8 08:02:38 2019
+++ src/sys/dev/pci/auich.c	Sat Mar 21 15:31:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: auich.c,v 1.157 2019/06/08 08:02:38 isaki Exp $	*/
+/*	$NetBSD: auich.c,v 1.157.2.1 2020/03/21 15:31:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 

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

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:27:41 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/drm [netbsd-9]: bus_dma_hacks.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #791):

sys/external/bsd/drm2/include/drm/bus_dma_hacks.h: revision 1.20

in bus_dmamap_load_pglist() try a 32-element array of
bus_dma_segment_t's before attempting to allocate.
this hopefully avoids hangs i've had in X since updating
from netbsd-8 to netbsd-9 that i've tracked down to this
function failing with ENOMEM.

XXX: maybe can avoid the alloc entirely by batching these
calls in 32 segments each.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.17.4.1 -r1.17.4.2 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.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/external/bsd/drm2/include/drm/bus_dma_hacks.h
diff -u src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.17.4.1 src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.17.4.2
--- src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.17.4.1	Wed Nov  6 09:48:32 2019
+++ src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h	Sat Mar 21 15:27:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_hacks.h,v 1.17.4.1 2019/11/06 09:48:32 martin Exp $	*/
+/*	$NetBSD: bus_dma_hacks.h,v 1.17.4.2 2020/03/21 15:27:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -118,12 +118,15 @@ bus_dmatag_bounces_paddr(bus_dma_tag_t d
 #endif
 }
 
+#define MAX_STACK_SEGS 32	/* XXXMRG: 512 bytes on 16 byte seg platforms */
+
 static inline int
 bus_dmamap_load_pglist(bus_dma_tag_t tag, bus_dmamap_t map,
 struct pglist *pglist, bus_size_t size, int flags)
 {
 	km_flag_t kmflags;
 	bus_dma_segment_t *segs;
+	bus_dma_segment_t stacksegs[MAX_STACK_SEGS];
 	int nsegs, seg;
 	struct vm_page *page;
 	int error;
@@ -136,14 +139,23 @@ bus_dmamap_load_pglist(bus_dma_tag_t tag
 	}
 
 	KASSERT(nsegs <= (SIZE_MAX / sizeof(segs[0])));
-	switch (flags & (BUS_DMA_WAITOK|BUS_DMA_NOWAIT)) {
-	case BUS_DMA_WAITOK:	kmflags = KM_SLEEP;	break;
-	case BUS_DMA_NOWAIT:	kmflags = KM_NOSLEEP;	break;
-	default:		panic("invalid flags: %d", flags);
-	}
-	segs = kmem_alloc((nsegs * sizeof(segs[0])), kmflags);
-	if (segs == NULL)
-		return ENOMEM;
+	if (nsegs > MAX_STACK_SEGS) {
+		switch (flags & (BUS_DMA_WAITOK|BUS_DMA_NOWAIT)) {
+		case BUS_DMA_WAITOK:
+			kmflags = KM_SLEEP;
+			break;
+		case BUS_DMA_NOWAIT:
+			kmflags = KM_NOSLEEP;
+			break;
+		default:
+			panic("invalid flags: %d", flags);
+		}
+		segs = kmem_alloc((nsegs * sizeof(segs[0])), kmflags);
+		if (segs == NULL)
+			return ENOMEM;
+	} else {
+		segs = stacksegs;
+	}
 
 	seg = 0;
 	TAILQ_FOREACH(page, pglist, pageq.queue) {
@@ -166,7 +178,10 @@ bus_dmamap_load_pglist(bus_dma_tag_t tag
 fail1: __unused
 	bus_dmamap_unload(tag, map);
 fail0:	KASSERT(error);
-out:	kmem_free(segs, (nsegs * sizeof(segs[0])));
+out:	if (segs != stacksegs) {
+		KASSERT(nsegs > MAX_STACK_SEGS);
+		kmem_free(segs, (nsegs * sizeof(segs[0])));
+	}
 	return error;
 }
 



CVS commit: [netbsd-9] src/sys/ufs/ffs

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:25:24 UTC 2020

Modified Files:
src/sys/ufs/ffs [netbsd-9]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #790):

sys/ufs/ffs/ffs_alloc.c: revision 1.165

Fix non-DIAGNOSTIC build with UVM_PAGE_TRKOWN.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.164.4.1 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.164 src/sys/ufs/ffs/ffs_alloc.c:1.164.4.1
--- src/sys/ufs/ffs/ffs_alloc.c:1.164	Sun Apr 14 15:55:24 2019
+++ src/sys/ufs/ffs/ffs_alloc.c	Sat Mar 21 15:25:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.164 2019/04/14 15:55:24 kardel Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.164.4.1 2020/03/21 15:25:24 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.164 2019/04/14 15:55:24 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.164.4.1 2020/03/21 15:25:24 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -208,7 +208,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn,
 	ffs_lblktosize(fs, (voff_t)lbn) < round_page(vp->v_size) &&
 	((vp->v_vflag & VV_MAPPED) != 0 || (size & PAGE_MASK) != 0 ||
 	 ffs_blkoff(fs, size) != 0)) {
-		struct vm_page *pg;
+		struct vm_page *pg __diagused;
 		struct uvm_object *uobj = >v_uobj;
 		voff_t off = trunc_page(ffs_lblktosize(fs, lbn));
 		voff_t endoff = round_page(ffs_lblktosize(fs, lbn) + size);
@@ -328,7 +328,7 @@ ffs_realloccg(struct inode *ip, daddr_t 
 	 */
 
 	if (ITOV(ip)->v_type == VREG) {
-		struct vm_page *pg;
+		struct vm_page *pg __diagused;
 		struct uvm_object *uobj = (ip)->v_uobj;
 		voff_t off = trunc_page(ffs_lblktosize(fs, lbprev));
 		voff_t endoff = round_page(ffs_lblktosize(fs, lbprev) + osize);



CVS commit: [netbsd-9] src/sys/miscfs/deadfs

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:24:06 UTC 2020

Modified Files:
src/sys/miscfs/deadfs [netbsd-9]: dead_vnops.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #789):

sys/miscfs/deadfs/dead_vnops.c: revision 1.62

Use vn_bwrite, not genfs_nullop, for VOP_BWRITE.
VOP_BWRITE is responsible for calling biodone; can't just leave it
hanging.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.16.1 src/sys/miscfs/deadfs/dead_vnops.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/miscfs/deadfs/dead_vnops.c
diff -u src/sys/miscfs/deadfs/dead_vnops.c:1.61 src/sys/miscfs/deadfs/dead_vnops.c:1.61.16.1
--- src/sys/miscfs/deadfs/dead_vnops.c:1.61	Wed Apr 26 03:02:49 2017
+++ src/sys/miscfs/deadfs/dead_vnops.c	Sat Mar 21 15:24:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dead_vnops.c,v 1.61 2017/04/26 03:02:49 riastradh Exp $	*/
+/*	$NetBSD: dead_vnops.c,v 1.61.16.1 2020/03/21 15:24:06 martin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.61 2017/04/26 03:02:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.61.16.1 2020/03/21 15:24:06 martin Exp $");
 
 #include 
 #include 
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: dead_vnops.c
 /*
  * Prototypes for dead operations on vnodes.
  */
-#define dead_bwrite	genfs_nullop
+#define	dead_bwrite	vn_bwrite
 int	dead_lookup(void *);
 int	dead_open(void *);
 #define dead_close	genfs_nullop



CVS commit: [netbsd-9] src

2020-03-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 21 15:18:58 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: vdev_disk.c
src/sys/dev [netbsd-9]: cgd.c
src/sys/dev/ata [netbsd-9]: wd.c wdvar.h
src/sys/dev/dkwedge [netbsd-9]: dk.c
src/sys/kern [netbsd-9]: subr_disk_open.c
src/sys/sys [netbsd-9]: disk.h dkio.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #788):

sys/sys/dkio.h: revision 1.26
sys/dev/dkwedge/dk.c: revision 1.100
sys/sys/disk.h: revision 1.75
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.14
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.15
sys/dev/cgd.c: revision 1.121
sys/dev/ata/wdvar.h: revision 1.50
sys/kern/subr_disk_open.c: revision 1.15
sys/dev/ata/wd.c: revision 1.459

New ioctl DIOCGSECTORALIGN returns sector alignment parameters.

struct disk_sectoralign {
/* First aligned sector number.  */
uint32_t dsa_firstaligned;
/* Number of sectors per aligned unit.  */
uint32_t dsa_alignment;
};

- Teach wd(4) to get it from ATA.
- Teach cgd(4) to pass it through from the underlying disk.
- Teach dk(4) to pass it through with adjustments.
- Teach zpool (zfs) to take advantage of it.
  => XXX zpool doesn't seem to understand when the vdev's starting
 sector is misaligned.

Missing:
- ccd(4) and raidframe(4) support -- these should support _using_
  DIOCGSECTORALIGN to decide where to start putting ccd or raid
  stripes on disk, and these should perhaps _implement_
  DIOCGSECTORALIGN by reporting the stripe/interleave factor.
- sd(4) support -- I don't know any obvious way to get it from SCSI,
  but if any SCSI wizards know better than I, please feel free to
  teach sd(4) about it!
- any ld(4) attachments -- might be worth teaching the ld drivers for
  nvme and various raid controllers to get the aligned sector size

There's some duplicate logic here for now.  I'm doing it this way,
rather than gathering the logic into a new disklabel_sectoralign
function or something, so that this change is limited to adding a new
ioctl, without any new kernel symbols, in order to make it easy to
pull up to netbsd-9 without worrying about the module ABI.

Make getdiskinfo() compatible with a DIOCGWEDGEINFO.

dkw_parent is defined to hold the disk name as used by disk_find(), not
a partition (i.e. no partition letter appended).

Use utility functions to handle disk geometry.


To generate a diff of this commit:
cvs rdiff -u -r1.11.2.2 -r1.11.2.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
cvs rdiff -u -r1.116 -r1.116.10.1 src/sys/dev/cgd.c
cvs rdiff -u -r1.452 -r1.452.2.1 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.49 -r1.49.4.1 src/sys/dev/ata/wdvar.h
cvs rdiff -u -r1.97 -r1.97.8.1 src/sys/dev/dkwedge/dk.c
cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/kern/subr_disk_open.c
cvs rdiff -u -r1.74 -r1.74.2.1 src/sys/sys/disk.h
cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/sys/dkio.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/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11.2.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11.2.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11.2.2	Sun Dec  8 14:39:07 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c	Sat Mar 21 15:18:57 2020
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -147,10 +146,12 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 	spa_t *spa = vd->vdev_spa;
 	vdev_disk_t *dvd;
 	vnode_t *vp;
-	struct dkwedge_info dkw;
-	struct disk *pdk;
 	int error, cmd;
-	struct partinfo pinfo;
+	uint64_t numsecs;
+	unsigned secsize;
+	struct disk *pdk;
+	struct dkwedge_info dkw;
+	struct disk_sectoralign dsa;
 
 	/*
 	 * We must have a pathname, and it must be absolute.
@@ -219,33 +220,15 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 		return (SET_ERROR(EINVAL));
 	}
 
+	pdk = NULL;
+	if (getdiskinfo(vp, ) == 0)
+		pdk = disk_find(dkw.dkw_parent);
+
 	/* XXXNETBSD Once tls-maxphys gets merged this block becomes:
-		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0)
-			pdk = disk_find(dkw.dkw_parent);
-		else
-			pdk = disk_find_blk(vp->v_rdev);
 		dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS);
 	*/
 	{
 		struct buf buf = { .b_bcount = MAXPHYS };
-
-		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0) {
-			pdk = disk_find(dkw.dkw_parent);
-		} else {
-			const char *dev_name;
-
-			dev_name = devsw_blk2name(major(vp->v_rdev));
-			if (dev_name) {
-char disk_name[16];
-
-snprintf(disk_name, sizeof(disk_name), "%s%d",
-dev_name, DISKUNIT(vp->v_rdev));
-pdk = disk_find(disk_name);
-			} 

CVS commit: src/distrib/hpcarm

2020-03-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 21 14:25:49 UTC 2020

Modified Files:
src/distrib/hpcarm: Makefile
Added Files:
src/distrib/hpcarm/liveimage: Makefile fstab.in spec.in

Log Message:
Add "build.sh live-image" support for hpcarm.

Tested on WS003SH.
See also PR/55075 for live-image with FAT partition support.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/hpcarm/Makefile
cvs rdiff -u -r0 -r1.1 src/distrib/hpcarm/liveimage/Makefile \
src/distrib/hpcarm/liveimage/fstab.in \
src/distrib/hpcarm/liveimage/spec.in

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

Modified files:

Index: src/distrib/hpcarm/Makefile
diff -u src/distrib/hpcarm/Makefile:1.6 src/distrib/hpcarm/Makefile:1.7
--- src/distrib/hpcarm/Makefile:1.6	Fri Sep 19 17:38:43 2008
+++ src/distrib/hpcarm/Makefile	Sat Mar 21 14:25:49 2020
@@ -1,12 +1,16 @@
-#	$NetBSD: Makefile,v 1.6 2008/09/19 17:38:43 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.7 2020/03/21 14:25:49 tsutsui Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 SUBDIR=		instkernel stand cdroms
+SUBDIR+=	liveimage
 TARGETS+=	release
 
 iso_image:
 	${MAKEDIRTARGET} cdroms iso_image
 
+live_image:
+	${MAKEDIRTARGET} liveimage live_image
+
 .include 

Added files:

Index: src/distrib/hpcarm/liveimage/Makefile
diff -u /dev/null src/distrib/hpcarm/liveimage/Makefile:1.1
--- /dev/null	Sat Mar 21 14:25:50 2020
+++ src/distrib/hpcarm/liveimage/Makefile	Sat Mar 21 14:25:49 2020
@@ -0,0 +1,39 @@
+#	$NetBSD: Makefile,v 1.1 2020/03/21 14:25:49 tsutsui Exp $
+
+LIVEIMGBASE=	NetBSD-${DISTRIBVER}-${MACHINE}-live	# gives ${IMGBASE}.img
+
+.include 
+
+LIVEIMAGEMB?=	1920		# for 2GB SD due to Windows Mobile restriction
+SWAPMB?=	64
+FATMB?=		32
+
+USE_MBR=	yes
+MBRFAT=		6		# 16-bit FAT, more than 32M
+
+# Omit comp etc. due to size restriction
+KERN_SET=	kern-WZERO3
+#SETS=		base modules etc misc rescue text xbase xetc xfont xserver
+
+# prepare JORNADA720 kernel as an independent name
+prepare_md_post:
+	echo Extracting kern-JORNADA720.${TAR_SUFF} ...
+	${TOOL_PAX} ${PAX_TIMESTAMP} -rn\
+	--use-compress-program=${COMPRESS_PROGRAM:Q}		\
+	-f ${SETS_DIR}/kern-JORNADA720.${TAR_SUFF} .
+	mv netbsd netbsd.JORNADA720
+
+CLEANFILES+=	netbsd.JORNADA720
+
+IMGFILE_EXTRA=\
+		${.OBJDIR}/netbsd.JORNADA720	.
+
+DISKPROTO_IN=	${.CURDIR}/../../common/bootimage/diskproto.mbrfat.in
+FSTAB_IN=	${.CURDIR}/fstab.in
+SPEC_EXTRA=	${.CURDIR}/spec.in
+
+FATFILES=	${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/hpcboot.exe
+FATFILES+=	${WORKDIR}/netbsd
+FATFILES+=	${WORKDIR}/netbsd.JORNADA720
+
+.include "${.CURDIR}/../../common/bootimage/Makefile.liveimage"
Index: src/distrib/hpcarm/liveimage/fstab.in
diff -u /dev/null src/distrib/hpcarm/liveimage/fstab.in:1.1
--- /dev/null	Sat Mar 21 14:25:50 2020
+++ src/distrib/hpcarm/liveimage/fstab.in	Sat Mar 21 14:25:49 2020
@@ -0,0 +1,7 @@
+ROOT.a		/		ffs	rw		1 1
+ROOT.b		none		none	sw		0 0
+ROOT.e		/dos		msdos	rw		0 0
+ptyfs		/dev/pts	ptyfs	rw		0 0
+kernfs		/kern		kernfs	rw,noauto	0 0
+procfs		/proc		procfs	rw,noauto	0 0
+tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25 0 0
Index: src/distrib/hpcarm/liveimage/spec.in
diff -u /dev/null src/distrib/hpcarm/liveimage/spec.in:1.1
--- /dev/null	Sat Mar 21 14:25:50 2020
+++ src/distrib/hpcarm/liveimage/spec.in	Sat Mar 21 14:25:49 2020
@@ -0,0 +1,3 @@
+# $NetBSD: spec.in,v 1.1 2020/03/21 14:25:49 tsutsui Exp $
+./netbsd.JORNADA720	type=file mode=0755 uname=root gname=wheel
+./dos		type=dir mode=0755 uname=root gname=wheel



CVS commit: src/distrib/zaurus

2020-03-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 21 14:24:12 UTC 2020

Modified Files:
src/distrib/zaurus: Makefile
Added Files:
src/distrib/zaurus/liveimage: Makefile fstab.in spec.in

Log Message:
Add "build.sh live-image" support for zaurus.

Tested on SL-C3000 and SL-C700.
See also PR/55075 for live-image with FAT partition support.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/zaurus/Makefile
cvs rdiff -u -r0 -r1.1 src/distrib/zaurus/liveimage/Makefile \
src/distrib/zaurus/liveimage/fstab.in \
src/distrib/zaurus/liveimage/spec.in

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

Modified files:

Index: src/distrib/zaurus/Makefile
diff -u src/distrib/zaurus/Makefile:1.2 src/distrib/zaurus/Makefile:1.3
--- src/distrib/zaurus/Makefile:1.2	Sun May 29 17:19:31 2011
+++ src/distrib/zaurus/Makefile	Sat Mar 21 14:24:12 2020
@@ -1,12 +1,16 @@
-# $NetBSD: Makefile,v 1.2 2011/05/29 17:19:31 tsutsui Exp $
+# $NetBSD: Makefile,v 1.3 2020/03/21 14:24:12 tsutsui Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 SUBDIR=		ramdisk .WAIT instkernel cdroms
+SUBDIR+=	liveimage
 TARGETS+=	release
 
 iso_image:
 	${MAKEDIRTARGET} cdroms iso_image
 
+live_image:
+	${MAKEDIRTARGET} liveimage live_image
+
 .include 

Added files:

Index: src/distrib/zaurus/liveimage/Makefile
diff -u /dev/null src/distrib/zaurus/liveimage/Makefile:1.1
--- /dev/null	Sat Mar 21 14:24:12 2020
+++ src/distrib/zaurus/liveimage/Makefile	Sat Mar 21 14:24:12 2020
@@ -0,0 +1,39 @@
+#	$NetBSD: Makefile,v 1.1 2020/03/21 14:24:12 tsutsui Exp $
+
+LIVEIMGBASE=	NetBSD-${DISTRIBVER}-zaurus-live	# gives ${IMGBASE}.img
+
+.include 
+
+LIVEIMAGEMB?=	900		# for "1GB" SD due to Zaurus Linux restriction
+SWAPMB?=	64
+FATMB?=		32
+
+USE_MBR=	yes
+MBRFAT=		6		# 16-bit FAT, more than 32M
+
+# Omit comp etc. due to size restriction
+KERN_SET=	kern-GENERIC
+SETS=		base modules etc misc rescue text xbase xetc xfont xserver
+
+# prepare SL-C700 kernel as an independent name
+prepare_md_post:
+	echo Extracting kern-C700.${TAR_SUFF} ...
+	${TOOL_PAX} ${PAX_TIMESTAMP} -rn\
+	--use-compress-program=${COMPRESS_PROGRAM:Q}		\
+	-f ${SETS_DIR}/kern-C700.${TAR_SUFF} .
+	mv netbsd netbsd.c700
+
+CLEANFILES+=	netbsd.c700
+
+IMGFILE_EXTRA=\
+		${.OBJDIR}/netbsd.c700		.
+
+DISKPROTO_IN=	${.CURDIR}/../../common/bootimage/diskproto.mbrfat.in
+FSTAB_IN=	${.CURDIR}/fstab.in
+SPEC_EXTRA=	${.CURDIR}/spec.in
+
+FATFILES=	${WORKDIR}/usr/mdec/zbsdmod.o ${WORKDIR}/usr/mdec/zboot
+FATFILES+=	${WORKDIR}/netbsd
+FATFILES+=	${WORKDIR}/netbsd.c700
+
+.include "${.CURDIR}/../../common/bootimage/Makefile.liveimage"
Index: src/distrib/zaurus/liveimage/fstab.in
diff -u /dev/null src/distrib/zaurus/liveimage/fstab.in:1.1
--- /dev/null	Sat Mar 21 14:24:12 2020
+++ src/distrib/zaurus/liveimage/fstab.in	Sat Mar 21 14:24:12 2020
@@ -0,0 +1,7 @@
+ROOT.a		/		ffs	rw		1 1
+ROOT.b		none		none	sw		0 0
+ROOT.e		/dos		msdos	rw		0 0
+ptyfs		/dev/pts	ptyfs	rw		0 0
+kernfs		/kern		kernfs	rw,noauto	0 0
+procfs		/proc		procfs	rw,noauto	0 0
+tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25 0 0
Index: src/distrib/zaurus/liveimage/spec.in
diff -u /dev/null src/distrib/zaurus/liveimage/spec.in:1.1
--- /dev/null	Sat Mar 21 14:24:12 2020
+++ src/distrib/zaurus/liveimage/spec.in	Sat Mar 21 14:24:12 2020
@@ -0,0 +1,3 @@
+# $NetBSD: spec.in,v 1.1 2020/03/21 14:24:12 tsutsui Exp $
+./netbsd.c700	type=file mode=0755 uname=root gname=wheel
+./dos		type=dir mode=0755 uname=root gname=wheel



CVS commit: src/distrib/common/bootimage

2020-03-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 21 14:19:27 UTC 2020

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage
Added Files:
src/distrib/common/bootimage: diskproto.mbrfat.in

Log Message:
Add "live-image with a FAT partition for bootstrap files" support.

See PR/55075 for more details.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/distrib/common/bootimage/Makefile.bootimage
cvs rdiff -u -r0 -r1.1 src/distrib/common/bootimage/diskproto.mbrfat.in

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.23 src/distrib/common/bootimage/Makefile.bootimage:1.24
--- src/distrib/common/bootimage/Makefile.bootimage:1.23	Thu Nov 21 22:29:03 2019
+++ src/distrib/common/bootimage/Makefile.bootimage	Sat Mar 21 14:19:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.23 2019/11/21 22:29:03 joerg Exp $
+#	$NetBSD: Makefile.bootimage,v 1.24 2020/03/21 14:19:26 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -63,6 +63,9 @@
 #	EFIMB
 #		EFI partition size in target image in MB
 #		(default: 128)
+#	FATMB
+#		FAT partition size in target image in MB
+#		(default: 0)
 #	KERN_SET
 #		kernel set name which should be extracted into image
 #		(default: kern-GENERIC)
@@ -123,6 +126,15 @@
 #	EFIBOOT
 #		EFI bootloader
 #		(default: empty)
+#	MBRFAT
+#		MBR partition type value for FAT
+#		(default: 6 ("16-bit FAT, more than 32M"))
+#	FATMAKEFSOPTIONS
+#		options passed to makefs(8) to create a FAT partition
+#		(default: -o fat_type=16)
+#	FATFILES
+#		list of additional files to be copied into FAT partition
+#		(default: empty)
 #
 
 .include  		#
@@ -169,11 +181,13 @@ GPTSECTORS=	0
 EFIMB?=		128		# 128MB
 GPTSECTORS=	2048
 .endif
+FATMB?=		0
 
 # XXX: SWAPMB could be zero and expr(1) returns exit status 1 in that case
 IMAGESECTORS!=	expr ${IMAGEMB} \* 1024 \* 1024 / 512
 SWAPSECTORS!=	expr ${SWAPMB} \* 1024 \* 1024 / 512 || true
 EFISECTORS!=	expr ${EFIMB} \* 1024 \* 1024 / 512 || true
+FATSECTORS!=	expr ${FATMB} \* 1024 \* 1024 / 512 || true
 
 .if ${USE_MBR} == "no" && ${USE_GPT} == "no"
 LABELSECTORS?=	0
@@ -184,7 +198,7 @@ LABELSECTORS?=	2048	# 1MB aligned for mo
 .endif
 
 FSSECTORS!=	expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS} \
-		- ${EFISECTORS} - ${GPTSECTORS}
+		- ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
 FSSIZE!=	expr ${FSSECTORS} \* 512
 
 # parameters for disklabel and MBR
@@ -196,10 +210,14 @@ MBRHEADS=	255
 MBRSECTORS=	63
 MBRCYLINDERS!=	expr ${IMAGESECTORS} / \( ${MBRHEADS} \* ${MBRSECTORS} \)
 MBRNETBSD=	169
+MBRFAT?=	6	# 16-bit FAT, more than 32M
 
-BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} - ${EFISECTORS} - ${GPTSECTORS}
-FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS}
-SWAPOFFSET!=	expr ${LABELSECTORS} + ${FSSECTORS} + ${EFISECTORS}
+BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} \
+		- ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
+FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS}
+SWAPOFFSET!=	expr ${LABELSECTORS} + ${FSSECTORS} \
+		+ ${EFISECTORS} + ${FATSECTORS}
+FATOFFSET=	${LABELSECTORS}
 
 # parameters for sunlabel
 FSCYLINDERS!=	expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \)
@@ -227,6 +245,7 @@ FSTAB_IN?=	${DISTRIBDIR}/common/bootimag
 SPEC_IN?=	${DISTRIBDIR}/common/bootimage/spec.in
 
 IMGMAKEFSOPTIONS?=	-o bsize=16384,fsize=2048,density=8192
+FATMAKEFSOPTIONS?=	-o fat_type=16
 
 WORKDIR?=   work
 WORKSPEC?=  work.spec
@@ -267,6 +286,8 @@ WORKGPT?=	work.gpt
 WORKLABEL?=	work.diskproto
 WORKIMG?=	work.img
 EFIWORKDIR?=	work.efidir
+WORKFAT?=	work.fat
+WORKFATDIR?=	work.fatdir
 
 .if ${USE_GPT} != "no"
 ${WORKFSTAB}: ${WORKMBR}
@@ -388,6 +409,9 @@ TARGET_BLOCKS+=	${WORKMBRTRUNC}
 .if ${USE_GPT} != "no"
 TARGET_BLOCKS+=	${WORKEFI}
 .endif
+.if ${FATSECTORS} != 0
+TARGET_BLOCKS+=	${WORKFAT}
+.endif
 TARGET_BLOCKS+=	 ${TARGETFS}
 .if ${SWAPSECTORS} != 0
 TARGET_BLOCKS+=	${WORKSWAP}
@@ -398,6 +422,7 @@ TARGET_BLOCKS+=	${WORKGPT}
 
 CLEANFILES+=	${WORKMBR} ${WORKMBRTRUNC} ${WORKSWAP}
 CLEANFILES+=	${WORKEFI} ${WORKGPT}
+CLEANFILES+=	${WORKFAT}
 CLEANFILES+=	${WORKLABEL}.tmp ${WORKLABEL}
 CLEANFILES+=	${WORKIMG} ${IMGBASE}.img
 
@@ -423,6 +448,8 @@ ${WORKLABEL}:
 	-e "s/@@SWAPSECTORS@@/${SWAPSECTORS}/"			\
 	-e "s/@@SWAPOFFSET@@/${SWAPOFFSET}/"			\
 	-e "s/@@BSDPARTSECTORS@@/${BSDPARTSECTORS}/"		\
+	-e "s/@@FATSECTORS@@/${FATSECTORS}/"			\
+	-e "s/@@FATOFFSET@@/${FATOFFSET}/"\
 	< ${DISKPROTO_IN} > ${WORKLABEL}.tmp
 	mv ${WORKLABEL}.tmp ${WORKLABEL}
 
@@ -439,6 +466,26 @@ ${WORKEFI}: ${TARGETFS}
 	-t msdos -o F=32,c=1	\
 	${WORKEFI} ${EFIWORKDIR}
 
+${WORKFAT}: ${TARGETFS} ${FATFILES}
+	@echo create FAT partition for bootstrap files...
+	@${MKDIR} ${MKDIRPERM} 

CVS commit: src/sys/fs/nilfs

2020-03-21 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Mar 21 13:39:31 UTC 2020

Modified Files:
src/sys/fs/nilfs: nilfs_subr.c

Log Message:
Fix use-after-free issue!


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/nilfs/nilfs_subr.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/fs/nilfs/nilfs_subr.c
diff -u src/sys/fs/nilfs/nilfs_subr.c:1.14 src/sys/fs/nilfs/nilfs_subr.c:1.15
--- src/sys/fs/nilfs/nilfs_subr.c:1.14	Sun Mar 29 14:12:28 2015
+++ src/sys/fs/nilfs/nilfs_subr.c	Sat Mar 21 13:39:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_subr.c,v 1.14 2015/03/29 14:12:28 riastradh Exp $ */
+/* $NetBSD: nilfs_subr.c,v 1.15 2020/03/21 13:39:31 reinoud Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_subr.c,v 1.14 2015/03/29 14:12:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_subr.c,v 1.15 2020/03/21 13:39:31 reinoud Exp $");
 #endif /* not lint */
 
 #include 
@@ -230,6 +230,7 @@ nilfs_btree_lookup_level(struct nilfs_no
 	dptrs = dkeys + NILFS_BTREE_NODE_NCHILDREN_MAX(nilfsdev->blocksize);
 
 	assert((btree_hdr->bn_flags & NILFS_BTREE_NODE_ROOT) == 0);
+	assert((btree_hdr->bn_level == level));
 
 	/* select matching child XXX could use binary search */
 	selected = 0;
@@ -253,7 +254,7 @@ nilfs_btree_lookup_level(struct nilfs_no
 	brelse(bp, BC_AGE);
 
 	return nilfs_btree_lookup_level(node, lblocknr,
-			child_btree_blk, btree_hdr->bn_level-1, vblocknr);
+			child_btree_blk, level-1, vblocknr);
 }
 
 
@@ -686,9 +687,10 @@ nilfs_get_node_raw(struct nilfs_device *
 
 	/* fixup inode size for system nodes */
 	if ((ino < NILFS_USER_INO) && (ino != NILFS_ROOT_INO)) {
-		DPRINTF(VOLUMES, ("NEED TO GET my size for inode %"PRIu64"\n",
+		DPRINTF(VOLUMES, ("NEED TO GET my size for inode %"PRIu64"?\n",
 			ino));
 		/* for now set it to maximum, -1 is illegal */
+		DPRINTF(VOLUMES, ("  current size of inode is %"PRIu64"\n", inode->i_size));
 		inode->i_size = nilfs_rw64(((uint64_t) -2));
 	}
 



CVS commit: src/sys/fs/nilfs

2020-03-21 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Mar 21 13:38:29 UTC 2020

Modified Files:
src/sys/fs/nilfs: nilfs.h

Log Message:
Compile in the DPRINTF debug macro's on DEBUG kernels


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/fs/nilfs/nilfs.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/fs/nilfs/nilfs.h
diff -u src/sys/fs/nilfs/nilfs.h:1.5 src/sys/fs/nilfs/nilfs.h:1.6
--- src/sys/fs/nilfs/nilfs.h:1.5	Wed Oct 15 09:05:46 2014
+++ src/sys/fs/nilfs/nilfs.h	Sat Mar 21 13:38:29 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs.h,v 1.5 2014/10/15 09:05:46 hannken Exp $ */
+/* $NetBSD: nilfs.h,v 1.6 2020/03/21 13:38:29 reinoud Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -66,7 +66,7 @@ extern int nilfs_verbose;
 /* initial value of nilfs_verbose */
 #define NILFS_DEBUGGING		0
 
-#ifdef NILFS_DEBUG
+#ifdef DEBUG
 #define DPRINTF(name, arg) { \
 		if (nilfs_verbose & NILFS_DEBUG_##name) {\
 			printf arg;\



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

2020-03-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sat Mar 21 11:46:36 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
- handle register adjustment when link speed change.
- make some more care on reset operation.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sociox/if_ave.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/sociox/if_ave.c
diff -u src/sys/arch/arm/sociox/if_ave.c:1.7 src/sys/arch/arm/sociox/if_ave.c:1.8
--- src/sys/arch/arm/sociox/if_ave.c:1.7	Sat Mar 21 08:16:19 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Sat Mar 21 11:46:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ave.c,v 1.7 2020/03/21 08:16:19 nisimura Exp $	*/
+/*	$NetBSD: if_ave.c,v 1.8 2020/03/21 11:46:36 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.7 2020/03/21 08:16:19 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.8 2020/03/21 11:46:36 nisimura Exp $");
 
 #include 
 #include 
@@ -77,9 +77,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define AVEGISR		0x104		/* global interrupt status */
 #define  GISR_PHY	(1U<<24)	/* PHY status change detected */
 #define  GISR_TXCI	(1U<<16)	/* transmission completed */
-#define  GISR_RXERR	(1U<<8)		/* Rx frame error detected */
-#define  GISR_RXOVF	(1U<<7)		/* Rx oveflow detected */
-#define  GISR_RXDROP	(1U<<6)		/* Rx has been dropped */
+#define  GISR_RXF2L	(1U<<8)		/* Rx frame length beyond limit */
+#define  GISR_RXOVF	(1U<<7)		/* RxFIFO oveflow detected */
+#define  GISR_RXDROP	(1U<<6)		/* PAUSE frame has been dropped */
 #define  GISR_RXIT	(1U<<5)		/* receive itimer notify */
 #define AVETXC		0x200		/* transmit control */
 #define  TXC_FCE	(1U<<18)	/* enable Tx flow control */
@@ -133,9 +133,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define AVE32RDB	0x1800	/* 32bit Rx store base, upto 2048 */
 
 #define AVERMIIC	0x8028		/* RMII control */
-#define  RMIIC_RST	(1U<<16)	/* reset */
-#define AVELINKSEL	0x8034		/* link speed selection */
-#define  LINKSEL_SPD100	(1U<<0)		/* RMII speed 100Mbps */
+#define  RMIIC_RST	(1U<<16)	/* reset operation */
+#define AVELINKSEL	0x8034		/* RMII speed selection */
+#define  LINKSEL_SPD100	(1U<<0)		/* use 100Mbps */
 
 /*
  * descriptor size is 12 bytes when 64bit paddr design, 8 bytes otherwise.
@@ -486,12 +486,19 @@ ave_fdt_attach(device_t parent, device_t
 static void
 ave_reset(struct ave_softc *sc)
 {
+	uint32_t csr;
 
 	CSR_WRITE(sc, AVERXC, 0);	/* stop Rx first */
 	CSR_WRITE(sc, AVEDESCC, 0);	/* stop Tx/Rx descriptor engine */
+	if (sc->sc_phymode & CFG_MII) {
+		csr = CSR_READ(sc, AVERMIIC);
+		CSR_WRITE(sc, AVERMIIC, csr &~ RMIIC_RST);
+		DELAY(10);
+		CSR_WRITE(sc , AVERMIIC, csr);
+	}
 	CSR_WRITE(sc, AVEGR, GR_RXRST); /* assert RxFIFO reset operation */
 	DELAY(50);
-	CSR_WRITE(sc, AVEGR, 0);	/* negate reset */
+	CSR_WRITE(sc, AVEGR, 0);
 	CSR_WRITE(sc, AVEGISR, GISR_RXOVF); /* clear OVF condition */
 }
 
@@ -564,7 +571,7 @@ ave_init(struct ifnet *ifp)
 	CSR_WRITE(sc, AVEITIRQC, csr | ITIRQC_R0E | INTMVAL);
 
 	CSR_WRITE(sc, AVEGIMR, /* PHY interrupt is not maskable */
-	GISR_TXCI | GISR_RXIT | GISR_RXDROP | GISR_RXOVF | GISR_RXERR);
+	GISR_TXCI | GISR_RXIT | GISR_RXDROP | GISR_RXOVF | GISR_RXF2L);
 
 	ifp->if_flags |= IFF_RUNNING;
 	ifp->if_flags &= ~IFF_OACTIVE;
@@ -664,21 +671,19 @@ mii_statchg(struct ifnet *ifp)
 	else
 		rxcr &= ~RXC_FCE;
 
-	/* HW does not handle auto speed adjustment */
+	/* HW does not handle automatic speed adjustment */
 	txcr &= ~(TXC_SPD1000 | TXC_SPD100);
 	if ((sc->sc_phymode & CFG_MII) == 0 /* RGMII model */
-	 && IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
+	 && IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_1000_T)
 		txcr |= TXC_SPD1000;
 	else if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
 		txcr |= TXC_SPD100;
 
 	/* adjust LINKSEL when MII/RMII too */
 	if (sc->sc_phymode & CFG_MII) {
-		csr = CSR_READ(sc, AVELINKSEL);
+		csr = CSR_READ(sc, AVELINKSEL) &~ LINKSEL_SPD100;;
 		if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
 			csr |= LINKSEL_SPD100;
-		else
-			csr &= ~LINKSEL_SPD100;
 		CSR_WRITE(sc, AVELINKSEL, csr);
 	}
 
@@ -804,15 +809,15 @@ ave_write_filt(struct ave_softc *sc, int
 {
 	uint32_t macl, mach, n, mskbyte0;
 
-	macl = mach = 0;
-	macl |= (en[3]<<24) | (en[2]<<16)| (en[1]<<8) | en[0];
-	mach |= (en[5]<<8)  | en[4];
 	/* pick v4mcast or v6mcast length */
 	n = (en[0] == 0x01) ? 3 : (en[0] == 0x33) ? 2 : ETHER_ADDR_LEN;
 	/* entry 0 is reserved for promisc mode */
 	mskbyte0 = (i > 0) ? genmask0(n) : MSKBYTE0;
 
 	/* set frame address first */
+	macl = mach = 0;
+	macl |= (en[3]<<24) | (en[2]<<16)| (en[1]<<8) | en[0];
+	mach |= (en[5]<<8)  | en[4];
 	CSR_WRITE(sc, AVEAFB + (i * 0x40) + 0, macl);
 	CSR_WRITE(sc, AVEAFB + (i * 0x40) + 4, mach);
 	/* set byte 

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

2020-03-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sat Mar 21 08:16:19 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
- add one more missing RXC_EN.
- handle link speed change.
- fix genmask0() bit mask generation error.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sociox/if_ave.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/sociox/if_ave.c
diff -u src/sys/arch/arm/sociox/if_ave.c:1.6 src/sys/arch/arm/sociox/if_ave.c:1.7
--- src/sys/arch/arm/sociox/if_ave.c:1.6	Sat Mar 21 07:16:16 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Sat Mar 21 08:16:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ave.c,v 1.6 2020/03/21 07:16:16 nisimura Exp $	*/
+/*	$NetBSD: if_ave.c,v 1.7 2020/03/21 08:16:19 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.6 2020/03/21 07:16:16 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.7 2020/03/21 08:16:19 nisimura Exp $");
 
 #include 
 #include 
@@ -122,7 +122,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define AVEAFMSKB	0x0d00		/* byte mask base */
 #define  MSKBYTE0	0xfff3f	/* zeros in 7:6 */
 #define  MSKBYTE1	0x003ff	/* ones in 25:0 */
-#define  genmask0(x)	(MSKBYTE0 & (~0U << (32-(x
+#define  genmask0(x)	(MSKBYTE0 & (~0U << (x)))
 #define AVEAFMSKV	0x0e00		/* bit mask base */
 #define AVEAFRING	0x0f00		/* entry ring number selector */
 #define AVEAFEN		0x0ffc		/* entry enable bit vector */
@@ -132,6 +132,11 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define AVE32TDB	0x1000	/* 32bit Tx store base, upto 256 */
 #define AVE32RDB	0x1800	/* 32bit Rx store base, upto 2048 */
 
+#define AVERMIIC	0x8028		/* RMII control */
+#define  RMIIC_RST	(1U<<16)	/* reset */
+#define AVELINKSEL	0x8034		/* link speed selection */
+#define  LINKSEL_SPD100	(1U<<0)		/* RMII speed 100Mbps */
+
 /*
  * descriptor size is 12 bytes when 64bit paddr design, 8 bytes otherwise.
  */
@@ -635,17 +640,19 @@ mii_statchg(struct ifnet *ifp)
 {
 	struct ave_softc *sc = ifp->if_softc;
 	struct mii_data *mii = >sc_mii;
-	uint32_t txcr, rxcr;
+	struct ifmedia * const ifm = >mii_media;
+	uint32_t txcr, rxcr, csr;
 
-	/* Get flow control negotiation result. */
+	/* get flow control negotiation result */
 	if (IFM_SUBTYPE(mii->mii_media.ifm_cur->ifm_media) == IFM_AUTO &&
 	(mii->mii_media_active & IFM_ETH_FMASK) != sc->sc_flowflags)
 		sc->sc_flowflags = mii->mii_media_active & IFM_ETH_FMASK;
 
-	/* Adjust PAUSE flow control. */
 	txcr = CSR_READ(sc, AVETXC);
 	rxcr = CSR_READ(sc, AVERXC);
 	CSR_WRITE(sc, AVERXC, rxcr &~ RXC_EN); /* stop Rx first */
+
+	/* adjust 802.3x PAUSE flow control */
 	if ((mii->mii_media_active & IFM_FDX)
 	&& (sc->sc_flowflags & IFM_ETH_TXPAUSE))
 		txcr |= TXC_FCE;
@@ -656,9 +663,28 @@ mii_statchg(struct ifnet *ifp)
 		rxcr |= RXC_FCE;
 	else
 		rxcr &= ~RXC_FCE;
+
+	/* HW does not handle auto speed adjustment */
+	txcr &= ~(TXC_SPD1000 | TXC_SPD100);
+	if ((sc->sc_phymode & CFG_MII) == 0 /* RGMII model */
+	 && IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
+		txcr |= TXC_SPD1000;
+	else if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
+		txcr |= TXC_SPD100;
+
+	/* adjust LINKSEL when MII/RMII too */
+	if (sc->sc_phymode & CFG_MII) {
+		csr = CSR_READ(sc, AVELINKSEL);
+		if (IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_100_TX)
+			csr |= LINKSEL_SPD100;
+		else
+			csr &= ~LINKSEL_SPD100;
+		CSR_WRITE(sc, AVELINKSEL, csr);
+	}
+
 	sc->sc_rxc = rxcr;
 	CSR_WRITE(sc, AVETXC, txcr);
-	CSR_WRITE(sc, AVERXC, rxcr);
+	CSR_WRITE(sc, AVERXC, rxcr | RXC_EN);
 
 printf("%ctxfe, %crxfe\n",
 	(txcr & TXC_FCE) ? '+' : '-', (rxcr & RXC_FCE) ? '+' : '-');
@@ -776,22 +802,25 @@ ave_ioctl(struct ifnet *ifp, u_long cmd,
 static void
 ave_write_filt(struct ave_softc *sc, int i, const uint8_t *en)
 {
-	uint32_t n, macl, mach;
+	uint32_t macl, mach, n, mskbyte0;
 
-	/* pick v4mcast or v6mcast length */
-	n = (en[0] == 0x01) ? 3 : (en[0] == 0x33) ? 2 : ETHER_ADDR_LEN;
 	macl = mach = 0;
 	macl |= (en[3]<<24) | (en[2]<<16)| (en[1]<<8) | en[0];
 	mach |= (en[5]<<8)  | en[4];
+	/* pick v4mcast or v6mcast length */
+	n = (en[0] == 0x01) ? 3 : (en[0] == 0x33) ? 2 : ETHER_ADDR_LEN;
+	/* entry 0 is reserved for promisc mode */
+	mskbyte0 = (i > 0) ? genmask0(n) : MSKBYTE0;
+
 	/* set frame address first */
 	CSR_WRITE(sc, AVEAFB + (i * 0x40) + 0, macl);
 	CSR_WRITE(sc, AVEAFB + (i * 0x40) + 4, mach);
 	/* set byte mask according to mask length, any of 6, 3, or 2 */
-	CSR_WRITE(sc, AVEAFMSKB + (i * 8) + 0, genmask0(n));
+	CSR_WRITE(sc, AVEAFMSKB + (i * 8) + 0, mskbyte0);
 	CSR_WRITE(sc, AVEAFMSKB + (i * 8) + 4, MSKBYTE1);
 	/* set bit vector mask */
 	CSR_WRITE(sc, AVEAFMSKV + (i * 4), 0x);
-	/* use Rx ring 0 for any entry */
+	/* use Rx ring 0 anyway */
 	CSR_WRITE(sc, AVEAFRING + (i * 4), 0);

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

2020-03-21 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sat Mar 21 07:16:16 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
make comments about descriptor storage design detail


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sociox/if_ave.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/sociox/if_ave.c
diff -u src/sys/arch/arm/sociox/if_ave.c:1.5 src/sys/arch/arm/sociox/if_ave.c:1.6
--- src/sys/arch/arm/sociox/if_ave.c:1.5	Sat Mar 21 04:35:20 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Sat Mar 21 07:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ave.c,v 1.5 2020/03/21 04:35:20 nisimura Exp $	*/
+/*	$NetBSD: if_ave.c,v 1.6 2020/03/21 07:16:16 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,11 +30,13 @@
  */
 
 /*
- * Socionext Uniphier AVE GbE driver
+ * Socionext UniPhier AVE GbE driver
+ *
+ * There are two groups for 64bit paddr model and 32bit paddr.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.5 2020/03/21 04:35:20 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.6 2020/03/21 07:16:16 nisimura Exp $");
 
 #include 
 #include 
@@ -125,15 +127,13 @@ __KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1
 #define AVEAFRING	0x0f00		/* entry ring number selector */
 #define AVEAFEN		0x0ffc		/* entry enable bit vector */
 
-#define AVETDB		0x1000		/* 64bit Tx descriptor storage base */
-#define AVERDB		0x1c00		/* 64bit Rx descriptor storage base */
-#define AVE32TDB	0x1000		/* 32bit Tx descriptor storage base */
-#define AVE32RDB	0x1800		/* 32bit Rx descriptor storage base */
+#define AVETDB		0x1000	/* 64bit Tx descriptor store, upto 256 */
+#define AVERDB		0x1c00	/* 64bit Rx descriptor store, upto 2048 */
+#define AVE32TDB	0x1000	/* 32bit Tx store base, upto 256 */
+#define AVE32RDB	0x1800	/* 32bit Rx store base, upto 2048 */
 
 /*
  * descriptor size is 12 bytes when 64bit paddr design, 8 bytes otherwise.
- * 3KB/24KB split or 64bit paddr Tx/Rx descriptor storage.
- * 2KB/16KB split or 32bit paddr Tx/Rx descriptor storage.
  */
 struct tdes {
 	uint32_t t0, t1, t2;
@@ -165,10 +165,10 @@ struct rdes32 { uint32_t r0, r1; };
 /* R2 frame address 63:32 */
 
 #define AVE_NTXSEGS		16
-#define AVE_TXQUEUELEN		8
+#define AVE_TXQUEUELEN		(AVE_NTXDESC / AVE_NTXSEGS)
 #define AVE_TXQUEUELEN_MASK	(AVE_TXQUEUELEN - 1)
 #define AVE_TXQUEUE_GC		(AVE_TXQUEUELEN / 4)
-#define AVE_NTXDESC		(AVE_TXQUEUELEN * AVE_NTXSEGS)
+#define AVE_NTXDESC		256			/* HW limit */
 #define AVE_NTXDESC_MASK	(AVE_NTXDESC - 1)
 #define AVE_NEXTTX(x)		(((x) + 1) & AVE_NTXDESC_MASK)
 #define AVE_NEXTTXS(x)		(((x) + 1) & AVE_TXQUEUELEN_MASK)
@@ -232,8 +232,8 @@ struct ave_softc {
 	bus_dmamap_t sc_cddmamap;	/* control data DMA map */
 #define sc_cddma	sc_cddmamap->dm_segs[0].ds_addr
 
-	struct tdes *sc_txdescs;	/* PTR to tdes [NTXDESC] array */
-	struct rdes *sc_rxdescs;	/* PTR to rdes [NRXDESC] array */
+	struct tdes *sc_txdescs;	/* PTR to tdes [NTXDESC] store */
+	struct rdes *sc_rxdescs;	/* PTR to rdes [NRXDESC] store */
 	struct tdes32 *sc_txd32;
 	struct rdes32 *sc_rxd32;
 
@@ -344,19 +344,19 @@ ave_fdt_attach(device_t parent, device_t
 	hwver = CSR_READ(sc, AVEHWVER);
 	sc->sc_model = of_search_compatible(phandle, compat_data)->data;
 
-	aprint_naive("\n");
-	aprint_normal(": Gigabit Ethernet Controller\n");
-	aprint_normal_dev(self, "UniPhier %c%c%c%c AVE %d GbE (%d.%d)\n",
-	hwimp >> 24, hwimp >> 16, hwimp >> 8, hwimp,
-	sc->sc_model,
-	hwver >> 8, hwver & 0xff);
-	aprint_normal_dev(self, "interrupt on %s\n", intrstr);
-
 	phy_mode = fdtbus_get_string(phandle, "phy-mode");
 	if (phy_mode == NULL) {
 		aprint_error(": missing 'phy-mode' property\n");
 		phy_mode = "rgmii";
 	}
+
+	aprint_naive("\n");
+	aprint_normal(": Gigabit Ethernet Controller\n");
+	aprint_normal_dev(self, "UniPhier %c%c%c%c AVE %d GbE (%d.%d) %s\n",
+	hwimp >> 24, hwimp >> 16, hwimp >> 8, hwimp,
+	sc->sc_model, hwver >> 8, hwver & 0xff, phy_mode);
+	aprint_normal_dev(self, "interrupt on %s\n", intrstr);
+
 	if (strcmp(phy_mode, "rgmii") == 0)
 		sc->sc_phymode = 0;		/* RGMII */
 	else
@@ -423,14 +423,15 @@ ave_fdt_attach(device_t parent, device_t
 	callout_setfunc(>sc_tick_ch, phy_tick, sc);
 
 	/*
-	 * no need to build Tx/Rx descriptor control_data.
-	 * go straight to make dmamap to hold Tx segments/Rx frames.
+	 * HW has a dedicated store to hold Tx/Rx descriptor arrays.
+	 * so no need to build Tx/Rx descriptor control_data.
+	 * go straight to make dmamap to hold Tx segments and Rx frames.
 	 */
 	for (i = 0; i < AVE_TXQUEUELEN; i++) {
 		if ((error = bus_dmamap_create(sc->sc_dmat, MCLBYTES,
 		AVE_NTXSEGS, MCLBYTES, 0, 0,
 		>sc_txsoft[i].txs_dmamap)) != 0) {
-			aprint_error_dev(sc->sc_dev,
+			aprint_error_dev(self,
 			"unable to create tx DMA map %d, error = %d\n",
 			i, error);
 			goto fail_4;
@@ -439,7 

CVS commit: src/sys/dev/usb

2020-03-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 21 06:55:22 UTC 2020

Modified Files:
src/sys/dev/usb: if_kue.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/usb/if_kue.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/if_kue.c
diff -u src/sys/dev/usb/if_kue.c:1.103 src/sys/dev/usb/if_kue.c:1.104
--- src/sys/dev/usb/if_kue.c:1.103	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/usb/if_kue.c	Sat Mar 21 06:55:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kue.c,v 1.103 2020/03/15 23:04:50 thorpej Exp $	*/
+/*	$NetBSD: if_kue.c,v 1.104 2020/03/21 06:55:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.103 2020/03/15 23:04:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.104 2020/03/21 06:55:22 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -503,7 +503,7 @@ kue_attach(device_t parent, device_t sel
 		aprint_error_dev(self, "could not read Ethernet descriptor\n");
 		return;
 	}
-	memcpy(un->un_eaddr, sc->kue_desc.kue_macaddr, sizeof un->un_eaddr);
+	memcpy(un->un_eaddr, sc->kue_desc.kue_macaddr, sizeof(un->un_eaddr));
 
 	sc->kue_mcfilters = kmem_alloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN,
 	KM_SLEEP);



CVS commit: src/sys/dev/usb

2020-03-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 21 06:54:56 UTC 2020

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

Log Message:
KNG


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 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/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.150 src/sys/dev/usb/ugen.c:1.151
--- src/sys/dev/usb/ugen.c:1.150	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/ugen.c	Sat Mar 21 06:54:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.150 2020/03/14 02:35:33 christos Exp $	*/
+/*	$NetBSD: ugen.c,v 1.151 2020/03/21 06:54:56 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.150 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.151 2020/03/21 06:54:56 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -231,7 +231,7 @@ ugen_attach(device_t parent, device_t se
 	struct usb_attach_arg *uaa = aux;
 	struct usbif_attach_arg uiaa;
 
-	memset(, 0, sizeof uiaa);
+	memset(, 0, sizeof(uiaa));
 	uiaa.uiaa_port = uaa->uaa_port;
 	uiaa.uiaa_vendor = uaa->uaa_vendor;
 	uiaa.uiaa_product = uaa->uaa_product;



CVS commit: src/sys/dev/usb

2020-03-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 21 06:55:13 UTC 2020

Modified Files:
src/sys/dev/usb: if_umb.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/usb/if_umb.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/if_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.17 src/sys/dev/usb/if_umb.c:1.18
--- src/sys/dev/usb/if_umb.c:1.17	Thu Mar 19 07:51:22 2020
+++ src/sys/dev/usb/if_umb.c	Sat Mar 21 06:55:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.18 2020/03/21 06:55:13 skrll Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.18 2020/03/21 06:55:13 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2760,7 +2760,7 @@ inet_ntop(int af, const void *src, char 
 Static const char *
 inet_ntop4(const u_char *src, char *dst, size_t size)
 {
-	char tmp[sizeof "255.255.255.255"];
+	char tmp[sizeof("255.255.255.255")];
 	int l;
 
 	l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
@@ -2789,7 +2789,7 @@ inet_ntop6(const u_char *src, char *dst,
 	 * Keep this in mind if you think this function should have been coded
 	 * to use pointer overlays.  All the world's not a VAX.
 	 */
-	char tmp[sizeof "::::::255.255.255.255"];
+	char tmp[sizeof("::::::255.255.255.255")];
 	char *tp, *ep;
 	struct { int base, len; } best, cur;
 #define IN6ADDRSZ	16
@@ -2803,7 +2803,7 @@ inet_ntop6(const u_char *src, char *dst,
 	 *	Copy the input (bytewise) array into a wordwise array.
 	 *	Find the longest run of 0x00's in src[] for :: shorthanding.
 	 */
-	memset(words, '\0', sizeof words);
+	memset(words, '\0', sizeof(words));
 	for (i = 0; i < IN6ADDRSZ; i++)
 		words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
 	best.base = -1;



CVS commit: src/sys/dev/usb

2020-03-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 21 06:54:43 UTC 2020

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_ure.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/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.38 src/sys/dev/usb/if_ure.c:1.39
--- src/sys/dev/usb/if_ure.c:1.38	Sun Mar 15 23:04:51 2020
+++ src/sys/dev/usb/if_ure.c	Sat Mar 21 06:54:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.38 2020/03/15 23:04:51 thorpej Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.39 2020/03/21 06:54:43 skrll Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.38 2020/03/15 23:04:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.39 2020/03/21 06:54:43 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -962,7 +962,7 @@ ure_attach(device_t parent, device_t sel
 		eaddr[4] = machi & 0xff;
 		eaddr[5] = (machi >> 8) & 0xff;
 	}
-	memcpy(un->un_eaddr, eaddr, sizeof un->un_eaddr);
+	memcpy(un->un_eaddr, eaddr, sizeof(un->un_eaddr));
 
 	struct ifnet *ifp = usbnet_ifp(un);
 



CVS commit: src/sys/dev/usb

2020-03-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 21 06:54:33 UTC 2020

Modified Files:
src/sys/dev/usb: if_umbreg.h

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_umbreg.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/usb/if_umbreg.h
diff -u src/sys/dev/usb/if_umbreg.h:1.1 src/sys/dev/usb/if_umbreg.h:1.2
--- src/sys/dev/usb/if_umbreg.h:1.1	Tue Jul 31 16:44:29 2018
+++ src/sys/dev/usb/if_umbreg.h	Sat Mar 21 06:54:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umbreg.h,v 1.1 2018/07/31 16:44:29 khorben Exp $ */
+/*	$NetBSD: if_umbreg.h,v 1.2 2020/03/21 06:54:32 skrll Exp $ */
 /*	$OpenBSD: if_umb.h,v 1.4 2017/04/18 13:27:55 gerhard Exp $ */
 
 /*
@@ -40,7 +40,7 @@ umb_val2descr(const struct umb_valdescr 
 			return vdp->descr;
 		vdp++;
 	}
-	snprintf(sval, sizeof (sval), "#%d", val);
+	snprintf(sval, sizeof(sval), "#%d", val);
 	return sval;
 }
 



CVS commit: src/sys/ufs/lfs

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 06:11:05 UTC 2020

Modified Files:
src/sys/ufs/lfs: lfs.h lfs_accessors.h

Log Message:
Avoid misaligned access to lfs64 on-disk records in memory.

lfs64 directory entries are only 32-bit aligned in order to conserve
space in directory blocks, and we had a hack to stuff a 64-bit inode
in them.  This replaces the hack by __aligned(4) __packed, and goes
further:

1. It's not clear that all the other lfs64 data structures are 64-bit
   aligned on disk to begin with.  We can go through these later and
   upgrade them from

struct foo64 {
...
} __aligned(4) __packed;

union foo {
struct foo64 f64;
...
};

   to

struct foo64 {
...
};

union foo {
struct foo64 f64 __aligned(8);
...
} __aligned(4) __packed;

   if we really want to take advantage of 64-bit memory accesses.

   However, the __aligned(4) __packed must remain on the union
   because:

2. We access even the lfs32 data structures via a union that has
   lfs64 members, and it turns out that compilers will assume access
   through a union with 64-bit aligned members implies the whole
   union has 64-bit alignment, even if we're only accessing a 32-bit
   aligned member.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/ufs/lfs/lfs.h
cvs rdiff -u -r1.48 -r1.49 src/sys/ufs/lfs/lfs_accessors.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/ufs/lfs/lfs.h
diff -u src/sys/ufs/lfs/lfs.h:1.206 src/sys/ufs/lfs/lfs.h:1.207
--- src/sys/ufs/lfs/lfs.h:1.206	Sat Mar 21 06:09:33 2020
+++ src/sys/ufs/lfs/lfs.h	Sat Mar 21 06:11:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs.h,v 1.206 2020/03/21 06:09:33 riastradh Exp $	*/
+/*	$NetBSD: lfs.h,v 1.207 2020/03/21 06:11:05 riastradh Exp $	*/
 
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp  */
@@ -358,18 +358,19 @@ struct lfs_dirheader32 {
 __CTASSERT(sizeof(struct lfs_dirheader32) == 8);
 
 struct lfs_dirheader64 {
-	uint32_t dh_inoA;		/* inode number of entry */
-	uint32_t dh_inoB;		/* inode number of entry */
+	uint64_t dh_ino;		/* inode number of entry */
 	uint16_t dh_reclen;		/* length of this record */
 	uint8_t  dh_type; 		/* file type, see below */
 	uint8_t  dh_namlen;		/* length of string in d_name */
-};
+} __aligned(4) __packed;
 __CTASSERT(sizeof(struct lfs_dirheader64) == 12);
 
 union lfs_dirheader {
 	struct lfs_dirheader64 u_64;
 	struct lfs_dirheader32 u_32;
 };
+__CTASSERT(__alignof(union lfs_dirheader) == __alignof(struct lfs_dirheader64));
+__CTASSERT(__alignof(union lfs_dirheader) == __alignof(struct lfs_dirheader32));
 
 typedef union lfs_dirheader LFS_DIRHEADER;
 
@@ -481,6 +482,8 @@ union lfs_dinode {
 	struct lfs64_dinode u_64;
 	struct lfs32_dinode u_32;
 };
+__CTASSERT(__alignof(union lfs_dinode) == __alignof(struct lfs64_dinode));
+__CTASSERT(__alignof(union lfs_dinode) == __alignof(struct lfs32_dinode));
 
 /*
  * The di_db fields may be overlaid with other information for
@@ -563,7 +566,7 @@ struct finfo64 {
 	uint64_t fi_ino;		/* inode number */
 	uint32_t fi_lastlength;		/* length of last block in array */
 	uint32_t fi_pad;		/* unused */
-};
+} __aligned(4) __packed;
 __CTASSERT(sizeof(struct finfo64) == 24);
 
 typedef struct finfo32 FINFO32;
@@ -579,6 +582,8 @@ typedef union finfo {
 	struct finfo64 u_64;
 	struct finfo32 u_32;
 } FINFO;
+__CTASSERT(__alignof(union finfo) == __alignof(struct finfo64));
+__CTASSERT(__alignof(union finfo) == __alignof(struct finfo32));
 
 /*
  * inode info (part of the segment summary)
@@ -590,7 +595,7 @@ typedef union finfo {
 
 typedef struct iinfo64 {
 	uint64_t ii_block;		/* block number */
-} IINFO64;
+} __aligned(4) __packed IINFO64;
 __CTASSERT(sizeof(struct iinfo64) == 8);
 
 typedef struct iinfo32 {
@@ -602,6 +607,8 @@ typedef union iinfo {
 	struct iinfo64 u_64;
 	struct iinfo32 u_32;
 } IINFO;
+__CTASSERT(__alignof(union iinfo) == __alignof(struct iinfo64));
+__CTASSERT(__alignof(union iinfo) == __alignof(struct iinfo32));
 
 /*
  * Index file inode entries.
@@ -620,7 +627,7 @@ struct ifile64 {
 	uint64_t if_atime_sec;		/* Last access time, seconds */
 	int64_t	  if_daddr;		/* inode disk address */
 	uint64_t if_nextfree;		/* next-unallocated inode */
-};
+} __aligned(4) __packed;
 __CTASSERT(sizeof(struct ifile64) == 32);
 
 typedef struct ifile32 IFILE32;
@@ -655,6 +662,9 @@ typedef union ifile {
 	struct ifile32 u_32;
 	struct ifile_v1 u_v1;
 } IFILE;
+__CTASSERT(__alignof(union ifile) == __alignof(struct ifile64));
+__CTASSERT(__alignof(union ifile) == __alignof(struct ifile32));
+__CTASSERT(__alignof(union ifile) == __alignof(struct ifile_v1));
 
 /*
  * Cleaner information structure.  This resides in 

CVS commit: src/sys/ufs/lfs

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 06:09:34 UTC 2020

Modified Files:
src/sys/ufs/lfs: lfs.h

Log Message:
CTASSERT lfs on-disk structure sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/sys/ufs/lfs/lfs.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/ufs/lfs/lfs.h
diff -u src/sys/ufs/lfs/lfs.h:1.205 src/sys/ufs/lfs/lfs.h:1.206
--- src/sys/ufs/lfs/lfs.h:1.205	Sun Feb 23 08:49:34 2020
+++ src/sys/ufs/lfs/lfs.h	Sat Mar 21 06:09:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs.h,v 1.205 2020/02/23 08:49:34 riastradh Exp $	*/
+/*	$NetBSD: lfs.h,v 1.206 2020/03/21 06:09:33 riastradh Exp $	*/
 
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp  */
@@ -355,6 +355,7 @@ struct lfs_dirheader32 {
 	uint8_t  dh_type; 		/* file type, see below */
 	uint8_t  dh_namlen;		/* length of string in d_name */
 };
+__CTASSERT(sizeof(struct lfs_dirheader32) == 8);
 
 struct lfs_dirheader64 {
 	uint32_t dh_inoA;		/* inode number of entry */
@@ -363,6 +364,7 @@ struct lfs_dirheader64 {
 	uint8_t  dh_type; 		/* file type, see below */
 	uint8_t  dh_namlen;		/* length of string in d_name */
 };
+__CTASSERT(sizeof(struct lfs_dirheader64) == 12);
 
 union lfs_dirheader {
 	struct lfs_dirheader64 u_64;
@@ -381,6 +383,7 @@ struct lfs_dirtemplate32 {
 	struct lfs_dirheader32	dotdot_header;
 	char			dotdot_name[4];	/* ditto */
 };
+__CTASSERT(sizeof(struct lfs_dirtemplate32) == 2*(8 + 4));
 
 struct lfs_dirtemplate64 {
 	struct lfs_dirheader64	dot_header;
@@ -388,6 +391,7 @@ struct lfs_dirtemplate64 {
 	struct lfs_dirheader64	dotdot_header;
 	char			dotdot_name[4];	/* ditto */
 };
+__CTASSERT(sizeof(struct lfs_dirtemplate64) == 2*(12 + 4));
 
 union lfs_dirtemplate {
 	struct lfs_dirtemplate64 u_64;
@@ -408,6 +412,7 @@ struct lfs_odirtemplate {
 	uint16_t	dotdot_namlen;
 	char		dotdot_name[4];	/* ditto */
 };
+__CTASSERT(sizeof(struct lfs_odirtemplate) == 2*(8 + 4));
 #endif
 
 /*
@@ -441,6 +446,7 @@ struct lfs32_dinode {
 	uint32_t	di_gid;		/* 116: File group. */
 	uint64_t	di_modrev;	/* 120: i_modrev for NFSv4 */
 };
+__CTASSERT(sizeof(struct lfs32_dinode) == 128);
 
 struct lfs64_dinode {
 	uint16_t	di_mode;	/*   0: IFMT, permissions; see below. */
@@ -469,6 +475,7 @@ struct lfs64_dinode {
 	uint64_t	di_inumber;	/* 240: Inode number */
 	uint64_t	di_spare[1];	/* 248: Reserved; currently unused */
 };
+__CTASSERT(sizeof(struct lfs64_dinode) == 256);
 
 union lfs_dinode {
 	struct lfs64_dinode u_64;
@@ -529,6 +536,7 @@ struct segusage {
 	uint32_t su_flags;		/* 12: segment flags */
 	uint64_t su_lastmod;		/* 16: last modified timestamp */
 };
+__CTASSERT(sizeof(struct segusage) == 24);
 
 typedef struct segusage_v1 SEGUSE_V1;
 struct segusage_v1 {
@@ -538,6 +546,7 @@ struct segusage_v1 {
 	uint16_t su_ninos;		/* 10: number of inode blocks in seg */
 	uint32_t su_flags;		/* 12: segment flags  */
 };
+__CTASSERT(sizeof(struct segusage_v1) == 16);
 
 /*
  * On-disk file information.  One per file with data blocks in the segment.
@@ -555,6 +564,7 @@ struct finfo64 {
 	uint32_t fi_lastlength;		/* length of last block in array */
 	uint32_t fi_pad;		/* unused */
 };
+__CTASSERT(sizeof(struct finfo64) == 24);
 
 typedef struct finfo32 FINFO32;
 struct finfo32 {
@@ -563,6 +573,7 @@ struct finfo32 {
 	uint32_t fi_ino;		/* inode number */
 	uint32_t fi_lastlength;		/* length of last block in array */
 };
+__CTASSERT(sizeof(struct finfo32) == 16);
 
 typedef union finfo {
 	struct finfo64 u_64;
@@ -580,10 +591,12 @@ typedef union finfo {
 typedef struct iinfo64 {
 	uint64_t ii_block;		/* block number */
 } IINFO64;
+__CTASSERT(sizeof(struct iinfo64) == 8);
 
 typedef struct iinfo32 {
 	uint32_t ii_block;		/* block number */
 } IINFO32;
+__CTASSERT(sizeof(struct iinfo32) == 4);
 
 typedef union iinfo {
 	struct iinfo64 u_64;
@@ -608,6 +621,7 @@ struct ifile64 {
 	int64_t	  if_daddr;		/* inode disk address */
 	uint64_t if_nextfree;		/* next-unallocated inode */
 };
+__CTASSERT(sizeof(struct ifile64) == 32);
 
 typedef struct ifile32 IFILE32;
 struct ifile32 {
@@ -617,6 +631,7 @@ struct ifile32 {
 	uint32_t if_atime_sec;		/* Last access time, seconds */
 	uint32_t if_atime_nsec;		/* and nanoseconds */
 };
+__CTASSERT(sizeof(struct ifile32) == 20);
 
 typedef struct ifile_v1 IFILE_V1;
 struct ifile_v1 {
@@ -628,6 +643,7 @@ struct ifile_v1 {
 	struct timespec if_atime;	/* Last access time */
 #endif
 };
+__CTASSERT(sizeof(struct ifile_v1) == 12);
 
 /*
  * Note: struct ifile_v1 is often handled by accessing the first three
@@ -657,6 +673,7 @@ typedef struct _cleanerinfo32 {
 	uint32_t free_tail;		/* 20: tail of the inode free list */
 	uint32_t flags;			/* 24: status word from the kernel */
 } CLEANERINFO32;
+__CTASSERT(sizeof(struct _cleanerinfo32) == 28);
 
 typedef struct _cleanerinfo64 {
 	uint32_t 

CVS commit: src/sys/dev/raidframe

2020-03-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 21 06:02:13 UTC 2020

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
Restore historic $Hdr: ...$ text.

This was presumably eaten by git cvsexportcommit, which is curious
because I thought I had gotten out of the habit of passing -k to it.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.380 src/sys/dev/raidframe/rf_netbsdkintf.c:1.381
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.380	Sun Mar  1 03:21:54 2020
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Sat Mar 21 06:02:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.380 2020/03/01 03:21:54 riastradh Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.381 2020/03/21 06:02:13 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: Utah $Hdr$
+ * from: Utah $Hdr: cd.c 1.6 90/11/28$
  *
  *  @(#)cd.c8.2 (Berkeley) 11/16/93
  */
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.380 2020/03/01 03:21:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.381 2020/03/21 06:02:13 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"