CVS commit: src/sys/external/bsd

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 16 07:29:48 UTC 2020

Added Files:
src/sys/external/bsd/common/include/linux: log2.h
Removed Files:
src/sys/external/bsd/drm2/include/linux: log2.h

Log Message:
Move another file from drm2 to common for .


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/log2.h
cvs rdiff -u -r1.5 -r0 src/sys/external/bsd/drm2/include/linux/log2.h

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

Added files:

Index: src/sys/external/bsd/common/include/linux/log2.h
diff -u /dev/null src/sys/external/bsd/common/include/linux/log2.h:1.1
--- /dev/null	Sun Feb 16 07:29:48 2020
+++ src/sys/external/bsd/common/include/linux/log2.h	Sun Feb 16 07:29:48 2020
@@ -0,0 +1,76 @@
+/*	$NetBSD: log2.h,v 1.1 2020/02/16 07:29:48 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_LOG2_H_
+#define _LINUX_LOG2_H_
+
+#include 
+#include 
+
+#include 
+
+static inline bool
+is_power_of_2(unsigned long x)
+{
+	return ((x != 0) && (((x - 1) & x) == 0));
+}
+
+static inline unsigned long
+roundup_pow_of_two(unsigned long n)
+{
+	unsigned i;
+
+	if (n == 0)
+		return 1;
+
+	n -= 1;
+	for (i = 1; i < CHAR_BIT * sizeof n; i <<= 1)
+		n |= (n >> i);
+
+	return (n + 1);
+}
+
+static inline unsigned long
+rounddown_pow_of_two(unsigned long n)
+{
+
+	/* XXX fls64 is not fls_ulong, but it'll do for now.  */
+	return (1UL << (fls64(n) - 1));
+}
+
+static inline unsigned
+order_base_2(unsigned long n)
+{
+
+	return ilog2(roundup_pow_of_two(n));
+}
+
+#endif  /* _LINUX_LOG2_H_ */



CVS commit: src/sys/external/bsd

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 16 07:29:48 UTC 2020

Added Files:
src/sys/external/bsd/common/include/linux: log2.h
Removed Files:
src/sys/external/bsd/drm2/include/linux: log2.h

Log Message:
Move another file from drm2 to common for .


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/log2.h
cvs rdiff -u -r1.5 -r0 src/sys/external/bsd/drm2/include/linux/log2.h

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



CVS commit: src/sys/external/bsd

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 16 06:50:14 UTC 2020

Added Files:
src/sys/external/bsd/common/include/asm: byteorder.h
Removed Files:
src/sys/external/bsd/drm2/include/asm: byteorder.h

Log Message:
Missed a drm2 -> common move.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/asm/byteorder.h
cvs rdiff -u -r1.3 -r0 src/sys/external/bsd/drm2/include/asm/byteorder.h

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



CVS commit: src/sys/external/bsd

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 16 06:50:14 UTC 2020

Added Files:
src/sys/external/bsd/common/include/asm: byteorder.h
Removed Files:
src/sys/external/bsd/drm2/include/asm: byteorder.h

Log Message:
Missed a drm2 -> common move.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/asm/byteorder.h
cvs rdiff -u -r1.3 -r0 src/sys/external/bsd/drm2/include/asm/byteorder.h

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

Added files:

Index: src/sys/external/bsd/common/include/asm/byteorder.h
diff -u /dev/null src/sys/external/bsd/common/include/asm/byteorder.h:1.1
--- /dev/null	Sun Feb 16 06:50:14 2020
+++ src/sys/external/bsd/common/include/asm/byteorder.h	Sun Feb 16 06:50:14 2020
@@ -0,0 +1,58 @@
+/*	$NetBSD: byteorder.h,v 1.1 2020/02/16 06:50:14 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ASM_BYTEORDER_H_
+#define _ASM_BYTEORDER_H_
+
+#include 
+
+#define	cpu_to_le16	htole16
+#define	cpu_to_le32	htole32
+#define	cpu_to_le64	htole64
+#define	cpu_to_be16	htobe16
+#define	cpu_to_be32	htobe32
+#define	cpu_to_be64	htobe64
+
+#define	le16_to_cpu	le16toh
+#define	le32_to_cpu	le32toh
+#define	le64_to_cpu	le64toh
+#define	be16_to_cpu	be16toh
+#define	be32_to_cpu	be32toh
+#define	be64_to_cpu	be64toh
+
+#define	be16_to_cpup	be16dec
+#define	be32_to_cpup	be32dec
+#define	be64_to_cpup	be64dec
+#define	le16_to_cpup	le16dec
+#define	le32_to_cpup	le32dec
+#define	le64_to_cpup	le64dec
+
+#endif	/* _ASM_BYTEORDER_H_ */



CVS commit: src/lib/libpthread

2020-02-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 15 23:59:30 UTC 2020

Modified Files:
src/lib/libpthread: pthread.c pthread_int.h pthread_mutex.c
pthread_tsd.c

Log Message:
Enhance the pthread(3) + malloc(3) init model

Separate the pthread_atfork(3) call from pthread_tsd_init()
and move it into a distinct function.

Call inside pthread__init() late TSD initialization route, just after
"pthread_atfork(NULL, NULL, pthread__fork_callback);".

Document that malloc(3) initialization is now controlled again and called
during the first pthread_atfork(3) call.

Remove #if 0 code from pthread_mutex.c as we no longer initialize malloc
prematurely.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.101 -r1.102 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.74 -r1.75 src/lib/libpthread/pthread_mutex.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libpthread/pthread_tsd.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/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.164 src/lib/libpthread/pthread.c:1.165
--- src/lib/libpthread/pthread.c:1.164	Sat Feb  8 17:06:03 2020
+++ src/lib/libpthread/pthread.c	Sat Feb 15 23:59:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.164 2020/02/08 17:06:03 kamil Exp $	*/
+/*	$NetBSD: pthread.c,v 1.165 2020/02/15 23:59:30 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.164 2020/02/08 17:06:03 kamil Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.165 2020/02/15 23:59:30 kamil Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -181,7 +181,7 @@ pthread__init(void)
 	 * while pthread_keys descriptors are not
 	 * yet allocated.
 	 */
-	pthread__main = pthread_tsd_init(&__pthread_st_size);
+	pthread__main = pthread_tsd_earlyinit(&__pthread_st_size);
 	if (pthread__main == NULL)
 		err(EXIT_FAILURE, "Cannot allocate pthread storage");
 
@@ -257,8 +257,16 @@ pthread__init(void)
 		}
 	}
 
-	/* Tell libc that we're here and it should role-play accordingly. */
+	/*
+	 * Tell libc that we're here and it should role-play accordingly.
+	 *
+	 * pthread_atfork(3) calls malloc(3) and initializes the system malloc.
+	 */
 	pthread_atfork(NULL, NULL, pthread__fork_callback);
+
+	/* Requires functional malloc(3). */
+	pthread_tsd_init();
+
 	__isthreaded = 1;
 }
 

Index: src/lib/libpthread/pthread_int.h
diff -u src/lib/libpthread/pthread_int.h:1.101 src/lib/libpthread/pthread_int.h:1.102
--- src/lib/libpthread/pthread_int.h:1.101	Wed Feb  5 11:05:10 2020
+++ src/lib/libpthread/pthread_int.h	Sat Feb 15 23:59:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_int.h,v 1.101 2020/02/05 11:05:10 kamil Exp $	*/
+/*	$NetBSD: pthread_int.h,v 1.102 2020/02/15 23:59:30 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -294,7 +294,8 @@ pthread__self(void)
 	} \
 } while (/*CONSTCOND*/0)
 
-void 	*pthread_tsd_init(size_t *) PTHREAD_HIDE;
+void 	*pthread_tsd_earlyinit(size_t *) PTHREAD_HIDE;
+void 	pthread_tsd_init(void) PTHREAD_HIDE;
 void	pthread__destroy_tsd(pthread_t) PTHREAD_HIDE;
 void	pthread__copy_tsd(pthread_t) PTHREAD_HIDE;
 

Index: src/lib/libpthread/pthread_mutex.c
diff -u src/lib/libpthread/pthread_mutex.c:1.74 src/lib/libpthread/pthread_mutex.c:1.75
--- src/lib/libpthread/pthread_mutex.c:1.74	Sat Feb  1 18:14:16 2020
+++ src/lib/libpthread/pthread_mutex.c	Sat Feb 15 23:59:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_mutex.c,v 1.74 2020/02/01 18:14:16 kamil Exp $	*/
+/*	$NetBSD: pthread_mutex.c,v 1.75 2020/02/15 23:59:30 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_mutex.c,v 1.74 2020/02/01 18:14:16 kamil Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.75 2020/02/15 23:59:30 kamil Exp $");
 
 #include 
 #include 
@@ -122,14 +122,12 @@ pthread_mutex_init(pthread_mutex_t *ptm,
 {
 	uintptr_t type, proto, val, ceil;
 
-#if 0
 	/*
 	 * Always initialize the mutex structure, maybe be used later
 	 * and the cost should be minimal.
 	 */
 	if (__predict_false(__uselibcstub))
 		return __libc_mutex_init_stub(ptm, attr);
-#endif
 
 	pthread__error(EINVAL, "Invalid mutes attribute",
 	attr == NULL || attr->ptma_magic == _PT_MUTEXATTR_MAGIC);
@@ -619,10 +617,9 @@ pthread__mutex_wakeup(pthread_t self, pt
 int
 pthread_mutexattr_init(pthread_mutexattr_t *attr)
 {
-#if 0
+
 	if (__predict_false(__uselibcstub))
 		return __libc_mutexattr_init_stub(attr);
-#endif
 
 	attr->ptma_magic = _PT_MUTEXATTR_MAGIC;
 	attr->ptma_private = (void *)PTHREAD_MUTEX_DEFAULT;

Index: src/lib/libpthread/pthread_tsd.c
diff -u src/lib/libpthread/pthread_tsd.c:1.18 src/lib/libpthread/pthread_tsd.c:1.19
--- src/lib/libpthread/pthread_tsd.c:1.18	Wed Dec 25 00:44:45 2019
+++ 

CVS commit: src/lib/libpthread

2020-02-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 15 23:59:30 UTC 2020

Modified Files:
src/lib/libpthread: pthread.c pthread_int.h pthread_mutex.c
pthread_tsd.c

Log Message:
Enhance the pthread(3) + malloc(3) init model

Separate the pthread_atfork(3) call from pthread_tsd_init()
and move it into a distinct function.

Call inside pthread__init() late TSD initialization route, just after
"pthread_atfork(NULL, NULL, pthread__fork_callback);".

Document that malloc(3) initialization is now controlled again and called
during the first pthread_atfork(3) call.

Remove #if 0 code from pthread_mutex.c as we no longer initialize malloc
prematurely.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.101 -r1.102 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.74 -r1.75 src/lib/libpthread/pthread_mutex.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libpthread/pthread_tsd.c

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



CVS commit: src/sys/dev/i2c

2020-02-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 15 23:42:01 UTC 2020

Modified Files:
src/sys/dev/i2c: gttwsi_core.c

Log Message:
Interrupt-driven I/O seems to completely go off the rails, at least
on AllWinner implementations of this controller, so force polled mode
for now.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/i2c/gttwsi_core.c

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

Modified files:

Index: src/sys/dev/i2c/gttwsi_core.c
diff -u src/sys/dev/i2c/gttwsi_core.c:1.15 src/sys/dev/i2c/gttwsi_core.c:1.16
--- src/sys/dev/i2c/gttwsi_core.c:1.15	Mon Jan 13 12:53:46 2020
+++ src/sys/dev/i2c/gttwsi_core.c	Sat Feb 15 23:42:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gttwsi_core.c,v 1.15 2020/01/13 12:53:46 thorpej Exp $	*/
+/*	$NetBSD: gttwsi_core.c,v 1.16 2020/02/15 23:42:01 thorpej Exp $	*/
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.15 2020/01/13 12:53:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi_core.c,v 1.16 2020/02/15 23:42:01 thorpej Exp $");
 #include "locators.h"
 
 #include 
@@ -317,6 +317,13 @@ gttwsi_wait(struct gttwsi_softc *sc, uin
 	uint32_t status;
 	int timo, error = 0;
 
+	/*
+	 * XXX Interrupt-driven mode seems to be horribly broken,
+	 * XXX at least on AllWinner implementations.  Force polled
+	 * XXX mode for now.
+	 */
+	flags |= I2C_F_POLL;
+
 	DELAY(5);
 	if (!(flags & I2C_F_POLL))
 		control |= CONTROL_INTEN;



CVS commit: src/sys/dev/i2c

2020-02-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 15 23:42:01 UTC 2020

Modified Files:
src/sys/dev/i2c: gttwsi_core.c

Log Message:
Interrupt-driven I/O seems to completely go off the rails, at least
on AllWinner implementations of this controller, so force polled mode
for now.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/i2c/gttwsi_core.c

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



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

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 23:19:37 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/rand: rand_unix.c

Log Message:
Open /dev/urandom with O_CLOEXEC.

Let's avoid bleeding file descriptors into our clients' children,
shall we?

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.13 src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.14
--- src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.13	Thu Jan 23 02:54:55 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c	Sat Feb 15 23:19:37 2020
@@ -479,7 +479,7 @@ static int get_random_device(size_t n)
 return rd->fd;
 
 /* open the random device ... */
-if ((rd->fd = open(random_device_paths[n], O_RDONLY)) == -1)
+if ((rd->fd = open(random_device_paths[n], O_RDONLY|O_CLOEXEC)) == -1)
 return rd->fd;
 
 /* ... and cache its relevant stat(2) data */



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

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 23:19:37 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/rand: rand_unix.c

Log Message:
Open /dev/urandom with O_CLOEXEC.

Let's avoid bleeding file descriptors into our clients' children,
shall we?

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c

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



CVS commit: src/lib/libdm

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 22:55:22 UTC 2020

Modified Files:
src/lib/libdm: libdm_ioctl.c

Log Message:
Let's not write temporary files to fixed paths in /tmp, shall we?

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libdm/libdm_ioctl.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/libdm/libdm_ioctl.c
diff -u src/lib/libdm/libdm_ioctl.c:1.3 src/lib/libdm/libdm_ioctl.c:1.4
--- src/lib/libdm/libdm_ioctl.c:1.3	Thu Dec 27 14:05:54 2018
+++ src/lib/libdm/libdm_ioctl.c	Sat Feb 15 22:55:22 2020
@@ -171,14 +171,12 @@ libdm_task_run(libdm_task_t libdm_task)
 	}
 	dict = prop_dictionary_internalize(prefp.pref_plist);
 #else
-	prop_dictionary_externalize_to_file(libdm_task->ldm_task, "/tmp/libdm_in");
 	error = prop_dictionary_sendrecv_ioctl(libdm_task->ldm_task,
 	libdm_control_fd, NETBSD_DM_IOCTL, );
 	if ( error != 0) {
 		libdm_control_close(libdm_control_fd);
 		return error;
 	}
-	prop_dictionary_externalize_to_file(dict, "/tmp/libdm_out");
 #endif
 
 	libdm_control_close(libdm_control_fd);



CVS commit: src/lib/libdm

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 22:55:22 UTC 2020

Modified Files:
src/lib/libdm: libdm_ioctl.c

Log Message:
Let's not write temporary files to fixed paths in /tmp, shall we?

XXX pullup


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

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



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 19:03:15 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
Teach zfs to revoke vnodes the usual way.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.57 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.58
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.57	Thu Feb 13 16:53:32 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Sat Feb 15 19:03:15 2020
@@ -6309,6 +6309,7 @@ const struct vnodeopv_entry_desc zfs_vno
 	{ _ioctl_desc,		zfs_netbsd_ioctl },
 	{ _poll_desc,		genfs_poll },
 	{ _kqfilter_desc,		genfs_kqfilter },
+	{ _revoke_desc,		genfs_revoke },
 	{ _fsync_desc,		zfs_netbsd_fsync },
 	{ _remove_desc,		zfs_netbsd_remove },
 	{ _link_desc,		zfs_netbsd_link },
@@ -6353,6 +6354,7 @@ const struct vnodeopv_entry_desc zfs_spe
 	{ _ioctl_desc,		spec_ioctl },
 	{ _poll_desc,		spec_poll },
 	{ _kqfilter_desc,		spec_kqfilter },
+	{ _revoke_desc,		spec_revoke },
 	{ _fsync_desc,		zfs_netbsd_fsync },
 	{ _remove_desc,		spec_remove },
 	{ _link_desc,		spec_link },
@@ -6397,6 +6399,7 @@ const struct vnodeopv_entry_desc zfs_fif
 	{ _ioctl_desc,		vn_fifo_bypass },
 	{ _poll_desc,		vn_fifo_bypass },
 	{ _kqfilter_desc,		vn_fifo_bypass },
+	{ _revoke_desc,		vn_fifo_bypass },
 	{ _fsync_desc,		zfs_netbsd_fsync },
 	{ _remove_desc,		vn_fifo_bypass },
 	{ _link_desc,		vn_fifo_bypass },



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 19:03:15 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
Teach zfs to revoke vnodes the usual way.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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



CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 18:12:15 UTC 2020

Modified Files:
src/sys/arch/vax/vax: pmap.c
src/sys/ddb: db_proc.c
src/sys/kern: init_main.c kern_exit.c kern_idle.c kern_lwp.c
kern_resource.c kern_sleepq.c kern_softint.c kern_synch.c
src/sys/rump/librump/rumpkern: lwproc.c scheduler.c
src/sys/sys: lwp.h

Log Message:
- Move the LW_RUNNING flag back into l_pflag: updating l_flag without lock
  in softint_dispatch() is risky.  May help with the "softint screwup"
  panic.

- Correct the memory barriers around zombies switching into oblivion.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.9 -r1.10 src/sys/ddb/db_proc.c
cvs rdiff -u -r1.519 -r1.520 src/sys/kern/init_main.c
cvs rdiff -u -r1.282 -r1.283 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_idle.c
cvs rdiff -u -r1.226 -r1.227 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/kern_resource.c
cvs rdiff -u -r1.60 -r1.61 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/kern_softint.c
cvs rdiff -u -r1.338 -r1.339 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/librump/rumpkern/lwproc.c
cvs rdiff -u -r1.49 -r1.50 src/sys/rump/librump/rumpkern/scheduler.c
cvs rdiff -u -r1.201 -r1.202 src/sys/sys/lwp.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/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.188 src/sys/arch/vax/vax/pmap.c:1.189
--- src/sys/arch/vax/vax/pmap.c:1.188	Wed Jan  8 17:38:42 2020
+++ src/sys/arch/vax/vax/pmap.c	Sat Feb 15 18:12:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188 2020/01/08 17:38:42 ad Exp $	   */
+/*	$NetBSD: pmap.c,v 1.189 2020/02/15 18:12:14 ad Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.188 2020/01/08 17:38:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.189 2020/02/15 18:12:14 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -699,7 +699,7 @@ pmap_vax_swappable(struct lwp *l, struct
 		return false;
 	if (l->l_proc->p_vmspace->vm_map.pmap == pm)
 		return false;
-	if ((l->l_flag & LW_RUNNING) != 0)
+	if ((l->l_pflag & LP_RUNNING) != 0)
 		return false;
 	if (l->l_class != SCHED_OTHER)
 		return false;

Index: src/sys/ddb/db_proc.c
diff -u src/sys/ddb/db_proc.c:1.9 src/sys/ddb/db_proc.c:1.10
--- src/sys/ddb/db_proc.c:1.9	Wed Jan  8 17:38:42 2020
+++ src/sys/ddb/db_proc.c	Sat Feb 15 18:12:14 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: db_proc.c,v 1.9 2020/01/08 17:38:42 ad Exp $	*/
+/*	$NetBSD: db_proc.c,v 1.10 2020/02/15 18:12:14 ad Exp $	*/
 
 /*-
- * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 2009, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.9 2020/01/08 17:38:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.10 2020/02/15 18:12:14 ad Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -196,7 +196,7 @@ db_show_all_procs(db_expr_t addr, bool h
 	sizeof(db_nbuf));
 }
 run = (l.l_stat == LSONPROC ||
-(l.l_flag & LW_RUNNING) != 0);
+(l.l_pflag & LP_RUNNING) != 0);
 if (l.l_cpu != NULL) {
 	db_read_bytes((db_addr_t)
 	_cpu->ci_data.cpu_index,
@@ -254,7 +254,7 @@ db_show_all_procs(db_expr_t addr, bool h
 	wbuf[0] = '\0';
 }
 run = (l.l_stat == LSONPROC ||
-(l.l_flag & LW_RUNNING) != 0);
+(l.l_pflag & LP_RUNNING) != 0);
 db_read_bytes((db_addr_t)_emul->e_name,
 sizeof(ename), (char *));
 
@@ -332,7 +332,7 @@ db_show_proc(db_expr_t addr, bool haddr,
 		db_read_bytes((db_addr_t)lp, sizeof(l), (char *));
 
 		run = (l.l_stat == LSONPROC ||
-		(l.l_flag & LW_RUNNING) != 0);
+		(l.l_pflag & LP_RUNNING) != 0);
 
 		db_printf("%slwp %d", (run ? "> " : "  "), l.l_lid);
 		if (l.l_name != NULL) {

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.519 src/sys/kern/init_main.c:1.520
--- src/sys/kern/init_main.c:1.519	Tue Jan 28 16:35:39 2020
+++ src/sys/kern/init_main.c	Sat Feb 15 18:12:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.519 2020/01/28 16:35:39 ad Exp $	*/
+/*	$NetBSD: init_main.c,v 1.520 2020/02/15 18:12:15 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.519 2020/01/28 16:35:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.520 2020/02/15 18:12:15 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -290,7 +290,7 @@ main(void)
 #ifndef LWP0_CPU_INFO
 	l->l_cpu = curcpu();
 #endif
-	l->l_flag |= 

CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 18:12:15 UTC 2020

Modified Files:
src/sys/arch/vax/vax: pmap.c
src/sys/ddb: db_proc.c
src/sys/kern: init_main.c kern_exit.c kern_idle.c kern_lwp.c
kern_resource.c kern_sleepq.c kern_softint.c kern_synch.c
src/sys/rump/librump/rumpkern: lwproc.c scheduler.c
src/sys/sys: lwp.h

Log Message:
- Move the LW_RUNNING flag back into l_pflag: updating l_flag without lock
  in softint_dispatch() is risky.  May help with the "softint screwup"
  panic.

- Correct the memory barriers around zombies switching into oblivion.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.9 -r1.10 src/sys/ddb/db_proc.c
cvs rdiff -u -r1.519 -r1.520 src/sys/kern/init_main.c
cvs rdiff -u -r1.282 -r1.283 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/kern_idle.c
cvs rdiff -u -r1.226 -r1.227 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/kern_resource.c
cvs rdiff -u -r1.60 -r1.61 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/kern_softint.c
cvs rdiff -u -r1.338 -r1.339 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/librump/rumpkern/lwproc.c
cvs rdiff -u -r1.49 -r1.50 src/sys/rump/librump/rumpkern/scheduler.c
cvs rdiff -u -r1.201 -r1.202 src/sys/sys/lwp.h

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



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

2020-02-15 Thread Roy Marples

On 14/02/2020 20:36, Santhosh Raju wrote:

On Thu, Feb 13, 2020 at 4:44 PM Santhosh Raju  wrote:


On Thu, Feb 13, 2020 at 4:32 PM Kamil Rytarowski  wrote:


On 13.02.2020 22:20, Valery Ushakov wrote:

I did not propose to disable the warning.  I proposed to downgrade
-Werror to -Wno-error (i.e. a warning) and only for the buggy
sanitizer build.  That file will still be compiled in normal builds
with all the warnings=errors enabled, so real problems won't be
overlooked.


OK, we can try this path.

Santosh, could you please revert and try -Wno-error + upstream it?

Thank you in advance!



Sure, let me prepare the patch.



The patch has been prepared.

The builds were run both with and without MKLIBCSANITIZER=yes and it
was completed successfully.

Let us know if it alright to commit this.


Looks ok to me, commit it.

Roy


CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:13:55 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_exec.c
src/sys/kern: kern_exec.c kern_lwp.c
src/sys/sys: lwp.h

Log Message:
PR kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig 
triggers vpp != NULL in exit1()->radixtree.c line 674

Create an lwp_renumber() from the code in emulexec() and use in
linux_e_proc_exec() and linux_e_proc_fork() too.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/linux/common/linux_exec.c
cvs rdiff -u -r1.491 -r1.492 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.225 -r1.226 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.200 -r1.201 src/sys/sys/lwp.h

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

Modified files:

Index: src/sys/compat/linux/common/linux_exec.c
diff -u src/sys/compat/linux/common/linux_exec.c:1.120 src/sys/compat/linux/common/linux_exec.c:1.121
--- src/sys/compat/linux/common/linux_exec.c:1.120	Fri Aug 10 21:44:58 2018
+++ src/sys/compat/linux/common/linux_exec.c	Sat Feb 15 17:13:55 2020
@@ -1,7 +1,8 @@
-/*	$NetBSD: linux_exec.c,v 1.120 2018/08/10 21:44:58 pgoyette Exp $	*/
+/*	$NetBSD: linux_exec.c,v 1.121 2020/02/15 17:13:55 ad Exp $	*/
 
 /*-
- * Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008, 2020
+ * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -31,11 +32,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.120 2018/08/10 21:44:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.121 2020/02/15 17:13:55 ad Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -129,9 +131,7 @@ linux_e_proc_exec(struct proc *p, struct
 
 	KASSERT(p->p_nlwps == 1);
 	l = LIST_FIRST(>p_lwps);
-	mutex_enter(p->p_lock);
-	l->l_lid = p->p_pid;
-	mutex_exit(p->p_lock);
+	lwp_renumber(l, p->p_pid);
 }
 
 void
@@ -152,7 +152,7 @@ linux_e_proc_fork(struct proc *p2, struc
 
 	KASSERT(p2->p_nlwps == 1);
 	l2 = LIST_FIRST(>p_lwps);
-	l2->l_lid = p2->p_pid;
+	lwp_renumber(l2, p2->p_pid);
 	led1 = l1->l_emuldata;
 	led2 = l2->l_emuldata;
 	led2->led_child_tidptr = led1->led_child_tidptr;

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.491 src/sys/kern/kern_exec.c:1.492
--- src/sys/kern/kern_exec.c:1.491	Mon Feb 10 22:13:01 2020
+++ src/sys/kern/kern_exec.c	Sat Feb 15 17:13:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.491 2020/02/10 22:13:01 christos Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.492 2020/02/15 17:13:55 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.491 2020/02/10 22:13:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.492 2020/02/15 17:13:55 ad Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1148,32 +1148,9 @@ emulexec(struct lwp *l, struct exec_pack
 	&& p->p_emul != epp->ep_esch->es_emul)
 		(*p->p_emul->e_proc_exit)(p);
 
-	/*
-	 * This is now LWP 1.  Re-number the LWP if needed.  Don't bother
-	 * with p_treelock here as this is the only live LWP in the proc
-	 * right now.
-	 */
-	while (__predict_false(l->l_lid != 1)) {
-		lwp_t *l2 __diagused;
-		int error;
-
-		mutex_enter(p->p_lock);
-		error = radix_tree_insert_node(>p_lwptree, 1 - 1, l);
-		if (error == 0) {
-			l2 = radix_tree_remove_node(>p_lwptree,
-			(uint64_t)(l->l_lid - 1));
-			KASSERT(l2 == l);
-			p->p_nlwpid = 2;
-			l->l_lid = 1;
-		}
-		mutex_exit(p->p_lock);
-
-		if (error == 0)
-			break;
-
-		KASSERT(error == ENOMEM);
-		radix_tree_await_memory();
-	}
+	/* This is now LWP 1.  Re-number the LWP if needed. */
+	if (l->l_lid != 1)
+		lwp_renumber(l, 1);
 
 	/*
 	 * Call exec hook. Emulation code may NOT store reference to anything

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.225 src/sys/kern/kern_lwp.c:1.226
--- src/sys/kern/kern_lwp.c:1.225	Tue Feb 11 06:09:48 2020
+++ src/sys/kern/kern_lwp.c	Sat Feb 15 17:13:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.225 2020/02/11 06:09:48 dogcow Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.226 2020/02/15 17:13:55 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.225 2020/02/11 06:09:48 dogcow Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.226 2020/02/15 17:13:55 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -2025,6 +2025,40 @@ lwp_setprivate(struct lwp *l, void *ptr)
 	return error;
 }
 
+/*
+ * Renumber the first and only LWP in a process on exec() or fork().
+ * Don't bother with p_treelock here as this is the only live LWP in
+ * the proc right now.
+ */
+void

CVS commit: src/sys/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:14:31 UTC 2020

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

Log Message:
NetBSD 9.99.47 - added lwp_renumber()


To generate a diff of this commit:
cvs rdiff -u -r1.649 -r1.650 src/sys/sys/param.h

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



CVS commit: src/sys/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:14:31 UTC 2020

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

Log Message:
NetBSD 9.99.47 - added lwp_renumber()


To generate a diff of this commit:
cvs rdiff -u -r1.649 -r1.650 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.649 src/sys/sys/param.h:1.650
--- src/sys/sys/param.h:1.649	Fri Feb  7 13:37:20 2020
+++ src/sys/sys/param.h	Sat Feb 15 17:14:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.649 2020/02/07 13:37:20 thorpej Exp $	*/
+/*	$NetBSD: param.h,v 1.650 2020/02/15 17:14:30 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999004600	/* NetBSD 9.99.46 */
+#define	__NetBSD_Version__	999004700	/* NetBSD 9.99.47 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:13:55 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_exec.c
src/sys/kern: kern_exec.c kern_lwp.c
src/sys/sys: lwp.h

Log Message:
PR kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig 
triggers vpp != NULL in exit1()->radixtree.c line 674

Create an lwp_renumber() from the code in emulexec() and use in
linux_e_proc_exec() and linux_e_proc_fork() too.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/linux/common/linux_exec.c
cvs rdiff -u -r1.491 -r1.492 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.225 -r1.226 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.200 -r1.201 src/sys/sys/lwp.h

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



CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:09:24 UTC 2020

Modified Files:
src/sys/kern: kern_condvar.c sys_select.c
src/sys/sys: syncobj.h

Log Message:
- List all of the syncobjs in syncobj.h.
- Update a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/kern_condvar.c
cvs rdiff -u -r1.51 -r1.52 src/sys/kern/sys_select.c
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/syncobj.h

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



CVS commit: src/sys

2020-02-15 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Feb 15 17:09:24 UTC 2020

Modified Files:
src/sys/kern: kern_condvar.c sys_select.c
src/sys/sys: syncobj.h

Log Message:
- List all of the syncobjs in syncobj.h.
- Update a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/kern_condvar.c
cvs rdiff -u -r1.51 -r1.52 src/sys/kern/sys_select.c
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/syncobj.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/kern/kern_condvar.c
diff -u src/sys/kern/kern_condvar.c:1.42 src/sys/kern/kern_condvar.c:1.43
--- src/sys/kern/kern_condvar.c:1.42	Wed Nov 20 21:49:00 2019
+++ src/sys/kern/kern_condvar.c	Sat Feb 15 17:09:24 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: kern_condvar.c,v 1.42 2019/11/20 21:49:00 ad Exp $	*/
+/*	$NetBSD: kern_condvar.c,v 1.43 2020/02/15 17:09:24 ad Exp $	*/
 
 /*-
- * Copyright (c) 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.42 2019/11/20 21:49:00 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.43 2020/02/15 17:09:24 ad Exp $");
 
 #include 
 #include 
@@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_condvar
  *	cv_opaque[2]	description for ps(1)
  *
  * cv_opaque[0..1] is protected by the interlock passed to cv_wait() (enqueue
- * only), and the sleep queue lock acquired with sleeptab_lookup() (enqueue
+ * only), and the sleep queue lock acquired with sleepq_hashlock() (enqueue
  * and dequeue).
  *
  * cv_opaque[2] (the wmesg) is static and does not change throughout the life
@@ -70,7 +70,7 @@ static void		cv_unsleep(lwp_t *, bool);
 static inline void	cv_wakeup_one(kcondvar_t *);
 static inline void	cv_wakeup_all(kcondvar_t *);
 
-static syncobj_t cv_syncobj = {
+syncobj_t cv_syncobj = {
 	.sobj_flag	= SOBJ_SLEEPQ_SORTED,
 	.sobj_unsleep	= cv_unsleep,
 	.sobj_changepri	= sleepq_changepri,

Index: src/sys/kern/sys_select.c
diff -u src/sys/kern/sys_select.c:1.51 src/sys/kern/sys_select.c:1.52
--- src/sys/kern/sys_select.c:1.51	Sat Feb  1 02:23:04 2020
+++ src/sys/kern/sys_select.c	Sat Feb 15 17:09:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_select.c,v 1.51 2020/02/01 02:23:04 riastradh Exp $	*/
+/*	$NetBSD: sys_select.c,v 1.52 2020/02/15 17:09:24 ad Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2019 The NetBSD Foundation, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.51 2020/02/01 02:23:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.52 2020/02/15 17:09:24 ad Exp $");
 
 #include 
 #include 
@@ -136,7 +136,7 @@ static const int sel_flag[] = {
 	POLLRDBAND
 };
 
-static syncobj_t select_sobj = {
+syncobj_t select_sobj = {
 	.sobj_flag	= SOBJ_SLEEPQ_FIFO,
 	.sobj_unsleep	= sleepq_unsleep,
 	.sobj_changepri	= sleepq_changepri,

Index: src/sys/sys/syncobj.h
diff -u src/sys/sys/syncobj.h:1.9 src/sys/sys/syncobj.h:1.10
--- src/sys/sys/syncobj.h:1.9	Sun Jan 26 19:01:56 2020
+++ src/sys/sys/syncobj.h	Sat Feb 15 17:09:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: syncobj.h,v 1.9 2020/01/26 19:01:56 ad Exp $	*/
+/*	$NetBSD: syncobj.h,v 1.10 2020/02/15 17:09:24 ad Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -56,11 +56,13 @@ struct lwp *syncobj_noowner(wchan_t);
 #define	SOBJ_SLEEPQ_LIFO	0x04
 #define	SOBJ_SLEEPQ_NULL	0x08
 
-extern syncobj_t	sched_syncobj;
+extern syncobj_t	cv_syncobj;
+extern syncobj_t	lwp_park_syncobj;
 extern syncobj_t	mutex_syncobj;
 extern syncobj_t	rw_syncobj;
+extern syncobj_t	sched_syncobj;
+extern syncobj_t	select_syncobj;
 extern syncobj_t	sleep_syncobj;
-extern syncobj_t	lwp_park_syncobj;
 
 #endif /* defined(_KERNEL) */
 



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 17:01:01 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Fix two comments


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.106 src/sys/arch/mips/mips/mipsX_subr.S:1.107
--- src/sys/arch/mips/mips/mipsX_subr.S:1.106	Sat Feb 15 16:56:15 2020
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sat Feb 15 17:01:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.106 2020/02/15 16:56:15 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.107 2020/02/15 17:01:00 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1960,7 +1960,7 @@ MIPSX(kern_tlbi_odd):
 	_SLL	k0, k0, WIRED_SHIFT		# get rid of wired bit
 	_SRL	k0, k0, WIRED_SHIFT
 #endif
-	_MTC0	k0, MIPS_COP_0_TLB_LO1		# save PTE entry
+	_MTC0	k0, MIPS_COP_0_TLB_LO1		# load PTE entry
 	COP0_SYNC
 	and	k0, k0, MIPS3_PG_V		# check for valid entry
 #ifdef MIPS3
@@ -1981,7 +1981,7 @@ MIPSX(kern_tlbi_odd):
 	sltiu	k1, k1, MIPS3_TLB_WIRED_UPAGES	# Luckily this is MIPS3_PG_G
 	or	k1, k1, k0
 #endif
-	_MTC0	k0, MIPS_COP_0_TLB_LO0		# save PTE entry
+	_MTC0	k0, MIPS_COP_0_TLB_LO0		# load PTE entry
 	COP0_SYNC
 #ifdef MIPS3
 	nop	# required for QED5230



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 17:01:01 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Fix two comments


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/mips/mips/mipsX_subr.S

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



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 16:56:15 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/mips/mips/mipsX_subr.S

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



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 16:56:15 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/mips/mips/mipsX_subr.S

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

Modified files:

Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.105 src/sys/arch/mips/mips/mipsX_subr.S:1.106
--- src/sys/arch/mips/mips/mipsX_subr.S:1.105	Tue Jun 25 21:26:04 2019
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sat Feb 15 16:56:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.105 2019/06/25 21:26:04 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.106 2020/02/15 16:56:15 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1826,7 +1826,7 @@ END(MIPSX(cache_exception))
  *	virtual address.
  *
  *	If we are page sizes which use both TLB LO entries, either both
- *	are valid or neither are.  So this expection should never happen.
+ *	are valid or neither are.  So this exception should never happen.
  *
  * Results:
  *	None.



CVS commit: src/sys/external/bsd/dwc2

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 14:05:06 UTC 2020

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
#ifdef DIAGNOSTIC --> __diagused


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.70 src/sys/external/bsd/dwc2/dwc2.c:1.71
--- src/sys/external/bsd/dwc2/dwc2.c:1.70	Sat Feb 15 13:56:56 2020
+++ src/sys/external/bsd/dwc2/dwc2.c	Sat Feb 15 14:05:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.70 2020/02/15 13:56:56 riastradh Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.71 2020/02/15 14:05:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.70 2020/02/15 13:56:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.71 2020/02/15 14:05:06 riastradh Exp $");
 
 #include "opt_usb.h"
 
@@ -449,9 +449,7 @@ dwc2_poll(struct usbd_bus *bus)
 Static void
 dwc2_close_pipe(struct usbd_pipe *pipe)
 {
-#ifdef DIAGNOSTIC
-	struct dwc2_softc *sc = pipe->up_dev->ud_bus->ub_hcpriv;
-#endif
+	struct dwc2_softc *sc __diagused = pipe->up_dev->ud_bus->ub_hcpriv;
 
 	KASSERT(mutex_owned(>sc_lock));
 }
@@ -755,9 +753,8 @@ dwc2_device_ctrl_start(struct usbd_xfer 
 Static void
 dwc2_device_ctrl_abort(struct usbd_xfer *xfer)
 {
-#ifdef DIAGNOSTIC
-	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
-#endif
+	struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer);
+
 	KASSERT(mutex_owned(>sc_lock));
 
 	DPRINTF("xfer=%p\n", xfer);
@@ -805,9 +802,8 @@ dwc2_device_bulk_transfer(struct usbd_xf
 Static void
 dwc2_device_bulk_abort(struct usbd_xfer *xfer)
 {
-#ifdef DIAGNOSTIC
-	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
-#endif
+	struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer);
+
 	KASSERT(mutex_owned(>sc_lock));
 
 	DPRINTF("xfer=%p\n", xfer);
@@ -877,9 +873,7 @@ dwc2_device_intr_start(struct usbd_xfer 
 Static void
 dwc2_device_intr_abort(struct usbd_xfer *xfer)
 {
-#ifdef DIAGNOSTIC
-	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
-#endif
+	struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer);
 
 	KASSERT(mutex_owned(>sc_lock));
 	KASSERT(xfer->ux_pipe->up_intrxfer == xfer);



CVS commit: src/sys/external/bsd/dwc2

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 14:05:06 UTC 2020

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
#ifdef DIAGNOSTIC --> __diagused


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/external/bsd/dwc2/dwc2.c

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



CVS commit: src/sys

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 13:56:56 UTC 2020

Modified Files:
src/sys/dev/usb: motg.c
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Fix non-DIAGNOSTIC builds.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.69 -r1.70 src/sys/external/bsd/dwc2/dwc2.c

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

Modified files:

Index: src/sys/dev/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.28 src/sys/dev/usb/motg.c:1.29
--- src/sys/dev/usb/motg.c:1.28	Sat Feb 15 07:46:48 2020
+++ src/sys/dev/usb/motg.c	Sat Feb 15 13:56:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.28 2020/02/15 07:46:48 skrll Exp $	*/
+/*	$NetBSD: motg.c,v 1.29 2020/02/15 13:56:55 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.28 2020/02/15 07:46:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.29 2020/02/15 13:56:55 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1056,7 +1056,7 @@ motg_root_intr_start(struct usbd_xfer *x
 void
 motg_root_intr_close(struct usbd_pipe *pipe)
 {
-	struct motg_softc *sc = MOTG_PIPE2SC(pipe);
+	struct motg_softc *sc __diagused = MOTG_PIPE2SC(pipe);
 	MOTGHIST_FUNC(); MOTGHIST_CALLED();
 
 	KASSERT(mutex_owned(>sc_lock));

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.69 src/sys/external/bsd/dwc2/dwc2.c:1.70
--- src/sys/external/bsd/dwc2/dwc2.c:1.69	Sat Feb 15 01:21:56 2020
+++ src/sys/external/bsd/dwc2/dwc2.c	Sat Feb 15 13:56:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.69 2020/02/15 01:21:56 riastradh Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.70 2020/02/15 13:56:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.69 2020/02/15 01:21:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.70 2020/02/15 13:56:56 riastradh Exp $");
 
 #include "opt_usb.h"
 
@@ -683,7 +683,7 @@ dwc2_root_intr_abort(struct usbd_xfer *x
 Static void
 dwc2_root_intr_close(struct usbd_pipe *pipe)
 {
-	struct dwc2_softc *sc = DWC2_PIPE2SC(pipe);
+	struct dwc2_softc *sc __diagused = DWC2_PIPE2SC(pipe);
 
 	DPRINTF("\n");
 



CVS commit: src/sys

2020-02-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 15 13:56:56 UTC 2020

Modified Files:
src/sys/dev/usb: motg.c
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Fix non-DIAGNOSTIC builds.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.69 -r1.70 src/sys/external/bsd/dwc2/dwc2.c

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



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

2020-02-15 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Feb 15 13:51:33 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S

Log Message:
avoid nesting /*'s (-Wcomment)


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/aarch64/aarch64/locore.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.56 src/sys/arch/aarch64/aarch64/locore.S:1.57
--- src/sys/arch/aarch64/aarch64/locore.S:1.56	Sat Feb 15 08:16:10 2020
+++ src/sys/arch/aarch64/aarch64/locore.S	Sat Feb 15 13:51:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.56 2020/02/15 08:16:10 skrll Exp $	*/
+/*	$NetBSD: locore.S,v 1.57 2020/02/15 13:51:33 tnn Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -38,7 +38,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.56 2020/02/15 08:16:10 skrll Exp $")
+RCSID("$NetBSD: locore.S,v 1.57 2020/02/15 13:51:33 tnn Exp $")
 
 #ifdef AARCH64_DEVICE_MEM_STRONGLY_ORDERED
 #define	MAIR_DEVICE_MEM		MAIR_DEVICE_nGnRnE
@@ -47,9 +47,9 @@ RCSID("$NetBSD: locore.S,v 1.56 2020/02/
 #endif
 #define	MAIR_DEVICE_MEM_SO	MAIR_DEVICE_nGnRnE
 
-/*#define DEBUG_LOCORE			/* debug print */
-/*#define DEBUG_LOCORE_PRINT_LOCK	/* avoid mixing AP's output */
-/*#define DEBUG_MMU			/* dump MMU table */
+/*#define DEBUG_LOCORE			// debug print */
+/*#define DEBUG_LOCORE_PRINT_LOCK	// avoid mixing AP's output */
+/*#define DEBUG_MMU			// dump MMU table */
 
 #define LOCORE_EL2
 



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

2020-02-15 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Feb 15 13:51:33 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S

Log Message:
avoid nesting /*'s (-Wcomment)


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/aarch64/aarch64/locore.S

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



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 12:45:05 UTC 2020

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
Need to limit the DMA range for tx1.  Assume 32bit DMA everywhere for now.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/nvidia/tegra_sdhc.c

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



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

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 12:45:05 UTC 2020

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
Need to limit the DMA range for tx1.  Assume 32bit DMA everywhere for now.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/nvidia/tegra_sdhc.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/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.24 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.25
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.24	Sun Oct 13 06:11:31 2019
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Sat Feb 15 12:45:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.24 2019/10/13 06:11:31 skrll Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.25 2020/02/15 12:45:05 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.24 2019/10/13 06:11:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.25 2020/02/15 12:45:05 skrll Exp $");
 
 #include 
 #include 
@@ -111,7 +111,14 @@ tegra_sdhc_attach(device_t parent, devic
 		bus_width = 4;
 
 	sc->sc.sc_dev = self;
-	sc->sc.sc_dmat = faa->faa_dmat;
+
+	error = bus_dmatag_subregion(faa->faa_dmat, 0, 0x,
+	>sc.sc_dmat, BUS_DMA_WAITOK);
+	if (error != 0) {
+		aprint_error(": couldn't create DMA tag: %d\n", error);
+		return;
+	}
+
 	sc->sc.sc_flags = SDHC_FLAG_32BIT_ACCESS |
 			  SDHC_FLAG_NO_PWR0 |
 			  SDHC_FLAG_NO_CLKBASE |



CVS commit: src/sys/dev/pci

2020-02-15 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Feb 15 12:20:35 UTC 2020

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

Log Message:
return the ifmedia active status correctly even while the link is not up after 
attach.

pointed out by msaitoh@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/if_aq.c

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

Modified files:

Index: src/sys/dev/pci/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.10 src/sys/dev/pci/if_aq.c:1.11
--- src/sys/dev/pci/if_aq.c:1.10	Mon Feb 10 05:53:12 2020
+++ src/sys/dev/pci/if_aq.c	Sat Feb 15 12:20:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.10 2020/02/10 05:53:12 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.11 2020/02/15 12:20:35 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.10 2020/02/10 05:53:12 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.11 2020/02/15 12:20:35 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -1005,8 +1005,6 @@ struct aq_softc {
 	bool sc_intr_moderation_enable;
 	bool sc_rss_enable;
 
-	int sc_media_active;
-
 	struct ethercom sc_ethercom;
 	struct ether_addr sc_enaddr;
 	struct ifmedia sc_media;
@@ -2717,39 +2715,6 @@ aq_set_filter(struct aq_softc *sc)
 	return error;
 }
 
-static void
-aq_mediastatus_update(struct aq_softc *sc)
-{
-	sc->sc_media_active = 0;
-
-	if (sc->sc_link_fc & AQ_FC_RX)
-		sc->sc_media_active |= IFM_ETH_RXPAUSE;
-	if (sc->sc_link_fc & AQ_FC_TX)
-		sc->sc_media_active |= IFM_ETH_TXPAUSE;
-
-	switch (sc->sc_link_rate) {
-	case AQ_LINK_100M:
-		/* XXX: need to detect fulldup or halfdup */
-		sc->sc_media_active |= IFM_100_TX | IFM_FDX;
-		break;
-	case AQ_LINK_1G:
-		sc->sc_media_active |= IFM_1000_T | IFM_FDX;
-		break;
-	case AQ_LINK_2G5:
-		sc->sc_media_active |= IFM_2500_T | IFM_FDX;
-		break;
-	case AQ_LINK_5G:
-		sc->sc_media_active |= IFM_5000_T | IFM_FDX;
-		break;
-	case AQ_LINK_10G:
-		sc->sc_media_active |= IFM_10G_T | IFM_FDX;
-		break;
-	default:
-		sc->sc_media_active |= IFM_NONE;
-		break;
-	}
-}
-
 static int
 aq_ifmedia_change(struct ifnet * const ifp)
 {
@@ -2805,13 +2770,39 @@ aq_ifmedia_status(struct ifnet * const i
 {
 	struct aq_softc *sc = ifp->if_softc;
 
+	/* update ifm_active */
 	ifmr->ifm_active = IFM_ETHER;
-	ifmr->ifm_status = IFM_AVALID;
+	if (sc->sc_link_fc & AQ_FC_RX)
+		ifmr->ifm_active |= IFM_ETH_RXPAUSE;
+	if (sc->sc_link_fc & AQ_FC_TX)
+		ifmr->ifm_active |= IFM_ETH_TXPAUSE;
 
+	switch (sc->sc_link_rate) {
+	case AQ_LINK_100M:
+		/* XXX: need to detect fulldup or halfdup */
+		ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
+		break;
+	case AQ_LINK_1G:
+		ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
+		break;
+	case AQ_LINK_2G5:
+		ifmr->ifm_active |= IFM_2500_T | IFM_FDX;
+		break;
+	case AQ_LINK_5G:
+		ifmr->ifm_active |= IFM_5000_T | IFM_FDX;
+		break;
+	case AQ_LINK_10G:
+		ifmr->ifm_active |= IFM_10G_T | IFM_FDX;
+		break;
+	default:
+		ifmr->ifm_active |= IFM_NONE;
+		break;
+	}
+
+	/* update ifm_status */
+	ifmr->ifm_status = IFM_AVALID;
 	if (sc->sc_link_rate != AQ_LINK_NONE)
 		ifmr->ifm_status |= IFM_ACTIVE;
-
-	ifmr->ifm_active |= sc->sc_media_active;
 }
 
 static void
@@ -3385,8 +3376,6 @@ aq_update_link_status(struct aq_softc *s
 		sc->sc_link_fc = fc;
 		sc->sc_link_eee = eee;
 
-		aq_mediastatus_update(sc);
-
 		/* update interrupt timing according to new link speed */
 		aq_hw_interrupt_moderation_set(sc);
 	}



CVS commit: src/sys/dev/pci

2020-02-15 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Feb 15 12:20:35 UTC 2020

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

Log Message:
return the ifmedia active status correctly even while the link is not up after 
attach.

pointed out by msaitoh@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/if_aq.c

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



CVS commit: src/sys/arch/amd64/stand/prekern

2020-02-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Feb 15 10:41:25 UTC 2020

Modified Files:
src/sys/arch/amd64/stand/prekern: mm.c

Log Message:
Explain more.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/stand/prekern/mm.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/stand/prekern/mm.c
diff -u src/sys/arch/amd64/stand/prekern/mm.c:1.24 src/sys/arch/amd64/stand/prekern/mm.c:1.25
--- src/sys/arch/amd64/stand/prekern/mm.c:1.24	Sat Mar  9 08:42:25 2019
+++ src/sys/arch/amd64/stand/prekern/mm.c	Sat Feb 15 10:41:25 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: mm.c,v 1.24 2019/03/09 08:42:25 maxv Exp $	*/
+/*	$NetBSD: mm.c,v 1.25 2020/02/15 10:41:25 maxv Exp $	*/
 
 /*
- * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
+ * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Maxime Villard.
@@ -289,6 +289,12 @@ mm_shift_segment(vaddr_t va, size_t page
 	size_t shiftsize, offset;
 	uint64_t rnd;
 
+	/*
+	 * If possible, shift the segment in memory using a random offset. Once
+	 * shifted the segment remains in the same page, of size pagesz. Make
+	 * sure to respect the ELF alignment constraint.
+	 */
+
 	if (elfalign == 0) {
 		elfalign = ELFROUND;
 	}
@@ -317,6 +323,13 @@ mm_map_head(void)
 	vaddr_t randva;
 
 	/*
+	 * The HEAD window is 1GB below the main KASLR window. This is to
+	 * ensure that head always comes first in virtual memory. The reason
+	 * for that is that we use (headva + sh_offset), and sh_offset is
+	 * unsigned.
+	 */
+
+	/*
 	 * To get the size of the head, we give a look at the read-only
 	 * mapping of the kernel we created in locore. We're identity mapped,
 	 * so kernpa = kernva.
@@ -324,6 +337,10 @@ mm_map_head(void)
 	size = elf_get_head_size((vaddr_t)kernpa_start);
 	npages = size / PAGE_SIZE;
 
+	/*
+	 * Choose a random range of VAs in the HEAD window, and create the page
+	 * tree for it.
+	 */
 	prng_get_rand(, sizeof(rnd));
 	randva = rounddown(HEAD_WINDOW_BASE + rnd % (HEAD_WINDOW_SIZE - size),
 	PAGE_SIZE);
@@ -355,22 +372,27 @@ mm_map_segment(int segtype, paddr_t pa, 
 		pagesz = NBPD_L2;
 	}
 
+	/* Create the page tree */
 	size = roundup(elfsz, pagesz);
 	randva = mm_randva_kregion(size, pagesz);
 
+	/* Enter the segment */
 	npages = size / PAGE_SIZE;
 	for (i = 0; i < npages; i++) {
 		mm_enter_pa(pa + i * PAGE_SIZE,
 		randva + i * PAGE_SIZE, MM_PROT_READ|MM_PROT_WRITE);
 	}
 
+	/* Shift the segment in memory */
 	offset = mm_shift_segment(randva, pagesz, elfsz, elfalign);
 	ASSERT(offset + elfsz <= size);
 
+	/* Fill the paddings */
 	pad = pads[segtype];
 	memset((void *)randva, pad, offset);
 	memset((void *)(randva + offset + elfsz), pad, size - elfsz - offset);
 
+	/* Register the bootspace information */
 	bootspace_addseg(segtype, randva, pa, size);
 
 	return (randva + offset);
@@ -425,12 +447,31 @@ mm_map_boot(void)
 }
 
 /*
- * There is a variable number of independent regions: one head, several kernel
- * segments, one boot. They are all mapped at random VAs.
+ * The bootloader has set up the following layout of physical memory:
+ * ++-+---+--+---+
+ * | ELF HEADER | SECTION HEADERS | KERN SECTIONS | SYM+REL SECTIONS | EXTRA |
+ * ++-+---+--+---+
+ * Which we abstract into several "regions":
+ * +--+---+--+
+ * | Head region  | Several segs  |   Boot region|
+ * +--+---+--+
+ * See loadfile_elf32.c:loadfile_dynamic() for the details.
+ *
+ * There is a variable number of independent regions we create: one head,
+ * several kernel segments, one boot. They are all mapped at random VAs.
  *
  * Head contains the ELF Header and ELF Section Headers, and we use them to
- * map the rest of the regions. Head must be placed in memory *before* the
- * other regions.
+ * map the rest of the regions. Head must be placed in both virtual memory
+ * and physical memory *before* the rest.
+ *
+ * The Kernel Sections are mapped at random VAs using individual segments
+ * in bootspace.
+ *
+ * Boot contains various information, including the ELF Sym+Rel sections,
+ * plus extra memory the prekern has used so far; it is a region that the
+ * kernel will eventually use for module_map. Boot is placed *after* the
+ * other regions in physical memory. In virtual memory however there is no
+ * constraint, so its VA is randomly selected in the main KASLR window.
  *
  * At the end of this function, the bootspace structure is fully constructed.
  */



CVS commit: src/sys/arch/amd64/stand/prekern

2020-02-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Feb 15 10:41:25 UTC 2020

Modified Files:
src/sys/arch/amd64/stand/prekern: mm.c

Log Message:
Explain more.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/stand/prekern/mm.c

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



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

2020-02-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 15 09:57:30 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: tcache.c

Log Message:
jemalloc: Avoid variable length array with length 0

Cherry-pick upstrem patch.

https://github.com/jemalloc/jemalloc/pull/1768


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/tcache.c

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



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

2020-02-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 15 09:57:30 UTC 2020

Modified Files:
src/external/bsd/jemalloc/dist/src: tcache.c

Log Message:
jemalloc: Avoid variable length array with length 0

Cherry-pick upstrem patch.

https://github.com/jemalloc/jemalloc/pull/1768


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/jemalloc/dist/src/tcache.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/jemalloc/dist/src/tcache.c
diff -u src/external/bsd/jemalloc/dist/src/tcache.c:1.1.1.1 src/external/bsd/jemalloc/dist/src/tcache.c:1.2
--- src/external/bsd/jemalloc/dist/src/tcache.c:1.1.1.1	Mon Mar  4 17:10:23 2019
+++ src/external/bsd/jemalloc/dist/src/tcache.c	Sat Feb 15 09:57:30 2020
@@ -111,7 +111,8 @@ tcache_bin_flush_small(tsd_t *tsd, tcach
 	arena_t *arena = tcache->arena;
 	assert(arena != NULL);
 	unsigned nflush = tbin->ncached - rem;
-	VARIABLE_ARRAY(extent_t *, item_extent, nflush);
+	/* Variable length array must have > 0 length. */
+	VARIABLE_ARRAY(extent_t *, item_extent, nflush + + 1);
 	/* Look up extent once per item. */
 	for (unsigned i = 0 ; i < nflush; i++) {
 		item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));
@@ -196,7 +197,8 @@ tcache_bin_flush_large(tsd_t *tsd, cache
 	arena_t *arena = tcache->arena;
 	assert(arena != NULL);
 	unsigned nflush = tbin->ncached - rem;
-	VARIABLE_ARRAY(extent_t *, item_extent, nflush);
+	/* Variable length array must have > 0 length. */
+	VARIABLE_ARRAY(extent_t *, item_extent, nflush + 1);
 	/* Look up extent once per item. */
 	for (unsigned i = 0 ; i < nflush; i++) {
 		item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));



CVS commit: src/sys/dev/usb

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 09:26:07 UTC 2020

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

Log Message:
Change bNbrPorts for loop to start from 1 to match others.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/xhci.c

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



CVS commit: src/sys/dev/usb

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 09:26:07 UTC 2020

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

Log Message:
Change bNbrPorts for loop to start from 1 to match others.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/xhci.c

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

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.118 src/sys/dev/usb/xhci.c:1.119
--- src/sys/dev/usb/xhci.c:1.118	Sat Feb 15 01:21:56 2020
+++ src/sys/dev/usb/xhci.c	Sat Feb 15 09:26:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.118 2020/02/15 01:21:56 riastradh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.119 2020/02/15 09:26:07 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.118 2020/02/15 01:21:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.119 2020/02/15 09:26:07 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -3175,9 +3175,9 @@ xhci_setup_route(struct usbd_pipe *pipe,
 		;
 	if (hub) {
 		int p;
-		for (p = 0; p < hub->ud_hub->uh_hubdesc.bNbrPorts; p++) {
-			if (hub->ud_hub->uh_ports[p].up_dev == adev) {
-dev->ud_myhsport = >ud_hub->uh_ports[p];
+		for (p = 1; p <= hub->ud_hub->uh_hubdesc.bNbrPorts; p++) {
+			if (hub->ud_hub->uh_ports[p - 1].up_dev == adev) {
+dev->ud_myhsport = >ud_hub->uh_ports[p - 1];
 goto found;
 			}
 		}



CVS commit: src/sys/arch

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 08:16:12 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c locore.S
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/aarch64/include: cpu.h machdep.h
src/sys/arch/arm/acpi: cpu_acpi.c
src/sys/arch/arm/altera: cycv_platform.c
src/sys/arch/arm/arm: arm_cpu_topology.c arm_machdep.c armv6_start.S
src/sys/arch/arm/arm32: arm32_boot.c arm32_machdep.c cpu.c genassym.cf
src/sys/arch/arm/broadcom: bcm2835_intr.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/fdt: cpu_fdt.c
src/sys/arch/arm/include: cpu.h cpu_topology.h locore.h
src/sys/arch/arm/include/arm32: machdep.h
src/sys/arch/arm/mainbus: cpu_mainbus.c
src/sys/arch/arm/nvidia: soc_tegra124.c
src/sys/arch/arm/samsung: exynos_platform.c
src/sys/arch/arm/vexpress: vexpress_platform.c
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/imx7: imx7_machdep.c
src/sys/arch/evbarm/nitrogen6: nitrogen6_machdep.c
src/sys/arch/evbarm/zynq: zynq_machdep.c
Added Files:
src/sys/arch/arm/arm: cpu_subr.c
src/sys/arch/arm/include: cpuvar.h

Log Message:
Various updates and improvements to cpu start up on arm/aarch64

- start sharing more code around the AP startup messaging.
- call arm_cpu_topology_set early so that ci_core_id is available for
  drivers, e.g. bcm2835_intr.c
- both arm and aarch64 now have
  - a static cpu_info_store array
  - the same arm_cpu_{hatched,mbox}


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/include/machdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/cpu_acpi.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/arm_cpu_topology.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/arm/armv6_start.S
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/arm/cpu_subr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/arm32/arm32_boot.c
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/arm/arm32/genassym.cf
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.152 -r1.153 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/fdt/cpu_fdt.c
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/include/cpu_topology.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/include/cpuvar.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/locore.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/include/arm32/machdep.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/mainbus/cpu_mainbus.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/nvidia/soc_tegra124.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/imx7/imx7_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/zynq/zynq_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/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.40 src/sys/arch/aarch64/aarch64/cpu.c:1.41
--- src/sys/arch/aarch64/aarch64/cpu.c:1.40	Sun Feb  9 08:14:55 2020
+++ src/sys/arch/aarch64/aarch64/cpu.c	Sat Feb 15 08:16:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.40 2020/02/09 08:14:55 skrll Exp $ */
+/* $NetBSD: cpu.c,v 1.41 2020/02/15 08:16:10 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.40 2020/02/09 08:14:55 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.41 2020/02/15 08:16:10 skrll Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -68,16 +68,6 @@ static void cpu_setup_id(struct cpu_info
 static void cpu_setup_sysctl(device_t, struct cpu_info *);
 
 #ifdef MULTIPROCESSOR
-uint64_t cpu_mpidr[MAXCPUS];
-
-volatile u_int aarch64_cpu_mbox[howmany(MAXCPUS, sizeof(u_int))] __cacheline_aligned = { 0 };
-volatile u_int 

CVS commit: src/sys/arch

2020-02-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 15 08:16:12 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c locore.S
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/aarch64/include: cpu.h machdep.h
src/sys/arch/arm/acpi: cpu_acpi.c
src/sys/arch/arm/altera: cycv_platform.c
src/sys/arch/arm/arm: arm_cpu_topology.c arm_machdep.c armv6_start.S
src/sys/arch/arm/arm32: arm32_boot.c arm32_machdep.c cpu.c genassym.cf
src/sys/arch/arm/broadcom: bcm2835_intr.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/fdt: cpu_fdt.c
src/sys/arch/arm/include: cpu.h cpu_topology.h locore.h
src/sys/arch/arm/include/arm32: machdep.h
src/sys/arch/arm/mainbus: cpu_mainbus.c
src/sys/arch/arm/nvidia: soc_tegra124.c
src/sys/arch/arm/samsung: exynos_platform.c
src/sys/arch/arm/vexpress: vexpress_platform.c
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/imx7: imx7_machdep.c
src/sys/arch/evbarm/nitrogen6: nitrogen6_machdep.c
src/sys/arch/evbarm/zynq: zynq_machdep.c
Added Files:
src/sys/arch/arm/arm: cpu_subr.c
src/sys/arch/arm/include: cpuvar.h

Log Message:
Various updates and improvements to cpu start up on arm/aarch64

- start sharing more code around the AP startup messaging.
- call arm_cpu_topology_set early so that ci_core_id is available for
  drivers, e.g. bcm2835_intr.c
- both arm and aarch64 now have
  - a static cpu_info_store array
  - the same arm_cpu_{hatched,mbox}


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/include/machdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/cpu_acpi.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/arm_cpu_topology.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/arm/armv6_start.S
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/arm/cpu_subr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/arm32/arm32_boot.c
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/arm/arm32/genassym.cf
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.152 -r1.153 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/fdt/cpu_fdt.c
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/include/cpu_topology.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/include/cpuvar.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/locore.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/include/arm32/machdep.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/mainbus/cpu_mainbus.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/nvidia/soc_tegra124.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/imx7/imx7_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/zynq/zynq_machdep.c

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