CVS commit: src/sys

2018-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 12 05:49:38 UTC 2018

Modified Files:
src/sys/kern: uipc_mbufdebug.c
src/sys/sys: mbuf.h

Log Message:
- Print TCP options. Some of them are not decoded yet (e.g. SACK).
- Print IP checksum and TCP checksum.
- When a packet length is shorter than a required size of the protocol, print
  both sizes.
- Make m_examine_xxx() functions global.
- Use bool instead of boolean_t.
- s/TRUE/true/, s/FALSE/false/
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/uipc_mbufdebug.c
cvs rdiff -u -r1.210 -r1.211 src/sys/sys/mbuf.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/kern/uipc_mbufdebug.c
diff -u src/sys/kern/uipc_mbufdebug.c:1.5 src/sys/kern/uipc_mbufdebug.c:1.6
--- src/sys/kern/uipc_mbufdebug.c:1.5	Thu Oct 11 11:17:07 2018
+++ src/sys/kern/uipc_mbufdebug.c	Fri Oct 12 05:49:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbufdebug.c,v 1.5 2018/10/11 11:17:07 msaitoh Exp $	*/
+/*	$NetBSD: uipc_mbufdebug.c,v 1.6 2018/10/12 05:49:38 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbufdebug.c,v 1.5 2018/10/11 11:17:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbufdebug.c,v 1.6 2018/10/12 05:49:38 msaitoh Exp $");
 
 #include 
 #include 
@@ -63,30 +63,6 @@ static char *str_ipaddr(const struct in_
 static char *str_ip6addr(const struct in6_addr *);
 static const char *str_ipproto(const uint8_t);
 
-/* parsers for m_examine() */
-static void m_examine_ether(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_pppoe(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_ppp(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_arp(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_ip(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_icmp(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_ip6(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_icmp6(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_tcp(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_udp(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-static void m_examine_hex(const struct mbuf *, int, const char *,
-void (*)(const char *, ...));
-
 /* header structure for some protocol */
 struct pppoehdr {
 	uint8_t vertype;
@@ -157,18 +133,18 @@ m_peek_len(const struct mbuf *m, const c
 {
 	const struct mbuf *m0;
 	unsigned int pktlen;
-	boolean_t opt_c = FALSE;
+	bool opt_c = false;
 	unsigned char ch;
 
-	while ( modif && (ch = *(modif++)) != '\0') {
+	while (modif && (ch = *(modif++)) != '\0') {
 		switch (ch) {
 		case 'c':
-			opt_c = TRUE;
+			opt_c = true;
 			break;
 		}
 	}
 
-	if (opt_c == TRUE) {
+	if (opt_c == true) {
 		return m->m_len;
 	}
 
@@ -242,7 +218,7 @@ str_ipproto(const uint8_t proto)
 	return NULL;
 }
 
-static void
+void
 m_examine_ether(const struct mbuf *m, int off, const char *modif,
 void (*pr)(const char *, ...))
 {
@@ -251,7 +227,8 @@ m_examine_ether(const struct mbuf *m, in
 
 	pktlen = m_peek_len(m, modif) - off;
 	if (pktlen < sizeof(eh)) {
-		(*pr)("%s: too short mbuf chain\n", __func__);
+		(*pr)("%s: too short mbuf chain (%u < %u)\n", __func__,
+		pktlen, sizeof(eh));
 		return m_examine_hex(m, off, modif, pr);
 	}
 
@@ -290,7 +267,7 @@ m_examine_ether(const struct mbuf *m, in
 	return m_examine_hex(m, off, modif, pr);
 }
 
-static void
+void
 m_examine_pppoe(const struct mbuf *m, int off, const char *modif,
 void (*pr)(const char *, ...))
 {
@@ -301,7 +278,8 @@ m_examine_pppoe(const struct mbuf *m, in
 
 	pktlen = m_peek_len(m, modif) - off;
 	if (pktlen < sizeof(ph)) {
-		(*pr)("%s: too short mbuf chain\n", __func__);
+		(*pr)("%s: too short mbuf chain (%u, %u)\n", __func__,
+		pktlen, sizeof(ph));
 		return m_examine_hex(m, off, modif, pr);
 	}
 
@@ -371,7 +349,7 @@ m_examine_pppoe(const struct mbuf *m, in
 	return m_examine_ppp(m, off, modif, pr);
 }
 
-static void
+void
 m_examine_ppp(const struct mbuf *m, int off, const char *modif,
 void (*pr)(const char *, ...))
 {
@@ -381,7 +359,8 @@ m_examine_ppp(const struct mbuf *m, int 
 
 	pktlen = m_peek_len(m, modif) - off;
 	if (pktlen < sizeof(h)) {
-		(*pr)("%s: too short mbuf chain\n", __func__);
+		(*pr)("%s: too short mbuf chain (%u < %u)\n", __func__,
+		pktlen, sizeof(h));
 		return m_examine_hex(m, off, modif, pr);
 	}
 
@@ -462,7 +441,7 @@ m_examine_ppp(const struct mbuf *m, int 
 	return m_examine_h

CVS commit: src/sys/netinet

2018-10-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Oct 12 05:41:18 UTC 2018

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

Log Message:
Force ip_off to zero when the reassembly is complete. This was lost in my
rev1.19 - before that the IP struct was clobbered for the reassembly, but
it actually implicitly guaranteed that the first fragment of the packet
would end up with ip_off = 0, and this was a desired behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet/ip_reass.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/ip_reass.c
diff -u src/sys/netinet/ip_reass.c:1.20 src/sys/netinet/ip_reass.c:1.21
--- src/sys/netinet/ip_reass.c:1.20	Mon Sep 17 08:11:27 2018
+++ src/sys/netinet/ip_reass.c	Fri Oct 12 05:41:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.20 2018/09/17 08:11:27 maxv Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.21 2018/10/12 05:41:18 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.20 2018/09/17 08:11:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.21 2018/10/12 05:41:18 maxv Exp $");
 
 #include 
 #include 
@@ -402,6 +402,7 @@ insert:
 	 * header visible.
 	 */
 	ip->ip_len = htons((ip->ip_hl << 2) + next);
+	ip->ip_off = htons(0);
 	ip->ip_src = fp->ipq_src;
 	ip->ip_dst = fp->ipq_dst;
 	free(fp, M_FTABLE);



CVS commit: src/sys/compat/netbsd32

2018-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Oct 12 05:06:05 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c

Log Message:
PR kern/53666
Correct misleading names of dummy variables. No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/compat/netbsd32/netbsd32_ioctl.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/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.98 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.99
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.98	Thu Oct 11 15:23:22 2018
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Fri Oct 12 05:06:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.98 2018/10/11 15:23:22 christos Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.99 2018/10/12 05:06:05 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.98 2018/10/11 15:23:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.99 2018/10/12 05:06:05 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1346,7 +1346,7 @@ netbsd32_ioctl(struct lwp *l, const stru
 	case BIOCGDLTLIST32:
 		IOCTL_STRUCT_CONV_TO(BIOCGDLTLIST, bpf_dltlist);
 	case BIOCSRTIMEOUT32:
-#define netbsd32_to_timeval(p, s32p, cmd) netbsd32_to_timeval(p, s32p)
+#define netbsd32_to_timeval(s32p, p, cmd) netbsd32_to_timeval(s32p, p)
 #define netbsd32_from_timeval(p, s32p, cmd) netbsd32_from_timeval(p, s32p)
 		IOCTL_STRUCT_CONV_TO(BIOCSRTIMEOUT, timeval);
 #undef netbsd32_to_timeval



CVS commit: src/share/man/man4

2018-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 12 04:43:50 UTC 2018

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

Log Message:
 The 'c' modifier of mbuf command is to NOT follow the mbuf chain.
Usually, users want to floow the mbuf chain. This modifier is used when a
user don't want to follow a mbuf chain.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/share/man/man4/ddb.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/ddb.4
diff -u src/share/man/man4/ddb.4:1.183 src/share/man/man4/ddb.4:1.184
--- src/share/man/man4/ddb.4:1.183	Mon Aug 13 03:20:19 2018
+++ src/share/man/man4/ddb.4	Fri Oct 12 04:43:50 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.4,v 1.183 2018/08/13 03:20:19 mrg Exp $
+.\"	$NetBSD: ddb.4,v 1.184 2018/10/12 04:43:50 msaitoh Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -56,7 +56,7 @@
 .\" any improvements or extensions that they make and grant Carnegie Mellon
 .\" the rights to redistribute these changes.
 .\"
-.Dd August 12, 2018
+.Dd October 12, 2018
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -679,7 +679,7 @@ Print the mbuf structure at
 Valid modifiers:
 .Bl -tag -width 4n -compact
 .It Cm /c
-The mbufs in the chain are followed.
+The mbufs in the chain are NOT followed.
 .It Cm /d
 The data is dumped.
 .It Cm /v



CVS commit: [pgoyette-compat] src/doc

2018-10-11 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Oct 12 04:12:07 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Remove the last item in the need-for-merge section.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/TODO.compat-module

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

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.17 src/doc/TODO.compat-module:1.1.2.18
--- src/doc/TODO.compat-module:1.1.2.17	Tue Oct  2 22:00:47 2018
+++ src/doc/TODO.compat-module	Fri Oct 12 04:12:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.17 2018/10/02 22:00:47 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.18 2018/10/12 04:12:06 pgoyette Exp $ */
 
 DONE
 
@@ -55,19 +55,13 @@ DONE
 framework, and split version-specific code from baseline code as
 needed.
 
-TODO - Required for branch merge
-
-16. The ieee_80211 compat code needs to be verified to make sure it is
-handling the if43_20 compat routine cvtcmd() correctly.
-
-
 TODO - Not required for branch merge
 
-17. Audit the entire code base for any remaining embedded #ifdef's for
+16. Audit the entire code base for any remaining embedded #ifdef's for
 COMPAT_xx.  When found, move the actual compat code into the compat
 hierarchy and replace originals with indirect (vectored) calls.
 
-18. The rtsock compat code is a disaster, with rtsock_50.c #include-ing
+17. The rtsock compat code is a disaster, with rtsock_50.c #include-ing
 the main rtsock.c code with various manipulations of the COMPAT_50
 macro.  Once rtsock is separated, compat_14 references to rtsock_50
 routines needs to be verified.
@@ -77,7 +71,7 @@ TODO - Not required for branch merge
 the compat code can be executed, neither on the branch nor on
 HEAD.
 
-19. The compat_60 module still needs some work for XEN systems.  We
+18. The compat_60 module still needs some work for XEN systems.  We
 probably need some build infrastructure changes to ensure that
 XEN (and, for i386, XEN-PAE) modules are build with the correct
 macros defined and with -I directories specified in the same order
@@ -85,7 +79,7 @@ TODO - Not required for branch merge
 prevents loading of micro-code updates for amd64 processors running
 XEN kernels.  This limitation also exists on HEAD.
 
-20. There seems to be quite a bit of MD compat_xx code, in the various
+19. There seems to be quite a bit of MD compat_xx code, in the various
 sys/arch/ directories.  I haven't yet looked at any of this.  But it
 seems to me that the MI compat build infrastructure should have some
 mechanism to "reach over" to the MD code, #include a Makefile.inc file,
@@ -103,12 +97,12 @@ TODO - Not required for branch merge
 into the monolithic COMPAT module on HEAD.  Thus, its absence from
 any of the version-specific modules is not a regression.
 
-21. For compat_50, in addition to rtsock there are some things in dev/gpio
+20. For compat_50, in addition to rtsock there are some things in dev/gpio
 and dev/wscons/wsmux that I haven't been able to cleanly separate.
 These items are not currently included in the monolithic COMPAT module
 on HEAD, so lack of integration on the branch is not a regression.
 
-22. Find all the remaining dependencies on the compat_utils routines and
+21. Find all the remaining dependencies on the compat_utils routines and
 deal with them appropriately.  For now, we simply ensure that they
 are included in every kernel via 'options COMPAT_UTILS' in file
 sys/conf/std



CVS commit: src/doc

2018-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Oct 12 04:09:09 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
note that aarch64 supports compat_netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.2445 -r1.2446 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/CHANGES
diff -u src/doc/CHANGES:1.2445 src/doc/CHANGES:1.2446
--- src/doc/CHANGES:1.2445	Sat Sep 29 21:53:38 2018
+++ src/doc/CHANGES	Fri Oct 12 04:09:09 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2445 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2446 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -230,3 +230,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		userland tools. [maxv 20180923]
 	npf: Converted to use libnv [rmind 20180929]
 	ntp: Import ntp 4.2.8p12. [christos 20180929]
+	aarch64: add support for compat_netbsd32(8). [ryo 20181012]



CVS commit: src/share/man/man8

2018-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Oct 12 04:08:59 UTC 2018

Modified Files:
src/share/man/man8: compat_netbsd32.8

Log Message:
Mention that compat32 supports running arm binaries on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man8/compat_netbsd32.8

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/man8/compat_netbsd32.8
diff -u src/share/man/man8/compat_netbsd32.8:1.9 src/share/man/man8/compat_netbsd32.8:1.10
--- src/share/man/man8/compat_netbsd32.8:1.9	Tue Sep 13 09:16:15 2011
+++ src/share/man/man8/compat_netbsd32.8	Fri Oct 12 04:08:59 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: compat_netbsd32.8,v 1.9 2011/09/13 09:16:15 wiz Exp $
+.\"	$NetBSD: compat_netbsd32.8,v 1.10 2018/10/12 04:08:59 ryo Exp $
 .\"
 .\" Copyright (c) 2001 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 11, 2006
+.Dd October 12, 2018
 .Dt COMPAT_NETBSD32 8
 .Os
 .Sh NAME
@@ -37,6 +37,10 @@ module allows
 .Nx Ns Tn /sparc64
 to run
 .Nx Ns Tn /sparc
+executables,
+.Nx Ns Tn /aarch64
+to run
+.Nx Ns Tn /arm
 executables, and
 .Nx Ns Tn /amd64
 to run



CVS commit: src/sys/arch

2018-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Oct 12 01:28:58 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S db_disasm.c db_machdep.c
exec_machdep.c fault.c locore.S netbsd32_machdep.c pmap.c trap.c
vectors.S
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/aarch64/include: armreg.h db_machdep.h elf_machdep.h
netbsd32_machdep.h param.h pmap.h vmparam.h
src/sys/arch/arm/include: mcontext.h
src/sys/arch/evbarm/conf: GENERIC64 RPI64
Added Files:
src/sys/arch/aarch64/aarch64: aarch32_syscall.c netbsd32_syscall.c

Log Message:
add initial support of COMPAT_NETBSD32 on AArch64.
arm ELF32 EABI binaries could be execute in AArch32 state on AArch64. A32 THUMB 
mode is not supported yet.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/aarch64/aarch64/aarch32_syscall.c \
src/sys/arch/aarch64/aarch64/netbsd32_syscall.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/cpuswitch.S \
src/sys/arch/aarch64/aarch64/db_disasm.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/db_machdep.c \
src/sys/arch/aarch64/aarch64/vectors.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/exec_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/fault.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/aarch64/aarch64/locore.S \
src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/include/db_machdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/include/elf_machdep.h \
src/sys/arch/aarch64/include/param.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/include/netbsd32_machdep.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/include/vmparam.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/include/mcontext.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/RPI64

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/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.4 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.5
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.4	Tue Jul 17 18:08:36 2018
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Fri Oct 12 01:28:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.4 2018/07/17 18:08:36 christos Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.5 2018/10/12 01:28:57 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,9 +33,10 @@
 #include 
 #include "assym.h"
 
+#include "opt_compat_netbsd32.h"
 #include "opt_ddb.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.4 2018/07/17 18:08:36 christos Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.5 2018/10/12 01:28:57 ryo Exp $")
 
 /*
  * At IPL_SCHED:
@@ -308,6 +309,9 @@ ENTRY_NP(el0_trap_exit)
 
 	ldr	x0, [x9, #L_PRIVATE]	/* tpidr_el0 = curlwp->l_private */
 	msr	tpidr_el0, x0
+#ifdef COMPAT_NETBSD32
+	msr	tpidrro_el0, x0
+#endif
 
 	unwind_x3_x30
 
Index: src/sys/arch/aarch64/aarch64/db_disasm.c
diff -u src/sys/arch/aarch64/aarch64/db_disasm.c:1.4 src/sys/arch/aarch64/aarch64/db_disasm.c:1.5
--- src/sys/arch/aarch64/aarch64/db_disasm.c:1.4	Sat Sep 15 19:47:48 2018
+++ src/sys/arch/aarch64/aarch64/db_disasm.c	Fri Oct 12 01:28:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.4 2018/09/15 19:47:48 jakllsch Exp $ */
+/* $NetBSD: db_disasm.c,v 1.5 2018/10/12 01:28:57 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.4 2018/09/15 19:47:48 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.5 2018/10/12 01:28:57 ryo Exp $");
 
 #include 
 #include 
@@ -121,3 +121,18 @@ strdisasm(vaddr_t pc)
 
 	return strdisasm_buf;
 }
+
+/*
+ * disassemble aarch32 insns?
+ */
+const char *
+strdisasm_aarch32(vaddr_t pc)
+{
+	uint32_t insn = *(uint32_t *)pc;
+
+	/* not supported any aarch32 insns yet... */
+	snprintf(strdisasm_buf, sizeof(strdisasm_buf), ".insn 0x%08x", insn);
+
+	return strdisasm_buf;
+}
+

Index: src/sys/arch/aarch64/aarch64/db_machdep.c
diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.8 src/sys/arch/aarch64/aarch64/db_machdep.c:1.9
--- src/sys/arch/aarch64/aarch64/db_machdep.c:1.8	Sat Sep 15 19:47:48 2018
+++ src/sys/arch/aarch64/aarch64/db_machdep.c	Fri Oct 12 01:28:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.8 2018/09/15 19:47:48 jakllsch Exp $ */
+/* $NetBSD: db_machdep.c,v 1.9 2018/10/12 01:28:57 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep

CVS commit: src/sys/external/bsd/drm2/nouveau

2018-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 12 01:16:20 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/nouveau: files.nouveau

Log Message:
nouveau_nv50_display.c and nouveau_nvif_client.c have variable structures
not at the end of a structure.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/drm2/nouveau/files.nouveau

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

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/files.nouveau
diff -u src/sys/external/bsd/drm2/nouveau/files.nouveau:1.21 src/sys/external/bsd/drm2/nouveau/files.nouveau:1.22
--- src/sys/external/bsd/drm2/nouveau/files.nouveau:1.21	Mon Aug 27 12:06:01 2018
+++ src/sys/external/bsd/drm2/nouveau/files.nouveau	Thu Oct 11 21:16:20 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.nouveau,v 1.21 2018/08/27 16:06:01 riastradh Exp $
+#	$NetBSD: files.nouveau,v 1.22 2018/10/12 01:16:20 christos Exp $
 
 version	20180827
 
@@ -27,6 +27,7 @@ makeoptions	nouveau	CPPFLAGS+="-DCONFIG_
 
 makeoptions	nouveau	"CWARNFLAGS.nouveau"+="-Wno-missing-field-initializers"
 makeoptions	nouveau	"CWARNFLAGS.nouveau"+="-Wno-shadow"
+makeoptions	nouveau	"CWARNFLAGS.clang"+="-Wno-gnu-variable-sized-type-not-at-end"
 
 file	external/bsd/drm2/nouveau/nouveau_module.c	nouveau
 



CVS commit: src/sys/arch/aarch64/aarch64

2018-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Oct 12 01:13:51 UTC 2018

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

Log Message:
- cleanup checking address ranges with IN_RANGE macro
- change PM_ADDR_CHECK macro to KASSERTMSG
- restore fast lookup cases with IN_RANGE macro for pmap_extract changed in my 
previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/aarch64/aarch64/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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.27 src/sys/arch/aarch64/aarch64/pmap.c:1.28
--- src/sys/arch/aarch64/aarch64/pmap.c:1.27	Fri Oct 12 00:57:17 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Oct 12 01:13:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.27 2018/10/12 00:57:17 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.28 2018/10/12 01:13:51 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.27 2018/10/12 00:57:17 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.28 2018/10/12 01:13:51 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -232,32 +232,27 @@ pm_unlock(struct pmap *pm)
 	mutex_exit(&pm->pm_lock);
 }
 
-static void __unused
-pm_addr_check(struct pmap *pm, vaddr_t va, const char *prefix)
-{
-	if (pm == pmap_kernel()) {
-		if (VM_MIN_KERNEL_ADDRESS <= va && va < VM_MAX_KERNEL_ADDRESS) {
-			// ok
-		} else {
-			printf("%s: kernel pm %p:"
-			" va=%016lx is not kernel address\n",
-			prefix, pm, va);
-			panic("pm_addr_check");
-		}
-	} else {
-		if (VM_MIN_ADDRESS <= va && va <= VM_MAX_ADDRESS) {
-			// ok
-		} else {
-			printf(
-			"%s: user pm %p: va=%016lx is not kernel address\n",
-			prefix, pm, va);
-			panic("pm_addr_check");
-		}
-	}
-}
-#define PM_ADDR_CHECK(pm, va)		pm_addr_check(pm, va, __func__)
+#define IN_RANGE(va,sta,end)	(((sta) <= (va)) && ((va) < (end)))
+
 #define IN_KSEG_ADDR(va)	\
-	((AARCH64_KSEG_START <= (va)) && ((va) < AARCH64_KSEG_END))
+	IN_RANGE((va), AARCH64_KSEG_START, AARCH64_KSEG_END)
+
+#define KASSERT_PM_ADDR(pm, va)		\
+	do {\
+		if ((pm) == pmap_kernel()) {\
+			KASSERTMSG(IN_RANGE((va), VM_MIN_KERNEL_ADDRESS, \
+			VM_MAX_KERNEL_ADDRESS),			\
+			"%s: kernel pm %p: va=%016lx"		\
+			" is not kernel address\n",			\
+			__func__, (pm), (va));			\
+		} else {		\
+			KASSERTMSG(IN_RANGE((va),			\
+			VM_MIN_ADDRESS, VM_MAX_ADDRESS),		\
+			"%s: user pm %p: va=%016lx"			\
+			" is not user address\n",			\
+			__func__, (pm), (va));			\
+		}			\
+	} while (0 /* CONSTCOND */)
 
 
 static const struct pmap_devmap *pmap_devmap_table;
@@ -620,12 +615,22 @@ pmap_extract(struct pmap *pm, vaddr_t va
 	static pt_entry_t *ptep;
 	paddr_t pa;
 	vsize_t blocksize = 0;
+	extern char __kernel_text[];
+	extern char _end[];
 
-	ptep = _pmap_pte_lookup_bs(pm, va, &blocksize);
-	if (ptep == NULL)
-		return false;
+	if (IN_RANGE(va, (vaddr_t)__kernel_text, (vaddr_t)_end)) {
+		/* fast loookup */
+		pa = KERN_VTOPHYS(va);
+	} else if (IN_KSEG_ADDR(va)) {
+		/* fast loookup. should be used only if actually mapped? */
+		pa = AARCH64_KVA_TO_PA(va);
+	} else {
+		ptep = _pmap_pte_lookup_bs(pm, va, &blocksize);
+		if (ptep == NULL)
+			return false;
+		pa = lxpde_pa(*ptep) + (va & (blocksize - 1));
+	}
 
-	pa = lxpde_pa(*ptep) + (va & (blocksize - 1));
 	if (pap != NULL)
 		*pap = pa;
 	return true;
@@ -637,22 +642,13 @@ vtophys(vaddr_t va)
 	struct pmap *pm;
 	paddr_t pa;
 
-	if (VM_MIN_KERNEL_ADDRESS <= va && va < VM_MAX_KERNEL_ADDRESS) {
-		if (pmap_extract(pmap_kernel(), va, &pa) == false) {
-			return VTOPHYS_FAILED;
-		}
-	} else if (IN_KSEG_ADDR(va)) {
-		pa = AARCH64_KVA_TO_PA(va);
-	} else if (VM_MIN_ADDRESS <= va && va <= VM_MAX_ADDRESS) {
-		if (curlwp->l_proc == NULL)
-			return VTOPHYS_FAILED;
+	if (va & TTBR_SEL_VA)
+		pm = pmap_kernel();
+	else
 		pm = curlwp->l_proc->p_vmspace->vm_map.pmap;
-		if (pmap_extract(pm, va, &pa) == false) {
-			return VTOPHYS_FAILED;
-		}
-	} else {
+
+	if (pmap_extract(pm, va, &pa) == false)
 		return VTOPHYS_FAILED;
-	}
 	return pa;
 }
 
@@ -996,10 +992,10 @@ pmap_kremove(vaddr_t va, vsize_t size)
 	KDASSERT((va & PGOFSET) == 0);
 	KDASSERT((size & PGOFSET) == 0);
 
-	KASSERT(!IN_KSEG_ADDR(va));
+	KDASSERT(!IN_KSEG_ADDR(va));
 
 	eva = va + size;
-	KDASSERT(VM_MIN_KERNEL_ADDRESS <= va && eva < VM_MAX_KERNEL_ADDRESS);
+	KDASSERT(IN_RANGE(va, VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS));
 
 	s = splvm();
 	for (; va < eva; va += PAGE_SIZE) {
@@ -1061,8 +1057,7 @@ pmap_protect(struct pmap *pm, vaddr_t sv
 	UVMHIST_LOG(pmaphist, "pm=%p, sva=%016lx, eva=%016lx, prot=%08x",
 	pm, sva, eva, prot);
 
-	PM_ADDR_CHECK(pm, sva);
-
+	KASSERT_PM_ADDR(pm, sva);
 	KASSERT(!IN_KSEG_ADDR(sva));
 
 	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
@@ -1276,7 +1271,8 @@ 

CVS commit: src/sys/arch/aarch64

2018-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Oct 12 00:57:17 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
rewrite pmap_pte_lookup() to share similar code.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/include/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.26 src/sys/arch/aarch64/aarch64/pmap.c:1.27
--- src/sys/arch/aarch64/aarch64/pmap.c:1.26	Thu Oct  4 23:53:13 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Oct 12 00:57:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.26 2018/10/04 23:53:13 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.27 2018/10/12 00:57:17 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.26 2018/10/04 23:53:13 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.27 2018/10/12 00:57:17 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -186,7 +186,8 @@ struct pv_entry {
 	pt_entry_t *pv_ptep;	/* for fast pte lookup */
 };
 
-static pt_entry_t *_pmap_pte_lookup(struct pmap *, vaddr_t);
+static pt_entry_t *_pmap_pte_lookup_l3(struct pmap *, vaddr_t);
+static pt_entry_t *_pmap_pte_lookup_bs(struct pmap *, vaddr_t, vsize_t *);
 static pt_entry_t _pmap_pte_adjust_prot(pt_entry_t, vm_prot_t, vm_prot_t, bool);
 static pt_entry_t _pmap_pte_adjust_cacheflags(pt_entry_t, u_int);
 static void _pmap_remove(struct pmap *, vaddr_t, bool);
@@ -618,91 +619,16 @@ pmap_extract(struct pmap *pm, vaddr_t va
 {
 	static pt_entry_t *ptep;
 	paddr_t pa;
-	bool found;
+	vsize_t blocksize = 0;
 
-#if 0
-	PM_ADDR_CHECK(pm, va);
-#else
-	if (((pm == pmap_kernel()) &&
-	!(VM_MIN_KERNEL_ADDRESS <= va && va < VM_MAX_KERNEL_ADDRESS) &&
-	!(AARCH64_KSEG_START <= va && va < AARCH64_KSEG_END)) ||
-	((pm != pmap_kernel()) &&
-	!(VM_MIN_ADDRESS <= va && va <= VM_MAX_ADDRESS)))
+	ptep = _pmap_pte_lookup_bs(pm, va, &blocksize);
+	if (ptep == NULL)
 		return false;
-#endif
-
-	extern char __kernel_text[];
-	extern char _end[];
-	if ((vaddr_t)__kernel_text <= va && va < (vaddr_t)_end) {
-		pa = KERN_VTOPHYS(va);
-		found = true;
-	} else if (AARCH64_KSEG_START <= va && va < AARCH64_KSEG_END) {
-		pa = AARCH64_KVA_TO_PA(va);
-		found = true;
-	} else {
-		pt_entry_t pte;
-
-		ptep = _pmap_pte_lookup(pm, va);
-		if (ptep == NULL) {
-			pd_entry_t pde, *l1, *l2, *l3;
-
-			/*
-			 * traverse L0 -> L1 -> L2 -> L3 table
-			 * with considering block
-			 */
-			pde = pm->pm_l0table[l0pde_index(va)];
-			if (!l0pde_valid(pde)) {
-found = false;
-goto done;
-			}
-
-			l1 = (void *)AARCH64_PA_TO_KVA(l0pde_pa(pde));
-			pde = l1[l1pde_index(va)];
-			if (!l1pde_valid(pde)) {
-found = false;
-goto done;
-			}
-			if (l1pde_is_block(pde)) {
-pa = l1pde_pa(pde) + (va & L1_OFFSET);
-found = true;
-goto done;
-			}
-
-			KASSERT(l1pde_is_table(pde));
-
-			l2 = (void *)AARCH64_PA_TO_KVA(l1pde_pa(pde));
-			pde = l2[l2pde_index(va)];
-			if (!l2pde_valid(pde)) {
-found = false;
-goto done;
-			}
-			if (l2pde_is_block(pde)) {
-pa = l2pde_pa(pde) + (va & L2_OFFSET);
-found = true;
-goto done;
-			}
-
-			KASSERT(l2pde_is_table(pde));
 
-			l3 = (void *)AARCH64_PA_TO_KVA(l2pde_pa(pde));
-			pte = l3[l3pte_index(va)];
-
-		} else {
-			pte = *ptep;
-		}
-		if (!l3pte_valid(pte) || !l3pte_is_page(pte)) {
-			found = false;
-			goto done;
-		}
-
-		KASSERT(l3pte_is_page(pte));
-		pa = l3pte_pa(pte) + (va & L3_OFFSET);
-		found = true;
-	}
- done:
-	if (found && (pap != NULL))
+	pa = lxpde_pa(*ptep) + (va & (blocksize - 1));
+	if (pap != NULL)
 		*pap = pa;
-	return found;
+	return true;
 }
 
 paddr_t
@@ -731,49 +657,84 @@ vtophys(vaddr_t va)
 }
 
 static pt_entry_t *
-_pmap_pte_lookup(struct pmap *pm, vaddr_t va)
+_pmap_pte_lookup_bs(struct pmap *pm, vaddr_t va, vsize_t *bs)
 {
-	if (AARCH64_KSEG_START <= va && va < AARCH64_KSEG_END) {
-		panic("page entry is mapped in KSEG");
-	} else {
-		pd_entry_t *l0, *l1, *l2, *l3;
-		pd_entry_t pde;
-		pt_entry_t *ptep;
-		unsigned int idx;
+	pt_entry_t *ptep;
+	pd_entry_t *l0, *l1, *l2, *l3;
+	pd_entry_t pde;
+	vsize_t blocksize;
+	unsigned int idx;
 
-		/*
-		 * traverse L0 -> L1 -> L2 -> L3 table
-		 */
-		l0 = pm->pm_l0table;
+	if (((pm == pmap_kernel()) && ((va & TTBR_SEL_VA) == 0)) ||
+	((pm != pmap_kernel()) && ((va & TTBR_SEL_VA) != 0))) {
+		blocksize = 0;
+		ptep = NULL;
+		goto done;
+	}
 
-		idx = l0pde_index(va);
-		pde = l0[idx];
-		if (!l0pde_valid(pde))
-			return NULL;
-
-		l1 = (void *)AARCH64_PA_TO_KVA(l0pde_pa(pde));
-		idx = l1pde_index(va);
-		pde = l1[idx];
-		if (!l1pde_valid(pde))
-			return NULL;
-
-		if (l1pde_is_block(pde))
-			return NULL;
-
-		l2 

CVS commit: src/sys/dev/acpi

2018-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Oct 11 22:58:37 UTC 2018

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

Log Message:
Fix button type print; "type" is one of PSWITCH_TYPE_*, not ACPI_EVENT_*_BUTTON.


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/dev/acpi/acpi.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.c
diff -u src/sys/dev/acpi/acpi.c:1.271 src/sys/dev/acpi/acpi.c:1.272
--- src/sys/dev/acpi/acpi.c:1.271	Fri May 25 15:48:00 2018
+++ src/sys/dev/acpi/acpi.c	Thu Oct 11 22:58:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.271 2018/05/25 15:48:00 ryoon Exp $	*/
+/*	$NetBSD: acpi.c,v 1.272 2018/10/11 22:58:36 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.271 2018/05/25 15:48:00 ryoon Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.272 2018/10/11 22:58:36 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -1196,7 +1196,7 @@ acpi_register_fixed_button(struct acpi_s
 	}
 
 	aprint_normal_dev(sc->sc_dev, "fixed %s button present\n",
-	(type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep");
+	(type != PSWITCH_TYPE_SLEEP) ? "power" : "sleep");
 
 	return;
 



CVS commit: [jdolecek-ncqfixes] src/sys/dev

2018-10-11 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Oct 11 20:57:51 UTC 2018

Modified Files:
src/sys/dev/ata [jdolecek-ncqfixes]: TODO.ncq ata.c ata_subr.c atavar.h
files.ata
src/sys/dev/ic [jdolecek-ncqfixes]: ahcisata_core.c ahcisatavar.h
mvsata.c mvsatavar.h siisata.c siisatavar.h
Added Files:
src/sys/dev/ata [jdolecek-ncqfixes]: ata_recovery.c

Log Message:
refactor shared parts of the SATA error recovery into new function
ata_recovery_resume() and use for ahcisata/siisata/mvsata, also replace
per-controller hold/unhold with generic version

move the shared recovery code into separate file ata_recovery.c


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.12 -r1.4.2.13 src/sys/dev/ata/TODO.ncq
cvs rdiff -u -r1.141.6.15 -r1.141.6.16 src/sys/dev/ata/ata.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/dev/ata/ata_recovery.c
cvs rdiff -u -r1.6.2.7 -r1.6.2.8 src/sys/dev/ata/ata_subr.c
cvs rdiff -u -r1.99.2.10 -r1.99.2.11 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.27 -r1.27.6.1 src/sys/dev/ata/files.ata
cvs rdiff -u -r1.62.2.8 -r1.62.2.9 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.18 -r1.18.6.1 src/sys/dev/ic/ahcisatavar.h
cvs rdiff -u -r1.41.2.6 -r1.41.2.7 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/ic/mvsatavar.h
cvs rdiff -u -r1.35.6.8 -r1.35.6.9 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.7 -r1.7.6.1 src/sys/dev/ic/siisatavar.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/ata/TODO.ncq
diff -u src/sys/dev/ata/TODO.ncq:1.4.2.12 src/sys/dev/ata/TODO.ncq:1.4.2.13
--- src/sys/dev/ata/TODO.ncq:1.4.2.12	Sat Oct  6 20:27:28 2018
+++ src/sys/dev/ata/TODO.ncq	Thu Oct 11 20:57:51 2018
@@ -4,7 +4,8 @@ jdolecek-ncqfixes goals:
 - run recovery via atathread, move to new function and share ahci/siisata/mvsata
 - maybe do device error handling in not-interrupt-context (maybe this should be
   done on a mpata branch?)
-- remove controller-specific slot bitmaps (ic/siisata.c, ic/ahcisata_core.c)
+- adjust mvsata() intr code to accept tfd (instead of irq 0/1) so that
+  ata_recovery_resume() works properly for it
 
 Bugs
 

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.141.6.15 src/sys/dev/ata/ata.c:1.141.6.16
--- src/sys/dev/ata/ata.c:1.141.6.15	Sat Oct  6 21:19:55 2018
+++ src/sys/dev/ata/ata.c	Thu Oct 11 20:57:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.141.6.15 2018/10/06 21:19:55 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.141.6.16 2018/10/11 20:57:51 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.15 2018/10/06 21:19:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.16 2018/10/11 20:57:51 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -933,98 +933,6 @@ out:
 	return rv;
 }
 
-int
-ata_read_log_ext_ncq(struct ata_drive_datas *drvp, uint8_t flags,
-uint8_t *slot, uint8_t *status, uint8_t *err)
-{
-	struct ata_xfer *xfer = &drvp->recovery_xfer;
-	int rv;
-	struct ata_channel *chp = drvp->chnl_softc;
-	struct atac_softc *atac = chp->ch_atac;
-	uint8_t *tb, cksum, page;
-
-	ATADEBUG_PRINT(("%s\n", __func__), DEBUG_FUNCS);
-
-	/* Only NCQ ATA drives support/need this */
-	if (drvp->drive_type != ATA_DRIVET_ATA ||
-	(drvp->drive_flags & ATA_DRIVE_NCQ) == 0)
-		return EOPNOTSUPP;
-
-	memset(xfer, 0, sizeof(*xfer));
-
-	tb = drvp->recovery_blk;
-	memset(tb, 0, sizeof(drvp->recovery_blk));
-
-	/*
-	 * We could use READ LOG DMA EXT if drive supports it (i.e.
-	 * when it supports Streaming feature) to avoid PIO command,
-	 * and to make this a little faster. Realistically, it
-	 * should not matter.
-	 */
-	xfer->c_flags |= C_SKIP_QUEUE;
-	xfer->c_ata_c.r_command = WDCC_READ_LOG_EXT;
-	xfer->c_ata_c.r_lba = page = WDCC_LOG_PAGE_NCQ;
-	xfer->c_ata_c.r_st_bmask = WDCS_DRDY;
-	xfer->c_ata_c.r_st_pmask = WDCS_DRDY;
-	xfer->c_ata_c.r_count = 1;
-	xfer->c_ata_c.r_device = WDSD_LBA;
-	xfer->c_ata_c.flags = AT_READ | AT_LBA | AT_LBA48 | flags;
-	xfer->c_ata_c.timeout = 1000; /* 1s */
-	xfer->c_ata_c.data = tb;
-	xfer->c_ata_c.bcount = sizeof(drvp->recovery_blk);
-
-	if ((*atac->atac_bustype_ata->ata_exec_command)(drvp,
-		xfer) != ATACMD_COMPLETE) {
-		rv = EAGAIN;
-		goto out;
-	}
-	if (xfer->c_ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
-		rv = EINVAL;
-		goto out;
-	}
-
-	cksum = 0;
-	for (int i = 0; i < sizeof(drvp->recovery_blk); i++)
-		cksum += tb[i];
-	if (cksum != 0) {
-		device_printf(drvp->drv_softc,
-		"invalid checksum %x for READ LOG EXT page %x\n",
-		cksum, page);
-		rv = EINVAL;
-		goto out;
-	}
-
-	if (tb[0] & WDCC_LOG_NQ) {
-		/* not queued command */
-		rv = EOPNOTSUPP;
-		goto out;
-	}
-
-	*slot = tb[0] & 0x1f;
-	*status = tb[2];
-	*err = tb[3];
-
-	if ((*status & WDCS_ERR) == 0) {
-		/*
-		 * We expect error here. Normal physical drives always
-		 * do, it

CVS commit: src/etc/mtree

2018-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 11 18:04:06 UTC 2018

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
add intermediate directory.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.178 src/etc/mtree/NetBSD.dist.base:1.179
--- src/etc/mtree/NetBSD.dist.base:1.178	Thu Oct 11 11:39:54 2018
+++ src/etc/mtree/NetBSD.dist.base	Thu Oct 11 14:04:06 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.178 2018/10/11 15:39:54 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.179 2018/10/11 18:04:06 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1294,6 +1294,7 @@
 ./var/chroot/unbound		mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/etc	mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/etc/unbound	mode=0755 uname=_unbound gname=_unbound
+./var/chroot/unbound/var
 ./var/chroot/unbound/var/run	mode=0775 gname=_unbound
 ./var/crash			mode=0770
 ./var/cron



CVS commit: src/distrib/sets/lists/base

2018-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 11 15:41:07 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
add unbound /var/run


To generate a diff of this commit:
cvs rdiff -u -r1.1191 -r1.1192 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1191 src/distrib/sets/lists/base/mi:1.1192
--- src/distrib/sets/lists/base/mi:1.1191	Sun Sep 30 11:56:47 2018
+++ src/distrib/sets/lists/base/mi	Thu Oct 11 11:41:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1191 2018/09/30 15:56:47 jmcneill Exp $
+# $NetBSD: mi,v 1.1192 2018/10/11 15:41:07 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6007,6 +6007,8 @@
 ./var/chroot/unboundbase-sys-root
 ./var/chroot/unbound/etc			base-sys-root
 ./var/chroot/unbound/etc/unbound		base-sys-root
+./var/chroot/unbound/var			base-sys-root
+./var/chroot/unbound/var/run			base-sys-root
 ./var/crash	base-sys-root
 ./var/cron	base-cron-root
 ./var/cron/tabs	base-cron-root



CVS commit: src/etc/mtree

2018-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 11 15:39:55 UTC 2018

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
Add unbound /var/run directory (reported by hannken@)


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.177 src/etc/mtree/NetBSD.dist.base:1.178
--- src/etc/mtree/NetBSD.dist.base:1.177	Sun Sep 23 05:21:00 2018
+++ src/etc/mtree/NetBSD.dist.base	Thu Oct 11 11:39:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.177 2018/09/23 09:21:00 maxv Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.178 2018/10/11 15:39:54 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1294,6 +1294,7 @@
 ./var/chroot/unbound		mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/etc	mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/etc/unbound	mode=0755 uname=_unbound gname=_unbound
+./var/chroot/unbound/var/run	mode=0775 gname=_unbound
 ./var/crash			mode=0770
 ./var/cron
 ./var/cron/tabs			mode=0700



CVS commit: src/sys/compat/netbsd32

2018-10-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 11 15:23:22 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.97 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.98
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.97	Sat Oct  6 11:22:16 2018
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Thu Oct 11 11:23:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.97 2018/10/06 15:22:16 christos Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.98 2018/10/11 15:23:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.97 2018/10/06 15:22:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.98 2018/10/11 15:23:22 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1345,6 +1345,12 @@ netbsd32_ioctl(struct lwp *l, const stru
 		IOCTL_STRUCT_CONV_TO(BIOCSUDPF, bpf_program);
 	case BIOCGDLTLIST32:
 		IOCTL_STRUCT_CONV_TO(BIOCGDLTLIST, bpf_dltlist);
+	case BIOCSRTIMEOUT32:
+#define netbsd32_to_timeval(p, s32p, cmd) netbsd32_to_timeval(p, s32p)
+#define netbsd32_from_timeval(p, s32p, cmd) netbsd32_from_timeval(p, s32p)
+		IOCTL_STRUCT_CONV_TO(BIOCSRTIMEOUT, timeval);
+#undef netbsd32_to_timeval
+#undef netbsd32_from_timeval
 
 	case WSDISPLAYIO_ADDSCREEN32:
 		IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata);

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.64 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.65
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.64	Sat Sep 29 10:41:35 2018
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Thu Oct 11 11:23:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.64 2018/09/29 14:41:35 rmind Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.65 2018/10/11 15:23:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -116,6 +116,7 @@ struct netbsd32_bpf_dltlist {
 #define BIOCSTCPF32	_IOW('B',114, struct netbsd32_bpf_program)
 #define BIOCSUDPF32	_IOW('B',115, struct netbsd32_bpf_program)
 #define BIOCGDLTLIST32	_IOWR('B',119, struct netbsd32_bpf_dltlist)
+#define BIOCSRTIMEOUT32	_IOW('B',122, struct netbsd32_timeval)
 
 
 struct netbsd32_wsdisplay_addscreendata {



CVS commit: src/sys/kern

2018-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 11 11:17:07 UTC 2018

Modified Files:
src/sys/kern: uipc_mbufdebug.c

Log Message:
Fix m_examine_ip6() to print IPv6 payload length (ip6_plen) correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/uipc_mbufdebug.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/kern/uipc_mbufdebug.c
diff -u src/sys/kern/uipc_mbufdebug.c:1.4 src/sys/kern/uipc_mbufdebug.c:1.5
--- src/sys/kern/uipc_mbufdebug.c:1.4	Wed Oct 10 10:54:30 2018
+++ src/sys/kern/uipc_mbufdebug.c	Thu Oct 11 11:17:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbufdebug.c,v 1.4 2018/10/10 10:54:30 msaitoh Exp $	*/
+/*	$NetBSD: uipc_mbufdebug.c,v 1.5 2018/10/11 11:17:07 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbufdebug.c,v 1.4 2018/10/10 10:54:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbufdebug.c,v 1.5 2018/10/11 11:17:07 msaitoh Exp $");
 
 #include 
 #include 
@@ -697,7 +697,7 @@ m_examine_ip6(const struct mbuf *m, int 
 	(*pr)("IPv6: Version = %u\n", (vfc & IPV6_VERSION_MASK) >> 4);
 	flow = ntohl(ip6.ip6_flow);
 	(*pr)("IPv6: Flow INFO = 0x%07x\n", flow & IPV6_FLOWINFO_MASK);
-	(*pr)("IPv6: Payload Length = %u\n", ip6.ip6_plen);
+	(*pr)("IPv6: Payload Length = %u\n", ntohs(ip6.ip6_plen));
 	nxt = ip6.ip6_nxt;
 	(*pr)("IPv6: Next Header = %u(%s)\n", nxt, str_ipproto(nxt));
 	(*pr)("IPv6: Hop Limit = %u\n", ip6.ip6_hlim);