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

2018-12-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec  8 06:53:11 UTC 2018

Modified Files:
src/sys/arch/evbarm/rpi: rpi_vcmbox.c

Log Message:
Add machdep.cpu.frequency.available node to support estd.

While the RPI can run at many intermediate clock frequencies,
this is sufficient for estd and is known to work with every
firmware revision.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/rpi/rpi_vcmbox.c

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

Modified files:

Index: src/sys/arch/evbarm/rpi/rpi_vcmbox.c
diff -u src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.4 src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.5
--- src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.4	Sat Oct  4 13:18:34 2014
+++ src/sys/arch/evbarm/rpi/rpi_vcmbox.c	Sat Dec  8 06:53:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: rpi_vcmbox.c,v 1.4 2014/10/04 13:18:34 mlelstv Exp $ */
+/* $NetBSD: rpi_vcmbox.c,v 1.5 2018/12/08 06:53:11 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rpi_vcmbox.c,v 1.4 2014/10/04 13:18:34 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_vcmbox.c,v 1.5 2018/12/08 06:53:11 mlelstv Exp $");
 
 #include 
 #include 
@@ -233,6 +233,7 @@ vcmbox_cpufreq_init(struct vcmbox_softc 
 {
 	const struct sysctlnode *node, *cpunode, *freqnode;
 	int error;
+	static char available[20];
 
 	error = vcmbox_read_clockrate(sc, VCPROPTAG_GET_MIN_CLOCKRATE,
 	VCPROP_CLK_ARM, >sc_cpu_minrate);
@@ -297,6 +298,16 @@ vcmbox_cpufreq_init(struct vcmbox_softc 
 		goto sysctl_failed;
 	sc->sc_node_max = node->sysctl_num;
 
+	snprintf(available, sizeof(available), "%" PRIu32 " %" PRIu32,
+	RATE2MHZ(sc->sc_cpu_minrate), RATE2MHZ(sc->sc_cpu_maxrate));
+
+	error = sysctl_createv(>sc_log, 0, , ,
+	CTLFLAG_PERMANENT, CTLTYPE_STRING, "available", NULL,
+	NULL, 0, available, strlen(available),
+	CTL_CREATE, CTL_EOL);
+	if (error)
+		goto sysctl_failed;
+
 	return 0;
 
 sysctl_failed:



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

2018-12-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec  8 06:53:11 UTC 2018

Modified Files:
src/sys/arch/evbarm/rpi: rpi_vcmbox.c

Log Message:
Add machdep.cpu.frequency.available node to support estd.

While the RPI can run at many intermediate clock frequencies,
this is sufficient for estd and is known to work with every
firmware revision.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/rpi/rpi_vcmbox.c

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



CVS commit: src

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Dec  8 01:47:22 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi
src/external/cddl/osnet/usr.bin/ztest: Makefile

Log Message:
Include ztest(1) in builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1629 -r1.1630 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/usr.bin/ztest/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/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1629 src/distrib/sets/lists/man/mi:1.1630
--- src/distrib/sets/lists/man/mi:1.1629	Sat Dec  1 11:17:28 2018
+++ src/distrib/sets/lists/man/mi	Sat Dec  8 01:47:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1629 2018/12/01 11:17:28 jdolecek Exp $
+# $NetBSD: mi,v 1.1630 2018/12/08 01:47:21 sevan Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -653,6 +653,7 @@
 ./usr/share/man/cat1/zless.0			man-util-catman		.cat
 ./usr/share/man/cat1/zmore.0			man-util-catman		.cat
 ./usr/share/man/cat1/znew.0			man-util-catman		.cat
+./usr/share/man/cat1/ztest.0			man-zfs-catman		zfs,.cat
 ./usr/share/man/cat3/atari/ahdi_buildlabel.0	man-obsolete		obsolete
 ./usr/share/man/cat3/atari/ahdi_checklabel.0	man-obsolete		obsolete
 ./usr/share/man/cat3/atari/ahdi_readlabel.0	man-obsolete		obsolete
@@ -3862,6 +3863,7 @@
 ./usr/share/man/html1/zless.html		man-util-htmlman	html
 ./usr/share/man/html1/zmore.html		man-util-htmlman	html
 ./usr/share/man/html1/znew.html			man-util-htmlman	html
+./usr/share/man/html1/ztest.html		man-zfs-htmlman		zfs,html
 ./usr/share/man/html3/libbozohttpd.html		man-sys-htmlman		html
 ./usr/share/man/html3/libunbound.html		man-netutil-htmlman	html,unbound
 ./usr/share/man/html3lua/bozohttpd.html		man-sys-htmlman		html
@@ -6718,6 +6720,7 @@
 ./usr/share/man/man1/xmlwf.1			man-util-man		.man
 ./usr/share/man/man1/xz.1			man-util-man		.man
 ./usr/share/man/man1/xzcat.1			man-util-man		.man
+./usr/share/man/man1/ztest.1			man-zfs-man		zfs,.man
 ./usr/share/man/man1/yes.1			man-util-man		.man
 ./usr/share/man/man1/ypcat.1			man-nis-man		yp,.man
 ./usr/share/man/man1/ypmatch.1			man-nis-man		yp,.man

Index: src/external/cddl/osnet/usr.bin/ztest/Makefile
diff -u src/external/cddl/osnet/usr.bin/ztest/Makefile:1.3 src/external/cddl/osnet/usr.bin/ztest/Makefile:1.4
--- src/external/cddl/osnet/usr.bin/ztest/Makefile:1.3	Thu Oct 30 21:15:13 2014
+++ src/external/cddl/osnet/usr.bin/ztest/Makefile	Sat Dec  8 01:47:21 2018
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2014/10/30 21:15:13 justin Exp $
+#	$NetBSD: Makefile,v 1.4 2018/12/08 01:47:21 sevan Exp $
 
 .include "../../Makefile.zfs"
 
 PROG=	ztest
-MKMAN=	no
+MAN= 	ztest.1
 
 DPADD=	${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} ${LIBPTHREAD} \
 	${LIBZ} ${LIBAVL}



CVS commit: src

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Dec  8 01:47:22 UTC 2018

Modified Files:
src/distrib/sets/lists/man: mi
src/external/cddl/osnet/usr.bin/ztest: Makefile

Log Message:
Include ztest(1) in builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1629 -r1.1630 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/usr.bin/ztest/Makefile

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



CVS commit: src/external/cddl/osnet/usr.bin/ztest

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Dec  8 01:28:27 UTC 2018

Added Files:
src/external/cddl/osnet/usr.bin/ztest: ztest.1

Log Message:
Add a draft manual for ztest(1), based on the comments from zfstest.c (WIP).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/usr.bin/ztest/ztest.1

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

Added files:

Index: src/external/cddl/osnet/usr.bin/ztest/ztest.1
diff -u /dev/null src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.1
--- /dev/null	Sat Dec  8 01:28:27 2018
+++ src/external/cddl/osnet/usr.bin/ztest/ztest.1	Sat Dec  8 01:28:27 2018
@@ -0,0 +1,154 @@
+.\" $NetBSD: ztest.1,v 1.1 2018/12/08 01:28:27 sevan Exp $
+.\"
+.\" Copyright (c) 2018 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Sevan Janiyan 
+.\"
+.\" 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``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 FOUNDATION OR CONTRIBUTORS
+.\" 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.
+.\"/
+.Dd December 8, 2018
+.Dt ZTEST 1
+.Os
+.Sh NAME
+.Nm ztest
+.Nd ZFS stress test utility
+.Sh SYNOPSIS
+.Nm
+.Op Fl vsamrRdtgikpfVETFPBh
+.Sh DESCRIPTION
+The
+.Nm
+utility stress tests the DMU, ZAP, SPA components of ZFS from user space.
+.Pp
+.Nm
+provides a simple routine to test the functionality of a component task.
+These simple routines can then be used to stress test through parallel
+execution.
+Tests are run as child processes of the main process.
+.Pp
+The checksum and compression functions are changed each time a dataset is
+opened to introduce varying combinations of checksum and compression from block
+to block among objects.
+.Pp
+While tests are running, faults are injected into the pool to verify
+self-healing ability.
+.Pp
+To verify that the on-disk consistency is never lost after a crash, child
+processes are killed at random with a SIGKILL signal, after which the parent
+process invokes a new child to run the test again on the same storage pool.
+.Pp
+The main
+.Nm
+process uses an
+.Xr mmap 2
+temporary file to pass information to child processes which allows shared
+memory to survive
+.Xr exec 3
+syscall.
+A copy of the ztest_shared_hdr_t struct containing information on the size and
+number of shared structures in the file is always stored at offset 0 of the
+file.
+.Pp
+For backwards compatibility testing
+.Nm
+can invoke an alternative version of
+.Nm
+after a SIGLKILL using the
+.Fl B
+flag.
+.sp
+The following options are available:
+.sp
+.Fl v
+vdevs (default: 5)
+.sp
+.Fl s
+size of each vdev (default: 256M)
+.sp
+.Fl a
+alignment shift (default: 9) use 0 for random
+.sp
+.Fl m
+mirror copies (default: 2)
+.sp
+.Fl r
+raidz disks (default: 4)
+.sp
+.Fl R
+raidz parity (default: 1)
+.sp
+.Fl d
+datasets (default: 7)
+.sp
+.Fl t
+threads (default: 23)
+.sp
+.Fl g
+gang block threshold (default: 32K)
+.sp
+.Fl i
+init count (default: 1) initialize pool i times
+.sp
+.Fl k
+kill percentage (default: 70%)
+.sp
+.Fl p
+pool name (default: ztest)
+.sp
+.Fl f
+dir (default: /tmp) file directory for vdev files
+.sp
+.Fl V
+verbose (use multiple times to increase verbosity)
+.sp
+.Fl E
+use existing pool instead of creating new one
+.sp
+.Fl T
+time (default: 300 sec) total run time
+.sp
+.Fl F
+freezeloops (default: 50) max loops in
+.Fn spa_freeze
+.sp
+.Fl P
+passtime (default: 60 sec) time per pass
+.sp
+.Fl B
+alt ztest (default: ) alternate ztest path
+.sp
+.Fl h
+(print help)
+.Sh AUTHORS
+This man page was written by
+.An Sevan Janiyan
+.Aq se...@netbsd.org .
+.Sh CAVEATS
+To allow for backward compatibilty testing using older versions of
+.Nm
+the information stored in the
+.Xr 

CVS commit: src/external/cddl/osnet/usr.bin/ztest

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Dec  8 01:28:27 UTC 2018

Added Files:
src/external/cddl/osnet/usr.bin/ztest: ztest.1

Log Message:
Add a draft manual for ztest(1), based on the comments from zfstest.c (WIP).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/usr.bin/ztest/ztest.1

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



CVS commit: src/sys/dev/ic

2018-12-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Dec  7 22:22:12 UTC 2018

Modified Files:
src/sys/dev/ic: ahcisata_core.c ahcisatavar.h

Log Message:
add optional hook for intr establish when active port is attached, export
ahci_intr_port() in form suitable for interrupt hanlder, and probe for GHC
MRSM flag as courtesy for use by the intr hook

towards multi-vector MSI/MSI-X support


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/ahcisatavar.h

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.71 src/sys/dev/ic/ahcisata_core.c:1.72
--- src/sys/dev/ic/ahcisata_core.c:1.71	Tue Nov 20 19:19:21 2018
+++ src/sys/dev/ic/ahcisata_core.c	Fri Dec  7 22:22:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.71 2018/11/20 19:19:21 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.72 2018/12/07 22:22:12 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.71 2018/11/20 19:19:21 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.72 2018/12/07 22:22:12 jdolecek Exp $");
 
 #include 
 #include 
@@ -125,7 +125,6 @@ const struct ata_bustype ahci_ata_bustyp
 	ahci_channel_recover,
 };
 
-static void ahci_intr_port(struct ahci_softc *, struct ahci_channel *);
 static void ahci_setup_port(struct ahci_softc *sc, int i);
 
 static void
@@ -167,6 +166,9 @@ ahci_reset(struct ahci_softc *sc)
 		AHCI_WRITE(sc, AHCI_PI, sc->sc_init_data.ports);
 	}
 
+	/* Check if hardware reverted to single message MSI */
+	sc->sc_ghc_mrsm = ISSET(AHCI_READ(sc, AHCI_GHC), AHCI_GHC_MRSM);
+
 	return 0;
 }
 
@@ -372,6 +374,14 @@ ahci_attach(struct ahci_softc *sc)
 			AHCINAME(sc));
 			break;
 		}
+
+		/* Optional intr establish per active port */
+		if (sc->sc_intr_establish && sc->sc_intr_establish(sc, i) != 0){
+			aprint_error("%s: intr establish hook failed\n",
+			AHCINAME(sc));
+			break;
+		}
+
 		achp = >sc_channels[i];
 		chp = >ata_channel;
 		sc->sc_chanarray[i] = chp;
@@ -581,16 +591,19 @@ ahci_intr(void *v)
 		AHCI_WRITE(sc, AHCI_IS, is);
 		for (i = 0; i < AHCI_MAX_PORTS; i++)
 			if (is & (1U << i))
-ahci_intr_port(sc, >sc_channels[i]);
+ahci_intr_port(>sc_channels[i]);
 	}
+
 	return r;
 }
 
-static void
-ahci_intr_port(struct ahci_softc *sc, struct ahci_channel *achp)
+int
+ahci_intr_port(void *v)
 {
-	uint32_t is, tfd, sact;
+	struct ahci_channel *achp = v;
 	struct ata_channel *chp = >ata_channel;
+	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
+	uint32_t is, tfd, sact;
 	struct ata_xfer *xfer;
 	int slot = -1;
 	bool recover = false;
@@ -703,6 +716,8 @@ ahci_intr_port(struct ahci_softc *sc, st
 		ata_thread_run(chp, 0, ATACH_TH_RECOVERY, tfd); 
 		ata_channel_unlock(chp);
 	}
+
+	return 1;
 }
 
 static void
@@ -1167,7 +1182,7 @@ ahci_cmd_poll(struct ata_channel *chp, s
 		if (xfer->c_ata_c.flags & AT_DONE)
 			break;
 		ata_channel_unlock(chp);
-		ahci_intr_port(sc, achp);
+		ahci_intr_port(achp);
 		ata_channel_lock(chp);
 		ata_delay(chp, 10, "ahcipl", xfer->c_ata_c.flags);
 	}
@@ -1410,7 +1425,7 @@ ahci_bio_poll(struct ata_channel *chp, s
 	for (int i = 0; i < ATA_DELAY * 10; i++) {
 		if (xfer->c_bio.flags & ATA_ITSDONE)
 			break;
-		ahci_intr_port(sc, achp);
+		ahci_intr_port(achp);
 		delay(100);
 	}
 	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel, 
@@ -1907,7 +1922,7 @@ ahci_atapi_poll(struct ata_channel *chp,
 	for (int i = 0; i < ATA_DELAY / 10; i++) {
 		if (xfer->c_scsipi->xs_status & XS_STS_DONE)
 			break;
-		ahci_intr_port(sc, achp);
+		ahci_intr_port(achp);
 		delay(1);
 	}
 	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel, 

Index: src/sys/dev/ic/ahcisatavar.h
diff -u src/sys/dev/ic/ahcisatavar.h:1.20 src/sys/dev/ic/ahcisatavar.h:1.21
--- src/sys/dev/ic/ahcisatavar.h:1.20	Wed Oct 24 19:38:00 2018
+++ src/sys/dev/ic/ahcisatavar.h	Fri Dec  7 22:22:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatavar.h,v 1.20 2018/10/24 19:38:00 jdolecek Exp $	*/
+/*	$NetBSD: ahcisatavar.h,v 1.21 2018/12/07 22:22:12 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -86,7 +86,9 @@ struct ahci_softc {
 
 	void	(*sc_channel_start)(struct ahci_softc *, struct ata_channel *);
 	void	(*sc_channel_stop)(struct ahci_softc *, struct ata_channel *);
+	int	(*sc_intr_establish)(struct ahci_softc *, int);
 
+	bool sc_ghc_mrsm;
 	bool sc_save_init_data;
 	struct {
 		uint32_t cap;
@@ -121,4 +123,5 @@ void ahci_childdetached(struct ahci_soft
 void ahci_resume(struct ahci_softc *);
 
 int  ahci_intr(void *);
+int  ahci_intr_port(void *);
 



CVS commit: src/sys/dev/ic

2018-12-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Dec  7 22:22:12 UTC 2018

Modified Files:
src/sys/dev/ic: ahcisata_core.c ahcisatavar.h

Log Message:
add optional hook for intr establish when active port is attached, export
ahci_intr_port() in form suitable for interrupt hanlder, and probe for GHC
MRSM flag as courtesy for use by the intr hook

towards multi-vector MSI/MSI-X support


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/ahcisatavar.h

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



CVS commit: src/doc

2018-12-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Dec  7 21:28:03 UTC 2018

Added Files:
src/doc: TODO.ext2fs

Log Message:
save some notes from my two years old hacking on ext3/ext4 support with
our ext2fs


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/doc/TODO.ext2fs

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

Added files:

Index: src/doc/TODO.ext2fs
diff -u /dev/null src/doc/TODO.ext2fs:1.1
--- /dev/null	Fri Dec  7 21:28:03 2018
+++ src/doc/TODO.ext2fs	Fri Dec  7 21:28:03 2018
@@ -0,0 +1,27 @@
+newfs_ext2fs support for EXTRA_ISIZE - not yet
+
+bunch of bin ext2 bugs - fsck_ext2fs et.al.
+
+64bit support meta data support - maybe only affects dirs and raises
+  limit on max.filesystem?
+
+fix ext4.wiki - h_reserved[2] should actually be h_reserved[3] according
+  to ext4 code
+
+xattr - dont forget refcount handling , with hash map (same as linux)
+- use roundup2() instead of custom macros
+
+EXTENTS:
+check if the inode_ext extents cache is actually used
+
+optimalization - on sync, only overwrite changed cgs? adv for bigger
+filesystems
+
+remove dup e2fs_mnton from m_fs
+
+maybe return limit to 32000 links for !DIR_NLINK fs (cross-check what Linux
+ext4 code)
+
+QUOTA support ?
+
+INODE_DATA support? (even linux is dev only)



CVS commit: src/doc

2018-12-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Dec  7 21:28:03 UTC 2018

Added Files:
src/doc: TODO.ext2fs

Log Message:
save some notes from my two years old hacking on ext3/ext4 support with
our ext2fs


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/doc/TODO.ext2fs

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



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:41:30 UTC 2018

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

Log Message:
Annotate ticket #1129 for furhter fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.70 src/doc/CHANGES-8.1:1.1.2.71
--- src/doc/CHANGES-8.1:1.1.2.70	Fri Dec  7 17:13:56 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 19:41:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.70 2018/12/07 17:13:56 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.71 2018/12/07 19:41:30 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1995,10 +1995,11 @@ share/man/man4/Makefile1.673 (patch)
 share/man/man4/mfii.41.1,1.2
 sys/arch/amd64/conf/ALL1.108
 sys/arch/amd64/conf/GENERIC			1.508
-sys/arch/amd64/conf/XEN3_DOM0			1.159 (patch)
+sys/arch/amd64/conf/XEN3_DOM0			1.159
 sys/arch/i386/conf/ALL1.458
 sys/arch/i386/conf/GENERIC			1.1194
-sys/arch/i386/conf/XEN3PAE_DOM0			1.8
+sys/arch/i386/conf/XEN3PAE_DOM0			1.8 (via patch, applied to
+		 XEN3_DOM0)
 sys/dev/ic/mfi.c1.60
 sys/dev/ic/mfireg.h1.9
 sys/dev/pci/files.pci1.410



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:41:30 UTC 2018

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

Log Message:
Annotate ticket #1129 for furhter fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-8.1

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



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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:38:54 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-8]: XEN3_DOM0

Log Message:
Fixup pullups from ticket #1129:

sys/arch/amd64/conf/XEN3_DOM0 rev 1.159
src/sys/arch/i386/conf/XEN3PAE_DOM0 rev 1.8 (via patch)

Add mffii(4)


To generate a diff of this commit:
cvs rdiff -u -r1.135.4.7 -r1.135.4.8 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.112.4.8 -r1.112.4.9 src/sys/arch/i386/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.7 src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.8
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.135.4.7	Wed Apr 18 14:45:08 2018
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Fri Dec  7 19:38:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.135.4.7 2018/04/18 14:45:08 martin Exp $
+# $NetBSD: XEN3_DOM0,v 1.135.4.8 2018/12/07 19:38:53 martin Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -519,6 +519,7 @@ dpt*	at pci? dev ? function ?	# DPT Smar
 iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
 isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
 mfi*	at pci? dev ? function ?	# LSI MegaRAID SAS
+mfii*	at pci? dev ? function ?	# LSI MegaRAID SAS (Fusion and newer)
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSILogic 9x9 and 53c1030 (Fusion-MPT)
 mpii*	at pci? dev ? function ?	# LSI Logic Fusion-MPT II

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.8 src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.9
--- src/sys/arch/i386/conf/XEN3_DOM0:1.112.4.8	Wed Apr 18 14:45:08 2018
+++ src/sys/arch/i386/conf/XEN3_DOM0	Fri Dec  7 19:38:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.112.4.8 2018/04/18 14:45:08 martin Exp $
+#	$NetBSD: XEN3_DOM0,v 1.112.4.9 2018/12/07 19:38:53 martin Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -492,6 +492,7 @@ dpt*	at pci? dev ? function ?	# DPT Smar
 iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
 isp*	at pci? dev ? function ?	# Qlogic ISP [12]0x0 SCSI/FibreChannel
 mfi*	at pci? dev ? function ?	# LSI MegaRAID SAS
+mfii*	at pci? dev ? function ?	# LSI MegaRAID SAS (Fusion and newer)
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSILogic 9x9 and 53c1030 (Fusion-MPT)
 mpii*	at pci? dev ? function ?	# LSI Logic Fusion-MPT II



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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 19:38:54 UTC 2018

Modified Files:
src/sys/arch/amd64/conf [netbsd-8]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-8]: XEN3_DOM0

Log Message:
Fixup pullups from ticket #1129:

sys/arch/amd64/conf/XEN3_DOM0 rev 1.159
src/sys/arch/i386/conf/XEN3PAE_DOM0 rev 1.8 (via patch)

Add mffii(4)


To generate a diff of this commit:
cvs rdiff -u -r1.135.4.7 -r1.135.4.8 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.112.4.8 -r1.112.4.9 src/sys/arch/i386/conf/XEN3_DOM0

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



CVS commit: src/sys/sys

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 19:01:11 UTC 2018

Modified Files:
src/sys/sys: termios.h

Log Message:
Add speeds B50 to B400 in increments of 50.

Motivated by picocom checking for the existance of these at compile
time, and therefor previously not being able able to use picocom to
access the consoles of modern Rockchip SoCs (for example RK3399) running
at B150.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/termios.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/sys/termios.h
diff -u src/sys/sys/termios.h:1.35 src/sys/sys/termios.h:1.36
--- src/sys/sys/termios.h:1.35	Fri Dec  7 18:45:13 2018
+++ src/sys/sys/termios.h	Fri Dec  7 19:01:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: termios.h,v 1.35 2018/12/07 18:45:13 jakllsch Exp $	*/
+/*	$NetBSD: termios.h,v 1.36 2018/12/07 19:01:11 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1993, 1994
@@ -237,7 +237,15 @@ struct termios {
 #define B115200 	115200U
 #define B230400 	230400U
 #define B460800 	460800U
+#define B50 	50U
 #define B921600 	921600U
+#define B100	100U
+#define B150	150U
+#define B200	200U
+#define B250	250U
+#define B300	300U
+#define B350	350U
+#define B400	400U
 #define EXTA		19200U
 #define EXTB		38400U
 #endif  /* defined(_NETBSD_SOURCE) */



CVS commit: src/sys/sys

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 19:01:11 UTC 2018

Modified Files:
src/sys/sys: termios.h

Log Message:
Add speeds B50 to B400 in increments of 50.

Motivated by picocom checking for the existance of these at compile
time, and therefor previously not being able able to use picocom to
access the consoles of modern Rockchip SoCs (for example RK3399) running
at B150.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/termios.h

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



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

2018-12-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec  7 18:46:28 UTC 2018

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

Log Message:
add simple stack overflow checker for debugging


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/trap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.11 src/sys/arch/aarch64/aarch64/trap.c:1.12
--- src/sys/arch/aarch64/aarch64/trap.c:1.11	Fri Oct 12 01:28:57 2018
+++ src/sys/arch/aarch64/aarch64/trap.c	Fri Dec  7 18:46:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.11 2018/10/12 01:28:57 ryo Exp $ */
+/* $NetBSD: trap.c,v 1.12 2018/12/07 18:46:27 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.11 2018/10/12 01:28:57 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.12 2018/12/07 18:46:27 ryo Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -296,6 +296,15 @@ interrupt(struct trapframe *tf)
 {
 	struct cpu_info * const ci = curcpu();
 
+#ifdef STACKCHECKS
+	struct lwp *l = curlwp;
+	void *sp = (void *)reg_sp_read();
+	if (l->l_addr >= sp) {
+		panic("lwp/interrupt stack overflow detected."
+		" lwp=%p, sp=%p, l_addr=%p", l, sp, l->l_addr);
+	}
+#endif
+
 	/* enable traps */
 	daif_enable(DAIF_D|DAIF_A);
 



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

2018-12-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec  7 18:46:28 UTC 2018

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

Log Message:
add simple stack overflow checker for debugging


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/trap.c

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



CVS commit: src/sys/sys

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 18:45:13 UTC 2018

Modified Files:
src/sys/sys: termios.h

Log Message:
reindent "standard speeds" in preparation for 7-digit bauds


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/termios.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/sys/termios.h
diff -u src/sys/sys/termios.h:1.34 src/sys/sys/termios.h:1.35
--- src/sys/sys/termios.h:1.34	Wed Oct 25 06:32:59 2017
+++ src/sys/sys/termios.h	Fri Dec  7 18:45:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: termios.h,v 1.34 2017/10/25 06:32:59 kre Exp $	*/
+/*	$NetBSD: termios.h,v 1.35 2018/12/07 18:45:13 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1993, 1994
@@ -212,34 +212,34 @@ struct termios {
 /*
  * Standard speeds
  */
-#define B0	0U
-#define B50	50U
-#define B75	75U
-#define B110	110U
-#define B134	134U
-#define B150	150U
-#define B200	200U
-#define B300	300U
-#define B600	600U
-#define B1200	1200U
-#define	B1800	1800U
-#define B2400	2400U
-#define B4800	4800U
-#define B9600	9600U
-#define B19200	19200U
-#define B38400	38400U
-#if defined(_NETBSD_SOURCE)
-#define B7200	7200U
-#define B14400	14400U
-#define B28800	28800U
-#define B57600	57600U
-#define B76800	76800U
-#define B115200	115200U
-#define B230400	230400U
-#define B460800	460800U
-#define B921600	921600U
-#define EXTA	19200U
-#define EXTB	38400U
+#define B0		0U
+#define B50		50U
+#define B75		75U
+#define B110		110U
+#define B134		134U
+#define B150		150U
+#define B200		200U
+#define B300		300U
+#define B600		600U
+#define B1200		1200U
+#define B1800		1800U
+#define B2400		2400U
+#define B4800		4800U
+#define B9600		9600U
+#define B19200		19200U
+#define B38400		38400U
+#if defined(_NETBSD_SOURCE)
+#define B7200		7200U
+#define B14400		14400U
+#define B28800		28800U
+#define B57600		57600U
+#define B76800		76800U
+#define B115200 	115200U
+#define B230400 	230400U
+#define B460800 	460800U
+#define B921600 	921600U
+#define EXTA		19200U
+#define EXTB		38400U
 #endif  /* defined(_NETBSD_SOURCE) */
 
 #ifndef _KERNEL



CVS commit: src/sys/sys

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 18:45:13 UTC 2018

Modified Files:
src/sys/sys: termios.h

Log Message:
reindent "standard speeds" in preparation for 7-digit bauds


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/termios.h

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



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

2018-12-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec  7 18:27:03 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S

Log Message:
modifying curlwp->l_md_ktf, curlwp->l_md_cpacr, and curlwp should be protected 
by a critical section.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/cpuswitch.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.6 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.7
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.6	Thu Nov  8 08:28:07 2018
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Fri Dec  7 18:27:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.6 2018/11/08 08:28:07 maxv Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.7 2018/12/07 18:27:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_ddb.h"
 #include "opt_kasan.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.6 2018/11/08 08:28:07 maxv Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.7 2018/12/07 18:27:03 ryo Exp $")
 
 /*
  * At IPL_SCHED:
@@ -76,6 +76,7 @@ ENTRY_NP(cpu_switchto)
 	/* We are done with the old lwp */
 
 .Lrestore_lwp:
+	DISABLE_INTERRUPT
 #if L_MD_KTF + 8 == L_MD_CPACR
 	ldp	x4, x5, [x1, #L_MD_KTF]	/* get trapframe ptr and cpacr_el1 */
 #else
@@ -87,6 +88,7 @@ ENTRY_NP(cpu_switchto)
 
 	mrs	x3, tpidr_el1
 	str	x1, [x3, #CI_CURLWP]	/* switch curlwp to new lwp */
+	ENABLE_INTERRUPT
 
 	/*
 	 * Restore callee save registers.



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

2018-12-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec  7 18:27:03 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S

Log Message:
modifying curlwp->l_md_ktf, curlwp->l_md_cpacr, and curlwp should be protected 
by a critical section.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/cpuswitch.S

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



CVS commit: src/share/misc

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec  7 17:58:29 UTC 2018

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

Log Message:
Continuing with ZFS


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/share/misc/acronyms.comp

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



CVS commit: src/share/misc

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec  7 17:58:29 UTC 2018

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

Log Message:
Continuing with ZFS


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.220 src/share/misc/acronyms.comp:1.221
--- src/share/misc/acronyms.comp:1.220	Fri Dec  7 16:36:30 2018
+++ src/share/misc/acronyms.comp	Fri Dec  7 17:58:29 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.220 2018/12/07 16:36:30 sevan Exp $
+$NetBSD: acronyms.comp,v 1.221 2018/12/07 17:58:29 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1454,6 +1454,7 @@ TTM	translation table maps
 TTY	teletype
 TUI	{terminal,text-based,textual} user interface
 TX	{transmit out,transmitter}
+TXG	transaction group
 TZ	time zone
 UAC	user {access,account} control
 UAF	use-after-free



CVS commit: src/doc

2018-12-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Dec  7 17:57:22 UTC 2018

Modified Files:
src/doc: TODO.sanitizers

Log Message:
Add new entry in TODO.sanitizers for NetBSD tar(1) enhancement request

Added:
 - NetBSD tar: handle character escaping in file names (\\ \), needed in
   check-lld (lld::reproduce-backslash.s)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/doc/TODO.sanitizers

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



CVS commit: src/doc

2018-12-07 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Dec  7 17:57:22 UTC 2018

Modified Files:
src/doc: TODO.sanitizers

Log Message:
Add new entry in TODO.sanitizers for NetBSD tar(1) enhancement request

Added:
 - NetBSD tar: handle character escaping in file names (\\ \), needed in
   check-lld (lld::reproduce-backslash.s)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/doc/TODO.sanitizers

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.sanitizers
diff -u src/doc/TODO.sanitizers:1.8 src/doc/TODO.sanitizers:1.9
--- src/doc/TODO.sanitizers:1.8	Tue Dec  4 18:39:03 2018
+++ src/doc/TODO.sanitizers	Fri Dec  7 17:57:22 2018
@@ -41,6 +41,9 @@ Long term:
  - oom-killer ATF tests and fixes
  - uvm_map.c E2BIG workaround or limit raise (1MB -> 10MB?), needed by libFuzzer
  - utime(3) allow changing actime regardless of noatime mount property
+ - NetBSD tar: handle character escaping in file names (\\ \), needed in
+   check-lld (lld::reproduce-backslash.s)
+
 
 Unspecified:
  - kernel-tsan? upstream development is stalled with patches for Linux 4.2



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

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 17:56:42 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic_v2m.c

Log Message:
fix a paste-o in a panic message


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/cortex/gic_v2m.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/cortex/gic_v2m.c
diff -u src/sys/arch/arm/cortex/gic_v2m.c:1.4 src/sys/arch/arm/cortex/gic_v2m.c:1.5
--- src/sys/arch/arm/cortex/gic_v2m.c:1.4	Fri Nov 16 15:06:21 2018
+++ src/sys/arch/arm/cortex/gic_v2m.c	Fri Dec  7 17:56:41 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_v2m.c,v 1.4 2018/11/16 15:06:21 jmcneill Exp $ */
+/* $NetBSD: gic_v2m.c,v 1.5 2018/12/07 17:56:41 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.4 2018/11/16 15:06:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.5 2018/12/07 17:56:41 jakllsch Exp $");
 
 #include 
 #include 
@@ -128,7 +128,7 @@ gic_v2m_msi_disable(struct gic_v2m_frame
 	int off;
 
 	if (!pci_get_capability(pc, tag, PCI_CAP_MSI, , NULL))
-		panic("gic_v2m_msi_enable: device is not MSI-capable");
+		panic("gic_v2m_msi_disable: device is not MSI-capable");
 
 	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
 	ctl &= ~PCI_MSI_CTL_MSI_ENABLE;



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

2018-12-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec  7 17:56:42 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic_v2m.c

Log Message:
fix a paste-o in a panic message


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/cortex/gic_v2m.c

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



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 17:13:56 UTC 2018

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

Log Message:
Ticket #1129


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.69 src/doc/CHANGES-8.1:1.1.2.70
--- src/doc/CHANGES-8.1:1.1.2.69	Fri Dec  7 13:28:53 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 17:13:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.69 2018/12/07 13:28:53 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.70 2018/12/07 17:13:56 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1990,3 +1990,25 @@ sys/dev/pci/pcivar.h1.113
 	area when suspending and restore them on resume.
 	[msaitoh, ticket #1128]
 
+distrib/sets/lists/man/mi			1.1628
+share/man/man4/Makefile1.673 (patch)
+share/man/man4/mfii.41.1,1.2
+sys/arch/amd64/conf/ALL1.108
+sys/arch/amd64/conf/GENERIC			1.508
+sys/arch/amd64/conf/XEN3_DOM0			1.159 (patch)
+sys/arch/i386/conf/ALL1.458
+sys/arch/i386/conf/GENERIC			1.1194
+sys/arch/i386/conf/XEN3PAE_DOM0			1.8
+sys/dev/ic/mfi.c1.60
+sys/dev/ic/mfireg.h1.9
+sys/dev/pci/files.pci1.410
+sys/dev/pci/mfii.c1.1,1.2 (adjusted)
+sys/dev/pci/mpii.c1.13
+sys/dev/pci/mpiireg.h1.1
+
+	Add mpii(4), a driver for LSI Megaraid Fusion controllers.
+	Ported from OpenBSD.  Note that the earlier fusion controllers
+	(Megaraid 2208, codenamed Thunderbold) are also supported by mfi(4).
+	mpii(4) will take precedence if both drivers are enabled.
+	[bouyer, ticket #1129]
+



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 17:13:56 UTC 2018

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

Log Message:
Ticket #1129


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-8.1

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



CVS commit: [netbsd-8] src

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 17:11:38 UTC 2018

Modified Files:
src/distrib/sets/lists/man [netbsd-8]: mi
src/share/man/man4 [netbsd-8]: Makefile
src/sys/arch/amd64/conf [netbsd-8]: ALL GENERIC
src/sys/arch/i386/conf [netbsd-8]: ALL GENERIC
src/sys/dev/ic [netbsd-8]: mfi.c mfireg.h
src/sys/dev/pci [netbsd-8]: files.pci mpii.c
Added Files:
src/share/man/man4 [netbsd-8]: mfii.4
src/sys/dev/pci [netbsd-8]: mfii.c mpiireg.h

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1129):

sys/arch/amd64/conf/XEN3_DOM0: revision 1.159
sys/arch/amd64/conf/GENERIC: revision 1.508
sys/arch/i386/conf/ALL: revision 1.458
sys/dev/ic/mfi.c: revision 1.60
sys/dev/pci/mpiireg.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1628
sys/dev/pci/mfii.c: revision 1.1,1.2 (adapted)
sys/arch/i386/conf/GENERIC: revision 1.1194
sys/dev/pci/mpii.c: revision 1.13
sys/dev/ic/mfireg.h: revision 1.9
share/man/man4/mfii.4: revision 1.1
share/man/man4/Makefile: revision 1.673 (patch)
sys/dev/pci/files.pci: revision 1.410
share/man/man4/mfii.4: revision 1.2
sys/arch/amd64/conf/ALL: revision 1.108
sys/arch/i386/conf/XEN3PAE_DOM0: revision 1.8 (patch, in XEN3_DOM0)

Add some definitions from OpenBSD, needed by the upcoming mfii driver.
No functionnal change.

 -

Move registers definitions to a separate file, needed for the upcomning mpii
driver. No functionnal change.

 -

Add mpii(4), a driver for LSI Megaraid Fusion controllers.
Ported from OpenBSD. This driver is MP-safe.

Note that the earlier fusion controllers (Megaraid 2208, codenamed Thunderbold)
are also supported by mfi(4). mpii will take precedence if both drivers
are enabled.

Tested on a
mfii0 at pci6 dev 0 function 0: "PERC H740P Adapter ", firmware 50.3.0-1512, 819
2MB cache
mfii0: interrupting at ioapic2 pin 2
scsibus0 at mfii0: 64 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0:  disk fixed
sd0: fabricating a geometry
sd0: 99 GB, 102399 cyl, 64 head, 32 sec, 512 bytes/sect x 209714688 sectors
sd0: tagged queueing
sd1 at scsibus0 target 1 lun 0:  disk fixed
sd1: fabricating a geometry
sd1: 22254 GB, 22788608 cyl, 64 head, 32 sec, 512 bytes/sect x 46671069696 
sectors
sd1: fabricating a geometry

It supports bioctl(8) ioctls, as well as sensors for the BBU and logical
drives.

Sponsored by LIP6.

 -

Add my name in copyright list

 -

add a man page for the new mpii, mostly from OpenBSD.

 -

Sort SEE ALSO. Fix date. Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1557.2.6 -r1.1557.2.7 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.637.2.3 -r1.637.2.4 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.2.4.2 src/share/man/man4/mfii.4
cvs rdiff -u -r1.59.2.5 -r1.59.2.6 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.459.2.12 -r1.459.2.13 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.419.2.3 -r1.419.2.4 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1156.2.12 -r1.1156.2.13 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.57 -r1.57.10.1 src/sys/dev/ic/mfi.c
cvs rdiff -u -r1.8 -r1.8.30.1 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.388.4.3 -r1.388.4.4 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.3.2.2 src/sys/dev/pci/mfii.c
cvs rdiff -u -r1.8.10.1 -r1.8.10.2 src/sys/dev/pci/mpii.c
cvs rdiff -u -r0 -r1.2.2.2 src/sys/dev/pci/mpiireg.h

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



Re: CVS commit: src/sys/arch/x86

2018-12-07 Thread Maxime Villard

Le 07/12/2018 à 17:29, Jaromír Doleček a écrit :

Maybe I missed something earlier - does KASLR being enabled by default
mean that x86 now doesn't any more use the direct map to copy memory
pages?


No. The direct map is still there and still used, the only thing is that
its location is randomized.

You are probably confusing with KASAN, which indeed doesn't have a
direct map, for specific reasons.

In all cases, GENERIC stays with a direct map.


CVS commit: src/share/misc

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec  7 16:36:30 UTC 2018

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

Log Message:
Add some ZFS related acronyms.
While here, replace spaces with a tab for ZFS entry.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.219 src/share/misc/acronyms.comp:1.220
--- src/share/misc/acronyms.comp:1.219	Thu Dec  6 14:22:48 2018
+++ src/share/misc/acronyms.comp	Fri Dec  7 16:36:30 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.219 2018/12/06 14:22:48 ginsbach Exp $
+$NetBSD: acronyms.comp,v 1.220 2018/12/07 16:36:30 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -367,6 +367,7 @@ DMA	direct memory access
 DMI	desktop management interface
 DMS	document management system
 DMT	discrete multitone modulation
+DMU	data management layer
 DNARD	Digital network appliance reference design
 DND	drag and drop
 DNS	Domain Name System
@@ -396,6 +397,7 @@ DSA	digital signature algorithm
 DSAP	destination service access point
 DSB	double-sideband modulation
 DSDT	differentiated system descriptor table
+DSL	dataset and snapshot layer
 DSL	digital subscriber line
 DSL	domain specific language
 DSLAM	digital subscriber line access multiplexer
@@ -1330,6 +1332,7 @@ SOHO	small office/home office
 SOL	serial over LAN
 SP	service pack
 SP	stack pointer
+SPA	storage pool allocator
 SPARC	scalable processor architecture
 SPARQL	SPARQL Protocol and RDF Query Language
 SPD	security policy database
@@ -1583,9 +1586,13 @@ YANG	yet another next generation
 YAWPFAPR	you are welcome; please file a problem report
 YP	Yellow Pages
 YTD	year to date
+ZAP	ZFS attribute processor
 ZBR	zone bit recording
 ZFOD	zero-filled on demand
-ZFSzettabyte file system
+ZFS	zettabyte file system
 ZIF	zero insertion force
 ZIFS	zero insertion force socket
+ZIL	ZFS intent log
 ZMA	zone multicast address
+ZPL	ZFS Posix layer
+ZVOL	ZFS Volume



CVS commit: src/share/misc

2018-12-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Dec  7 16:36:30 UTC 2018

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

Log Message:
Add some ZFS related acronyms.
While here, replace spaces with a tab for ZFS entry.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/share/misc/acronyms.comp

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



Re: CVS commit: src/sys/arch/x86

2018-12-07 Thread Jaromír Doleček
Maybe I missed something earlier - does KASLR being enabled by default
mean that x86 now doesn't any more use the direct map to copy memory
pages?

Jaromir
Le ven. 7 déc. 2018 à 16:47, Maxime Villard  a écrit :
>
> Module Name:src
> Committed By:   maxv
> Date:   Fri Dec  7 15:47:11 UTC 2018
>
> Modified Files:
> src/sys/arch/x86/conf: files.x86
> src/sys/arch/x86/x86: pmap.c
>
> Log Message:
> Add an option to have a static kernel memory layout. This option is
> disabled by default - that is to say, KASLR remains enabled by default.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/conf/files.x86
> cvs rdiff -u -r1.312 -r1.313 src/sys/arch/x86/x86/pmap.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>


Re: CVS commit: src/sys/kern

2018-12-07 Thread Maxime Villard

Le 07/12/2018 à 12:33, Manuel Bouyer a écrit :

On Thu, Dec 06, 2018 at 06:43:52PM +0100, Maxime Villard wrote:

Le 06/12/2018 à 11:06, Manuel Bouyer a écrit :

as I understand KASLR (but I didn't look at the code), addresses are choosen
at random. So I guess there's a random number generator in the process.
Maybe it would be as simple as making the random number generator return
a constant value ?


Yes, change the two calls to cpu_earlyrng() in x86/pmap.c::slotspace_rand()
to return zero, and you're back with a static layout.


This looks like an easy option to add


Yes, it's easier than in my initial implementation, and I've committed
the option.


CVS commit: src/sys/arch/x86

2018-12-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Dec  7 15:47:11 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86
src/sys/arch/x86/x86: pmap.c

Log Message:
Add an option to have a static kernel memory layout. This option is
disabled by default - that is to say, KASLR remains enabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/x86/x86/pmap.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/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.103 src/sys/arch/x86/conf/files.x86:1.104
--- src/sys/arch/x86/conf/files.x86:1.103	Mon Jul 16 06:18:31 2018
+++ src/sys/arch/x86/conf/files.x86	Fri Dec  7 15:47:11 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.103 2018/07/16 06:18:31 maxv Exp $
+#	$NetBSD: files.x86,v 1.104 2018/12/07 15:47:11 maxv Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI
@@ -17,6 +17,9 @@ defflag opt_pcifixup.h	PCI_ADDR_FIXUP PC
 # To be able to test for NetBSD/xen in shared files
 defflag	opt_xen.h		DO_NOT_DEFINE
 
+# Option to have a static kernel memory layout
+defflag opt_kaslr.h	NO_X86_ASLR
+
 defflag	SVS
 
 define  cpubus { [apid = -1] }

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.312 src/sys/arch/x86/x86/pmap.c:1.313
--- src/sys/arch/x86/x86/pmap.c:1.312	Mon Nov 19 20:44:51 2018
+++ src/sys/arch/x86/x86/pmap.c	Fri Dec  7 15:47:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.312 2018/11/19 20:44:51 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.313 2018/12/07 15:47:11 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.312 2018/11/19 20:44:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.313 2018/12/07 15:47:11 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -138,6 +138,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3
 #include "opt_xen.h"
 #include "opt_svs.h"
 #include "opt_kasan.h"
+#include "opt_kaslr.h"
 
 #include 
 #include 
@@ -1360,6 +1361,9 @@ slotspace_rand(int type, size_t sz, size
 
 	/* Select a hole. */
 	cpu_earlyrng(, sizeof(hole));
+#ifdef NO_X86_ASLR
+	hole = 0;
+#endif
 	hole %= nholes;
 	startsl = holes[hole].start;
 	endsl = holes[hole].end;
@@ -1367,6 +1371,9 @@ slotspace_rand(int type, size_t sz, size
 
 	/* Select an area within the hole. */
 	cpu_earlyrng(, sizeof(va));
+#ifdef NO_X86_ASLR
+	va = 0;
+#endif
 	winsize = ((endsl - startsl) * NBPD_L4) - sz;
 	va %= winsize;
 	va = rounddown(va, align);



CVS commit: src/sys/arch/x86

2018-12-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Dec  7 15:47:11 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86
src/sys/arch/x86/x86: pmap.c

Log Message:
Add an option to have a static kernel memory layout. This option is
disabled by default - that is to say, KASLR remains enabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/x86/x86/pmap.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/iscsi

2018-12-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Dec  7 14:59:19 UTC 2018

Modified Files:
src/sys/dev/iscsi: iscsi_ioctl.c

Log Message:
interlock isn't taken when cleaning up.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/iscsi/iscsi_ioctl.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/iscsi/iscsi_ioctl.c
diff -u src/sys/dev/iscsi/iscsi_ioctl.c:1.29 src/sys/dev/iscsi/iscsi_ioctl.c:1.30
--- src/sys/dev/iscsi/iscsi_ioctl.c:1.29	Wed Dec  6 04:29:58 2017
+++ src/sys/dev/iscsi/iscsi_ioctl.c	Fri Dec  7 14:59:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_ioctl.c,v 1.29 2017/12/06 04:29:58 ozaki-r Exp $	*/
+/*	$NetBSD: iscsi_ioctl.c,v 1.30 2018/12/07 14:59:19 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1783,7 +1783,7 @@ iscsi_cleanup_thread(void *par)
 
 			KASSERT(!conn->c_in_session);
 
-			callout_halt(>c_timeout, _cleanup_mtx);
+			callout_halt(>c_timeout, NULL);
 			closef(conn->c_sock);
 			callout_destroy(>c_timeout);
 			cv_destroy(>c_idle_cv);



CVS commit: src/sys/dev/iscsi

2018-12-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Dec  7 14:59:19 UTC 2018

Modified Files:
src/sys/dev/iscsi: iscsi_ioctl.c

Log Message:
interlock isn't taken when cleaning up.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/iscsi/iscsi_ioctl.c

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



CVS commit: src/sys/netinet6

2018-12-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Dec  7 14:47:24 UTC 2018

Modified Files:
src/sys/netinet6: nd6_nbr.c

Log Message:
inet6: match NS nonce to any interface

This allows the same address to exist on many interfaces on the same
prefix, matching the inet behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/netinet6/nd6_nbr.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/netinet6/nd6_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.161 src/sys/netinet6/nd6_nbr.c:1.162
--- src/sys/netinet6/nd6_nbr.c:1.161	Tue Dec  4 21:16:54 2018
+++ src/sys/netinet6/nd6_nbr.c	Fri Dec  7 14:47:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.161 2018/12/04 21:16:54 roy Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.162 2018/12/07 14:47:24 roy Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.161 2018/12/04 21:16:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.162 2018/12/07 14:47:24 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -77,6 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 
 
 struct dadq;
 static struct dadq *nd6_dad_find(struct ifaddr *, struct nd_opt_nonce *, bool *);
+static bool nd6_dad_ownnonce(struct ifaddr *, struct nd_opt_nonce *nonce);
 static void nd6_dad_starttimer(struct dadq *, int);
 static void nd6_dad_destroytimer(struct dadq *);
 static void nd6_dad_timer(struct dadq *);
@@ -309,6 +310,16 @@ nd6_ns_input(struct mbuf *m, int off, in
 		goto freeit;
 	}
 
+	/*
+	 * It looks that sender is performing DAD.
+	 * Check that the nonce is not being used by the same address
+	 * on another interface.
+	 */
+	if (IN6_IS_ADDR_UNSPECIFIED() && ndopts.nd_opts_nonce != NULL) {
+		if (nd6_dad_ownnonce(ifa, ndopts.nd_opts_nonce))
+			goto freeit;
+	}
+
 	ifa_release(ifa, _ia);
 	ifa = NULL;
 
@@ -1088,17 +1099,33 @@ static kmutex_t nd6_dad_lock;
 static struct dadq *
 nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *nonce, bool *found_nonce)
 {
+	struct in6_addr *myaddr6, *dadaddr6;
+	bool match_ifa;
 	struct dadq *dp;
 	int i, nonce_max;
 
 	KASSERT(mutex_owned(_dad_lock));
+	KASSERT(ifa != NULL);
+
+	myaddr6 = IFA_IN6(ifa);
+	if (nonce != NULL &&
+	nonce->nd_opt_nonce_len != (ND_OPT_NONCE_LEN + 2) / 8)
+		nonce = NULL;
+	match_ifa = nonce == NULL || found_nonce == NULL || *found_nonce == false;
+	if (found_nonce != NULL)
+		*found_nonce = false;
 
 	TAILQ_FOREACH(dp, , dad_list) {
-		if (dp->dad_ifa != ifa)
-			continue;
+		if (match_ifa) {
+			if (dp->dad_ifa != ifa)
+continue;
+		} else {
+			dadaddr6 = IFA_IN6(dp->dad_ifa);
+			if (!IN6_ARE_ADDR_EQUAL(myaddr6, dadaddr6))
+continue;
+		}
 
-		if (nonce == NULL ||
-		nonce->nd_opt_nonce_len != (ND_OPT_NONCE_LEN + 2) / 8)
+		if (nonce == NULL)
 			break;
 
 		nonce_max = MIN(dp->dad_ns_ocount, ND_OPT_NONCE_STORE);
@@ -1115,7 +1142,7 @@ nd6_dad_find(struct ifaddr *ifa, struct 
 			log(LOG_DEBUG,
 			"%s: detected a looped back NS message for %s\n",
 			ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???",
-			IN6_PRINT(ip6buf, IFA_IN6(ifa)));
+			IN6_PRINT(ip6buf, myaddr6));
 			dp->dad_ns_lcount++;
 			continue;
 		}
@@ -1125,6 +1152,18 @@ nd6_dad_find(struct ifaddr *ifa, struct 
 	return dp;
 }
 
+static bool
+nd6_dad_ownnonce(struct ifaddr *ifa, struct nd_opt_nonce *nonce)
+{
+	bool found_nonce = true;
+
+	mutex_enter(_dad_lock);
+	nd6_dad_find(ifa, nonce, _nonce);
+	mutex_exit(_dad_lock);
+
+	return found_nonce;
+}
+
 static void
 nd6_dad_starttimer(struct dadq *dp, int ticks)
 {



CVS commit: src/sys/netinet6

2018-12-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Dec  7 14:47:24 UTC 2018

Modified Files:
src/sys/netinet6: nd6_nbr.c

Log Message:
inet6: match NS nonce to any interface

This allows the same address to exist on many interfaces on the same
prefix, matching the inet behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/netinet6/nd6_nbr.c

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



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:28:54 UTC 2018

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

Log Message:
Tickets #1124 - #1128


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.68 -r1.1.2.69 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.68 src/doc/CHANGES-8.1:1.1.2.69
--- src/doc/CHANGES-8.1:1.1.2.68	Tue Dec  4 12:07:53 2018
+++ src/doc/CHANGES-8.1	Fri Dec  7 13:28:53 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.68 2018/12/04 12:07:53 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.69 2018/12/07 13:28:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1955,3 +1955,38 @@ sys/dev/pci/pcidevs_data.h			(regen)
 	Add 2 Symbios products.
 	[bouyer, ticket #1123]
 
+usr.bin/vmstat/vmstat.11.21,1.22
+
+	Suggest kernhist(9) which is required for vmstat -u and -U.
+	Document that vmstat -w -1 is accepted.
+	[sevan, ticket #1124]
+
+bin/sh/redir.c	1.61
+
+	Fix the <> redirection operator to not truncate the named file.
+	[kre, ticket #1125]
+
+bin/sh/alias.c	1.19
+
+	Avoid core dumps from sh in alias processing.
+	[kre, ticket #1126]
+
+bin/sh/sh.1	1.211 (patch)
+bin/sh/var.c	1.72
+bin/sh/var.h	1.38 (patch)
+
+	Change /bin/sh magic variable semantics, so that if
+	one of them (other than LINENO or RANDOM) is used
+	as a normal variable (by setting it to any value)
+	then that variable loses its special properties, and
+	simply acts like any other variable.  These variables
+	already acted normally (for what that is) if unset.
+	[kre, ticket #1127]
+
+sys/dev/pci/pci.c1.153
+sys/dev/pci/pcivar.h1.113
+
+	Save control registers in PCI-X, PCIe, MSI and MSI-X capability
+	area when suspending and restore them on resume.
+	[msaitoh, ticket #1128]
+



CVS commit: [netbsd-8] src/doc

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:28:54 UTC 2018

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

Log Message:
Tickets #1124 - #1128


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.68 -r1.1.2.69 src/doc/CHANGES-8.1

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



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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:27:19 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pci.c pcivar.h

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

sys/dev/pci/pcivar.h: revision 1.113
sys/dev/pci/pci.c: revision 1.153

  Save control registers in PCI-X, PCIe, MSI and MSI-X capability area when
suspend and restore them when resume. For PCIe capabilities register, it's
required to check the existence of each register to not to write the next area.

  This change fixes a stability of suspend/resume.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.152.6.1 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.109.8.1 -r1.109.8.2 src/sys/dev/pci/pcivar.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/pci.c
diff -u src/sys/dev/pci/pci.c:1.152 src/sys/dev/pci/pci.c:1.152.6.1
--- src/sys/dev/pci/pci.c:1.152	Wed Apr  5 04:04:54 2017
+++ src/sys/dev/pci/pci.c	Fri Dec  7 13:27:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.c,v 1.152 2017/04/05 04:04:54 msaitoh Exp $	*/
+/*	$NetBSD: pci.c,v 1.152.6.1 2018/12/07 13:27:19 martin Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.152 2017/04/05 04:04:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.152.6.1 2018/12/07 13:27:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -881,7 +881,70 @@ pci_conf_capture(pci_chipset_tag_t pc, p
 	for (off = 0; off < 16; off++)
 		pcs->reg[off] = pci_conf_read(pc, tag, (off * 4));
 
-	return;
+	/* For PCI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIX, , NULL) != 0)
+		pcs->x_csr = pci_conf_read(pc, tag, off + PCIX_CMD);
+
+	/* For PCIe */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIEXPRESS, , NULL) != 0) {
+		pcireg_t xcap = pci_conf_read(pc, tag, off + PCIE_XCAP);
+		unsigned int devtype;
+
+		devtype = PCIE_XCAP_TYPE(xcap);
+		pcs->e_dcr = (uint16_t)pci_conf_read(pc, tag, off + PCIE_DCSR);
+
+		if (PCIE_HAS_LINKREGS(devtype))
+			pcs->e_lcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_LCSR);
+
+		if ((xcap & PCIE_XCAP_SI) != 0)
+			pcs->e_slcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_SLCSR);
+
+		if (PCIE_HAS_ROOTREGS(devtype))
+			pcs->e_rcr = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_RCR);
+
+		if (__SHIFTOUT(xcap, PCIE_XCAP_VER_MASK) >= 2) {
+			pcs->e_dcr2 = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_DCSR2);
+
+			if (PCIE_HAS_LINKREGS(devtype))
+pcs->e_lcr2 = (uint16_t)pci_conf_read(pc, tag,
+			off + PCIE_LCSR2);
+
+			/* XXX PCIE_SLCSR2 (It's reserved by the PCIe spec) */
+		}
+	}
+
+	/* For MSI */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSI, , NULL) != 0) {
+		bool bit64, pvmask;
+		
+		pcs->msi_ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+
+		bit64 = pcs->msi_ctl & PCI_MSI_CTL_64BIT_ADDR;
+		pvmask = pcs->msi_ctl & PCI_MSI_CTL_PERVEC_MASK;
+
+		/* Address */
+		pcs->msi_maddr = pci_conf_read(pc, tag, off + PCI_MSI_MADDR);
+		if (bit64)
+			pcs->msi_maddr64_hi = pci_conf_read(pc, tag,
+			off + PCI_MSI_MADDR64_HI);
+
+		/* Data */
+		pcs->msi_mdata = pci_conf_read(pc, tag,
+		off + (bit64 ? PCI_MSI_MDATA64 : PCI_MSI_MDATA));
+
+		/* Per-vector masking */
+		if (pvmask)
+			pcs->msi_mask = pci_conf_read(pc, tag,
+			off + (bit64 ? PCI_MSI_MASK64 : PCI_MSI_MASK));
+	}
+
+	/* For MSI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSIX, , NULL) != 0)
+		pcs->msix_ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
 }
 
 void
@@ -897,7 +960,80 @@ pci_conf_restore(pci_chipset_tag_t pc, p
 			pci_conf_write(pc, tag, (off * 4), pcs->reg[off]);
 	}
 
-	return;
+	/* For PCI-X */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIX, , NULL) != 0)
+		pci_conf_write(pc, tag, off + PCIX_CMD, pcs->x_csr);
+
+	/* For PCIe */
+	if (pci_get_capability(pc, tag, PCI_CAP_PCIEXPRESS, , NULL) != 0) {
+		pcireg_t xcap = pci_conf_read(pc, tag, off + PCIE_XCAP);
+		unsigned int devtype;
+
+		devtype = PCIE_XCAP_TYPE(xcap);
+		pci_conf_write(pc, tag, off + PCIE_DCSR, pcs->e_dcr);
+
+		/*
+		 * PCIe capability is variable sized. To not to write the next
+		 * area, check the existence of each register.
+		 */
+		if (PCIE_HAS_LINKREGS(devtype))
+			pci_conf_write(pc, tag, off + PCIE_LCSR, pcs->e_lcr);
+
+		if ((xcap & PCIE_XCAP_SI) != 0)
+			pci_conf_write(pc, tag, off + PCIE_SLCSR, pcs->e_slcr);
+
+		if (PCIE_HAS_ROOTREGS(devtype))
+			pci_conf_write(pc, tag, off + PCIE_RCR, pcs->e_rcr);
+
+		if (__SHIFTOUT(xcap, PCIE_XCAP_VER_MASK) >= 2) {
+			pci_conf_write(pc, tag, off + PCIE_DCSR2, pcs->e_dcr2);
+
+			if (PCIE_HAS_LINKREGS(devtype))
+pci_conf_write(pc, tag, off + PCIE_LCSR2,
+pcs->e_lcr2);
+
+			/* XXX PCIE_SLCSR2 (It's reserved by the PCIe spec) */
+		}
+	}
+
+	/* For MSI */
+	if (pci_get_capability(pc, tag, PCI_CAP_MSI, , NULL) != 0) {
+		pcireg_t reg;
+		bool 

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

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:27:19 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: pci.c pcivar.h

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

sys/dev/pci/pcivar.h: revision 1.113
sys/dev/pci/pci.c: revision 1.153

  Save control registers in PCI-X, PCIe, MSI and MSI-X capability area when
suspend and restore them when resume. For PCIe capabilities register, it's
required to check the existence of each register to not to write the next area.

  This change fixes a stability of suspend/resume.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.152.6.1 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.109.8.1 -r1.109.8.2 src/sys/dev/pci/pcivar.h

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



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:23:49 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: sh.1 var.c var.h

Log Message:
Pull up following revision(s) (requested by kre in ticket #1127):

bin/sh/var.h: revision 1.38 (via patch)
bin/sh/var.c: revision 1.72
bin/sh/sh.1: revision 1.211 (via patch)

Alter a design botch when magic (self modifying) variables
were added to sh ... in other shells, setting such a variable
(for most of them) causes it to lose its special properties,
and act the same as any other variable.   I had assumed that
was just implementor laziness...   I was wrong.

>From now on the NetBSD shell will act like the others, and if vars
like HOSTNAME (and SECONDS, etc) are used as variables in a script
or whatever, they will act just like normal variables (and unless
this happens when they have been made local, or as a variable-assignment
as a prefix to a command, the special properties they would have had
otherwise are lost for the remainder of the life of the (sub-)shell
in which the variables were set).

Importing a value from the environment counts as setting the
value for this purpose (so if HOSTNAME is set in the environment,
the value there will be the value $HOSTNAME expands to).
The two exceptions to this are LINENO and RANDOM.   RANDOM
needs to be able to be set to (re-)set its seed.  LINENO needs to
be able to be set (at least in the "local" command) to achieve
the desired functionality.   It is unlikely that any (sane) script
is going to want to use those two as normal vars however.

While here, fix a minor bug in popping local vars (fn return) that need
to notify the shell of changes in value (like PATH).
Change sh(1) to reflect this alteration.  Also add doc of the
(forgotten) magic var EUSER (which has been there since the others
were added), and add a few more vars (which are documented
in other places in sh(1) - like ENV) into the defined or used
variable list (as well as wherever else they appear).

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.5 -r1.146.2.6 src/bin/sh/sh.1
cvs rdiff -u -r1.55.2.3 -r1.55.2.4 src/bin/sh/var.c
cvs rdiff -u -r1.28.8.1 -r1.28.8.2 src/bin/sh/var.h

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.146.2.5 src/bin/sh/sh.1:1.146.2.6
--- src/bin/sh/sh.1:1.146.2.5	Wed Oct 25 07:03:10 2017
+++ src/bin/sh/sh.1	Fri Dec  7 13:23:49 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.146.2.5 2017/10/25 07:03:10 snj Exp $
+.\"	$NetBSD: sh.1,v 1.146.2.6 2018/12/07 13:23:49 martin Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2315,6 +2315,21 @@ Making
 local causes any shell options that are changed via the set command inside the
 function to be restored to their original values when the function
 returns.
+If any of the shell's magic variables
+(those which return a value which may vary without
+the variable being explicitly altered,
+e.g.:
+.Dv SECONDS
+or
+.Dv HOSTNAME )
+are made local in a function,
+they will lose their special properties when set
+within the function, including by the
+.Ic local
+command itself
+(if not to be set in the function, there is little point
+in making a variable local)
+but those properties will be restored when the function returns.
 .Pp
 It is an error to use
 .Ic local
@@ -2985,6 +3000,30 @@ above, which are documented further abov
 If unset
 .Dq $HOME/.editrc
 is used.
+.It Ev ENV
+Names the file sourced at startup by the shell.
+Unused by this shell after initialization,
+but is usually passed through the environment to
+descendant shells.
+.It Ev EUSER
+Set to the login name of the effective user id running the shell,
+as returned by
+.Bd -compact -literal -offset indent
+getpwuid(geteuid())->pw_name
+.Ed
+.Po
+See
+.Xr getpwuid 3
+and
+.Xr geteuid 2
+for more details.
+.Pc
+This is obtained each time
+.Ev EUSER
+is expanded, so changes to the shell's execution identity
+cause updates without further action.
+If unset, it returns nothing.
+If set it loses its special properties, and is simply a variable.
 .It Ev HISTSIZE
 The number of lines in the history buffer for the shell.
 .It Ev HOME
@@ -3003,8 +3042,7 @@ This is obtained each time
 is expanded, so changes to the system's name are reflected
 without further action.
 If unset, it returns nothing.
-Setting it does nothing except reverse the effect of an earlier
-.Ic unset .
+If set it loses its special properties, and is simply a variable.
 .It Ev IFS
 Input Field Separators.
 This is normally set to
@@ -3056,6 +3094,22 @@ The default search path for executables.
 See the
 .Sx Path Search
 section above.
+.It Ev POSIXLY_CORRECT
+If set in the environment upon initialization of the shell,
+then the shell option
+.Ic posix
+will be set.
+.Po
+See the description of the
+.Ic set

CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:23:49 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: sh.1 var.c var.h

Log Message:
Pull up following revision(s) (requested by kre in ticket #1127):

bin/sh/var.h: revision 1.38 (via patch)
bin/sh/var.c: revision 1.72
bin/sh/sh.1: revision 1.211 (via patch)

Alter a design botch when magic (self modifying) variables
were added to sh ... in other shells, setting such a variable
(for most of them) causes it to lose its special properties,
and act the same as any other variable.   I had assumed that
was just implementor laziness...   I was wrong.

>From now on the NetBSD shell will act like the others, and if vars
like HOSTNAME (and SECONDS, etc) are used as variables in a script
or whatever, they will act just like normal variables (and unless
this happens when they have been made local, or as a variable-assignment
as a prefix to a command, the special properties they would have had
otherwise are lost for the remainder of the life of the (sub-)shell
in which the variables were set).

Importing a value from the environment counts as setting the
value for this purpose (so if HOSTNAME is set in the environment,
the value there will be the value $HOSTNAME expands to).
The two exceptions to this are LINENO and RANDOM.   RANDOM
needs to be able to be set to (re-)set its seed.  LINENO needs to
be able to be set (at least in the "local" command) to achieve
the desired functionality.   It is unlikely that any (sane) script
is going to want to use those two as normal vars however.

While here, fix a minor bug in popping local vars (fn return) that need
to notify the shell of changes in value (like PATH).
Change sh(1) to reflect this alteration.  Also add doc of the
(forgotten) magic var EUSER (which has been there since the others
were added), and add a few more vars (which are documented
in other places in sh(1) - like ENV) into the defined or used
variable list (as well as wherever else they appear).

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.5 -r1.146.2.6 src/bin/sh/sh.1
cvs rdiff -u -r1.55.2.3 -r1.55.2.4 src/bin/sh/var.c
cvs rdiff -u -r1.28.8.1 -r1.28.8.2 src/bin/sh/var.h

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



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:14:42 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: alias.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1126):

bin/sh/alias.c: revision 1.19

Fix the worst of the bugs in alias processing.   This has been in sh
since this code was first imported (May 1994) (ie: before 4.4-Lite)

There is (much) more coming soon (the big ugly comment is going away).

This one has been separated out, as it can easily cause sh
core dumps, so needs:
XXX pullup-8

(the other changes to aliases probably will not get that.)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/bin/sh/alias.c

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



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:14:42 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: alias.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1126):

bin/sh/alias.c: revision 1.19

Fix the worst of the bugs in alias processing.   This has been in sh
since this code was first imported (May 1994) (ie: before 4.4-Lite)

There is (much) more coming soon (the big ugly comment is going away).

This one has been separated out, as it can easily cause sh
core dumps, so needs:
XXX pullup-8

(the other changes to aliases probably will not get that.)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/bin/sh/alias.c

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

Modified files:

Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.15 src/bin/sh/alias.c:1.15.16.1
--- src/bin/sh/alias.c:1.15	Wed Jun 18 18:17:30 2014
+++ src/bin/sh/alias.c	Fri Dec  7 13:14:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $	*/
+/*	$NetBSD: alias.c,v 1.15.16.1 2018/12/07 13:14:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $");
+__RCSID("$NetBSD: alias.c,v 1.15.16.1 2018/12/07 13:14:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -67,17 +67,9 @@ setalias(char *name, char *val)
 {
 	struct alias *ap, **app;
 
+	(void) unalias(name);	/* old one (if any) is now gone */
 	app = hashalias(name);
-	for (ap = *app; ap; ap = ap->next) {
-		if (equal(name, ap->name)) {
-			INTOFF;
-			ckfree(ap->val);
-			ap->val	= savestr(val);
-			INTON;
-			return;
-		}
-	}
-	/* not found */
+
 	INTOFF;
 	ap = ckmalloc(sizeof (struct alias));
 	ap->name = savestr(name);



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:12:02 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: redir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1125):

bin/sh/redir.c: revision 1.61

Fix the <> redirection operator, which has been broken since it was
first implemented in response to PR bin/4966  (PR Feb 1998, fix Feb 1999).

The file named should not be truncated.

No other shell truncates the file (<> was added to FreeBSD sh in Oct 2000,
and did not include O_TRUNC) and POSIX certainly does not suggest that
should happen (just that the file is to be created if it does not exist.)

Bug pointed out in off-list e-mail by Martijn Dekker


To generate a diff of this commit:
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/bin/sh/redir.c

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

Modified files:

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.57.2.1 src/bin/sh/redir.c:1.57.2.2
--- src/bin/sh/redir.c:1.57.2.1	Sun Jul 23 14:58:14 2017
+++ src/bin/sh/redir.c	Fri Dec  7 13:12:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.57.2.1 2017/07/23 14:58:14 snj Exp $	*/
+/*	$NetBSD: redir.c,v 1.57.2.2 2018/12/07 13:12:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.57.2.1 2017/07/23 14:58:14 snj Exp $");
+__RCSID("$NetBSD: redir.c,v 1.57.2.2 2018/12/07 13:12:02 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -283,7 +283,7 @@ openredirect(union node *redir, char mem
 		break;
 	case NFROMTO:
 		fname = redir->nfile.expfname;
-		if ((f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
+		if ((f = open(fname, O_RDWR|O_CREAT, 0666)) < 0)
 			goto ecreate;
 		break;
 	case NTO:



CVS commit: [netbsd-8] src/bin/sh

2018-12-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  7 13:12:02 UTC 2018

Modified Files:
src/bin/sh [netbsd-8]: redir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1125):

bin/sh/redir.c: revision 1.61

Fix the <> redirection operator, which has been broken since it was
first implemented in response to PR bin/4966  (PR Feb 1998, fix Feb 1999).

The file named should not be truncated.

No other shell truncates the file (<> was added to FreeBSD sh in Oct 2000,
and did not include O_TRUNC) and POSIX certainly does not suggest that
should happen (just that the file is to be created if it does not exist.)

Bug pointed out in off-list e-mail by Martijn Dekker


To generate a diff of this commit:
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/bin/sh/redir.c

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



CVS commit: [netbsd-8] src/usr.bin/vmstat

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

Modified Files:
src/usr.bin/vmstat [netbsd-8]: vmstat.1

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1124):

usr.bin/vmstat/vmstat.1: revision 1.21
usr.bin/vmstat/vmstat.1: revision 1.22

Suggest kernhist(9) which is required for vmstat -u and -U
Drop Pp before Bl while here.

 -

Document vmstat -w -1 is accepted.
via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.38.1 src/usr.bin/vmstat/vmstat.1

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.1
diff -u src/usr.bin/vmstat/vmstat.1:1.20 src/usr.bin/vmstat/vmstat.1:1.20.38.1
--- src/usr.bin/vmstat/vmstat.1:1.20	Wed Oct 21 22:18:37 2009
+++ src/usr.bin/vmstat/vmstat.1	Fri Dec  7 13:09:14 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmstat.1,v 1.20 2009/10/21 22:18:37 wiz Exp $
+.\"	$NetBSD: vmstat.1,v 1.20.38.1 2018/12/07 13:09:14 martin Exp $
 .\"
 .\" Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
 .\"
-.Dd October 22, 2009
+.Dd December 5, 2018
 .Dt VMSTAT 1
 .Os
 .Sh NAME
@@ -186,12 +186,16 @@ seconds between each display.
 If no repeat
 .Ar count
 is specified, the default is infinity.
+The
+.Nm
+command will accept and honor a negative number of
+.Ar wait
+seconds.
 .El
 .Pp
 By default,
 .Nm
 displays the following information:
-.Pp
 .Bl -tag -width memory
 .It procs
 Information about the numbers of processes in various states.
@@ -288,7 +292,8 @@ apparent which are recomputed every seco
 .Xr ps 1 ,
 .Xr systat 1 ,
 .Xr iostat 8 ,
-.Xr pstat 8
+.Xr pstat 8 ,
+.Xr kernhist 9
 .Pp
 The sections starting with
 .Dq Interpreting system activity



CVS commit: [netbsd-8] src/usr.bin/vmstat

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

Modified Files:
src/usr.bin/vmstat [netbsd-8]: vmstat.1

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1124):

usr.bin/vmstat/vmstat.1: revision 1.21
usr.bin/vmstat/vmstat.1: revision 1.22

Suggest kernhist(9) which is required for vmstat -u and -U
Drop Pp before Bl while here.

 -

Document vmstat -w -1 is accepted.
via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.38.1 src/usr.bin/vmstat/vmstat.1

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



Re: CVS commit: src/sys/kern

2018-12-07 Thread Manuel Bouyer
On Thu, Dec 06, 2018 at 06:43:52PM +0100, Maxime Villard wrote:
> Le 06/12/2018 à 11:06, Manuel Bouyer a écrit :
> > as I understand KASLR (but I didn't look at the code), addresses are choosen
> > at random. So I guess there's a random number generator in the process.
> > Maybe it would be as simple as making the random number generator return
> > a constant value ?
> 
> Yes, change the two calls to cpu_earlyrng() in x86/pmap.c::slotspace_rand()
> to return zero, and you're back with a static layout.

This looks like an easy option to add

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


CVS commit: src/sys/dev/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 09:36:26 UTC 2018

Modified Files:
src/sys/dev/pci: files.pci ppb.c

Log Message:
- defflag PPB_USEINTR
- Print "interrupting at "


To generate a diff of this commit:
cvs rdiff -u -r1.410 -r1.411 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/ppb.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.410 src/sys/dev/pci/files.pci:1.411
--- src/sys/dev/pci/files.pci:1.410	Sat Nov 24 18:23:29 2018
+++ src/sys/dev/pci/files.pci	Fri Dec  7 09:36:26 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.410 2018/11/24 18:23:29 bouyer Exp $
+#	$NetBSD: files.pci,v 1.411 2018/12/07 09:36:26 msaitoh Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -378,6 +378,7 @@ file	dev/pci/toshide.c	toshide
 device	ppb: pcibus
 attach	ppb at pci
 file	dev/pci/ppb.c			ppb
+defflag opt_ppb.h	PPB_USEINTR
 
 # Cyclades Cyclom-8/16/32
 attach	cy at pci with cy_pci

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.63 src/sys/dev/pci/ppb.c:1.64
--- src/sys/dev/pci/ppb.c:1.63	Wed May 10 03:24:31 2017
+++ src/sys/dev/pci/ppb.c	Fri Dec  7 09:36:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.63 2017/05/10 03:24:31 msaitoh Exp $	*/
+/*	$NetBSD: ppb.c,v 1.64 2018/12/07 09:36:26 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.63 2017/05/10 03:24:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.64 2018/12/07 09:36:26 msaitoh Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_ppb.h"
+#endif
 
 #include 
 #include 
@@ -276,7 +280,7 @@ ppbattach(device_t parent, device_t self
 
 		intrstr = pci_intr_string(pc, sc->sc_pihp[0], intrbuf,
 		sizeof(intrbuf));
-		aprint_normal_dev(self, "%s\n", intrstr);
+		aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
 		/* Clear any pending events */
 		slcsr = pci_conf_read(pc, pa->pa_tag,



CVS commit: src/sys/dev/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 09:36:26 UTC 2018

Modified Files:
src/sys/dev/pci: files.pci ppb.c

Log Message:
- defflag PPB_USEINTR
- Print "interrupting at "


To generate a diff of this commit:
cvs rdiff -u -r1.410 -r1.411 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/ppb.c

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



CVS commit: src/tests/net/if_vlan

2018-12-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Dec  7 09:29:01 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
tests: check error messages strictly


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/net/if_vlan/t_vlan.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/net/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.13 src/tests/net/if_vlan/t_vlan.sh:1.14
--- src/tests/net/if_vlan/t_vlan.sh:1.13	Fri Dec  7 09:28:31 2018
+++ src/tests/net/if_vlan/t_vlan.sh	Fri Dec  7 09:29:01 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_vlan.sh,v 1.13 2018/12/07 09:28:31 ozaki-r Exp $
+#	$NetBSD: t_vlan.sh,v 1.14 2018/12/07 09:29:01 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -342,7 +342,7 @@ vlan_vlanid_body_common()
 	$atf_ifconfig vlan0 create
 
 	export RUMP_SERVER=$SOCK_LOCAL
-	atf_check -s not-exit:0 -e ignore\
+	atf_check -s not-exit:0 -e match:"^usage: rump.ifconfig" \
 	rump.ifconfig vlan0 vlan -1 vlanif shmif0
 
 	# $config_and_ping 0 # reserved vlan id
@@ -368,14 +368,14 @@ vlan_vlanid_body_common()
 	done
 
 	$atf_ifconfig vlan0 vlan 1 vlanif shmif0
-	atf_check -s not-exit:0 -e ignore \
+	atf_check -s not-exit:0 -e match:"SIOCSETVLAN: Device busy" \
 	rump.ifconfig vlan0 vlan 2 vlanif shmif0
 
-	atf_check -s not-exit:0 -e ignore \
+	atf_check -s not-exit:0 -e match:"SIOCSETVLAN: Device busy" \
 	rump.ifconfig vlan0 vlan 1 vlanif shmif1
 
 	$atf_ifconfig vlan0 -vlanif
-	atf_check -s not-exit:0 -e ignore \
+	atf_check -s not-exit:0 -e match:"Invalid argument" \
 	rump.ifconfig vlan0 $local0/$prefix
 
 	export RUMP_SERVER=$SOCK_LOCAL
@@ -469,8 +469,8 @@ vlan_configs_body_common()
 	$atf_ifconfig vlan0 -vlanif shmif0
 
 	$atf_ifconfig vlan0 vlan 10 vlanif shmif0
-	atf_check -s exit:0 -e ignore rump.ifconfig vlan0 -vlanif shmif1
-	atf_check -s exit:0 -e ignore rump.ifconfig vlan0 -vlanif shmif2
+	atf_check -s exit:0 rump.ifconfig vlan0 -vlanif shmif1
+	atf_check -s exit:0 rump.ifconfig vlan0 -vlanif shmif2
 
 	$atf_ifconfig vlan0 -vlanif
 
@@ -659,7 +659,8 @@ vlan_multicast_body_common()
 	atf_check -s exit:0 -o not-match:"$eth_mcaddr" $HIJACKING ifmcstat
 
 	# delete a non-existing address
-	atf_check -s not-exit:0 -e ignore $HIJACKING $siocXmulti del vlan0 $mcaddr
+	atf_check -s not-exit:0 -e match:"Invalid argument" \
+	$HIJACKING $siocXmulti del vlan0 $mcaddr
 
 	# add an address to different interfaces
 	$atf_siocXmulti add vlan0 $mcaddr



CVS commit: src/tests/net/if_vlan

2018-12-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Dec  7 09:29:01 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
tests: check error messages strictly


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/net/if_vlan/t_vlan.sh

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



CVS commit: src/tests/net/if_vlan

2018-12-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Dec  7 09:28:31 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
tests: reduce repeated phrases... (NFC)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/net/if_vlan/t_vlan.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/net/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.12 src/tests/net/if_vlan/t_vlan.sh:1.13
--- src/tests/net/if_vlan/t_vlan.sh:1.12	Wed Nov 14 05:07:48 2018
+++ src/tests/net/if_vlan/t_vlan.sh	Fri Dec  7 09:28:31 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_vlan.sh,v 1.12 2018/11/14 05:07:48 knakahara Exp $
+#	$NetBSD: t_vlan.sh,v 1.13 2018/12/07 09:28:31 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -45,43 +45,45 @@ DEBUG=${DEBUG:-false}
 
 vlan_create_destroy_body_common()
 {
+	local atf_ifconfig="atf_check -s exit:0 rump.ifconfig"
+
 	export RUMP_SERVER=${SOCK_LOCAL}
 
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 destroy
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 destroy
 
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 up
-	atf_check -s exit:0 rump.ifconfig vlan0 down
-	atf_check -s exit:0 rump.ifconfig vlan0 destroy
-
-	atf_check -s exit:0 rump.ifconfig shmif0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 vlan 1 vlanif shmif0
-	atf_check -s exit:0 rump.ifconfig vlan0 up
-	atf_check -s exit:0 rump.ifconfig vlan0 destroy
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 up
+	$atf_ifconfig vlan0 down
+	$atf_ifconfig vlan0 destroy
+
+	$atf_ifconfig shmif0 create
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 vlan 1 vlanif shmif0
+	$atf_ifconfig vlan0 up
+	$atf_ifconfig vlan0 destroy
 
 	# more than one vlan interface with a same parent interface
-	atf_check -s exit:0 rump.ifconfig shmif1 create
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 vlan 10 vlanif shmif0
-	atf_check -s exit:0 rump.ifconfig vlan1 create
-	atf_check -s exit:0 rump.ifconfig vlan1 vlan 11 vlanif shmif0
+	$atf_ifconfig shmif1 create
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 vlan 10 vlanif shmif0
+	$atf_ifconfig vlan1 create
+	$atf_ifconfig vlan1 vlan 11 vlanif shmif0
 
 	# more than one interface with another parent interface
-	atf_check -s exit:0 rump.ifconfig vlan2 create
-	atf_check -s exit:0 rump.ifconfig vlan2 vlan 12 vlanif shmif1
-	atf_check -s exit:0 rump.ifconfig vlan3 create
-	atf_check -s exit:0 rump.ifconfig vlan3 vlan 13 vlanif shmif1
-	atf_check -s exit:0 rump.ifconfig shmif0 destroy
+	$atf_ifconfig vlan2 create
+	$atf_ifconfig vlan2 vlan 12 vlanif shmif1
+	$atf_ifconfig vlan3 create
+	$atf_ifconfig vlan3 vlan 13 vlanif shmif1
+	$atf_ifconfig shmif0 destroy
 	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig vlan0
 	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig vlan1
 	atf_check -s exit:0 -o match:'shmif1' rump.ifconfig vlan2
 	atf_check -s exit:0 -o match:'shmif1' rump.ifconfig vlan3
-	atf_check -s exit:0 rump.ifconfig vlan0 destroy
-	atf_check -s exit:0 rump.ifconfig vlan1 destroy
-	atf_check -s exit:0 rump.ifconfig vlan2 destroy
-	atf_check -s exit:0 rump.ifconfig vlan3 destroy
+	$atf_ifconfig vlan0 destroy
+	$atf_ifconfig vlan1 destroy
+	$atf_ifconfig vlan2 destroy
+	$atf_ifconfig vlan3 destroy
 
 }
 
@@ -133,6 +135,7 @@ vlan_create_destroy6_cleanup()
 
 vlan_basic_body_common()
 {
+	local atf_ifconfig="atf_check -s exit:0 rump.ifconfig"
 	local outfile=./out
 	local af=inet
 	local prefix=24
@@ -152,23 +155,23 @@ vlan_basic_body_common()
 	rump_server_add_iface $SOCK_REMOTE shmif0 $BUS
 
 	export RUMP_SERVER=$SOCK_LOCAL
-	atf_check -s exit:0 rump.ifconfig shmif0 up
+	$atf_ifconfig shmif0 up
 	export RUMP_SERVER=$SOCK_REMOTE
-	atf_check -s exit:0 rump.ifconfig shmif0 up
+	$atf_ifconfig shmif0 up
 
 	export RUMP_SERVER=$SOCK_LOCAL
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 vlan 10 vlanif shmif0
-	atf_check -s exit:0 rump.ifconfig vlan0 $af $local0/$prefix
-	atf_check -s exit:0 rump.ifconfig vlan0 up
-	atf_check -s exit:0 rump.ifconfig -w 10
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 vlan 10 vlanif shmif0
+	$atf_ifconfig vlan0 $af $local0/$prefix
+	$atf_ifconfig vlan0 up
+	$atf_ifconfig -w 10
 
 	export RUMP_SERVER=$SOCK_REMOTE
-	atf_check -s exit:0 rump.ifconfig vlan0 create
-	atf_check -s exit:0 rump.ifconfig vlan0 vlan 10 vlanif shmif0
-	atf_check -s exit:0 rump.ifconfig vlan0 $af $remote0/$prefix
-	atf_check -s exit:0 rump.ifconfig vlan0 up
-	atf_check -s exit:0 rump.ifconfig -w 10
+	$atf_ifconfig vlan0 create
+	$atf_ifconfig vlan0 vlan 10 vlanif shmif0
+	$atf_ifconfig vlan0 $af $remote0/$prefix
+	$atf_ifconfig vlan0 up
+	$atf_ifconfig -w 10
 
 	

CVS commit: src/tests/net/if_vlan

2018-12-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Dec  7 09:28:31 UTC 2018

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
tests: reduce repeated phrases... (NFC)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/net/if_vlan/t_vlan.sh

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



CVS commit: src/sys/netipsec

2018-12-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Dec  7 09:11:04 UTC 2018

Modified Files:
src/sys/netipsec: ipsecif.c

Log Message:
ipsecif(4) should not increment drop counter by errors not related to if_snd. 
Pointed out by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/netipsec/ipsecif.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/netipsec/ipsecif.c
diff -u src/sys/netipsec/ipsecif.c:1.11 src/sys/netipsec/ipsecif.c:1.12
--- src/sys/netipsec/ipsecif.c:1.11	Thu Nov 15 10:23:56 2018
+++ src/sys/netipsec/ipsecif.c	Fri Dec  7 09:11:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsecif.c,v 1.11 2018/11/15 10:23:56 maxv Exp $  */
+/*	$NetBSD: ipsecif.c,v 1.12 2018/12/07 09:11:04 knakahara Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.11 2018/11/15 10:23:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.12 2018/12/07 09:11:04 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -364,10 +364,9 @@ ipsecif4_output(struct ipsec_variant *va
 	KASSERT(sp->policy != IPSEC_POLICY_ENTRUST);
 	KASSERT(sp->policy != IPSEC_POLICY_BYPASS);
 	if (sp->policy != IPSEC_POLICY_IPSEC) {
-		struct ifnet *ifp = >iv_softc->ipsec_if;
 		m_freem(m);
-		IF_DROP(>if_snd);
-		return 0;
+		error = ENETUNREACH;
+		goto done;
 	}
 
 	/* get flowinfo */



CVS commit: src/sys/netipsec

2018-12-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Dec  7 09:11:04 UTC 2018

Modified Files:
src/sys/netipsec: ipsecif.c

Log Message:
ipsecif(4) should not increment drop counter by errors not related to if_snd. 
Pointed out by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/netipsec/ipsecif.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/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 08:52:43 UTC 2018

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

Log Message:
No functional change. OK'd by nonaka:
- Use correct macro.
- Don't use magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/nvme_pci.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/nvme_pci.c
diff -u src/sys/dev/pci/nvme_pci.c:1.24 src/sys/dev/pci/nvme_pci.c:1.25
--- src/sys/dev/pci/nvme_pci.c:1.24	Sat Dec  1 13:32:55 2018
+++ src/sys/dev/pci/nvme_pci.c	Fri Dec  7 08:52:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme_pci.c,v 1.24 2018/12/01 13:32:55 jdolecek Exp $	*/
+/*	$NetBSD: nvme_pci.c,v 1.25 2018/12/07 08:52:43 msaitoh Exp $	*/
 /*	$OpenBSD: nvme_pci.c,v 1.3 2016/04/14 11:18:32 dlg Exp $ */
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme_pci.c,v 1.24 2018/12/01 13:32:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme_pci.c,v 1.25 2018/12/07 08:52:43 msaitoh Exp $");
 
 #include 
 #include 
@@ -173,7 +173,7 @@ nvme_pci_attach(device_t parent, device_
 		return;
 	}
 	sc->sc_iot = pa->pa_memt;
-	error = pci_mapreg_info(pa->pa_pc, pa->pa_tag, PCI_MAPREG_START,
+	error = pci_mapreg_info(pa->pa_pc, pa->pa_tag, NVME_PCI_BAR,
 	memtype, , >sc_ios, );
 	if (error) {
 		aprint_error_dev(self, "can't get map info\n");
@@ -190,7 +190,7 @@ nvme_pci_attach(device_t parent, device_
 		msixoff + PCI_MSIX_TBLOFFSET);
 		table_offset = msixtbl & PCI_MSIX_TBLOFFSET_MASK;
 		bir = msixtbl & PCI_MSIX_PBABIR_MASK;
-		if (bir == 0) {
+		if (bir == PCI_MAPREG_NUM(NVME_PCI_BAR)) {
 			sc->sc_ios = table_offset;
 		}
 	}



CVS commit: src/sys/dev/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 08:52:43 UTC 2018

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

Log Message:
No functional change. OK'd by nonaka:
- Use correct macro.
- Don't use magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/nvme_pci.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/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 08:28:44 UTC 2018

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

Log Message:
 xHCI uses BAR0 to map memory space. If a chip has MSI-X capability and it
points to BAR0, reserve the space. Almost the same as nvme_pci.c.

XXX Is it possible to make a nice API?


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/xhci_pci.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/pci

2018-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  7 08:28:44 UTC 2018

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

Log Message:
 xHCI uses BAR0 to map memory space. If a chip has MSI-X capability and it
points to BAR0, reserve the space. Almost the same as nvme_pci.c.

XXX Is it possible to make a nice API?


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/xhci_pci.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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.18 src/sys/dev/pci/xhci_pci.c:1.19
--- src/sys/dev/pci/xhci_pci.c:1.18	Fri Nov 30 17:47:54 2018
+++ src/sys/dev/pci/xhci_pci.c	Fri Dec  7 08:28:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.18 2018/11/30 17:47:54 jdolecek Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.19 2018/12/07 08:28:44 msaitoh Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.18 2018/11/30 17:47:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.19 2018/12/07 08:28:44 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -125,9 +125,11 @@ xhci_pci_attach(device_t parent, device_
 	const pcitag_t tag = pa->pa_tag;
 	char const *intrstr;
 	pcireg_t csr, memtype, usbrev;
-	int err;
 	uint32_t hccparams;
 	char intrbuf[PCI_INTRSTR_LEN];
+	bus_addr_t memaddr;
+	int flags, msixoff;
+	int err;
 
 	sc->sc_dev = self;
 
@@ -146,22 +148,41 @@ xhci_pci_attach(device_t parent, device_
 
 	/* map MMIO registers */
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, PCI_CBMEM);
-	switch (memtype) {
-	case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
-	case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
-		if (pci_mapreg_map(pa, PCI_CBMEM, memtype, 0,
-			   >sc_iot, >sc_ioh, NULL, >sc_ios)) {
-			sc->sc_ios = 0;
-			aprint_error_dev(self, "can't map mem space\n");
-			return;
-		}
-		break;
-	default:
+	if (PCI_MAPREG_TYPE(memtype) != PCI_MAPREG_TYPE_MEM) {
 		sc->sc_ios = 0;
 		aprint_error_dev(self, "BAR not 64 or 32-bit MMIO\n");
 		return;
 	}
 
+	sc->sc_iot = pa->pa_memt;
+	if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, PCI_CBMEM, memtype,
+	, >sc_ios, ) != 0) {
+		sc->sc_ios = 0;
+		aprint_error_dev(self, "can't get map info\n");
+		return;
+	}
+
+	if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_MSIX, ,
+	NULL)) {
+		pcireg_t msixtbl;
+		uint32_t table_offset;
+		int bir;
+
+		msixtbl = pci_conf_read(pa->pa_pc, pa->pa_tag,
+		msixoff + PCI_MSIX_TBLOFFSET);
+		table_offset = msixtbl & PCI_MSIX_TBLOFFSET_MASK;
+		bir = msixtbl & PCI_MSIX_PBABIR_MASK;
+		/* Shrink map area for MSI-X table */
+		if (bir == PCI_MAPREG_NUM(PCI_CBMEM))
+			sc->sc_ios = table_offset;
+	}
+	if (bus_space_map(sc->sc_iot, memaddr, sc->sc_ios, flags,
+	>sc_ioh)) {
+		sc->sc_ios = 0;
+		aprint_error_dev(self, "can't map mem space\n");
+		return;
+	}
+
 	psc->sc_pc = pc;
 	psc->sc_tag = tag;