CVS commit: src/sys/dev/pci

2019-03-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Mar 28 02:50:27 UTC 2019

Modified Files:
src/sys/dev/pci: if_bnx.c if_bnxvar.h

Log Message:
- Remove extra cast (from OpenBSD rev. 1.95)
- Add support flow control (from OpenBSD rev. 1.97 and 1.100).
  The main difference between NetBSD and other *BSDs is that the flow control
  does really works. The lower 8bit of BNX_L2CTX_CTX_TYPE should be 0xff
  (from Linux). Note that I have NetXtremeII-PG203-R.pdf and it says the field
  is reserved and should be 0.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_bnxvar.h

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

Modified files:

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.71 src/sys/dev/pci/if_bnx.c:1.72
--- src/sys/dev/pci/if_bnx.c:1.71	Wed Mar 27 03:37:32 2019
+++ src/sys/dev/pci/if_bnx.c	Thu Mar 28 02:50:27 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: if_bnx.c,v 1.71 2019/03/27 03:37:32 msaitoh Exp $	*/
-/*	$OpenBSD: if_bnx.c,v 1.94 2011/04/18 04:27:31 dlg Exp $ */
+/*	$NetBSD: if_bnx.c,v 1.72 2019/03/28 02:50:27 msaitoh Exp $	*/
+/*	$OpenBSD: if_bnx.c,v 1.100 2013/01/13 05:45:10 brad Exp $ */
 
 /*-
  * Copyright (c) 2006-2010 Broadcom Corporation
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.71 2019/03/27 03:37:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.72 2019/03/28 02:50:27 msaitoh Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -380,6 +380,7 @@ int	bnx_tx_encap(struct bnx_softc *, str
 void	bnx_start(struct ifnet *);
 int	bnx_ioctl(struct ifnet *, u_long, void *);
 void	bnx_watchdog(struct ifnet *);
+void	bnx_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 int	bnx_init(struct ifnet *);
 
 void	bnx_init_context(struct bnx_softc *);
@@ -819,7 +820,7 @@ bnx_attach(device_t parent, device_t sel
 
 	sc->bnx_ec.ec_mii = >bnx_mii;
 	ifmedia_init(>bnx_mii.mii_media, 0, ether_mediachange,
-	ether_mediastatus);
+	bnx_ifmedia_sts);
 
 	/* set phyflags and chipid before mii_attach() */
 	dict = device_properties(self);
@@ -831,6 +832,7 @@ bnx_attach(device_t parent, device_t sel
 	/* Print some useful adapter info */
 	bnx_print_adapter_info(sc);
 
+	mii_flags |= MIIF_DOPAUSE;
 	if (sc->bnx_phy_flags & BNX_PHY_SERDES_FLAG)
 		mii_flags |= MIIF_HAVEFIBER;
 	mii_attach(self, >bnx_mii, 0x,
@@ -1188,6 +1190,7 @@ bnx_miibus_statchg(struct ifnet *ifp)
 {
 	struct bnx_softc	*sc = ifp->if_softc;
 	struct mii_data		*mii = >bnx_mii;
+	uint32_t		rx_mode = sc->rx_mode;
 	int			val;
 
 	val = REG_RD(sc, BNX_EMAC_MODE);
@@ -1195,6 +1198,15 @@ bnx_miibus_statchg(struct ifnet *ifp)
 	BNX_EMAC_MODE_MAC_LOOP | BNX_EMAC_MODE_FORCE_LINK |
 	BNX_EMAC_MODE_25G);
 
+	/*
+	 * Get flow control negotiation result.
+	 */
+	if (IFM_SUBTYPE(mii->mii_media.ifm_cur->ifm_media) == IFM_AUTO &&
+	(mii->mii_media_active & IFM_ETH_FMASK) != sc->bnx_flowflags) {
+		sc->bnx_flowflags = mii->mii_media_active & IFM_ETH_FMASK;
+		mii->mii_media_active &= ~IFM_ETH_FMASK;
+	}
+
 	/* Set MII or GMII interface based on the speed
 	 * negotiated by the PHY.
 	 */
@@ -1235,6 +1247,36 @@ bnx_miibus_statchg(struct ifnet *ifp)
 	}
 
 	REG_WR(sc, BNX_EMAC_MODE, val);
+
+	/*
+	 * 802.3x flow control
+	 */
+	if (sc->bnx_flowflags & IFM_ETH_RXPAUSE) {
+		DBPRINT(sc, BNX_INFO, "Enabling RX mode flow control.\n");
+		rx_mode |= BNX_EMAC_RX_MODE_FLOW_EN;
+	} else {
+		DBPRINT(sc, BNX_INFO, "Disabling RX mode flow control.\n");
+		rx_mode &= ~BNX_EMAC_RX_MODE_FLOW_EN;
+	}
+
+	if (sc->bnx_flowflags & IFM_ETH_TXPAUSE) {
+		DBPRINT(sc, BNX_INFO, "Enabling TX mode flow control.\n");
+		BNX_SETBIT(sc, BNX_EMAC_TX_MODE, BNX_EMAC_TX_MODE_FLOW_EN);
+	} else {
+		DBPRINT(sc, BNX_INFO, "Disabling TX mode flow control.\n");
+		BNX_CLRBIT(sc, BNX_EMAC_TX_MODE, BNX_EMAC_TX_MODE_FLOW_EN);
+	}
+
+	/* Only make changes if the recive mode has actually changed. */
+	if (rx_mode != sc->rx_mode) {
+		DBPRINT(sc, BNX_VERBOSE, "Enabling new receive mode: 0x%08X\n",
+		rx_mode);
+
+		sc->rx_mode = rx_mode;
+		REG_WR(sc, BNX_EMAC_RX_MODE, rx_mode);
+
+		bnx_init_rx_context(sc);
+	}
 }
 
 //
@@ -4147,7 +4189,7 @@ bnx_free_tx_chain(struct bnx_softc *sc)
 
 	/* Clear each TX chain page. */
 	for (i = 0; i < TX_PAGES; i++) {
-		memset((char *)sc->tx_bd_chain[i], 0, BNX_TX_CHAIN_PAGE_SZ);
+		memset(sc->tx_bd_chain[i], 0, BNX_TX_CHAIN_PAGE_SZ);
 		bus_dmamap_sync(sc->bnx_dmatag, sc->tx_bd_chain_map[i], 0,
 		BNX_TX_CHAIN_PAGE_SZ, BUS_DMASYNC_PREWRITE);
 	}
@@ -4178,22 +4220,8 @@ bnx_init_rx_context(struct bnx_softc *sc
 	val = BNX_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE |
 		BNX_L2CTX_CTX_TYPE_SIZE_L2 | (0x02 << 8);
 
-	if (BNX_CHIP_NUM(sc) == 

CVS commit: src/sys/dev/pci

2019-03-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 27 22:00:33 UTC 2019

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

Log Message:
fix the fix(es) - don't try to access a BIOS we didn't find.
Now this works on sparc64 again.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.103 src/sys/dev/pci/radeonfb.c:1.104
--- src/sys/dev/pci/radeonfb.c:1.103	Fri Mar 22 07:41:41 2019
+++ src/sys/dev/pci/radeonfb.c	Wed Mar 27 22:00:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.103 2019/03/22 07:41:41 martin Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.104 2019/03/27 22:00:33 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.103 2019/03/22 07:41:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.104 2019/03/27 22:00:33 macallan Exp $");
 
 #include 
 #include 
@@ -478,6 +478,8 @@ radeonfb_attach(device_t parent, device_
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_family = radeonfb_devices[i].family;
 	sc->sc_flags = radeonfb_devices[i].flags;
+	sc->sc_bios = NULL;
+	sc->sc_biossz = 0;
 
 	/* enable memory and IO access */
 	screg = pci_conf_read(sc->sc_pc, sc->sc_pt, PCI_COMMAND_STATUS_REG);
@@ -1402,9 +1404,6 @@ radeonfb_loadbios(struct radeonfb_softc 
 	pci_find_rom(pa, romt, romh, romsz, PCI_ROM_CODE_TYPE_X86, ,
 	>sc_biossz);
 
-	if (sc->sc_biossz == 0 || sc->sc_bios == NULL)
-		return;
-
 foundit:
 	if (sc->sc_biossz > 0) {
 		sc->sc_bios = malloc(sc->sc_biossz, M_DEVBUF, M_WAITOK);
@@ -1431,15 +1430,13 @@ foundit:
 	pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_MAPREG_ROM) &
 	~PCI_MAPREG_ROM_ENABLE);
 
-	DPRINTF(("BIOS %08x\n", *(uint32_t *)sc->sc_bios));
-
-	ptr = GETBIOS16(sc, 0x48);
-	if ((GETBIOS32(sc, ptr + 4) == 0x41544f4d /* "ATOM" */) ||
-	(GETBIOS32(sc, ptr + 4) == 0x4d4f5441 /* "MOTA" */)) {
-		sc->sc_flags |= RFB_ATOM;
-	}
-
 	if (sc->sc_biossz > 0) {
+		ptr = GETBIOS16(sc, 0x48);
+		if ((GETBIOS32(sc, ptr + 4) == 0x41544f4d /* "ATOM" */) ||
+		(GETBIOS32(sc, ptr + 4) == 0x4d4f5441 /* "MOTA" */)) {
+			sc->sc_flags |= RFB_ATOM;
+		}
+
 		aprint_verbose("%s: Found %d KB %s BIOS\n", XNAME(sc),
 		(unsigned)sc->sc_biossz >> 10,
 		IS_ATOM(sc) ? "ATOM" : "Legacy");
@@ -1928,14 +1925,14 @@ nobios:
 			sc->sc_ports[0].rp_dac_type = RADEON_DAC_TVDAC;
 			sc->sc_ports[0].rp_conn_type = RADEON_CONN_DVI_D;
 			sc->sc_ports[0].rp_tmds_type = RADEON_TMDS_INT;
-			sc->sc_ports[0].rp_number = 1;
+			sc->sc_ports[0].rp_number = 0;
 
 			sc->sc_ports[1].rp_mon_type = RADEON_MT_UNKNOWN;
 			sc->sc_ports[1].rp_ddc_type = RADEON_DDC_VGA;
 			sc->sc_ports[1].rp_dac_type = RADEON_DAC_PRIMARY;
 			sc->sc_ports[1].rp_conn_type = RADEON_CONN_CRT;
 			sc->sc_ports[1].rp_tmds_type = RADEON_TMDS_UNKNOWN;
-			sc->sc_ports[1].rp_number = 0;
+			sc->sc_ports[1].rp_number = 1;
 		}
 	}
 



CVS commit: src/tests/crypto/libcrypto

2019-03-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Mar 27 21:14:54 UTC 2019

Modified Files:
src/tests/crypto/libcrypto: t_ciphers.sh

Log Message:
Timeout for evp test case is still not enough for qemu/sparc


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/crypto/libcrypto/t_ciphers.sh

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

Modified files:

Index: src/tests/crypto/libcrypto/t_ciphers.sh
diff -u src/tests/crypto/libcrypto/t_ciphers.sh:1.7 src/tests/crypto/libcrypto/t_ciphers.sh:1.8
--- src/tests/crypto/libcrypto/t_ciphers.sh:1.7	Sat Sep 29 10:50:33 2018
+++ src/tests/crypto/libcrypto/t_ciphers.sh	Wed Mar 27 21:14:54 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_ciphers.sh,v 1.7 2018/09/29 10:50:33 gson Exp $
+# $NetBSD: t_ciphers.sh,v 1.8 2019/03/27 21:14:54 gson Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@ atf_test_case evp
 evp_head()
 {
 	atf_set "descr" "Checks EVP cipher"
-	atf_set "timeout" "600"
+	atf_set "timeout" "1200"
 }
 evp_body()
 {



CVS commit: src/sys/arch/powerpc/include/ibm4xx

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 19:30:31 UTC 2019

Modified Files:
src/sys/arch/powerpc/include/ibm4xx: vmparam.h

Log Message:
fix protection


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/ibm4xx/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/powerpc/include/ibm4xx/vmparam.h
diff -u src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.11 src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.12
--- src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.11	Mon Feb 13 04:46:30 2017
+++ src/sys/arch/powerpc/include/ibm4xx/vmparam.h	Wed Mar 27 15:30:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.11 2017/02/13 09:46:30 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.12 2019/03/27 19:30:31 christos Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -31,8 +31,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _MACHINE_VMPARAM_H_
-#define _MACHINE_VMPARAM_H_
+#ifndef _POWERPC_IBM4XX_VMPARAM_H_
+#define _POWERPC_IBM4XX_VMPARAM_H_
 
 /*
  * We use 16K pages on IBM4xx CPUs.  Override the PAGE_* definitions
@@ -101,4 +101,4 @@ struct pmap_physseg {
 
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
 
-#endif /* _MACHINE_VMPARAM_H_ */
+#endif /* _POWERPC_IBM4XX_VMPARAM_H_ */



CVS commit: src/sys

2019-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 27 19:13:34 UTC 2019

Modified Files:
src/sys/dev: ccd.c dksubr.c
src/sys/dev/ofw: ofdisk.c
src/sys/kern: subr_disk.c
src/sys/sys: dkio.h

Log Message:
Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/dev/ccd.c
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/dksubr.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ofw/ofdisk.c
cvs rdiff -u -r1.122 -r1.123 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.24 -r1.25 src/sys/sys/dkio.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/ccd.c
diff -u src/sys/dev/ccd.c:1.178 src/sys/dev/ccd.c:1.179
--- src/sys/dev/ccd.c:1.178	Fri Mar  1 11:06:56 2019
+++ src/sys/dev/ccd.c	Wed Mar 27 19:13:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd.c,v 1.178 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: ccd.c,v 1.179 2019/03/27 19:13:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.178 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.179 2019/03/27 19:13:34 martin Exp $");
 
 #include 
 #include 
@@ -1126,6 +1126,7 @@ ccdioctl(dev_t dev, u_long cmd, void *da
 	case DIOCCACHESYNC:
 	case DIOCAWEDGE:
 	case DIOCDWEDGE:
+	case DIOCRMWEDGES:
 	case DIOCMWEDGES:
 #ifdef __HAVE_OLD_DISKLABEL
 	case ODIOCSDINFO:

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.106 src/sys/dev/dksubr.c:1.107
--- src/sys/dev/dksubr.c:1.106	Mon Jan  7 22:35:55 2019
+++ src/sys/dev/dksubr.c	Wed Mar 27 19:13:34 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.106 2019/01/07 22:35:55 jdolecek Exp $ */
+/* $NetBSD: dksubr.c,v 1.107 2019/03/27 19:13:34 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.106 2019/01/07 22:35:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.107 2019/03/27 19:13:34 martin Exp $");
 
 #include 
 #include 
@@ -617,6 +617,7 @@ dk_ioctl(struct dk_softc *dksc, dev_t de
 	case DIOCDWEDGE:
 	case DIOCLWEDGES:
 	case DIOCMWEDGES:
+	case DIOCRMWEDGES:
 	case DIOCCACHESYNC:
 #ifdef __HAVE_OLD_DISKLABEL
 	case ODIOCGDINFO:

Index: src/sys/dev/ofw/ofdisk.c
diff -u src/sys/dev/ofw/ofdisk.c:1.52 src/sys/dev/ofw/ofdisk.c:1.53
--- src/sys/dev/ofw/ofdisk.c:1.52	Sat Mar 25 09:21:21 2017
+++ src/sys/dev/ofw/ofdisk.c	Wed Mar 27 19:13:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofdisk.c,v 1.52 2017/03/25 09:21:21 martin Exp $	*/
+/*	$NetBSD: ofdisk.c,v 1.53 2019/03/27 19:13:34 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.52 2017/03/25 09:21:21 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.53 2019/03/27 19:13:34 martin Exp $");
 
 #include 
 #include 
@@ -367,6 +367,7 @@ ofdisk_ioctl(dev_t dev, u_long cmd, void
 	case DIOCDWEDGE:
 	case DIOCAWEDGE:
 	case DIOCLWEDGES:
+	case DIOCRMWEDGES:
 	case DIOCMWEDGES:
 		if (OFDISK_FLOPPY_P(of))
 			return ENOTTY;

Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.122 src/sys/kern/subr_disk.c:1.123
--- src/sys/kern/subr_disk.c:1.122	Wed Mar  7 21:13:24 2018
+++ src/sys/kern/subr_disk.c	Wed Mar 27 19:13:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk.c,v 1.122 2018/03/07 21:13:24 kre Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.123 2019/03/27 19:13:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.122 2018/03/07 21:13:24 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.123 2019/03/27 19:13:33 martin Exp $");
 
 #include 
 #include 
@@ -645,6 +645,13 @@ disk_ioctl(struct disk *dk, dev_t dev, u
 		dkwedge_discover(dk);
 		return 0;
 
+	case DIOCRMWEDGES:
+		if ((flag & FWRITE) == 0)
+			return EBADF;
+
+		dkwedge_delall(dk);
+		return 0;
+
 	default:
 		return EPASSTHROUGH;
 	}

Index: src/sys/sys/dkio.h
diff -u src/sys/sys/dkio.h:1.24 src/sys/sys/dkio.h:1.25
--- src/sys/sys/dkio.h:1.24	Wed Apr  5 20:15:49 2017
+++ src/sys/sys/dkio.h	Wed Mar 27 19:13:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dkio.h,v 1.24 2017/04/05 20:15:49 jdolecek Exp $	*/
+/*	$NetBSD: dkio.h,v 1.25 2019/03/27 19:13:33 martin Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -130,4 +130,7 @@
 #define	DIOCGSECTORSIZE	_IOR('d', 133, u_int)	/* sector size in bytes */
 #define	DIOCGMEDIASIZE	_IOR('d', 132, off_t)	/* media size in bytes */
 
+		/* mass removal */
+#define	DIOCRMWEDGES	_IOR('d', 134, int)	/* remove all wedges */
+
 #endif /* _SYS_DKIO_H_ */



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

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 19:01:44 UTC 2019

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

Log Message:
provide the max page size for userland


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sparc/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/sparc/include/vmparam.h
diff -u src/sys/arch/sparc/include/vmparam.h:1.43 src/sys/arch/sparc/include/vmparam.h:1.44
--- src/sys/arch/sparc/include/vmparam.h:1.43	Mon Jan  7 11:59:18 2013
+++ src/sys/arch/sparc/include/vmparam.h	Wed Mar 27 15:01:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.43 2013/01/07 16:59:18 chs Exp $ */
+/*	$NetBSD: vmparam.h,v 1.44 2019/03/27 19:01:44 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -62,18 +62,25 @@
 #define	PAGE_SHIFT_SUN4		13
 #define	PAGE_SHIFT_SUN4CM	12
 
-#define	MIN_PAGE_SIZE		(1 << PAGE_SHIFT_SUN4CM)
-#define	MAX_PAGE_SIZE		(1 << PAGE_SHIFT_SUN4)
+#define MAX_PAGE_SHIFT		PAGE_SHIFT_SUN4
+#define MIN_PAGE_SHIFT		PAGE_SHIFT_SUN4CM
+
+#define	MIN_PAGE_SIZE		(1 << MIN_PAGE_SHIFT)
+#define	MAX_PAGE_SIZE		(1 << MAX_PAGE_SHIFT)
 
 #if CPU_NTYPES != 0 && !defined(SUN4)
 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4CM
-#define	PAGE_SIZE		(1 << PAGE_SHIFT)
-#define	PAGE_MASK		(PAGE_SIZE - 1)
 #elif CPU_NTYPES == 1 && defined(SUN4)
 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4
+#elif defined(_KERNEL)
+#error "Cannot determine page size"
+#else
+/* Default to max for userland */
+#define	PAGE_SHIFT		MAX_PAGE_SHIFT
+#endif
+
 #define	PAGE_SIZE		(1 << PAGE_SHIFT)
 #define	PAGE_MASK		(PAGE_SIZE - 1)
-#endif
 
 /*
  * USRSTACK is the top (end) of the user stack.



CVS commit: src/share/mk

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 18:41:18 UTC 2019

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

Log Message:
back to jemalloc for the masses


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

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1116 src/share/mk/bsd.own.mk:1.1117
--- src/share/mk/bsd.own.mk:1.1116	Wed Mar 27 07:15:55 2019
+++ src/share/mk/bsd.own.mk	Wed Mar 27 14:41:18 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1116 2019/03/27 11:15:55 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1117 2019/03/27 18:41:18 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -172,14 +172,7 @@ EXTERNAL_BINUTILS_SUBDIR=	/does/not/exis
 # What version of jemalloc we use (100 is the one
 # built-in to libc from 2005 (pre version 3).
 #
-.if ${MACHINE_CPU} == "x86_64"	|| \
-${MACHINE_CPU} == "i386"	|| \
-${MACHINE_CPU} == "aarch64"	|| \
-${MACHINE} == "sparc64"
 HAVE_JEMALLOC?=		510
-.else
-HAVE_JEMALLOC?=		100
-.endif
 
 .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)



CVS commit: src/sys

2019-03-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Mar 27 18:27:47 UTC 2019

Modified Files:
src/sys/kern: subr_pool.c
src/sys/sys: pool.h

Log Message:
Kernel Heap Hardening: detect frees-in-wrong-pool on on-page pools. The
detection is already implicitly done for off-page pools.

We recycle pr_slack (unused) in struct pool, and make ph_node a union in
order to recycle an unsigned int in struct pool_item_header. Each time a
pool is created we atomically increase a global counter, and register the
current value in pp. We then propagate this value in each ph, and ensure
they match in pool_put.

This can catch several classes of kernel bugs and basically makes them
unexploitable. It comes with no increase in memory usage and no measurable
increase in CPU cost (inexistent cost actually, just one check predicted
false).


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.86 -r1.87 src/sys/sys/pool.h

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

Modified files:

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.244 src/sys/kern/subr_pool.c:1.245
--- src/sys/kern/subr_pool.c:1.244	Tue Mar 26 18:31:30 2019
+++ src/sys/kern/subr_pool.c	Wed Mar 27 18:27:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.244 2019/03/26 18:31:30 maxv Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.245 2019/03/27 18:27:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.244 2019/03/26 18:31:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.245 2019/03/27 18:27:46 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -143,6 +143,8 @@ static kcondvar_t pool_busy;
 /* This lock protects initialization of a potentially shared pool allocator */
 static kmutex_t pool_allocator_lock;
 
+static unsigned int poolid_counter = 0;
+
 typedef uint32_t pool_item_bitmap_t;
 #define	BITMAP_SIZE	(CHAR_BIT * sizeof(pool_item_bitmap_t))
 #define	BITMAP_MASK	(BITMAP_SIZE - 1)
@@ -151,8 +153,17 @@ struct pool_item_header {
 	/* Page headers */
 	LIST_ENTRY(pool_item_header)
 ph_pagelist;	/* pool page list */
-	SPLAY_ENTRY(pool_item_header)
-ph_node;	/* Off-page page headers */
+	union {
+		/* !PR_PHINPAGE */
+		struct {
+			SPLAY_ENTRY(pool_item_header)
+phu_node;	/* off-page page headers */
+		} phu_offpage;
+		/* PR_PHINPAGE */
+		struct {
+			unsigned int phu_poolid;
+		} phu_onpage;
+	} ph_u1;
 	void *			ph_page;	/* this page's address */
 	uint32_t		ph_time;	/* last referenced */
 	uint16_t		ph_nmissing;	/* # of chunks in use */
@@ -167,10 +178,12 @@ struct pool_item_header {
 		struct {
 			pool_item_bitmap_t phu_bitmap[1];
 		} phu_notouch;
-	} ph_u;
+	} ph_u2;
 };
-#define	ph_itemlist	ph_u.phu_normal.phu_itemlist
-#define	ph_bitmap	ph_u.phu_notouch.phu_bitmap
+#define ph_node		ph_u1.phu_offpage.phu_node
+#define ph_poolid	ph_u1.phu_onpage.phu_poolid
+#define ph_itemlist	ph_u2.phu_normal.phu_itemlist
+#define ph_bitmap	ph_u2.phu_notouch.phu_bitmap
 
 #define PHSIZE	ALIGN(sizeof(struct pool_item_header))
 
@@ -445,6 +458,11 @@ pr_find_pagehead(struct pool *pp, void *
 panic("%s: [%s] item %p below item space",
 __func__, pp->pr_wchan, v);
 			}
+			if (__predict_false(ph->ph_poolid != pp->pr_poolid)) {
+panic("%s: [%s] item %p poolid %u != %u",
+__func__, pp->pr_wchan, v, ph->ph_poolid,
+pp->pr_poolid);
+			}
 		} else {
 			tmp.ph_page = page;
 			ph = SPLAY_FIND(phtree, >pr_phtree, );
@@ -497,8 +515,15 @@ pr_rmpage(struct pool *pp, struct pool_i
 	 * Unlink the page from the pool and queue it for release.
 	 */
 	LIST_REMOVE(ph, ph_pagelist);
-	if ((pp->pr_roflags & PR_PHINPAGE) == 0)
+	if (pp->pr_roflags & PR_PHINPAGE) {
+		if (__predict_false(ph->ph_poolid != pp->pr_poolid)) {
+			panic("%s: [%s] ph %p poolid %u != %u",
+			__func__, pp->pr_wchan, ph, ph->ph_poolid,
+			pp->pr_poolid);
+		}
+	} else {
 		SPLAY_REMOVE(phtree, >pr_phtree, ph);
+	}
 	LIST_INSERT_HEAD(pq, ph, ph_pagelist);
 
 	pp->pr_npages--;
@@ -697,6 +722,7 @@ pool_init(struct pool *pp, size_t size, 
 	pp->pr_align = align;
 	pp->pr_wchan = wchan;
 	pp->pr_alloc = palloc;
+	pp->pr_poolid = atomic_inc_uint_nv(_counter);
 	pp->pr_nitems = 0;
 	pp->pr_nout = 0;
 	pp->pr_hardlimit = UINT_MAX;
@@ -1298,7 +1324,9 @@ pool_prime_page(struct pool *pp, void *s
 	ph->ph_page = storage;
 	ph->ph_nmissing = 0;
 	ph->ph_time = time_uptime;
-	if ((pp->pr_roflags & PR_PHINPAGE) == 0)
+	if (pp->pr_roflags & PR_PHINPAGE)
+		ph->ph_poolid = pp->pr_poolid;
+	else
 		SPLAY_INSERT(phtree, >pr_phtree, ph);
 
 	pp->pr_nidle++;

Index: src/sys/sys/pool.h
diff -u src/sys/sys/pool.h:1.86 src/sys/sys/pool.h:1.87
--- src/sys/sys/pool.h:1.86	Tue Mar 26 18:31:30 2019
+++ src/sys/sys/pool.h	Wed Mar 27 18:27:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pool.h,v 1.86 

CVS commit: src/sys/arch

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 17:15:30 UTC 2019

Modified Files:
src/sys/arch/acorn32/include: vmparam.h
src/sys/arch/amiga/include: vmparam.h
src/sys/arch/arm/include/arm32: vmparam.h
src/sys/arch/atari/include: vmparam.h
src/sys/arch/cats/include: vmparam.h
src/sys/arch/epoc32/include: vmparam.h
src/sys/arch/evbarm/include: vmparam.h
src/sys/arch/hpcarm/include: vmparam.h
src/sys/arch/iyonix/include: vmparam.h
src/sys/arch/shark/include: vmparam.h
src/sys/arch/zaurus/include: vmparam.h

Log Message:
- expose vmparams to userland on arm, like other archs do.
- remove unneeded includes


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/acorn32/include/vmparam.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amiga/include/vmparam.h
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/arm/include/arm32/vmparam.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/cats/include/vmparam.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/epoc32/include/vmparam.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/include/vmparam.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcarm/include/vmparam.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/iyonix/include/vmparam.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/shark/include/vmparam.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/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/acorn32/include/vmparam.h
diff -u src/sys/arch/acorn32/include/vmparam.h:1.27 src/sys/arch/acorn32/include/vmparam.h:1.28
--- src/sys/arch/acorn32/include/vmparam.h:1.27	Thu Nov  2 05:42:44 2017
+++ src/sys/arch/acorn32/include/vmparam.h	Wed Mar 27 13:15:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.27 2017/11/02 09:42:44 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.28 2019/03/27 17:15:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -32,8 +32,6 @@
 #ifndef	_ACORN32_VMPARAM_H_
 #define	_ACORN32_VMPARAM_H_
 
-#if defined(_KERNEL) || defined(_KMEMUSER)
-
 #include 
 
 /*
@@ -83,6 +81,4 @@
 #define	VM_FREELIST_ISADMA	1
 #define VM_FREELIST_RPCDMA	1
 
-#endif /* _KERNEL || _KMEMUSER */
-
 #endif	/* _ACORN32_VMPARAM_H_ */

Index: src/sys/arch/amiga/include/vmparam.h
diff -u src/sys/arch/amiga/include/vmparam.h:1.46 src/sys/arch/amiga/include/vmparam.h:1.47
--- src/sys/arch/amiga/include/vmparam.h:1.46	Wed Sep 30 16:36:28 2015
+++ src/sys/arch/amiga/include/vmparam.h	Wed Mar 27 13:15:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.46 2015/09/30 20:36:28 phx Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.47 2019/03/27 17:15:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -41,8 +41,6 @@
 #ifndef _MACHINE_VMPARAM_H_
 #define _MACHINE_VMPARAM_H_
 
-#include 
-
 /*
  * Machine dependent constants for amiga
  */

Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.42 src/sys/arch/arm/include/arm32/vmparam.h:1.43
--- src/sys/arch/arm/include/arm32/vmparam.h:1.42	Sat Oct 27 09:26:23 2018
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Mar 27 13:15:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.42 2018/10/27 13:26:23 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.43 2019/03/27 17:15:29 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -38,7 +38,6 @@
 #ifndef _ARM_ARM32_VMPARAM_H_
 #define	_ARM_ARM32_VMPARAM_H_
 
-#if defined(_KERNEL) || defined(_KMEMUSER)
 
 /*
  * Virtual Memory parameters common to all arm32 platforms.
@@ -46,7 +45,6 @@
 
 #include 
 #include 
-#include 	/* pt_entry_t */
 
 #define	__USE_TOPDOWN_VM
 #define	USRSTACK	VM_MAXUSER_ADDRESS
@@ -99,6 +97,4 @@
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)
 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) -(PAGE_SIZE+1))
 
-#endif /* _KERNEL || _KMEMUSER */
-
 #endif /* _ARM_ARM32_VMPARAM_H_ */

Index: src/sys/arch/atari/include/vmparam.h
diff -u src/sys/arch/atari/include/vmparam.h:1.32 src/sys/arch/atari/include/vmparam.h:1.33
--- src/sys/arch/atari/include/vmparam.h:1.32	Mon Feb 26 10:11:12 2018
+++ src/sys/arch/atari/include/vmparam.h	Wed Mar 27 13:15:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.32 2018/02/26 15:11:12 tsutsui Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.33 2019/03/27 17:15:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -41,8 +41,6 @@
 #ifndef _MACHINE_VMPARAM_H_
 #define _MACHINE_VMPARAM_H_
 
-#include 
-
 /*
  * Machine dependent constants for atari
  */

Index: src/sys/arch/cats/include/vmparam.h
diff -u src/sys/arch/cats/include/vmparam.h:1.30 src/sys/arch/cats/include/vmparam.h:1.31
--- src/sys/arch/cats/include/vmparam.h:1.30	Thu Nov  2 05:42:44 2017
+++ src/sys/arch/cats/include/vmparam.h	Wed Mar 27 13:15:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.30 2017/11/02 09:42:44 skrll 

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 17:02:20 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
alignment for sh3


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

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3	Wed Mar 27 11:33:52 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 13:02:20 2019
@@ -97,6 +97,9 @@ typedef int malloc_cpuid_t;
 #  if defined(__riscv) || defined(__riscv__)
 #define LG_QUANTUM		4
 #  endif
+#  ifdef __sh3__
+#define LG_QUANTUM		3
+#  endif
 #  ifdef __s390__
 #define LG_QUANTUM		4
 #  endif



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

2019-03-27 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Wed Mar 27 16:38:50 UTC 2019

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

Log Message:
ensure LOSC is configured for external clock


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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_timer.c
diff -u src/sys/arch/arm/sunxi/sunxi_timer.c:1.5 src/sys/arch/arm/sunxi/sunxi_timer.c:1.6
--- src/sys/arch/arm/sunxi/sunxi_timer.c:1.5	Wed Mar 27 06:56:19 2019
+++ src/sys/arch/arm/sunxi/sunxi_timer.c	Wed Mar 27 16:38:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_timer.c,v 1.5 2019/03/27 06:56:19 tnn Exp $ */
+/* $NetBSD: sunxi_timer.c,v 1.6 2019/03/27 16:38:49 tnn Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.5 2019/03/27 06:56:19 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.6 2019/03/27 16:38:49 tnn Exp $");
 
 #include 
 #include 
@@ -78,6 +78,19 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_timer.
 #define	TMR4_INTV_VALUE_REG	0x54
 #define	TMR4_CURNT_VALUE_REG	0x58
 
+/* Control registers */
+#define	AVS_CNT_CTL_REG		0x80
+#define	AVS_CNT0_REG		0x84
+#define	AVS_CNT1_REG		0x88
+#define	AVS_CNT_DIV_REG		0x8c
+#define	WDOG_CTRL_REG		0x90
+#define	WDOG_MODE_REG		0x94
+#define	LOSC_CTRL_REG		0x100
+#define	 LOSC_CTRL_KEY_FIELD	__BITS(31,16)
+#define	 LOSC_CTRL_KEY_FIELD_V	0x16aa
+#define  LOSC_CTRL_OSC32K_AUTO_SWT_EN	__BIT(14)
+#define	 LOSC_CTRL_OSC32K_SEL	__BIT(0)
+
 static const char * const compatible[] = {
 	"allwinner,sun4i-a10-timer",
 	NULL
@@ -179,6 +192,7 @@ sunxi_timer_attach(device_t parent, devi
 	bus_addr_t addr;
 	bus_size_t size;
 	u_int ticks;
+	u_int reg;
 
 	if (fdtbus_get_reg(phandle, 0, , ) != 0) {
 		aprint_error(": couldn't get registers\n");
@@ -238,10 +252,16 @@ sunxi_timer_attach(device_t parent, devi
 	 * LOSC is optional to implement in hardware.
 	 * Make sure it ticks before registering it.
 	 */
+	reg = __SHIFTIN(LOSC_CTRL_KEY_FIELD_V, LOSC_CTRL_KEY_FIELD) |
+	LOSC_CTRL_OSC32K_AUTO_SWT_EN |
+	LOSC_CTRL_OSC32K_SEL;
+	TIMER_WRITE(sc, LOSC_CTRL_REG, reg);
 	ticks = sunxi_timer_get_timecount_losc(tc_losc);
 	delay(100);
 	if (ticks != sunxi_timer_get_timecount_losc(tc_losc))
 		tc_init(tc_losc);
+	else
+		TIMER_WRITE(sc, LOSC_CTRL_REG, reg & ~LOSC_CTRL_OSC32K_SEL);
 
 	/* Use this as the OS timer in UP configurations */
 	if (!arm_has_mpext_p) {



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

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 16:16:43 UTC 2019

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

Log Message:
Provide the (max) defaults for page size for userland.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/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/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.20 src/sys/arch/powerpc/include/vmparam.h:1.21
--- src/sys/arch/powerpc/include/vmparam.h:1.20	Fri Jun 23 17:28:38 2017
+++ src/sys/arch/powerpc/include/vmparam.h	Wed Mar 27 12:16:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.20 2017/06/23 21:28:38 joerg Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.21 2019/03/27 16:16:43 christos Exp $	*/
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -28,15 +28,15 @@
 #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
 round_page((vaddr_t)(da) + (vsize_t)maxdmap)
 
-#if defined(_MODULE) || defined(MODULAR)
 /*
  * If we are a module or a modular kernel, then we need to defined the range
  * of our varible page sizes since BOOKE and OEA use 4KB pages while IBM4XX
  * use 16KB pages.
  */
-#define	MIN_PAGE_SIZE	4096		/* BOOKE/OEA */
-#define	MAX_PAGE_SIZE	16384		/* IBM4XX */
-#endif
+#define MIN_PAGE_SHIFT	12			/* BOOKE/OEA */
+#define MAX_PAGE_SHIFT	14			/* IBM4XX */
+#define	MIN_PAGE_SIZE	(1 << MIN_PAGE_SHIFT)
+#define	MAX_PAGE_SIZE	(1 << MAX_PAGE_SHIFT)
 
 #if defined(_MODULE)
 #if defined(_RUMPKERNEL)
@@ -70,6 +70,10 @@ extern const char __USRSTACK;		/* let th
 #include 
 #elif defined(_KERNEL)
 #error unknown PPC variant
+#else
+#define PAGE_SHIFT  MAX_PAGE_SHIFT
+#define PAGE_SIZE   (1 << PAGE_SHIFT)
+#define PAGE_MASK   (PAGE_SIZE - 1)
 #endif
 
 #endif /* !_MODULE */



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 16:16:14 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal: size_classes.h

Log Message:
add tables for 16K page sizes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.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/bsd/jemalloc/include/jemalloc/internal/size_classes.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h:1.2	Thu Mar 21 05:42:44 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/size_classes.h	Wed Mar 27 12:16:14 2019
@@ -2789,6 +2789,1382 @@
 #define LARGE_MAXCLASS		size_t)1) << 62) + (((size_t)3) << 60))
 #endif
 
+#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 14)
+#define SIZE_CLASSES \
+  /* index, lg_grp, lg_delta, ndelta, psz, bin, pgs, lg_delta_lookup */ \
+SC(  0,  3,3,  0,  no, yes,   1,  3) \
+SC(  1,  3,3,  1,  no, yes,   1,  3) \
+SC(  2,  3,3,  2,  no, yes,   3,  3) \
+SC(  3,  3,3,  3,  no, yes,   1,  3) \
+ \
+SC(  4,  5,3,  1,  no, yes,   5,  3) \
+SC(  5,  5,3,  2,  no, yes,   3,  3) \
+SC(  6,  5,3,  3,  no, yes,   7,  3) \
+SC(  7,  5,3,  4,  no, yes,   1,  3) \
+ \
+SC(  8,  6,4,  1,  no, yes,   5,  4) \
+SC(  9,  6,4,  2,  no, yes,   3,  4) \
+SC( 10,  6,4,  3,  no, yes,   7,  4) \
+SC( 11,  6,4,  4,  no, yes,   1,  4) \
+ \
+SC( 12,  7,5,  1,  no, yes,   5,  5) \
+SC( 13,  7,5,  2,  no, yes,   3,  5) \
+SC( 14,  7,5,  3,  no, yes,   7,  5) \
+SC( 15,  7,5,  4,  no, yes,   1,  5) \
+ \
+SC( 16,  8,6,  1,  no, yes,   5,  6) \
+SC( 17,  8,6,  2,  no, yes,   3,  6) \
+SC( 18,  8,6,  3,  no, yes,   7,  6) \
+SC( 19,  8,6,  4,  no, yes,   1,  6) \
+ \
+SC( 20,  9,7,  1,  no, yes,   5,  7) \
+SC( 21,  9,7,  2,  no, yes,   3,  7) \
+SC( 22,  9,7,  3,  no, yes,   7,  7) \
+SC( 23,  9,7,  4,  no, yes,   1,  7) \
+ \
+SC( 24, 10,8,  1,  no, yes,   5,  8) \
+SC( 25, 10,8,  2,  no, yes,   3,  8) \
+SC( 26, 10,8,  3,  no, yes,   7,  8) \
+SC( 27, 10,8,  4,  no, yes,   1,  8) \
+ \
+SC( 28, 11,9,  1,  no, yes,   5,  9) \
+SC( 29, 11,9,  2,  no, yes,   3,  9) \
+SC( 30, 11,9,  3,  no, yes,   7,  9) \
+SC( 31, 11,9,  4,  no, yes,   1,  9) \
+ \
+SC( 32, 12,   10,  1,  no, yes,   5, no) \
+SC( 33, 12,   10,  2,  no, yes,   3, no) \
+SC( 34, 12,   10,  3,  no, yes,   7, no) \
+SC( 35, 12,   10,  4,  no, yes,   1, no) \
+ \
+SC( 36, 13,   11,  1,  no, yes,   5, no) \
+SC( 37, 13,   11,  2,  no, yes,   3, no) \
+SC( 38, 13,   11,  3,  no, yes,   7, no) \
+SC( 39, 13,   11,  4, yes, yes,   1, no) \
+ \
+SC( 40, 14,   12,  1,  no, yes,   5, no) \
+SC( 41, 14,   12,  2,  no, yes,   3, no) \
+SC( 42, 14,   12,  3,  no, yes,   7, no) \
+SC( 43, 14,   12,  4, yes, yes,   2, no) \
+ \
+SC( 44, 15,   13,  1,  no, yes,   5, no) \
+SC( 45, 15,   13,  2, yes, yes,   3, no) \
+SC( 46, 15,   13,  3,  no, yes,   7, no) \
+SC( 47, 15,   13,  4, yes,  no,   0, no) \
+ \
+SC( 48, 16,   14,  1, yes,  no,   0, no) \
+SC( 49, 16,   14,  2, yes,  no,   0, no) \
+SC( 50, 16,   14,  3, yes,  no,   0, no) \
+SC( 51, 16,  

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 15:33:52 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
vaxinate!


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

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2	Wed Mar 27 08:38:31 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 11:33:52 2019
@@ -110,6 +110,9 @@ typedef int malloc_cpuid_t;
 #  ifdef __le32__
 #define LG_QUANTUM		4
 #  endif
+#  ifdef __vax__
+#define LG_QUANTUM		4
+#  endif
 #  ifndef LG_QUANTUM
 #error "Unknown minimum alignment for architecture; specify via "
 	 "--with-lg-quantum"



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

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 15:30:19 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Handle vax optimizer


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/jemalloc/lib/Makefile.inc

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.6 src/external/bsd/jemalloc/lib/Makefile.inc:1.7
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.6	Tue Mar 12 11:13:25 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Wed Mar 27 11:30:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2019/03/12 15:13:25 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2019/03/27 15:30:19 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -48,6 +48,12 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
+.if ${MACHINE_ARCH} == "vax"
+# in merge_overlapping_regs, at regrename.c
+COPTS.arena.c+=-O0
+COPTS.extent.c+=-O0
+.endif
+
 SRCS+=${JEMALLOC_SRCS}
 
 jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 27 12:38:31 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_types.h

Log Message:
LG_QUANTUM is 4 for both sparc and sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.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/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.1 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.2
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:1.1	Mon Mar  4 17:25:09 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h	Wed Mar 27 12:38:31 2019
@@ -64,7 +64,7 @@ typedef int malloc_cpuid_t;
 #  ifdef __alpha__
 #define LG_QUANTUM		4
 #  endif
-#  if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__))
+#  ifdef __sparc__
 #define LG_QUANTUM		4
 #  endif
 #  if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64))



CVS commit: src/share/mk

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 11:15:55 UTC 2019

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

Log Message:
undo previous, too much breaks.


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

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1115 src/share/mk/bsd.own.mk:1.1116
--- src/share/mk/bsd.own.mk:1.1115	Tue Mar 26 22:51:41 2019
+++ src/share/mk/bsd.own.mk	Wed Mar 27 07:15:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1115 2019/03/27 02:51:41 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1116 2019/03/27 11:15:55 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -172,7 +172,14 @@ EXTERNAL_BINUTILS_SUBDIR=	/does/not/exis
 # What version of jemalloc we use (100 is the one
 # built-in to libc from 2005 (pre version 3).
 #
+.if ${MACHINE_CPU} == "x86_64"	|| \
+${MACHINE_CPU} == "i386"	|| \
+${MACHINE_CPU} == "aarch64"	|| \
+${MACHINE} == "sparc64"
 HAVE_JEMALLOC?=		510
+.else
+HAVE_JEMALLOC?=		100
+.endif
 
 .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)



CVS commit: src/sys/dev/sysmon

2019-03-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Mar 27 09:52:16 UTC 2019

Modified Files:
src/sys/dev/sysmon: swwdog.c

Log Message:
Don't create the driver's workqueue twice!

The driver is modular, so its modcmd(MOULE_CMD_INIT) always gets called
whether or not the driver is built-in to the kernel.  The modcmd init
code always calls swwdogattach() which creates the workqueue.  Therefore
there's no need to also create it in swwdog_attach() (used to attach a
device instance).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sysmon/swwdog.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/sysmon/swwdog.c
diff -u src/sys/dev/sysmon/swwdog.c:1.19 src/sys/dev/sysmon/swwdog.c:1.20
--- src/sys/dev/sysmon/swwdog.c:1.19	Tue May 12 10:20:14 2015
+++ src/sys/dev/sysmon/swwdog.c	Wed Mar 27 09:52:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: swwdog.c,v 1.19 2015/05/12 10:20:14 pgoyette Exp $	*/
+/*	$NetBSD: swwdog.c,v 1.20 2019/03/27 09:52:16 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2004, 2005 Steven M. Bellovin
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.19 2015/05/12 10:20:14 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.20 2019/03/27 09:52:16 pgoyette Exp $");
 
 /*
  *
@@ -160,11 +160,6 @@ swwdog_attach(device_t parent, device_t 
 {
 	struct swwdog_softc *sc = device_private(self);
 
-	if (workqueue_create(, "swwreboot", doreboot, NULL,
-	PRI_NONE, IPL_NONE, 0) != 0) {
-		aprint_error_dev(self, "failed to create reboot workqueue");
-	}
-
 	sc->sc_dev = self;
 	sc->sc_smw.smw_name = device_xname(self);
 	sc->sc_smw.smw_cookie = sc;
@@ -181,7 +176,6 @@ swwdog_attach(device_t parent, device_t 
 		aprint_error_dev(self, "unable to register software "
 		"watchdog with sysmon\n");
 		callout_destroy(>sc_c);
-		workqueue_destroy(wq);
 		return;
 	}
 



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

2019-03-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Mar 27 07:29:29 UTC 2019

Modified Files:
src/sys/arch/arm/pic: picvar.h

Log Message:
enlarge pic_name[] from 14 to 16. bcm2835_intr.c@1.20 used to the limit.
(sizeof struct pic_softc was not changed. it's just same as padding)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/pic/picvar.h

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

Modified files:

Index: src/sys/arch/arm/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.22 src/sys/arch/arm/pic/picvar.h:1.23
--- src/sys/arch/arm/pic/picvar.h:1.22	Fri Nov 16 15:06:22 2018
+++ src/sys/arch/arm/pic/picvar.h	Wed Mar 27 07:29:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: picvar.h,v 1.22 2018/11/16 15:06:22 jmcneill Exp $	*/
+/*	$NetBSD: picvar.h,v 1.23 2019/03/27 07:29:29 ryo Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -149,7 +149,7 @@ struct pic_softc {
 	percpu_t *pic_percpu;
 	uint8_t pic_id;
 	int pic_irqbase;
-	char pic_name[14];
+	char pic_name[16];
 };
 
 struct pic_ops {



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

2019-03-27 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Wed Mar 27 06:56:19 UTC 2019

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

Log Message:
fix wrong counter_mask assignment due to typo in previous


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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_timer.c
diff -u src/sys/arch/arm/sunxi/sunxi_timer.c:1.4 src/sys/arch/arm/sunxi/sunxi_timer.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_timer.c:1.4	Tue Mar 26 23:26:03 2019
+++ src/sys/arch/arm/sunxi/sunxi_timer.c	Wed Mar 27 06:56:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_timer.c,v 1.4 2019/03/26 23:26:03 tnn Exp $ */
+/* $NetBSD: sunxi_timer.c,v 1.5 2019/03/27 06:56:19 tnn Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.4 2019/03/26 23:26:03 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.5 2019/03/27 06:56:19 tnn Exp $");
 
 #include 
 #include 
@@ -229,7 +229,7 @@ sunxi_timer_attach(device_t parent, devi
 	tc->tc_priv = sc;
 	tc_init(tc);
 	tc_losc->tc_get_timecount = sunxi_timer_get_timecount_losc;
-	tc_losc->tc_counter_mask = ~0u,
+	tc_losc->tc_counter_mask = ~0u;
 	tc_losc->tc_frequency = 32768;
 	tc_losc->tc_name = "LOSC";
 	tc_losc->tc_quality = 150;



CVS commit: src/doc

2019-03-27 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Mar 27 06:56:38 UTC 2019

Modified Files:
src/doc: TODO.smpnet

Log Message:
Add another known issue (if_flags)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/doc/TODO.smpnet

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.smpnet
diff -u src/doc/TODO.smpnet:1.28 src/doc/TODO.smpnet:1.29
--- src/doc/TODO.smpnet:1.28	Tue Mar 26 05:17:17 2019
+++ src/doc/TODO.smpnet	Wed Mar 27 06:56:37 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.28 2019/03/26 05:17:17 ozaki-r Exp $
+$NetBSD: TODO.smpnet,v 1.29 2019/03/27 06:56:37 ozaki-r Exp $
 
 MP-safe components
 ==
@@ -229,3 +229,24 @@ One solution of the issue is to reorder 
 first register an address to the hash table then create its routes.  Another
 solution is to use the routing table for the to-self check instead of using the
 global hash table, like IPv6.
+
+if_flags
+
+
+To avoid data race on if_flags it should be protected by a lock (currently it's
+IFNET_LOCK).  Thus, if_flags should not be accessed on packet processing to
+avoid performance degradation by lock contentions.  Traditionally IFF_RUNNING,
+IFF_UP and IFF_OACTIVE flags of if_flags are checked on packet processing.  If
+you make a driver MP-safe you must remove such checks.
+
+IFF_ALLMULTI can be set/unset via if_mcast_op.  To protect updates of the flag,
+we had added IFNET_LOCK around if_mcast_op.  However that was not a good
+approach because if_mcast_op is typically called in the middle of a call path
+and holding IFNET_LOCK such places is problematic.  Actually a deadlock is
+observed.  Probably we should remove IFNET_LOCK and manage IFF_ALLMULTI
+somewhere other than if_flags, for example ethercom or driver itself (or a
+common driver framework once it appears).  Such a change is feasible because
+IFF_ALLMULTI is only set/unset by a driver and not accessed from any common
+components such as network protocols.
+
+Also IFF_PROMISC is checked in ether_input and we should get rid of it somehow.



CVS commit: src/etc

2019-03-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Mar 27 06:55:09 UTC 2019

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
Actually use unit number for iscsi device.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.200 src/etc/MAKEDEV.tmpl:1.201
--- src/etc/MAKEDEV.tmpl:1.200	Tue Mar 26 09:13:55 2019
+++ src/etc/MAKEDEV.tmpl	Wed Mar 27 06:55:09 2019
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.200 2019/03/26 09:13:55 pgoyette Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.201 2019/03/27 06:55:09 mlelstv Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2191,7 +2191,7 @@ zfs)
 
 iscsi[0-9]*)
 	unit=${i#iscsi}
-	mkdev iscsi${unit} c %iscsi_chr% 0 600
+	mkdev iscsi${unit} c %iscsi_chr% $unit 600
 	;;
 
 vchiq)