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

2017-11-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  7 07:21:13 UTC 2017

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Fix the "wait for any pending transmission to finish" - doesn't really
matter at the moment as the fifo is disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/dev/plcom.c

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

Modified files:

Index: src/sys/arch/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.52 src/sys/arch/evbarm/dev/plcom.c:1.53
--- src/sys/arch/evbarm/dev/plcom.c:1.52	Mon Apr 13 21:18:41 2015
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Nov  7 07:21:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.52 2015/04/13 21:18:41 riastradh Exp $	*/
+/*	$NetBSD: plcom.c,v 1.53 2017/11/07 07:21:13 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.52 2015/04/13 21:18:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.53 2017/11/07 07:21:13 skrll Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -2323,7 +2323,7 @@ plcom_common_putc(dev_t dev, struct plco
 
 	/* wait for any pending transmission to finish */
 	timo = 15;
-	while (!ISSET(PREAD1(pi, PL01XCOM_FR), PL01X_FR_TXFE) && --timo)
+	while (ISSET(PREAD1(pi, PL01XCOM_FR), PL01X_FR_TXFF) && --timo)
 		continue;
 
 	PWRITE1(pi, PL01XCOM_DR, c);



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

2017-11-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  7 07:21:13 UTC 2017

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Fix the "wait for any pending transmission to finish" - doesn't really
matter at the moment as the fifo is disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/dev/plcom.c

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



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

2017-11-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  7 07:19:13 UTC 2017

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/sunxi/sunxi_gpio.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_gpio.c
diff -u src/sys/arch/arm/sunxi/sunxi_gpio.c:1.17 src/sys/arch/arm/sunxi/sunxi_gpio.c:1.18
--- src/sys/arch/arm/sunxi/sunxi_gpio.c:1.17	Mon Nov  6 21:03:58 2017
+++ src/sys/arch/arm/sunxi/sunxi_gpio.c	Tue Nov  7 07:19:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.c,v 1.17 2017/11/06 21:03:58 jmcneill Exp $ */
+/* $NetBSD: sunxi_gpio.c,v 1.18 2017/11/07 07:19:13 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_soc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.17 2017/11/06 21:03:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.18 2017/11/07 07:19:13 skrll Exp $");
 
 #include 
 #include 
@@ -329,7 +329,7 @@ sunxi_gpio_release(device_t dev, void *p
 	sunxi_gpio_ctl(pin->pin_sc, pin->pin_def, GPIO_PIN_INPUT);
 
 	kmem_free(pin, sizeof(*pin));
-} 
+}
 
 static int
 sunxi_gpio_read(device_t dev, void *priv, bool raw)



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

2017-11-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  7 07:19:13 UTC 2017

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/sunxi/sunxi_gpio.c

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



Re: audio usemixer breaks vs(4) Re: CVS commit: src/sys/dev

2017-11-06 Thread Tetsuya Isaki
At Tue, 07 Nov 2017 12:45:47 +0900,
Tetsuya Isaki wrote:
> 
> nat@, (cc: christos@)
> 
> With this change, vs(4) no longer works even if usemixer=0.
  ^^
Oops, it should be 'usemixer=1'.

If usemixer=1, it plays noise.
If usemixer=0, failed to open sound device.

Anyway, please revert it.
---
Tetsuya Isaki 

> Please revert it, and don't break without public discussion.
> 
> This is the 3rd time you broke vs(4).
> You broke and I repaired.
> You broke and I repaired.
> I spent a lot of time this half year.
> 
> If you can not consider about supported devices (at least
> devices which has active users), please don't touch audio.
> 
> Thanks,
> ---
> Tetsuya Isaki 
> 
> At Tue, 7 Nov 2017 01:13:19 +,
> > Module Name:src
> > Committed By:   nat
> > Date:   Tue Nov  7 01:13:19 UTC 2017
> > 
> > Modified Files:
> > src/sys/dev: audio.c audiovar.h
> > 
> > Log Message:
> > A sysctl is now available to disable the in kernel mixer.
> > sysctl -w hw.hdafg0.usemixer=0
> > 
> > There currently is a problem draining the last block with the mixer
> > disabled.  I will fix this in a follow up commit.
> > 
> > AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
> > as the filters for mulaw, alaw and unsigned linear have been removed post
> > audio mixing changes.
> > 
> > Documentation for this sysctl variable will be made to audio.4 in a follow
> > up commit.
> > 
> > Ok christos@.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.429 -r1.430 src/sys/dev/audio.c
> > cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audiovar.h
> 


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

2017-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov  7 05:41:54 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c

Log Message:
 Fix a bug that X550T(1) didn't linkup if it forces 100BaseTX-FDX.
Popular switches and OSes don't use auto-negotiation if the media is
100BASE-TX (and 10BASE-T). Do the same thig.

 Another fix is required for Denverton's _T device which use firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_phy.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.12 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.13
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.12	Wed Aug 30 08:49:18 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Tue Nov  7 05:41:54 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_phy.c,v 1.12 2017/08/30 08:49:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe_phy.c,v 1.13 2017/11/07 05:41:54 msaitoh Exp $ */
 
 /**
 
@@ -38,6 +38,8 @@
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
 
+#include 
+
 static void ixgbe_i2c_start(struct ixgbe_hw *hw);
 static void ixgbe_i2c_stop(struct ixgbe_hw *hw);
 static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data);
@@ -855,18 +857,39 @@ s32 ixgbe_setup_phy_link_generic(struct 
 			  IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
 			  autoneg_reg);
 
-	/* Blocked by MNG FW so don't reset PHY */
-	if (ixgbe_check_reset_blocked(hw))
-		return status;
+	if (hw->phy.autoneg_advertised == IXGBE_LINK_SPEED_100_FULL) {
+		u16 ctrl;
 
-	/* Restart PHY auto-negotiation. */
-	hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
+		/* Force 100Mbps */
+		hw->phy.ops.read_reg(hw, MDIO_PMAPMD_CTRL1, MDIO_MMD_PMAPMD,
+		);
+		ctrl &= ~PMAPMD_CTRL1_SPEED_MASK;
+		ctrl |= PMAPMD_CTRL1_SPEED_100;
+		hw->phy.ops.write_reg(hw, MDIO_PMAPMD_CTRL1,MDIO_MMD_PMAPMD,
+		ctrl);
+
+		/* Don't use auto-nego for 100Mbps */
+		hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
 			 IXGBE_MDIO_AUTO_NEG_DEV_TYPE, _reg);
 
-	autoneg_reg |= IXGBE_MII_RESTART;
+		autoneg_reg &= ~AN_CTRL1_AUTOEN;	
 
-	hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
+		hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
 			  IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
+	} else {
+		/* Blocked by MNG FW so don't reset PHY */
+		if (ixgbe_check_reset_blocked(hw))
+			return status;
+
+		/* Restart PHY auto-negotiation. */
+		hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
+		IXGBE_MDIO_AUTO_NEG_DEV_TYPE, _reg);
+
+		autoneg_reg |= IXGBE_MII_RESTART | AN_CTRL1_AUTOEN;
+
+		hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
+		IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
+	}
 
 	return status;
 }



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

2017-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov  7 05:41:54 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c

Log Message:
 Fix a bug that X550T(1) didn't linkup if it forces 100BaseTX-FDX.
Popular switches and OSes don't use auto-negotiation if the media is
100BASE-TX (and 10BASE-T). Do the same thig.

 Another fix is required for Denverton's _T device which use firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_phy.c

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



CVS commit: src/sys/dev/mii

2017-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov  7 05:33:12 UTC 2017

Modified Files:
src/sys/dev/mii: mdio.h

Log Message:
 Define bit definitions of MDIO_PMAPMD_CTRL1 and MDIO_AN_CTRL1.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/mdio.h

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



CVS commit: src/sys/dev/mii

2017-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov  7 05:33:12 UTC 2017

Modified Files:
src/sys/dev/mii: mdio.h

Log Message:
 Define bit definitions of MDIO_PMAPMD_CTRL1 and MDIO_AN_CTRL1.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/mdio.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/mii/mdio.h
diff -u src/sys/dev/mii/mdio.h:1.6 src/sys/dev/mii/mdio.h:1.7
--- src/sys/dev/mii/mdio.h:1.6	Fri Jun  9 04:43:33 2017
+++ src/sys/dev/mii/mdio.h	Tue Nov  7 05:33:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdio.h,v 1.6 2017/06/09 04:43:33 msaitoh Exp $	*/
+/*	$NetBSD: mdio.h,v 1.7 2017/11/07 05:33:12 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -64,6 +64,24 @@
  * Table 45-3
  */
 #define MDIO_PMAPMD_CTRL1		0   /* PMA/PMD control 1 */
+#define PMAPMD_CTRL1_RESET	0x8000		/* Reset */
+#define PMAPMD_CTRL1_SPEED0	0x2000		/* Speed selection (LSB) */
+#define PMAPMD_CTRL1_LOWPWR	0x0800		/* Low power */
+#define PMAPMD_CTRL1_SPEED1	0x0040		/* Speed selection (MSB) */
+#define PMAPMD_CTRL1_SPEED2	0x003c		/* Speed selection (over 1G) */
+#define PMAPMD_CTRL1_LOOP_REM	0x0002		/* PMA remote loopback */
+#define PMAPMD_CTRL1_LOOP_LOC	0x0001		/* PMA local loopback */
+#define PMAPMD_CTRL1_SPEED_SEL52 (PMAPMD_CTRL1_SPEED0 | PMAPMD_CTRL1_SPEED1)
+#define PMAPMD_CTRL1_SPEED_MASK	(PMAPMD_CTRL1_SPEED_SEL52 \
+	| PMAPMD_CTRL1_SPEED2)
+#define PMAPMD_CTRL1_SPEED_10	   0
+#define PMAPMD_CTRL1_SPEED_100	   PMAPMD_CTRL1_SPEED0
+#define PMAPMD_CTRL1_SPEED_1G	   PMAPMD_CTRL1_SPEED1
+#define PMAPMD_CTRL1_SPEED_10G PMAPMD_CTRL1_SPEED_SEL52
+#define PMAPMD_CTRL1_SPEED_10PASS (PMAPMD_CTRL1_SPEED_SEL52 | (1 << 2))
+#define PMAPMD_CTRL1_SPEED_40G	  (PMAPMD_CTRL1_SPEED_SEL52 | (2 << 2))
+#define PMAPMD_CTRL1_SPEED_100G   (PMAPMD_CTRL1_SPEED_SEL52 | (3 << 2))
+
 #define MDIO_PMAPMD_STAT1		1   /* PMA/PMD status 1 */
 #define MDIO_PMAPMD_DEVID1		2   /* PMA/PMD device identifier 1 */
 #define MDIO_PMAPMD_DEVID2		3   /* PMA/PMD device identifier 2 */
@@ -529,6 +547,11 @@
  * Table 45-200
  */
 #define MDIO_AN_CTRL1		0   /* AN control 1 */
+#define AN_CTRL1_ANRESET	0x8000 /* AN reset */
+#define AN_CTRL1_ENP		0x2000 /* Extended Next Page  */
+#define AN_CTRL1_AUTOEN		0x1000 /* Auto-Negotiation enable */
+#define AN_CTRL1_STARTNEG	0x0200 /* Restart Auto-Negotiation */
+
 #define MDIO_AN_STAT1		1   /* AN status 1 */
 #define MDIO_AN_DEVID1		2   /* AN device identifier 1 */
 #define MDIO_AN_DEVID2		3   /* AN device identifier 2 */



CVS commit: src/sys/dev/ata

2017-11-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  7 04:09:08 UTC 2017

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
Make wddone poll all drives of a channel again.


To generate a diff of this commit:
cvs rdiff -u -r1.435 -r1.436 src/sys/dev/ata/wd.c

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



CVS commit: src/sys/dev/ata

2017-11-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  7 04:09:08 UTC 2017

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
Make wddone poll all drives of a channel again.


To generate a diff of this commit:
cvs rdiff -u -r1.435 -r1.436 src/sys/dev/ata/wd.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/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.435 src/sys/dev/ata/wd.c:1.436
--- src/sys/dev/ata/wd.c:1.435	Fri Nov  3 13:01:26 2017
+++ src/sys/dev/ata/wd.c	Tue Nov  7 04:09:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.435 2017/11/03 13:01:26 mlelstv Exp $ */
+/*	$NetBSD: wd.c,v 1.436 2017/11/07 04:09:08 mlelstv Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.435 2017/11/03 13:01:26 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.436 2017/11/07 04:09:08 mlelstv Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -901,7 +901,7 @@ noerror:	if ((xfer->c_bio.flags & ATA_CO
 	ata_free_xfer(wd->drvp->chnl_softc, xfer);
 
 	dk_done(dksc, bp);
-	dk_start(dksc, NULL);
+	ata_channel_start(wd->drvp->chnl_softc, wd->drvp->drive);
 }
 
 static void



audio usemixer breaks vs(4) Re: CVS commit: src/sys/dev

2017-11-06 Thread Tetsuya Isaki
nat@, (cc: christos@)

With this change, vs(4) no longer works even if usemixer=0.
Please revert it, and don't break without public discussion.

This is the 3rd time you broke vs(4).
You broke and I repaired.
You broke and I repaired.
I spent a lot of time this half year.

If you can not consider about supported devices (at least
devices which has active users), please don't touch audio.

Thanks,
---
Tetsuya Isaki 

At Tue, 7 Nov 2017 01:13:19 +,
> Module Name:  src
> Committed By: nat
> Date: Tue Nov  7 01:13:19 UTC 2017
> 
> Modified Files:
>   src/sys/dev: audio.c audiovar.h
> 
> Log Message:
> A sysctl is now available to disable the in kernel mixer.
>   sysctl -w hw.hdafg0.usemixer=0
> 
> There currently is a problem draining the last block with the mixer
> disabled.  I will fix this in a follow up commit.
> 
> AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
> as the filters for mulaw, alaw and unsigned linear have been removed post
> audio mixing changes.
> 
> Documentation for this sysctl variable will be made to audio.4 in a follow
> up commit.
> 
> Ok christos@.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.429 -r1.430 src/sys/dev/audio.c
> cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audiovar.h


CVS commit: src/tests/net/ndp

2017-11-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Nov  7 02:19:23 UTC 2017

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Let rtadvd not use syslog for logging

Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.

Address PR bin/52701


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/net/ndp/t_ra.sh

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



CVS commit: src/tests/net/ndp

2017-11-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Nov  7 02:19:23 UTC 2017

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Let rtadvd not use syslog for logging

Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.

Address PR bin/52701


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/net/ndp/t_ra.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/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.30 src/tests/net/ndp/t_ra.sh:1.31
--- src/tests/net/ndp/t_ra.sh:1.30	Mon Nov  6 10:51:40 2017
+++ src/tests/net/ndp/t_ra.sh	Tue Nov  7 02:19:23 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.30 2017/11/06 10:51:40 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.31 2017/11/07 02:19:23 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -151,7 +151,8 @@ start_rtadvd()
 	local pidfile=$2
 
 	export RUMP_SERVER=$sock
-	atf_check -s exit:0 rump.rtadvd -c ${CONFIG} -p $pidfile shmif0
+	atf_check -s exit:0 -e ignore \
+	rump.rtadvd -D -c ${CONFIG} -p $pidfile shmif0
 	while [ ! -f $pidfile ]; do
 		sleep 0.2
 	done



CVS commit: src/sys/dev

2017-11-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Nov  7 01:15:43 UTC 2017

Modified Files:
src/sys/dev: auconv.c auconv.h

Log Message:
Remove 24 bit in a 32 bit container filters.

At present this filter did not work well and has caused problems with
the audio mixer disabled for hdaudio(4).

These filters may return when they are fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/auconv.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/auconv.h

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



CVS commit: src/sys/dev

2017-11-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Nov  7 01:15:43 UTC 2017

Modified Files:
src/sys/dev: auconv.c auconv.h

Log Message:
Remove 24 bit in a 32 bit container filters.

At present this filter did not work well and has caused problems with
the audio mixer disabled for hdaudio(4).

These filters may return when they are fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/auconv.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/auconv.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/auconv.c
diff -u src/sys/dev/auconv.c:1.33 src/sys/dev/auconv.c:1.34
--- src/sys/dev/auconv.c:1.33	Mon Oct  2 07:06:15 2017
+++ src/sys/dev/auconv.c	Tue Nov  7 01:15:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.c,v 1.33 2017/10/02 07:06:15 nat Exp $	*/
+/*	$NetBSD: auconv.c,v 1.34 2017/11/07 01:15:42 nat Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.33 2017/10/02 07:06:15 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.34 2017/11/07 01:15:42 nat Exp $");
 
 #include 
 #include 
@@ -141,7 +141,6 @@ struct conv_table {
  */
 static const struct conv_table s8_table[] = {
 	TABLE_LIST(32, 32, 8)
-	TABLE_LIST(24, 32, 8)
 	TABLE_LIST(24, 24, 8)
 	TABLE_LIST(16, 16, 8)
 	TABLE_LIST(8, 8, 8)
@@ -151,7 +150,6 @@ static const struct conv_table s8_table[
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u8_table[] = {
 	TABLE_LIST(32, 32, 8)
-	TABLE_LIST(24, 32, 8)
 	TABLE_LIST(24, 24, 8)
 	TABLE_LIST(16, 16, 8)
 	TABLE_LIST(8, 8, 8)
@@ -161,7 +159,6 @@ static const struct conv_table u8_table[
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table s16le_table[] = {
 	TABLE_LIST(32, 32, 16)
-	TABLE_LIST(24, 32, 16)
 	TABLE_LIST(24, 24, 16)
 	TABLE_LIST(16, 16, 16)
 	TABLE_LIST(8, 8, 16)
@@ -171,7 +168,6 @@ static const struct conv_table s16le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table s16be_table[] = {
 	TABLE_LIST(32, 32, 16)
-	TABLE_LIST(24, 32, 16)
 	TABLE_LIST(24, 24, 16)
 	TABLE_LIST(16, 16, 16)
 	TABLE_LIST(8, 8, 16)
@@ -181,7 +177,6 @@ static const struct conv_table s16be_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u16le_table[] = {
 	TABLE_LIST(32, 32, 16)
-	TABLE_LIST(24, 32, 16)
 	TABLE_LIST(24, 24, 16)
 	TABLE_LIST(16, 16, 16)
 	TABLE_LIST(8, 8, 16)
@@ -191,7 +186,6 @@ static const struct conv_table u16le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u16be_table[] = {
 	TABLE_LIST(32, 32, 16)
-	TABLE_LIST(24, 32, 16)
 	TABLE_LIST(24, 24, 16)
 	TABLE_LIST(16, 16, 16)
 	TABLE_LIST(8, 8, 16)
@@ -202,7 +196,6 @@ static const struct conv_table u16be_tab
 #ifdef notdef
 static const struct conv_table s24le_table[] = {
 	TABLE_LIST(32, 32, 24)
-	TABLE_LIST(24, 32, 24)
 	TABLE_LIST(24, 24, 24)
 	TABLE_LIST(16, 16, 24)
 	TABLE_LIST(8, 8, 24)
@@ -212,7 +205,6 @@ static const struct conv_table s24le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table s24be_table[] = {
 	TABLE_LIST(32, 32, 24)
-	TABLE_LIST(24, 32, 24)
 	TABLE_LIST(24, 24, 24)
 	TABLE_LIST(16, 16, 24)
 	TABLE_LIST(8, 8, 24)
@@ -222,7 +214,6 @@ static const struct conv_table s24be_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u24le_table[] = {
 	TABLE_LIST(32, 32, 24)
-	TABLE_LIST(24, 32, 24)
 	TABLE_LIST(24, 24, 24)
 	TABLE_LIST(16, 16, 24)
 	TABLE_LIST(8, 8, 24)
@@ -232,7 +223,6 @@ static const struct conv_table u24le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u24be_table[] = {
 	TABLE_LIST(32, 32, 24)
-	TABLE_LIST(24, 32, 24)
 	TABLE_LIST(24, 24, 24)
 	TABLE_LIST(16, 16, 24)
 	TABLE_LIST(8, 8, 24)
@@ -243,7 +233,6 @@ static const struct conv_table u24be_tab
 #endif
 static const struct conv_table s32le_table[] = {
 	TABLE_LIST(32, 32, 32)
-	TABLE_LIST(24, 32, 32)
 	TABLE_LIST(24, 24, 32)
 	TABLE_LIST(16, 16, 32)
 	TABLE_LIST(8, 8, 32)
@@ -253,7 +242,6 @@ static const struct conv_table s32le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table s32be_table[] = {
 	TABLE_LIST(32, 32, 32)
-	TABLE_LIST(24, 32, 32)
 	TABLE_LIST(24, 24, 32)
 	TABLE_LIST(16, 16, 32)
 	TABLE_LIST(8, 8, 32)
@@ -263,7 +251,6 @@ static const struct conv_table s32be_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u32le_table[] = {
 	TABLE_LIST(32, 32, 32)
-	TABLE_LIST(24, 32, 32)
 	TABLE_LIST(24, 24, 32)
 	TABLE_LIST(16, 16, 32)
 	TABLE_LIST(8, 8, 32)
@@ -273,7 +260,6 @@ static const struct conv_table u32le_tab
 	{0, 0, 0, NULL, NULL}};
 static const struct conv_table u32be_table[] = {
 	TABLE_LIST(32, 32, 32)
-	TABLE_LIST(24, 32, 32)
 	TABLE_LIST(24, 24, 32)
 	TABLE_LIST(16, 16, 32)
 	TABLE_LIST(8, 8, 32)
@@ -312,7 +298,6 @@ static const struct conv_table u32be_tab
 
 static const struct conv_table mulaw_table[] = {
 	MULAW_LIST(32, 32, 32)
-	MULAW_LIST(24, 32, 24)
 	MULAW_LIST(24, 24, 24)
 	MULAW_LIST(16, 16, 16)
 	

CVS commit: src/sys/dev

2017-11-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Nov  7 01:13:19 UTC 2017

Modified Files:
src/sys/dev: audio.c audiovar.h

Log Message:
A sysctl is now available to disable the in kernel mixer.
sysctl -w hw.hdafg0.usemixer=0

There currently is a problem draining the last block with the mixer
disabled.  I will fix this in a follow up commit.

AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
as the filters for mulaw, alaw and unsigned linear have been removed post
audio mixing changes.

Documentation for this sysctl variable will be made to audio.4 in a follow
up commit.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.429 -r1.430 src/sys/dev/audio.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audiovar.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/audio.c
diff -u src/sys/dev/audio.c:1.429 src/sys/dev/audio.c:1.430
--- src/sys/dev/audio.c:1.429	Sat Nov  4 01:50:48 2017
+++ src/sys/dev/audio.c	Tue Nov  7 01:13:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.429 2017/11/04 01:50:48 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.430 2017/11/07 01:13:19 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.429 2017/11/04 01:50:48 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.430 2017/11/07 01:13:19 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -320,6 +320,7 @@ static int audio_sysctl_frequency(SYSCTL
 static int audio_sysctl_precision(SYSCTLFN_PROTO);
 static int audio_sysctl_channels(SYSCTLFN_PROTO);
 static int audio_sysctl_latency(SYSCTLFN_PROTO);
+static int audio_sysctl_usemixer(SYSCTLFN_PROTO);
 
 static int	audiomatch(device_t, cfdata_t, void *);
 static void	audioattach(device_t, device_t, void *);
@@ -608,6 +609,7 @@ audioattach(device_t parent, device_t se
 
 	sc->sc_lastgain = 128;
 	sc->sc_multiuser = false;
+	sc->sc_usemixer = true;
 
 	error = vchan_autoconfig(sc);
 	if (error != 0) {
@@ -814,6 +816,15 @@ audioattach(device_t parent, device_t se
 			>sc_multiuser, 0,
 			CTL_HW, node->sysctl_num,
 			CTL_CREATE, CTL_EOL);
+
+		sysctl_createv(>sc_log, 0, NULL, NULL,
+			CTLFLAG_READWRITE,
+			CTLTYPE_BOOL, "usemixer",
+			SYSCTL_DESCR("allow in-kernel mixing"),
+			audio_sysctl_usemixer, 0,
+			(void *)sc, 0,
+			CTL_HW, node->sysctl_num,
+			CTL_CREATE, CTL_EOL);
 	}
 
 	selinit(>sc_rsel);
@@ -1594,6 +1605,9 @@ audio_waitio(struct audio_softc *sc, kco
 	/* Wait for pending I/O to complete. */
 	error = cv_wait_sig(chan, sc->sc_lock);
 
+	if (!sc->sc_usemixer)
+		return error;
+
 	found = false;
 	SIMPLEQ_FOREACH(vchan, >sc_audiochan, entries) {
 		if (vchan->vc == vc) {
@@ -2153,7 +2167,7 @@ audio_open(dev_t dev, struct audio_softc
 
 	KASSERT(mutex_owned(sc->sc_lock));
 
-	if (sc->sc_ready == false)
+	if (sc->sc_usemixer && !sc->sc_ready)
 		return ENXIO;
 
 	hw = sc->hw_if;
@@ -2166,36 +2180,50 @@ audio_open(dev_t dev, struct audio_softc
 		n = chan->chan + 1;
 
 	chan = kmem_zalloc(sizeof(struct audio_chan), KM_SLEEP);
-	vc = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP);
+	if (sc->sc_usemixer)
+		vc = kmem_zalloc(sizeof(struct virtual_channel), KM_SLEEP);
+	else
+		vc = sc->sc_hwvc;
 	chan->vc = vc;
 
-	vc->sc_open = 0;
-	vc->sc_mode = 0;
-	vc->sc_sil_count = 0;
-	vc->sc_nrfilters = 0;
-	memset(vc->sc_rfilters, 0,
-	sizeof(vc->sc_rfilters));
-	vc->sc_rbus = false;
-	vc->sc_npfilters = 0;
-	memset(vc->sc_pfilters, 0,
-	sizeof(vc->sc_pfilters));
-	vc->sc_draining = false;
-	vc->sc_pbus = false;
-	vc->sc_lastinfovalid = false;
-	vc->sc_swvol = 255;
-	vc->sc_recswvol = 255;
+	if (sc->sc_usemixer) {
+		vc->sc_open = 0;
+		vc->sc_mode = 0;
+		vc->sc_sil_count = 0;
+		vc->sc_nrfilters = 0;
+		memset(vc->sc_rfilters, 0,
+		sizeof(vc->sc_rfilters));
+		vc->sc_rbus = false;
+		vc->sc_npfilters = 0;
+		memset(vc->sc_pfilters, 0,
+		sizeof(vc->sc_pfilters));
+		vc->sc_draining = false;
+		vc->sc_pbus = false;
+		vc->sc_lastinfovalid = false;
+		vc->sc_swvol = 255;
+		vc->sc_recswvol = 255;
+	} else {
+		if (sc->sc_opens > 0 || sc->sc_recopens > 0 ) {
+			kmem_free(chan, sizeof(struct audio_chan));
+			return EBUSY;
+		}
+	}
 
 	DPRINTF(("audio_open: flags=0x%x sc=%p hdl=%p\n",
 		 flags, sc, sc->hw_hdl));
 
-	error = audio_alloc_ring(sc, >sc_mpr, AUMODE_PLAY, AU_RING_SIZE);
-	if (error)
-		goto bad;
-	error = audio_alloc_ring(sc, >sc_mrr, AUMODE_RECORD, AU_RING_SIZE);
-	if (error)
-		goto bad;
+	if (sc->sc_usemixer) {
+		error = audio_alloc_ring(sc, >sc_mpr, AUMODE_PLAY,
+		AU_RING_SIZE);
+		if (error)
+			goto bad;
+		error = audio_alloc_ring(sc, >sc_mrr, AUMODE_RECORD,
+		AU_RING_SIZE);
+		if (error)
+			goto bad;
+	}
 
-	if (sc->sc_opens + sc->sc_recopens == 0) {
+	if (!sc->sc_usemixer || sc->sc_opens + sc->sc_recopens == 0) {
 		sc->sc_credentials = kauth_cred_get();
 		

CVS commit: src/sys/dev

2017-11-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Nov  7 01:13:19 UTC 2017

Modified Files:
src/sys/dev: audio.c audiovar.h

Log Message:
A sysctl is now available to disable the in kernel mixer.
sysctl -w hw.hdafg0.usemixer=0

There currently is a problem draining the last block with the mixer
disabled.  I will fix this in a follow up commit.

AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
as the filters for mulaw, alaw and unsigned linear have been removed post
audio mixing changes.

Documentation for this sysctl variable will be made to audio.4 in a follow
up commit.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.429 -r1.430 src/sys/dev/audio.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audiovar.h

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



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

2017-11-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov  6 23:06:55 UTC 2017

Modified Files:
src/tests/lib/libc/stdio: t_fopen.c

Log Message:
In the fopen_regular and fopen_symlink tests, when (that is, if) a
failure occurs, distinguish in the failure message the cases where the
open succeeded (and should not have), and where it failed, but not for
the expected reason (the "wrong errno" case not tested, would require
manufacturing a broken kernel...).

Add O_NOFOLLOW ('l' mode modifier) tests to the fopen_mode test case
(tests that are intended to open the file) and also add a few missing
commas which were causing a few of the sub-tests to be skipped, and
others to be not quite testing exactly what was intended.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/t_fopen.c

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



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

2017-11-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov  6 23:06:55 UTC 2017

Modified Files:
src/tests/lib/libc/stdio: t_fopen.c

Log Message:
In the fopen_regular and fopen_symlink tests, when (that is, if) a
failure occurs, distinguish in the failure message the cases where the
open succeeded (and should not have), and where it failed, but not for
the expected reason (the "wrong errno" case not tested, would require
manufacturing a broken kernel...).

Add O_NOFOLLOW ('l' mode modifier) tests to the fopen_mode test case
(tests that are intended to open the file) and also add a few missing
commas which were causing a few of the sub-tests to be skipped, and
others to be not quite testing exactly what was intended.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/t_fopen.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/stdio/t_fopen.c
diff -u src/tests/lib/libc/stdio/t_fopen.c:1.4 src/tests/lib/libc/stdio/t_fopen.c:1.5
--- src/tests/lib/libc/stdio/t_fopen.c:1.4	Mon Nov  6 17:32:53 2017
+++ src/tests/lib/libc/stdio/t_fopen.c	Mon Nov  6 23:06:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fopen.c,v 1.4 2017/11/06 17:32:53 christos Exp $ */
+/*	$NetBSD: t_fopen.c,v 1.5 2017/11/06 23:06:55 kre Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fopen.c,v 1.4 2017/11/06 17:32:53 christos Exp $");
+__RCSID("$NetBSD: t_fopen.c,v 1.5 2017/11/06 23:06:55 kre Exp $");
 
 #include 
 #include 
@@ -253,9 +253,10 @@ ATF_TC_BODY(fopen_mode, tc)
 
 	static const char *mode[] = {
 		"r", "r+", "w", "w+", "a", "a+",
-		"rb", "r+b", "wb", "w+b", "ab", "a+b"
-		"re", "r+e", "we", "w+e", "ae", "a+e"
-		"rf", "r+f", "wf", "w+f", "af", "a+f"
+		"rb", "r+b", "wb", "w+b", "ab", "a+b",
+		"re", "r+e", "we", "w+e", "ae", "a+e",
+		"rf", "r+f", "wf", "w+f", "af", "a+f",
+		"rl", "r+l", "wl", "w+l", "al", "a+l"
 	};
 
 	f = fopen(path, "w+");
@@ -327,11 +328,16 @@ ATF_TC_BODY(fopen_regular, tc)
 			if (f == NULL && errno == EFTYPE)
 continue;
 
-			if (f != NULL)
+			if (f != NULL) {
 (void)fclose(f);
 
-			atf_tc_fail_nonfatal("opened %s as %s",
-			devs[i], mode[j]);
+atf_tc_fail_nonfatal("opened %s as %s",
+devs[i], mode[j]);
+			} else {
+atf_tc_fail_nonfatal(
+"err %d (%s) from open of %s as %s", errno,
+strerror(errno), devs[i], mode[j]);
+			}
 		}
 	}
 }
@@ -360,10 +366,16 @@ ATF_TC_BODY(fopen_symlink, tc)
 		if (f == NULL && errno == EFTYPE)
 			continue;
 
-		if (f != NULL)
+		if (f != NULL) {
 			(void)fclose(f);
 
-		atf_tc_fail_nonfatal("opened %s as %s", linkpath, mode[j]);
+			atf_tc_fail_nonfatal("opened %s as %s", linkpath,
+			mode[j]);
+		} else {
+			atf_tc_fail_nonfatal(
+			"err %d (%s) from open of %s as %s", errno,
+			strerror(errno), linkpath, mode[j]);
+		}
 	}
 	ATF_REQUIRE(unlink(linkpath) == 0);
 }



CVS commit: src/share/man/man4

2017-11-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov  6 21:40:04 UTC 2017

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

Log Message:
Bump date for previous. New sentence, new line. Fix typos.
Add missing word.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/pms.4

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



CVS commit: src/share/man/man4

2017-11-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov  6 21:40:04 UTC 2017

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

Log Message:
Bump date for previous. New sentence, new line. Fix typos.
Add missing word.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/pms.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/pms.4
diff -u src/share/man/man4/pms.4:1.29 src/share/man/man4/pms.4:1.30
--- src/share/man/man4/pms.4:1.29	Mon Nov  6 21:11:17 2017
+++ src/share/man/man4/pms.4	Mon Nov  6 21:40:04 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.29 2017/11/06 21:11:17 blymn Exp $
+.\" $NetBSD: pms.4,v 1.30 2017/11/06 21:40:04 wiz Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd September 6, 2017
+.Dd November 6, 2017
 .Dt PMS 4
 .Os
 .Sh NAME
@@ -160,10 +160,11 @@ two or three buttons by detecting the fi
 either a button 2 or button 3 click iff the the click occurs within
 the region bounded by button_boundary and the bottom of the clickpad.
 .It Dv hw.synaptics.button3_edge
-This defines the left hand edige of the button 3 region.
+This defines the left hand edge of the button 3 region.
 If a click occurs in the region bounded by button_boundary, button3_edge
-the right hand edge of the click pad then the click will be reported
-as a button3 event.  Button 3 emulation can be disabled by setting
+and the right hand edge of the click pad then the click will be reported
+as a button3 event.
+Button 3 emulation can be disabled by setting
 button3_edge to the right hand edge of the clickpad.
 .It Dv hw.synaptics.button2_edge
 This defines the left hand edge of the button 2 region.
@@ -173,7 +174,7 @@ If a click occurs in this region then it
 event.
 For completeness, the region between the left hand side of the clickpad,
 button2_edge and button_boundary will be reported as a button1 event
-as will any clicks htat occur outside the button emulation region.
+as will any clicks that occur outside the button emulation region.
 .El
 .Pp
 The following



CVS commit: src

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 21:16:04 UTC 2017

Modified Files:
src/libexec/ld.elf_so: rtld.c
src/libexec/ld.elf_so/arch/arm: mdreloc.c
src/libexec/ld.elf_so/arch/i386: mdreloc.c
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c
src/libexec/ld.elf_so/arch/x86_64: mdreloc.c
src/tests/libexec/ld.elf_so: t_ifunc.c

Log Message:
init/fini for the main program is handled by crt0.o, so ifunc handling
is skipped right now as it iterates the same list. Don't repeat that
mistake and explicitly take care of it in the dynamic linker.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.42 -r1.43 src/libexec/ld.elf_so/arch/arm/mdreloc.c
cvs rdiff -u -r1.39 -r1.40 src/libexec/ld.elf_so/arch/i386/mdreloc.c
cvs rdiff -u -r1.65 -r1.66 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
cvs rdiff -u -r1.45 -r1.46 src/libexec/ld.elf_so/arch/x86_64/mdreloc.c
cvs rdiff -u -r1.4 -r1.5 src/tests/libexec/ld.elf_so/t_ifunc.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.187 src/libexec/ld.elf_so/rtld.c:1.188
--- src/libexec/ld.elf_so/rtld.c:1.187	Sat Aug 12 09:03:27 2017
+++ src/libexec/ld.elf_so/rtld.c	Mon Nov  6 21:16:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.187 2017/08/12 09:03:27 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.188 2017/11/06 21:16:04 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.187 2017/08/12 09:03:27 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.188 2017/11/06 21:16:04 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -259,6 +259,22 @@ _rtld_call_init_function(Obj_Entry *obj,
 #endif /* HAVE_INITFINI_ARRAY */
 }
 
+static bool
+_rtld_call_ifunc_functions(sigset_t *mask, Obj_Entry *obj, u_int cur_objgen)
+{
+	if (obj->ifunc_remaining
+#ifdef __sparc__
+	|| obj->ifunc_remaining_nonplt
+#endif
+	) {
+		_rtld_call_ifunc(obj, mask, cur_objgen);
+		if (_rtld_objgen != cur_objgen) {
+			return true;
+		}
+	}
+	return false;
+}
+
 static void
 _rtld_call_init_functions(sigset_t *mask)
 {
@@ -275,20 +291,22 @@ restart:
 
 	/* First pass: objects with IRELATIVE relocations. */
 	SIMPLEQ_FOREACH(elm, , link) {
-		Obj_Entry * const obj = elm->obj;
-		if (obj->ifunc_remaining
-#ifdef __sparc__
-		|| obj->ifunc_remaining_nonplt
-#endif
-		) {
-			_rtld_call_ifunc(obj, mask, cur_objgen);
-			if (_rtld_objgen != cur_objgen) {
-dbg(("restarting init iteration"));
-_rtld_objlist_clear();
-goto restart;
-			}
+		if (_rtld_call_ifunc_functions(mask, elm->obj, cur_objgen)) {
+			dbg(("restarting init iteration"));
+			_rtld_objlist_clear();
+			goto restart;
 		}
 	}
+	/*
+	 * XXX: For historic reasons, init/fini of the main object are called
+	 * from crt0. Don't introduce that mistake for ifunc, so look at
+	 * the head of _rtld_objlist that _rtld_initlist_tsort skipped.
+	 */
+	if (_rtld_call_ifunc_functions(mask, _rtld_objlist, cur_objgen)) {
+		dbg(("restarting init iteration"));
+		_rtld_objlist_clear();
+		goto restart;
+	}
 
 	/* Second pass: objects marked with DF_1_INITFIRST. */
 	SIMPLEQ_FOREACH(elm, , link) {

Index: src/libexec/ld.elf_so/arch/arm/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.42 src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.43
--- src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.42	Thu Aug 10 19:03:26 2017
+++ src/libexec/ld.elf_so/arch/arm/mdreloc.c	Mon Nov  6 21:16:04 2017
@@ -1,8 +1,8 @@
-/*	$NetBSD: mdreloc.c,v 1.42 2017/08/10 19:03:26 joerg Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.43 2017/11/06 21:16:04 joerg Exp $	*/
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.42 2017/08/10 19:03:26 joerg Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.43 2017/11/06 21:16:04 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -257,9 +257,6 @@ _rtld_relocate_plt_lazy(Obj_Entry *obj)
 {
 	const Elf_Rel *rel;
 
-	if (!obj->relocbase)
-		return 0;
-
 	for (rel = obj->pltrellim; rel-- > obj->pltrel; ) {
 		Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
 

Index: src/libexec/ld.elf_so/arch/i386/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/i386/mdreloc.c:1.39 src/libexec/ld.elf_so/arch/i386/mdreloc.c:1.40
--- src/libexec/ld.elf_so/arch/i386/mdreloc.c:1.39	Thu Aug 10 19:03:26 2017
+++ src/libexec/ld.elf_so/arch/i386/mdreloc.c	Mon Nov  6 21:16:04 2017
@@ -1,8 +1,8 @@
-/*	$NetBSD: mdreloc.c,v 1.39 2017/08/10 19:03:26 joerg Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.40 2017/11/06 21:16:04 joerg Exp $	*/
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.39 2017/08/10 19:03:26 joerg Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.40 2017/11/06 21:16:04 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -198,9 +198,6 @@ _rtld_relocate_plt_lazy(Obj_Entry *obj)
 {
 	const Elf_Rel *rel;
 
-	if 

CVS commit: src

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 21:16:04 UTC 2017

Modified Files:
src/libexec/ld.elf_so: rtld.c
src/libexec/ld.elf_so/arch/arm: mdreloc.c
src/libexec/ld.elf_so/arch/i386: mdreloc.c
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c
src/libexec/ld.elf_so/arch/x86_64: mdreloc.c
src/tests/libexec/ld.elf_so: t_ifunc.c

Log Message:
init/fini for the main program is handled by crt0.o, so ifunc handling
is skipped right now as it iterates the same list. Don't repeat that
mistake and explicitly take care of it in the dynamic linker.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.42 -r1.43 src/libexec/ld.elf_so/arch/arm/mdreloc.c
cvs rdiff -u -r1.39 -r1.40 src/libexec/ld.elf_so/arch/i386/mdreloc.c
cvs rdiff -u -r1.65 -r1.66 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
cvs rdiff -u -r1.45 -r1.46 src/libexec/ld.elf_so/arch/x86_64/mdreloc.c
cvs rdiff -u -r1.4 -r1.5 src/tests/libexec/ld.elf_so/t_ifunc.c

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



CVS commit: src/share/man/man4

2017-11-06 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  6 21:11:17 UTC 2017

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

Log Message:
Add documentation for clickpad mouse button emulation.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/pms.4

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



CVS commit: src/share/man/man4

2017-11-06 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  6 21:11:17 UTC 2017

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

Log Message:
Add documentation for clickpad mouse button emulation.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/pms.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/pms.4
diff -u src/share/man/man4/pms.4:1.28 src/share/man/man4/pms.4:1.29
--- src/share/man/man4/pms.4:1.28	Wed Sep  6 17:15:54 2017
+++ src/share/man/man4/pms.4	Mon Nov  6 21:11:17 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.28 2017/09/06 17:15:54 wiz Exp $
+.\" $NetBSD: pms.4,v 1.29 2017/11/06 21:11:17 blymn Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -153,6 +153,27 @@ event (default 32).
 .It Dv hw.synaptics.movement_threshold
 Movements of less than this value (in Synaptics coordinates) are
 ignored (default 4).
+.It Dv hw.synaptics.button_boundary
+Sets the top edge of the button emulation region on a clickpad.
+Since a clickpad only reports left clicks this region is used to emulate
+two or three buttons by detecting the finger location and reporting
+either a button 2 or button 3 click iff the the click occurs within
+the region bounded by button_boundary and the bottom of the clickpad.
+.It Dv hw.synaptics.button3_edge
+This defines the left hand edige of the button 3 region.
+If a click occurs in the region bounded by button_boundary, button3_edge
+the right hand edge of the click pad then the click will be reported
+as a button3 event.  Button 3 emulation can be disabled by setting
+button3_edge to the right hand edge of the clickpad.
+.It Dv hw.synaptics.button2_edge
+This defines the left hand edge of the button 2 region.
+The button 2 region is bounded by button2_edge, button3_edge and
+button_boundary.
+If a click occurs in this region then it will be reported as a button2
+event.
+For completeness, the region between the left hand side of the clickpad,
+button2_edge and button_boundary will be reported as a button1 event
+as will any clicks htat occur outside the button emulation region.
 .El
 .Pp
 The following



CVS commit: src/sys/dev/pckbport

2017-11-06 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  6 21:07:17 UTC 2017

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h

Log Message:
Add two finger support and middle/right button emulation.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/synapticsreg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pckbport/synapticsvar.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.33 src/sys/dev/pckbport/synaptics.c:1.34
--- src/sys/dev/pckbport/synaptics.c:1.33	Wed Mar  4 22:58:35 2015
+++ src/sys/dev/pckbport/synaptics.c	Mon Nov  6 21:07:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.33 2015/03/04 22:58:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.34 2017/11/06 21:07:17 blymn Exp $");
 
 #include 
 #include 
@@ -80,6 +80,10 @@ struct synaptics_packet {
 	signed short	sp_y;
 	u_char	sp_z;		/* Z (pressure) */
 	u_char	sp_w;		/* W (contact patch width) */
+	signed short	sp_sx;	/* Secondary finger unscaled absolute */
+/* X/Y coordinates */
+	signed short	sp_xy;
+	u_char	sp_finger;	/* 0 for primary, 1 for secondary */
 	char	sp_left;	/* Left mouse button status */
 	char	sp_right;	/* Right mouse button status */
 	char	sp_middle;	/* Middle button status (possibly emulated) */
@@ -105,6 +109,9 @@ static int synaptics_edge_bottom = SYNAP
 static int synaptics_edge_motion_delta = 32;
 static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5;
 static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10;
+static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM + 720;
+static int synaptics_button2 = SYNAPTICS_EDGE_LEFT + (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
+static int synaptics_button3 = SYNAPTICS_EDGE_LEFT + 2 * (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
 static int synaptics_two_fingers_emul = 0;
 static int synaptics_scale_x = 16;
 static int synaptics_scale_y = 16;
@@ -113,6 +120,9 @@ static int synaptics_max_speed_y = 32;
 static int synaptics_movement_threshold = 4;
 
 /* Sysctl nodes. */
+static int synaptics_button_boundary_nodenum;
+static int synaptics_button2_nodenum;
+static int synaptics_button3_nodenum;
 static int synaptics_up_down_emul_nodenum;
 static int synaptics_up_down_motion_delta_nodenum;
 static int synaptics_gesture_move_nodenum;
@@ -131,11 +141,56 @@ static int synaptics_max_speed_x_nodenum
 static int synaptics_max_speed_y_nodenum;
 static int synaptics_movement_threshold_nodenum;
 
+static int
+synaptics_poll_cmd(struct pms_softc *psc, ...)
+{
+	u_char cmd[4];
+	size_t i;
+	va_list ap;
+
+	va_start(ap, psc);
+
+	for (i = 0; i < __arraycount(cmd); i++)
+		if ((cmd[i] = (u_char)va_arg(ap, int)) == 0)
+			break;
+	va_end(ap);
+
+	int res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, i, 0,
+	NULL, 0);
+	if (res)
+		aprint_error_dev(psc->sc_dev, "command error %#x\n", cmd[0]);
+	return res;
+}
+
+static int
+synaptics_poll_reset(struct pms_softc *psc)
+{
+	u_char resp[2];
+	int res;
+
+	u_char cmd[1] = { PMS_RESET };
+	res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2,
+	resp, 1);
+	aprint_debug_dev(psc->sc_dev, "reset %d 0x%02x 0x%02x\n",
+	res, resp[0], resp[1]);
+	return res;
+}
+
+static int
+synaptics_poll_status(struct pms_softc *psc, u_char slice, u_char resp[3])
+{
+	u_char cmd[1] = { PMS_SEND_DEV_STATUS };
+	int res = pms_sliced_command(psc->sc_kbctag, psc->sc_kbcslot, slice);
+
+	return res | pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot,
+	cmd, 1, 3, resp, 0);
+}
+
 static void
 pms_synaptics_probe_extended(struct pms_softc *psc)
 {
 	struct synaptics_softc *sc = >u.synaptics;
-	u_char cmd[1], resp[3];
+	u_char resp[3];
 	int res;
 
 	aprint_debug_dev(psc->sc_dev,
@@ -156,11 +211,7 @@ pms_synaptics_probe_extended(struct pms_
 	if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08)
 	>= SYNAPTICS_EXTENDED_QUERY)
 	{
-		res = pms_sliced_command(psc->sc_kbctag,
-		psc->sc_kbcslot, SYNAPTICS_EXTENDED_QUERY);
-		cmd[0] = PMS_SEND_DEV_STATUS;
-		res |= pckbport_poll_cmd(psc->sc_kbctag,
-		psc->sc_kbcslot, cmd, 1, 3, resp, 0);
+		res = synaptics_poll_status(psc, SYNAPTICS_EXTENDED_QUERY, resp);
 		if (res == 0) {
 			int buttons = (resp[1] >> 4);
 			aprint_debug_dev(psc->sc_dev,
@@ -192,11 +243,9 @@ pms_synaptics_probe_extended(struct pms_
 	if (((sc->caps & SYNAPTICS_CAP_EXTNUM) + 0x08) >=
 	SYNAPTICS_CONTINUED_CAPABILITIES)
 	{
-		res = pms_sliced_command(psc->sc_kbctag,
-		psc->sc_kbcslot, 

CVS commit: src/sys/dev/pckbport

2017-11-06 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  6 21:07:17 UTC 2017

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h

Log Message:
Add two finger support and middle/right button emulation.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pckbport/synapticsreg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pckbport/synapticsvar.h

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



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

2017-11-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov  6 21:03:58 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c sunxi_gpio.c sunxi_platform.c

Log Message:
Add support for NextThing GR8.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/sunxi/sunxi_gpio.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/sunxi/sunxi_platform.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun5i_a13_ccu.c
diff -u src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.3 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.4
--- src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.3	Sun Aug 27 17:53:31 2017
+++ src/sys/arch/arm/sunxi/sun5i_a13_ccu.c	Mon Nov  6 21:03:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun5i_a13_ccu.c,v 1.3 2017/08/27 17:53:31 jmcneill Exp $ */
+/* $NetBSD: sun5i_a13_ccu.c,v 1.4 2017/11/06 21:03:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.3 2017/08/27 17:53:31 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.4 2017/11/06 21:03:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -67,6 +67,7 @@ static void sun5i_a13_ccu_attach(device_
 
 static const char * const compatible[] = {
 	"allwinner,sun5i-a13-ccu",
+	"nextthing,gr8-ccu",
 	NULL
 };
 

Index: src/sys/arch/arm/sunxi/sunxi_gpio.c
diff -u src/sys/arch/arm/sunxi/sunxi_gpio.c:1.16 src/sys/arch/arm/sunxi/sunxi_gpio.c:1.17
--- src/sys/arch/arm/sunxi/sunxi_gpio.c:1.16	Wed Oct 11 10:52:54 2017
+++ src/sys/arch/arm/sunxi/sunxi_gpio.c	Mon Nov  6 21:03:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.c,v 1.16 2017/10/11 10:52:54 jmcneill Exp $ */
+/* $NetBSD: sunxi_gpio.c,v 1.17 2017/11/06 21:03:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_soc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.16 2017/10/11 10:52:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.17 2017/11/06 21:03:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -77,6 +77,7 @@ static const struct of_compat_data compa
 #endif
 #ifdef SOC_SUN5I_A13
 	{ "allwinner,sun5i-a13-pinctrl",	(uintptr_t)_a13_padconf },
+	{ "nextthing,gr8-pinctrl",		(uintptr_t)_a13_padconf },
 #endif
 #ifdef SOC_SUN6I_A31
 	{ "allwinner,sun6i-a31-pinctrl",	(uintptr_t)_a31_padconf },

Index: src/sys/arch/arm/sunxi/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.15 src/sys/arch/arm/sunxi/sunxi_platform.c:1.16
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.15	Tue Oct 24 15:06:23 2017
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Mon Nov  6 21:03:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.15 2017/10/24 15:06:23 jmcneill Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.16 2017/11/06 21:03:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.15 2017/10/24 15:06:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.16 2017/11/06 21:03:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -263,6 +263,7 @@ static const struct arm_platform sun5i_p
 };
 
 ARM_PLATFORM(sun5i_a13, "allwinner,sun5i-a13", _platform);
+ARM_PLATFORM(sun5i_gr8, "nextthing,gr8", _platform);
 
 static const struct arm_platform sun6i_platform = {
 	.devmap = sunxi_platform_devmap,



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

2017-11-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov  6 21:03:58 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c sunxi_gpio.c sunxi_platform.c

Log Message:
Add support for NextThing GR8.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/sunxi/sunxi_gpio.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/sunxi/sunxi_platform.c

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



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 19:20:54 UTC 2017

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

Log Message:
handle ppc64


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/elf_machdep.h

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.14 src/sys/arch/powerpc/include/elf_machdep.h:1.15
--- src/sys/arch/powerpc/include/elf_machdep.h:1.14	Sun Nov  5 22:47:48 2017
+++ src/sys/arch/powerpc/include/elf_machdep.h	Mon Nov  6 14:20:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.14 2017/11/06 03:47:48 christos Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.15 2017/11/06 19:20:54 christos Exp $	*/
 
 #ifndef _POWERPC_ELF_MACHDEP_H_
 #define _POWERPC_ELF_MACHDEP_H_
@@ -16,15 +16,14 @@
 #define	ELF32_MACHDEP_ID	EM_PPC
 #define	ELF64_MACHDEP_ID	EM_PPC64
 
-#define KERN_ELFSIZE		32
 
-#ifndef ARCH_ELFSIZE
 #ifdef _LP64
+#define KERN_ELFSIZE		64
 #define ARCH_ELFSIZE		64	/* MD native binary size */
 #else
+#define KERN_ELFSIZE		32
 #define ARCH_ELFSIZE		32	/* MD native binary size */
 #endif
-#endif
 
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 19:20:54 UTC 2017

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

Log Message:
handle ppc64


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/elf_machdep.h

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



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 19:17:43 UTC 2017

Modified Files:
src/sys/arch/mips/include: elf_machdep.h

Log Message:
Handle 64 bit kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mips/include/elf_machdep.h

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



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 19:17:43 UTC 2017

Modified Files:
src/sys/arch/mips/include: elf_machdep.h

Log Message:
Handle 64 bit kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mips/include/elf_machdep.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/mips/include/elf_machdep.h
diff -u src/sys/arch/mips/include/elf_machdep.h:1.19 src/sys/arch/mips/include/elf_machdep.h:1.20
--- src/sys/arch/mips/include/elf_machdep.h:1.19	Sun Nov  5 22:47:47 2017
+++ src/sys/arch/mips/include/elf_machdep.h	Mon Nov  6 14:17:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.19 2017/11/06 03:47:47 christos Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.20 2017/11/06 19:17:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -28,10 +28,11 @@
 #ifndef _MIPS_ELF_MACHDEP_H_
 #define	_MIPS_ELF_MACHDEP_H_
 
-#define	KERN_ELFSIZE		32
 #ifdef _LP64
+#define	KERN_ELFSIZE		64
 #define	ARCH_ELFSIZE		64	/* MD native binary size */
 #else
+#define	KERN_ELFSIZE		32
 #define	ARCH_ELFSIZE		32	/* MD native binary size */
 #endif
 



CVS commit: src/usr.sbin/rtadvd

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 19:12:23 UTC 2017

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

Log Message:
Mark expandm as preserving format strings.


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

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



CVS commit: src/usr.sbin/rtadvd

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 19:12:23 UTC 2017

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

Log Message:
Mark expandm as preserving format strings.


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

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.57 src/usr.sbin/rtadvd/rtadvd.c:1.58
--- src/usr.sbin/rtadvd/rtadvd.c:1.57	Mon Nov  6 15:15:04 2017
+++ src/usr.sbin/rtadvd/rtadvd.c	Mon Nov  6 19:12:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.57 2017/11/06 15:15:04 christos Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.58 2017/11/06 19:12:23 joerg Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -1843,6 +1843,7 @@ ra_timer_update(void *data, struct times
 	   (intmax_t)tm->tv_sec, (intmax_t)tm->tv_nsec);
 }
 
+ __format_arg(3)
 static const char *
 expandm(char *buf, size_t len, const char *fmt)
 {



CVS commit: src/sys/kern

2017-11-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Nov  6 18:41:23 UTC 2017

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

Log Message:
Assert that pool_get failure happens only with PR_NOWAIT.

This would have caught the mistake I made last week leading to null
pointer dereferences all over the place, a mistake which I evidently
poorly scheduled alongside maxv's change to the panic message on x86
for null pointer dereferences.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/subr_pool.c

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



CVS commit: src/sys/kern

2017-11-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Nov  6 18:41:23 UTC 2017

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

Log Message:
Assert that pool_get failure happens only with PR_NOWAIT.

This would have caught the mistake I made last week leading to null
pointer dereferences all over the place, a mistake which I evidently
poorly scheduled alongside maxv's change to the panic message on x86
for null pointer dereferences.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/subr_pool.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_pool.c
diff -u src/sys/kern/subr_pool.c:1.210 src/sys/kern/subr_pool.c:1.211
--- src/sys/kern/subr_pool.c:1.210	Sun Nov  5 07:49:45 2017
+++ src/sys/kern/subr_pool.c	Mon Nov  6 18:41:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.210 2017/11/05 07:49:45 mlelstv Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.211 2017/11/06 18:41:22 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.210 2017/11/05 07:49:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.211 2017/11/06 18:41:22 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -805,6 +805,7 @@ pool_get(struct pool *pp, int flags)
 		pp->pr_nfail++;
 
 		mutex_exit(>pr_lock);
+		KASSERT((flags & (PR_WAITOK|PR_NOWAIT)) == PR_NOWAIT);
 		return (NULL);
 	}
 
@@ -848,6 +849,7 @@ pool_get(struct pool *pp, int flags)
 
 			pp->pr_nfail++;
 			mutex_exit(>pr_lock);
+			KASSERT((flags & (PR_WAITOK|PR_NOWAIT)) == PR_NOWAIT);
 			return (NULL);
 		}
 
@@ -2181,8 +2183,10 @@ pool_cache_get_slow(pool_cache_cpu_t *cc
 
 	object = pool_get(>pc_pool, flags);
 	*objectp = object;
-	if (__predict_false(object == NULL))
+	if (__predict_false(object == NULL)) {
+		KASSERT((flags & (PR_WAITOK|PR_NOWAIT)) == PR_NOWAIT);
 		return false;
+	}
 
 	if (__predict_false((*pc->pc_ctor)(pc->pc_arg, object, flags) != 0)) {
 		pool_put(>pc_pool, object);
@@ -2273,6 +2277,11 @@ pool_cache_get_paddr(pool_cache_t pc, in
 			break;
 	}
 
+	/*
+	 * We would like to KASSERT(object || (flags & PR_NOWAIT)), but
+	 * pool_cache_get can fail even in the PR_WAITOK case, if the
+	 * constructor fails.
+	 */
 	return object;
 }
 



CVS commit: src/sys/sys

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 17:56:25 UTC 2017

Modified Files:
src/sys/sys: exec_elf.h kobj.h ksyms.h

Log Message:
Since _RUMPKERNEL is really userland code it needs ARCH_ELFSIZE,
not KERN_ELFSIZE, make it so!


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/sys/exec_elf.h
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/kobj.h
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/ksyms.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/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.157 src/sys/sys/exec_elf.h:1.158
--- src/sys/sys/exec_elf.h:1.157	Sun Nov  5 22:50:33 2017
+++ src/sys/sys/exec_elf.h	Mon Nov  6 12:56:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.157 2017/11/06 03:50:33 christos Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.158 2017/11/06 17:56:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -1051,12 +1051,11 @@ struct netbsd_elfcore_procinfo {
 
 
 #if !defined(ELFSIZE)
-#if defined(_KERNEL) && defined(KERN_ELFSIZE)
-#define ELFSIZE KERN_ELFSIZE
-#endif
-#if !defined(_KERNEL) && defined(ARCH_ELFSIZE)
-#define ELFSIZE ARCH_ELFSIZE
-#endif
+# if defined(_RUMPKERNEL) || !defined(_KERNEL)
+#  define ELFSIZE ARCH_ELFSIZE
+# else
+#  define ELFSIZE KERN_ELFSIZE
+# endif
 #endif
 
 #if defined(ELFSIZE)

Index: src/sys/sys/kobj.h
diff -u src/sys/sys/kobj.h:1.19 src/sys/sys/kobj.h:1.20
--- src/sys/sys/kobj.h:1.19	Sun Nov  5 22:50:13 2017
+++ src/sys/sys/kobj.h	Mon Nov  6 12:56:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj.h,v 1.19 2017/11/06 03:50:13 christos Exp $	*/
+/*	$NetBSD: kobj.h,v 1.20 2017/11/06 17:56:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #ifndef _SYS_KOBJ_H_
 #define	_SYS_KOBJ_H_
 
-#ifndef ELFSIZE
+#if !defined(ELFSIZE) && !defined(_RUMPKERNEL)
 #define ELFSIZE KERN_ELFSIZE
 #endif
 

Index: src/sys/sys/ksyms.h
diff -u src/sys/sys/ksyms.h:1.36 src/sys/sys/ksyms.h:1.37
--- src/sys/sys/ksyms.h:1.36	Sun Nov  5 22:50:13 2017
+++ src/sys/sys/ksyms.h	Mon Nov  6 12:56:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ksyms.h,v 1.36 2017/11/06 03:50:13 christos Exp $	*/
+/*	$NetBSD: ksyms.h,v 1.37 2017/11/06 17:56:25 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2003 Anders Magnusson (ra...@ludd.luth.se).
@@ -30,7 +30,7 @@
 #ifndef _SYS_KSYMS_H_
 #define _SYS_KSYMS_H_
 
-#ifndef ELFSIZE
+#if !defined(ELFSIZE) && !defined(_RUMPKERNEL)
 #define ELFSIZE KERN_ELFSIZE
 #endif
 #include 



CVS commit: src/sys/sys

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 17:56:25 UTC 2017

Modified Files:
src/sys/sys: exec_elf.h kobj.h ksyms.h

Log Message:
Since _RUMPKERNEL is really userland code it needs ARCH_ELFSIZE,
not KERN_ELFSIZE, make it so!


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/sys/exec_elf.h
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/kobj.h
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/ksyms.h

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



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 17:32:53 UTC 2017

Modified Files:
src/tests/lib/libc/stdio: t_fopen.c

Log Message:
add a symlink test


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_fopen.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/stdio/t_fopen.c
diff -u src/tests/lib/libc/stdio/t_fopen.c:1.3 src/tests/lib/libc/stdio/t_fopen.c:1.4
--- src/tests/lib/libc/stdio/t_fopen.c:1.3	Wed Sep 14 10:34:37 2011
+++ src/tests/lib/libc/stdio/t_fopen.c	Mon Nov  6 12:32:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fopen.c,v 1.3 2011/09/14 14:34:37 martin Exp $ */
+/*	$NetBSD: t_fopen.c,v 1.4 2017/11/06 17:32:53 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fopen.c,v 1.3 2011/09/14 14:34:37 martin Exp $");
+__RCSID("$NetBSD: t_fopen.c,v 1.4 2017/11/06 17:32:53 christos Exp $");
 
 #include 
 #include 
@@ -336,6 +336,43 @@ ATF_TC_BODY(fopen_regular, tc)
 	}
 }
 
+static char linkpath[] = "symlink";
+
+ATF_TC_WITH_CLEANUP(fopen_symlink);
+ATF_TC_HEAD(fopen_symlink, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test fopen(3) with 'l' mode");
+}
+
+ATF_TC_BODY(fopen_symlink, tc)
+{
+	static const char *mode[] = { "rl", "r+l", "wl", "w+l", "al", "a+l" };
+	size_t j;
+	FILE *f;
+
+	ATF_CHECK(symlink("/dev/null", linkpath) != -1);
+
+	for (j = 0; j < __arraycount(mode); j++) {
+
+		errno = 0;
+		f = fopen(linkpath, mode[j]);
+
+		if (f == NULL && errno == EFTYPE)
+			continue;
+
+		if (f != NULL)
+			(void)fclose(f);
+
+		atf_tc_fail_nonfatal("opened %s as %s", linkpath, mode[j]);
+	}
+	ATF_REQUIRE(unlink(linkpath) == 0);
+}
+
+ATF_TC_CLEANUP(fopen_symlink, tc)
+{
+	(void)unlink(linkpath);
+}
+
 ATF_TC_WITH_CLEANUP(fopen_seek);
 ATF_TC_HEAD(fopen_seek, tc)
 {
@@ -435,6 +472,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, fopen_mode);
 	ATF_TP_ADD_TC(tp, fopen_perm);
 	ATF_TP_ADD_TC(tp, fopen_regular);
+	ATF_TP_ADD_TC(tp, fopen_symlink);
 	ATF_TP_ADD_TC(tp, fopen_seek);
 	ATF_TP_ADD_TC(tp, freopen_std);
 



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 17:32:53 UTC 2017

Modified Files:
src/tests/lib/libc/stdio: t_fopen.c

Log Message:
add a symlink test


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_fopen.c

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



Re: CVS commit: src/usr.bin/kdump

2017-11-06 Thread Christos Zoulas
In article <20171106163453.gb28...@britannica.bec.de>,
Joerg Sonnenberger   wrote:
>On Sun, Nov 05, 2017 at 12:44:29PM -0500, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sun Nov  5 17:44:29 UTC 2017
>> 
>> Modified Files:
>>  src/usr.bin/kdump: mkioctls
>> 
>> Log Message:
>> deal with the stdbool.h mess defining bool in  and 
>> and then xf86Opt.h wanting to define a struct field called bool.
>
>I'd prefer to fix the latter.

You mean change xf86Opt.h and rename 'bool' to 'xbool' or something else?
That would probably require touching a lot of other X client code, and
things will stop compiling out of the box for NetBSD. I think upstream
should fix it first :-)

christos



Re: CVS commit: src/usr.bin/kdump

2017-11-06 Thread Joerg Sonnenberger
On Sun, Nov 05, 2017 at 12:44:29PM -0500, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sun Nov  5 17:44:29 UTC 2017
> 
> Modified Files:
>   src/usr.bin/kdump: mkioctls
> 
> Log Message:
> deal with the stdbool.h mess defining bool in  and 
> and then xf86Opt.h wanting to define a struct field called bool.

I'd prefer to fix the latter.

Joerg


CVS commit: src/sys/arch/xen

2017-11-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Nov  6 15:27:09 UTC 2017

Modified Files:
src/sys/arch/xen/x86: xen_ipi.c
src/sys/arch/xen/xen: clock.c if_xennet_xenbus.c xbd_xenbus.c
xbdback_xenbus.c xencons.c xennetback_xenbus.c
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
Switch XEN drivers to use intr_establish_xname()/intr_disestablish()

This completes the API transition.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/xen/xen/xennetback_xenbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/xenbus/xenbus_comms.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/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.22 src/sys/arch/xen/x86/xen_ipi.c:1.23
--- src/sys/arch/xen/x86/xen_ipi.c:1.22	Tue Aug 15 09:16:59 2017
+++ src/sys/arch/xen/x86/xen_ipi.c	Mon Nov  6 15:27:09 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.23 2017/11/06 15:27:09 cherry Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.23 2017/11/06 15:27:09 cherry Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.23 2017/11/06 15:27:09 cherry Exp $");
 
 #include 
 
@@ -78,12 +78,17 @@ static void (*ipifunc[XEN_NIPIS])(struct
 	xen_ipi_generic,
 };
 
-static void
-xen_ipi_handler(struct cpu_info *ci, struct intrframe *regs)
+static int
+xen_ipi_handler(void *arg)
 {
 	uint32_t pending;
 	int bit;
+	struct cpu_info *ci;
+	struct intrframe *regs;
 
+	ci = curcpu();
+	regs = arg;
+	
 	pending = atomic_swap_32(>ci_ipis, 0);
 
 	KDASSERT((pending >> XEN_NIPIS) == 0);
@@ -98,6 +103,8 @@ xen_ipi_handler(struct cpu_info *ci, str
 			/* NOTREACHED */
 		}
 	}
+
+	return 0;
 }
 
 /* Must be called once for every cpu that expects to send/recv ipis */
@@ -118,9 +125,9 @@ xen_ipi_init(void)
 
 	KASSERT(evtchn != -1 && evtchn < NR_EVENT_CHANNELS);
 
-	if (0 != event_set_handler(evtchn, (int (*)(void *))xen_ipi_handler,
-   ci, IPL_HIGH, "ipi")) {
-		panic("event_set_handler(...) KPI violation\n");
+	if(intr_establish_xname(0, _pic, evtchn, IST_LEVEL, IPL_HIGH,
+		xen_ipi_handler, ci, true, "ipi") == NULL) {
+		panic("%s: unable to register ipi handler\n", __func__);
 		/* NOTREACHED */
 	}
 

Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.64 src/sys/arch/xen/xen/clock.c:1.65
--- src/sys/arch/xen/xen/clock.c:1.64	Sun Jun 12 09:08:09 2016
+++ src/sys/arch/xen/xen/clock.c	Mon Nov  6 15:27:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.64 2016/06/12 09:08:09 jnemeth Exp $	*/
+/*	$NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $	*/
 
 /*
  *
@@ -29,7 +29,7 @@
 #include "opt_xen.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.64 2016/06/12 09:08:09 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $");
 
 #include 
 #include 
@@ -49,7 +49,8 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
 #include 
 #include 
 
-static int xen_timer_handler(void *, struct intrframe *);
+static int xen_timer_handler(void *);
+static struct intrhand *ih;
 
 /* A timecounter: Xen system_time extrapolated with a TSC. */
 u_int xen_get_timecount(struct timecounter*);
@@ -509,7 +510,7 @@ xen_suspendclocks(struct cpu_info *ci)
 	KASSERT(evtch != -1);
 
 	hypervisor_mask_event(evtch);
-	event_remove_handler(evtch, (int (*)(void *))xen_timer_handler, ci);
+	intr_disestablish(ih);
 
 	aprint_verbose("Xen clock: removed event channel %d\n", evtch);
 }
@@ -522,8 +523,11 @@ xen_resumeclocks(struct cpu_info *ci)
 	evtch = bind_virq_to_evtch(VIRQ_TIMER);
 	KASSERT(evtch != -1);
 
-	event_set_handler(evtch, (int (*)(void *))xen_timer_handler,
-	ci, IPL_CLOCK, "clock");
+	ih = intr_establish_xname(0, _pic, evtch, IST_LEVEL, IPL_CLOCK,
+	xen_timer_handler, ci, true, "clock");
+
+	KASSERT(ih != NULL);
+
 	hypervisor_enable_event(evtch);
 
 	aprint_verbose("Xen clock: using event channel %d\n", evtch);
@@ -531,11 +535,12 @@ xen_resumeclocks(struct cpu_info *ci)
 
 /* ARGSUSED */
 static int
-xen_timer_handler(void *arg, struct intrframe *regs)
+xen_timer_handler(void *arg)
 {
 	int64_t delta;
 	struct cpu_info *ci = curcpu();
-	KASSERT(arg == ci);
+	struct intrframe *regs = arg;
+
 	int err;
 again:
 	

CVS commit: src/sys/arch/xen

2017-11-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Nov  6 15:27:09 UTC 2017

Modified Files:
src/sys/arch/xen/x86: xen_ipi.c
src/sys/arch/xen/xen: clock.c if_xennet_xenbus.c xbd_xenbus.c
xbdback_xenbus.c xencons.c xennetback_xenbus.c
src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
Switch XEN drivers to use intr_establish_xname()/intr_disestablish()

This completes the API transition.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/xen/xen/xennetback_xenbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/xenbus/xenbus_comms.c

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



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

2017-11-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Nov  6 15:21:23 UTC 2017

Modified Files:
src/sys/arch/xen/conf: files.xen

Log Message:
Summary: xen/x86/intr.c has been retired. Don't try to build it.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/xen/conf/files.xen

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/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.162 src/sys/arch/xen/conf/files.xen:1.163
--- src/sys/arch/xen/conf/files.xen:1.162	Sat Nov  4 15:24:42 2017
+++ src/sys/arch/xen/conf/files.xen	Mon Nov  6 15:21:23 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.162 2017/11/04 15:24:42 cherry Exp $
+#	$NetBSD: files.xen,v 1.163 2017/11/06 15:21:23 cherry Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -139,7 +139,6 @@ file	arch/x86/x86/bus_space.c	machdep
 file	arch/xen/x86/consinit.c		machdep
 file	arch/x86/x86/identcpu.c		machdep
 file	arch/xen/x86/pintr.c		machdep & dom0ops
-file	arch/xen/x86/intr.c		machdep
 file	arch/xen/x86/xen_ipi.c		multiprocessor
 file	arch/x86/x86/intr.c		machdep
 file	arch/x86/x86/idt.c		machdep



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

2017-11-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Nov  6 15:21:23 UTC 2017

Modified Files:
src/sys/arch/xen/conf: files.xen

Log Message:
Summary: xen/x86/intr.c has been retired. Don't try to build it.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/usr.sbin/rtadvd

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 15:15:04 UTC 2017

Modified Files:
src/usr.sbin/rtadvd: advcap.c config.c dump.c if.c rrenum.c rtadvd.8
rtadvd.c timer.c
Added Files:
src/usr.sbin/rtadvd: logit.h

Log Message:
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/rtadvd/advcap.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/rtadvd/config.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/rtadvd/dump.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/rtadvd/if.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/rtadvd/logit.h
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rtadvd/rrenum.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/rtadvd/rtadvd.8
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/rtadvd/rtadvd.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rtadvd/timer.c

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

Modified files:

Index: src/usr.sbin/rtadvd/advcap.c
diff -u src/usr.sbin/rtadvd/advcap.c:1.16 src/usr.sbin/rtadvd/advcap.c:1.17
--- src/usr.sbin/rtadvd/advcap.c:1.16	Wed Nov 11 02:48:41 2015
+++ src/usr.sbin/rtadvd/advcap.c	Mon Nov  6 10:15:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: advcap.c,v 1.16 2015/11/11 07:48:41 ozaki-r Exp $	*/
+/*	$NetBSD: advcap.c,v 1.17 2017/11/06 15:15:04 christos Exp $	*/
 /*	$KAME: advcap.c,v 1.11 2003/05/19 09:46:50 keiichi Exp $	*/
 
 /*
@@ -48,6 +48,8 @@
 #include "pathnames.h"
 #include "prog_ops.h"
 
+#include "logit.h"
+
 #ifndef __UNCONST
 #define __UNCONST(a)		((void *)(unsigned long)(const void *)(a))
 #endif
@@ -137,7 +139,7 @@ getent(char *bp, char *name, char *cp)
 		tf = open(RM = cp, O_RDONLY);
 	}
 	if (tf < 0) {
-		syslog(LOG_INFO, "<%s> open: %m", __func__);
+		logit(LOG_INFO, "<%s> open: %m", __func__);
 		return (-2);
 	}
 	for (;;) {

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.36 src/usr.sbin/rtadvd/config.c:1.37
--- src/usr.sbin/rtadvd/config.c:1.36	Mon Feb 27 00:41:36 2017
+++ src/usr.sbin/rtadvd/config.c	Mon Nov  6 10:15:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.36 2017/02/27 05:41:36 ozaki-r Exp $	*/
+/*	$NetBSD: config.c,v 1.37 2017/11/06 15:15:04 christos Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -67,6 +67,7 @@
 #include "timer.h"
 #include "if.h"
 #include "config.h"
+#include "logit.h"
 #include "prog_ops.h"
 
 #ifndef __arraycount
@@ -180,24 +181,24 @@ getconfig(const char *intface, int exith
 	do {\
 		p = calloc(1, sizeof(*p));\
 		if (p == NULL) {	\
-			syslog(LOG_ERR, "<%s> calloc failed: %m",	\
+			logit(LOG_ERR, "<%s> calloc failed: %m",	\
 			__func__);	\
 			goto errexit;	\
 		}			\
 	} while(/*CONSTCOND*/0)
 
 	if (if_nametoindex(intface) == 0) {
-		syslog(LOG_INFO, "<%s> interface %s not found, ignoring",
+		logit(LOG_INFO, "<%s> interface %s not found, ignoring",
 		   __func__, intface);
 		return;
 	}
 
-	syslog(LOG_DEBUG, "<%s> loading configuration for interface %s",
+	logit(LOG_DEBUG, "<%s> loading configuration for interface %s",
 	   __func__, intface);
 
 	if ((stat = agetent(tbuf, intface)) <= 0) {
 		memset(tbuf, 0, sizeof(tbuf));
-		syslog(LOG_INFO,
+		logit(LOG_INFO,
 		   "<%s> %s isn't defined in the configuration file"
 		   " or the configuration file doesn't exist."
 		   " Treat it as default",
@@ -223,7 +224,7 @@ getconfig(const char *intface, int exith
 		tmp->advlinkopt = 1;
 	if (tmp->advlinkopt) {
 		if ((tmp->sdl = if_nametosdl(intface)) == NULL) {
-			syslog(LOG_ERR,
+			logit(LOG_ERR,
 			   "<%s> can't get information of %s",
 			   __func__, intface);
 			goto errexit;
@@ -232,7 +233,7 @@ getconfig(const char *intface, int exith
 	} else {
 		tmp->ifindex = if_nametoindex(intface);
 		if (tmp->ifindex == 0) {
-			syslog(LOG_ERR,
+			logit(LOG_ERR,
 			   "<%s> can't get information of %s",
 			   __func__, intface);
 			goto errexit;
@@ -242,7 +243,7 @@ getconfig(const char *intface, int exith
 	strlcpy(tmp->ifname, intface, sizeof(tmp->ifname));
 	if ((tmp->phymtu = if_getmtu(intface)) == 0) {
 		tmp->phymtu = IPV6_MMTU;
-		syslog(LOG_WARNING,
+		logit(LOG_WARNING,
 		   "<%s> can't get interface mtu of %s. Treat as %d",
 		   __func__, intface, IPV6_MMTU);
 	}
@@ -252,7 +253,7 @@ getconfig(const char *intface, int exith
 	 */
 	MAYHAVE(val, "maxinterval", DEF_MAXRTRADVINTERVAL);
 	if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) {
-		syslog(LOG_ERR,
+		logit(LOG_ERR,
 		   "<%s> maxinterval (%d) on %s is invalid "
 		   "(must be between %u and %u)", __func__, val,
 		   intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL);
@@ -261,7 +262,7 @@ getconfig(const char *intface, int exith
 	tmp->maxinterval = val;
 	MAYHAVE(val, "mininterval", tmp->maxinterval/3);
 	if (val < MIN_MININTERVAL || val > (tmp->maxinterval 

CVS commit: src/usr.sbin/rtadvd

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 15:15:04 UTC 2017

Modified Files:
src/usr.sbin/rtadvd: advcap.c config.c dump.c if.c rrenum.c rtadvd.8
rtadvd.c timer.c
Added Files:
src/usr.sbin/rtadvd: logit.h

Log Message:
Change the meaning of the 'D' flag to print errors to stderr instead of
syslog(3) and exit if poll(2) fails (intended to be used with unit-tests).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/rtadvd/advcap.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/rtadvd/config.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/rtadvd/dump.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/rtadvd/if.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/rtadvd/logit.h
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rtadvd/rrenum.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/rtadvd/rtadvd.8
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/rtadvd/rtadvd.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rtadvd/timer.c

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



CVS commit: src/lib/libc/stdlib

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 14:26:03 UTC 2017

Modified Files:
src/lib/libc/stdlib: atexit.c

Log Message:
Assert that __cxa_atexit is not used with NULL as DSO. Don't use
__cxa_atexit directly from atexit, they have different behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/stdlib/atexit.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/libc/stdlib/atexit.c
diff -u src/lib/libc/stdlib/atexit.c:1.31 src/lib/libc/stdlib/atexit.c:1.32
--- src/lib/libc/stdlib/atexit.c:1.31	Thu Nov  2 19:39:33 2017
+++ src/lib/libc/stdlib/atexit.c	Mon Nov  6 14:26:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: atexit.c,v 1.31 2017/11/02 19:39:33 kamil Exp $	*/
+/*	$NetBSD: atexit.c,v 1.32 2017/11/06 14:26:03 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: atexit.c,v 1.31 2017/11/02 19:39:33 kamil Exp $");
+__RCSID("$NetBSD: atexit.c,v 1.32 2017/11/06 14:26:03 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -142,12 +142,12 @@ __aeabi_atexit(void *arg, void (*func)(v
 int
 __aeabi_atexit(void *arg, void (*func)(void *), void *dso)
 {
-	return __cxa_atexit(func, arg, dso);
+	return (__cxa_atexit(func, arg, dso));
 }
 #endif
 
-int
-__cxa_atexit(void (*func)(void *), void *arg, void *dso)
+static int
+__cxa_atexit_internal(void (*func)(void *), void *arg, void *dso)
 {
 	struct atexit_handler *ah;
 
@@ -172,6 +172,13 @@ __cxa_atexit(void (*func)(void *), void 
 	return (0);
 }
 
+int
+__cxa_atexit(void (*func)(void *), void *arg, void *dso)
+{
+	_DIAGASSERT(dso != NULL);
+	return (__cxa_atexit_internal(func, arg, dso));
+}
+
 /*
  * Run the list of atexit handlers.  If dso is NULL, run all of them,
  * otherwise run only those matching the specified dso.
@@ -255,5 +262,5 @@ int
 atexit(void (*func)(void))
 {
 
-	return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
+	return (__cxa_atexit_internal((void (*)(void *))func, NULL, NULL));
 }



CVS commit: src/lib/libc/stdlib

2017-11-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov  6 14:26:03 UTC 2017

Modified Files:
src/lib/libc/stdlib: atexit.c

Log Message:
Assert that __cxa_atexit is not used with NULL as DSO. Don't use
__cxa_atexit directly from atexit, they have different behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/stdlib/atexit.c

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



CVS commit: src/tests/net/ndp

2017-11-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Nov  6 10:51:40 UTC 2017

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Kill rtadvd surely even if the tests fail in the middle

It may help PR bin/52701.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/net/ndp/t_ra.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/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.29 src/tests/net/ndp/t_ra.sh:1.30
--- src/tests/net/ndp/t_ra.sh:1.29	Thu Jun 22 09:56:48 2017
+++ src/tests/net/ndp/t_ra.sh	Mon Nov  6 10:51:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.29 2017/06/22 09:56:48 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.30 2017/11/06 10:51:40 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -85,6 +85,34 @@ wait_term()
 	return 0
 }
 
+kill_rtadvd()
+{
+	local pidfile=$1
+
+	kill -KILL `cat $pidfile`
+	rm -f $pidfile
+}
+
+terminate_rtadvd()
+{
+	local pidfile=$1
+	local n=5
+
+	if [ ! -f $pidfile ]; then
+		return
+	fi
+
+	kill -TERM `cat $pidfile`
+	while [ -f $pidfile ]; do
+		n=$((n - 1))
+		if [ $n = 0 ]; then
+			kill_rtadvd $pidfile
+			break
+		fi
+		sleep 0.2
+	done
+}
+
 create_rtadvdconfig()
 {
 
@@ -203,8 +231,7 @@ ra_basic_body()
 	atf_check -s exit:0 -o not-match:'fc00:1:' rump.ifconfig shmif0 inet6
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
+	terminate_rtadvd $PIDFILE
 
 	export RUMP_SERVER=${RUMPCLI}
 	atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
@@ -215,8 +242,7 @@ ra_basic_body()
 
 	check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
+	terminate_rtadvd $PIDFILE
 
 	rump_server_destroy_ifaces
 }
@@ -224,12 +250,8 @@ ra_basic_body()
 ra_basic_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
 	cleanup
 }
 
@@ -267,7 +289,7 @@ ra_flush_prefix_entries_body()
 
 	# Terminate rtadvd to prevent new RA messages from coming
 	# Note that ifconfig down; kill -TERM doesn't work
-	kill -KILL `cat ${PIDFILE}`
+	kill_rtadvd $PIDFILE
 
 	# Flush all the entries in the prefix list
 	atf_check -s exit:0 rump.ndp -P
@@ -288,6 +310,7 @@ ra_flush_prefix_entries_cleanup()
 {
 
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
 	cleanup
 }
 
@@ -325,7 +348,7 @@ ra_flush_defrouter_entries_body()
 
 	# Terminate rtadvd to prevent new RA messages from coming
 	# Note that ifconfig down; kill -TERM doesn't work
-	kill -KILL `cat ${PIDFILE}`
+	kill_rtadvd $PIDFILE
 
 	# Flush all the entries in the default router list
 	atf_check -s exit:0 rump.ndp -R
@@ -345,6 +368,7 @@ ra_flush_defrouter_entries_cleanup()
 {
 
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
 	cleanup
 }
 
@@ -384,8 +408,7 @@ ra_delete_address_body()
 	$(rump.ifconfig shmif0 |awk '/AUTOCONF/ {print $2}') delete
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
+	terminate_rtadvd $PIDFILE
 
 	rump_server_destroy_ifaces
 }
@@ -393,12 +416,8 @@ ra_delete_address_body()
 ra_delete_address_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
 	cleanup
 }
 
@@ -444,10 +463,8 @@ ra_multiple_routers_body()
 	atf_check_equal $n 2
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE3}`
-	wait_term ${PIDFILE3}
+	terminate_rtadvd $PIDFILE
+	terminate_rtadvd $PIDFILE3
 
 	rump_server_destroy_ifaces
 }
@@ -455,16 +472,9 @@ ra_multiple_routers_body()
 ra_multiple_routers_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-	if [ -f ${PIDFILE3} ]; then
-		kill -TERM `cat ${PIDFILE3}`
-		wait_term ${PIDFILE3}
-	fi
-
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
+	terminate_rtadvd $PIDFILE3
 	cleanup
 }
 
@@ -510,10 +520,8 @@ ra_multiple_routers_single_prefix_body()
 	atf_check_equal $n 1
 	unset RUMP_SERVER
 
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
-	wait_term ${PIDFILE}
-	atf_check -s exit:0 kill -TERM `cat ${PIDFILE1_2}`
-	wait_term ${PIDFILE1_2}
+	terminate_rtadvd $PIDFILE
+	terminate_rtadvd $PIDFILE1_2
 
 	rump_server_destroy_ifaces
 }
@@ -521,16 +529,9 @@ ra_multiple_routers_single_prefix_body()
 ra_multiple_routers_single_prefix_cleanup()
 {
 
-	if [ -f ${PIDFILE} ]; then
-		kill -TERM `cat ${PIDFILE}`
-		wait_term ${PIDFILE}
-	fi
-	if [ -f ${PIDFILE1_2} ]; then
-		kill -TERM `cat ${PIDFILE1_2}`
-		wait_term ${PIDFILE1_2}
-	fi
-
 	$DEBUG && dump
+	terminate_rtadvd $PIDFILE
+	terminate_rtadvd $PIDFILE1_2
 	cleanup
 }
 
@@ -588,12 +589,9 @@ ra_multiple_routers_maxifprefixes_body()
 	# TODO check other conditions
 	unset 

CVS commit: src/tests/net/ndp

2017-11-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Nov  6 10:51:40 UTC 2017

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Kill rtadvd surely even if the tests fail in the middle

It may help PR bin/52701.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/net/ndp/t_ra.sh

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



CVS commit: [netbsd-8] src/doc

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:40:43 UTC 2017

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

Log Message:
338-341, 343, 344, 346-348


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

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



CVS commit: [netbsd-8] src/doc

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:40:43 UTC 2017

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

Log Message:
338-341, 343, 344, 346-348


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.73 -r1.1.2.74 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.73 src/doc/CHANGES-8.0:1.1.2.74
--- src/doc/CHANGES-8.0:1.1.2.73	Thu Nov  2 21:41:35 2017
+++ src/doc/CHANGES-8.0	Mon Nov  6 10:40:42 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.73 2017/11/02 21:41:35 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.74 2017/11/06 10:40:42 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -6639,3 +6639,95 @@ sys/uvm/uvm_mmap.c1.167
 	made processes stuck.
 	[christos, ticket #336]
 
+external/bsd/nvi/dist/common/recover.c		1.6-1.9
+external/bsd/nvi/usr.bin/recover/virecover	1.2-1.3
+
+	Fix vulnerabilities in the handling of recovery files.
+	[spz, ticket #344]
+
+xsrc/external/mit/xorg-server.old/dist/Xext/panoramiX.c 1.2
+xsrc/external/mit/xorg-server.old/dist/Xext/saver.c 1.2
+xsrc/external/mit/xorg-server.old/dist/Xext/xvdisp.c 1.2
+xsrc/external/mit/xorg-server.old/dist/Xi/xichangehierarchy.c 1.2
+xsrc/external/mit/xorg-server.old/dist/dbe/dbe.c 1.2
+xsrc/external/mit/xorg-server.old/dist/dix/dispatch.c 1.2
+xsrc/external/mit/xorg-server.old/dist/hw/dmx/dmxpict.c 1.2
+xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dixmods/extmod/xf86dga2.c 1.2
+xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dri/xf86dri.c 1.2
+xsrc/external/mit/xorg-server.old/dist/render/render.c 1.2
+xsrc/external/mit/xorg-server.old/dist/xfixes/cursor.c 1.2
+xsrc/external/mit/xorg-server.old/dist/xfixes/region.c 1.2
+xsrc/external/mit/xorg-server.old/dist/xfixes/saveset.c 1.2
+xsrc/external/mit/xorg-server.old/dist/xfixes/xfixes.c 1.2
+xsrc/external/mit/xorg-server/dist/Xext/panoramiX.c 1.2
+xsrc/external/mit/xorg-server/dist/Xext/saver.c	1.2
+xsrc/external/mit/xorg-server/dist/Xext/vidmode.c 1.2
+xsrc/external/mit/xorg-server/dist/Xext/xres.c	1.2
+xsrc/external/mit/xorg-server/dist/Xext/xvdisp.c 1.7
+xsrc/external/mit/xorg-server/dist/Xi/xibarriers.c 1.2
+xsrc/external/mit/xorg-server/dist/Xi/xichangehierarchy.c 1.4
+xsrc/external/mit/xorg-server/dist/dbe/dbe.c	1.4
+xsrc/external/mit/xorg-server/dist/dix/dispatch.c 1.4
+xsrc/external/mit/xorg-server/dist/hw/dmx/dmxpict.c 1.2
+xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86DGA.c 1.2
+xsrc/external/mit/xorg-server/dist/hw/xfree86/dri/xf86dri.c 1.2
+xsrc/external/mit/xorg-server/dist/pseudoramiX/pseudoramiX.c 1.2
+xsrc/external/mit/xorg-server/dist/render/render.c 1.4
+xsrc/external/mit/xorg-server/dist/xfixes/cursor.c 1.2
+xsrc/external/mit/xorg-server/dist/xfixes/region.c 1.2
+xsrc/external/mit/xorg-server/dist/xfixes/saveset.c 1.2
+xsrc/external/mit/xorg-server/dist/xfixes/xfixes.c 1.2
+
+	apply fixes for CVEs 2017-12176 to 2017-12187
+	[mrg, ticket #346]
+
+usr.bin/mkubootimage/mkubootimage.c		1.22
+
+	add missing break after -m case
+	[jmcneill, ticket #347]
+
+sys/dev/pci/if_wm.c1.542
+sys/dev/pci/if_wmreg.h1.104
+
+	Fix wm(4) vlan panic.  wm(4) used PRI bits and CFI bit as
+	vlantag by mistake.
+	[knakahara, ticket #348]
+
+sys/kern/kern_history.c1.16
+sys/sys/kernhist.h1.22
+usr.bin/vmstat/vmstat.c1.220
+
+	Remove the ABI version-and-length check that was recently
+	introduced; sysctl(9) ABIs should be stable across versions.
+	[pgoyette, ticket #343]
+
+sys/net/if_vlan.c1.104
+
+	Fix vlan panic when vlan is re-configured without destroy.
+	[knahakara, ticket #340]
+
+sys/net/if_l2tp.c1.12
+
+	Fix l2tp panic when l2tp session id is changed.
+	[knakahara, ticket #341]
+
+sys/arch/sparc64/dev/sab.c			1.55
+sys/dev/ic/com.c1.345
+sys/dev/ic/z8530tty.c1.132
+sys/dev/sun/sunkbd.c1.30
+sys/dev/sun/sunms.c1.33
+sys/sys/tty.h	1.94
+
+	Define a new tty internal state flag: TS_KERN_ONLY.  If this
+	flag is set, the underlying hardware is used by another driver
+	and userland has no right to open it.
+
+	PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
+	so userland will not touch it.
+	[martin, ticket #338]
+
+sys/compat/netbsd32/netbsd32_conv.h		1.33
+
+	PR kern/52681: fix msghdr conversion.
+	[martin, ticket #339]
+



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:33:06 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_conv.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #339):
sys/compat/netbsd32/netbsd32_conv.h: revision 1.33
PR kern/52681: fix msghdr conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/compat/netbsd32/netbsd32_conv.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/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.31 src/sys/compat/netbsd32/netbsd32_conv.h:1.31.8.1
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.31	Sun Nov 13 13:59:45 2016
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Mon Nov  6 10:33:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.31 2016/11/13 13:59:45 rin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.31.8.1 2017/11/06 10:33:06 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -287,10 +287,10 @@ static __inline void
 netbsd32_from_msghdr(struct netbsd32_msghdr *mhp32, const struct msghdr *mhp)
 {
 
-	mhp32->msg_name = mhp32->msg_name;
-	mhp32->msg_namelen = mhp32->msg_namelen;
-	mhp32->msg_iovlen = mhp32->msg_iovlen;
-	mhp32->msg_control = mhp32->msg_control;
+	NETBSD32PTR32(mhp32->msg_name, mhp->msg_name);
+	mhp32->msg_namelen = mhp->msg_namelen;
+	mhp32->msg_iovlen = mhp->msg_iovlen;
+	NETBSD32PTR32(mhp32->msg_control, mhp->msg_control);
 	mhp32->msg_controllen = mhp->msg_controllen;
 	mhp32->msg_flags = mhp->msg_flags;
 }



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:33:06 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_conv.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #339):
sys/compat/netbsd32/netbsd32_conv.h: revision 1.33
PR kern/52681: fix msghdr conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/compat/netbsd32/netbsd32_conv.h

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



CVS commit: [netbsd-8] src/sys

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:29:06 UTC 2017

Modified Files:
src/sys/arch/sparc64/dev [netbsd-8]: sab.c
src/sys/dev/ic [netbsd-8]: com.c z8530tty.c
src/sys/dev/sun [netbsd-8]: sunkbd.c sunms.c
src/sys/sys [netbsd-8]: tty.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #338):
sys/arch/sparc64/dev/sab.c: revision 1.55
sys/dev/ic/com.c: revision 1.345
sys/dev/ic/z8530tty.c: revision 1.132
sys/dev/sun/sunkbd.c: revision 1.30
sys/dev/sun/sunms.c: revision 1.33
sys/sys/tty.h: revision 1.94
As discussed on tech-kern: define a new tty internal state flag: TS_KERN_ONLY
Implement it in a few tty drivers. If this flag is set, the underlying
hardware is used by another driver and userland has no right to open
it. A few uses will appear soon in sys/dev/sun/sun{kbd,ms}.c.
--
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
control).


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.12.1 src/sys/arch/sparc64/dev/sab.c
cvs rdiff -u -r1.339 -r1.339.10.1 src/sys/dev/ic/com.c
cvs rdiff -u -r1.131 -r1.131.12.1 src/sys/dev/ic/z8530tty.c
cvs rdiff -u -r1.29 -r1.29.22.1 src/sys/dev/sun/sunkbd.c
cvs rdiff -u -r1.32 -r1.32.22.1 src/sys/dev/sun/sunms.c
cvs rdiff -u -r1.93 -r1.93.12.1 src/sys/sys/tty.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/sparc64/dev/sab.c
diff -u src/sys/arch/sparc64/dev/sab.c:1.54 src/sys/arch/sparc64/dev/sab.c:1.54.12.1
--- src/sys/arch/sparc64/dev/sab.c:1.54	Sat Nov 15 19:20:02 2014
+++ src/sys/arch/sparc64/dev/sab.c	Mon Nov  6 10:29:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sab.c,v 1.54 2014/11/15 19:20:02 christos Exp $	*/
+/*	$NetBSD: sab.c,v 1.54.12.1 2017/11/06 10:29:06 snj Exp $	*/
 /*	$OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.54 2014/11/15 19:20:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.54.12.1 2017/11/06 10:29:06 snj Exp $");
 
 #include "opt_kgdb.h"
 #include 
@@ -681,6 +681,13 @@ sabopen(dev_t dev, int flags, int mode, 
 	tp = sc->sc_tty;
 	tp->t_dev = dev;
 
+	/*
+	 * If the device is exclusively for kernel use, deny userland
+	 * open.
+	 */
+	if (ISSET(tp->t_state, TS_KERN_ONLY))
+		return (EBUSY);
+
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 

Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.339 src/sys/dev/ic/com.c:1.339.10.1
--- src/sys/dev/ic/com.c:1.339	Fri May 27 20:01:49 2016
+++ src/sys/dev/ic/com.c	Mon Nov  6 10:29:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.339 2016/05/27 20:01:49 bouyer Exp $ */
+/* $NetBSD: com.c,v 1.339.10.1 2017/11/06 10:29:06 snj Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.339 2016/05/27 20:01:49 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.339.10.1 2017/11/06 10:29:06 snj Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -871,6 +871,13 @@ comopen(dev_t dev, int flag, int mode, s
 
 	tp = sc->sc_tty;
 
+	/*
+	 * If the device is exclusively for kernel use, deny userland
+	 * open.
+	 */
+	if (ISSET(tp->t_state, TS_KERN_ONLY))
+		return (EBUSY);
+
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
@@ -1009,6 +1016,12 @@ comclose(dev_t dev, int flag, int mode, 
 	/* XXX This is for cons.c. */
 	if (!ISSET(tp->t_state, TS_ISOPEN))
 		return (0);
+	/*
+	 * If the device is exclusively for kernel use, deny userland
+	 * close.
+	 */
+	if (ISSET(tp->t_state, TS_KERN_ONLY))
+		return (0);
 
 	(*tp->t_linesw->l_close)(tp, flag);
 	ttyclose(tp);

Index: src/sys/dev/ic/z8530tty.c
diff -u src/sys/dev/ic/z8530tty.c:1.131 src/sys/dev/ic/z8530tty.c:1.131.12.1
--- src/sys/dev/ic/z8530tty.c:1.131	Sat Nov 15 19:18:18 2014
+++ src/sys/dev/ic/z8530tty.c	Mon Nov  6 10:29:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: z8530tty.c,v 1.131 2014/11/15 19:18:18 christos Exp $	*/
+/*	$NetBSD: z8530tty.c,v 1.131.12.1 2017/11/06 10:29:06 snj Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -137,7 +137,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.131 2014/11/15 19:18:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.131.12.1 2017/11/06 10:29:06 snj Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_ntp.h"
@@ -560,6 +560,13 @@ zsopen(dev_t dev, int flags, int mode, s
 	if (tp == NULL)
 		return (EBUSY);
 
+	/*
+	 * If the device is exclusively for kernel use, deny userland
+	 * open.
+	 */
+	if (ISSET(tp->t_state, TS_KERN_ONLY))
+		return (EBUSY);
+
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 

Index: 

CVS commit: [netbsd-8] src/sys

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:29:06 UTC 2017

Modified Files:
src/sys/arch/sparc64/dev [netbsd-8]: sab.c
src/sys/dev/ic [netbsd-8]: com.c z8530tty.c
src/sys/dev/sun [netbsd-8]: sunkbd.c sunms.c
src/sys/sys [netbsd-8]: tty.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #338):
sys/arch/sparc64/dev/sab.c: revision 1.55
sys/dev/ic/com.c: revision 1.345
sys/dev/ic/z8530tty.c: revision 1.132
sys/dev/sun/sunkbd.c: revision 1.30
sys/dev/sun/sunms.c: revision 1.33
sys/sys/tty.h: revision 1.94
As discussed on tech-kern: define a new tty internal state flag: TS_KERN_ONLY
Implement it in a few tty drivers. If this flag is set, the underlying
hardware is used by another driver and userland has no right to open
it. A few uses will appear soon in sys/dev/sun/sun{kbd,ms}.c.
--
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
control).


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.12.1 src/sys/arch/sparc64/dev/sab.c
cvs rdiff -u -r1.339 -r1.339.10.1 src/sys/dev/ic/com.c
cvs rdiff -u -r1.131 -r1.131.12.1 src/sys/dev/ic/z8530tty.c
cvs rdiff -u -r1.29 -r1.29.22.1 src/sys/dev/sun/sunkbd.c
cvs rdiff -u -r1.32 -r1.32.22.1 src/sys/dev/sun/sunms.c
cvs rdiff -u -r1.93 -r1.93.12.1 src/sys/sys/tty.h

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



CVS commit: src/crypto/external/bsd/openssh

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:26:13 UTC 2017

Modified Files:
src/crypto/external/bsd/openssh: Makefile.inc

Log Message:
no more ssh1 code in openssh, so no use defining WITH_SSH1


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/Makefile.inc

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

Modified files:

Index: src/crypto/external/bsd/openssh/Makefile.inc
diff -u src/crypto/external/bsd/openssh/Makefile.inc:1.9 src/crypto/external/bsd/openssh/Makefile.inc:1.10
--- src/crypto/external/bsd/openssh/Makefile.inc:1.9	Thu Jul 23 08:03:25 2015
+++ src/crypto/external/bsd/openssh/Makefile.inc	Mon Nov  6 10:26:13 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.9 2015/07/23 08:03:25 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.10 2017/11/06 10:26:13 snj Exp $
 
 WARNS?=	4
 
@@ -16,7 +16,7 @@ CPPFLAGS+=-DHAVE_HEADER_AD
 CPPFLAGS+=-DHAVE_LOGIN_CAP
 CPPFLAGS+=-DHAVE_STDLIB_H
 
-CPPFLAGS+=-DWITH_SSH1 -DWITH_OPENSSL -DENABLE_PKCS11 -D_OPENBSD_SOURCE
+CPPFLAGS+=-DWITH_OPENSSL -DENABLE_PKCS11 -D_OPENBSD_SOURCE
 .if !defined(NOPIC)
 CPPFLAGS+=-DHAVE_DLOPEN
 .endif



CVS commit: src/crypto/external/bsd/openssh

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:26:13 UTC 2017

Modified Files:
src/crypto/external/bsd/openssh: Makefile.inc

Log Message:
no more ssh1 code in openssh, so no use defining WITH_SSH1


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/Makefile.inc

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:59:01 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #341):
sys/net/if_l2tp.c: revision 1.12
fix l2tp panic when l2tp session id is changed (same as if_vlan.c:r1.104)
E.g. the following operation causes this panic.

# ifconfig l2tp0 create
# ifconfig l2tp0 session 140 140
# ifconfig l2tp1 create
# ifconfig l2tp1 session 200 200
# ifconfig l2tp1 session 300 300
panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file 
"/disk4/home/k-nakahara/repos/netbsd-src/sys/sys/pslist.h", line 118

Pointed out by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 src/sys/net/if_l2tp.c

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

Modified files:

Index: src/sys/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.11 src/sys/net/if_l2tp.c:1.11.2.1
--- src/sys/net/if_l2tp.c:1.11	Thu Jun  1 02:45:14 2017
+++ src/sys/net/if_l2tp.c	Mon Nov  6 09:59:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.11 2017/06/01 02:45:14 chs Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.11.2.1 2017/11/06 09:59:01 snj Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.11 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.11.2.1 2017/11/06 09:59:01 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1069,6 +1069,7 @@ l2tp_set_session(struct l2tp_softc *sc, 
 		pserialize_perform(l2tp_psz);
 	}
 	mutex_exit(_hash.lock);
+	PSLIST_ENTRY_DESTROY(sc, l2tp_hash);
 
 	l2tp_variant_update(sc, nvar);
 	mutex_exit(>l2tp_lock);
@@ -1078,6 +1079,7 @@ l2tp_set_session(struct l2tp_softc *sc, 
 		log(LOG_DEBUG, "%s: add hash entry: sess_id=%" PRIu32 ", idx=%" PRIu32 "\n",
 		sc->l2tp_ec.ec_if.if_xname, nvar->lv_my_sess_id, idx);
 
+	PSLIST_ENTRY_INIT(sc, l2tp_hash);
 	mutex_enter(_hash.lock);
 	PSLIST_WRITER_INSERT_HEAD(_hash.lists[idx], sc, l2tp_hash);
 	mutex_exit(_hash.lock);



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:59:01 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #341):
sys/net/if_l2tp.c: revision 1.12
fix l2tp panic when l2tp session id is changed (same as if_vlan.c:r1.104)
E.g. the following operation causes this panic.

# ifconfig l2tp0 create
# ifconfig l2tp0 session 140 140
# ifconfig l2tp1 create
# ifconfig l2tp1 session 200 200
# ifconfig l2tp1 session 300 300
panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file 
"/disk4/home/k-nakahara/repos/netbsd-src/sys/sys/pslist.h", line 118

Pointed out by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 src/sys/net/if_l2tp.c

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:57:39 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knahakara in ticket #340):
sys/net/if_vlan.c: revision 1.104
fix vlan panic when vlan is re-configured without destroy.
E.g. the following operation causes this panic.

# ifconfig vlan0 create
# ifconfig vlan0 vlan 1 vlanif ixg3
# ifconfig vlan1 create
# ifconfig vlan1 vlan 1 vlanif ixg2
# ifconfig vlan1 -vlanif
# ifconfig vlan1 vlan 1 vlanif ixg2
panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file 
"/git/netbsd-src/sys/sys/pslist.h", line 118

Pointed out and tested by msaitoh@n.o, fixed by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.4 -r1.97.2.5 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.97.2.4 src/sys/net/if_vlan.c:1.97.2.5
--- src/sys/net/if_vlan.c:1.97.2.4	Wed Oct 25 07:12:33 2017
+++ src/sys/net/if_vlan.c	Mon Nov  6 09:57:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.97.2.4 2017/10/25 07:12:33 snj Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.97.2.5 2017/11/06 09:57:39 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.4 2017/10/25 07:12:33 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.5 2017/11/06 09:57:39 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -468,6 +468,7 @@ vlan_config(struct ifvlan *ifv, struct i
 	 */
 	ifv->ifv_if.if_type = p->if_type;
 
+	PSLIST_ENTRY_INIT(ifv, ifv_hash);
 	idx = tag_hash_func(tag, ifv_hash.mask);
 
 	mutex_enter(_hash.lock);
@@ -572,6 +573,7 @@ vlan_unconfig_locked(struct ifvlan *ifv,
 	PSLIST_WRITER_REMOVE(ifv, ifv_hash);
 	pserialize_perform(vlan_psz);
 	mutex_exit(_hash.lock);
+	PSLIST_ENTRY_DESTROY(ifv, ifv_hash);
 
 	vlan_linkmib_update(ifv, nmib);
 



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:57:39 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knahakara in ticket #340):
sys/net/if_vlan.c: revision 1.104
fix vlan panic when vlan is re-configured without destroy.
E.g. the following operation causes this panic.

# ifconfig vlan0 create
# ifconfig vlan0 vlan 1 vlanif ixg3
# ifconfig vlan1 create
# ifconfig vlan1 vlan 1 vlanif ixg2
# ifconfig vlan1 -vlanif
# ifconfig vlan1 vlan 1 vlanif ixg2
panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file 
"/git/netbsd-src/sys/sys/pslist.h", line 118

Pointed out and tested by msaitoh@n.o, fixed by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.4 -r1.97.2.5 src/sys/net/if_vlan.c

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



CVS commit: [netbsd-8] src

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:55:57 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: kern_history.c
src/sys/sys [netbsd-8]: kernhist.h
src/usr.bin/vmstat [netbsd-8]: vmstat.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #343):
sys/kern/kern_history.c: revision 1.16
sys/sys/kernhist.h: revision 1.22
usr.bin/vmstat/vmstat.c: revision 1.220
Remove the ABI version-and-length check that was recently introduced;
sysctl(9) ABIs should be stable across versions.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.1 -r1.14.8.2 src/sys/kern/kern_history.c
cvs rdiff -u -r1.18.8.2 -r1.18.8.3 src/sys/sys/kernhist.h
cvs rdiff -u -r1.216.6.2 -r1.216.6.3 src/usr.bin/vmstat/vmstat.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_history.c
diff -u src/sys/kern/kern_history.c:1.14.8.1 src/sys/kern/kern_history.c:1.14.8.2
--- src/sys/kern/kern_history.c:1.14.8.1	Thu Nov  2 21:29:52 2017
+++ src/sys/kern/kern_history.c	Mon Nov  6 09:55:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_history.c,v 1.14.8.1 2017/11/02 21:29:52 snj Exp $	 */
+/*	$NetBSD: kern_history.c,v 1.14.8.2 2017/11/06 09:55:57 snj Exp $	 */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.14.8.1 2017/11/02 21:29:52 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.14.8.2 2017/11/06 09:55:57 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
@@ -460,12 +460,6 @@ sysctl_kernhist_helper(SYSCTLFN_ARGS)
 	buf = kmem_alloc(bufsize, KM_SLEEP);
 
 	/*
-	 * Set the export structure's version info
-	 */
-	buf->sh_version = KERNHIST_SYSCTL_VERSION;
-	buf->sh_arglen = sizeof(uintmax_t);
-
-	/*
 	 * Copy history header info to the export structure
 	 */
 	j = find_string(xlate_t, _c, h->name, h->namelen);

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.18.8.2 src/sys/sys/kernhist.h:1.18.8.3
--- src/sys/sys/kernhist.h:1.18.8.2	Thu Nov  2 21:29:52 2017
+++ src/sys/sys/kernhist.h	Mon Nov  6 09:55:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.18.8.2 2017/11/02 21:29:52 snj Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.18.8.3 2017/11/06 09:55:57 snj Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -89,8 +89,7 @@ struct sysctl_history_event {
 
 /* list of all events for a single history */
 struct sysctl_history {
-	uint16_t	sh_version;
-	uint16_t	sh_arglen;
+	uint32_t	filler;
 	uint32_t	sh_nameoffset;
 	uint32_t	sh_numentries;
 	uint32_t	sh_nextfree;

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.216.6.2 src/usr.bin/vmstat/vmstat.c:1.216.6.3
--- src/usr.bin/vmstat/vmstat.c:1.216.6.2	Thu Nov  2 21:29:53 2017
+++ src/usr.bin/vmstat/vmstat.c	Mon Nov  6 09:55:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.216.6.2 2017/11/02 21:29:53 snj Exp $ */
+/* $NetBSD: vmstat.c,v 1.216.6.3 2017/11/06 09:55:56 snj Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.216.6.2 2017/11/02 21:29:53 snj Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.216.6.3 2017/11/06 09:55:56 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -2273,11 +2273,6 @@ hist_dodump_sysctl(int mib[], unsigned i
 	if (errno != 0)
 		err(1, "sysctl failed");
  
-	/* Make sure we've got matching versions */
-	if (hist->sh_version != KERNHIST_SYSCTL_VERSION ||
-	hist->sh_arglen != sizeof(uintmax_t))
-		errx(1, "Kernel version or argument length mismatch!");
-
 	strp = (char *)(>sh_events[hist->sh_numentries]);
  
 	(void)printf("%"PRIu32" entries, next is %"PRIu32"\n",



CVS commit: [netbsd-8] src

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:55:57 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: kern_history.c
src/sys/sys [netbsd-8]: kernhist.h
src/usr.bin/vmstat [netbsd-8]: vmstat.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #343):
sys/kern/kern_history.c: revision 1.16
sys/sys/kernhist.h: revision 1.22
usr.bin/vmstat/vmstat.c: revision 1.220
Remove the ABI version-and-length check that was recently introduced;
sysctl(9) ABIs should be stable across versions.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.1 -r1.14.8.2 src/sys/kern/kern_history.c
cvs rdiff -u -r1.18.8.2 -r1.18.8.3 src/sys/sys/kernhist.h
cvs rdiff -u -r1.216.6.2 -r1.216.6.3 src/usr.bin/vmstat/vmstat.c

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:54:01 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #348):
sys/dev/pci/if_wm.c: revision 1.542
sys/dev/pci/if_wmreg.h: revision 1.104
fix wm(4) vlan panic. Reported and tested by Tom Ivar Helbekkmo, thanks.
wm(4) used PRI bits and CFI bit as vlantag by mistake. It is found out
by if_ether.h:r1.67.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.4 -r1.508.4.5 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.1 -r1.98.6.2 src/sys/dev/pci/if_wmreg.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.4 src/sys/dev/pci/if_wm.c:1.508.4.5
--- src/sys/dev/pci/if_wm.c:1.508.4.4	Tue Oct 24 08:38:59 2017
+++ src/sys/dev/pci/if_wm.c	Mon Nov  6 09:54:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.4 2017/10/24 08:38:59 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.5 2017/11/06 09:54:01 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.4 2017/10/24 08:38:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.5 2017/11/06 09:54:01 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -8095,11 +8095,11 @@ wm_rxdesc_get_vlantag(struct wm_rxqueue 
 	struct wm_softc *sc = rxq->rxq_sc;
 
 	if (sc->sc_type == WM_T_82574)
-		return rxq->rxq_ext_descs[idx].erx_ctx.erxc_vlan;
+		return EXTRXC_VLAN_ID(rxq->rxq_ext_descs[idx].erx_ctx.erxc_vlan);
 	else if ((sc->sc_flags & WM_F_NEWQUEUE) != 0)
-		return rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_vlan;
+		return NQRXC_VLAN_ID(rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_vlan);
 	else
-		return rxq->rxq_descs[idx].wrx_special;
+		return WRX_VLAN_ID(rxq->rxq_descs[idx].wrx_special);
 }
 
 static inline int

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.98.6.1 src/sys/dev/pci/if_wmreg.h:1.98.6.2
--- src/sys/dev/pci/if_wmreg.h:1.98.6.1	Tue Aug  1 23:33:18 2017
+++ src/sys/dev/pci/if_wmreg.h	Mon Nov  6 09:54:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.98.6.1 2017/08/01 23:33:18 snj Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.98.6.2 2017/11/06 09:54:01 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -208,6 +208,12 @@ typedef union ext_rxdesc {
 #define EXTRXC_STATUS_PKTTYPE_MASK	__BITS(19,16)
 #define EXTRXC_STATUS_PKTTYPE(status)	__SHIFTOUT(status,EXTRXC_STATUS_PKTTYPE_MASK)
 
+#define	EXTRXC_VLAN_ID_MASK	__BITS(11,0)	/* VLAN identifier mask */
+#define	EXTRXC_VLAN_ID(x)	((x) & EXTRXC_VLAN_ID_MASK) /* VLAN identifier */
+#define	EXTRXC_VLAN_CFI		__BIT(12)	/* Canonical Form Indicator */
+#define	EXTRXC_VLAN_PRI_MASK	__BITS(15,13)	/* VLAN priority mask */
+#define	EXTRXC_VLAN_PRI(x)	__SHIFTOUT((x),EXTRXC_VLAN_PRI_MASK) /* VLAN priority */
+
 /* advanced RX descriptor for 82575 and newer */
 typedef union nq_rxdesc {
 	struct {
@@ -330,6 +336,12 @@ typedef union nq_rxdesc {
 #define NQRXC_STATUS_MC		__BIT(19) /* Packet received from Manageability Controller */
 	  /* "MBC" in i350 spec */
 
+#define	NQRXC_VLAN_ID_MASK	__BITS(11,0)	/* VLAN identifier mask */
+#define	NQRXC_VLAN_ID(x)	((x) & NQRXC_VLAN_ID_MASK) /* VLAN identifier */
+#define	NQRXC_VLAN_CFI		__BIT(12)	/* Canonical Form Indicator */
+#define	NQRXC_VLAN_PRI_MASK	__BITS(15,13)	/* VLAN priority mask */
+#define	NQRXC_VLAN_PRI(x)	__SHIFTOUT((x),NQRXC_VLAN_PRI_MASK) /* VLAN priority */
+
 /*
  * The Wiseman transmit descriptor.
  *



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:54:01 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #348):
sys/dev/pci/if_wm.c: revision 1.542
sys/dev/pci/if_wmreg.h: revision 1.104
fix wm(4) vlan panic. Reported and tested by Tom Ivar Helbekkmo, thanks.
wm(4) used PRI bits and CFI bit as vlantag by mistake. It is found out
by if_ether.h:r1.67.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.4 -r1.508.4.5 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.1 -r1.98.6.2 src/sys/dev/pci/if_wmreg.h

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:52:15 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #347):
usr.bin/mkubootimage/mkubootimage.c: revision 1.22
add missing break after -m case


To generate a diff of this commit:
cvs rdiff -u -r1.18.8.2 -r1.18.8.3 src/usr.bin/mkubootimage/mkubootimage.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/mkubootimage/mkubootimage.c
diff -u src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.2 src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.3
--- src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.2	Tue Jul 25 02:00:33 2017
+++ src/usr.bin/mkubootimage/mkubootimage.c	Mon Nov  6 09:52:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.18.8.3 2017/11/06 09:52:15 snj Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.18.8.3 2017/11/06 09:52:15 snj Exp $");
 
 #include 
 #include 
@@ -410,6 +410,7 @@ main(int argc, char *argv[])
 			(num == ULONG_MAX || num == 0)))
 errx(1, "illegal number -- %s", optarg);
 			image_magic = (uint32_t)num;
+			break;
 		case 'n':	/* name */
 			image_name = strdup(optarg);
 			break;



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:52:15 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #347):
usr.bin/mkubootimage/mkubootimage.c: revision 1.22
add missing break after -m case


To generate a diff of this commit:
cvs rdiff -u -r1.18.8.2 -r1.18.8.3 src/usr.bin/mkubootimage/mkubootimage.c

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



CVS commit: [netbsd-8] xsrc/external/mit

2017-11-06 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Mon Nov  6 09:43:03 UTC 2017

Modified Files:
xsrc/external/mit/xorg-server.old/dist/Xext [netbsd-8]: panoramiX.c
saver.c xvdisp.c
xsrc/external/mit/xorg-server.old/dist/Xi [netbsd-8]:
xichangehierarchy.c
xsrc/external/mit/xorg-server.old/dist/dbe [netbsd-8]: dbe.c
xsrc/external/mit/xorg-server.old/dist/dix [netbsd-8]: dispatch.c
xsrc/external/mit/xorg-server.old/dist/hw/dmx [netbsd-8]: dmxpict.c
xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dixmods/extmod 
[netbsd-8]:
xf86dga2.c
xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dri [netbsd-8]:
xf86dri.c
xsrc/external/mit/xorg-server.old/dist/render [netbsd-8]: render.c
xsrc/external/mit/xorg-server.old/dist/xfixes [netbsd-8]: cursor.c
region.c saveset.c xfixes.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-8]: panoramiX.c saver.c
vidmode.c xres.c xvdisp.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-8]: xibarriers.c
xichangehierarchy.c
xsrc/external/mit/xorg-server/dist/dbe [netbsd-8]: dbe.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-8]: dispatch.c
xsrc/external/mit/xorg-server/dist/hw/dmx [netbsd-8]: dmxpict.c
xsrc/external/mit/xorg-server/dist/hw/xfree86/common [netbsd-8]:
xf86DGA.c
xsrc/external/mit/xorg-server/dist/hw/xfree86/dri [netbsd-8]: xf86dri.c
xsrc/external/mit/xorg-server/dist/pseudoramiX [netbsd-8]:
pseudoramiX.c
xsrc/external/mit/xorg-server/dist/render [netbsd-8]: render.c
xsrc/external/mit/xorg-server/dist/xfixes [netbsd-8]: cursor.c region.c
saveset.c xfixes.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #346):
external/mit/xorg-server.old/dist/Xext/panoramiX.c: 1.2
external/mit/xorg-server.old/dist/Xext/saver.c: 1.2
external/mit/xorg-server.old/dist/Xext/xvdisp.c: 1.2
external/mit/xorg-server.old/dist/Xi/xichangehierarchy.c: 1.2
external/mit/xorg-server.old/dist/dbe/dbe.c: 1.2
external/mit/xorg-server.old/dist/dix/dispatch.c: 1.2
external/mit/xorg-server.old/dist/hw/dmx/dmxpict.c: 1.2
external/mit/xorg-server.old/dist/hw/xfree86/dixmods/extmod/xf86dga2.c: 
1.2
external/mit/xorg-server.old/dist/hw/xfree86/dri/xf86dri.c: 1.2
external/mit/xorg-server.old/dist/render/render.c: 1.2
external/mit/xorg-server.old/dist/xfixes/cursor.c: 1.2
external/mit/xorg-server.old/dist/xfixes/region.c: 1.2
external/mit/xorg-server.old/dist/xfixes/saveset.c: 1.2
external/mit/xorg-server.old/dist/xfixes/xfixes.c: 1.2
external/mit/xorg-server/dist/Xext/panoramiX.c: 1.2
external/mit/xorg-server/dist/Xext/saver.c: 1.2
external/mit/xorg-server/dist/Xext/vidmode.c: 1.2
external/mit/xorg-server/dist/Xext/xres.c: 1.2
external/mit/xorg-server/dist/Xext/xvdisp.c: 1.7
external/mit/xorg-server/dist/Xi/xibarriers.c: 1.2
external/mit/xorg-server/dist/Xi/xichangehierarchy.c: 1.4
external/mit/xorg-server/dist/dbe/dbe.c: 1.4
external/mit/xorg-server/dist/dix/dispatch.c: 1.4
external/mit/xorg-server/dist/hw/dmx/dmxpict.c: 1.2
external/mit/xorg-server/dist/hw/xfree86/common/xf86DGA.c: 1.2
external/mit/xorg-server/dist/hw/xfree86/dri/xf86dri.c: 1.2
external/mit/xorg-server/dist/pseudoramiX/pseudoramiX.c: 1.2
external/mit/xorg-server/dist/render/render.c: 1.4
external/mit/xorg-server/dist/xfixes/cursor.c: 1.2
external/mit/xorg-server/dist/xfixes/region.c: 1.2
external/mit/xorg-server/dist/xfixes/saveset.c: 1.2
external/mit/xorg-server/dist/xfixes/xfixes.c: 1.2
apply fixes for CVEs 2017-12176 to 2017-12187.
--
>From 1b1d4c04695dced2463404174b50b3581dbd857b Mon Sep 17 00:00:00 2001
From: Nathan Kidd 
Date: Sun, 21 Dec 2014 01:10:03 -0500
Subject: hw/xfree86: unvalidated lengths
This addresses:
CVE-2017-12180 in XFree86-VidModeExtension
CVE-2017-12181 in XFree86-DGA
CVE-2017-12182 in XFree86-DRI
--
>From 211e05ac85a294ef361b9f80d689047fa52b9076 Mon Sep 17 00:00:00 2001
From: Michal Srb 
Date: Fri, 7 Jul 2017 17:21:46 +0200
Subject: Xi: Test exact size of XIBarrierReleasePointer
Otherwise a client can send any value of num_barriers and cause reading or 
swapping of values on heap behind the receive buffer.
--
>From 4ca68b878e851e2136c234f40a25008297d8d831 Mon Sep 17 00:00:00 2001
From: Nathan Kidd 
Date: Fri, 9 Jan 2015 10:09:14 -0500
Subject: dbe: Unvalidated variable-length request in ProcDbeGetVisualInfo
 (CVE-2017-12177)
v2: Protect against integer overflow (Alan Coopersmith)
--
>From 55caa8b08c84af2b50fbc936cf334a5a93dd7db5 Mon Sep 17 00:00:00 2001
From: Nathan Kidd 

CVS commit: [netbsd-8] xsrc/external/mit

2017-11-06 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Mon Nov  6 09:43:03 UTC 2017

Modified Files:
xsrc/external/mit/xorg-server.old/dist/Xext [netbsd-8]: panoramiX.c
saver.c xvdisp.c
xsrc/external/mit/xorg-server.old/dist/Xi [netbsd-8]:
xichangehierarchy.c
xsrc/external/mit/xorg-server.old/dist/dbe [netbsd-8]: dbe.c
xsrc/external/mit/xorg-server.old/dist/dix [netbsd-8]: dispatch.c
xsrc/external/mit/xorg-server.old/dist/hw/dmx [netbsd-8]: dmxpict.c
xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dixmods/extmod 
[netbsd-8]:
xf86dga2.c
xsrc/external/mit/xorg-server.old/dist/hw/xfree86/dri [netbsd-8]:
xf86dri.c
xsrc/external/mit/xorg-server.old/dist/render [netbsd-8]: render.c
xsrc/external/mit/xorg-server.old/dist/xfixes [netbsd-8]: cursor.c
region.c saveset.c xfixes.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-8]: panoramiX.c saver.c
vidmode.c xres.c xvdisp.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-8]: xibarriers.c
xichangehierarchy.c
xsrc/external/mit/xorg-server/dist/dbe [netbsd-8]: dbe.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-8]: dispatch.c
xsrc/external/mit/xorg-server/dist/hw/dmx [netbsd-8]: dmxpict.c
xsrc/external/mit/xorg-server/dist/hw/xfree86/common [netbsd-8]:
xf86DGA.c
xsrc/external/mit/xorg-server/dist/hw/xfree86/dri [netbsd-8]: xf86dri.c
xsrc/external/mit/xorg-server/dist/pseudoramiX [netbsd-8]:
pseudoramiX.c
xsrc/external/mit/xorg-server/dist/render [netbsd-8]: render.c
xsrc/external/mit/xorg-server/dist/xfixes [netbsd-8]: cursor.c region.c
saveset.c xfixes.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #346):
external/mit/xorg-server.old/dist/Xext/panoramiX.c: 1.2
external/mit/xorg-server.old/dist/Xext/saver.c: 1.2
external/mit/xorg-server.old/dist/Xext/xvdisp.c: 1.2
external/mit/xorg-server.old/dist/Xi/xichangehierarchy.c: 1.2
external/mit/xorg-server.old/dist/dbe/dbe.c: 1.2
external/mit/xorg-server.old/dist/dix/dispatch.c: 1.2
external/mit/xorg-server.old/dist/hw/dmx/dmxpict.c: 1.2
external/mit/xorg-server.old/dist/hw/xfree86/dixmods/extmod/xf86dga2.c: 
1.2
external/mit/xorg-server.old/dist/hw/xfree86/dri/xf86dri.c: 1.2
external/mit/xorg-server.old/dist/render/render.c: 1.2
external/mit/xorg-server.old/dist/xfixes/cursor.c: 1.2
external/mit/xorg-server.old/dist/xfixes/region.c: 1.2
external/mit/xorg-server.old/dist/xfixes/saveset.c: 1.2
external/mit/xorg-server.old/dist/xfixes/xfixes.c: 1.2
external/mit/xorg-server/dist/Xext/panoramiX.c: 1.2
external/mit/xorg-server/dist/Xext/saver.c: 1.2
external/mit/xorg-server/dist/Xext/vidmode.c: 1.2
external/mit/xorg-server/dist/Xext/xres.c: 1.2
external/mit/xorg-server/dist/Xext/xvdisp.c: 1.7
external/mit/xorg-server/dist/Xi/xibarriers.c: 1.2
external/mit/xorg-server/dist/Xi/xichangehierarchy.c: 1.4
external/mit/xorg-server/dist/dbe/dbe.c: 1.4
external/mit/xorg-server/dist/dix/dispatch.c: 1.4
external/mit/xorg-server/dist/hw/dmx/dmxpict.c: 1.2
external/mit/xorg-server/dist/hw/xfree86/common/xf86DGA.c: 1.2
external/mit/xorg-server/dist/hw/xfree86/dri/xf86dri.c: 1.2
external/mit/xorg-server/dist/pseudoramiX/pseudoramiX.c: 1.2
external/mit/xorg-server/dist/render/render.c: 1.4
external/mit/xorg-server/dist/xfixes/cursor.c: 1.2
external/mit/xorg-server/dist/xfixes/region.c: 1.2
external/mit/xorg-server/dist/xfixes/saveset.c: 1.2
external/mit/xorg-server/dist/xfixes/xfixes.c: 1.2
apply fixes for CVEs 2017-12176 to 2017-12187.
--
>From 1b1d4c04695dced2463404174b50b3581dbd857b Mon Sep 17 00:00:00 2001
From: Nathan Kidd 
Date: Sun, 21 Dec 2014 01:10:03 -0500
Subject: hw/xfree86: unvalidated lengths
This addresses:
CVE-2017-12180 in XFree86-VidModeExtension
CVE-2017-12181 in XFree86-DGA
CVE-2017-12182 in XFree86-DRI
--
>From 211e05ac85a294ef361b9f80d689047fa52b9076 Mon Sep 17 00:00:00 2001
From: Michal Srb 
Date: Fri, 7 Jul 2017 17:21:46 +0200
Subject: Xi: Test exact size of XIBarrierReleasePointer
Otherwise a client can send any value of num_barriers and cause reading or 
swapping of values on heap behind the receive buffer.
--
>From 4ca68b878e851e2136c234f40a25008297d8d831 Mon Sep 17 00:00:00 2001
From: Nathan Kidd 
Date: Fri, 9 Jan 2015 10:09:14 -0500
Subject: dbe: Unvalidated variable-length request in ProcDbeGetVisualInfo
 (CVE-2017-12177)
v2: Protect against integer overflow (Alan Coopersmith)
--
>From 55caa8b08c84af2b50fbc936cf334a5a93dd7db5 Mon Sep 17 00:00:00 2001
From: Nathan Kidd 

CVS commit: [netbsd-8] src/external/bsd/nvi

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:37:24 UTC 2017

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-8]: recover.c
src/external/bsd/nvi/usr.bin/recover [netbsd-8]: virecover

Log Message:
Pull up following revision(s) (requested by spz in ticket #344):
external/bsd/nvi/usr.bin/recover/virecover: 1.2-1.3
external/bsd/nvi/dist/common/recover.c: 1.6-1.9
be more careful about opening recovery files... in particular deal with
people trying to get 'vi -r' stuck using named pipes, symlink attacks,
and coercing others opening recovery files they did not create.
- don't use command substitution to glob a pattern into a list of filenames;
  it is less efficient than doing it directly and does not handle whitespace
  in filenames properly.
- change test to [
- quote variables
Put back the tests for "no files matched" (in a different way than they
were written previously - but that's just style.)   This is not csh...
Use the correct test operator to test for an empty file (rather than
testing for an empty file name...)
Write test ('[') commands in a way that is defined to work, rather than
just happens to - we can afford the (negligible) performance hit here.
Deal safely with recovery mail files.
oops, accidendally committed an earlier non-working version; fixed.
Don't use popenve() for portability; forking an extra shell here is not an
issue.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.22.1 src/external/bsd/nvi/dist/common/recover.c
cvs rdiff -u -r1.1 -r1.1.22.1 src/external/bsd/nvi/usr.bin/recover/virecover

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/nvi/dist/common/recover.c
diff -u src/external/bsd/nvi/dist/common/recover.c:1.5 src/external/bsd/nvi/dist/common/recover.c:1.5.22.1
--- src/external/bsd/nvi/dist/common/recover.c:1.5	Sun Jan 26 21:43:45 2014
+++ src/external/bsd/nvi/dist/common/recover.c	Mon Nov  6 09:37:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: recover.c,v 1.5 2014/01/26 21:43:45 christos Exp $ */
+/*	$NetBSD: recover.c,v 1.5.22.1 2017/11/06 09:37:24 snj Exp $ */
 /*-
  * Copyright (c) 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: recover.c,v 10.31 2001/11/01 15:24:44 skimo Exp  (Berkeley) Date: 2001/11/01 15:24:44 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: recover.c,v 1.5 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: recover.c,v 1.5.22.1 2017/11/06 09:37:24 snj Exp $");
 #endif
 
 #include 
@@ -115,17 +115,17 @@ __RCSID("$NetBSD: recover.c,v 1.5 2014/0
 #define	VI_FHEADER	"X-vi-recover-file: "
 #define	VI_PHEADER	"X-vi-recover-path: "
 
-static int	 rcv_copy __P((SCR *, int, char *));
-static void	 rcv_email __P((SCR *, char *));
-static char	*rcv_gets __P((char *, size_t, int));
-static int	 rcv_mailfile __P((SCR *, int, char *));
-static int	 rcv_mktemp __P((SCR *, char *, const char *, int));
+static int	 rcv_copy(SCR *, int, char *);
+static void	 rcv_email(SCR *, const char *);
+static char	*rcv_gets(char *, size_t, int);
+static int	 rcv_mailfile(SCR *, int, char *);
+static int	 rcv_mktemp(SCR *, char *, const char *, int);
 
 /*
  * rcv_tmp --
  *	Build a file name that will be used as the recovery file.
  *
- * PUBLIC: int rcv_tmp __P((SCR *, EXF *, char *));
+ * PUBLIC: int rcv_tmp(SCR *, EXF *, char *);
  */
 int
 rcv_tmp(SCR *sp, EXF *ep, char *name)
@@ -186,7 +186,7 @@ err:		msgq(sp, M_ERR,
  * rcv_init --
  *	Force the file to be snapshotted for recovery.
  *
- * PUBLIC: int rcv_init __P((SCR *));
+ * PUBLIC: int rcv_init(SCR *);
  */
 int
 rcv_init(SCR *sp)
@@ -248,7 +248,7 @@ err:	msgq(sp, M_ERR,
  *		sending email to the user if the file was modified
  *		ending the file session
  *
- * PUBLIC: int rcv_sync __P((SCR *, u_int));
+ * PUBLIC: int rcv_sync(SCR *, u_int);
  */
 int
 rcv_sync(SCR *sp, u_int flags)
@@ -482,6 +482,22 @@ err:	if (!issync)
 }
 
 /*
+ * Since vi creates recovery files only accessible by the user, files
+ * accessible by group or others are probably malicious so avoid them.
+ * This is simpler than checking for getuid() == st.st_uid and we want
+ * to preserve the functionality that root can recover anything which
+ * means that root should know better and be careful.
+ */
+static int
+checkok(int fd)
+{
+	struct stat sb;
+
+	return fstat(fd, ) != -1 && S_ISREG(sb.st_mode) &&
+	(sb.st_mode & (S_IRWXG|S_IRWXO)) == 0;
+}
+
+/*
  *	people making love
  *	never exactly the same
  *	just like a snowflake
@@ -489,7 +505,7 @@ err:	if (!issync)
  * rcv_list --
  *	List the files that can be recovered by this user.
  *
- * PUBLIC: int rcv_list __P((SCR *));
+ * PUBLIC: int rcv_list(SCR *);
  */
 int
 rcv_list(SCR *sp)
@@ -525,9 +541,14 @@ rcv_list(SCR *sp)
 		 * if we're using fcntl(2), there's no way to lock a file
 		 * descriptor that's not open for writing.
 		 

CVS commit: [netbsd-8] src/external/bsd/nvi

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:37:24 UTC 2017

Modified Files:
src/external/bsd/nvi/dist/common [netbsd-8]: recover.c
src/external/bsd/nvi/usr.bin/recover [netbsd-8]: virecover

Log Message:
Pull up following revision(s) (requested by spz in ticket #344):
external/bsd/nvi/usr.bin/recover/virecover: 1.2-1.3
external/bsd/nvi/dist/common/recover.c: 1.6-1.9
be more careful about opening recovery files... in particular deal with
people trying to get 'vi -r' stuck using named pipes, symlink attacks,
and coercing others opening recovery files they did not create.
- don't use command substitution to glob a pattern into a list of filenames;
  it is less efficient than doing it directly and does not handle whitespace
  in filenames properly.
- change test to [
- quote variables
Put back the tests for "no files matched" (in a different way than they
were written previously - but that's just style.)   This is not csh...
Use the correct test operator to test for an empty file (rather than
testing for an empty file name...)
Write test ('[') commands in a way that is defined to work, rather than
just happens to - we can afford the (negligible) performance hit here.
Deal safely with recovery mail files.
oops, accidendally committed an earlier non-working version; fixed.
Don't use popenve() for portability; forking an extra shell here is not an
issue.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.22.1 src/external/bsd/nvi/dist/common/recover.c
cvs rdiff -u -r1.1 -r1.1.22.1 src/external/bsd/nvi/usr.bin/recover/virecover

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:23:51 UTC 2017

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

Log Message:
1385


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 src/doc/CHANGES-7.1.1

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

Modified files:

Index: src/doc/CHANGES-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.37 src/doc/CHANGES-7.1.1:1.1.2.38
--- src/doc/CHANGES-7.1.1:1.1.2.37	Sun Nov  5 21:07:32 2017
+++ src/doc/CHANGES-7.1.1	Mon Nov  6 09:23:51 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.37 2017/11/05 21:07:32 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.38 2017/11/06 09:23:51 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -3798,3 +3798,8 @@ xsrc/xfree/xc/programs/Xserver/render/re
 	apply fixes for CVEs 2017-12176 to 2017-12187
 	[mrg, ticket #1523]
 
+sys/dev/pci/if_wm.c1.497
+
+	Fix panic on shutdown.  PR kern/52039.
+	[kardel, ticket #1385]
+



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:23:51 UTC 2017

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

Log Message:
1385


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 src/doc/CHANGES-7.1.1

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



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:21:48 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1385):
sys/dev/pci/if_wm.c: revision 1.497
PR kern/52039: use same safeguard as for the 82578


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.13 -r1.289.2.13.2.1 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.289.2.13 src/sys/dev/pci/if_wm.c:1.289.2.13.2.1
--- src/sys/dev/pci/if_wm.c:1.289.2.13	Thu Mar  9 06:28:36 2017
+++ src/sys/dev/pci/if_wm.c	Mon Nov  6 09:21:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.289.2.13 2017/03/09 06:28:36 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.289.2.13.2.1 2017/11/06 09:21:48 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.13 2017/03/09 06:28:36 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.13.2.1 2017/11/06 09:21:48 snj Exp $");
 
 #include 
 #include 
@@ -11153,7 +11153,7 @@ wm_enable_wakeup(struct wm_softc *sc)
 
 			/* Assume that the PHY is copper */
 			child = LIST_FIRST(>sc_mii.mii_phys);
-			if (child->mii_mpd_rev <= 2)
+			if ((child != NULL) && (child->mii_mpd_rev <= 2))
 sc->sc_mii.mii_writereg(sc->sc_dev, 1,
 (768 << 5) | 25, 0x0444); /* magic num */
 		}



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

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 09:21:48 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1385):
sys/dev/pci/if_wm.c: revision 1.497
PR kern/52039: use same safeguard as for the 82578


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.13 -r1.289.2.13.2.1 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.