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

2018-12-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Dec  9 00:45:18 UTC 2018

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

Log Message:
remove XXXKALSR that became MI.


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

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

Modified files:

Index: src/sys/arch/xen/conf/files.compat
diff -u src/sys/arch/xen/conf/files.compat:1.31 src/sys/arch/xen/conf/files.compat:1.32
--- src/sys/arch/xen/conf/files.compat:1.31	Fri Jul 13 09:37:32 2018
+++ src/sys/arch/xen/conf/files.compat	Sun Dec  9 00:45:18 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.compat,v 1.31 2018/07/13 09:37:32 maxv Exp $
+#	$NetBSD: files.compat,v 1.32 2018/12/09 00:45:18 mrg Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 
 # options for MP configuration through the MP spec
@@ -25,7 +25,6 @@ defflag	bioscall.h		XXXBIOSCALL
 defflag	opt_pcibios.h		XXXOPT_PCIBIOS
 defflag	opt_pcifixup.h		XXXOPT_PCIFIXUP
 
-defflag opt_kaslr.h		XXXKASLR
 defflag opt_svs.h		XXXSVS
 
 # User-settable LDT (used by WINE)



CVS commit: src/crypto/external/bsd/openssl/lib/engines

2018-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  8 23:24:02 UTC 2018

Added Files:
src/crypto/external/bsd/openssl/lib/engines: Makefile engines.mk
src/crypto/external/bsd/openssl/lib/engines/capi: Makefile
src/crypto/external/bsd/openssl/lib/engines/dasync: Makefile
src/crypto/external/bsd/openssl/lib/engines/ossltest: Makefile
src/crypto/external/bsd/openssl/lib/engines/padlock: Makefile

Log Message:
Add engines infrastructure, not hooked to the build:
1. sets needs to be fixed
2. need to decide if I am going to add engine.so.MAJOR or use engine.so
   like OpenSSL wants
3. padlock is MD (x86) needs asm to be added, and conditionally built


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/openssl/lib/engines/Makefile \
src/crypto/external/bsd/openssl/lib/engines/engines.mk
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/engines/capi/Makefile
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/engines/dasync/Makefile
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/engines/ossltest/Makefile
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/engines/padlock/Makefile

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

Added files:

Index: src/crypto/external/bsd/openssl/lib/engines/Makefile
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/Makefile:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/Makefile	Sat Dec  8 18:24:01 2018
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2018/12/08 23:24:01 christos Exp $
+
+.include "bsd.own.mk"
+
+# OpenSSL engines.
+SUBDIR= capi dasync ossltest padlock
+
+.include 
Index: src/crypto/external/bsd/openssl/lib/engines/engines.mk
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/engines.mk:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/engines.mk	Sat Dec  8 18:24:01 2018
@@ -0,0 +1,36 @@
+#	$NetBSD: engines.mk,v 1.1 2018/12/08 23:24:01 christos Exp $
+
+NOLINT=		# don't build a lint library
+NOPROFILE=	# don't build a profile library
+NOPICINSTALL=	# don't install _pic.a library
+
+.include 
+
+SHLIB_MAJOR=0
+SHLIB_MINOR=0
+
+CRYPTODIST= ${NETBSDSRCDIR}/crypto
+.include "${NETBSDSRCDIR}/crypto/Makefile.openssl"
+.PATH: ${OPENSSLSRC}/engines
+
+CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/../include
+ 
+.if defined(MLIBDIR)
+LIBDIR=/usr/lib/${MLIBDIR}/openssl
+.else
+LIBDIR=/usr/lib/openssl
+.endif
+
+.if ${MKPIC} != "no"
+.PRECIOUS: ${DESTDIR}${LIBDIR}/${LIB}.so
+libinstall:: ${DESTDIR}${LIBDIR}/${LIB}.so
+.else
+libinstall::
+.endif
+
+.include 
+
+${DESTDIR}${LIBDIR}/${LIB}.so: lib${LIB}.so.${SHLIB_FULLVERSION}
+	${_MKTARGET_INSTALL}
+	${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	${.ALLSRC} ${.TARGET}

Index: src/crypto/external/bsd/openssl/lib/engines/capi/Makefile
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/capi/Makefile:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/capi/Makefile	Sat Dec  8 18:24:01 2018
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2018/12/08 23:24:01 christos Exp $
+
+LIB=	capi
+SRCS=	e_capi.c e_capi_err.c
+
+.include "../engines.mk"

Index: src/crypto/external/bsd/openssl/lib/engines/dasync/Makefile
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/dasync/Makefile:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/dasync/Makefile	Sat Dec  8 18:24:01 2018
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2018/12/08 23:24:01 christos Exp $
+
+LIB=	dasync
+SRCS=	e_dasync.c e_dasync_err.c
+
+.include "../engines.mk"

Index: src/crypto/external/bsd/openssl/lib/engines/ossltest/Makefile
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/ossltest/Makefile:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/ossltest/Makefile	Sat Dec  8 18:24:02 2018
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2018/12/08 23:24:02 christos Exp $
+
+LIB=	ossltest
+SRCS=	e_ossltest.c e_ossltest_err.c
+
+.include "../engines.mk"

Index: src/crypto/external/bsd/openssl/lib/engines/padlock/Makefile
diff -u /dev/null src/crypto/external/bsd/openssl/lib/engines/padlock/Makefile:1.1
--- /dev/null	Sat Dec  8 18:24:02 2018
+++ src/crypto/external/bsd/openssl/lib/engines/padlock/Makefile	Sat Dec  8 18:24:02 2018
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2018/12/08 23:24:02 christos Exp $
+
+LIB=	padlock
+SRCS=	e_padlock.c
+
+.include "../engines.mk"



CVS commit: src/doc

2018-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  8 22:38:06 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1573 -r1.1574 src/doc/3RDPARTY
cvs rdiff -u -r1.2460 -r1.2461 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1573 src/doc/3RDPARTY:1.1574
--- src/doc/3RDPARTY:1.1573	Thu Nov 29 11:04:21 2018
+++ src/doc/3RDPARTY	Sat Dec  8 17:38:06 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1573 2018/11/29 16:04:21 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1574 2018/12/08 22:38:06 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1071,8 +1071,8 @@ markus is very cooperative about it):
 - adjust the DEFAULT_PKCS11_WHITELIST for ssh-agent
 
 Package:	OpenSSL
-Version:	1.0.2o/1.1.0i
-Current Vers:	1.0.2q/1.1.0j
+Version:	1.0.2o/1.1.1a
+Current Vers:	1.0.2q/1.1.1a
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2460 src/doc/CHANGES:1.2461
--- src/doc/CHANGES:1.2460	Wed Dec  5 01:51:16 2018
+++ src/doc/CHANGES	Sat Dec  8 17:38:06 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2460 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2461 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -256,3 +256,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[netbsd 20181130]
 	atactl(8): Add support to automatically detect Micron/Crucial devices
 		and their vendor-specific SMART status values.  [mrg 20181205]
+	OpenSSL: Imported 1.1.1a. [christos 20181208]



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

2018-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  8 22:35:45 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist: CHANGES Configure NEWS README
e_os.h
src/crypto/external/bsd/openssl/dist/apps: ca.c ocsp.c openssl.cnf
s_server.c speed.c
src/crypto/external/bsd/openssl/dist/crypto: cryptlib.c
src/crypto/external/bsd/openssl/dist/crypto/bio: bio_lib.c bss_log.c
src/crypto/external/bsd/openssl/dist/crypto/bn: bn_exp.c bn_lib.c
src/crypto/external/bsd/openssl/dist/crypto/bn/asm: x86_64-gcc.c
src/crypto/external/bsd/openssl/dist/crypto/ec: ec_ameth.c
src/crypto/external/bsd/openssl/dist/crypto/engine: eng_devcrypto.c
src/crypto/external/bsd/openssl/dist/crypto/evp: e_aes.c
src/crypto/external/bsd/openssl/dist/crypto/rand: rand_unix.c
randfile.c
src/crypto/external/bsd/openssl/dist/crypto/rsa: rsa_lib.c
src/crypto/external/bsd/openssl/dist/crypto/ui: ui_openssl.c
src/crypto/external/bsd/openssl/dist/crypto/x509: x509_vfy.c
src/crypto/external/bsd/openssl/dist/include/internal: tsan_assist.h
src/crypto/external/bsd/openssl/dist/ssl: d1_lib.c s3_cbc.c s3_enc.c
s3_lib.c ssl_ciph.c ssl_lib.c ssl_locl.h t1_lib.c
src/crypto/external/bsd/openssl/dist/test: ecdsatest.c evp_extra_test.c
evp_test.c
src/crypto/external/bsd/openssl/dist/util: mkdef.pl
src/crypto/external/bsd/openssl/lib/libcrypto: crypto.inc
Removed Files:
src/crypto/external/bsd/openssl/dist/doc/man3:
SSL_CTX_set_client_CA_list.pod SSL_get_client_CA_list.pod
SSL_get_server_tmp_key.pod

Log Message:
Merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssl/dist/CHANGES \
src/crypto/external/bsd/openssl/dist/NEWS \
src/crypto/external/bsd/openssl/dist/README
cvs rdiff -u -r1.21 -r1.22 src/crypto/external/bsd/openssl/dist/Configure
cvs rdiff -u -r1.11 -r1.12 src/crypto/external/bsd/openssl/dist/e_os.h
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssl/dist/apps/ca.c \
src/crypto/external/bsd/openssl/dist/apps/s_server.c
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/openssl/dist/apps/ocsp.c
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/openssl/dist/apps/openssl.cnf
cvs rdiff -u -r1.15 -r1.16 src/crypto/external/bsd/openssl/dist/apps/speed.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/dist/crypto/cryptlib.c
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/dist/crypto/bio/bio_lib.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/bio/bss_log.c
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_exp.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_lib.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/bn/asm/x86_64-gcc.c
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/openssl/dist/crypto/ec/ec_ameth.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/openssl/dist/crypto/evp/e_aes.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/openssl/dist/crypto/rand/randfile.c
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/dist/crypto/rsa/rsa_lib.c
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/dist/crypto/ui/ui_openssl.c
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
cvs rdiff -u -r1.1.1.1 -r0 \

src/crypto/external/bsd/openssl/dist/doc/man3/SSL_CTX_set_client_CA_list.pod \
src/crypto/external/bsd/openssl/dist/doc/man3/SSL_get_client_CA_list.pod \
src/crypto/external/bsd/openssl/dist/doc/man3/SSL_get_server_tmp_key.pod
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/include/internal/tsan_assist.h
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssl/dist/ssl/d1_lib.c \
src/crypto/external/bsd/openssl/dist/ssl/s3_cbc.c
cvs rdiff -u -r1.13 -r1.14 src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c \
src/crypto/external/bsd/openssl/dist/ssl/ssl_lib.c
cvs rdiff -u -r1.22 -r1.23 src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/openssl/dist/ssl/ssl_ciph.c
cvs rdiff -u -r1.19 -r1.20 \
src/crypto/external/bsd/openssl/dist/ssl/ssl_locl.h
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssl/dist/ssl/t1_lib.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/test/ecdsatest.c
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/dist/test/evp_extra_test.c \
src/crypto/external/bsd/openssl/dist/test/evp_test.c
cvs rdiff -u -r1.9 -r1.10 

CVS commit: src/sys

2018-12-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  8 21:14:37 UTC 2018

Modified Files:
src/sys/arch/mips/alchemy/dev: com_aubus.c
src/sys/arch/mips/ingenic: ingenic_com.c
src/sys/arch/mips/ralink: ralink_com.c
src/sys/arch/mips/rmi: rmixl_com.c
src/sys/conf: files
src/sys/dev/ic: com.c comvar.h
src/sys/dev/marvell: com_mv.c

Log Message:
Remove the COM_REGMAP option -- just use it all the time.  While here,
garbage-collect the COM_FUNCMAP and COM_AU1X00 options, as there are
not used anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/alchemy/dev/com_aubus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/ingenic/ingenic_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/ralink/ralink_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/rmi/rmixl_com.c
cvs rdiff -u -r1.1217 -r1.1218 src/sys/conf/files
cvs rdiff -u -r1.351 -r1.352 src/sys/dev/ic/com.c
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/ic/comvar.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/marvell/com_mv.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/mips/alchemy/dev/com_aubus.c
diff -u src/sys/arch/mips/alchemy/dev/com_aubus.c:1.7 src/sys/arch/mips/alchemy/dev/com_aubus.c:1.8
--- src/sys/arch/mips/alchemy/dev/com_aubus.c:1.7	Sat Dec  8 17:46:12 2018
+++ src/sys/arch/mips/alchemy/dev/com_aubus.c	Sat Dec  8 21:14:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: com_aubus.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $ */
+/* $NetBSD: com_aubus.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com_aubus.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_aubus.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $");
 
 #include 
 #include 
@@ -70,10 +70,6 @@ CFATTACH_DECL_NEW(com_aubus, sizeof(stru
 
 #define CONMODE	((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 
-#ifndef	COM_REGMAP
-#error	COM_REGMAP not defined!
-#endif
-
 int
 com_aubus_probe(device_t parent, cfdata_t cf, void *aux)
 {

Index: src/sys/arch/mips/ingenic/ingenic_com.c
diff -u src/sys/arch/mips/ingenic/ingenic_com.c:1.7 src/sys/arch/mips/ingenic/ingenic_com.c:1.8
--- src/sys/arch/mips/ingenic/ingenic_com.c:1.7	Sat Dec  8 17:46:12 2018
+++ src/sys/arch/mips/ingenic/ingenic_com.c	Sat Dec  8 21:14:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ingenic_com.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $ */
+/*	$NetBSD: ingenic_com.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ingenic_com.c,v 1.7 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ingenic_com.c,v 1.8 2018/12/08 21:14:36 thorpej Exp $");
 
 #include 
 #include 
@@ -48,12 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: ingenic_com.
 #include 
 #include 
 
-#include "opt_com.h"
-
-#ifndef COM_REGMAP
-#error We need COM_REGMAP
-#endif
-
 volatile int32_t *com0addr = (int32_t *)MIPS_PHYS_TO_KSEG1(JZ_UART0);
 
 void	ingenic_putchar_init(void);

Index: src/sys/arch/mips/ralink/ralink_com.c
diff -u src/sys/arch/mips/ralink/ralink_com.c:1.6 src/sys/arch/mips/ralink/ralink_com.c:1.7
--- src/sys/arch/mips/ralink/ralink_com.c:1.6	Sat Dec  8 17:46:12 2018
+++ src/sys/arch/mips/ralink/ralink_com.c	Sat Dec  8 21:14:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $	*/
+/*	$NetBSD: ralink_com.c,v 1.7 2018/12/08 21:14:36 thorpej Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -130,7 +130,7 @@
 /* ralink_com.c -- Ralink 3052 uart console driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_com.c,v 1.7 2018/12/08 21:14:36 thorpej Exp $");
 
 #include "locators.h"
 #include 
@@ -151,8 +151,6 @@ __KERNEL_RCSID(0, "$NetBSD: ralink_com.c
 #include 
 #include 
 
-#include "opt_com.h"
-
 struct ralink_com_softc {
 	struct com_softc sc_com;
 	void *sc_ih;
@@ -171,10 +169,6 @@ CFATTACH_DECL_NEW(ralink_com, sizeof(str
 #define CONMODE	\
 	((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 
-#ifndef COM_REGMAP
-#error  COM_REGMAP not defined!
-#endif
-
 #ifndef RALINK_CONADDR
 #define RALINK_CONADDR	RA_UART_LITE_BASE	/* default console is UART_LITE */
 #endif

Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.6 src/sys/arch/mips/rmi/rmixl_com.c:1.7
--- src/sys/arch/mips/rmi/rmixl_com.c:1.6	Sat Dec  8 17:46:12 2018
+++ src/sys/arch/mips/rmi/rmixl_com.c	Sat Dec  8 21:14:37 2018
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.6 2018/12/08 17:46:12 thorpej Exp $ */
+/* $Id: rmixl_com.c,v 1.7 2018/12/08 21:14:37 thorpej Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.

CVS commit: src/sys

2018-12-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  8 17:46:14 UTC 2018

Modified Files:
src/sys/arch/acorn32/mainbus: com_pioc.c
src/sys/arch/acorn32/podulebus: amps.c
src/sys/arch/algor/dev: com_mainbus.c
src/sys/arch/alpha/jensenio: com_jensenio.c
src/sys/arch/alpha/sableio: com_sableio.c
src/sys/arch/amiga/clockport: com_ss.c
src/sys/arch/amiga/dev: com_supio.c
src/sys/arch/arc/jazz: com_jazzio.c
src/sys/arch/arm/broadcom: bcm2835_com.c bcm53xx_cca.c
src/sys/arch/arm/gemini: gemini_com.c lpc_com.c
src/sys/arch/arm/nvidia: tegra_com.c
src/sys/arch/arm/omap: obio_com.c omap_com.c omapl1x_com.c
src/sys/arch/arm/ti: ti_com.c
src/sys/arch/arm/xscale: ixp425_com.c pxa2x0_com.c
src/sys/arch/cobalt/dev: com_mainbus.c
src/sys/arch/evbarm/adi_brh: com_obio.c
src/sys/arch/evbarm/hdl_g: com_obio.c
src/sys/arch/evbarm/iq80310: com_obio.c
src/sys/arch/evbarm/iq80321: com_obio.c
src/sys/arch/evbarm/npwr_fc: com_obio.c
src/sys/arch/evbppc/ev64260: com_obio.c
src/sys/arch/evbppc/explora/dev: com_elb.c
src/sys/arch/hp300/dev: com_dio.c com_frodo.c
src/sys/arch/hpcmips/dev: com_hpcio.c
src/sys/arch/hpcmips/vr: com_vrip.c
src/sys/arch/hpcsh/dev/hd64461: hd64461uart.c
src/sys/arch/hpcsh/dev/hd64465: hd64465uart.c
src/sys/arch/hppa/dev: com_dino.c com_ssio.c
src/sys/arch/hppa/gsc: com_gsc.c
src/sys/arch/i386/pnpbios: com_pnpbios.c
src/sys/arch/iyonix/iyonix: com_obio.c
src/sys/arch/macppc/dev: com_mainbus.c
src/sys/arch/mips/alchemy/dev: com_aubus.c
src/sys/arch/mips/atheros/dev: com_arbus.c
src/sys/arch/mips/ingenic: ingenic_com.c
src/sys/arch/mips/ralink: ralink_com.c
src/sys/arch/mips/rmi: rmixl_com.c
src/sys/arch/mmeye/dev: com_mainbus.c
src/sys/arch/powerpc/booke/dev: pq3duart.c
src/sys/arch/powerpc/ibm4xx/dev: com_opb.c
src/sys/arch/rs6000/ioplanar: com_iop.c
src/sys/arch/sandpoint/sandpoint: com_eumb.c
src/sys/arch/sgimips/mace: com_mace.c
src/sys/arch/sparc/dev: com_ebus.c com_obio.c
src/sys/arch/sparc64/dev: com_ebus.c
src/sys/arch/x68k/dev: com_intio.c
src/sys/dev/acpi: com_acpi.c
src/sys/dev/cardbus: com_cardbus.c
src/sys/dev/fdt: dw_apb_uart.c
src/sys/dev/ic: com.c com_cpcbus.c com_upc.c comvar.h
src/sys/dev/isa: com_isa.c com_multi.c
src/sys/dev/isapnp: com_isapnp.c
src/sys/dev/marvell: com_mv.c
src/sys/dev/mca: com_mca.c
src/sys/dev/ofisa: com_ofisa.c
src/sys/dev/pci: com_puc.c
src/sys/dev/pcmcia: com_pcmcia.c mhzc.c pcmcom.c xirc.c
src/sys/dev/podulebus: acemidi.c

Log Message:
Clean up initialization of com_regs structure, in preparation for
some additional changers.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/acorn32/mainbus/com_pioc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/acorn32/podulebus/amps.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/algor/dev/com_mainbus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/alpha/jensenio/com_jensenio.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/alpha/sableio/com_sableio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/clockport/com_ss.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amiga/dev/com_supio.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arc/jazz/com_jazzio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835_com.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm53xx_cca.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/gemini/gemini_com.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/gemini/lpc_com.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_com.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/obio_com.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/omap_com.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omapl1x_com.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/ti/ti_com.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/ixp425_com.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/xscale/pxa2x0_com.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/cobalt/dev/com_mainbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/adi_brh/com_obio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/hdl_g/com_obio.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/iq80310/com_obio.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/iq80321/com_obio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/npwr_fc/com_obio.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbppc/ev64260/com_obio.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbppc/explora/dev/com_elb.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/dev/com_dio.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/dev/com_frodo.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hpcmips/dev/com_hpcio.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hpcmips/vr/com_vrip.c
cvs rdiff 

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

2018-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  8 17:07:27 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/engine: eng_devcrypto.c
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h
src/crypto/external/bsd/openssl/lib/libcrypto: engine.inc

Log Message:
Put back devcrypto (what was called cryptodev) engine support.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.1.1.1 src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c:1.1.1.1	Sun Sep 23 09:17:46 2018
+++ src/crypto/external/bsd/openssl/dist/crypto/engine/eng_devcrypto.c	Sat Dec  8 12:07:27 2018
@@ -177,7 +177,8 @@ static int cipher_do_cipher(EVP_CIPHER_C
 if (EVP_CIPHER_CTX_iv_length(ctx) > 0) {
 assert(inl >= EVP_CIPHER_CTX_iv_length(ctx));
 if (!EVP_CIPHER_CTX_encrypting(ctx)) {
-unsigned char *ivptr = in + inl - EVP_CIPHER_CTX_iv_length(ctx);
+const unsigned char *ivptr =
+		in + inl - EVP_CIPHER_CTX_iv_length(ctx);
 
 memcpy(saved_iv, ivptr, EVP_CIPHER_CTX_iv_length(ctx));
 }

Index: src/crypto/external/bsd/openssl/include/openssl/opensslconf.h
diff -u src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.6 src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.7
--- src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.6	Mon Oct 15 08:45:52 2018
+++ src/crypto/external/bsd/openssl/include/openssl/opensslconf.h	Sat Dec  8 12:07:27 2018
@@ -45,8 +45,10 @@ extern "C" {
 #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
 # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
 #endif
-#ifndef OPENSSL_NO_DEVCRYPTOENG
-# define OPENSSL_NO_DEVCRYPTOENG
+#if 0
+# ifndef OPENSSL_NO_DEVCRYPTOENG
+#  define OPENSSL_NO_DEVCRYPTOENG
+# endif
 #endif
 #if !defined(_LP64) || defined(__sparc64__)
 # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128

Index: src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc:1.12 src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc:1.13
--- src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc:1.12	Sun Sep 23 09:33:04 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/engine.inc	Sat Dec  8 12:07:27 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: engine.inc,v 1.12 2018/09/23 13:33:04 christos Exp $
+#	$NetBSD: engine.inc,v 1.13 2018/12/08 17:07:27 christos Exp $
 #
 #	@(#) Copyright (c) 1995 Simon J. Gerraty
 #
@@ -13,6 +13,7 @@ ENGINE_SRCS += \
 eng_all.c \
 eng_cnf.c \
 eng_ctrl.c \
+eng_devcrypto.c \
 eng_dyn.c \
 eng_err.c \
 eng_fat.c \



CVS commit: src/sys/dev/pci

2018-12-08 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Dec  8 15:31:30 UTC 2018

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

Log Message:
support multi-vector MSI-X

tested and confirmed working by Masanobu SAITOH on C3000


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/ahcisata_pci.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/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.49 src/sys/dev/pci/ahcisata_pci.c:1.50
--- src/sys/dev/pci/ahcisata_pci.c:1.49	Tue Dec  4 19:34:27 2018
+++ src/sys/dev/pci/ahcisata_pci.c	Sat Dec  8 15:31:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.49 2018/12/04 19:34:27 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.50 2018/12/08 15:31:30 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,14 +26,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.49 2018/12/04 19:34:27 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.50 2018/12/08 15:31:30 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
 #endif
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -207,7 +207,8 @@ struct ahci_pci_softc {
 	pci_chipset_tag_t sc_pc;
 	pcitag_t sc_pcitag;
 	pci_intr_handle_t *sc_pihp;
-	void *sc_ih;
+	int sc_nintr;
+	void **sc_ih;
 };
 
 static int  ahci_pci_has_quirk(pci_vendor_id_t, pci_product_id_t);
@@ -286,16 +287,105 @@ ahci_pci_match(device_t parent, cfdata_t
 	return ret;
 }
 
+static int
+ahci_pci_intr_establish(struct ahci_softc *sc, int port)
+{
+	struct ahci_pci_softc *psc = (struct ahci_pci_softc *)sc;
+	device_t self = sc->sc_atac.atac_dev;
+	char intrbuf[PCI_INTRSTR_LEN];
+	char intr_xname[INTRDEVNAMEBUF];
+	const char *intrstr;
+	int vec;
+	int (*intr_handler)(void *);
+	void *intr_arg;
+
+	KASSERT(psc->sc_pihp != NULL);
+	KASSERT(psc->sc_nintr > 0);
+
+	snprintf(intr_xname, sizeof(intr_xname), "%s", device_xname(self));
+
+	if (psc->sc_nintr == 1 || sc->sc_ghc_mrsm) {
+		/* Only one interrupt, established on vector 0 */
+		intr_handler = ahci_intr;
+		intr_arg = sc;
+		vec = 0;
+
+		if (psc->sc_ih[vec] != NULL) {
+			/* Already established, nothing more to do */
+			goto out;
+		}
+
+	} else {
+		/*
+		 * Theoretically AHCI device can have less MSI/MSI-X vectors
+		 * than supported ports. Hardware is allowed to revert
+		 * to single message MSI, but not required to do so.
+		 * So handle the case when it did not revert to single MSI.
+		 * In this case last available interrupt vector is used
+		 * for port == max vector, and all further ports.
+		 * This last vector must use the general interrupt handler,
+		 * since it needs to be able to handle several ports.
+		 * NOTE: such case was never actually observed yet
+		 */
+		if (sc->sc_atac.atac_nchannels > psc->sc_nintr
+		&& port >= (psc->sc_nintr - 1)) {
+			intr_handler = ahci_intr;
+			intr_arg = sc;
+			vec = psc->sc_nintr - 1;
+
+			if (psc->sc_ih[vec] != NULL) {
+/* Already established, nothing more to do */
+goto out;
+			}
+
+			if (port == vec) {
+/* Print error once */
+aprint_error_dev(self,
+"port %d independant interrupt vector not "
+"available, sharing with further ports",
+port);
+			}
+		} else {
+			/* Vector according to port */
+			KASSERT(port < psc->sc_nintr);
+			KASSERT(psc->sc_ih[port] == NULL);
+			intr_handler = ahci_intr_port;
+			intr_arg = >sc_channels[port];
+			vec = port;
+
+			snprintf(intr_xname, sizeof(intr_xname), "%s port%d",
+			device_xname(self), port);
+		}
+	}
+
+	intrstr = pci_intr_string(psc->sc_pc, psc->sc_pihp[vec], intrbuf,
+	sizeof(intrbuf));
+	psc->sc_ih[vec] = pci_intr_establish_xname(psc->sc_pc,
+	psc->sc_pihp[vec], IPL_BIO, intr_handler, intr_arg, intr_xname);
+	if (psc->sc_ih == NULL) {
+		aprint_error_dev(self, "couldn't establish interrupt");
+		if (intrstr != NULL)
+			aprint_error(" at %s", intrstr);
+		aprint_error("\n");
+		goto fail;
+	}
+	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
+
+out:
+	return 0;
+
+fail:
+	return EAGAIN;
+}
+
 static void
 ahci_pci_attach(device_t parent, device_t self, void *aux)
 {
 	struct pci_attach_args *pa = aux;
 	struct ahci_pci_softc *psc = device_private(self);
 	struct ahci_softc *sc = >ah_sc;
-	const char *intrstr;
 	bool ahci_cap_64bit;
 	bool ahci_bad_64bit;
-	char intrbuf[PCI_INTRSTR_LEN];
 
 	sc->sc_atac.atac_dev = self;
 
@@ -314,29 +404,18 @@ ahci_pci_attach(device_t parent, device_
 	int counts[PCI_INTR_TYPE_SIZE] = {
 		[PCI_INTR_TYPE_INTX] = 1,
 		[PCI_INTR_TYPE_MSI] = 1,
-		[PCI_INTR_TYPE_MSIX] = 0, /* XXX not working */
+		[PCI_INTR_TYPE_MSIX] = -1,
 	};
 
 	/* Allocate and establish the interrupt. */
-	if (pci_intr_alloc(pa, >sc_pihp, counts, PCI_INTR_TYPE_MSI)) {
+	if (pci_intr_alloc(pa, >sc_pihp, counts, PCI_INTR_TYPE_MSIX)) {
 		aprint_error_dev(self, "can't allocate 

CVS commit: src/sys/arch/arm

2018-12-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec  8 15:04:40 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c files.acpi
src/sys/arch/arm/cortex: gicv3_its.c
src/sys/arch/arm/include: pci_machdep.h
Added Files:
src/sys/arch/arm/acpi: acpi_iort.c acpi_iort.h

Log Message:
Add support for decoding PCI ID mappings using IO remapping tables (IORT).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/acpi_iort.c \
src/sys/arch/arm/acpi/acpi_iort.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/acpi/acpi_pci_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/cortex/gicv3_its.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/pci_machdep.h

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.8 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.9
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.8	Fri Nov 16 15:06:21 2018
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Sat Dec  8 15:04:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.8 2018/11/16 15:06:21 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.9 2018/12/08 15:04:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.8 2018/11/16 15:06:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.9 2018/12/08 15:04:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_pci_mac
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -75,6 +76,7 @@ static int	acpi_pci_md_bus_maxdevs(void 
 static pcitag_t	acpi_pci_md_make_tag(void *, int, int, int);
 static void	acpi_pci_md_decompose_tag(void *, pcitag_t, int *, int *, int *);
 static u_int	acpi_pci_md_get_segment(void *);
+static uint32_t	acpi_pci_md_get_devid(void *, uint32_t);
 static pcireg_t	acpi_pci_md_conf_read(void *, pcitag_t, int);
 static void	acpi_pci_md_conf_write(void *, pcitag_t, int, pcireg_t);
 static int	acpi_pci_md_conf_hook(void *, int, int, int, pcireg_t);
@@ -98,6 +100,7 @@ struct arm32_pci_chipset arm_acpi_pci_ch
 	.pc_make_tag = acpi_pci_md_make_tag,
 	.pc_decompose_tag = acpi_pci_md_decompose_tag,
 	.pc_get_segment = acpi_pci_md_get_segment,
+	.pc_get_devid = acpi_pci_md_get_devid,
 	.pc_conf_read = acpi_pci_md_conf_read,
 	.pc_conf_write = acpi_pci_md_conf_write,
 	.pc_conf_hook = acpi_pci_md_conf_hook,
@@ -240,6 +243,14 @@ acpi_pci_md_get_segment(void *v)
 	return ap->ap_seg;
 }
 
+static uint32_t
+acpi_pci_md_get_devid(void *v, uint32_t devid)
+{
+	struct acpi_pci_context * const ap = v;
+
+	return acpi_iort_pci_root_map(ap->ap_seg, devid);
+}
+
 static pcireg_t
 acpi_pci_md_conf_read(void *v, pcitag_t tag, int offset)
 {

Index: src/sys/arch/arm/acpi/files.acpi
diff -u src/sys/arch/arm/acpi/files.acpi:1.5 src/sys/arch/arm/acpi/files.acpi:1.6
--- src/sys/arch/arm/acpi/files.acpi:1.5	Mon Nov 12 12:56:05 2018
+++ src/sys/arch/arm/acpi/files.acpi	Sat Dec  8 15:04:40 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.5 2018/11/12 12:56:05 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.6 2018/12/08 15:04:40 jmcneill Exp $
 #
 # Configuration info for ACPI compliant ARM boards.
 #
@@ -10,6 +10,7 @@ defflag	opt_pcifixup.h		ACPI_PCI_FIXUP
 
 include "dev/acpi/files.acpi"
 
+file	arch/arm/acpi/acpi_iort.c		acpi
 file	arch/arm/acpi/acpi_machdep.c		acpi
 file	arch/arm/acpi/acpi_pci_machdep.c	acpi & pci
 file	arch/arm/acpi/acpi_platform.c		acpi

Index: src/sys/arch/arm/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.9 src/sys/arch/arm/cortex/gicv3_its.c:1.10
--- src/sys/arch/arm/cortex/gicv3_its.c:1.9	Wed Nov 28 22:54:11 2018
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sat Dec  8 15:04:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.9 2018/11/28 22:54:11 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.10 2018/12/08 15:04:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.9 2018/11/28 22:54:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.10 2018/12/08 15:04:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -282,11 +282,14 @@ gicv3_its_msi_free_lpi(struct gicv3_its 
 static uint32_t
 gicv3_its_devid(pci_chipset_tag_t pc, pcitag_t tag)
 {
+	uint32_t devid;
 	int b, d, f;
 
 	pci_decompose_tag(pc, tag, , , );
 
-	return (b << 8) | (d << 3) | f;
+	devid = (b << 8) | (d << 3) | f;
+
+	return pci_get_devid(pc, devid);
 }
 
 static int

Index: src/sys/arch/arm/include/pci_machdep.h
diff -u src/sys/arch/arm/include/pci_machdep.h:1.16 src/sys/arch/arm/include/pci_machdep.h:1.17
--- src/sys/arch/arm/include/pci_machdep.h:1.16	Fri Nov 16 15:06:22 2018

CVS commit: src/sys/dev/acpi

2018-12-08 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec  8 15:02:06 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi_mcfg.c

Log Message:
acpimcfg_configure_bus_cb can support 16-bit addresses now


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/acpi/acpi_mcfg.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/acpi/acpi_mcfg.c
diff -u src/sys/dev/acpi/acpi_mcfg.c:1.14 src/sys/dev/acpi/acpi_mcfg.c:1.15
--- src/sys/dev/acpi/acpi_mcfg.c:1.14	Mon Dec  3 05:22:03 2018
+++ src/sys/dev/acpi/acpi_mcfg.c	Sat Dec  8 15:02:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.14 2018/12/03 05:22:03 cherry Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.15 2018/12/08 15:02:06 jmcneill Exp $	*/
 
 /*-
  * Copyright (C) 2015 NONAKA Kimihiro 
@@ -28,7 +28,7 @@
 #include "opt_pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.14 2018/12/03 05:22:03 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.15 2018/12/08 15:02:06 jmcneill Exp $");
 
 #include 
 #include 
@@ -717,7 +717,8 @@ acpimcfg_configure_bus_cb(ACPI_RESOURCE 
 	const char *s;
 	int error;
 
-	if (res->Type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
+	if (res->Type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
+	res->Type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
 	res->Type != ACPI_RESOURCE_TYPE_ADDRESS64)
 		return AE_OK;
 



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

2018-12-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec  8 14:57:11 UTC 2018

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

Log Message:
 Don't call callout_halt() if it's not initialzied.


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

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.169 src/sys/dev/pci/ixgbe/ixgbe.c:1.170
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.169	Thu Dec  6 13:25:02 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec  8 14:57:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.169 2018/12/06 13:25:02 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.170 2018/12/08 14:57:11 msaitoh Exp $ */
 
 /**
 
@@ -3566,7 +3566,8 @@ ixgbe_detach(device_t dev, int flags)
 	IXGBE_WRITE_REG(>hw, IXGBE_CTRL_EXT, ctrl_ext);
 
 	callout_halt(>timer, NULL);
-	callout_halt(>recovery_mode_timer, NULL);
+	if (adapter->feat_en & IXGBE_FEATURE_RECOVERY_MODE)
+		callout_halt(>recovery_mode_timer, NULL);
 
 	if (adapter->feat_en & IXGBE_FEATURE_NETMAP)
 		netmap_detach(adapter->ifp);



CVS commit: src/external/cddl/osnet/usr.bin/ztest

2018-12-08 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Dec  8 14:55:53 UTC 2018

Modified Files:
src/external/cddl/osnet/usr.bin/ztest: ztest.1

Log Message:
Spelling


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/usr.bin/ztest/ztest.1

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

Modified files:

Index: src/external/cddl/osnet/usr.bin/ztest/ztest.1
diff -u src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.2 src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.3
--- src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.2	Sat Dec  8 12:18:37 2018
+++ src/external/cddl/osnet/usr.bin/ztest/ztest.1	Sat Dec  8 14:55:53 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: ztest.1,v 1.2 2018/12/08 12:18:37 wiz Exp $
+.\" $NetBSD: ztest.1,v 1.3 2018/12/08 14:55:53 sevan Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -151,7 +151,7 @@ This man page was written by
 .An Sevan Janiyan
 .Aq Mt se...@netbsd.org .
 .Sh CAVEATS
-To allow for backward compatibilty testing using older versions of
+To allow for backward compatibility testing using older versions of
 .Nm
 the information stored in the
 .Xr mmap 2



CVS commit: src/sys/dev/pci

2018-12-08 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Dec  8 13:31:32 UTC 2018

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

Log Message:
Don't try to handle interrupts for a detached device. Should fix
panic on shutdown reported by Stefan Hertenberger on current-users.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/pci/if_msk.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_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.80 src/sys/dev/pci/if_msk.c:1.81
--- src/sys/dev/pci/if_msk.c:1.80	Tue Nov 13 19:39:04 2018
+++ src/sys/dev/pci/if_msk.c	Sat Dec  8 13:31:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.80 2018/11/13 19:39:04 jdolecek Exp $ */
+/* $NetBSD: if_msk.c,v 1.81 2018/12/08 13:31:31 bouyer Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.80 2018/11/13 19:39:04 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.81 2018/12/08 13:31:31 bouyer Exp $");
 
 #include 
 #include 
@@ -1299,7 +1299,7 @@ msk_detach(device_t self, int flags)
 	if (sc->sk_if[sc_if->sk_port] == NULL)
 		return (0);
 
-	msk_stop(ifp, 0);
+	msk_stop(ifp, 1);
 
 	if (--sc->rnd_attached == 0)
 		rnd_detach_source(>rnd_source);
@@ -2244,10 +2244,12 @@ msk_intr(void *xsc)
 		switch (cur_st->sk_opcode) {
 		case SK_Y2_STOPC_RXSTAT:
 			sc_if = sc->sk_if[cur_st->sk_link & 0x01];
-			msk_rxeof(sc_if, letoh16(cur_st->sk_len),
-			letoh32(cur_st->sk_status));
-			if (sc_if->sk_cdata.sk_rx_cnt < (MSK_RX_RING_CNT/3))
-msk_fill_rx_tick(sc_if);
+			if (sc_if) {
+msk_rxeof(sc_if, letoh16(cur_st->sk_len),
+letoh32(cur_st->sk_status));
+if (sc_if->sk_cdata.sk_rx_cnt < (MSK_RX_RING_CNT/3))
+	msk_fill_rx_tick(sc_if);
+			}
 			break;
 		case SK_Y2_STOPC_TXSTAT:
 			if (sc_if0)



CVS commit: [netbsd-8] src/doc

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:27:57 UTC 2018

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

Log Message:
Tickets #1130 - #1132


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.71 -r1.1.2.72 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.71 src/doc/CHANGES-8.1:1.1.2.72
--- src/doc/CHANGES-8.1:1.1.2.71	Fri Dec  7 19:41:30 2018
+++ src/doc/CHANGES-8.1	Sat Dec  8 12:27:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.71 2018/12/07 19:41:30 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.72 2018/12/08 12:27:57 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2013,3 +2013,26 @@ sys/dev/pci/mpiireg.h1.1
 	mpii(4) will take precedence if both drivers are enabled.
 	[bouyer, ticket #1129]
 
+sys/dev/pci/if_bge.c1.317,1.320
+sys/dev/pci/if_bgereg.h1.94
+sys/dev/pci/if_bgevar.h1.24
+
+	bge(4): fix and workaround hardware bugs in TSO4 support for BCM5720
+	and similar.
+	[bouyer, ticket #1130]
+
+share/man/man4/mpii.41.3,1.4
+sys/dev/pci/mfii.c1.3
+sys/dev/pci/mpii.c1.15-1.18 (adapted)
+sys/dev/pci/mpiireg.h1.2
+
+	sync mpii(4) with OpenBSD, adding support for the SAS3xxx controllers,
+	and making the driver MP-safe.
+	[bouyer, ticket #1131]
+
+sys/compat/linux/common/linux_socket.c		(apply patch, see 1.140,
+		workaround without ABI change)
+
+	Fix linux emulation of sendto(2).
+	[tsutsui, ticket #1132]
+



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

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:24:18 UTC 2018

Modified Files:
src/sys/compat/linux/common [netbsd-8]: linux_socket.c

Log Message:
Apply patch, requested by tsutsui in ticket #1132:

Different solution for the fix in

sys/compat/linux/common/linux_socket.c  rev 1.140

The solution in -current could not be directly used as it required a kernel
version bump and broke the ABI. Work around it differently here.

Fixes linux emulation of sendto(2), PR 53103.


To generate a diff of this commit:
cvs rdiff -u -r1.138.6.2 -r1.138.6.3 \
src/sys/compat/linux/common/linux_socket.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.138.6.2 src/sys/compat/linux/common/linux_socket.c:1.138.6.3
--- src/sys/compat/linux/common/linux_socket.c:1.138.6.2	Sat May 12 10:29:08 2018
+++ src/sys/compat/linux/common/linux_socket.c	Sat Dec  8 12:24:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.138.6.2 2018/05/12 10:29:08 martin Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.2 2018/05/12 10:29:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -401,6 +401,7 @@ linux_sys_sendto(struct lwp *l, const st
 	struct msghdr   msg;
 	struct iovecaiov;
 	struct sockaddr_big nam;
+	struct mbuf *m;
 	int bflags;
 	int error;
 
@@ -415,13 +416,31 @@ linux_sys_sendto(struct lwp *l, const st
 	msg.msg_control = NULL;
 
 	if (SCARG(uap, tolen)) {
+		size_t solen;
+
 		/* Read in and convert the sockaddr */
 		error = linux_get_sa(l, SCARG(uap, s), , SCARG(uap, to),
 		SCARG(uap, tolen));
 		if (error)
 			return (error);
-		msg.msg_name = 
-		msg.msg_namelen = SCARG(uap, tolen);
+
+		/*
+		 * XXX
+		 * Copy sockaddr_big to mbuf because sockargs() called from
+		 * do_sys_sendmsg_so() can't handle sockaddr in msg_name
+		 * already copied into the kernel space.
+		 */
+		solen = nam.sb_len;
+		m = m_get(M_WAIT, MT_SONAME);
+		if (solen > MLEN) {
+			MEXTMALLOC(m, solen, M_WAITOK);
+		}
+		m->m_len = solen;
+		memcpy(mtod(m, void *), , solen);
+
+		msg.msg_flags |= MSG_NAMEMBUF;
+		msg.msg_name = m;
+		msg.msg_namelen = solen;
 	}
 
 	msg.msg_iov = 



CVS commit: src/external/cddl/osnet/usr.bin/ztest

2018-12-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Dec  8 12:18:37 UTC 2018

Modified Files:
src/external/cddl/osnet/usr.bin/ztest: ztest.1

Log Message:
Improve man page.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/usr.bin/ztest/ztest.1

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

Modified files:

Index: src/external/cddl/osnet/usr.bin/ztest/ztest.1
diff -u src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.1 src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.2
--- src/external/cddl/osnet/usr.bin/ztest/ztest.1:1.1	Sat Dec  8 01:28:27 2018
+++ src/external/cddl/osnet/usr.bin/ztest/ztest.1	Sat Dec  8 12:18:37 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: ztest.1,v 1.1 2018/12/08 01:28:27 sevan Exp $
+.\" $NetBSD: ztest.1,v 1.2 2018/12/08 12:18:37 wiz Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,24 @@
 .Nd ZFS stress test utility
 .Sh SYNOPSIS
 .Nm
-.Op Fl vsamrRdtgikpfVETFPBh
+.Op Fl EhV
+.Op Fl a Ar shift
+.Op Fl B Ar path
+.Op Fl d Ar datasets
+.Op Fl F Ar loops
+.Op Fl f Ar path
+.Op Fl g Ar threshold
+.Op Fl i Ar count
+.Op Fl k Ar percent
+.Op Fl m Ar copies
+.Op Fl P Ar passtime
+.Op Fl p Ar name
+.Op Fl R Ar parity
+.Op Fl r Ar disks
+.Op Fl s Ar size
+.Op Fl T Ar time
+.Op Fl t Ar threads
+.Op Fl v Ar vdevs
 .Sh DESCRIPTION
 The
 .Nm
@@ -66,84 +83,73 @@ temporary file to pass information to ch
 memory to survive
 .Xr exec 3
 syscall.
-A copy of the ztest_shared_hdr_t struct containing information on the size and
-number of shared structures in the file is always stored at offset 0 of the
-file.
+A copy of the
+.Vt ztest_shared_hdr_t
+struct containing information on the size and number of shared
+structures in the file is always stored at offset 0 of the file.
 .Pp
 For backwards compatibility testing
 .Nm
 can invoke an alternative version of
 .Nm
-after a SIGLKILL using the
+after a
+.Dv SIGKILL
+signal using the
 .Fl B
 flag.
-.sp
+.Pp
 The following options are available:
-.sp
-.Fl v
-vdevs (default: 5)
-.sp
-.Fl s
-size of each vdev (default: 256M)
-.sp
-.Fl a
+.Bl -tag -width 5n
+.It Fl a Ar shift
 alignment shift (default: 9) use 0 for random
-.sp
-.Fl m
-mirror copies (default: 2)
-.sp
-.Fl r
-raidz disks (default: 4)
-.sp
-.Fl R
-raidz parity (default: 1)
-.sp
-.Fl d
+.It Fl B Ar path
+alt ztest (default: ) alternate ztest path
+.It Fl d Ar datasets
 datasets (default: 7)
-.sp
-.Fl t
-threads (default: 23)
-.sp
-.Fl g
-gang block threshold (default: 32K)
-.sp
-.Fl i
-init count (default: 1) initialize pool i times
-.sp
-.Fl k
-kill percentage (default: 70%)
-.sp
-.Fl p
-pool name (default: ztest)
-.sp
-.Fl f
-dir (default: /tmp) file directory for vdev files
-.sp
-.Fl V
-verbose (use multiple times to increase verbosity)
-.sp
-.Fl E
+.It Fl E
 use existing pool instead of creating new one
-.sp
-.Fl T
-time (default: 300 sec) total run time
-.sp
-.Fl F
+.It Fl F Ar loops
 freezeloops (default: 50) max loops in
 .Fn spa_freeze
-.sp
-.Fl P
+.It Fl f Ar path
+dir (default:
+.Pa /tmp )
+file directory for vdev files
+.It Fl g Ar threshold
+gang block threshold (default: 32K)
+.It Fl h
+print help
+.It Fl i Ar count
+init count (default: 1) initialize pool
+.Ar count
+times
+.It Fl k Ar percent
+kill percentage (default: 70%)
+.It Fl m Ar copies
+mirror copies (default: 2)
+.It Fl P Ar passtime
 passtime (default: 60 sec) time per pass
-.sp
-.Fl B
-alt ztest (default: ) alternate ztest path
-.sp
-.Fl h
-(print help)
+.It Fl p Ar name
+pool name (default: ztest)
+.It Fl R Ar parity
+raidz parity (default: 1)
+.It Fl r Ar disks
+raidz disks (default: 4)
+.It Fl s Ar size
+size of each vdev (default: 256M)
+.It Fl T Ar time
+time (default: 300 sec) total run time
+.It Fl t Ar threads
+threads (default: 23)
+.It Fl V
+verbose (use multiple times to increase verbosity)
+.It Fl v Ar vdevs
+number of vdevs (default: 5)
+.El
 .Sh AUTHORS
 This man page was written by
 .An Sevan Janiyan
-.Aq se...@netbsd.org .
+.Aq Mt se...@netbsd.org .
 .Sh CAVEATS
 To allow for backward compatibilty testing using older versions of
 .Nm



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

2018-12-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  8 12:10:22 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bge.c if_bgereg.h if_bgevar.h

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1130):

sys/dev/pci/if_bge.c: revision 1.320
sys/dev/pci/if_bgevar.h: revision 1.24
sys/dev/pci/if_bge.c: revision 1.317
sys/dev/pci/if_bgereg.h: revision 1.94

More TSO4 fixes, from the freebsd driver:
- the chip doens't want the lenght of options, but the complete lenght of
  ip headers (ip + tcp + options). Fix this for the BGE_IS_5717_PLUS()
  and BGE_IS_5705_PLUS() cases; FreeBSD doens't cover the last case so
  leave it as is for now. This fixes checksum failures for heavy transfers.
- It looks like the transmit engine hangs if the TCP segment crosses a 4GB
  boundary. FreeBSD fixes it by mapping everything below 4GB; instead
  try detect when this happens and do the bounce only when needed.

With these fixes I could transfers 3GB images over ftp at gigabit speed
(112MB/s with wget) without problems. Tested on a
bge0 at pci4 dev 0 function 0: Broadcom BCM5720 Gigabit Ethernet
bge0: APE firmware NCSI 1.4.22.0
bge0: interrupting at msi1 vec 0
bge0: HW config 002b1194, 6014, 0002aa38,  000c
bge0: ASIC BCM5720 A0 (0x572), Ethernet address d0:94:66:8b:9c:18
bge0: setting short Tx thresholds
brgphy0 at bge0 phy 1: BCM5720C 1000BASE-T media interface, rev. 0

 -

Don't destroy the dma maps if we're not disabling the adapter, avoids
a KASSERT() when bus_dmamap_destroy() is called from interrupt
context via bge_watchdog()

Set IFF_OACTIVE only when bge_encap() fails on adapter ressource shortage.
Otherwise we may set IFF_OACTIVE while no transmit is in progress, and
nothing will clear it.

If bus_dmamap_load_mbuf() fails with EFBIG, m_defrag() the chain and retry.
Refine the check for the 4GB boundary workaround (a fragment should also
not cross the boundary), and do it only for TSO.

If bge_encap() fails and didn't set IFF_OACTIVE, drop the packet.

Bring in more hardware bug workarounds from freebsd.

With these it seems that a BCM5720 A0 can survive a few hours of internet
load with TSO4 enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.310.2.3 -r1.310.2.4 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.93 -r1.93.4.1 src/sys/dev/pci/if_bgereg.h
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/pci/if_bgevar.h

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.310.2.3 src/sys/dev/pci/if_bge.c:1.310.2.4
--- src/sys/dev/pci/if_bge.c:1.310.2.3	Mon Nov 26 17:22:32 2018
+++ src/sys/dev/pci/if_bge.c	Sat Dec  8 12:10:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.310.2.4 2018/12/08 12:10:22 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.3 2018/11/26 17:22:32 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.310.2.4 2018/12/08 12:10:22 martin Exp $");
 
 #include 
 #include 
@@ -233,10 +233,10 @@ static int bge_newbuf_std(struct bge_sof
 			   bus_dmamap_t);
 static int bge_newbuf_jumbo(struct bge_softc *, int, struct mbuf *);
 static int bge_init_rx_ring_std(struct bge_softc *);
-static void bge_free_rx_ring_std(struct bge_softc *);
+static void bge_free_rx_ring_std(struct bge_softc *m, bool);
 static int bge_init_rx_ring_jumbo(struct bge_softc *);
 static void bge_free_rx_ring_jumbo(struct bge_softc *);
-static void bge_free_tx_ring(struct bge_softc *);
+static void bge_free_tx_ring(struct bge_softc *m, bool);
 static int bge_init_tx_ring(struct bge_softc *);
 
 static int bge_chipinit(struct bge_softc *);
@@ -1713,6 +1713,9 @@ bge_newbuf_std(struct bge_softc *sc, int
 	struct bge_rx_bd	*r;
 	int			error;
 
+	if (dmamap == NULL)
+		dmamap = sc->bge_cdata.bge_rx_std_map[i];
+
 	if (dmamap == NULL) {
 		error = bus_dmamap_create(sc->bge_dmatag, MCLBYTES, 1,
 		MCLBYTES, 0, BUS_DMA_NOWAIT, );
@@ -1852,7 +1855,7 @@ bge_init_rx_ring_std(struct bge_softc *s
 }
 
 static void
-bge_free_rx_ring_std(struct bge_softc *sc)
+bge_free_rx_ring_std(struct bge_softc *sc, bool disable)
 {
 	int i;
 
@@ -1863,8 +1866,11 @@ bge_free_rx_ring_std(struct bge_softc *s
 		if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) {
 			m_freem(sc->bge_cdata.bge_rx_std_chain[i]);
 			sc->bge_cdata.bge_rx_std_chain[i] = NULL;
-			bus_dmamap_destroy(sc->bge_dmatag,
-			sc->bge_cdata.bge_rx_std_map[i]);
+			if (disable) {
+bus_dmamap_destroy(sc->bge_dmatag,
+sc->bge_cdata.bge_rx_std_map[i]);
+sc->bge_cdata.bge_rx_std_map[i] = NULL;
+			}
 		}
 		memset((char *)>bge_rdata->bge_rx_std_ring[i], 0,
 		sizeof(struct bge_rx_bd));
@@ -1920,7 +1926,7 @@ bge_free_rx_ring_jumbo(struct bge_softc 
 }
 
 static void