CVS commit: src/sys/arch/sparc64/dev

2020-06-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 12 03:41:57 UTC 2020

Modified Files:
src/sys/arch/sparc64/dev: jbus-i2c.c pcfiic_ebus.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/dev/jbus-i2c.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/pcfiic_ebus.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/sparc64/dev/jbus-i2c.c
diff -u src/sys/arch/sparc64/dev/jbus-i2c.c:1.4 src/sys/arch/sparc64/dev/jbus-i2c.c:1.5
--- src/sys/arch/sparc64/dev/jbus-i2c.c:1.4	Sun Dec 22 23:23:31 2019
+++ src/sys/arch/sparc64/dev/jbus-i2c.c	Fri Jun 12 03:41:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: jbus-i2c.c,v 1.4 2019/12/22 23:23:31 thorpej Exp $	*/
+/*	$NetBSD: jbus-i2c.c,v 1.5 2020/06/12 03:41:57 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jbus-i2c.c,v 1.4 2019/12/22 23:23:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jbus-i2c.c,v 1.5 2020/06/12 03:41:57 thorpej Exp $");
 
 #include 
 #include 
@@ -136,7 +136,6 @@ jbusi2c_setup_i2c(struct jbusi2c_softc *
 	struct i2cbus_attach_args iba;
 	prop_array_t cfg;
 	prop_dictionary_t dev;
-	prop_data_t data;
 	prop_dictionary_t dict = device_properties(sc->sc_dev);
 	int devs, regs[2], addr;
 	char name[64], compat[256];
@@ -167,10 +166,9 @@ jbusi2c_setup_i2c(struct jbusi2c_softc *
 		addr = (regs[1] & 0xff) >> 1;
 		DPRINTF("-> %s@%d,%x\n", name, regs[0], addr);
 		dev = prop_dictionary_create();
-		prop_dictionary_set_cstring(dev, "name", name);
-		data = prop_data_create_data(compat, strlen(compat)+1);
-		prop_dictionary_set(dev, "compatible", data);
-		prop_object_release(data);
+		prop_dictionary_set_string(dev, "name", name);
+		prop_dictionary_set_data(dev, "compatible", compat,
+		strlen(compat)+1);
 		prop_dictionary_set_uint32(dev, "addr", addr);
 		prop_dictionary_set_uint64(dev, "cookie", devs);
 		prop_array_add(cfg, dev);

Index: src/sys/arch/sparc64/dev/pcfiic_ebus.c
diff -u src/sys/arch/sparc64/dev/pcfiic_ebus.c:1.5 src/sys/arch/sparc64/dev/pcfiic_ebus.c:1.6
--- src/sys/arch/sparc64/dev/pcfiic_ebus.c:1.5	Sun Jan  3 17:32:17 2016
+++ src/sys/arch/sparc64/dev/pcfiic_ebus.c	Fri Jun 12 03:41:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcfiic_ebus.c,v 1.5 2016/01/03 17:32:17 jdc Exp $	*/
+/*	$NetBSD: pcfiic_ebus.c,v 1.6 2020/06/12 03:41:57 thorpej Exp $	*/
 /*	$OpenBSD: pcfiic_ebus.c,v 1.13 2008/06/08 03:07:40 deraadt Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcfiic_ebus.c,v 1.5 2016/01/03 17:32:17 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcfiic_ebus.c,v 1.6 2020/06/12 03:41:57 thorpej Exp $");
 
 /*
  * Device specific driver for the EBus i2c devices found on some sun4u
@@ -187,13 +187,10 @@ add_prop(prop_array_t c, const char *nam
 	int node)
 {
 	prop_dictionary_t dev;
-	prop_data_t data;
 
 	dev = prop_dictionary_create();
-	prop_dictionary_set_cstring(dev, "name", name);
-	data = prop_data_create_data(compat, strlen(compat)+1);
-	prop_dictionary_set(dev, "compatible", data);
-	prop_object_release(data);
+	prop_dictionary_set_string(dev, "name", name);
+	prop_dictionary_set_data(dev, "compatible", compat, strlen(compat)+1);
 	prop_dictionary_set_uint32(dev, "addr", addr);
 	prop_dictionary_set_uint64(dev, "cookie", node);
 	prop_array_add(c, dev);



CVS commit: src/sys

2020-06-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 12 03:32:30 UTC 2020

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c
src/sys/dev/fdt: fdt_i2c.c
src/sys/dev/i2c: i2c.c

Log Message:
i2c-indirect-config == false  -->  i2c-no-indirect-config == true


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/fdt_i2c.c
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/i2c/i2c.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.218 src/sys/arch/sparc64/sparc64/autoconf.c:1.219
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.218	Tue Jun  9 21:57:00 2020
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Fri Jun 12 03:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.218 2020/06/09 21:57:00 macallan Exp $ */
+/*	$NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.218 2020/06/09 21:57:00 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1391,7 +1391,7 @@ noether:
 prop_dictionary_set(props, "i2c-child-devices",
 cfg);
 prop_dictionary_set_bool(props,
-"i2c-indirect-config", false);
+"i2c-no-indirect-config", true);
 			}
 
 			/* ADM1026 at 0x2e */

Index: src/sys/dev/fdt/fdt_i2c.c
diff -u src/sys/dev/fdt/fdt_i2c.c:1.7 src/sys/dev/fdt/fdt_i2c.c:1.8
--- src/sys/dev/fdt/fdt_i2c.c:1.7	Wed Apr 24 06:03:02 2019
+++ src/sys/dev/fdt/fdt_i2c.c	Fri Jun 12 03:32:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $ */
+/* $NetBSD: fdt_i2c.c,v 1.8 2020/06/12 03:32:30 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.8 2020/06/12 03:32:30 thorpej Exp $");
 
 #include 
 #include 
@@ -123,7 +123,7 @@ fdtbus_attach_i2cbus(device_t dev, int p
 	prop_object_release(devs);
 
 	props = device_properties(dev);
-	prop_dictionary_set_bool(props, "i2c-indirect-config", false);
+	prop_dictionary_set_bool(props, "i2c-no-indirect-config", true);
 
 	ret = config_found_ia(dev, "i2cbus", , print);
 	if (iba.iba_child_devices)

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.73 src/sys/dev/i2c/i2c.c:1.74
--- src/sys/dev/i2c/i2c.c:1.73	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/i2c/i2c.c	Fri Jun 12 03:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.73 2020/06/11 02:39:30 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.73 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $");
 
 #include 
 #include 
@@ -400,7 +400,7 @@ iic_attach(device_t parent, device_t sel
 	char *buf;
 	i2c_tag_t ic;
 	int rv;
-	bool indirect_config;
+	bool no_indirect_config = false;
 
 	aprint_naive("\n");
 	aprint_normal(": I2C bus\n");
@@ -424,12 +424,11 @@ iic_attach(device_t parent, device_t sel
 
 	if (iba->iba_child_devices) {
 		child_devices = iba->iba_child_devices;
-		indirect_config = false;
+		no_indirect_config = true;
 	} else {
 		props = device_properties(parent);
-		if (!prop_dictionary_get_bool(props, "i2c-indirect-config",
-		_config))
-			indirect_config = true;
+		prop_dictionary_get_bool(props, "i2c-no-indirect-config",
+		_indirect_config);
 		child_devices = prop_dictionary_get(props, "i2c-child-devices");
 	}
 
@@ -495,7 +494,7 @@ iic_attach(device_t parent, device_t sel
 			if (buf)
 free(buf, M_TEMP);
 		}
-	} else if (indirect_config) {
+	} else if (!no_indirect_config) {
 		/*
 		 * Attach all i2c devices described in the kernel
 		 * configuration file.



CVS commit: src/common/lib/libprop

2020-06-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 12 00:02:26 UTC 2020

Modified Files:
src/common/lib/libprop: prop_object_impl.h

Log Message:
Change previous to only apply when building with clang.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/common/lib/libprop/prop_object_impl.h

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

Modified files:

Index: src/common/lib/libprop/prop_object_impl.h
diff -u src/common/lib/libprop/prop_object_impl.h:1.35 src/common/lib/libprop/prop_object_impl.h:1.36
--- src/common/lib/libprop/prop_object_impl.h:1.35	Thu Jun 11 22:25:44 2020
+++ src/common/lib/libprop/prop_object_impl.h	Fri Jun 12 00:02:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_object_impl.h,v 1.35 2020/06/11 22:25:44 joerg Exp $	*/
+/*	$NetBSD: prop_object_impl.h,v 1.36 2020/06/12 00:02:26 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc.
@@ -492,7 +492,11 @@ do {	\
 #if defined(__NetBSD__)
 #include 
 #define	_PROP_ARG_UNUSED		__unused
-#define	_PROP_DEPRECATED(s, m)
+#if defined(__clang__)
+#define	_PROP_DEPRECATED(s, m)		/* delete */
+#else /* ! __clang__ */
+#define	_PROP_DEPRECATED(s, m)		__warn_references(s, m)
+#endif /* __clang__ */
 #else
 #define	_PROP_ARG_UNUSED		/* delete */
 #define	_PROP_DEPRECATED(s, m)		/* delete */



CVS commit: src/share/misc

2020-06-11 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Jun 11 23:19:53 UTC 2020

Modified Files:
src/share/misc: acronyms acronyms.comp

Log Message:
QOI


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/share/misc/acronyms
cvs rdiff -u -r1.306 -r1.307 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.302 src/share/misc/acronyms:1.303
--- src/share/misc/acronyms:1.302	Wed Jun 10 20:26:52 2020
+++ src/share/misc/acronyms	Thu Jun 11 23:19:53 2020
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.302 2020/06/10 20:26:52 sevan Exp $
+$NetBSD: acronyms,v 1.303 2020/06/11 23:19:53 sevan Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -469,6 +469,7 @@ PTT	post-telephone-telegraph
 PTV	parental tunnel vision
 QED	quod erat demonstrandum
 QFT	quoted for truth
+QOI	quality of information
 RA	residential advisor
 RAND	reasonable and non-discriminatory
 RCD	residual current device

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.306 src/share/misc/acronyms.comp:1.307
--- src/share/misc/acronyms.comp:1.306	Fri Jun  5 19:45:51 2020
+++ src/share/misc/acronyms.comp	Thu Jun 11 23:19:53 2020
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.306 2020/06/05 19:45:51 sevan Exp $
+$NetBSD: acronyms.comp,v 1.307 2020/06/11 23:19:53 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1285,6 +1285,8 @@ QBE	query by example
 QC	quality control
 QDI	quasi delay insensitive
 QCIF	quarter common intermediate format
+QOI	quality of implementation
+QOI	quick order interface
 QOS	quality of service
 QVL	qualified vendor list
 R/O	read only



CVS commit: src/common/lib/libprop

2020-06-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jun 11 22:25:44 UTC 2020

Modified Files:
src/common/lib/libprop: prop_object_impl.h

Log Message:
Unbreak clang builds by removing questionable linker warning sections
trggered all over the place.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/common/lib/libprop/prop_object_impl.h

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

Modified files:

Index: src/common/lib/libprop/prop_object_impl.h
diff -u src/common/lib/libprop/prop_object_impl.h:1.34 src/common/lib/libprop/prop_object_impl.h:1.35
--- src/common/lib/libprop/prop_object_impl.h:1.34	Sat Jun  6 21:25:59 2020
+++ src/common/lib/libprop/prop_object_impl.h	Thu Jun 11 22:25:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_object_impl.h,v 1.34 2020/06/06 21:25:59 thorpej Exp $	*/
+/*	$NetBSD: prop_object_impl.h,v 1.35 2020/06/11 22:25:44 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc.
@@ -492,7 +492,7 @@ do {	\
 #if defined(__NetBSD__)
 #include 
 #define	_PROP_ARG_UNUSED		__unused
-#define	_PROP_DEPRECATED(s, m)		__warn_references(s, m)
+#define	_PROP_DEPRECATED(s, m)
 #else
 #define	_PROP_ARG_UNUSED		/* delete */
 #define	_PROP_DEPRECATED(s, m)		/* delete */



CVS commit: src/sys/uvm

2020-06-11 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Jun 11 22:25:51 UTC 2020

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Counter tweaks:

- Don't need to count anonpages+filepages any more; clean+unknown+dirty for
  each kind of page can be summed to get the totals.

- Track the number of free pages with a counter so that it's one less thing
  for the allocator to do, which opens up further options there.

- Remove cpu_count_sync_one(). It has no users and doesn't save a whole lot.
  For the cheap option, give cpu_count_sync() a boolean parameter indicating
  that a cached value is okay, and rate limit the updates for cached values
  to hz.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.83 src/sys/uvm/uvm_pglist.c:1.84
--- src/sys/uvm/uvm_pglist.c:1.83	Thu Jun 11 19:20:47 2020
+++ src/sys/uvm/uvm_pglist.c	Thu Jun 11 22:25:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.83 2020/06/11 19:20:47 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.83 2020/06/11 19:20:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.84 2020/06/11 22:25:51 ad Exp $");
 
 #include 
 #include 
@@ -98,6 +98,7 @@ uvm_pglist_add(struct vm_page *pg, struc
 #endif
 	LIST_REMOVE(pg, pageq.list);
 	pgb->pgb_nfree--;
+	CPU_COUNT(CPU_COUNT_FREEPAGES, -1);
 	if (pg->flags & PG_ZERO)
 		CPU_COUNT(CPU_COUNT_ZEROPAGES, -1);
 	pg->flags = PG_CLEAN;



CVS commit: src

2020-06-11 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Jun 11 22:21:05 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_misc.c
src/sys/compat/linux32/common: linux32_sysinfo.c
src/sys/kern: subr_cpu.c vfs_vnode.c vfs_vnops.c
src/sys/miscfs/procfs: procfs_linux.c
src/sys/sys: cpu_data.h
src/sys/uvm: uvm_loan.c uvm_meter.c uvm_page.c uvm_pdaemon.c
uvm_pdpolicy_clock.c uvm_stat.c
src/usr.bin/vmstat: vmstat.c

Log Message:
Counter tweaks:

- Don't need to count anonpages+filepages any more; clean+unknown+dirty for
  each kind of page can be summed to get the totals.

- Track the number of free pages with a counter so that it's one less thing
  for the allocator to do, which opens up further options there.

- Remove cpu_count_sync_one().  It has no users and doesn't save a whole lot.
  For the cheap option, give cpu_count_sync() a boolean parameter indicating
  that a cached value is okay, and rate limit the updates for cached values
  to hz.


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/linux32/common/linux32_sysinfo.c
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_cpu.c
cvs rdiff -u -r1.123 -r1.124 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.85 -r1.86 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -u -r1.50 -r1.51 src/sys/sys/cpu_data.h
cvs rdiff -u -r1.103 -r1.104 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.78 -r1.79 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.239 -r1.240 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.128 -r1.129 src/sys/uvm/uvm_pdaemon.c
cvs rdiff -u -r1.38 -r1.39 src/sys/uvm/uvm_pdpolicy_clock.c
cvs rdiff -u -r1.44 -r1.45 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.250 src/sys/compat/linux/common/linux_misc.c:1.251
--- src/sys/compat/linux/common/linux_misc.c:1.250	Thu Jun 11 19:20:46 2020
+++ src/sys/compat/linux/common/linux_misc.c	Thu Jun 11 22:21:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.250 2020/06/11 19:20:46 ad Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.251 2020/06/11 22:21:05 ad Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.250 2020/06/11 19:20:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.251 2020/06/11 22:21:05 ad Exp $");
 
 #include 
 #include 
@@ -1347,6 +1347,7 @@ linux_sys_sysinfo(struct lwp *l, const s
 	} */
 	struct linux_sysinfo si;
 	struct loadavg *la;
+	int64_t filepg;
 
 	memset(, 0, sizeof(si));
 	si.uptime = time_uptime;
@@ -1355,9 +1356,14 @@ linux_sys_sysinfo(struct lwp *l, const s
 	si.loads[1] = la->ldavg[1] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
 	si.loads[2] = la->ldavg[2] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
 	si.totalram = ctob((u_long)physmem);
+	/* uvm_availmem() may sync the counters. */
 	si.freeram = (u_long)uvm_availmem(true) * uvmexp.pagesize;
+	filepg = cpu_count_get(CPU_COUNT_FILECLEAN) +
+	cpu_count_get(CPU_COUNT_FILEDIRTY) +
+	cpu_count_get(CPU_COUNT_FILEUNKNOWN) -
+	cpu_count_get(CPU_COUNT_EXECPAGES);
 	si.sharedram = 0;	/* XXX */
-	si.bufferram = (u_long)uvmexp.filepages * uvmexp.pagesize;
+	si.bufferram = (u_long)(filepg * uvmexp.pagesize);
 	si.totalswap = (u_long)uvmexp.swpages * uvmexp.pagesize;
 	si.freeswap = 
 	(u_long)(uvmexp.swpages - uvmexp.swpginuse) * uvmexp.pagesize;

Index: src/sys/compat/linux32/common/linux32_sysinfo.c
diff -u src/sys/compat/linux32/common/linux32_sysinfo.c:1.12 src/sys/compat/linux32/common/linux32_sysinfo.c:1.13
--- src/sys/compat/linux32/common/linux32_sysinfo.c:1.12	Thu Jun 11 19:20:46 2020
+++ src/sys/compat/linux32/common/linux32_sysinfo.c	Thu Jun 11 22:21:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_sysinfo.c,v 1.12 2020/06/11 19:20:46 ad Exp $ */
+/*	$NetBSD: linux32_sysinfo.c,v 1.13 2020/06/11 22:21:05 ad Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.12 2020/06/11 19:20:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.13 2020/06/11 22:21:05 ad Exp $");
 
 #include 
 #include 
@@ -69,6 +69,7 @@ linux32_sys_sysinfo(struct lwp *l, const
 	} */
 	struct linux32_sysinfo si;
 	struct loadavg *la;
+	int64_t filepg;
 
 	memset(, 0, sizeof(si));
 	si.uptime = time_uptime;
@@ -77,9 +78,14 @@ linux32_sys_sysinfo(struct lwp *l, const
 	si.loads[1] = la->ldavg[1] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
 	si.loads[2] = la->ldavg[2] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
 	si.totalram = ctob((u_long)physmem);
+	/* uvm_availmem() may sync 

CVS commit: src

2020-06-11 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Jun 11 19:20:47 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c
src/external/cddl/osnet/sys/kern: misc.c
src/sys/arch/alpha/alpha: machdep.c
src/sys/arch/atari/atari: machdep.c
src/sys/arch/cesfic/cesfic: machdep.c
src/sys/arch/emips/emips: machdep.c
src/sys/arch/evbppc/explora: machdep.c
src/sys/arch/evbppc/virtex: machdep.c
src/sys/arch/evbppc/walnut: machdep.c
src/sys/arch/ews4800mips/ews4800mips: machdep.c
src/sys/arch/hp300/hp300: machdep.c
src/sys/arch/hppa/hppa: machdep.c
src/sys/arch/luna68k/luna68k: machdep.c
src/sys/arch/mac68k/mac68k: machdep.c
src/sys/arch/mips/mips: cpu_subr.c
src/sys/arch/mvme68k/mvme68k: machdep.c
src/sys/arch/news68k/news68k: machdep.c
src/sys/arch/next68k/next68k: machdep.c
src/sys/arch/powerpc/booke: booke_machdep.c
src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c
src/sys/arch/powerpc/oea: oea_machdep.c
src/sys/arch/riscv/riscv: riscv_machdep.c
src/sys/arch/sgimips/sgimips: machdep.c
src/sys/arch/sh3/sh3: sh3_machdep.c
src/sys/arch/sparc/sparc: machdep.c
src/sys/arch/sparc64/sparc64: machdep.c
src/sys/arch/sun2/sun2: machdep.c
src/sys/arch/sun3/sun3: machdep.c
src/sys/arch/sun3/sun3x: machdep.c
src/sys/arch/vax/vax: machdep.c
src/sys/arch/x68k/x68k: machdep.c
src/sys/compat/linux/common: linux_misc.c
src/sys/compat/linux32/common: linux32_sysinfo.c
src/sys/dev: ccd.c
src/sys/fs/tmpfs: tmpfs_mem.c
src/sys/kern: init_main.c kern_module.c kern_proc.c vfs_bio.c
src/sys/miscfs/procfs: procfs_linux.c
src/sys/rump/librump/rumpkern: vm.c
src/sys/ufs/chfs: chfs_subr.c
src/sys/ufs/lfs: lfs_bio.c
src/sys/uvm: uvm_extern.h uvm_glue.c uvm_meter.c uvm_page.c
uvm_pdaemon.c uvm_pdpolicy_clock.c uvm_pglist.c uvm_stat.c

Log Message:
uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched.  It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/sys/kern/misc.c
cvs rdiff -u -r1.359 -r1.360 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/atari/atari/machdep.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/cesfic/cesfic/machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/emips/emips/machdep.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbppc/explora/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbppc/virtex/machdep.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbppc/walnut/machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/ews4800mips/ews4800mips/machdep.c
cvs rdiff -u -r1.233 -r1.234 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/hppa/machdep.c
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.357 -r1.358 src/sys/arch/mac68k/mac68k/machdep.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/next68k/next68k/machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/oea/oea_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/sgimips/sgimips/machdep.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.333 -r1.334 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.297 -r1.298 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/sun2/sun2/machdep.c
cvs rdiff -u -r1.211 -r1.212 src/sys/arch/sun3/sun3/machdep.c
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/sun3/sun3x/machdep.c
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.202 -r1.203 src/sys/arch/x68k/x68k/machdep.c
cvs rdiff -u -r1.249 -r1.250 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/linux32/common/linux32_sysinfo.c
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/ccd.c
cvs rdiff -u -r1.12 -r1.13 src/sys/fs/tmpfs/tmpfs_mem.c
cvs rdiff -u -r1.526 -r1.527 src/sys/kern/init_main.c
cvs rdiff -u -r1.150 -r1.151 src/sys/kern/kern_module.c
cvs rdiff -u -r1.254 -r1.255 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.295 -r1.296 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.84 -r1.85 

CVS commit: src/lib/libpthread

2020-06-11 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Jun 11 18:42:02 UTC 2020

Modified Files:
src/lib/libpthread: pthread.c pthread_tsd.c

Log Message:
Drop self->pt_lock before clearing TSD / malloc TSD.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.22 -r1.23 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.175 src/lib/libpthread/pthread.c:1.176
--- src/lib/libpthread/pthread.c:1.175	Wed Jun 10 22:45:15 2020
+++ src/lib/libpthread/pthread.c	Thu Jun 11 18:42:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.175 2020/06/10 22:45:15 ad Exp $	*/
+/*	$NetBSD: pthread.c,v 1.176 2020/06/11 18:42:02 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.175 2020/06/10 22:45:15 ad Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.176 2020/06/11 18:42:02 ad Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -615,21 +615,18 @@ pthread_exit(void *retval)
 	pthread_mutex_lock(>pt_lock);
 	self->pt_flags |= PT_FLAG_CS_DISABLED;
 	self->pt_cancel = 0;
+	pthread_mutex_unlock(>pt_lock);
 
 	/* Call any cancellation cleanup handlers */
 	if (!PTQ_EMPTY(>pt_cleanup_stack)) {
-		pthread_mutex_unlock(>pt_lock);
 		while (!PTQ_EMPTY(>pt_cleanup_stack)) {
 			cleanup = PTQ_FIRST(>pt_cleanup_stack);
 			PTQ_REMOVE(>pt_cleanup_stack, cleanup, ptc_next);
 			(*cleanup->ptc_cleanup)(cleanup->ptc_arg);
 		}
-		pthread_mutex_lock(>pt_lock);
 	}
 
-	pthread_mutex_unlock(>pt_lock);
 	__cxa_thread_run_atexit();
-	pthread_mutex_lock(>pt_lock);
 
 	/* Perform cleanup of thread-specific data */
 	pthread__destroy_tsd(self);
@@ -641,6 +638,7 @@ pthread_exit(void *retval)
 	 * Signal our exit.  Our stack and pthread_t won't be reused until
 	 * pthread_create() can see from kernel info that this LWP is gone.
 	 */
+	pthread_mutex_lock(>pt_lock);
 	self->pt_exitval = retval;
 	if (self->pt_flags & PT_FLAG_DETACHED) {
 		/* pthread__reap() will drop the lock. */

Index: src/lib/libpthread/pthread_tsd.c
diff -u src/lib/libpthread/pthread_tsd.c:1.22 src/lib/libpthread/pthread_tsd.c:1.23
--- src/lib/libpthread/pthread_tsd.c:1.22	Sun Apr 19 20:47:03 2020
+++ src/lib/libpthread/pthread_tsd.c	Thu Jun 11 18:42:02 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: pthread_tsd.c,v 1.22 2020/04/19 20:47:03 joerg Exp $	*/
+/*	$NetBSD: pthread_tsd.c,v 1.23 2020/06/11 18:42:02 ad Exp $	*/
 
 /*-
- * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2007, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_tsd.c,v 1.22 2020/04/19 20:47:03 joerg Exp $");
+__RCSID("$NetBSD: pthread_tsd.c,v 1.23 2020/06/11 18:42:02 ad Exp $");
 
 /* Functions and structures dealing with thread-specific data */
 #include 
@@ -323,7 +323,6 @@ pthread__destroy_tsd(pthread_t self)
 
 	if (!self->pt_havespecific)
 		return;
-	pthread_mutex_unlock(>pt_lock);
 
 	/* Butenhof, section 5.4.2 (page 167):
 	 * 
@@ -378,7 +377,6 @@ pthread__destroy_tsd(pthread_t self)
 	} while (!done && --iterations);
 
 	self->pt_havespecific = 0;
-	pthread_mutex_lock(>pt_lock);
 }
 
 void



CVS commit: src/lib/libpthread

2020-06-11 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Jun 11 18:41:22 UTC 2020

Modified Files:
src/lib/libpthread: pthread_mutex.c

Log Message:
Adjust memory barriers.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/lib/libpthread/pthread_mutex.c

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

Modified files:

Index: src/lib/libpthread/pthread_mutex.c
diff -u src/lib/libpthread/pthread_mutex.c:1.80 src/lib/libpthread/pthread_mutex.c:1.81
--- src/lib/libpthread/pthread_mutex.c:1.80	Wed Jun 10 22:45:15 2020
+++ src/lib/libpthread/pthread_mutex.c	Thu Jun 11 18:41:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_mutex.c,v 1.80 2020/06/10 22:45:15 ad Exp $	*/
+/*	$NetBSD: pthread_mutex.c,v 1.81 2020/06/11 18:41:22 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_mutex.c,v 1.80 2020/06/10 22:45:15 ad Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.81 2020/06/11 18:41:22 ad Exp $");
 
 #include 
 #include 
@@ -532,7 +532,7 @@ pthread__mutex_wakeup(pthread_t self, st
 		next = cur->next;
 		pthread__assert(cur->lid != 0);
 		lids[nlid++] = cur->lid;
-		membar_sync();
+		membar_exit();
 		cur->lid = 0;
 		/* No longer safe to touch 'cur' */
 	}
@@ -719,6 +719,9 @@ pthread__mutex_deferwake(pthread_t self,
 	/* Append atomically. */
 	for (o = ptm->ptm_waiters;; o = n) {
 		tail->next = o;
+#ifndef PTHREAD__ATOMIC_IS_MEMBAR
+		membar_producer();
+#endif
 		n = atomic_cas_ptr(>ptm_waiters, o, head);
 		if (__predict_true(n == o)) {
 			break;



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

2020-06-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 11 16:05:54 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
dhcpcd: Disable priviledge separation and sandboxing for SMALLPROG builds

It's a fair chunk of code and is probably safe enough for our ramdisks.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

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/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.52 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.53
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.52	Sat May  2 19:35:03 2020
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Thu Jun 11 16:05:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2020/05/02 19:35:03 fox Exp $
+# $NetBSD: Makefile,v 1.53 2020/06/11 16:05:54 roy Exp $
 #
 
 WARNS?=		6
@@ -13,9 +13,13 @@ SRCS+=		if.c if-options.c route.c sa.c s
 SRCS+=		dhcp-common.c dhcpcd-embedded.c
 SRCS+=		if-bsd.c
 
+# Disable privilege separation and sandboxing
+# This should be fine for ramdisk based installers
+.if !defined(SMALLPROG)
 CPPFLAGS+=	-DPRIVSEP -DPRIVSEP_USER=\"_dhcpcd\"
 SRCS+=		privsep.c privsep-root.c privsep-inet.c
 SRCS+=		privsep-bsd.c
+.endif
 
 CPPFLAGS+=	-DHAVE_CONFIG_H -D_OPENBSD_SOURCE
 
@@ -31,7 +35,9 @@ SRCS+=		auth.c
 .if (${USE_INET} != "no")
 CPPFLAGS+=	-DINET
 SRCS+=		bpf.c dhcp.c ipv4.c
+.if !defined(SMALLPROG)
 SRCS+=		privsep-bpf.c
+.endif
 
 .if (${MKLIBCSANITIZER:Uno} == "yes")
 .if (${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8)



CVS commit: src/sys/dev/pci

2020-06-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jun 11 14:22:10 UTC 2020

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

Log Message:
forgot to commit a header change, again...


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/radeonfbvar.h

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

Modified files:

Index: src/sys/dev/pci/radeonfbvar.h
diff -u src/sys/dev/pci/radeonfbvar.h:1.20 src/sys/dev/pci/radeonfbvar.h:1.21
--- src/sys/dev/pci/radeonfbvar.h:1.20	Wed Nov  5 19:39:17 2014
+++ src/sys/dev/pci/radeonfbvar.h	Thu Jun 11 14:22:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfbvar.h,v 1.20 2014/11/05 19:39:17 macallan Exp $ */
+/* $NetBSD: radeonfbvar.h,v 1.21 2020/06/11 14:22:10 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -184,7 +184,7 @@ struct radeonfb_display {
 	int			rd_ncrtcs;
 	struct radeonfb_crtc	rd_crtcs[2];
 
-	struct radeonfb_cursor	rd_cursor;
+	struct radeonfb_cursor	rd_cursor, rd_tempcursor;
 	/* XXX: this should probaby be an array for CRTCs */
 	//struct videomode	rd_videomode;
 



CVS commit: src/sbin/drvctl

2020-06-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jun 11 13:49:57 UTC 2020

Modified Files:
src/sbin/drvctl: drvctl.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/drvctl/drvctl.c

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

Modified files:

Index: src/sbin/drvctl/drvctl.c
diff -u src/sbin/drvctl/drvctl.c:1.20 src/sbin/drvctl/drvctl.c:1.21
--- src/sbin/drvctl/drvctl.c:1.20	Wed Feb 14 17:43:09 2018
+++ src/sbin/drvctl/drvctl.c	Thu Jun 11 13:49:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.20 2018/02/14 17:43:09 jakllsch Exp $ */
+/* $NetBSD: drvctl.c,v 1.21 2020/06/11 13:49:57 thorpej Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -76,9 +76,8 @@ main(int argc, char **argv)
 	struct devrescanargs raa;
 	int *locs, i;
 	prop_dictionary_t command_dict, args_dict, results_dict, data_dict;
-	prop_string_t string;
-	prop_number_t number;
 	char *xml;
+	int drvctl_error;
 
 	mode = 0;
 	while ((c = getopt(argc, argv, "QRSa:dlnprt")) != -1) {
@@ -164,17 +163,12 @@ main(int argc, char **argv)
 		command_dict = prop_dictionary_create();
 		args_dict = prop_dictionary_create();
 
-		string = prop_string_create_cstring_nocopy("get-properties");
-		prop_dictionary_set(command_dict, "drvctl-command", string);
-		prop_object_release(string);
-
-		string = prop_string_create_cstring(argv[0]);
-		prop_dictionary_set(args_dict, "device-name", string);
-		prop_object_release(string);
-
-		prop_dictionary_set(command_dict, "drvctl-arguments",
+		prop_dictionary_set_string_nocopy(command_dict,
+		"drvctl-command", "get-properties");
+		prop_dictionary_set_string(args_dict, "device-name",
+		argv[0]);
+		prop_dictionary_set_and_rel(command_dict, "drvctl-arguments",
 		args_dict);
-		prop_object_release(args_dict);
 
 		res = prop_dictionary_sendrecv_ioctl(command_dict, fd,
 		DRVCTLCOMMAND, _dict);
@@ -182,11 +176,10 @@ main(int argc, char **argv)
 		if (res)
 			errc(EXIT_FAILURE, res, "DRVCTLCOMMAND");
 
-		number = prop_dictionary_get(results_dict, "drvctl-error");
-		if (prop_number_integer_value(number) != 0) {
-			errc(EXIT_FAILURE,
-			(int)prop_number_integer_value(number),
-			"get-properties");
+		if (prop_dictionary_get_int(results_dict, "drvctl-error",
+	_error) &&
+		drvctl_error != 0) {
+			errc(EXIT_FAILURE, drvctl_error, "get-properties");
 		}
 
 		data_dict = prop_dictionary_get(results_dict,
@@ -271,10 +264,10 @@ display_object(prop_object_t obj, bool n
 		printf("%s\n", prop_bool_true(obj) ? "true" : "false");
 		break;
 	case PROP_TYPE_NUMBER:
-		printf("%" PRId64 "\n", prop_number_integer_value(obj));
+		printf("%" PRId64 "\n", prop_number_signed_value(obj));
 		break;
 	case PROP_TYPE_STRING:
-		printf("%s\n", prop_string_cstring_nocopy(obj));
+		printf("%s\n", prop_string_value(obj));
 		break;
 	case PROP_TYPE_DICTIONARY:
 		xml = prop_dictionary_externalize(obj);



CVS commit: src

2020-06-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jun 11 13:36:20 UTC 2020

Modified Files:
src/share/man/man4: bpf.4
src/sys/net: bpf.c bpf.h bpfdesc.h

Log Message:
bpf(4): Add ioctls BIOCSETWF and BIOCLOCK

Once BIOCLOCK is executed, the device becomes locked which prevents the
execution of ioctl(2) commands which can change the underlying parameters
of the bpf(4) device. An example might be the setting of bpf(4) filter
programs or attaching to different network interfaces.

BIOCSETWF can be used to set write filters for outgoing packets.
Currently if a bpf(4) consumer is compromised, the bpf(4) descriptor can
essentially be used as a raw socket, regardless of consumer's UID.
Write filters give users the ability to constrain which packets can be sent
through the bpf(4) descriptor.

Taken from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/share/man/man4/bpf.4
cvs rdiff -u -r1.236 -r1.237 src/sys/net/bpf.c
cvs rdiff -u -r1.74 -r1.75 src/sys/net/bpf.h
cvs rdiff -u -r1.46 -r1.47 src/sys/net/bpfdesc.h

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

Modified files:

Index: src/share/man/man4/bpf.4
diff -u src/share/man/man4/bpf.4:1.61 src/share/man/man4/bpf.4:1.62
--- src/share/man/man4/bpf.4:1.61	Tue Jun 26 06:47:57 2018
+++ src/share/man/man4/bpf.4	Thu Jun 11 13:36:20 2020
@@ -1,6 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\"	$NetBSD: bpf.4,v 1.61 2018/06/26 06:47:57 msaitoh Exp $
+.\"	$NetBSD: bpf.4,v 1.62 2020/06/11 13:36:20 roy Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1992, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" This document is derived in part from the enet man page (enet.4)
 .\" distributed with 4.3BSD Unix.
 .\"
-.Dd June 22, 2018
+.Dd June 11, 2020
 .Dt BPF 4
 .Os
 .Sh NAME
@@ -231,6 +231,10 @@ This is useful for programs like
 .Xr rarpd 8 ,
 which must respond to messages in real time.
 The default for a new file is off.
+.Dv BIOCLOCK
+Set the locked flag on the bpf descriptor.
+This prevents the execution of ioctl commands which could change the
+underlying operating parameters of the device.
 .It Dv BIOCSETF ( struct bpf_program )
 Sets the filter program used by the kernel to discard uninteresting
 packets.
@@ -256,6 +260,10 @@ are performed.
 See section
 .Sy FILTER MACHINE
 for an explanation of the filter language.
+.It Dv BIOCSETWF ( struct bpf_program )
+Sets the write filter program used by the kernel to control what type
+of packets can be written to the interface.
+See the BIOCSETF command for more information on the bpf filter program.
 .It Dv BIOCVERSION ( struct bpf_version )
 Returns the major and minor version numbers of the filter language currently
 recognized by the kernel.

Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.236 src/sys/net/bpf.c:1.237
--- src/sys/net/bpf.c:1.236	Mon Mar 16 21:20:11 2020
+++ src/sys/net/bpf.c	Thu Jun 11 13:36:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.236 2020/03/16 21:20:11 pgoyette Exp $	*/
+/*	$NetBSD: bpf.c,v 1.237 2020/06/11 13:36:20 roy Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.236 2020/03/16 21:20:11 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.237 2020/06/11 13:36:20 roy Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -236,6 +236,7 @@ static struct pslist_head bpf_dlist;
 	PSLIST_ENTRY_DESTROY((__d), bd_bif_dlist_entry)
 
 static int	bpf_allocbufs(struct bpf_d *);
+static u_int	bpf_xfilter(struct bpf_filter **, void *, u_int, u_int);
 static void	bpf_deliver(struct bpf_if *,
 		void *(*cpfn)(void *, const void *, size_t),
 		void *, u_int, u_int, const u_int);
@@ -244,11 +245,12 @@ static void	bpf_free_filter(struct bpf_f
 static void	bpf_ifname(struct ifnet *, struct ifreq *);
 static void	*bpf_mcpy(void *, const void *, size_t);
 static int	bpf_movein(struct uio *, int, uint64_t,
-			struct mbuf **, struct sockaddr *);
+			struct mbuf **, struct sockaddr *,
+struct bpf_filter **);
 static void	bpf_attachd(struct bpf_d *, struct bpf_if *);
 static void	bpf_detachd(struct bpf_d *);
 static int	bpf_setif(struct bpf_d *, struct ifreq *);
-static int	bpf_setf(struct bpf_d *, struct bpf_program *);
+static int	bpf_setf(struct bpf_d *, struct bpf_program *, u_long);
 static void	bpf_timed_out(void *);
 static inline void
 		bpf_wakeup(struct bpf_d *);
@@ -322,13 +324,14 @@ bpf_jit_freecode(bpfjit_func_t jcode)
 
 static int
 bpf_movein(struct uio *uio, int linktype, uint64_t mtu, struct mbuf **mp,
-	   struct sockaddr *sockp)
+	   struct sockaddr *sockp, struct bpf_filter **wfilter)
 {
 	struct mbuf *m, *m0, *n;
 	int error;
 	size_t len;
 	size_t hlen;
 	size_t align;
+	u_int slen;
 
 	/*
 	 * Build a sockaddr based on the data link layer type.
@@ -431,6 +434,12 @@ bpf_movein(struct uio *uio, int linktype
 		

CVS commit: src/bin/expr

2020-06-11 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 11 13:08:08 UTC 2020

Modified Files:
src/bin/expr: expr.y

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/expr/expr.y

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

Modified files:

Index: src/bin/expr/expr.y
diff -u src/bin/expr/expr.y:1.45 src/bin/expr/expr.y:1.46
--- src/bin/expr/expr.y:1.45	Wed Jun 27 17:23:36 2018
+++ src/bin/expr/expr.y	Thu Jun 11 13:08:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: expr.y,v 1.45 2018/06/27 17:23:36 kamil Exp $ */
+/* $NetBSD: expr.y,v 1.46 2020/06/11 13:08:07 kamil Exp $ */
 
 /*_
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 %{
 #include 
 #ifndef lint
-__RCSID("$NetBSD: expr.y,v 1.45 2018/06/27 17:23:36 kamil Exp $");
+__RCSID("$NetBSD: expr.y,v 1.46 2020/06/11 13:08:07 kamil Exp $");
 #endif /* not lint */
 
 #include 
@@ -361,7 +361,7 @@ perform_arith_op(const char *left, const
 			r = -r;
 		}
 
-		/* - remove the case of legative l and positive r */
+		/* - remove the case of negative l and positive r */
 		if (l < 0 && r >= 0) {
 			/* Use res as a temporary variable */
 			res = l;



CVS commit: src/tests/lib/libpthread

2020-06-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 11 11:40:54 UTC 2020

Modified Files:
src/tests/lib/libpthread: t_mtx.c

Log Message:
Do not destroy mutices that failed to init - fixes a run with
PTHREAD_DIAGASSERT set to "a". Pointed out by joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libpthread/t_mtx.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mtx.c
diff -u src/tests/lib/libpthread/t_mtx.c:1.1 src/tests/lib/libpthread/t_mtx.c:1.2
--- src/tests/lib/libpthread/t_mtx.c:1.1	Wed Apr 24 11:43:19 2019
+++ src/tests/lib/libpthread/t_mtx.c	Thu Jun 11 11:40:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $	*/
+/*	$NetBSD: t_mtx.c,v 1.2 2020/06/11 11:40:54 martin Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2019\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $");
+__RCSID("$NetBSD: t_mtx.c,v 1.2 2020/06/11 11:40:54 martin Exp $");
 
 #include 
 #include 
@@ -62,13 +62,10 @@ ATF_TC_BODY(mtx_init, tc)
 	mtx_destroy();
 
 	ATF_REQUIRE_EQ(mtx_init(, mtx_recursive), thrd_error);
-	mtx_destroy();
 
 	ATF_REQUIRE_EQ(mtx_init(, mtx_plain | mtx_timed), thrd_error);
-	mtx_destroy();
 
 	ATF_REQUIRE_EQ(mtx_init(, -1), thrd_error);
-	mtx_destroy();
 }
 
 ATF_TC(mtx_lock);



CVS commit: src/sys/arch/arm/imx/fdt

2020-06-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 11 11:05:29 UTC 2020

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_iomux.c

Log Message:
Match fsl,imx7d-iomuxc


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_iomux.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/imx/fdt/imx6_iomux.c
diff -u src/sys/arch/arm/imx/fdt/imx6_iomux.c:1.3 src/sys/arch/arm/imx/fdt/imx6_iomux.c:1.4
--- src/sys/arch/arm/imx/fdt/imx6_iomux.c:1.3	Wed Jan 15 01:09:56 2020
+++ src/sys/arch/arm/imx/fdt/imx6_iomux.c	Thu Jun 11 11:05:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_iomux.c,v 1.3 2020/01/15 01:09:56 jmcneill Exp $	*/
+/*	$NetBSD: imx6_iomux.c,v 1.4 2020/06/11 11:05:29 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.3 2020/01/15 01:09:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.4 2020/06/11 11:05:29 jmcneill Exp $");
 
 #include "opt_fdt.h"
 
@@ -134,6 +134,7 @@ imxiomux_match(device_t parent, cfdata_t
 {
 	const char * const compatible[] = {
 		"fsl,imx6q-iomuxc",
+		"fsl,imx7d-iomuxc",
 		"fsl,imx8mq-iomuxc",
 		NULL
 	};



CVS commit: [netbsd-9] src/doc

2020-06-11 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Thu Jun 11 11:04:12 UTC 2020

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

Log Message:
Tickets #957 & #958.


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

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.64 src/doc/CHANGES-9.1:1.1.2.65
--- src/doc/CHANGES-9.1:1.1.2.64	Sun Jun  7 19:08:12 2020
+++ src/doc/CHANGES-9.1	Thu Jun 11 11:04:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.64 2020/06/07 19:08:12 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.65 2020/06/11 11:04:11 jdc Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -2886,3 +2886,16 @@ sys/arch/arm/include/arm32/param.h		1.30
 	_ARCH_ARM_6 has a split of 2:2 and others have a split of 3:1.
 	[skrll, ticket #951]
 
+src/sys/dev/usb/if_otus.c			1.45 (via patch)
+
+	Stricter bounds check for some packet length we get from the usb chip,
+	to make sure we do not corrupt kernel memory.
+	Pointed out by Ilja Van Sprundel.
+	[martin, ticket #957]
+
+src/sys/dev/usb/if_run.c			1.41
+
+	Better bounds checking for oversized packets, to avoid kernel memory
+	corruption. Pointed out by Ilja Van Sprundel.
+	[martin, ticket #958]
+



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

2020-06-11 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Thu Jun 11 11:03:22 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: if_run.c

Log Message:
Pull up following revision (requested by martin in ticket #958):

src/sys/dev/usb/if_run.c: revision 1.41

Better bounds checking for oversized packets, to avoid kernel memory
corruption. Pointed out by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/dev/usb/if_run.c

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

Modified files:

Index: src/sys/dev/usb/if_run.c
diff -u src/sys/dev/usb/if_run.c:1.32 src/sys/dev/usb/if_run.c:1.32.4.1
--- src/sys/dev/usb/if_run.c:1.32	Tue Jan 22 06:47:20 2019
+++ src/sys/dev/usb/if_run.c	Thu Jun 11 11:03:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_run.c,v 1.32 2019/01/22 06:47:20 skrll Exp $	*/
+/*	$NetBSD: if_run.c,v 1.32.4.1 2020/06/11 11:03:22 jdc Exp $	*/
 /*	$OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.32 2019/01/22 06:47:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.32.4.1 2020/06/11 11:03:22 jdc Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2255,7 +2255,8 @@ run_rx_frame(struct run_softc *sc, uint8
 		return;
 	}
 	if (len > MHLEN) {
-		MCLGET(m, M_DONTWAIT);
+		if (__predict_true(len <= MCLBYTES))
+			MCLGET(m, M_DONTWAIT);
 		if (__predict_false(!(m->m_flags & M_EXT))) {
 			ifp->if_ierrors++;
 			m_freem(m);



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

2020-06-11 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Thu Jun 11 11:01:20 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: if_otus.c

Log Message:
Pull up following revision (requested by martin in ticket #957):

src/sys/dev/usb/if_otus.c: revision 1.45 (via patch)

Stricter bounds check for some packet length we get from the usb chip,
to make sure we do not corrupt kernel memory.
Pointed out by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/usb/if_otus.c

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

Modified files:

Index: src/sys/dev/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.38 src/sys/dev/usb/if_otus.c:1.38.2.1
--- src/sys/dev/usb/if_otus.c:1.38	Tue May 28 07:41:50 2019
+++ src/sys/dev/usb/if_otus.c	Thu Jun 11 11:01:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_otus.c,v 1.38 2019/05/28 07:41:50 msaitoh Exp $	*/
+/*	$NetBSD: if_otus.c,v 1.38.2.1 2020/06/11 11:01:20 jdc Exp $	*/
 /*	$OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.38 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.38.2.1 2020/06/11 11:01:20 jdc Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1745,6 +1745,10 @@ otus_sub_rxeof(struct otus_softc *sc, ui
 	}
 	/* Compute MPDU's length. */
 	mlen = len - AR_PLCP_HDR_LEN - sizeof(*tail);
+	if (__predict_false(mlen < IEEE80211_CRC_LEN)) {
+		ifp->if_ierrors++;
+		return;
+	}
 	mlen -= IEEE80211_CRC_LEN;	/* strip 802.11 FCS */
 	/* Make sure there's room for an 802.11 header. */
 	/*
@@ -1765,7 +1769,8 @@ otus_sub_rxeof(struct otus_softc *sc, ui
 		return;
 	}
 	if (align + mlen > MHLEN) {
-		MCLGET(m, M_DONTWAIT);
+		if (__predict_true(align + mlen <= MCLBYTES))
+			MCLGET(m, M_DONTWAIT);
 		if (__predict_false(!(m->m_flags & M_EXT))) {
 			ifp->if_ierrors++;
 			m_freem(m);



CVS commit: src/sys/arch/arm/imx/fdt

2020-06-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jun 11 11:01:16 UTC 2020

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_usb.c imx7d_ccm.c

Log Message:
Add i.MX7 USB support


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_usb.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/fdt/imx7d_ccm.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/imx/fdt/imx6_usb.c
diff -u src/sys/arch/arm/imx/fdt/imx6_usb.c:1.3 src/sys/arch/arm/imx/fdt/imx6_usb.c:1.4
--- src/sys/arch/arm/imx/fdt/imx6_usb.c:1.3	Sun Nov 24 11:07:19 2019
+++ src/sys/arch/arm/imx/fdt/imx6_usb.c	Thu Jun 11 11:01:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usb.c,v 1.3 2019/11/24 11:07:19 skrll Exp $	*/
+/*	$NetBSD: imx6_usb.c,v 1.4 2020/06/11 11:01:16 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.3 2019/11/24 11:07:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.4 2020/06/11 11:01:16 jmcneill Exp $");
 
 #include "opt_fdt.h"
 
@@ -75,6 +75,7 @@ CFATTACH_DECL_NEW(imxusbc_fdt, sizeof(st
 
 static const char * const compatible[] = {
 	"fsl,imx6q-usb",
+	"fsl,imx7d-usb",
 	NULL
 };
 

Index: src/sys/arch/arm/imx/fdt/imx7d_ccm.c
diff -u src/sys/arch/arm/imx/fdt/imx7d_ccm.c:1.1 src/sys/arch/arm/imx/fdt/imx7d_ccm.c:1.2
--- src/sys/arch/arm/imx/fdt/imx7d_ccm.c:1.1	Wed Jun 10 17:57:50 2020
+++ src/sys/arch/arm/imx/fdt/imx7d_ccm.c	Thu Jun 11 11:01:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: imx7d_ccm.c,v 1.1 2020/06/10 17:57:50 jmcneill Exp $ */
+/* $NetBSD: imx7d_ccm.c,v 1.2 2020/06/11 11:01:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: imx7d_ccm.c,v 1.1 2020/06/10 17:57:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx7d_ccm.c,v 1.2 2020/06/11 11:01:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -269,6 +269,10 @@ static struct imx_ccm_clk imx7d_ccm_clks
 	IMX_GATE(USDHC1_ROOT_CLK, "usdhc1_root_clk", "usdhc1_post_div", 0x46c0, __BIT(0)),
 	IMX_GATE(USDHC2_ROOT_CLK, "usdhc2_root_clk", "usdhc2_post_div", 0x46d0, __BIT(0)),
 	IMX_GATE(USDHC3_ROOT_CLK, "usdhc3_root_clk", "usdhc3_post_div", 0x46e0, __BIT(0)),
+
+	IMX_GATE(USB_CTRL_CLK, "usb_ctrl_clk", "ahb_root_clk", 0x4680, __BIT(0)),
+	IMX_GATE(USB_PHY1_CLK, "usb_phy1_clk", "pll_usb1_main_clk", 0x46a0, __BIT(0)),
+	IMX_GATE(USB_PHY2_CLK, "usb_phy2_clk", "pll_usb_main_clk", 0x46b0, __BIT(0)),
 };
 
 static int



CVS commit: src/sys/dev/usb

2020-06-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 11 09:56:57 UTC 2020

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

Log Message:
Better bounds checking for oversized packets, to avoid kernel memory
corruption. Pointed out by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/usb/if_run.c

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

Modified files:

Index: src/sys/dev/usb/if_run.c
diff -u src/sys/dev/usb/if_run.c:1.40 src/sys/dev/usb/if_run.c:1.41
--- src/sys/dev/usb/if_run.c:1.40	Sat Jun  6 13:53:43 2020
+++ src/sys/dev/usb/if_run.c	Thu Jun 11 09:56:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_run.c,v 1.40 2020/06/06 13:53:43 gson Exp $	*/
+/*	$NetBSD: if_run.c,v 1.41 2020/06/11 09:56:57 martin Exp $	*/
 /*	$OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.40 2020/06/06 13:53:43 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.41 2020/06/11 09:56:57 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2345,7 +2345,8 @@ run_rx_frame(struct run_softc *sc, uint8
 		return;
 	}
 	if (len > MHLEN) {
-		MCLGET(m, M_DONTWAIT);
+		if (__predict_true(len <= MCLBYTES))
+			MCLGET(m, M_DONTWAIT);
 		if (__predict_false(!(m->m_flags & M_EXT))) {
 			if_statinc(ifp, if_ierrors);
 			m_freem(m);



CVS commit: src/sys/dev/usb

2020-06-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 11 09:51:37 UTC 2020

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

Log Message:
Stricter bounds check for some packet length we get from the usb chip,
to make sure we do not corrupt kernel memory.
Pointed out by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/if_otus.c

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

Modified files:

Index: src/sys/dev/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.44 src/sys/dev/usb/if_otus.c:1.45
--- src/sys/dev/usb/if_otus.c:1.44	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/usb/if_otus.c	Thu Jun 11 09:51:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_otus.c,v 1.44 2020/03/15 23:04:50 thorpej Exp $	*/
+/*	$NetBSD: if_otus.c,v 1.45 2020/06/11 09:51:37 martin Exp $	*/
 /*	$OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.44 2020/03/15 23:04:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.45 2020/06/11 09:51:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1758,6 +1758,10 @@ otus_sub_rxeof(struct otus_softc *sc, ui
 	}
 	/* Compute MPDU's length. */
 	mlen = len - AR_PLCP_HDR_LEN - sizeof(*tail);
+	if (__predict_false(mlen < IEEE80211_CRC_LEN)) {
+		if_statinc(ifp, if_ierrors);
+		return;
+	}
 	mlen -= IEEE80211_CRC_LEN;	/* strip 802.11 FCS */
 	/* Make sure there's room for an 802.11 header. */
 	/*
@@ -1778,7 +1782,8 @@ otus_sub_rxeof(struct otus_softc *sc, ui
 		return;
 	}
 	if (align + mlen > MHLEN) {
-		MCLGET(m, M_DONTWAIT);
+		if (__predict_true(align + mlen <= MCLBYTES))
+			MCLGET(m, M_DONTWAIT);
 		if (__predict_false(!(m->m_flags & M_EXT))) {
 			if_statinc(ifp, if_ierrors);
 			m_freem(m);



CVS commit: src/sys/dev/pci

2020-06-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 11 09:23:13 UTC 2020

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

Log Message:
No functional change:

 - Rename some macros and function.
 - Add newline.


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

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.677 src/sys/dev/pci/if_wm.c:1.678
--- src/sys/dev/pci/if_wm.c:1.677	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/pci/if_wm.c	Thu Jun 11 09:23:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.677 2020/06/11 02:39:30 thorpej Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.678 2020/06/11 09:23:13 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.677 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.678 2020/06/11 09:23:13 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -165,10 +165,12 @@ int	wm_debug = WM_DEBUG_TX | WM_DEBUG_RX
 
 #ifdef NET_MPSAFE
 #define WM_MPSAFE	1
-#define CALLOUT_FLAGS	CALLOUT_MPSAFE
+#define WM_CALLOUT_FLAGS	CALLOUT_MPSAFE
+#define WM_SOFTINT_FLAGS	SOFTINT_MPSAFE
 #define WM_WORKQUEUE_FLAGS	WQ_PERCPU | WQ_MPSAFE
 #else
-#define CALLOUT_FLAGS	0
+#define WM_CALLOUT_FLAGS	0
+#define WM_SOFTINT_FLAGS	0
 #define WM_WORKQUEUE_FLAGS	WQ_PERCPU
 #endif
 
@@ -758,7 +760,7 @@ static void	wm_init_rss(struct wm_softc 
 static void	wm_adjust_qnum(struct wm_softc *, int);
 static inline bool	wm_is_using_msix(struct wm_softc *);
 static inline bool	wm_is_using_multiqueue(struct wm_softc *);
-static int	wm_softint_establish(struct wm_softc *, int, int);
+static int	wm_softint_establish_queue(struct wm_softc *, int, int);
 static int	wm_setup_legacy(struct wm_softc *);
 static int	wm_setup_msix(struct wm_softc *);
 static int	wm_init(struct ifnet *);
@@ -1839,7 +1841,7 @@ wm_attach(device_t parent, device_t self
 	uint32_t reg;
 
 	sc->sc_dev = self;
-	callout_init(>sc_tick_ch, CALLOUT_FLAGS);
+	callout_init(>sc_tick_ch, WM_CALLOUT_FLAGS);
 	callout_setfunc(>sc_tick_ch, wm_tick, sc);
 	sc->sc_core_stopping = false;
 
@@ -2104,7 +2106,7 @@ alloc_retry:
 		aprint_verbose_dev(sc->sc_dev,
 		"Communication Streaming Architecture\n");
 		if (sc->sc_type == WM_T_82547) {
-			callout_init(>sc_txfifo_ch, CALLOUT_FLAGS);
+			callout_init(>sc_txfifo_ch, WM_CALLOUT_FLAGS);
 			callout_setfunc(>sc_txfifo_ch,
 			wm_82547_txfifo_stall, sc);
 			aprint_verbose_dev(sc->sc_dev,
@@ -5445,17 +5447,14 @@ wm_is_using_multiqueue(struct wm_softc *
 }
 
 static int
-wm_softint_establish(struct wm_softc *sc, int qidx, int intr_idx)
+wm_softint_establish_queue(struct wm_softc *sc, int qidx, int intr_idx)
 {
 	struct wm_queue *wmq = >sc_queue[qidx];
 
 	wmq->wmq_id = qidx;
 	wmq->wmq_intr_idx = intr_idx;
-	wmq->wmq_si = softint_establish(SOFTINT_NET
-#ifdef WM_MPSAFE
-	| SOFTINT_MPSAFE
-#endif
-	, wm_handle_queue, wmq);
+	wmq->wmq_si = softint_establish(SOFTINT_NET | WM_SOFTINT_FLAGS,
+	wm_handle_queue, wmq);
 	if (wmq->wmq_si != NULL)
 		return 0;
 
@@ -5500,7 +5499,7 @@ wm_setup_legacy(struct wm_softc *sc)
 	aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
 	sc->sc_nintrs = 1;
 
-	return wm_softint_establish(sc, 0, 0);
+	return wm_softint_establish_queue(sc, 0, 0);
 }
 
 static int
@@ -5578,7 +5577,7 @@ wm_setup_msix(struct wm_softc *sc)
 			"for TX and RX interrupting at %s\n", intrstr);
 		}
 		sc->sc_ihs[intr_idx] = vih;
-		if (wm_softint_establish(sc, qidx, intr_idx) != 0)
+		if (wm_softint_establish_queue(sc, qidx, intr_idx) != 0)
 			goto fail;
 		txrx_established++;
 		intr_idx++;
@@ -5900,6 +5899,7 @@ wm_init_locked(struct ifnet *ifp)
 			reg &= ~GCR_NO_SNOOP_ALL;
 		CSR_WRITE(sc, WMREG_GCR, reg);
 	}
+
 	if ((sc->sc_type >= WM_T_ICH8)
 	|| (sc->sc_pcidevid == PCI_PRODUCT_INTEL_82546GB_QUAD_COPPER)
 	|| (sc->sc_pcidevid == PCI_PRODUCT_INTEL_82546GB_QUAD_COPPER_KSP3)) {



CVS commit: src/doc

2020-06-11 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Jun 11 09:17:11 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
bsd-family-tree


To generate a diff of this commit:
cvs rdiff -u -r1.1724 -r1.1725 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.1724 src/doc/3RDPARTY:1.1725
--- src/doc/3RDPARTY:1.1724	Thu Jun  4 13:11:03 2020
+++ src/doc/3RDPARTY	Thu Jun 11 09:17:10 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1724 2020/06/04 13:11:03 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1725 2020/06/11 09:17:10 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -208,8 +208,8 @@ Todo[4]: Re-entrant functions of net/*
 Todo[5]: Reconcile the doc directory.
 
 Package:	bsd-family-tree
-Version:	359561
-Current Vers:	359561
+Version:	361673
+Current Vers:	361673
 Maintainer:	The FreeBSD Project
 Archive Site:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 Home Page:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree



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

2020-06-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 11 09:16:05 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
 Fix typo. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.228 src/sys/dev/pci/ixgbe/ixgbe.c:1.229
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.228	Fri Apr 17 02:21:25 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Jun 11 09:16:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.228 2020/04/17 02:21:25 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.229 2020/06/11 09:16:05 msaitoh Exp $ */
 
 /**
 
@@ -409,12 +409,12 @@ static int (*ixgbe_ring_empty)(struct if
 #ifdef NET_MPSAFE
 #define IXGBE_MPSAFE		1
 #define IXGBE_CALLOUT_FLAGS	CALLOUT_MPSAFE
-#define IXGBE_SOFTINFT_FLAGS	SOFTINT_MPSAFE
+#define IXGBE_SOFTINT_FLAGS	SOFTINT_MPSAFE
 #define IXGBE_WORKQUEUE_FLAGS	WQ_PERCPU | WQ_MPSAFE
 #define IXGBE_TASKLET_WQ_FLAGS	WQ_MPSAFE
 #else
 #define IXGBE_CALLOUT_FLAGS	0
-#define IXGBE_SOFTINFT_FLAGS	0
+#define IXGBE_SOFTINT_FLAGS	0
 #define IXGBE_WORKQUEUE_FLAGS	WQ_PERCPU
 #define IXGBE_TASKLET_WQ_FLAGS	0
 #endif
@@ -1100,15 +1100,15 @@ ixgbe_attach(device_t parent, device_t d
 		goto err_late;
 
 	/* Tasklets for Link, SFP, Multispeed Fiber and Flow Director */
-	adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINFT_FLAGS,
+	adapter->link_si = softint_establish(SOFTINT_NET |IXGBE_SOFTINT_FLAGS,
 	ixgbe_handle_link, adapter);
-	adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+	adapter->mod_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 	ixgbe_handle_mod, adapter);
-	adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+	adapter->phy_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 	ixgbe_handle_phy, adapter);
 	if (adapter->feat_en & IXGBE_FEATURE_FDIR)
 		adapter->fdir_si =
-		softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+		softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 			ixgbe_reinit_fdir, adapter);
 	if ((adapter->link_si == NULL) || (adapter->mod_si == NULL)
 	|| (adapter->phy_si == NULL)
@@ -6537,7 +6537,7 @@ alloc_retry:
 	 */
 	if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
 		txr->txr_si =
-		softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+		softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 			ixgbe_deferred_mq_start, txr);
 
 		snprintf(wqname, sizeof(wqname), "%sdeferTx", device_xname(dev));
@@ -6546,7 +6546,7 @@ alloc_retry:
 		IPL_NET, IXGBE_WORKQUEUE_FLAGS);
 		adapter->txr_wq_enqueued = percpu_alloc(sizeof(u_int));
 	}
-	que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+	que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 	ixgbe_handle_que, que);
 	snprintf(wqname, sizeof(wqname), "%sTxRx", device_xname(dev));
 	error = workqueue_create(>que_wq, wqname,
@@ -6686,7 +6686,7 @@ ixgbe_allocate_msix(struct adapter *adap
 
 		if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
 			txr->txr_si = softint_establish(
-SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 ixgbe_deferred_mq_start, txr);
 			if (txr->txr_si == NULL) {
 aprint_error_dev(dev,
@@ -6696,7 +6696,7 @@ ixgbe_allocate_msix(struct adapter *adap
 			}
 		}
 		que->que_si
-		= softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+		= softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 			ixgbe_handle_que, que);
 		if (que->que_si == NULL) {
 			aprint_error_dev(dev,
@@ -6758,7 +6758,7 @@ ixgbe_allocate_msix(struct adapter *adap
 
 	if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) {
 		adapter->mbx_si =
-		softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
+		softint_establish(SOFTINT_NET | IXGBE_SOFTINT_FLAGS,
 			ixgbe_handle_mbx, adapter);
 		if (adapter->mbx_si == NULL) {
 			aprint_error_dev(dev,

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.148 src/sys/dev/pci/ixgbe/ixv.c:1.149
--- src/sys/dev/pci/ixgbe/ixv.c:1.148	Fri Apr 17 02:21:25 2020
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Jun 11 09:16:05 2020
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.148 2020/04/17 02:21:25 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.149 2020/06/11 09:16:05 msaitoh Exp $*/
 
 /**
 
@@ -226,11 +226,11 @@ TUNABLE_INT("hw.ixv.enable_legacy_tx", &
 #ifdef NET_MPSAFE
 #define IXGBE_MPSAFE		1
 #define IXGBE_CALLOUT_FLAGS	CALLOUT_MPSAFE
-#define IXGBE_SOFTINFT_FLAGS	SOFTINT_MPSAFE
+#define IXGBE_SOFTINT_FLAGS	SOFTINT_MPSAFE
 #define IXGBE_WORKQUEUE_FLAGS	WQ_PERCPU | WQ_MPSAFE
 #else
 #define 

CVS commit: src/share/misc

2020-06-11 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Jun 11 09:15:31 UTC 2020

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Sync with r359561


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.81 src/share/misc/bsd-family-tree:1.82
--- src/share/misc/bsd-family-tree:1.81	Thu Apr  2 11:09:24 2020
+++ src/share/misc/bsd-family-tree	Thu Jun 11 09:15:31 2020
@@ -493,7 +493,7 @@ Tenth   Edition 1989-10-xx [QCU]
 2.9BSD-Seismo		1985-08-xx [SMS]
 2.10BSD			1987-04-xx [KKK]
 2.10.1BSD		1989-01-xx [SMS]
-2.11BSD			1992-02-xx [SMS]
+2.11BSD			1991-03-14 [SMS]
 2.11BSD rev #430	1999-12-13 [SMS]
 
 32V			1978-1[01]-xx [QCU] 1979-03-26 [TUHS]
@@ -873,5 +873,5 @@ Steven M. Schultz for providing 2.8BSD, 
 Copyright (c) 1997-2012 Wolfram Schneider 
 URL: https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 
-$FreeBSD: head/share/misc/bsd-family-tree 359561 2020-04-02 11:08:19Z sevan $
-$NetBSD: bsd-family-tree,v 1.81 2020/04/02 11:09:24 sevan Exp $
+$FreeBSD: head/share/misc/bsd-family-tree 361673 2020-05-31 21:38:33Z imp $
+$NetBSD: bsd-family-tree,v 1.82 2020/06/11 09:15:31 sevan Exp $



CVS commit: src/sys/dev/pci

2020-06-11 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Jun 11 09:01:27 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add Intel XMM 7360 LTE Modem


To generate a diff of this commit:
cvs rdiff -u -r1.1414 -r1.1415 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1414 src/sys/dev/pci/pcidevs:1.1415
--- src/sys/dev/pci/pcidevs:1.1414	Tue May 26 19:07:14 2020
+++ src/sys/dev/pci/pcidevs	Thu Jun 11 09:01:27 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1414 2020/05/26 19:07:14 martin Exp $
+$NetBSD: pcidevs,v 1.1415 2020/06/11 09:01:27 jdolecek Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5860,6 +5860,7 @@ product INTEL CP_SCS_REGS	0xd157	Core Pr
 product INTEL CP_MISC_REGS	0xd158	Core Processor Miscellaneous Registers
 product INTEL HANKSVILLE	0xf0fe	HANKSVILLE LAN Controller
 product INTEL SSD_760P		0xf1a6	SSD 760p
+product INTEL XMM7360		0x7360  XMM 7360 LTE Modem
 
 /* Intergraph products */
 product INTERGRAPH 4D60T	0x00e3	Powerstorm 4D60T



CVS commit: src/sys/dev/pci

2020-06-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jun 11 07:51:26 UTC 2020

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

Log Message:
only read the backlight level register on mobility chips


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/radeonfb.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/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.107 src/sys/dev/pci/radeonfb.c:1.108
--- src/sys/dev/pci/radeonfb.c:1.107	Thu Jun 11 07:46:59 2020
+++ src/sys/dev/pci/radeonfb.c	Thu Jun 11 07:51:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.107 2020/06/11 07:46:59 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.108 2020/06/11 07:51:26 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.107 2020/06/11 07:46:59 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.108 2020/06/11 07:51:26 macallan Exp $");
 
 #include 
 #include 
@@ -1022,7 +1022,10 @@ radeonfb_attach(device_t parent, device_
 		callout_setfunc(>rd_bl_lvds_co,
 radeonfb_lvds_callout, dp);
 		dp->rd_bl_on = 1;
-		dp->rd_bl_level = radeonfb_get_backlight(dp);
+		if (sc->sc_flags & RFB_MOB) {
+			dp->rd_bl_level = radeonfb_get_backlight(dp);
+		} else
+			dp->rd_bl_level = 128;
 		radeonfb_set_backlight(dp, dp->rd_bl_level);
 	}
 



CVS commit: src/sys/dev/pci

2020-06-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jun 11 07:46:59 UTC 2020

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

Log Message:
reduce stack usage in radeonfb_pickres() and radeonfb_set_cursor()


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/pci/radeonfb.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/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.106 src/sys/dev/pci/radeonfb.c:1.107
--- src/sys/dev/pci/radeonfb.c:1.106	Thu Feb  6 13:31:30 2020
+++ src/sys/dev/pci/radeonfb.c	Thu Jun 11 07:46:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.106 2020/02/06 13:31:30 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.107 2020/06/11 07:46:59 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.106 2020/02/06 13:31:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.107 2020/06/11 07:46:59 macallan Exp $");
 
 #include 
 #include 
@@ -80,6 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3694,12 +3695,12 @@ radeonfb_set_cursor(struct radeonfb_disp
 	unsigned	index, count;
 	int		i, err;
 	int		pitch, size;
-	struct radeonfb_cursor	nc;
+	struct radeonfb_cursor	*nc = >rd_tempcursor;
 
 	flags = wc->which;
 
 	/* copy old values */
-	nc = dp->rd_cursor;
+	memcpy(nc, >rd_cursor, sizeof(struct radeonfb_cursor));
 
 	if (flags & WSDISPLAY_CURSOR_DOCMAP) {
 		index = wc->cmap.index;
@@ -3719,7 +3720,7 @@ radeonfb_set_cursor(struct radeonfb_disp
 			return err;
 
 		for (i = index; i < index + count; i++) {
-			nc.rc_cmap[i] =
+			nc->rc_cmap[i] =
 			(r[i] << 16) + (g[i] << 8) + (b[i] << 0);
 		}
 	}
@@ -3734,46 +3735,46 @@ radeonfb_set_cursor(struct radeonfb_disp
 		size = pitch * wc->size.y;
 
 		/* clear the old cursor and mask */
-		memset(nc.rc_image, 0, 512);
-		memset(nc.rc_mask, 0, 512);
+		memset(nc->rc_image, 0, 512);
+		memset(nc->rc_mask, 0, 512);
 
-		nc.rc_size = wc->size;
+		nc->rc_size = wc->size;
 
-		if ((err = copyin(wc->image, nc.rc_image, size)) != 0)
+		if ((err = copyin(wc->image, nc->rc_image, size)) != 0)
 			return err;
 
-		if ((err = copyin(wc->mask, nc.rc_mask, size)) != 0)
+		if ((err = copyin(wc->mask, nc->rc_mask, size)) != 0)
 			return err;
 	}
 
 	if (flags & WSDISPLAY_CURSOR_DOHOT) {
-		nc.rc_hot = wc->hot;
-		if (nc.rc_hot.x >= nc.rc_size.x)
-			nc.rc_hot.x = nc.rc_size.x - 1;
-		if (nc.rc_hot.y >= nc.rc_size.y)
-			nc.rc_hot.y = nc.rc_size.y - 1;
+		nc->rc_hot = wc->hot;
+		if (nc->rc_hot.x >= nc->rc_size.x)
+			nc->rc_hot.x = nc->rc_size.x - 1;
+		if (nc->rc_hot.y >= nc->rc_size.y)
+			nc->rc_hot.y = nc->rc_size.y - 1;
 	}
 
 	if (flags & WSDISPLAY_CURSOR_DOPOS) {
-		nc.rc_pos = wc->pos;
-		if (nc.rc_pos.x >= dp->rd_virtx)
-			nc.rc_pos.x = dp->rd_virtx - 1;
+		nc->rc_pos = wc->pos;
+		if (nc->rc_pos.x >= dp->rd_virtx)
+			nc->rc_pos.x = dp->rd_virtx - 1;
 #if 0
-		if (nc.rc_pos.x < 0)
-			nc.rc_pos.x = 0;
+		if (nc->rc_pos.x < 0)
+			nc->rc_pos.x = 0;
 #endif
-		if (nc.rc_pos.y >= dp->rd_virty)
-			nc.rc_pos.y = dp->rd_virty - 1;
+		if (nc->rc_pos.y >= dp->rd_virty)
+			nc->rc_pos.y = dp->rd_virty - 1;
 #if 0
-		if (nc.rc_pos.y < 0)
-			nc.rc_pos.y = 0;
+		if (nc->rc_pos.y < 0)
+			nc->rc_pos.y = 0;
 #endif
 	}
 	if (flags & WSDISPLAY_CURSOR_DOCUR) {
-		nc.rc_visible = wc->enable;
+		nc->rc_visible = wc->enable;
 	}
 
-	dp->rd_cursor = nc;
+	memcpy(>rd_cursor, nc, sizeof(struct radeonfb_cursor));
 	radeonfb_cursor_update(dp, wc->which);
 
 	return 0;
@@ -4174,10 +4175,14 @@ radeonfb_pickres(struct radeonfb_display
 		}
 
 	} else {
-		struct videomode	modes[64];
+		struct videomode	*modes;
+		size_t			smodes;
 		int			nmodes = 0;
 		int			valid = 0;
 
+		smodes = sizeof(struct videomode) * 64;
+		modes = kmem_alloc(smodes, KM_SLEEP);
+
 		for (i = 0; i < dp->rd_ncrtcs; i++) {
 			/*
 			 * pick the largest resolution in common.
@@ -4246,6 +4251,8 @@ radeonfb_pickres(struct radeonfb_display
 *y = modes[i].vdisplay;
 			}
 		}
+		kmem_free(modes, smodes);
+
 	}
 
 	if ((*x == 0) || (*y == 0)) {