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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 08:09:07 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S

Log Message:
There are two places where we reload %gs:

 * In setusergs. Here we can't fault. So we don't need to handle this
   case.

 * In intrfastexit for 32bit processes. This case needs to be handled,
   and we already have a label.

So use the label instead of disassembling %rip.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/amd64_trap.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.33 src/sys/arch/amd64/amd64/amd64_trap.S:1.34
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.33	Thu Feb 22 08:36:31 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Feb 25 08:09:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.33 2018/02/22 08:36:31 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.34 2018/02/25 08:09:07 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -400,12 +400,12 @@ NENTRY(check_swapgs)
 5:
 
 	/* Case 3: move to %gs? */
-	movq	TF_RIP(%rsp),%rax
-	movw	(%rax),%ax
-	andb	$070,%ah		/* mask mod/rm from mod/reg/rm */
-	cmpw	$0x8e+050*256,%ax	/* Any move to %gs (reg 5) */
-	jne	2b			/* No - normal kernel fault */
-	jmp	1b			/* Yes - restore %gs */
+	leaq	do_mov_gs(%rip),%rdi
+	cmpq	%rdi,TF_RIP(%rsp)
+	je	1b
+
+	/* None of the above cases */
+	jmp	2b	/* normal kernel fault */
 END(check_swapgs)
 #endif
 



CVS commit: src/sys/dev

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 08:19:35 UTC 2018

Modified Files:
src/sys/dev/pci: files.pci
Added Files:
src/sys/dev/imcsmb: imc.c imcsmb.c imcsmb_reg.h imcsmb_var.h

Log Message:
Import imcsmb driver from FreeBSD.  This driver allows access to the
SMBus controllers which are part of the integrated memory controllers
on certain modern Intel CPUs.  These SMBus are attached only to the
memory DIMMs, so we provide only a minimum amount of functionality.

Deliberately not included in GENERIC, as on some motherboards there
can be conflicting access between the driver and the motherboard.  The
motherboards generally will provide a mechanism to synchronize access,
but the methods are likely proprietary;  the driver provides a place
for inserting user-provided synchronization.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/imcsmb/imc.c src/sys/dev/imcsmb/imcsmb.c \
src/sys/dev/imcsmb/imcsmb_reg.h src/sys/dev/imcsmb/imcsmb_var.h
cvs rdiff -u -r1.392 -r1.393 src/sys/dev/pci/files.pci

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.392 src/sys/dev/pci/files.pci:1.393
--- src/sys/dev/pci/files.pci:1.392	Sun Dec  3 14:26:38 2017
+++ src/sys/dev/pci/files.pci	Sun Feb 25 08:19:34 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.392 2017/12/03 14:26:38 jdolecek Exp $
+#	$NetBSD: files.pci,v 1.393 2018/02/25 08:19:34 pgoyette Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1189,3 +1189,14 @@ include "external/bsd/drm2/pci/files.drm
 device	ismt: i2cbus
 attach	ismt at pci
 file	dev/pci/ismt.c		ismt
+
+# Intel Integrated Memory Controller and associated SMBus
+# (Experimental)
+
+device	imc {}: imcsmb
+attach	imc at pci
+file	dev/imcsmb/imc.c		imc
+
+device	imcsmb: i2cbus
+attach	imcsmb at imc
+file	dev/imcsmb/imcsmb.c		imcsmb

Added files:

Index: src/sys/dev/imcsmb/imc.c
diff -u /dev/null src/sys/dev/imcsmb/imc.c:1.1
--- /dev/null	Sun Feb 25 08:19:35 2018
+++ src/sys/dev/imcsmb/imc.c	Sun Feb 25 08:19:34 2018
@@ -0,0 +1,397 @@
+/* $NetBSD: imc.c,v 1.1 2018/02/25 08:19:34 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * 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.
+ */
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
+ *
+ * Copyright (c) 2017-2018 Panasas
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED T

CVS commit: src/sys/modules

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 08:20:29 UTC 2018

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/imc: Makefile imc.ioconf
src/sys/modules/imcsmb: Makefile imcsmb.ioconf

Log Message:
Add new modules (for i386 and amd64 only) for the imcsmb SMBus driver.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/imc/Makefile \
src/sys/modules/imc/imc.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/imcsmb/Makefile \
src/sys/modules/imcsmb/imcsmb.ioconf

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.199 src/sys/modules/Makefile:1.200
--- src/sys/modules/Makefile:1.199	Thu Jan 25 23:40:06 2018
+++ src/sys/modules/Makefile	Sun Feb 25 08:20:28 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.199 2018/01/25 23:40:06 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.200 2018/02/25 08:20:28 pgoyette Exp $
 
 .include 
 
@@ -76,6 +76,7 @@ SUBDIR+=	iic
 SUBDIR+=	ip_ecn
 SUBDIR+=	ipl
 SUBDIR+=	kernfs
+SUBDIR+=	ksem
 SUBDIR+=	layerfs
 SUBDIR+=	lfs
 SUBDIR+=	lua
@@ -376,6 +377,12 @@ SUBDIR+=	auvitek
 SUBDIR+=	coram
 SUBDIR+=	cxdtv
 SUBDIR+=	emdtv
+
+# Intel Integrated Memory Controller and associated SMBus
+# (Experimental)
+SUBDIR+=	imc
+SUBDIR+=	imcsmb
+
 .endif
 
 .if (${MKISCSI} != "no")

Added files:

Index: src/sys/modules/imc/Makefile
diff -u /dev/null src/sys/modules/imc/Makefile:1.1
--- /dev/null	Sun Feb 25 08:20:29 2018
+++ src/sys/modules/imc/Makefile	Sun Feb 25 08:20:28 2018
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2018/02/25 08:20:28 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev
+.PATH:	${S}/dev/pci
+.PATH:	${S}/dev/imcsmb
+
+KMOD=	imc
+IOCONF= imc.ioconf
+
+SRCS+=	imc.c
+
+.include 
Index: src/sys/modules/imc/imc.ioconf
diff -u /dev/null src/sys/modules/imc/imc.ioconf:1.1
--- /dev/null	Sun Feb 25 08:20:29 2018
+++ src/sys/modules/imc/imc.ioconf	Sun Feb 25 08:20:28 2018
@@ -0,0 +1,10 @@
+#   $NetBSD: imc.ioconf,v 1.1 2018/02/25 08:20:28 pgoyette Exp $
+
+ioconf imc
+
+include "conf/files"
+include "dev/pci/files.pci"
+
+pseudo-root pci*
+
+imc* at pci? dev ? func ?

Index: src/sys/modules/imcsmb/Makefile
diff -u /dev/null src/sys/modules/imcsmb/Makefile:1.1
--- /dev/null	Sun Feb 25 08:20:29 2018
+++ src/sys/modules/imcsmb/Makefile	Sun Feb 25 08:20:29 2018
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2018/02/25 08:20:29 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev
+.PATH:	${S}/dev/pci
+.PATH:	${S}/dev/imcsmb
+
+KMOD=	imcsmb
+IOCONF= imcsmb.ioconf
+
+SRCS+=	imcsmb.c
+
+.include 
Index: src/sys/modules/imcsmb/imcsmb.ioconf
diff -u /dev/null src/sys/modules/imcsmb/imcsmb.ioconf:1.1
--- /dev/null	Sun Feb 25 08:20:29 2018
+++ src/sys/modules/imcsmb/imcsmb.ioconf	Sun Feb 25 08:20:29 2018
@@ -0,0 +1,10 @@
+#   $NetBSD: imcsmb.ioconf,v 1.1 2018/02/25 08:20:29 pgoyette Exp $
+
+ioconf imcsmb
+
+include "conf/files"
+include "dev/pci/files.pci"
+
+pseudo-root imc*
+
+imcsmb* at imc?



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

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 08:21:57 UTC 2018

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Update for newly added imcsmb driver modules.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/modules/md.i386

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.73 src/distrib/sets/lists/modules/md.amd64:1.74
--- src/distrib/sets/lists/modules/md.amd64:1.73	Thu Jan 25 23:42:06 2018
+++ src/distrib/sets/lists/modules/md.amd64	Sun Feb 25 08:21:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.73 2018/01/25 23:42:06 pgoyette Exp $
+# $NetBSD: md.amd64,v 1.74 2018/02/25 08:21:57 pgoyette Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -109,6 +109,10 @@
 ./@MODULEDIR@/hpacel/hpacel.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/hpetbase-kernel-modules	kmod
 ./@MODULEDIR@/hpet/hpet.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/imcbase-kernel-modules	kmod
+./@MODULEDIR@/imc/imc.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/imcsmbbase-kernel-modules	kmod
+./@MODULEDIR@/imcsmb/imcsmb.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/hpqlbbase-kernel-modules	kmod
 ./@MODULEDIR@/hpqlb/hpqlb.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/i915drmbase-kernel-modules	kmod

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.76 src/distrib/sets/lists/modules/md.i386:1.77
--- src/distrib/sets/lists/modules/md.i386:1.76	Thu Jan 25 23:42:06 2018
+++ src/distrib/sets/lists/modules/md.i386	Sun Feb 25 08:21:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.76 2018/01/25 23:42:06 pgoyette Exp $
+# $NetBSD: md.i386,v 1.77 2018/02/25 08:21:57 pgoyette Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -106,6 +106,10 @@
 ./@MODULEDIR@/hpet/hpet.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/hpqlbbase-kernel-modules	kmod
 ./@MODULEDIR@/hpqlb/hpqlb.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/imcbase-kernel-modules kmod
+./@MODULEDIR@/imc/imc.kmod			base-kernel-modules kmod
+./@MODULEDIR@/imcsmbbase-kernel-modules kmod
+./@MODULEDIR@/imcsmb/imcsmb.kmod		base-kernel-modules kmod
 ./@MODULEDIR@/i915drmbase-kernel-modules	kmod
 ./@MODULEDIR@/i915drm/i915drm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/i915drmkms			base-kernel-modules	kmod



CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 08:22:53 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: Makefile
Added Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
Add the man page for new imcsmb driver


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man4/man4.x86/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/Makefile
diff -u src/share/man/man4/man4.x86/Makefile:1.17 src/share/man/man4/man4.x86/Makefile:1.18
--- src/share/man/man4/man4.x86/Makefile:1.17	Thu Jan 25 01:25:39 2018
+++ src/share/man/man4/man4.x86/Makefile	Sun Feb 25 08:22:53 2018
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.17 2018/01/25 01:25:39 christos Exp $
+#	$NetBSD: Makefile,v 1.18 2018/02/25 08:22:53 pgoyette Exp $
 
 MAN=	amdpcib.4 apic.4 balloon.4 coretemp.4 est.4 fdc.4 \
-	fwhrng.4 hpet.4 ichlpcib.4 lpt.4 mem.4 odcm.4 powernow.4 \
+	fwhrng.4 hpet.4 ichlpcib.4 imcsmb.4 lpt.4 mem.4 odcm.4 powernow.4 \
 	soekrisgpio.4 tco.4 tprof_amdpmi.4 tprof_pmi.4 vmt.4 vmx.4 \
 	amdsmn.4 amdzentemp.4
 

Added files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u /dev/null src/share/man/man4/man4.x86/imcsmb.4:1.1
--- /dev/null	Sun Feb 25 08:22:53 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 08:22:53 2018
@@ -0,0 +1,147 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2018 Panasas
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 24, 2018
+.Dt IMCSMB 4
+.Os
+.Sh NAME
+.Nm imcsmb
+.Nd Intel integrated Memory Controller (iMC) SMBus controller driver
+.Sh SYNOPSIS
+.Cd imc* at pci? dev ? func ?
+.Cd imcsmb* at imc?
+.Cd iic* at i2cbus?
+.Pp
+Alternatively, to load the driver as a module at boot time, place the following
+line in
+.Xr boot.cfg :
+.Bd -literal -offset indent
+load=imcsmb
+.Ed
+or add the following line to your /etc/modules file:
+.Bd -literal -offset indent
+imcsmb
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides
+.Xr iic 4
+support for the SMBus controller functionality in the integrated Memory
+Controllers (iMCs) embedded in Intel Sandybridge-Xeon, Ivybridge-Xeon,
+Haswell-Xeon, and Broadwell-Xeon CPUs.
+Each CPU implements one or more iMCs, depending on the number of cores; each
+iMC implements two SMBus controllers (iMC-SMBs).
+The iMC-SMBs are used by the iMCs to read configuration information from the
+DIMMs during POST.
+They may also be used, by motherboard firmware or a BMC, to monitor the
+temperature of the DIMMs.
+.Pp
+The iMC-SMBs are
+.Sy not
+general-purpose SMBus controllers.
+By their nature, they are only ever attached to DIMMs, so they implement only
+the SMBus operations need for communicating with DIMMs.
+Specifically:
+.Pp
+.Bl -dash -offset indent -compact
+.It
+READB
+.It
+READW
+.It
+WRITEB
+.It
+WRITEW
+.El
+.Pp
+A more detailed discussion of the hardware and driver architecture can be found
+at the top of
+.Pa sys/dev/imcsmb/imc.c .
+.Sh WARNINGS
+As mentioned above, firmware might use the iMC-SMBs to read DIMM temperatures.
+The public iMC documentation does not describe any sort of coordination
+mechanism to prevent requests from different sources -- such as the motherboard
+firmware, a BMC, or the operating system -- from interfering with each other.
+.Pp
+.Bf Sy
+Therefore, it is highly recommended that developers contact the motherboard
+vendor for any board-specific instructions on how to disable and re-enable DIMM
+temperature monitoring.
+.Ef
+.Pp
+DIMM temperature monitoring should be disabled before r

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

2018-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb 25 08:23:09 UTC 2018

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

Log Message:
Use correct MID_ value


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/core_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/core_machdep.c
diff -u src/sys/arch/aarch64/aarch64/core_machdep.c:1.1 src/sys/arch/aarch64/aarch64/core_machdep.c:1.2
--- src/sys/arch/aarch64/aarch64/core_machdep.c:1.1	Sun Aug 10 05:47:37 2014
+++ src/sys/arch/aarch64/aarch64/core_machdep.c	Sun Feb 25 08:23:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: core_machdep.c,v 1.2 2018/02/25 08:23:09 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.1 2014/08/10 05:47:37 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.2 2018/02/25 08:23:09 skrll Exp $");
 
 #include 
 #include 
@@ -56,7 +56,7 @@ cpu_coredump(struct lwp *l, struct cored
 	int error;
 
 	if (iocookie == NULL) {
-		CORE_SETMAGIC(*chdr, COREMAGIC, MID_POWERPC, 0);
+		CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
 		chdr->c_hdrsize = ALIGN(sizeof *chdr);
 		chdr->c_seghdrsize = ALIGN(sizeof cseg);
 		chdr->c_cpusize = sizeof md_core;



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

2018-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb 25 08:24:36 UTC 2018

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/core_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/core_machdep.c
diff -u src/sys/arch/aarch64/aarch64/core_machdep.c:1.2 src/sys/arch/aarch64/aarch64/core_machdep.c:1.3
--- src/sys/arch/aarch64/aarch64/core_machdep.c:1.2	Sun Feb 25 08:23:09 2018
+++ src/sys/arch/aarch64/aarch64/core_machdep.c	Sun Feb 25 08:24:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.2 2018/02/25 08:23:09 skrll Exp $ */
+/* $NetBSD: core_machdep.c,v 1.3 2018/02/25 08:24:36 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.2 2018/02/25 08:23:09 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.3 2018/02/25 08:24:36 skrll Exp $");
 
 #include 
 #include 
@@ -57,9 +57,9 @@ cpu_coredump(struct lwp *l, struct cored
 
 	if (iocookie == NULL) {
 		CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
-		chdr->c_hdrsize = ALIGN(sizeof *chdr);
-		chdr->c_seghdrsize = ALIGN(sizeof cseg);
-		chdr->c_cpusize = sizeof md_core;
+		chdr->c_hdrsize = ALIGN(sizeof(*chdr));
+		chdr->c_seghdrsize = ALIGN(sizeof(cseg));
+		chdr->c_cpusize = sizeof(md_core);
 		chdr->c_nseg++;
 		return 0;
 	}



CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 08:27:15 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
Ooops - forgot to add NetBSD License


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u src/share/man/man4/man4.x86/imcsmb.4:1.1 src/share/man/man4/man4.x86/imcsmb.4:1.2
--- src/share/man/man4/man4.x86/imcsmb.4:1.1	Sun Feb 25 08:22:53 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 08:27:15 2018
@@ -1,3 +1,33 @@
+.\" $NetBSD
+.\"
+.\"
+.\" Copyright (c) 2018 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Paul Goyette
+.\"
+.\" 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.
+
 .\"
 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
 .\"



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 08:28:55 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S

Log Message:
Replace %rax -> %rdi, so that check_swapgs clobbers only one register.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/amd64/amd64/amd64_trap.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.34 src/sys/arch/amd64/amd64/amd64_trap.S:1.35
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.34	Sun Feb 25 08:09:07 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Feb 25 08:28:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.34 2018/02/25 08:09:07 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.35 2018/02/25 08:28:55 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -393,8 +393,8 @@ NENTRY(check_swapgs)
 	leaq	do_iret(%rip),%rdi
 	cmpq	%rdi,TF_RIP(%rsp)
 	jne	5f
-	movq	TF_RSP(%rsp),%rax	/* Must read %rsp, may be a pad word */
-	testb	$SEL_UPL,8(%rax)	/* Check %cs of outer iret frame */
+	movq	TF_RSP(%rsp),%rdi	/* Must read %rsp, may be a pad word */
+	testb	$SEL_UPL,8(%rdi)	/* Check %cs of outer iret frame */
 	je	2b			/* jump if iret was to kernel  */
 	jmp	1b			/* to user - must restore %gs */
 5:



CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Feb 25 10:04:04 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
Fix xrefs, remove empty lines, fix RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u src/share/man/man4/man4.x86/imcsmb.4:1.2 src/share/man/man4/man4.x86/imcsmb.4:1.3
--- src/share/man/man4/man4.x86/imcsmb.4:1.2	Sun Feb 25 08:27:15 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 10:04:04 2018
@@ -1,5 +1,4 @@
-.\" $NetBSD
-.\"
+.\" $NetBSD: imcsmb.4,v 1.3 2018/02/25 10:04:04 wiz Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +26,6 @@
 .\" 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.
-
 .\"
 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
 .\"
@@ -69,7 +67,7 @@
 .Pp
 Alternatively, to load the driver as a module at boot time, place the following
 line in
-.Xr boot.cfg :
+.Xr boot.cfg 5 :
 .Bd -literal -offset indent
 load=imcsmb
 .Ed
@@ -154,7 +152,7 @@ The
 driver will connect to the i2cbus instances created by
 .Nm .
 .Sh SEE ALSO
-.Xr i2c 4
+.Xr iic 4
 .Sh HISTORY
 The
 .Nm
@@ -173,5 +171,4 @@ It was substantially refactored, and thi
 It was adapted to
 .Nx
 by
-.An Paul Goyette Aq Mt pgoye...@netbsd.org .
-
+.An Paul Goyette Aq Mt pgoye...@netbsd.org .



CVS commit: src/sys/modules

2018-02-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Feb 25 10:17:12 UTC 2018

Modified Files:
src/sys/modules: Makefile

Log Message:
Remove ksem module reference

This does not exist in HEAD.

It looks like accidentally committed in:

Add new modules (for i386 and amd64 only) for the imcsmb SMBus driver.
src/sys/modules/Makefile r1.200


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.200 src/sys/modules/Makefile:1.201
--- src/sys/modules/Makefile:1.200	Sun Feb 25 08:20:28 2018
+++ src/sys/modules/Makefile	Sun Feb 25 10:17:12 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.200 2018/02/25 08:20:28 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.201 2018/02/25 10:17:12 kamil Exp $
 
 .include 
 
@@ -76,7 +76,6 @@ SUBDIR+=	iic
 SUBDIR+=	ip_ecn
 SUBDIR+=	ipl
 SUBDIR+=	kernfs
-SUBDIR+=	ksem
 SUBDIR+=	layerfs
 SUBDIR+=	lfs
 SUBDIR+=	lua



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 11:57:44 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S

Log Message:
Ah. Don't use NENTRY() to declare check_swapgs, use LABEL() instead. NENTRY
puts the code in the .text section, so the effect of TEXT_USER_BEGIN was
overwritten, and check_swapgs was not put in the .text.user section.

As a result kernels running SVS would crash when jumping here - because we
execute this place with the user page table loaded, and in this page table
only .text.user is mapped.

While here, rename check_swapgs -> kernuser_reenter, because we do more
things than just SWAPGS.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/amd64/amd64/amd64_trap.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.35 src/sys/arch/amd64/amd64/amd64_trap.S:1.36
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.35	Sun Feb 25 08:28:55 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Feb 25 11:57:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.35 2018/02/25 08:28:55 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.36 2018/02/25 11:57:44 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -273,22 +273,22 @@ IDTVEC_END(trap10)
  * equivalent of iret, if it does this code would be needed
  * in order to copy the user segment registers into the fault frame.
  */
-#define check_swapgs alltraps
+#define kernuser_reenter alltraps
 #endif
 
 IDTVEC(trap11)		/* #NP() Segment not present */
 	TRAP_NJ(T_SEGNPFLT)
-	jmp	check_swapgs
+	jmp	kernuser_reenter
 IDTVEC_END(trap11)
 
 IDTVEC(trap12)		/* #SS() Stack exception */
 	TRAP_NJ(T_STKFLT)
-	jmp	check_swapgs
+	jmp	kernuser_reenter
 IDTVEC_END(trap12)
 
 IDTVEC(trap13)		/* #GP() General protection */
 	TRAP_NJ(T_PROTFLT)
-	jmp	check_swapgs
+	jmp	kernuser_reenter
 IDTVEC_END(trap13)
 
 IDTVEC(trap14)
@@ -365,7 +365,7 @@ IDTVEC(intrspurious)
 	jmp	.Lalltraps_checkusr
 IDTVEC_END(intrspurious)
 
-#ifndef check_swapgs
+#ifndef kernuser_reenter
 /*
  * We need to worry about traps in kernel mode while the kernel %gs isn't
  * loaded. These are either faults on iretq during return to user or loads to
@@ -374,7 +374,8 @@ IDTVEC_END(intrspurious)
  * When such traps happen, we have CPL=0 and %gs=userland, and we must perform
  * an additional swapgs to get %gs=kernel.
  */
-NENTRY(check_swapgs)
+	_ALIGN_TEXT
+LABEL(kernuser_reenter)
 	INTRENTRY_L(3f,1:)
 2:
 	sti
@@ -406,7 +407,7 @@ NENTRY(check_swapgs)
 
 	/* None of the above cases */
 	jmp	2b	/* normal kernel fault */
-END(check_swapgs)
+END(kernuser_reenter)
 #endif
 
 	TEXT_USER_END



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

2018-02-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Feb 25 12:28:18 UTC 2018

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

Log Message:
Correct OpenSSL 1.1 entries in plist

Fix references to:
./usr/share/man/cat3/BIO_get_data.0
./usr/share/man/cat3/SSL_CONF_cmd.0

This is obserbable with the MKCATPAGES=yes build option.


To generate a diff of this commit:
cvs rdiff -u -r1.2184 -r1.2185 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2184 src/distrib/sets/lists/comp/mi:1.2185
--- src/distrib/sets/lists/comp/mi:1.2184	Sat Feb 17 21:46:41 2018
+++ src/distrib/sets/lists/comp/mi	Sun Feb 25 12:28:18 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2184 2018/02/17 21:46:41 kamil Exp $
+#	$NetBSD: mi,v 1.2185 2018/02/25 12:28:18 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -4476,7 +4476,7 @@
 ./usr/share/man/cat3/BIO_f_null.0		comp-c-catman		.cat
 ./usr/share/man/cat3/BIO_f_ssl.0		comp-c-catman		.cat
 ./usr/share/man/cat3/BIO_find_type.0		comp-c-catman		.cat
-./usr/share/man/cat3/BIO_get_data.	0	comp-c-catman		.cat,openssl=11
+./usr/share/man/cat3/BIO_get_data.0		comp-c-catman		.cat,openssl=11
 ./usr/share/man/cat3/BIO_get_ex_new_index.0	comp-c-catman		.cat,openssl=11
 ./usr/share/man/cat3/BIO_meth_new.0		comp-c-catman		.cat,openssl=11
 ./usr/share/man/cat3/BIO_new.0			comp-c-catman		.cat
@@ -4967,7 +4967,7 @@
 ./usr/share/man/cat3/SSL_CONF_CTX_set1_prefix.0		comp-c-catman	.cat,openssl=11
 ./usr/share/man/cat3/SSL_CONF_CTX_set_flags.0		comp-c-catman	.cat,openssl=11
 ./usr/share/man/cat3/SSL_CONF_CTX_set_ssl_ctx.0		comp-c-catman	.cat,openssl=11
-./usr/share/man/cat3/SSL_CONF_cmd.0		`	comp-c-catman	.cat,openssl=11
+./usr/share/man/cat3/SSL_CONF_cmd.0			comp-c-catman	.cat,openssl=11
 ./usr/share/man/cat3/SSL_CONF_cmd_argv.0		comp-c-catman	.cat,openssl=11
 ./usr/share/man/cat3/SSL_CTX_add1_chain_cert.0		comp-c-catman	.cat,openssl=11
 ./usr/share/man/cat3/SSL_CTX_add_extra_chain_cert.0	comp-c-catman		.cat



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 12:37:16 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S locore.S trap.c

Log Message:
Fix handling of segment register faults when running with SVS. The behavior
is changed also in the non-SVS case.

I've put a documentation in amd64_trap.S. Basically, the problem with SVS
is that if iret faults, we already have a full trapframe pushed on the
stack and the CPU will push another frame on this stack (nested), but it
hits the redzone below the stack since it is still running with the user
page table loaded.

To fix that, we pop a good part of the trapframe earlier in intrfastexit.
If iret faults, the current %rsp has enough room for an iret frame, and
the CPU can push that without problem. We then switch back to the outer
iret frame (the frame the CPU was trying to pop by executing iret, but that
it didn't pop for real because iret faulted), call INTRENTRY, and handle
the trap as if it had been received from userland directly.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amd64/amd64/amd64_trap.S
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/amd64/amd64/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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.36 src/sys/arch/amd64/amd64/amd64_trap.S:1.37
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.36	Sun Feb 25 11:57:44 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Feb 25 12:37:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.36 2018/02/25 11:57:44 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.37 2018/02/25 12:37:16 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -368,69 +368,139 @@ IDTVEC_END(intrspurious)
 #ifndef kernuser_reenter
 /*
  * We need to worry about traps in kernel mode while the kernel %gs isn't
- * loaded. These are either faults on iretq during return to user or loads to
- * %gs.
+ * loaded. When such traps happen, we have CPL=0 and %gs=userland, and we
+ * must perform an additional swapgs to get %gs=kernel.
+ */
+
+#define TF_SMALL(val, reg)		(val - TF_REGSIZE)(reg)
+#define TF_SMALL_REGPUSHED(val, reg)	(val - (TF_REGSIZE - 8))(reg)
+
+/*
+ * It is possible that we received a trap in kernel mode, but with the user
+ * context loaded. There are six cases where this can happen:
  *
- * When such traps happen, we have CPL=0 and %gs=userland, and we must perform
- * an additional swapgs to get %gs=kernel.
+ *  o Execution of SYSRETQ.
+ *  o Execution of IRETQ.
+ *  o Reload of ES.
+ *  o Reload of DS.
+ *  o Reload of FS.
+ *  o Reload of GS.
+ *
+ * When this happens, the kernel is re-entered in kernel mode, but the
+ * previous context is in kernel mode too.
+ *
+ * We have two iret frames in the stack. In the first one, the 'rsp' field
+ * points to the outer iret frame:
+ *
+ * +---+
+ * | trapno | err | rip | cs=ring0 | rflags | rsp | ss |
+ * +---|---+
+ * |
+ *   +-+
+ *   |
+ *   |+---+
+ *   +--> | trapno | err | rip | cs=ring3 | rflags | rsp | ss |
+ *+---+
+ *
+ * We perform a three-step procedure:
+ *
+ *  o We copy the 'trapno' field of the current frame into the 'trapno'
+ *field of the outer frame.
+ *
+ *  o We update RSP to point to the outer frame. This outer frame is in the
+ *same stack as the current frame, and likely just after the current
+ *frame.
+ *
+ *  o We do a normal INTRENTRY. Now that RSP points to the outer frame,
+ *everything behaves as if we had received a trap from the outer frame,
+ *that is to say, from userland directly.
+ *
+ * Finally, we jump to 'calltrap' and handle the trap smoothly.
+ *
+ * Two notes regarding SVS:
+ *
+ *  o With SVS, we will receive the trap while the user page tables are
+ *loaded. That's not a problem, we don't touch anything unmapped here.
+ *
+ *  o With SVS, when the user page tables are loaded, the stack is really
+ *small, and can contain only one trapframe structure. Therefore, in
+ *intrfastexit, we must save the GPRs and pop their part of the stack
+ *right away. If we weren't doing that, and the reload of ES faulted for
+ *example, then the CPU would try to push an iret frame on the current
+ *stack (nested), and would double-fault because it touches the redzone
+ *below the stack (see the documentation in x86/x86/svs.c). By popping
+ *the GPR part of the stack, we leave enough stack for the CPU to push
+ *an iret frame, and for us to push two 8-byte reg

CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 12:39:44 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
Fix a typo.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u src/share/man/man4/man4.x86/imcsmb.4:1.3 src/share/man/man4/man4.x86/imcsmb.4:1.4
--- src/share/man/man4/man4.x86/imcsmb.4:1.3	Sun Feb 25 10:04:04 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 12:39:44 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: imcsmb.4,v 1.3 2018/02/25 10:04:04 wiz Exp $
+.\" $NetBSD: imcsmb.4,v 1.4 2018/02/25 12:39:44 uwe Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -94,7 +94,7 @@ The iMC-SMBs are
 .Sy not
 general-purpose SMBus controllers.
 By their nature, they are only ever attached to DIMMs, so they implement only
-the SMBus operations need for communicating with DIMMs.
+the SMBus operations needed for communicating with DIMMs.
 Specifically:
 .Pp
 .Bl -dash -offset indent -compact
@@ -114,8 +114,8 @@ at the top of
 .Sh WARNINGS
 As mentioned above, firmware might use the iMC-SMBs to read DIMM temperatures.
 The public iMC documentation does not describe any sort of coordination
-mechanism to prevent requests from different sources -- such as the motherboard
-firmware, a BMC, or the operating system -- from interfering with each other.
+mechanism to prevent requests from different sources \(em such as the motherboard
+firmware, a BMC, or the operating system \(em from interfering with each other.
 .Pp
 .Bf Sy
 Therefore, it is highly recommended that developers contact the motherboard



CVS commit: src/external/gpl2/groff/tmac

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 12:46:49 UTC 2018

Modified Files:
src/external/gpl2/groff/tmac: mdoc.local

Log Message:
Add FreeBSD 11.0 and 12.0


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/groff/tmac/mdoc.local

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

Modified files:

Index: src/external/gpl2/groff/tmac/mdoc.local
diff -u src/external/gpl2/groff/tmac/mdoc.local:1.4 src/external/gpl2/groff/tmac/mdoc.local:1.5
--- src/external/gpl2/groff/tmac/mdoc.local:1.4	Sun Jan 14 03:33:10 2018
+++ src/external/gpl2/groff/tmac/mdoc.local	Sun Feb 25 12:46:49 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdoc.local,v 1.4 2018/01/14 03:33:10 uwe Exp $
+.\" $NetBSD: mdoc.local,v 1.5 2018/02/25 12:46:49 uwe Exp $
 .\"
 .\" Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -78,6 +78,8 @@
 .ds doc-operating-system-FreeBSD-9.0   9.0
 .ds doc-operating-system-FreeBSD-10.0   10.0
 .ds doc-operating-system-FreeBSD-10.1   10.1
+.ds doc-operating-system-FreeBSD-11.0   11.0
+.ds doc-operating-system-FreeBSD-12.0   12.0
 .
 .
 .nr Dx 1



CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 12:51:33 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
.Po/.Pc are not appropriate for enclosing sentences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u src/share/man/man4/man4.x86/imcsmb.4:1.4 src/share/man/man4/man4.x86/imcsmb.4:1.5
--- src/share/man/man4/man4.x86/imcsmb.4:1.4	Sun Feb 25 12:39:44 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 12:51:33 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: imcsmb.4,v 1.4 2018/02/25 12:39:44 uwe Exp $
+.\" $NetBSD: imcsmb.4,v 1.5 2018/02/25 12:51:33 uwe Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -130,10 +130,8 @@ and re-enabled before returning from
 The driver includes comments to that effect at the appropriate locations.
 The driver has been tested and shown to work, with only that type of
 modification, on certain motherboards from Intel.
-.Po
-Unfortunately, those modifications were based on material covered under a
-non-disclosure agreement, and therefore are not included in this driver.
-.Pc
+(Unfortunately, those modifications were based on material covered under a
+non-disclosure agreement, and therefore are not included in this driver.)
 The driver has also been tested and shown to work as-is on various motherboards
 from SuperMicro.
 .Pp



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

2018-02-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Feb 25 12:53:22 UTC 2018

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

Log Message:
Register the x86/imcsmb man/cat/html page


To generate a diff of this commit:
cvs rdiff -u -r1.1576 -r1.1577 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1576 src/distrib/sets/lists/man/mi:1.1577
--- src/distrib/sets/lists/man/mi:1.1576	Fri Feb  9 04:20:38 2018
+++ src/distrib/sets/lists/man/mi	Sun Feb 25 12:53:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1576 2018/02/09 04:20:38 christos Exp $
+# $NetBSD: mi,v 1.1577 2018/02/25 12:53:22 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2015,6 +2015,7 @@
 ./usr/share/man/cat4/x86/fwhrng.0		man-sys-catman		.cat
 ./usr/share/man/cat4/x86/hpet.0			man-sys-catman		.cat
 ./usr/share/man/cat4/x86/ichlpcib.0		man-sys-catman		.cat
+./usr/share/man/cat4/x86/imcsmb.0		man-sys-catman		.cat
 ./usr/share/man/cat4/x86/ioapic.0		man-sys-catman		.cat
 ./usr/share/man/cat4/x86/kmem.0			man-sys-catman		.cat
 ./usr/share/man/cat4/x86/lapic.0		man-sys-catman		.cat
@@ -5070,6 +5071,7 @@
 ./usr/share/man/html4/x86/fwhrng.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/hpet.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/ichlpcib.html		man-sys-htmlman		html
+./usr/share/man/html4/x86/imcsmb.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/ioapic.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/kmem.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/lapic.html		man-sys-htmlman		html
@@ -8057,6 +8059,7 @@
 ./usr/share/man/man4/x86/fwhrng.4		man-sys-man		.man
 ./usr/share/man/man4/x86/hpet.4			man-sys-man		.man
 ./usr/share/man/man4/x86/ichlpcib.4		man-sys-man		.man
+./usr/share/man/man4/x86/imcsmb.4		man-sys-man		.man
 ./usr/share/man/man4/x86/ioapic.4		man-sys-man		.man
 ./usr/share/man/man4/x86/kmem.4			man-sys-man		.man
 ./usr/share/man/man4/x86/lapic.4		man-sys-man		.man



CVS commit: src/share/man/man4/man4.x86

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 12:57:39 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: imcsmb.4

Log Message:
Use .Dl instead of .Bd -literal, fix vertical spacing.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/man4.x86/imcsmb.4

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

Modified files:

Index: src/share/man/man4/man4.x86/imcsmb.4
diff -u src/share/man/man4/man4.x86/imcsmb.4:1.5 src/share/man/man4/man4.x86/imcsmb.4:1.6
--- src/share/man/man4/man4.x86/imcsmb.4:1.5	Sun Feb 25 12:51:33 2018
+++ src/share/man/man4/man4.x86/imcsmb.4	Sun Feb 25 12:57:39 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: imcsmb.4,v 1.5 2018/02/25 12:51:33 uwe Exp $
+.\" $NetBSD: imcsmb.4,v 1.6 2018/02/25 12:57:39 uwe Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -68,13 +68,12 @@
 Alternatively, to load the driver as a module at boot time, place the following
 line in
 .Xr boot.cfg 5 :
-.Bd -literal -offset indent
-load=imcsmb
-.Ed
+.Pp
+.Dl load=imcsmb
+.Pp
 or add the following line to your /etc/modules file:
-.Bd -literal -offset indent
-imcsmb
-.Ed
+.Pp
+.Dl imcsmb
 .Sh DESCRIPTION
 The
 .Nm



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 13:09:34 UTC 2018

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

Log Message:
Mmh. We shouldn't read %cr2 here. %cr2 is initialized by the CPU only
during page faults (T_PAGEFLT), so here we're reading a value that comes
from a previous page fault.

That's a real problem; if you launch an unprivileged process, set up a
signal handler, make it sleep 10 seconds, and trigger a T_ALIGNFLT fault,
you get in si_addr the address of another LWP's page - and perhaps this
can be used to defeat userland ASLR.

This bug has been there since 2003.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/amd64/amd64/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/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.112 src/sys/arch/amd64/amd64/trap.c:1.113
--- src/sys/arch/amd64/amd64/trap.c:1.112	Sun Feb 25 12:37:16 2018
+++ src/sys/arch/amd64/amd64/trap.c	Sun Feb 25 13:09:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.112 2018/02/25 12:37:16 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.113 2018/02/25 13:09:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.112 2018/02/25 12:37:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2018/02/25 13:09:33 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -376,7 +376,7 @@ trap(struct trapframe *frame)
 	case T_ALIGNFLT|T_USER:
 		KSI_INIT_TRAP(&ksi);
 		ksi.ksi_trap = type & ~T_USER;
-		ksi.ksi_addr = (void *)rcr2();
+		ksi.ksi_addr = (void *)frame->tf_rip;
 		switch (type) {
 		case T_SEGNPFLT|T_USER:
 		case T_STKFLT|T_USER:



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 13:14:27 UTC 2018

Modified Files:
src/sys/arch/amd64/include: frameasm.h

Log Message:
Remove INTRENTRY_L, it's not used anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amd64/include/frameasm.h

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

Modified files:

Index: src/sys/arch/amd64/include/frameasm.h
diff -u src/sys/arch/amd64/include/frameasm.h:1.36 src/sys/arch/amd64/include/frameasm.h:1.37
--- src/sys/arch/amd64/include/frameasm.h:1.36	Thu Feb 22 10:42:11 2018
+++ src/sys/arch/amd64/include/frameasm.h	Sun Feb 25 13:14:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frameasm.h,v 1.36 2018/02/22 10:42:11 maxv Exp $	*/
+/*	$NetBSD: frameasm.h,v 1.37 2018/02/25 13:14:27 maxv Exp $	*/
 
 #ifndef _AMD64_MACHINE_FRAMEASM_H
 #define _AMD64_MACHINE_FRAMEASM_H
@@ -150,23 +150,19 @@
 #define SVS_LEAVE_ALTSTACK	/* nothing */
 #endif
 
-#define	INTRENTRY_L(kernel_trap, usertrap) \
+#define	INTRENTRY \
 	subq	$TF_REGSIZE,%rsp	; \
 	INTR_SAVE_GPRS			; \
 	cld; \
 	SMAP_ENABLE			; \
 	testb	$SEL_UPL,TF_CS(%rsp)	; \
-	je	kernel_trap		; \
-usertrap; \
+	je	98f			; \
 	SWAPGS; \
 	SVS_ENTER			; \
 	movw	%gs,TF_GS(%rsp)		; \
 	movw	%fs,TF_FS(%rsp)		; \
 	movw	%es,TF_ES(%rsp)		; \
-	movw	%ds,TF_DS(%rsp)	
-
-#define	INTRENTRY \
-	INTRENTRY_L(98f,)		; \
+	movw	%ds,TF_DS(%rsp)		; \
 98:
 
 #define INTRFASTEXIT \



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

2018-02-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Feb 25 13:15:35 UTC 2018

Modified Files:
src/sys/arch/x86/x86: svs.c

Log Message:
Remove the first entry from the todo list, it's handled properly now.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/svs.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/x86/svs.c
diff -u src/sys/arch/x86/x86/svs.c:1.11 src/sys/arch/x86/x86/svs.c:1.12
--- src/sys/arch/x86/x86/svs.c:1.11	Sat Feb 24 19:52:46 2018
+++ src/sys/arch/x86/x86/svs.c	Sun Feb 25 13:15:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: svs.c,v 1.11 2018/02/24 19:52:46 maxv Exp $	*/
+/*	$NetBSD: svs.c,v 1.12 2018/02/25 13:15:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.11 2018/02/24 19:52:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.12 2018/02/25 13:15:35 maxv Exp $");
 
 #include "opt_svs.h"
 
@@ -212,8 +212,6 @@ __KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.11
  *
  * Ordered from highest priority to lowest:
  *
- *  o Handle segment register faults properly.
- *
  *  o The NMI stack is not double-entered. Therefore if we ever receive an NMI
  *and leave it, the content of the stack will be visible to userland (via
  *Meltdown). Normally we never leave NMIs, unless a privileged user



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

2018-02-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Feb 25 14:27:07 UTC 2018

Modified Files:
src/tests/lib/libc/sys: Makefile t_ucontext.c

Log Message:
Add new tests in lib/libc/sys/t_ucontext

New tests:
 - ucontext_sp
 - ucontext_fp
 - ucontext_pc
 - ucontext_intrv

They test respectively:
 - _UC_MACHINE_SP
 - _UC_MACHINE_FP
 - _UC_MACHINE_PC
 - _UC_MACHINE_INTRV

These tests attempt to access and print the values from ucontext, without
interpreting the values.

This is a follow up of the _UC_MACHINE_FP() introduction.

These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_ucontext.c

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

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.49 src/tests/lib/libc/sys/Makefile:1.50
--- src/tests/lib/libc/sys/Makefile:1.49	Sun Apr  2 21:44:00 2017
+++ src/tests/lib/libc/sys/Makefile	Sun Feb 25 14:27:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2017/04/02 21:44:00 kamil Exp $
+# $NetBSD: Makefile,v 1.50 2018/02/25 14:27:07 kamil Exp $
 
 MKMAN=	no
 
@@ -96,6 +96,7 @@ CPPFLAGS.t_ptrace_wait4.c	+= -D_KERNTYPE
 CPPFLAGS.t_ptrace_wait6.c	+= -D_KERNTYPES
 CPPFLAGS.t_ptrace_waitid.c	+= -D_KERNTYPES
 CPPFLAGS.t_ptrace_waitpid.c	+= -D_KERNTYPES
+CPPFLAGS.t_ucontext.c		+= -D_KERNTYPES
 
 FILES=		truncate_test.root_owned
 FILESBUILD=	yes

Index: src/tests/lib/libc/sys/t_ucontext.c
diff -u src/tests/lib/libc/sys/t_ucontext.c:1.1 src/tests/lib/libc/sys/t_ucontext.c:1.2
--- src/tests/lib/libc/sys/t_ucontext.c:1.1	Sat Oct 15 06:54:52 2011
+++ src/tests/lib/libc/sys/t_ucontext.c	Sun Feb 25 14:27:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $ */
+/* $NetBSD: t_ucontext.c,v 1.2 2018/02/25 14:27:07 kamil Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $");
+__RCSID("$NetBSD: t_ucontext.c,v 1.2 2018/02/25 14:27:07 kamil Exp $");
 
 #include 
 #include 
@@ -68,9 +68,73 @@ ATF_TC_BODY(ucontext_basic, tc)
 	ATF_REQUIRE_EQ(y, 21);
 }
 
+ATF_TC(ucontext_sp);
+ATF_TC_HEAD(ucontext_sp, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_SP()");
+}
+
+ATF_TC_BODY(ucontext_sp, tc)
+{
+	ucontext_t u;
+
+	getcontext(&u);
+
+	printf("_UC_MACHINE_SP(u)=%" PRIxREGISTER "\n", _UC_MACHINE_SP(&u));
+}
+
+ATF_TC(ucontext_fp);
+ATF_TC_HEAD(ucontext_fp, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_FP()");
+}
+
+ATF_TC_BODY(ucontext_fp, tc)
+{
+	ucontext_t u;
+
+	getcontext(&u);
+
+	printf("_UC_MACHINE_FP(u)=%" PRIxREGISTER "\n", _UC_MACHINE_FP(&u));
+}
+
+ATF_TC(ucontext_pc);
+ATF_TC_HEAD(ucontext_pc, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_PC()");
+}
+
+ATF_TC_BODY(ucontext_pc, tc)
+{
+	ucontext_t u;
+
+	getcontext(&u);
+
+	printf("_UC_MACHINE_PC(u)=%" PRIxREGISTER "\n", _UC_MACHINE_PC(&u));
+}
+
+ATF_TC(ucontext_intrv);
+ATF_TC_HEAD(ucontext_intrv, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_INTRV()");
+}
+
+ATF_TC_BODY(ucontext_intrv, tc)
+{
+	ucontext_t u;
+
+	getcontext(&u);
+
+	printf("_UC_MACHINE_INTRV(u)=%" PRIxREGISTER "\n", _UC_MACHINE_INTRV(&u));
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, ucontext_basic);
+	ATF_TP_ADD_TC(tp, ucontext_sp);
+	ATF_TP_ADD_TC(tp, ucontext_fp);
+	ATF_TP_ADD_TC(tp, ucontext_pc);
+	ATF_TP_ADD_TC(tp, ucontext_intrv);
 
 	return atf_no_error();
 }



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

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 15:31:07 UTC 2018

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

Log Message:
fix spello


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_ucontext.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ucontext.c
diff -u src/tests/lib/libc/sys/t_ucontext.c:1.2 src/tests/lib/libc/sys/t_ucontext.c:1.3
--- src/tests/lib/libc/sys/t_ucontext.c:1.2	Sun Feb 25 09:27:07 2018
+++ src/tests/lib/libc/sys/t_ucontext.c	Sun Feb 25 10:31:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ucontext.c,v 1.2 2018/02/25 14:27:07 kamil Exp $ */
+/* $NetBSD: t_ucontext.c,v 1.3 2018/02/25 15:31:07 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ucontext.c,v 1.2 2018/02/25 14:27:07 kamil Exp $");
+__RCSID("$NetBSD: t_ucontext.c,v 1.3 2018/02/25 15:31:07 christos Exp $");
 
 #include 
 #include 
@@ -71,7 +71,7 @@ ATF_TC_BODY(ucontext_basic, tc)
 ATF_TC(ucontext_sp);
 ATF_TC_HEAD(ucontext_sp, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_SP()");
+	atf_tc_set_md_var(tc, "descr", "Retrieve _UC_MACHINE_SP()");
 }
 
 ATF_TC_BODY(ucontext_sp, tc)
@@ -86,7 +86,7 @@ ATF_TC_BODY(ucontext_sp, tc)
 ATF_TC(ucontext_fp);
 ATF_TC_HEAD(ucontext_fp, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_FP()");
+	atf_tc_set_md_var(tc, "descr", "Retrieve _UC_MACHINE_FP()");
 }
 
 ATF_TC_BODY(ucontext_fp, tc)
@@ -101,7 +101,7 @@ ATF_TC_BODY(ucontext_fp, tc)
 ATF_TC(ucontext_pc);
 ATF_TC_HEAD(ucontext_pc, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_PC()");
+	atf_tc_set_md_var(tc, "descr", "Retrieve _UC_MACHINE_PC()");
 }
 
 ATF_TC_BODY(ucontext_pc, tc)
@@ -116,7 +116,7 @@ ATF_TC_BODY(ucontext_pc, tc)
 ATF_TC(ucontext_intrv);
 ATF_TC_HEAD(ucontext_intrv, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Retrive _UC_MACHINE_INTRV()");
+	atf_tc_set_md_var(tc, "descr", "Retrieve _UC_MACHINE_INTRV()");
 }
 
 ATF_TC_BODY(ucontext_intrv, tc)



CVS commit: src/sys/uvm/pmap

2018-02-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Feb 25 16:44:31 UTC 2018

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
adjust KASSERT() triggered in PR port-cobalt/53054 to provide more info


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.26 src/sys/uvm/pmap/pmap_tlb.c:1.27
--- src/sys/uvm/pmap/pmap_tlb.c:1.26	Wed Feb 21 21:53:54 2018
+++ src/sys/uvm/pmap/pmap_tlb.c	Sun Feb 25 16:44:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.26 2018/02/21 21:53:54 jdolecek Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.26 2018/02/21 21:53:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -457,7 +457,11 @@ pmap_tlb_asid_reinitialize(struct pmap_t
 		const u_int asids_found = tlb_record_asids(
 		ti->ti_asid_bitmap._b, ti->ti_asid_max);
 		pmap_tlb_asid_check();
-		KASSERT(asids_found == pmap_tlb_asid_count(ti));
+#ifdef DIAGNOSTIC
+		const u_int asids_count = pmap_tlb_asid_count(ti);
+#endif
+		KASSERTMSG(asids_found == asids_count,
+		"found %u != count %u", asids_found, asids_count);
 		if (__predict_false(asids_found >= ti->ti_asid_max / 2)) {
 			tlb_invalidate_asids(KERNEL_PID + 1, ti->ti_asid_max);
 #else /* MULTIPROCESSOR && !PMAP_TLB_NEED_SHOOTDOWN */



CVS commit: src/share/man/man2

2018-02-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Feb 25 16:53:51 UTC 2018

Modified Files:
src/share/man/man2: ucontext.2

Log Message:
Document _UC_MACHINE_*() in ucontext(2)

Document:
 - _UC_MACHINE_SP()
 - _UC_MACHINE_FP()
 - _UC_MACHINE_PC()
 - _UC_MACHINE_INTRV()
 - _UC_MACHINE_SET_PC()

Document fragileness of the frame-pointer accessor.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man2/ucontext.2

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

Modified files:

Index: src/share/man/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.6 src/share/man/man2/ucontext.2:1.7
--- src/share/man/man2/ucontext.2:1.6	Thu Apr 29 06:07:35 2010
+++ src/share/man/man2/ucontext.2	Sun Feb 25 16:53:51 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.6 2010/04/29 06:07:35 jruoho Exp $
+.\"	$NetBSD: ucontext.2,v 1.7 2018/02/25 16:53:51 kamil Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 29, 2010
+.Dd February 25, 2018
 .Dt UCONTEXT 2
 .Os
 .Sh NAME
@@ -35,6 +35,11 @@
 .Nd user context
 .Sh SYNOPSIS
 .In ucontext.h
+.Fn _UC_MACHINE_SP "&uc"
+.Fn _UC_MACHINE_FP "&uc"
+.Fn _UC_MACHINE_PC "&uc"
+.Fn _UC_MACHINE_INTRV "&uc"
+.Fn _UC_MACHINE_SET_PC "&uc"
 .Sh DESCRIPTION
 The
 .Vt ucontext_t
@@ -86,6 +91,36 @@ it may consist of general registers, flo
 and other machine-specific information.
 Its description is beyond the scope of this manual page;
 portable applications should not access this structure member.
+.Pp
+The
+.Fn _UC_MACHINE_SP ,
+.Fn _UC_MACHINE_FP ,
+.Fn _UC_MACHINE_PC ,
+.Fn _UC_MACHINE_INTRV
+and
+.Fn _UC_MACHINE_SET_PC
+auxiliary macros are designed to perform respectively the following operations:
+.Bl -dash
+.It
+read stack pointer ,
+.It
+read frame pointer (base pointer) ,
+.It
+read program counter ,
+.It
+read interrupt vector ,
+.It
+write program counter .
+.El
+.Pp
+The frame pointer macro does not guarantee to retrieve a reliable value
+and should not be used in a code unless no other debugging format is
+easily accessible.
+A compiler might optimize the frame pointer register in a function,
+reusing as a general purpose register storage
+.Ar -fomit-frame-pointer
+or emit function prologues only before parts that need them
+.Ar -fshrink-wrap .
 .Sh SEE ALSO
 .Xr _exit 2 ,
 .Xr getcontext 2 ,



CVS commit: src/share/man/man2

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 17:37:05 UTC 2018

Modified Files:
src/share/man/man2: ucontext.2

Log Message:
Flags are .Fl not .Ar


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man2/ucontext.2

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

Modified files:

Index: src/share/man/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.7 src/share/man/man2/ucontext.2:1.8
--- src/share/man/man2/ucontext.2:1.7	Sun Feb 25 16:53:51 2018
+++ src/share/man/man2/ucontext.2	Sun Feb 25 17:37:05 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.7 2018/02/25 16:53:51 kamil Exp $
+.\"	$NetBSD: ucontext.2,v 1.8 2018/02/25 17:37:05 uwe Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -117,10 +117,10 @@ The frame pointer macro does not guarant
 and should not be used in a code unless no other debugging format is
 easily accessible.
 A compiler might optimize the frame pointer register in a function,
-reusing as a general purpose register storage
-.Ar -fomit-frame-pointer
+reusing it as a general purpose register storage
+.Fl ( fomit-frame-pointer )
 or emit function prologues only before parts that need them
-.Ar -fshrink-wrap .
+.Fl ( fshrink-wrap ) .
 .Sh SEE ALSO
 .Xr _exit 2 ,
 .Xr getcontext 2 ,



CVS commit: src/share/man/man2

2018-02-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 25 17:45:40 UTC 2018

Modified Files:
src/share/man/man2: ucontext.2

Log Message:
Use tagged list.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man2/ucontext.2

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

Modified files:

Index: src/share/man/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.8 src/share/man/man2/ucontext.2:1.9
--- src/share/man/man2/ucontext.2:1.8	Sun Feb 25 17:37:05 2018
+++ src/share/man/man2/ucontext.2	Sun Feb 25 17:45:40 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.8 2018/02/25 17:37:05 uwe Exp $
+.\"	$NetBSD: ucontext.2,v 1.9 2018/02/25 17:45:40 uwe Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -92,25 +92,19 @@ and other machine-specific information.
 Its description is beyond the scope of this manual page;
 portable applications should not access this structure member.
 .Pp
-The
-.Fn _UC_MACHINE_SP ,
-.Fn _UC_MACHINE_FP ,
-.Fn _UC_MACHINE_PC ,
-.Fn _UC_MACHINE_INTRV
-and
-.Fn _UC_MACHINE_SET_PC
-auxiliary macros are designed to perform respectively the following operations:
-.Bl -dash
-.It
-read stack pointer ,
-.It
-read frame pointer (base pointer) ,
-.It
-read program counter ,
-.It
-read interrupt vector ,
-.It
-write program counter .
+The following auxiliary macros are available to access some of that
+machine-specific information:
+.Bl -tag -width ".Fn _UC_MACHINE_SET_PC" -offset indent
+.It Fn _UC_MACHINE_SP
+\(em read stack pointer,
+.It Fn _UC_MACHINE_FP
+\(em read frame pointer (base pointer),
+.It Fn _UC_MACHINE_PC
+\(em read program counter,
+.It Fn _UC_MACHINE_INTRV
+\(em read interrupt vector,
+.It Fn _UC_MACHINE_SET_PC
+\(em write program counter.
 .El
 .Pp
 The frame pointer macro does not guarantee to retrieve a reliable value



CVS commit: src/external/bsd/libproc/dist

2018-02-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Feb 25 18:48:39 UTC 2018

Modified Files:
src/external/bsd/libproc/dist: libproc.h

Log Message:
add some flag definitions from a newer version of FreeBSD's libproc
that are needed by the new dtrace.  these don't do anything yet,
but dtrace doesn't mind.  I'll do a full resync to the latest FreeBSD
libproc / librtld_db later.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libproc/dist/libproc.h

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

Modified files:

Index: src/external/bsd/libproc/dist/libproc.h
diff -u src/external/bsd/libproc/dist/libproc.h:1.3 src/external/bsd/libproc/dist/libproc.h:1.4
--- src/external/bsd/libproc/dist/libproc.h:1.3	Fri Jun  9 01:17:25 2017
+++ src/external/bsd/libproc/dist/libproc.h	Sun Feb 25 18:48:39 2018
@@ -51,6 +51,11 @@ typedef void (*proc_child_func)(void *);
 #define PS_DEAD		5
 #define PS_LOST		6
 
+/* Flags for proc_attach(). */
+#define	PATTACH_FORCE	0x01
+#define	PATTACH_RDONLY	0x02
+#define	PATTACH_NOSTOP	0x04
+
 /* Reason values for proc_detach(). */
 #define PRELEASE_HANG	1
 #define PRELEASE_KILL	2



CVS commit: src/lib/libpthread

2018-02-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Feb 25 18:51:18 UTC 2018

Modified Files:
src/lib/libpthread: Makefile

Log Message:
remove hard-coded -fomit-frame-pointer for pthread stuff,
let these use the same setting as the rest of the tree.
the performance difference is marginal and this allows
dtrace ustack() to work better.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/lib/libpthread/Makefile

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

Modified files:

Index: src/lib/libpthread/Makefile
diff -u src/lib/libpthread/Makefile:1.87 src/lib/libpthread/Makefile:1.88
--- src/lib/libpthread/Makefile:1.87	Sun Jul  3 14:24:58 2016
+++ src/lib/libpthread/Makefile	Sun Feb 25 18:51:18 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.87 2016/07/03 14:24:58 christos Exp $
+#	$NetBSD: Makefile,v 1.88 2018/02/25 18:51:18 chs Exp $
 #
 
 WARNS?=	5
@@ -90,31 +90,13 @@ SRCS+=		pthread_compat.c
 
 ALIGN_FUNCTIONS=	${${ACTIVE_CC} == "gcc":? -falign-functions=32 :}
 
-.if ${MACHINE_CPU} != "m68k" && ${MACHINE_CPU} != "sh3" && ${MACHINE_ARCH} != "vax"
-OMIT_FRAME_POINTER=	-fomit-frame-pointer
-.else
-OMIT_FRAME_POINTER=
-.endif
-
 # The TSD routines are used in the implementation of profiling, and so
 # can't be profiled themselves.
-COPTS.pthread_specific.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
+COPTS.pthread_specific.c+=	${ALIGN_FUNCTIONS}
 pthread_specific.po: pthread_specific.o
 	${_MKTARGET_CREATE}
 	cp pthread_specific.o pthread_specific.po
 
-# Internal spinlock routines are performance critical.  Don't profile them,
-# it's incompatibile with -fomit-frame-pointer.
-COPTS.pthread_lock.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
-pthread_lock.po: pthread_lock.o
-	${_MKTARGET_CREATE}
-	cp pthread_lock.o pthread_lock.po
-
-COPTS.pthread_mutex.c+=	${OMIT_FRAME_POINTER} ${ALIGN_FUNCTIONS}
-pthread_mutex.po: pthread_mutex.o
-	${_MKTARGET_CREATE}
-	cp pthread_mutex.o pthread_mutex.po
-
 COPTS.pthread.c += -Wno-stack-protector -Wno-format-nonliteral
 COPTS.pthread_attr.c += -Wno-format-nonliteral
 



CVS commit: src/share/mk

2018-02-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Feb 25 18:53:23 UTC 2018

Modified Files:
src/share/mk: bsd.host.mk sys.mk

Log Message:
add DTRACE_OPTS and HOST_DTRACE_OPTS to allow disabling various optimizations
that interfere with using dtrace.  use them when MKDTRACE=yes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/mk/bsd.host.mk
cvs rdiff -u -r1.129 -r1.130 src/share/mk/sys.mk

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

Modified files:

Index: src/share/mk/bsd.host.mk
diff -u src/share/mk/bsd.host.mk:1.3 src/share/mk/bsd.host.mk:1.4
--- src/share/mk/bsd.host.mk:1.3	Sat Feb 20 15:18:46 2016
+++ src/share/mk/bsd.host.mk	Sun Feb 25 18:53:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.host.mk,v 1.3 2016/02/20 15:18:46 christos Exp $
+#	$NetBSD: bsd.host.mk,v 1.4 2018/02/25 18:53:23 chs Exp $
 
 .if !defined(_BSD_HOST_MK_)
 _BSD_HOST_MK_=1
@@ -9,11 +9,16 @@ HOST_DBG?= -g
 HOST_DBG?= -O
 .endif
 
+.if ${MKDTRACE:Uno} != "no"
+# disable compiler options that interfere with dtrace
+HOST_DTRACE_OPTS?=	-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-ipa-sra
+.endif
+
 # Helpers for cross-compiling
 HOST_CC?=	cc
 HOST_CFLAGS?=	${HOST_DBG}
-HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
-HOST_COMPILE.cc?=  ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
+HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_DTRACE_OPTS} ${HOST_CPPFLAGS} -c
+HOST_COMPILE.cc?=  ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_DTRACE_OPTS} ${HOST_CPPFLAGS} -c
 HOST_LINK.cc?=  ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
 .if defined(HOSTPROG_CXX)
 HOST_LINK.c?=   ${HOST_LINK.cc}

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.129 src/share/mk/sys.mk:1.130
--- src/share/mk/sys.mk:1.129	Wed Mar 30 17:35:43 2016
+++ src/share/mk/sys.mk	Sun Feb 25 18:53:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.129 2016/03/30 17:35:43 martin Exp $
+#	$NetBSD: sys.mk,v 1.130 2018/02/25 18:53:23 chs Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -37,9 +37,12 @@ DBG?=	-O2 ${"${.TARGET:M*.po}" == "":? -
 .else
 DBG?=	-O2
 .endif
+.if ${MKDTRACE:Uno} != "no"
+DTRACE_OPTS?=	-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-ipa-sra -fno-ipa-icf
+.endif
 CFLAGS?=	${DBG}
 LDFLAGS?=
-COMPILE.c?=	${CC} ${CFLAGS} ${CPPFLAGS} -c
+COMPILE.c?=	${CC} ${CFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c
 LINK.c?=	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
 
 # C Type Format data is required for DTrace
@@ -55,7 +58,7 @@ __ALLSRC3=	${empty(NETBSDSRCDIR):?${__AL
 __BUILDSEED=	${BUILDSEED}/${__ALLSRC3:O}/${.TARGET}
 _CXXSEED?=	${BUILDSEED:D-frandom-seed=${__BUILDSEED:hash}}
 
-COMPILE.cc?=	${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
+COMPILE.cc?=	${CXX} ${_CXXSEED} ${CXXFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c
 LINK.cc?=	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
 
 OBJC?=		${CC}



CVS commit: src/sys/kern

2018-02-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Feb 25 18:54:29 UTC 2018

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

Log Message:
add defines to control whether or not mutex operations are skipped
after we have panic'd.  no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/kern_mutex.c

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

Modified files:

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.72 src/sys/kern/kern_mutex.c:1.73
--- src/sys/kern/kern_mutex.c:1.72	Tue Feb  6 07:46:24 2018
+++ src/sys/kern/kern_mutex.c	Sun Feb 25 18:54:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.72 2018/02/06 07:46:24 ozaki-r Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.73 2018/02/25 18:54:29 chs Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.72 2018/02/06 07:46:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.73 2018/02/25 18:54:29 chs Exp $");
 
 #include 
 #include 
@@ -60,6 +60,9 @@ __KERNEL_RCSID(0, "$NetBSD: kern_mutex.c
 
 #include 
 
+#define MUTEX_PANIC_SKIP_SPIN 1
+#define MUTEX_PANIC_SKIP_ADAPTIVE 1
+
 /*
  * When not running a debug kernel, spin mutexes are not much
  * more than an splraiseipl() and splx() pair.
@@ -489,8 +492,10 @@ mutex_vector_enter(kmutex_t *mtx)
 		 * to reduce cache line ping-ponging between CPUs.
 		 */
 		do {
+#if MUTEX_PANIC_SKIP_SPIN
 			if (panicstr != NULL)
 break;
+#endif
 			while (MUTEX_SPINBIT_LOCKED_P(mtx)) {
 SPINLOCK_BACKOFF(count);
 #ifdef LOCKDEBUG
@@ -547,10 +552,12 @@ mutex_vector_enter(kmutex_t *mtx)
 			owner = mtx->mtx_owner;
 			continue;
 		}
+#if MUTEX_PANIC_SKIP_ADAPTIVE
 		if (__predict_false(panicstr != NULL)) {
 			KPREEMPT_ENABLE(curlwp);
 			return;
 		}
+#endif
 		if (__predict_false(MUTEX_OWNER(owner) == curthread)) {
 			MUTEX_ABORT(mtx, "locking against myself");
 		}
@@ -726,8 +733,10 @@ mutex_vector_exit(kmutex_t *mtx)
 	if (MUTEX_SPIN_P(mtx)) {
 #ifdef FULL
 		if (__predict_false(!MUTEX_SPINBIT_LOCKED_P(mtx))) {
+#if MUTEX_PANIC_SKIP_SPIN
 			if (panicstr != NULL)
 return;
+#endif
 			MUTEX_ABORT(mtx, "exiting unheld spin mutex");
 		}
 		MUTEX_UNLOCKED(mtx);
@@ -737,11 +746,13 @@ mutex_vector_exit(kmutex_t *mtx)
 		return;
 	}
 
+#ifdef MUTEX_PANIC_SKIP_ADAPTIVE
 	if (__predict_false((uintptr_t)panicstr | cold)) {
 		MUTEX_UNLOCKED(mtx);
 		MUTEX_RELEASE(mtx);
 		return;
 	}
+#endif
 
 	curthread = (uintptr_t)curlwp;
 	MUTEX_DASSERT(mtx, curthread != 0);
@@ -932,8 +943,10 @@ mutex_spin_retry(kmutex_t *mtx)
 	 * to reduce cache line ping-ponging between CPUs.
 	 */
 	do {
+#if MUTEX_PANIC_SKIP_SPIN
 		if (panicstr != NULL)
 			break;
+#endif
 		while (MUTEX_SPINBIT_LOCKED_P(mtx)) {
 			SPINLOCK_BACKOFF(count);
 #ifdef LOCKDEBUG



CVS commit: src/sys/sys

2018-02-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Feb 25 18:55:23 UTC 2018

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

Log Message:
add definitions of FIOSEEKDATA and FIOSEEKHOLE for ZFS.
from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/filio.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/filio.h
diff -u src/sys/sys/filio.h:1.10 src/sys/sys/filio.h:1.11
--- src/sys/sys/filio.h:1.10	Sun Dec 11 12:25:20 2005
+++ src/sys/sys/filio.h	Sun Feb 25 18:55:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: filio.h,v 1.10 2005/12/11 12:25:20 christos Exp $	*/
+/*	$NetBSD: filio.h,v 1.11 2018/02/25 18:55:23 chs Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993, 1994
@@ -44,6 +44,9 @@
 /* Generic file-descriptor ioctl's. */
 #define	FIOCLEX		 _IO('f', 1)		/* set close on exec on fd */
 #define	FIONCLEX	 _IO('f', 2)		/* remove close on exec */
+/* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */
+#define	FIOSEEKDATA	_IOWR('f', 97, off_t)	/* SEEK_DATA */
+#define	FIOSEEKHOLE	_IOWR('f', 98, off_t)	/* SEEK_HOLE */
 #define	FIONREAD	_IOR('f', 127, int)	/* get # bytes to read */
 #define	FIONBIO		_IOW('f', 126, int)	/* set/clear non-blocking i/o */
 #define	FIOASYNC	_IOW('f', 125, int)	/* set/clear async i/o */
@@ -55,7 +58,6 @@
 		 * in send queue. */
 #define	FIONSPACE	_IOR('f', 120, int)	/* get space in send queue. */
 
-
 /* Ugly symbol for compatibility with other operating systems */
 #define	FIBMAP		FIOGETBMAP
 



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 19:22:42 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: mDNSPosix.c

Log Message:
zero out socket structures before bind.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c

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

Modified files:

Index: src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.13 src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.14
--- src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.13	Wed Jan 17 01:10:27 2018
+++ src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c	Sun Feb 25 14:22:41 2018
@@ -745,6 +745,10 @@ mDNSlocal int SetupSocket(struct sockadd
 // And start listening for packets
 if (err == 0)
 {
+	mDNSPlatformMemZero(&bindAddr, sizeof(bindAddr));
+#ifndef NOT_HAVE_SA_LEN
+	bindAddr.sin_len = sizeof(bindAddr);
+#endif
 bindAddr.sin_family  = AF_INET;
 bindAddr.sin_port= port.NotAnInteger;
 bindAddr.sin_addr.s_addr = INADDR_ANY; // Want to receive multicasts AND unicasts on this socket
@@ -1054,6 +1058,9 @@ mDNSlocal mStatus OpenIfNotifySocket(int
 
 /* Subscribe the socket to Link & IP addr notifications. */
 mDNSPlatformMemZero(&snl, sizeof snl);
+#ifndef NOT_HAVE_SA_LEN
+snl.nl_len= sizeof(snl);
+#endif
 snl.nl_family = AF_NETLINK;
 snl.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
 ret = bind(sock, (struct sockaddr *) &snl, sizeof snl);
@@ -1266,6 +1273,11 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanR
 int err;
 int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 struct sockaddr_in s5353;
+
+mDNSPlatformMemZero(&s5353, sizeof(s5353));
+#ifndef NOT_HAVE_SA_LEN
+s5353.sin_len = sizeof(s5353);
+#endif
 s5353.sin_family  = AF_INET;
 s5353.sin_port= MulticastDNSPort.NotAnInteger;
 s5353.sin_addr.s_addr = 0;



CVS import: src/external/apache2/mDNSResponder/dist

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 19:25:36 UTC 2018

Update of /cvsroot/src/external/apache2/mDNSResponder/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv12806

Log Message:
import latest

Status:

Vendor Tag: APPLE
Release Tags:   mdnsresponder-878-30-4

U src/external/apache2/mDNSResponder/dist/LICENSE
N src/external/apache2/mDNSResponder/dist/.gitignore
U src/external/apache2/mDNSResponder/dist/Clients/dnssdutil.c
U src/external/apache2/mDNSResponder/dist/Clients/dnsctl.c
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.c
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.h
U src/external/apache2/mDNSResponder/dist/Clients/dns-sd.c
U src/external/apache2/mDNSResponder/dist/unittests/mDNSCoreReceiveTest.h
U src/external/apache2/mDNSResponder/dist/unittests/uds_daemon_ut.c
U src/external/apache2/mDNSResponder/dist/unittests/DNSMessageTest.h
U src/external/apache2/mDNSResponder/dist/unittests/LocalOnlyTimeoutTests.h
U src/external/apache2/mDNSResponder/dist/unittests/InterfaceTest.c
U src/external/apache2/mDNSResponder/dist/unittests/mDNSCoreReceiveTest.c
U src/external/apache2/mDNSResponder/dist/unittests/CNameRecordTests.h
U src/external/apache2/mDNSResponder/dist/unittests/unittest_common.h
U src/external/apache2/mDNSResponder/dist/unittests/unittest.h
U src/external/apache2/mDNSResponder/dist/unittests/daemon_ut.c
U src/external/apache2/mDNSResponder/dist/unittests/DomainNameTest.h
U src/external/apache2/mDNSResponder/dist/unittests/ResourceRecordTest.h
U src/external/apache2/mDNSResponder/dist/unittests/LocalOnlyTimeoutTests.c
U src/external/apache2/mDNSResponder/dist/unittests/InterfaceTest.h
U src/external/apache2/mDNSResponder/dist/unittests/main.c
U src/external/apache2/mDNSResponder/dist/unittests/DNSMessageTest.c
U src/external/apache2/mDNSResponder/dist/unittests/DomainNameTest.c
U src/external/apache2/mDNSResponder/dist/unittests/unittest.c
U src/external/apache2/mDNSResponder/dist/unittests/unittest_common.c
U src/external/apache2/mDNSResponder/dist/unittests/CNameRecordTests.c
U src/external/apache2/mDNSResponder/dist/unittests/mdns_ut.c
U src/external/apache2/mDNSResponder/dist/unittests/ResourceRecordTest.c
U src/external/apache2/mDNSResponder/dist/unittests/mdns_macosx_ut.c
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSDebug.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.c
C src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/DNSDigest.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.h
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientlib.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd_internal.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/CommonServices.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd_private.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/GenLinkedList.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/dns-sd.1
U src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSDebug.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnsextd_parser.y
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientstub.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8
U src/external/apache2/mDNSResponder/dist/mDNSShared/Ge

CVS commit: src/external/apache2/mDNSResponder

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 20:04:56 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder: prepare-import.sh
src/external/apache2/mDNSResponder/dist/mDNSCore: mDNS.c
mDNSEmbeddedAPI.h uDNS.c
src/external/apache2/mDNSResponder/dist/mDNSPosix: mDNSPosix.c
src/external/apache2/mDNSResponder/dist/mDNSShared: dns_sd.h

Log Message:
merge conflicts; also:
- Do the reuse-port first like MacOS/X otherwise we can't bind
- Disable SO_RECV_ANYIF hack


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/apache2/mDNSResponder/prepare-import.sh
cvs rdiff -u -r1.8 -r1.9 \
src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
cvs rdiff -u -r1.14 -r1.15 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h

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

Modified files:

Index: src/external/apache2/mDNSResponder/prepare-import.sh
diff -u src/external/apache2/mDNSResponder/prepare-import.sh:1.4 src/external/apache2/mDNSResponder/prepare-import.sh:1.5
--- src/external/apache2/mDNSResponder/prepare-import.sh:1.4	Sun Jan 14 17:51:12 2018
+++ src/external/apache2/mDNSResponder/prepare-import.sh	Sun Feb 25 15:04:55 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.4 2018/01/14 22:51:12 christos Exp $
+# $NetBSD: prepare-import.sh,v 1.5 2018/02/25 20:04:55 christos Exp $
 #
 # Extract the new tarball and run this script with the first argument
 # the mDNSResponder-X.Y directory that was created. cd to that directory
@@ -10,8 +10,8 @@
 
 set -e
 cd "$1"
-rm -rf mDNSMacOS9 mDNSMacOSX mDNSVxWorks mDNSWindows
-rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt Documents
+rm -rf mDNSMacOS9 mDNSMacOSX mDNSVxWorks mDNSWindows Documents
+rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt
 
 (cd Clients
 rm -rf BonjourExample DNS-SD.VisualStudio DNS-SD.xcodeproj

Index: src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c:1.8 src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c:1.9
--- src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c:1.8	Sun Jan 14 15:04:55 2018
+++ src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c	Sun Feb 25 15:04:56 2018
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -4172,12 +4172,12 @@ mDNSexport void AnswerCurrentQuestionWit
 responseLatencyMs = 0;
 }
 
-MetricsUpdateUDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
+MetricsUpdateDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
 q->metrics.answered = mDNStrue;
 }
 if (q->metrics.querySendCount > 0)
 {
-MetricsUpdateUDNSResolveStats(queryName, &rr->resrec, isForCellular);
+MetricsUpdateDNSResolveStats(queryName, &rr->resrec, isForCellular);
 }
 }
 #endif
@@ -8946,6 +8946,13 @@ mDNSlocal void mDNSCoreReceiveResponse(m
response->h.numAuthorities, response->h.numAuthorities == 1 ? "y,  " : "ies,",
response->h.numAdditionals, response->h.numAdditionals == 1 ? " ": "s", end - response->data, LLQType);
 
+#if AWD_METRICS
+if (mDNSSameIPPort(srcport, UnicastDNSPort))
+{
+MetricsUpdateDNSResponseSize((mDNSu32)(end - (mDNSu8 *)response));
+}
+#endif
+
 // According to RFC 2181 
 //When a DNS client receives a reply with TC
 //set, it should ignore that response, and query again, using a
@@ -12129,7 +12136,7 @@ mDNSexport mStatus mDNS_StopQuery_intern
 queryName  = question->metrics.originalQName ? question->metrics.originalQName : &question->qname;
 isForCell  = (question->qDNSServer && question->qDNSServer->cellIntf);
 durationMs = ((m->timenow - question->metrics.firstQueryTime) * 1000) / mDNSPlatformOneSecond;
-MetricsUpdateUDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
+MetricsUpdateDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
 }
 #endif
 // Take care to cut question from list *before* calling UpdateQuestion

CVS commit: src/external/apache2/mDNSResponder/dist/mDNSShared

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 21:06:40 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSShared: mDNSResponder.8

Log Message:
update upstream code changes in signal handling.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8

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

Modified files:

Index: src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8
diff -u src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8:1.1.1.4 src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8:1.2
--- src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8:1.1.1.4	Sun Jan 14 14:40:51 2018
+++ src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8	Sun Feb 25 16:06:40 2018
@@ -14,7 +14,7 @@
 .\" See the License for the specific language governing permissions and
 .\" limitations under the License.
 .\"
-.Dd April 2004  \" Date
+.Dd Feb 25, 2018  \" Date
 .Dt mDNSResponder 8 \" Document Title
 .Os Darwin  \" Operating System
 .\"
@@ -61,23 +61,24 @@ logging levels map as follows:
 .Dl Info - Informational messages
 .Pp
 By default, only log level Error is logged.
-.Pp
-A SIGUSR1 signal toggles additional logging, with Warning and Notice
-enabled by default:
-.Pp
-.Dl % sudo killall -USR1 mDNSResponder
+.\" .Pp
+.\" A SIGUSR1 signal toggles additional logging, with Warning and Notice
+.\" enabled by default:
+.\" .Pp
+.\" .Dl % sudo killall -USR1 mDNSResponder
 .Pp
 Once this logging is enabled, users can additionally use syslog(1)
 to change the log filter for the process. For example, to enable log levels Emergency - Debug:
 .Pp
 .Dl % sudo syslog -c mDNSResponder -d
-.Pp
-A SIGUSR2 signal toggles packet logging:
-.Pp
-.Dl % sudo killall -USR2 mDNSResponder
-.Pp
-A SIGINFO signal will dump a snapshot summary of the internal state to 
-.Pa /var/log/system.log Ns :
+.\" .Pp
+.\" A SIGUSR2 signal toggles packet logging:
+.\" .Pp
+.\" .Dl % sudo killall -USR2 mDNSResponder
+.Pp
+A SIGUSR1 signal will dump a snapshot summary of the internal state to 
+.\" .Pa /var/log/system.log Ns :
+.Xr syslog 8 .
 .Pp
 .Dl % sudo killall -INFO mDNSResponder
 .Sh OPTIONAL ARGUMENTS



CVS commit: [netbsd-8] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:01:13 UTC 2018

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

Log Message:
586


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.128 -r1.1.2.129 src/doc/CHANGES-8.0

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.0
diff -u src/doc/CHANGES-8.0:1.1.2.128 src/doc/CHANGES-8.0:1.1.2.129
--- src/doc/CHANGES-8.0:1.1.2.128	Mon Feb 19 19:08:18 2018
+++ src/doc/CHANGES-8.0	Sun Feb 25 21:01:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.128 2018/02/19 19:08:18 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.129 2018/02/25 21:01:13 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9717,3 +9717,13 @@ share/man/man4/gif.41.31
 	requested in PR kern/53037.
 	[pgoyette, ticket #560]
 
+tests/lib/libc/sys/t_ptrace_amd64_wait.h	1.2
+tests/lib/libc/sys/t_ptrace_i386_wait.h		1.2
+tests/lib/libc/sys/t_ptrace_wait.c		1.10-1.20
+tests/lib/libc/sys/t_ptrace_x86_wait.h		1.2-1.3
+
+	Sync some ptrace tests with -current.
+	This mostly disables a few tests that fail or hang various
+	test environments.
+	[martin, ticket #586]
+



CVS commit: [netbsd-7-1] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:15:39 UTC 2018

Modified Files:
src/sys/arch/amiga/conf [netbsd-7-1]: DRACO GENERIC GENERIC.in
src/sys/arch/i386/conf [netbsd-7-1]: GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/sparc/conf [netbsd-7-1]: GENERIC KRUPS MRCOFFEE TADPOLE3GX
src/sys/arch/sparc64/conf [netbsd-7-1]: GENERIC NONPLUS64
src/sys/kern [netbsd-7-1]: kern_exec.c

Log Message:
Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.175.8.1 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.307.2.2 -r1.307.2.2.6.1 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.125.2.2 -r1.125.2.2.6.1 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.1107.2.9.2.1 -r1.1107.2.9.2.2 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.85.2.6 -r1.85.2.6.2.1 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.59.2.5 -r1.59.2.5.6.1 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.243.4.3 -r1.243.4.3.6.1 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.66 -r1.66.10.1 src/sys/arch/sparc/conf/KRUPS
cvs rdiff -u -r1.45 -r1.45.10.1 src/sys/arch/sparc/conf/MRCOFFEE
cvs rdiff -u -r1.61.4.2 -r1.61.4.2.6.1 src/sys/arch/sparc/conf/TADPOLE3GX
cvs rdiff -u -r1.171.4.4 -r1.171.4.4.6.1 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.41.4.2 -r1.41.4.2.6.1 src/sys/arch/sparc64/conf/NONPLUS64
cvs rdiff -u -r1.408.2.4 -r1.408.2.4.4.1 src/sys/kern/kern_exec.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/amiga/conf/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.175 src/sys/arch/amiga/conf/DRACO:1.175.8.1
--- src/sys/arch/amiga/conf/DRACO:1.175	Sat Jul  5 10:00:42 2014
+++ src/sys/arch/amiga/conf/DRACO	Sun Feb 25 21:15:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.175 2014/07/05 10:00:42 tsutsui Exp $
+# $NetBSD: DRACO,v 1.175.8.1 2018/02/25 21:15:38 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.175 $"
+#ident 		"GENERIC-$Revision: 1.175.8.1 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -140,7 +140,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.307.2.2 src/sys/arch/amiga/conf/GENERIC:1.307.2.2.6.1
--- src/sys/arch/amiga/conf/GENERIC:1.307.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC	Sun Feb 25 21:15:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.307.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC,v 1.307.2.2.6.1 2018/02/25 21:15:38 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.307.2.2 $"
+#ident 		"GENERIC-$Revision: 1.307.2.2.6.1 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -153,7 +153,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC.in
diff -u src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2 src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2.6.1
--- src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC.in	Sun Feb 25 21:15:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.125.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC.in,v 1.125.2.2.6.1 2018/02/25 21:15:38 snj Exp $
 #
 ##
 # GENERIC machine description file
@@ -52,7 +52,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.125.2.2 $"
+#ident 		"GENERIC-$Revision: 1.125.2.2.6.1 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', 

CVS commit: [netbsd-7-1] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:16:25 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.2

Log Message:
1499


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/doc/CHANGES-7.1.2

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-7.1.2
diff -u src/doc/CHANGES-7.1.2:1.1.2.16 src/doc/CHANGES-7.1.2:1.1.2.17
--- src/doc/CHANGES-7.1.2:1.1.2.16	Sat Feb 24 18:30:46 2018
+++ src/doc/CHANGES-7.1.2	Sun Feb 25 21:16:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.2,v 1.1.2.16 2018/02/24 18:30:46 snj Exp $
+# $NetBSD: CHANGES-7.1.2,v 1.1.2.17 2018/02/25 21:16:25 snj Exp $
 
 A complete list of changes from the NetBSD 7.1.1 release to the NetBSD 7.1.2
 release:
@@ -157,3 +157,22 @@ sys/netmpls/mpls_ttl.c1.9
	Fix several memory corruptions and inconsistencies in MPLS.
 	[maxv, ticket #1571]
 
+sys/arch/amiga/conf/DRACO			patch
+sys/arch/amiga/conf/GENERIC			patch
+sys/arch/amiga/conf/GENERIC.in			patch
+sys/arch/i386/conf/GENERIC			patch
+sys/arch/i386/conf/XEN3_DOM0			patch
+sys/arch/i386/conf/XEN3_DOMU			patch
+sys/arch/sparc/conf/GENERIC			patch
+sys/arch/sparc/conf/KRUPS			patch
+sys/arch/sparc/conf/MRCOFFEE			patch
+sys/arch/sparc/conf/TADPOLE3GX			patch
+sys/arch/sparc64/conf/GENERIC			patch
+sys/arch/sparc64/conf/NONPLUS64			patch
+sys/kern/kern_exec.cpatch
+
+	- disable compat_svr4 and compat_svr4_32 everywhere
+	- disable compat_ibcs2 everywhere but on Vax
+	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
+	[maxv, ticket #1499]
+



CVS commit: [netbsd-7] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:16:07 UTC 2018

Modified Files:
src/sys/arch/amiga/conf [netbsd-7]: DRACO GENERIC GENERIC.in
src/sys/arch/i386/conf [netbsd-7]: GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/sparc/conf [netbsd-7]: GENERIC KRUPS MRCOFFEE TADPOLE3GX
src/sys/arch/sparc64/conf [netbsd-7]: GENERIC NONPLUS64
src/sys/kern [netbsd-7]: kern_exec.c

Log Message:
Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.175.2.1 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.307.2.2 -r1.307.2.3 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.125.2.2 -r1.125.2.3 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.1107.2.12 -r1.1107.2.13 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.85.2.9 -r1.85.2.10 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.59.2.5 -r1.59.2.6 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.243.4.3 -r1.243.4.4 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.66 -r1.66.4.1 src/sys/arch/sparc/conf/KRUPS
cvs rdiff -u -r1.45 -r1.45.4.1 src/sys/arch/sparc/conf/MRCOFFEE
cvs rdiff -u -r1.61.4.2 -r1.61.4.3 src/sys/arch/sparc/conf/TADPOLE3GX
cvs rdiff -u -r1.171.4.4 -r1.171.4.5 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.41.4.2 -r1.41.4.3 src/sys/arch/sparc64/conf/NONPLUS64
cvs rdiff -u -r1.408.2.4 -r1.408.2.5 src/sys/kern/kern_exec.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/amiga/conf/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.175 src/sys/arch/amiga/conf/DRACO:1.175.2.1
--- src/sys/arch/amiga/conf/DRACO:1.175	Sat Jul  5 10:00:42 2014
+++ src/sys/arch/amiga/conf/DRACO	Sun Feb 25 21:16:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.175 2014/07/05 10:00:42 tsutsui Exp $
+# $NetBSD: DRACO,v 1.175.2.1 2018/02/25 21:16:07 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.175 $"
+#ident 		"GENERIC-$Revision: 1.175.2.1 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -140,7 +140,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.307.2.2 src/sys/arch/amiga/conf/GENERIC:1.307.2.3
--- src/sys/arch/amiga/conf/GENERIC:1.307.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC	Sun Feb 25 21:16:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.307.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC,v 1.307.2.3 2018/02/25 21:16:07 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.307.2.2 $"
+#ident 		"GENERIC-$Revision: 1.307.2.3 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -153,7 +153,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC.in
diff -u src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2 src/sys/arch/amiga/conf/GENERIC.in:1.125.2.3
--- src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC.in	Sun Feb 25 21:16:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.125.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC.in,v 1.125.2.3 2018/02/25 21:16:07 snj Exp $
 #
 ##
 # GENERIC machine description file
@@ -52,7 +52,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.125.2.2 $"
+#ident 		"GENERIC-$Revision: 1.125.2.3 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
 makeoptions	COPTS="-Os"
@@ -195,7 +195,7 @@ options 	COMPAT_40	# Net

CVS commit: [netbsd-7-0] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:16:33 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1499


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.86 -r1.1.2.87 src/doc/CHANGES-7.0.3

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-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.86 src/doc/CHANGES-7.0.3:1.1.2.87
--- src/doc/CHANGES-7.0.3:1.1.2.86	Sat Feb 24 18:30:39 2018
+++ src/doc/CHANGES-7.0.3	Sun Feb 25 21:16:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.86 2018/02/24 18:30:39 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.87 2018/02/25 21:16:33 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5269,3 +5269,22 @@ sys/netmpls/mpls_ttl.c1.9
	Fix several memory corruptions and inconsistencies in MPLS.
 	[maxv, ticket #1571]
 
+sys/arch/amiga/conf/DRACO			patch
+sys/arch/amiga/conf/GENERIC			patch
+sys/arch/amiga/conf/GENERIC.in			patch
+sys/arch/i386/conf/GENERIC			patch
+sys/arch/i386/conf/XEN3_DOM0			patch
+sys/arch/i386/conf/XEN3_DOMU			patch
+sys/arch/sparc/conf/GENERIC			patch
+sys/arch/sparc/conf/KRUPS			patch
+sys/arch/sparc/conf/MRCOFFEE			patch
+sys/arch/sparc/conf/TADPOLE3GX			patch
+sys/arch/sparc64/conf/GENERIC			patch
+sys/arch/sparc64/conf/NONPLUS64			patch
+sys/kern/kern_exec.cpatch
+
+	- disable compat_svr4 and compat_svr4_32 everywhere
+	- disable compat_ibcs2 everywhere but on Vax
+	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
+	[maxv, ticket #1499]
+



CVS commit: [netbsd-7] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:15:52 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 src/doc/CHANGES-7.2

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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.72 src/doc/CHANGES-7.2:1.1.2.73
--- src/doc/CHANGES-7.2:1.1.2.72	Sat Feb 24 18:30:56 2018
+++ src/doc/CHANGES-7.2	Sun Feb 25 21:15:52 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.72 2018/02/24 18:30:56 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.73 2018/02/25 21:15:52 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5223,3 +5223,22 @@ sys/netmpls/mpls_ttl.c1.9
	Fix several memory corruptions and inconsistencies in MPLS.
 	[maxv, ticket #1571]
 
+sys/arch/amiga/conf/DRACO			patch
+sys/arch/amiga/conf/GENERIC			patch
+sys/arch/amiga/conf/GENERIC.in			patch
+sys/arch/i386/conf/GENERIC			patch
+sys/arch/i386/conf/XEN3_DOM0			patch
+sys/arch/i386/conf/XEN3_DOMU			patch
+sys/arch/sparc/conf/GENERIC			patch
+sys/arch/sparc/conf/KRUPS			patch
+sys/arch/sparc/conf/MRCOFFEE			patch
+sys/arch/sparc/conf/TADPOLE3GX			patch
+sys/arch/sparc64/conf/GENERIC			patch
+sys/arch/sparc64/conf/NONPLUS64			patch
+sys/kern/kern_exec.cpatch
+
+	- disable compat_svr4 and compat_svr4_32 everywhere
+	- disable compat_ibcs2 everywhere but on Vax
+	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
+	[maxv, ticket #1499]
+



CVS commit: [netbsd-7-0] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 21:15:20 UTC 2018

Modified Files:
src/sys/arch/amiga/conf [netbsd-7-0]: DRACO GENERIC GENERIC.in
src/sys/arch/i386/conf [netbsd-7-0]: GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/sparc/conf [netbsd-7-0]: GENERIC KRUPS MRCOFFEE TADPOLE3GX
src/sys/arch/sparc64/conf [netbsd-7-0]: GENERIC NONPLUS64
src/sys/kern [netbsd-7-0]: kern_exec.c

Log Message:
Apply patch (requested by maxv in ticket #1499):
- disable compat_svr4 and compat_svr4_32 everywhere
- disable compat_ibcs2 everywhere but on Vax
- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.175.4.1 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.307.2.2 -r1.307.2.2.2.1 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.125.2.2 -r1.125.2.2.2.1 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.1107.2.8.2.1 -r1.1107.2.8.2.2 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.85.2.5 -r1.85.2.5.2.1 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.59.2.5 -r1.59.2.5.2.1 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.243.4.3 -r1.243.4.3.2.1 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.66 -r1.66.6.1 src/sys/arch/sparc/conf/KRUPS
cvs rdiff -u -r1.45 -r1.45.6.1 src/sys/arch/sparc/conf/MRCOFFEE
cvs rdiff -u -r1.61.4.2 -r1.61.4.2.2.1 src/sys/arch/sparc/conf/TADPOLE3GX
cvs rdiff -u -r1.171.4.4 -r1.171.4.4.2.1 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.41.4.2 -r1.41.4.2.2.1 src/sys/arch/sparc64/conf/NONPLUS64
cvs rdiff -u -r1.408.2.3.2.1 -r1.408.2.3.2.2 src/sys/kern/kern_exec.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/amiga/conf/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.175 src/sys/arch/amiga/conf/DRACO:1.175.4.1
--- src/sys/arch/amiga/conf/DRACO:1.175	Sat Jul  5 10:00:42 2014
+++ src/sys/arch/amiga/conf/DRACO	Sun Feb 25 21:15:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.175 2014/07/05 10:00:42 tsutsui Exp $
+# $NetBSD: DRACO,v 1.175.4.1 2018/02/25 21:15:19 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.175 $"
+#ident 		"GENERIC-$Revision: 1.175.4.1 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -140,7 +140,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.307.2.2 src/sys/arch/amiga/conf/GENERIC:1.307.2.2.2.1
--- src/sys/arch/amiga/conf/GENERIC:1.307.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC	Sun Feb 25 21:15:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.307.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC,v 1.307.2.2.2.1 2018/02/25 21:15:19 snj Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.307.2.2 $"
+#ident 		"GENERIC-$Revision: 1.307.2.2.2.1 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -153,7 +153,7 @@ options 	COMPAT_40	# NetBSD 4.0 compatib
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_60	# NetBSD 6.0 compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC.in
diff -u src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2 src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2.2.1
--- src/sys/arch/amiga/conf/GENERIC.in:1.125.2.2	Tue Nov 18 19:05:28 2014
+++ src/sys/arch/amiga/conf/GENERIC.in	Sun Feb 25 21:15:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.125.2.2 2014/11/18 19:05:28 snj Exp $
+# $NetBSD: GENERIC.in,v 1.125.2.2.2.1 2018/02/25 21:15:19 snj Exp $
 #
 ##
 # GENERIC machine description file
@@ -52,7 +52,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.125.2.2 $"
+#ident 		"GENERIC-$Revision: 1.125.2.2.2.1 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION'

CVS commit: src/sys/uvm/pmap

2018-02-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Feb 25 21:43:03 UTC 2018

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
fix the DIAGNOSTIC function pmap_tlb_asid_count() to not expect
that TLBINFO_ASID_INUSE_P() returns just 0 or 1; the underlying
__BITMAP_ISSET() actually returns the matching bit nowadays, which
caused miscounting

fixes PR kern/53054 by Sevan Janiyan


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.27 src/sys/uvm/pmap/pmap_tlb.c:1.28
--- src/sys/uvm/pmap/pmap_tlb.c:1.27	Sun Feb 25 16:44:31 2018
+++ src/sys/uvm/pmap/pmap_tlb.c	Sun Feb 25 21:43:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.28 2018/02/25 21:43:03 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.27 2018/02/25 16:44:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.28 2018/02/25 21:43:03 jdolecek Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -409,7 +409,8 @@ pmap_tlb_asid_count(struct pmap_tlb_info
 {
 	size_t count = 0;
 	for (tlb_asid_t asid = 1; asid <= ti->ti_asid_max; asid++) {
-		count += TLBINFO_ASID_INUSE_P(ti, asid);
+		if (TLBINFO_ASID_INUSE_P(ti, asid))
+			count++;
 	}
 	return count;
 }



CVS commit: src/sys/arch

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 22:00:22 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
As requested by chuq@, add the new imc devices to the i386 and amd64
ALL kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.433 -r1.434 src/sys/arch/i386/conf/ALL

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/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.81 src/sys/arch/amd64/conf/ALL:1.82
--- src/sys/arch/amd64/conf/ALL:1.81	Mon Feb 12 23:11:00 2018
+++ src/sys/arch/amd64/conf/ALL	Sun Feb 25 22:00:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.81 2018/02/12 23:11:00 joerg Exp $
+# $NetBSD: ALL,v 1.82 2018/02/25 22:00:22 pgoyette Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.81 $"
+#ident		"ALL-$Revision: 1.82 $"
 
 maxusers	64		# estimated number of users
 
@@ -596,6 +596,11 @@ wbsio*	at isa? port 0x4e
 # IBM Hawk Integrated Systems Management Processor
 ibmhawk0	at iic? addr 0x37
 
+# Intel Integrated Memory Controller SMBus (experimental)
+imc* at pci? dev ? function ?		# Intel Integrated Memory Controller,
+imcsmb* at imc?# the associated SMBus controller,
+iic* at imcsmb?# and the SMBus itself
+
 # LM7[89] and compatible hardware monitors
 # Use flags to select temp sensor type (see lm(4) man page for details)
 lm0	at isa?	port 0x290 flags 0x0	# other common ports: 0x280, 0x310

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.433 src/sys/arch/i386/conf/ALL:1.434
--- src/sys/arch/i386/conf/ALL:1.433	Sun Dec 10 17:52:13 2017
+++ src/sys/arch/i386/conf/ALL	Sun Feb 25 22:00:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.433 2017/12/10 17:52:13 hannken Exp $
+# $NetBSD: ALL,v 1.434 2018/02/25 22:00:22 pgoyette Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.433 $"
+#ident		"ALL-$Revision: 1.434 $"
 
 maxusers	64		# estimated number of users
 
@@ -462,6 +462,11 @@ gpio*	at elansc?
 elanpar*	at elansc?
 elanpex*	at elansc?
 
+# Intel Integrated Memory Controller SMBus (experimental)
+imc* at pci? dev ? function ?		# Intel Integrated Memory Controller,
+imcsmb* at imc?# the associated SMBus controller,
+iic* at imcsmb?# and the SMBus itself
+
 # Temperatures
 amdnb_misc* at pci?			# AMD NB Misc Configuration
 amdtemp* at amdnb_misc?			# AMD CPU Temperature sensors



CVS commit: [netbsd-7] src/sys/modules/lua

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 22:59:28 UTC 2018

Modified Files:
src/sys/modules/lua [netbsd-7]: lua.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1545):
sys/modules/lua/lua.c: up to 1.24
whitespace, knf, comments, but no functional change
--
lua(4): fixed require
--
plug leak on error. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4
--
fix double require bug
--
Use aprint*() instead of printf() in xxx_attach().
--
Check pmf_device_register return value. NFC
Appeases static analyzers.
Can't destroy pb until we're done using it.
--
Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.13.2.6 src/sys/modules/lua/lua.c:1.13.2.7
--- src/sys/modules/lua/lua.c:1.13.2.6	Sun Jul 23 06:03:30 2017
+++ src/sys/modules/lua/lua.c	Sun Feb 25 22:59:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.13.2.6 2017/07/23 06:03:30 snj Exp $ */
+/*	$NetBSD: lua.c,v 1.13.2.7 2018/02/25 22:59:28 snj Exp $ */
 
 /*
  * Copyright (c) 2011 - 2017 by Marc Balmer .
@@ -141,7 +141,8 @@ lua_attach(device_t parent, device_t sel
 	mutex_init(&sc->sc_state_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(&sc->sc_state_cv, "luastate");
 
-	pmf_device_register(self, NULL, NULL);
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	/* Sysctl to provide some control over behaviour */
 sysctl_createv(&sc->sc_log, 0, NULL, &node,
@@ -152,7 +153,7 @@ lua_attach(device_t parent, device_t sel
 CTL_KERN, CTL_CREATE, CTL_EOL);
 
 if (node == NULL) {
-		printf(": can't create sysctl node\n");
+		aprint_error(": can't create sysctl node\n");
 return;
 	}
 
@@ -287,6 +288,7 @@ luaioctl(dev_t dev, u_long cmd, void *da
 	struct pathbuf *pb;
 	struct vattr va;
 	struct lua_loadstate ls;
+	struct lua_state_info *states;
 	int error, n;
 	klua_State *K;
 
@@ -306,14 +308,25 @@ luaioctl(dev_t dev, u_long cmd, void *da
 			LIST_FOREACH(s, &lua_states, lua_next) {
 if (n > info->num_states)
 	break;
-copyoutstr(s->lua_name, info->states[n].name,
-MAX_LUA_NAME, NULL);
-copyoutstr(s->lua_desc, info->states[n].desc,
-MAX_LUA_DESC, NULL);
-info->states[n].user = s->K->ks_user;
 n++;
 			}
 			info->num_states = n;
+			states = kmem_alloc(sizeof(*states) * n, KM_SLEEP);
+			if (copyin(info->states, states, sizeof(*states) * n)
+			== 0) {
+n = 0;
+LIST_FOREACH(s, &lua_states, lua_next) {
+	if (n > info->num_states)
+		break;
+	strcpy(states[n].name, s->lua_name);
+	strcpy(states[n].desc, s->lua_desc);
+	states[n].user = s->K->ks_user;
+	n++;
+}
+copyout(states, info->states,
+sizeof(*states) * n);
+kmem_free(states, sizeof(*states) * n);
+			}
 		}
 		break;
 	case LUACREATE:
@@ -402,8 +415,8 @@ luaioctl(dev_t dev, u_long cmd, void *da
 if (pb == NULL)
 	return ENOMEM;
 NDINIT(&nd, LOOKUP, FOLLOW | NOCHROOT, pb);
-pathbuf_destroy(pb);
 error = vn_open(&nd, FREAD, 0);
+pathbuf_destroy(pb);
 if (error) {
 	if (lua_verbose)
 		device_printf(sc->sc_dev,
@@ -644,7 +657,7 @@ klua_mod_unregister(const char *name)
 
 klua_State *
 klua_newstate(lua_Alloc f, void *ud, const char *name, const char *desc,
-		int ipl)
+int ipl)
 {
 	klua_State *K;
 	struct lua_state *s;
@@ -711,6 +724,7 @@ klua_close(klua_State *K)
 	struct lua_module *m;
 	int error = 0;
 
+	/* XXX consider registering a handler instead of a fixed name. */
 	lua_getglobal(K->L, "onClose");
 	if (lua_isfunction(K->L, -1))
 		lua_pcall(K->L, -1, 0, 0);
@@ -801,9 +815,11 @@ MODULE(MODULE_CLASS_MISC, lua, NULL);
 static const struct cfiattrdata luabus_iattrdata = {
 	"luabus", 0, { { NULL, NULL, 0 },}
 };
+
 static const struct cfiattrdata *const lua_attrs[] = {
 	&luabus_iattrdata, NULL
 };
+
 CFDRIVER_DECL(lua, DV_DULL, lua_attrs);
 extern struct cfattach lua_ca;
 static int lualoc[] = {
@@ -811,6 +827,7 @@ static int lualoc[] = {
 	-1,
 	-1
 };
+
 static struct cfdata lua_cfdata[] = {
 	{
 		.cf_name = "lua",



CVS commit: [netbsd-7] src/sys/netinet6

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:17:47 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-7]: ip6_input.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1572):
sys/netinet6/ip6_input.c: 1.188 via patch
Kick nested fragments.


To generate a diff of this commit:
cvs rdiff -u -r1.149.2.2 -r1.149.2.3 src/sys/netinet6/ip6_input.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/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.149.2.2 src/sys/netinet6/ip6_input.c:1.149.2.3
--- src/sys/netinet6/ip6_input.c:1.149.2.2	Tue Jan 30 18:28:45 2018
+++ src/sys/netinet6/ip6_input.c	Sun Feb 25 23:17:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.149.2.2 2018/01/30 18:28:45 martin Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.149.2.3 2018/02/25 23:17:47 snj Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.2 2018/01/30 18:28:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.3 2018/02/25 23:17:47 snj Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -249,7 +249,7 @@ ip6_input(struct mbuf *m)
 	int hit, off = sizeof(struct ip6_hdr), nest;
 	u_int32_t plen;
 	u_int32_t rtalert = ~0;
-	int nxt, ours = 0, rh_present = 0;
+	int nxt, ours = 0, rh_present = 0, frg_present;
 	struct ifnet *deliverifp = NULL;
 	int srcrt = 0;
 	const struct rtentry *rt;
@@ -720,6 +720,7 @@ ip6_input(struct mbuf *m)
 	nest = 0;
 
 	rh_present = 0;
+	frg_present = 0;
 	while (nxt != IPPROTO_DONE) {
 		if (ip6_hdrnestlimit && (++nest > ip6_hdrnestlimit)) {
 			IP6_STATINC(IP6_STAT_TOOMANYHDR);
@@ -744,6 +745,13 @@ ip6_input(struct mbuf *m)
 IP6_STATINC(IP6_STAT_BADOPTIONS);
 goto bad;
 			}
+		} else if (nxt == IPPROTO_FRAGMENT) {
+			if (frg_present++) {
+in6_ifstat_inc(m->m_pkthdr.rcvif,
+ifs6_in_hdrerr);
+IP6_STATINC(IP6_STAT_BADOPTIONS);
+goto bad;
+			}
 		}
 
 #ifdef IPSEC



CVS commit: [netbsd-7-0] src/sys/netinet6

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:17:22 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-7-0]: ip6_input.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1572):
sys/netinet6/ip6_input.c: 1.188 via patch
Kick nested fragments.


To generate a diff of this commit:
cvs rdiff -u -r1.149.2.1.2.1 -r1.149.2.1.2.2 src/sys/netinet6/ip6_input.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/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.149.2.1.2.1 src/sys/netinet6/ip6_input.c:1.149.2.1.2.2
--- src/sys/netinet6/ip6_input.c:1.149.2.1.2.1	Tue Jan 30 18:31:53 2018
+++ src/sys/netinet6/ip6_input.c	Sun Feb 25 23:17:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.149.2.1.2.1 2018/01/30 18:31:53 martin Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.149.2.1.2.2 2018/02/25 23:17:22 snj Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.2.1 2018/01/30 18:31:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.2.2 2018/02/25 23:17:22 snj Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -249,7 +249,7 @@ ip6_input(struct mbuf *m)
 	int hit, off = sizeof(struct ip6_hdr), nest;
 	u_int32_t plen;
 	u_int32_t rtalert = ~0;
-	int nxt, ours = 0, rh_present = 0;
+	int nxt, ours = 0, rh_present = 0, frg_present;
 	struct ifnet *deliverifp = NULL;
 	int srcrt = 0;
 	const struct rtentry *rt;
@@ -720,6 +720,7 @@ ip6_input(struct mbuf *m)
 	nest = 0;
 
 	rh_present = 0;
+	frg_present = 0;
 	while (nxt != IPPROTO_DONE) {
 		if (ip6_hdrnestlimit && (++nest > ip6_hdrnestlimit)) {
 			IP6_STATINC(IP6_STAT_TOOMANYHDR);
@@ -744,6 +745,13 @@ ip6_input(struct mbuf *m)
 IP6_STATINC(IP6_STAT_BADOPTIONS);
 goto bad;
 			}
+		} else if (nxt == IPPROTO_FRAGMENT) {
+			if (frg_present++) {
+in6_ifstat_inc(m->m_pkthdr.rcvif,
+ifs6_in_hdrerr);
+IP6_STATINC(IP6_STAT_BADOPTIONS);
+goto bad;
+			}
 		}
 
 #ifdef IPSEC



CVS commit: [netbsd-7-1] src/sys/netinet6

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:17:37 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-7-1]: ip6_input.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1572):
sys/netinet6/ip6_input.c: 1.188 via patch
Kick nested fragments.


To generate a diff of this commit:
cvs rdiff -u -r1.149.2.1.6.1 -r1.149.2.1.6.2 src/sys/netinet6/ip6_input.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/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.149.2.1.6.1 src/sys/netinet6/ip6_input.c:1.149.2.1.6.2
--- src/sys/netinet6/ip6_input.c:1.149.2.1.6.1	Tue Jan 30 18:30:31 2018
+++ src/sys/netinet6/ip6_input.c	Sun Feb 25 23:17:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.149.2.1.6.1 2018/01/30 18:30:31 martin Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.149.2.1.6.2 2018/02/25 23:17:37 snj Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.6.1 2018/01/30 18:30:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.149.2.1.6.2 2018/02/25 23:17:37 snj Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -249,7 +249,7 @@ ip6_input(struct mbuf *m)
 	int hit, off = sizeof(struct ip6_hdr), nest;
 	u_int32_t plen;
 	u_int32_t rtalert = ~0;
-	int nxt, ours = 0, rh_present = 0;
+	int nxt, ours = 0, rh_present = 0, frg_present;
 	struct ifnet *deliverifp = NULL;
 	int srcrt = 0;
 	const struct rtentry *rt;
@@ -720,6 +720,7 @@ ip6_input(struct mbuf *m)
 	nest = 0;
 
 	rh_present = 0;
+	frg_present = 0;
 	while (nxt != IPPROTO_DONE) {
 		if (ip6_hdrnestlimit && (++nest > ip6_hdrnestlimit)) {
 			IP6_STATINC(IP6_STAT_TOOMANYHDR);
@@ -744,6 +745,13 @@ ip6_input(struct mbuf *m)
 IP6_STATINC(IP6_STAT_BADOPTIONS);
 goto bad;
 			}
+		} else if (nxt == IPPROTO_FRAGMENT) {
+			if (frg_present++) {
+in6_ifstat_inc(m->m_pkthdr.rcvif,
+ifs6_in_hdrerr);
+IP6_STATINC(IP6_STAT_BADOPTIONS);
+goto bad;
+			}
 		}
 
 #ifdef IPSEC



CVS commit: [netbsd-7] src/sys/kern

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:27:17 UTC 2018

Modified Files:
src/sys/kern [netbsd-7]: subr_tftproot.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1573):
sys/kern/subr_tftproot.c: 1.20
Fix md(4) double attachment in TFTPROOT option
The mdattach() call in tftproot_dhcpboot() has probably always been
useless, but it seems it became harmful, as it causes 7.1.1 to deadlock
during boot.


To generate a diff of this commit:
cvs rdiff -u -r1.12.12.2 -r1.12.12.3 src/sys/kern/subr_tftproot.c

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

Modified files:

Index: src/sys/kern/subr_tftproot.c
diff -u src/sys/kern/subr_tftproot.c:1.12.12.2 src/sys/kern/subr_tftproot.c:1.12.12.3
--- src/sys/kern/subr_tftproot.c:1.12.12.2	Mon Apr  6 01:37:29 2015
+++ src/sys/kern/subr_tftproot.c	Sun Feb 25 23:27:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_tftproot.c,v 1.12.12.2 2015/04/06 01:37:29 snj Exp $ */
+/*	$NetBSD: subr_tftproot.c,v 1.12.12.3 2018/02/25 23:27:17 snj Exp $ */
 
 /*-
  * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved.
@@ -39,7 +39,7 @@
 #include "opt_md.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.12.12.2 2015/04/06 01:37:29 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.12.12.3 2018/02/25 23:27:17 snj Exp $");
 
 #include 
 #include 
@@ -65,8 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: subr_tftproo
 #include 
 #include 
 
-extern void   mdattach(int);
-
 /* 
  * Copied from  
  */
@@ -333,7 +331,6 @@ tftproot_getfile(struct tftproot_handle 
 	DPRINTF(("%s():%d RAMdisk loaded: %ld@%p\n", 
 	__func__, __LINE__, trh->trh_len, trh->trh_base));
 	md_root_setconf(trh->trh_base, trh->trh_len);
-	mdattach(0);
 
 	error = 0;
 out:



CVS commit: [netbsd-7] src/sys/fs/msdosfs

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:28:47 UTC 2018

Modified Files:
src/sys/fs/msdosfs [netbsd-7]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1574):
sys/fs/msdosfs/msdosfs_vfsops.c: 1.129
relax sanity check. It's ok to have more FAT sectors than needed.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.1 -r1.115.2.2 src/sys/fs/msdosfs/msdosfs_vfsops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.115.2.1 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.115.2.2
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.115.2.1	Mon Oct 23 19:10:46 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sun Feb 25 23:28:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.115.2.1 2017/10/23 19:10:46 snj Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.115.2.2 2018/02/25 23:28:47 snj Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.115.2.1 2017/10/23 19:10:46 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.115.2.2 2018/02/25 23:28:47 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -709,8 +709,8 @@ msdosfs_mountfs(struct vnode *devvp, str
 	fatbytes = (pmp->pm_maxcluster+1) * pmp->pm_fatmult / pmp->pm_fatdiv;
 	fatblocksecs = howmany(fatbytes, pmp->pm_BytesPerSec);
 
-	if (pmp->pm_FATsecs != fatblocksecs) {
-		DPRINTF("FATsecs %lu != real %lu\n", pmp->pm_FATsecs,
+	if (pmp->pm_FATsecs < fatblocksecs) {
+		DPRINTF("FATsecs %lu < real %lu\n", pmp->pm_FATsecs,
 			fatblocksecs);
 		error = EINVAL;
 		goto error_exit;



CVS commit: [netbsd-7-0] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:35:25 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1572


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.87 -r1.1.2.88 src/doc/CHANGES-7.0.3

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-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.87 src/doc/CHANGES-7.0.3:1.1.2.88
--- src/doc/CHANGES-7.0.3:1.1.2.87	Sun Feb 25 21:16:33 2018
+++ src/doc/CHANGES-7.0.3	Sun Feb 25 23:35:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.87 2018/02/25 21:16:33 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.88 2018/02/25 23:35:25 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5288,3 +5288,8 @@ sys/kern/kern_exec.cpatch
 	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
 	[maxv, ticket #1499]
 
+sys/netinet6/ip6_input.c			1.188 via patch
+
+	Kick nested IPv6 fragments.
+	[maxv, ticket #1572]
+



CVS commit: [netbsd-7] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:35:15 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
1545, 1572-1574


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.73 -r1.1.2.74 src/doc/CHANGES-7.2

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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.73 src/doc/CHANGES-7.2:1.1.2.74
--- src/doc/CHANGES-7.2:1.1.2.73	Sun Feb 25 21:15:52 2018
+++ src/doc/CHANGES-7.2	Sun Feb 25 23:35:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.73 2018/02/25 21:15:52 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.74 2018/02/25 23:35:15 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5242,3 +5242,34 @@ sys/kern/kern_exec.cpatch
 	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
 	[maxv, ticket #1499]
 
+sys/modules/lua/lua.cup to 1.24
+
+	lua(4):
+	- fix crash when executing luactl after creating a Lua state.
+	  PR 52864.
+	- plug leak on error
+	- fixed require
+	- fix double require bug
+	- use aprint*() instead of printf() in xxx_attach().
+	- check pmf_device_register return value. NFC
+	- can't destroy pb until we're done using it.
+	- whitespace, knf, comments
+	[sevan, ticket #1545]
+
+sys/netinet6/ip6_input.c			1.188 via patch
+
+	Kick nested IPv6 fragments.
+	[maxv, ticket #1572]
+
+sys/kern/subr_tftproot.c			1.20
+
+	Fix md(4) double attachment in TFTPROOT option.  Avoids
+	deadlock at boot.
+	[manu, ticket #1573]
+
+sys/fs/msdosfs/msdosfs_vfsops.c			1.129
+
+	Relax sanity check. It's ok to have more FAT sectors
+	than needed.
+	[mlelstv, ticket #1574]
+



CVS commit: [netbsd-7-1] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:35:54 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.2

Log Message:
1572


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/CHANGES-7.1.2

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-7.1.2
diff -u src/doc/CHANGES-7.1.2:1.1.2.17 src/doc/CHANGES-7.1.2:1.1.2.18
--- src/doc/CHANGES-7.1.2:1.1.2.17	Sun Feb 25 21:16:25 2018
+++ src/doc/CHANGES-7.1.2	Sun Feb 25 23:35:54 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.2,v 1.1.2.17 2018/02/25 21:16:25 snj Exp $
+# $NetBSD: CHANGES-7.1.2,v 1.1.2.18 2018/02/25 23:35:54 snj Exp $
 
 A complete list of changes from the NetBSD 7.1.1 release to the NetBSD 7.1.2
 release:
@@ -176,3 +176,8 @@ sys/kern/kern_exec.cpatch
 	- remove svr4/svr4_32/ibcs2/freebsd from the module autoload list
 	[maxv, ticket #1499]
 
+sys/netinet6/ip6_input.c			1.188 via patch
+
+	Kick nested IPv6 fragments.
+	[maxv, ticket #1572]
+



CVS commit: src/usr.bin/at

2018-02-25 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Sun Feb 25 23:48:16 UTC 2018

Modified Files:
src/usr.bin/at: privs.c

Log Message:
Fix typo in error message.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/at/privs.c

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

Modified files:

Index: src/usr.bin/at/privs.c
diff -u src/usr.bin/at/privs.c:1.2 src/usr.bin/at/privs.c:1.3
--- src/usr.bin/at/privs.c:1.2	Sun Mar 13 00:33:12 2016
+++ src/usr.bin/at/privs.c	Sun Feb 25 23:48:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: privs.c,v 1.2 2016/03/13 00:33:12 dholland Exp $	*/
+/*	$NetBSD: privs.c,v 1.3 2018/02/25 23:48:16 htodd Exp $	*/
 
 /*
  *  privs.c - privileged operations
@@ -78,9 +78,9 @@ void
 privs_exit(void)
 {
 	if (setegid(real_gid) == -1)
-		privs_fail("Cannot relinguish group privs");
+		privs_fail("Cannot relinquish group privs");
 	if (seteuid(real_uid) == -1)
-		privs_fail("Cannot relinguish user privs");
+		privs_fail("Cannot relinquish user privs");
 }
 
 void



CVS commit: [netbsd-8] src

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:50:24 UTC 2018

Modified Files:
src/sys/arch/aarch64/include [netbsd-8]: mcontext.h
src/sys/arch/alpha/include [netbsd-8]: mcontext.h
src/sys/arch/amd64/include [netbsd-8]: mcontext.h
src/sys/arch/arm/include [netbsd-8]: mcontext.h
src/sys/arch/hppa/include [netbsd-8]: mcontext.h
src/sys/arch/i386/include [netbsd-8]: mcontext.h
src/sys/arch/ia64/include [netbsd-8]: mcontext.h
src/sys/arch/m68k/include [netbsd-8]: mcontext.h
src/sys/arch/mips/include [netbsd-8]: mcontext.h
src/sys/arch/or1k/include [netbsd-8]: mcontext.h
src/sys/arch/powerpc/include [netbsd-8]: mcontext.h
src/sys/arch/riscv/include [netbsd-8]: mcontext.h
src/sys/arch/sh3/include [netbsd-8]: mcontext.h
src/sys/arch/sparc/include [netbsd-8]: mcontext.h
src/sys/arch/sparc64/include [netbsd-8]: mcontext.h
src/sys/arch/vax/include [netbsd-8]: mcontext.h
src/tests/lib/libc/sys [netbsd-8]: Makefile t_ucontext.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #552):
sys/arch/aarch64/include/mcontext.h: 1.2
sys/arch/alpha/include/mcontext.h: 1.9
sys/arch/amd64/include/mcontext.h: 1.19
sys/arch/arm/include/mcontext.h: 1.19
sys/arch/hppa/include/mcontext.h: 1.9
sys/arch/i386/include/mcontext.h: 1.14
sys/arch/ia64/include/mcontext.h: 1.6
sys/arch/m68k/include/mcontext.h: 1.10
sys/arch/mips/include/mcontext.h: 1.22
sys/arch/or1k/include/mcontext.h: 1.2
sys/arch/powerpc/include/mcontext.h: 1.18
sys/arch/riscv/include/mcontext.h: 1.5
sys/arch/sh3/include/mcontext.h: 1.11
sys/arch/sparc/include/mcontext.h: 1.14-1.17
sys/arch/sparc64/include/mcontext.h: 1.10
sys/arch/vax/include/mcontext.h: 1.9
tests/lib/libc/sys/Makefile: 1.50
tests/lib/libc/sys/t_ucontext.c: 1.2
Introduce _UC_MACHINE_FP() as a macro
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.
Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.
For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).
For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:
  ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM  LOC_REG (79)
Once ia64 will mature, this should be revisited.
A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.
For the remaining CPUs, reuse standard register as defined in appropriate ABI.
The direct users of this macro are LLVM and GCC with Sanitizers.
Proposed on tech-userlevel@.
Sponsored by 
--
Improve _UC_MACHINE_FP() for SPARC/SPARC64
Introduce a static inline function _uc_machine_fp() that contains improved
caluclation of a frame pointer.
Algorithm:
  uptr *stk_ptr;
#  if defined (__arch64__)
  stk_ptr = (uptr *) (*sp + 2047);
#  else
  stk_ptr = (uptr *) *sp;
#  endif
  *bp = stk_ptr[15];
Noted by 
--
Make _UC_MACHINE_FP() compile again and fix it so that it does not add
the offset twice.
--
fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] is
the right offset.  do this by using __greg32_t, which is only in
the sparc64 version, and these are only useful there, so move them.
--
Add new tests in lib/libc/sys/t_ucontext
New tests:
 - ucontext_sp
 - ucontext_fp
 - ucontext_pc
 - ucontext_intrv
They test respectively:
 - _UC_MACHINE_SP
 - _UC_MACHINE_FP
 - _UC_MACHINE_PC
 - _UC_MACHINE_INTRV
These tests attempt to access and print the values from ucontext, without
interpreting the values.
This is a follow up of the _UC_MACHINE_FP() introduction.
These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.
Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.22.1 src/sys/arch/aarch64/include/mcontext.h
cvs rdiff -u -r1.8 -r1.8.32.1 src/sys/arch/alpha/include/mcontext.h
cvs rdiff -u -r1.18 -r1.18.20.1 src/sys/arch/amd64/include/mcontext.h
cvs rdiff -u -r1.18 -r1.18.10.1 src/sys/arch/arm/include/mcontext.h
cvs rdiff -u -r1.8 -r1.8.22.1 src/sys/arch/hppa/include/mcontext.h
cvs rdiff -u -r1.12 -r1.12.22.1 src/sys/arch/i386/include/mcontext.h
cvs rdiff -u -r1.5 -r1.5.8.1 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.9 -r1.9.42.1 src/sys/arch/m68k/include/mcontext.h
cvs rdiff -u -r1.21 -r1.21.10.1 src/sys/arch/mips/include/mcontext.h
cvs rdiff -u -r1.1 -r1.1.12.1 src/sys/arch/or1k/include/mcontext.h
cvs rdiff -u -r1.17 -r1.17.12.1 src/sys/arch/powerpc/include/mcontext.h
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/arch/riscv/include/mcontext.h
cvs rdiff -u -r1.10 -r1.10.32.1 src/sys/arch/sh3/include/mcontext.h
cvs rdiff -u -r1.13 -r1.13.32.1 src/sys/arch/sparc/include/mcontext.h
cvs rdiff -u -r1.9 -r1.9.32.1 src/sys/arch/sparc64/include/mc

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

2018-02-25 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Sun Feb 25 23:51:22 UTC 2018

Modified Files:
src/usr.bin/su [netbsd-8]: su_pam.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.8.1 src/usr.bin/su/su_pam.c

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

Modified files:

Index: src/usr.bin/su/su_pam.c
diff -u src/usr.bin/su/su_pam.c:1.20 src/usr.bin/su/su_pam.c:1.20.8.1
--- src/usr.bin/su/su_pam.c:1.20	Sun Aug  9 09:39:21 2015
+++ src/usr.bin/su/su_pam.c	Sun Feb 25 23:51:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: su_pam.c,v 1.20 2015/08/09 09:39:21 shm Exp $	*/
+/*	$NetBSD: su_pam.c,v 1.20.8.1 2018/02/25 23:51:22 htodd Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988\
 #if 0
 static char sccsid[] = "@(#)su.c	8.3 (Berkeley) 4/2/94";*/
 #else
-__RCSID("$NetBSD: su_pam.c,v 1.20 2015/08/09 09:39:21 shm Exp $");
+__RCSID("$NetBSD: su_pam.c,v 1.20.8.1 2018/02/25 23:51:22 htodd Exp $");
 #endif
 #endif /* not lint */
 
@@ -337,7 +337,7 @@ main(int argc, char **argv)
 	/*
 	 * Initialize the supplemental groups before pam gets to them,
 	 * so that other pam modules get a chance to add more when
-	 * we do setcred. Note, we don't relinguish our set-userid yet
+	 * we do setcred. Note, we don't relinquish our set-userid yet
 	 */
 	/* if we aren't changing users, keep the current group members */
 	if (ruid != pwd->pw_uid &&



CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 23:51:25 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Regen attachment list, since we just added "iic* at imcsmb?"

This regen also caught a few other missing entries.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.15 src/share/man/man4/iic.4:1.16
--- src/share/man/man4/iic.4:1.15	Wed Jan 24 10:00:42 2018
+++ src/share/man/man4/iic.4	Sun Feb 25 23:51:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.15 2018/01/24 10:00:42 wiz Exp $
+.\"	$NetBSD: iic.4,v 1.16 2018/02/25 23:51:25 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -29,20 +29,23 @@
 .\" grep -h '^iic.*at' */conf/* | sort -u -k +3 | sed -e 's,[ ][  ]*, ,g' -e 's, *#.*,,' | sh -c 'while read iic at ic ; do printf ".Cd \"$iic $at %-20s # %s\"\n" "$ic" "`grep \"iic.*at.*$ic\" */conf/* | sed \"s,/.*,,\" | sort -u | tr \"\012\" \ `"  ; done' | uniq | tee /tmp/x
 .\" cat /tmp/x
 .\"
-.Cd "iic* at acpismbus?   # amd64 i386"
+.Sh DESCRIPTION
+.Cd "iic* at tsciic?  # alpha "
 .Cd "iic* at alipm?   # alpha amd64 i386 sparc64 "
 .Cd "iic* at amdpm?   # amd64 i386 "
 .Cd "iic* at armadillo9iic?   # evbarm "
 .Cd "iic0 at at91twi? # evbarm "
 .Cd "iic0 at ausmbus0 # evbmips "
 .Cd "iic* at awiniic? # evbarm "
-.Cd "iic4 at awinp2wi0# evbarm "
 .Cd "iic* at bcmi2c?  # evbarm "
 .Cd "iic* at coram?   # amd64 i386 "
+.Cd "iic* at cuda0# macppc "
 .Cd "iic0 at cuda0# macppc "
+.Cd "iic* at cuda?# macppc "
 .Cd "iic* at cxdtv?   # amd64 i386 "
 .Cd "iic* at diic?# acorn32 evbppc "
-.Cd "iic* at exyoiic? # evbarm "
+.Cd "iic* at dwiic?   # amd64 i386 "
+.Cd "iic* at exyoi2c? # evbarm "
 .Cd "iic* at g2i2c?   # evbarm "
 .Cd "iic0 at gpiic?   # evbppc "
 .Cd "iic* at gpioiic? # amd64 i386 "
@@ -50,6 +53,7 @@
 .Cd "iic* at gxiic?   # evbarm "
 .Cd "iic* at i2cbus?  # evbarm "
 .Cd "iic* at ichsmb?  # amd64 i386 "
+.Cd "iic* at imcsmb?  # amd64 i386 "
 .Cd "iic* at imxi2c?  # evbarm "
 .Cd "iic0 at iomdiic? # acorn32 "
 .Cd "iic0 at iopiic?  # evbarm iyonix "
@@ -62,21 +66,15 @@
 .Cd "iic* at omapiic? # evbarm "
 .Cd "iic* at pcfiic?  # sparc64 "
 .Cd "iic* at piixpm?  # amd64 i386 "
+.Cd "iic* at pmu? # macppc "
 .Cd "iic* at ri2c?# evbmips "
-.Cd "iic0 at rkiic0   # evbarm "
-.Cd "iic1 at rkiic1   # evbarm "
-.Cd "iic2 at rkiic2   # evbarm "
-.Cd "iic3 at rkiic3   # evbarm "
-.Cd "iic4 at rkiic4   # evbarm "
 .Cd "iic* at rtciic?  # mmeye "
 .Cd "iic0 at slugiic0 # evbarm "
 .Cd "iic* at tegrai2c?# evbarm "
 .Cd "iic* at tiiic?   # evbarm "
-.Cd "iic* at tsciic?  # alpha "
 .Cd "iic* at viapcib? # i386 "
 .Cd "iic* at voyager0 # evbmips "
 .Cd "iic0 at ziic?# evbmips zaurus "
-.Sh DESCRIPTION
 I2C is a two-wire bus developed by Philips used for connecting
 integrated circuits.
 It is commonly used for connecting devices such as EEPROMs,



CVS commit: [netbsd-8] src/include

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:53:59 UTC 2018

Modified Files:
src/include [netbsd-8]: string.h

Log Message:
Pull up following revision(s) (requested by kamil in ticket #561):
include/string.h: 1.52
Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.6.1 src/include/string.h

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

Modified files:

Index: src/include/string.h
diff -u src/include/string.h:1.51 src/include/string.h:1.51.6.1
--- src/include/string.h:1.51	Wed Oct 12 20:01:22 2016
+++ src/include/string.h	Sun Feb 25 23:53:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: string.h,v 1.51 2016/10/12 20:01:22 christos Exp $	*/
+/*	$NetBSD: string.h,v 1.51.6.1 2018/02/25 23:53:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -74,7 +74,8 @@ int	 strerror_r(int, char *, size_t);
 #endif /* _POSIX_C_SOURCE >= 199506 || XOPEN_SOURCE >= 500 || ... */
 size_t	 strxfrm(char * __restrict, const char * __restrict, size_t);
 
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
+#if (_POSIX_C_SOURCE - 0 >= 200112L) || defined(_XOPEN_SOURCE) || \
+defined(_NETBSD_SOURCE)
 void	*memccpy(void *, const void *, int, size_t);
 char	*strdup(const char *);
 #endif



CVS commit: src/doc

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 23:53:57 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new mdns-responder.


To generate a diff of this commit:
cvs rdiff -u -r1.1503 -r1.1504 src/doc/3RDPARTY
cvs rdiff -u -r1.2359 -r1.2360 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1503 src/doc/3RDPARTY:1.1504
--- src/doc/3RDPARTY:1.1503	Fri Feb  9 12:14:26 2018
+++ src/doc/3RDPARTY	Sun Feb 25 18:53:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1503 2018/02/09 17:14:26 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1504 2018/02/25 23:53:57 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -847,8 +847,8 @@ Notes:
 Uses libc's ohash
 
 Package:	mDNSResponder
-Version:	878.1.1
-Current Vers:	878.1.1
+Version:	878.30.4
+Current Vers:	878.30.4
 Maintainer:	Apple
 Archive Site:	https://www.opensource.apple.com/tarballs/mDNSResponder/
 Home Page:	https://developer.apple.com/bonjour/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2359 src/doc/CHANGES:1.2360
--- src/doc/CHANGES:1.2359	Thu Feb 22 22:33:36 2018
+++ src/doc/CHANGES	Sun Feb 25 18:53:57 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2359 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2360 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -115,3 +115,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		enable by default. [sevan 20180217]
 	macppc: Enable support for "per-priority cyclical scan" buffer queue
 		strategy. [sevan 20180223]
+	mdnsd(8), dns-sd(1), libdns_sd: import mDNSResponder 878.30.4
+		[christos 20180225]



CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 23:55:21 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Fix the commands-to-generate-the-attachment list to use tab's instead
of multiple spaces in the regex bracket expressions, and alert the
reader to this.  Otherwise, a cut-and-paste might simply expand the
tab characters to some number of spaces, and the result won't find
what you're looking for!

XXX Despite the indication that these commands should be run in csh
(or derivative), they seem to run just fine under /bin/sh as well.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.16 src/share/man/man4/iic.4:1.17
--- src/share/man/man4/iic.4:1.16	Sun Feb 25 23:51:25 2018
+++ src/share/man/man4/iic.4	Sun Feb 25 23:55:21 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.16 2018/02/25 23:51:25 pgoyette Exp $
+.\"	$NetBSD: iic.4,v 1.17 2018/02/25 23:55:21 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -24,9 +24,11 @@
 .Nd Inter IC (I2C) bus
 .Sh SYNOPSIS
 .\"
-.\" Use the following commands in (t)csh to output the list below:
+.\" Use the following commands in (t)csh to output the list below (note
+\." the first sed command includes a  and  character in each
+\." of the bracket expressions):
 .\" cd .../src/sys/arch
-.\" grep -h '^iic.*at' */conf/* | sort -u -k +3 | sed -e 's,[ ][  ]*, ,g' -e 's, *#.*,,' | sh -c 'while read iic at ic ; do printf ".Cd \"$iic $at %-20s # %s\"\n" "$ic" "`grep \"iic.*at.*$ic\" */conf/* | sed \"s,/.*,,\" | sort -u | tr \"\012\" \ `"  ; done' | uniq | tee /tmp/x
+.\" grep -h '^iic.*at' */conf/* | sort -u -k +3 | sed -e 's,[	 ][	 ]*, ,g' -e 's, *#.*,,' | sh -c 'while read iic at ic ; do printf ".Cd \"$iic $at %-20s # %s\"\n" "$ic" "`grep \"iic.*at.*$ic\" */conf/* | sed \"s,/.*,,\" | sort -u | tr \"\012\" \ `"  ; done' | uniq | tee /tmp/x
 .\" cat /tmp/x
 .\"
 .Sh DESCRIPTION



CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Feb 25 23:55:55 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Bump date for previous two changes.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.17 src/share/man/man4/iic.4:1.18
--- src/share/man/man4/iic.4:1.17	Sun Feb 25 23:55:21 2018
+++ src/share/man/man4/iic.4	Sun Feb 25 23:55:55 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.17 2018/02/25 23:55:21 pgoyette Exp $
+.\"	$NetBSD: iic.4,v 1.18 2018/02/25 23:55:55 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -16,7 +16,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd July 26, 2016
+.Dd February 26, 2018
 .Dt IIC 4
 .Os
 .Sh NAME



CVS commit: [netbsd-8] src/lib/libpthread

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:55:50 UTC 2018

Modified Files:
src/lib/libpthread [netbsd-8]: pthread.h

Log Message:
Pull up following revision(s) (requested by kamil in ticket #562):
lib/libpthread/pthread.h: 1.41
Remove namespace restriction from pthread_condattr_{g,s}etclock(3)
These functions were marked as _NETBSD_SOURCE when introduced to the
sources. In fact they are regular POSIX threading functions available
since the 2001 standard. There is an older mention about alignment with
"IEEE Std 1003.1j-2000".
This corrects usage of these functions when a source code is compiled
with a POSIX namespace option.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.6.1 src/lib/libpthread/pthread.h

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

Modified files:

Index: src/lib/libpthread/pthread.h
diff -u src/lib/libpthread/pthread.h:1.38 src/lib/libpthread/pthread.h:1.38.6.1
--- src/lib/libpthread/pthread.h:1.38	Sun Oct 30 23:26:33 2016
+++ src/lib/libpthread/pthread.h	Sun Feb 25 23:55:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.h,v 1.38 2016/10/30 23:26:33 kamil Exp $	*/
+/*	$NetBSD: pthread.h,v 1.38.6.1 2018/02/25 23:55:50 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -130,11 +130,9 @@ int	pthread_cond_timedwait(pthread_cond_
 int	pthread_cond_signal(pthread_cond_t *);
 int	pthread_cond_broadcast(pthread_cond_t *);
 int	pthread_condattr_init(pthread_condattr_t *);
-#if defined(_NETBSD_SOURCE)
 int pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
 int	pthread_condattr_getclock(const pthread_condattr_t * __restrict,
 	clockid_t * __restrict);
-#endif
 int	pthread_condattr_destroy(pthread_condattr_t *);
 #ifdef _PTHREAD_PSHARED
 int	pthread_condattr_getpshared(const pthread_condattr_t * __restrict,



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Feb 25 23:57:51 UTC 2018

Modified Files:
src/sys/sys [netbsd-8]: fcntl.h

Log Message:
Pull up following revision(s) (requested by kamil in ticket #563):
sys/sys/fcntl.h: 1.50
Enable O_NOFOLLOW in the POSIX namespace
This open(2) flag first appeared in FreeBSD and was standarized by POSIX
in the 2008 standard.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.48.8.1 src/sys/sys/fcntl.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/fcntl.h
diff -u src/sys/sys/fcntl.h:1.48 src/sys/sys/fcntl.h:1.48.8.1
--- src/sys/sys/fcntl.h:1.48	Tue Jan 10 23:08:13 2017
+++ src/sys/sys/fcntl.h	Sun Feb 25 23:57:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fcntl.h,v 1.48 2017/01/10 23:08:13 christos Exp $	*/
+/*	$NetBSD: fcntl.h,v 1.48.8.1 2018/02/25 23:57:51 snj Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1990, 1993
@@ -90,7 +90,7 @@
 (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
 #define	O_SYNC		0x0080	/* synchronous writes */
 #endif
-#if defined(_NETBSD_SOURCE)
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
 #define	O_NOFOLLOW	0x0100	/* don't follow symlinks on the last */
 	/* path component */
 #endif



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:05:04 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: ichsmb.c ismt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #565):
sys/dev/pci/ichsmb.c: 1.51
sys/dev/pci/ismt.c: 1.6
Add C3000 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.6.1 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/dev/pci/ismt.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.50 src/sys/dev/pci/ichsmb.c:1.50.6.1
--- src/sys/dev/pci/ichsmb.c:1.50	Fri Mar 31 08:38:13 2017
+++ src/sys/dev/pci/ichsmb.c	Mon Feb 26 00:05:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.50 2017/03/31 08:38:13 msaitoh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.50.6.1 2018/02/26 00:05:04 snj Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50 2017/03/31 08:38:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50.6.1 2018/02/26 00:05:04 snj Exp $");
 
 #include 
 #include 
@@ -130,6 +130,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_DH89XXCC_SMB:
 		case PCI_PRODUCT_INTEL_DH89XXCL_SMB:
 		case PCI_PRODUCT_INTEL_C2000_PCU_SMBUS:
+		case PCI_PRODUCT_INTEL_C3K_SMBUS_LEGACY:
 			return 1;
 		}
 	}

Index: src/sys/dev/pci/ismt.c
diff -u src/sys/dev/pci/ismt.c:1.5 src/sys/dev/pci/ismt.c:1.5.2.1
--- src/sys/dev/pci/ismt.c:1.5	Thu Apr 27 10:01:54 2017
+++ src/sys/dev/pci/ismt.c	Mon Feb 26 00:05:04 2018
@@ -60,7 +60,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.5 2017/04/27 10:01:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.5.2.1 2018/02/26 00:05:04 snj Exp $");
 
 #include 
 #include 
@@ -801,6 +801,7 @@ ismt_match(device_t parent, cfdata_t mat
 	case PCI_PRODUCT_INTEL_S1200_SMBUS_0:
 	case PCI_PRODUCT_INTEL_S1200_SMBUS_1:
 	case PCI_PRODUCT_INTEL_C2000_SMBUS:
+	case PCI_PRODUCT_INTEL_C3K_SMBUS:
 		break;
 	default:
 		return 0;



CVS commit: src/usr.bin/su

2018-02-25 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Mon Feb 26 00:05:05 UTC 2018

Modified Files:
src/usr.bin/su: su_pam.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/su/su_pam.c

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

Modified files:

Index: src/usr.bin/su/su_pam.c
diff -u src/usr.bin/su/su_pam.c:1.20 src/usr.bin/su/su_pam.c:1.21
--- src/usr.bin/su/su_pam.c:1.20	Sun Aug  9 09:39:21 2015
+++ src/usr.bin/su/su_pam.c	Mon Feb 26 00:05:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: su_pam.c,v 1.20 2015/08/09 09:39:21 shm Exp $	*/
+/*	$NetBSD: su_pam.c,v 1.21 2018/02/26 00:05:05 htodd Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988\
 #if 0
 static char sccsid[] = "@(#)su.c	8.3 (Berkeley) 4/2/94";*/
 #else
-__RCSID("$NetBSD: su_pam.c,v 1.20 2015/08/09 09:39:21 shm Exp $");
+__RCSID("$NetBSD: su_pam.c,v 1.21 2018/02/26 00:05:05 htodd Exp $");
 #endif
 #endif /* not lint */
 
@@ -337,7 +337,7 @@ main(int argc, char **argv)
 	/*
 	 * Initialize the supplemental groups before pam gets to them,
 	 * so that other pam modules get a chance to add more when
-	 * we do setcred. Note, we don't relinguish our set-userid yet
+	 * we do setcred. Note, we don't relinquish our set-userid yet
 	 */
 	/* if we aren't changing users, keep the current group members */
 	if (ruid != pwd->pw_uid &&



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

2018-02-25 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Mon Feb 26 00:04:23 UTC 2018

Modified Files:
src/usr.bin/su [netbsd-8]: su_pam.c

Log Message:
Undo last commit - wrong tree.


To generate a diff of this commit:
cvs rdiff -u -r1.20.8.1 -r1.20.8.2 src/usr.bin/su/su_pam.c

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

Modified files:

Index: src/usr.bin/su/su_pam.c
diff -u src/usr.bin/su/su_pam.c:1.20.8.1 src/usr.bin/su/su_pam.c:1.20.8.2
--- src/usr.bin/su/su_pam.c:1.20.8.1	Sun Feb 25 23:51:22 2018
+++ src/usr.bin/su/su_pam.c	Mon Feb 26 00:04:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: su_pam.c,v 1.20.8.1 2018/02/25 23:51:22 htodd Exp $	*/
+/*	$NetBSD: su_pam.c,v 1.20.8.2 2018/02/26 00:04:23 htodd Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988\
 #if 0
 static char sccsid[] = "@(#)su.c	8.3 (Berkeley) 4/2/94";*/
 #else
-__RCSID("$NetBSD: su_pam.c,v 1.20.8.1 2018/02/25 23:51:22 htodd Exp $");
+__RCSID("$NetBSD: su_pam.c,v 1.20.8.2 2018/02/26 00:04:23 htodd Exp $");
 #endif
 #endif /* not lint */
 
@@ -337,7 +337,7 @@ main(int argc, char **argv)
 	/*
 	 * Initialize the supplemental groups before pam gets to them,
 	 * so that other pam modules get a chance to add more when
-	 * we do setcred. Note, we don't relinquish our set-userid yet
+	 * we do setcred. Note, we don't relinguish our set-userid yet
 	 */
 	/* if we aren't changing users, keep the current group members */
 	if (ruid != pwd->pw_uid &&



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:00:53 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #564):
sys/dev/pci/if_wm.c: 1.563
Fix a bug that RX and TX may stall on heavy load on wm(4) like ixgbe.c:r1.121.
wm_rxeof() and wm_txeof() have loop limit and the function returns true
if a packet still exists.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.13 -r1.508.4.14 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.13 src/sys/dev/pci/if_wm.c:1.508.4.14
--- src/sys/dev/pci/if_wm.c:1.508.4.13	Mon Feb  5 15:07:30 2018
+++ src/sys/dev/pci/if_wm.c	Mon Feb 26 00:00:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.13 2018/02/05 15:07:30 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.14 2018/02/26 00:00:53 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.13 2018/02/05 15:07:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.14 2018/02/26 00:00:53 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -775,8 +775,8 @@ static void	wm_nq_send_common_locked(str
 static void	wm_deferred_start_locked(struct wm_txqueue *);
 static void	wm_handle_queue(void *);
 /* Interrupt */
-static int	wm_txeof(struct wm_txqueue *, u_int);
-static void	wm_rxeof(struct wm_rxqueue *, u_int);
+static bool	wm_txeof(struct wm_txqueue *, u_int);
+static bool	wm_rxeof(struct wm_rxqueue *, u_int);
 static void	wm_linkintr_gmii(struct wm_softc *, uint32_t);
 static void	wm_linkintr_tbi(struct wm_softc *, uint32_t);
 static void	wm_linkintr_serdes(struct wm_softc *, uint32_t);
@@ -8066,7 +8066,7 @@ wm_deferred_start_locked(struct wm_txque
  *
  *	Helper; handle transmit interrupts.
  */
-static int
+static bool
 wm_txeof(struct wm_txqueue *txq, u_int limit)
 {
 	struct wm_softc *sc = txq->txq_sc;
@@ -8076,11 +8076,12 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	int i;
 	uint8_t status;
 	struct wm_queue *wmq = container_of(txq, struct wm_queue, wmq_txq);
+	bool more = false;
 
 	KASSERT(mutex_owned(txq->txq_lock));
 
 	if (txq->txq_stopping)
-		return 0;
+		return false;
 
 	txq->txq_flags &= ~WM_TXQ_NO_SPACE;
 	/* for ALTQ and legacy(not use multiqueue) ethernet controller */
@@ -8093,8 +8094,13 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	 */
 	for (i = txq->txq_sdirty; txq->txq_sfree != WM_TXQUEUELEN(txq);
 	 i = WM_NEXTTXS(txq, i), txq->txq_sfree++) {
-		if (limit-- == 0)
+		if (limit-- == 0) {
+			more = true;
+			DPRINTF(WM_DEBUG_TX,
+			("%s: TX: loop limited, job %d is not processed\n",
+device_xname(sc->sc_dev), i));
 			break;
+		}
 
 		txs = &txq->txq_soft[i];
 
@@ -8168,7 +8174,7 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	if (txq->txq_sfree == WM_TXQUEUELEN(txq))
 		txq->txq_watchdog = false;
 
-	return count;
+	return more;
 }
 
 static inline uint32_t
@@ -8381,7 +8387,7 @@ wm_rxdesc_ensure_checksum(struct wm_rxqu
  *
  *	Helper; handle receive interrupts.
  */
-static void
+static bool
 wm_rxeof(struct wm_rxqueue *rxq, u_int limit)
 {
 	struct wm_softc *sc = rxq->rxq_sc;
@@ -8392,12 +8398,17 @@ wm_rxeof(struct wm_rxqueue *rxq, u_int l
 	int count = 0;
 	uint32_t status, errors;
 	uint16_t vlantag;
+	bool more = false;
 
 	KASSERT(mutex_owned(rxq->rxq_lock));
 
 	for (i = rxq->rxq_ptr;; i = WM_NEXTRX(i)) {
 		if (limit-- == 0) {
 			rxq->rxq_ptr = i;
+			more = true;
+			DPRINTF(WM_DEBUG_RX,
+			("%s: RX: loop limited, descriptor %d is not processed\n",
+device_xname(sc->sc_dev), i));
 			break;
 		}
 
@@ -8571,6 +8582,8 @@ wm_rxeof(struct wm_rxqueue *rxq, u_int l
 
 	DPRINTF(WM_DEBUG_RX,
 	("%s: RX: rxptr -> %d\n", device_xname(sc->sc_dev), i));
+
+	return more;
 }
 
 /*
@@ -9009,6 +9022,8 @@ wm_txrxintr_msix(void *arg)
 	struct wm_softc *sc = txq->txq_sc;
 	u_int txlimit = sc->sc_tx_intr_process_limit;
 	u_int rxlimit = sc->sc_rx_intr_process_limit;
+	bool txmore;
+	bool rxmore;
 
 	KASSERT(wmq->wmq_intr_idx == wmq->wmq_id);
 
@@ -9025,7 +9040,7 @@ wm_txrxintr_msix(void *arg)
 	}
 
 	WM_Q_EVCNT_INCR(txq, txdw);
-	wm_txeof(txq, txlimit);
+	txmore = wm_txeof(txq, txlimit);
 	/* wm_deferred start() is done in wm_handle_queue(). */
 	mutex_exit(txq->txq_lock);
 
@@ -9039,12 +9054,15 @@ wm_txrxintr_msix(void *arg)
 	}
 
 	WM_Q_EVCNT_INCR(rxq, rxintr);
-	wm_rxeof(rxq, rxlimit);
+	rxmore = wm_rxeof(rxq, rxlimit);
 	mutex_exit(rxq->rxq_lock);
 
 	wm_itrs_writereg(sc, wmq);
 
-	softint_schedule(wmq->wmq_si);
+	if (txmore || rxmore)
+		softint_schedule(wmq->wmq_si);
+	else
+		wm_txrxintr_enable(wmq);
 
 	return 1;
 }
@@ -9058,13 +9076,15 @@ wm_handle_queue(void *arg)
 	struct wm_softc *sc = txq->txq_sc;
 	u_int txlimit = sc->sc_tx_process_limit;
 

CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 00:10:44 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Hmmm, for some reason the first entry in the generated list is not
in collating-sequence order.  Move it to the proper place in the
list.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.18 src/share/man/man4/iic.4:1.19
--- src/share/man/man4/iic.4:1.18	Sun Feb 25 23:55:55 2018
+++ src/share/man/man4/iic.4	Mon Feb 26 00:10:44 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.18 2018/02/25 23:55:55 pgoyette Exp $
+.\"	$NetBSD: iic.4,v 1.19 2018/02/26 00:10:44 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -32,7 +32,6 @@
 .\" cat /tmp/x
 .\"
 .Sh DESCRIPTION
-.Cd "iic* at tsciic?  # alpha "
 .Cd "iic* at alipm?   # alpha amd64 i386 sparc64 "
 .Cd "iic* at amdpm?   # amd64 i386 "
 .Cd "iic* at armadillo9iic?   # evbarm "
@@ -74,6 +73,7 @@
 .Cd "iic0 at slugiic0 # evbarm "
 .Cd "iic* at tegrai2c?# evbarm "
 .Cd "iic* at tiiic?   # evbarm "
+.Cd "iic* at tsciic?  # alpha "
 .Cd "iic* at viapcib? # i386 "
 .Cd "iic* at voyager0 # evbmips "
 .Cd "iic0 at ziic?# evbmips zaurus "



CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 00:14:57 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Ooopppsss!  Put the .Sh DESCRIPTION where it belongs, _after_ the
list of config attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.19 src/share/man/man4/iic.4:1.20
--- src/share/man/man4/iic.4:1.19	Mon Feb 26 00:10:44 2018
+++ src/share/man/man4/iic.4	Mon Feb 26 00:14:56 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.19 2018/02/26 00:10:44 pgoyette Exp $
+.\"	$NetBSD: iic.4,v 1.20 2018/02/26 00:14:56 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -31,7 +31,6 @@
 .\" grep -h '^iic.*at' */conf/* | sort -u -k +3 | sed -e 's,[	 ][	 ]*, ,g' -e 's, *#.*,,' | sh -c 'while read iic at ic ; do printf ".Cd \"$iic $at %-20s # %s\"\n" "$ic" "`grep \"iic.*at.*$ic\" */conf/* | sed \"s,/.*,,\" | sort -u | tr \"\012\" \ `"  ; done' | uniq | tee /tmp/x
 .\" cat /tmp/x
 .\"
-.Sh DESCRIPTION
 .Cd "iic* at alipm?   # alpha amd64 i386 sparc64 "
 .Cd "iic* at amdpm?   # amd64 i386 "
 .Cd "iic* at armadillo9iic?   # evbarm "
@@ -77,6 +76,7 @@
 .Cd "iic* at viapcib? # i386 "
 .Cd "iic* at voyager0 # evbmips "
 .Cd "iic0 at ziic?# evbmips zaurus "
+.Sh DESCRIPTION
 I2C is a two-wire bus developed by Philips used for connecting
 integrated circuits.
 It is commonly used for connecting devices such as EEPROMs,



CVS commit: src/share/man/man4

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 00:17:40 UTC 2018

Modified Files:
src/share/man/man4: iic.4

Log Message:
Finally, remove extraneous entries for macppc's "iic at cuda".  We
don't need three entries that differ only in wildcarding.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man4/iic.4

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

Modified files:

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.20 src/share/man/man4/iic.4:1.21
--- src/share/man/man4/iic.4:1.20	Mon Feb 26 00:14:56 2018
+++ src/share/man/man4/iic.4	Mon Feb 26 00:17:40 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.20 2018/02/26 00:14:56 pgoyette Exp $
+.\"	$NetBSD: iic.4,v 1.21 2018/02/26 00:17:40 pgoyette Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -39,8 +39,6 @@
 .Cd "iic* at awiniic? # evbarm "
 .Cd "iic* at bcmi2c?  # evbarm "
 .Cd "iic* at coram?   # amd64 i386 "
-.Cd "iic* at cuda0# macppc "
-.Cd "iic0 at cuda0# macppc "
 .Cd "iic* at cuda?# macppc "
 .Cd "iic* at cxdtv?   # amd64 i386 "
 .Cd "iic* at diic?# acorn32 evbppc "



CVS commit: [netbsd-8] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:19:44 UTC 2018

Modified Files:
src/sys/arch/arm/include [netbsd-8]: cpu.h
src/sys/arch/mips/include [netbsd-8]: cpu.h
src/sys/arch/powerpc/include [netbsd-8]: cpu.h
src/sys/sys [netbsd-8]: cpu.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #566):
sys/arch/arm/include/cpu.h: 1.94
sys/arch/mips/include/cpu.h: 1.122
sys/arch/powerpc/include/cpu.h: 1.103
sys/sys/cpu.h: 1.42
CPU_INFO_FOREACH() must always iterate at least the boot cpu.
document this in sys/cpu.h and fix the arm and mips versions
to check ncpu is non zero before using it as an iterator max.
this should fix the new assert in init_main.c.
--
apply the same change for powerpc as mrg did for arm and mips:
CPU_INFO_FOREACH() must always iterate at least the boot cpu.
document this in sys/cpu.h and fix the arm and mips versions
to check ncpu is non zero before using it as an iterator max.
this should fix the new assert in init_main.c.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.93.6.1 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.121 -r1.121.8.1 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.102 -r1.102.8.1 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.41 -r1.41.20.1 src/sys/sys/cpu.h

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

Modified files:

Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.93 src/sys/arch/arm/include/cpu.h:1.93.6.1
--- src/sys/arch/arm/include/cpu.h:1.93	Tue Apr  4 09:26:32 2017
+++ src/sys/arch/arm/include/cpu.h	Mon Feb 26 00:19:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.93 2017/04/04 09:26:32 sevan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.93.6.1 2018/02/26 00:19:44 snj Exp $	*/
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -235,7 +235,7 @@ extern struct cpu_info *cpu_info[];
 #define cpu_number()		(curcpu()->ci_index)
 #define CPU_IS_PRIMARY(ci)	((ci)->ci_index == 0)
 #define CPU_INFO_FOREACH(cii, ci)			\
-	cii = 0, ci = cpu_info[0]; cii < ncpu && (ci = cpu_info[cii]) != NULL; cii++
+	cii = 0, ci = cpu_info[0]; cii < (ncpu ? ncpu : 1) && (ci = cpu_info[cii]) != NULL; cii++
 #else
 #define cpu_number()0
 

Index: src/sys/arch/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.121 src/sys/arch/mips/include/cpu.h:1.121.8.1
--- src/sys/arch/mips/include/cpu.h:1.121	Mon Oct 31 12:49:04 2016
+++ src/sys/arch/mips/include/cpu.h	Mon Feb 26 00:19:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.121 2016/10/31 12:49:04 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.121.8.1 2018/02/26 00:19:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -160,7 +160,7 @@ struct cpu_info {
 #ifdef MULTIPROCESSOR
 #define	CPU_INFO_ITERATOR		int
 #define	CPU_INFO_FOREACH(cii, ci)	\
-cii = 0, ci = cpu_infos[0]; cii < ncpu && (ci = cpu_infos[cii]) != NULL; cii++
+cii = 0, ci = cpu_infos[0]; cii < (ncpu ? ncpu : 1) && (ci = cpu_infos[cii]) != NULL; cii++
 #else
 #define	CPU_INFO_ITERATOR		int __unused
 #define	CPU_INFO_FOREACH(cii, ci)	\

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.102 src/sys/arch/powerpc/include/cpu.h:1.102.8.1
--- src/sys/arch/powerpc/include/cpu.h:1.102	Wed Oct 19 00:08:42 2016
+++ src/sys/arch/powerpc/include/cpu.h	Mon Feb 26 00:19:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.102 2016/10/19 00:08:42 nonaka Exp $	*/
+/*	$NetBSD: cpu.h,v 1.102.8.1 2018/02/26 00:19:44 snj Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -32,6 +32,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 #ifndef	_POWERPC_CPU_H_
 #define	_POWERPC_CPU_H_
 
@@ -54,6 +55,8 @@ struct cache_info {
 #include 
 #include 
 #include 
+#include 
+#include 
 #endif
 
 #include 
@@ -191,7 +194,7 @@ extern struct cpuset_info cpuset_info;
 #define CPU_IS_PRIMARY(ci)	((ci)->ci_cpuid == 0)
 #define CPU_INFO_ITERATOR	int
 #define CPU_INFO_FOREACH(cii, ci)\
-	cii = 0, ci = &cpu_info[0]; cii < ncpu; cii++, ci++
+	cii = 0, ci = &cpu_info[0]; cii < (ncpu ? ncpu : 1); cii++, ci++
 
 #else
 #define cpu_number()		0

Index: src/sys/sys/cpu.h
diff -u src/sys/sys/cpu.h:1.41 src/sys/sys/cpu.h:1.41.20.1
--- src/sys/sys/cpu.h:1.41	Mon May 19 20:39:23 2014
+++ src/sys/sys/cpu.h	Mon Feb 26 00:19:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.41 2014/05/19 20:39:23 rmind Exp $	*/
+/*	$NetBSD: cpu.h,v 1.41.20.1 2018/02/26 00:19:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 2007 YAMAMOTO Takashi,
@@ -63,6 +63,14 @@ void cpu_need_resched(struct cpu_info *,
 #define	cpu_did_resched(l)	/* nothing */
 #endif
 
+/*
+ * CPU_INFO_ITERATOR() may be supplied by machine dependent code as it
+ * controls how the cpu_info structures are allocated.
+ * 
+ * This macro must always iterate just the boot-CPU when the system has
+ * not attached any cpus via mi_cpu_attach

CVS commit: [netbsd-8] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:25:16 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixgbe_rss.h ixv.c
src/sys/net [netbsd-8]: files.net
Added Files:
src/sys/net [netbsd-8]: rss_config.c rss_config.h

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #567):
distrib/sets/lists/comp/mi: 1.2182-1.2183
sys/dev/pci/if_wm.c: 1.564
sys/dev/pci/ixgbe/ixgbe.c: 1.122
sys/dev/pci/ixgbe/ixgbe_rss.h: 1.3
sys/dev/pci/ixgbe/ixv.c: 1.78
sys/net/Makefile: 1.35-1.36
sys/net/files.net: 1.15
sys/net/rss_config.c: 1.1
sys/net/rss_config.h: 1.1
Introduce very simple Receive Side Scaling (RSS) utility.
ok by msaitoh@n.o.
--
Apply RSS utility to wm(4).
ok by msaitoh@n.o.
--
Apply RSS utility to ixg(4) and ixv(4).
ok by msaitoh@n.o.
--
Fix build failure, sorry.
--
Currently, it is not necessary to install rss_config.h. Pointed out by 
msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.14 -r1.508.4.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.88.2.8 -r1.88.2.9 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/pci/ixgbe/ixgbe_rss.h
cvs rdiff -u -r1.56.2.5 -r1.56.2.6 src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.13.6.1 -r1.13.6.2 src/sys/net/files.net
cvs rdiff -u -r0 -r1.1.2.2 src/sys/net/rss_config.c src/sys/net/rss_config.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.14 src/sys/dev/pci/if_wm.c:1.508.4.15
--- src/sys/dev/pci/if_wm.c:1.508.4.14	Mon Feb 26 00:00:53 2018
+++ src/sys/dev/pci/if_wm.c	Mon Feb 26 00:25:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.14 2018/02/26 00:00:53 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.15 2018/02/26 00:25:16 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.14 2018/02/26 00:00:53 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.15 2018/02/26 00:25:16 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -116,6 +116,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.
 
 #include 
 
+#include 
+
 #include 			/* XXX for struct ip */
 #include 		/* XXX for struct ip */
 #include 			/* XXX for struct ip */
@@ -715,7 +717,6 @@ static void	wm_flush_desc_rings(struct w
 static void	wm_reset(struct wm_softc *);
 static int	wm_add_rxbuf(struct wm_rxqueue *, int);
 static void	wm_rxdrain(struct wm_rxqueue *);
-static void	wm_rss_getkey(uint8_t *);
 static void	wm_init_rss(struct wm_softc *);
 static void	wm_adjust_qnum(struct wm_softc *, int);
 static inline bool	wm_is_using_msix(struct wm_softc *);
@@ -4838,43 +4839,6 @@ wm_rxdrain(struct wm_rxqueue *rxq)
 	}
 }
 
-
-/*
- * XXX copy from FreeBSD's sys/net/rss_config.c
- */
-/*
- * RSS secret key, intended to prevent attacks on load-balancing.  Its
- * effectiveness may be limited by algorithm choice and available entropy
- * during the boot.
- *
- * XXXRW: And that we don't randomize it yet!
- *
- * This is the default Microsoft RSS specification key which is also
- * the Chelsio T5 firmware default key.
- */
-#define RSS_KEYSIZE 40
-static uint8_t wm_rss_key[RSS_KEYSIZE] = {
-	0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
-	0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
-	0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
-	0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
-	0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa,
-};
-
-/*
- * Caller must pass an array of size sizeof(rss_key).
- *
- * XXX
- * As if_ixgbe may use this function, this function should not be
- * if_wm specific function.
- */
-static void
-wm_rss_getkey(uint8_t *key)
-{
-
-	memcpy(key, wm_rss_key, sizeof(wm_rss_key));
-}
-
 /*
  * Setup registers for RSS.
  *
@@ -4886,7 +4850,7 @@ wm_init_rss(struct wm_softc *sc)
 	uint32_t mrqc, reta_reg, rss_key[RSSRK_NUM_REGS];
 	int i;
 
-	CTASSERT(sizeof(rss_key) == sizeof(wm_rss_key));
+	CTASSERT(sizeof(rss_key) == RSS_KEYSIZE);
 
 	for (i = 0; i < RETA_NUM_ENTRIES; i++) {
 		int qid, reta_ent;
@@ -4912,7 +4876,7 @@ wm_init_rss(struct wm_softc *sc)
 		CSR_WRITE(sc, WMREG_RETA_Q(i), reta_reg);
 	}
 
-	wm_rss_getkey((uint8_t *)rss_key);
+	rss_getkey((uint8_t *)rss_key);
 	for (i = 0; i < RSSRK_NUM_REGS; i++)
 		CSR_WRITE(sc, WMREG_RSSRK(i), rss_key[i]);
 

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.8 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.9
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.8	Sat Jan 13 21:40:01 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Feb 26 00:25:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.8 2018/01/13 21:40:01 snj Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.9 2018/02/26 00:25:16 snj Exp $ */
 
 /*

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:26:46 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: ip6_input.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #568):
sys/netinet6/ip6_input.c: 1.188
Kick nested fragments.


To generate a diff of this commit:
cvs rdiff -u -r1.178.2.4 -r1.178.2.5 src/sys/netinet6/ip6_input.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/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.178.2.4 src/sys/netinet6/ip6_input.c:1.178.2.5
--- src/sys/netinet6/ip6_input.c:1.178.2.4	Tue Jan 30 18:21:09 2018
+++ src/sys/netinet6/ip6_input.c	Mon Feb 26 00:26:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.178.2.4 2018/01/30 18:21:09 martin Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.178.2.5 2018/02/26 00:26:46 snj Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.178.2.4 2018/01/30 18:21:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.178.2.5 2018/02/26 00:26:46 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -258,7 +258,7 @@ ip6_input(struct mbuf *m, struct ifnet *
 	int hit, off = sizeof(struct ip6_hdr), nest;
 	u_int32_t plen;
 	u_int32_t rtalert = ~0;
-	int nxt, ours = 0, rh_present = 0;
+	int nxt, ours = 0, rh_present = 0, frg_present;
 	struct ifnet *deliverifp = NULL;
 	int srcrt = 0;
 	struct rtentry *rt = NULL;
@@ -776,6 +776,7 @@ ip6_input(struct mbuf *m, struct ifnet *
 	percpu_putref(ip6_forward_rt_percpu);
 
 	rh_present = 0;
+	frg_present = 0;
 	while (nxt != IPPROTO_DONE) {
 		if (ip6_hdrnestlimit && (++nest > ip6_hdrnestlimit)) {
 			IP6_STATINC(IP6_STAT_TOOMANYHDR);
@@ -799,6 +800,12 @@ ip6_input(struct mbuf *m, struct ifnet *
 IP6_STATINC(IP6_STAT_BADOPTIONS);
 goto bad;
 			}
+		} else if (nxt == IPPROTO_FRAGMENT) {
+			if (frg_present++) {
+in6_ifstat_inc(rcvif, ifs6_in_hdrerr);
+IP6_STATINC(IP6_STAT_BADOPTIONS);
+goto bad;
+			}
 		}
 
 #ifdef IPSEC



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:29:27 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: route6.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #569):
sys/netinet6/route6.c: 1.24-1.25
Fix the ICMP error code. rh was obtained via IP6_EXTHDR_GET, and it is not
guaranteed to be in the same mbuf as ip6, so computing the difference
between the pointers may result in a wrong offset.
ip6 is now unused, so remove it.
--
Remove this code, RH0 must be dropped, according to RFC5095. FreeBSD and
OpenBSD already do the same. Also, style, and remove useless includes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.84.1 src/sys/netinet6/route6.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/route6.c
diff -u src/sys/netinet6/route6.c:1.23 src/sys/netinet6/route6.c:1.23.84.1
--- src/sys/netinet6/route6.c:1.23	Tue Apr 15 03:57:04 2008
+++ src/sys/netinet6/route6.c	Mon Feb 26 00:29:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route6.c,v 1.23 2008/04/15 03:57:04 thorpej Exp $	*/
+/*	$NetBSD: route6.c,v 1.23.84.1 2018/02/26 00:29:27 snj Exp $	*/
 /*	$KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $	*/
 
 /*
@@ -31,13 +31,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.23 2008/04/15 03:57:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.23.84.1 2018/02/26 00:29:27 snj Exp $");
 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #include 
 
@@ -46,23 +44,16 @@ __KERNEL_RCSID(0, "$NetBSD: route6.c,v 1
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
-#if 0
-static int ip6_rthdr0(struct mbuf *, struct ip6_hdr *, struct ip6_rthdr0 *);
-#endif
-
 int
 route6_input(struct mbuf **mp, int *offp, int proto)
 {
-	struct ip6_hdr *ip6;
 	struct mbuf *m = *mp;
 	struct ip6_rthdr *rh;
 	int off = *offp, rhlen;
 
-	ip6 = mtod(m, struct ip6_hdr *);
 	IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, sizeof(*rh));
 	if (rh == NULL) {
 		IP6_STATINC(IP6_STAT_TOOSHORT);
@@ -70,41 +61,10 @@ route6_input(struct mbuf **mp, int *offp
 	}
 
 	switch (rh->ip6r_type) {
-#if 0
-	/*
-	 * See http://www.secdev.org/conf/IPv6_RH_security-csw07.pdf
-	 * for why IPV6_RTHDR_TYPE_0 is banned here.
-	 *
-	 * We return ICMPv6 parameter problem so that innocent people
-	 * (not an attacker) would notice about the use of IPV6_RTHDR_TYPE_0.
-	 * Since there's no amplification, and ICMPv6 error will be rate-
-	 * controlled, it shouldn't cause any problem.
-	 * If you are concerned about this, you may want to use the following
-	 * code fragment:
-	 *
-	 * case IPV6_RTHDR_TYPE_0:
-	 *	m_freem(m);
-	 *	return (IPPROTO_DONE);
-	 */
 	case IPV6_RTHDR_TYPE_0:
-		rhlen = (rh->ip6r_len + 1) << 3;
 		/*
-		 * note on option length:
-		 * maximum rhlen: 2048
-		 * max mbuf m_pulldown can handle: MCLBYTES == usually 2048
-		 * so, here we are assuming that m_pulldown can handle
-		 * rhlen == 2048 case.  this may not be a good thing to
-		 * assume - we may want to avoid pulling it up altogether.
+		 * RFC5095: RH0 must be treated as unrecognized.
 		 */
-		IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, rhlen);
-		if (rh == NULL) {
-			IP6_STATINC(IP6_STAT_TOOSHORT);
-			return IPPROTO_DONE;
-		}
-		if (ip6_rthdr0(m, ip6, (struct ip6_rthdr0 *)rh))
-			return (IPPROTO_DONE);
-		break;
-#endif
 	default:
 		/* unknown routing type */
 		if (rh->ip6r_segleft == 0) {
@@ -113,112 +73,10 @@ route6_input(struct mbuf **mp, int *offp
 		}
 		IP6_STATINC(IP6_STAT_BADOPTIONS);
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)&rh->ip6r_type - (char *)ip6);
-		return (IPPROTO_DONE);
+		off + offsetof(struct ip6_rthdr, ip6r_type));
+		return IPPROTO_DONE;
 	}
 
 	*offp += rhlen;
-	return (rh->ip6r_nxt);
-}
-
-#if 0
-/*
- * Type0 routing header processing
- *
- * RFC2292 backward compatibility warning: no support for strict/loose bitmap,
- * as it was dropped between RFC1883 and RFC2460.
- */
-static int
-ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, 
-	struct ip6_rthdr0 *rh0)
-{
-	int addrs, index;
-	struct in6_addr *nextaddr, tmpaddr;
-	const struct ip6aux *ip6a;
-
-	if (rh0->ip6r0_segleft == 0)
-		return (0);
-
-	if (rh0->ip6r0_len % 2
-#ifdef COMPAT_RFC1883
-	|| rh0->ip6r0_len > 46
-#endif
-		) {
-		/*
-		 * Type 0 routing header can't contain more than 23 addresses.
-		 * RFC 2462: this limitation was removed since strict/loose
-		 * bitmap field was deleted.
-		 */
-		IP6_STATINC(IP6_STAT_BADOPTIONS);
-		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)&rh0->ip6r0_len - (char *)ip6);
-		return (-1);
-	}
-
-	if ((addrs = rh0->ip6r0_len / 2) < rh0->ip6r0_segleft) {
-		IP6_STATINC(IP6_STAT_BADOPTIONS);
-		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)&rh0->ip6r0_segleft - (char *)ip6);
-		return (-1);
-	}
-
-	index = addrs - rh0->ip6r0_segleft;
-	rh0->ip

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:33:08 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by alnsn in ticket #570):
sys/dist/pf/net/pf.c: 1.79-1.80
PR/53036: Alexander Nasonov: 'block user' in pf's ruleset panics 8.0_BETA
Check for NULL.
--
It is normal for socket credentials to be missing for incoming sockets,
so don't warn.


To generate a diff of this commit:
cvs rdiff -u -r1.76.6.1 -r1.76.6.2 src/sys/dist/pf/net/pf.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/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.76.6.1 src/sys/dist/pf/net/pf.c:1.76.6.2
--- src/sys/dist/pf/net/pf.c:1.76.6.1	Sat Feb 10 04:12:17 2018
+++ src/sys/dist/pf/net/pf.c	Mon Feb 26 00:33:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf.c,v 1.76.6.1 2018/02/10 04:12:17 snj Exp $	*/
+/*	$NetBSD: pf.c,v 1.76.6.2 2018/02/26 00:33:08 snj Exp $	*/
 /*	$OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.76.6.1 2018/02/10 04:12:17 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.76.6.2 2018/02/26 00:33:08 snj Exp $");
 
 #include "pflog.h"
 
@@ -2847,6 +2847,8 @@ pf_socket_lookup(int direction, struct p
 		break;
 #endif /* INET6 */
 	}
+	if (so == NULL || so->so_cred == NULL)
+		return -1;
 	pd->lookup.uid = kauth_cred_geteuid(so->so_cred);
 	pd->lookup.gid = kauth_cred_getegid(so->so_cred);
 #else



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:35:56 UTC 2018

Modified Files:
src/tests/net/net [netbsd-8]: t_ping_opts.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #571):
tests/net/net/t_ping_opts.sh: 1.2-1.3
Now that we don't allow source-routed packets by default, set allowsrcrt=1
and forwsrcrt=1. Should fix the ATF failure.
--
Fix ping_opts_gateway and ping_opts_recordroute
We need to enable the options of source routing on all rump kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.8.1 src/tests/net/net/t_ping_opts.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/net/t_ping_opts.sh
diff -u src/tests/net/net/t_ping_opts.sh:1.1 src/tests/net/net/t_ping_opts.sh:1.1.8.1
--- src/tests/net/net/t_ping_opts.sh:1.1	Fri Mar 31 06:41:40 2017
+++ src/tests/net/net/t_ping_opts.sh	Mon Feb 26 00:35:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ping_opts.sh,v 1.1 2017/03/31 06:41:40 ozaki-r Exp $
+#	$NetBSD: t_ping_opts.sh,v 1.1.8.1 2018/02/26 00:35:56 snj Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -222,6 +222,22 @@ ping_opts_gateway_body()
 	check_echo_request_pkt_with_macaddr \
 	$my_macaddr $gw_shmif0_macaddr $IPSRC $IPDST
 
+	export RUMP_SERVER=$SOCKSRC
+	# ping -g 
+	# By default source-routed packets are prohibited
+	atf_check -s not-exit:0 -o match:'Net prohibited access' \
+	rump.ping $PING_OPTS -g $IPSRCGW $IPDST
+
+	# Enable the options of source routing
+	export RUMP_SERVER=$SOCKSRC
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	export RUMP_SERVER=$SOCKDST
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	export RUMP_SERVER=$SOCKFWD
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwsrcrt=1
+
+	export RUMP_SERVER=$SOCKSRC
 	# ping -g 
 	atf_check -s exit:0 -o ignore rump.ping $PING_OPTS \
 	-g $IPSRCGW $IPDST
@@ -302,6 +318,16 @@ ping_opts_recordroute_body()
 	$my_macaddr $gw_shmif0_macaddr $IPSRC $IPDST
 	check_recorded_routes $out
 
+	# Enable the options of source routing
+	export RUMP_SERVER=$SOCKSRC
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	export RUMP_SERVER=$SOCKDST
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	export RUMP_SERVER=$SOCKFWD
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.allowsrcrt=1
+	atf_check -s exit:0 rump.sysctl -q -w net.inet.ip.forwsrcrt=1
+
+	export RUMP_SERVER=$SOCKSRC
 	# ping -R -g 
 	atf_check -s exit:0 -o save:$out rump.ping $PING_OPTS \
 	-R -g $IPSRCGW $IPDST



CVS commit: [netbsd-8] src

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:41:14 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if_bridge.c
src/tests/net [netbsd-8]: net_common.sh
src/tests/net/if_bridge [netbsd-8]: t_bridge.sh
src/tests/net/if_gif [netbsd-8]: t_gif.sh
src/tests/net/if_ipsec [netbsd-8]: t_ipsec.sh
src/tests/net/if_l2tp [netbsd-8]: t_l2tp.sh
src/tests/net/if_loop [netbsd-8]: t_basic.sh
src/tests/net/if_pppoe [netbsd-8]: t_pppoe.sh
src/tests/net/if_tap [netbsd-8]: t_tap.sh
src/tests/net/if_tun [netbsd-8]: Makefile t_tun.sh
src/tests/net/if_vlan [netbsd-8]: t_vlan.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #572):
sys/net/if_bridge.c: 1.138, 1.148
tests/net/if_bridge/t_bridge.sh: 1.18
tests/net/if_gif/t_gif.sh: 1.12
tests/net/if_ipsec/t_ipsec.sh: 1.3
tests/net/if_l2tp/t_l2tp.sh: 1.4
tests/net/if_loop/t_basic.sh: 1.2
tests/net/if_pppoe/t_pppoe.sh: 1.18
tests/net/if_tap/t_tap.sh: 1.7
tests/net/if_tun/Makefile: 1.2
tests/net/if_tun/t_tun.sh: 1.5
tests/net/if_vlan/t_vlan.sh: 1.8
tests/net/net_common.sh: 1.26
Remove unnecessary splsoftnet
--
If the bridge is not running, don't call bridge_stop. Otherwise the
following commands will crash the kernel:
ifconfig bridge0 create
ifconfig bridge0 destroy
--
Commonalize and add tests of creating/destroying interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.134.6.6 -r1.134.6.7 src/sys/net/if_bridge.c
cvs rdiff -u -r1.18.2.3 -r1.18.2.4 src/tests/net/net_common.sh
cvs rdiff -u -r1.17 -r1.17.4.1 src/tests/net/if_bridge/t_bridge.sh
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/tests/net/if_gif/t_gif.sh
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/tests/net/if_ipsec/t_ipsec.sh
cvs rdiff -u -r1.2.8.1 -r1.2.8.2 src/tests/net/if_l2tp/t_l2tp.sh
cvs rdiff -u -r1.1 -r1.1.8.1 src/tests/net/if_loop/t_basic.sh
cvs rdiff -u -r1.17 -r1.17.4.1 src/tests/net/if_pppoe/t_pppoe.sh
cvs rdiff -u -r1.6 -r1.6.6.1 src/tests/net/if_tap/t_tap.sh
cvs rdiff -u -r1.1 -r1.1.8.1 src/tests/net/if_tun/Makefile
cvs rdiff -u -r1.4 -r1.4.6.1 src/tests/net/if_tun/t_tun.sh
cvs rdiff -u -r1.1.8.1 -r1.1.8.2 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/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.134.6.6 src/sys/net/if_bridge.c:1.134.6.7
--- src/sys/net/if_bridge.c:1.134.6.6	Tue Jan 16 13:01:10 2018
+++ src/sys/net/if_bridge.c	Mon Feb 26 00:41:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.134.6.6 2018/01/16 13:01:10 martin Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.6 2018/01/16 13:01:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -468,11 +468,9 @@ bridge_clone_destroy(struct ifnet *ifp)
 {
 	struct bridge_softc *sc = ifp->if_softc;
 	struct bridge_iflist *bif;
-	int s;
-
-	s = splsoftnet();
 
-	bridge_stop(ifp, 1);
+	if ((ifp->if_flags & IFF_RUNNING) != 0)
+		bridge_stop(ifp, 1);
 
 	BRIDGE_LOCK(sc);
 	for (;;) {
@@ -485,8 +483,6 @@ bridge_clone_destroy(struct ifnet *ifp)
 	PSLIST_DESTROY(&sc->sc_iflist_psref.bip_iflist);
 	BRIDGE_UNLOCK(sc);
 
-	splx(s);
-
 	if_detach(ifp);
 
 	/* Tear down the routing table. */

Index: src/tests/net/net_common.sh
diff -u src/tests/net/net_common.sh:1.18.2.3 src/tests/net/net_common.sh:1.18.2.4
--- src/tests/net/net_common.sh:1.18.2.3	Fri Nov 17 20:43:11 2017
+++ src/tests/net/net_common.sh	Mon Feb 26 00:41:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: net_common.sh,v 1.18.2.3 2017/11/17 20:43:11 snj Exp $
+#	$NetBSD: net_common.sh,v 1.18.2.4 2018/02/26 00:41:13 snj Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -431,3 +431,45 @@ skip_if_qemu()
 	atf_skip "unreliable under qemu, skip until PR kern/43997 fixed"
 	fi
 }
+
+test_create_destroy_common()
+{
+	local sock=$1
+	local ifname=$2
+	local test_address=${3:-false}
+	local ipv4="10.0.0.1/24"
+	local ipv6="fc00::1"
+
+	export RUMP_SERVER=$sock
+
+	atf_check -s exit:0 rump.ifconfig $ifname create
+	atf_check -s exit:0 rump.ifconfig $ifname destroy
+
+	atf_check -s exit:0 rump.ifconfig $ifname create
+	atf_check -s exit:0 rump.ifconfig $ifname up
+	atf_check -s exit:0 rump.ifconfig $ifname down
+	atf_check -s exit:0 rump.ifconfig $ifname destroy
+
+	# Destroy while UP
+	atf_check -s exit:0 rump.ifconfig $ifname create
+	atf_check -s exit:0 rump.ifconfig $ifname up
+	atf_check -s exit:0 rump.ifconfig $ifname destroy
+
+	if ! $test_address; then
+		return
+	fi
+
+	# With an IPv4 address
+	atf_check -s exit:0 rump.ifconfig $ifname create

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:43:23 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: kern_synch.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #573):
sys/kern/kern_synch.c: 1.314
Avoid a race condition between an LWP migration and curlwp_bind
curlwp_bind sets the LP_BOUND flag to l_pflags of the current LWP, which
prevents it from migrating to another CPU until curlwp_bindx is called.
Meanwhile, there are several ways that an LWP is migrated to another CPU and in
any cases the scheduler postpones a migration if a target LWP is running.  One
example of LWP migrations is a load balancing; the scheduler periodically
explores CPU-hogging LWPs and schedule them to migrate (see sched_lwp_stats).
At that point the scheduler checks the LP_BOUND flag and if it's set to a LWP,
the scheduler doesn't schedule the LWP.  A scheduled LWP is tried to be migrated
when it is leaving a running CPU, i.e., mi_switch.  And mi_switch does NOT check
the LP_BOUND flag.  So if an LWP is scheduled first and then it sets the
LP_BOUND flag, the LWP can be migrated regardless of the flag.  To avoid this
race condition, we need to check the flag in mi_switch too.
For more details see
https://mail-index.netbsd.org/tech-kern/2018/02/13/msg023079.html


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.311.10.1 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.311 src/sys/kern/kern_synch.c:1.311.10.1
--- src/sys/kern/kern_synch.c:1.311	Sun Jul  3 14:24:58 2016
+++ src/sys/kern/kern_synch.c	Mon Feb 26 00:43:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.311 2016/07/03 14:24:58 christos Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.311.10.1 2018/02/26 00:43:23 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.311 2016/07/03 14:24:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.311.10.1 2018/02/26 00:43:23 snj Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -589,7 +589,8 @@ mi_switch(lwp_t *l)
 			 * be reset here, if interrupt/preemption happens
 			 * early in idle LWP.
 			 */
-			if (l->l_target_cpu != NULL) {
+			if (l->l_target_cpu != NULL &&
+			(l->l_pflag & LP_BOUND) == 0) {
 KASSERT((l->l_pflag & LP_INTR) == 0);
 spc->spc_migrating = l;
 			}



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:49:48 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-8]: copy.S cpufunc.S

Log Message:
Pull up following revision(s) (requested by maxv in ticket #575):
sys/arch/amd64/amd64/copy.S: 1.28 via patch
sys/arch/amd64/amd64/cpufunc.S: 1.31
Don't fall through functions, explicitly jump instead.


To generate a diff of this commit:
cvs rdiff -u -r1.20.10.1 -r1.20.10.2 src/sys/arch/amd64/amd64/copy.S
cvs rdiff -u -r1.27 -r1.27.8.1 src/sys/arch/amd64/amd64/cpufunc.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/amd64/amd64/copy.S
diff -u src/sys/arch/amd64/amd64/copy.S:1.20.10.1 src/sys/arch/amd64/amd64/copy.S:1.20.10.2
--- src/sys/arch/amd64/amd64/copy.S:1.20.10.1	Mon Sep  4 20:41:28 2017
+++ src/sys/arch/amd64/amd64/copy.S	Mon Feb 26 00:49:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.20.10.1 2017/09/04 20:41:28 snj Exp $	*/
+/*	$NetBSD: copy.S,v 1.20.10.2 2018/02/26 00:49:48 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -105,6 +105,7 @@ ENTRY(do_pmap_load)
 	popq	%rdi
 	leaveq
 	ret
+END(do_pmap_load)
 
 /*
  * Copy routines from and to userland, plus a few more. See the
@@ -172,6 +173,7 @@ ENTRY(kcopy)
 .Lkcopy_end:
 	xorq	%rax,%rax
 	ret
+END(kcopy)
 
 ENTRY(copyout)
 	DEFERRED_SWITCH_CHECK
@@ -199,6 +201,7 @@ ENTRY(copyout)
 	xorl	%eax,%eax
 	ret
 	DEFERRED_SWITCH_CALL
+END(copyout)
 
 ENTRY(copyin)
 	DEFERRED_SWITCH_CHECK
@@ -227,21 +230,20 @@ ENTRY(copyin)
 	xorl	%eax,%eax
 	ret
 	DEFERRED_SWITCH_CALL
+END(copyin)
 
 NENTRY(copy_efault)
 	movq	$EFAULT,%rax
-
-/*
- * kcopy_fault is used by kcopy and copy_fault is used by copyin/out.
- *
- * they're distinguished for lazy pmap switching.  see trap().
- */
+	ret
+END(copy_efault)
 
 NENTRY(kcopy_fault)
 	ret
+END(kcopy_fault)
 
 NENTRY(copy_fault)
 	ret
+END(copy_fault)
 
 ENTRY(copyoutstr)
 	DEFERRED_SWITCH_CHECK
@@ -282,6 +284,7 @@ ENTRY(copyoutstr)
 	movq	$ENAMETOOLONG,%rax
 	jmp	copystr_return
 	DEFERRED_SWITCH_CALL
+END(copyoutstr)
 
 ENTRY(copyinstr)
 	DEFERRED_SWITCH_CHECK
@@ -315,16 +318,19 @@ ENTRY(copyinstr)
 	xorq	%rax,%rax
 	jmp	copystr_return
 
-2:	/* edx is zero -- return EFAULT or ENAMETOOLONG. */
+2:	/* rdx is zero -- return EFAULT or ENAMETOOLONG. */
 	movq	$VM_MAXUSER_ADDRESS,%r11
 	cmpq	%r11,%rsi
 	jae	_C_LABEL(copystr_efault)
 	movq	$ENAMETOOLONG,%rax
 	jmp	copystr_return
 	DEFERRED_SWITCH_CALL
+END(copyinstr)
 
 ENTRY(copystr_efault)
 	movl	$EFAULT,%eax
+	jmp	copystr_return
+END(copystr_efault)
 
 ENTRY(copystr_fault)
 copystr_return:
@@ -333,8 +339,8 @@ copystr_return:
 	jz	8f
 	subq	%rdx,%r8
 	movq	%r8,(%r9)
-
 8:	ret
+END(copystr_fault)
 
 ENTRY(copystr)
 	xchgq	%rdi,%rsi
@@ -354,7 +360,7 @@ ENTRY(copystr)
 	xorl	%eax,%eax
 	jmp	6f
 
-4:	/* edx is zero -- return ENAMETOOLONG. */
+4:	/* rdx is zero -- return ENAMETOOLONG. */
 	movl	$ENAMETOOLONG,%eax
 
 6:	/* Set *lencopied and return %eax. */
@@ -364,7 +370,7 @@ ENTRY(copystr)
 	movq	%r8,(%rcx)
 
 7:	ret
-
+END(copystr)
 
 ENTRY(fuswintr)
 	cmpl	$TLBSTATE_VALID,CPUVAR(TLBSTATE)
@@ -380,6 +386,7 @@ ENTRY(fuswintr)
 
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
+END(fuswintr)
 
 ENTRY(fubyte)
 	DEFERRED_SWITCH_CHECK
@@ -395,6 +402,7 @@ ENTRY(fubyte)
 	movq	$0,PCB_ONFAULT(%rcx)
 	ret
 	DEFERRED_SWITCH_CALL
+END(fubyte)
 
 ENTRY(suswintr)
 	cmpl	$TLBSTATE_VALID,CPUVAR(TLBSTATE)
@@ -411,6 +419,7 @@ ENTRY(suswintr)
 	xorq	%rax,%rax
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret
+END(suswintr)
 
 ENTRY(subyte)
 	DEFERRED_SWITCH_CHECK
@@ -428,6 +437,7 @@ ENTRY(subyte)
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret
 	DEFERRED_SWITCH_CALL
+END(subyte)
 
 /*
  * These are the same, but must reside at different addresses,
@@ -437,15 +447,18 @@ ENTRY(fusuintrfailure)
 	movq	$0,PCB_ONFAULT(%rcx)
 	movl	$-1,%eax
 	ret
+END(fusuintrfailure)
 
 ENTRY(fusufailure)
 	movq	$0,PCB_ONFAULT(%rcx)
 	movl	$-1,%eax
 	ret
+END(fusufailure)
 
 ENTRY(fusuaddrfault)
 	movl	$-1,%eax
 	ret
+END(fusuaddrfault)
 
 /*
  * Compare-and-swap the 64-bit integer in the user-space.
@@ -474,6 +487,7 @@ ENTRY(ucas_64)
 	xorq	%rax,%rax
 	ret
 	DEFERRED_SWITCH_CALL
+END(ucas_64)
 
 /*
  * int	ucas_32(volatile int32_t *uptr, int32_t old, int32_t new, int32_t *ret);
@@ -500,12 +514,16 @@ ENTRY(ucas_32)
 	xorq	%rax,%rax
 	ret
 	DEFERRED_SWITCH_CALL
+END(ucas_32)
 
 ENTRY(ucas_efault)
 	movq	$EFAULT,%rax
+	ret
+END(ucas_efault)
 
 NENTRY(ucas_fault)
 	ret
+END(ucas_fault)
 
 /*
  * int	ucas_ptr(volatile void **uptr, void *old, void *new, void **ret);
@@ -524,6 +542,7 @@ x86_copyfunc_end:	.globl	x86_copyfunc_en
  */
 	.section ".rodata"
 	.globl _C_LABEL(onfault_table)
+
 _C_LABEL(onfault_table):
 	.quad .Lcopyin_start
 	.quad .Lcopyin_end

Index: src/sys/arch/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.27 src/sys/arch/amd64/amd64/cpufunc.S:1.27.8.1
--- src/sys/arch/amd64/amd64/cpufunc.S:1.27	Sun Nov 27 14:49:21 2016

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 00:56:29 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #576):
sys/dev/pci/pci_subr.c: 1.197-1.200
sys/dev/pci/pcireg.h: 1.136-1.137
sys/dev/pci/ppbreg.h: 1.8
 Add VGA 16bit decode bit into the PCI bridge control register. This bit is
defined in PCI-to-PCI Bridge Architecture Specification Revision 1.2. This
bit has meaning if the VGA enable bit or the VGA Palette Snoop Enable bit is
set.
 NOTE: sys/arch/x86/pci/pci_ranges.c::mmio_range_extend_by_vga_enable() and/or
some other functions should be modified.
 "s/above 300W/greater than 300W/" in pci_conf_print_pcie_power(). From
PCIe Base Spec 3.1a Errata 2017-12-13.
Cleanup:
- Don't pass a capability pointer as a argument of pci_conf_find_cap() and
  determine the first pointer in the pci_conf_find_cap() function.
- Don't pass a capability pointer as a argument of pci_conf_find_extcap()
  because it's not used.
- Remove unsed code.
- Add PCie Link Activation ECN.
- Use macro.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.3 -r1.183.2.4 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.130.2.2 -r1.130.2.3 src/sys/dev/pci/pcireg.h
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/dev/pci/ppbreg.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_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.183.2.3 src/sys/dev/pci/pci_subr.c:1.183.2.4
--- src/sys/dev/pci/pci_subr.c:1.183.2.3	Wed Nov 22 14:38:47 2017
+++ src/sys/dev/pci/pci_subr.c	Mon Feb 26 00:56:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.183.2.3 2017/11/22 14:38:47 martin Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.183.2.4 2018/02/26 00:56:29 snj Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.3 2017/11/22 14:38:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.4 2018/02/26 00:56:29 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -70,7 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v
 #include 
 #endif
 
-static int pci_conf_find_cap(const pcireg_t *, int, unsigned int, int *);
+static int pci_conf_find_cap(const pcireg_t *, unsigned int, int *);
+static int pci_conf_find_extcap(const pcireg_t *, unsigned int, int *);
 static void pci_conf_print_pcie_power(uint8_t, unsigned int);
 
 /*
@@ -831,8 +832,7 @@ pci_conf_print_common(
 		int pcie_capoff;
 		pcireg_t reg;
 
-		if (pci_conf_find_cap(regs, PCI_CAPLISTPTR_REG,
-		PCI_CAP_PCIEXPRESS, &pcie_capoff)) {
+		if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, &pcie_capoff)) {
 			reg = regs[o2i(pcie_capoff + PCIE_XCAP)];
 			if (PCIE_XCAP_TYPE(reg) == PCIE_XCAP_TYPE_ROOT_EVNTC)
 subclass = PCI_SUBCLASS_SYSTEM_RCEC;
@@ -1769,10 +1769,10 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	/* Capability Register */
 	reg = regs[o2i(capoff)];
 	printf("Capability register: 0x%04x\n", reg >> 16);
-	pciever = (unsigned int)((reg & 0x000f) >> 16);
+	pciever = (unsigned int)(PCIE_XCAP_VER(reg));
 	printf("  Capability version: %u\n", pciever);
 	printf("  Device type: ");
-	switch ((reg & 0x00f0) >> 20) {
+	switch (PCIE_XCAP_TYPE(reg)) {
 	case PCIE_XCAP_TYPE_PCIE_DEV:	/* 0x0 */
 		printf("PCI Express Endpoint device\n");
 		check_upstreamport = true;
@@ -2446,13 +2446,29 @@ static struct {
 };
 
 static int
-pci_conf_find_cap(const pcireg_t *regs, int capoff, unsigned int capid,
-int *offsetp)
+pci_conf_find_cap(const pcireg_t *regs, unsigned int capid, int *offsetp)
 {
 	pcireg_t rval;
+	unsigned int capptr;
 	int off;
 
-	for (off = PCI_CAPLIST_PTR(regs[o2i(capoff)]);
+	if (!(regs[o2i(PCI_COMMAND_STATUS_REG)] & PCI_STATUS_CAPLIST_SUPPORT))
+		return 0;
+
+	/* Determine the Capability List Pointer register to start with. */
+	switch (PCI_HDRTYPE_TYPE(regs[o2i(PCI_BHLC_REG)])) {
+	case 0:	/* standard device header */
+	case 1: /* PCI-PCI bridge header */
+		capptr = PCI_CAPLISTPTR_REG;
+		break;
+	case 2:	/* PCI-CardBus Bridge header */
+		capptr = PCI_CARDBUS_CAPLISTPTR_REG;
+		break;
+	default:
+		return 0;
+	}
+	
+	for (off = PCI_CAPLIST_PTR(regs[o2i(capptr)]);
 	 off != 0; off = PCI_CAPLIST_NEXT(rval)) {
 		rval = regs[o2i(off)];
 		if (capid == PCI_CAPLIST_CAP(rval)) {
@@ -2511,13 +2527,6 @@ pci_conf_print_caplist(
 		 * the same. This is required because some capabilities
 		 * appear multiple times (e.g. HyperTransport capability).
 		 */
-#if 0
-		if (pci_conf_find_cap(regs, capoff, i, &off)) {
-			rval = regs[o2i(off)];
-			if (pci_captab[i].printfunc != NULL)
-pci_captab[i].printfunc(regs, off);
-		}
-#else
 		for (off = PCI_CAPLIST_PTR(regs[o2i(capoff)]);
 		 off != 0; off = PCI_CAPLIST_NEXT(regs[o2i(off)])) {
 			rval = regs[o2i(off)];
@@ -2525,7 +2534,6 @@ pci_c

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:01:41 UTC 2018

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #577):
sys/arch/x86/pci/if_vmx.c: 1.21
m_free -> m_freem, otherwise leak


To generate a diff of this commit:
cvs rdiff -u -r1.19.6.1 -r1.19.6.2 src/sys/arch/x86/pci/if_vmx.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/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.19.6.1 src/sys/arch/x86/pci/if_vmx.c:1.19.6.2
--- src/sys/arch/x86/pci/if_vmx.c:1.19.6.1	Tue Oct 24 08:38:59 2017
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Feb 26 01:01:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.19.6.1 2017/10/24 08:38:59 snj Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.1 2017/10/24 08:38:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $");
 
 #include 
 #include 
@@ -2527,7 +2527,7 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t
 		offset = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
 		break;
 	default:
-		m_free(m);
+		m_freem(m);
 		return (EINVAL);
 	}
 



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:04:44 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-8]: GENERIC MAMBO POWERMAC POWERMAC_G5
src/sys/arch/powerpc/oea [netbsd-8]: ofw_rascons.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #578):
sys/arch/macppc/conf/GENERIC: 1.341
sys/arch/macppc/conf/MAMBO: 1.28
sys/arch/macppc/conf/POWERMAC: 1.69
sys/arch/macppc/conf/POWERMAC_G5: 1.30
sys/arch/powerpc/oea/ofw_rascons.c: 1.10
Remove OFB_ENABLE_CACHE
from 
"it is outdated, genfb and friends don't need or use it, and it makes no
sense on accelerated drivers either. It tries to BAT-map the framebuffer
cacheable, which works on most macs but makes a few models lock up.
Genfb doesn't have that problem and is faster too."


To generate a diff of this commit:
cvs rdiff -u -r1.329.2.2 -r1.329.2.3 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.24.12.1 -r1.24.12.2 src/sys/arch/macppc/conf/MAMBO
cvs rdiff -u -r1.66 -r1.66.10.1 src/sys/arch/macppc/conf/POWERMAC
cvs rdiff -u -r1.26.8.1 -r1.26.8.2 src/sys/arch/macppc/conf/POWERMAC_G5
cvs rdiff -u -r1.9 -r1.9.28.1 src/sys/arch/powerpc/oea/ofw_rascons.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/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.329.2.2 src/sys/arch/macppc/conf/GENERIC:1.329.2.3
--- src/sys/arch/macppc/conf/GENERIC:1.329.2.2	Fri Jan 26 14:28:14 2018
+++ src/sys/arch/macppc/conf/GENERIC	Mon Feb 26 01:04:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.329.2.2 2018/01/26 14:28:14 martin Exp $
+# $NetBSD: GENERIC,v 1.329.2.3 2018/02/26 01:04:43 snj Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.329.2.2 $"
+#ident 		"GENERIC-$Revision: 1.329.2.3 $"
 
 maxusers	32
 
@@ -280,10 +280,6 @@ trm*	at pci? dev ? function ?	# Tekram D
 
 # Display devices
 # ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs or any
-# O'Hare based machine that uses external cache like the PowerBook 3400c
-#options 	OFB_ENABLE_CACHE	# Speed up console in ofb
 #options 	OFB_FAKE_VGA_FB		# Allow X to mmap VGA regs
 # 
 # ofb is considered obsolete and machine-independent genfb should be used

Index: src/sys/arch/macppc/conf/MAMBO
diff -u src/sys/arch/macppc/conf/MAMBO:1.24.12.1 src/sys/arch/macppc/conf/MAMBO:1.24.12.2
--- src/sys/arch/macppc/conf/MAMBO:1.24.12.1	Fri Jan 26 14:28:14 2018
+++ src/sys/arch/macppc/conf/MAMBO	Mon Feb 26 01:04:43 2018
@@ -6,7 +6,7 @@ include		"arch/macppc/conf/std.macppc.g5
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.24.12.1 $"
+#ident 		"GENERIC-$Revision: 1.24.12.2 $"
 
 maxusers	32
 
@@ -141,9 +141,6 @@ ppb*	at pci? dev ? function ?	# PCI-PCI 
 
 # Other  PCI devices
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs.
-#options 	OFB_ENABLE_CACHE	# Speed up console
 pciide* at pci? dev ? function ? flags 0x	# GENERIC pciide driver
 obio*	at pci? dev ? function ?
 macofcons0 at pci? dev ? function ?	# OpenFirmware console (for debugging)

Index: src/sys/arch/macppc/conf/POWERMAC
diff -u src/sys/arch/macppc/conf/POWERMAC:1.66 src/sys/arch/macppc/conf/POWERMAC:1.66.10.1
--- src/sys/arch/macppc/conf/POWERMAC:1.66	Fri Aug 21 01:52:08 2015
+++ src/sys/arch/macppc/conf/POWERMAC	Mon Feb 26 01:04:43 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: POWERMAC,v 1.66 2015/08/21 01:52:08 uebayasi Exp $
+#	$NetBSD: POWERMAC,v 1.66.10.1 2018/02/26 01:04:43 snj Exp $
 #
 # POWERMAC config file
 #
@@ -93,7 +93,6 @@ wsdisplay* at wsemuldisplaydev? console 
 
 # ofb is deprecated, use genfb instead
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-#options 	OFB_ENABLE_CACHE	# Speed up console
 obio*	at pci? dev ? function ?
 
 nsphy*	at mii? phy ?			# NS83840 PHYs

Index: src/sys/arch/macppc/conf/POWERMAC_G5
diff -u src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.1 src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.2
--- src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.1	Fri Jan 26 14:28:14 2018
+++ src/sys/arch/macppc/conf/POWERMAC_G5	Mon Feb 26 01:04:43 2018
@@ -151,9 +151,6 @@ wsmouse* at ums?
 
 # Other  PCI devices
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs.
-#options 	OFB_ENABLE_CACHE	# Speed up console
 pciide* at pci? dev ? function ? flags 0x	# GENERIC pci

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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:08:26 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-8]: GENERIC GENERIC_601 MAMBO
POWERMAC_G5

Log Message:
Pull up following revision(s) (requested by sevan in ticket #579):
sys/arch/macppc/conf/GENERIC: 1.342
sys/arch/macppc/conf/GENERIC_601: 1.18
sys/arch/macppc/conf/MAMBO: 1.29
sys/arch/macppc/conf/POWERMAC_G5: 1.31
Enable BUFQ_PRIOCSCAN by default for NetBSD/macppc.
Drop references to NEW_BUFQ_STRATEGY and replace with currently available
options BUFQ_READPRIO and BUFQ_PRIOCSCAN.
ok 


To generate a diff of this commit:
cvs rdiff -u -r1.329.2.3 -r1.329.2.4 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.12.6.1 -r1.12.6.2 src/sys/arch/macppc/conf/GENERIC_601
cvs rdiff -u -r1.24.12.2 -r1.24.12.3 src/sys/arch/macppc/conf/MAMBO
cvs rdiff -u -r1.26.8.2 -r1.26.8.3 src/sys/arch/macppc/conf/POWERMAC_G5

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

Modified files:

Index: src/sys/arch/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.329.2.3 src/sys/arch/macppc/conf/GENERIC:1.329.2.4
--- src/sys/arch/macppc/conf/GENERIC:1.329.2.3	Mon Feb 26 01:04:43 2018
+++ src/sys/arch/macppc/conf/GENERIC	Mon Feb 26 01:08:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.329.2.3 2018/02/26 01:04:43 snj Exp $
+# $NetBSD: GENERIC,v 1.329.2.4 2018/02/26 01:08:26 snj Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.329.2.3 $"
+#ident 		"GENERIC-$Revision: 1.329.2.4 $"
 
 maxusers	32
 
@@ -49,7 +49,7 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
 #options 	BUFQ_READPRIO
-#options 	BUFQ_PRIOCSCAN
+options 	BUFQ_PRIOCSCAN
 
 # Diagnostic/debugging support options
 #options 	DIAGNOSTIC	# cheap kernel consistency checks

Index: src/sys/arch/macppc/conf/GENERIC_601
diff -u src/sys/arch/macppc/conf/GENERIC_601:1.12.6.1 src/sys/arch/macppc/conf/GENERIC_601:1.12.6.2
--- src/sys/arch/macppc/conf/GENERIC_601:1.12.6.1	Fri Jan 26 14:28:14 2018
+++ src/sys/arch/macppc/conf/GENERIC_601	Mon Feb 26 01:08:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_601,v 1.12.6.1 2018/01/26 14:28:14 martin Exp $
+# $NetBSD: GENERIC_601,v 1.12.6.2 2018/02/26 01:08:26 snj Exp $
 #
 # GENERIC machine description file
 # 
@@ -28,7 +28,7 @@ include		"arch/macppc/conf/std.macppc.60
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident 		"GENERIC-$Revision: 1.12.6.1 $"
+ident 		"GENERIC-$Revision: 1.12.6.2 $"
 
 maxusers	32
 
@@ -53,7 +53,7 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
 #options 	BUFQ_READPRIO
-#options 	BUFQ_PRIOCSCAN
+options 	BUFQ_PRIOCSCAN
 
 # Diagnostic/debugging support options
 #options 	DIAGNOSTIC	# cheap kernel consistency checks

Index: src/sys/arch/macppc/conf/MAMBO
diff -u src/sys/arch/macppc/conf/MAMBO:1.24.12.2 src/sys/arch/macppc/conf/MAMBO:1.24.12.3
--- src/sys/arch/macppc/conf/MAMBO:1.24.12.2	Mon Feb 26 01:04:43 2018
+++ src/sys/arch/macppc/conf/MAMBO	Mon Feb 26 01:08:26 2018
@@ -6,7 +6,7 @@ include		"arch/macppc/conf/std.macppc.g5
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.24.12.2 $"
+#ident 		"GENERIC-$Revision: 1.24.12.3 $"
 
 maxusers	32
 
@@ -33,7 +33,8 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
-#options 	NEW_BUFQ_STRATEGY
+#options 	BUFQ_READPRIO
+options 	BUFQ_PRIOCSCAN
 
 # Diagnostic/debugging support options
 options 	DIAGNOSTIC	# cheap kernel consistency checks

Index: src/sys/arch/macppc/conf/POWERMAC_G5
diff -u src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.2 src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.3
--- src/sys/arch/macppc/conf/POWERMAC_G5:1.26.8.2	Mon Feb 26 01:04:43 2018
+++ src/sys/arch/macppc/conf/POWERMAC_G5	Mon Feb 26 01:08:26 2018
@@ -30,7 +30,8 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
-#options 	NEW_BUFQ_STRATEGY
+#options 	BUFQ_READPRIO
+options 	BUFQ_PRIOCSCAN
 
 # Diagnostic/debugging support options
 options 	DIAGNOSTIC	# cheap kernel consistency checks



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

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:09:41 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: subr_tftproot.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #580):
sys/kern/subr_tftproot.c: 1.20
Fix md(4) double attachment in TFTPROOT option
The mdattach() call in tftproot_dhcpboot() has probably always been
useless, but it seems it became harmful, as it causes 7.1.1 to deadlock
during boot.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.8.1 src/sys/kern/subr_tftproot.c

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

Modified files:

Index: src/sys/kern/subr_tftproot.c
diff -u src/sys/kern/subr_tftproot.c:1.19 src/sys/kern/subr_tftproot.c:1.19.8.1
--- src/sys/kern/subr_tftproot.c:1.19	Mon Oct 31 15:27:24 2016
+++ src/sys/kern/subr_tftproot.c	Mon Feb 26 01:09:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_tftproot.c,v 1.19 2016/10/31 15:27:24 maxv Exp $ */
+/*	$NetBSD: subr_tftproot.c,v 1.19.8.1 2018/02/26 01:09:41 snj Exp $ */
 
 /*-
  * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved.
@@ -39,7 +39,7 @@
 #include "opt_md.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.19 2016/10/31 15:27:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.19.8.1 2018/02/26 01:09:41 snj Exp $");
 
 #include 
 #include 
@@ -65,8 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: subr_tftproo
 #include 
 #include 
 
-extern void   mdattach(int);
-
 /* 
  * Copied from  
  */
@@ -333,7 +331,6 @@ tftproot_getfile(struct tftproot_handle 
 	DPRINTF(("%s():%d RAMdisk loaded: %ld@%p\n", 
 	__func__, __LINE__, trh->trh_len, trh->trh_base));
 	md_root_setconf(trh->trh_base, trh->trh_len);
-	mdattach(0);
 
 	error = 0;
 out:



CVS commit: [netbsd-8] src/sys/rump/librump/rumpvfs

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:18:28 UTC 2018

Modified Files:
src/sys/rump/librump/rumpvfs [netbsd-8]: rumpfs.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #581):
sys/rump/librump/rumpvfs/rumpfs.c: 1.151-1.152
PR/52738: Martin Husemann: rumpfs does not support mtime
--
When truncating a file make sure to update mtime.
This fixes PR kern/51762 for rumpfs.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.150.2.1 src/sys/rump/librump/rumpvfs/rumpfs.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/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.150 src/sys/rump/librump/rumpvfs/rumpfs.c:1.150.2.1
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.150	Sun May 28 16:37:16 2017
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Mon Feb 26 01:18:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.150 2017/05/28 16:37:16 hannken Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.150.2.1 2018/02/26 01:18:28 snj Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.150 2017/05/28 16:37:16 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.150.2.1 2018/02/26 01:18:28 snj Exp $");
 
 #include 
 #include 
@@ -614,6 +614,32 @@ freedir(struct rumpfs_node *rnd, struct 
 	}
 }
 
+#define	RUMPFS_ACCESS	1
+#define	RUMPFS_MODIFY	2
+#define	RUMPFS_CHANGE	4
+
+static int
+rumpfs_update(int flags, struct vnode *vp, const struct timespec *acc,
+const struct timespec *mod, const struct timespec *chg)
+{
+	struct rumpfs_node *rn = vp->v_data;
+
+	if (flags == 0)
+		return 0;
+
+	if (vp->v_mount->mnt_flag & MNT_RDONLY)
+		return EROFS;
+
+	if (flags & RUMPFS_ACCESS)
+		rn->rn_va.va_atime = *acc;
+	if (flags & RUMPFS_MODIFY)
+		rn->rn_va.va_mtime = *mod;
+	if (flags & RUMPFS_CHANGE)
+		rn->rn_va.va_ctime = *chg;
+
+	return 0;
+}
+
 /*
  * Simple lookup for rump file systems.
  *
@@ -858,6 +884,7 @@ rump_vop_setattr(void *v)
 	struct vattr *vap = ap->a_vap;
 	struct rumpfs_node *rn = vp->v_data;
 	struct vattr *attr = &rn->rn_va;
+	struct timespec now;
 	kauth_cred_t cred = ap->a_cred;
 	int error;
 
@@ -878,14 +905,25 @@ rump_vop_setattr(void *v)
 			return error;
 	}
 
-	SETIFVAL(va_atime.tv_sec, time_t);
-	SETIFVAL(va_ctime.tv_sec, time_t);
-	SETIFVAL(va_mtime.tv_sec, time_t);
+	int flags = 0;
+	getnanotime(&now);
+	if (vap->va_atime.tv_sec != VNOVAL)
+		if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
+			flags |= RUMPFS_ACCESS;
+	if (vap->va_mtime.tv_sec != VNOVAL) {
+		flags |= RUMPFS_CHANGE | RUMPFS_MODIFY;
+		if (vp->v_mount->mnt_flag & MNT_RELATIME)
+			flags |= RUMPFS_ACCESS;
+	} else if (vap->va_size == 0) {
+		flags |= RUMPFS_MODIFY;
+		vap->va_mtime = now;
+	}
 	SETIFVAL(va_birthtime.tv_sec, time_t);
-	SETIFVAL(va_atime.tv_nsec, long);
-	SETIFVAL(va_ctime.tv_nsec, long);
-	SETIFVAL(va_mtime.tv_nsec, long);
 	SETIFVAL(va_birthtime.tv_nsec, long);
+	flags |= RUMPFS_CHANGE;
+	error = rumpfs_update(flags, vp, &vap->va_atime, &vap->va_mtime, &now);
+	if (error)
+		return error;
 
 	if (CHANGED(va_flags, u_long)) {
 		/* XXX Can we handle system flags here...? */
@@ -1345,6 +1383,7 @@ rump_vop_read(void *v)
 	const int advice = IO_ADV_DECODE(ap->a_ioflag);
 	off_t chunk;
 	int error = 0;
+	struct timespec ts;
 
 	if (vp->v_type == VDIR)
 		return EISDIR;
@@ -1353,6 +1392,9 @@ rump_vop_read(void *v)
 	if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST)
 		return etread(rn, uio);
 
+	getnanotime(&ts);
+	(void)rumpfs_update(RUMPFS_ACCESS, vp, &ts, &ts, &ts);
+
 	/* otherwise, it's off to ubc with us */
 	while (uio->uio_resid > 0) {
 		chunk = MIN(uio->uio_resid, (off_t)rn->rn_dlen-uio->uio_offset);
@@ -1415,6 +1457,10 @@ rump_vop_write(void *v)
 	off_t chunk;
 	int error = 0;
 	bool allocd = false;
+	struct timespec ts;
+
+	getnanotime(&ts);
+	(void)rumpfs_update(RUMPFS_MODIFY, vp, &ts, &ts, &ts);
 
 	if (ap->a_ioflag & IO_APPEND)
 		uio->uio_offset = vp->v_size;



CVS commit: [netbsd-8] src/tests/lib/libc/arch/alpha

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:20:21 UTC 2018

Modified Files:
src/tests/lib/libc/arch/alpha [netbsd-8]: return_one.S

Log Message:
Pull up following revision(s) (requested by maya in ticket #582):
tests/lib/libc/arch/alpha/return_one.S: 1.2
Implement helper function for alpha


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.34.1 src/tests/lib/libc/arch/alpha/return_one.S

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

Modified files:

Index: src/tests/lib/libc/arch/alpha/return_one.S
diff -u src/tests/lib/libc/arch/alpha/return_one.S:1.1 src/tests/lib/libc/arch/alpha/return_one.S:1.1.34.1
--- src/tests/lib/libc/arch/alpha/return_one.S:1.1	Mon Jul 18 23:16:09 2011
+++ src/tests/lib/libc/arch/alpha/return_one.S	Mon Feb 26 01:20:21 2018
@@ -1,8 +1,11 @@
-/*	$NetBSD: return_one.S,v 1.1 2011/07/18 23:16:09 jym Exp $ */
+/*	$NetBSD: return_one.S,v 1.1.34.1 2018/02/26 01:20:21 snj Exp $ */
 
 #include 
 
 .globl	return_one, return_one_end;
 
-return_one: return_one_end:
+return_one:
+	lda	v0,1
+	ret
+return_one_end:
 	nop



CVS commit: [netbsd-8] src/lib/libm/arch/alpha

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:22:04 UTC 2018

Modified Files:
src/lib/libm/arch/alpha [netbsd-8]: fenv.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #583):
lib/libm/arch/alpha/fenv.c: 1.3
Fix usage of sysarch(ALPHA_FPGETMASK)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.4.1 src/lib/libm/arch/alpha/fenv.c

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

Modified files:

Index: src/lib/libm/arch/alpha/fenv.c
diff -u src/lib/libm/arch/alpha/fenv.c:1.2 src/lib/libm/arch/alpha/fenv.c:1.2.4.1
--- src/lib/libm/arch/alpha/fenv.c:1.2	Wed Mar 22 23:11:08 2017
+++ src/lib/libm/arch/alpha/fenv.c	Mon Feb 26 01:22:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $	*/
+/*	$NetBSD: fenv.c,v 1.2.4.1 2018/02/26 01:22:04 snj Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -28,7 +28,7 @@
  * $FreeBSD: src/lib/msun/alpha/fenv.c,v 1.2 2005/03/16 19:03:44 das Exp $
  */
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.2.4.1 2018/02/26 01:22:04 snj Exp $");
 
 #include "namespace.h"
 
@@ -63,7 +63,7 @@ fegetenv(fenv_t *envp)
 	 * only need to issue an excb after the mf_fpcr to ensure that
 	 * the read is executed before any subsequent FP ops.
 	 */
-	sysarch(ALPHA_FPGETMASK, (char *)&p);
+	p.mask = sysarch(ALPHA_FPGETMASK, 0);
 	__mf_fpcr(&r.__d);
 	*envp = r.__bits | p.mask;
 	__excb();
@@ -76,7 +76,7 @@ feholdexcept(fenv_t *envp)
 	struct alpha_fp_except_args p;
 	union __fpcr r;
 
-	sysarch(ALPHA_FPGETMASK, (char *)&p);
+	p.mask = sysarch(ALPHA_FPGETMASK, 0);
 	__mf_fpcr(&r.__d);
 	*envp = r.__bits | p.mask;
 	r.__bits &= ~((fenv_t)FE_ALL_EXCEPT << _FPUSW_SHIFT);
@@ -124,7 +124,7 @@ feenableexcept(int mask)
 {
 	struct alpha_fp_except_args p;
 
-	sysarch(ALPHA_FPGETMASK, &p);
+	p.mask = sysarch(ALPHA_FPGETMASK, 0);
 	p.mask |= (mask & FE_ALL_EXCEPT);
 	sysarch(ALPHA_FPSETMASK, &p);
 	return p.mask;
@@ -135,7 +135,7 @@ fedisableexcept(int mask)
 {
 	struct alpha_fp_except_args p;
 
-	sysarch(ALPHA_FPGETMASK, &p);
+	p.mask = sysarch(ALPHA_FPGETMASK, 0);
 	p.mask &= ~(mask & FE_ALL_EXCEPT);
 	sysarch(ALPHA_FPSETMASK, &p);
 	return p.mask;
@@ -144,8 +144,6 @@ fedisableexcept(int mask)
 int
 fegetexcept(void)
 {
-	struct alpha_fp_except_args p;
 
-	sysarch(ALPHA_FPGETMASK, &p);
-	return p.mask;
+	return sysarch(ALPHA_FPGETMASK, 0);
 }



CVS commit: [netbsd-8] src/sys

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:23:42 UTC 2018

Modified Files:
src/sys/arch/alpha/alpha [netbsd-8]: fp_complete.c
src/sys/lib/libkern [netbsd-8]: softfloat.c softfloat.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #584):
sys/arch/alpha/alpha/fp_complete.c: 1.22
sys/lib/libkern/softfloat.c: 1.6
sys/lib/libkern/softfloat.h: 1.5
PR port-alpha/52520: provide float64 -> uint64 conversion and use
that when converting positive numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.20.1 src/sys/arch/alpha/alpha/fp_complete.c
cvs rdiff -u -r1.5 -r1.5.22.1 src/sys/lib/libkern/softfloat.c
cvs rdiff -u -r1.4 -r1.4.80.1 src/sys/lib/libkern/softfloat.h

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

Modified files:

Index: src/sys/arch/alpha/alpha/fp_complete.c
diff -u src/sys/arch/alpha/alpha/fp_complete.c:1.21 src/sys/arch/alpha/alpha/fp_complete.c:1.21.20.1
--- src/sys/arch/alpha/alpha/fp_complete.c:1.21	Mon May 19 07:09:10 2014
+++ src/sys/arch/alpha/alpha/fp_complete.c	Mon Feb 26 01:23:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fp_complete.c,v 1.21 2014/05/19 07:09:10 matt Exp $ */
+/* $NetBSD: fp_complete.c,v 1.21.20.1 2018/02/26 01:23:42 snj Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: fp_complete.c,v 1.21 2014/05/19 07:09:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fp_complete.c,v 1.21.20.1 2018/02/26 01:23:42 snj Exp $");
 
 #include "opt_compat_osf1.h"
 
@@ -334,7 +334,7 @@ cvt_tq_gq(uint32_t inst_bits, struct lwp
 
 	inst.bits = inst_bits;
 	stt(inst.float_detail.fb, &tfb, l);
-	tfc.i = float64_to_int64(tfb.i);
+	tfc.i = tfb.sign ? float64_to_int64(tfb.i) : float64_to_uint64(tfb.i);
 	alpha_ldt(inst.float_detail.fc, &tfc);	/* yes, ldt */
 }
 

Index: src/sys/lib/libkern/softfloat.c
diff -u src/sys/lib/libkern/softfloat.c:1.5 src/sys/lib/libkern/softfloat.c:1.5.22.1
--- src/sys/lib/libkern/softfloat.c:1.5	Sun Nov  3 00:01:43 2013
+++ src/sys/lib/libkern/softfloat.c	Mon Feb 26 01:23:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.c,v 1.5 2013/11/03 00:01:43 christos Exp $ */
+/* $NetBSD: softfloat.c,v 1.5.22.1 2018/02/26 01:23:42 snj Exp $ */
 
 /*
  * This version hacked for use with gcc -msoft-float by bjh21.
@@ -49,7 +49,7 @@ this code that are retained.
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: softfloat.c,v 1.5 2013/11/03 00:01:43 christos Exp $");
+__RCSID("$NetBSD: softfloat.c,v 1.5.22.1 2018/02/26 01:23:42 snj Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef SOFTFLOAT_FOR_GCC
@@ -211,6 +211,38 @@ static int64 roundAndPackInt64( flag zSi
 return z;
 
 }
+
+/* same as above, but for unsigned values */
+static uint64 roundAndPackUInt64( bits64 absZ0, bits64 absZ1 )
+{
+int8 roundingMode;
+flag roundNearestEven, increment;
+uint64 z;
+
+roundingMode = float_rounding_mode();
+roundNearestEven = ( roundingMode == float_round_nearest_even );
+increment = ( (sbits64) absZ1 < 0 );
+if ( ! roundNearestEven ) {
+if ( roundingMode == float_round_to_zero ) {
+increment = 0;
+}
+else {
+increment = ( roundingMode == float_round_up ) && absZ1;
+}
+}
+if ( increment ) {
+++absZ0;
+if ( absZ0 == 0 ) {
+float_raise( float_flag_invalid );
+return LIT64( 0x7FFF );
+	}
+absZ0 &= ~ ( ( (bits64) ( absZ1<<1 ) == 0 ) & roundNearestEven );
+}
+z = absZ0;
+if ( absZ1 ) float_set_inexact();
+return z;
+
+}
 #endif
 
 /*
@@ -2399,6 +2431,44 @@ int64 float64_to_int64( float64 a )
 
 }
 
+/* like above, but result is unsigned */
+uint64 float64_to_uint64( float64 a )
+{
+flag aSign;
+int16 aExp, shiftCount;
+bits64 aSig, aSigExtra;
+
+aSig = extractFloat64Frac( a );
+aExp = extractFloat64Exp( a );
+aSign = extractFloat64Sign( a );
+
+if (aSign) {
+	return float64_to_int64(a);
+}
+
+if ( aExp ) aSig |= LIT64( 0x0010 );
+shiftCount = 0x433 - aExp;
+if ( shiftCount <= 0 ) {
+if ( 0x43E < aExp ) {
+float_raise( float_flag_invalid );
+if (! aSign
+ || (( aExp == 0x7FF )
+  && ( aSig != LIT64( 0x0010 ) ) )
+   ) {
+return LIT64( 0x7FFF );
+}
+return (sbits64) LIT64( 0x8000 );
+}
+aSigExtra = 0;
+aSig <<= - shiftCount;
+}
+else {
+shift64ExtraRightJamming( aSig, 0, shiftCount, &aSig, &aSigExtra );
+}
+return roundAndPackUInt64( aSig, aSigExtra );
+
+}
+
 /*
 ---
 Returns the result of converting the double-pr

CVS commit: [netbsd-8] src/tests/lib/libpthread

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:24:54 UTC 2018

Modified Files:
src/tests/lib/libpthread [netbsd-8]: t_mutex.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #585):
tests/lib/libpthread/t_mutex.c: 1.19
Since there has been no objection (or even comment) in response
to my message on tech-userlevel ...
Subject: tests/lib/libpthread/t_mutex:mutex6
Date: Thu, 23 Nov 2017 17:34:54 +0700
Message-ID: <28385.1511433294%andromeda.noi.kre.to@localhost>
which can be found at:
http://mail-index.netbsd.org/tech-userlevel/2017/11/23/msg011010.html
which analysed the mutex6 test case of this test, and concluded
that it was useless, nonsense, and broken (the whole test is just a
race - not even really using or testing mutexes), let it be henceforth
forever gone.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.4.1 src/tests/lib/libpthread/t_mutex.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.18 src/tests/lib/libpthread/t_mutex.c:1.18.4.1
--- src/tests/lib/libpthread/t_mutex.c:1.18	Sat Apr  1 17:19:40 2017
+++ src/tests/lib/libpthread/t_mutex.c	Mon Feb 26 01:24:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $ */
+/* $NetBSD: t_mutex.c,v 1.18.4.1 2018/02/26 01:24:54 snj Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.18.4.1 2018/02/26 01:24:54 snj Exp $");
 
 #include  /* For timespecadd */
 #include  /* For UINT16_MAX */
@@ -371,131 +371,6 @@ ATF_TC_BODY(mutex5, tc)
 	PTHREAD_REQUIRE(pthread_join(child, NULL));
 }
 
-static int start = 0;
-static uintmax_t high_cnt = 0, low_cnt = 0, MAX_LOOP = 1;
-
-static void *
-high_prio(void* arg)
-{
-	struct sched_param param;
-	int policy;
-	param.sched_priority = min_fifo_prio + 10;
-	pthread_t childid = pthread_self();
-
-	PTHREAD_REQUIRE(pthread_setschedparam(childid, 1, ¶m));
-	PTHREAD_REQUIRE(pthread_getschedparam(childid, &policy, ¶m));
-	printf("high protect = %d, prio = %d\n",
-	_sched_protect(-2), param.sched_priority);
-	ATF_REQUIRE_EQ(policy, 1);
-	printf("high prio = %d\n", param.sched_priority);
-	sleep(1);
-	long tmp = 0;
-	for (int i = 0; i < 20; i++) {
-		while (high_cnt < MAX_LOOP) {
-			tmp += (123456789 % 1234) * (987654321 % 54321);
-			high_cnt += 1;
-		}
-		high_cnt = 0;
-		sleep(1);
-	}
-	PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
-	if (start == 0) start = 2;
-	PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
-
-	return 0;
-}
-
-static void *
-low_prio(void* arg)
-{
-	struct sched_param param;
-	int policy;
-	param.sched_priority = min_fifo_prio;
-	pthread_t childid = pthread_self();
-	int res = _sched_protect(max_fifo_prio);
-	ATF_REQUIRE_EQ(res, 0);
-	PTHREAD_REQUIRE(pthread_setschedparam(childid, 1, ¶m));
-	PTHREAD_REQUIRE(pthread_getschedparam(childid, &policy, ¶m));
-	printf("low protect = %d, prio = %d\n", _sched_protect(-2),
-	param.sched_priority);
-	ATF_REQUIRE_EQ(policy, 1);
-	printf("low prio = %d\n", param.sched_priority);
-	sleep(1);
-	long tmp = 0;
-	for (int i = 0; i < 20; i++) {
-		while (low_cnt < MAX_LOOP) {
-			tmp += (123456789 % 1234) * (987654321 % 54321);
-			low_cnt += 1;
-		}
-		low_cnt = 0;
-		sleep(1);
-	}
-	PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy));
-	if (start == 0)
-		start = 1;
-	PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex));
-
-	return 0;
-}
-
-ATF_TC(mutex6);
-ATF_TC_HEAD(mutex6, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Checks scheduling for priority ceiling");
-	atf_tc_set_md_var(tc, "require.user", "root");
-}
-
-/*
- * 1. main thread sets itself to be a realtime task and launched two tasks,
- *one has higher priority and the other has lower priority.
- * 2. each child thread(low and high priority thread) sets its scheduler and
- *priority.
- * 3. each child thread did several rounds of computation, after each round it
- *sleep 1 second.
- * 4. the child thread with low priority will call _sched_protect to increase
- *its protect priority.
- * 5. We verify the thread with low priority runs first.
- *
- * Why does it work? From the main thread, we launched the high
- * priority thread first. This gives this thread the benefit of
- * starting first. The low priority thread did not call _sched_protect(2).
- * The high priority thread should finish the task first. After each
- * round of computation, we call sleep, to put the task into the
- * sleep queue, and wake up again after the timer expires. This
- * gives the scheduler the chance to decide which task to run. So,
- * the thread with real high priority will always b

CVS commit: [netbsd-8] src/doc

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 01:31:19 UTC 2018

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

Log Message:
tickets 552, 561-573, 575-585


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.129 -r1.1.2.130 src/doc/CHANGES-8.0

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.0
diff -u src/doc/CHANGES-8.0:1.1.2.129 src/doc/CHANGES-8.0:1.1.2.130
--- src/doc/CHANGES-8.0:1.1.2.129	Sun Feb 25 21:01:13 2018
+++ src/doc/CHANGES-8.0	Mon Feb 26 01:31:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.129 2018/02/25 21:01:13 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.130 2018/02/26 01:31:19 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9727,3 +9727,211 @@ tests/lib/libc/sys/t_ptrace_x86_wait.h		
 	test environments.
 	[martin, ticket #586]
 
+sys/arch/aarch64/include/mcontext.h		1.2
+sys/arch/alpha/include/mcontext.h		1.9
+sys/arch/amd64/include/mcontext.h		1.19
+sys/arch/arm/include/mcontext.h			1.19
+sys/arch/hppa/include/mcontext.h		1.9
+sys/arch/i386/include/mcontext.h		1.14
+sys/arch/ia64/include/mcontext.h		1.6
+sys/arch/m68k/include/mcontext.h		1.10
+sys/arch/mips/include/mcontext.h		1.22
+sys/arch/or1k/include/mcontext.h		1.2
+sys/arch/powerpc/include/mcontext.h		1.18
+sys/arch/riscv/include/mcontext.h		1.5
+sys/arch/sh3/include/mcontext.h			1.11
+sys/arch/sparc/include/mcontext.h		1.14-1.17
+sys/arch/sparc64/include/mcontext.h		1.10
+sys/arch/vax/include/mcontext.h			1.9
+tests/lib/libc/sys/Makefile			1.50
+tests/lib/libc/sys/t_ucontext.c			1.2
+
+	- Introduce _UC_MACHINE_FP().  _UC_MACHINE_FP() is a helper
+	  macro to extract from mcontext a frame pointer.
+	- Add new tests in lib/libc/sys/t_ucontext:
+	  * ucontext_sp (testing _UC_MACHINE_SP)
+	  * ucontext_fp (testing _UC_MACHINE_FP)
+	  * ucontext_pc (testing _UC_MACHINE_PC)
+	  * ucontext_intrv (testing _UC_MACHINE_INTRV)
+	[kamil, ticket #552]
+
+include/string.h1.52
+
+	Mark memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001
+	[kamil, ticket #561]
+
+lib/libpthread/pthread.h			1.41
+
+	Remove namespace restriction from pthread_condattr_{g,s}etclock(3).
+	[kamil, ticket #562]
+
+sys/sys/fcntl.h	1.50
+
+	Enable O_NOFOLLOW in the POSIX namespace
+	[kamil, ticket #563]
+
+sys/dev/pci/if_wm.c1.563
+
+	Fix a bug that caused wm(4) to stall under heavy load.
+	[knakahara, ticket #564]
+
+sys/dev/pci/ichsmb.c1.51
+sys/dev/pci/ismt.c1.6
+
+	Add C3000 devices.
+	[msaitoh, ticket #565]
+
+sys/arch/arm/include/cpu.h			1.94
+sys/arch/mips/include/cpu.h			1.122
+sys/arch/powerpc/include/cpu.h			1.103
+sys/sys/cpu.h	1.42
+
+	arm/mips/powerpc: CPU_INFO_FOREACH() must always iterate at
+	least the boot cpu.  Fixes assert that fires under LOCKDEBUG.
+	[skrll, ticket #566]
+
+distrib/sets/lists/comp/mi			1.2182
+distrib/sets/lists/comp/mi			1.2183
+sys/dev/pci/if_wm.c1.564
+sys/dev/pci/ixgbe/ixgbe.c			1.122
+sys/dev/pci/ixgbe/ixgbe_rss.h			1.3
+sys/dev/pci/ixgbe/ixv.c1.78
+sys/net/Makefile1.35
+sys/net/Makefile1.36
+sys/net/files.net1.15
+sys/net/rss_config.c1.1
+sys/net/rss_config.h1.1
+
+	Introduce very simple Receive Side Scaling (RSS) utility.
+	Apply RSS utility to wm(4), ixg(4), and ixv(4).
+	[knakahara, ticket #567]
+
+sys/netinet6/ip6_input.c			1.188
+
+	Kick nested IPv6 fragments.
+	[maxv, ticket #568]
+
+sys/netinet6/route6.c1.24-1.25
+
+	Fix the ICMP error code. rh was obtained via IP6_EXTHDR_GET,
+	and it is not guaranteed to be in the same mbuf as ip6, so
+	computing the difference between the pointers may result in a
+	wrong offset.
+
+	Remove #if 0'd code.
+	[maxv, ticket #569]
+
+sys/dist/pf/net/pf.c1.79
+
+	Fix PR/53036: 'block user' in pf's ruleset results in panic.
+	[alnsn, ticket #570]
+
+tests/net/net/t_ping_opts.sh			1.2-1.3
+
+	Now that we don't allow source-routed packets by default, set
+	allowsrcrt=1 and forwsrcrt=1. Should fix the ATF failure.
+	Fix ping_opts_gateway and ping_opts_recordroute.  We need to
+	enable the options of source routing on all rump kernels.
+	[ozaki-r, ticket #571]
+
+sys/net/if_bridge.c1.138, 1.148
+tests/net/if_bridge/t_bridge.sh			1.18
+tests/net/if_gif/t_gif.sh			1.12
+tests/net/if_ipsec/t_ipsec.sh			1.3
+tests/net/if_l2tp/t_l2tp.sh			1.4
+tests/net/if_loop/t_basic.sh			1.2
+tests/net/if_pppoe/t_pppoe.sh			1.18
+tests/net/if_tap/t_tap.sh			1.7
+tests/net/if_tun/Makefile			1.2
+tests/net/if_tun/t_tun.sh			1.5
+tests/net/if_vlan/t_vlan.sh			1.8
+tests/net/net_common.sh1.26
+
+	if_bridge:
+	- Remove unnecessary splsoftnet
+	- Fix panic on bridge creation/destruction
+
+	Commonalize and add tests of creating/destroying interfaces
+	[ozaki-r, ticket #572]
+
+sys/kern/kern_synch.c1.314
+
+	Avoid race between an LWP migration and curlwp_bind.
+	[ozaki-r, ticket #573]
+
+sys/arch/amd64/amd64/copy.S			1.28 via patch
+sys/

CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc

2018-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 26 01:33:06 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc: crypto.inc
ec.inc
Added Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc: sparccap.c

Log Message:
make this link again:
- we don't want to define the reference impl flag because there is no
  complete c reference impl for nistz256
- we want to define an empty OPENSSL_cpuid_setup() because we don't want
  to use the v9 one... this function is called from 2 places:
  1. in the sparccpuid.S assembly, which we need for the CRYPTO_mem*
 functions -- but we could get rid of the v9 stuff with
 #ifdef __sparc_v9__ for size and we don't bother
  2. crypto/init.c


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/sparccap.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc:1.6 src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc:1.7
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc:1.6	Sat Feb 24 16:51:22 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/crypto.inc	Sun Feb 25 20:33:05 2018
@@ -1,9 +1,10 @@
 .PATH.S: ${.PARSEDIR}
+.PATH.c: ${.PARSEDIR}
 CPUID = yes
-CPUID_SRCS += sparccpuid.S
+CPUID_SRCS += sparccpuid.S sparccap.c
 
 .if ${MACHINE} == "sparc64"
-CPUID_SRCS += sparcv9cap.c sparcv9-mont.S sparcv9a-mont.S 
+CPUID_SRCS += sparcv9-mont.S sparcv9a-mont.S 
 CPUID_SRCS += sparct4-mont.S vis3-mont.S
 #CPPFLAGS += -DOPENSSL_BN_ASM_MONT
 AFLAGS.sparcv9-mont.S+= -Wa,-Av9

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc:1.6
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc:1.5	Sat Feb 24 16:45:57 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/ec.inc	Sun Feb 25 20:33:05 2018
@@ -6,7 +6,6 @@ EC_SRCS += \
 ECNI = yes
 AFLAGS.ecp_nistz256-sparcv9.S += -Wa,-Av9
 .else
-ECCPPFLAGS+=-DECP_NISTZ256_REFERENCE_IMPLEMENTATION
 .endif
 
 .include "../../ec.inc"

Added files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/sparccap.c
diff -u /dev/null src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/sparccap.c:1.1
--- /dev/null	Sun Feb 25 20:33:06 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/sparccap.c	Sun Feb 25 20:33:05 2018
@@ -0,0 +1,6 @@
+
+void OPENSSL_cpuid_setup(void);
+
+void OPENSSL_cpuid_setup(void)
+{
+}



CVS commit: src/sys/dev/pci/ixgbe

2018-02-25 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Feb 26 04:19:00 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h

Log Message:
Fix poll mode assumption breaking.

ixgbe_{enable,disable}_intr() forcibly enable/disable all interrupts
regardless of current state. That can break poll mode assumption,
that is, queue interrupts must not occur while polling Tx/Rx rings.

E.g. "ifconfig ixg0 delete && ifconfig ixg0 192.168.0.1" on heavy
load traffic can causes this issue.

This fix may have 1% or 2% performance impact at short packets.

XXX
ixgbe_rearm_queues() which is called only via watchdog can also break
this poll mode assumption because writing EICS casues interrupts
immediately when interrupt auto mask enabled.
We will fix it with other issues about watchdog later.

ok by msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.32 src/sys/dev/pci/ixgbe/ix_txrx.c:1.33
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.32	Thu Feb 22 10:02:08 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Feb 26 04:19:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.32 2018/02/22 10:02:08 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.33 2018/02/26 04:19:00 knakahara Exp $ */
 
 /**
 
@@ -2260,6 +2260,9 @@ ixgbe_allocate_queues(struct adapter *ad
 		que->me = i;
 		que->txr = &adapter->tx_rings[i];
 		que->rxr = &adapter->rx_rings[i];
+
+		mutex_init(&que->im_mtx, MUTEX_DEFAULT, IPL_NET);
+		que->im_nest = 0;
 	}
 
 	return (0);

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.126 src/sys/dev/pci/ixgbe/ixgbe.c:1.127
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.126	Thu Feb 22 10:02:08 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Feb 26 04:19:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.126 2018/02/22 10:02:08 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.127 2018/02/26 04:19:00 knakahara Exp $ */
 
 /**
 
@@ -2384,9 +2384,14 @@ static inline void
 ixgbe_enable_queue(struct adapter *adapter, u32 vector)
 {
 	struct ixgbe_hw *hw = &adapter->hw;
+	struct ix_queue *que = &adapter->queues[vector];
 	u64 queue = (u64)(1ULL << vector);
 	u32 mask;
 
+	mutex_enter(&que->im_mtx);
+	if (que->im_nest > 0 && --que->im_nest > 0)
+		goto out;
+
 	if (hw->mac.type == ixgbe_mac_82598EB) {
 		mask = (IXGBE_EIMS_RTX_QUEUE & queue);
 		IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask);
@@ -2398,6 +2403,8 @@ ixgbe_enable_queue(struct adapter *adapt
 		if (mask)
 			IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
 	}
+out:
+	mutex_exit(&que->im_mtx);
 } /* ixgbe_enable_queue */
 
 /
@@ -2407,9 +2414,14 @@ static inline void
 ixgbe_disable_queue(struct adapter *adapter, u32 vector)
 {
 	struct ixgbe_hw *hw = &adapter->hw;
+	struct ix_queue *que = &adapter->queues[vector];
 	u64 queue = (u64)(1ULL << vector);
 	u32 mask;
 
+	mutex_enter(&que->im_mtx);
+	if (que->im_nest++ > 0)
+		goto  out;
+
 	if (hw->mac.type == ixgbe_mac_82598EB) {
 		mask = (IXGBE_EIMS_RTX_QUEUE & queue);
 		IXGBE_WRITE_REG(hw, IXGBE_EIMC, mask);
@@ -2421,6 +2433,8 @@ ixgbe_disable_queue(struct adapter *adap
 		if (mask)
 			IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask);
 	}
+out:
+	mutex_exit(&que->im_mtx);
 } /* ixgbe_disable_queue */
 
 /
@@ -3427,6 +3441,10 @@ ixgbe_detach(device_t dev, int flags)
 
 	ixgbe_free_transmit_structures(adapter);
 	ixgbe_free_receive_structures(adapter);
+	for (int i = 0; i < adapter->num_queues; i++) {
+		struct ix_queue * que = &adapter->queues[i];
+		mutex_destroy(&que->im_mtx);
+	}
 	free(adapter->queues, M_DEVBUF);
 	free(adapter->mta, M_DEVBUF);
 
@@ -4568,15 +4586,17 @@ ixgbe_enable_intr(struct adapter *adapte
 static void
 ixgbe_disable_intr(struct adapter *adapter)
 {
+	struct ix_queue	*que = adapter->queues;
+
+	/* disable interrupts other than queues */
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~IXGBE_EIMC_RTX_QUEUE);
+
 	if (adapter->msix_mem)
 		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0);
-	if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0);
-	} else {
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0x);
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0);
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0);
-	}
+
+	for (int i = 0; i < adapter->num_queues; i++, que++)
+		ixgbe_disable_queue(adapter, que->msix);
+
 	IXGBE_WRITE_F

CVS commit: src/sys/dev/imcsmb

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 04:25:32 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imcsmb.c

Log Message:
Search for child devices using the i2cbus attribute


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/imcsmb/imcsmb.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/imcsmb/imcsmb.c
diff -u src/sys/dev/imcsmb/imcsmb.c:1.1 src/sys/dev/imcsmb/imcsmb.c:1.2
--- src/sys/dev/imcsmb/imcsmb.c:1.1	Sun Feb 25 08:19:34 2018
+++ src/sys/dev/imcsmb/imcsmb.c	Mon Feb 26 04:25:32 2018
@@ -125,7 +125,7 @@ imcsmb_attach(device_t parent, device_t 
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
-	imcsmb_rescan(self, "imcsmb", 0);
+	imcsmb_rescan(self, "i2cbus", 0);
 }
 
 static int
@@ -134,6 +134,9 @@ imcsmb_rescan(device_t self, const char 
 	struct imcsmb_softc *sc = device_private(self);
 	struct i2cbus_attach_args iba;
 
+	if (!ifattr_match(ifattr, "i2cbus"))
+		return 0;
+
 	/* Create the i2cbus child */
 	if (sc->sc_smbus != NULL)
 		return 0;



CVS commit: src/sys/dev/imcsmb

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 04:31:32 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imc.c

Log Message:
Remove unneeded imc_print() routine


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/imcsmb/imc.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/imcsmb/imc.c
diff -u src/sys/dev/imcsmb/imc.c:1.1 src/sys/dev/imcsmb/imc.c:1.2
--- src/sys/dev/imcsmb/imc.c:1.1	Sun Feb 25 08:19:34 2018
+++ src/sys/dev/imcsmb/imc.c	Mon Feb 26 04:31:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.1 2018/02/25 08:19:34 pgoyette Exp $ */
+/* $NetBSD: imc.c,v 1.2 2018/02/26 04:31:32 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -225,19 +225,6 @@ imc_attach(device_t parent, device_t sel
 /* Create the imcsmbX children */
 
 static int
-imc_print(void *aux, const char *pnp)
-{
-	struct imc_attach_args *imca = aux;
-
-	if (pnp != NULL) {
-		aprint_normal("smbus controller not %d attached to %s\n",
-		imca->ia_unit, pnp);
-		return UNCONF;
-	} else
-		return QUIET;
-}
-
-static int
 imc_rescan(device_t self, const char * ifattr, const int *flags)
 {
 	struct imc_softc *sc = device_private(self);
@@ -253,7 +240,7 @@ imc_rescan(device_t self, const char * i
 		imca.ia_regs = &imcsmb_regs[unit];
 		imca.ia_pci_tag = sc->sc_pci_tag;
 		imca.ia_pci_chipset_tag = sc->sc_pci_chipset_tag;
-		child = config_found_ia(self, "imc", &imca, imc_print);
+		child = config_found_ia(self, "imc", &imca, NULL);
 
 		if (child == NULL) {
 			aprint_normal_dev(self, "Child %d imcsmb not added\n",



CVS commit: [netbsd-8] src

2018-02-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Feb 26 04:32:31 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0
src/sys/arch/aarch64/include [netbsd-8]: mcontext.h
src/sys/arch/alpha/include [netbsd-8]: mcontext.h
src/sys/arch/amd64/include [netbsd-8]: mcontext.h
src/sys/arch/arm/include [netbsd-8]: mcontext.h
src/sys/arch/hppa/include [netbsd-8]: mcontext.h
src/sys/arch/i386/include [netbsd-8]: mcontext.h
src/sys/arch/ia64/include [netbsd-8]: mcontext.h
src/sys/arch/m68k/include [netbsd-8]: mcontext.h
src/sys/arch/mips/include [netbsd-8]: mcontext.h
src/sys/arch/or1k/include [netbsd-8]: mcontext.h
src/sys/arch/powerpc/include [netbsd-8]: mcontext.h
src/sys/arch/riscv/include [netbsd-8]: mcontext.h
src/sys/arch/sh3/include [netbsd-8]: mcontext.h
src/sys/arch/sparc/include [netbsd-8]: mcontext.h
src/sys/arch/sparc64/include [netbsd-8]: mcontext.h
src/sys/arch/vax/include [netbsd-8]: mcontext.h
src/tests/lib/libc/sys [netbsd-8]: Makefile t_ucontext.c

Log Message:
revert ticket 552, which broke the build


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.130 -r1.1.2.131 src/doc/CHANGES-8.0
cvs rdiff -u -r1.1.22.1 -r1.1.22.2 src/sys/arch/aarch64/include/mcontext.h
cvs rdiff -u -r1.8.32.1 -r1.8.32.2 src/sys/arch/alpha/include/mcontext.h
cvs rdiff -u -r1.18.20.1 -r1.18.20.2 src/sys/arch/amd64/include/mcontext.h
cvs rdiff -u -r1.18.10.1 -r1.18.10.2 src/sys/arch/arm/include/mcontext.h
cvs rdiff -u -r1.8.22.1 -r1.8.22.2 src/sys/arch/hppa/include/mcontext.h
cvs rdiff -u -r1.12.22.1 -r1.12.22.2 src/sys/arch/i386/include/mcontext.h
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.9.42.1 -r1.9.42.2 src/sys/arch/m68k/include/mcontext.h
cvs rdiff -u -r1.21.10.1 -r1.21.10.2 src/sys/arch/mips/include/mcontext.h
cvs rdiff -u -r1.1.12.1 -r1.1.12.2 src/sys/arch/or1k/include/mcontext.h
cvs rdiff -u -r1.17.12.1 -r1.17.12.2 src/sys/arch/powerpc/include/mcontext.h
cvs rdiff -u -r1.4.10.1 -r1.4.10.2 src/sys/arch/riscv/include/mcontext.h
cvs rdiff -u -r1.10.32.1 -r1.10.32.2 src/sys/arch/sh3/include/mcontext.h
cvs rdiff -u -r1.13.32.1 -r1.13.32.2 src/sys/arch/sparc/include/mcontext.h
cvs rdiff -u -r1.9.32.1 -r1.9.32.2 src/sys/arch/sparc64/include/mcontext.h
cvs rdiff -u -r1.8.40.1 -r1.8.40.2 src/sys/arch/vax/include/mcontext.h
cvs rdiff -u -r1.49.4.1 -r1.49.4.2 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.1.34.1 -r1.1.34.2 src/tests/lib/libc/sys/t_ucontext.c

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.0
diff -u src/doc/CHANGES-8.0:1.1.2.130 src/doc/CHANGES-8.0:1.1.2.131
--- src/doc/CHANGES-8.0:1.1.2.130	Mon Feb 26 01:31:19 2018
+++ src/doc/CHANGES-8.0	Mon Feb 26 04:32:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.130 2018/02/26 01:31:19 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.131 2018/02/26 04:32:29 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9727,34 +9727,6 @@ tests/lib/libc/sys/t_ptrace_x86_wait.h		
 	test environments.
 	[martin, ticket #586]
 
-sys/arch/aarch64/include/mcontext.h		1.2
-sys/arch/alpha/include/mcontext.h		1.9
-sys/arch/amd64/include/mcontext.h		1.19
-sys/arch/arm/include/mcontext.h			1.19
-sys/arch/hppa/include/mcontext.h		1.9
-sys/arch/i386/include/mcontext.h		1.14
-sys/arch/ia64/include/mcontext.h		1.6
-sys/arch/m68k/include/mcontext.h		1.10
-sys/arch/mips/include/mcontext.h		1.22
-sys/arch/or1k/include/mcontext.h		1.2
-sys/arch/powerpc/include/mcontext.h		1.18
-sys/arch/riscv/include/mcontext.h		1.5
-sys/arch/sh3/include/mcontext.h			1.11
-sys/arch/sparc/include/mcontext.h		1.14-1.17
-sys/arch/sparc64/include/mcontext.h		1.10
-sys/arch/vax/include/mcontext.h			1.9
-tests/lib/libc/sys/Makefile			1.50
-tests/lib/libc/sys/t_ucontext.c			1.2
-
-	- Introduce _UC_MACHINE_FP().  _UC_MACHINE_FP() is a helper
-	  macro to extract from mcontext a frame pointer.
-	- Add new tests in lib/libc/sys/t_ucontext:
-	  * ucontext_sp (testing _UC_MACHINE_SP)
-	  * ucontext_fp (testing _UC_MACHINE_FP)
-	  * ucontext_pc (testing _UC_MACHINE_PC)
-	  * ucontext_intrv (testing _UC_MACHINE_INTRV)
-	[kamil, ticket #552]
-
 include/string.h1.52
 
 	Mark memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001

Index: src/sys/arch/aarch64/include/mcontext.h
diff -u src/sys/arch/aarch64/include/mcontext.h:1.1.22.1 src/sys/arch/aarch64/include/mcontext.h:1.1.22.2
--- src/sys/arch/aarch64/include/mcontext.h:1.1.22.1	Sun Feb 25 23:50:22 2018
+++ src/sys/arch/aarch64/include/mcontext.h	Mon Feb 26 04:32:29 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.1.22.1 2018/02/25 23:50:22 snj Exp $ */
+/* $NetBSD: mcontext.h,v 1.1.22.2 2018/02/26 04:32:29 snj Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -106,7 +106,6 @@ typed

CVS commit: src/sys/dev/imcsmb

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 05:01:21 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imc.c

Log Message:
Change the "Child not added" message from normal to debug


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/imcsmb/imc.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/imcsmb/imc.c
diff -u src/sys/dev/imcsmb/imc.c:1.2 src/sys/dev/imcsmb/imc.c:1.3
--- src/sys/dev/imcsmb/imc.c:1.2	Mon Feb 26 04:31:32 2018
+++ src/sys/dev/imcsmb/imc.c	Mon Feb 26 05:01:21 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.2 2018/02/26 04:31:32 pgoyette Exp $ */
+/* $NetBSD: imc.c,v 1.3 2018/02/26 05:01:21 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -243,7 +243,7 @@ imc_rescan(device_t self, const char * i
 		child = config_found_ia(self, "imc", &imca, NULL);
 
 		if (child == NULL) {
-			aprint_normal_dev(self, "Child %d imcsmb not added\n",
+			aprint_debug_dev(self, "Child %d imcsmb not added\n",
 			unit);
 		}
 		sc->sc_smbchild[unit] = child;



CVS commit: src/sys/dev/imcsmb

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 05:04:51 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imcsmb.c

Log Message:
Identify the device that wsa just attached.  Avoids getting strange
message sequence similar to

imcsmb0 at imc0iic at imcsmb0 not configured

Also, while here, revert to the original FreeBSD wait-for-device-to-
settle code by waiting for 4 intervals of 10ms each, rather than 40
intervals of 1ms.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/imcsmb/imcsmb.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/imcsmb/imcsmb.c
diff -u src/sys/dev/imcsmb/imcsmb.c:1.2 src/sys/dev/imcsmb/imcsmb.c:1.3
--- src/sys/dev/imcsmb/imcsmb.c:1.2	Mon Feb 26 04:25:32 2018
+++ src/sys/dev/imcsmb/imcsmb.c	Mon Feb 26 05:04:51 2018
@@ -115,6 +115,8 @@ imcsmb_attach(device_t parent, device_t 
 	struct imcsmb_softc *sc = device_private(self);
 	struct imc_attach_args *imca = aux;
 
+	aprint_normal_dev(self, ": SMBus controller\n");
+
 	/* Initialize private state */
 	sc->sc_dev = self;
 	sc->sc_regs = imca->ia_regs;
@@ -344,13 +346,13 @@ imcsmb_exec(void *cookie, i2c_op_t op, i
 	 * is idle before issuing a command. We can safely timeout after 35 ms,
 	 * as this is the maximum time the SMBus spec allows for a transaction.
 	 */
-	for (i = 40; i != 0; i--) {
+	for (i = 4; i != 0; i--) {
 		stat_val = pci_conf_read(sc->sc_pci_chipset_tag,
 		sc->sc_pci_tag, sc->sc_regs->smb_stat);
 		if (! (stat_val & IMCSMB_STATUS_BUSY_BIT)) {
 			break;
 		}
-		delay(1000);	/* wait 1ms */
+		delay(100);	/* wait 10ms */
 	}
 
 	if (i == 0) {



CVS commit: src/sys/dev/imcsmb

2018-02-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Feb 26 05:47:03 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imc.c

Log Message:
For non-modular driver, don't set return status for the default case.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/imcsmb/imc.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/imcsmb/imc.c
diff -u src/sys/dev/imcsmb/imc.c:1.3 src/sys/dev/imcsmb/imc.c:1.4
--- src/sys/dev/imcsmb/imc.c:1.3	Mon Feb 26 05:01:21 2018
+++ src/sys/dev/imcsmb/imc.c	Mon Feb 26 05:47:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.3 2018/02/26 05:01:21 pgoyette Exp $ */
+/* $NetBSD: imc.c,v 1.4 2018/02/26 05:47:03 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -376,8 +376,10 @@ imc_modcmd(modcmd_t cmd, void *opaque)
 			mutex_destroy(&imc_access_mutex);
 		break;
 	default:
+#ifdef _MODULE
 		error = ENOTTY;
 		break;
+#endif
 	}
 
 	return error;



  1   2   >