CVS commit: src/sys/arch/sgimips/sgimips

2018-09-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  8 02:33:34 UTC 2018

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

Log Message:
Initialize ci_divisor_delay by temporary cpufreq for early delay(9) calls.

This is actually required for Indigo R3k.
Reported by Naruaki Etomi in PR port-sgimips/53520.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/sgimips/sgimips/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/sgimips/sgimips/machdep.c
diff -u src/sys/arch/sgimips/sgimips/machdep.c:1.146 src/sys/arch/sgimips/sgimips/machdep.c:1.147
--- src/sys/arch/sgimips/sgimips/machdep.c:1.146	Sun Sep  2 09:57:33 2018
+++ src/sys/arch/sgimips/sgimips/machdep.c	Sat Sep  8 02:33:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.146 2018/09/02 09:57:33 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.147 2018/09/08 02:33:33 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.146 2018/09/02 09:57:33 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.147 2018/09/08 02:33:33 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -334,6 +334,25 @@ mach_init(int argc, int32_t argv32[], ui
 	curcpu()->ci_cpu_freq = strtoul(cpufreq, NULL, 10) * 100;
 
 	/*
+	 * Also initialize ci members for delay and clock by the temporary
+	 * ci_cpu_freq value for early use of delay(9).
+	 * These values will be calibrated later in MD code:
+	 *  - int_attach() in dev/int.c for IP6/10/12/20/22
+	 *  - crime_attach() in dev/crime.c for IP32
+	 *
+	 * XXX: ci_divisor_delay is for mips3_delay() in mips/mips3_clock.c
+	 *  but sgimips abuse it as "instructions per microsecond"
+	 *  for traditional delay(9) implementation derived from
+	 *  4.4BSD/mips (also used in pmax and news3400).
+	 *	(see sys/arch/mips/mips/mips_mcclock.c etc.)
+	 *
+	 * Note ci_cycles_per_hz is for mips3_clockintr.c for MIPS3 so
+	 * there is no early use, but initialize it as a sane default.
+	 */
+	curcpu()->ci_cycles_per_hz = curcpu()->ci_cpu_freq / (2 * hz);
+	curcpu()->ci_divisor_delay = curcpu()->ci_cpu_freq / (2 * 100);
+
+	/*
 	 * Check machine (IPn) type.
 	 *
 	 * Note even on IP12 (which doesn't have ARCBIOS),



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  8 00:51:57 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: files.generic64

Log Message:
Pull in files.seattle


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/files.generic64

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/evbarm/conf/files.generic64
diff -u src/sys/arch/evbarm/conf/files.generic64:1.4 src/sys/arch/evbarm/conf/files.generic64:1.5
--- src/sys/arch/evbarm/conf/files.generic64:1.4	Sun Aug 26 21:06:46 2018
+++ src/sys/arch/evbarm/conf/files.generic64	Sat Sep  8 00:51:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic64,v 1.4 2018/08/26 21:06:46 rjs Exp $
+#	$NetBSD: files.generic64,v 1.5 2018/09/08 00:51:57 jmcneill Exp $
 #
 
 defparam opt_arm_debug.h	EARLYCONS
@@ -10,6 +10,7 @@ include "arch/evbarm/conf/files.fdt"
 
 # Add other board files here
 #
+include "arch/arm/amd/files.seattle"
 include "arch/arm/broadcom/files.bcm2835"
 include "arch/arm/nvidia/files.tegra"
 include "arch/arm/rockchip/files.rockchip"



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  8 00:49:06 UTC 2018

Added Files:
src/sys/arch/arm/amd: files.seattle seattle_platform.c

Log Message:
Add platform glue for AMD Opteron A1100 family SoCs.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/amd/files.seattle \
src/sys/arch/arm/amd/seattle_platform.c

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

Added files:

Index: src/sys/arch/arm/amd/files.seattle
diff -u /dev/null src/sys/arch/arm/amd/files.seattle:1.1
--- /dev/null	Sat Sep  8 00:49:06 2018
+++ src/sys/arch/arm/amd/files.seattle	Sat Sep  8 00:49:06 2018
@@ -0,0 +1,9 @@
+#	$NetBSD: files.seattle,v 1.1 2018/09/08 00:49:06 jmcneill Exp $
+#
+# Configuration info for AMD ARM SoCs
+#
+#
+
+file	arch/arm/amd/seattle_platform.c		soc_seattle
+
+defflag	opt_soc.hSOC_SEATTLE
Index: src/sys/arch/arm/amd/seattle_platform.c
diff -u /dev/null src/sys/arch/arm/amd/seattle_platform.c:1.1
--- /dev/null	Sat Sep  8 00:49:06 2018
+++ src/sys/arch/arm/amd/seattle_platform.c	Sat Sep  8 00:49:06 2018
@@ -0,0 +1,159 @@
+/* $NetBSD: seattle_platform.c,v 1.1 2018/09/08 00:49:06 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "opt_soc.h"
+#include "opt_multiprocessor.h"
+#include "opt_fdt_arm.h"
+
+#define _ARM32_BUS_DMA_PRIVATE
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: seattle_platform.c,v 1.1 2018/09/08 00:49:06 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define	SEATTLE_CORE_VBASE	KERNEL_IO_VBASE
+#define	SEATTLE_CORE_PBASE	0xe000
+#define	SEATTLE_CORE_SIZE	0x0200
+
+#define	SEATTLE_UART_FREQ	1
+
+extern struct arm32_bus_dma_tag arm_generic_dma_tag;
+extern struct bus_space arm_generic_bs_tag;
+extern struct bus_space arm_generic_a4x_bs_tag;
+
+static struct arm32_dma_range seattle_dma_ranges[] = {
+	[0] = {
+		.dr_sysbase = 0,
+		.dr_busbase = 0,
+		.dr_len = 0x100,
+		.dr_flags = _BUS_DMAMAP_COHERENT,
+	}
+};
+
+static struct arm32_bus_dma_tag seattle_bus_dma_tag = {
+	._ranges = seattle_dma_ranges,
+	._nranges = __arraycount(seattle_dma_ranges),
+_BUS_DMAMAP_FUNCS,
+	_BUS_DMAMEM_FUNCS,
+	_BUS_DMATAG_FUNCS,
+};
+
+static void
+seattle_platform_init_attach_args(struct fdt_attach_args *faa)
+{
+	faa->faa_bst = _generic_bs_tag;
+	faa->faa_a4x_bst = _generic_a4x_bs_tag;
+	faa->faa_dmat = _bus_dma_tag;
+}
+
+static void
+seattle_platform_device_register(device_t self, void *aux)
+{
+}
+
+static const struct pmap_devmap *
+seattle_platform_devmap(void)
+{
+	static const struct pmap_devmap devmap[] = {
+		DEVMAP_ENTRY(SEATTLE_CORE_VBASE,
+			 SEATTLE_CORE_PBASE,
+			 SEATTLE_CORE_SIZE),
+		DEVMAP_ENTRY_END
+	};
+
+	return devmap;
+}
+
+void seattle_platform_early_putchar(char);
+
+void
+seattle_platform_early_putchar(char c)
+{
+#ifdef CONSADDR
+#define CONSADDR_VA	((CONSADDR - SEATTLE_CORE_PBASE) + SEATTLE_CORE_VBASE)
+	volatile uint32_t *uartaddr = cpu_earlydevice_va_p() ?
+	(volatile uint32_t *)CONSADDR_VA :
+	(volatile uint32_t *)CONSADDR;
+
+	while ((uartaddr[PL01XCOM_FR / 4] & PL01X_FR_TXFF) != 0)
+		continue;
+
+	uartaddr[PL01XCOM_DR / 4] = c;
+
+	while ((uartaddr[PL01XCOM_FR / 4] & PL01X_FR_TXFE) == 0)
+		continue;
+#undef CONSADDR_VA
+#endif
+}
+
+static u_int
+seattle_platform_uart_freq(void)
+{
+	return SEATTLE_UART_FREQ;
+}
+
+static const struct arm_platform seattle_platform = {
+	.ap_devmap = seattle_platform_devmap,
+	

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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  8 00:42:01 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add pl061gpio, pcihost, mskc/msk (commented out), ehci@pci, ohci@pci, and 
xhci@pci


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.34 src/sys/arch/evbarm/conf/GENERIC64:1.35
--- src/sys/arch/evbarm/conf/GENERIC64:1.34	Sun Sep  2 01:17:23 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sat Sep  8 00:42:01 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.34 2018/09/02 01:17:23 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.35 2018/09/08 00:42:01 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -170,6 +170,7 @@ tegra210car*	at fdt? pass 3		# NVIDIA Te
 
 # GPIO controller
 bcmgpio*	at fdt?			# Broadcom BCM283x GPIO
+pl061gpio*	at fdt?			# ARM PrimeCell PL061 GPIO
 sunxigpio*	at fdt? pass 3		# Allwinner GPIO
 tegragpio*	at fdt? pass 2		# NVIDIA Tegra GPIO
 rkgpio*		at rkiomux?		# Rockchip GPIO
@@ -187,14 +188,17 @@ tegra210xpad*	at fdt?			# NVIDIA Tegra X
 tegra210xphy*	at tegra210xpad?
 
 # PCIE
+pcihost*	at fdt?			# Generic PCI host controller
 tegrapcie0	at fdt?			# NVIDIA Tegra PCIE
-pci*		at tegrapcie0
+pci*		at pcibus? 
 ppb*		at pci? dev ? function ?
 pci*		at ppb?
 
 # Ethernet
 awge*		at fdt?# DesignWare Gigabit Ethernet
 emac*		at fdt?# Allwinner Gigabit Ethernet (EMAC)
+#mskc*		at pci? dev ? function ?	# Marvell Yukon 2 Gigabit Ethernet
+#msk*		at mskc?
 re*		at pci? dev ? function ?	# Realtek RTL8111GS
 
 # MII/PHY support
@@ -343,9 +347,12 @@ sunxiusb3phy*	at fdt? pass 9		# Allwinne
 tegrausbphy*	at fdt?			# NVIDIA Tegra USB PHY
 dwctwo*		at fdt?			# Designware USB DRD
 ehci*		at fdt?			# EHCI
+ehci*		at pci?			# EHCI
 motg*		at fdt?			# Mentor Graphics USB OTG
 ohci*		at fdt?			# OHCI
+ohci*		at pci?			# OHCI
 xhci*		at fdt?			# XHCI
+xhci*		at pci?			# XHCI
 usb*		at usbus?
 
 include "dev/usb/usbdevices.config"



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  8 00:42:24 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Add initrd options


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/std.generic64

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/evbarm/conf/std.generic64
diff -u src/sys/arch/evbarm/conf/std.generic64:1.1 src/sys/arch/evbarm/conf/std.generic64:1.2
--- src/sys/arch/evbarm/conf/std.generic64:1.1	Sun Apr  1 04:35:04 2018
+++ src/sys/arch/evbarm/conf/std.generic64	Sat Sep  8 00:42:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic64,v 1.1 2018/04/01 04:35:04 ryo Exp $
+#	$NetBSD: std.generic64,v 1.2 2018/09/08 00:42:24 jmcneill Exp $
 #
 # 	generic NetBSD/evbarm64 with FDT support
 
@@ -28,6 +28,11 @@ options 	PCI_NETBSD_CONFIGURE
 
 makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.generic64"
 
+# initrd support
+options		MEMORY_DISK_HOOKS
+options		MEMORY_DISK_DYNAMIC
+pseudo-device	md
+
 # General options
 options 	CHILD_MAX=1024	# 160 is too few
 options 	OPEN_MAX=1024	# 128 is too few



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  8 00:40:57 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/fdt: pcihost_fdt.c

Log Message:
Add FDT generic PCI host controller driver.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/pcihost_fdt.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/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.23 src/sys/arch/arm/fdt/files.fdt:1.24
--- src/sys/arch/arm/fdt/files.fdt:1.23	Fri Aug 17 14:21:30 2018
+++ src/sys/arch/arm/fdt/files.fdt	Sat Sep  8 00:40:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.23 2018/08/17 14:21:30 skrll Exp $
+# $NetBSD: files.fdt,v 1.24 2018/09/08 00:40:57 jmcneill Exp $
 
 include	"dev/pckbport/files.pckbport"
 
@@ -53,6 +53,11 @@ file	arch/arm/fdt/plrtc_fdt.c		plrtc_fdt
 attach	psci at fdt with psci_fdt
 file	arch/arm/fdt/psci_fdt.c			psci_fdt
 
+# Generic PCI host controller
+device	pcihost: pcibus
+attach	pcihost at fdt with pcihost_fdt
+file	arch/arm/fdt/pcihost_fdt.c		pcihost_fdt
+
 device	armpmu
 attach	armpmu at fdt with pmu_fdt
 file	arch/arm/fdt/pmu_fdt.c			pmu_fdt

Added files:

Index: src/sys/arch/arm/fdt/pcihost_fdt.c
diff -u /dev/null src/sys/arch/arm/fdt/pcihost_fdt.c:1.1
--- /dev/null	Sat Sep  8 00:40:57 2018
+++ src/sys/arch/arm/fdt/pcihost_fdt.c	Sat Sep  8 00:40:57 2018
@@ -0,0 +1,512 @@
+/* $NetBSD: pcihost_fdt.c,v 1.1 2018/09/08 00:40:57 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.1 2018/09/08 00:40:57 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#define	IH_PIN_MASK			0x000f
+#define	IH_MPSAFE			0x8000
+
+#define	PCIHOST_DEFAULT_BUS_MIN		0
+#define	PCIHOST_DEFAULT_BUS_MAX		255
+
+#define	PCIHOST_CACHELINE_SIZE		arm_dcache_align
+
+/* Physical address format bit definitions */
+#define	PHYS_HI_RELO			__BIT(31)
+#define	PHYS_HI_PREFETCH		__BIT(30)
+#define	PHYS_HI_ALIASED			__BIT(29)
+#define	PHYS_HI_SPACE			__BITS(25,24)
+#define	 PHYS_HI_SPACE_CFG		0
+#define	 PHYS_HI_SPACE_IO		1
+#define	 PHYS_HI_SPACE_MEM32		2
+#define	 PHYS_HI_SPACE_MEM64		3
+#define	PHYS_HI_BUS			__BITS(23,16)
+#define	PHYS_HI_DEVICE			__BITS(15,11)
+#define	PHYS_HI_FUNCTION		__BITS(10,8)
+#define	PHYS_HI_REGISTER		__BITS(7,0)
+
+enum pcihost_type {
+	PCIHOST_CAM = 1,
+	PCIHOST_ECAM,
+};
+
+struct pcihost_softc {
+	device_t		sc_dev;
+	bus_dma_tag_t		sc_dmat;
+	bus_space_tag_t		sc_bst;
+	bus_space_handle_t	sc_bsh;
+	int			sc_phandle;
+
+	enum pcihost_type	sc_type;
+
+	u_int			sc_bus_min;
+	u_int			sc_bus_max;
+
+	struct arm32_pci_chipset sc_pc;
+};
+
+static int	pcihost_match(device_t, cfdata_t, void *);
+static void	pcihost_attach(device_t, device_t, void *);
+
+static void	pcihost_init(pci_chipset_tag_t, void *);
+static int	pcihost_config(struct pcihost_softc *);
+
+static void	pcihost_attach_hook(device_t, device_t,
+   struct pcibus_attach_args *);
+static int	pcihost_bus_maxdevs(void *, int);
+static pcitag_t	pcihost_make_tag(void *, int, int, int);
+static void	pcihost_decompose_tag(void *, pcitag_t, int *, int *, int *);
+static pcireg_t	pcihost_conf_read(void *, pcitag_t, int);
+static void	pcihost_conf_write(void *, pcitag_t, int, pcireg_t);
+static int	pcihost_conf_hook(void *, int, int, int, pcireg_t);
+static void	

CVS commit: [pgoyette-compat] src

2018-09-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep  7 23:32:30 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: COMPAT-branch-notes
src/sbin/modstat [pgoyette-compat]: main.c modstat.8
src/share/man/man9 [pgoyette-compat]: module.9
src/sys/compat/common [pgoyette-compat]: compat_mod.c compat_sysv_mod.c
kern_mod_80.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_module.c
src/sys/kern [pgoyette-compat]: kern_module.c sys_module.c
src/sys/sys [pgoyette-compat]: module.h

Log Message:
At the request of reviewers, remove the module alias functionality.

We will rely only on module names and duplicate-symbol detection to
detect module conflicts.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/COMPAT-branch-notes
cvs rdiff -u -r1.24.12.2 -r1.24.12.3 src/sbin/modstat/main.c
cvs rdiff -u -r1.22.12.2 -r1.22.12.3 src/sbin/modstat/modstat.8
cvs rdiff -u -r1.42.2.7 -r1.42.2.8 src/share/man/man9/module.9
cvs rdiff -u -r1.24.14.36 -r1.24.14.37 src/sys/compat/common/compat_mod.c
cvs rdiff -u -r1.4.10.3 -r1.4.10.4 src/sys/compat/common/compat_sysv_mod.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/common/kern_mod_80.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.130.2.21 -r1.130.2.22 src/sys/kern/kern_module.c
cvs rdiff -u -r1.23.2.8 -r1.23.2.9 src/sys/kern/sys_module.c
cvs rdiff -u -r1.41.14.10 -r1.41.14.11 src/sys/sys/module.h

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

Modified files:

Index: src/doc/COMPAT-branch-notes
diff -u src/doc/COMPAT-branch-notes:1.1.2.22 src/doc/COMPAT-branch-notes:1.1.2.23
--- src/doc/COMPAT-branch-notes:1.1.2.22	Thu Sep  6 08:22:10 2018
+++ src/doc/COMPAT-branch-notes	Fri Sep  7 23:32:29 2018
@@ -1,16 +1,17 @@
-/* $NetBSD: COMPAT-branch-notes,v 1.1.2.22 2018/09/06 08:22:10 pgoyette Exp $ */
+/* $NetBSD: COMPAT-branch-notes,v 1.1.2.23 2018/09/07 23:32:29 pgoyette Exp $ */
 
 DONE
 
-1.  Removed linking of the kernel compat object library into all kernels;
-using the .o library caused some build breakage, and resulted in the
-bulk of the compat code being included in every kernel, but without
-any module linkage.  In turn, this caused failure when loading some
-modules due to symbols already being defined in the kernel.
-
-2.  Reverted some intentional breakage for loading the sysv_ipc module;
-the breakage was introduced as the fix for the above-mentioned build
-breakage.  
+1.  Returned the build to use a .a compat library rather than a .o
+library.  The original method used was .a but that was changed
+(fairly recently) as a work-around to address some support
+routines that were not being included when needed.  These support
+modules are now included in their own module, and the work-around
+is therefore no longer needed.
+
+2.  Reverted some intentional auto-load breakage for loading the sysv_ipc
+module; the breakage was introduced as the fix for the above-mentioned
+build breakage.  
 
 3.  Split the sysv_ipc compat routines into their own compat_sysv module.
 
@@ -19,34 +20,27 @@ DONE
 5.  Extracted some net/if.c compat routines into the compat module, and
 replaced the originals with indirect (vectored) function calls.
 
-6.  Implemented a mechanism for modules to include "aliases", allowing
-a single module file to declare multiple names.  For example, a
-single "compat" module could declare compat_80, compat_70, etc, and
-other modules could depend on specific compat levels rather than on
-the entirety of compat.
-
-7.  Reconfirmed existing compat-module dependencies, and update the
+6.  Reconfirmed existing compat-module dependencies, and update the
 defopt/defflag lines in the config files* as needed, to insure that
 built-in dependencies get resolved.
 
-8.  Fixed limits on the number of module depedencies and maximum
+7.  Fixed limits on the number of module depedencies and maximum
 recursion level have been removed.  Previous code for reporting
 module status to userland has been versioned and moved to the
 compat_80 module.
 
-9.  The old monolithic compat module has been broken into multiple
+8.  The old monolithic compat module has been broken into multiple
 modules, one for each old NetBSD version.  The monolithic module
-is still available, and uses the alias mechanism to "advertise"
-that the component modules are available.
+is still available.
 
 Similarly, the compat_sysv module has also been split into several
-version-specific modules.  (A mini-monolithic compat_sysv module
-is still provided.)
+version-specific modules, and the mini-monolithic compat_sysv module
+is still provided.
 
-10. syscalls.master has been updated to autoload the version-specific
+9.  syscalls.master has been updated to 

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

2018-09-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Sep  7 21:14:45 UTC 2018

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

Log Message:
re-enable 64bit addressing in n32 kernels
Now these work again, at least on my Indy.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/arch/mips/mips/locore.S

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

Modified files:

Index: src/sys/arch/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.218 src/sys/arch/mips/mips/locore.S:1.219
--- src/sys/arch/mips/mips/locore.S:1.218	Wed Mar 28 17:56:52 2018
+++ src/sys/arch/mips/mips/locore.S	Fri Sep  7 21:14:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.218 2018/03/28 17:56:52 maya Exp $	*/
+/*	$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -63,7 +63,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore.S,v 1.218 2018/03/28 17:56:52 maya Exp $")
+RCSID("$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $")
 
 #include "assym.h"
 
@@ -87,12 +87,17 @@ _C_LABEL(kernel_text):
 	mtc0	k0, MIPS_COP_0_STATUS
 	COP0_SYNC
 
-#ifdef _LP64
+#if defined(_LP64) 
 	/* Enable 64-bit addressing */
 	mfc0	k0, MIPS_COP_0_STATUS
 	MFC0_HAZARD
 	or	k0, MIPS_SR_KX | MIPS_SR_UX
 	mtc0	k0, MIPS_COP_0_STATUS
+#elif defined(__mips_n32)
+mfc0k0, MIPS_COP_0_STATUS
+MFC0_HAZARD
+or  k0, MIPS_SR_KX
+mtc0k0, MIPS_COP_0_STATUS
 #endif
 
 #ifdef HPCMIPS_L1CACHE_DISABLE



CVS commit: src/distrib/sets/lists/base

2018-09-07 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Fri Sep  7 20:44:04 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
fix the build

add mssing directory to sets list


To generate a diff of this commit:
cvs rdiff -u -r1.1185 -r1.1186 src/distrib/sets/lists/base/mi

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/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1185 src/distrib/sets/lists/base/mi:1.1186
--- src/distrib/sets/lists/base/mi:1.1185	Thu Sep  6 19:19:44 2018
+++ src/distrib/sets/lists/base/mi	Fri Sep  7 20:44:04 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1185 2018/09/06 19:19:44 maxv Exp $
+# $NetBSD: mi,v 1.1186 2018/09/07 20:44:04 para Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -5983,6 +5983,7 @@
 ./var/chroot/nsd/varbase-sys-root
 ./var/chroot/nsd/var/dbbase-sys-root
 ./var/chroot/nsd/var/db/nsd			base-sys-root
+./var/chroot/nsd/var/run			base-sys-root
 ./var/chroot/ntpdbase-ntp-root
 ./var/chroot/ntpd/devbase-ntp-root
 ./var/chroot/ntpd/etcbase-ntp-root



CVS commit: src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64

2018-09-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  7 18:41:39 UTC 2018

Modified Files:
src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64: configargs.h

Log Message:
fix the build; this was mis-generated before to an empty file.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64/configargs.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/usr.bin/gcc/arch/aarch64/configargs.h
diff -u src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64/configargs.h:1.2 src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64/configargs.h:1.3
--- src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64/configargs.h:1.2	Wed Sep  5 02:27:04 2018
+++ src/external/gpl3/gcc.old/usr.bin/gcc/arch/aarch64/configargs.h	Fri Sep  7 14:41:39 2018
@@ -0,0 +1,11 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gcc,v 1.94 2018/09/04 22:57:25 mrg Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* Generated automatically. */
+static const char configuration_arguments[] = "/usr/src/tools/gcc/../../external/gpl3/gcc.old/dist/configure --target=aarch64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb3 20180905' --with-system-zlib --disable-libstdcxx-dual-abi --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-mpc-lib=/usr/src/external/lgpl3/mpc/lib/libmpc/obj.evbarm-aarch64 --with-mpfr-lib=/usr/src/external/lgpl3/mpfr/lib/libmpfr/obj.evbarm-aarch64 --with-gmp-lib=/usr/src/external/lgpl3/gmp/lib/libgmp/obj.evbarm-aarch64 --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/aarch64 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --disable-libstdcxx-dual-abi --build=aarch64--netbsd --host=aarch64--netbsd --with-sysroot=
 /usr/obj/evbarm-aarch64/release";
+static const char thread_model[] = "posix";
+
+static const struct {
+  const char *name, *value;
+} configure_default_options[] = { { NULL, NULL} };



CVS commit: src/sys/stand/efiboot

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  7 17:30:59 UTC 2018

Modified Files:
src/sys/stand/efiboot: boot.c efiboot.h efifdt.c efifdt.h exec.c

Log Message:
Add initrd support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/efiboot.h \
src/sys/stand/efiboot/exec.c
cvs rdiff -u -r1.7 -r1.8 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efifdt.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/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.5 src/sys/stand/efiboot/boot.c:1.6
--- src/sys/stand/efiboot/boot.c:1.5	Mon Sep  3 00:17:00 2018
+++ src/sys/stand/efiboot/boot.c	Fri Sep  7 17:30:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.5 2018/09/03 00:17:00 jmcneill Exp $	*/
+/*	$NetBSD: boot.c,v 1.6 2018/09/07 17:30:58 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -53,17 +53,20 @@ static const char * const names[][2] = {
 #define	DEFTIMEOUT	5
 
 static char default_device[32];
+static char initrd_path[255];
 
 void	command_boot(char *);
 void	command_dev(char *);
+void	command_initrd(char *);
 void	command_ls(char *);
 void	command_reset(char *);
 void	command_version(char *);
 void	command_quit(char *);
 
 const struct boot_command commands[] = {
-	{ "boot",	command_boot,		"boot [fsN:][filename] [args]\n (ex. \"fs0:\\netbsd.old -s\"" },
+	{ "boot",	command_boot,		"boot [dev:][filename] [args]\n (ex. \"hd0a:\\netbsd.old -s\"" },
 	{ "dev",	command_dev,		"dev" },
+	{ "initrd",	command_initrd,		"initrd [dev:][filename]" },
 	{ "ls",		command_ls,		"ls [hdNn:/path]" },
 	{ "version",	command_version,	"version" },
 	{ "help",	command_help,		"help|?" },
@@ -111,6 +114,12 @@ command_dev(char *arg)
 }
 
 void
+command_initrd(char *arg)
+{
+	set_initrd_path(arg);
+}
+
+void
 command_ls(char *arg)
 {
 	ls(arg);
@@ -157,6 +166,21 @@ get_default_device(void)
 	return default_device;
 }
 
+int
+set_initrd_path(char *arg)
+{
+	if (strlen(arg) + 1 > sizeof(initrd_path))
+		return ERANGE;
+	strcpy(initrd_path, arg);
+	return 0;
+}
+
+char *
+get_initrd_path(void)
+{
+	return initrd_path;
+}
+
 void
 print_banner(void)
 {

Index: src/sys/stand/efiboot/efiboot.h
diff -u src/sys/stand/efiboot/efiboot.h:1.3 src/sys/stand/efiboot/efiboot.h:1.4
--- src/sys/stand/efiboot/efiboot.h:1.3	Mon Sep  3 00:04:02 2018
+++ src/sys/stand/efiboot/efiboot.h	Fri Sep  7 17:30:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.h,v 1.3 2018/09/03 00:04:02 jmcneill Exp $	*/
+/*	$NetBSD: efiboot.h,v 1.4 2018/09/07 17:30:58 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -52,6 +52,8 @@ extern const struct boot_command command
 void command_help(char *);
 int set_default_device(char *);
 char *get_default_device(void);
+int set_initrd_path(char *);
+char *get_initrd_path(void);
 
 /* console.c */
 int ischar(void);
Index: src/sys/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.3 src/sys/stand/efiboot/exec.c:1.4
--- src/sys/stand/efiboot/exec.c:1.3	Sun Sep  2 23:50:23 2018
+++ src/sys/stand/efiboot/exec.c	Fri Sep  7 17:30:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.3 2018/09/02 23:50:23 jmcneill Exp $ */
+/* $NetBSD: exec.c,v 1.4 2018/09/07 17:30:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -33,6 +33,78 @@
 
 u_long load_offset = 0;
 
+#define	FDT_SPACE	(4 * 1024 * 1024)
+#define	FDT_ALIGN	((2 * 1024 * 1024) - 1)
+
+static EFI_PHYSICAL_ADDRESS initrd_addr;
+static u_long initrd_size = 0;
+
+static int
+load_initrd(void)
+{
+	EFI_STATUS status;
+	struct stat st;
+	ssize_t len;
+	char *path;
+	int fd;
+
+	path = get_initrd_path();
+	if (strlen(path) == 0)
+		return 0;
+
+	fd = open(path, 0);
+	if (fd < 0) {
+		printf("boot: failed to open %s: %s\n", path, strerror(errno));
+		return errno;
+	}
+	if (fstat(fd, ) < 0) {
+		printf("boot: failed to fstat %s: %s\n", path, strerror(errno));
+		close(fd);
+		return errno;
+	}
+	if (st.st_size == 0) {
+		printf("boot: empty initrd %s\n", path);
+		close(fd);
+		return EINVAL;
+	}
+
+	initrd_size = st.st_size;
+
+#ifdef EFIBOOT_ALLOCATE_MAX_ADDRESS
+	initrd_addr = EFIBOOT_ALLOCATE_MAX_ADDRESS;
+	status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress, EfiLoaderData,
+	EFI_SIZE_TO_PAGES(initrd_size), _addr);
+#else
+	initrd_addr = 0;
+	status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateAnyPages, EfiLoaderData,
+	EFI_SIZE_TO_PAGES(initrd_size), _addr);
+#endif
+	if (EFI_ERROR(status)) {
+		printf("Failed to allocate %lu bytes for initrd image (error %lu)\n",
+		initrd_size, status);
+		close(fd);
+		return ENOMEM;
+	}
+
+	printf("boot: loading %s ", path);
+	len = read(fd, (void *)initrd_addr, initrd_size);
+	close(fd);
+
+	if (len != initrd_size) {
+		if (len < 0)
+			printf(": %s\n", strerror(errno));
+		else
+			printf(": returned %ld 

CVS commit: src/sys/stand/efiboot

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  7 17:30:32 UTC 2018

Modified Files:
src/sys/stand/efiboot: efiboot_machdep.h
src/sys/stand/efiboot/bootaa64: cache.S efibootaa64.c

Log Message:
Disable MMU and dcache before jumping to the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/efiboot_machdep.h
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/bootaa64/cache.S \
src/sys/stand/efiboot/bootaa64/efibootaa64.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/stand/efiboot/efiboot_machdep.h
diff -u src/sys/stand/efiboot/efiboot_machdep.h:1.1 src/sys/stand/efiboot/efiboot_machdep.h:1.2
--- src/sys/stand/efiboot/efiboot_machdep.h:1.1	Fri Aug 24 02:01:06 2018
+++ src/sys/stand/efiboot/efiboot_machdep.h	Fri Sep  7 17:30:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot_machdep.h,v 1.1 2018/08/24 02:01:06 jmcneill Exp $ */
+/* $NetBSD: efiboot_machdep.h,v 1.2 2018/09/07 17:30:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -30,4 +30,5 @@
 #define	EFIBOOT_ALIGN 0
 #endif
 
+void efi_dcache_flush(u_long, u_long);
 void efi_boot_kernel(u_long[]);

Index: src/sys/stand/efiboot/bootaa64/cache.S
diff -u src/sys/stand/efiboot/bootaa64/cache.S:1.1 src/sys/stand/efiboot/bootaa64/cache.S:1.2
--- src/sys/stand/efiboot/bootaa64/cache.S:1.1	Fri Aug 24 02:01:06 2018
+++ src/sys/stand/efiboot/bootaa64/cache.S	Fri Sep  7 17:30:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.S,v 1.1 2018/08/24 02:01:06 jmcneill Exp $	*/
+/*	$NetBSD: cache.S,v 1.2 2018/09/07 17:30:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 Robin Randhawa
@@ -34,6 +34,9 @@
 
 #include 
 
+#define	SCTLR_M	(1<<0)
+#define	SCTLR_C	(1<<2)
+
 	.text
 	.align	2
 
@@ -96,3 +99,40 @@ ENTRY(aarch64_icache_inv_all)
 	isb
 	ret
 END(aarch64_icache_inv_all)
+
+/*
+ * void aarch64_exec_kernel(paddr_t entry, paddr_t dtb)
+ */
+ENTRY(aarch64_exec_kernel)
+	mov	x20, x0	/* kernel entry point */
+	mov	x21, x1	/* dtb address */
+
+	mrs	x0, CurrentEL
+	lsr	x0, x0, #2
+	cmp	x0, #0x2
+	b.eq	1f
+
+	/* Disable MMU and dcache, CurrentEL = EL1 */
+	mrs	x0, sctlr_el1
+	bic	x0, x0, #SCTLR_M
+	bic	x0, x0, #SCTLR_C
+	msr	sctlr_el1, x0
+	isb
+	b	2f
+1:
+	/* Disable MMU and dcache, CurrentEL = EL2 */
+	mrs	x0, sctlr_el2
+	bic	x0, x0, #SCTLR_M
+	bic	x0, x0, #SCTLR_C
+	msr	sctlr_el2, x0
+	isb
+2:
+
+	/* Jump to kernel */
+	mov	x0, x21
+	mov	x1, xzr
+	mov	x2, xzr
+	mov	x3, xzr
+	br	x20
+
+END(aarch64_exec_kernel)
Index: src/sys/stand/efiboot/bootaa64/efibootaa64.c
diff -u src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.1 src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.2
--- src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.1	Fri Aug 24 02:01:06 2018
+++ src/sys/stand/efiboot/bootaa64/efibootaa64.c	Fri Sep  7 17:30:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootaa64.c,v 1.1 2018/08/24 02:01:06 jmcneill Exp $	*/
+/*	$NetBSD: efibootaa64.c,v 1.2 2018/09/07 17:30:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -36,6 +36,13 @@
 /* cache.S */
 void aarch64_dcache_wbinv_range(vaddr_t, vsize_t);
 void aarch64_icache_inv_all(void);
+void aarch64_exec_kernel(paddr_t, paddr_t);
+
+void
+efi_dcache_flush(u_long start, u_long size)
+{
+	aarch64_dcache_wbinv_range(start, size);
+}
 
 void
 efi_boot_kernel(u_long marks[MARK_MAX])
@@ -51,5 +58,5 @@ efi_boot_kernel(u_long marks[MARK_MAX])
 		aarch64_dcache_wbinv_range((u_long)efi_fdt_data(), efi_fdt_size());
 	aarch64_icache_inv_all();
 
-	kernel_entry((register_t)efi_fdt_data(), 0, 0, 0);
+	aarch64_exec_kernel((paddr_t)marks[MARK_ENTRY], (paddr_t)efi_fdt_data());
 }



CVS commit: src/sys/arch/evbarm/fdt

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  7 17:21:58 UTC 2018

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Increase MAX_PHYSMEM to 64


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/fdt/fdt_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/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.34 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.35
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.34	Mon Aug 27 09:54:16 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Fri Sep  7 17:21:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.34 2018/08/27 09:54:16 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.35 2018/09/07 17:21:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.34 2018/08/27 09:54:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.35 2018/09/07 17:21:58 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -459,7 +459,7 @@ initarm(void *arg)
 
 	parse_mi_bootargs(boot_args);
 
-	#define MAX_PHYSMEM 16
+	#define MAX_PHYSMEM 64
 	static struct boot_physmem fdt_physmem[MAX_PHYSMEM];
 	int nfdt_physmem = 0;
 	struct extent_region *er;



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  7 17:21:38 UTC 2018

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

Log Message:
Increase VM_PHYSSEG_MAX to 64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/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.4 src/sys/arch/aarch64/include/vmparam.h:1.5
--- src/sys/arch/aarch64/include/vmparam.h:1.4	Sat May 12 15:14:49 2018
+++ src/sys/arch/aarch64/include/vmparam.h	Fri Sep  7 17:21:38 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.4 2018/05/12 15:14:49 jmcneill Exp $ */
+/* $NetBSD: vmparam.h,v 1.5 2018/09/07 17:21:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -150,7 +150,7 @@
 #define AARCH64_KVA_TO_PA(va)	((paddr_t) ((va) & ~AARCH64_KSEG_MASK))
 
 /* */
-#define VM_PHYSSEG_MAX		16  /* XXX */
+#define VM_PHYSSEG_MAX		64  /* XXX */
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
 
 #define VM_NFREELIST		3



CVS commit: src/external/bsd/nsd/etc/rc.d

2018-09-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  7 16:51:13 UTC 2018

Modified Files:
src/external/bsd/nsd/etc/rc.d: nsd

Log Message:
make a link to the pid file so the rc scripts can find it.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nsd/etc/rc.d/nsd

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/nsd/etc/rc.d/nsd
diff -u src/external/bsd/nsd/etc/rc.d/nsd:1.1 src/external/bsd/nsd/etc/rc.d/nsd:1.2
--- src/external/bsd/nsd/etc/rc.d/nsd:1.1	Sat Jan  7 14:51:21 2017
+++ src/external/bsd/nsd/etc/rc.d/nsd	Fri Sep  7 12:51:12 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: nsd,v 1.1 2017/01/07 19:51:21 christos Exp $
+# $NetBSD: nsd,v 1.2 2018/09/07 16:51:12 christos Exp $
 #
 
 # PROVIDE: named
@@ -62,13 +62,14 @@ nsd_migrate()
 
 nsd_precmd()
 {
-	if [ -z "$nsd_chrootdir" ]; then
+	if [ -z "${nsd_chrootdir}" ]; then
 		return
 	fi
 
 	if [ ! -h /etc/nsd ]; then
 		nsd_migrate /etc/nsd ${nsd_chrootdir}
 	fi
+	ln -sf "${nsd_chrootdir}${pidfile}" "${pidfile}"
 }
 
 load_rc_config $name



CVS commit: src/etc/mtree

2018-09-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  7 16:50:22 UTC 2018

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
add /var/chroot/nsd/var/run


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.173 src/etc/mtree/NetBSD.dist.base:1.174
--- src/etc/mtree/NetBSD.dist.base:1.173	Thu Sep  6 15:19:44 2018
+++ src/etc/mtree/NetBSD.dist.base	Fri Sep  7 12:50:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.173 2018/09/06 19:19:44 maxv Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.174 2018/09/07 16:50:22 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1277,6 +1277,7 @@
 ./var/chroot/nsd/var		mode=0755 uname=_nsd gname=_nsd
 ./var/chroot/nsd/var/db		mode=0755 uname=_nsd gname=_nsd
 ./var/chroot/nsd/var/db/nsd	mode=0755 uname=_nsd gname=_nsd
+./var/chroot/nsd/var/run	mode=0775 uname=_nsd gname=_nsd
 ./var/chroot/ntpd
 ./var/chroot/ntpd/dev
 ./var/chroot/ntpd/etc



CVS commit: src/usr.bin/xlint

2018-09-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  7 15:16:15 UTC 2018

Modified Files:
src/usr.bin/xlint/common: inittyp.c lint.h lp64.h tyname.c
src/usr.bin/xlint/lint1: decl.c err.c scan.l tree.c
src/usr.bin/xlint/lint2: read.c

Log Message:
recognize int128


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/common/lp64.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint2/read.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/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.11 src/usr.bin/xlint/common/inittyp.c:1.12
--- src/usr.bin/xlint/common/inittyp.c:1.11	Tue Apr 14 21:20:57 2009
+++ src/usr.bin/xlint/common/inittyp.c	Fri Sep  7 11:16:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.11 2009/04/15 01:20:57 christos Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.12 2018/09/07 15:16:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.11 2009/04/15 01:20:57 christos Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.12 2018/09/07 15:16:15 christos Exp $");
 #endif
 
 #include 
@@ -104,6 +104,15 @@ inittyp(void)
 		{ UQUAD,{ QUAD_SIZE, 8 * CHAR_BIT,
   QUAD, UQUAD,
   1, 1, 0, 1, 1, 0, "unsigned long long" } },
+#ifdef INT128_SIZE
+		{ INT128,   { INT128_SIZE, 16 * CHAR_BIT,
+  INT128, UINT128,
+  1, 0, 0, 1, 1, 0, "__int128_t" } },
+		{ UINT128,  { INT128_SIZE, 16 * CHAR_BIT,
+  INT128, UINT128,
+  1, 1, 0, 1, 1, 0, "__uint128_t" } },
+#endif
+
 		{ FLOAT,{ FLOAT_SIZE, 4 * CHAR_BIT,
   FLOAT, FLOAT,
   0, 0, 1, 1, 1, 0, "float" } },

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.13 src/usr.bin/xlint/common/lint.h:1.14
--- src/usr.bin/xlint/common/lint.h:1.13	Tue Apr 14 21:20:57 2009
+++ src/usr.bin/xlint/common/lint.h	Fri Sep  7 11:16:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.13 2009/04/15 01:20:57 christos Exp $	*/
+/*	$NetBSD: lint.h,v 1.14 2018/09/07 15:16:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -64,6 +64,10 @@ typedef enum {
 	ULONG,		/* unsigned long */
 	QUAD,		/* (signed) long long */
 	UQUAD,		/* unsigned long long */
+#ifdef INT128_SIZE
+	INT128,		/* (signed) __int128_t */
+	UINT128,	/* __uint128_t */
+#endif
 	FLOAT,		/* float */
 	DOUBLE,		/* double or, with tflag, long float */
 	LDOUBLE,	/* long double */

Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.4 src/usr.bin/xlint/common/lp64.h:1.5
--- src/usr.bin/xlint/common/lp64.h:1.4	Tue Mar 27 15:24:03 2012
+++ src/usr.bin/xlint/common/lp64.h	Fri Sep  7 11:16:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lp64.h,v 1.4 2012/03/27 19:24:03 christos Exp $	*/
+/*	$NetBSD: lp64.h,v 1.5 2018/09/07 15:16:15 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -45,6 +45,7 @@
 #define	LONG_SIZE	(8 * CHAR_BIT)
 #define	QUAD_SIZE	(8 * CHAR_BIT)
 #define	PTR_SIZE	(8 * CHAR_BIT)
+#define	INT128_SIZE	(16 * CHAR_BIT)
 
 #define	TARG_SCHAR_MAX	((signed char) (((unsigned char) -1) >> 1))
 #define	TARG_SCHAR_MIN	((-TARG_CHAR_MAX) - 1)
@@ -65,3 +66,7 @@
 #define	TARG_QUAD_MAX	((int64_t) (((uint64_t) -1) >> 1))
 #define	TARG_QUAD_MIN	((-TARG_QUAD_MAX) - 1)
 #define	TARG_UQUAD_MAX	((uint64_t) -1)
+
+#define	TARG_INT128_MAX		((__int128_t) (((__uint128_t) -1) >> 1))
+#define	TARG_INT128_MIN		((-TARG_INT128_MAX) - 1)
+#define	TARG_UINT128_MAX	((__uint128_t) -1)

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.12 src/usr.bin/xlint/common/tyname.c:1.13
--- src/usr.bin/xlint/common/tyname.c:1.12	Fri Aug 19 06:18:11 2016
+++ src/usr.bin/xlint/common/tyname.c	Fri Sep  7 11:16:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.12 2016/08/19 10:18:11 christos Exp $	*/
+/*	$NetBSD: tyname.c,v 1.13 2018/09/07 15:16:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.12 2016/08/19 10:18:11 christos Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.13 2018/09/07 15:16:15 christos Exp $");
 #endif
 
 #include 
@@ -68,6 +68,10 @@ basictyname(tspec_t t)
 	case ULONG:	return "unsigned long";
 	case QUAD:	return "long long";
 	case UQUAD:	return "unsigned long long";
+#ifdef INT128_SIZE
+	case INT128:	return "__int128_t";
+	case UINT128:	return 

CVS commit: src/sys/netbt

2018-09-07 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Fri Sep  7 14:47:15 UTC 2018

Modified Files:
src/sys/netbt: hci_link.c

Log Message:
two issues noted by maxv@

1. If an adaptor sends repeated fragments indicating HCI_PACKET_START,
   we would leak mbufs. Fix that by releasing the previous in that case.

2. If an adaptor sends fragments which overflow the expected total
   payload length, it could build up the pending packet to use up system
   mbufs. Fix that by changing the unsigned calculation to a comparison
   and rejecting oversize packets


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/netbt/hci_link.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/netbt/hci_link.c
diff -u src/sys/netbt/hci_link.c:1.24 src/sys/netbt/hci_link.c:1.25
--- src/sys/netbt/hci_link.c:1.24	Tue May 20 18:25:54 2014
+++ src/sys/netbt/hci_link.c	Fri Sep  7 14:47:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_link.c,v 1.24 2014/05/20 18:25:54 rmind Exp $	*/
+/*	$NetBSD: hci_link.c,v 1.25 2018/09/07 14:47:15 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.24 2014/05/20 18:25:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_link.c,v 1.25 2018/09/07 14:47:15 plunky Exp $");
 
 #include 
 #include 
@@ -475,12 +475,15 @@ hci_acl_recv(struct mbuf *m, struct hci_
 
 	switch (pb) {
 	case HCI_PACKET_START:
-		if (link->hl_rxp != NULL)
+		if (m->m_pkthdr.len < sizeof(l2cap_hdr_t))
+			goto bad;
+
+		if (link->hl_rxp != NULL) {
 			aprint_error_dev(unit->hci_dev,
 			"dropped incomplete ACL packet\n");
 
-		if (m->m_pkthdr.len < sizeof(l2cap_hdr_t))
-			goto bad;
+			m_freem(link->hl_rxp);
+		}
 
 		link->hl_rxp = m;
 		got = m->m_pkthdr.len;
@@ -508,18 +511,24 @@ hci_acl_recv(struct mbuf *m, struct hci_
 	}
 
 	m_copydata(m, 0, sizeof(want), );
-	want = le16toh(want) + sizeof(l2cap_hdr_t) - got;
+	want = le16toh(want);
+	got -= sizeof(l2cap_hdr_t);
 
-	if (want > 0)
+	if (got < want)		/* wait for more */
 		return;
 
 	link->hl_rxp = NULL;
 
-	if (want == 0) {
-		l2cap_recv_frame(m, link);
-		return;
+	if (got > want) {
+		DPRINTF("%s: packet overflow\n",
+			device_xname(unit->hci_dev));
+
+		goto bad;
 	}
 
+	l2cap_recv_frame(m, link);
+	return;
+
 bad:
 	m_freem(m);
 }



CVS commit: src/sys/net

2018-09-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  7 13:24:14 UTC 2018

Modified Files:
src/sys/net: if.c

Log Message:
Flip the order of free'ing things to avoid crash (from ozaki-r). Tested
with a month's uptime. Used to crash once a week.


To generate a diff of this commit:
cvs rdiff -u -r1.435 -r1.436 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.435 src/sys/net/if.c:1.436
--- src/sys/net/if.c:1.435	Thu Sep  6 02:42:00 2018
+++ src/sys/net/if.c	Fri Sep  7 09:24:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.435 2018/09/06 06:42:00 maxv Exp $	*/
+/*	$NetBSD: if.c,v 1.436 2018/09/07 13:24:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.435 2018/09/06 06:42:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.436 2018/09/07 13:24:14 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1322,6 +1322,18 @@ if_detach(struct ifnet *ifp)
 	if_deactivate(ifp);
 	IFNET_UNLOCK(ifp);
 
+	/*
+	 * Unlink from the list and wait for all readers to leave
+	 * from pserialize read sections.  Note that we can't do
+	 * psref_target_destroy here.  See below.
+	 */
+	IFNET_GLOBAL_LOCK();
+	ifindex2ifnet[ifp->if_index] = NULL;
+	TAILQ_REMOVE(_list, ifp, if_list);
+	IFNET_WRITER_REMOVE(ifp);
+	pserialize_perform(ifnet_psz);
+	IFNET_GLOBAL_UNLOCK();
+
 	if (ifp->if_slowtimo != NULL && ifp->if_slowtimo_ch != NULL) {
 		ifp->if_slowtimo = NULL;
 		callout_halt(ifp->if_slowtimo_ch, NULL);
@@ -1453,14 +1465,10 @@ restart:
 		}
 	}
 
-	/* Wait for all readers to drain before freeing.  */
-	IFNET_GLOBAL_LOCK();
-	ifindex2ifnet[ifp->if_index] = NULL;
-	TAILQ_REMOVE(_list, ifp, if_list);
-	IFNET_WRITER_REMOVE(ifp);
-	pserialize_perform(ifnet_psz);
-	IFNET_GLOBAL_UNLOCK();
-
+	/*
+	 * Must be done after the above pr_purgeif because if_psref may be
+	 * still used in pr_purgeif.
+	 */
 	psref_target_destroy(>if_psref, ifnet_psref_class);
 	PSLIST_ENTRY_DESTROY(ifp, if_pslist_entry);
 



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

2018-09-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  7 12:50:58 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: plcom_fdt.c

Log Message:
Print interrupt info


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/plcom_fdt.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/fdt/plcom_fdt.c
diff -u src/sys/arch/arm/fdt/plcom_fdt.c:1.1 src/sys/arch/arm/fdt/plcom_fdt.c:1.2
--- src/sys/arch/arm/fdt/plcom_fdt.c:1.1	Fri Jun  2 14:30:58 2017
+++ src/sys/arch/arm/fdt/plcom_fdt.c	Fri Sep  7 12:50:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: plcom_fdt.c,v 1.1 2017/06/02 14:30:58 jmcneill Exp $ */
+/* $NetBSD: plcom_fdt.c,v 1.2 2018/09/07 12:50:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.1 2017/06/02 14:30:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.2 2018/09/07 12:50:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -62,6 +62,7 @@ plcom_fdt_attach(device_t parent, device
 	struct plcom_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
 	const int phandle = faa->faa_phandle;
+	char intrstr[128];
 	struct clk *clk;
 	bus_addr_t addr;
 	bus_size_t size;
@@ -72,6 +73,11 @@ plcom_fdt_attach(device_t parent, device
 		return;
 	}
 
+	if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
+		aprint_error(": failed to decode interrupt\n");
+		return;
+	}
+
 	sc->sc_dev = self;
 
 	/* Enable clocks */
@@ -98,6 +104,8 @@ plcom_fdt_attach(device_t parent, device
 	}
 	plcom_attach_subr(sc);
 
+	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
+
 	ih = fdtbus_intr_establish(phandle, 0, IPL_SERIAL, FDT_INTR_MPSAFE,
 	plcomintr, sc);
 	if (ih == NULL) {



CVS commit: [netbsd-8] src/doc

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:38:23 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Tickets #1010 - #1014


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-8.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-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.21 src/doc/CHANGES-8.1:1.1.2.22
--- src/doc/CHANGES-8.1:1.1.2.21	Thu Sep  6 08:11:54 2018
+++ src/doc/CHANGES-8.1	Fri Sep  7 12:38:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.21 2018/09/06 08:11:54 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.22 2018/09/07 12:38:23 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -942,3 +942,40 @@ external/gpl3/gcc/usr.bin/gcc/arch/x86_6
 	Regen (mknative).
 	[mrg, ticket #1009]
 
+sys/dev/scsipi/scsipi_base.c			1.178
+
+	Async event can be called before the adapter is running (pmax tc asc).
+	[mrg, ticket #1010]
+
+sys/arch/amd64/conf/GENERIC			1.502 (patch)
+sys/arch/i386/conf/GENERIC			1.1188 (patch)
+sys/dev/usb/usbdevices.config			1.32 (patch)
+
+	Add commented entries that exist in amd64 GENERIC: oboe, mos, umb.
+	Comment out uscanner(4) -- usb scanners use ugen(4) interface.
+	Use dev/usb/usbdevices.config, gaining these missing drivers:
+	slurm(4), uthum(4), umcs(4), uark(4), upgt(4), and usmsc(4).
+	[mrg, ticket #1011]
+
+sys/net/route.c	1.212,1.213
+
+	Fix reference leak in the delyed route free mechanism.
+	Avoid a race overwriting rt_free_global.enqueued.
+	[ozaki-r, ticket #1012]
+
+sys/ddb/db_command.c1.155 (patch)
+sys/kern/subr_lockdebug.c			1.65 (patch)
+sys/sys/lockdebug.h1.20 (patch)
+
+	Add a lockdebug_dismiss() function for DDB to use that tells
+	lockdebug to avoid asserts.  use it for the ddb "reboot"
+	command, so that it doesn't matter how ddb was entered, the
+	reboot not trigger mutex checks and not work.
+	[mrg, ticket #1013]
+
+sys/dev/pci/ixgbe/ix_txrx.c			1.50
+
+	Fix a wrong error return value from ixgbe_mq_start (an if_transmit
+	function).
+	[msaitoh, ticket #1014]
+



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:37:20 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1014):

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.50

  Fix a bug that ixgbe_mq_start(an if_transmit function) returned wrong
value on error. pcq_put returns false on error, so returning it to caller
indicated no error.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.12 -r1.24.2.13 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.12 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.13
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.12	Tue Aug  7 13:33:23 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Sep  7 12:37:20 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.12 2018/08/07 13:33:23 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.13 2018/09/07 12:37:20 martin Exp $ */
 
 /**
 
@@ -202,7 +202,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 {
 	struct adapter	*adapter = ifp->if_softc;
 	struct tx_ring	*txr;
-	int 		i, err = 0;
+	int 		i;
 #ifdef RSS
 	uint32_t bucket_id;
 #endif
@@ -238,11 +238,10 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 
 	txr = >tx_rings[i];
 
-	err = pcq_put(txr->txr_interq, m);
-	if (err == false) {
+	if (__predict_false(!pcq_put(txr->txr_interq, m))) {
 		m_freem(m);
 		txr->pcq_drops.ev_count++;
-		return (err);
+		return ENOBUFS;
 	}
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);



CVS commit: [netbsd-8] src/sys

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:34:18 UTC 2018

Modified Files:
src/sys/ddb [netbsd-8]: db_command.c
src/sys/kern [netbsd-8]: subr_lockdebug.c
src/sys/sys [netbsd-8]: lockdebug.h

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

sys/sys/lockdebug.h: revision 1.20
sys/ddb/db_command.c: revision 1.155
sys/kern/subr_lockdebug.c: revision 1.65

add a lockdebug_dismiss() function for DDB to use that tells
lockdebug to avoid asserts.  use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.


To generate a diff of this commit:
cvs rdiff -u -r1.148.8.2 -r1.148.8.3 src/sys/ddb/db_command.c
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/sys/kern/subr_lockdebug.c
cvs rdiff -u -r1.15.6.1 -r1.15.6.2 src/sys/sys/lockdebug.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.148.8.2 src/sys/ddb/db_command.c:1.148.8.3
--- src/sys/ddb/db_command.c:1.148.8.2	Tue Jul 31 17:01:20 2018
+++ src/sys/ddb/db_command.c	Fri Sep  7 12:34:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.148.8.2 2018/07/31 17:01:20 martin Exp $	*/
+/*	$NetBSD: db_command.c,v 1.148.8.3 2018/09/07 12:34:18 martin Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.148.8.2 2018/07/31 17:01:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.148.8.3 2018/09/07 12:34:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1351,6 +1351,10 @@ db_reboot_cmd(db_expr_t addr, bool have_
 	 * called from cpu_reboot.
 	 */
 	db_recover = 0;
+	/* Avoid all mutex errors */
+#ifdef LOCKDEBUG
+	lockdebug_dismiss();
+#endif
 	panicstr = "reboot forced via kernel debugger";
 	cpu_reboot((int)bootflags, NULL);
 #else	/* _KERNEL */

Index: src/sys/kern/subr_lockdebug.c
diff -u src/sys/kern/subr_lockdebug.c:1.57.2.1 src/sys/kern/subr_lockdebug.c:1.57.2.2
--- src/sys/kern/subr_lockdebug.c:1.57.2.1	Mon Apr  2 09:07:52 2018
+++ src/sys/kern/subr_lockdebug.c	Fri Sep  7 12:34:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_lockdebug.c,v 1.57.2.1 2018/04/02 09:07:52 martin Exp $	*/
+/*	$NetBSD: subr_lockdebug.c,v 1.57.2.2 2018/09/07 12:34:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.57.2.1 2018/04/02 09:07:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.57.2.2 2018/09/07 12:34:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -977,6 +977,19 @@ lockdebug_show_lockstats(void (*pr)(cons
 #endif	/* DDB */
 
 /*
+ * lockdebug_dismiss:
+ *
+ *  The system is rebooting, and potentially from an unsafe
+ *  place so avoid any future aborts.
+ */
+void
+lockdebug_dismiss(void)
+{
+
+	atomic_inc_uint_nv(_panic);
+}
+
+/*
  * lockdebug_abort:
  *
  *	An error has been trapped - dump lock info and call panic().

Index: src/sys/sys/lockdebug.h
diff -u src/sys/sys/lockdebug.h:1.15.6.1 src/sys/sys/lockdebug.h:1.15.6.2
--- src/sys/sys/lockdebug.h:1.15.6.1	Mon Apr  2 09:07:53 2018
+++ src/sys/sys/lockdebug.h	Fri Sep  7 12:34:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockdebug.h,v 1.15.6.1 2018/04/02 09:07:53 martin Exp $	*/
+/*	$NetBSD: lockdebug.h,v 1.15.6.2 2018/09/07 12:34:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@ typedef	struct lockops {
 #define	LOCKDEBUG_ABORT(f, ln, l, o, m) \
 lockdebug_abort(f, ln, l, o, m)
 
+void	lockdebug_dismiss(void);
 void	lockdebug_abort(const char *, size_t, volatile void *, lockops_t *,
 const char *);
 



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

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:31:30 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: route.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1012):

sys/net/route.c: revision 1.212
sys/net/route.c: revision 1.213

route: don't take an extra reference of a rtentry for the delayed free mechanism
Because a reference is already taken at that point.

 -

route: avoid overwriting rt_free_global.enqueued unexpectedly

rt_free_global.enqueued can be set to true by rt_free during rt_free_work
because rt_free_work releases rt_free_global.lock.  So rt_free_work must update
it once and not update after releasing the lock.


To generate a diff of this commit:
cvs rdiff -u -r1.194.6.10 -r1.194.6.11 src/sys/net/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/sys/net/route.c
diff -u src/sys/net/route.c:1.194.6.10 src/sys/net/route.c:1.194.6.11
--- src/sys/net/route.c:1.194.6.10	Fri Jun  8 10:14:33 2018
+++ src/sys/net/route.c	Fri Sep  7 12:31:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.194.6.10 2018/06/08 10:14:33 martin Exp $	*/
+/*	$NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.10 2018/06/08 10:14:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $");
 
 #include 
 #ifdef RTFLUSH_DEBUG
@@ -702,8 +702,8 @@ rt_free_work(struct work *wk, void *arg)
 		struct rtentry *rt;
 
 		mutex_enter(_free_global.lock);
-		rt_free_global.enqueued = false;
 		if ((rt = SLIST_FIRST(_free_global.queue)) == NULL) {
+			rt_free_global.enqueued = false;
 			mutex_exit(_free_global.lock);
 			return;
 		}
@@ -726,7 +726,7 @@ rt_free(struct rtentry *rt)
 	}
 
 	mutex_enter(_free_global.lock);
-	rt_ref(rt);
+	/* No need to add a reference here. */
 	SLIST_INSERT_HEAD(_free_global.queue, rt, rt_free);
 	if (!rt_free_global.enqueued) {
 		workqueue_enqueue(rt_free_global.wq, _free_global.wk, NULL);



CVS commit: [netbsd-8] src/sys

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:27:27 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: GENERIC
src/sys/arch/i386/conf [netbsd-8]: GENERIC
src/sys/dev/usb [netbsd-8]: usbdevices.config

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

sys/dev/usb/usbdevices.config: revision 1.32 (patch)
sys/arch/amd64/conf/GENERIC: revision 1.502 (patch)
sys/arch/i386/conf/GENERIC: revision 1.1188 (patch)

- add commented entries that exist in amd64 GENERIC: oboe, mos, umb.
  (XXX: mos might be deleteable now?).
- comment uscanner(4) -- usb scanners use ugen(4) interface.
- minor sort.

 -

use dev/usb/usbdevices.config, gaining these missing drivers:
slurm(4), uthum(4), umcs(4), uark(4), upgt(4), and usmsc(4).

 -

use dev/usb/usbdevices.config instead of a local list.
adds slurm(4), umcs(4), uark(4), and usmsc(4).


To generate a diff of this commit:
cvs rdiff -u -r1.459.2.10 -r1.459.2.11 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1156.2.10 -r1.1156.2.11 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.30 -r1.30.2.1 src/sys/dev/usb/usbdevices.config

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/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.459.2.10 src/sys/arch/amd64/conf/GENERIC:1.459.2.11
--- src/sys/arch/amd64/conf/GENERIC:1.459.2.10	Sat Jun  9 15:12:21 2018
+++ src/sys/arch/amd64/conf/GENERIC	Fri Sep  7 12:27:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.459.2.10 2018/06/09 15:12:21 martin Exp $
+# $NetBSD: GENERIC,v 1.459.2.11 2018/09/07 12:27:26 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.459.2.10 $"
+#ident		"GENERIC-$Revision: 1.459.2.11 $"
 
 maxusers	64		# estimated number of users
 
@@ -900,180 +900,7 @@ usb*	at ohci?
 usb*	at uhci?
 usb*	at slhci?
 
-# USB Hubs
-uhub*	at usb?
-uhub*	at uhub? port ?
-
-# USB HID device
-uhidev* at uhub? port ? configuration ? interface ?
-
-# USB Mice
-ums*	at uhidev? reportid ?
-wsmouse* at ums? mux 0
-
-# USB Touchscreens
-uts*	at uhidev? reportid ?
-wsmouse* at uts? mux 0
-
-# USB eGalax touch-panel
-uep*	at uhub? port ?
-wsmouse* at uep? mux 0
-
-# USB Keyboards
-ukbd*	at uhidev? reportid ?
-wskbd*	at ukbd? console ? mux 1
-
-# USB serial adapter
-ucycom* at uhidev? reportid ?
-
-# USB Generic HID devices
-uhid*	at uhidev? reportid ?
-
-# USB LCDs and USB-VGA adaptors
-udl*	at uhub? port ?		# DisplayLink DL-1x0/1x5
-wsdisplay* at udl?
-
-# USB Printer
-ulpt*	at uhub? port ? configuration ? interface ?
-
-# USB Modem
-umodem* at uhub? port ? configuration ?
-ucom*	at umodem?
-
-# Option N.V. Wireless WAN modems
-uhso*	at uhub? port ? configuration ?
-
-# USB Mass Storage
-umass*	at uhub? port ? configuration ? interface ?
-wd* at umass?
-
-# USB audio
-uaudio* at uhub? port ? configuration ?
-uaudio* at usbifif?
-
-# USB MIDI
-umidi*	at uhub? port ? configuration ?
-
-# USB IrDA
-# USB-IrDA bridge spec
-uirda*	at uhub? port ? configuration ? interface ?
-irframe* at uirda?
-
-stuirda* at uhub? port ? configuration ? interface ?
-irframe* at stuirda?
-
-# SigmaTel STIr4200 USB/IrDA Bridge
-ustir*	at uhub? port ?
-irframe* at ustir?
-
-# KingSun/DonShine USB/IrDA Bridge
-udsir*	at uhub? port ?
-irframe* at udsir?
-
-# Windows Media Center IR transceiver
-irmce*	at uhub? port ?
-cir*	at irmce?
-
-# USB Ethernet adapters
-aue*	at uhub? port ?		# ADMtek AN986 Pegasus based adapters
-axe*	at uhub? port ?		# ASIX AX88172 based adapters
-axen*	at uhub? port ?		# ASIX AX88178a/AX88179 based adapters
-cdce*	at uhub? port ?		# CDC, Ethernet Networking Control Model
-cue*	at uhub? port ?		# CATC USB-EL1201A based adapters
-kue*	at uhub? port ?		# Kawasaki LSI KL5KUSB101B based adapters
-#mos*	at uhub? port ?		# Moschip MCS7730/MCS7830/MCS7832 based adapters
-udav*	at uhub? port ?		# Davicom DM9601 based adapters
-url*	at uhub? port ?		# Realtek RTL8150L based adapters
-urndis* at uhub? port ? 	# Microsoft RNDIS specification
-
-# Prolific PL2301/PL2302 host-to-host adapter
-upl*	at uhub? port ?
-
-# Serial adapters
-ubsa*	at uhub? port ?		# Belkin serial adapter
-ucom*	at ubsa? portno ?
-
-uchcom* at uhub? port ? 	# WinChipHead CH341/CH340 serial adapter
-ucom*	at uchcom? portno ?
-
-uftdi*	at uhub? port ?		# FTDI FT8U100AX serial adapter
-ucom*	at uftdi? portno ?
-
-uipaq*	at uhub? port ?		# iPAQ PDAs
-ucom*	at uipaq? portno ?
-
-umct*	at uhub? port ?		# MCT USB-RS232 serial adapter
-ucom*	at umct? portno ?
-
-uplcom* at uhub? port ? 	# I/O DATA USB-RSAQ2 serial adapter
-ucom*	at uplcom? portno ?
-
-uslsa*	at uhub? port ?		# Silicon Labs USB-RS232 serial adapter
-ucom*	at uslsa? portno ?
-
-uvscom* at uhub? port ? 	# SUNTAC Slipper U VS-10U serial adapter
-ucom*	at 

CVS commit: [netbsd-8] src/sys/dev/scsipi

2018-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  7 12:21:13 UTC 2018

Modified Files:
src/sys/dev/scsipi [netbsd-8]: scsipi_base.c

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

sys/dev/scsipi/scsipi_base.c: revision 1.178

Async event can be called before the adapter is running (pmax tc asc)


To generate a diff of this commit:
cvs rdiff -u -r1.175.8.1 -r1.175.8.2 src/sys/dev/scsipi/scsipi_base.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/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.175.8.1 src/sys/dev/scsipi/scsipi_base.c:1.175.8.2
--- src/sys/dev/scsipi/scsipi_base.c:1.175.8.1	Wed Jun 21 18:18:55 2017
+++ src/sys/dev/scsipi/scsipi_base.c	Fri Sep  7 12:21:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.175.8.1 2017/06/21 18:18:55 snj Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.175.8.2 2018/09/07 12:21:13 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.175.8.1 2017/06/21 18:18:55 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.175.8.2 2018/09/07 12:21:13 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -2238,8 +2238,10 @@ void
 scsipi_async_event(struct scsipi_channel *chan, scsipi_async_event_t event,
 void *arg)
 {
+	bool lock = chan_running(chan) > 0;
 
-	mutex_enter(chan_mtx(chan));
+	if (lock)
+		mutex_enter(chan_mtx(chan));
 	switch (event) {
 	case ASYNC_EVENT_MAX_OPENINGS:
 		scsipi_async_event_max_openings(chan,
@@ -2256,7 +2258,8 @@ scsipi_async_event(struct scsipi_channel
 		scsipi_async_event_channel_reset(chan);
 		break;
 	}
-	mutex_exit(chan_mtx(chan));
+	if (lock)
+		mutex_exit(chan_mtx(chan));
 }
 
 /*



CVS commit: src/doc

2018-09-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep  7 10:20:32 UTC 2018

Modified Files:
src/doc: TODO.kaslr

Log Message:
mark two entries as done, and add two more


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/doc/TODO.kaslr

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

Modified files:

Index: src/doc/TODO.kaslr
diff -u src/doc/TODO.kaslr:1.5 src/doc/TODO.kaslr:1.6
--- src/doc/TODO.kaslr:1.5	Tue Sep  4 15:41:08 2018
+++ src/doc/TODO.kaslr	Fri Sep  7 10:20:32 2018
@@ -20,11 +20,13 @@
 -- Several entry points leak kernel addresses:
[DONE] - "modstat -k"
- "netstat -nat"
-   - kern.proc
-   - kern.proc2
+   [DONE] - kern.proc
+   [DONE] - kern.proc2
- kern.file
- kern.file2
- kern.lwp
+   - sysctl_inpcblist
+   - sysctl_unpcblist
 
 -- Be careful with dmesg.
 



CVS commit: src/sys/net

2018-09-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep  7 06:13:14 UTC 2018

Modified Files:
src/sys/net: raw_cb.h raw_usrreq.c

Log Message:
Make raw_input non-variadic.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/net/raw_cb.h
cvs rdiff -u -r1.61 -r1.62 src/sys/net/raw_usrreq.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/net/raw_cb.h
diff -u src/sys/net/raw_cb.h:1.29 src/sys/net/raw_cb.h:1.30
--- src/sys/net/raw_cb.h:1.29	Fri May 11 09:43:59 2018
+++ src/sys/net/raw_cb.h	Fri Sep  7 06:13:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_cb.h,v 1.29 2018/05/11 09:43:59 roy Exp $	*/
+/*	$NetBSD: raw_cb.h,v 1.30 2018/09/07 06:13:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -65,7 +65,8 @@ int	raw_attach(struct socket *, int, str
 void	*raw_ctlinput(int, const struct sockaddr *, void *);
 void	raw_detach(struct socket *);
 void	raw_disconnect(struct rawcb *);
-void	raw_input(struct mbuf *, ...);
+void	raw_input(struct mbuf *, struct sockproto *, struct sockaddr *,
+	struct sockaddr *, struct rawcbhead *);
 int	raw_usrreq(struct socket *,
 	int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *);
 void	raw_setsockaddr(struct rawcb *, struct sockaddr *);

Index: src/sys/net/raw_usrreq.c
diff -u src/sys/net/raw_usrreq.c:1.61 src/sys/net/raw_usrreq.c:1.62
--- src/sys/net/raw_usrreq.c:1.61	Wed May  9 06:35:10 2018
+++ src/sys/net/raw_usrreq.c	Fri Sep  7 06:13:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_usrreq.c,v 1.61 2018/05/09 06:35:10 maxv Exp $	*/
+/*	$NetBSD: raw_usrreq.c,v 1.62 2018/09/07 06:13:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.61 2018/05/09 06:35:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_usrreq.c,v 1.62 2018/09/07 06:13:14 maxv Exp $");
 
 #include 
 #include 
@@ -65,22 +65,12 @@ equal(const struct sockaddr *a1, const s
  * If nothing exists for this packet, drop it.
  */
 void
-raw_input(struct mbuf *m0, ...)
+raw_input(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src,
+struct sockaddr *dst, struct rawcbhead *rawcbhead)
 {
 	struct rawcb *rp;
 	struct mbuf *m = m0;
 	struct socket *last;
-	va_list ap;
-	struct sockproto *proto;
-	struct sockaddr *src, *dst;
-	struct rawcbhead *rawcbhead;
-
-	va_start(ap, m0);
-	proto = va_arg(ap, struct sockproto *);
-	src = va_arg(ap, struct sockaddr *);
-	dst = va_arg(ap, struct sockaddr *);
-	rawcbhead = va_arg(ap, struct rawcbhead *);
-	va_end(ap);
 
 	last = NULL;
 	LIST_FOREACH(rp, rawcbhead, rcb_list) {



CVS commit: src/sys/net

2018-09-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep  7 06:08:16 UTC 2018

Modified Files:
src/sys/net: rtsock.c

Log Message:
Set unused pr_input field to NULL, discussed on tech-net@.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.242 src/sys/net/rtsock.c:1.243
--- src/sys/net/rtsock.c:1.242	Fri Aug 31 15:15:23 2018
+++ src/sys/net/rtsock.c	Fri Sep  7 06:08:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.242 2018/08/31 15:15:23 maxv Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.243 2018/09/07 06:08:16 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.242 2018/08/31 15:15:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.243 2018/09/07 06:08:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2063,7 +2063,6 @@ static const struct protosw COMPATNAME(r
 		.pr_type = SOCK_RAW,
 		.pr_domain = (routedomain),
 		.pr_flags = PR_ATOMIC|PR_ADDR,
-		.pr_input = raw_input,
 		.pr_ctlinput = raw_ctlinput,
 		.pr_ctloutput = route_ctloutput,
 		.pr_usrreqs = _usrreqs,