CVS commit: src/sys/dev

2018-03-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 08:44:12 UTC 2018

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Follow previous entries, and list the imc and imcsmb devices twice,
once each for amd64 and i386


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.304 src/sys/dev/DEVNAMES:1.305
--- src/sys/dev/DEVNAMES:1.304	Thu Mar  1 04:31:22 2018
+++ src/sys/dev/DEVNAMES	Thu Mar  1 08:44:12 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.304 2018/03/01 04:31:22 pgoyette Exp $
+#	$NetBSD: DEVNAMES,v 1.305 2018/03/01 08:44:12 pgoyette Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -646,8 +646,10 @@ iic			acorn32
 ik			vax
 il			MI
 imc			sgimips
-imc			x86_64,i386
-imcsmb			x86_64,i386
+imc			amd64
+imc			i386
+imcsmb			amd64
+imcsmb			i386
 inphy			MI
 intersil7170		MI		Attribute
 interwave		MI		Attribute



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

2018-03-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar  1 13:54:37 UTC 2018

Modified Files:
src/sys/arch/macppc/dev: kauai.c

Log Message:
match K2 UATA, found in some G5


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/macppc/dev/kauai.c

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

Modified files:

Index: src/sys/arch/macppc/dev/kauai.c
diff -u src/sys/arch/macppc/dev/kauai.c:1.38 src/sys/arch/macppc/dev/kauai.c:1.39
--- src/sys/arch/macppc/dev/kauai.c:1.38	Fri Oct 20 07:06:07 2017
+++ src/sys/arch/macppc/dev/kauai.c	Thu Mar  1 13:54:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kauai.c,v 1.38 2017/10/20 07:06:07 jdolecek Exp $	*/
+/*	$NetBSD: kauai.c,v 1.39 2018/03/01 13:54:36 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2003 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.38 2017/10/20 07:06:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.39 2018/03/01 13:54:36 macallan Exp $");
 
 #include 
 #include 
@@ -94,6 +94,7 @@ kauai_match(device_t parent, cfdata_t ma
 		case PCI_PRODUCT_APPLE_UNINORTH_ATA:
 		case PCI_PRODUCT_APPLE_INTREPID2_ATA:
 		case PCI_PRODUCT_APPLE_SHASTA_ATA:
+		case PCI_PRODUCT_APPLE_K2_UATA:
 		return 5;
 		}
 	}



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

2018-03-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar  1 13:55:25 UTC 2018

Modified Files:
src/sys/arch/macppc/dev: uni-n.c

Log Message:
match /u3, found in some G5


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/dev/uni-n.c

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

Modified files:

Index: src/sys/arch/macppc/dev/uni-n.c
diff -u src/sys/arch/macppc/dev/uni-n.c:1.7 src/sys/arch/macppc/dev/uni-n.c:1.8
--- src/sys/arch/macppc/dev/uni-n.c:1.7	Fri Sep 15 21:33:52 2017
+++ src/sys/arch/macppc/dev/uni-n.c	Thu Mar  1 13:55:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uni-n.c,v 1.7 2017/09/15 21:33:52 macallan Exp $	*/
+/*	$NetBSD: uni-n.c,v 1.8 2018/03/01 13:55:25 macallan Exp $	*/
 
 /*-
  * Copyright (C) 2005 Michael Lorenz.
@@ -31,7 +31,7 @@
  */
  
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.7 2017/09/15 21:33:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uni-n.c,v 1.8 2018/03/01 13:55:25 macallan Exp $");
 
 #include 
 #include 
@@ -62,7 +62,8 @@ uni_n_match(device_t parent, cfdata_t cf
 	struct confargs *ca = aux;
 	char compat[32];
 	if ((strcmp(ca->ca_name, "uni-n") != 0) &&
-	(strcmp(ca->ca_name, "u4") != 0))
+	(strcmp(ca->ca_name, "u4") != 0) &&
+	(strcmp(ca->ca_name, "u3") != 0))
 		return 0;
 
 	memset(compat, 0, sizeof(compat));



CVS commit: src/sys/netinet

2018-03-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Mar  1 14:40:57 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Sprinkle some const.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.267 src/sys/netinet/if_arp.c:1.268
--- src/sys/netinet/if_arp.c:1.267	Sat Feb 24 07:53:15 2018
+++ src/sys/netinet/if_arp.c	Thu Mar  1 14:40:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.267 2018/02/24 07:53:15 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.268 2018/03/01 14:40:57 roy Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.267 2018/02/24 07:53:15 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.268 2018/03/01 14:40:57 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -222,10 +222,10 @@ static int log_unknown_network = 1;
 #define	LLA_ADDRSTRLEN	(16 * 3)
 
 static char *
-lla_snprintf(char *, uint8_t *, int);
+lla_snprintf(char *, const u_int8_t *, int);
 
 static char *
-lla_snprintf(char *dst, uint8_t *adrp, int len)
+lla_snprintf(char *dst, const u_int8_t *adrp, int len)
 {
 	int i;
 	char *p;



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

2018-03-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar  1 16:03:02 UTC 2018

Modified Files:
src/sys/arch/powerpc/pic: pic_openpic.c

Log Message:
use mapiodev() so this can work on G5s


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/powerpc/pic/pic_openpic.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/powerpc/pic/pic_openpic.c
diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.10 src/sys/arch/powerpc/pic/pic_openpic.c:1.11
--- src/sys/arch/powerpc/pic/pic_openpic.c:1.10	Thu Jun  1 02:45:07 2017
+++ src/sys/arch/powerpc/pic/pic_openpic.c	Thu Mar  1 16:03:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic_openpic.c,v 1.10 2017/06/01 02:45:07 chs Exp $ */
+/*	$NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.10 2017/06/01 02:45:07 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $");
 
 #include 
 #include 
@@ -54,7 +54,7 @@ setup_openpic(void *addr, int passthroug
 	int irq;
 	u_int x;
 
-	openpic_base = (void *)addr;
+	openpic_base = mapiodev((paddr_t)addr, 0x4, false);
 	opicops = kmem_alloc(sizeof(*opicops), KM_SLEEP);
 	pic = &opicops->pic;
 



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

2018-03-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar  1 16:49:07 UTC 2018

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

Log Message:
Remove these two KASSERTs. Thinking about it, they may fire when the user
enters "sysctl -w machdep.svs.enabled=0", if the xcall is received between
the 'svs_enabled' check in the caller and the same check in these KASSERTs.

In such a case we perform an SVS operation with svs_enabled set to false,
but that's intentional: after it is done svs_pmap_sync and svs_lwp_switch
won't be called anymore, the pdir synchronization is dropped.

Having said that, I didn't see these KASSERTs getting triggered.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/svs.c

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

Modified files:

Index: src/sys/arch/x86/x86/svs.c
diff -u src/sys/arch/x86/x86/svs.c:1.12 src/sys/arch/x86/x86/svs.c:1.13
--- src/sys/arch/x86/x86/svs.c:1.12	Sun Feb 25 13:15:35 2018
+++ src/sys/arch/x86/x86/svs.c	Thu Mar  1 16:49:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: svs.c,v 1.12 2018/02/25 13:15:35 maxv Exp $	*/
+/*	$NetBSD: svs.c,v 1.13 2018/03/01 16:49:06 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.12 2018/02/25 13:15:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.13 2018/03/01 16:49:06 maxv Exp $");
 
 #include "opt_svs.h"
 
@@ -455,7 +455,6 @@ svs_pmap_sync(struct pmap *pmap, int ind
 	struct cpu_info *ci;
 	cpuid_t cid;
 
-	KASSERT(svs_enabled);
 	KASSERT(pmap != NULL);
 	KASSERT(pmap != pmap_kernel());
 	KASSERT(mutex_owned(pmap->pm_lock));
@@ -488,8 +487,6 @@ svs_lwp_switch(struct lwp *oldlwp, struc
 	uintptr_t rsp0;
 	vaddr_t va;
 
-	KASSERT(svs_enabled);
-
 	if (newlwp->l_flag & LW_SYSTEM) {
 		return;
 	}



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

2018-03-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar  1 16:55:01 UTC 2018

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

Log Message:
Replace PG_G by pmap_pg_g, for the sake of removing references to the
former. No functional change since pmap_pg_g = PG_G.


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.281 src/sys/arch/x86/x86/pmap.c:1.282
--- src/sys/arch/x86/x86/pmap.c:1.281	Sun Feb 18 14:07:29 2018
+++ src/sys/arch/x86/x86/pmap.c	Thu Mar  1 16:55:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.281 2018/02/18 14:07:29 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.282 2018/03/01 16:55:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.281 2018/02/18 14:07:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.282 2018/03/01 16:55:01 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1672,7 +1672,7 @@ pmap_remap_global(void)
 	for ( ; kva < kva_end; kva += PAGE_SIZE) {
 		p1i = pl1_i(kva);
 		if (pmap_valid_entry(PTE_BASE[p1i]))
-			PTE_BASE[p1i] |= PG_G;
+			PTE_BASE[p1i] |= pmap_pg_g;
 	}
 
 	/* kernel segments */
@@ -1685,7 +1685,7 @@ pmap_remap_global(void)
 		for ( ; kva < kva_end; kva += PAGE_SIZE) {
 			p1i = pl1_i(kva);
 			if (pmap_valid_entry(PTE_BASE[p1i]))
-PTE_BASE[p1i] |= PG_G;
+PTE_BASE[p1i] |= pmap_pg_g;
 		}
 	}
 
@@ -1695,7 +1695,7 @@ pmap_remap_global(void)
 	for ( ; kva < kva_end; kva += PAGE_SIZE) {
 		p1i = pl1_i(kva);
 		if (pmap_valid_entry(PTE_BASE[p1i]))
-			PTE_BASE[p1i] |= PG_G;
+			PTE_BASE[p1i] |= pmap_pg_g;
 	}
 }
 #endif



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

2018-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar  1 17:15:14 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc [netbsd-8]: genassym.cf
src/lib/libc/arch/powerpc/gen [netbsd-8]: swapcontext.S

Log Message:
Pull up following revision(s) (requested by uwe in ticket #596):
lib/libc/arch/powerpc/genassym.cf: revision 1.5
lib/libc/arch/powerpc/gen/swapcontext.S: revision 1.8
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.
(oops, forgot to commit this along with swapcontext.S)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.18.1 src/lib/libc/arch/powerpc/genassym.cf
cvs rdiff -u -r1.7 -r1.7.18.1 src/lib/libc/arch/powerpc/gen/swapcontext.S

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

Modified files:

Index: src/lib/libc/arch/powerpc/genassym.cf
diff -u src/lib/libc/arch/powerpc/genassym.cf:1.4 src/lib/libc/arch/powerpc/genassym.cf:1.4.18.1
--- src/lib/libc/arch/powerpc/genassym.cf:1.4	Fri Aug 30 21:28:59 2013
+++ src/lib/libc/arch/powerpc/genassym.cf	Thu Mar  1 17:15:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2013/08/30 21:28:59 matt Exp $
+#	$NetBSD: genassym.cf,v 1.4.18.1 2018/03/01 17:15:13 martin Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ define CALLFRAME_R31	offsetof(struct cal
 
 define UC_GREGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1])
 define UC_GREGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3])
+define UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R30])
 define UC_GREGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 
 define SIG_BLOCK	SIG_BLOCK

Index: src/lib/libc/arch/powerpc/gen/swapcontext.S
diff -u src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7 src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7.18.1
--- src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/powerpc/gen/swapcontext.S	Thu Mar  1 17:15:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.7.18.1 2018/03/01 17:15:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 #include "assym.h"
 
-__RCSID("$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
+__RCSID("$NetBSD: swapcontext.S,v 1.7.18.1 2018/03/01 17:15:14 martin Exp $")
 
 #define	XCALLFRAMELEN	(((2+3)*SZREG + CALLFRAMELEN - 1) & -CALLFRAMELEN)
 #define	XCALLFRAME_R30	(XCALLFRAMELEN-1*SZREG)
@@ -57,6 +57,10 @@ ENTRY(swapcontext)
 	stw	%r0,UC_GREGS_PC(%r11)		# pc <- lr
 	addi	%r0,%r1,XCALLFRAMELEN
 	stw	%r0,UC_GREGS_R1(%r11)		# adjust sp
+#ifdef __PIC__
+	lwz	%r0,XCALLFRAME_R30(%r1)
+	stw	%r0,UC_GREGS_R30(%r11)		# caller's r30
+#endif
 	lwz	%r3,XCALLFRAME_UCP(%r1)		# load ucp
 	bl	PIC_PLT(_C_LABEL(setcontext))	# setcontext(ucp)
 1:



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

2018-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar  1 19:02:15 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #597):
sys/dev/pci/ixgbe/ixgbe.h: revision 1.31
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.33
sys/dev/pci/ixgbe/ixgbe.c: revision 1.127
sys/dev/pci/ixgbe/ixv.c: revision 1.82
Fix poll mode assumption breaking.
ixgbe_{enable,disable}_intr() forcibly enable/disable all interrupts
regardless of current state. That can break poll mode assumption,
that is, queue interrupts must not occur while polling Tx/Rx rings.
E.g. "ifconfig ixg0 delete && ifconfig ixg0 192.168.0.1" on heavy
load traffic can causes this issue.
This fix may have 1% or 2% performance impact at short packets.
XXX
ixgbe_rearm_queues() which is called only via watchdog can also break
this poll mode assumption because writing EICS casues interrupts
immediately when interrupt auto mask enabled.
We will fix it with other issues about watchdog later.
ok by msaitoh@n.o.
Apply ixgbe.c:r1.127 to ixv.c. Pointed out by msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.4 -r1.24.2.5 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.10 -r1.88.2.11 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.24.6.3 -r1.24.6.4 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.56.2.7 -r1.56.2.8 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.4 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.5
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.4	Mon Feb 26 13:55:54 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Mar  1 19:02:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.4 2018/02/26 13:55:54 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.5 2018/03/01 19:02:15 martin Exp $ */
 
 /**
 
@@ -2260,6 +2260,9 @@ ixgbe_allocate_queues(struct adapter *ad
 		que->me = i;
 		que->txr = &adapter->tx_rings[i];
 		que->rxr = &adapter->rx_rings[i];
+
+		mutex_init(&que->im_mtx, MUTEX_DEFAULT, IPL_NET);
+		que->im_nest = 0;
 	}
 
 	return (0);

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

CVS commit: [netbsd-8] src

2018-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar  1 19:04:57 UTC 2018

Modified Files:
src/share/mk [netbsd-8]: bsd.test.mk
src/tests/lib [netbsd-8]: Makefile

Log Message:
Pull up following revision(s) (requested by kre in ticket #598):
tests/lib/Makefile: revision 1.30
share/mk/bsd.test.mk: revision 1.25
PR lib/52007
Provide a mechanism whereby a test sub-directory can be installed,
without the test being scheduled to run by default (ie: keeping
it out of the Atffile, and Kyuafile if Kyua is enabled.).
The mechanism is perhaps a bit kludgey - anyone with a better idea
how to make it happen, feel free to improve this (the one user as
of about the time of this commit is (or will be) src/tests/lib/Makefile)
PR lib/52007
Move libevent from being a test playing sub-directory, to a groupy,
just hanging around, hoping someone will notice it, and throw it
a bone...  (mixed metaphors?)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.22.1 src/share/mk/bsd.test.mk
cvs rdiff -u -r1.29 -r1.29.2.1 src/tests/lib/Makefile

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

Modified files:

Index: src/share/mk/bsd.test.mk
diff -u src/share/mk/bsd.test.mk:1.24 src/share/mk/bsd.test.mk:1.24.22.1
--- src/share/mk/bsd.test.mk:1.24	Sat Feb 23 22:01:51 2013
+++ src/share/mk/bsd.test.mk	Thu Mar  1 19:04:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.test.mk,v 1.24 2013/02/23 22:01:51 jmmv Exp $
+# $NetBSD: bsd.test.mk,v 1.24.22.1 2018/03/01 19:04:57 martin Exp $
 #
 
 .include 
@@ -8,6 +8,9 @@ _TESTS:=	# empty
 .if defined(TESTS_SUBDIRS)
 SUBDIR+=	${TESTS_SUBDIRS}
 .endif
+.if defined(TESTS_SUBDIR_INSTALL_ONLY)
+SUBDIR+=	${TESTS_SUBDIR_INSTALL_ONLY}
+.endif
 
 .include 
 

Index: src/tests/lib/Makefile
diff -u src/tests/lib/Makefile:1.29 src/tests/lib/Makefile:1.29.2.1
--- src/tests/lib/Makefile:1.29	Sun May 21 15:28:42 2017
+++ src/tests/lib/Makefile	Thu Mar  1 19:04:57 2018
@@ -1,12 +1,14 @@
-# $NetBSD: Makefile,v 1.29 2017/05/21 15:28:42 riastradh Exp $
+# $NetBSD: Makefile,v 1.29.2.1 2018/03/01 19:04:57 martin Exp $
 
 .include 
 
-TESTS_SUBDIRS=	csu libbluetooth libc libcrypt libcurses libevent libexecinfo \
+TESTS_SUBDIRS=	csu libbluetooth libc libcrypt libcurses libexecinfo \
 		libm libobjc libposix libppath libprop libpthread \
 		librefuse librt libtre libusbhid libutil \
 		semaphore
 
+TESTS_SUBDIR_INSTALL_ONLY=	libevent
+
 .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE)
 TESTS_SUBDIRS+= librumpclient librumphijack
 .endif



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

2018-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar  1 19:07:31 UTC 2018

Modified Files:
src/sys/arch/x86/include [netbsd-8]: Makefile

Log Message:
Pull up following revision(s) (requested by kamil in ticket #599):
sys/arch/x86/include/Makefile: revision 1.22
Stop installing dbregs.h
This is now kernel-only header. The behavior is well specified by the CPU=
documents and we don't introduce changes to it.
Noted by 


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.8.1 src/sys/arch/x86/include/Makefile

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

Modified files:

Index: src/sys/arch/x86/include/Makefile
diff -u src/sys/arch/x86/include/Makefile:1.21 src/sys/arch/x86/include/Makefile:1.21.8.1
--- src/sys/arch/x86/include/Makefile:1.21	Thu Dec 15 12:04:18 2016
+++ src/sys/arch/x86/include/Makefile	Thu Mar  1 19:07:31 2018
@@ -1,4 +1,4 @@
-# 	$NetBSD: Makefile,v 1.21 2016/12/15 12:04:18 kamil Exp $
+# 	$NetBSD: Makefile,v 1.21.8.1 2018/03/01 19:07:31 martin Exp $
 
 INCSDIR=/usr/include/x86
 
@@ -11,7 +11,6 @@ INCS=	aout_machdep.h \
 	cpu_ucode.h \
 	cputypes.h \
 	cpuvar.h \
-	dbregs.h \
 	float.h \
 	fpu.h \
 	ieee.h ieeefp.h \



CVS commit: [netbsd-8] src/doc

2018-03-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar  1 19:09:02 UTC 2018

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

Log Message:
Tickets #596 - #599


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.135 src/doc/CHANGES-8.0:1.1.2.136
--- src/doc/CHANGES-8.0:1.1.2.135	Wed Feb 28 18:55:54 2018
+++ src/doc/CHANGES-8.0	Thu Mar  1 19:09:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.135 2018/02/28 18:55:54 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.136 2018/03/01 19:09:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -10001,3 +10001,30 @@ sys/net/rtsock.c1.231
 	Avoid using a zero family mask.
 	[mrg, ticket #595]
 
+lib/libc/arch/powerpc/gen/swapcontext.S		1.8
+lib/libc/arch/powerpc/genassym.cf		1.5
+
+	Fix swapcontext for PIC code.
+	[uwe, ticket #596]
+
+sys/dev/pci/ixgbe/ix_txrx.c			1.33
+sys/dev/pci/ixgbe/ixgbe.c			1.127
+sys/dev/pci/ixgbe/ixgbe.h			1.31
+sys/dev/pci/ixgbe/ixv.c1.82
+
+	Do not queue interrupts while polling Tx/Rx rings.
+	[knakahara, ticket #597]
+
+share/mk/bsd.test.mk1.25
+tests/lib/Makefile1.30
+
+	Provide a mechanism whereby a test sub-directory can be installed,
+	without the test being scheduled to run by default.
+	Apply this to the libevent tests.
+	[kre, ticket #598]
+
+sys/arch/x86/include/Makefile			1.22
+
+	Do not install dbregs.h, it is a kernel-only header.
+	[kamil, ticket #599]
+



CVS commit: src/share/misc

2018-03-01 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Thu Mar  1 19:09:33 UTC 2018

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

Log Message:
Add SMEP and additional CSDL and LTO acronyms


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

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.192 src/share/misc/acronyms.comp:1.193
--- src/share/misc/acronyms.comp:1.192	Mon Feb 19 20:49:01 2018
+++ src/share/misc/acronyms.comp	Thu Mar  1 19:09:33 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.192 2018/02/19 20:49:01 ginsbach Exp $
+$NetBSD: acronyms.comp,v 1.193 2018/03/01 19:09:33 ginsbach Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -251,7 +251,7 @@ CS	cable select
 CS	chip select
 CS	code segment
 CS	computer science
-CSDL	common schema definition language
+CSDL	{common,conceptual} schema definition language
 CSI	channel state information
 CSI	common system interface
 CSMA	carrier sense multiple access
@@ -723,6 +723,7 @@ LSN	Large Scale NAT
 LSN	log sequence number
 LSR	label switch router
 LTCC	low temperature co-fired ceramic
+LTO	linear tape-open
 LTO	link time optimization
 LTR	left to right
 LTR	load task register
@@ -1205,6 +1206,7 @@ SMAP	supervisor mode access prevention
 SMART	self-monitoring analysis and reporting technology
 SMBIOS	System Management BIOS
 SMC	system management controller
+SMEP	supervisor mode execution protection
 SMF	single mode fiber
 SMI	structure of management information
 SMI	system management interrupt



CVS commit: src/sys/arch/ia64

2018-03-01 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Mar  1 23:01:19 UTC 2018

Modified Files:
src/sys/arch/ia64/include: pci_machdep.h
src/sys/arch/ia64/pci: pci_machdep.c

Log Message:
Remove empty pci_enumerate_bus() stub specific for ia64.  I think it was 
originally added to allow acpi compilation with pci, which appears to no longer 
be an issue.

PCI will need to be revisited for ia64 at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/pci_machdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/pci/pci_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/ia64/include/pci_machdep.h
diff -u src/sys/arch/ia64/include/pci_machdep.h:1.3 src/sys/arch/ia64/include/pci_machdep.h:1.4
--- src/sys/arch/ia64/include/pci_machdep.h:1.3	Fri Aug  5 17:01:56 2016
+++ src/sys/arch/ia64/include/pci_machdep.h	Thu Mar  1 23:01:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.h,v 1.3 2016/08/05 17:01:56 scole Exp $	*/
+/*	$NetBSD: pci_machdep.h,v 1.4 2018/03/01 23:01:19 scole Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -42,13 +42,4 @@ void pci_decompose_tag(pci_chipset_tag_t
 pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
 void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
 
-/*
- * XXX should ia64_pci_enumerate_bus and
- *  #define PCI_MACHDEP_ENUMERATE_BUS ia64_pci_enumerate_bus
- * be used? acpi_pci appears to require pci_enumerate_bus though.
- */
-int pci_enumerate_bus(struct pci_softc *, const int *,
-		  int (*)(const struct pci_attach_args *),
-		  struct pci_attach_args *);
-
 #endif

Index: src/sys/arch/ia64/pci/pci_machdep.c
diff -u src/sys/arch/ia64/pci/pci_machdep.c:1.5 src/sys/arch/ia64/pci/pci_machdep.c:1.6
--- src/sys/arch/ia64/pci/pci_machdep.c:1.5	Fri Aug  5 17:04:52 2016
+++ src/sys/arch/ia64/pci/pci_machdep.c	Thu Mar  1 23:01:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.5 2016/08/05 17:04:52 scole Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.6 2018/03/01 23:01:19 scole Exp $	*/
 /*
  * Copyright (c) 2009, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.5 2016/08/05 17:04:52 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.6 2018/03/01 23:01:19 scole Exp $");
 
 #include 
 #include 
@@ -102,13 +102,3 @@ pci_conf_write(pci_chipset_tag_t pc, pci
 	if (res.sal_status < 0)
 		printf("pci configuration write failed\n");
 }
-
-int
-pci_enumerate_bus(struct pci_softc *sc, const int *locators,
-		  int (*match)(const struct pci_attach_args *), struct pci_attach_args *pap)
-{
-	/* XXX implement */
-	panic("ia64 pci_enumerate_bus not implemented");
-
-	return -1;
-}



CVS commit: src/etc

2018-03-01 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Mar  2 00:25:26 UTC 2018

Modified Files:
src/etc/etc.amd64: boot.cfg
src/etc/etc.i386: boot.cfg

Log Message:
Instead of explicitly specifying a kernel name, ommit to allow the bootloader 
to iterate
through the list of kernel names it is configured to try. This way there is
fallback if /netbsd is not present. netbsd is the first name to be tried anyway.
Issue brought up on tech-kern@ by Patrick Welche  where a 
system
without /netbsd hung on boot.
Suggestion by rudolf 
https://mail-index.netbsd.org/tech-kern/2018/02/16/msg023122.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/etc/etc.amd64/boot.cfg
cvs rdiff -u -r1.4 -r1.5 src/etc/etc.i386/boot.cfg

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

Modified files:

Index: src/etc/etc.amd64/boot.cfg
diff -u src/etc/etc.amd64/boot.cfg:1.4 src/etc/etc.amd64/boot.cfg:1.5
--- src/etc/etc.amd64/boot.cfg:1.4	Wed Dec 21 14:33:13 2011
+++ src/etc/etc.amd64/boot.cfg	Fri Mar  2 00:25:26 2018
@@ -1,7 +1,7 @@
-menu=Boot normally:rndseed /var/db/entropy-file;boot netbsd
-menu=Boot single user:rndseed /var/db/entropy-file;boot netbsd -s
-menu=Disable ACPI:rndseed /var/db/entropy-file;boot netbsd -2
-menu=Disable ACPI and SMP:rndseed /var/db/entropy-file;boot netbsd -12
+menu=Boot normally:rndseed /var/db/entropy-file;boot
+menu=Boot single user:rndseed /var/db/entropy-file;boot -s
+menu=Disable ACPI:rndseed /var/db/entropy-file;boot -2
+menu=Disable ACPI and SMP:rndseed /var/db/entropy-file;boot -12
 menu=Drop to boot prompt:prompt
 default=1
 timeout=5

Index: src/etc/etc.i386/boot.cfg
diff -u src/etc/etc.i386/boot.cfg:1.4 src/etc/etc.i386/boot.cfg:1.5
--- src/etc/etc.i386/boot.cfg:1.4	Wed Dec 21 14:33:13 2011
+++ src/etc/etc.i386/boot.cfg	Fri Mar  2 00:25:26 2018
@@ -1,7 +1,7 @@
-menu=Boot normally:rndseed /var/db/entropy-file;boot netbsd
-menu=Boot single user:rndseed /var/db/entropy-file;boot netbsd -s
-menu=Disable ACPI:rndseed /var/db/entropy-file;boot netbsd -2
-menu=Disable ACPI and SMP:rndseed /var/db/entropy-file;boot netbsd -12
+menu=Boot normally:rndseed /var/db/entropy-file;boot
+menu=Boot single user:rndseed /var/db/entropy-file;boot -s
+menu=Disable ACPI:rndseed /var/db/entropy-file;boot -2
+menu=Disable ACPI and SMP:rndseed /var/db/entropy-file;boot -12
 menu=Drop to boot prompt:prompt
 default=1
 timeout=5



CVS commit: src/sys/dev

2018-03-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Mar  2 06:01:20 UTC 2018

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Since acorn26 has been retired, release all acorn26-speceific device
name entries.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.305 src/sys/dev/DEVNAMES:1.306
--- src/sys/dev/DEVNAMES:1.305	Thu Mar  1 08:44:12 2018
+++ src/sys/dev/DEVNAMES	Fri Mar  2 06:01:20 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.305 2018/03/01 08:44:12 pgoyette Exp $
+#	$NetBSD: DEVNAMES,v 1.306 2018/03/02 06:01:20 pgoyette Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -88,10 +88,7 @@ apm			i386
 aps			MI
 arbus			evbmips
 arc			MI		Attribute
-arckbd			acorn26
 arcmsr			MI
-arcpp			acorn26
-arcvideo		acorn26
 aria			MI
 armgic			arm
 arml2cc			arm
@@ -287,7 +284,6 @@ cpciic			MI
 cpctim			MI
 cprofb			MI
 cpsw			evbarm
-cpu			acorn26
 cpu			acorn32
 cpu			algor
 cpu			alpha
@@ -380,7 +376,6 @@ ebus			sparc
 ebus			sparc64
 ec			MI
 ec			sun2
-eca			acorn26
 eccmemctl		sparc
 ed			MI (MCA)
 ed			amiga
@@ -394,7 +389,6 @@ ef			MI
 efa			amiga
 eg			MI
 ega			MI
-eh			acorn26
 ehci			MI
 ei			MI
 eisa			MI
@@ -487,7 +481,6 @@ fec			arm
 ffb			sparc64
 fhpib			hp300
 finsio			MI
-fiq			acorn26		Attribute
 flash			evbppc
 flsc			amiga
 flsc			amigappc
@@ -496,7 +489,6 @@ fmv			MI
 footbridge		cats		Attribute
 footbridge		netwinder	Attribute
 fpa			MI
-fpu			acorn26
 fpu			mac68k
 frodo			hp300
 fta			MI
@@ -641,7 +633,6 @@ ifpci			MI
 ifuba			MI		Attribute
 igsfb			MI
 iha			MI
-iic			acorn26
 iic			acorn32
 ik			vax
 il			MI
@@ -661,9 +652,6 @@ intvid			mac68k
 ioasic			MI
 ioat			MI
 iobl			amiga
-iobus			acorn26
-ioc			acorn26
-ioeb			acorn26
 iomd			acorn32
 iomdiic			acorn32
 iomdkbc			acorn32
@@ -754,7 +742,6 @@ kdb			MI
 kft			alpha
 kse			MI
 kue			MI
-latches			acorn26
 lc			MI
 lca			alpha
 ld			MI
@@ -969,7 +956,6 @@ njs			MI
 np			vax
 npx			i386
 nsclpcsio		MI
-nsio			acorn26		Attribute
 nsphy			MI
 nsphyter		MI
 ntwoc			MI
@@ -1180,7 +1166,6 @@ rk			vax
 rl			vax
 rlc			vax
 rt			MI
-rtc			acorn26
 rtc			acorn32
 rtc			evbmips
 rtc			hp300
@@ -1444,7 +1429,6 @@ umodem_common		MI		Attribute
 ums			MI
 uninorth		macppc
 univ_pci		MI		Attribute
-unixbp			acorn26
 up			vax
 upc			MI
 upl			MI



CVS commit: src/sys/dev

2018-03-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Mar  2 06:04:16 UTC 2018

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Rename the i2c attribute i2cbus, and add the MI iic device.

Note that the iic device source files are named i2c*  Also note that
iic attaches at i2cbus


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.306 src/sys/dev/DEVNAMES:1.307
--- src/sys/dev/DEVNAMES:1.306	Fri Mar  2 06:01:20 2018
+++ src/sys/dev/DEVNAMES	Fri Mar  2 06:04:16 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.306 2018/03/02 06:01:20 pgoyette Exp $
+#	$NetBSD: DEVNAMES,v 1.307 2018/03/02 06:04:16 pgoyette Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -608,7 +608,7 @@ hydra			acorn32
 hyper			amiga
 hyper			amigappc
 hyper			hp300
-i2c			MI		Attribute
+i2cbus			MI		Attribute
 i2c_eeprom		MI		Attribute
 i8042			shark		Attribute
 i82586			MI		Attribute
@@ -633,6 +633,7 @@ ifpci			MI
 ifuba			MI		Attribute
 igsfb			MI
 iha			MI
+iic			MI		(Source file i2c.c)
 iic			acorn32
 ik			vax
 il			MI



CVS commit: src/lib/libc/inet

2018-03-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Mar  2 06:31:53 UTC 2018

Modified Files:
src/lib/libc/inet: inet_ntop.c

Log Message:
PR/48585: Set errno when returning NULL for AF_INET

In inet_ntop4(), errno wasn't set before returning NULL.
Seems like an oversight in the existing fix for PR/48585.
Noticed by code inspection.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/inet/inet_ntop.c

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

Modified files:

Index: src/lib/libc/inet/inet_ntop.c
diff -u src/lib/libc/inet/inet_ntop.c:1.11 src/lib/libc/inet/inet_ntop.c:1.12
--- src/lib/libc/inet/inet_ntop.c:1.11	Mon Feb 10 16:30:54 2014
+++ src/lib/libc/inet/inet_ntop.c	Fri Mar  2 06:31:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet_ntop.c,v 1.11 2014/02/10 16:30:54 christos Exp $	*/
+/*	$NetBSD: inet_ntop.c,v 1.12 2018/03/02 06:31:53 lukem Exp $	*/
 
 /*
  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -22,7 +22,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
 #else
-__RCSID("$NetBSD: inet_ntop.c,v 1.11 2014/02/10 16:30:54 christos Exp $");
+__RCSID("$NetBSD: inet_ntop.c,v 1.12 2018/03/02 06:31:53 lukem Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -106,8 +106,10 @@ inet_ntop4(const u_char *src, char *dst,
 
 	l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
 	src[0], src[1], src[2], src[3]);
-	if (l <= 0 || (socklen_t) l >= size)
+	if (l <= 0 || (socklen_t) l >= size) {
+		errno = ENOSPC;
 		return NULL;
+	}
 	strlcpy(dst, tmp, size);
 	return dst;
 }



CVS commit: src/sys/dev/pci

2018-03-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar  2 06:40:31 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
 Add Intel Gemini Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1316 src/sys/dev/pci/pcidevs:1.1317
--- src/sys/dev/pci/pcidevs:1.1316	Sat Feb 24 14:05:46 2018
+++ src/sys/dev/pci/pcidevs	Fri Mar  2 06:40:31 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1316 2018/02/24 14:05:46 mlelstv Exp $
+$NetBSD: pcidevs,v 1.1317 2018/03/02 06:40:31 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4187,6 +4187,42 @@ product INTEL XE5_V3_IMC0_DDRIO_B 0x2fda
 product INTEL XE5_V3_IMC0_DDRIO_C 0x2fdb Xeon E5 v3 IMC DDRIO
 product INTEL WIFI_LINK_3165_1	0x3165	Dual Band Wireless AC 3165
 product INTEL WIFI_LINK_3165_2	0x3166	Dual Band Wireless AC 3165
+product INTEL GLK_IGD_1		0x3184	UHD Graphics 605
+product INTEL GLK_IGD_2		0x3185	UHD Graphics 600
+product INTEL GLK_DPTF		0x318c	Gemini Lake DPTF
+product INTEL GLK_GNA		0x3190	Gemini Lake GNA
+product INTEL GLK_P2SB		0x3192	Gemini Lake Primary to SideBand Bridge
+product INTEL GLK_PMC		0x3194	Gemini Lake PMC
+product INTEL GLK_FASTSPI	0x3196	Gemini Lake Fast SPI
+product INTEL GLK_ESPI		0x3197	Gemini Lake eSPI
+product INTEL GLK_HDA		0x3198	Gemini Lake HD Audio
+product INTEL GLK_ISH		0x31a2	Gemini Lake Integrated Sensor Hub
+product INTEL GLK_XHCI		0x31a8	Gemini Lake USB Host (xHCI)
+product INTEL GLK_XDCI		0x31aa	Gemini Lake USB Device (xDCI)
+product INTEL GLK_I2C_0		0x31ac	Gemini Lake I2C 0
+product INTEL GLK_I2C_1		0x31ae	Gemini Lake I2C 1
+product INTEL GLK_I2C_2		0x31b0	Gemini Lake I2C 2
+product INTEL GLK_I2C_3		0x31b2	Gemini Lake I2C 3
+product INTEL GLK_I2C_4		0x31b4	Gemini Lake I2C 4
+product INTEL GLK_I2C_5		0x31b6	Gemini Lake I2C 5
+product INTEL GLK_I2C_6		0x31b8	Gemini Lake I2C 6
+product INTEL GLK_I2C_7		0x31ba	Gemini Lake I2C 7
+product INTEL GLK_UART_0	0x31bc	Gemini Lake UART 0
+product INTEL GLK_UART_2	0x31c0	Gemini Lake UART 2
+product INTEL GLK_SPI		0x31c2	Gemini Lake SPI
+product INTEL GLK_EMMC		0x31cc	Gemini Lake eMMC
+product INTEL GLK_SMB		0x31d4	Gemini Lake SMBus
+product INTEL GLK_PCIE_4	0x31d6	Gemini Lake PCIe x2
+product INTEL GLK_PCIE_5	0x31d7	Gemini Lake PCIe x2
+product INTEL GLK_PCIE_0	0x31d8	Gemini Lake PCIe x4
+product INTEL GLK_PCIE_1	0x31d9	Gemini Lake PCIe x4
+product INTEL GLK_PCIE_2	0x31da	Gemini Lake PCIe x4
+product INTEL GLK_PCIE_3	0x31db	Gemini Lake PCIe x4
+product INTEL GLK_CNVI		0x31dc	Gemini Lake CNVi
+product INTEL GLK_SATA		0x31e3	Gemini Lake SATA
+product INTEL GLK_LPC		0x31e8	Gemini Lake LPC
+product INTEL GLK_SSRAM		0x31ec	Gemini Lake Shared SRAM
+product INTEL GLK_HB		0x31f0	Gemini Lake Host Bridge
 product INTEL 31244		0x3200	31244 Serial ATA Controller
 product INTEL 82855PM_DDR	0x3340	82855PM MCH Host Controller
 product INTEL 82855PM_AGP	0x3341	82855PM Host-AGP Bridge



CVS commit: src/sys/netipsec

2018-03-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Mar  2 07:37:14 UTC 2018

Modified Files:
src/sys/netipsec: key.c keydb.h

Log Message:
Avoid data races on lifetime counters by using percpu(9)

We don't make them percpu(9) directly because the structure is exposed to
userland and we don't want to break ABI.  So we add another member variable
for percpu(9) and use it internally.  When we export them to userland, they
are converted to the original format.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/netipsec/key.c
cvs rdiff -u -r1.20 -r1.21 src/sys/netipsec/keydb.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.248 src/sys/netipsec/key.c:1.249
--- src/sys/netipsec/key.c:1.248	Thu Feb  8 20:57:41 2018
+++ src/sys/netipsec/key.c	Fri Mar  2 07:37:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.248 2018/02/08 20:57:41 maxv Exp $	*/
+/*	$NetBSD: key.c,v 1.249 2018/03/02 07:37:13 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.248 2018/02/08 20:57:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.249 2018/03/02 07:37:13 ozaki-r Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -785,6 +785,26 @@ static struct callout	key_timehandler_ch
 static struct workqueue	*key_timehandler_wq;
 static struct work	key_timehandler_wk;
 
+/*
+ * Utilities for percpu counters for sadb_lifetime_allocations and
+ * sadb_lifetime_bytes.
+ */
+#define LIFETIME_COUNTER_ALLOCATIONS	0
+#define LIFETIME_COUNTER_BYTES		1
+#define LIFETIME_COUNTER_SIZE		2
+
+typedef uint64_t lifetime_counters_t[LIFETIME_COUNTER_SIZE];
+
+static void
+key_sum_lifetime_counters(void *p, void *arg, struct cpu_info *ci __unused)
+{
+	lifetime_counters_t *one = p;
+	lifetime_counters_t *sum = arg;
+
+	(*sum)[LIFETIME_COUNTER_ALLOCATIONS] += (*one)[LIFETIME_COUNTER_ALLOCATIONS];
+	(*sum)[LIFETIME_COUNTER_BYTES] += (*one)[LIFETIME_COUNTER_BYTES];
+}
+
 u_int
 key_sp_refcnt(const struct secpolicy *sp)
 {
@@ -3257,6 +3277,8 @@ key_newsav(struct mbuf *m, const struct 
 		/* We don't allow lft_c to be NULL */
 		newsav->lft_c = kmem_zalloc(sizeof(struct sadb_lifetime),
 		KM_SLEEP);
+		newsav->lft_c_counters_percpu =
+		percpu_alloc(sizeof(lifetime_counters_t));
 	}
 
 	/* reset created */
@@ -3467,6 +3489,10 @@ key_freesaval(struct secasvar *sav)
 		kmem_intr_free(sav->key_auth, sav->key_auth_len);
 	if (sav->key_enc != NULL)
 		kmem_intr_free(sav->key_enc, sav->key_enc_len);
+	if (sav->lft_c_counters_percpu != NULL) {
+		percpu_free(sav->lft_c_counters_percpu,
+		sizeof(lifetime_counters_t));
+	}
 	if (sav->lft_c != NULL)
 		kmem_intr_free(sav->lft_c, sizeof(*(sav->lft_c)));
 	if (sav->lft_h != NULL)
@@ -3635,6 +3661,8 @@ key_setsaval(struct secasvar *sav, struc
 	sav->lft_c->sadb_lifetime_addtime = time_uptime;
 	sav->lft_c->sadb_lifetime_usetime = 0;
 
+	sav->lft_c_counters_percpu = percpu_alloc(sizeof(lifetime_counters_t));
+
 	/* lifetimes for HARD and SOFT */
 {
 	const struct sadb_lifetime *lft0;
@@ -3818,7 +3846,9 @@ key_setdumpsa(struct secasvar *sav, u_in
 			p = sav->key_enc;
 			break;
 
-		case SADB_EXT_LIFETIME_CURRENT:
+		case SADB_EXT_LIFETIME_CURRENT: {
+			lifetime_counters_t sum = {0};
+
 			KASSERT(sav->lft_c != NULL);
 			l = PFKEY_UNUNIT64(((struct sadb_ext *)sav->lft_c)->sadb_ext_len);
 			memcpy(<, sav->lft_c, sizeof(struct sadb_lifetime));
@@ -3826,8 +3856,15 @@ key_setdumpsa(struct secasvar *sav, u_in
 			time_mono_to_wall(lt.sadb_lifetime_addtime);
 			lt.sadb_lifetime_usetime =
 			time_mono_to_wall(lt.sadb_lifetime_usetime);
+			percpu_foreach(sav->lft_c_counters_percpu,
+			key_sum_lifetime_counters, sum);
+			lt.sadb_lifetime_allocations =
+			sum[LIFETIME_COUNTER_ALLOCATIONS];
+			lt.sadb_lifetime_bytes =
+			sum[LIFETIME_COUNTER_BYTES];
 			p = <
 			break;
+		}
 
 		case SADB_EXT_LIFETIME_HARD:
 			if (!sav->lft_h)
@@ -4857,9 +4894,17 @@ restart:
 			 * when new SA is installed.  Caution when it's
 			 * installed too big lifetime by time.
 			 */
-			else if (sav->lft_s->sadb_lifetime_bytes != 0 &&
-			 sav->lft_s->sadb_lifetime_bytes <
-			 sav->lft_c->sadb_lifetime_bytes) {
+			else {
+uint64_t lft_c_bytes = 0;
+lifetime_counters_t sum = {0};
+
+percpu_foreach(sav->lft_c_counters_percpu,
+key_sum_lifetime_counters, sum);
+lft_c_bytes = sum[LIFETIME_COUNTER_BYTES];
+
+if (sav->lft_s->sadb_lifetime_bytes == 0 ||
+sav->lft_s->sadb_lifetime_bytes >= lft_c_bytes)
+	continue;
 
 key_sa_chgstate(sav, SADB_SASTATE_DYING);
 mutex_exit(&key_sad.lock);
@@ -4907,9 +4952,18 @@ restart:
 			}
 #endif
 			/* check HARD lifetime by bytes */
-			else if (sa