CVS commit: src/sys/dev/pci

2018-04-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 23 01:35:25 UTC 2018

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

Log Message:
- Backout if_wm.c rev.1.574 and print "device timeout (lost interrupt)"
 when all descriptors in a queue are free. When all descripters are free after
 wm_txeof(), it's caused by lost interrupt (though I've never seen it). One
 possibility is chip bug and another possibility is software bug. We should
 reset in any cases. If we don't reset and don't print error message, TX
 processing is done intermittently and user might not noticed the problem.

- Rename txq_watchdog to txq_sending to make the meaning clear.


To generate a diff of this commit:
cvs rdiff -u -r1.575 -r1.576 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.575 src/sys/dev/pci/if_wm.c:1.576
--- src/sys/dev/pci/if_wm.c:1.575	Mon Apr 23 01:29:23 2018
+++ src/sys/dev/pci/if_wm.c	Mon Apr 23 01:35:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.576 2018/04/23 01:35:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.576 2018/04/23 01:35:25 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -370,7 +370,7 @@ struct wm_txqueue {
 
 	bool txq_stopping;
 
-	bool txq_watchdog;
+	bool txq_sending;
 	time_t txq_lastsent;
 
 	uint32_t txq_packets;		/* for AIM */
@@ -3010,7 +3010,7 @@ wm_watchdog_txq(struct ifnet *ifp, struc
 {
 
 	mutex_enter(txq->txq_lock);
-	if (txq->txq_watchdog &&
+	if (txq->txq_sending &&
 	time_uptime - txq->txq_lastsent > wm_watchdog_timeout) {
 		wm_watchdog_txq_locked(ifp, txq, hang);
 	}
@@ -3032,14 +3032,17 @@ wm_watchdog_txq_locked(struct ifnet *ifp
 	 */
 	wm_txeof(txq, UINT_MAX);
 
-	if (txq->txq_free != WM_NTXDESC(txq)) {
+	if (txq->txq_sending)
+		*hang |= __BIT(wmq->wmq_id);
+
+	if (txq->txq_free == WM_NTXDESC(txq)) {
+		log(LOG_ERR, "%s: device timeout (lost interrupt)\n",
+		device_xname(sc->sc_dev));
+	} else {
 #ifdef WM_DEBUG
 		int i, j;
 		struct wm_txsoft *txs;
 #endif
-		if (txq->txq_watchdog)
-			*hang |= __BIT(wmq->wmq_id);
-
 		log(LOG_ERR,
 		"%s: device timeout (txfree %d txsfree %d txnext %d)\n",
 		device_xname(sc->sc_dev), txq->txq_free, txq->txq_sfree,
@@ -6011,7 +6014,7 @@ wm_stop_locked(struct ifnet *ifp, int di
 		struct wm_queue *wmq = >sc_queue[qidx];
 		struct wm_txqueue *txq = >wmq_txq;
 		mutex_enter(txq->txq_lock);
-		txq->txq_watchdog = false; /* ensure watchdog disabled */
+		txq->txq_sending = false; /* ensure watchdog disabled */
 		for (i = 0; i < WM_TXQUEUELEN(txq); i++) {
 			txs = >txq_soft[i];
 			if (txs->txs_mbuf != NULL) {
@@ -6700,7 +6703,7 @@ wm_init_tx_queue(struct wm_softc *sc, st
 	wm_init_tx_regs(sc, wmq, txq);
 	wm_init_tx_buffer(sc, txq);
 
-	txq->txq_watchdog = false;
+	txq->txq_sending = false;
 }
 
 static void
@@ -7467,7 +7470,7 @@ wm_send_common_locked(struct ifnet *ifp,
 	if (txq->txq_free != ofree) {
 		/* Set a watchdog timer in case the chip flakes out. */
 		txq->txq_lastsent = time_uptime;
-		txq->txq_watchdog = true;
+		txq->txq_sending = true;
 	}
 }
 
@@ -8041,7 +8044,7 @@ wm_nq_send_common_locked(struct ifnet *i
 	if (sent) {
 		/* Set a watchdog timer in case the chip flakes out. */
 		txq->txq_lastsent = time_uptime;
-		txq->txq_watchdog = true;
+		txq->txq_sending = true;
 	}
 }
 
@@ -8186,7 +8189,7 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	 * timer.
 	 */
 	if (txq->txq_sfree == WM_TXQUEUELEN(txq))
-		txq->txq_watchdog = false;
+		txq->txq_sending = false;
 
 	return more;
 }



CVS commit: src/sys/dev/pci

2018-04-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 23 01:35:25 UTC 2018

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

Log Message:
- Backout if_wm.c rev.1.574 and print "device timeout (lost interrupt)"
 when all descriptors in a queue are free. When all descripters are free after
 wm_txeof(), it's caused by lost interrupt (though I've never seen it). One
 possibility is chip bug and another possibility is software bug. We should
 reset in any cases. If we don't reset and don't print error message, TX
 processing is done intermittently and user might not noticed the problem.

- Rename txq_watchdog to txq_sending to make the meaning clear.


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



CVS commit: src/sys/dev/pci

2018-04-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 23 01:29:23 UTC 2018

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

Log Message:
 Count timeout correctly. This change reduce timeout value for 80003 as
expected. Reported by mouse@.


To generate a diff of this commit:
cvs rdiff -u -r1.574 -r1.575 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.574 src/sys/dev/pci/if_wm.c:1.575
--- src/sys/dev/pci/if_wm.c:1.574	Fri Apr 20 03:03:13 2018
+++ src/sys/dev/pci/if_wm.c	Mon Apr 23 01:29:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.574 2018/04/20 03:03:13 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.574 2018/04/20 03:03:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.575 2018/04/23 01:29:23 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -13069,7 +13069,7 @@ wm_get_swfw_semaphore(struct wm_softc *s
 	else
 		timeout = 200;
 
-	for (timeout = 0; timeout < 200; timeout++) {
+	while (timeout) {
 		if (wm_get_swsm_semaphore(sc)) {
 			aprint_error_dev(sc->sc_dev,
 			"%s: failed to get semaphore\n",
@@ -13085,6 +13085,7 @@ wm_get_swfw_semaphore(struct wm_softc *s
 		}
 		wm_put_swsm_semaphore(sc);
 		delay(5000);
+		timeout--;
 	}
 	printf("%s: failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
 	device_xname(sc->sc_dev), mask, swfw_sync);



CVS commit: src/sys/dev/pci

2018-04-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 23 01:29:23 UTC 2018

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

Log Message:
 Count timeout correctly. This change reduce timeout value for 80003 as
expected. Reported by mouse@.


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



CVS commit: src/sys/dev/usb

2018-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 22 20:32:27 UTC 2018

Modified Files:
src/sys/dev/usb: if_axe.c

Log Message:
merge duplicated code, back to logging error.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/usb/if_axe.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/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.87 src/sys/dev/usb/if_axe.c:1.88
--- src/sys/dev/usb/if_axe.c:1.87	Sat Apr 21 14:07:23 2018
+++ src/sys/dev/usb/if_axe.c	Sun Apr 22 16:32:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.87 2018/04/21 18:07:23 christos Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.88 2018/04/22 20:32:27 christos Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.87 2018/04/21 18:07:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.88 2018/04/22 20:32:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -523,6 +523,20 @@ axe_setmulti(struct axe_softc *sc)
 	axe_unlock_mii(sc);
 }
 
+static void
+axe_ax_init(struct axe_softc *sc)
+{
+	if (sc->axe_flags & AX178) {
+		axe_ax88178_init(sc);
+	} else if (sc->axe_flags & AX772) {
+		axe_ax88772_init(sc);
+	} else if (sc->axe_flags & AX772A) {
+		axe_ax88772a_init(sc);
+	} else if (sc->axe_flags & AX772B) {
+		axe_ax88772b_init(sc);
+	}
+}
+
 
 static void
 axe_reset(struct axe_softc *sc)
@@ -546,15 +560,8 @@ axe_reset(struct axe_softc *sc)
 #else
 	axe_lock_mii(sc);
 
-	if (sc->axe_flags & AX178) {
-		axe_ax88178_init(sc);
-	} else if (sc->axe_flags & AX772) {
-		axe_ax88772_init(sc);
-	} else if (sc->axe_flags & AX772A) {
-		axe_ax88772a_init(sc);
-	} else if (sc->axe_flags & AX772B) {
-		axe_ax88772b_init(sc);
-	}
+	axe_ax_init(sc);
+
 	axe_unlock_mii(sc);
 #endif
 }
@@ -971,20 +978,12 @@ axe_attach(device_t parent, device_t sel
 
 	/* Initialize controller and get station address. */
 
-	if (sc->axe_flags & AX178) {
-		axe_ax88178_init(sc);
-	} else if (sc->axe_flags & AX772) {
-		axe_ax88772_init(sc);
-	} else if (sc->axe_flags & AX772A) {
-		axe_ax88772a_init(sc);
-	} else if (sc->axe_flags & AX772B) {
-		axe_ax88772b_init(sc);
-	}
+	axe_ax_init(sc);
 
-	if (!(sc->axe_flags & AX772B)) {
+	if ((sc->axe_flags & AX772B) != 0) {
 		if (axe_cmd(sc, AXE_172_CMD_READ_NODEID, 0, 0, sc->axe_enaddr))
 		{
-			aprint_debug_dev(self,
+			aprint_error_dev(self,
 			"failed to read ethernet address\n");
 		}
 	}



CVS commit: src/sys/dev/usb

2018-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 22 20:32:27 UTC 2018

Modified Files:
src/sys/dev/usb: if_axe.c

Log Message:
merge duplicated code, back to logging error.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/usb/if_axe.c

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



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

2018-04-22 Thread Maxime Villard

I recently told membership-exec that I would be less outspoken, and more
convivial, so here's a try:

Le 22/04/2018 à 20:51, Joerg Sonnenberger a écrit :

On Sun, Apr 22, 2018 at 12:36:36PM +0200, Maxime Villard wrote:

Where are they? I haven't been made aware of any issue related to SVS+clang.


Yes, I did make you aware that SVS killed VirtualBox.


You are being dishonest. You did tell me that SVS didn't work with your
VirtualBox. At no point in time did you tell me that it was related to clang
or anything close to being a compiler issue, and not an implementation
issue.

In fact, if you want my point of view, you reported your "problem" in a way
that made me just unable to understand what it was about. I had to ask you
repeatedly, question after question, what is your virtualbox, what is your
cpu, is it hw-assisted, and so on.

In PR reports, we ask users to provide a minimal amount of information.

If you can't provide a full answer at once, and if I always have to ask one
more question all the time, you're just putting all the work on my side,
and I'm not going to use my crystal ball to try to guess what your exact
configuration or use-case is.

Having said that, I did review SVS when you reported your problem, I found
and fixed one issue, but it wasn't related to your problem.

Maxime


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

2018-04-22 Thread Joerg Sonnenberger
On Sun, Apr 22, 2018 at 12:36:36PM +0200, Maxime Villard wrote:
> Where are they? I haven't been made aware of any issue related to SVS+clang.

Yes, I did make you aware that SVS killed VirtualBox.

Joerg


CVS commit: [pgoyette-compat] src/distrib/sets/lists/modules

2018-04-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 22 12:45:10 UTC 2018

Modified Files:
src/distrib/sets/lists/modules [pgoyette-compat]: mi

Log Message:
Update sets lists for new compat_sysv_xx version-specific modules


To generate a diff of this commit:
cvs rdiff -u -r1.114.2.17 -r1.114.2.18 src/distrib/sets/lists/modules/mi

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

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.114.2.17 src/distrib/sets/lists/modules/mi:1.114.2.18
--- src/distrib/sets/lists/modules/mi:1.114.2.17	Tue Apr 17 08:02:35 2018
+++ src/distrib/sets/lists/modules/mi	Sun Apr 22 12:45:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.114.2.17 2018/04/17 08:02:35 pgoyette Exp $
+# $NetBSD: mi,v 1.114.2.18 2018/04/22 12:45:10 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -102,6 +102,12 @@
 ./@MODULEDIR@/compat_80/compat_80.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_ossaudio			base-kernel-modules	kmod
 ./@MODULEDIR@/compat_ossaudio/compat_ossaudio.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_10			base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_10/compat_sysv_10.kmod base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_14			base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_14/compat_sysv_14.kmod base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_50			base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv_50/compat_sysv_50.kmod base-kernel-modules	kmod
 ./@MODULEDIR@/compat_sysv			base-kernel-modules	kmod
 ./@MODULEDIR@/compat_sysv/compat_sysv.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/coredumpbase-kernel-modules	kmod



CVS commit: [pgoyette-compat] src/distrib/sets/lists/modules

2018-04-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 22 12:45:10 UTC 2018

Modified Files:
src/distrib/sets/lists/modules [pgoyette-compat]: mi

Log Message:
Update sets lists for new compat_sysv_xx version-specific modules


To generate a diff of this commit:
cvs rdiff -u -r1.114.2.17 -r1.114.2.18 src/distrib/sets/lists/modules/mi

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



Re: CVS commit: src/sys/dev/usb

2018-04-22 Thread Manuel Bouyer
On Sat, Apr 21, 2018 at 02:08:06PM -0400, Christos Zoulas wrote:
> On Apr 21,  6:18pm, bou...@antioche.eu.org (Manuel Bouyer) wrote:
> -- Subject: Re: CVS commit: src/sys/dev/usb
> 
> | unfortunably it doens't work for me (earmv7hf):
> | axe0: failed to read ethernet address
> | 
> | 1.84 works fine.
> 
> yes, because I turned a silent failure to an error. please try again.

It doens't help. Now the interface attaches but with no ethernet address:
[3.784317749] axe0 at uhub1 port 1
[3.784317749] axe0: vendor 05ac (0x5ac) product 1402 (0x1402), rev 
2.00/0.01, addr 2
[9.254457166] axe0: Ethernet address 00:00:00:00:00:00
[9.254457166] ukphy0 at axe0 phy 16: OUI 0x007063, model 0x0006, rev. 1
[9.454464708] ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 
auto

Also note the delay between axe0 being attached and the "Ethernet address"
printf.

For the rexcord here's the relevant dmesg info with the working 1.84:
[3.784548916] axe0 at uhub1 port 1
[3.784548916] axe0: vendor 05ac (0x5ac) product 1402 (0x1402), rev 
2.00/0.01, addr 2
[4.254560791] axe0: Ethernet address 38:c9:86:f1:6b:4d
[4.254560791] ukphy0 at axe0 phy 16: OUI 0x007063, model 0x0006, rev. 1
[4.254560791] ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, au
to

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


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

2018-04-22 Thread Kamil Rytarowski
On 22.04.2018 12:36, Maxime Villard wrote:
> Le 22/04/2018 à 12:32, Kamil Rytarowski a écrit :
>> On 22.04.2018 07:46, Maxime Villard wrote:
>>> Le 22/04/2018 à 01:25, Joerg Sonnenberger a écrit :
 Module Name:    src
 Committed By:    joerg
 Date:    Sat Apr 21 23:25:01 UTC 2018

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

 Log Message:
 Do not use movq for loading arbitrary 64bit immediates. The ISA
 restricts it to 32bit immediates.


 To generate a diff of this commit:
 cvs rdiff -u -r1.163 -r1.164 src/sys/arch/amd64/amd64/locore.S

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
>>>
>>> Mmh. Is there a compiler where this makes a difference? On NetBSD/GGG it
>>> doesn't (because if it did, SVS would never have worked), but I see that
>>> on MacOS the instruction indeed makes a difference, the encoding
>>> becomes:
>>>
>>>  movq    0x0, %rax
>>>
>>> Which is obviously not what we expect.
>>>
>>> Is this the problem you were having a few weeks ago? That is to say, the
>>> kernel that was crashing at boot time, did you compile it on another
>>> system/compiler that generated a "movq 0x0,%rax"?
>>>
>>> Anyway your change seems correct.
>>>
>>> Thanks,
>>> Maxime
>>
>> There are reports that the SVS kernel built by Clang doesn't work.
> 
> Where are they? I haven't been made aware of any issue related to
> SVS+clang.
> 
> (By the way, I sent [pullup-8 #786] this morning.)

I'm only aware about notification about the problem from users on IRC.



signature.asc
Description: OpenPGP digital signature


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

2018-04-22 Thread Maxime Villard

Le 22/04/2018 à 12:32, Kamil Rytarowski a écrit :

On 22.04.2018 07:46, Maxime Villard wrote:

Le 22/04/2018 à 01:25, Joerg Sonnenberger a écrit :

Module Name:src
Committed By:joerg
Date:Sat Apr 21 23:25:01 UTC 2018

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

Log Message:
Do not use movq for loading arbitrary 64bit immediates. The ISA
restricts it to 32bit immediates.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/amd64/amd64/locore.S

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


Mmh. Is there a compiler where this makes a difference? On NetBSD/GGG it
doesn't (because if it did, SVS would never have worked), but I see that
on MacOS the instruction indeed makes a difference, the encoding becomes:

 movq0x0, %rax

Which is obviously not what we expect.

Is this the problem you were having a few weeks ago? That is to say, the
kernel that was crashing at boot time, did you compile it on another
system/compiler that generated a "movq 0x0,%rax"?

Anyway your change seems correct.

Thanks,
Maxime


There are reports that the SVS kernel built by Clang doesn't work.


Where are they? I haven't been made aware of any issue related to SVS+clang.

(By the way, I sent [pullup-8 #786] this morning.)


CVS commit: src/sys/netipsec

2018-04-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Apr 22 10:25:40 UTC 2018

Modified Files:
src/sys/netipsec: ipip_var.h ipsec_netbsd.c xform_ipip.c

Log Message:
Rename ipip_allow->ipip_spoofcheck, and add net.inet.ipsec.ipip_spoofcheck.
Makes it simpler, and also fixes PR/39919.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/netipsec/ipip_var.h
cvs rdiff -u -r1.52 -r1.53 src/sys/netipsec/ipsec_netbsd.c
cvs rdiff -u -r1.66 -r1.67 src/sys/netipsec/xform_ipip.c

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



CVS commit: src/sys/netipsec

2018-04-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Apr 22 10:25:40 UTC 2018

Modified Files:
src/sys/netipsec: ipip_var.h ipsec_netbsd.c xform_ipip.c

Log Message:
Rename ipip_allow->ipip_spoofcheck, and add net.inet.ipsec.ipip_spoofcheck.
Makes it simpler, and also fixes PR/39919.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/netipsec/ipip_var.h
cvs rdiff -u -r1.52 -r1.53 src/sys/netipsec/ipsec_netbsd.c
cvs rdiff -u -r1.66 -r1.67 src/sys/netipsec/xform_ipip.c

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

Modified files:

Index: src/sys/netipsec/ipip_var.h
diff -u src/sys/netipsec/ipip_var.h:1.5 src/sys/netipsec/ipip_var.h:1.6
--- src/sys/netipsec/ipip_var.h:1.5	Thu Apr 19 08:27:38 2018
+++ src/sys/netipsec/ipip_var.h	Sun Apr 22 10:25:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipip_var.h,v 1.5 2018/04/19 08:27:38 maxv Exp $	*/
+/*	$NetBSD: ipip_var.h,v 1.6 2018/04/22 10:25:40 maxv Exp $	*/
 /*	$FreeBSD: ipip_var.h,v 1.1.4.1 2003/01/24 05:11:35 sam Exp $	*/
 /*	$OpenBSD: ip_ipip.h,v 1.5 2002/06/09 16:26:10 itojun Exp $ */
 /*
@@ -59,6 +59,6 @@
 #define	IPIP_NSTATS		10
 
 #ifdef _KERNEL
-extern	int ipip_allow;
+extern	int ipip_spoofcheck;
 #endif /* _KERNEL */
 #endif /* !_NETINET_IPIP_H_ */

Index: src/sys/netipsec/ipsec_netbsd.c
diff -u src/sys/netipsec/ipsec_netbsd.c:1.52 src/sys/netipsec/ipsec_netbsd.c:1.53
--- src/sys/netipsec/ipsec_netbsd.c:1.52	Wed Apr 18 07:38:02 2018
+++ src/sys/netipsec/ipsec_netbsd.c	Sun Apr 22 10:25:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_netbsd.c,v 1.52 2018/04/18 07:38:02 maxv Exp $	*/
+/*	$NetBSD: ipsec_netbsd.c,v 1.53 2018/04/22 10:25:40 maxv Exp $	*/
 /*	$KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $	*/
 /*	$KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.52 2018/04/18 07:38:02 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.53 2018/04/22 10:25:40 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -624,6 +624,12 @@ sysctl_net_inet_ipsec_setup(struct sysct
 		   CTL_NET, PF_INET, ipproto_ipsec,
 		   IPSECCTL_DEBUG, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, "ipip_spoofcheck", NULL,
+		   NULL, 0, _spoofcheck, 0,
+		   CTL_NET, PF_INET, ipproto_ipsec,
+		   CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READONLY,
 		   CTLTYPE_STRUCT, "ipsecstats", NULL,
 		   sysctl_net_inet_ipsec_stats, 0, NULL, 0,

Index: src/sys/netipsec/xform_ipip.c
diff -u src/sys/netipsec/xform_ipip.c:1.66 src/sys/netipsec/xform_ipip.c:1.67
--- src/sys/netipsec/xform_ipip.c:1.66	Thu Apr 19 08:27:39 2018
+++ src/sys/netipsec/xform_ipip.c	Sun Apr 22 10:25:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ipip.c,v 1.66 2018/04/19 08:27:39 maxv Exp $	*/
+/*	$NetBSD: xform_ipip.c,v 1.67 2018/04/22 10:25:40 maxv Exp $	*/
 /*	$FreeBSD: xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.66 2018/04/19 08:27:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.67 2018/04/22 10:25:40 maxv Exp $");
 
 /*
  * IP-inside-IP processing
@@ -87,7 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: xform_ipip.c
 /* XXX IPCOMP */
 #define	M_IPSEC	(M_AUTHIPHDR|M_AUTHIPDGM|M_DECRYPTED)
 
-int ipip_allow = 0;
+int ipip_spoofcheck = 1;
 percpu_t *ipipstat_percpu;
 
 void ipe4_attach(void);
@@ -254,7 +254,7 @@ _ipip_input(struct mbuf *m, int iphlen)
 	/* Check for local address spoofing. */
 	if ((m_get_rcvif_NOMPSAFE(m) == NULL ||
 	!(m_get_rcvif_NOMPSAFE(m)->if_flags & IFF_LOOPBACK)) &&
-	ipip_allow != 2) {
+	ipip_spoofcheck) {
 		int s = pserialize_read_enter();
 		IFNET_READER_FOREACH(ifp) {
 			IFADDR_READER_FOREACH(ifa, ifp) {



CVS commit: src/sys/dev/usb

2018-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Apr 22 07:47:15 UTC 2018

Modified Files:
src/sys/dev/usb: xhci.c

Log Message:
trigger the softint processing on that child bus which is not detached yet

fixes PR kern/53066 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/usb/xhci.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/usb

2018-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Apr 22 07:47:15 UTC 2018

Modified Files:
src/sys/dev/usb: xhci.c

Log Message:
trigger the softint processing on that child bus which is not detached yet

fixes PR kern/53066 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/usb/xhci.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/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.88 src/sys/dev/usb/xhci.c:1.89
--- src/sys/dev/usb/xhci.c:1.88	Sat Apr 21 15:53:24 2018
+++ src/sys/dev/usb/xhci.c	Sun Apr 22 07:47:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $	*/
+/*	$NetBSD: xhci.c,v 1.89 2018/04/22 07:47:14 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.89 2018/04/22 07:47:14 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1236,7 +1236,16 @@ xhci_intr(void *v)
 
 	ret = xhci_intr1(sc);
 	if (ret) {
-		usb_schedsoftintr(>sc_bus);
+		KASSERT(sc->sc_child || sc->sc_child2);
+
+		/*
+		 * One of child busses could be already detached. It doesn't
+		 * matter on which of the two the softintr is scheduled.
+		 */
+		if (sc->sc_child)
+			usb_schedsoftintr(>sc_bus);
+		else
+			usb_schedsoftintr(>sc_bus2);
 	}
 done:
 	mutex_spin_exit(>sc_intr_lock);



CVS commit: [pgoyette-compat] src

2018-04-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 22 07:20:30 UTC 2018

Modified Files:
src [pgoyette-compat]: UPDATING
src/bin/sh [pgoyette-compat]: arithmetic.c parser.c
src/crypto/external/bsd/netpgp/dist/src/lib [pgoyette-compat]:
libnetpgp.3
src/crypto/external/bsd/openssl/dist/crypto/rsa [pgoyette-compat]:
rsa_gen.c
src/distrib/sets/lists/base [pgoyette-compat]: shl.mi
src/distrib/sets/lists/comp [pgoyette-compat]: mi shl.mi
src/distrib/sets/lists/debug [pgoyette-compat]: shl.mi
src/doc [pgoyette-compat]: 3RDPARTY CHANGES CHANGES.prev
src/etc/defaults [pgoyette-compat]: rc.conf
src/external/bsd/am-utils/dist/fixmount [pgoyette-compat]: fixmount.8
src/external/bsd/file/dist [pgoyette-compat]: ChangeLog Makefile.in
README TODO aclocal.m4 compile config.guess config.h.in config.sub
configure configure.ac depcomp install-sh ltmain.sh missing
src/external/bsd/file/dist/doc [pgoyette-compat]: Makefile.in file.1
magic.5
src/external/bsd/file/dist/magic [pgoyette-compat]: Makefile.am
Makefile.in
src/external/bsd/file/dist/magic/magdir [pgoyette-compat]: acorn
animation apple archive audio c64 compress console elf filesystems
fonts games geo gnu images intel macintosh mozilla msdos msooxml
netbsd ole2compounddocs pgp revision riff sgml spectrum ssl
terminfo vorbis windows
src/external/bsd/file/dist/python [pgoyette-compat]: Makefile.in
src/external/bsd/file/dist/src [pgoyette-compat]: Makefile.am
Makefile.in apprentice.c ascmagic.c cdf.c compress.c encoding.c
file.c file.h file_opts.h funcs.c is_tar.c readcdf.c readelf.c
softmagic.c
src/external/bsd/file/dist/tests [pgoyette-compat]: Makefile.in
src/external/bsd/file/include [pgoyette-compat]: config.h
src/external/bsd/file/lib [pgoyette-compat]: Makefile shlib_version
src/external/gpl2/gmake/dist/glob [pgoyette-compat]: glob.c
src/external/gpl3/binutils/dist [pgoyette-compat]: config.guess
config.sub configure configure.ac
src/external/gpl3/binutils/dist/bfd [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in aoutx.h archive.c archures.c bfd-in2.h
bfd.c coff-alpha.c coffcode.h config.bfd configure configure.ac
configure.host cpu-mips.c cpu-or1k.c cpu-riscv.c dwarf2.c elf-bfd.h
elf-eh-frame.c elf.c elf32-arm.c elf32-avr.c elf32-hppa.c
elf32-i386.c elf32-m68k.c elf32-or1k.c elf32-ppc.c elf32-sh.c
elf32-vax.c elf64-alpha.c elf64-mips.c elf64-ppc.c elf64-x86-64.c
elflink.c elfn32-mips.c elfnn-riscv.c elfxx-mips.c elfxx-riscv.c
elfxx-riscv.h elfxx-sparc.c libbfd.h linker.c reloc.c syms.c
targets.c version.h
src/external/gpl3/binutils/dist/bfd/doc [pgoyette-compat]: Makefile.in
bfdt.texi bfdver.texi reloc.texi
src/external/gpl3/binutils/dist/binutils [pgoyette-compat]: ChangeLog
Makefile.in NEWS ar.c arsup.c bucomm.c configure objcopy.c
readelf.c strings.c
src/external/gpl3/binutils/dist/binutils/doc [pgoyette-compat]:
Makefile.am Makefile.in addr2line.1 ar.1 binutils.info
binutils.texi cxxfilt.man dlltool.1 elfedit.1 nlmconv.1 nm.1
objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1
windmc.1 windres.1
src/external/gpl3/binutils/dist/cpu [pgoyette-compat]: or1kcommon.cpu
src/external/gpl3/binutils/dist/gas [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in atof-generic.c configure configure.ac
configure.tgt remap.c write.c
src/external/gpl3/binutils/dist/gas/config [pgoyette-compat]:
atof-vax.c obj-elf.c tc-alpha.c tc-arm.c tc-m68k.c tc-mips.c
tc-mips.h tc-or1k.c tc-or1k.h tc-ppc.c tc-riscv.c tc-riscv.h
tc-sparc.c tc-vax.c tc-vax.h vax-inst.h
src/external/gpl3/binutils/dist/gas/doc [pgoyette-compat]: Makefile.am
Makefile.in as.1 as.info as.texinfo c-mips.texi c-ppc.texi
src/external/gpl3/binutils/dist/gold [pgoyette-compat]: Makefile.am
src/external/gpl3/binutils/dist/gprof [pgoyette-compat]: corefile.c
gprof.1 gprof.c gprof.info
src/external/gpl3/binutils/dist/include [pgoyette-compat]: bfdlink.h
dis-asm.h objalloc.h
src/external/gpl3/binutils/dist/include/elf [pgoyette-compat]: common.h
internal.h mips.h or1k.h ppc.h riscv.h
src/external/gpl3/binutils/dist/include/opcode [pgoyette-compat]:
hppa.h mips.h ppc.h riscv-opc.h riscv.h
src/external/gpl3/binutils/dist/ld [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in configure configure.ac configure.host

CVS commit: [pgoyette-compat] src

2018-04-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 22 07:20:30 UTC 2018

Modified Files:
src [pgoyette-compat]: UPDATING
src/bin/sh [pgoyette-compat]: arithmetic.c parser.c
src/crypto/external/bsd/netpgp/dist/src/lib [pgoyette-compat]:
libnetpgp.3
src/crypto/external/bsd/openssl/dist/crypto/rsa [pgoyette-compat]:
rsa_gen.c
src/distrib/sets/lists/base [pgoyette-compat]: shl.mi
src/distrib/sets/lists/comp [pgoyette-compat]: mi shl.mi
src/distrib/sets/lists/debug [pgoyette-compat]: shl.mi
src/doc [pgoyette-compat]: 3RDPARTY CHANGES CHANGES.prev
src/etc/defaults [pgoyette-compat]: rc.conf
src/external/bsd/am-utils/dist/fixmount [pgoyette-compat]: fixmount.8
src/external/bsd/file/dist [pgoyette-compat]: ChangeLog Makefile.in
README TODO aclocal.m4 compile config.guess config.h.in config.sub
configure configure.ac depcomp install-sh ltmain.sh missing
src/external/bsd/file/dist/doc [pgoyette-compat]: Makefile.in file.1
magic.5
src/external/bsd/file/dist/magic [pgoyette-compat]: Makefile.am
Makefile.in
src/external/bsd/file/dist/magic/magdir [pgoyette-compat]: acorn
animation apple archive audio c64 compress console elf filesystems
fonts games geo gnu images intel macintosh mozilla msdos msooxml
netbsd ole2compounddocs pgp revision riff sgml spectrum ssl
terminfo vorbis windows
src/external/bsd/file/dist/python [pgoyette-compat]: Makefile.in
src/external/bsd/file/dist/src [pgoyette-compat]: Makefile.am
Makefile.in apprentice.c ascmagic.c cdf.c compress.c encoding.c
file.c file.h file_opts.h funcs.c is_tar.c readcdf.c readelf.c
softmagic.c
src/external/bsd/file/dist/tests [pgoyette-compat]: Makefile.in
src/external/bsd/file/include [pgoyette-compat]: config.h
src/external/bsd/file/lib [pgoyette-compat]: Makefile shlib_version
src/external/gpl2/gmake/dist/glob [pgoyette-compat]: glob.c
src/external/gpl3/binutils/dist [pgoyette-compat]: config.guess
config.sub configure configure.ac
src/external/gpl3/binutils/dist/bfd [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in aoutx.h archive.c archures.c bfd-in2.h
bfd.c coff-alpha.c coffcode.h config.bfd configure configure.ac
configure.host cpu-mips.c cpu-or1k.c cpu-riscv.c dwarf2.c elf-bfd.h
elf-eh-frame.c elf.c elf32-arm.c elf32-avr.c elf32-hppa.c
elf32-i386.c elf32-m68k.c elf32-or1k.c elf32-ppc.c elf32-sh.c
elf32-vax.c elf64-alpha.c elf64-mips.c elf64-ppc.c elf64-x86-64.c
elflink.c elfn32-mips.c elfnn-riscv.c elfxx-mips.c elfxx-riscv.c
elfxx-riscv.h elfxx-sparc.c libbfd.h linker.c reloc.c syms.c
targets.c version.h
src/external/gpl3/binutils/dist/bfd/doc [pgoyette-compat]: Makefile.in
bfdt.texi bfdver.texi reloc.texi
src/external/gpl3/binutils/dist/binutils [pgoyette-compat]: ChangeLog
Makefile.in NEWS ar.c arsup.c bucomm.c configure objcopy.c
readelf.c strings.c
src/external/gpl3/binutils/dist/binutils/doc [pgoyette-compat]:
Makefile.am Makefile.in addr2line.1 ar.1 binutils.info
binutils.texi cxxfilt.man dlltool.1 elfedit.1 nlmconv.1 nm.1
objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1
windmc.1 windres.1
src/external/gpl3/binutils/dist/cpu [pgoyette-compat]: or1kcommon.cpu
src/external/gpl3/binutils/dist/gas [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in atof-generic.c configure configure.ac
configure.tgt remap.c write.c
src/external/gpl3/binutils/dist/gas/config [pgoyette-compat]:
atof-vax.c obj-elf.c tc-alpha.c tc-arm.c tc-m68k.c tc-mips.c
tc-mips.h tc-or1k.c tc-or1k.h tc-ppc.c tc-riscv.c tc-riscv.h
tc-sparc.c tc-vax.c tc-vax.h vax-inst.h
src/external/gpl3/binutils/dist/gas/doc [pgoyette-compat]: Makefile.am
Makefile.in as.1 as.info as.texinfo c-mips.texi c-ppc.texi
src/external/gpl3/binutils/dist/gold [pgoyette-compat]: Makefile.am
src/external/gpl3/binutils/dist/gprof [pgoyette-compat]: corefile.c
gprof.1 gprof.c gprof.info
src/external/gpl3/binutils/dist/include [pgoyette-compat]: bfdlink.h
dis-asm.h objalloc.h
src/external/gpl3/binutils/dist/include/elf [pgoyette-compat]: common.h
internal.h mips.h or1k.h ppc.h riscv.h
src/external/gpl3/binutils/dist/include/opcode [pgoyette-compat]:
hppa.h mips.h ppc.h riscv-opc.h riscv.h
src/external/gpl3/binutils/dist/ld [pgoyette-compat]: ChangeLog
Makefile.am Makefile.in configure configure.ac configure.host