CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2020-04-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 21 22:27:09 UTC 2020

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Drop obsolete special case for clang/ppc.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.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/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.11 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.12
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.11	Fri Aug  9 08:10:39 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Tue Apr 21 22:27:09 2020
@@ -156,15 +156,7 @@
 
 /* Non-empty if the tls_model attribute is supported. */
 #if !defined(__vax__) && !defined(__mc68010__)
-# if defined(__clang__) && defined(__ppc__) && defined(__pic__)
-/*
- * XXX: In pic mode clang generates PPC32_GOT instead of PPC32_PICGOT for
- * tls model initial-exec. It shouldn't; see PPCISelLowering.h
- */
-#  define JEMALLOC_TLS_MODEL __attribute__((tls_model("global-dynamic")))
-# else
 #  define JEMALLOC_TLS_MODEL __attribute__((tls_model("initial-exec")))
-# endif
 #endif
 
 /*



CVS commit: src/lib/libc/stdlib

2020-04-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 21 22:22:55 UTC 2020

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
Switch to using TLS in old jemalloc for everywhere but VAX and sun2.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/stdlib/jemalloc.c

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

Modified files:

Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.48 src/lib/libc/stdlib/jemalloc.c:1.49
--- src/lib/libc/stdlib/jemalloc.c:1.48	Mon Jan 13 19:14:37 2020
+++ src/lib/libc/stdlib/jemalloc.c	Tue Apr 21 22:22:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.48 2020/01/13 19:14:37 joerg Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.49 2020/04/21 22:22:55 joerg Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -100,7 +100,6 @@
 #ifdef __NetBSD__
 #  define xutrace(a, b)		utrace("malloc", (a), (b))
 #  define __DECONST(x, y)	((x)__UNCONST(y))
-#  define NO_TLS
 #else
 #  define xutrace(a, b)		utrace((a), (b))
 #endif	/* __NetBSD__ */
@@ -118,7 +117,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.48 2020/01/13 19:14:37 joerg Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.49 2020/04/21 22:22:55 joerg Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -222,13 +221,11 @@ __RCSID("$NetBSD: jemalloc.c,v 1.48 2020
 #  define QUANTUM_2POW_MIN	4
 #  define SIZEOF_PTR_2POW	3
 #  define TINY_MIN_2POW		3
-#  define NO_TLS
 #endif
 #ifdef __sparc64__
 #  define QUANTUM_2POW_MIN	4
 #  define SIZEOF_PTR_2POW	3
 #  define TINY_MIN_2POW		3
-#  define NO_TLS
 #endif
 #ifdef __amd64__
 #  define QUANTUM_2POW_MIN	4
@@ -242,7 +239,6 @@ __RCSID("$NetBSD: jemalloc.c,v 1.48 2020
 #  ifdef __ARM_EABI__
 #define TINY_MIN_2POW	3
 #  endif
-#  define NO_TLS
 #endif
 #ifdef __powerpc__
 #  define QUANTUM_2POW_MIN	4
@@ -264,6 +260,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.48 2020
 #  define QUANTUM_2POW_MIN	4
 #  define SIZEOF_PTR_2POW	2
 #  define USE_BRK
+#  define NO_TLS
 #endif
 #ifdef __sh__
 #  define QUANTUM_2POW_MIN	4
@@ -274,6 +271,9 @@ __RCSID("$NetBSD: jemalloc.c,v 1.48 2020
 #  define QUANTUM_2POW_MIN	4
 #  define SIZEOF_PTR_2POW	2
 #  define USE_BRK
+#  ifdef __mc68000__
+#  define NO_TLS
+#  endif
 #endif
 #if defined(__mips__) || defined(__riscv__)
 #  ifdef _LP64
@@ -771,9 +771,11 @@ static malloc_mutex_t	arenas_mtx; /* Pro
  * for allocations.
  */
 #ifndef NO_TLS
-static __thread arena_t	**arenas_map;
+static __attribute__((tls_model("initial-exec")))
+__thread arena_t	**arenas_map;
 #else
 static arena_t	**arenas_map;
+static thread_key_t arenas_map_key = -1;
 #endif
 
 #if !defined(NO_TLS) || !defined(_REENTRANT)
@@ -781,7 +783,6 @@ static arena_t	**arenas_map;
 # define	set_arenas_map(x)	(arenas_map = x)
 #else
 
-static thread_key_t arenas_map_key = -1;
 
 static inline arena_t **
 get_arenas_map(void)
@@ -809,14 +810,18 @@ set_arenas_map(arena_t **a)
 	}
 
 	if (arenas_map_key == -1) {
+#ifndef NO_TLS
 		(void)thr_keycreate(_map_key, NULL);
+#endif
 		if (arenas_map != NULL) {
 			_DIAGASSERT(arenas_map == a);
 			arenas_map = NULL;
 		}
 	}
 
+#ifndef NO_TLS
 	thr_setspecific(arenas_map_key, a);
+#endif
 }
 #endif
 



CVS commit: src/sys/sys

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 21:53:53 UTC 2020

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

Log Message:
NetBSD 9.99.57 - cwdinfo changed


To generate a diff of this commit:
cvs rdiff -u -r1.659 -r1.660 src/sys/sys/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/sys/param.h
diff -u src/sys/sys/param.h:1.659 src/sys/sys/param.h:1.660
--- src/sys/sys/param.h:1.659	Fri Apr 10 23:58:48 2020
+++ src/sys/sys/param.h	Tue Apr 21 21:53:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.659 2020/04/10 23:58:48 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.660 2020/04/21 21:53:53 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999005600	/* NetBSD 9.99.56 */
+#define	__NetBSD_Version__	999005700	/* NetBSD 9.99.57 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 21:46:07 UTC 2020

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

Log Message:
- Give cwdi_lock its own cache line, for multithreaded processes.
- Comments.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/sys/filedesc.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/filedesc.h
diff -u src/sys/sys/filedesc.h:1.67 src/sys/sys/filedesc.h:1.68
--- src/sys/sys/filedesc.h:1.67	Tue Apr 21 21:42:47 2020
+++ src/sys/sys/filedesc.h	Tue Apr 21 21:46:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: filedesc.h,v 1.67 2020/04/21 21:42:47 ad Exp $	*/
+/*	$NetBSD: filedesc.h,v 1.68 2020/04/21 21:46:07 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -164,13 +164,21 @@ typedef struct filedesc {
 	uint32_t	fd_dlomap[NDENTRIES];
 } filedesc_t;
 
+/*
+ * Working directory, root and umask information.  Serialization:
+ *
+ * a	atomic operations
+ * l	cwdi_lock
+ */
 typedef struct cwdinfo {
-	struct vnode	*cwdi_cdir;	/* current directory */
-	struct vnode	*cwdi_rdir;	/* root directory */
-	struct vnode	*cwdi_edir;	/* emulation root (if known) */
-	krwlock_t	cwdi_lock;	/* lock on entire struct */
-	u_int		cwdi_cmask;	/* mask for file creation */
-	u_int		cwdi_refcnt;	/* reference count */
+	struct vnode	*cwdi_cdir;	/* l: current directory */
+	struct vnode	*cwdi_rdir;	/* l: root directory */
+	struct vnode	*cwdi_edir;	/* l: emulation root (if known) */
+	u_int		cwdi_cmask;	/* a: mask for file creation */
+	u_int		cwdi_refcnt;	/* a: reference count */
+
+	krwlock_t	cwdi_lock	/* :: lock on struct */
+	__aligned(COHERENCY_UNIT);	/* -> gets own cache line */
 } cwdinfo_t;
 
 #ifdef _KERNEL



CVS commit: src/sys

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 21:42:47 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c
src/sys/kern: kern_exec.c kern_proc.c uipc_usrreq.c vfs_cwd.c
vfs_getcwd.c vfs_lookup.c vfs_mount.c vfs_subr.c vfs_syscalls.c
src/sys/miscfs/procfs: procfs_vnops.c
src/sys/sys: filedesc.h

Log Message:
Revert the changes made in February to make cwdinfo use mostly lockless,
which relied on taking extra vnode refs.

Having benchmarked various experimental changes over the past few months it
seems that it's better to avoid vnode refs as much as possible.  cwdi_lock
as a RW lock already did that to some extent for getcwd() and will permit
the same for namei() too.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.497 -r1.498 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.245 -r1.246 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.197 -r1.198 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/vfs_cwd.c
cvs rdiff -u -r1.58 -r1.59 src/sys/kern/vfs_getcwd.c
cvs rdiff -u -r1.217 -r1.218 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.80 -r1.81 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.485 -r1.486 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.546 -r1.547 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.210 -r1.211 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/sys/filedesc.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_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.87 src/sys/compat/netbsd32/netbsd32_fs.c:1.88
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.87	Sun Feb 23 22:14:03 2020
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Tue Apr 21 21:42:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.87 2020/02/23 22:14:03 ad Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.88 2020/04/21 21:42:47 ad Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.87 2020/02/23 22:14:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.88 2020/04/21 21:42:47 ad Exp $");
 
 #include 
 #include 
@@ -740,12 +740,13 @@ netbsd32___getcwd(struct lwp *l, const s
 		syscallarg(char *) bufp;
 		syscallarg(size_t) length;
 	} */
+	struct proc *p = l->l_proc;
 	int error;
 	char   *path;
 	char   *bp, *bend;
 	int len = (int)SCARG(uap, length);
 	int	lenused;
-	struct	vnode *dvp;
+	struct	cwdinfo *cwdi;
 
 	if (len > MAXPATHLEN*4)
 		len = MAXPATHLEN*4;
@@ -763,10 +764,11 @@ netbsd32___getcwd(struct lwp *l, const s
 	 * limit it to N/2 vnodes for an N byte buffer.
 	 */
 #define GETCWD_CHECK_ACCESS 0x0001
-	dvp = cwdcdir();
-	error = getcwd_common (dvp, NULL, , path, len/2,
+	cwdi = p->p_cwdi;
+	rw_enter(>cwdi_lock, RW_READER);
+	error = getcwd_common (cwdi->cwdi_cdir, NULL, , path, len/2,
 			   GETCWD_CHECK_ACCESS, l);
-	vrele(dvp);
+	rw_exit(>cwdi_lock);
 
 	if (error)
 		goto out;

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.497 src/sys/kern/kern_exec.c:1.498
--- src/sys/kern/kern_exec.c:1.497	Sun Apr 19 20:31:59 2020
+++ src/sys/kern/kern_exec.c	Tue Apr 21 21:42:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.497 2020/04/19 20:31:59 thorpej Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.498 2020/04/21 21:42:47 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.497 2020/04/19 20:31:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.498 2020/04/21 21:42:47 ad Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -672,7 +672,7 @@ exec_makepathbuf(struct lwp *l, const ch
 	char *path, *bp;
 	size_t len, tlen;
 	int error;
-	struct vnode *dvp;
+	struct cwdinfo *cwdi;
 
 	path = PNBUF_GET();
 	if (seg == UIO_SYSSPACE) {
@@ -698,10 +698,11 @@ exec_makepathbuf(struct lwp *l, const ch
 	memmove(bp, path, len);
 	*(--bp) = '/';
 
-	dvp = cwdcdir();
-	error = getcwd_common(dvp, NULL, , path, MAXPATHLEN / 2,
+	cwdi = l->l_proc->p_cwdi;
+	rw_enter(>cwdi_lock, RW_READER);
+	error = getcwd_common(cwdi->cwdi_cdir, NULL, , path, MAXPATHLEN / 2,
 	GETCWD_CHECK_ACCESS, l);
-	vrele(dvp);
+	rw_exit(>cwdi_lock);
 
 	if (error)
 		goto err;
@@ -1118,7 +1119,6 @@ static void
 emulexec(struct lwp *l, struct exec_package *epp)
 {
 	struct proc		*p = l->l_proc;
-	struct cwdinfo		*cwdi;
 
 	/* The emulation root will usually have been found when we looked
 	 * for the elf interpreter (or similar), if not look now. */
@@ -1127,10 +1127,9 @@ emulexec(struct lwp *l, struct exec_pack
 		emul_find_root(l, epp);
 
 	/* Any old emulation root got removed by fdcloseexec */
-	KASSERT(p == curproc);
-	cwdi = cwdenter(RW_WRITER);
-	cwdi->cwdi_edir = epp->ep_emul_root;
-	cwdexit(cwdi);
+	rw_enter(>p_cwdi->cwdi_lock, RW_WRITER);
+	

CVS commit: src/sys/arch

2020-04-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 21 21:39:07 UTC 2020

Modified Files:
src/sys/arch/macppc/stand: Makefile.inc
src/sys/arch/zaurus/stand: Makefile.inc

Log Message:
Use -Wno-error=address-of-packed-member for a number of more boot
loaders.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/macppc/stand/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/zaurus/stand/Makefile.inc

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

Modified files:

Index: src/sys/arch/macppc/stand/Makefile.inc
diff -u src/sys/arch/macppc/stand/Makefile.inc:1.4 src/sys/arch/macppc/stand/Makefile.inc:1.5
--- src/sys/arch/macppc/stand/Makefile.inc:1.4	Thu Apr 20 19:09:29 2017
+++ src/sys/arch/macppc/stand/Makefile.inc	Tue Apr 21 21:39:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.4 2017/04/20 19:09:29 uwe Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2020/04/21 21:39:07 joerg Exp $
 
 BINDIR=		/usr/mdec
 
@@ -6,3 +6,10 @@ CFLAGS_UNWIND.gcc=	-fno-unwind-tables -f
 CFLAGS_UNWIND.clang=	-fno-unwind-tables
 
 LINKFLAGS_UNWIND=	--no-ld-generated-unwind-info
+
+# 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
+
+COPTS+=	-fcommon

Index: src/sys/arch/zaurus/stand/Makefile.inc
diff -u src/sys/arch/zaurus/stand/Makefile.inc:1.5 src/sys/arch/zaurus/stand/Makefile.inc:1.6
--- src/sys/arch/zaurus/stand/Makefile.inc:1.5	Sat Jan 23 22:28:09 2016
+++ src/sys/arch/zaurus/stand/Makefile.inc	Tue Apr 21 21:39:07 2020
@@ -1,4 +1,11 @@
-#	$NetBSD: Makefile.inc,v 1.5 2016/01/23 22:28:09 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2020/04/21 21:39:07 joerg Exp $
 
 BINDIR=		/usr/mdec
 KLINK_MACHINE=	zaurus
+
+# 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
+
+COPTS+=	-fcommon



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

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 20:20:39 UTC 2020

Modified Files:
src/sys/arch/x86/x86: bus_space.c sys_machdep.c

Log Message:
two more files to convert to newer HYPERVISOR_physdev_op() interface


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/x86/bus_space.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/sys_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.43 src/sys/arch/x86/x86/bus_space.c:1.44
--- src/sys/arch/x86/x86/bus_space.c:1.43	Tue Dec  3 04:57:25 2019
+++ src/sys/arch/x86/x86/bus_space.c	Tue Apr 21 20:20:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.43 2019/12/03 04:57:25 riastradh Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.44 2020/04/21 20:20:39 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.43 2019/12/03 04:57:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.44 2020/04/21 20:20:39 jdolecek Exp $");
 
 #include 
 #include 
@@ -136,10 +136,10 @@ x86_bus_space_init(void)
 #ifdef XENPV
 	/* We are privileged guest os - should have IO privileges. */
 	if (xendomain_is_privileged()) {
-		struct physdev_op physop;
-		physop.cmd = PHYSDEVOP_SET_IOPL;
-		physop.u.set_iopl.iopl = 1;
-		if (HYPERVISOR_physdev_op() != 0)
+		struct physdev_set_iopl set_iopl;
+		memset(_iopl, 0, sizeof(set_iopl));
+		set_iopl.iopl = 1;
+		if (HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, _iopl) != 0)
 			panic("Unable to obtain IOPL, "
 			"despite being SIF_PRIVILEGED");
 	}

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.52 src/sys/arch/x86/x86/sys_machdep.c:1.53
--- src/sys/arch/x86/x86/sys_machdep.c:1.52	Sun Nov 10 21:16:34 2019
+++ src/sys/arch/x86/x86/sys_machdep.c	Tue Apr 21 20:20:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.52 2019/11/10 21:16:34 chs Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.53 2020/04/21 20:20:39 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2009, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.52 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.53 2020/04/21 20:20:39 jdolecek Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_user_ldt.h"
@@ -377,16 +377,15 @@ x86_iopl(struct lwp *l, void *args, regi
 		iopl = SEL_KPL;
 
 {
-	struct physdev_op physop;
 	struct pcb *pcb;
 
 	pcb = lwp_getpcb(l);
 	pcb->pcb_iopl = iopl;
 
 	/* Force the change at ring 0. */
-	physop.cmd = PHYSDEVOP_SET_IOPL;
-	physop.u.set_iopl.iopl = iopl;
-	HYPERVISOR_physdev_op();
+	struct physdev_set_iopl set_iopl;
+	set_iopl.iopl = iopl;
+	HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, _iopl);
 }
 #elif defined(__x86_64__)
 	if (ua.iopl)



CVS commit: src/sys/arch

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 20:13:40 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/xen/include: hypervisor.h i82093var.h
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h
src/sys/arch/xen/x86: hypervisor_machdep.c pintr.c
src/sys/arch/xen/xen: evtchn.c

Log Message:
convert to newer HYPERVISOR_physdev_op() interface, now command and the
arg are separate arguments - this is needed for newer physdev_op commands

remove code for PHYSDEVOP_IRQ_UNMASK_NOTIFY, it is obsolete since
interface version 0x00030202 and is unsupported by newer versions of Xen

confirmed working on amd64 Dom0, i386 compile-tested only


To generate a diff of this commit:
cvs rdiff -u -r1.346 -r1.347 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.825 -r1.826 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/i82093var.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/include/i386/hypercalls.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/x86/pintr.c
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/xen/xen/evtchn.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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.346 src/sys/arch/amd64/amd64/machdep.c:1.347
--- src/sys/arch/amd64/amd64/machdep.c:1.346	Fri Jan 31 08:21:11 2020
+++ src/sys/arch/amd64/amd64/machdep.c	Tue Apr 21 20:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.347 2020/04/21 20:13:39 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.347 2020/04/21 20:13:39 jdolecek Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -428,10 +428,9 @@ void
 x86_64_switch_context(struct pcb *new)
 {
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), new->pcb_rsp0);
-	struct physdev_op physop;
-	physop.cmd = PHYSDEVOP_SET_IOPL;
-	physop.u.set_iopl.iopl = new->pcb_iopl;
-	HYPERVISOR_physdev_op();
+	struct physdev_set_iopl set_iopl;
+	set_iopl.iopl = new->pcb_iopl;
+	HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, _iopl);
 }
 
 void
@@ -489,14 +488,13 @@ x86_64_proc0_pcb_ldt_init(void)
 #if !defined(XENPV)
 	lldt(GSYSSEL(GLDT_SEL, SEL_KPL));
 #else
-	struct physdev_op physop;
 	xen_set_ldt((vaddr_t)ldtstore, LDT_SIZE >> 3);
 	/* Reset TS bit and set kernel stack for interrupt handlers */
 	HYPERVISOR_fpu_taskswitch(1);
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_rsp0);
-	physop.cmd = PHYSDEVOP_SET_IOPL;
-	physop.u.set_iopl.iopl = pcb->pcb_iopl;
-	HYPERVISOR_physdev_op();
+	struct physdev_set_iopl set_iopl;
+	set_iopl.iopl = pcb->pcb_iopl;
+	HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, _iopl);
 #endif
 }
 

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.825 src/sys/arch/i386/i386/machdep.c:1.826
--- src/sys/arch/i386/i386/machdep.c:1.825	Fri Jan 31 08:21:11 2020
+++ src/sys/arch/i386/i386/machdep.c	Tue Apr 21 20:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.826 2020/04/21 20:13:39 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.826 2020/04/21 20:13:39 jdolecek Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -494,15 +494,14 @@ void
 i386_switch_context(lwp_t *l)
 {
 	struct pcb *pcb;
-	struct physdev_op physop;
 
 	pcb = lwp_getpcb(l);
 
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_esp0);
 
-	physop.cmd = PHYSDEVOP_SET_IOPL;
-	physop.u.set_iopl.iopl = pcb->pcb_iopl;
-	HYPERVISOR_physdev_op();
+	struct physdev_set_iopl set_iopl;
+	set_iopl.iopl = pcb->pcb_iopl;
+	HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, _iopl);
 }
 
 void

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.49 src/sys/arch/xen/include/hypervisor.h:1.50
--- src/sys/arch/xen/include/hypervisor.h:1.49	Mon Feb  4 18:14:53 2019
+++ src/sys/arch/xen/include/hypervisor.h	Tue Apr 21 20:13:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.49 2019/02/04 18:14:53 cherry Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.50 2020/04/21 20:13:39 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -147,10 +147,6 @@ extern 

CVS commit: [phil-wifi] src

2020-04-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 21 19:37:57 UTC 2020

Added Files:
src [phil-wifi]: BUILDING Makefile Makefile.inc README.md UPDATING
build.sh
src/bin [phil-wifi]: Makefile Makefile.inc
src/bin/cat [phil-wifi]: Makefile cat.1 cat.c
src/bin/chio [phil-wifi]: Makefile chio.1 chio.c defs.h pathnames.h
src/bin/chmod [phil-wifi]: Makefile chmod.1 chmod.c
src/bin/cp [phil-wifi]: Makefile cp.1 cp.c extern.h utils.c
src/bin/csh [phil-wifi]: Makefile alloc.c char.c char.h const.c csh.1
csh.c csh.h dir.c dir.h dol.c err.c exec.c exp.c extern.h file.c
func.c glob.c hist.c init.c lex.c misc.c parse.c pathnames.h proc.c
proc.h sem.c set.c str.c time.c
src/bin/csh/USD.doc [phil-wifi]: Makefile csh.1 csh.2 csh.3 csh.4
csh.ap csh.g tabs
src/bin/date [phil-wifi]: Makefile date.1 date.c extern.h netdate.c
src/bin/dd [phil-wifi]: Makefile args.c conv.c conv_tab.c dd.1 dd.c
dd.h dd_hostops.c dd_rumpops.c dd_swab.c extern.h misc.c position.c
src/bin/df [phil-wifi]: Makefile df.1 df.c
src/bin/domainname [phil-wifi]: Makefile domainname.1 domainname.c
src/bin/echo [phil-wifi]: Makefile echo.1 echo.c
src/bin/ed [phil-wifi]: Makefile POSIX README buf.c cbc.c ed.1 ed.h
glbl.c io.c main.c re.c sub.c undo.c
src/bin/ed/test [phil-wifi]: =.err Makefile README TODO a.d a.r a.t
a1.err a2.err addr.d addr.r addr.t addr1.err addr2.err ascii.d
ascii.r ascii.t bang1.d bang1.err bang1.r bang1.t bang2.err c.d c.r
c.t c1.err c2.err ckscripts.sh d.d d.err d.r d.t e1.d e1.err e1.r
e1.t e2.d e2.err e2.r e2.t e3.d e3.err e3.r e3.t e4.d e4.r e4.t
f1.err f2.err g1.d g1.err g1.r g1.t g2.d g2.err g2.r g2.t g3.d
g3.err g3.r g3.t g4.d g4.r g4.t g5.d g5.r g5.t h.err i.d i.r i.t
i1.err i2.err i3.err j.d j.r j.t k.d k.r k.t k1.err k2.err k3.err
k4.err l.d l.r l.t m.d m.err m.r m.t mkscripts.sh n.d n.r n.t
nl.err nl1.d nl1.r nl1.t nl2.d nl2.r nl2.t p.d p.r p.t q.d q.r q.t
q1.err r1.d r1.err r1.r r1.t r2.d r2.err r2.r r2.t r3.d r3.r r3.t
s1.d s1.err s1.r s1.t s10.err s2.d s2.err s2.r s2.t s3.d s3.err
s3.r s3.t s4.err s5.err s6.err s7.err s8.err s9.err t.d t.r t1.d
t1.err t1.r t1.t t2.d t2.err t2.r t2.t u.d u.err u.r u.t v.d v.r
v.t w.d w.r w.t w1.err w2.err w3.err x.err z.err
src/bin/expr [phil-wifi]: Makefile expr.1 expr.y
src/bin/hostname [phil-wifi]: Makefile hostname.1 hostname.c
src/bin/kill [phil-wifi]: Makefile kill.1 kill.c
src/bin/ksh [phil-wifi]: Makefile alloc.c c_ksh.c c_sh.c c_test.c
c_test.h c_ulimit.c conf-end.h config.h edit.c edit.h emacs-gen.sh
emacs.c eval.c exec.c expand.h expr.c history.c io.c jobs.c ksh.Man
ksh_dir.h ksh_limval.h lex.c lex.h mail.c main.c misc.c mkman
path.c proto.h sh.h shf.c shf.h siglist.in siglist.sh syn.c table.c
table.h trap.c tree.c tree.h tty.c tty.h var.c version.c vi.c
src/bin/ln [phil-wifi]: Makefile ln.1 ln.c
src/bin/ls [phil-wifi]: Makefile cmp.c extern.h ls.1 ls.c ls.h main.c
print.c util.c
src/bin/mkdir [phil-wifi]: Makefile mkdir.1 mkdir.c
src/bin/mt [phil-wifi]: Makefile mt.1 mt.c
src/bin/mv [phil-wifi]: Makefile mv.1 mv.c pathnames.h
src/bin/pax [phil-wifi]: Makefile ar_io.c ar_subs.c buf_subs.c cpio.1
cpio.c cpio.h dumptar.c extern.h file_subs.c ftree.c ftree.h
gen_subs.c getoldopt.c options.c options.h pat_rep.c pat_rep.h
pax.1 pax.c pax.h sel_subs.c sel_subs.h tables.c tables.h tar.1
tar.c tar.h tty_subs.c
src/bin/ps [phil-wifi]: Makefile extern.h fmt.c keyword.c nlist.c
print.c ps.1 ps.c ps.h
src/bin/pwd [phil-wifi]: Makefile pwd.1 pwd.c
src/bin/rcmd [phil-wifi]: Makefile rcmd.1
src/bin/rcp [phil-wifi]: Makefile extern.h pathnames.h rcp.1 rcp.c
util.c
src/bin/rm [phil-wifi]: Makefile rm.1 rm.c
src/bin/rmdir [phil-wifi]: Makefile rmdir.1 rmdir.c
src/bin/sh [phil-wifi]: Makefile TOUR alias.c alias.h arith_token.c
arith_tokens.h arithmetic.c arithmetic.h builtins.def cd.c cd.h
error.c error.h eval.c eval.h exec.c exec.h expand.c expand.h
histedit.c init.h input.c input.h jobs.c jobs.h machdep.h mail.c
mail.h main.c main.h memalloc.c memalloc.h miscbltin.c miscbltin.h
mkbuiltins mkinit.sh mknodenames.sh mknodes.sh mkoptions.sh
mktokens myhistedit.h mystring.c mystring.h nodes.c.pat nodetypes
option.list options.c options.h output.c output.h parser.c parser.h
redir.c redir.h sh.1 shell.h show.c show.h syntax.c syntax.h trap.c
   

CVS commit: src/sys/arch/xen

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 19:03:51 UTC 2020

Modified Files:
src/sys/arch/xen/include: intr.h
src/sys/arch/xen/x86: xen_intr.c

Log Message:
adjust so that this at least compiles and links with __HAVE_PCI_MSI_MSIX


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/xen/include/intr.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/xen_intr.c

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

Modified files:

Index: src/sys/arch/xen/include/intr.h
diff -u src/sys/arch/xen/include/intr.h:1.53 src/sys/arch/xen/include/intr.h:1.54
--- src/sys/arch/xen/include/intr.h:1.53	Mon Dec 23 13:35:37 2019
+++ src/sys/arch/xen/include/intr.h	Tue Apr 21 19:03:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.53 2019/12/23 13:35:37 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.54 2020/04/21 19:03:51 jdolecek Exp $	*/
 /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
 
 /*-
@@ -95,6 +95,9 @@ void xen_intr_mask(struct intrhand *);
 void xen_intr_unmask(struct intrhand *);
 void xen_intr_disestablish(struct intrhand *);
 
+struct intrsource *xen_intr_allocate_io_intrsource(const char *);
+void xen_intr_free_io_intrsource(const char *);
+
 #endif /* !_LOCORE */
 
 #endif /* _XEN_INTR_H_ */

Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.22 src/sys/arch/xen/x86/xen_intr.c:1.23
--- src/sys/arch/xen/x86/xen_intr.c:1.22	Mon Apr 13 22:54:12 2020
+++ src/sys/arch/xen/x86/xen_intr.c	Tue Apr 21 19:03:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $	*/
+/*	$NetBSD: xen_intr.c,v 1.23 2020/04/21 19:03:51 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.23 2020/04/21 19:03:51 jdolecek Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -67,6 +67,10 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v
 
 #if NPCI > 0
 #include 
+#ifdef __HAVE_PCI_MSI_MSIX
+#include 
+#include 
+#endif
 #endif
 
 #if defined(MULTIPROCESSOR)
@@ -527,6 +531,21 @@ xen_intr_create_intrid(int legacy_irq, s
 	return NULL; /* No pic found! */
 }
 
+static struct intrsource xen_dummy_intrsource;
+
+struct intrsource *
+xen_intr_allocate_io_intrsource(const char *intrid)
+{
+	/* Nothing to do, required by MSI code */
+	return _dummy_intrsource;
+}
+
+void
+xen_intr_free_io_intrsource(const char *intrid)
+{
+	/* Nothing to do, required by MSI code */
+}
+
 #if !defined(XENPVHVM)
 __strong_alias(spllower, xen_spllower);
 __strong_alias(x86_read_psl, xen_read_psl);
@@ -542,4 +561,6 @@ __strong_alias(intr_disestablish, xen_in
 __strong_alias(cpu_intr_redistribute, xen_cpu_intr_redistribute);
 __strong_alias(cpu_intr_count, xen_cpu_intr_count);
 __strong_alias(cpu_intr_init, xen_cpu_intr_init);
+__strong_alias(intr_allocate_io_intrsource, xen_intr_allocate_io_intrsource);
+__strong_alias(intr_free_io_intrsource, xen_intr_free_io_intrsource);
 #endif /* !XENPVHVM */



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

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 18:25:12 UTC 2020

Modified Files:
src/sys/arch/xen/include: intrdefs.h

Log Message:
XEN_IPI_KICK was replaced by XEN_IPI_AST.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/include/intrdefs.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/xen/include/intrdefs.h
diff -u src/sys/arch/xen/include/intrdefs.h:1.15 src/sys/arch/xen/include/intrdefs.h:1.16
--- src/sys/arch/xen/include/intrdefs.h:1.15	Fri Apr  3 22:20:36 2020
+++ src/sys/arch/xen/include/intrdefs.h	Tue Apr 21 18:25:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.15 2020/04/03 22:20:36 ad Exp $ */
+/* $NetBSD: intrdefs.h,v 1.16 2020/04/21 18:25:11 ad Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -6,7 +6,6 @@
 #define _XEN_INTRDEFS_H_
 
 /* Xen IPI types */
-#define XEN_IPI_KICK		0x
 #define XEN_IPI_HALT		0x0001
 #define XEN_IPI_SYNCH_FPU	0x0002
 #define XEN_IPI_DDB		0x0004



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

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 18:24:05 UTC 2020

Modified Files:
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
Remove spurious reference to XEN_IPI_KICK - it represents the absence of
a specific IPI type.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/x86/xen_ipi.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/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.36 src/sys/arch/xen/x86/xen_ipi.c:1.37
--- src/sys/arch/xen/x86/xen_ipi.c:1.36	Mon Apr 13 22:54:12 2020
+++ src/sys/arch/xen/x86/xen_ipi.c	Tue Apr 21 18:24:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.37 2020/04/21 18:24:05 ad Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.37 2020/04/21 18:24:05 ad Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.37 2020/04/21 18:24:05 ad Exp $");
 
 #include "opt_ddb.h"
 
@@ -156,7 +156,7 @@ valid_ipimask(uint32_t ipimask)
 {
 	uint32_t masks = XEN_IPI_GENERIC | XEN_IPI_HVCB | XEN_IPI_XCALL |
 		 XEN_IPI_DDB | XEN_IPI_SYNCH_FPU |
-		 XEN_IPI_HALT | XEN_IPI_KICK | XEN_IPI_AST;
+		 XEN_IPI_HALT | XEN_IPI_AST;
 
 	if (ipimask & ~masks) {
 		return false;



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

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 18:22:29 UTC 2020

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
Follow convention and put entire predicate inside __predict_false()


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/xen/x86/cpu.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/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.133 src/sys/arch/xen/x86/cpu.c:1.134
--- src/sys/arch/xen/x86/cpu.c:1.133	Mon Feb 24 12:20:29 2020
+++ src/sys/arch/xen/x86/cpu.c	Tue Apr 21 18:22:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.133 2020/02/24 12:20:29 rin Exp $	*/
+/*	$NetBSD: cpu.c,v 1.134 2020/04/21 18:22:29 ad Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.133 2020/02/24 12:20:29 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.134 2020/04/21 18:22:29 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1094,7 +1094,7 @@ x86_cpu_idle_xen(void)
 	KASSERT(ci->ci_ilevel == IPL_NONE);
 
 	x86_disable_intr();
-	if (!__predict_false(ci->ci_want_resched)) {
+	if (__predict_false(!ci->ci_want_resched)) {
 		idle_block();
 	} else {
 		x86_enable_intr();



CVS commit: src/sys/kern

2020-04-21 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Apr 21 17:50:19 UTC 2020

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

Log Message:
vmem_list_lock needs to be an adaptive lock.  Fixes LOCKDEBUG panic.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/kern/subr_vmem.c

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

Modified files:

Index: src/sys/kern/subr_vmem.c
diff -u src/sys/kern/subr_vmem.c:1.102 src/sys/kern/subr_vmem.c:1.103
--- src/sys/kern/subr_vmem.c:1.102	Sun Apr 19 21:55:37 2020
+++ src/sys/kern/subr_vmem.c	Tue Apr 21 17:50:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_vmem.c,v 1.102 2020/04/19 21:55:37 ad Exp $	*/
+/*	$NetBSD: subr_vmem.c,v 1.103 2020/04/21 17:50:19 ad Exp $	*/
 
 /*-
  * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi,
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.102 2020/04/19 21:55:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.103 2020/04/21 17:50:19 ad Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -662,7 +662,7 @@ static void
 vmem_bootstrap(void)
 {
 
-	mutex_init(_list_lock, MUTEX_DEFAULT, IPL_VM);
+	mutex_init(_list_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_btag_lock, MUTEX_DEFAULT, IPL_VM);
 	mutex_init(_btag_refill_lock, MUTEX_DEFAULT, IPL_VM);
 



CVS commit: [netbsd-8] src/sys/arch

2020-04-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 21 16:58:57 UTC 2020

Modified Files:
src/sys/arch/macppc/stand/ofwboot [netbsd-8]: Locore.c
src/sys/arch/powerpc/oea [netbsd-8]: ofw_consinit.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1533):

sys/arch/macppc/stand/ofwboot/Locore.c: revision 1.34 (via patch)
sys/arch/powerpc/oea/ofw_consinit.c: revision 1.18

When boot up with auto-boot? == true, some systems do not provide stdout
if the normal output is screen.

Open screen explicitly as stdout in this case, both for ofwboot and kernel,
which fixes problems with auto-boot? == true for Mac mini G4:
- messages from ofwboot do not appear
- kernel freeze during early boot stage

Taken from OpenBSD:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/macppc/ofw_machdep.c#rev1.3
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/stand/Locore.c#rev1.3

XXX
pullup to netbsd-9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.10.1 src/sys/arch/macppc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.17 -r1.17.10.1 src/sys/arch/powerpc/oea/ofw_consinit.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/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29.10.1
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.29	Fri Apr 22 18:25:41 2016
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Tue Apr 21 16:58:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.29 2016/04/22 18:25:41 christos Exp $	*/
+/*	$NetBSD: Locore.c,v 1.29.10.1 2020/04/21 16:58:56 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -621,6 +621,11 @@ setup(void)
 	OF_getprop(chosen, "stdout", , sizeof(stdout)) !=
 	sizeof(stdout))
 		OF_exit();
+
+	if (stdout == 0) {
+		/* screen should be console, but it is not open */
+		stdout = OF_open("screen");
+	}
 }
 
 void

Index: src/sys/arch/powerpc/oea/ofw_consinit.c
diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.17 src/sys/arch/powerpc/oea/ofw_consinit.c:1.17.10.1
--- src/sys/arch/powerpc/oea/ofw_consinit.c:1.17	Sun Feb 14 18:12:30 2016
+++ src/sys/arch/powerpc/oea/ofw_consinit.c	Tue Apr 21 16:58:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.17.10.1 2020/04/21 16:58:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17.10.1 2020/04/21 16:58:57 martin Exp $");
 
 #include 
 #include 
@@ -458,6 +458,10 @@ ofwoea_bootstrap_console(void)
 	if (OF_getprop(chosen, "stdin", ,
 	sizeof(stdin)) != sizeof(stdin))
 		goto nocons;
+	if (stdout == 0) {
+		 /* screen should be console, but it is not open */
+		 stdout = OF_open("screen");
+	}
 	node = OF_instance_to_package(stdout);
 	console_node = node;
 	console_instance = stdout;



CVS commit: [bouyer-xenpvh] src/sys/arch/xen/xen

2020-04-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr 21 16:57:40 UTC 2020

Modified Files:
src/sys/arch/xen/xen [bouyer-xenpvh]: xengnt.c

Log Message:
It is possible to use grant_v2 with HVM guest; but the status table has
to be mapped using XENMEM_add_to_physmap.


To generate a diff of this commit:
cvs rdiff -u -r1.29.2.2 -r1.29.2.3 src/sys/arch/xen/xen/xengnt.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/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.29.2.2 src/sys/arch/xen/xen/xengnt.c:1.29.2.3
--- src/sys/arch/xen/xen/xengnt.c:1.29.2.2	Mon Apr 20 19:42:10 2020
+++ src/sys/arch/xen/xen/xengnt.c	Tue Apr 21 16:57:40 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.29.2.2 2020/04/20 19:42:10 bouyer Exp $  */
+/*  $NetBSD: xengnt.c,v 1.29.2.3 2020/04/21 16:57:40 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.29.2.2 2020/04/20 19:42:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.29.2.3 2020/04/21 16:57:40 bouyer Exp $");
 
 #include 
 #include 
@@ -44,16 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1
 
 #include "opt_xen.h"
 
-/* 
- * grant table v2 is not supported for HVM guests on 4.11 at last.
- * see xen/arch/x86/hvm/hypercall.c in Xen sources (missing
- * GNTTABOP_get_status_frames)
- */
-
-#ifdef XENPV
-#define USE_GRANT_V2
-#endif
-
 /* #define XENDEBUG */
 #ifdef XENDEBUG
 #define DPRINTF(x) printf x
@@ -77,7 +67,6 @@ int last_gnt_entry;
 #define XENGNT_NO_ENTRY 0x
 
 /* VM address of the grant table */
-#ifdef USE_GRANT_V2
 #define NR_GRANT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(grant_entry_v2_t))
 #define NR_GRANT_STATUS_PER_PAGE (PAGE_SIZE / sizeof(grant_status_t))
 
@@ -86,10 +75,6 @@ grant_entry_v2_t *grant_table;
 int gnt_status_frames;
 
 grant_status_t *grant_status;
-#else /* USE_GRANT_V2 */
-#define NR_GRANT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(grant_entry_v1_t))
-grant_entry_v1_t *grant_table;
-#endif /* USE_GRANT_V2 */
 kmutex_t grant_lock;
 
 static grant_ref_t xengnt_get_entry(void);
@@ -118,13 +103,11 @@ xengnt_init(void)
 	gnt_nr_grant_frames = gnt_max_grant_frames;
 
 
-#ifdef USE_GRANT_V2
 	struct gnttab_set_version gntversion;
 	gntversion.version = 2;
 	rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, , 1);
 	if (rc < 0 || gntversion.version != 2)
 		panic("GNTTABOP_set_version 2 failed %d", rc);
-#endif /* USE_GRANT_V2 */
 
 	nr_grant_entries =
 	gnt_max_grant_frames * NR_GRANT_ENTRIES_PER_PAGE;
@@ -139,14 +122,12 @@ xengnt_init(void)
 	for (i = 0; i <= nr_grant_entries; i++)
 		gnt_entries[i] = XENGNT_NO_ENTRY;
 
-#ifdef USE_GRANT_V2
 	gnt_status_frames =
 	round_page(nr_grant_entries * sizeof(grant_status_t)) / PAGE_SIZE;
 	grant_status = (void *)uvm_km_alloc(kernel_map,
 	gnt_status_frames * PAGE_SIZE, 0, UVM_KMF_VAONLY);
 	if (grant_status == NULL)
 		panic("xengnt_init() status no VM space");
-#endif /* USE_GRANT_V2 */
 
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_VM);
 
@@ -194,10 +175,8 @@ xengnt_suspend(void) {
 	/* Remove virtual => machine mapping for grant table */
 	pmap_kremove((vaddr_t)grant_table, gnt_nr_grant_frames * PAGE_SIZE);
 
-#ifdef USE_GRANT_V2
 	/* Remove virtual => machine mapping for status table */
 	pmap_kremove((vaddr_t)grant_status, gnt_status_frames * PAGE_SIZE);
-#endif
 
 	pmap_update(pmap_kernel());
 	mutex_exit(_lock);
@@ -210,12 +189,8 @@ xengnt_suspend(void) {
 static int
 xengnt_map_status(void)
 {
-#ifdef USE_GRANT_V2
-	gnttab_get_status_frames_t getstatus;
 	uint64_t *pages;
 	size_t sz;
-	int err;
-
 	KASSERT(mutex_owned(_lock));
 
 	sz = gnt_status_frames * sizeof(*pages);
@@ -223,6 +198,10 @@ xengnt_map_status(void)
 	if (pages == NULL)
 		return ENOMEM;
 
+#ifdef XENPV
+	gnttab_get_status_frames_t getstatus;
+	int err;
+
 	getstatus.dom = DOMID_SELF;
 	getstatus.nr_frames = gnt_status_frames;
 	set_xen_guest_handle(getstatus.frame_list, pages);
@@ -240,7 +219,23 @@ xengnt_map_status(void)
 		kmem_free(pages, sz);
 		return ENOMEM;
 	}
+#else /* XENPV */
+	for (int i = 0; i < gnt_status_frames; i++) {
+		struct vm_page *pg;
+		struct xen_add_to_physmap xmap;
+
+		pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE|UVM_PGA_ZERO);
+		pages[i] = atop(uvm_vm_page_to_phys(pg));
+
+		xmap.domid = DOMID_SELF;
+		xmap.space = XENMAPSPACE_grant_table;
+		xmap.idx = i | XENMAPIDX_grant_table_status;
+		xmap.gpfn = pages[i];
 
+		if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, ) < 0)
+			panic("%s: Unable to add grant tables\n", __func__);
+	}
+#endif /* XENPV */
 	/*
 	 * map between status_table addresses and the machine addresses of
 	 * the status table frames
@@ -253,8 +248,6 @@ xengnt_map_status(void)
 	pmap_update(pmap_kernel());
 
 	kmem_free(pages, sz);
-
-#endif /* USE_GRANT_V2 */
 	return 0;
 }
 
@@ -298,7 +291,7 @@ xengnt_more_entries(void)
 		xmap.gpfn = 

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

2020-04-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 21 16:54:52 UTC 2020

Modified Files:
src/sys/arch/macppc/stand/ofwboot [netbsd-9]: Locore.c
src/sys/arch/powerpc/oea [netbsd-9]: ofw_consinit.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #837):

sys/arch/macppc/stand/ofwboot/Locore.c: revision 1.34
sys/arch/powerpc/oea/ofw_consinit.c: revision 1.18

When boot up with auto-boot? == true, some systems do not provide stdout
if the normal output is screen.

Open screen explicitly as stdout in this case, both for ofwboot and kernel,
which fixes problems with auto-boot? == true for Mac mini G4:
- messages from ofwboot do not appear
- kernel freeze during early boot stage

Taken from OpenBSD:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/macppc/ofw_machdep.c#rev1.3
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/stand/Locore.c#rev1.3

XXX
pullup to netbsd-9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/arch/macppc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.17 -r1.17.22.1 src/sys/arch/powerpc/oea/ofw_consinit.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/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.33 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.33.4.1
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.33	Mon Nov 12 20:00:46 2018
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Tue Apr 21 16:54:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.33 2018/11/12 20:00:46 scole Exp $	*/
+/*	$NetBSD: Locore.c,v 1.33.4.1 2020/04/21 16:54:51 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -680,6 +680,11 @@ setup(void)
 	sizeof(stdout))
 		OF_exit();
 
+	if (stdout == 0) {
+		/* screen should be console, but it is not open */
+		stdout = OF_open("screen");
+	}
+
 #ifdef HEAP_VARIABLE
 	uint32_t pvr, vers, hsize = HEAP_SIZE;
 

Index: src/sys/arch/powerpc/oea/ofw_consinit.c
diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.17 src/sys/arch/powerpc/oea/ofw_consinit.c:1.17.22.1
--- src/sys/arch/powerpc/oea/ofw_consinit.c:1.17	Sun Feb 14 18:12:30 2016
+++ src/sys/arch/powerpc/oea/ofw_consinit.c	Tue Apr 21 16:54:52 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.17.22.1 2020/04/21 16:54:52 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17 2016/02/14 18:12:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.17.22.1 2020/04/21 16:54:52 martin Exp $");
 
 #include 
 #include 
@@ -458,6 +458,10 @@ ofwoea_bootstrap_console(void)
 	if (OF_getprop(chosen, "stdin", ,
 	sizeof(stdin)) != sizeof(stdin))
 		goto nocons;
+	if (stdout == 0) {
+		 /* screen should be console, but it is not open */
+		 stdout = OF_open("screen");
+	}
 	node = OF_instance_to_package(stdout);
 	console_node = node;
 	console_instance = stdout;



CVS commit: src/sys/ufs/ffs

2020-04-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 21 15:04:13 UTC 2020

Modified Files:
src/sys/ufs/ffs: ffs_subr.c

Log Message:
use %s/__func__ so that the strings can be shared.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/ufs/ffs/ffs_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/ufs/ffs/ffs_subr.c
diff -u src/sys/ufs/ffs/ffs_subr.c:1.51 src/sys/ufs/ffs/ffs_subr.c:1.52
--- src/sys/ufs/ffs/ffs_subr.c:1.51	Mon May 27 23:53:28 2019
+++ src/sys/ufs/ffs/ffs_subr.c	Tue Apr 21 11:04:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_subr.c,v 1.51 2019/05/28 03:53:28 kamil Exp $	*/
+/*	$NetBSD: ffs_subr.c,v 1.52 2020/04/21 15:04:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.51 2019/05/28 03:53:28 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.52 2020/04/21 15:04:12 christos Exp $");
 
 #include 
 
@@ -195,7 +195,7 @@ ffs_isblock(struct fs *fs, u_char *cp, i
 		mask = 0x01 << (h & 0x7);
 		return ((cp[h >> 3] & mask) == mask);
 	default:
-		panic("ffs_isblock: unknown fs_fragshift %d",
+		panic("%s: unknown fs_fragshift %d", __func__,
 		(int)fs->fs_fragshift);
 	}
 }
@@ -219,7 +219,7 @@ ffs_isfreeblock(struct fs *fs, u_char *c
 	case 0:
 		return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0);
 	default:
-		panic("ffs_isfreeblock: unknown fs_fragshift %d",
+		panic("%s: unknown fs_fragshift %d", __func__,
 		(int)fs->fs_fragshift);
 	}
 }
@@ -245,7 +245,7 @@ ffs_clrblock(struct fs *fs, u_char *cp, 
 		cp[h >> 3] &= ~(0x01 << (h & 0x7));
 		return;
 	default:
-		panic("ffs_clrblock: unknown fs_fragshift %d",
+		panic("%s: unknown fs_fragshift %d", __func__,
 		(int)fs->fs_fragshift);
 	}
 }
@@ -271,7 +271,7 @@ ffs_setblock(struct fs *fs, u_char *cp, 
 		cp[h >> 3] |= (0x01 << (h & 0x7));
 		return;
 	default:
-		panic("ffs_setblock: unknown fs_fragshift %d",
+		panic("%s: unknown fs_fragshift %d", __func__,
 		(int)fs->fs_fragshift);
 	}
 }



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

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 14:51:07 UTC 2020

Modified Files:
src/sys/arch/xen/include: xenring.h

Log Message:
add blkif_x86_{32,64}_request_indirect types


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/include/xenring.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/xen/include/xenring.h
diff -u src/sys/arch/xen/include/xenring.h:1.4 src/sys/arch/xen/include/xenring.h:1.5
--- src/sys/arch/xen/include/xenring.h:1.4	Sun Apr  7 12:23:54 2019
+++ src/sys/arch/xen/include/xenring.h	Tue Apr 21 14:51:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xenring.h,v 1.4 2019/04/07 12:23:54 bouyer Exp $ */
+/* $NetBSD: xenring.h,v 1.5 2020/04/21 14:51:06 jdolecek Exp $ */
 
 /*
  * Glue goop for xbd ring request/response protocol structures.
@@ -51,6 +51,19 @@ struct blkif_x86_32_response {
 } __packed;
 typedef struct blkif_x86_32_response blkif_x86_32_response_t;
 
+struct blkif_x86_32_request_indirect {
+uint8_toperation;/* BLKIF_OP_INDIRECT*/
+uint8_tindirect_op;  /* BLKIF_OP_{READ/WRITE}*/
+uint16_t   nr_segments;  /* number of segments   */
+uint64_t   id;		 /* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint16_t	   _pad2;
+grant_ref_tindirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+uint64_t   _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_32_request_indirect blkif_x86_32_request_indirect_t;
+
 /* amd64-type requests/responses (always used in frontends ) */
 
 struct blkif_x86_64_request {
@@ -70,6 +83,25 @@ struct blkif_x86_64_response {
 };
 typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+struct blkif_x86_64_request_indirect {
+uint8_toperation;/* BLKIF_OP_INDIRECT*/
+uint8_tindirect_op;  /* BLKIF_OP_{READ/WRITE}*/
+uint16_t   nr_segments;  /* number of segments   */
+uint32_t   _pad1;
+uint64_t   id;   /* private guest value, echoed in resp  */
+blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+blkif_vdev_t   handle;   /* only for read/write requests */
+uint16_t	   _pad2;
+grant_ref_tindirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+uint32_t   _pad3;	 /* make it 64 byte aligned */
+} __packed;
+typedef struct blkif_x86_64_request_indirect blkif_x86_64_request_indirect_t;
+
+CTASSERT(sizeof(struct blkif_x86_32_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+CTASSERT(sizeof(struct blkif_request_indirect)
+	== sizeof(struct blkif_x86_64_request_indirect));
+
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);
 



CVS commit: src/doc

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 14:29:00 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
also note the 64KB MAXPHYS for xbd(4)


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2676 src/doc/CHANGES:1.2677
--- src/doc/CHANGES:1.2676	Tue Apr 21 14:26:15 2020
+++ src/doc/CHANGES	Tue Apr 21 14:29:00 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2676 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2677 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -177,6 +177,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	umass(4): Removed obsolete ISD-ATA support [jdolecek 202000413]
 	dhcpcd(8): Import version 9.0.1 [roy 20200413]
 	xbd(4): Make the driver MP-safe [jdolecek 20200413]
+	xbd(4): Support regular 64KB MAXPHYS [jdolecek 20200415]
 	xbd(4): Support indirect segments [jdolecek 20200416]
 	dhcpcd(8): Import version 9.0.2 [roy 20200421]
 	xbdback(4): Support indirect segments [jdolecek 20200421]



CVS commit: src/doc

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 14:26:15 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
note indirect segment support for xbd(4) and xbdback(4)


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2675 src/doc/CHANGES:1.2676
--- src/doc/CHANGES:1.2675	Tue Apr 21 09:58:07 2020
+++ src/doc/CHANGES	Tue Apr 21 14:26:15 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2675 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2676 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -177,4 +177,6 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	umass(4): Removed obsolete ISD-ATA support [jdolecek 202000413]
 	dhcpcd(8): Import version 9.0.1 [roy 20200413]
 	xbd(4): Make the driver MP-safe [jdolecek 20200413]
+	xbd(4): Support indirect segments [jdolecek 20200416]
 	dhcpcd(8): Import version 9.0.2 [roy 20200421]
+	xbdback(4): Support indirect segments [jdolecek 20200421]



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

2020-04-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 21 13:57:12 UTC 2020

Modified Files:
src/external/bsd/blacklist/bin: blacklistd.8

Log Message:
PR/55193: Jose Luis Duran: Fix wrong location for the db file.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/blacklist/bin/blacklistd.8

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

Modified files:

Index: src/external/bsd/blacklist/bin/blacklistd.8
diff -u src/external/bsd/blacklist/bin/blacklistd.8:1.22 src/external/bsd/blacklist/bin/blacklistd.8:1.23
--- src/external/bsd/blacklist/bin/blacklistd.8:1.22	Mon Mar 30 04:45:09 2020
+++ src/external/bsd/blacklist/bin/blacklistd.8	Tue Apr 21 09:57:12 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: blacklistd.8,v 1.22 2020/03/30 08:45:09 wiz Exp $
+.\" $NetBSD: blacklistd.8,v 1.23 2020/04/21 13:57:12 christos Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 29, 2020
+.Dd April 21, 2020
 .Dt BLACKLISTD 8
 .Os
 .Sh NAME
@@ -189,7 +189,7 @@ The name of the configuration file to re
 The Berkeley DB file where
 .Nm
 stores its state, usually
-.Pa /var/run/blacklistd.db .
+.Pa /var/db/blacklistd.db .
 .It Fl d
 Normally,
 .Nm



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

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 13:56:18 UTC 2020

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

Log Message:
add support for indirect segments, which makes it possible to pass
up to MAXPHYS (implementation limit, interface allows more) using
single request

request using indirect segment requires 1 extra copy hypercall per
request, but saves 2 shared memory hypercalls (map_grant/unmap_grant),
so should be net performance boost due to less TLB flushing

this also effectively doubles disk queue size for xbd(4)


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/xen/xen/xbdback_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/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.85 src/sys/arch/xen/xen/xbdback_xenbus.c:1.86
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.85	Mon Apr 20 19:29:09 2020
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Tue Apr 21 13:56:18 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.85 2020/04/20 19:29:09 jdolecek Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.86 2020/04/21 13:56:18 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.85 2020/04/20 19:29:09 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.86 2020/04/21 13:56:18 jdolecek Exp $");
 
 #include 
 #include 
@@ -73,6 +73,9 @@ __KERNEL_RCSID(0, "$NetBSD: xbdback_xenb
 
 /* Need to alloc one extra page to account for possible mapping offset */
 #define VBD_VA_SIZE	(MAXPHYS + PAGE_SIZE)
+#define VBD_MAX_INDIRECT_SEGMENTS	VBD_VA_SIZE >> PAGE_SHIFT
+
+CTASSERT(XENSHM_MAX_PAGES_PER_REQUEST >= VBD_MAX_INDIRECT_SEGMENTS);
 
 struct xbdback_io;
 struct xbdback_instance;
@@ -179,8 +182,10 @@ struct xbdback_instance {
 	RING_IDX xbdi_req_prod; /* limit on request indices */
 	xbdback_cont_t xbdi_cont;
 	/* _request state: track requests fetched from ring */
-	struct xbdback_request *xbdi_req; /* if NULL, ignore following */
 	blkif_request_t xbdi_xen_req;
+	struct blkif_request_segment xbdi_seg[VBD_MAX_INDIRECT_SEGMENTS];
+	bus_dmamap_t xbdi_seg_dmamap;
+	grant_ref_t xbdi_in_gntref;
 	/* _io state: I/O associated to this instance */
 	struct xbdback_io *xbdi_io;
 	/* other state */
@@ -221,9 +226,9 @@ struct xbdback_io {
 			struct xbdback_va *xio_xv;
 			vaddr_t xio_start_offset;	/* I/O start offset */
 			/* grants to map */
-			grant_ref_t xio_gref[XENSHM_MAX_PAGES_PER_REQUEST];
+			grant_ref_t xio_gref[VBD_MAX_INDIRECT_SEGMENTS];
 			/* grants release */
-			grant_handle_t xio_gh[XENSHM_MAX_PAGES_PER_REQUEST];
+			grant_handle_t xio_gh[VBD_MAX_INDIRECT_SEGMENTS];
 			uint16_t xio_nrma; /* number of guest pages */
 		} xio_rw;
 	} u;
@@ -374,6 +379,22 @@ xbdback_xenbus_create(struct xenbus_devi
 	xbusd->xbusd_otherend_changed = xbdback_frontend_changed;
 	xbdi->xbdi_xbusd = xbusd;
 
+	if (bus_dmamap_create(xbdi->xbdi_xbusd->xbusd_dmat, PAGE_SIZE,
+	1, PAGE_SIZE, PAGE_SIZE, BUS_DMA_WAITOK | BUS_DMA_ALLOCNOW,
+	>xbdi_seg_dmamap) != 0) {
+		printf("%s: can't create dma map for indirect segments\n",
+		xbdi->xbdi_name);
+		goto fail;
+	}
+	if (bus_dmamap_load(xbdi->xbdi_xbusd->xbusd_dmat,
+	xbdi->xbdi_seg_dmamap, xbdi->xbdi_seg,
+	sizeof(xbdi->xbdi_seg), NULL, BUS_DMA_WAITOK) != 0) {
+		printf("%s: can't load dma map for indirect segments\n",
+		xbdi->xbdi_name);
+		goto fail;
+	}
+	KASSERT(xbdi->xbdi_seg_dmamap->dm_nsegs == 1);
+
 	SLIST_INIT(>xbdi_va_free);
 	for (i = 0; i < BLKIF_RING_SIZE; i++) {
 		xbdi->xbdi_va[i].xv_vaddr = uvm_km_alloc(kernel_map,
@@ -457,6 +478,9 @@ xbdback_xenbus_destroy(void *arg)
 		}
 	}
 
+	bus_dmamap_unload(xbdi->xbdi_xbusd->xbusd_dmat, xbdi->xbdi_seg_dmamap);
+	bus_dmamap_destroy(xbdi->xbdi_xbusd->xbusd_dmat, xbdi->xbdi_seg_dmamap);
+
 	mutex_destroy(>xbdi_lock);
 	cv_destroy(>xbdi_cv);
 	kmem_free(xbdi, sizeof(*xbdi));
@@ -804,6 +828,13 @@ again:
 		xbusd->xbusd_path, err);
 		goto abort;
 	}
+	err = xenbus_printf(xbt, xbusd->xbusd_path,
+	"feature-max-indirect-segments", "%u", VBD_MAX_INDIRECT_SEGMENTS);
+	if (err) {
+		printf("xbdback: failed to write %s/feature-indirect: %d\n",
+		xbusd->xbusd_path, err);
+		goto abort;
+	}
 	err = xenbus_transaction_end(xbt, 0);
 	if (err == EAGAIN)
 		goto again;
@@ -936,39 +967,35 @@ xbdback_co_main(struct xbdback_instance 
  * the ring.
  */
 static void *
-xbdback_co_main_loop(struct xbdback_instance *xbdi, void *obj) 
+xbdback_co_main_loop(struct xbdback_instance *xbdi, void *obj __unused) 
 {
-	blkif_request_t *req;
+	blkif_request_t *req, *reqn;
 	blkif_x86_32_request_t *req32;
 	blkif_x86_64_request_t *req64;
+	blkif_request_indirect_t *rin;
 
-	(void)obj;
-	req = >xbdi_xen_req;
 	if (xbdi->xbdi_ring.ring_n.req_cons != xbdi->xbdi_req_prod) {
+		req = >xbdi_xen_req;
+		memset(req, 0, 

CVS commit: src/doc

2020-04-21 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Apr 21 13:39:26 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
new openssl


To generate a diff of this commit:
cvs rdiff -u -r1.1712 -r1.1713 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.1712 src/doc/3RDPARTY:1.1713
--- src/doc/3RDPARTY:1.1712	Tue Apr 21 09:58:07 2020
+++ src/doc/3RDPARTY	Tue Apr 21 13:39:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1712 2020/04/21 09:58:07 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1713 2020/04/21 13:39:26 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1088,11 +1088,11 @@ markus is very cooperative about it):
 
 Package:	OpenSSL
 Version:	1.0.2o/1.1.1f
-Current Vers:	1.0.2t/1.1.1f
+Current Vers:	1.0.2t/1.1.1g
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/
-Date:		2020-04-05
+Date:		2020-04-21
 Mailing List:	openssl-annou...@openssl.org
 Responsible:	christos, mjf, tls, riastradh, spz
 License:	OpenSSL and SSLeay license (both BSD-like)



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

2020-04-21 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Apr 21 13:31:09 UTC 2020

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

Log Message:
adjust the condition for max indirect segments to make it clear what
is really needed (enough to map MAXPHYS + 1 page); no functional difference


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.121 src/sys/arch/xen/xen/xbd_xenbus.c:1.122
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.121	Sun Apr 19 16:45:08 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Tue Apr 21 13:31:08 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.121 2020/04/19 16:45:08 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.122 2020/04/21 13:31:08 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.121 2020/04/19 16:45:08 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.122 2020/04/21 13:31:08 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -769,7 +769,7 @@ xbd_features(struct xbd_xenbus_softc *sc
 	"feature-max-indirect-segments", , 10);
 	if (err)
 		val = 0;
-	if (val > (MAXPHYS >> PAGE_SHIFT)) {
+	if (val >= (MAXPHYS >> PAGE_SHIFT) + 1) {
 		/* We can use indirect segments, the limit is big enough */
 		sc->sc_features |= BLKIF_FEATURE_INDIRECT;
 	}



CVS commit: src/usr.sbin/rtadvd

2020-04-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Apr 21 12:23:13 UTC 2020

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

Log Message:
Remove dst variable that was only set but not used.

(This broke the build for me.)


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/usr.sbin/rtadvd/rtadvd.c

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.74 src/usr.sbin/rtadvd/rtadvd.c:1.75
--- src/usr.sbin/rtadvd/rtadvd.c:1.74	Tue Apr 21 12:21:27 2020
+++ src/usr.sbin/rtadvd/rtadvd.c	Tue Apr 21 12:23:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.74 2020/04/21 12:21:27 wiz Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.75 2020/04/21 12:23:13 wiz Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -725,7 +725,6 @@ rtadvd_input(void)
 	struct cmsghdr *cm;
 	struct in6_pktinfo *pi = NULL;
 	char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ];
-	struct in6_addr dst = in6addr_any;
 	struct rainfo *rai;
 
 	/*
@@ -750,7 +749,6 @@ rtadvd_input(void)
 		cm->cmsg_len == CMSG_LEN(sizeof(struct in6_pktinfo))) {
 			pi = (struct in6_pktinfo *)(CMSG_DATA(cm));
 			ifindex = pi->ipi6_ifindex;
-			dst = pi->ipi6_addr;
 		}
 		if (cm->cmsg_level == IPPROTO_IPV6 &&
 		cm->cmsg_type == IPV6_HOPLIMIT &&



CVS commit: src/usr.sbin/rtadvd

2020-04-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Apr 21 12:21:27 UTC 2020

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

Log Message:
Update getopt string.

Remove -M. Add -C (the code is there and documented, even if noone could
activate it...).
Sync usage with manpage.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/rtadvd/rtadvd.c

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.73 src/usr.sbin/rtadvd/rtadvd.c:1.74
--- src/usr.sbin/rtadvd/rtadvd.c:1.73	Tue Apr 21 12:16:47 2020
+++ src/usr.sbin/rtadvd/rtadvd.c	Tue Apr 21 12:21:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.73 2020/04/21 12:16:47 roy Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.74 2020/04/21 12:21:27 wiz Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
 	pid_t pid;
 
 	/* get command line options and arguments */
-#define OPTIONS "c:dDfM:p:s"
+#define OPTIONS "Cc:dDfp:s"
 	while ((ch = getopt(argc, argv, OPTIONS)) != -1) {
 #undef OPTIONS
 		switch (ch) {
@@ -214,8 +214,8 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 	if (argc == 0) {
-		fprintf(stderr, "Ysage: %s [-DdfRs] [-c conffile]"
-		" [-M ifname] [-p pidfile] interface ...\n", getprogname());
+		fprintf(stderr, "Ysage: %s [-CDdfs] [-c conffile]"
+		" [-p pidfile] interface ...\n", getprogname());
 		return EXIT_FAILURE;
 	}
 



CVS commit: src/usr.sbin/rtadvd

2020-04-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Apr 21 12:19:44 UTC 2020

Modified Files:
src/usr.sbin/rtadvd: rtadvd.8

Log Message:
Remove -M from SYNOPSIS as well.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/rtadvd/rtadvd.8

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.8
diff -u src/usr.sbin/rtadvd/rtadvd.8:1.28 src/usr.sbin/rtadvd/rtadvd.8:1.29
--- src/usr.sbin/rtadvd/rtadvd.8:1.28	Tue Apr 21 12:05:54 2020
+++ src/usr.sbin/rtadvd/rtadvd.8	Tue Apr 21 12:19:44 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtadvd.8,v 1.28 2020/04/21 12:05:54 roy Exp $
+.\"	$NetBSD: rtadvd.8,v 1.29 2020/04/21 12:19:44 wiz Exp $
 .\"	$KAME: rtadvd.8,v 1.24 2002/05/31 16:16:08 jinmei Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -38,7 +38,6 @@
 .Nm
 .Op Fl CDdfs
 .Op Fl c Ar configfile
-.Op Fl M Ar ifname
 .Op Fl p Ar pidfile
 .Ar interface ...
 .Sh DESCRIPTION



CVS commit: src/usr.sbin/rtadvd

2020-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 21 12:16:47 UTC 2020

Modified Files:
src/usr.sbin/rtadvd: config.c config.h rtadvd.c

Log Message:
rtadvd: Remove disabled use of SIOCGIFPREFIX_IN6

It's not been enabled since the functionality was added to ifconfig(8)
many many years ago.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/rtadvd/config.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/rtadvd/config.h
cvs rdiff -u -r1.72 -r1.73 src/usr.sbin/rtadvd/rtadvd.c

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

Modified files:

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.43 src/usr.sbin/rtadvd/config.c:1.44
--- src/usr.sbin/rtadvd/config.c:1.43	Mon Nov 11 13:42:49 2019
+++ src/usr.sbin/rtadvd/config.c	Tue Apr 21 12:16:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.43 2019/11/11 13:42:49 roy Exp $	*/
+/*	$NetBSD: config.c,v 1.44 2020/04/21 12:16:47 roy Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -875,49 +875,6 @@ makeentry(char *buf, size_t len, int id,
 }
 
 /*
- * Add a prefix to the list of specified interface and reconstruct
- * the outgoing packet.
- * The prefix must not be in the list.
- * XXX: other parameters of the prefix(e.g. lifetime) should be
- * able to be specified.
- */
-static void
-add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr)
-{
-	struct prefix *prefix;
-	char ntopbuf[INET6_ADDRSTRLEN];
-
-	if ((prefix = calloc(1, sizeof(*prefix))) == NULL) {
-		logit(LOG_ERR, "<%s> memory allocation failed",
-		   __func__);
-		return;		/* XXX: error or exit? */
-	}
-	prefix->prefix = ipr->ipr_prefix.sin6_addr;
-	prefix->prefixlen = ipr->ipr_plen;
-	prefix->validlifetime = ipr->ipr_vltime;
-	prefix->preflifetime = ipr->ipr_pltime;
-	prefix->onlinkflg = ipr->ipr_raf_onlink;
-	prefix->autoconfflg = ipr->ipr_raf_auto;
-	prefix->origin = PREFIX_FROM_DYNAMIC;
-
-	prefix->rainfo = rai;
-	TAILQ_INSERT_TAIL(>prefix, prefix, next);
-	rai->pfxs++;
-
-	logit(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
-	   __func__, inet_ntop(AF_INET6, >ipr_prefix.sin6_addr,
-   ntopbuf, INET6_ADDRSTRLEN),
-	   ipr->ipr_plen, rai->ifname);
-
-	/* free the previous packet */
-	free(rai->ra_data);
-	rai->ra_data = NULL;
-
-	/* reconstruct the packet */
-	make_packet(rai);
-}
-
-/*
  * Delete a prefix to the list of specified interface and reconstruct
  * the outgoing packet.
  * The prefix must be in the list.
@@ -1001,73 +958,45 @@ update_prefix(struct prefix * prefix)
 }
 
 /*
- * Try to get an in6_prefixreq contents for a prefix which matches
- * ipr->ipr_prefix and ipr->ipr_plen and belongs to
- * the interface whose name is ipr->ipr_name[].
+ * Add a prefix to the list of specified interface and reconstruct
+ * the outgoing packet.
+ * The prefix must not be in the list.
+ * XXX: other parameters of the prefix(e.g. lifetime) should be
+ * able to be specified.
  */
-static int
-init_prefix(struct in6_prefixreq *ipr)
+void
+add_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen)
 {
-#if 0
-	int s;
+	struct prefix *prefix;
+	char ntopbuf[INET6_ADDRSTRLEN];
 
-	if ((s = prog_socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-		logit(LOG_ERR, "<%s> socket: %m", __func__);
-		exit(1);
+	if ((prefix = calloc(1, sizeof(*prefix))) == NULL) {
+		logit(LOG_ERR, "<%s> memory allocation failed",
+		   __func__);
+		return;		/* XXX: error or exit? */
 	}
+	prefix->prefix = *addr;
+	prefix->prefixlen = plen;
+	prefix->validlifetime = DEF_ADVVALIDLIFETIME;
+	prefix->preflifetime = DEF_ADVPREFERREDLIFETIME;
+	prefix->onlinkflg = 1;
+	prefix->autoconfflg = 0;
+	prefix->origin = PREFIX_FROM_DYNAMIC;
 
-	if (prog_ioctl(s, SIOCGIFPREFIX_IN6, ipr) < 0) {
-		logit(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX: %m", __func__);
+	prefix->rainfo = rai;
+	TAILQ_INSERT_TAIL(>prefix, prefix, next);
+	rai->pfxs++;
 
-		ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
-		ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
-		ipr->ipr_raf_onlink = 1;
-		ipr->ipr_raf_auto = 1;
-		/* omit other field initialization */
-	}
-	else if (ipr->ipr_origin < PR_ORIG_RR) {
-		char ntopbuf[INET6_ADDRSTRLEN];
-
-		logit(LOG_WARNING, "<%s> Added prefix(%s)'s origin %d is"
-		   "lower than PR_ORIG_RR(router renumbering)."
-		   "This should not happen if I am router", __func__,
-		   inet_ntop(AF_INET6, >ipr_prefix.sin6_addr, ntopbuf,
- sizeof(ntopbuf)), ipr->ipr_origin);
-		prog_close(s);
-		return 1;
-	}
-
-	prog_close(s);
-	return 0;
-#else
-	ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
-	ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
-	ipr->ipr_raf_onlink = 1;
-	ipr->ipr_raf_auto = 1;
-	return 0;
-#endif
-}
+	logit(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
+	   __func__, inet_ntop(AF_INET6, addr, ntopbuf, INET6_ADDRSTRLEN),
+	   plen, rai->ifname);
 
-void
-make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen)

CVS commit: src/usr.sbin/rtadvd

2020-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 21 12:05:54 UTC 2020

Modified Files:
src/usr.sbin/rtadvd: Makefile rtadvd.8 rtadvd.c
Removed Files:
src/usr.sbin/rtadvd: rrenum.c rrenum.h

Log Message:
rtadvd: Remove router renumbering - it's been disable for years


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/rtadvd/Makefile
cvs rdiff -u -r1.21 -r0 src/usr.sbin/rtadvd/rrenum.c
cvs rdiff -u -r1.6 -r0 src/usr.sbin/rtadvd/rrenum.h
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/rtadvd/rtadvd.8
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/rtadvd/rtadvd.c

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

Modified files:

Index: src/usr.sbin/rtadvd/Makefile
diff -u src/usr.sbin/rtadvd/Makefile:1.23 src/usr.sbin/rtadvd/Makefile:1.24
--- src/usr.sbin/rtadvd/Makefile:1.23	Sun Oct 13 07:28:21 2019
+++ src/usr.sbin/rtadvd/Makefile	Tue Apr 21 12:05:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2019/10/13 07:28:21 mrg Exp $
+# $NetBSD: Makefile,v 1.24 2020/04/21 12:05:54 roy Exp $
 
 WARNS?=	4
 
@@ -7,7 +7,7 @@ WARNS?=	4
 USE_FORT?=	yes	# network server
 
 RUMPPRG=	rtadvd
-SRCS=		rtadvd.c rrenum.c advcap.c if.c config.c timer.c dump.c
+SRCS=		rtadvd.c advcap.c if.c config.c timer.c dump.c
 MAN=		rtadvd.8 rtadvd.conf.5
 
 CPPFLAGS+=	-DINET6

Index: src/usr.sbin/rtadvd/rtadvd.8
diff -u src/usr.sbin/rtadvd/rtadvd.8:1.27 src/usr.sbin/rtadvd/rtadvd.8:1.28
--- src/usr.sbin/rtadvd/rtadvd.8:1.27	Mon Nov 11 13:42:49 2019
+++ src/usr.sbin/rtadvd/rtadvd.8	Tue Apr 21 12:05:54 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtadvd.8,v 1.27 2019/11/11 13:42:49 roy Exp $
+.\"	$NetBSD: rtadvd.8,v 1.28 2020/04/21 12:05:54 roy Exp $
 .\"	$KAME: rtadvd.8,v 1.24 2002/05/31 16:16:08 jinmei Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 11, 2019
+.Dd April 21, 2020
 .Dt RTADVD 8
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd router advertisement daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl CDdfRs
+.Op Fl CDdfs
 .Op Fl c Ar configfile
 .Op Fl M Ar ifname
 .Op Fl p Ar pidfile
@@ -137,15 +137,6 @@ Repeating this option, adds more verbose
 .It Fl f
 Foreground mode (useful when debugging).
 Log messages will be dumped to stderr when this option is specified.
-.It Fl M Ar ifname
-Specify an interface to join the all-routers site-local multicast group.
-By default,
-.Nm
-tries to join the first advertising interface appearing on the command
-line.
-This option has meaning only with the
-.Fl R
-option, which enables routing renumbering protocol support.
 .\".It Fl m
 .\"Enables mobile IPv6 support.
 .\"This changes the content of router advertisement option, as well as
@@ -157,17 +148,6 @@ for the PID file.
 By default,
 .Pa /var/run/rtadvd.pid
 is used.
-.It Fl R
-Accept router renumbering requests.
-If you enable it, an
-.Xr ipsec 4
-setup is suggested for security reasons.
-.\"On KAME-based systems,
-.\".Xr rrenumd 8
-.\"generates router renumbering request packets.
-This option is currently disabled, and is ignored by
-.Nm
-with a warning message.
 .It Fl s
 Do not add or delete prefixes dynamically.
 Only statically configured prefixes, if any, will be advertised.

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.71 src/usr.sbin/rtadvd/rtadvd.c:1.72
--- src/usr.sbin/rtadvd/rtadvd.c:1.71	Mon Nov 11 13:42:49 2019
+++ src/usr.sbin/rtadvd/rtadvd.c	Tue Apr 21 12:05:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.71 2019/11/11 13:42:49 roy Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.72 2020/04/21 12:05:54 roy Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -62,7 +62,6 @@
 #include 
 
 #include "rtadvd.h"
-#include "rrenum.h"
 #include "advcap.h"
 #include "timer.h"
 #include "if.h"
@@ -85,10 +84,8 @@ struct iovec rcviov[2];
 struct iovec sndiov[2];
 struct sockaddr_in6 rcvfrom;
 static const char *dumpfilename = "/var/run/rtadvd.dump"; /* XXX configurable */
-static char *mcastif;
 int sock;
 int rtsock = -1;
-int accept_rr = 0;
 int Cflag = 0, dflag = 0, sflag = 0, Dflag;
 
 static char **if_argv;
@@ -187,7 +184,7 @@ main(int argc, char *argv[])
 	pid_t pid;
 
 	/* get command line options and arguments */
-#define OPTIONS "c:dDfM:p:Rs"
+#define OPTIONS "c:dDfM:p:s"
 	while ((ch = getopt(argc, argv, OPTIONS)) != -1) {
 #undef OPTIONS
 		switch (ch) {
@@ -206,18 +203,9 @@ main(int argc, char *argv[])
 		case 'f':
 			fflag = 1;
 			break;
-		case 'M':
-			mcastif = optarg;
-			break;
 		case 'p':
 			pidfilepath = optarg;
 			break;
-		case 'R':
-			fprintf(stderr, "rtadvd: "
-"the -R option is currently ignored.\n");
-			/* accept_rr = 1; */
-			/* run anyway... */
-			break;
 		case 's':
 			sflag = 1;
 			break;
@@ -889,16 +877,6 @@ rtadvd_input(void)
 		}
 		ra_input(i, (struct nd_router_advert *)icp, pi, );
 		break;
-	case ICMP6_ROUTER_RENUMBERING:
-		

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

2020-04-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 21 11:35:02 UTC 2020

Modified Files:
src/sys/arch/arm/include: asm.h

Log Message:
LLVM is a bit stricter and wants the ARM variant of %progbits.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/include/asm.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/include/asm.h
diff -u src/sys/arch/arm/include/asm.h:1.32 src/sys/arch/arm/include/asm.h:1.33
--- src/sys/arch/arm/include/asm.h:1.32	Fri Apr 17 14:19:43 2020
+++ src/sys/arch/arm/include/asm.h	Tue Apr 21 11:35:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.32 2020/04/17 14:19:43 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.33 2020/04/21 11:35:02 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -221,7 +221,7 @@
 #define	PIC_SYM(x,y)	x
 #endif	/* __PIC__ */
 
-#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+#define RCSID(x)	.pushsection ".ident","MS",%progbits,1;		\
 			.asciz x;	\
 			.popsection
 



CVS commit: src/doc

2020-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 21 09:58:07 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note newer dhcpcd


To generate a diff of this commit:
cvs rdiff -u -r1.1711 -r1.1712 src/doc/3RDPARTY
cvs rdiff -u -r1.2674 -r1.2675 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.1711 src/doc/3RDPARTY:1.1712
--- src/doc/3RDPARTY:1.1711	Tue Apr 21 09:20:17 2020
+++ src/doc/3RDPARTY	Tue Apr 21 09:58:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1711 2020/04/21 09:20:17 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1712 2020/04/21 09:58:07 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	9.0.1
-Current Vers:	9.0.1
+Version:	9.0.2
+Current Vers:	9.0.2
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-04-13
+Date:		2020-04-21
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2674 src/doc/CHANGES:1.2675
--- src/doc/CHANGES:1.2674	Tue Apr 14 08:00:22 2020
+++ src/doc/CHANGES	Tue Apr 21 09:58:07 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2674 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2675 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -177,3 +177,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	umass(4): Removed obsolete ISD-ATA support [jdolecek 202000413]
 	dhcpcd(8): Import version 9.0.1 [roy 20200413]
 	xbd(4): Make the driver MP-safe [jdolecek 20200413]
+	dhcpcd(8): Import version 9.0.2 [roy 20200421]



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

2020-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 21 09:55:33 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
if-options.c ipv6.c ipv6nd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.34 -r1.35 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/src/if-bsd.c \
src/external/bsd/dhcpcd/dist/src/ipv6nd.c
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/dhcpcd/dist/src/ipv6.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.35 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.36
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.35	Mon Apr 13 15:46:26 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Tue Apr 21 09:55:33 2020
@@ -3494,8 +3494,9 @@ dhcp_packet(struct interface *ifp, uint8
 			__func__, ifp->name);
 			return;
 		}
-		data += fl;
 		len -= fl;
+		/* Move the data to avoid alignment errors. */
+		memmove(data, data + fl, len);
 	}
 
 	/* Validate filter. */
@@ -3608,15 +3609,18 @@ dhcp_readudp(struct dhcpcd_ctx *ctx, str
 		.iov_base = buf,
 		.iov_len = sizeof(buf),
 	};
+	union {
+		struct cmsghdr hdr;
 #ifdef IP_RECVIF
-	unsigned char ctl[CMSG_SPACE(sizeof(struct sockaddr_dl))] = { 0 };
+		uint8_t buf[CMSG_SPACE(sizeof(struct sockaddr_dl))];
 #else
-	unsigned char ctl[CMSG_SPACE(sizeof(struct in_pktinfo))] = { 0 };
+		uint8_t buf[CMSG_SPACE(sizeof(struct in_pktinfo))];
 #endif
+	} cmsgbuf = { .buf = { 0 } };
 	struct msghdr msg = {
 	.msg_name = , .msg_namelen = sizeof(from),
 	.msg_iov = , .msg_iovlen = 1,
-	.msg_control = ctl, .msg_controllen = sizeof(ctl),
+	.msg_control = buf, .msg_controllen = sizeof(cmsgbuf.buf),
 	};
 	int s;
 	ssize_t bytes;

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.17 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.18
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.17	Mon Apr 13 15:46:26 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Tue Apr 21 09:55:33 2020
@@ -1585,6 +1585,7 @@ dhcp6_startdiscover(void *arg)
 {
 	struct interface *ifp;
 	struct dhcp6_state *state;
+	int llevel;
 
 	ifp = arg;
 	state = D6_STATE(ifp);
@@ -1592,7 +1593,11 @@ dhcp6_startdiscover(void *arg)
 	if (state->reason == NULL || strcmp(state->reason, "TIMEOUT6") != 0)
 		dhcp6_delete_delegates(ifp);
 #endif
-	loginfox("%s: soliciting a DHCPv6 lease", ifp->name);
+	if (state->new == NULL && !state->failed)
+		llevel = LOG_INFO;
+	else
+		llevel = LOG_DEBUG;
+	logmessage(llevel, "%s: soliciting a DHCPv6 lease", ifp->name);
 	state->state = DH6S_DISCOVER;
 	state->RTC = 0;
 	state->IMD = SOL_MAX_DELAY;
@@ -1616,11 +1621,15 @@ dhcp6_startinform(void *arg)
 {
 	struct interface *ifp;
 	struct dhcp6_state *state;
+	int llevel;
 
 	ifp = arg;
 	state = D6_STATE(ifp);
-	if (state->new == NULL || ifp->options->options & DHCPCD_DEBUG)
-		loginfox("%s: requesting DHCPv6 information", ifp->name);
+	if (state->new == NULL && !state->failed)
+		llevel = LOG_INFO;
+	else
+		llevel = LOG_DEBUG;
+	logmessage(llevel, "%s: requesting DHCPv6 information", ifp->name);
 	state->state = DH6S_INFORM;
 	state->RTC = 0;
 	state->IMD = INF_MAX_DELAY;
@@ -1677,6 +1686,8 @@ dhcp6_fail(struct interface* ifp)
 {
 	struct dhcp6_state *state = D6_STATE(ifp);
 
+	state->failed = true;
+
 	/* RFC3315 18.1.2 says that prior addresses SHOULD be used on failure.
 	 * RFC2131 3.2.3 says that MAY chose to use the prior address.
 	 * Because dhcpcd was written first for RFC2131, we have the LASTLEASE
@@ -1711,33 +1722,43 @@ dhcp6_fail(struct interface* ifp)
 	}
 }
 
+static int
+dhcp6_failloglevel(struct interface *ifp)
+{
+	const struct dhcp6_state *state = D6_CSTATE(ifp);
+
+	return state->failed ? LOG_DEBUG : LOG_ERR;
+}
+
 static void
 dhcp6_failconfirm(void *arg)
 {
-	struct interface *ifp;
+	struct interface *ifp = arg;
+	int llevel = dhcp6_failloglevel(ifp);
 
-	ifp = arg;
-	logerrx("%s: failed to confirm prior address", ifp->name);
+	logmessage(llevel, "%s: failed to confirm prior DHCPv6 address",
+	ifp->name);
 	dhcp6_fail(ifp);
 }
 
 static void
 dhcp6_failrequest(void *arg)
 {
-	struct interface *ifp;
+	struct interface *ifp = arg;
+	int llevel = dhcp6_failloglevel(ifp);
 
-	ifp = arg;
-	logerrx("%s: failed to request address", ifp->name);
+	logmessage(llevel, "%s: failed to request DHCPv6 address", ifp->name);
 	dhcp6_fail(ifp);
 }
 
 static void
 dhcp6_failinform(void *arg)
 {
-	struct interface *ifp;
+	struct interface *ifp = arg;
+	int llevel = dhcp6_failloglevel(ifp);
 
-	ifp = arg;
-	logerrx("%s: failed to request 

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

2020-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 21 09:54:18 UTC 2020

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

Log Message:
Update to dhcpcd-9.0.2 with the following changes:
 * Control sockets are not opened in test mode
 * privsep: no longer aborts if protocol not available
 * inet6: Don't regen temporary addresses without a state
 * inet6: Reduce RA log spam
 * dhcp6: Don't log when things consitently fail
 * inet6: Add temporary directive to slaac option [1]
 * Ensure current interface flags persist when setting a flag
 * DHCP via BPF is now aligned correctly
 * CMSG buffers are now aligned correctly
 * hostnames are no longer clobbered when being forced and a RA is recieved

[1] dhcpcd no longer looks at any possible kernel settings when deciding to
manage IPv6 temporary addresses or not. You now instruct dhcpcd to do this 
in dhcpcd.conf. Playing whack-a-mole with various kernel knobs wasn't fun 
and some OS's have or are removing RA and thus temporary address managemnt
from the kernel so said knobs are no longer there.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_0_2

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
C src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

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

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



CVS commit: src/doc

2020-04-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Apr 21 09:20:17 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
postfix-3.5.1 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1710 -r1.1711 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.1710 src/doc/3RDPARTY:1.1711
--- src/doc/3RDPARTY:1.1710	Mon Apr 13 15:48:55 2020
+++ src/doc/3RDPARTY	Tue Apr 21 09:20:17 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1710 2020/04/13 15:48:55 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1711 2020/04/21 09:20:17 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1197,11 +1197,11 @@ now to do a new import.
 
 Package:	Postfix
 Version:	3.5.0
-Current Vers:	3.5.0
+Current Vers:	3.5.1
 Maintainer:	Wietse Venema 
 Archive Site:
 Home Page:	http://www.postfix.org/
-Date: 		2020-03-18
+Date: 		2020-04-21
 Mailing List:	postfix-us...@postfix.org
 Responsible:	christos
 License:	IBM Public License. See also src/external/ibm-public/postfix/dist.



CVS commit: src/sys/arch/hp300/hp300

2020-04-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 21 09:02:33 UTC 2020

Modified Files:
src/sys/arch/hp300/hp300: machdep.c

Log Message:
Fix garbages in dmesg caused by uninitialized variables slipped in r1.228.

Noticed in HP9000/362 dmesg:
 https://dmesgd.nycbug.org/index.cgi?do=view=5459

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/hp300/hp300/machdep.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.232 src/sys/arch/hp300/hp300/machdep.c:1.233
--- src/sys/arch/hp300/hp300/machdep.c:1.232	Tue Dec 31 13:07:10 2019
+++ src/sys/arch/hp300/hp300/machdep.c	Tue Apr 21 09:02:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -433,6 +433,7 @@ identifycpu(void)
 	/*
 	 * ...and the FPU type.
 	 */
+	fpu[0] = '\0';
 	switch (fputype) {
 	case FPU_68040:
 		strlcpy(fpu, "+FPU", sizeof(fpu));
@@ -458,6 +459,7 @@ identifycpu(void)
 	/*
 	 * ...and finally, the cache type.
 	 */
+	cache[0] = '\0';
 	if (cputype == CPU_68040)
 		snprintf(cache, sizeof(cache),
 		", 4k on-chip physical I/D caches");



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

2020-04-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 21 07:08:12 UTC 2020

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

Log Message:
 Print "Hz".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/identcpu_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/arch/x86/x86/identcpu_subr.c
diff -u src/sys/arch/x86/x86/identcpu_subr.c:1.1 src/sys/arch/x86/x86/identcpu_subr.c:1.2
--- src/sys/arch/x86/x86/identcpu_subr.c:1.1	Tue Apr 21 02:56:37 2020
+++ src/sys/arch/x86/x86/identcpu_subr.c	Tue Apr 21 07:08:12 2020
@@ -33,7 +33,7 @@
  * See src/usr.sbin/cpuctl/{Makefile, arch/i386.c}).
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.1 2020/04/21 02:56:37 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu_subr.c,v 1.2 2020/04/21 07:08:12 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "lapic.h"
@@ -110,7 +110,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci)
 			x86_cpuid(0x16, descs);
 			if (descs[0] != 0) {
 aprint_verbose_dev(ci->ci_dev,
-"CPU base freq %" PRIu64 "\n",
+"CPU base freq %" PRIu64 " Hz\n",
 (uint64_t)descs[0] * 100);
 
 /*
@@ -125,7 +125,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci)
 			}
 			if (descs[1] != 0) {
 aprint_verbose_dev(ci->ci_dev,
-"CPU max freq %" PRIu64 "\n",
+"CPU max freq %" PRIu64 " Hz\n",
 (uint64_t)descs[1] * 100);
 			}
 		}
@@ -139,7 +139,7 @@ cpu_tsc_freq_cpuid(struct cpu_info *ci)
 #endif
 	}
 	if (freq != 0)
-		aprint_verbose_dev(ci->ci_dev, "TSC freq %" PRIu64 "\n",
+		aprint_verbose_dev(ci->ci_dev, "TSC freq %" PRIu64 " Hz\n",
 		freq);
 
 	return freq;



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

2020-04-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr 21 06:45:16 UTC 2020

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

Log Message:
There is no fast spoon^Wfast path in pmap_clearbit.

PR port-arm/55186: tests crash arm pmap

Tested by martin@


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.411 src/sys/arch/arm/arm32/pmap.c:1.412
--- src/sys/arch/arm/arm32/pmap.c:1.411	Sun Apr 19 21:24:36 2020
+++ src/sys/arch/arm/arm32/pmap.c	Tue Apr 21 06:45:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.411 2020/04/19 21:24:36 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.412 2020/04/21 06:45:16 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.411 2020/04/19 21:24:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.412 2020/04/21 06:45:16 skrll Exp $");
 
 #include 
 #include 
@@ -2374,14 +2374,6 @@ pmap_clearbit(struct vm_page_md *md, pad
 #endif
 
 		/*
-		 * Anything to do?
-		 */
-		if ((oflags & maskbits) == 0 && execbits == 0) {
-			pv = SLIST_NEXT(pv, pv_link);
-			continue;
-		}
-
-		/*
 		 * Try to get a hold on the pmap's lock.  We must do this
 		 * while still holding the page locked, to know that the
 		 * page is still associated with the pmap and the mapping is