CVS commit: src/sys/dev/pci

2020-01-22 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Jan 23 07:49:57 UTC 2020

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

Log Message:
fix softint_disestablish() in wm_detach().

ok by msaitoh@n.o

XXX pullup-8, pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.660 -r1.661 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.660 src/sys/dev/pci/if_wm.c:1.661
--- src/sys/dev/pci/if_wm.c:1.660	Tue Jan 21 08:50:54 2020
+++ src/sys/dev/pci/if_wm.c	Thu Jan 23 07:49:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.660 2020/01/21 08:50:54 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.661 2020/01/23 07:49:57 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.660 2020/01/21 08:50:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.661 2020/01/23 07:49:57 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3096,6 +3096,9 @@ wm_detach(device_t self, int flags __unu
 	}
 	pci_intr_release(sc->sc_pc, sc->sc_intrs, sc->sc_nintrs);
 
+	for (i = 0; i < sc->sc_nqueues; i++)
+		softint_disestablish(sc->sc_queue[i].wmq_si);
+
 	wm_free_txrx_queues(sc);
 
 	/* Unmap the registers */



CVS commit: src/crypto/external/bsd/openssl/lib/libcryptotest

2020-01-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 23 07:27:00 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcryptotest: Makefile

Log Message:
add new random.c.  builds for me.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/openssl/lib/libcryptotest/Makefile

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/lib/libcryptotest/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcryptotest/Makefile:1.1 src/crypto/external/bsd/openssl/lib/libcryptotest/Makefile:1.2
--- src/crypto/external/bsd/openssl/lib/libcryptotest/Makefile:1.1	Sun Sep 23 13:33:09 2018
+++ src/crypto/external/bsd/openssl/lib/libcryptotest/Makefile	Thu Jan 23 07:27:00 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/09/23 13:33:09 christos Exp $
+# $NetBSD: Makefile,v 1.2 2020/01/23 07:27:00 mrg Exp $
 
 LIBISPRIVATE=	yes
 LIB=		cryptotest
@@ -13,6 +13,6 @@ CRYPTODIST= ${NETBSDSRCDIR}/crypto
 CPPFLAGS+= -I${OPENSSLSRC}/include
 
 SRCS+=	tests.c format_output.c output_helpers.c basic_output.c stanza.c
-SRCS+=	main.c tap_bio.c driver.c init.c test_cleanup.c cb.c
+SRCS+=	main.c tap_bio.c driver.c init.c test_cleanup.c cb.c random.c
 
 .include 



CVS commit: src/tests/lib/libc/sys

2020-01-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 23 06:17:22 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Fix the build: access_regs_set_unaligned_pc_* tests depend on availability
of gpregs


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.147 src/tests/lib/libc/sys/t_ptrace_wait.c:1.148
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.147	Tue Jan 21 16:46:07 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Thu Jan 23 06:17:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.147 2020/01/21 16:46:07 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.148 2020/01/23 06:17:21 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.147 2020/01/21 16:46:07 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.148 2020/01/23 06:17:21 martin Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -8449,9 +8449,9 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC_HAVE_GPREGS(tp, access_regs5);
 	ATF_TP_ADD_TC_HAVE_GPREGS(tp, access_regs6);
 
-	ATF_TP_ADD_TC(tp, access_regs_set_unaligned_pc_0x1);
-	ATF_TP_ADD_TC(tp, access_regs_set_unaligned_pc_0x3);
-	ATF_TP_ADD_TC(tp, access_regs_set_unaligned_pc_0x7);
+	ATF_TP_ADD_TC_HAVE_GPREGS(tp, access_regs_set_unaligned_pc_0x1);
+	ATF_TP_ADD_TC_HAVE_GPREGS(tp, access_regs_set_unaligned_pc_0x3);
+	ATF_TP_ADD_TC_HAVE_GPREGS(tp, access_regs_set_unaligned_pc_0x7);
 
 	ATF_TP_ADD_TC_HAVE_FPREGS(tp, access_fpregs1);
 	ATF_TP_ADD_TC_HAVE_FPREGS(tp, access_fpregs2);



CVS commit: src/doc

2020-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 23 02:57:25 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1685 -r1.1686 src/doc/3RDPARTY
cvs rdiff -u -r1.2641 -r1.2642 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1685 src/doc/3RDPARTY:1.1686
--- src/doc/3RDPARTY:1.1685	Mon Jan  6 16:04:58 2020
+++ src/doc/3RDPARTY	Wed Jan 22 21:57:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1685 2020/01/06 21:04:58 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1686 2020/01/23 02:57:25 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1087,7 +1087,7 @@ markus is very cooperative about it):
 - adjust the DEFAULT_PKCS11_WHITELIST for ssh-agent
 
 Package:	OpenSSL
-Version:	1.0.2o/1.1.1c
+Version:	1.0.2o/1.1.1d
 Current Vers:	1.0.2t/1.1.1d
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2641 src/doc/CHANGES:1.2642
--- src/doc/CHANGES:1.2641	Mon Jan 20 13:39:43 2020
+++ src/doc/CHANGES	Wed Jan 22 21:57:25 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2641 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2642 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -103,3 +103,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	de(4): Removed from the tree. [thorpej 20200119]
 	token ring and tr(4): Removed from the tree. [20200119]
 	fddi, fpa(4), fta(4), fea(4): Removed from the tree. [20200120]
+	OpenSSL: Imported 1.1.1d. [christos 20200122]



CVS commit: src/sys/compat/common

2020-01-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 22 23:41:29 UTC 2020

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
Since this used to be part of the compat_50 module, make it depend on
compat_50 rather than compat_60 module.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_50_quota.c

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

Modified files:

Index: src/sys/compat/common/compat_50_quota.c
diff -u src/sys/compat/common/compat_50_quota.c:1.1 src/sys/compat/common/compat_50_quota.c:1.2
--- src/sys/compat/common/compat_50_quota.c:1.1	Tue Jan 21 02:37:16 2020
+++ src/sys/compat/common/compat_50_quota.c	Wed Jan 22 23:41:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_50_quota.c,v 1.1 2020/01/21 02:37:16 pgoyette Exp $ */
+/*	$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.1 2020/01/21 02:37:16 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -164,7 +164,7 @@ compat_50_sys_quotactl(struct lwp *l, co
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_60");
+MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_50");
 
 static int
 compat_50_quota_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/dev

2020-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 22 23:19:12 UTC 2020

Modified Files:
src/sys/dev/fdt: dwcmmc_fdt.c
src/sys/dev/ic: dwc_mmc.c dwc_mmc_reg.h dwc_mmc_var.h

Log Message:
dwc_mmc fixes:
 - Rockchip uses a different SDIO int bit, so take this into consideration
 - Avoid unnecessary resets and always wait for resets to complete
 - kpause instead of delay while holding spinlock
 - Do not attempt autostop for SD_IO_RW_EXTENDED commands
 - Allow for sub-blklen byte counts for single block transfers


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/fdt/dwcmmc_fdt.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/dwc_mmc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_mmc_reg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/dwc_mmc_var.h

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

Modified files:

Index: src/sys/dev/fdt/dwcmmc_fdt.c
diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.10 src/sys/dev/fdt/dwcmmc_fdt.c:1.11
--- src/sys/dev/fdt/dwcmmc_fdt.c:1.10	Wed Jan  1 12:18:18 2020
+++ src/sys/dev/fdt/dwcmmc_fdt.c	Wed Jan 22 23:19:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwcmmc_fdt.c,v 1.10 2020/01/01 12:18:18 jmcneill Exp $ */
+/* $NetBSD: dwcmmc_fdt.c,v 1.11 2020/01/22 23:19:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.10 2020/01/01 12:18:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.11 2020/01/22 23:19:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -56,12 +56,14 @@ static int	dwcmmc_fdt_signal_voltage(str
 struct dwcmmc_fdt_config {
 	u_int		ciu_div;
 	u_int		flags;
+	uint32_t	intr_cardmask;
 };
 
 static const struct dwcmmc_fdt_config dwcmmc_rk3288_config = {
 	.ciu_div = 2,
 	.flags = DWC_MMC_F_USE_HOLD_REG |
 		 DWC_MMC_F_DMA,
+	.intr_cardmask = __BIT(24),
 };
 
 static const struct of_compat_data compat_data[] = {
@@ -156,6 +158,7 @@ dwcmmc_fdt_attach(device_t parent, devic
 		sc->sc_bus_width = 4;
 
 	sc->sc_fifo_depth = fifo_depth;
+	sc->sc_intr_cardmask = esc->sc_conf->intr_cardmask;
 	sc->sc_ciu_div = esc->sc_conf->ciu_div;
 	sc->sc_flags = esc->sc_conf->flags;
 	sc->sc_pre_power_on = dwcmmc_fdt_pre_power_on;

Index: src/sys/dev/ic/dwc_mmc.c
diff -u src/sys/dev/ic/dwc_mmc.c:1.20 src/sys/dev/ic/dwc_mmc.c:1.21
--- src/sys/dev/ic/dwc_mmc.c:1.20	Wed Jan  1 12:18:18 2020
+++ src/sys/dev/ic/dwc_mmc.c	Wed Jan 22 23:19:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.20 2020/01/01 12:18:18 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.21 2020/01/22 23:19:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.20 2020/01/01 12:18:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.21 2020/01/22 23:19:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -35,6 +35,7 @@ __KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -532,7 +533,6 @@ dwc_mmc_dma_prepare(struct dwc_mmc_softc
 	val |= DWC_MMC_GCTRL_DMARESET;
 	MMC_WRITE(sc, DWC_MMC_GCTRL, val);
 
-	MMC_WRITE(sc, DWC_MMC_DMAC, DWC_MMC_DMAC_SOFTRESET);
 	if (cmd->c_flags & SCF_CMD_READ)
 		val = DWC_MMC_IDST_RECEIVE_INT;
 	else
@@ -597,7 +597,7 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 	if (ISSET(sc->sc_flags, DWC_MMC_F_USE_HOLD_REG))
 		cmdval |= DWC_MMC_CMD_USE_HOLD_REG;
 
-	if (cmd->c_opcode == 0)
+	if (cmd->c_opcode == MMC_GO_IDLE_STATE)
 		cmdval |= DWC_MMC_CMD_SEND_INIT_SEQ;
 	if (cmd->c_flags & SCF_RSP_PRESENT)
 		cmdval |= DWC_MMC_CMD_RSP_EXP;
@@ -611,6 +611,14 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 	if (cmd->c_datalen > 0) {
 		unsigned int nblks;
 
+		MMC_WRITE(sc, DWC_MMC_GCTRL,
+		MMC_READ(sc, DWC_MMC_GCTRL) | DWC_MMC_GCTRL_FIFORESET);
+		for (retry = 0; retry < 100; retry++) {
+			if (!(MMC_READ(sc, DWC_MMC_DMAC) & DWC_MMC_DMAC_SOFTRESET))
+break;
+			kpause("dwcmmcfifo", false, uimax(mstohz(1), 1), >sc_intr_lock);
+		}
+
 		cmdval |= DWC_MMC_CMD_DATA_EXP | DWC_MMC_CMD_WAIT_PRE_OVER;
 		if (!ISSET(cmd->c_flags, SCF_CMD_READ)) {
 			cmdval |= DWC_MMC_CMD_WRITE;
@@ -620,15 +628,22 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 		if (nblks == 0 || (cmd->c_datalen % cmd->c_blklen) != 0)
 			++nblks;
 
-		if (nblks > 1) {
+		if (nblks > 1 && cmd->c_opcode != SD_IO_RW_EXTENDED) {
 			cmdval |= DWC_MMC_CMD_SEND_AUTO_STOP;
 			imask |= DWC_MMC_INT_AUTO_CMD_DONE;
 		} else {
 			imask |= DWC_MMC_INT_DATA_OVER;
 		}
 
+		MMC_WRITE(sc, DWC_MMC_TIMEOUT, 0x);
 		MMC_WRITE(sc, DWC_MMC_BLKSZ, cmd->c_blklen);
-		MMC_WRITE(sc, DWC_MMC_BYTECNT, nblks * cmd->c_blklen);
+		MMC_WRITE(sc, DWC_MMC_BYTECNT,
+		nblks > 1 ? nblks * cmd->c_blklen : cmd->c_datalen);
+		if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
+			MMC_WRITE(sc, DWC_MMC_CARDTHRCTL,
+			__SHIFTIN(cmd->c_blklen, DWC_MMC_CARDTHRCTL_RDTHR) |
+			DWC_MMC_CARDTHRCTL_RDTHREN);
+		}
 	}
 

CVS commit: src/sys/kern

2020-01-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 22 22:39:27 UTC 2020

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

Log Message:
Enhance debug message when autoloading a module.  Identify the pid
of the process that triggered the autoload, as well as its p_comm
and the status.

This is only triggered if you've requested DEBUG messages by setting
the kern.module.verbose sysctl(8) variable.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/kern_module.c

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

Modified files:

Index: src/sys/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.145 src/sys/kern/kern_module.c:1.146
--- src/sys/kern/kern_module.c:1.145	Tue Jan 21 15:26:36 2020
+++ src/sys/kern/kern_module.c	Wed Jan 22 22:39:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.145 2020/01/21 15:26:36 christos Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.146 2020/01/22 22:39:27 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.145 2020/01/21 15:26:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.146 2020/01/22 22:39:27 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_module.
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -677,6 +678,7 @@ int
 module_autoload(const char *filename, modclass_t modclass)
 {
 	int error;
+	struct proc *p = curlwp->l_proc;
 
 	kernconfig_lock();
 
@@ -701,6 +703,8 @@ module_autoload(const char *filename, mo
 		error = module_do_load(filename, false, 0, NULL, NULL, modclass,
 		true);
 
+	module_print("Autoload for `%s' requested by pid %d (%s), status %d\n",
+	filename, p->p_pid, p->p_comm, error);
 	kernconfig_unlock();
 	return error;
 }



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

2020-01-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jan 22 22:29:29 UTC 2020

Modified Files:
src/sys/arch/macppc/conf: GENERIC

Log Message:
enable CPU speed / voltage control via GPIOs and/or DFS
should work on most *Book G4
( notable exception - TiBooks. They use a completely different mechanism )


To generate a diff of this commit:
cvs rdiff -u -r1.361 -r1.362 src/sys/arch/macppc/conf/GENERIC

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

Modified files:

Index: src/sys/arch/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.361 src/sys/arch/macppc/conf/GENERIC:1.362
--- src/sys/arch/macppc/conf/GENERIC:1.361	Mon Jan 20 18:38:20 2020
+++ src/sys/arch/macppc/conf/GENERIC	Wed Jan 22 22:29:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.361 2020/01/20 18:38:20 thorpej Exp $
+# $NetBSD: GENERIC,v 1.362 2020/01/22 22:29:28 macallan Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.361 $"
+#ident 		"GENERIC-$Revision: 1.362 $"
 
 maxusers	32
 
@@ -329,6 +329,9 @@ mc*	at obio?			# MACE ethernet
 esp*	at obio? flags 0x00ff		# 53c9x SCSI
 mesh*	at obio? flags 0x		# MESH SCSI
 nvram*	at obio?			# nvram
+options OBIO_SPEED_CONTROL		# CPU speed / voltage control via GPIOs
+	# and/or DFS, found on most *Book G4
+
 
 # the traditional ADB subsystem
 



CVS commit: src/usr.bin/make/filemon

2020-01-22 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Wed Jan 22 22:10:36 UTC 2020

Modified Files:
src/usr.bin/make/filemon: filemon.h

Log Message:
Rename guard to avoid that already used by Linux filemon.h

Reviewed by: riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/filemon/filemon.h

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

Modified files:

Index: src/usr.bin/make/filemon/filemon.h
diff -u src/usr.bin/make/filemon/filemon.h:1.1 src/usr.bin/make/filemon/filemon.h:1.2
--- src/usr.bin/make/filemon/filemon.h:1.1	Sun Jan 19 19:49:37 2020
+++ src/usr.bin/make/filemon/filemon.h	Wed Jan 22 22:10:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: filemon.h,v 1.1 2020/01/19 19:49:37 riastradh Exp $	*/
+/*	$NetBSD: filemon.h,v 1.2 2020/01/22 22:10:36 sjg Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,8 +29,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef FILEMON_H
-#define	FILEMON_H
+#ifndef FILEMON_H_
+#define	FILEMON_H_
 
 #include 
 
@@ -50,4 +50,4 @@ int	filemon_setpid_child(const struct fi
 int	filemon_readfd(const struct filemon *);
 int	filemon_process(struct filemon *);
 
-#endif	/* FILEMON_H */
+#endif	/* FILEMON_H_ */



CVS commit: src/sys/dev/ic

2020-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 22 21:59:10 UTC 2020

Modified Files:
src/sys/dev/ic: dwc_mmc_reg.h

Log Message:
Fix DWC_MMC_INT_SDIO_INT bit


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/dwc_mmc_reg.h

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

Modified files:

Index: src/sys/dev/ic/dwc_mmc_reg.h
diff -u src/sys/dev/ic/dwc_mmc_reg.h:1.7 src/sys/dev/ic/dwc_mmc_reg.h:1.8
--- src/sys/dev/ic/dwc_mmc_reg.h:1.7	Sat Jun 16 00:15:40 2018
+++ src/sys/dev/ic/dwc_mmc_reg.h	Wed Jan 22 21:59:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc_reg.h,v 1.7 2018/06/16 00:15:40 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc_reg.h,v 1.8 2020/01/22 21:59:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -107,7 +107,7 @@
 
 #define DWC_MMC_INT_CARD_REMOVE		__BIT(31)
 #define DWC_MMC_INT_CARD_INSERT		__BIT(30)
-#define DWC_MMC_INT_SDIO_INT		__BIT(16)
+#define DWC_MMC_INT_SDIO_INT		__BIT(24)
 #define DWC_MMC_INT_END_BIT_ERR		__BIT(15)
 #define DWC_MMC_INT_AUTO_CMD_DONE	__BIT(14)
 #define DWC_MMC_INT_START_BIT_ERR	__BIT(13)



CVS commit: src/share/mk

2020-01-22 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 22 21:46:07 UTC 2020

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

Log Message:
Switch powerpc to GCC 8 again now that alloca() is fixed.
PR port-macppc/54827


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

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1174 src/share/mk/bsd.own.mk:1.1175
--- src/share/mk/bsd.own.mk:1.1174	Wed Jan 22 08:32:33 2020
+++ src/share/mk/bsd.own.mk	Wed Jan 22 21:46:06 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1174 2020/01/22 08:32:33 uwe Exp $
+#	$NetBSD: bsd.own.mk,v 1.1175 2020/01/22 21:46:06 uwe Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -70,6 +70,7 @@ TOOLCHAIN_MISSING?=	no
 ${MACHINE} == "sparc64" || \
 ${MACHINE_CPU} == "aarch64" || \
 ${MACHINE_CPU} == "arm" || \
+${MACHINE_CPU} == "powerpc" || \
 ${MACHINE_CPU} == "powerpc64" || \
 ${MACHINE_CPU} == "riscv"
 HAVE_GCC?=	8



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2020-01-22 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 22 21:39:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd.h

Log Message:
Do not override STACK_BOUNDARY in netbsd.h

sysv4.h already overrides PREFERRED_STACK_BOUNDARY b/c SYSV ABI
requires 16 bytes alignment for %sp anyway and so we already get that
for free.

More importantly this also fixes alloca() in GCC 8, that was somehow
confused by that STACK_BOUNDARY value we had and created a buffer that
overlapped top local variable slots.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.14 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.14	Tue Oct  1 10:38:19 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h	Wed Jan 22 21:39:43 2020
@@ -138,10 +138,6 @@
 #define TRAMPOLINE_SIZE 48
 #endif
 
-/* Override STACK_BOUNDARY to use Altivec compliant one.  */
-#undef STACK_BOUNDARY
-#define STACK_BOUNDARY	128
-
 /* Use standard DWARF numbering for DWARF debugging information.  */
 #define RS6000_USE_DWARF_NUMBERING
 



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

2020-01-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Jan 22 21:21:24 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_vcaudio.c bcm2835_vcaudioreg.h

Log Message:
Adapt to changed 64bit vchiq interface.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_vcaudio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.14 src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.15
--- src/sys/arch/arm/broadcom/bcm2835_vcaudio.c:1.14	Wed May  8 13:40:14 2019
+++ src/sys/arch/arm/broadcom/bcm2835_vcaudio.c	Wed Jan 22 21:21:24 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_vcaudio.c,v 1.14 2019/05/08 13:40:14 isaki Exp $ */
+/* $NetBSD: bcm2835_vcaudio.c,v 1.15 2020/01/22 21:21:24 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.14 2019/05/08 13:40:14 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.15 2020/01/22 21:21:24 mlelstv Exp $");
 
 #include 
 #include 
@@ -371,8 +371,6 @@ vcaudio_service_callback(void *priv, con
 	VC_AUDIO_MSG_T msg;
 	int32_t msglen = 0;
 	int error;
-	void (*intr)(void *) = NULL;
-	void *intrarg = NULL;
 
 	if (sc == NULL || reason != VCHI_CALLBACK_MSG_AVAILABLE)
 		return;
@@ -396,9 +394,8 @@ vcaudio_service_callback(void *priv, con
 		break;
 
 	case VC_AUDIO_MSG_TYPE_COMPLETE:
-		intr = msg.u.complete.callback;
-		intrarg = msg.u.complete.cookie;
-		if (intr && intrarg) {
+		if (msg.u.complete.cookie1 == VC_AUDIO_WRITE_COOKIE1 &&
+		msg.u.complete.cookie2 == VC_AUDIO_WRITE_COOKIE2) {
 			int count = msg.u.complete.count & 0x;
 			int perr = (msg.u.complete.count & __BIT(30)) != 0;
 			bool sched = false;
@@ -420,7 +417,7 @@ vcaudio_service_callback(void *priv, con
 			}
 
 			if (sched && sc->sc_pint) {
-intr(intrarg);
+sc->sc_pint(sc->sc_pintarg);
 sc->sc_abytes += sc->sc_pblksize;
 cv_signal(>sc_datacv);
 			}
@@ -465,8 +462,8 @@ vcaudio_worker(void *priv)
 		msg.type = VC_AUDIO_MSG_TYPE_WRITE;
 		msg.u.write.max_packet = VCAUDIO_MSGSIZE;
 		msg.u.write.count = count;
-		msg.u.write.callback = intr;
-		msg.u.write.cookie = intrarg;
+		msg.u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1;
+		msg.u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2;
 		msg.u.write.silence = 0;
 
 		block = (uint8_t *)sc->sc_pstart + sc->sc_ppos;

Index: src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h
diff -u src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h:1.3 src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h:1.4
--- src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h:1.3	Fri Apr 25 15:51:12 2014
+++ src/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h	Wed Jan 22 21:21:24 2020
@@ -33,6 +33,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 
 // FourCC code used for VCHI connection
 #define VC_AUDIO_SERVER_NAME  MAKE_FOURCC("AUDS")
+#define VC_AUDIO_WRITE_COOKIE1  MAKE_FOURCC("BCMA")
+#define VC_AUDIO_WRITE_COOKIE2  MAKE_FOURCC("DATA")
 
 // Maximum message length
 #define VC_AUDIO_MAX_MSG_LEN  (sizeof( VC_AUDIO_MSG_T ))
@@ -115,8 +117,8 @@ typedef struct
 typedef struct
 {
uint32_t count; // in bytes
-   void *callback;
-   void *cookie;
+   uint32_t cookie1;
+   uint32_t cookie2;
uint16_t silence;
uint16_t max_packet;
 } VC_AUDIO_WRITE_T;
@@ -132,8 +134,8 @@ typedef struct
 typedef struct
 {
int32_t count;  // Success value
-   void *callback;
-   void *cookie;
+   uint32_t cookie1;
+   uint32_t cookie2;
 } VC_AUDIO_COMPLETE_T;
 
 // Message header for all messages in HOST->VC direction



CVS commit: src/usr.bin/calendar/calendars

2020-01-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Wed Jan 22 21:07:56 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday

Log Message:
Add Terry Jones, once clarified who wasn't the messiah, but a very naughty boy


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/calendar/calendars/calendar.birthday

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.birthday
diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.35 src/usr.bin/calendar/calendars/calendar.birthday:1.36
--- src/usr.bin/calendar/calendars/calendar.birthday:1.35	Sat Nov 30 12:04:13 2019
+++ src/usr.bin/calendar/calendars/calendar.birthday	Wed Jan 22 21:07:56 2020
@@ -22,6 +22,7 @@
 01/19	Robert Edward Lee born in Stratford Estate, Virginia, 1807
 01/20	Buzz Aldrin born, 1930
 01/20	George Burns born, 1898
+01/21	Terence Graham Parry Jones died in London, England, 2020
 01/21	Thomas Jonathan "Stonewall" Jackson born in Clarksburg, VA, 1824
 01/21	Vladimir Lenin died, 1924
 01/22	Sir Francis Bacon born, 1561
@@ -36,6 +37,7 @@
 01/27	Samuel Gompers born, 1850
 01/30	Franklin Delano Roosevelt born in Hyde Park, New York, 1882
 01/31	Jackie Robinson born, 1919
+02/01	Terence Graham Parry Jones was born in Colwyn Bay, Denbighshire, Wales, 1942
 02/03	Gertrude Stein born, 1874
 02/05	Alex Harvey (SAHB) born in Glasgow, Scotland, 1935
 02/06	King George VI of UK dies;  his daughter becomes Elizabeth II, 1952



CVS commit: src/usr.bin/make

2020-01-22 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Wed Jan 22 21:04:29 UTC 2020

Modified Files:
src/usr.bin/make: meta.c

Log Message:
Check for filemon valid.

If meta_needed() returns FALSE, mfp and filemon will be NULL
in which case we should not call filemon_*().


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.76 src/usr.bin/make/meta.c:1.77
--- src/usr.bin/make/meta.c:1.76	Wed Jan 22 00:26:45 2020
+++ src/usr.bin/make/meta.c	Wed Jan 22 21:04:29 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.76 2020/01/22 00:26:45 sjg Exp $ */
+/*  $NetBSD: meta.c,v 1.77 2020/01/22 21:04:29 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -124,7 +124,7 @@ meta_open_filemon(BuildMon *pbm)
 
 pbm->mon_fd = -1;
 pbm->filemon = NULL;
-if (!useFilemon)
+if (!useFilemon || !pbm->mfp)
 	return;
 
 pbm->filemon = filemon_open();
@@ -701,7 +701,7 @@ meta_job_child(Job *job)
 }
 if (pbm->mfp != NULL) {
 	close(fileno(pbm->mfp));
-	if (useFilemon) {
+	if (useFilemon && pbm->filemon) {
 	pid_t pid;
 
 	pid = getpid();
@@ -724,7 +724,7 @@ meta_job_parent(Job *job, pid_t pid)
 } else {
 	pbm = 
 }
-if (useFilemon) {
+if (useFilemon && pbm->filemon) {
 	filemon_setpid_parent(pbm->filemon, pid);
 }
 #endif
@@ -1686,6 +1686,8 @@ meta_compat_parent(pid_t child)
 meta_job_parent(NULL, child);
 close(childPipe[1]);			/* child side */
 outfd = childPipe[0];
+if (!Mybm.filemon)/* no meta  */
+	return;
 metafd = filemon_readfd(Mybm.filemon);
 
 maxfd = -1;



CVS commit: src/sbin/route

2020-01-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Jan 22 19:22:06 UTC 2020

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

Log Message:
route: address flags are more useful than interface flags for address msgs


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sbin/route/route.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/route/route.c
diff -u src/sbin/route/route.c:1.164 src/sbin/route/route.c:1.165
--- src/sbin/route/route.c:1.164	Wed Jan 22 17:55:41 2020
+++ src/sbin/route/route.c	Wed Jan 22 19:22:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.164 2020/01/22 17:55:41 roy Exp $	*/
+/*	$NetBSD: route.c,v 1.165 2020/01/22 19:22:06 roy Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.164 2020/01/22 17:55:41 roy Exp $");
+__RCSID("$NetBSD: route.c,v 1.165 2020/01/22 19:22:06 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -1375,7 +1375,7 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 	case RTM_DELADDR:
 	case RTM_CHGADDR:
 		ifam = (struct ifa_msghdr *)rtm;
-		(void)printf("pid %d, metric %d, flags: ",
+		(void)printf("pid %d, metric %d, addrflags: ",
 		ifam->ifam_pid, ifam->ifam_metric);
 		struct sockaddr *sa = (struct sockaddr *)(ifam + 1);
 		const char *bits;
@@ -1390,7 +1390,7 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 			bits = unknownflags;
 			break;
 		}
-		bprintf(stdout, ifam->ifam_flags, bits);
+		bprintf(stdout, ifam->ifam_addrflags, bits);
 		pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs);
 		break;
 	case RTM_IEEE80211:



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2020-01-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Jan 22 19:15:49 UTC 2020

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_2835_arm.c
vchiq_arm.c vchiq_core.c vchiq_core.h vchiq_kern_lib.c vchiq_shim.c

Log Message:
align with upstream for 64bit compatibility.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.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/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.20 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.21
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.20	Sun Dec 10 21:38:27 2017
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c	Wed Jan 22 19:15:49 2020
@@ -57,6 +57,9 @@
 #include "vchiq_netbsd.h"
 #include "vchiq_connected.h"
 
+#define VCPAGE_OFFSET 0x0fff
+#define VCPAGE_SHIFT  12
+
 #define MAX_FRAGMENTS (VCHIQ_NUM_CURRENT_BULKS * 2)
 
 typedef struct vchiq_2835_state_struct {
@@ -146,7 +149,7 @@ vchiq_platform_init(VCHIQ_STATE_T *state
 	vchiq_log_info(vchiq_arm_log_level,
 	"%s: slot_phys = %lx\n", __func__, slot_phys);
 
-	WARN_ON(((int)slot_mem & (PAGE_SIZE - 1)) != 0);
+	WARN_ON(((uintptr_t)slot_mem & (PAGE_SIZE - 1)) != 0);
 
 	vchiq_slot_zero = vchiq_init_slots(slot_mem, slot_mem_size);
 	if (!vchiq_slot_zero) {
@@ -187,12 +190,12 @@ vchiq_platform_init(VCHIQ_STATE_T *state
 	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
 	vchiq_log_info(vchiq_arm_log_level,
-		"vchiq_init - done (slots %x, phys %x)",
-		(unsigned int)vchiq_slot_zero, (unsigned int)slot_phys);
+		"vchiq_init - done (slots %p, phys %x)",
+		vchiq_slot_zero, (unsigned int)slot_phys);
 
 	vchiq_call_connected_callbacks();
 
-   return 0;
+	return 0;
 
 failed_vchiq_init:
 failed_init_slots:
@@ -355,7 +358,7 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bu
 	pagelist->type = (dir == VCHIQ_BULK_RECEIVE) ?
 	PAGELIST_READ : PAGELIST_WRITE;
 	pagelist->length = size;
-	pagelist->offset = va & L2_S_OFFSET;
+	pagelist->offset = va & VCPAGE_OFFSET;
 
 	/*
 	 * busdma already coalesces contiguous pages for us
@@ -363,10 +366,10 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bu
 	for (int i = 0; i < bi->dmamap->dm_nsegs; i++) {
 		bus_addr_t addr = bi->dmamap->dm_segs[i].ds_addr;
 		bus_size_t len = bi->dmamap->dm_segs[i].ds_len;
-		bus_size_t off = addr & L2_S_OFFSET;
-		int npgs = ((off + len + L2_S_OFFSET) >> L2_S_SHIFT);
+		bus_size_t off = addr & VCPAGE_OFFSET;
+		int npgs = ((off + len + VCPAGE_OFFSET) >> VCPAGE_SHIFT);
 
-		pagelist->addrs[i] = addr & ~L2_S_OFFSET;
+		pagelist->addrs[i] = addr & ~VCPAGE_OFFSET;
 		pagelist->addrs[i] |= npgs - 1;
 	}
 
@@ -443,7 +446,7 @@ vchiq_complete_bulk(VCHIQ_BULK_T *bulk)
 		PAGELIST_T *pagelist = bi->pagelist;
 
 		vchiq_log_trace(vchiq_arm_log_level,
-			"free_pagelist - %x, %d", (unsigned int)pagelist, actual);
+			"free_pagelist - %p, %d", pagelist, actual);
 
 		bus_dmamap_sync(dma_tag, bi->pagelist_map, 0,
 		bi->pagelist_size, BUS_DMASYNC_POSTWRITE);
Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.20 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.21
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.20	Tue Aug  7 09:01:52 2018
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c	Wed Jan 22 19:15:49 2020
@@ -461,8 +461,8 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 #define	_IOC_TYPE(x)	IOCGROUP(x)
 
 	vchiq_log_trace(vchiq_arm_log_level,
-		 "vchiq_ioctl - instance %x, cmd %s, arg %p",
-		(unsigned int)instance,
+		 "vchiq_ioctl - instance %p, cmd %s, arg %p",
+		instance,
 		((_IOC_TYPE(cmd) == VCHIQ_IOC_MAGIC) &&
 		(_IOC_NR(cmd) <= VCHIQ_IOC_MAX)) ?
 		ioctl_names[_IOC_NR(cmd)] : "", arg);
@@ -755,8 +755,8 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 break;
 			}
 			vchiq_log_info(vchiq_arm_log_level,
-"found bulk_waiter %x for pid %d",
-(unsigned int)waiter, current->l_proc->p_pid);
+"found bulk_waiter %p for pid %d",
+waiter, current->l_proc->p_pid);
 			args.userdata = >bulk_waiter;
 		}
 		status = vchiq_bulk_transfer
@@ -786,8 +786,8 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 			list_add(>list, 

CVS commit: src/sbin/route

2020-01-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Jan 22 17:55:41 UTC 2020

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

Log Message:
route: Decode the correct flags for interface address messages


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sbin/route/route.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/route/route.c
diff -u src/sbin/route/route.c:1.163 src/sbin/route/route.c:1.164
--- src/sbin/route/route.c:1.163	Mon Sep  2 00:30:01 2019
+++ src/sbin/route/route.c	Wed Jan 22 17:55:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.163 2019/09/02 00:30:01 roy Exp $	*/
+/*	$NetBSD: route.c,v 1.164 2020/01/22 17:55:41 roy Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.163 2019/09/02 00:30:01 roy Exp $");
+__RCSID("$NetBSD: route.c,v 1.164 2020/01/22 17:55:41 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -54,6 +54,7 @@ __RCSID("$NetBSD: route.c,v 1.163 2019/0
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1301,9 +1302,12 @@ const char * const msgtypes[] = {
 	[RTM_CHGADDR] = "RTM_CHGADDR: address being changed on iface",
 };
 
+const char unknownflags[] = "\020";
 const char metricnames[] = RTVBITS;
 const char routeflags[] = RTFBITS;
 const char ifnetflags[] = IFFBITS;
+const char in_ifflags[] = IN_IFFBITS;
+const char in6_ifflags[] = IN6_IFFBITS;
 const char addrnames[] = RTABITS;
 
 
@@ -1373,7 +1377,20 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 		ifam = (struct ifa_msghdr *)rtm;
 		(void)printf("pid %d, metric %d, flags: ",
 		ifam->ifam_pid, ifam->ifam_metric);
-		bprintf(stdout, ifam->ifam_flags, routeflags);
+		struct sockaddr *sa = (struct sockaddr *)(ifam + 1);
+		const char *bits;
+		switch (sa->sa_family) {
+		case AF_INET:
+			bits = in_ifflags;
+			break;
+		case AF_INET6:
+			bits = in6_ifflags;
+			break;
+		default:
+			bits = unknownflags;
+			break;
+		}
+		bprintf(stdout, ifam->ifam_flags, bits);
 		pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs);
 		break;
 	case RTM_IEEE80211:



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

2020-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 22 17:15:53 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
Fixup a comment


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/aarch64/aarch64/aarch64_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/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.37 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.38
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.37	Wed Jan  8 05:41:07 2020
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Jan 22 17:15:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.37 2020/01/08 05:41:07 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.38 2020/01/22 17:15:53 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.37 2020/01/08 05:41:07 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.38 2020/01/22 17:15:53 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -99,7 +99,8 @@ vaddr_t physical_end;
 /* filled in before cleaning bss. keep in .data */
 u_long kern_vtopdiff __attribute__((__section__(".data")));
 
-long kernend_extra;	/* extra physicalmemory allocated from round_page(_end[]) */
+/* extra physical memory allocated from round_page(_end[]) */
+long kernend_extra;
 
 /* dump configuration */
 int	cpu_dump(void);



CVS commit: src/sys/arch

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 16:59:38 UTC 2020

Modified Files:
src/sys/arch/aarch64/include: vmparam.h
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Bump UBC defaults on sparc64 & aarch64, which already have a large pager_map.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/include/vmparam.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/sparc64/include/vmparam.h

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

Modified files:

Index: src/sys/arch/aarch64/include/vmparam.h
diff -u src/sys/arch/aarch64/include/vmparam.h:1.9 src/sys/arch/aarch64/include/vmparam.h:1.10
--- src/sys/arch/aarch64/include/vmparam.h:1.9	Tue Jan 21 10:54:11 2020
+++ src/sys/arch/aarch64/include/vmparam.h	Wed Jan 22 16:59:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.9 2020/01/21 10:54:11 jmcneill Exp $ */
+/* $NetBSD: vmparam.h,v 1.10 2020/01/22 16:59:38 ad Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -42,6 +42,17 @@
 #define	PAGER_MAP_DEFAULT_SIZE	(512 * 1024 * 1024)
 
 /*
+ * Defaults for Unified Buffer Cache parameters.
+ */
+
+#ifndef UBC_WINSHIFT
+#define	UBC_WINSHIFT	16	/* 64kB */
+#endif
+#ifndef UBC_NWINS
+#define	UBC_NWINS	4096	/* 256MB */
+#endif
+
+/*
  * AARCH64 supports 3 page sizes: 4KB, 16KB, 64KB.  Each page table can
  * even have its own page size.
  */

Index: src/sys/arch/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.39 src/sys/arch/sparc64/include/vmparam.h:1.40
--- src/sys/arch/sparc64/include/vmparam.h:1.39	Mon Sep  3 16:29:28 2018
+++ src/sys/arch/sparc64/include/vmparam.h	Wed Jan 22 16:59:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.39 2018/09/03 16:29:28 riastradh Exp $ */
+/*	$NetBSD: vmparam.h,v 1.40 2020/01/22 16:59:37 ad Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -64,6 +64,17 @@
 #definePAGER_MAP_DEFAULT_SIZE (512 * 1024 * 1024)
 
 /*
+ * Defaults for Unified Buffer Cache parameters.
+ */
+
+#ifndef UBC_WINSHIFT
+#define	UBC_WINSHIFT	16	/* 64kB */
+#endif
+#ifndef UBC_NWINS
+#define	UBC_NWINS	4096	/* 256MB */
+#endif
+
+/*
  * The kernel itself is mapped by the boot loader with 4Mb locked VM pages,
  * so let's keep 4Mb definitions here as well.
  */



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

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 16:52:46 UTC 2020

Modified Files:
src/sys/arch/amd64/include: param.h vmparam.h

Log Message:
Move the UBC defaults into vmparam.h


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/amd64/include/vmparam.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/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.34 src/sys/arch/amd64/include/param.h:1.35
--- src/sys/arch/amd64/include/param.h:1.34	Fri Jan 17 21:14:16 2020
+++ src/sys/arch/amd64/include/param.h	Wed Jan 22 16:52:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.34 2020/01/17 21:14:16 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.35 2020/01/22 16:52:46 ad Exp $	*/
 
 #ifdef __x86_64__
 
@@ -113,17 +113,6 @@
 #define	NKMEMPAGES_MAX_UNLIMITED 1
 
 /*
- * Defaults for Unified Buffer Cache parameters.
- */
-
-#ifndef UBC_WINSHIFT
-#define	UBC_WINSHIFT	16	/* 64kB */
-#endif
-#ifndef UBC_NWINS
-#define	UBC_NWINS	4096	/* 256MB */
-#endif
-
-/*
  * XXXfvdl the PD* stuff is different from i386.
  */
 /*

Index: src/sys/arch/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.51 src/sys/arch/amd64/include/vmparam.h:1.52
--- src/sys/arch/amd64/include/vmparam.h:1.51	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/amd64/include/vmparam.h	Wed Jan 22 16:52:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.51 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.52 2020/01/22 16:52:46 ad Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -63,6 +63,17 @@
 #define	PAGER_MAP_DEFAULT_SIZE (512 * 1024 * 1024)
 
 /*
+ * Defaults for Unified Buffer Cache parameters.
+ */
+
+#ifndef UBC_WINSHIFT
+#define	UBC_WINSHIFT	16	/* 64kB */
+#endif
+#ifndef UBC_NWINS
+#define	UBC_NWINS	4096	/* 256MB */
+#endif
+
+/*
  * USRSTACK is the top (end) of the user stack. Immediately above the
  * user stack resides the user structure, which is UPAGES long and contains
  * the kernel stack.



CVS commit: src/lib/libexecinfo

2020-01-22 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Wed Jan 22 16:07:40 UTC 2020

Modified Files:
src/lib/libexecinfo: unwind.c

Log Message:
Fix using gcc's unwind.h


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libexecinfo/unwind.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/libexecinfo/unwind.c
diff -u src/lib/libexecinfo/unwind.c:1.3 src/lib/libexecinfo/unwind.c:1.4
--- src/lib/libexecinfo/unwind.c:1.3	Wed Jan 30 22:46:49 2019
+++ src/lib/libexecinfo/unwind.c	Wed Jan 22 16:07:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: unwind.c,v 1.3 2019/01/30 22:46:49 mrg Exp $	*/
+/*	$NetBSD: unwind.c,v 1.4 2020/01/22 16:07:40 mgorny Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 #include 
 
-#include "unwind.h"
+#include 
 #include "execinfo.h"
 
 struct tracer_context {



CVS commit: src

2020-01-22 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Wed Jan 22 15:10:32 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/lib/libgcc: Makefile.inc
src/external/gpl3/gcc/lib/libgcc: Makefile.inc
src/lib/libexecinfo: Makefile
Removed Files:
src/lib/libexecinfo: unwind.h

Log Message:
Install gcc's unwind.h instead of libexecinfo's

The prototypes in libexecinfo's unwind.h do not match those commonly
used (e.g. by gcc, clang, GNU libunwind, LLVM libunwind...), causing
C++ programs to fail to build on type mismatches (e.g. compiler-rt,
libc++abi).  Rather than providing our own header, reuse the one
included in gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc
cvs rdiff -u -r1.43 -r1.44 src/external/gpl3/gcc/lib/libgcc/Makefile.inc
cvs rdiff -u -r1.8 -r1.9 src/lib/libexecinfo/Makefile
cvs rdiff -u -r1.5 -r0 src/lib/libexecinfo/unwind.h

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

Modified files:

Index: src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc:1.12 src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc:1.13
--- src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc:1.12	Thu Sep 26 08:03:26 2019
+++ src/external/gpl3/gcc.old/lib/libgcc/Makefile.inc	Wed Jan 22 15:10:31 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2019/09/26 08:03:26 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2020/01/22 15:10:31 mgorny Exp $
 
 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
 GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/}
@@ -111,6 +111,10 @@ LIB2_EHASM=	${G_LIB2ADDEH:M*.S:T:Nlibunw
 .else
 LIB2_EH=	${G_LIB2ADDEH:M*.c:T}
 LIB2_EHASM=	${G_LIB2ADDEH:M*.S:T}
+
+INCSDIR=	/usr/include
+# originally copied from unwind-*.h
+INCS+=		unwind.h
 .endif
 
 # We have to weed out any existing func.S file that may exist

Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.43 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.44
--- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.43	Sat May 11 02:39:32 2019
+++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc	Wed Jan 22 15:10:31 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.43 2019/05/11 02:39:32 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.44 2020/01/22 15:10:31 mgorny Exp $
 
 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
 GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/}
@@ -111,6 +111,10 @@ LIB2_EHASM=	${G_LIB2ADDEH:M*.S:T:Nlibunw
 .else
 LIB2_EH=	${G_LIB2ADDEH:M*.c:T}
 LIB2_EHASM=	${G_LIB2ADDEH:M*.S:T}
+
+INCSDIR=	/usr/include
+# originally copied from unwind-*.h
+INCS+=		unwind.h
 .endif
 
 # We have to weed out any existing func.S file that may exist

Index: src/lib/libexecinfo/Makefile
diff -u src/lib/libexecinfo/Makefile:1.8 src/lib/libexecinfo/Makefile:1.9
--- src/lib/libexecinfo/Makefile:1.8	Fri Oct 24 22:42:16 2014
+++ src/lib/libexecinfo/Makefile	Wed Jan 22 15:10:32 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2014/10/24 22:42:16 joerg Exp $
+# $NetBSD: Makefile,v 1.9 2020/01/22 15:10:32 mgorny Exp $
 
 .include 
 
@@ -8,10 +8,6 @@ WARNS?=4
 INCSDIR=/usr/include
 INCS=execinfo.h
 
-.if ${HAVE_LIBGCC_EH} == "yes"
-INCS+=	unwind.h
-.endif
-
 #CPPFLAGS+='-D__RCSID(a)=' -D_GNU_SOURCE '-D__printflike(a,b)='
 #CPPFLAGS+=-I/usr/include/libelf
 #COPTS+=-std=gnu99



CVS commit: src

2020-01-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 22 14:01:50 UTC 2020

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Removed Files:
src/share/man/man4: esh.4

Log Message:
I overlooked the esh(4) man page when removing HIPPI support; remove it
now.  Thanks maxv@ for noticing and pointing it out.


To generate a diff of this commit:
cvs rdiff -u -r1.1676 -r1.1677 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.699 -r1.700 src/share/man/man4/Makefile
cvs rdiff -u -r1.10 -r0 src/share/man/man4/esh.4

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1676 src/distrib/sets/lists/man/mi:1.1677
--- src/distrib/sets/lists/man/mi:1.1676	Tue Jan 21 03:29:56 2020
+++ src/distrib/sets/lists/man/mi	Wed Jan 22 14:01:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1676 2020/01/21 03:29:56 taca Exp $
+# $NetBSD: mi,v 1.1677 2020/01/22 14:01:50 thorpej Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1073,7 +1073,7 @@
 ./usr/share/man/cat4/ep.0			man-sys-catman		.cat
 ./usr/share/man/cat4/epic.0			man-sys-catman		.cat
 ./usr/share/man/cat4/esa.0			man-sys-catman		.cat
-./usr/share/man/cat4/esh.0			man-sys-catman		.cat
+./usr/share/man/cat4/esh.0			man-obsolete		obsolete
 ./usr/share/man/cat4/esiop.0			man-sys-catman		.cat
 ./usr/share/man/cat4/esis.0			man-obsolete		obsolete
 ./usr/share/man/cat4/esl.0			man-obsolete		obsolete
@@ -4258,7 +4258,7 @@
 ./usr/share/man/html4/ep.html			man-sys-htmlman		html
 ./usr/share/man/html4/epic.html			man-sys-htmlman		html
 ./usr/share/man/html4/esa.html			man-sys-htmlman		html
-./usr/share/man/html4/esh.html			man-sys-htmlman		html
+./usr/share/man/html4/esh.html			man-obsolete		obsolete
 ./usr/share/man/html4/esiop.html		man-sys-htmlman		html
 ./usr/share/man/html4/esis.html			man-obsolete		obsolete
 ./usr/share/man/html4/esl.html			man-obsolete		obsolete
@@ -7215,7 +7215,7 @@
 ./usr/share/man/man4/ep.4			man-sys-man		.man
 ./usr/share/man/man4/epic.4			man-sys-man		.man
 ./usr/share/man/man4/esa.4			man-sys-man		.man
-./usr/share/man/man4/esh.4			man-sys-man		.man
+./usr/share/man/man4/esh.4			man-obsolete		obsolete
 ./usr/share/man/man4/esiop.4			man-sys-man		.man
 ./usr/share/man/man4/esis.4			man-obsolete		obsolete
 ./usr/share/man/man4/esl.4			man-obsolete		obsolete

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.699 src/share/man/man4/Makefile:1.700
--- src/share/man/man4/Makefile:1.699	Mon Jan 20 18:38:17 2020
+++ src/share/man/man4/Makefile	Wed Jan 22 14:01:50 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.699 2020/01/20 18:38:17 thorpej Exp $
+#	$NetBSD: Makefile,v 1.700 2020/01/22 14:01:50 thorpej Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -21,7 +21,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	com.4 coram.4 crypto.4 cs80bus.4 cuda.4 cypide.4 cxdtv.4 \
 	ddb.4 ddc.4 dge.4 dk.4 dm.4 dmoverio.4 \
 	dmphy.4 dpt.4 dpti.4 drm.4 drum.4 drvctl.4 dtv.4 dtviic.4 dwctwo.4 \
-	eap.4 ebus.4 edc.4 elmc.4 emuxki.4 ena.4 envsys.4 ep.4 esh.4 \
+	eap.4 ebus.4 edc.4 elmc.4 emuxki.4 ena.4 envsys.4 ep.4 \
 	esa.4 esiop.4 esm.4 eso.4 et.4 etphy.4 exphy.4 \
 	fd.4 finsio.4 flash.4 fms.4 fss.4 \
 	fujbp.4 full.4 fxp.4 \



CVS commit: src/sys/kern

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 13:19:33 UTC 2020

Modified Files:
src/sys/kern: kern_lock.c kern_synch.c

Log Message:
- DIAGNOSTIC: check for leaked kernel_lock in mi_switch().

- Now that ci_biglock_wanted is set later, explicitly disable preemption
  while acquiring kernel_lock.  It was blocked in a roundabout way
  previously.

Reported-by: syzbot+43111d810160fb4b9...@syzkaller.appspotmail.com
Reported-by: syzbot+f5b871bd00089bf97...@syzkaller.appspotmail.com
Reported-by: syzbot+cd1f15eee5b1b6d20...@syzkaller.appspotmail.com
Reported-by: syzbot+fb945a331dabd0b6b...@syzkaller.appspotmail.com
Reported-by: syzbot+53a0c2342b361db25...@syzkaller.appspotmail.com
Reported-by: syzbot+55a952814dede...@syzkaller.appspotmail.com
Reported-by: syzbot+c7104a72172b0f909...@syzkaller.appspotmail.com
Reported-by: syzbot+efbd30c6ca0f7d844...@syzkaller.appspotmail.com
Reported-by: syzbot+330a421bd46794d8b...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/kern/kern_lock.c
cvs rdiff -u -r1.336 -r1.337 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.165 src/sys/kern/kern_lock.c:1.166
--- src/sys/kern/kern_lock.c:1.165	Fri Jan 17 20:26:22 2020
+++ src/sys/kern/kern_lock.c	Wed Jan 22 13:19:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.165 2020/01/17 20:26:22 ad Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.166 2020/01/22 13:19:33 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.165 2020/01/17 20:26:22 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.166 2020/01/22 13:19:33 ad Exp $");
 
 #include 
 #include 
@@ -212,9 +212,10 @@ _kernel_lock(int nlocks)
 	owant = ci->ci_biglock_wanted;
 
 	/*
-	 * Spin until we acquire the lock.  Once we have it, record the
-	 * time spent with lockstat.
+	 * Stay pinned to the CPU and spin until we acquire the lock.  Once
+	 * we have it, record the time spent with lockstat.
 	 */
+	l->l_nopreempt++;
 	LOCKSTAT_ENTER(lsflag);
 	LOCKSTAT_START_TIMER(lsflag, spintime);
 
@@ -238,6 +239,11 @@ _kernel_lock(int nlocks)
 		s = splvm();
 	} while (!__cpu_simple_lock_try(kernel_lock));
 
+	/*
+	 * Got it; not re-enable preemption, although we now can't do a
+	 * preemption as kernel_lock is held!
+	 */
+	l->l_nopreempt--;
 	ci->ci_biglock_count = nlocks;
 	l->l_blcnt = nlocks;
 	splx(s);

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.336 src/sys/kern/kern_synch.c:1.337
--- src/sys/kern/kern_synch.c:1.336	Thu Jan  9 16:35:03 2020
+++ src/sys/kern/kern_synch.c	Wed Jan 22 13:19:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.336 2020/01/09 16:35:03 ad Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.337 2020/01/22 13:19:33 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.336 2020/01/09 16:35:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.337 2020/01/22 13:19:33 ad Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -353,8 +353,7 @@ kpreempt(uintptr_t where)
 			break;
 		}
 		s = splsched();
-		if (__predict_false(l->l_blcnt != 0 ||
-		curcpu()->ci_biglock_wanted != NULL)) {
+		if (__predict_false(l->l_blcnt != 0)) {
 			/* Hold or want kernel_lock, code is not MT safe. */
 			splx(s);
 			if ((dop & DOPREEMPT_COUNTED) == 0) {
@@ -531,6 +530,7 @@ mi_switch(lwp_t *l)
 	KASSERT(lwp_locked(l, NULL));
 	KASSERT(kpreempt_disabled());
 	KASSERT(mutex_owned(curcpu()->ci_schedstate.spc_mutex));
+	KASSERTMSG(l->l_blcnt == 0, "kernel_lock leaked");
 
 	kstack_check_magic(l);
 



CVS commit: src/sys/kern

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 12:44:54 UTC 2020

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

Log Message:
Add a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/kern_rwlock.c

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

Modified files:

Index: src/sys/kern/kern_rwlock.c
diff -u src/sys/kern/kern_rwlock.c:1.63 src/sys/kern/kern_rwlock.c:1.64
--- src/sys/kern/kern_rwlock.c:1.63	Tue Jan 21 20:29:51 2020
+++ src/sys/kern/kern_rwlock.c	Wed Jan 22 12:44:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rwlock.c,v 1.63 2020/01/21 20:29:51 ad Exp $	*/
+/*	$NetBSD: kern_rwlock.c,v 1.64 2020/01/22 12:44:54 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020
@@ -36,10 +36,16 @@
  *
  *	Solaris Internals: Core Kernel Architecture, Jim Mauro and
  *	Richard McDougall.
+ *
+ * The NetBSD implementation differs from that described in the book, in
+ * that the locks are partially adaptive.  Lock waiters spin wait while a
+ * lock is write held and the holder is still running on a CPU.  The method
+ * of choosing which threads to awaken when a lock is released also differs,
+ * mainly to take account of the partially adaptive behaviour.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.63 2020/01/21 20:29:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.64 2020/01/22 12:44:54 ad Exp $");
 
 #include "opt_lockdebug.h"
 



CVS commit: src/sys/arch/arm

2020-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 22 12:23:12 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: cpu.c
src/sys/arch/arm/include: cpu.h

Log Message:
#ifdef whack-a-mole for the pmap_maxproc_set functionality


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/arm/include/cpu.h

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

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.142 src/sys/arch/arm/arm32/cpu.c:1.143
--- src/sys/arch/arm/arm32/cpu.c:1.142	Mon Jan 20 22:13:57 2020
+++ src/sys/arch/arm/arm32/cpu.c	Wed Jan 22 12:23:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.142 2020/01/20 22:13:57 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.143 2020/01/22 12:23:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.142 2020/01/20 22:13:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.143 2020/01/22 12:23:12 skrll Exp $");
 
 #include 
 #include 
@@ -887,11 +887,15 @@ identify_features(device_t dv)
 	cpu_processor_features[0], cpu_processor_features[1]);
 }
 
-#ifdef ARM_MMU_EXTENDED
+#ifdef _ARM_ARCH_6
 int
 cpu_maxproc_hook(int nmaxproc)
 {
 
+#ifdef ARM_MMU_EXTENDED
 	return pmap_maxproc_set(nmaxproc);
+#else
+	return 0;
+#endif
 }
 #endif

Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.106 src/sys/arch/arm/include/cpu.h:1.107
--- src/sys/arch/arm/include/cpu.h:1.106	Mon Jan 20 22:13:57 2020
+++ src/sys/arch/arm/include/cpu.h	Wed Jan 22 12:23:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.106 2020/01/20 22:13:57 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.107 2020/01/22 12:23:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -329,7 +329,7 @@ vaddr_t cpu_uarea_alloc_idlelwp(struct c
  */
 void	cpu_attach(device_t, cpuid_t);
 
-#ifdef ARM_MMU_EXTENDED
+#ifdef _ARM_ARCH_6
 int	cpu_maxproc_hook(int);
 #endif
 



CVS commit: src/sys

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 12:23:04 UTC 2020

Modified Files:
src/sys/kern: kern_exit.c kern_lwp.c
src/sys/sys: userret.h

Log Message:
Catch a leaked hold of kernel_lock sooner with DIAGNOSTIC and make the
message a bit more informative.


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.219 -r1.220 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/userret.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_exit.c
diff -u src/sys/kern/kern_exit.c:1.279 src/sys/kern/kern_exit.c:1.280
--- src/sys/kern/kern_exit.c:1.279	Wed Jan  8 17:38:42 2020
+++ src/sys/kern/kern_exit.c	Wed Jan 22 12:23:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.279 2020/01/08 17:38:42 ad Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.280 2020/01/22 12:23:04 ad Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.279 2020/01/08 17:38:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.280 2020/01/22 12:23:04 ad Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -206,6 +206,7 @@ exit1(struct lwp *l, int exitcode, int s
 
 	/* Verify that we hold no locks other than p->p_lock. */
 	LOCKDEBUG_BARRIER(p->p_lock, 0);
+	KASSERTMSG(curcpu()->ci_biglock_count == 0, "kernel_lock leaked");
 	KASSERT(mutex_owned(p->p_lock));
 	KASSERT(p->p_vmspace != NULL);
 

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.219 src/sys/kern/kern_lwp.c:1.220
--- src/sys/kern/kern_lwp.c:1.219	Sun Jan 12 13:15:08 2020
+++ src/sys/kern/kern_lwp.c	Wed Jan 22 12:23:04 2020
@@ -1,7 +1,8 @@
-/*	$NetBSD: kern_lwp.c,v 1.219 2020/01/12 13:15:08 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.220 2020/01/22 12:23:04 ad Exp $	*/
 
 /*-
- * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
+ * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -209,7 +210,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.219 2020/01/12 13:15:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.220 2020/01/22 12:23:04 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -1063,8 +1064,9 @@ lwp_exit(struct lwp *l)
 
 	SDT_PROBE(proc, kernel, , lwp__exit, l, 0, 0, 0, 0);
 
-	/* Verify that we hold no locks */
+	/* Verify that we hold no locks; for DIAGNOSTIC check kernel_lock. */
 	LOCKDEBUG_BARRIER(NULL, 0);
+	KASSERTMSG(curcpu()->ci_biglock_count == 0, "kernel_lock leaked");
 
 	/*
 	 * If we are the last live LWP in a process, we need to exit the
@@ -1080,7 +1082,6 @@ lwp_exit(struct lwp *l)
 	if (p->p_nlwps - p->p_nzlwps == 1) {
 		KASSERT(current == true);
 		KASSERT(p != );
-		/* XXXSMP kernel_lock not held */
 		exit1(l, 0, 0);
 		/* NOTREACHED */
 	}

Index: src/sys/sys/userret.h
diff -u src/sys/sys/userret.h:1.31 src/sys/sys/userret.h:1.32
--- src/sys/sys/userret.h:1.31	Sat Nov 30 17:49:03 2019
+++ src/sys/sys/userret.h	Wed Jan 22 12:23:04 2020
@@ -1,7 +1,8 @@
-/*	$NetBSD: userret.h,v 1.31 2019/11/30 17:49:03 ad Exp $	*/
+/*	$NetBSD: userret.h,v 1.32 2020/01/22 12:23:04 ad Exp $	*/
 
 /*-
- * Copyright (c) 1998, 2000, 2003, 2006, 2008, 2019 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2000, 2003, 2006, 2008, 2019, 2020
+ * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -84,8 +85,8 @@ mi_userret(struct lwp *l)
 
 	KPREEMPT_DISABLE(l);
 	ci = l->l_cpu;
+	KASSERTMSG(ci->ci_biglock_count == 0, "kernel_lock leaked");
 	KASSERT(l->l_blcnt == 0);
-	KASSERT(ci->ci_biglock_count == 0);
 	if (__predict_false(ci->ci_want_resched)) {
 		preempt();
 		ci = l->l_cpu;



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

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 12:10:46 UTC 2020

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

Log Message:
Fast-forward through the namecache was stopping one component too soon when
there was an obstacle, e.g. a mountpoint.  The obstacle should be returned
not the parent directory.


To generate a diff of this commit:
cvs rdiff -u -r1.212.4.4 -r1.212.4.5 src/sys/kern/vfs_lookup.c

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

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.212.4.4 src/sys/kern/vfs_lookup.c:1.212.4.5
--- src/sys/kern/vfs_lookup.c:1.212.4.4	Sun Jan 19 21:19:25 2020
+++ src/sys/kern/vfs_lookup.c	Wed Jan 22 12:10:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.212.4.4 2020/01/19 21:19:25 ad Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.212.4.5 2020/01/22 12:10:46 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212.4.4 2020/01/19 21:19:25 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212.4.5 2020/01/22 12:10:46 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_magiclinks.h"
@@ -954,7 +954,11 @@ lookup_crossmount(struct namei_state *st
 	(mp = foundobj->v_mountedhere) != NULL &&
 	(cnp->cn_flags & NOCROSSMOUNT) == 0) {
 		KASSERTMSG(searchdir != foundobj, "same vn %p", searchdir);
-		/* First get the vnode stable. */
+		/*
+		 * First get the vnode stable.  LK_SHARED works brilliantly
+		 * here because almost nothing else wants to lock the
+		 * covered vnode.
+		 */
 		error = vn_lock(foundobj, LK_SHARED);
 		if (error != 0) {
 			vrele(foundobj);
@@ -962,7 +966,7 @@ lookup_crossmount(struct namei_state *st
 			break;
 		}
 
-		/* Then check to see if something is still mounted there. */
+		/* Then check to see if something is still mounted on it. */
 		if ((mp = foundobj->v_mountedhere) == NULL) {
 			VOP_UNLOCK(foundobj);
 			break;
@@ -1109,7 +1113,9 @@ lookup_once(struct namei_state *state,
 	/*
 	 * If the file system supports VOP_LOOKUP() with a shared lock, and
 	 * we are not making any modifications (nameiop LOOKUP) or this is
-	 * not the last component then get a shared lock LK_SHARED.
+	 * not the last component then get a shared lock LK_SHARED.  Where
+	 * we can't do fast-forwarded lookups (for example with layered file
+	 * systems) then this is the fallback for reducing lock contention.
 	 */
 	if ((searchdir->v_mount->mnt_iflag & IMNT_SHRLOOKUP) != 0 &&
 	(cnp->cn_nameiop == LOOKUP || (cnp->cn_flags & ISLASTCN) == 0)) {
@@ -1237,8 +1243,8 @@ done:
 /*
  * Parse out the first path name component that we need to to consider. 
  *
- * While doing this, attempt to use the name cache to fastforward through as
- * many "easy" to find components of the path as possible.
+ * While doing this, attempt to use the name cache to fast-forward through
+ * as many "easy" to find components of the path as possible.
  *
  * We use the namecache's node locks to form a chain, and avoid as many
  * vnode references and locks as possible.  In the ideal case, only the
@@ -1280,8 +1286,7 @@ lookup_fastforward(struct namei_state *s
 		/*
 		 * Can't deal with dotdot lookups, because it means lock
 		 * order reversal, and there are checks in lookup_once()
-		 * that need to be made.  Also check for missing mountpoints
-		 * (XXX racy).
+		 * that need to be made.  Also check for missing mountpoints.
 		 */
 		if ((cnp->cn_flags & ISDOTDOT) != 0 ||
 		(*searchdir)->v_mount == NULL) {
@@ -1322,8 +1327,16 @@ lookup_fastforward(struct namei_state *s
 			break;
 		}
 
-		/* Stop if we've reached the last component: get vnode. */
-		if (cnp->cn_flags & ISLASTCN) {
+		/*
+		 * Stop and get a hold on the vnode if there's something
+		 * that can't be handled here:
+		 *
+		 * - we've reached the last component.
+		 * - or encountered a mount point that needs to be crossed.
+		 * - or encountered something other than a directory.
+		 */
+		if ((cnp->cn_flags & ISLASTCN) != 0 || vp->v_type != VDIR ||
+		(vp->v_type == VDIR && vp->v_mountedhere != NULL)) {
 			mutex_enter(vp->v_interlock);
 			error = vcache_tryvget(vp);
 			/* v_interlock now released */
@@ -1335,17 +1348,6 @@ lookup_fastforward(struct namei_state *s
 		}
 
 		/*
-		 * Not the last component.  If we found something other than
-		 * a directory, or it's a directory with a filesystem
-		 * mounted on it, bail out.
-		 */
-		if (vp->v_type != VDIR || vp->v_mountedhere != NULL) {
-			error = EOPNOTSUPP;
-			vp = NULL;
-			break;
-		}
-
-		/*
 		 * Otherwise, we're still in business.  Set the found VDIR
 		 * vnode as the search dir for the next component and
 		 * continue on to it.
@@ -1365,9 +1367,8 @@ lookup_fastforward(struct namei_state *s
 		mutex_enter((*searchdir)->v_interlock);
 		error2 = vcache_tryvget(*searchdir);
 		/* v_interlock now unheld */
-		if 

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

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 12:04:36 UTC 2020

Modified Files:
src/sys/miscfs/nullfs [ad-namecache]: null_vfsops.c

Log Message:
Copy the IMNT_SHRLOOKUP flag from lowerrootvp's mount.


To generate a diff of this commit:
cvs rdiff -u -r1.96.2.1 -r1.96.2.2 src/sys/miscfs/nullfs/null_vfsops.c

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

Modified files:

Index: src/sys/miscfs/nullfs/null_vfsops.c
diff -u src/sys/miscfs/nullfs/null_vfsops.c:1.96.2.1 src/sys/miscfs/nullfs/null_vfsops.c:1.96.2.2
--- src/sys/miscfs/nullfs/null_vfsops.c:1.96.2.1	Sun Jan 19 21:21:55 2020
+++ src/sys/miscfs/nullfs/null_vfsops.c	Wed Jan 22 12:04:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: null_vfsops.c,v 1.96.2.1 2020/01/19 21:21:55 ad Exp $	*/
+/*	$NetBSD: null_vfsops.c,v 1.96.2.2 2020/01/22 12:04:36 ad Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.96.2.1 2020/01/19 21:21:55 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.96.2.2 2020/01/22 12:04:36 ad Exp $");
 
 #include 
 #include 
@@ -140,7 +140,8 @@ nullfs_mount(struct mount *mp, const cha
 	/* Create the mount point. */
 	nmp = kmem_zalloc(sizeof(struct null_mount), KM_SLEEP);
 	mp->mnt_data = nmp;
-	mp->mnt_iflag |= IMNT_MPSAFE | IMNT_SHRLOOKUP;
+	mp->mnt_iflag |= IMNT_MPSAFE;
+	mp->mnt_iflag |= lowerrootvp->v_mount->mnt_iflag & IMNT_SHRLOOKUP;
 
 	/*
 	 * Make sure that the mount point is sufficiently initialized



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

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 12:00:18 UTC 2020

Modified Files:
src/sys/miscfs/genfs [ad-namecache]: genfs_vnops.c

Log Message:
Make sure LK_UPGRADE always comes with LK_NOWAIT; dropping the lock in here
is unclean and I wonder if it could screw over fstrans.


To generate a diff of this commit:
cvs rdiff -u -r1.200.2.1 -r1.200.2.2 src/sys/miscfs/genfs/genfs_vnops.c

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

Modified files:

Index: src/sys/miscfs/genfs/genfs_vnops.c
diff -u src/sys/miscfs/genfs/genfs_vnops.c:1.200.2.1 src/sys/miscfs/genfs/genfs_vnops.c:1.200.2.2
--- src/sys/miscfs/genfs/genfs_vnops.c:1.200.2.1	Sat Jan 18 17:12:59 2020
+++ src/sys/miscfs/genfs/genfs_vnops.c	Wed Jan 22 12:00:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_vnops.c,v 1.200.2.1 2020/01/18 17:12:59 ad Exp $	*/
+/*	$NetBSD: genfs_vnops.c,v 1.200.2.2 2020/01/22 12:00:18 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.200.2.1 2020/01/18 17:12:59 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.200.2.2 2020/01/22 12:00:18 ad Exp $");
 
 #include 
 #include 
@@ -295,11 +295,9 @@ genfs_deadlock(void *v)
 	if (ISSET(flags, LK_DOWNGRADE)) {
 		rw_downgrade(vip->vi_lock);
 	} else if (ISSET(flags, LK_UPGRADE)) {
+		KASSERT(ISSET(flags, LK_NOWAIT));
 		if (!rw_tryupgrade(vip->vi_lock)) {
-			if (ISSET(flags, LK_NOWAIT))
-return EBUSY;
-			rw_exit(vip->vi_lock);
-			rw_enter(vip->vi_lock, RW_WRITER);
+			return EBUSY;
 		}
 	} else if ((flags & (LK_EXCLUSIVE | LK_SHARED)) != 0) {
 		op = (ISSET(flags, LK_EXCLUSIVE) ? RW_WRITER : RW_READER);
@@ -349,11 +347,9 @@ genfs_lock(void *v)
 	if (ISSET(flags, LK_DOWNGRADE)) {
 		rw_downgrade(vip->vi_lock);
 	} else if (ISSET(flags, LK_UPGRADE)) {
+		KASSERT(ISSET(flags, LK_NOWAIT));
 		if (!rw_tryupgrade(vip->vi_lock)) {
-			if (ISSET(flags, LK_NOWAIT))
-return EBUSY;
-			rw_exit(vip->vi_lock);
-			rw_enter(vip->vi_lock, RW_WRITER);
+			return EBUSY;
 		}
 	} else if ((flags & (LK_EXCLUSIVE | LK_SHARED)) != 0) {
 		op = (ISSET(flags, LK_EXCLUSIVE) ? RW_WRITER : RW_READER);



CVS commit: [ad-namecache] src/sys

2020-01-22 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Jan 22 11:40:17 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [ad-namecache]: genassym.cf lock_stubs.S
src/sys/arch/amd64/include [ad-namecache]: rwlock.h
src/sys/arch/i386/i386 [ad-namecache]: genassym.cf lock_stubs.S
src/sys/arch/x86/include [ad-namecache]: rwlock.h
src/sys/kern [ad-namecache]: kern_rwlock.c
src/sys/sys [ad-namecache]: lwp.h rwlock.h

Log Message:
Back out previous.


To generate a diff of this commit:
cvs rdiff -u -r1.80.2.2 -r1.80.2.3 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.35.2.1 -r1.35.2.2 src/sys/arch/amd64/amd64/lock_stubs.S
cvs rdiff -u -r1.2.144.1 -r1.2.144.2 src/sys/arch/amd64/include/rwlock.h
cvs rdiff -u -r1.117.2.2 -r1.117.2.3 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.32.2.1 -r1.32.2.2 src/sys/arch/i386/i386/lock_stubs.S
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 src/sys/arch/x86/include/rwlock.h
cvs rdiff -u -r1.59.2.3 -r1.59.2.4 src/sys/kern/kern_rwlock.c
cvs rdiff -u -r1.192.2.2 -r1.192.2.3 src/sys/sys/lwp.h
cvs rdiff -u -r1.12.2.1 -r1.12.2.2 src/sys/sys/rwlock.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/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.80.2.2 src/sys/arch/amd64/amd64/genassym.cf:1.80.2.3
--- src/sys/arch/amd64/amd64/genassym.cf:1.80.2.2	Sun Jan 19 21:08:29 2020
+++ src/sys/arch/amd64/amd64/genassym.cf	Wed Jan 22 11:40:16 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.80.2.2 2020/01/19 21:08:29 ad Exp $
+#	$NetBSD: genassym.cf,v 1.80.2.3 2020/01/22 11:40:16 ad Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -78,6 +78,7 @@ include 
 include 
 include 
 include 
+include 
 include 
 include 
 include 
@@ -345,6 +346,15 @@ define	MTX_IPL			offsetof(struct kmutex,
 define	MTX_LOCK		offsetof(struct kmutex, u.s.mtxs_lock)
 define	MTX_OWNER		offsetof(struct kmutex, u.mtxa_owner)
 
+define	RW_OWNER		offsetof(struct krwlock, rw_owner)
+define	RW_WRITE_LOCKED		RW_WRITE_LOCKED
+define	RW_WRITE_WANTED		RW_WRITE_WANTED
+define	RW_READ_INCR		RW_READ_INCR
+define	RW_HAS_WAITERS		RW_HAS_WAITERS
+define	RW_THREAD		RW_THREAD
+define	RW_READER		RW_READER
+define	RW_WRITER		RW_WRITER
+
 define	EV_COUNT		offsetof(struct evcnt, ev_count)
 
 define	OPTERON_MSR_PASSCODE	OPTERON_MSR_PASSCODE

Index: src/sys/arch/amd64/amd64/lock_stubs.S
diff -u src/sys/arch/amd64/amd64/lock_stubs.S:1.35.2.1 src/sys/arch/amd64/amd64/lock_stubs.S:1.35.2.2
--- src/sys/arch/amd64/amd64/lock_stubs.S:1.35.2.1	Sun Jan 19 21:08:29 2020
+++ src/sys/arch/amd64/amd64/lock_stubs.S	Wed Jan 22 11:40:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.35.2.1 2020/01/19 21:08:29 ad Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.35.2.2 2020/01/22 11:40:16 ad Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -185,6 +185,126 @@ ENTRY(mutex_spin_exit)
 
 END(mutex_spin_exit)
 
+/*
+ * void	rw_enter(krwlock_t *rwl, krw_t op);
+ *
+ * Acquire one hold on a RW lock.
+ */
+ENTRY(rw_enter)
+	cmpl	$RW_READER, %esi
+	jne	2f
+
+	/*
+	 * Reader: this is the most common case.
+	 */
+	movq	(%rdi), %rax
+0:
+	testb	$(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
+	jnz	3f
+	leaq	RW_READ_INCR(%rax), %rdx
+	LOCK
+	cmpxchgq %rdx, (%rdi)
+	jnz	1f
+	RET
+1:
+	jmp	0b
+
+	/*
+	 * Writer: if the compare-and-set fails, don't bother retrying.
+	 */
+2:	movq	CPUVAR(CURLWP), %rcx
+	xorq	%rax, %rax
+	orq	$RW_WRITE_LOCKED, %rcx
+	LOCK
+	cmpxchgq %rcx, (%rdi)
+	jnz	3f
+	RET
+3:
+	jmp	_C_LABEL(rw_vector_enter)
+END(rw_enter)
+
+/*
+ * void	rw_exit(krwlock_t *rwl);
+ *
+ * Release one hold on a RW lock.
+ */
+ENTRY(rw_exit)
+	movq	(%rdi), %rax
+	testb	$RW_WRITE_LOCKED, %al
+	jnz	2f
+
+	/*
+	 * Reader
+	 */
+0:	testb	$RW_HAS_WAITERS, %al
+	jnz	3f
+	cmpq	$RW_READ_INCR, %rax
+	jb	3f
+	leaq	-RW_READ_INCR(%rax), %rdx
+	LOCK
+	cmpxchgq %rdx, (%rdi)
+	jnz	1f
+	ret
+1:
+	jmp	0b
+
+	/*
+	 * Writer
+	 */
+2:	leaq	-RW_WRITE_LOCKED(%rax), %rdx
+	subq	CPUVAR(CURLWP), %rdx
+	jnz	3f
+	LOCK
+	cmpxchgq %rdx, (%rdi)
+	jnz	3f
+	ret
+
+3:	jmp	_C_LABEL(rw_vector_exit)
+END(rw_exit)
+
+/*
+ * int	rw_tryenter(krwlock_t *rwl, krw_t op);
+ *
+ * Try to acquire one hold on a RW lock.
+ */
+ENTRY(rw_tryenter)
+	cmpl	$RW_READER, %esi
+	jne	2f
+
+	/*
+	 * Reader: this is the most common case.
+	 */
+	movq	(%rdi), %rax
+0:
+	testb	$(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
+	jnz	4f
+	leaq	RW_READ_INCR(%rax), %rdx
+	LOCK
+	cmpxchgq %rdx, (%rdi)
+	jnz	1f
+	movl	%edx, %eax			/* nonzero */
+	RET
+1:
+	jmp	0b
+
+	/*
+	 * Writer: if the compare-and-set fails, don't bother retrying.
+	 */
+2:	movq	CPUVAR(CURLWP), %rcx
+	xorq	%rax, %rax
+	orq	$RW_WRITE_LOCKED, %rcx
+	LOCK
+	cmpxchgq %rcx, (%rdi)
+	movl	$0, %eax
+	setz	%al
+3:
+	RET
+	ret
+4:
+	xorl	%eax, %eax
+	jmp	3b
+END(rw_tryenter)
+
 #endif	/* LOCKDEBUG */
 
 /*

Index: src/sys/arch/amd64/include/rwlock.h
diff -u 

CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo

2020-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 22 11:38:54 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo:
nouveau_nvkm_engine_fifo_gk104.c

Log Message:
Write pbdma timeout regs during initialisation on GK208B, GK208, and GM107.

Based on the following upstream commit:
https://github.com/torvalds/linux/commit/79bb4b617f965736d2e1c616235302c1d0e823b2


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.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/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.3	Mon Aug 27 07:40:11 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c	Wed Jan 22 11:38:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.3 2018/08/27 07:40:11 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.4 2020/01/22 11:38:54 jmcneill Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.3 2018/08/27 07:40:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.4 2020/01/22 11:38:54 jmcneill Exp $");
 
 #include "gk104.h"
 #include "changk104.h"
@@ -752,6 +752,20 @@ gk104_fifo_init(struct nvkm_fifo *base)
 
 	nvkm_wr32(device, 0x002254, 0x1000 | fifo->user.bar.offset >> 12);
 
+	/* XXX NetBSD
+	 * write pbdma timeout regs during initialization
+	 * backport of:
+	 * https://github.com/torvalds/linux/commit/79bb4b617f965736d2e1c616235302c1d0e823b2
+	 */
+	switch (device->chipset) {
+	case 0x106:	/* GK208B */
+	case 0x108:	/* GK208 */
+	case 0x117:	/* GM107 */
+		for (i = 0; i < fifo->spoon_nr; i++)
+			nvkm_wr32(device, 0x04012c + (i * 0x2000), 0x);
+		break;
+	}
+
 	nvkm_wr32(device, 0x002100, 0x);
 	nvkm_wr32(device, 0x002140, 0x7fff);
 }



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

2020-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 22 10:52:35 UTC 2020

Modified Files:
src/sys/arch/arm/arm: arm_machdep.c

Log Message:
Oops, the cast is required


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/arm/arm/arm_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/arm/arm/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.61 src/sys/arch/arm/arm/arm_machdep.c:1.62
--- src/sys/arch/arm/arm/arm_machdep.c:1.61	Tue Jan 21 04:59:47 2020
+++ src/sys/arch/arm/arm/arm_machdep.c	Wed Jan 22 10:52:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_machdep.c,v 1.61 2020/01/21 04:59:47 skrll Exp $	*/
+/*	$NetBSD: arm_machdep.c,v 1.62 2020/01/22 10:52:35 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.61 2020/01/21 04:59:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.62 2020/01/22 10:52:35 skrll Exp $");
 
 #include 
 #include 
@@ -309,7 +309,7 @@ cpu_kpreempt_enter(uintptr_t where, int 
 void
 cpu_kpreempt_exit(uintptr_t where)
 {
-	atomic_and_uint(()->ci_astpending, ~__BIT(1));
+	atomic_and_uint(()->ci_astpending, (unsigned int)~__BIT(1));
 }
 
 bool



CVS commit: src/share/mk

2020-01-22 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 22 08:32:33 UTC 2020

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

Log Message:
Switch powerpc back to GCC 7 until we fix alloca() PR port-macppc/54827
ok mrg@


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

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1173 src/share/mk/bsd.own.mk:1.1174
--- src/share/mk/bsd.own.mk:1.1173	Sun Jan 19 00:57:18 2020
+++ src/share/mk/bsd.own.mk	Wed Jan 22 08:32:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1173 2020/01/19 00:57:18 jmcneill Exp $
+#	$NetBSD: bsd.own.mk,v 1.1174 2020/01/22 08:32:33 uwe Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -70,7 +70,6 @@ TOOLCHAIN_MISSING?=	no
 ${MACHINE} == "sparc64" || \
 ${MACHINE_CPU} == "aarch64" || \
 ${MACHINE_CPU} == "arm" || \
-${MACHINE_CPU} == "powerpc" || \
 ${MACHINE_CPU} == "powerpc64" || \
 ${MACHINE_CPU} == "riscv"
 HAVE_GCC?=	8