CVS commit: src/sys

2019-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jun 15 06:40:34 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/evbarm/conf: GENERIC64
src/sys/conf: files
src/sys/kern: subr_asan.c

Log Message:
Add KASAN_PANIC, an option to turn KASAN warning into kernel panics,
requested by Siddharth. While here clarify a little.


To generate a diff of this commit:
cvs rdiff -u -r1.528 -r1.529 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.1236 -r1.1237 src/sys/conf/files
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_asan.c

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



CVS commit: src/sys

2019-06-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jun 15 06:40:34 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/evbarm/conf: GENERIC64
src/sys/conf: files
src/sys/kern: subr_asan.c

Log Message:
Add KASAN_PANIC, an option to turn KASAN warning into kernel panics,
requested by Siddharth. While here clarify a little.


To generate a diff of this commit:
cvs rdiff -u -r1.528 -r1.529 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.1236 -r1.1237 src/sys/conf/files
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_asan.c

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.528 src/sys/arch/amd64/conf/GENERIC:1.529
--- src/sys/arch/amd64/conf/GENERIC:1.528	Fri May 24 14:28:48 2019
+++ src/sys/arch/amd64/conf/GENERIC	Sat Jun 15 06:40:34 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.528 2019/05/24 14:28:48 nonaka Exp $
+# $NetBSD: GENERIC,v 1.529 2019/06/15 06:40:34 maxv 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.528 $"
+#ident		"GENERIC-$Revision: 1.529 $"
 
 maxusers	64		# estimated number of users
 
@@ -123,10 +123,12 @@ options 	KDTRACE_HOOKS	# kernel DTrace h
 
 # Kernel Address Sanitizer (kASan). You need to disable SVS to use it.
 # The quarantine is optional and can help KASAN find more use-after-frees.
-#makeoptions 	KASAN=1		# Kernel Address Sanitizer
-#options 	KASAN
-#no options	SVS
-#options	POOL_QUARANTINE
+# Use KASAN_PANIC if you want panics instead of warnings.
+#makeoptions 	KASAN=1		# mandatory
+#options 	KASAN		# mandatory
+#no options	SVS		# mandatory
+#options	POOL_QUARANTINE	# optional
+#options	KASAN_PANIC	# optional
 
 # Kernel Info Leak Detector.
 #makeoptions 	KLEAK=1

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.98 src/sys/arch/evbarm/conf/GENERIC64:1.99
--- src/sys/arch/evbarm/conf/GENERIC64:1.98	Thu Jun 13 13:35:41 2019
+++ src/sys/arch/evbarm/conf/GENERIC64	Sat Jun 15 06:40:34 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.98 2019/06/13 13:35:41 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.99 2019/06/15 06:40:34 maxv Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -132,9 +132,13 @@ options 	INCLUDE_CONFIG_FILE
 #options 	EARLYCONS=thunderx, CONSADDR=0x87e02400
 #options 	EARLYCONS=virt
 
-# Kernel Address Sanitizer (kASan).
-#makeoptions 	KASAN=1		# Kernel Address Sanitizer
-#options 	KASAN
+# Kernel Address Sanitizer (kASan). The quarantine is optional and can
+# help KASAN find more use-after-frees. Use KASAN_PANIC if you want panics
+# instead of warnings.
+#makeoptions 	KASAN=1		# mandatory
+#options 	KASAN		# mandatory
+#options	POOL_QUARANTINE	# optional
+#options	KASAN_PANIC	# optional
 
 makeoptions	DEBUG="-g"	# compile full symbol table
 makeoptions	COPY_SYMTAB=1

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1236 src/sys/conf/files:1.1237
--- src/sys/conf/files:1.1236	Fri May 17 03:34:26 2019
+++ src/sys/conf/files	Sat Jun 15 06:40:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1236 2019/05/17 03:34:26 ozaki-r Exp $
+#	$NetBSD: files,v 1.1237 2019/06/15 06:40:34 maxv Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -30,6 +30,7 @@ defparam opt_syslimits.h	CHILD_MAX OPEN_
 defflag opt_diagnostic.h	_DIAGNOSTIC
 defflagGPROF
 defflagKASAN
+defflag opt_kasan.h		KASAN_PANIC
 defflagKLEAK
 defflagKCOV
 defflag opt_pool.h		POOL_QUARANTINE

Index: src/sys/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.9 src/sys/kern/subr_asan.c:1.10
--- src/sys/kern/subr_asan.c:1.9	Sat May  4 17:19:10 2019
+++ src/sys/kern/subr_asan.c	Sat Jun 15 06:40:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.9 2019/05/04 17:19:10 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.10 2019/06/15 06:40:34 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.9 2019/05/04 17:19:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.10 2019/06/15 06:40:34 maxv Exp $");
 
 #include 
 #include 
@@ -43,6 +43,12 @@ __KERNEL_RCSID(0, "$NetBSD: subr_asan.c,
 
 #include 
 
+#ifdef KASAN_PANIC
+#define REPORT panic
+#else
+#define REPORT printf
+#endif
+
 /* ASAN constants. Part of the compiler ABI. */
 #define KASAN_SHADOW_SCALE_SHIFT	3
 #define KASAN_SHADOW_SCALE_SIZE		(1UL << KASAN_SHADOW_SCALE_SHIFT)
@@ -185,7 +191,7 @@ static void
 kasan_report(unsigned long addr, size_t size, bool write, unsigned long pc,
 uint8_t code)
 {
-	printf("ASan: Unauthorized Access In %p: Addr %p [%zu byte%s, %s,"
+	REPORT("ASan: Unauthorized Access In %p: Addr %p [%zu byte%s, %s,"
 	" %s]\n",
 	

CVS commit: src/sys/dev/usb

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jun 15 04:00:17 UTC 2019

Modified Files:
src/sys/dev/usb: if_urtwn.c if_urtwnvar.h

Log Message:
 Add rnd(9) support.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/if_urtwnvar.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/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.69 src/sys/dev/usb/if_urtwn.c:1.70
--- src/sys/dev/usb/if_urtwn.c:1.69	Thu Mar  7 14:55:49 2019
+++ src/sys/dev/usb/if_urtwn.c	Sat Jun 15 04:00:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.69 2019/03/07 14:55:49 christos Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.70 2019/06/15 04:00:17 msaitoh Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.69 2019/03/07 14:55:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.70 2019/06/15 04:00:17 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -512,6 +513,8 @@ urtwn_attach(device_t parent, device_t s
 
 	ifp->if_percpuq = if_percpuq_create(ifp);
 	if_register(ifp);
+	rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
+	RND_TYPE_NET, RND_FLAG_DEFAULT);
 
 	ieee80211_announce(ic);
 
@@ -546,6 +549,8 @@ urtwn_detach(device_t self, int flags)
 	callout_halt(&sc->sc_scan_to, NULL);
 	callout_halt(&sc->sc_calib_to, NULL);
 
+	pmf_device_deregister(self);
+
 	if (ISSET(sc->sc_flags, URTWN_FLAG_ATTACHED)) {
 		urtwn_stop(ifp, 0);
 		usb_rem_task_wait(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER,
@@ -2505,6 +2510,9 @@ urtwn_rxeof(struct usbd_xfer *xfer, void
 	DPRINTFN(DBG_RX, ("%s: %s: Rx %d frames in one chunk\n",
 	device_xname(sc->sc_dev), __func__, npkts));
 
+	if (npkts != 0)
+		rnd_add_uint32(&sc->rnd_source, npkts);
+
 	/* Process all of them. */
 	while (npkts-- > 0) {
 		if (__predict_false(len < (int)sizeof(*stat))) {

Index: src/sys/dev/usb/if_urtwnvar.h
diff -u src/sys/dev/usb/if_urtwnvar.h:1.12 src/sys/dev/usb/if_urtwnvar.h:1.13
--- src/sys/dev/usb/if_urtwnvar.h:1.12	Fri Feb  1 03:20:35 2019
+++ src/sys/dev/usb/if_urtwnvar.h	Sat Jun 15 04:00:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwnvar.h,v 1.12 2019/02/01 03:20:35 christos Exp $	*/
+/*	$NetBSD: if_urtwnvar.h,v 1.13 2019/06/15 04:00:17 msaitoh Exp $	*/
 /*	$OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $	*/
 
 /*-
@@ -198,6 +198,7 @@ struct urtwn_softc {
 	boolsc_running;
 
 	struct ieee80211_beacon_offsets sc_bo;
+	krndsource_t rnd_source;	/* random source */
 };
 
 #endif /* _IF_URTWNVAR_H_ */



CVS commit: src/sys/dev/usb

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jun 15 04:00:17 UTC 2019

Modified Files:
src/sys/dev/usb: if_urtwn.c if_urtwnvar.h

Log Message:
 Add rnd(9) support.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/if_urtwnvar.h

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



CVS commit: src/sys/dev/i2c

2019-06-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jun 15 02:00:21 UTC 2019

Modified Files:
src/sys/dev/i2c: adadc.c fcu.c

Log Message:
explicitly initialize sensor->state


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/adadc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/fcu.c

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

Modified files:

Index: src/sys/dev/i2c/adadc.c
diff -u src/sys/dev/i2c/adadc.c:1.6 src/sys/dev/i2c/adadc.c:1.7
--- src/sys/dev/i2c/adadc.c:1.6	Tue Jun 26 06:03:57 2018
+++ src/sys/dev/i2c/adadc.c	Sat Jun 15 02:00:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: adadc.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $ */
+/* $NetBSD: adadc.c,v 1.7 2019/06/15 02:00:21 macallan Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.7 2019/06/15 02:00:21 macallan Exp $");
 
 #include 
 #include 
@@ -157,6 +157,7 @@ adadc_attach(device_t parent, device_t s
 			int reg = 0;
 			OF_getprop(ch, "reg", ®, sizeof(reg));
 			s = &sc->sc_sensors[sc->sc_nsensors];
+			s->state = ENVSYS_SINVALID;
 			/*
 			 * this setup matches my 2x 2.5GHz PCI-X G5, Linux and
 			 * FreeBSD hardcode these as well so we should be safe

Index: src/sys/dev/i2c/fcu.c
diff -u src/sys/dev/i2c/fcu.c:1.8 src/sys/dev/i2c/fcu.c:1.9
--- src/sys/dev/i2c/fcu.c:1.8	Mon Sep  3 16:29:31 2018
+++ src/sys/dev/i2c/fcu.c	Sat Jun 15 02:00:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fcu.c,v 1.8 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: fcu.c,v 1.9 2019/06/15 02:00:21 macallan Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.8 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.9 2019/06/15 02:00:21 macallan Exp $");
 
 #include 
 #include 
@@ -195,6 +195,8 @@ fcu_attach(device_t parent, device_t sel
 
 		envsys_data_t *s = &sc->sc_sensors[sc->sc_nsensors];
 
+		s->state = ENVSYS_SINVALID;
+
 		if (OF_getprop(ch, "device_type", type, 32) <= 0)
 			goto next;
 
@@ -309,7 +311,7 @@ next:
 
 	sc->sc_dying = FALSE;
 	kthread_create(PRI_NONE, 0, curcpu(), fcu_adjust, sc, &sc->sc_thread,
-	"fan control"); 
+	"fan control");
 }
 
 static void



CVS commit: src/sys/dev/i2c

2019-06-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jun 15 02:00:21 UTC 2019

Modified Files:
src/sys/dev/i2c: adadc.c fcu.c

Log Message:
explicitly initialize sensor->state


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/adadc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/fcu.c

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



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

2019-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jun 15 00:08:25 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3399_pcie.c

Log Message:
Make this work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk3399_pcie.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/rockchip/rk3399_pcie.c
diff -u src/sys/arch/arm/rockchip/rk3399_pcie.c:1.3 src/sys/arch/arm/rockchip/rk3399_pcie.c:1.4
--- src/sys/arch/arm/rockchip/rk3399_pcie.c:1.3	Wed Jun 12 22:44:53 2019
+++ src/sys/arch/arm/rockchip/rk3399_pcie.c	Sat Jun 15 00:08:25 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_pcie.c,v 1.3 2019/06/12 22:44:53 jmcneill Exp $ */
+/* $NetBSD: rk3399_pcie.c,v 1.4 2019/06/15 00:08:25 jmcneill Exp $ */
 /*
  * Copyright (c) 2018 Mark Kettenis 
  *
@@ -17,7 +17,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.3 2019/06/12 22:44:53 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.4 2019/06/15 00:08:25 jmcneill Exp $");
 
 #include 
 #include 
@@ -174,16 +174,6 @@ clock_enable_all(int phandle)
 	}
 }
 
-static inline void
-clock_enable(int phandle, const char *name)
-{
-	struct clk * clk = fdtbus_clock_get(phandle, name);
-	if (clk == NULL)
-		return;
-	if (clk_enable(clk) != 0)
-		return;
-}
-
 static void
 reset_assert(int phandle, const char *name)
 {
@@ -210,13 +200,12 @@ rkpcie_attach(device_t parent, device_t 
 	struct rkpcie_softc *sc = device_private(self);
 	struct pcihost_softc * const phsc = &sc->sc_phsc;
 	struct fdt_attach_args *faa = aux;
-	//struct pcibus_attach_args pba;
 	struct fdtbus_gpio_pin *ep_gpio;
+	u_int max_link_speed, num_lanes;
+	struct fdtbus_phy *phy[4];
 	const u_int *bus_range;
-	int len;
 	uint32_t status;
-	bool retry = false;
-	int timo;
+	int timo, len;
 
 	phsc->sc_dev = self;
 	phsc->sc_bst = faa->faa_bst;
@@ -255,7 +244,12 @@ rkpcie_attach(device_t parent, device_t 
 	clock_enable_all(phandle);
 
 	ep_gpio = fdtbus_gpio_acquire(phandle, "ep-gpios", GPIO_PIN_OUTPUT);
-	//retry = true;
+
+	if (of_getprop_uint32(phandle, "max-link-speed", &max_link_speed) != 0)
+		max_link_speed = 2;
+	if (of_getprop_uint32(phandle, "num-lanes", &num_lanes) != 0)
+		num_lanes = 1;
+
 again:
 	fdtbus_gpio_write(ep_gpio, 0);
 
@@ -263,16 +257,11 @@ again:
 	reset_assert(phandle, "pclk");
 	reset_assert(phandle, "pm");
 
-	//device_printf(self, "%s phy0\n", __func__);
-	struct fdtbus_phy *phy[4];
 	memset(phy, 0, sizeof(phy));
 	phy[0] = fdtbus_phy_get(phandle, "pcie-phy-0");
-	//device_printf(self, "%s phy1 %p\n", __func__, phy[0]);
 	if (phy[0] == NULL) {
 		phy[0] = fdtbus_phy_get(phandle, "pcie-phy");
-		device_printf(self, "%s phy2 %p\n", __func__, phy);
 	} else {
-		/* XXX */
 		phy[1] = fdtbus_phy_get(phandle, "pcie-phy-1");
 		phy[2] = fdtbus_phy_get(phandle, "pcie-phy-2");
 		phy[3] = fdtbus_phy_get(phandle, "pcie-phy-3");
@@ -289,15 +278,14 @@ again:
 	reset_deassert(phandle, "aclk");
 	reset_deassert(phandle, "pclk");
 
-	if (retry)
+	if (max_link_speed == 1)
 		HWRITE4(sc, PCIE_CLIENT_BASIC_STRAP_CONF, PCBSC_PGS_GEN1);
 	else
 		HWRITE4(sc, PCIE_CLIENT_BASIC_STRAP_CONF, PCBSC_PGS_GEN2);
 
 	/* Switch into Root Complex mode. */
 	HWRITE4(sc, PCIE_CLIENT_BASIC_STRAP_CONF,
-	PCBSC_MS_ROOTPORT | PCBSC_CONF_EN | PCBSC_LC(4));
-	//printf("%s PCBSC %x\n", __func__, HREAD4(sc, PCIE_CLIENT_BASIC_STRAP_CONF));
+	PCBSC_MS_ROOTPORT | PCBSC_CONF_EN | PCBSC_LC(num_lanes));
 
 	if (phy[3] && fdtbus_phy_enable(phy[3], true) != 0) {
 		aprint_error(": couldn't enable phy3\n");
@@ -317,16 +305,6 @@ again:
 	reset_deassert(phandle, "mgmt");
 	reset_deassert(phandle, "pipe");
 
-	/* FTS count */
-	HWRITE4(sc, PCIE_LM_PLC1, HREAD4(sc, PCIE_LM_PLC1) | PCIE_LM_PLC1_FTS_MASK);
-
-	/* XXX Advertise power limits? */
-
-	/* common clock */
-	HWRITE4(sc, PCIE_RC_CONFIG_LCSR, HREAD4(sc, PCIE_RC_CONFIG_LCSR) | PCIE_LCSR_COMCLKCFG);
-	/* 128 RCB */
-	HWRITE4(sc, PCIE_RC_CONFIG_LCSR, HREAD4(sc, PCIE_RC_CONFIG_LCSR) | PCIE_LCSR_RCB);
-
 	/* Start link training. */
 	HWRITE4(sc, PCIE_CLIENT_BASIC_STRAP_CONF, PCBSC_LINK_TRAIN_EN);
 
@@ -341,14 +319,14 @@ again:
 	if (timo == 0) {
 		device_printf(self, "link training timeout (link_st %u)\n",
 		PCBS1_LINK_ST(status));
-		if (!retry) {
-			retry = true;
+		if (max_link_speed > 1) {
+			--max_link_speed;
 			goto again;
 		}
 		return;
 	}
 
-	if (!retry) {
+	if (max_link_speed == 2) {
 		HWRITE4(sc, PCIE_RC_CONFIG_LCSR, HREAD4(sc, PCIE_RC_CONFIG_LCSR) | PCIE_LCSR_RETRAIN);
 		for (timo = 500; timo > 0; timo--) {
 			status = HREAD4(sc, PCIE_LM_CORE_CTRL);
@@ -358,27 +336,11 @@ again:
 		}
 		if (timo == 0) {
 			device_printf(self, "Gen2 link training timeout\n");
-			retry = true;
+			--max_link_speed;
 			goto again;
 		}
 	}
 
-#if 0
-	printf("%s CBS0 %x\n", __func__, HREAD4(sc, PCIE_CLIENT_BASIC_STATUS1));
-	HWRITE4(sc, PCIE_LM_DEBUG_MUX_CONTROL, (HREAD4(sc, PCIE_LM_DEBU

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

2019-06-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jun 15 00:08:25 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3399_pcie.c

Log Message:
Make this work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk3399_pcie.c

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



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:48:43 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_hstimer.c sunxi_timer.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_hstimer.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_timer.c

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



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:48:43 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_hstimer.c sunxi_timer.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_hstimer.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_timer.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/sunxi/sunxi_hstimer.c
diff -u src/sys/arch/arm/sunxi/sunxi_hstimer.c:1.1 src/sys/arch/arm/sunxi/sunxi_hstimer.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_hstimer.c:1.1	Fri Jun 14 21:26:36 2019
+++ src/sys/arch/arm/sunxi/sunxi_hstimer.c	Fri Jun 14 21:48:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_hstimer.c,v 1.1 2019/06/14 21:26:36 tnn Exp $ */
+/* $NetBSD: sunxi_hstimer.c,v 1.2 2019/06/14 21:48:43 tnn Exp $ */
 
 /*-
  * Copyright (c) 2019 Tobias Nygren 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.1 2019/06/14 21:26:36 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.2 2019/06/14 21:48:43 tnn Exp $");
 
 #include 
 #include 
@@ -175,7 +175,7 @@ sunxi_hstimer_attach(device_t parent, de
 
 	/* Timecounter setup */
 	tc->tc_get_timecount = sunxi_hstimer_get_timecount;
-	tc->tc_counter_mask = ~0u,
+	tc->tc_counter_mask = ~0u;
 	tc->tc_frequency = clk_get_rate(clk);
 	tc->tc_name = "hstimer";
 	tc->tc_quality = 300;

Index: src/sys/arch/arm/sunxi/sunxi_timer.c
diff -u src/sys/arch/arm/sunxi/sunxi_timer.c:1.6 src/sys/arch/arm/sunxi/sunxi_timer.c:1.7
--- src/sys/arch/arm/sunxi/sunxi_timer.c:1.6	Wed Mar 27 16:38:49 2019
+++ src/sys/arch/arm/sunxi/sunxi_timer.c	Fri Jun 14 21:48:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_timer.c,v 1.6 2019/03/27 16:38:49 tnn Exp $ */
+/* $NetBSD: sunxi_timer.c,v 1.7 2019/06/14 21:48:43 tnn Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.6 2019/03/27 16:38:49 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.7 2019/06/14 21:48:43 tnn Exp $");
 
 #include 
 #include 
@@ -236,7 +236,7 @@ sunxi_timer_attach(device_t parent, devi
 
 	/* Timecounter setup */
 	tc->tc_get_timecount = sunxi_timer_get_timecount;
-	tc->tc_counter_mask = ~0u,
+	tc->tc_counter_mask = ~0u;
 	tc->tc_frequency = rate;
 	tc->tc_name = "Timer 2";
 	tc->tc_quality = 200;



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:28:10 UTC 2019

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

Log Message:
add sunxihstimer* at fdt?


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.39 src/sys/arch/evbarm/conf/GENERIC:1.40
--- src/sys/arch/evbarm/conf/GENERIC:1.39	Thu Jun 13 13:35:41 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Fri Jun 14 21:28:10 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.39 2019/06/13 13:35:41 jmcneill Exp $
+#	$NetBSD: GENERIC,v 1.40 2019/06/14 21:28:10 tnn Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -302,7 +302,8 @@ gtmr*		at fdt? pass 1		# ARM Generic Tim
 armgtmr0	at gtmr?
 mct*		at fdt? pass 2		# Exynos Multi Core Timer (MCT)
 armgtmr*	at mct?
-sunxitimer* at fdt? # Allwinner async timer
+sunxitimer*	at fdt?			# Allwinner async timer
+sunxihstimer*	at fdt?			# Allwinner High-Speed timer
 tegratimer*	at fdt?			# Timers
 
 # Watchdog



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:28:10 UTC 2019

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

Log Message:
add sunxihstimer* at fdt?


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/conf/GENERIC

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



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:26:36 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Added Files:
src/sys/arch/arm/sunxi: sunxi_hstimer.c

Log Message:
sunxihstimer: add support for Allwinner High-Speed Timer


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_hstimer.c

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



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

2019-06-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 14 21:26:36 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Added Files:
src/sys/arch/arm/sunxi: sunxi_hstimer.c

Log Message:
sunxihstimer: add support for Allwinner High-Speed Timer


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_hstimer.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/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.64 src/sys/arch/arm/sunxi/files.sunxi:1.65
--- src/sys/arch/arm/sunxi/files.sunxi:1.64	Tue May 28 21:56:04 2019
+++ src/sys/arch/arm/sunxi/files.sunxi	Fri Jun 14 21:26:36 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.64 2019/05/28 21:56:04 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.65 2019/06/14 21:26:36 tnn Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -204,6 +204,11 @@ device	sunxitimer
 attach	sunxitimer at fdt with sunxi_timer
 file	arch/arm/sunxi/sunxi_timer.c		sunxi_timer
 
+# High Speed Timer
+device	sunxihstimer
+attach	sunxihstimer at fdt with sunxi_hstimer
+file	arch/arm/sunxi/sunxi_hstimer.c		sunxi_hstimer
+
 # Watchdog
 device	sunxiwdt: sysmon_wdog
 attach	sunxiwdt at fdt with sunxi_wdt

Added files:

Index: src/sys/arch/arm/sunxi/sunxi_hstimer.c
diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_hstimer.c:1.1
--- /dev/null	Fri Jun 14 21:26:36 2019
+++ src/sys/arch/arm/sunxi/sunxi_hstimer.c	Fri Jun 14 21:26:36 2019
@@ -0,0 +1,201 @@
+/* $NetBSD: sunxi_hstimer.c,v 1.1 2019/06/14 21:26:36 tnn Exp $ */
+
+/*-
+ * Copyright (c) 2019 Tobias Nygren 
+ * Copyright (c) 2017 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 
+__KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.1 2019/06/14 21:26:36 tnn Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+/* High Speed Timer registers */
+#define	HS_TMR_IRQ_EN_REG	0x0
+#define	HS_TMR_IRQ_EN(n)	__BIT(n)
+#define	HS_TMR_IRQ_STAS_REG	0x4
+#define	HS_TMR_STAS_PEND(n)	__BIT(n)
+#define	HS_TMR0_CTRL_REG	0x10
+#define	 HS_TMR0_CTRL_MODE	__BIT(7)
+#define	 HS_TMR0_CTRL_CLK_PRESCALE	__BITS(6,4)
+#define	 HS_TMR0_CTRL_RELOAD	__BIT(1)
+#define	 HS_TMR0_CTRL_EN	__BIT(0)
+#define	HS_TMR0_INTV_LO_REG	0x14
+#define	HS_TMR0_INTV_HI_REG	0x18
+#define	HS_TMR0_CURNT_LO_REG	0x1c
+#define	HS_TMR0_CURNT_HI_REG	0x20
+#define	HS_TMR1_CTRL_REG	0x30
+#define	 HS_TMR1_CTRL_MODE	__BIT(7)
+#define	 HS_TMR1_CTRL_CLK_PRESCALE	__BITS(6,4)
+#define	 HS_TMR1_CTRL_RELOAD	__BIT(1)
+#define	 HS_TMR1_CTRL_EN	__BIT(0)
+#define	HS_TMR1_INTV_LO_REG	0x34
+#define	HS_TMR1_INTV_HI_REG	0x38
+#define	HS_TMR1_CURNT_LO_REG	0x3c
+#define	HS_TMR1_CURNT_HI_REG	0x40
+#define	HS_TMR2_CTRL_REG	0x50
+#define	 HS_TMR2_CTRL_MODE	__BIT(7)
+#define	 HS_TMR2_CTRL_CLK_PRESCALE	__BITS(6,4)
+#define	 HS_TMR2_CTRL_RELOAD	__BIT(1)
+#define	 HS_TMR2_CTRL_EN	__BIT(0)
+#define	HS_TMR2_INTV_LO_REG	0x54
+#define	HS_TMR2_INTV_HI_REG	0x58
+#define	HS_TMR2_CURNT_LO_REG	0x5c
+#define	HS_TMR2_CURNT_HI_REG	0x60
+#define	HS_TMR3_CTRL_REG	0x70
+#define	 HS_TMR3_CTRL_MODE	__BIT(7)
+#define	 HS_TMR3_CTRL_CLK_PRESCALE	__BITS(6,4)
+#define	 HS_TMR3_CTRL_RELOAD	__BIT(1)
+#define	 HS_TMR3_CTRL_EN	__BIT(0)
+#define	HS_TMR3_INTV_LO_REG	0x74
+#define	HS_TMR3_INTV_HI_REG	0x78
+#define	HS_TMR3_CURNT_LO_REG	0x7c
+#define	HS_TMR3_CURNT_HI_REG	0x80
+
+static const char * const compatible[] = {
+	"allwinner,sun5i-a13-hstimer",
+	"allwinner,sun6i-a31-hstimer",
+	"allwinner,sun7i-a20-hstimer",
+	NULL
+};
+
+struct sunxi_hstimer_softc {
+	device_t		sc_dev;
+	bus_space_tag_t		sc_bst;
+	bus_space_handle_t	sc_bsh;
+	int			sc_phan

CVS commit: src/distrib/emips/instkernel

2019-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 14 16:34:31 UTC 2019

Modified Files:
src/distrib/emips/instkernel: Makefile

Log Message:
Bump file system size slightly


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/emips/instkernel/Makefile

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

Modified files:

Index: src/distrib/emips/instkernel/Makefile
diff -u src/distrib/emips/instkernel/Makefile:1.4 src/distrib/emips/instkernel/Makefile:1.5
--- src/distrib/emips/instkernel/Makefile:1.4	Mon Apr  1 02:01:39 2019
+++ src/distrib/emips/instkernel/Makefile	Fri Jun 14 16:34:31 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2019/04/01 02:01:39 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2019/06/14 16:34:31 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -6,7 +6,7 @@
 .include 
 
 IMAGE=		diskimage
-IMAGESIZE=	2400k
+IMAGESIZE=	2600k
 LISTS=		${.CURDIR}/list
 MTREECONF=	${DISTRIBDIR}/common/mtree.dot
 IMAGEENDIAN=	be



CVS commit: src/distrib/emips/instkernel

2019-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 14 16:34:31 UTC 2019

Modified Files:
src/distrib/emips/instkernel: Makefile

Log Message:
Bump file system size slightly


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/emips/instkernel/Makefile

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



CVS commit: src/doc

2019-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 14 16:11:12 UTC 2019

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update TODO.ptrace

Drop compat32 entries as they were mostly addressed.
Drop MD specific calls, it's up to port's CPU to contain various features
like PT_STEP.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/doc/TODO.ptrace

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.ptrace
diff -u src/doc/TODO.ptrace:1.30 src/doc/TODO.ptrace:1.31
--- src/doc/TODO.ptrace:1.30	Sun Aug  5 13:07:33 2018
+++ src/doc/TODO.ptrace	Fri Jun 14 16:11:11 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO.ptrace,v 1.30 2018/08/05 13:07:33 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.31 2019/06/14 16:11:11 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
@@ -13,12 +13,8 @@ Items we (currently) plan to finish in t
GUI toolkits (and perhaps other libraries) - this is long term wishlist in
GDB for Linux - the current approach is to fork and debug through GDB remote
protocol (this is how it is done in LLDB)
- - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
-   in all ports
  - add ATF tests for SIGCHLD
- - fix more calls for netbsd32 compat
  - research kgdb(4)
- - check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee
 
 and of course: fix as many bugs as possible.
 



CVS commit: src/doc

2019-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 14 16:11:12 UTC 2019

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update TODO.ptrace

Drop compat32 entries as they were mostly addressed.
Drop MD specific calls, it's up to port's CPU to contain various features
like PT_STEP.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/doc/TODO.ptrace

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



CVS commit: src/usr.sbin/postinstall

2019-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 14 14:39:49 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
cleanup obsolete file selection from sets and refactor font synchronization.
The font config files are not in sets, so they are still hard-coded.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/postinstall/postinstall.in

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.3 src/usr.sbin/postinstall/postinstall.in:1.4
--- src/usr.sbin/postinstall/postinstall.in:1.3	Fri Jun 14 10:17:45 2019
+++ src/usr.sbin/postinstall/postinstall.in	Fri Jun 14 10:39:49 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.3 2019/06/14 14:17:45 christos Exp $
+# $NetBSD: postinstall.in,v 1.4 2019/06/14 14:39:49 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1013,38 +1013,42 @@ do_fontconfig()
 		msg "${FONTCONFIG_DIR} is not a directory; skipping check"
 		return 0
 	fi
-
-	populate_dir "$op" false "${FONTCONFIG_DIR}" "${DEST_DIR}/etc/fonts/conf.avail" 444 \
-		10-autohint.conf \
-		10-no-sub-pixel.conf \
-		10-scale-bitmap-fonts.conf \
-		10-sub-pixel-bgr.conf \
-		10-sub-pixel-rgb.conf \
-		10-sub-pixel-vbgr.conf \
-		10-sub-pixel-vrgb.conf \
-		10-unhinted.conf \
-		11-lcdfilter-default.conf \
-		11-lcdfilter-legacy.conf \
-		11-lcdfilter-light.conf \
-		20-unhint-small-vera.conf \
-		25-unhint-nonlatin.conf \
-		30-metric-aliases.conf \
-		40-nonlatin.conf \
-		45-generic.conf \
-		45-latin.conf \
-		49-sansserif.conf \
-		50-user.conf \
-		51-local.conf \
-		60-generic.conf \
-		60-latin.conf \
-		65-fonts-persian.conf \
-		65-khmer.conf \
-		65-nonlatin.conf \
-		69-unifont.conf \
-		70-no-bitmaps.conf \
-		70-yes-bitmaps.conf \
-		80-delicious.conf \
-		90-synthetic.conf
+	local regular_fonts="
+10-autohint.conf
+10-no-sub-pixel.conf
+10-scale-bitmap-fonts.conf
+10-sub-pixel-bgr.conf
+10-sub-pixel-rgb.conf
+10-sub-pixel-vbgr.conf
+10-sub-pixel-vrgb.conf
+10-unhinted.conf
+11-lcdfilter-default.conf
+11-lcdfilter-legacy.conf
+11-lcdfilter-light.conf
+20-unhint-small-vera.conf
+25-unhint-nonlatin.conf
+30-metric-aliases.conf
+40-nonlatin.conf
+45-generic.conf
+45-latin.conf
+49-sansserif.conf
+50-user.conf
+51-local.conf
+60-generic.conf
+60-latin.conf
+65-fonts-persian.conf
+65-khmer.conf
+65-nonlatin.conf
+69-unifont.conf
+70-no-bitmaps.conf
+70-yes-bitmaps.conf
+80-delicious.conf
+90-synthetic.conf
+"
+	populate_dir "$op" false "${FONTCONFIG_DIR}" \
+	"${DEST_DIR}/etc/fonts/conf.avail" \
+	444 \
+	${regular_fonts}
 	failed=$(( ${failed} + $? ))
 
 	if ! $SOURCEMODE; then
@@ -1059,31 +1063,33 @@ do_fontconfig()
 
 	# We can't modify conf.d easily; someone might have removed a file.
 
-	conf_d_failed=0
 	# Look for old files that need to be deleted.
-	if [ -f "${DEST_DIR}/etc/fonts/conf.d/10-unhinted.conf" -a \
-	 -f "${DEST_DIR}/etc/fonts/conf.d/10-autohint.conf" ]; then
-		conf_d_failed=1
-		failed=$(( ${failed} + 1 ))
-	fi
+	obsolete_fonts="
+10-autohint.conf
+10-no-sub-pixel.conf
+10-sub-pixel-bgr.conf
+10-sub-pixel-rgb.conf
+10-sub-pixel-vbgr.conf
+10-sub-pixel-vrgb.conf
+10-unhinted.conf
+25-unhint-nonlatin.conf
+65-khmer.conf
+70-no-bitmaps.conf
+70-yes-bitmaps.conf
+"
+	failed_fonts=""
+	for i in ${obsolete_fonts}; do
+	if [ -f "${DEST_DIR}/etc/fonts/conf.d/$i" ]; then
+		conf_d_failed=1
+		failed_fonts="$failed_fonts $i"
+	fi
+	done
 
-	if [ "$conf_d_failed" = 1 ]; then
-		msg \
-"Broken fontconfig configuration found; please delete these files"
-		msg \
-"in the ${DEST_DIR}/etc/fonts/conf.d/ subdirectory:"
-		msg \
-"   10-autohint.conf 10-no-sub-pixel.conf 10-sub-pixel-bgr.conf"
-		msg \
-"   10-sub-pixel-rgb.conf 10-sub-pixel-vbgr.conf"
+	if [ -n "$failed_fonts" ]; then
 		msg \
-"   10-sub-pixel-vrgb.conf 10-unhinted.conf 25-unhint-nonlatin.conf"
-		msg \
-"   65-khmer.conf 70-no-bitmaps.conf 70-yes-bitmaps.conf"
-		msg \
-"(This warning only appears if both the 10-unhinted.conf and"
-		msg \
-"10-autohint.conf files are present."
+"Broken fontconfig configuration found; please delete these files:"
+		msg "[$failed_fonts]"
+		failed=$(( ${failed} + 1 ))
 	fi
 
 	return ${failed}
@@ -1422,6 +1428,15 @@ select_set_files()
 	-e "/^\.${qdir}/s@^.$2[[:space:]].*@\1@p" $3
 }
 
+# select obsolete files in a sets file
+# $1: directory pattern
+# $2: file pattern
+# $3: filename
+select_obsolete_files()
+{
+	${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" $3
+}
+
 exclude()
 {
 	if [ -z "$*" ]; then
@@ -1465,9 +1480,8 @@ do_rc()
 	exclude ${rc_external_files})"
 
 	# obsolete rc file in /etc/rc.d
-	local rc_obsolete_files="$(${SED} -n \
-	-e '/obsolete/s@./etc/rc.d/\([^[:space:]]*\)[[:space:]].*@\1@p' \

CVS commit: src/usr.sbin/postinstall

2019-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 14 14:39:49 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
cleanup obsolete file selection from sets and refactor font synchronization.
The font config files are not in sets, so they are still hard-coded.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2019-06-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Jun 14 14:17:58 UTC 2019

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: bootmain.c

Log Message:
Add missing newline.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/boot_ufs/bootmain.c

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



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2019-06-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Jun 14 14:17:58 UTC 2019

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: bootmain.c

Log Message:
Add missing newline.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/boot_ufs/bootmain.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/x68k/stand/boot_ufs/bootmain.c
diff -u src/sys/arch/x68k/stand/boot_ufs/bootmain.c:1.13 src/sys/arch/x68k/stand/boot_ufs/bootmain.c:1.14
--- src/sys/arch/x68k/stand/boot_ufs/bootmain.c:1.13	Sat Jul 17 06:27:03 2010
+++ src/sys/arch/x68k/stand/boot_ufs/bootmain.c	Fri Jun 14 14:17:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootmain.c,v 1.13 2010/07/17 06:27:03 isaki Exp $	*/
+/*	$NetBSD: bootmain.c,v 1.14 2019/06/14 14:17:58 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994 Takumi Nakamura.
@@ -229,7 +229,7 @@ load_file_ino(ino32_t ino, const char *f
 	if ((N_GETMAGIC(*header) != OMAGIC) ||
 	(N_GETMID(*header) != MID_M68K)) {
 		B_PRINT(fn);
-		B_PRINT(": inappropriate format");
+		B_PRINT(": inappropriate format\r\n");
 		return 0;
 	}
 



CVS commit: src/usr.sbin/postinstall

2019-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 14 14:17:45 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
select the powerd scripts from the sets


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2019-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun 14 14:17:45 UTC 2019

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
select the powerd scripts from the sets


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/postinstall/postinstall.in

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.2 src/usr.sbin/postinstall/postinstall.in:1.3
--- src/usr.sbin/postinstall/postinstall.in:1.2	Thu Jun 13 21:54:16 2019
+++ src/usr.sbin/postinstall/postinstall.in	Fri Jun 14 10:17:45 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.2 2019/06/14 01:54:16 christos Exp $
+# $NetBSD: postinstall.in,v 1.3 2019/06/14 14:17:45 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -972,17 +972,21 @@ additem envsys "envsys configuration is 
 do_envsys()
 {
 	[ -n "$1" ] || err 3 "USAGE: do_envsys fix|check"
-	op="$1"
-	failed=0
+	local op="$1"
+	local failed=0
+	local etcsets=$(getetcsets)
 
 	populate_dir "$op" true "${SRC_DIR}/etc" "${DEST_DIR}/etc" 644 \
 		envsys.conf
 	failed=$(( ${failed} + $? ))
 
+	local powerd_scripts="$(select_set_files /etc/powerd/scripts/ \
+	"/etc/powerd/scripts/\([^[:space:]/]*\)" ${etcsets})"
+
 	populate_dir "$op" true "${SRC_DIR}/etc/powerd/scripts" \
-		"${DEST_DIR}/etc/powerd/scripts" 555 sensor_battery \
-		sensor_drive sensor_fan sensor_indicator sensor_power \
-		sensor_resistance sensor_temperature sensor_voltage
+		"${DEST_DIR}/etc/powerd/scripts" \
+		555 \
+		${powerd_scripts}
 	failed=$(( ${failed} + $? ))
 
 	return ${failed}



CVS commit: src/sys/arch/x68k/stand/boot

2019-06-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Jun 14 14:15:53 UTC 2019

Modified Files:
src/sys/arch/x68k/stand/boot: Makefile

Log Message:
boot_ufs (primary bootloader) expects /boot OMAGIC a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/stand/boot/Makefile

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



CVS commit: src/sys/arch/x68k/stand/boot

2019-06-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Jun 14 14:15:53 UTC 2019

Modified Files:
src/sys/arch/x68k/stand/boot: Makefile

Log Message:
boot_ufs (primary bootloader) expects /boot OMAGIC a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/stand/boot/Makefile

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/x68k/stand/boot/Makefile
diff -u src/sys/arch/x68k/stand/boot/Makefile:1.30 src/sys/arch/x68k/stand/boot/Makefile:1.31
--- src/sys/arch/x68k/stand/boot/Makefile:1.30	Wed Jan  2 00:48:13 2019
+++ src/sys/arch/x68k/stand/boot/Makefile	Fri Jun 14 14:15:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2019/01/02 00:48:13 christos Exp $
+#	$NetBSD: Makefile,v 1.31 2019/06/14 14:15:53 isaki Exp $
 
 NOMAN=		# defined
 
@@ -42,6 +42,7 @@ CPPFLAGS+=	-DSUPPORT_BOOTP -DSUPPORT_DHC
 #CPPFLAGS+=	-DDEBUG
 CFLAGS=		-Wno-main -Os -m68020-60
 LINKFLAGS=	-N -static -T ${.CURDIR}/../boot/boot.ldscript
+ELF2AOUT_OPTS=	-O
 LIBIOCS!=	cd $M/stand/libiocs && ${PRINTOBJDIR}
 LIBSA!=		cd $M/stand/libsa && ${PRINTOBJDIR}
 L=		${LIBSA}/lib
@@ -55,7 +56,7 @@ ${PROG}:	${OBJS} ${LDLIBS}
 	${_MKTARGET_LINK}
 	${LD} ${LINKFLAGS} -o ${PROG}.sym ${OBJS} ${LDLIBS}
 	${STRIP} ${PROG}.sym -o ${PROG}.strip
-	${M68K_ELF2AOUT} ${PROG}.strip ${PROG}
+	${M68K_ELF2AOUT} ${ELF2AOUT_OPTS} ${PROG}.strip ${PROG}
 
 CLEANFILES+=	${PROG}.sym ${PROG}.strip
 



CVS commit: src/sys/dev/tprof

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 14 11:50:35 UTC 2019

Modified Files:
src/sys/dev/tprof: tprof_x86_amd.c tprof_x86_intel.c

Log Message:
 Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_x86_amd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/tprof/tprof_x86_intel.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/tprof/tprof_x86_amd.c
diff -u src/sys/dev/tprof/tprof_x86_amd.c:1.3 src/sys/dev/tprof/tprof_x86_amd.c:1.4
--- src/sys/dev/tprof/tprof_x86_amd.c:1.3	Wed May 29 17:09:17 2019
+++ src/sys/dev/tprof/tprof_x86_amd.c	Fri Jun 14 11:50:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $	*/
+/*	$NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $");
 
 #include 
 #include 
@@ -135,8 +135,8 @@ tprof_amd_start_cpu(void *arg1, void *ar
 	wrmsr(PERFCTR(ctrno), counter_reset_val);
 	wrmsr(PERFEVTSEL(ctrno), pesr);
 
-	amd_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_PCINT);
-	lapic_writereg(LAPIC_PCINT, LAPIC_DLMODE_NMI);
+	amd_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_LVT_PCINT);
+	lapic_writereg(LAPIC_LVT_PCINT, LAPIC_DLMODE_NMI);
 
 	wrmsr(PERFEVTSEL(ctrno), pesr | PESR_EN);
 }
@@ -148,7 +148,7 @@ tprof_amd_stop_cpu(void *arg1, void *arg
 
 	wrmsr(PERFEVTSEL(ctrno), 0);
 
-	lapic_writereg(LAPIC_PCINT, amd_lapic_saved[cpu_index(ci)]);
+	lapic_writereg(LAPIC_LVT_PCINT, amd_lapic_saved[cpu_index(ci)]);
 }
 
 static int

Index: src/sys/dev/tprof/tprof_x86_intel.c
diff -u src/sys/dev/tprof/tprof_x86_intel.c:1.2 src/sys/dev/tprof/tprof_x86_intel.c:1.3
--- src/sys/dev/tprof/tprof_x86_intel.c:1.2	Tue Jul 24 09:47:35 2018
+++ src/sys/dev/tprof/tprof_x86_intel.c	Fri Jun 14 11:50:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_intel.c,v 1.2 2018/07/24 09:47:35 maxv Exp $	*/
+/*	$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.2 2018/07/24 09:47:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $");
 
 #include 
 #include 
@@ -119,8 +119,8 @@ tprof_intel_start_cpu(void *arg1, void *
 	wrmsr(MSR_PERFCTR0, counter_reset_val);
 	wrmsr(MSR_EVNTSEL0, evtval);
 
-	intel_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_PCINT);
-	lapic_writereg(LAPIC_PCINT, LAPIC_DLMODE_NMI);
+	intel_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_LVT_PCINT);
+	lapic_writereg(LAPIC_LVT_PCINT, LAPIC_DLMODE_NMI);
 }
 
 static void
@@ -131,7 +131,7 @@ tprof_intel_stop_cpu(void *arg1, void *a
 	wrmsr(MSR_EVNTSEL0, 0);
 	wrmsr(MSR_PERFCTR0, 0);
 
-	lapic_writereg(LAPIC_PCINT, intel_lapic_saved[cpu_index(ci)]);
+	lapic_writereg(LAPIC_LVT_PCINT, intel_lapic_saved[cpu_index(ci)]);
 }
 
 static int
@@ -162,9 +162,9 @@ tprof_intel_nmi(const struct trapframe *
 	wrmsr(MSR_PERFCTR0, counter_reset_val);
 
 	/* unmask PMI */
-	pcint = lapic_readreg(LAPIC_PCINT);
+	pcint = lapic_readreg(LAPIC_LVT_PCINT);
 	KASSERT((pcint & LAPIC_LVT_MASKED) != 0);
-	lapic_writereg(LAPIC_PCINT, pcint & ~LAPIC_LVT_MASKED);
+	lapic_writereg(LAPIC_LVT_PCINT, pcint & ~LAPIC_LVT_MASKED);
 
 	return 1;
 }



CVS commit: src/sys/dev/tprof

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 14 11:50:35 UTC 2019

Modified Files:
src/sys/dev/tprof: tprof_x86_amd.c tprof_x86_intel.c

Log Message:
 Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_x86_amd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/tprof/tprof_x86_intel.c

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



CVS commit: src/sys/dev/fdt

2019-06-14 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Fri Jun 14 11:08:18 UTC 2019

Modified Files:
src/sys/dev/fdt: fdt_intr.c fdt_subr.c fdtvar.h

Log Message:
Add support "interrupts-extended".

* fdtbus_get_phandle_with_data().
  Add utility subroutine to get phandle with data.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/fdt/fdt_intr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/fdt/fdtvar.h

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



CVS commit: src/sys/dev/fdt

2019-06-14 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Fri Jun 14 11:08:18 UTC 2019

Modified Files:
src/sys/dev/fdt: fdt_intr.c fdt_subr.c fdtvar.h

Log Message:
Add support "interrupts-extended".

* fdtbus_get_phandle_with_data().
  Add utility subroutine to get phandle with data.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/fdt/fdt_intr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/fdt/fdtvar.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/fdt_intr.c
diff -u src/sys/dev/fdt/fdt_intr.c:1.21 src/sys/dev/fdt/fdt_intr.c:1.22
--- src/sys/dev/fdt/fdt_intr.c:1.21	Wed Feb 27 17:01:57 2019
+++ src/sys/dev/fdt/fdt_intr.c	Fri Jun 14 11:08:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.21 2019/02/27 17:01:57 jakllsch Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.22 2019/06/14 11:08:18 hkenken Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.21 2019/02/27 17:01:57 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.22 2019/06/14 11:08:18 hkenken Exp $");
 
 #include 
 #include 
@@ -322,12 +322,31 @@ done:
 	return result;
 }
 
+
+static const u_int *
+get_specifier_from_extended(int phandle, int pindex, int *piphandle)
+{
+	const u_int *result = NULL;
+	struct fdt_phandle_data data;
+
+	if (fdtbus_get_phandle_with_data(phandle, "interrupts-extended",
+		"#interrupt-cells", pindex, &data) == 0) {
+		*piphandle = data.phandle;
+		result = data.values;
+	}
+
+	return result;
+}
+
 static const u_int *
 get_specifier_by_index(int phandle, int pindex, int *piphandle)
 {
 	const u_int *node_specifier;
 	int interrupt_parent, interrupt_cells, len;
 
+	if (of_hasprop(phandle, "interrupts-extended"))
+		return get_specifier_from_extended(phandle, pindex, piphandle);
+
 	interrupt_parent = fdtbus_get_interrupt_parent(phandle);
 	if (interrupt_parent <= 0)
 		return NULL;

Index: src/sys/dev/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.29 src/sys/dev/fdt/fdt_subr.c:1.30
--- src/sys/dev/fdt/fdt_subr.c:1.29	Wed Feb 27 16:56:00 2019
+++ src/sys/dev/fdt/fdt_subr.c	Fri Jun 14 11:08:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.29 2019/02/27 16:56:00 jakllsch Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.30 2019/06/14 11:08:18 hkenken Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.29 2019/02/27 16:56:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.30 2019/06/14 11:08:18 hkenken Exp $");
 
 #include "opt_fdt.h"
 
@@ -130,6 +130,42 @@ fdtbus_get_phandle(int phandle, const ch
 }
 
 int
+fdtbus_get_phandle_with_data(int phandle, const char *prop, const char *cells,
+int index, struct fdt_phandle_data *data)
+{
+	int len;
+	const int offset = 1;
+
+	const u_int *p = fdtbus_get_prop(phandle, prop, &len);
+	if (p == NULL || len <= 0)
+		return EINVAL;
+
+	for (int i = 0; len > 0; i++) {
+		u_int phandle_ref = be32toh(*p);
+		const u_int iparent = fdtbus_get_phandle_from_native(phandle_ref);
+		uint32_t cells_num;
+		of_getprop_uint32(iparent, cells, &cells_num);
+
+		if (index == i) {
+			if (data != NULL) {
+data->phandle = iparent;
+data->count = cells_num;
+data->values = p + offset;
+			}
+			goto done;
+		}
+
+		const u_int reclen = offset + cells_num;
+		len -= reclen * sizeof(u_int);
+		p += reclen;
+	}
+	return EINVAL;
+
+done:
+	return 0;
+}
+
+int
 fdtbus_get_phandle_from_native(int phandle)
 {
 	const int off = fdt_node_offset_by_phandle(fdt_data, phandle);

Index: src/sys/dev/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.51 src/sys/dev/fdt/fdtvar.h:1.52
--- src/sys/dev/fdt/fdtvar.h:1.51	Wed May  8 13:40:18 2019
+++ src/sys/dev/fdt/fdtvar.h	Fri Jun 14 11:08:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.51 2019/05/08 13:40:18 isaki Exp $ */
+/* $NetBSD: fdtvar.h,v 1.52 2019/06/14 11:08:18 hkenken Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -232,6 +232,12 @@ struct fdt_console_info {
 	const struct fdt_console *ops;
 };
 
+struct fdt_phandle_data {
+	int phandle;
+	int count;
+	const u_int *values;
+};
+
 #define	_FDT_CONSOLE_REGISTER(name)	\
 	__link_set_add_rodata(fdt_consoles, __CONCAT(name,_consinfo));
 
@@ -278,6 +284,8 @@ int		fdtbus_get_reg_byname(int, const ch
 		bus_size_t *);
 int		fdtbus_get_reg64(int, u_int, uint64_t *, uint64_t *);
 int		fdtbus_get_phandle(int, const char *);
+int		fdtbus_get_phandle_with_data(int, const char *, const char *,
+		int, struct fdt_phandle_data *);
 int		fdtbus_get_phandle_from_native(int);
 i2c_tag_t	fdtbus_get_i2c_tag(int);
 i2c_tag_t	fdtbus_i2c_acquire(int, const char *);



CVS commit: src/sys/arch/x86

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 14 09:23:42 UTC 2019

Modified Files:
src/sys/arch/x86/include: apicvar.h
src/sys/arch/x86/x86: apic.c ioapic.c lapic.c

Log Message:
- Dump LAPIC and I/O APIC correctly.
  - Don't print redirect target on LAPIC.
  - Fix DEST_MASK:
- DEST_MASK is not 1 bit but 2 bit.
- Add missing "\0"s to print decoded name correctly.
  - Support both LAPIC and I/O APIC correctly in apic_format_redir().
- Improve output of some bits using with snprintb()'s "F\B\1" and ":\V".


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/apicvar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/apic.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/x86/ioapic.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/x86/lapic.c

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

Modified files:

Index: src/sys/arch/x86/include/apicvar.h
diff -u src/sys/arch/x86/include/apicvar.h:1.5 src/sys/arch/x86/include/apicvar.h:1.6
--- src/sys/arch/x86/include/apicvar.h:1.5	Mon Apr 28 20:23:40 2008
+++ src/sys/arch/x86/include/apicvar.h	Fri Jun 14 09:23:42 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: apicvar.h,v 1.5 2008/04/28 20:23:40 martin Exp $ */
+/* 	$NetBSD: apicvar.h,v 1.6 2019/06/14 09:23:42 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -44,6 +44,14 @@ struct apic_attach_args {
 	int apic_vecbase;
 };
 
-void apic_format_redir(const char *, const char *, int, u_int32_t, u_int32_t);
+/*
+ * Dump function for both LAPIC and I/O APIC.
+ * The 3rd argument is APIC_VECTYPE_*.
+ */
+#define APIC_VECTYPE_LAPIC_LVT	1
+#define APIC_VECTYPE_LAPIC_ICR	2
+#define APIC_VECTYPE_IOAPIC	3
+void apic_format_redir(const char *, const char *, int, int, uint32_t,
+uint32_t);
 
 #endif /* !_X86_APICVAR_H_ */

Index: src/sys/arch/x86/x86/apic.c
diff -u src/sys/arch/x86/x86/apic.c:1.9 src/sys/arch/x86/x86/apic.c:1.10
--- src/sys/arch/x86/x86/apic.c:1.9	Thu Jun 13 07:28:17 2019
+++ src/sys/arch/x86/x86/apic.c	Fri Jun 14 09:23:42 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: apic.c,v 1.9 2019/06/13 07:28:17 msaitoh Exp $ */
+/* $NetBSD: apic.c,v 1.10 2019/06/14 09:23:42 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apic.c,v 1.9 2019/06/13 07:28:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apic.c,v 1.10 2019/06/14 09:23:42 msaitoh Exp $");
 
 #include 
 #include 
@@ -42,31 +42,38 @@ __KERNEL_RCSID(0, "$NetBSD: apic.c,v 1.9
 #include 
 #include 
 
-const char redirlofmt[] = "\177\20"
-	"f\0\10vector\0"
-	"f\10\3delmode\0"
-	"b\13logical\0"
-	"b\14pending\0"
-	"b\15actlo\0"
-	"b\16irrpending\0"
-	"b\17level\0"
+#define APICVTFMT "\177\20"		\
+	"f\0\10vector\0"		\
+	"f\10\3delmode\0" "=\0fixed\0" "=\1low\0" "=\2SMI\0" "=\4NMI\0"	\
+			"=\5INIT\0" "=\6startup\0" "=\7ExtINT\0"	\
+	"F\13\1\0" ":\0physical\0" ":\1logical\0"			\
+	"b\14pending\0"			\
+	"F\15\1\0" ":\0acthi\0" ":\1actlo\0"\
+	"b\16irrpending\0"		\
+	"F\17\1\0" ":\0edge\0" ":\1level\0"\
 	"b\20masked\0"
-	"f\22\1dest\0" "=\1self" "=\2all" "=\3all-others";
 
-const char redirhifmt[] = "\177\20"
+static const char ioapicfmt[] = APICVTFMT
+	"f\22\2dest\0" "=\1self\0" "=\2all\0" "=\3all-others\0";
+
+static const char lapicfmt[] = APICVTFMT
+	"f\21\2timer\0" "=\0oneshot\0" "=\1periodic\0" "=\2TSC-deadine\0";
+
+static const char redirhifmt[] = "\177\20"
 	"f\30\10target\0";
 
 void
-apic_format_redir(const char *where1, const char *where2, int idx,
+apic_format_redir(const char *where1, const char *where2, int idx, int type,
 		uint32_t redirhi, uint32_t redirlo)
 {
 	char buf[256];
 
-	snprintb(buf, sizeof(buf), redirlofmt, redirlo);
-	printf("%s: %s%d %s",
-	where1, where2, idx, buf);
+	snprintb(buf, sizeof(buf),
+	type == APIC_VECTYPE_IOAPIC ? ioapicfmt : lapicfmt, redirlo);
+	printf("%s: %s%d %s", where1, where2, idx, buf);
 
-	if ((redirlo & LAPIC_DEST_MASK) == 0) {
+	if ((type == APIC_VECTYPE_IOAPIC)
+	&& ((redirlo & LAPIC_DEST_MASK) == 0)) {
 		snprintb(buf, sizeof(buf), redirhifmt, redirhi);
 		printf(" %s", buf);
 	}

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.60 src/sys/arch/x86/x86/ioapic.c:1.61
--- src/sys/arch/x86/x86/ioapic.c:1.60	Thu Jun 13 07:28:17 2019
+++ src/sys/arch/x86/x86/ioapic.c	Fri Jun 14 09:23:42 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.60 2019/06/13 07:28:17 msaitoh Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.61 2019/06/14 09:23:42 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.60 2019/06/13 07:28:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.61 2019/06/14 09:23:42 msaitoh Exp $");
 
 #include "opt_ddb.h"
 
@@ -238,8 +238,8 @@ ioapic_print_redir(struct ioapic_softc *
 	uint32_t redirlo = ioapic_read(sc, IOAPIC_

CVS commit: src/sys/arch/x86

2019-06-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jun 14 09:23:42 UTC 2019

Modified Files:
src/sys/arch/x86/include: apicvar.h
src/sys/arch/x86/x86: apic.c ioapic.c lapic.c

Log Message:
- Dump LAPIC and I/O APIC correctly.
  - Don't print redirect target on LAPIC.
  - Fix DEST_MASK:
- DEST_MASK is not 1 bit but 2 bit.
- Add missing "\0"s to print decoded name correctly.
  - Support both LAPIC and I/O APIC correctly in apic_format_redir().
- Improve output of some bits using with snprintb()'s "F\B\1" and ":\V".


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/apicvar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/apic.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/x86/ioapic.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/x86/lapic.c

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



CVS commit: src

2019-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 14 09:12:42 UTC 2019

Modified Files:
src: Makefile

Log Message:
Use the generated "postinstall" in the objdir for postinstall-check
and postinstall-fix targets - we do not have a simple postinstall script
in the source tree any more.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/Makefile

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



CVS commit: src

2019-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 14 09:12:42 UTC 2019

Modified Files:
src: Makefile

Log Message:
Use the generated "postinstall" in the objdir for postinstall-check
and postinstall-fix targets - we do not have a simple postinstall script
in the source tree any more.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/Makefile

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

Modified files:

Index: src/Makefile
diff -u src/Makefile:1.326 src/Makefile:1.327
--- src/Makefile:1.326	Thu Jun  6 14:51:43 2019
+++ src/Makefile	Fri Jun 14 09:12:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.326 2019/06/06 14:51:43 martin Exp $
+#	$NetBSD: Makefile,v 1.327 2019/06/14 09:12:42 martin Exp $
 
 #
 # This is the top-level makefile for building NetBSD. For an outline of
@@ -169,7 +169,8 @@ afterinstall: .PHONY .MAKE
 	${MAKEDIRTARGET} . postinstall-check
 .endif
 
-_POSTINSTALL=	${.CURDIR}/usr.sbin/postinstall/postinstall \
+_POSTINSTALL=	${:!cd ${.CURDIR}/usr.sbin/postinstall && \
+			${MAKE} print-objdir!}/postinstall  \
 		-m ${MACHINE} -a ${MACHINE_ARCH}
 _POSTINSTALL_ENV= \
 	AWK=${TOOL_AWK:Q}		\



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

2019-06-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jun 14 09:09:12 UTC 2019

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

Log Message:
Simplify the _ARM32_NEED_BUS_DMA_BOUNCE #ifdefs and rely on compiler
optimisation of the bouncing = false case.

Drain the write buf (aka DSB) in more cases

Catch all CPUs that support speculation. (thunderx isn't CPU_CORTEX)


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/arm/arm32/bus_dma.c

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



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

2019-06-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jun 14 09:09:12 UTC 2019

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

Log Message:
Simplify the _ARM32_NEED_BUS_DMA_BOUNCE #ifdefs and rely on compiler
optimisation of the bouncing = false case.

Drain the write buf (aka DSB) in more cases

Catch all CPUs that support speculation. (thunderx isn't CPU_CORTEX)


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/arm/arm32/bus_dma.c

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

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.114 src/sys/arch/arm/arm32/bus_dma.c:1.115
--- src/sys/arch/arm/arm32/bus_dma.c:1.114	Sat Jun  8 11:57:27 2019
+++ src/sys/arch/arm/arm32/bus_dma.c	Fri Jun 14 09:09:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.114 2019/06/08 11:57:27 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.114 2019/06/08 11:57:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $");
 
 #include 
 #include 
@@ -254,12 +254,13 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 	return 0;
 }
 
+static int _bus_dma_uiomove(void *buf, struct uio *uio, size_t n,
+	int direction);
+
 #ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 static int _bus_dma_alloc_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map,
 	bus_size_t size, int flags);
 static void _bus_dma_free_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map);
-static int _bus_dma_uiomove(void *buf, struct uio *uio, size_t n,
-	int direction);
 
 static int
 _bus_dma_load_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
@@ -796,7 +797,7 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 bool readonly_p)
 {
 
-#if defined(ARM_MMU_EXTENDED) || defined(CPU_CORTEX)
+#if defined(ARM_MMU_EXTENDED)
 	/*
 	 * No optimisations are available for readonly mbufs on armv6+, so
 	 * assume it's not readonly from here on.
@@ -863,7 +864,8 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 		cpu_sdcache_wb_range(va, pa, len);
 		break;
 
-#ifdef CPU_CORTEX
+#if defined(CPU_CORTEX) || defined(CPU_ARMV8)
+
 	/*
 	 * Cortex CPUs can do speculative loads so we need to clean the cache
 	 * after a DMA read to deal with any speculatively loaded cache lines.
@@ -1074,22 +1076,23 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 #endif
 
 	const int pre_ops = ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
-#ifdef CPU_CORTEX
+#if defined(CPU_CORTEX) || defined(CPU_ARMV8)
 	const int post_ops = ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
 #else
 	const int post_ops = 0;
 #endif
-	if (!bouncing) {
-		if (pre_ops == 0 && post_ops == BUS_DMASYNC_POSTWRITE) {
-			STAT_INCR(sync_postwrite);
-			return;
-		} else if (pre_ops == 0 && post_ops == 0) {
-			return;
-		}
+	if (pre_ops == 0 && post_ops == 0)
+		return;
+
+	if (post_ops == BUS_DMASYNC_POSTWRITE) {
+		KASSERT(pre_ops == 0);
+		STAT_INCR(sync_postwrite);
+		return;
 	}
+
 	KASSERTMSG(bouncing || pre_ops != 0 || (post_ops & BUS_DMASYNC_POSTREAD),
 	"pre_ops %#x post_ops %#x", pre_ops, post_ops);
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+
 	if (bouncing && (ops & BUS_DMASYNC_PREWRITE)) {
 		struct arm32_bus_dma_cookie * const cookie = map->_dm_cookie;
 		STAT_INCR(write_bounces);
@@ -1123,23 +1126,28 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 #endif /* DIAGNOSTIC */
 		}
 	}
-#endif /* _ARM32_NEED_BUS_DMA_BOUNCE */
 
-	/* Skip cache frobbing if mapping was COHERENT. */
-	if (!bouncing && (map->_dm_flags & _BUS_DMAMAP_COHERENT)) {
-		/* Drain the write buffer. */
-		if (pre_ops & BUS_DMASYNC_PREWRITE)
+	/* Skip cache frobbing if mapping was COHERENT */
+	if ((map->_dm_flags & _BUS_DMAMAP_COHERENT)) {
+		/*
+		 * Drain the write buffer of DMA operators.
+		 * 1) when cpu->device (prewrite)
+		 * 2) when device->cpu (postread)
+		 */
+		if ((pre_ops & BUS_DMASYNC_PREWRITE) || (post_ops & BUS_DMASYNC_POSTREAD))
 			cpu_drain_writebuf();
-		return;
-	}
 
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
-	if (bouncing && ((map->_dm_flags & _BUS_DMAMAP_COHERENT) || pre_ops == 0)) {
-		goto bounce_it;
+		/*
+		 * Only thing left to do for COHERENT mapping is copy from bounce
+		 * in the POSTREAD case.
+		 */
+		if (bouncing && (post_ops & BUS_DMASYNC_POSTREAD))
+			goto bounce_it;
+
+		return;
 	}
-#endif /* _ARM32_NEED_BUS_DMA_BOUNCE */
 
-#ifndef ARM_MMU_EXTENDED
+#if !defined( ARM_MMU_EXTENDED)
 	/*
 	 * If the mapping belongs to a non-kernel vmspace, and the
 	 * vmspace has not been active since the last time a full
@@ -1151,11 +1159,9 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 #endif
 
 	int buftype = map->_dm_buftype;
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 	if (bouncing) {
 		buftype = _BUS_DMA_BUFTYPE_LINEAR;
 	}
-#endif
 
 	switch (buftype) {
 	case _BU

CVS commit: src/usr.sbin/rtadvd

2019-06-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jun 14 09:06:45 UTC 2019

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

Log Message:
rtadvd: fix rdnss and dnssl lifetime assignment

Treat it the same as a prefix valid time as per the RFC.
This allows to set a zero value to remove the assignment from the node.


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

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



CVS commit: src/usr.sbin/rtadvd

2019-06-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jun 14 09:06:45 UTC 2019

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

Log Message:
rtadvd: fix rdnss and dnssl lifetime assignment

Treat it the same as a prefix valid time as per the RFC.
This allows to set a zero value to remove the assignment from the node.


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

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

Modified files:

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.40 src/usr.sbin/rtadvd/config.c:1.41
--- src/usr.sbin/rtadvd/config.c:1.40	Fri Apr 20 15:57:23 2018
+++ src/usr.sbin/rtadvd/config.c	Fri Jun 14 09:06:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.40 2018/04/20 15:57:23 roy Exp $	*/
+/*	$NetBSD: config.c,v 1.41 2019/06/14 09:06:45 roy Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -701,9 +701,7 @@ getconfig(const char *intface, int exith
 
 		makeentry(entbuf, sizeof(entbuf), i, "rdnssltime");
 		MAYHAVE(val64, entbuf, tmp->maxinterval * 3 / 2);
-		if (val64 < tmp->maxinterval ||
-		val64 > tmp->maxinterval * 2)
-		{
+		if (val64 < 0 || val64 > 0x) {
 			logit(LOG_ERR, "<%s> %s (%lld) on %s is invalid",
 			 __func__, entbuf, (long long)val64, intface);
 			goto errexit;
@@ -737,9 +735,7 @@ getconfig(const char *intface, int exith
 
 		makeentry(entbuf, sizeof(entbuf), i, "dnsslltime");
 		MAYHAVE(val64, entbuf, tmp->maxinterval * 3 / 2);
-		if (val64 < tmp->maxinterval ||
-		val64 > tmp->maxinterval * 2)
-		{
+		if (val64 < 0 || val64 > 0x) {
 			logit(LOG_ERR, "<%s> %s (%lld) on %s is invalid",
 			 __func__, entbuf, (long long)val64, intface);
 			goto errexit;