CVS commit: src/sys/dev/mii

2019-03-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar 25 05:39:51 UTC 2019

Modified Files:
src/sys/dev/mii: makphy.c
Added Files:
src/sys/dev/mii: makphyvar.h

Log Message:
- 88E1000(S) has no page select register, so don't access it.
  Note that qemu doesn't implement the register and the access fails.
  For I210, we can use the register.
- Don't set PSCR_CRS_ON_TX bit on I210.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/makphy.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/mii/makphyvar.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/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.57 src/sys/dev/mii/makphy.c:1.58
--- src/sys/dev/mii/makphy.c:1.57	Wed Feb 27 18:21:04 2019
+++ src/sys/dev/mii/makphy.c	Mon Mar 25 05:39:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $	*/
+/*	$NetBSD: makphy.c,v 1.58 2019/03/25 05:39:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.57 2019/02/27 18:21:04 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.58 2019/03/25 05:39:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -76,11 +76,12 @@ __KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1
 #include 
 
 #include 
+#include 
 
 static int	makphymatch(device_t, cfdata_t, void *);
 static void	makphyattach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(makphy, sizeof(struct mii_softc),
+CFATTACH_DECL_NEW(makphy, sizeof(struct makphy_softc),
 makphymatch, makphyattach, mii_phy_detach, mii_phy_activate);
 
 static int	makphy_service(struct mii_softc *, struct mii_data *, int);
@@ -155,22 +156,24 @@ makphyattach(device_t parent, device_t s
 	struct mii_attach_args *ma = aux;
 	struct mii_data *mii = ma->mii_data;
 	const struct mii_phydesc *mpd;
+	struct makphy_softc *maksc = (struct makphy_softc *)sc;
 	const char *name;
-	uint16_t reg;
+	uint16_t reg, model;
 
 	mpd = mii_phy_match(ma, makphys);
 	aprint_naive(": Media interface\n");
 	if (mpd)
 		name = mpd->mpd_name;
-	else if (makphy_isi210(parent, ma))
+	else if (makphy_isi210(parent, ma)) {
 		name = MII_STR_xxMARVELL_I210;
-	else
+		maksc->sc_flags |= MAKPHY_F_I210;
+	} else
 		panic("Unknown PHY");
 	aprint_normal(": %s, rev. %d\n", name, MII_REV(ma->mii_id2));
 
 	sc->mii_dev = self;
 	sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2);
-	sc->mii_mpd_model = MII_MODEL(ma->mii_id2);
+	sc->mii_mpd_model = model = MII_MODEL(ma->mii_id2);
 	sc->mii_mpd_rev = MII_REV(ma->mii_id2);
 	sc->mii_inst = mii->mii_instance;
 	sc->mii_phy = ma->mii_phyno;
@@ -179,10 +182,26 @@ makphyattach(device_t parent, device_t s
 	sc->mii_flags = ma->mii_flags;
 	sc->mii_anegticks = MII_ANEGTICKS;
 
-	/* Make sure page 0 is selected. */
-	PHY_WRITE(sc, MAKPHY_EADR, 0);
+	switch (model) {
+	case MII_MODEL_xxMARVELL_E1000:
+		if ((maksc->sc_flags & MAKPHY_F_I210) != 0)
+			goto page0;
+		/* FALLTHROUGH */
+	case MII_MODEL_xxMARVELL_E1000_3:
+	case MII_MODEL_xxMARVELL_E1000S:
+	case MII_MODEL_xxMARVELL_E1000_5:
+		/* 88E1000 series has no EADR */
+		break;
+	default:
+page0:
+		/* Make sure page 0 is selected. */
+		if (PHY_WRITE(sc, MAKPHY_EADR, 0) != 0)
+			aprint_verbose_dev(self,
+			"Failed to access EADR. Are you an emulator?\n");
+		break;
+	}
 
-	switch (sc->mii_mpd_model) {
+	switch (model) {
 	case MII_MODEL_xxMARVELL_E1011:
 	case MII_MODEL_xxMARVELL_E1112:
 		PHY_READ(sc, MAKPHY_ESSR, );
@@ -212,6 +231,7 @@ makphyattach(device_t parent, device_t s
 static void
 makphy_reset(struct mii_softc *sc)
 {
+	struct makphy_softc *maksc = (struct makphy_softc *)sc;
 	uint16_t reg;
 
 	mii_phy_reset(sc);
@@ -224,6 +244,9 @@ makphy_reset(struct mii_softc *sc)
 	/* Assert CRS on transmit. */
 	switch (sc->mii_mpd_model) {
 	case MII_MODEL_MARVELL_E1000_0:
+		if ((maksc->sc_flags & MAKPHY_F_I210) != 0)
+			break;
+		/* FALLTHROUGH */
 	case MII_MODEL_MARVELL_E1000_3:
 	case MII_MODEL_MARVELL_E1000_5:
 	case MII_MODEL_MARVELL_E1000_6:

Added files:

Index: src/sys/dev/mii/makphyvar.h
diff -u /dev/null src/sys/dev/mii/makphyvar.h:1.1
--- /dev/null	Mon Mar 25 05:39:51 2019
+++ src/sys/dev/mii/makphyvar.h	Mon Mar 25 05:39:51 2019
@@ -0,0 +1,42 @@
+/* $NetBSD: makphyvar.h,v 1.1 2019/03/25 05:39:51 msaitoh Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of 

CVS commit: src/sys/dev/pci

2019-03-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar 25 05:32:01 UTC 2019

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

Log Message:
 Pass error status to the upper layer in wm_gmii_{i82544,i80003}*().


To generate a diff of this commit:
cvs rdiff -u -r1.631 -r1.632 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.631 src/sys/dev/pci/if_wm.c:1.632
--- src/sys/dev/pci/if_wm.c:1.631	Tue Mar  5 03:49:06 2019
+++ src/sys/dev/pci/if_wm.c	Mon Mar 25 05:32:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.631 2019/03/05 03:49:06 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.632 2019/03/25 05:32:01 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.631 2019/03/05 03:49:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.632 2019/03/25 05:32:01 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10641,14 +10641,17 @@ static int
 wm_gmii_i82544_readreg_locked(device_t dev, int phy, int reg, uint16_t *val)
 {
 	struct wm_softc *sc = device_private(dev);
+	int rv;
 
 	if (reg > BME1000_MAX_MULTI_PAGE_REG) {
 		switch (sc->sc_phytype) {
 		case WMPHY_IGP:
 		case WMPHY_IGP_2:
 		case WMPHY_IGP_3:
-			wm_gmii_mdic_writereg(dev, phy, MII_IGPHY_PAGE_SELECT,
-			reg);
+			rv = wm_gmii_mdic_writereg(dev, phy,
+			MII_IGPHY_PAGE_SELECT, reg);
+			if (rv != 0)
+return rv;
 			break;
 		default:
 #ifdef WM_DEBUG
@@ -10659,9 +10662,7 @@ wm_gmii_i82544_readreg_locked(device_t d
 		}
 	}
 	
-	wm_gmii_mdic_readreg(dev, phy, reg & MII_ADDRMASK, val);
-
-	return 0;
+	return wm_gmii_mdic_readreg(dev, phy, reg & MII_ADDRMASK, val);
 }
 
 /*
@@ -10690,14 +10691,17 @@ static int
 wm_gmii_i82544_writereg_locked(device_t dev, int phy, int reg, uint16_t val)
 {
 	struct wm_softc *sc = device_private(dev);
+	int rv;
 
 	if (reg > BME1000_MAX_MULTI_PAGE_REG) {
 		switch (sc->sc_phytype) {
 		case WMPHY_IGP:
 		case WMPHY_IGP_2:
 		case WMPHY_IGP_3:
-			wm_gmii_mdic_writereg(dev, phy, MII_IGPHY_PAGE_SELECT,
-			reg);
+			rv = wm_gmii_mdic_writereg(dev, phy,
+			MII_IGPHY_PAGE_SELECT, reg);
+			if (rv != 0)
+return rv;
 			break;
 		default:
 #ifdef WM_DEBUG
@@ -10708,9 +10712,7 @@ wm_gmii_i82544_writereg_locked(device_t 
 		}
 	}
 			
-	wm_gmii_mdic_writereg(dev, phy, reg & MII_ADDRMASK, val);
-
-	return 0;
+	return wm_gmii_mdic_writereg(dev, phy, reg & MII_ADDRMASK, val);
 }
 
 /*
@@ -10755,8 +10757,8 @@ wm_gmii_i80003_readreg(device_t dev, int
 		 * register.
 		 */
 		delay(200);
-		wm_gmii_mdic_readreg(dev, phy, page_select, );
-		if (temp2 != temp) {
+		rv = wm_gmii_mdic_readreg(dev, phy, page_select, );
+		if ((rv != 0) || (temp2 != temp)) {
 			device_printf(dev, "%s failed\n", __func__);
 			rv = -1;
 			goto out;
@@ -10813,8 +10815,8 @@ wm_gmii_i80003_writereg(device_t dev, in
 		 * register.
 		 */
 		delay(200);
-		wm_gmii_mdic_readreg(dev, phy, page_select, );
-		if (temp2 != temp) {
+		rv = wm_gmii_mdic_readreg(dev, phy, page_select, );
+		if ((rv != 0) || (temp2 != temp)) {
 			device_printf(dev, "%s failed\n", __func__);
 			rv = -1;
 			goto out;



CVS commit: src/sys/net

2019-03-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Mar 25 04:06:36 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
 Revert rev. 1.151 and 1.152 to avoid compile error. Requested by pgoyette.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.152 src/sys/net/if_tun.c:1.153
--- src/sys/net/if_tun.c:1.152	Mon Mar 25 02:58:28 2019
+++ src/sys/net/if_tun.c	Mon Mar 25 04:06:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.152 2019/03/25 02:58:28 pgoyette Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.153 2019/03/25 04:06:36 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.152 2019/03/25 02:58:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.153 2019/03/25 04:06:36 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -194,7 +194,7 @@ tun_find_zunit(int unit)
 		if (unit == tp->tun_unit)
 			break;
 	if (tp)
-		LIST_REMOVE(tp, tunz_softc_list);
+		LIST_REMOVE(tp, tun_list);
 	mutex_exit(_softc_lock);
 	KASSERTMSG(!tp || (tp->tun_flags & (TUN_INITED|TUN_OPEN)) == TUN_OPEN,
 	"tun%d: inconsistent flags: %x", unit, tp->tun_flags);



CVS commit: src/sys/net

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar 25 02:58:28 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
Use correct list name


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.151 src/sys/net/if_tun.c:1.152
--- src/sys/net/if_tun.c:1.151	Mon Mar 25 01:06:34 2019
+++ src/sys/net/if_tun.c	Mon Mar 25 02:58:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.151 2019/03/25 01:06:34 pgoyette Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.152 2019/03/25 02:58:28 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.151 2019/03/25 01:06:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.152 2019/03/25 02:58:28 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -194,7 +194,7 @@ tun_find_zunit(int unit)
 		if (unit == tp->tun_unit)
 			break;
 	if (tp)
-		LIST_REMOVE(tp, tunz_list);
+		LIST_REMOVE(tp, tunz_softc_list);
 	mutex_exit(_softc_lock);
 	KASSERTMSG(!tp || (tp->tun_flags & (TUN_INITED|TUN_OPEN)) == TUN_OPEN,
 	"tun%d: inconsistent flags: %x", unit, tp->tun_flags);



CVS commit: src/sbin

2019-03-24 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Mar 25 02:13:01 UTC 2019

Modified Files:
src/sbin/dump: dump.8 dump.h itime.c main.c
src/sbin/dump_lfs: dump_lfs.8

Log Message:
Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry

This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sbin/dump/dump.8
cvs rdiff -u -r1.56 -r1.57 src/sbin/dump/dump.h
cvs rdiff -u -r1.21 -r1.22 src/sbin/dump/itime.c
cvs rdiff -u -r1.74 -r1.75 src/sbin/dump/main.c
cvs rdiff -u -r1.17 -r1.18 src/sbin/dump_lfs/dump_lfs.8

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

Modified files:

Index: src/sbin/dump/dump.8
diff -u src/sbin/dump/dump.8:1.69 src/sbin/dump/dump.8:1.70
--- src/sbin/dump/dump.8:1.69	Sun Jul 15 06:14:13 2018
+++ src/sbin/dump/dump.8	Mon Mar 25 02:13:01 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dump.8,v 1.69 2018/07/15 06:14:13 dholland Exp $
+.\"	$NetBSD: dump.8,v 1.70 2019/03/25 02:13:01 manu Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	 Regents of the University of California.
@@ -51,6 +51,7 @@
 .Op Fl r Ar cachesize
 .Op Fl s Ar feet
 .Op Fl T Ar date
+.Op Fl U Ar dumpdev
 .Op Fl x Ar snap-backup
 .Ar files-to-dump
 .Nm
@@ -299,10 +300,22 @@ The file
 .Pa /etc/dumpdates
 may be edited to change any of the fields,
 if necessary.
-If a list of files or subdirectories is being dumped
+If the
+.Fl T
+option is used or if a list of files or subdirectories is being dumped
 (as opposed to an entire file system), then
 .Fl u
 is ignored.
+.It Fl U Ar dumpdev
+Same as
+.Fl u
+but specifies the device in
+.Pa /etc/dumpdates
+as
+.Ar dumpdev .
+This option can be used with subdir dumps and with the
+.Fl T
+option.
 .It Fl W
 .Nm
 tells the operator what file systems need to be dumped.

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.56 src/sbin/dump/dump.h:1.57
--- src/sbin/dump/dump.h:1.56	Fri Mar  1 16:42:11 2019
+++ src/sbin/dump/dump.h	Mon Mar 25 02:13:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.56 2019/03/01 16:42:11 christos Exp $	*/
+/*	$NetBSD: dump.h,v 1.57 2019/03/25 02:13:01 manu Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -115,6 +115,7 @@ const char *temp;	/* name of the file fo
 char	lastlevel;	/* dump level of previous dump */
 char	level;		/* dump level of this dump */
 int	uflag;		/* update flag */
+const char *dumpdev;	/* device name in dumpdates */
 int	eflag;		/* eject flag */
 int	lflag;		/* autoload flag */
 int	diskfd;		/* disk file descriptor */

Index: src/sbin/dump/itime.c
diff -u src/sbin/dump/itime.c:1.21 src/sbin/dump/itime.c:1.22
--- src/sbin/dump/itime.c:1.21	Fri Mar  1 16:42:11 2019
+++ src/sbin/dump/itime.c	Mon Mar 25 02:13:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: itime.c,v 1.21 2019/03/01 16:42:11 christos Exp $	*/
+/*	$NetBSD: itime.c,v 1.22 2019/03/25 02:13:01 manu Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)itime.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: itime.c,v 1.21 2019/03/01 16:42:11 christos Exp $");
+__RCSID("$NetBSD: itime.c,v 1.22 2019/03/25 02:13:01 manu Exp $");
 #endif
 #endif /* not lint */
 
@@ -129,9 +129,9 @@ getdumptime(void)
 {
 	struct dumpdates *ddp;
 	int i;
-	char *fname;
+	const char *fname;
 
-	fname = disk;
+	fname = dumpdev ? dumpdev : disk;
 #ifdef FDEBUG
 	msg("Looking for name %s in dumpdates = %s for level = %c\n",
 		fname, dumpdates, level);
@@ -170,15 +170,15 @@ putdumptime(void)
 	struct dumpdates *dtwalk, *dtfound;
 	int i;
 	int fd;
-	char *fname;
+	const char *fname;
 
-	if(uflag == 0)
+	if (uflag == 0 && dumpdev == NULL)
 		return;
 	if ((df = fopen(dumpdates, "r+")) == NULL)
 		quite(errno, "cannot rewrite %s", dumpdates);
 	fd = fileno(df);
 	(void) flock(fd, LOCK_EX);
-	fname = disk;
+	fname = dumpdev ? dumpdev : disk;
 	free((char *)ddatev);
 	ddatev = 0;
 	nddates = 0;

Index: src/sbin/dump/main.c
diff -u src/sbin/dump/main.c:1.74 src/sbin/dump/main.c:1.75
--- src/sbin/dump/main.c:1.74	Fri Mar  1 16:42:11 2019
+++ src/sbin/dump/main.c	Mon Mar 25 02:13:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.74 2019/03/01 16:42:11 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.74 2019/03/01 16:42:11 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $");
 #endif
 #endif /* not lint */
 
@@ -133,7 +133,7 @@ main(int argc, char *argv[])
 
 	obsolete(, );
 	while ((ch = getopt(argc, argv,
-	"0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uWwx:X")) != -1)
+	"0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
 		switch 

CVS commit: src/sys/net

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar 25 01:06:35 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
This should do it!

Remove the zombie unit from the zombie list, not the regular list!


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.150 src/sys/net/if_tun.c:1.151
--- src/sys/net/if_tun.c:1.150	Mon Mar 25 01:01:29 2019
+++ src/sys/net/if_tun.c	Mon Mar 25 01:06:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.150 2019/03/25 01:01:29 pgoyette Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.151 2019/03/25 01:06:34 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.150 2019/03/25 01:01:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.151 2019/03/25 01:06:34 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -194,7 +194,7 @@ tun_find_zunit(int unit)
 		if (unit == tp->tun_unit)
 			break;
 	if (tp)
-		LIST_REMOVE(tp, tun_list);
+		LIST_REMOVE(tp, tunz_list);
 	mutex_exit(_softc_lock);
 	KASSERTMSG(!tp || (tp->tun_flags & (TUN_INITED|TUN_OPEN)) == TUN_OPEN,
 	"tun%d: inconsistent flags: %x", unit, tp->tun_flags);



CVS commit: src/sys/net

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar 25 01:01:29 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
And revert both of the previous.  It seems that the structure has
already been removed from the list in the find_zunit() code.

So now, off to really find out why the module won't unload.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.149 src/sys/net/if_tun.c:1.150
--- src/sys/net/if_tun.c:1.149	Mon Mar 25 00:59:04 2019
+++ src/sys/net/if_tun.c	Mon Mar 25 01:01:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.149 2019/03/25 00:59:04 pgoyette Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.150 2019/03/25 01:01:29 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.149 2019/03/25 00:59:04 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.150 2019/03/25 01:01:29 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -369,7 +369,6 @@ tunclose(dev_t dev, int flag, int mode,
 		softint_disestablish(tp->tun_osih);
 		softint_disestablish(tp->tun_isih);
 		mutex_destroy(>tun_lock);
-		LIST_REMOVE(tp, tunz_list);
 		kmem_free(tp, sizeof(*tp));
 		return 0;
 	}



CVS commit: src/sys/net

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar 25 00:59:04 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
Fix previous - remove it from the list before freeing the memory.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.148 src/sys/net/if_tun.c:1.149
--- src/sys/net/if_tun.c:1.148	Mon Mar 25 00:55:28 2019
+++ src/sys/net/if_tun.c	Mon Mar 25 00:59:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.149 2019/03/25 00:59:04 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.149 2019/03/25 00:59:04 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -369,8 +369,8 @@ tunclose(dev_t dev, int flag, int mode,
 		softint_disestablish(tp->tun_osih);
 		softint_disestablish(tp->tun_isih);
 		mutex_destroy(>tun_lock);
-		kmem_free(tp, sizeof(*tp));
 		LIST_REMOVE(tp, tunz_list);
+		kmem_free(tp, sizeof(*tp));
 		return 0;
 	}
 



CVS commit: src/sys/net

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar 25 00:55:28 UTC 2019

Modified Files:
src/sys/net: if_tun.c

Log Message:
If the unit being closed was a "zombie" (ie, the interface was destroyed
previously), remove it from the zombie list after freeing all of its
resources.

This should allow the module to be unloaded even if there was a zombie
at some point.  Without this change, the zombie list never gets emptied.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.147 src/sys/net/if_tun.c:1.148
--- src/sys/net/if_tun.c:1.147	Mon Sep  3 16:29:35 2018
+++ src/sys/net/if_tun.c	Mon Mar 25 00:55:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.147 2018/09/03 16:29:35 riastradh Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.147 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -370,6 +370,7 @@ tunclose(dev_t dev, int flag, int mode,
 		softint_disestablish(tp->tun_isih);
 		mutex_destroy(>tun_lock);
 		kmem_free(tp, sizeof(*tp));
+		LIST_REMOVE(tp, tunz_list);
 		return 0;
 	}
 



CVS commit: src/lib/libedit

2019-03-24 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Mar 24 16:42:49 UTC 2019

Modified Files:
src/lib/libedit: filecomplete.c

Log Message:
Only quote the completion matches if we are doing filename completion

If the user supplies a value for the attempted_completion_function parameter
then we cannot be sure if the completion is for filename or something else, in 
such
a case don't attempt to quote the completion matches.

Reviewed by christos

This should address PR lib/54067


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/lib/libedit/filecomplete.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/libedit/filecomplete.c
diff -u src/lib/libedit/filecomplete.c:1.51 src/lib/libedit/filecomplete.c:1.52
--- src/lib/libedit/filecomplete.c:1.51	Fri May  4 20:38:26 2018
+++ src/lib/libedit/filecomplete.c	Sun Mar 24 16:42:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecomplete.c,v 1.51 2018/05/04 20:38:26 christos Exp $	*/
+/*	$NetBSD: filecomplete.c,v 1.52 2019/03/24 16:42:49 abhinav Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.51 2018/05/04 20:38:26 christos Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.52 2019/03/24 16:42:49 abhinav Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -655,15 +655,19 @@ fn_complete(EditLine *el,
  * it, unless we do filename completion and the
  * object is a directory. Also do necessary escape quoting
  */
-char *escaped_completion = escape_filename(el, matches[0]);
-if (escaped_completion == NULL)
+char *completion;
+if (!attempted_completion_function)
+	completion = escape_filename(el, matches[0]);
+else
+	completion = strdup(matches[0]);
+if (completion == NULL)
 	goto out;
 el_winsertstr(el,
-	ct_decode_string(escaped_completion, >el_scratch));
+	ct_decode_string(completion, >el_scratch));
 el_winsertstr(el,
-		ct_decode_string((*app_func)(escaped_completion),
+		ct_decode_string((*app_func)(completion),
 			>el_scratch));
-free(escaped_completion);
+free(completion);
 			} else {
 /*
  * Only replace the completed string with common part of



CVS commit: src/sys/compat/linux/arch/alpha

2019-03-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Mar 24 16:39:47 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.106 -r1.107 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/alpha/linux_syscalls.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/compat/linux/arch/alpha/linux_syscall.h
diff -u src/sys/compat/linux/arch/alpha/linux_syscall.h:1.107 src/sys/compat/linux/arch/alpha/linux_syscall.h:1.108
--- src/sys/compat/linux/arch/alpha/linux_syscall.h:1.107	Fri Aug 10 21:47:14 2018
+++ src/sys/compat/linux/arch/alpha/linux_syscall.h	Sun Mar 24 16:39:46 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.h,v 1.107 2018/08/10 21:47:14 pgoyette Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.108 2019/03/24 16:39:46 maxv Exp $ */
 
 /*
  * System call numbers.
@@ -30,6 +30,9 @@
 /* syscall: "close" ret: "int" args: "int" */
 #define	LINUX_SYS_close	6
 
+/* syscall: "osf1_wait4" ret: "int" args: "int" "int *" "int" "struct osf1_rusage *" */
+#define	LINUX_SYS_osf1_wait4	7
+
 /* syscall: "creat" ret: "int" args: "const char *" "linux_umode_t" */
 #define	LINUX_SYS_creat	8
 
@@ -63,6 +66,9 @@
 /* syscall: "getpid_with_ppid" ret: "pid_t" args: */
 #define	LINUX_SYS_getpid_with_ppid	20
 
+/* syscall: "osf1_mount" ret: "int" args: "int" "const char *" "int" "void *" */
+#define	LINUX_SYS_osf1_mount	21
+
 /* syscall: "setuid" ret: "int" args: "uid_t" */
 #define	LINUX_SYS_setuid	23
 
@@ -90,6 +96,9 @@
 /* syscall: "pipe" ret: "int" args: */
 #define	LINUX_SYS_pipe	42
 
+/* syscall: "osf1_set_program_attributes" ret: "int" args: "void *" "unsigned long" "void *" "unsigned long" */
+#define	LINUX_SYS_osf1_set_program_attributes	43
+
 /* syscall: "open" ret: "int" args: "const char *" "int" "linux_umode_t" */
 #define	LINUX_SYS_open	45
 
@@ -156,6 +165,9 @@
 /* syscall: "setgroups" ret: "int" args: "int" "const gid_t *" */
 #define	LINUX_SYS_setgroups	80
 
+/* syscall: "osf1_setitimer" ret: "int" args: "int" "struct osf1_itimerval *" "struct osf1_itimerval *" */
+#define	LINUX_SYS_osf1_setitimer	83
+
 /* syscall: "gethostname" ret: "int" args: "char *" "u_int" */
 #define	LINUX_SYS_gethostname	87
 
@@ -171,6 +183,9 @@
 /* syscall: "fcntl" ret: "int" args: "int" "int" "void *" */
 #define	LINUX_SYS_fcntl	92
 
+/* syscall: "osf1_select" ret: "int" args: "u_int" "fd_set *" "fd_set *" "fd_set *" "struct osf1_timeval *" */
+#define	LINUX_SYS_osf1_select	93
+
 /* syscall: "poll" ret: "int" args: "struct pollfd *" "u_int" "int" */
 #define	LINUX_SYS_poll	94
 
@@ -222,6 +237,12 @@
 /* syscall: "sendmsg" ret: "ssize_t" args: "int" "const struct linux_msghdr *" "int" */
 #define	LINUX_SYS_sendmsg	114
 
+/* syscall: "osf1_gettimeofday" ret: "int" args: "struct osf1_timeval *" "struct osf1_timezone *" */
+#define	LINUX_SYS_osf1_gettimeofday	116
+
+/* syscall: "osf1_getrusage" ret: "int" args: "int" "struct osf1_rusage *" */
+#define	LINUX_SYS_osf1_getrusage	117
+
 /* syscall: "getsockopt" ret: "int" args: "int" "int" "int" "void *" "int *" */
 #define	LINUX_SYS_getsockopt	118
 
@@ -231,6 +252,9 @@
 /* syscall: "writev" ret: "ssize_t" args: "int" "const struct iovec *" "int" */
 #define	LINUX_SYS_writev	121
 
+/* syscall: "osf1_settimeofday" ret: "int" args: "struct osf1_timeval *" "struct osf1_timezone *" */
+#define	LINUX_SYS_osf1_settimeofday	122
+
 /* syscall: "__posix_fchown" ret: "int" args: "int" "uid_t" "gid_t" */
 #define	LINUX_SYS___posix_fchown	123
 
@@ -276,6 +300,9 @@
 /* syscall: "rmdir" ret: "int" args: "const char *" */
 #define	LINUX_SYS_rmdir	137
 
+/* syscall: "osf1_utimes" ret: "int" args: "const char *" "const struct osf1_timeval *" */
+#define	LINUX_SYS_osf1_utimes	138
+
 /* syscall: "getpeername" ret: "int" args: "int" "void *" "int *" */
 #define	LINUX_SYS_getpeername	141
 
@@ -297,6 +324,12 @@
 /* syscall: "getdirentries" ret: "int" args: "int" "char *" "u_int" "long *" */
 #define	LINUX_SYS_getdirentries	159
 
+/* syscall: "osf1_statfs" ret: "int" args: "const char *" "struct osf1_statfs *" "int" */
+#define	LINUX_SYS_osf1_statfs	160
+
+/* syscall: "osf1_fstatfs" ret: "int" args: "int" "struct osf1_statfs *" "int" */
+#define	LINUX_SYS_osf1_fstatfs	161
+
 /* syscall: "getdomainname" ret: "int" args: "char *" "int" */
 #define	LINUX_SYS_getdomainname	165
 
@@ -363,6 +396,18 @@
 /* syscall: "getsid" ret: "pid_t" args: "pid_t" */
 #define	LINUX_SYS_getsid	234
 
+/* syscall: "osf1_sysinfo" ret: "int" args: "int" "char *" "long" */
+#define	LINUX_SYS_osf1_sysinfo	241
+
+/* syscall: "osf1_usleep_thread" ret: "int" args: "struct osf1_timeval *" "struct 

CVS commit: src/sys/compat

2019-03-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Mar 24 16:24:20 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: files.linux_alpha syscalls.master
src/sys/compat/osf1: files.osf1
Added Files:
src/sys/compat/linux/arch/alpha: linux_osf1.c linux_osf1.h

Log Message:
Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/alpha/files.linux_alpha
cvs rdiff -u -r0 -r1.1 src/sys/compat/linux/arch/alpha/linux_osf1.c \
src/sys/compat/linux/arch/alpha/linux_osf1.h
cvs rdiff -u -r1.94 -r1.95 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/osf1/files.osf1

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/linux/arch/alpha/files.linux_alpha
diff -u src/sys/compat/linux/arch/alpha/files.linux_alpha:1.9 src/sys/compat/linux/arch/alpha/files.linux_alpha:1.10
--- src/sys/compat/linux/arch/alpha/files.linux_alpha:1.9	Tue May 31 20:53:13 2011
+++ src/sys/compat/linux/arch/alpha/files.linux_alpha	Sun Mar 24 16:24:19 2019
@@ -1,8 +1,9 @@
-#	$NetBSD: files.linux_alpha,v 1.9 2011/05/31 20:53:13 njoly Exp $
+#	$NetBSD: files.linux_alpha,v 1.10 2019/03/24 16:24:19 maxv Exp $
 #
 # Config file description for alpha-dependent Linux compat code.
 
 file	compat/linux/arch/alpha/linux_machdep.c		compat_linux
+file	compat/linux/arch/alpha/linux_osf1.c		compat_linux
 file	compat/linux/arch/alpha/linux_pipe.c		compat_linux
 file	compat/linux/arch/alpha/linux_syscalls.c	compat_linux
 file	compat/linux/arch/alpha/linux_sysent.c		compat_linux

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.94 src/sys/compat/linux/arch/alpha/syscalls.master:1.95
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.94	Fri Feb  3 16:17:08 2017
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sun Mar 24 16:24:19 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.94 2017/02/03 16:17:08 christos Exp $
+	$NetBSD: syscalls.master,v 1.95 2019/03/24 16:24:19 maxv Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -78,6 +78,7 @@
 ;#include 
 
 #include 
+#include 
 
 %%
 
@@ -89,7 +90,7 @@
 			size_t nbyte); }
 5	UNIMPL
 6	NOARGS		{ int|sys||close(int fd); }
-7	NODEF		{ int|osf1_sys||wait4(int pid, int *status, \
+7	STD		{ int|linux_sys||osf1_wait4(int pid, int *status, \
 			int options, struct osf1_rusage *rusage); }
 ;8	ALIAS		osf1_sys_old_creat, NOT USED
 8	STD		{ int|linux_sys||creat(const char *path, linux_umode_t mode); }
@@ -109,7 +110,7 @@
 19	NOARGS		{ long|compat_43_sys||lseek(int fd, long offset, \
 			int whence); }
 20	NOARGS		{ pid_t|sys||getpid_with_ppid(void); }
-21	NODEF		{ int|osf1_sys||mount(int type, const char *path, \
+21	STD		{ int|linux_sys||osf1_mount(int type, const char *path, \
 			int flags, void *data); }
 22	UNIMPL		umount
 23	NOARGS		{ int|sys||setuid(uid_t uid); }
@@ -133,7 +134,7 @@
 40	UNIMPL
 41	NOARGS		{ int|sys||dup(int fd); }
 42	NOARGS		{ int|linux_sys||pipe(void); }
-43	NODEF		{ int|osf1_sys||set_program_attributes( \
+43	STD		{ int|linux_sys||osf1_set_program_attributes( \
 			void *taddr, unsigned long tsize, \
 			void *daddr, unsigned long dsize); }
 44	UNIMPL
@@ -187,7 +188,7 @@
 80	NOARGS		{ int|sys||setgroups(int gidsetsize, const gid_t *gidset); }
 81	UNIMPL
 82	UNIMPL		setpgrp
-83	NODEF		{ int|osf1_sys||setitimer(int which, \
+83	STD		{ int|linux_sys||osf1_setitimer(int which, \
 			struct osf1_itimerval *itv, \
 			struct osf1_itimerval *oitv); }
 84	UNIMPL
@@ -201,7 +202,7 @@
 90	NOARGS		{ int|sys||dup2(int from, int to); }
 91	STD		{ int|linux_sys||fstat(int fd, struct linux_stat *sp); }
 92	STD		{ int|linux_sys||fcntl(int fd, int cmd, void *arg); }
-93	NODEF		{ int|osf1_sys||select(u_int nd, fd_set *in, \
+93	STD		{ int|linux_sys||osf1_select(u_int nd, fd_set *in, \
 			fd_set *ou, fd_set *ex, struct osf1_timeval *tv); }
 94	NOARGS		{ int|sys||poll(struct pollfd *fds, u_int nfds, \
 			int timeout); }
@@ -242,9 +243,9 @@
 114	STD		{ ssize_t|linux_sys||sendmsg(int s, \
 const struct linux_msghdr *msg, int flags); }
 115	UNIMPL
-116	NODEF		{ int|osf1_sys||gettimeofday(struct osf1_timeval *tv, \
+116	STD		{ int|linux_sys||osf1_gettimeofday(struct osf1_timeval *tv, \
 			struct osf1_timezone *tzp); }
-117	NODEF		{ int|osf1_sys||getrusage(int who, \
+117	STD		{ int|linux_sys||osf1_getrusage(int who, \
 			struct osf1_rusage *rusage); }
 118	STD		{ int|linux_sys||getsockopt(int s, int level, \
 int optname, void *optval, int *optlen); }
@@ -253,7 +254,7 @@
 int iovcnt); }
 121	NOARGS		{ ssize_t|sys||writev(int fd, const struct iovec *iovp, \
 int iovcnt); }
-122	NODEF		{ 

CVS commit: src/sys

2019-03-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Mar 24 15:58:32 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c
src/sys/compat/linux32/arch/amd64: linux32_machdep.c

Log Message:
Disable preemption when setting PCB_COMPAT32, to prevent a context switch
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT.
On NetBSD-current it is harmless, however in NetBSD-8 it might cause
panics, because NetBSD-8 uses the old SegRegs model and under this model
we reload %fs and %gs during switches.


To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.43 -r1.44 \
src/sys/compat/linux32/arch/amd64/linux32_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.328 src/sys/arch/amd64/amd64/machdep.c:1.329
--- src/sys/arch/amd64/amd64/machdep.c:1.328	Sun Mar 24 13:15:42 2019
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Mar 24 15:58:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.328 2019/03/24 13:15:42 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.329 2019/03/24 15:58:32 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.328 2019/03/24 13:15:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.329 2019/03/24 15:58:32 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -2237,12 +2237,12 @@ cpu_segregs32_zero(struct lwp *l)
 	struct pcb *pcb;
 	uint64_t zero = 0;
 
+	KASSERT(kpreempt_disabled());
 	KASSERT(l->l_proc->p_flag & PK_32);
 	KASSERT(l == curlwp);
 
 	pcb = lwp_getpcb(l);
 
-	kpreempt_disable();
 	tf->tf_fs = 0;
 	tf->tf_gs = 0;
 	setds(GSEL(GUDATA32_SEL, SEL_UPL));
@@ -2253,7 +2253,6 @@ cpu_segregs32_zero(struct lwp *l)
 	pcb->pcb_gs = 0;
 	update_descriptor(()->ci_gdt[GUFS_SEL], );
 	update_descriptor(()->ci_gdt[GUGS_SEL], );
-	kpreempt_enable();
 }
 
 /*

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.119 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.120
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.119	Fri Mar  1 11:06:55 2019
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Sun Mar 24 15:58:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.119 2019/03/01 11:06:55 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.120 2019/03/24 15:58:32 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.119 2019/03/01 11:06:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.120 2019/03/24 15:58:32 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -138,21 +138,22 @@ netbsd32_setregs(struct lwp *l, struct e
 
 	netbsd32_adjust_limits(p);
 
-	l->l_md.md_flags = MDL_COMPAT32;	/* Force iret not sysret */
-	pcb->pcb_flags = PCB_COMPAT32;
-
 	fpu_save_area_clear(l, pack->ep_osversion >= 699002600
 	?  __NetBSD_NPXCW__ : __NetBSD_COMPAT_NPXCW__);
-
 	x86_dbregs_clear(l);
 
+	kpreempt_disable();
+	pcb->pcb_flags = PCB_COMPAT32;
 	p->p_flag |= PK_32;
+	l->l_md.md_flags = MDL_COMPAT32;	/* force iret not sysret */
+	cpu_segregs32_zero(l);
+	cpu_fsgs_reload(l, LSEL(LUDATA32_SEL, SEL_UPL),
+	LSEL(LUDATA32_SEL, SEL_UPL));
+	kpreempt_enable();
 
 	tf = l->l_md.md_regs;
 	tf->tf_ds = LSEL(LUDATA32_SEL, SEL_UPL);
 	tf->tf_es = LSEL(LUDATA32_SEL, SEL_UPL);
-	cpu_segregs32_zero(l);
-	cpu_fsgs_reload(l, tf->tf_ds, tf->tf_es);
 	tf->tf_rdi = 0;
 	tf->tf_rsi = 0;
 	tf->tf_rbp = 0;

Index: src/sys/compat/linux32/arch/amd64/linux32_machdep.c
diff -u src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.43 src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.44
--- src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.43	Sat Oct 21 07:24:26 2017
+++ src/sys/compat/linux32/arch/amd64/linux32_machdep.c	Sun Mar 24 15:58:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_machdep.c,v 1.43 2017/10/21 07:24:26 maxv Exp $ */
+/*	$NetBSD: linux32_machdep.c,v 1.44 2019/03/24 15:58:32 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.43 2017/10/21 07:24:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.44 2019/03/24 15:58:32 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_user_ldt.h"
@@ -287,10 +287,14 @@ linux32_setregs(struct lwp *l, struct ex
 
 	fpu_save_area_clear(l, __Linux_NPXCW__);
 
-	l->l_md.md_flags = MDL_COMPAT32;	/* Forces iret not sysret */
+	kpreempt_disable();
 	pcb->pcb_flags = PCB_COMPAT32;
-
 	p->p_flag |= PK_32;
+	l->l_md.md_flags = 

CVS commit: src/sbin/gpt

2019-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 13:45:35 UTC 2019

Modified Files:
src/sbin/gpt: gpt.8 show.c

Log Message:
Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sbin/gpt/gpt.8
cvs rdiff -u -r1.42 -r1.43 src/sbin/gpt/show.c

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

Modified files:

Index: src/sbin/gpt/gpt.8
diff -u src/sbin/gpt/gpt.8:1.64 src/sbin/gpt/gpt.8:1.65
--- src/sbin/gpt/gpt.8:1.64	Sun Mar 24 13:31:00 2019
+++ src/sbin/gpt/gpt.8	Sun Mar 24 13:45:35 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.64 2019/03/24 13:31:00 martin Exp $
+.\" $NetBSD: gpt.8,v 1.65 2019/03/24 13:45:35 martin Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -466,7 +466,7 @@ See above for a description of these opt
 Partitions are removed by clearing the partition type.
 No other information is changed.
 .\"  resize 
-.It Nm Ic resize [ Fl i Ar index | Fl b Ar startsec ] Oo Fl a Ar alignment Oc \
+.It Nm Ic resize Oo Fl i Ar index Oc Oo Fl b Ar startsec Oc Oo Fl a Ar alignment Oc \
 Oo Fl s Ar size Oc
 The
 .Ic resize
@@ -592,7 +592,7 @@ They may be used by
 .Nx
 in the future.
 .\"  show 
-.It Nm Ic show Oo Fl aglu Oc Oo Fl i Ar index Oc
+.It Nm Ic show Oo Fl aglu Oc Oo Fl i Ar index Oc Oo Fl b Ar startsec Oc
 The
 .Ic show
 command displays the current partitioning on the listed devices and gives
@@ -611,6 +611,8 @@ option the GPT partition type is display
 user friendly form.
 With the
 .Fl i
+or the
+.Fl b
 option, all the details of a particular GPT partition will be displayed.
 The format of this display is subject to change.
 With the

Index: src/sbin/gpt/show.c
diff -u src/sbin/gpt/show.c:1.42 src/sbin/gpt/show.c:1.43
--- src/sbin/gpt/show.c:1.42	Sun Mar  3 03:20:42 2019
+++ src/sbin/gpt/show.c	Sun Mar 24 13:45:35 2019
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: show.c,v 1.42 2019/03/03 03:20:42 jnemeth Exp $");
+__RCSID("$NetBSD: show.c,v 1.43 2019/03/24 13:45:35 martin Exp $");
 #endif
 
 #include 
@@ -317,8 +317,10 @@ cmd_show(gpt_t gpt, int argc, char *argv
 	int ch;
 	int xshow = 0;
 	unsigned int entry = 0;
+	off_t start = 0;
+	map_t m;
 
-	while ((ch = getopt(argc, argv, "gi:lua")) != -1) {
+	while ((ch = getopt(argc, argv, "gi:b:lua")) != -1) {
 		switch(ch) {
 		case 'a':
 			xshow |= SHOW_ALL;
@@ -330,6 +332,10 @@ cmd_show(gpt_t gpt, int argc, char *argv
 			if (gpt_uint_get(gpt, ) == -1)
 return usage();
 			break;
+		case 'b':
+			if (gpt_human_get(gpt, ) == -1)
+return usage();
+			break;
 		case 'l':
 			xshow |= SHOW_LABEL;
 			break;
@@ -350,5 +356,17 @@ cmd_show(gpt_t gpt, int argc, char *argv
 	if (xshow & SHOW_ALL)
 		return show_all(gpt);
 
+	if (start > 0) {
+		for (m = map_first(gpt); m != NULL; m = m->map_next) {
+			if (m->map_type != MAP_TYPE_GPT_PART ||
+			m->map_index < 1)
+continue;
+			if (start != m->map_start)
+continue;
+			entry = m->map_index;
+			break;
+		}
+	}
+
 	return entry > 0 ? show_one(gpt, entry) : show(gpt, xshow);
 }



CVS commit: src/share/man/man4

2019-03-24 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Mar 24 13:31:31 UTC 2019

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/zyd.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/zyd.4
diff -u src/share/man/man4/zyd.4:1.6 src/share/man/man4/zyd.4:1.7
--- src/share/man/man4/zyd.4:1.6	Sun Mar 24 11:22:06 2019
+++ src/share/man/man4/zyd.4	Sun Mar 24 13:31:31 2019
@@ -1,5 +1,5 @@
 .\" $OpenBSD: zyd.4,v 1.22 2007/05/24 02:49:57 cnst Exp $
-.\" $NetBSD: zyd.4,v 1.6 2019/03/24 11:22:06 gson Exp $
+.\" $NetBSD: zyd.4,v 1.7 2019/03/24 13:31:31 gson Exp $
 .\"
 .\" Copyright (c) 1997, 1998, 1999
 .\" Bill Paul . All rights reserved.
@@ -31,7 +31,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 28, 2007
+.Dd March 24, 2019
 .Dt ZYD 4
 .Os
 .Sh NAME



CVS commit: src/sbin/gpt

2019-03-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 24 13:31:00 UTC 2019

Modified Files:
src/sbin/gpt: gpt.8 resize.c

Log Message:
Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sbin/gpt/gpt.8
cvs rdiff -u -r1.23 -r1.24 src/sbin/gpt/resize.c

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

Modified files:

Index: src/sbin/gpt/gpt.8
diff -u src/sbin/gpt/gpt.8:1.63 src/sbin/gpt/gpt.8:1.64
--- src/sbin/gpt/gpt.8:1.63	Tue May  1 21:16:02 2018
+++ src/sbin/gpt/gpt.8	Sun Mar 24 13:31:00 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.63 2018/05/01 21:16:02 kre Exp $
+.\" $NetBSD: gpt.8,v 1.64 2019/03/24 13:31:00 martin Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
 .\"
-.Dd May 1, 2018
+.Dd March 24, 2019
 .Dt GPT 8
 .Os
 .Sh NAME
@@ -466,7 +466,7 @@ See above for a description of these opt
 Partitions are removed by clearing the partition type.
 No other information is changed.
 .\"  resize 
-.It Nm Ic resize Fl i Ar index Oo Fl a Ar alignment Oc \
+.It Nm Ic resize [ Fl i Ar index | Fl b Ar startsec ] Oo Fl a Ar alignment Oc \
 Oo Fl s Ar size Oc
 The
 .Ic resize

Index: src/sbin/gpt/resize.c
diff -u src/sbin/gpt/resize.c:1.23 src/sbin/gpt/resize.c:1.24
--- src/sbin/gpt/resize.c:1.23	Tue Jul  3 03:41:24 2018
+++ src/sbin/gpt/resize.c	Sun Mar 24 13:31:00 2019
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: resize.c,v 1.23 2018/07/03 03:41:24 jnemeth Exp $");
+__RCSID("$NetBSD: resize.c,v 1.24 2019/03/24 13:31:00 martin Exp $");
 #endif
 
 #include 
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: resize.c,v 1.23 2018/0
 static int cmd_resize(gpt_t, int, char *[]);
 
 static const char *resizehelp[] = {
-	"-i index [-a alignment] [-s size]",
+	"[-i index | -b blocknr] [-a alignment] [-s size]",
 };
 
 struct gpt_cmd c_resize = {
@@ -131,17 +131,32 @@ static int
 cmd_resize(gpt_t gpt, int argc, char *argv[])
 {
 	int ch;
-	off_t alignment = 0, sectors, size = 0;
+	off_t alignment = 0, sectors, start = 0, size = 0;
 	unsigned int entry = 0;
+	map_t m;
 
-	while ((ch = getopt(argc, argv, GPT_AIS)) != -1) {
-		if (gpt_add_ais(gpt, , , , ch) == -1)
+	while ((ch = getopt(argc, argv, GPT_AIS "b:")) != -1) {
+		if (ch == 'b')
+			gpt_human_get(gpt, );
+		else if (gpt_add_ais(gpt, , , , ch) == -1)
 			return usage();
 	}
 
 	if (argc != optind)
 		return usage();
 
+	if (start > 0) {
+		for (m = map_first(gpt); m != NULL; m = m->map_next) {
+			if (m->map_type != MAP_TYPE_GPT_PART ||
+			m->map_index < 1)
+continue;
+			if (start != m->map_start)
+continue;
+			entry = m->map_index;
+			break;
+		}
+	}
+
 	if ((sectors = gpt_check_ais(gpt, alignment, entry, size)) == -1)
 		return -1;
 



CVS commit: src/sys

2019-03-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Mar 24 13:15:43 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/compat/linux/arch/amd64: linux_machdep.c

Log Message:
Fix a tiny race in setregs and linux_setregs. Between the moment we set
pcb_flags to zero, and the moment cpu_segregs64_zero resets pcb_gs, we may
be preempted.

If this happens, and if the calling LWP was a 32bit thread, when switching
back to that LWP, the context switcher sees that PCB_COMPAT32 is not set in
pcb_flags and tries to perform a 64bit context switch; but pcb_gs contains
a 32bit GDT descriptor, and not a 64bit GS.base value. The wrmsr therefore
faults because the value is non-canonical, and this fault is fatal.

Rearrange the code so that the update of pcb_flags and pcb_gs/pcb_fs is non
interruptible. This fixes the problem, tested with a reproducer (which
therefore doesn't work anymore).

Likely fixes PR/53993.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/linux/arch/amd64/linux_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.327 src/sys/arch/amd64/amd64/machdep.c:1.328
--- src/sys/arch/amd64/amd64/machdep.c:1.327	Sat Mar  9 08:42:25 2019
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Mar 24 13:15:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.327 2019/03/09 08:42:25 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.328 2019/03/24 13:15:42 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.327 2019/03/09 08:42:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.328 2019/03/24 13:15:42 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -1371,17 +1371,18 @@ setregs(struct lwp *l, struct exec_packa
 
 	fpu_save_area_clear(l, pack->ep_osversion >= 699002600
 	? __NetBSD_NPXCW__ : __NetBSD_COMPAT_NPXCW__);
-	pcb->pcb_flags = 0;
 	x86_dbregs_clear(l);
 
+	kpreempt_disable();
+	pcb->pcb_flags = 0;
 	l->l_proc->p_flag &= ~PK_32;
-
 	l->l_md.md_flags = MDL_IRET;
+	cpu_segregs64_zero(l);
+	kpreempt_enable();
 
 	tf = l->l_md.md_regs;
 	tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
 	tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
-	cpu_segregs64_zero(l);
 	tf->tf_rdi = 0;
 	tf->tf_rsi = 0;
 	tf->tf_rbp = 0;
@@ -2198,12 +2199,12 @@ cpu_segregs64_zero(struct lwp *l)
 	struct pcb *pcb;
 	uint64_t zero = 0;
 
+	KASSERT(kpreempt_disabled());
 	KASSERT((l->l_proc->p_flag & PK_32) == 0);
 	KASSERT(l == curlwp);
 
 	pcb = lwp_getpcb(l);
 
-	kpreempt_disable();
 	tf->tf_fs = 0;
 	tf->tf_gs = 0;
 	setds(GSEL(GUDATA_SEL, SEL_UPL));
@@ -2223,7 +2224,6 @@ cpu_segregs64_zero(struct lwp *l)
 	pcb->pcb_gs = 0;
 	update_descriptor(()->ci_gdt[GUFS_SEL], );
 	update_descriptor(()->ci_gdt[GUGS_SEL], );
-	kpreempt_enable();
 }
 
 /*

Index: src/sys/compat/linux/arch/amd64/linux_machdep.c
diff -u src/sys/compat/linux/arch/amd64/linux_machdep.c:1.56 src/sys/compat/linux/arch/amd64/linux_machdep.c:1.57
--- src/sys/compat/linux/arch/amd64/linux_machdep.c:1.56	Mon Jan  1 08:03:43 2018
+++ src/sys/compat/linux/arch/amd64/linux_machdep.c	Sun Mar 24 13:15:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.c,v 1.56 2018/01/01 08:03:43 maxv Exp $ */
+/*	$NetBSD: linux_machdep.c,v 1.57 2019/03/24 13:15:43 maxv Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.56 2018/01/01 08:03:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.57 2019/03/24 13:15:43 maxv Exp $");
 
 #include 
 #include 
@@ -91,11 +91,13 @@ linux_setregs(struct lwp *l, struct exec
 #endif
 
 	fpu_save_area_clear(l, __NetBSD_NPXCW__);
-	pcb->pcb_flags = 0;
 
+	kpreempt_disable();
+	pcb->pcb_flags = 0;
 	l->l_proc->p_flag &= ~PK_32;
-
 	l->l_md.md_flags = MDL_IRET;
+	cpu_segregs64_zero(l);
+	kpreempt_enable();
 
 	tf = l->l_md.md_regs;
 	tf->tf_rax = 0;
@@ -120,7 +122,6 @@ linux_setregs(struct lwp *l, struct exec
 	tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL);
 	tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
 	tf->tf_es = 0;
-	cpu_segregs64_zero(l);
 
 	return;
 }



CVS commit: src/share/man/man4

2019-03-24 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Mar 24 11:22:06 UTC 2019

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

Log Message:
Delete the sentence "Wired Equivalent Privacy (WEP) is the de facto
encryption standard for wireless networks", because it no longer is.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/zyd.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/zyd.4
diff -u src/share/man/man4/zyd.4:1.5 src/share/man/man4/zyd.4:1.6
--- src/share/man/man4/zyd.4:1.5	Mon Jul  3 21:30:58 2017
+++ src/share/man/man4/zyd.4	Sun Mar 24 11:22:06 2019
@@ -1,5 +1,5 @@
 .\" $OpenBSD: zyd.4,v 1.22 2007/05/24 02:49:57 cnst Exp $
-.\" $NetBSD: zyd.4,v 1.5 2017/07/03 21:30:58 wiz Exp $
+.\" $NetBSD: zyd.4,v 1.6 2019/03/24 11:22:06 gson Exp $
 .\"
 .\" Copyright (c) 1997, 1998, 1999
 .\" Bill Paul . All rights reserved.
@@ -65,8 +65,6 @@ or to scan for access points.
 .Pp
 .Nm
 supports software WEP.
-Wired Equivalent Privacy (WEP) is the de facto encryption standard
-for wireless networks.
 It can be typically configured in one of three modes:
 no encryption; 40-bit encryption; or 104-bit encryption.
 Unfortunately, due to serious weaknesses in WEP protocol



CVS commit: src

2019-03-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Mar 24 11:20:26 UTC 2019

Modified Files:
src/distrib/sets/lists/modules: mi
src/sys/modules: Makefile
Added Files:
src/sys/modules/if_tap: Makefile tap.ioconf
src/sys/modules/tap: Makefile tap.c

Log Message:
Add a loadable module for tap(4).

The code was already modularized, we simply didn't build the loadable
module.

Note also that since the tap(4) device can be reasonably accessed by
either creating a  device instance (using ifconfig(8)) or by opening
/dev/tap, we need to create both if_tap.kmod and tap.kmod (similar to
what is done with tun(4)).


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.219 -r1.220 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_tap/Makefile \
src/sys/modules/if_tap/tap.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/tap/Makefile src/sys/modules/tap/tap.c

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

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.119 src/distrib/sets/lists/modules/mi:1.120
--- src/distrib/sets/lists/modules/mi:1.119	Wed Feb  6 11:55:05 2019
+++ src/distrib/sets/lists/modules/mi	Sun Mar 24 11:20:26 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.119 2019/02/06 11:55:05 rin Exp $
+# $NetBSD: mi,v 1.120 2019/03/24 11:20:26 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -228,6 +228,8 @@
 ./@MODULEDIR@/if_stf/if_stf.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_stripbase-kernel-modules	kmod
 ./@MODULEDIR@/if_strip/if_strip.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_tapbase-kernel-modules	kmod
+./@MODULEDIR@/if_tap/if_tap.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_tunbase-kernel-modules	kmod
 ./@MODULEDIR@/if_tun/if_tun.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_urebase-kernel-modules	kmod
@@ -416,6 +418,8 @@
 ./@MODULEDIR@/tmpfs/tmpfs.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/tprofbase-kernel-modules	kmod
 ./@MODULEDIR@/tprof/tprof.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/tapbase-kernel-modules	kmod
+./@MODULEDIR@/tap/tap.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/tunbase-kernel-modules	kmod
 ./@MODULEDIR@/tun/tun.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/twabase-obsolete		obsolete

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.219 src/sys/modules/Makefile:1.220
--- src/sys/modules/Makefile:1.219	Wed Feb  6 11:55:06 2019
+++ src/sys/modules/Makefile	Sun Mar 24 11:20:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.219 2019/02/06 11:55:06 rin Exp $
+#	$NetBSD: Makefile,v 1.220 2019/03/24 11:20:26 pgoyette Exp $
 
 .include 
 
@@ -87,6 +87,7 @@ SUBDIR+=	if_smsc
 SUBDIR+=	if_srt
 SUBDIR+=	if_stf
 SUBDIR+=	if_strip
+SUBDIR+=	if_tap tap
 SUBDIR+=	if_tun tun
 SUBDIR+=	if_ure
 SUBDIR+=	if_vlan

Added files:

Index: src/sys/modules/if_tap/Makefile
diff -u /dev/null src/sys/modules/if_tap/Makefile:1.1
--- /dev/null	Sun Mar 24 11:20:26 2019
+++ src/sys/modules/if_tap/Makefile	Sun Mar 24 11:20:26 2019
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2019/03/24 11:20:26 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		if_tap
+IOCONF=		tap.ioconf
+SRCS=		if_tap.c
+
+CPPFLAGS+=	-DINET
+CPPFLAGS+=	-DINET6
+
+.include 
Index: src/sys/modules/if_tap/tap.ioconf
diff -u /dev/null src/sys/modules/if_tap/tap.ioconf:1.1
--- /dev/null	Sun Mar 24 11:20:26 2019
+++ src/sys/modules/if_tap/tap.ioconf	Sun Mar 24 11:20:26 2019
@@ -0,0 +1,7 @@
+#	$NetBSD: tap.ioconf,v 1.1 2019/03/24 11:20:26 pgoyette Exp $
+
+ioconf		tap
+
+include		"conf/files"
+
+pseudo-device   tap

Index: src/sys/modules/tap/Makefile
diff -u /dev/null src/sys/modules/tap/Makefile:1.1
--- /dev/null	Sun Mar 24 11:20:26 2019
+++ src/sys/modules/tap/Makefile	Sun Mar 24 11:20:26 2019
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2019/03/24 11:20:26 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+KMOD=		tap
+SRCS=		tap.c
+
+.include 
Index: src/sys/modules/tap/tap.c
diff -u /dev/null src/sys/modules/tap/tap.c:1.1
--- /dev/null	Sun Mar 24 11:20:26 2019
+++ src/sys/modules/tap/tap.c	Sun Mar 24 11:20:26 2019
@@ -0,0 +1,51 @@
+/*	$NetBSD: tap.c,v 1.1 2019/03/24 11:20:26 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the 

CVS commit: src/external/mit/xorg/lib/fontconfig/src

2019-03-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Mar 24 10:39:45 UTC 2019

Modified Files:
src/external/mit/xorg/lib/fontconfig/src: Makefile

Log Message:
Make "includes" depend upon uuid/uuid.h (as already did
depends, dependall, and all) rather than unconditionally
"building" it.

This avoids a "file exists" error from an update build
(where the objdir already contained the link to the file.)

ok mrg@ :
 "if it works from a clean objdir, please commit it.  we can fix more later.."


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/external/mit/xorg/lib/fontconfig/src/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/fontconfig/src/Makefile
diff -u src/external/mit/xorg/lib/fontconfig/src/Makefile:1.24 src/external/mit/xorg/lib/fontconfig/src/Makefile:1.25
--- src/external/mit/xorg/lib/fontconfig/src/Makefile:1.24	Mon Mar 11 01:40:05 2019
+++ src/external/mit/xorg/lib/fontconfig/src/Makefile	Sun Mar 24 10:39:45 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2019/03/11 01:40:05 mrg Exp $
+#	$NetBSD: Makefile,v 1.25 2019/03/24 10:39:45 kre Exp $
 
 .include 
 
@@ -321,8 +321,8 @@ LIBUUID_DIST=	${NETBSDSRCDIR}/external/b
 .include "${LIBUUID_DIST}/libuuid_ul-rename.mk"
 SRCS+=	${UUID_UL_SRCS}
 
-depend dependall all: uuid/uuid.h
-includes uuid/uuid.h:
+includes depend dependall all: uuid/uuid.h
+uuid/uuid.h:
 	@-mkdir -p uuid
 	ln -s ${X11SRCDIR}/external/bsd/libuuid_ul/dist/uuid.h uuid/uuid.h