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

2017-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 25 07:55:06 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: ARMADAXP

Log Message:
Add pci attachment for mvsata


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/ARMADAXP

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

Modified files:

Index: src/sys/arch/evbarm/conf/ARMADAXP
diff -u src/sys/arch/evbarm/conf/ARMADAXP:1.18 src/sys/arch/evbarm/conf/ARMADAXP:1.19
--- src/sys/arch/evbarm/conf/ARMADAXP:1.18	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/ARMADAXP	Sat Feb 25 07:55:06 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ARMADAXP,v 1.18 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: ARMADAXP,v 1.19 2017/02/25 07:55:06 skrll Exp $
 #
 #	ARMADA XP DEV BOARD
 #
@@ -276,6 +276,9 @@ options 	PCI_NETBSD_CONFIGURE
 pci*		at mvpex?
 pchb*		at pci? dev ? function ?	# PCI-Host bridges
 
+# PCI Serial-ATA Host Controller
+mvsata* 	at pci? dev ? function ?
+
 # PCI Ethernet
 wm*		at pci? dev ? function ?	# Intel 8254x gigabit
 re*		at pci? dev ? function ?



CVS commit: src/sys/arch/x86

2017-02-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Feb 25 01:13:50 UTC 2017

Modified Files:
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: genfb_machdep.c

Log Message:
EFI console is drawing faster by shadowfb.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/genfb_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/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.77 src/sys/arch/x86/pci/pci_machdep.c:1.78
--- src/sys/arch/x86/pci/pci_machdep.c:1.77	Thu Feb  9 03:38:01 2017
+++ src/sys/arch/x86/pci/pci_machdep.c	Sat Feb 25 01:13:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.77 2017/02/09 03:38:01 msaitoh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.78 2017/02/25 01:13:50 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.77 2017/02/09 03:38:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.78 2017/02/25 01:13:50 nonaka Exp $");
 
 #include 
 #include 
@@ -1095,6 +1095,8 @@ device_pci_register(device_t dev, void *
 if (ri->ri_bits != NULL) {
 	prop_dictionary_set_uint64(dict,
 	"virtual_address",
+	ri->ri_hwbits != NULL ?
+	(vaddr_t)ri->ri_hworigbits :
 	(vaddr_t)ri->ri_origbits);
 }
 #endif
@@ -1121,6 +1123,11 @@ device_pci_register(device_t dev, void *
 
 #if NWSDISPLAY > 0 && NGENFB > 0
 if (device_is_a(dev, "genfb")) {
+	prop_dictionary_set_bool(dict,
+	"enable_shadowfb",
+	ri->ri_hwbits != NULL ?
+	  true : false);
+
 	x86_genfb_set_console_dev(dev);
 #ifdef DDB
 	db_trap_callback =

Index: src/sys/arch/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.11 src/sys/arch/x86/x86/genfb_machdep.c:1.12
--- src/sys/arch/x86/x86/genfb_machdep.c:1.11	Thu Jul 25 15:09:27 2013
+++ src/sys/arch/x86/x86/genfb_machdep.c	Sat Feb 25 01:13:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.11 2013/07/25 15:09:27 macallan Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.11 2013/07/25 15:09:27 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.12 2017/02/25 01:13:50 nonaka Exp $");
 
 #include "opt_mtrr.h"
 
@@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -61,6 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 
 #if NWSDISPLAY > 0 && NGENFB > 0
 struct vcons_screen x86_genfb_console_screen;
+bool x86_genfb_use_shadowfb = true;
 
 #if NACPICA > 0
 extern int acpi_md_vesa_modenum;
@@ -182,7 +184,17 @@ x86_genfb_cnattach(void)
 	ri->ri_height = fbinfo->height;
 	ri->ri_depth = fbinfo->depth;
 	ri->ri_stride = fbinfo->stride;
-	ri->ri_bits = bits;
+	if (x86_genfb_use_shadowfb && lookup_bootinfo(BTINFO_EFI) != NULL) {
+		/* XXX The allocated memory is never released... */
+		ri->ri_bits = kmem_alloc(ri->ri_stride * ri->ri_height,
+		KM_NOSLEEP);
+		if (ri->ri_bits == NULL) {
+			aprint_error("%s: couldn't alloc shadowfb\n", __func__);
+			ri->ri_bits = bits;
+		} else
+			ri->ri_hwbits = bits;
+	} else
+		ri->ri_bits = bits;
 	ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_CLEAR;
 	rasops_init(ri, ri->ri_width / 8, ri->ri_height / 8);
 	ri->ri_caps = WSSCREEN_WSCOLORS;



CVS commit: src/sys/dev/wsfb

2017-02-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Feb 25 01:11:55 UTC 2017

Modified Files:
src/sys/dev/wsfb: genfb.c genfbvar.h

Log Message:
genfb(4): Enabling/Disabling shadowfb can be controlled via prop.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/wsfb/genfb.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/wsfb/genfbvar.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/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.58 src/sys/dev/wsfb/genfb.c:1.59
--- src/sys/dev/wsfb/genfb.c:1.58	Mon Jun  1 20:47:59 2015
+++ src/sys/dev/wsfb/genfb.c	Sat Feb 25 01:11:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.58 2015/06/01 20:47:59 nat Exp $ */
+/*	$NetBSD: genfb.c,v 1.59 2017/02/25 01:11:55 nonaka Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.58 2015/06/01 20:47:59 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.59 2017/02/25 01:11:55 nonaka Exp $");
 
 #include 
 #include 
@@ -130,6 +130,15 @@ genfb_init(struct genfb_softc *sc)
 		sc->sc_fbaddr = (void *)(uintptr_t)fbaddr;
 	}
 
+	sc->sc_shadowfb = NULL;
+	if (!prop_dictionary_get_bool(dict, "enable_shadowfb",
+	>sc_enable_shadowfb))
+#ifdef GENFB_SHADOWFB
+		sc->sc_enable_shadowfb = true;
+#else
+		sc->sc_enable_shadowfb = false;
+#endif
+
 	if (!prop_dictionary_get_uint32(dict, "linebytes", >sc_stride))
 		sc->sc_stride = (sc->sc_width * sc->sc_depth) >> 3;
 
@@ -240,11 +249,11 @@ genfb_attach(struct genfb_softc *sc, str
 	sc->sc_accessops.mmap = genfb_mmap;
 	sc->sc_accessops.pollc = genfb_pollc;
 
-#ifdef GENFB_SHADOWFB
-	sc->sc_shadowfb = kmem_alloc(sc->sc_fbsize, KM_SLEEP);
-	if (sc->sc_want_clear == false && sc->sc_shadowfb != NULL)
-		memcpy(sc->sc_shadowfb, sc->sc_fbaddr, sc->sc_fbsize);
-#endif
+	if (sc->sc_enable_shadowfb) {
+		sc->sc_shadowfb = kmem_alloc(sc->sc_fbsize, KM_SLEEP);
+		if (sc->sc_want_clear == false && sc->sc_shadowfb != NULL)
+			memcpy(sc->sc_shadowfb, sc->sc_fbaddr, sc->sc_fbsize);
+	}
 
 	vcons_init(>vd, sc, >sc_defaultscreen_descr,
 	>sc_accessops);
@@ -529,14 +538,10 @@ genfb_init_screen(void *cookie, struct v
 	if (sc->sc_want_clear)
 		ri->ri_flg |= RI_FULLCLEAR;
 
-#ifdef GENFB_SHADOWFB
 	if (sc->sc_shadowfb != NULL) {
-
 		ri->ri_hwbits = (char *)sc->sc_fbaddr;
 		ri->ri_bits = (char *)sc->sc_shadowfb;
-	} else
-#endif
-	{
+	} else {
 		ri->ri_bits = (char *)sc->sc_fbaddr;
 		scr->scr_flags |= VCONS_DONT_READ;
 	}

Index: src/sys/dev/wsfb/genfbvar.h
diff -u src/sys/dev/wsfb/genfbvar.h:1.24 src/sys/dev/wsfb/genfbvar.h:1.25
--- src/sys/dev/wsfb/genfbvar.h:1.24	Thu Jul 24 21:35:13 2014
+++ src/sys/dev/wsfb/genfbvar.h	Sat Feb 25 01:11:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfbvar.h,v 1.24 2014/07/24 21:35:13 riastradh Exp $ */
+/*	$NetBSD: genfbvar.h,v 1.25 2017/02/25 01:11:55 nonaka Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -111,9 +111,8 @@ struct genfb_softc {
 	struct genfb_mode_callback *sc_modecb;
 	int sc_backlight_level, sc_backlight_on;
 	void *sc_fbaddr;	/* kva */
-#ifdef GENFB_SHADOWFB
 	void *sc_shadowfb;
-#endif
+	bool sc_enable_shadowfb;
 	bus_addr_t sc_fboffset;	/* bus address */
 	int sc_width, sc_height, sc_stride, sc_depth;
 	size_t sc_fbsize;



CVS commit: src/usr.bin/elf2ecoff

2017-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 24 17:19:14 UTC 2017

Modified Files:
src/usr.bin/elf2ecoff: elf2ecoff.c

Log Message:
fix printf format


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/elf2ecoff/elf2ecoff.c

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

Modified files:

Index: src/usr.bin/elf2ecoff/elf2ecoff.c
diff -u src/usr.bin/elf2ecoff/elf2ecoff.c:1.32 src/usr.bin/elf2ecoff/elf2ecoff.c:1.33
--- src/usr.bin/elf2ecoff/elf2ecoff.c:1.32	Fri Feb 24 08:03:25 2017
+++ src/usr.bin/elf2ecoff/elf2ecoff.c	Fri Feb 24 12:19:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2ecoff.c,v 1.32 2017/02/24 13:03:25 christos Exp $	*/
+/*	$NetBSD: elf2ecoff.c,v 1.33 2017/02/24 17:19:14 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Jonathan Stone
@@ -247,7 +247,7 @@ usage:
 
 			if (debug) {
 fprintf(stderr, "  combinining PH %zu type %d "
-"flags 0x%x with data, ndata = %d, "
+"flags %#x with data, ndata = %d, "
 "nbss =%d\n", i, ph[i].p_type,
 ph[i].p_flags, ndata.len, nbss.len);
 			}
@@ -260,7 +260,7 @@ usage:
 			ntxt.len = ph[i].p_filesz;
 			if (debug) {
 fprintf(stderr, "  combinining PH %zu type %d "
-"flags 0x%x with text, len = %d\n",
+"flags %#x with text, len = %d\n",
 i, ph[i].p_type, ph[i].p_flags, ntxt.len);
 			}
 			combine(, , 0);
@@ -423,8 +423,8 @@ usage:
 
 
 	if (debug)
-		fprintf(stderr, "writing syms at offset 0x%lx\n",
-		(uint32_t) ep.f.f_symptr + sizeof(symhdr));
+		fprintf(stderr, "writing syms at offset %#x\n",
+		(uint32_t)(ep.f.f_symptr + sizeof(symhdr)));
 
 	/* Copy and translate the symbol table... */
 	elf_symbol_table_to_ecoff(outfile, infile, ,
@@ -590,7 +590,7 @@ write_ecoff_symhdr(int out, struct ecoff
 
 	if (debug)
 		fprintf(stderr,
-		"writing symhdr for %d entries at offset 0x%x\n",
+		"writing symhdr for %d entries at offset %#x\n",
 		nesyms, ep->f.f_symptr);
 
 	ep->f.f_nsyms = sizeof(struct ecoff32_symhdr);



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

2017-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb 24 17:07:13 UTC 2017

Modified Files:
src/sys/arch/arm/marvell: mvsoc.c

Log Message:
Typo in a model string


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/marvell/mvsoc.c

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

Modified files:

Index: src/sys/arch/arm/marvell/mvsoc.c
diff -u src/sys/arch/arm/marvell/mvsoc.c:1.27 src/sys/arch/arm/marvell/mvsoc.c:1.28
--- src/sys/arch/arm/marvell/mvsoc.c:1.27	Mon Jan  9 14:15:20 2017
+++ src/sys/arch/arm/marvell/mvsoc.c	Fri Feb 24 17:07:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoc.c,v 1.27 2017/01/09 14:15:20 kiyohara Exp $	*/
+/*	$NetBSD: mvsoc.c,v 1.28 2017/02/24 17:07:13 skrll Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013, 2014, 2016 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.27 2017/01/09 14:15:20 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.28 2017/02/24 17:07:13 skrll Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
@@ -400,7 +400,7 @@ static struct {
 #if defined(ARMADAXP)
 	{ ARMADAXP(MV78130),	1, "MV78130",	"A0",  "Armada XP" },
 	{ ARMADAXP(MV78160),	1, "MV78160",	"A0",  "Armada XP" },
-	{ ARMADAXP(MV78230),	1, "MV78260",	"A0",  "Armada XP" },
+	{ ARMADAXP(MV78230),	1, "MV78230",	"A0",  "Armada XP" },
 	{ ARMADAXP(MV78260),	1, "MV78260",	"A0",  "Armada XP" },
 	{ ARMADAXP(MV78260),	2, "MV78260",	"B0",  "Armada XP" },
 	{ ARMADAXP(MV78460),	1, "MV78460",	"A0",  "Armada XP" },



CVS commit: src/sys/dev

2017-02-24 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Fri Feb 24 16:53:24 UTC 2017

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

Log Message:
Remove use of sc_intr_lock from audio_read.  Fixes LOCKDEBUG panics.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.310 src/sys/dev/audio.c:1.311
--- src/sys/dev/audio.c:1.310	Fri Feb 24 09:49:49 2017
+++ src/sys/dev/audio.c	Fri Feb 24 16:53:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.310 2017/02/24 09:49:49 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.311 2017/02/24 16:53:24 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.310 2017/02/24 09:49:49 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.311 2017/02/24 16:53:24 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2546,11 +2546,9 @@ audio_read(struct audio_softc *sc, struc
 		DPRINTFN(1,("audio_read: outp=%p, cc=%d\n", outp, cc));
 
 		n = uio->uio_resid;
-		mutex_exit(sc->sc_intr_lock);
 		mutex_exit(sc->sc_lock);
 		error = uiomove(__UNCONST(outp), cc, uio);
 		mutex_enter(sc->sc_lock);
-		mutex_enter(sc->sc_intr_lock);
 		n -= uio->uio_resid; /* number of bytes actually moved */
 
 		vc->sc_rustream->outp = audio_stream_add_outp



CVS commit: src/sys/netinet

2017-02-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Feb 24 13:42:19 UTC 2017

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

Log Message:
Only do DaD if the interface actually has the address.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 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.243 src/sys/netinet/if_arp.c:1.244
--- src/sys/netinet/if_arp.c:1.243	Tue Feb 21 03:58:23 2017
+++ src/sys/netinet/if_arp.c	Fri Feb 24 13:42:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.243 2017/02/21 03:58:23 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.244 2017/02/24 13:42:18 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.243 2017/02/21 03:58:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.244 2017/02/24 13:42:18 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1018,6 +1018,7 @@ in_arpinput(struct mbuf *m)
 	int s;
 	char llabuf[LLA_ADDRSTRLEN];
 	char ipbuf[INET_ADDRSTRLEN];
+	bool do_dad;
 
 	if (__predict_false(m_makewritable(, 0, m->m_pkthdr.len, M_DONTWAIT)))
 		goto out;
@@ -1113,6 +1114,9 @@ in_arpinput(struct mbuf *m)
 		goto out;
 	}
 
+	/* Only do DaD if we have a matching address. */
+	do_dad = (ia != NULL);
+
 	if (ia == NULL) {
 		ia = in_get_ia_on_iface_psref(isaddr, rcvif, _ia);
 		if (ia == NULL) {
@@ -1160,9 +1164,10 @@ in_arpinput(struct mbuf *m)
 	}
 
 	/* DAD check, RFC 5227 */
-	if (in_hosteq(isaddr, myaddr) ||
+	if (do_dad &&
+	(in_hosteq(isaddr, myaddr) ||
 	(in_nullhost(isaddr) && in_hosteq(itaddr, myaddr)
-	&& ISSET(m->m_flags, M_BCAST))) /* Allow Unicast Poll, RFC 1122 */
+	&& ISSET(m->m_flags, M_BCAST /* Allow Unicast Poll, RFC 1122 */
 	{
 		arp_dad_duplicated((struct ifaddr *)ia,
 		lla_snprintf(llabuf, ar_sha(ah), ah->ar_hln));



CVS commit: src/share/man/man4

2017-02-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb 24 13:04:23 UTC 2017

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

Log Message:
 Remove RSS's note in BUGS section because it's supported now.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/ixg.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/ixg.4
diff -u src/share/man/man4/ixg.4:1.9 src/share/man/man4/ixg.4:1.10
--- src/share/man/man4/ixg.4:1.9	Wed Dec 28 05:03:32 2016
+++ src/share/man/man4/ixg.4	Fri Feb 24 13:04:23 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: ixg.4,v 1.9 2016/12/28 05:03:32 msaitoh Exp $
+.\" $NetBSD: ixg.4,v 1.10 2017/02/24 13:04:23 msaitoh Exp $
 .\"
 .\" Copyright (c) 2001-2008, Intel Corporation
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD: src/share/man/man4/ixgbe.4,v 1.3 2010/12/19 23:54:31 yongari Exp $
 .\"
-.Dd December 28, 2016
+.Dd February 24, 2017
 .Dt IXG 4
 .Os
 .Sh NAME
@@ -112,8 +112,3 @@ by
 The hardware supports a maximum MTU of 16114 bytes, but the
 .Nx
 port of the driver supports only 9000 bytes.
-.Pp
-The hardware supports Receive-Side Scaling (RSS), however, these features are
-not enabled in the
-.Nx
-driver at this time.



CVS commit: src/usr.bin/elf2ecoff

2017-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 24 13:03:25 UTC 2017

Modified Files:
src/usr.bin/elf2ecoff: elf2ecoff.c

Log Message:
fix printf format.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/elf2ecoff/elf2ecoff.c

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

Modified files:

Index: src/usr.bin/elf2ecoff/elf2ecoff.c
diff -u src/usr.bin/elf2ecoff/elf2ecoff.c:1.31 src/usr.bin/elf2ecoff/elf2ecoff.c:1.32
--- src/usr.bin/elf2ecoff/elf2ecoff.c:1.31	Thu Feb 23 13:49:00 2017
+++ src/usr.bin/elf2ecoff/elf2ecoff.c	Fri Feb 24 08:03:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf2ecoff.c,v 1.31 2017/02/23 18:49:00 christos Exp $	*/
+/*	$NetBSD: elf2ecoff.c,v 1.32 2017/02/24 13:03:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Jonathan Stone
@@ -512,7 +512,7 @@ saveRead(int file, off_t offset, off_t l
 	if ((off = lseek(file, offset, SEEK_SET)) < 0)
 		err(1, "%s: fseek", name);
 	if ((tmp = malloc(len)) == NULL)
-		err(1, "%s: Can't allocate %td bytes", name, len);
+		err(1, "%s: Can't allocate %jd bytes", name, (intmax_t)len);
 	count = read(file, tmp, len);
 	if (count != len)
 		err(1, "%s: short read", name);



CVS commit: src/sys/arch/i386/stand/efiboot/bootia32

2017-02-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri Feb 24 12:24:25 UTC 2017

Modified Files:
src/sys/arch/i386/stand/efiboot/bootia32: startprog32.S

Log Message:
efiboot: Don't access old stack after copying a kernel.

It's possible that the old stack is overwritten by the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S

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

Modified files:

Index: src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S
diff -u src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S:1.1 src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S:1.2
--- src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S:1.1	Tue Feb 21 10:53:37 2017
+++ src/sys/arch/i386/stand/efiboot/bootia32/startprog32.S	Fri Feb 24 12:24:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: startprog32.S,v 1.1 2017/02/21 10:53:37 nonaka Exp $	*/
+/*	$NetBSD: startprog32.S,v 1.2 2017/02/24 12:24:25 nonaka Exp $	*/
 /*	NetBSD: startprog.S,v 1.4 2016/12/04 08:21:08 maxv Exp	*/
 
 /*
@@ -91,6 +91,9 @@ start:
 
 	cli
 
+	movl	8(%ebp), %ebx	/* %ebx: entry address */
+	movl	36(%ebp), %edx	/* %edx: loaded start address */
+
 	/* Prepare a new stack */
 	movl	20(%ebp), %eax	/* stack */
 	subl	$4, %eax
@@ -108,12 +111,12 @@ start:
 	rep
 	movsl			/* copy %ds:(%esi) -> %es:(%edi) */
 	cld
-	mov	%edi, %edx	/* %edx: new stack pointer */
+	mov	%edi, %esp	/* set new stack pointer */
 
 	/* Copy kernel */
-	movl	24(%esp), %edi	/* dest */
-	movl	28(%esp), %esi	/* src */
-	movl	32(%esp), %ecx	/* size */
+	movl	24(%ebp), %edi	/* dest */
+	movl	28(%ebp), %esi	/* src */
+	movl	32(%ebp), %ecx	/* size */
 #if defined(NO_OVERLAP)
 	movl	%ecx, %eax
 #else
@@ -179,20 +182,17 @@ start:
 .Lcopy_done:
 	cld			/* LynxOS depends on it */
 
-	movl	8(%ebp), %esi	/* %esi: entry address */
-	movl	36(%ebp), %edi	/* %edi: loaded start address */
-
 	/* Prepare jump address */
-	lea	(start32a - start)(%edi), %eax
-	movl	%eax, (start32r - start)(%edi)
+	lea	(start32a - start)(%edx), %eax
+	movl	%eax, (start32r - start)(%edx)
 
 	/* Setup GDT */
-	lea	(gdt - start)(%edi), %eax
-	movl	%eax, (gdtrr - start)(%edi)
-	lgdt	(gdtr - start)(%edi)
+	lea	(gdt - start)(%edx), %eax
+	movl	%eax, (gdtrr - start)(%edx)
+	lgdt	(gdtr - start)(%edx)
 
 	/* Jump to set %cs */
-	ljmp	*(start32r - start)(%edi)
+	ljmp	*(start32r - start)(%edx)
 
 	.align	4
 start32a:
@@ -203,7 +203,8 @@ start32a:
 	movw	%ax, %gs
 	movw	%ax, %ss
 
-	movl	%edx, %esp
+	/* Already set new stack pointer */
+	movl	%esp, %ebp
 
 	/* Disable Paging in CR0 */
 	movl	%cr0, %eax
@@ -220,8 +221,8 @@ start32a:
 	.align	4
 start32b:
 	xor	%eax, %eax
-	movl	%esi, (start32r - start)(%edi)
-	ljmp	*(start32r - start)(%edi)
+	movl	%ebx, (start32r - start)(%edx)
+	ljmp	*(start32r - start)(%edx)
 
 	.align	16
 start32r:



CVS commit: src/sys/dev/pci

2017-02-24 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Feb 24 10:09:21 UTC 2017

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

Log Message:
apply 82574 RFCTL workaround the same as FreeBSD and linux.

In fact, this workaround reduces interrupt count.


To generate a diff of this commit:
cvs rdiff -u -r1.486 -r1.487 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.486 src/sys/dev/pci/if_wm.c:1.487
--- src/sys/dev/pci/if_wm.c:1.486	Fri Feb 24 10:07:33 2017
+++ src/sys/dev/pci/if_wm.c	Fri Feb 24 10:09:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.487 2017/02/24 10:09:21 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.487 2017/02/24 10:09:21 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -5032,6 +5032,16 @@ wm_init_locked(struct ifnet *ifp)
 			reg |= CTRL_EXT_PBA | CTRL_EXT_EIAME;
 			CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
 
+			/*
+			 * workaround issue with spurious interrupts
+			 * in MSI-X mode.
+			 * At wm_initialize_hardware_bits(), sc_nintrs has not
+			 * initialized yet. So re-initialize WMREG_RFCTL here.
+			 */
+			reg = CSR_READ(sc, WMREG_RFCTL);
+			reg |= WMREG_RFCTL_ACKDIS;
+			CSR_WRITE(sc, WMREG_RFCTL, reg);
+
 			ivar = 0;
 			/* TX and RX */
 			for (i = 0; i < sc->sc_nqueues; i++) {



CVS commit: src/sys/dev/pci

2017-02-24 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Feb 24 10:07:33 UTC 2017

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

Log Message:
82574 should follow MSI-X mode IMS manner.

Howerver some legacy interrupts occur as MSI-X other interrupt yet...


To generate a diff of this commit:
cvs rdiff -u -r1.485 -r1.486 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.485 src/sys/dev/pci/if_wm.c:1.486
--- src/sys/dev/pci/if_wm.c:1.485	Sat Feb 18 14:48:43 2017
+++ src/sys/dev/pci/if_wm.c	Fri Feb 24 10:07:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.485 2017/02/18 14:48:43 christos Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.485 2017/02/18 14:48:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -5133,10 +5133,15 @@ wm_init_locked(struct ifnet *ifp)
 
 		switch (sc->sc_type) {
 		case WM_T_82574:
-			CSR_WRITE(sc, WMREG_EIAC_82574,
-			WMREG_EIAC_82574_MSIX_MASK);
-			sc->sc_icr |= WMREG_EIAC_82574_MSIX_MASK;
-			CSR_WRITE(sc, WMREG_IMS, sc->sc_icr);
+			mask = 0;
+			for (i = 0; i < sc->sc_nqueues; i++) {
+wmq = >sc_queue[i];
+mask |= ICR_TXQ(wmq->wmq_id);
+mask |= ICR_RXQ(wmq->wmq_id);
+			}
+			mask |= ICR_OTHER;
+			CSR_WRITE(sc, WMREG_EIAC_82574, mask);
+			CSR_WRITE(sc, WMREG_IMS, mask | ICR_LSC);
 			break;
 		default:
 			if (sc->sc_type == WM_T_82575) {



CVS commit: src/sys/dev

2017-02-24 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Fri Feb 24 09:49:49 UTC 2017

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

Log Message:
Simplify locking.  Hold intr lock only when dealing with sc_pr (mix ring)
or virtual channel 0 (hardware).


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.309 src/sys/dev/audio.c:1.310
--- src/sys/dev/audio.c:1.309	Fri Feb 24 07:52:39 2017
+++ src/sys/dev/audio.c	Fri Feb 24 09:49:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.309 2017/02/24 07:52:39 skrll Exp $	*/
+/*	$NetBSD: audio.c,v 1.310 2017/02/24 09:49:49 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.309 2017/02/24 07:52:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.310 2017/02/24 09:49:49 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -206,6 +206,12 @@ int	audiodebug = AUDIO_DEBUG;
 int	audio_idle_timeout = 30;
 #endif
 
+#define HW_LOCK(x)	if (x == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
+mutex_enter(sc->sc_intr_lock);
+
+#define HW_UNLOCK(x)	if (x == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
+mutex_exit(sc->sc_intr_lock);
+
 int	audio_blk_ms = AUDIO_BLK_MS;
 
 int	audiosetinfo(struct audio_softc *, struct audio_info *, bool,
@@ -1280,7 +1286,7 @@ audio_setup_pfilters(struct audio_softc 
 	}
 
 	/* Swap in new filters. */
-	mutex_enter(sc->sc_intr_lock);
+	HW_LOCK(vc);
 	memcpy(of, vc->sc_pfilters, sizeof(of));
 	memcpy(os, vc->sc_pstreams, sizeof(os));
 	onfilters = vc->sc_npfilters;
@@ -1298,7 +1304,7 @@ audio_setup_pfilters(struct audio_softc 
 		vc->sc_mpr.s.param = pfilters->filters[0].param;
 		vc->sc_pustream = >sc_pstreams[0];
 	}
-	mutex_exit(sc->sc_intr_lock);
+	HW_UNLOCK(vc);
 
 	/* Destroy old filters. */
 	for (i = 0; i < onfilters; i++) {
@@ -1365,7 +1371,7 @@ audio_setup_rfilters(struct audio_softc 
 	}
 
 	/* Swap in new filters. */
-	mutex_enter(sc->sc_intr_lock);
+	HW_LOCK(vc);
 	memcpy(of, vc->sc_rfilters, sizeof(of));
 	memcpy(os, vc->sc_rstreams, sizeof(os));
 	onfilters = vc->sc_nrfilters;
@@ -1383,7 +1389,7 @@ audio_setup_rfilters(struct audio_softc 
 		vc->sc_mrr.s.param = rfilters->filters[0].param;
 		vc->sc_rustream = >sc_rstreams[rfilters->req_size - 1];
 	}
-	mutex_exit(sc->sc_intr_lock);
+	HW_UNLOCK(vc);
 
 #ifdef AUDIO_DEBUG
 	printf("%s: HW-buffer=%p pustream=%p\n",
@@ -2187,7 +2193,6 @@ audio_open(dev_t dev, struct audio_softc
 	DPRINTF(("audio_open: done sc_mode = 0x%x\n", vc->sc_mode));
 
 	grow_mixer_states(sc, 2);
-	mutex_enter(sc->sc_intr_lock);
 	if (flags & FREAD)
 		sc->sc_recopens++;
 	sc->sc_opens++;
@@ -2195,7 +2200,6 @@ audio_open(dev_t dev, struct audio_softc
 	chan->chan = n;
 	chan->deschan = n;
 	SIMPLEQ_INSERT_TAIL(>sc_audiochan, chan, entries);
-	mutex_exit(sc->sc_intr_lock);
 
 	error = fd_clone(fp, fd, flags, _fileops, chan);
 	KASSERT(error == EMOVEFD);
@@ -2303,7 +2307,9 @@ audio_drain(struct audio_softc *sc, stru
 		cc = cb->blksize - (inp - cb->s.start) % cb->blksize;
 		audio_fill_silence(>s.param, inp, cc);
 		cb->s.inp = audio_stream_add_inp(>s, inp, cc);
+		mutex_exit(sc->sc_intr_lock);
 		error = audiostartp(sc, vc);
+		mutex_enter(sc->sc_intr_lock);
 		if (error)
 			return error;
 	} else if (hw == true) {
@@ -2411,6 +2417,8 @@ audio_close(struct audio_softc *sc, int 
 
 	if (sc->sc_opens == 1 && hw->close != NULL)
 		hw->close(sc->hw_hdl);
+	mutex_exit(sc->sc_intr_lock);
+
 	if (sc->sc_opens == 1) {
 		sc->sc_async_audio = 0;
 		kauth_cred_free(sc->sc_credentials);
@@ -2438,7 +2446,6 @@ audio_close(struct audio_softc *sc, int 
 	sc->sc_opens--;
 	shrink_mixer_states(sc, 2);
 	SIMPLEQ_REMOVE(>sc_audiochan, chan, audio_chan, entries);
-	mutex_exit(sc->sc_intr_lock);
 	mutex_exit(sc->sc_lock);
 	audio_free_ring(sc, >sc_mpr);
 	audio_free_ring(sc, >sc_mrr);
@@ -2510,12 +2517,10 @@ audio_read(struct audio_softc *sc, struc
 		return error;
 	}
 
-	mutex_enter(sc->sc_intr_lock);
 	while (uio->uio_resid > 0 && !error) {
 		while ((used = audio_stream_get_used(vc->sc_rustream)) <= 0) {
 			if (!vc->sc_rbus && !vc->sc_mrr.pause)
 error = audiostartr(sc, vc);
-			mutex_exit(sc->sc_intr_lock);
 			if (error)
 return error;
 			if (ioflag & IO_NDELAY)
@@ -2526,7 +2531,6 @@ audio_read(struct audio_softc *sc, struc
 error = EIO;
 			if (error)
 return error;
-			mutex_enter(sc->sc_intr_lock);
 		}
 
 		outp = vc->sc_rustream->outp;
@@ -2553,7 +2557,6 @@ audio_read(struct audio_softc *sc, struc
 			(vc->sc_rustream, outp, n);
 		cb->copying = false;
 	}
-	mutex_exit(sc->sc_intr_lock);
 	return error;
 }
 
@@ -2838,7 +2841,6 @@ audio_write(struct audio_softc *sc, stru
 	}
 
 	error = 0;
-	mutex_enter(sc->sc_intr_lock);
 	while (uio->uio_resid > 0 && !error) {
 		/* wait if the