CVS commit: src/sys/dev/mii

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 03:37:58 UTC 2019

Modified Files:
src/sys/dev/mii: ukphy_subr.c

Log Message:
 Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ukphy_subr.c

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



CVS commit: src/sys/dev/mii

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 03:37:58 UTC 2019

Modified Files:
src/sys/dev/mii: ukphy_subr.c

Log Message:
 Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ukphy_subr.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/mii/ukphy_subr.c
diff -u src/sys/dev/mii/ukphy_subr.c:1.15 src/sys/dev/mii/ukphy_subr.c:1.16
--- src/sys/dev/mii/ukphy_subr.c:1.15	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/ukphy_subr.c	Thu Oct 24 03:37:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: ukphy_subr.c,v 1.16 2019/10/24 03:37:58 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.16 2019/10/24 03:37:58 msaitoh Exp $");
 
 #include 
 #include 
@@ -119,7 +119,7 @@ ukphy_status(struct mii_softc *phy)
 		else
 			mii->mii_media_active |= IFM_NONE;
 
-		if ((mii->mii_media_active & IFM_1000_T) &&
+		if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
 		(gtsr & GTSR_MS_RES))
 			mii->mii_media_active |= IFM_ETH_MASTER;
 



CVS commit: src/external/gpl3/gcc/dist/libiberty

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:31:38 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libiberty: sha1.c

Log Message:
mknative tries to build this file with c++ and c++ does not like types
inside offsetof() (a language limitation).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/libiberty/sha1.c

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



CVS commit: src/external/gpl3/gcc/dist/libiberty

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:31:38 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libiberty: sha1.c

Log Message:
mknative tries to build this file with c++ and c++ does not like types
inside offsetof() (a language limitation).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/libiberty/sha1.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/libiberty/sha1.c
diff -u src/external/gpl3/gcc/dist/libiberty/sha1.c:1.4 src/external/gpl3/gcc/dist/libiberty/sha1.c:1.5
--- src/external/gpl3/gcc/dist/libiberty/sha1.c:1.4	Tue Oct  1 06:38:22 2019
+++ src/external/gpl3/gcc/dist/libiberty/sha1.c	Wed Oct 23 23:31:38 2019
@@ -229,7 +229,7 @@ sha1_process_bytes (const void *buffer, 
   if (len >= 64)
 {
 #if !_STRING_ARCH_unaligned
-# ifdef __clang__
+# if defined(__clang__) || defined(__GNUC__)
 # define alignof(type) __alignof__(type)
 # else
 # define alignof(type) offsetof (struct { char c; type x; }, x)



CVS commit: src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:26:06 UTC 2019

Added Files:
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf: arm-cpu-cdata.h
arm-cpu-data.h

Log Message:
add new files
XXX: all the arms need regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-cdata.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-data.h

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



CVS commit: src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:26:06 UTC 2019

Added Files:
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf: arm-cpu-cdata.h
arm-cpu-data.h

Log Message:
add new files
XXX: all the arms need regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-cdata.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-data.h

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

Added files:

Index: src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-cdata.h
diff -u /dev/null src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-cdata.h:1.1
--- /dev/null	Wed Oct 23 23:26:06 2019
+++ src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf/arm-cpu-cdata.h	Wed Oct 23 23:26:06 2019
@@ -0,0 +1,3591 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gcc,v 1.102 2019/10/16 06:57:24 mrg Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* -*- buffer-read-only: t -*-
+   Generated automatically by parsecpu.awk from arm-cpus.in.
+   Do not edit.
+
+   Copyright (C) 2011-2018 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3,
+   or (at your option) any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with GCC; see the file COPYING3.  If not see
+   .  */
+
+static const cpu_arch_extension cpu_opttab_arm9e[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm946es[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm966es[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm968es[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm10e[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm1020e[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm1022e[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm926ejs[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL, false, false, {isa_nobit}}
+};
+
+static const cpu_arch_extension cpu_opttab_arm1026ejs[] = {
+  {
+"nofp", true, false,
+{
+  isa_bit_vfpv2, isa_bit_vfpv3, isa_bit_vfpv4, isa_bit_neon, 
+  isa_bit_fpv5, isa_bit_fp_d32, isa_bit_fp16, isa_bit_fp16conv, 
+  isa_bit_crypto, isa_bit_fp_dbl, isa_nobit
+}
+  },
+  { NULL,

CVS commit: src/tools/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:19:14 UTC 2019

Modified Files:
src/tools/gcc: Makefile mknative-gcc

Log Message:
arm needs more files


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/tools/gcc/Makefile
cvs rdiff -u -r1.102 -r1.103 src/tools/gcc/mknative-gcc

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.95 src/tools/gcc/Makefile:1.96
--- src/tools/gcc/Makefile:1.95	Mon Sep 30 04:40:20 2019
+++ src/tools/gcc/Makefile	Wed Oct 23 23:19:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.95 2019/09/30 08:40:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.96 2019/10/24 03:19:14 christos Exp $
 
 .include 
 
@@ -190,6 +190,9 @@ NATIVE_CONFIGURE_ARGS+= --disable-shared
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 EXTRA_GCC_TARGETS=	i386-builtin-types.inc
 .endif
+.if !empty(MACHINE_ARCH:M*arm*)
+EXTRA_GCC_TARGETS=	arm-cpu-data.h arm-cpu-cdata.h
+.endif
 
 NATIVE_CONFIGURE_ARGS+=	\
 			--disable-multilib \

Index: src/tools/gcc/mknative-gcc
diff -u src/tools/gcc/mknative-gcc:1.102 src/tools/gcc/mknative-gcc:1.103
--- src/tools/gcc/mknative-gcc:1.102	Wed Oct 16 02:57:24 2019
+++ src/tools/gcc/mknative-gcc	Wed Oct 23 23:19:14 2019
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-gcc,v 1.102 2019/10/16 06:57:24 mrg Exp $
+#	$NetBSD: mknative-gcc,v 1.103 2019/10/24 03:19:14 christos Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of gcc.
@@ -425,8 +425,10 @@ __EOF__
 
 	case "${MACHINE_ARCH}" in
 	(*arm*)
-		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/arm-cpu.h <$_TMPDIR/gcc/arm-cpu.h
-		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/arm-isa.h <$_TMPDIR/gcc/arm-isa.h
+		d=$_OUTDIRBASE/usr.bin/$_subdir/arch/${MACHINE_ARCH}
+		for f in arm-cpu.h arm-cpu-cdata.h arm-cpu-data.h arm-isa.h; do
+			write_c $d/$f <$_TMPDIR/gcc/$f
+		done
 		;;
 	esac
 }



CVS commit: src/tools/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 03:19:14 UTC 2019

Modified Files:
src/tools/gcc: Makefile mknative-gcc

Log Message:
arm needs more files


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/tools/gcc/Makefile
cvs rdiff -u -r1.102 -r1.103 src/tools/gcc/mknative-gcc

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



CVS commit: [netbsd-9] src/doc

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 02:31:34 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #362-#365 and #369.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.84 -r1.1.2.85 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 02:31:34 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #362-#365 and #369.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.84 -r1.1.2.85 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.84 src/doc/CHANGES-9.0:1.1.2.85
--- src/doc/CHANGES-9.0:1.1.2.84	Wed Oct 23 19:50:47 2019
+++ src/doc/CHANGES-9.0	Thu Oct 24 02:31:34 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.84 2019/10/23 19:50:47 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.85 2019/10/24 02:31:34 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5109,6 +5109,43 @@ sys/uvm/uvm_mmap.c1.173
 	Change 'npgs' from int to size_t.
 	[maxv, ticket #355]
 
+usr.sbin/sysinst/disks.c			1.52
+
+	Remove a hardcoded assumption that for BIOS boot we always will have
+	the first partition as root - in mixed EFI/BIOS setups this might not
+	be true (and in general the user is free to define arbitrary orders).
+	Pointed out by Robert Nestor.
+	[martin, ticket #362]
+
+usr.sbin/sysinst/msg.mi.en			1.23
+usr.sbin/sysinst/msg.mi.fr			1.21
+
+	Sentence begins with capital letter ("yes or no?"). Also add a few
+	french sentences, to make it less awful, but not complete.
+	[martin, ticket #363]
+
+usr.sbin/sysinst/disklabel.c			1.14
+
+	When translating (internal) indices to device names, properly deal with
+	gaps in partition allocations (e.g. no swap partition).
+	[martin, ticket #364]
+
+usr.sbin/sysinst/bsddisklabel.c			1.28
+usr.sbin/sysinst/disks.c			1.53
+
+	Skip unwanted (zero sized) partitions.
+	[martin, ticket #365]
+
+usr.sbin/sysinst/disks.c			1.51
+
+	PR install/54480: when upgrading a system and re-mounting the target /
+	with proper options, and the installed system does not use NAME= syntax
+	in fstab(5), use the device name we used to get here, instead of the
+	name from fstab, it might be different to what the real system calls
+	the device (compact flash root showing up as wd0 native, but sd? on the
+	card reader used for updating it right now).
+	[martin, ticket #369]
+
 sys/dev/fss.c	1.108
 
 	Avoid (harmless) test of uninitialized structure member.
@@ -5201,4 +5238,3 @@ sys/dev/mii/miidevs_data.h			(regen)
 	- Match a lot of Cicada and Vitesse devices correctly.
 	- Add support for VSC8221, VSC8234, VSC8641.
 	[msaitoh, ticket #372]
-



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

2019-10-23 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Wed Oct 23 21:40:36 UTC 2019

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

Log Message:
Give syspkg names to xserver mi files


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/sets/lists/xserver/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/xserver/mi
diff -u src/distrib/sets/lists/xserver/mi:1.41 src/distrib/sets/lists/xserver/mi:1.42
--- src/distrib/sets/lists/xserver/mi:1.41	Tue Apr 16 21:20:51 2019
+++ src/distrib/sets/lists/xserver/mi	Wed Oct 23 21:40:36 2019
@@ -1,41 +1,41 @@
-# $NetBSD: mi,v 1.41 2019/04/16 21:20:51 mrg Exp $
+# $NetBSD: mi,v 1.42 2019/10/23 21:40:36 uki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
 ./etc/mtree/set.xserver	xserver-sys-root	xorg
-./usr/X11R7/bin/Xnest	-unknown-	xorg
-./usr/X11R7/bin/Xvfb	-unknown-	xorg
-./usr/X11R7/lib/modules/dri/gallium_dri.so		-unknown-	xorg
-./usr/X11R7/lib/modules/dri/gallium_dri.so.0		-unknown-	xorg
-./usr/X11R7/lib/modules/dri/kms_swrast_dri.so		-unknown-	xorg
-./usr/X11R7/lib/modules/dri/kms_swrast_dri.so.0		-unknown-	xorg
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	obsolete,!machine=amd64,!machine=i386
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	obsolete,machine=amd64,mesa_ver=18
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	obsolete,machine=i386,mesa_ver=18
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=amd64,mesa_ver=10
-./usr/X11R7/lib/modules/dri/libmesa_dri.so		-unknown-	xorg,machine=i386,mesa_ver=10
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	obsolete,!machine=amd64,!machine=i386
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	obsolete,machine=amd64,mesa_ver=18
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	obsolete,machine=i386,mesa_ver=18
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=amd64,mesa_ver=10
-./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		-unknown-	xorg,machine=i386,mesa_ver=10
-./usr/X11R7/lib/modules/dri/swrast_dri.so		-unknown-	xorg
-./usr/X11R7/lib/modules/dri/swrast_dri.so.0		-unknown-	xorg
-./usr/X11R7/lib/modules/libglamoregl.so			-unknown-	xorg,xorg_glamor
-./usr/X11R7/lib/modules/libglamoregl.so.0		-unknown-	xorg,xorg_glamor
-./usr/X11R7/man/cat1/Xmark.0-unknown-	.cat,xorg
-./usr/X11R7/man/cat1/Xnest.0-unknown-	.cat,xorg
-./usr/X11R7/man/cat1/Xserver.0-unknown-	.cat,xorg
-./usr/X11R7/man/cat1/Xvfb.0-unknown-	.cat,xorg
-./usr/X11R7/man/cat5/SecurityPolicy.0			-unknown-	obsolete
-./usr/X11R7/man/html1/Xmark.html			-unknown-	html,xorg
-./usr/X11R7/man/html1/Xnest.html			-unknown-	html,xorg
-./usr/X11R7/man/html1/Xserver.html			-unknown-	html,xorg
-./usr/X11R7/man/html1/Xvfb.html-unknown-	html,xorg
-./usr/X11R7/man/html5/SecurityPolicy.html		-unknown-	obsolete
-./usr/X11R7/man/man1/Xmark.1-unknown-	.man,xorg
-./usr/X11R7/man/man1/Xnest.1-unknown-	.man,xorg
-./usr/X11R7/man/man1/Xserver.1-unknown-	.man,xorg
-./usr/X11R7/man/man1/Xvfb.1-unknown-	.man,xorg
-./usr/X11R7/man/man5/SecurityPolicy.5			-unknown-	obsolete
+./usr/X11R7/bin/Xnest	xserver-xorg-server-bin	xorg
+./usr/X11R7/bin/Xvfb	xserver-xorg-server-bin	xorg
+./usr/X11R7/lib/modules/dri/gallium_dri.so		xserver-gallium-lib	xorg
+./usr/X11R7/lib/modules/dri/gallium_dri.so.0		xserver-gallium-lib	xorg
+./usr/X11R7/lib/modules/dri/kms_swrast_dri.so		xserver-MesaLib-lib	xorg
+./usr/X11R7/lib/modules/dri/kms_swrast_dri.so.0		xserver-MesaLib-lib	xorg
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		xserver-obsolete	obsolete,!machine=amd64,!machine=i386
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		xserver-obsolete	obsolete,machine=amd64,mesa_ver=18
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		xserver-obsolete	obsolete,machine=i386,mesa_ver=18
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		xserver-MesaLib-lib	xorg,machine=amd64,mesa_ver=10
+./usr/X11R7/lib/modules/dri/libmesa_dri.so		xserver-MesaLib-lib	xorg,machine=i386,mesa_ver=10
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		xserver-obsolete	obsolete,!machine=amd64,!machine=i386
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		xserver-obsolete	obsolete,machine=amd64,mesa_ver=18
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		xserver-obsolete	obsolete,machine=i386,mesa_ver=18
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		xserver-MesaLib-lib	xorg,machine=amd64,mesa_ver=10
+./usr/X11R7/lib/modules/dri/libmesa_dri.so.0		xserver-MesaLib-lib	xorg,machine=i386,mesa_ver=10
+./usr/X11R7/lib/modules/dri/swrast_dri.so		xserver-MesaLib-lib	xorg
+./usr/X11R7/lib/modules/dri/swrast_dri.so.0		xserver-MesaLib-lib	xorg
+./usr/X11R7/lib/modules/libglamoregl.so			xserver-xorg-server-lib	xorg,xorg_glamor
+./usr/X11R7/lib/modules/libglamoregl.so.0		xserver-xorg-server-lib	xorg,xorg_glamor
+./usr/X11R7/man/cat1/Xmark.0xserver-x11perf-

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

2019-10-23 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Wed Oct 23 21:40:36 UTC 2019

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

Log Message:
Give syspkg names to xserver mi files


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/sets/lists/xserver/mi

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



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

2019-10-23 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Wed Oct 23 21:31:32 UTC 2019

Modified Files:
src/distrib/sets/lists/xserver: ad.x86_64

Log Message:
Architecture dependency files are obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/xserver/ad.x86_64

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/xserver/ad.x86_64
diff -u src/distrib/sets/lists/xserver/ad.x86_64:1.7 src/distrib/sets/lists/xserver/ad.x86_64:1.8
--- src/distrib/sets/lists/xserver/ad.x86_64:1.7	Fri Aug 19 22:37:04 2016
+++ src/distrib/sets/lists/xserver/ad.x86_64	Wed Oct 23 21:31:32 2019
@@ -1,8 +1,8 @@
-# $NetBSD: ad.x86_64,v 1.7 2016/08/19 22:37:04 mrg Exp $
-./usr/X11R7/bin/inb	-unknown-	obsolete
-./usr/X11R7/bin/inl	-unknown-	obsolete
-./usr/X11R7/bin/inw	-unknown-	obsolete
-./usr/X11R7/bin/ioport	-unknown-	obsolete
-./usr/X11R7/bin/outb	-unknown-	obsolete
-./usr/X11R7/bin/outl	-unknown-	obsolete
-./usr/X11R7/bin/outw	-unknown-	obsolete
+# $NetBSD: ad.x86_64,v 1.8 2019/10/23 21:31:32 uki Exp $
+./usr/X11R7/bin/inb	xserver-obsolete	obsolete
+./usr/X11R7/bin/inl	xserver-obsolete	obsolete
+./usr/X11R7/bin/inw	xserver-obsolete	obsolete
+./usr/X11R7/bin/ioport	xserver-obsolete	obsolete
+./usr/X11R7/bin/outb	xserver-obsolete	obsolete
+./usr/X11R7/bin/outl	xserver-obsolete	obsolete
+./usr/X11R7/bin/outw	xserver-obsolete	obsolete



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

2019-10-23 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Wed Oct 23 21:31:32 UTC 2019

Modified Files:
src/distrib/sets/lists/xserver: ad.x86_64

Log Message:
Architecture dependency files are obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/xserver/ad.x86_64

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



CVS commit: [netbsd-9] src/sys/dev

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 20:35:52 UTC 2019

Modified Files:
src/sys/dev [netbsd-9]: fss.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #356):

sys/dev/fss.c: revision 1.108

Check fc_type before fc_cluster, because the latter may not be initialized.

This is harmless because fc_type is always initialized properly, so the
next branch wouldn't have been taken.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/dev/fss.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/fss.c
diff -u src/sys/dev/fss.c:1.107 src/sys/dev/fss.c:1.107.4.1
--- src/sys/dev/fss.c:1.107	Wed Feb 20 10:03:25 2019
+++ src/sys/dev/fss.c	Wed Oct 23 20:35:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.107 2019/02/20 10:03:25 hannken Exp $	*/
+/*	$NetBSD: fss.c,v 1.107.4.1 2019/10/23 20:35:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.107 2019/02/20 10:03:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.107.4.1 2019/10/23 20:35:52 martin Exp $");
 
 #include 
 #include 
@@ -992,16 +992,19 @@ restart:
 		return 0;
 	}
 
-	for (scp = sc->sc_cache; scp < scl; scp++)
-		if (scp->fc_cluster == cl) {
-			if (scp->fc_type == FSS_CACHE_VALID) {
+	for (scp = sc->sc_cache; scp < scl; scp++) {
+		if (scp->fc_type == FSS_CACHE_VALID) {
+			if (scp->fc_cluster == cl) {
 mutex_exit(&sc->sc_slock);
 return 0;
-			} else if (scp->fc_type == FSS_CACHE_BUSY) {
+			}
+		} else if (scp->fc_type == FSS_CACHE_BUSY) {
+			if (scp->fc_cluster == cl) {
 cv_wait(&scp->fc_state_cv, &sc->sc_slock);
 goto restart;
 			}
 		}
+	}
 
 	for (scp = sc->sc_cache; scp < scl; scp++)
 		if (scp->fc_type == FSS_CACHE_FREE) {



CVS commit: [netbsd-9] src/sys/dev

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 20:35:52 UTC 2019

Modified Files:
src/sys/dev [netbsd-9]: fss.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #356):

sys/dev/fss.c: revision 1.108

Check fc_type before fc_cluster, because the latter may not be initialized.

This is harmless because fc_type is always initialized properly, so the
next branch wouldn't have been taken.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/dev/fss.c

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



CVS commit: [netbsd-9] src/doc

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:50:47 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #356 - #359, #361, #366 - #368, #370 - #372


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.83 src/doc/CHANGES-9.0:1.1.2.84
--- src/doc/CHANGES-9.0:1.1.2.83	Mon Oct 21 20:25:52 2019
+++ src/doc/CHANGES-9.0	Wed Oct 23 19:50:47 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.83 2019/10/21 20:25:52 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.84 2019/10/23 19:50:47 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5109,3 +5109,96 @@ sys/uvm/uvm_mmap.c1.173
 	Change 'npgs' from int to size_t.
 	[maxv, ticket #355]
 
+sys/dev/fss.c	1.108
+
+	Avoid (harmless) test of uninitialized structure member.
+	[maxv, ticket #356]
+
+sys/dev/ic/ahcisata_core.c			1.76
+
+	Ensure cmdh_prdtl is 0 in ahci_do_reset_drive().
+	[jdolecek, ticket #357]
+
+sys/dev/pci/ahcisata_pci.c			1.56
+
+	ahcisata: make sure bus mastering and memory space are actually enabled.
+	[tnn, ticket #358]
+
+sys/arch/aarch64/aarch64/cpu.c			1.23-1.25
+sys/arch/aarch64/aarch64/locore.S		1.42-1.44
+sys/arch/aarch64/include/cpu.h			1.14
+sys/arch/aarch64/include/param.h		1.12
+sys/arch/arm/acpi/cpu_acpi.c			1.7
+sys/arch/arm/arm32/cpu.c			1.133,1.134
+sys/arch/arm/fdt/cpu_fdt.c			1.28
+sys/arch/arm/include/cpu.h			1.101
+
+	aarch64: support upto 256 CPUs.
+	[jmcneill, ticket #359]
+
+sys/lib/libsa/loadfile_elf32.c			1.56
+
+	Make sure the kernel image we load is a static binary.
+	[maxv, ticket #361]
+
+sys/kern/kern_sig.c1.373,1.376
+sys/kern/sys_ptrace_common.c			1.64
+tests/lib/libc/sys/t_ptrace_wait.c		1.136,1.138-1.140
+
+	Fix a race condition when handling concurrent LWP signals,
+	add a test. Enable previously optional vfork and LWP events
+	tests.
+	[kamil, ticket #366]
+
+sys/net/if_vlan.c1.147
+
+	vlan(4): fix received packet statistics.
+	[ozaki-r, ticket #367]
+
+sys/netinet6/in6_ifattach.c			1.116,1.117
+sys/netinet6/in6_ifattach.h			1.14
+sys/netinet6/in6_var.h1.101,1.102
+sys/netinet6/ip6_input.c			1.212-1.214
+tests/net/ndp/t_ra.sh1.33
+
+	- Refactor the IPv6 temporary address timer
+	- Reject a small value being set to net.inet6.ip6.temppltime
+	  that may lead a kernel panic
+	- Add tests for the above fix
+	- Reset the timer immediately after changing
+	  net.inet6.ip6.temppltime, otherwise changing
+	  the value isn't reflected until an old interval
+	  period (one day by default) goes by
+	[ozaki-r, ticket #368]
+
+sys/dev/pci/if_bce.c1.55,1.56
+sys/dev/pci/if_bcereg.h1.5
+
+	- Add missing splnet()/splx() around mii_tick().
+	- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
+	- Mark ETHERCAP_VLAN_MTU.	 
+	- Clear the powerdown mode. Fixes PR kern/24911.
+	- Set proper LED modes.
+	[msaitoh, ticket #370]
+
+sys/arch/arm/ep93xx/epe.c			1.45
+sys/arch/arm/sunxi/sunxi_can.c			1.2
+sys/arch/mac68k/nubus/if_netdock_nubus.c	1.31
+sys/dev/ic/i82586.c1.86
+sys/dev/pcmcia/if_cnw.c1.66
+sys/dev/pcmcia/if_ray.c1.95
+sys/dev/qbus/if_il.c1.36
+sys/dev/qbus/if_qt.c1.24
+
+	Do not double count incoming packets.
+	[msaitoh, ticket #371]
+
+sys/dev/mii/ciphy.c1.37
+sys/dev/mii/miidevs1.158
+sys/dev/mii/miidevs.h(regen)
+sys/dev/mii/miidevs_data.h			(regen)
+
+	- Match a lot of Cicada and Vitesse devices correctly.
+	- Add support for VSC8221, VSC8234, VSC8641.
+	[msaitoh, ticket #372]
+



CVS commit: [netbsd-9] src/doc

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:50:47 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #356 - #359, #361, #366 - #368, #370 - #372


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:46:53 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #372


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/sys/dev/mii/miidevs_data.h

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



CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:46:53 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #372


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.151.2.1 src/sys/dev/mii/miidevs.h:1.151.2.2
--- src/sys/dev/mii/miidevs.h:1.151.2.1	Mon Sep  2 07:06:11 2019
+++ src/sys/dev/mii/miidevs.h	Wed Oct 23 19:46:53 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.1 2019/09/02 07:06:11 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.2 2019/10/23 19:46:53 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp
  */
 
 /*-
@@ -57,10 +57,8 @@
  */
 
 #define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
-#define	MII_OUI_VITESSE	0x0001c1	/* Vitesse */
 #define	MII_OUI_TRIDIUM	0x0001f0	/* Tridium */
 #define	MII_OUI_DATATRACK	0x0002c6	/* Data Track Technology */
-#define	MII_OUI_CICADA	0x0003f1	/* Cicada Semiconductor */
 #define	MII_OUI_AGERE	0x00053d	/* Agere */
 #define	MII_OUI_BANKSPEED	0x0006b8	/* Bankspeed Pty */
 #define	MII_OUI_NETEXCELL	0x0008bb	/* NetExcell */
@@ -118,6 +116,7 @@
 #define	MII_OUI_xxBROADCOM_ALT1	0x0050ef	/* Broadcom Corporation */
 #define	MII_OUI_yyINTEL	0x005500	/* Intel */
 #define	MII_OUI_yyASIX	0x007063	/* Asix Semiconductor */
+#define	MII_OUI_xxVITESSE	0x008083	/* Vitesse Semiconductor */
 #define	MII_OUI_xxPMCSIERRA2	0x009057	/* PMC-Sierra */
 #define	MII_OUI_xxCICADA	0x00c08f	/* Cicada Semiconductor */
 #define	MII_OUI_xxNATSEMI	0x1000e8	/* National Semiconductor */
@@ -305,23 +304,26 @@
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004
 #define	MII_STR_xxBROADCOM_ALT1_BCM5906	"BCM5906 10/100baseTX media interface"
 
-/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
-#define	MII_MODEL_CICADA_CS8201	0x0001
-#define	MII_STR_CICADA_CS8201	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8204	0x0004
-#define	MII_STR_CICADA_CS8204	"Cicada CS8204 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_VSC8211	0x000b
-#define	MII_STR_CICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201A	0x0020
-#define	MII_STR_CICADA_CS8201A	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201B	0x0021
-#define	MII_STR_CICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8244	0x002c
-#define	MII_STR_CICADA_CS8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
+/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */
+
+#define	MII_MODEL_xxCICADA_CIS8201	0x0001
+#define	MII_STR_xxCICADA_CIS8201	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8204	0x0004
+#define	MII_STR_xxCICADA_CIS8204	"Cicada CIS8204 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8211	0x000b
+#define	MII_STR_xxCICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
 #define	MII_MODEL_xxCICADA_VSC8221	0x0015
 #define	MII_STR_xxCICADA_VSC8221	"Vitesse VSC8221 10/100/1000BASE-T PHY"
-#define	MII_MODEL_xxCICADA_CS8201B	0x0021
-#define	MII_STR_xxCICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8224	0x0018
+#define	MII_STR_xxCICADA_VSC8224	"Vitesse VSC8224 10/100/1000BASE-T PHY"
+#define	MII_MODEL_xxCICADA_CIS8201A	0x0020
+#define	MII_STR_xxCICADA_CIS8201A	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8201B	0x0021
+#define	MII_STR_xxCICADA_CIS8201B	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8234	0x0022
+#define	MII_STR_xxCICADA_VSC8234	"Vitesse VSC8234 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8244	0x002c
+#define	MII_STR_xxCICADA_VSC8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
 
 /* Davicom Semiconductor PHYs */
 /* AMD Am79C873 seems to be a relabeled DM9101 */
@@ -601,9 +603,13 @@
 #define	MII_MODEL_VIA_VT6103_2	0x0034
 #define	MII_STR_VIA_VT6103_2	"VT6103 10/100 PHY"
 
-/* Vitesse PHYs */
-#define	MII_MODEL_VITESSE_VSC8601	0x0002
-#define	MII_STR_VITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+/* Vitesse PHYs (Now Microsemi) */
+#define	MII_MODEL_xxVITESSE_VSC8601	0x0002
+#define	MII_STR_xxVITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+#define	MII_MODEL_xxVITESSE_VSC8641	0x0003
+#define	MII_STR_xxVITESSE_VSC8641	"Vitesse VSC8641 10/100/1000TX PHY"
+#define	MII_MODEL_xxVITESSE_VSC8501	0x0013
+#define	MII_STR_xxVITESSE_VSC8501	"Vitesse VSC8501 10/100/1000TX PHY"
 
 /* XaQti Corp. PHYs */
 #define	MII_MODEL_xxXAQTI_XMACII	0x

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.1 src/sys/dev/mii/miidevs_data.h:1.139.2.2
--- src/sys/dev/mii/miidevs_data.h:1.

CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:45:57 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #372):

sys/dev/mii/miidevs: revision 1.158
sys/dev/mii/ciphy.c: revision 1.37

- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.
- Match a lot of Cicada and Vitesse devices correctly. This change also fixes
  a bug that ciphy_fixup() didn't work.
- Match VSC8221, VSC8234 and VSC8641.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.153.2.1 -r1.153.2.2 src/sys/dev/mii/miidevs

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



CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:45:57 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #372):

sys/dev/mii/miidevs: revision 1.158
sys/dev/mii/ciphy.c: revision 1.37

- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.
- Match a lot of Cicada and Vitesse devices correctly. This change also fixes
  a bug that ciphy_fixup() didn't work.
- Match VSC8221, VSC8234 and VSC8641.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.153.2.1 -r1.153.2.2 src/sys/dev/mii/miidevs

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/mii/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.34.4.1 src/sys/dev/mii/ciphy.c:1.34.4.2
--- src/sys/dev/mii/ciphy.c:1.34.4.1	Thu Oct 17 19:06:58 2019
+++ src/sys/dev/mii/ciphy.c	Wed Oct 23 19:45:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $ */
+/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -74,16 +74,16 @@ static const struct mii_phy_funcs ciphy_
 };
 
 static const struct mii_phydesc ciphys[] = {
-	MII_PHY_DESC(CICADA, CS8201),
-	MII_PHY_DESC(CICADA, CS8201A),
-	MII_PHY_DESC(CICADA, CS8201B),
-	MII_PHY_DESC(CICADA, CS8204),
-	MII_PHY_DESC(CICADA, VSC8211),
-	MII_PHY_DESC(CICADA, CS8244),
-	MII_PHY_DESC(CICADA, CS8201),
-	MII_PHY_DESC(CICADA, CS8201A),
-	MII_PHY_DESC(xxCICADA, CS8201B),
-	MII_PHY_DESC(VITESSE, VSC8601),
+	MII_PHY_DESC(xxCICADA, CIS8201),
+	MII_PHY_DESC(xxCICADA, CIS8201A),
+	MII_PHY_DESC(xxCICADA, CIS8201B),
+	MII_PHY_DESC(xxCICADA, CIS8204),
+	MII_PHY_DESC(xxCICADA, VSC8211),
+	MII_PHY_DESC(xxCICADA, VSC8221),
+	MII_PHY_DESC(xxCICADA, VSC8234),
+	MII_PHY_DESC(xxCICADA, VSC8244),
+	MII_PHY_DESC(xxVITESSE, VSC8601),
+	MII_PHY_DESC(xxVITESSE, VSC8641),
 	MII_PHY_END,
 };
 
@@ -398,8 +398,8 @@ ciphy_fixup(struct mii_softc *sc)
 	}
 
 	switch (model) {
-	case MII_MODEL_CICADA_CS8201:
-	case MII_MODEL_CICADA_CS8204:
+	case MII_MODEL_xxCICADA_CIS8201:
+	case MII_MODEL_xxCICADA_CIS8204:
 		/* Turn off "aux mode" (whatever that means) */
 		PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS);
 
@@ -418,8 +418,8 @@ ciphy_fixup(struct mii_softc *sc)
 
 		break;
 
-	case MII_MODEL_CICADA_CS8201A:
-	case MII_MODEL_CICADA_CS8201B:
+	case MII_MODEL_xxCICADA_CIS8201A:
+	case MII_MODEL_xxCICADA_CIS8201B:
 		/*
 		 * Work around speed polling bug in VT3119/VT3216
 		 * when using MII in full duplex mode.
@@ -431,9 +431,12 @@ ciphy_fixup(struct mii_softc *sc)
 			PHY_CLRBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO);
 
 		break;
-	case MII_MODEL_CICADA_VSC8211:
-	case MII_MODEL_CICADA_CS8244:
-	case MII_MODEL_VITESSE_VSC8601:
+	case MII_MODEL_xxCICADA_VSC8211:
+	case MII_MODEL_xxCICADA_VSC8221:
+	case MII_MODEL_xxCICADA_VSC8234:
+	case MII_MODEL_xxCICADA_VSC8244:
+	case MII_MODEL_xxVITESSE_VSC8601:
+	case MII_MODEL_xxVITESSE_VSC8641:
 		break;
 	default:
 		aprint_error_dev(sc->mii_dev, "unknown CICADA PHY model %x\n",

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.153.2.1 src/sys/dev/mii/miidevs:1.153.2.2
--- src/sys/dev/mii/miidevs:1.153.2.1	Sun Sep  1 13:56:01 2019
+++ src/sys/dev/mii/miidevs	Wed Oct 23 19:45:56 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $
+$NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -50,10 +50,8 @@ $NetBSD: miidevs,v 1.153.2.1 2019/09/01 
  */
 
 oui AMD0x1a	Advanced Micro Devices
-oui VITESSE			0x0001c1	Vitesse
 oui TRIDIUM			0x0001f0	Tridium
 oui DATATRACK			0x0002c6	Data Track Technology
-oui CICADA			0x0003f1	Cicada Semiconductor
 oui AGERE			0x00053d	Agere
 oui BANKSPEED			0x0006b8	Bankspeed Pty
 oui NETEXCELL			0x0008bb	NetExcell
@@ -111,6 +109,7 @@ oui xxINTEL			0x001f00	Intel
 oui xxBROADCOM_ALT1		0x0050ef	Broadcom Corporation
 oui yyINTEL			0x005500	Intel
 oui yyASIX			0x007063	Asix Semiconductor
+oui xxVITESSE			0x008083	Vitesse Semiconductor
 oui xxPMCSIERRA2		0x009057	PMC-Sierra
 oui xxCICADA			0x00c08f	Cicada Semiconductor
 oui xxNATSEMI			0x1000e8	National Semiconductor
@@ -220,15 +219,17 @@ model BROADCOM3 BCM5720C	0x0036 BCM5720C
 model BROADCOM4 BCM5725C	0x0038 BCM5725C 1000BASE-T media interface
 model xxBROADCOM_ALT1 BCM5906	0x0004 BCM5906 10/100baseTX media interface
 
-/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
-model CI

CVS commit: [netbsd-9] src/sys

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:43:25 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx [netbsd-9]: epe.c
src/sys/arch/arm/sunxi [netbsd-9]: sunxi_can.c
src/sys/arch/mac68k/nubus [netbsd-9]: if_netdock_nubus.c
src/sys/dev/ic [netbsd-9]: i82586.c
src/sys/dev/pcmcia [netbsd-9]: if_cnw.c if_ray.c
src/sys/dev/qbus [netbsd-9]: if_il.c if_qt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #371):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/arch/arm/sunxi/sunxi_can.c: revision 1.2
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

 if_ipackets is incremented in can_input(), so don't increment it in
sunxi_can_rx_intr to prevent double count. OK'd by bouyer@.

 if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/sys/arch/arm/sunxi/sunxi_can.c
cvs rdiff -u -r1.29 -r1.29.4.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c
cvs rdiff -u -r1.85 -r1.85.2.1 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.65 -r1.65.4.1 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.94 -r1.94.2.1 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/dev/qbus/if_il.c
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/dev/qbus/if_qt.c

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



CVS commit: [netbsd-9] src/sys

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:43:25 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx [netbsd-9]: epe.c
src/sys/arch/arm/sunxi [netbsd-9]: sunxi_can.c
src/sys/arch/mac68k/nubus [netbsd-9]: if_netdock_nubus.c
src/sys/dev/ic [netbsd-9]: i82586.c
src/sys/dev/pcmcia [netbsd-9]: if_cnw.c if_ray.c
src/sys/dev/qbus [netbsd-9]: if_il.c if_qt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #371):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/arch/arm/sunxi/sunxi_can.c: revision 1.2
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

 if_ipackets is incremented in can_input(), so don't increment it in
sunxi_can_rx_intr to prevent double count. OK'd by bouyer@.

 if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/sys/arch/arm/sunxi/sunxi_can.c
cvs rdiff -u -r1.29 -r1.29.4.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c
cvs rdiff -u -r1.85 -r1.85.2.1 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.65 -r1.65.4.1 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.94 -r1.94.2.1 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/dev/qbus/if_il.c
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/dev/qbus/if_qt.c

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

Modified files:

Index: src/sys/arch/arm/ep93xx/epe.c
diff -u src/sys/arch/arm/ep93xx/epe.c:1.44 src/sys/arch/arm/ep93xx/epe.c:1.44.2.1
--- src/sys/arch/arm/ep93xx/epe.c:1.44	Thu May 30 02:32:17 2019
+++ src/sys/arch/arm/ep93xx/epe.c	Wed Oct 23 19:43:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $	*/
+/*	$NetBSD: epe.c,v 1.44.2.1 2019/10/23 19:43:24 martin Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.44.2.1 2019/10/23 19:43:24 martin Exp $");
 
 #include 
 #include 
@@ -256,7 +256,6 @@ begin:
 	}
 
 	if (ndq > 0) {
-		ifp->if_ipackets += ndq;
 		CTRLPAGE_DMASYNC(TX_QLEN * 3 * sizeof(uint32_t),
 			RX_QLEN * 4 * sizeof(uint32_t),
 			BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);

Index: src/sys/arch/arm/sunxi/sunxi_can.c
diff -u src/sys/arch/arm/sunxi/sunxi_can.c:1.1 src/sys/arch/arm/sunxi/sunxi_can.c:1.1.8.1
--- src/sys/arch/arm/sunxi/sunxi_can.c:1.1	Wed Mar  7 20:55:31 2018
+++ src/sys/arch/arm/sunxi/sunxi_can.c	Wed Oct 23 19:43:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunxi_can.c,v 1.1 2018/03/07 20:55:31 bouyer Exp $	*/
+/*	$NetBSD: sunxi_can.c,v 1.1.8.1 2019/10/23 19:43:25 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017,2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.1 2018/03/07 20:55:31 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.1.8.1 2019/10/23 19:43:25 martin Exp $");
 
 #include 
 #include 
@@ -292,7 +292,6 @@ sunxi_can_rx_intr(struct sunxi_can_softc
 	}
 	sunxi_can_write(sc, SUNXI_CAN_CMD_REG, SUNXI_CAN_CMD_REL_RX_BUF);
 	m->m_len = m->m_pkthdr.len = CAN_MTU;
-	ifp->if_ipackets++;
 	ifp->if_ibytes += m->m_len;
 	m_set_rcvif(m, ifp);
 	can_bpf_mtap(ifp, m, 1);

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.29 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.29.4.1
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.29	Tue Feb  5 06:17:01 2019
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Wed Oct 23 19:43:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.29 2019/02/05 06:17:01 msaitoh Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.29.4.1 2019/10/23 19:43:25 martin Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.29 2019/02/05 06:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.29.4.1 2019/10/23 19:43:25 martin Exp $");
 
 #include 
 #include 
@@ -725,9 +725,7 @@ netdock_rxint(struct netdock_softc *sc)
 		len -= ETHER_CRC_LEN;
 
 		if ((regdata1 & 0x00ac) == 0) {
-			if (netdock_read(sc, len))
-ifp->if_ipackets++;
-			else
+			if (netdock_read(sc, len) == 0)
 ifp->if_ierrors++;
 		} else {
 			ifp->if_ierrors++;

Index: src/sys/dev/ic/i82586.c
diff -u src/sys/dev/ic/i82586.c:1.85 src/sys/dev/ic/i82586.c:1.85.2.1
--- src/sys/dev/ic/i82586.c:1.85	Wed May 29 10:07:29 2019
+++ src/sys/dev/ic/i82586.c	Wed Oct 23 19:43:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82586.c,v 1.85

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

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:38:52 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #370):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.170.1 src/sys/dev/pci/if_bcereg.h

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



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

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:38:52 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #370):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.170.1 src/sys/dev/pci/if_bcereg.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_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.52 src/sys/dev/pci/if_bce.c:1.52.2.1
--- src/sys/dev/pci/if_bce.c:1.52	Thu May 30 02:32:18 2019
+++ src/sys/dev/pci/if_bce.c	Wed Oct 23 19:38:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.52 2019/05/30 02:32:18 msaitoh Exp $	 */
+/* $NetBSD: if_bce.c,v 1.52.2.1 2019/10/23 19:38:52 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.52 2019/05/30 02:32:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.52.2.1 2019/10/23 19:38:52 martin Exp $");
 
 #include "vlan.h"
 
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1
 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -423,6 +421,8 @@ bce_attach(device_t parent, device_t sel
 	ifp->if_stop = bce_stop;
 	IFQ_SET_READY(&ifp->if_snd);
 
+	sc->ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
 	/* Initialize our media structures and probe the MII. */
 
 	mii->mii_ifp = ifp;
@@ -653,7 +653,7 @@ bce_watchdog(struct ifnet *ifp)
 {
 	struct bce_softc *sc = ifp->if_softc;
 
-	aprint_error_dev(sc->bce_dev, "device timeout\n");
+	device_printf(sc->bce_dev, "device timeout\n");
 	ifp->if_oerrors++;
 
 	(void) bce_init(ifp);
@@ -920,10 +920,15 @@ bce_init(struct ifnet *ifp)
 	sc->bce_txsnext = 0;
 	sc->bce_txin = 0;
 
-	/* enable crc32 generation */
+	/* enable crc32 generation and set proper LED modes */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
 	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) |
-	BCE_EMC_CG);
+	BCE_EMC_CRC32_ENAB | BCE_EMC_LED);
+
+	/* reset or clear powerdown control bit  */
+	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
+	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) &
+	~BCE_EMC_PDOWN);
 
 	/* setup DMA interrupt control */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DMAI_CTL, 1 << 24);	/* MAGIC */
@@ -1476,9 +1481,11 @@ static void
 bce_tick(void *v)
 {
 	struct bce_softc *sc = v;
+	int s;
 
-	/* Tick the MII. */
+	s = splnet();
 	mii_tick(&sc->bce_mii);
+	splx(s);
 
 	callout_reset(&sc->bce_timeout, hz, bce_tick, sc);
 }

Index: src/sys/dev/pci/if_bcereg.h
diff -u src/sys/dev/pci/if_bcereg.h:1.4 src/sys/dev/pci/if_bcereg.h:1.4.170.1
--- src/sys/dev/pci/if_bcereg.h:1.4	Sun Dec 11 12:22:49 2005
+++ src/sys/dev/pci/if_bcereg.h	Wed Oct 23 19:38:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bcereg.h,v 1.4 2005/12/11 12:22:49 christos Exp $	 */
+/* $NetBSD: if_bcereg.h,v 1.4.170.1 2019/10/23 19:38:52 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -71,7 +71,10 @@
 /* Ethernet MAC Control */
 #define BCE_MACCTL			0x00A8	/* ethernet mac control */
 /* mac control bits */
-#define BCE_EMC_CG			0x0001	/* crc32 generation */
+#define BCE_EMC_CRC32_ENAB		0x0001	/* crc32 generation */
+#define BCE_EMC_PDOWN			0x0004	/* PHY powerdown */
+#define BCE_EMC_EDET			0x0008	/* PHY energy detect */
+#define BCE_EMC_LED			0x00e0	/* PHY LED control */
 
 /* DMA Interrupt control */
 #define BCE_DMAI_CTL			0x0100



CVS commit: [netbsd-9] src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:33:07 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: in6_ifattach.c in6_ifattach.h in6_var.h
ip6_input.c
src/tests/net/ndp [netbsd-9]: t_ra.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #368):

sys/netinet6/in6_ifattach.h: revision 1.14
sys/netinet6/ip6_input.c: revision 1.212
sys/netinet6/ip6_input.c: revision 1.213
sys/netinet6/ip6_input.c: revision 1.214
sys/netinet6/in6_var.h: revision 1.101
sys/netinet6/in6_var.h: revision 1.102
sys/netinet6/in6_ifattach.c: revision 1.116
sys/netinet6/in6_ifattach.c: revision 1.117
tests/net/ndp/t_ra.sh: revision 1.33

Reorganize in6_tmpaddrtimer stuffs
- Move the related functions to where in6_tmpaddrtimer_ch exists
- Hide global variable in6_tmpaddrtimer_ch
- Rename ip6_init2 to in6_tmpaddrtimer_init
- Reduce callers of callout_reset
- Use callout_schedule

Validate ip6_temp_preferred_lifetime (net.inet6.ip6.temppltime) on a change
ip6_temp_preferred_lifetime is used to calculate an interval period to
regenerate temporary addresse by
  TEMP_PREFERRED_LIFETIME - REGEN_ADVANCE - DESYNC_FACTOR
as per RFC 3041 3.5.  So it must be greater than (REGEN_ADVANCE +
DESYNC_FACTOR), otherwise it will be negative and go wrong, for example
KASSERT(to_ticks >= 0) in callout_schedule_locked fails.

tests: add tests for the validateion of net.inet6.ip6.temppltime

in6: reset the temporary address timer on a change of the interval period


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.6.1 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.13 -r1.13.68.1 src/sys/netinet6/in6_ifattach.h
cvs rdiff -u -r1.100 -r1.100.6.1 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.208.2.2 -r1.208.2.3 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.32 -r1.32.6.1 src/tests/net/ndp/t_ra.sh

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



CVS commit: [netbsd-9] src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:33:07 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: in6_ifattach.c in6_ifattach.h in6_var.h
ip6_input.c
src/tests/net/ndp [netbsd-9]: t_ra.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #368):

sys/netinet6/in6_ifattach.h: revision 1.14
sys/netinet6/ip6_input.c: revision 1.212
sys/netinet6/ip6_input.c: revision 1.213
sys/netinet6/ip6_input.c: revision 1.214
sys/netinet6/in6_var.h: revision 1.101
sys/netinet6/in6_var.h: revision 1.102
sys/netinet6/in6_ifattach.c: revision 1.116
sys/netinet6/in6_ifattach.c: revision 1.117
tests/net/ndp/t_ra.sh: revision 1.33

Reorganize in6_tmpaddrtimer stuffs
- Move the related functions to where in6_tmpaddrtimer_ch exists
- Hide global variable in6_tmpaddrtimer_ch
- Rename ip6_init2 to in6_tmpaddrtimer_init
- Reduce callers of callout_reset
- Use callout_schedule

Validate ip6_temp_preferred_lifetime (net.inet6.ip6.temppltime) on a change
ip6_temp_preferred_lifetime is used to calculate an interval period to
regenerate temporary addresse by
  TEMP_PREFERRED_LIFETIME - REGEN_ADVANCE - DESYNC_FACTOR
as per RFC 3041 3.5.  So it must be greater than (REGEN_ADVANCE +
DESYNC_FACTOR), otherwise it will be negative and go wrong, for example
KASSERT(to_ticks >= 0) in callout_schedule_locked fails.

tests: add tests for the validateion of net.inet6.ip6.temppltime

in6: reset the temporary address timer on a change of the interval period


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.6.1 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.13 -r1.13.68.1 src/sys/netinet6/in6_ifattach.h
cvs rdiff -u -r1.100 -r1.100.6.1 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.208.2.2 -r1.208.2.3 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.32 -r1.32.6.1 src/tests/net/ndp/t_ra.sh

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

Modified files:

Index: src/sys/netinet6/in6_ifattach.c
diff -u src/sys/netinet6/in6_ifattach.c:1.115 src/sys/netinet6/in6_ifattach.c:1.115.6.1
--- src/sys/netinet6/in6_ifattach.c:1.115	Tue May  1 07:21:39 2018
+++ src/sys/netinet6/in6_ifattach.c	Wed Oct 23 19:33:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.c,v 1.115 2018/05/01 07:21:39 maxv Exp $	*/
+/*	$NetBSD: in6_ifattach.c,v 1.115.6.1 2019/10/23 19:33:07 martin Exp $	*/
 /*	$KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.115 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.115.6.1 2019/10/23 19:33:07 martin Exp $");
 
 #include 
 #include 
@@ -63,7 +63,7 @@ unsigned long in6_maxmtu = 0;
 
 int ip6_auto_linklocal = 1;	/* enable by default */
 
-callout_t in6_tmpaddrtimer_ch;
+static callout_t in6_tmpaddrtimer_ch;
 
 
 #if 0
@@ -75,6 +75,8 @@ static int get_ifid(struct ifnet *, stru
 static int in6_ifattach_linklocal(struct ifnet *, struct ifnet *);
 static int in6_ifattach_loopback(struct ifnet *);
 
+static void in6_tmpaddrtimer(void *);
+
 #define EUI64_GBIT	0x01
 #define EUI64_UBIT	0x02
 #define EUI64_TO_IFID(in6)	do {(in6)->s6_addr[8] ^= EUI64_UBIT; } while (/*CONSTCOND*/ 0)
@@ -849,6 +851,25 @@ in6_get_tmpifid(struct ifnet *ifp, u_int
 }
 
 void
+in6_tmpaddrtimer_init(void)
+{
+
+	/* timer for regeneration of temporary addresses randomize ID */
+	callout_init(&in6_tmpaddrtimer_ch, CALLOUT_MPSAFE);
+	callout_setfunc(&in6_tmpaddrtimer_ch, in6_tmpaddrtimer, NULL);
+	in6_tmpaddrtimer_schedule();
+}
+
+void
+in6_tmpaddrtimer_schedule(void)
+{
+
+	callout_schedule(&in6_tmpaddrtimer_ch,
+	(ip6_temp_preferred_lifetime - ip6_desync_factor -
+	ip6_temp_regen_advance) * hz);
+}
+
+static void
 in6_tmpaddrtimer(void *ignored_arg)
 {
 	struct nd_ifinfo *ndi;
@@ -860,9 +881,7 @@ in6_tmpaddrtimer(void *ignored_arg)
 	mutex_enter(softnet_lock);
 	KERNEL_LOCK(1, NULL);
 
-	callout_reset(&in6_tmpaddrtimer_ch,
-	(ip6_temp_preferred_lifetime - ip6_desync_factor -
-	ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL);
+	in6_tmpaddrtimer_schedule();
 
 	memset(nullbuf, 0, sizeof(nullbuf));
 	s = pserialize_read_enter();

Index: src/sys/netinet6/in6_ifattach.h
diff -u src/sys/netinet6/in6_ifattach.h:1.13 src/sys/netinet6/in6_ifattach.h:1.13.68.1
--- src/sys/netinet6/in6_ifattach.h:1.13	Sat Sep 19 13:11:02 2009
+++ src/sys/netinet6/in6_ifattach.h	Wed Oct 23 19:33:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.h,v 1.13 2009/09/19 13:11:02 christos Exp $	*/
+/*	$NetBSD: in6_ifattach.h,v 1.13.68.1 2019/10/23 19:33:07 martin Exp $	*/
 /*	$KAME: in6_ifattach.h,v 1.8 2000/04/12 03:51:30 itojun Exp $	*/
 
 /*
@@ -37,7 +37,6 @@
 void in6_ifattach(struct ifnet *, struct ifnet *);
 void in6_ifdetach(struct ifnet *);
 int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int);
-void in6_

CVS commit: [netbsd-9] src/sys/net

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:28:49 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if_vlan.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #367):

sys/net/if_vlan.c: revision 1.147

vlan: get rid of unnecessary if_ipackets++ in vlan_input
It's done by if_input() below now.

Pointed out by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.141.2.1 -r1.141.2.2 src/sys/net/if_vlan.c

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



CVS commit: [netbsd-9] src/sys/net

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:28:49 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if_vlan.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #367):

sys/net/if_vlan.c: revision 1.147

vlan: get rid of unnecessary if_ipackets++ in vlan_input
It's done by if_input() below now.

Pointed out by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.141.2.1 -r1.141.2.2 src/sys/net/if_vlan.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/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.141.2.1 src/sys/net/if_vlan.c:1.141.2.2
--- src/sys/net/if_vlan.c:1.141.2.1	Sun Sep  1 11:07:06 2019
+++ src/sys/net/if_vlan.c	Wed Oct 23 19:28:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.141.2.1 2019/09/01 11:07:06 martin Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.141.2.2 2019/10/23 19:28:49 martin Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.141.2.1 2019/09/01 11:07:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.141.2.2 2019/10/23 19:28:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1656,7 +1656,6 @@ vlan_input(struct ifnet *ifp, struct mbu
 	}
 
 	m_set_rcvif(m, &ifv->ifv_if);
-	ifv->ifv_if.if_ipackets++;
 
 	if (pfil_run_hooks(ifp->if_pfil, &m, ifp, PFIL_IN) != 0)
 		goto out;



CVS commit: [netbsd-9] src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:25:39 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: kern_sig.c sys_ptrace_common.c
src/tests/lib/libc/sys [netbsd-9]: t_ptrace_wait.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #366):

tests/lib/libc/sys/t_ptrace_wait.c: revision 1.136
sys/kern/kern_sig.c: revision 1.373
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.138
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.139
sys/kern/kern_sig.c: revision 1.376
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.140
sys/kern/sys_ptrace_common.c: revision 1.64

Fix typo in a comment

Enable TEST_LWP_ENABLED in t_ptrace_wait*
The LWP events (created, exited) are now reliable in my local tests.
PR kern/51420
PR kern/51995

Remove the short-circuit lwp_exit() path from sigswitch()

sigswitch() can be called from exit1() through:

   ttywait()->ttysleep()-> 
cv_timedwait_sig()->sleepq_block()->issignal()->sigswitch()

lwp_exit() called for the last LWP triggers exit1() and this causes a panic.
The debugger related signals have short-circuit demise paths in
eventswitch() and other functions, before calling sigswitch().

This change restores the original behavior, but there is an open question
whether the kernel crash is a red herring of misbehavior of ttywait().
This should fix PR kern/54618 by David H. Gutteridge

Fix a race condition when handling concurrent LWP signals and add a test

Fix a race condition that caused PT_GET_SIGINFO to return incorrect
information when multiple signals were delivered concurrently
to different LWPs.  Add a regression test that verifies that when 50
threads concurrently use pthread_kill() on themselves, the debugger
receives all signals with correct information.

The kernel uses separate signal queues for each LWP.  However,
the signal context used to implement PT_GET_SIGINFO is stored in 'struct
proc' and therefore common to all LWPs in the process.  Previously,
this member was filled in kpsignal2(), i.e. when the signal was sent.

This meant that if another LWP managed to send another signal
concurrently, the data was overwritten before the process was stopped.

As a result, PT_GET_SIGINFO did not report the correct LWP and signal
(it could even report a different signal than wait()).  This can be
quite reliably reproduced with the number of 20 LWPs, however it can
also occur with 10.

This patch moves setting of signal context to issignal(), just before
the process is actually stopped.  The data is taken from per-LWP
or per-process signal queue.  The added test confirms that the debugger
correctly receives all signals, and PT_GET_SIGINFO reports both correct
LWP and signal number.
Reviewed by kamil.

Remove preprocessor switch TEST_VFORK_ENABLED in t_ptrace_wait*
vfork(2) tests are now enabled always and confirmed to be stable.

Remove preprocessor switch TEST_LWP_ENABLED in t_ptrace_wait*
LWP tests are now enabled always and confirmed to be stable.


To generate a diff of this commit:
cvs rdiff -u -r1.364.2.7 -r1.364.2.8 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.58.2.8 -r1.58.2.9 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.131.2.5 -r1.131.2.6 src/tests/lib/libc/sys/t_ptrace_wait.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/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.364.2.7 src/sys/kern/kern_sig.c:1.364.2.8
--- src/sys/kern/kern_sig.c:1.364.2.7	Tue Oct 15 19:28:16 2019
+++ src/sys/kern/kern_sig.c	Wed Oct 23 19:25:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.364.2.7 2019/10/15 19:28:16 martin Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.364.2.8 2019/10/23 19:25:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.364.2.7 2019/10/15 19:28:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.364.2.8 2019/10/23 19:25:39 martin Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_dtrace.h"
@@ -1318,10 +1318,6 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 	if (p->p_stat != SACTIVE && p->p_stat != SSTOP)
 		return 0;
 
-	/* XXX for core dump/debugger */
-	p->p_sigctx.ps_lwp = ksi->ksi_lid;
-	p->p_sigctx.ps_info = ksi->ksi_info;
-
 	/*
 	 * Notify any interested parties of the signal.
 	 */
@@ -1711,21 +1707,6 @@ sigswitch(int ppmask, int signo, bool pr
 	}
 
 	/*
-	 * If we are exiting, demise now.
-	 *
-	 * This avoids notifying tracer and deadlocking.
-	 */
-	if (__predict_false(ISSET(p->p_sflag, PS_WEXIT))) {
-		mutex_exit(p->p_lock);
-		if (proc_lock_held) {
-			mutex_exit(proc_lock);
-		}
-		lwp_exit(l);
-		panic("sigswitch");
-		/* NOTREACHED */
-	}
-
-	/*
 	 * On entry we know that the process needs to stop.  If it's
 	 * the result of a 'sideways' stop signal that has been sourced
 	 * through issignal(), then stop other LWPs

CVS commit: [netbsd-9] src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:25:39 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: kern_sig.c sys_ptrace_common.c
src/tests/lib/libc/sys [netbsd-9]: t_ptrace_wait.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #366):

tests/lib/libc/sys/t_ptrace_wait.c: revision 1.136
sys/kern/kern_sig.c: revision 1.373
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.138
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.139
sys/kern/kern_sig.c: revision 1.376
tests/lib/libc/sys/t_ptrace_wait.c: revision 1.140
sys/kern/sys_ptrace_common.c: revision 1.64

Fix typo in a comment

Enable TEST_LWP_ENABLED in t_ptrace_wait*
The LWP events (created, exited) are now reliable in my local tests.
PR kern/51420
PR kern/51995

Remove the short-circuit lwp_exit() path from sigswitch()

sigswitch() can be called from exit1() through:

   ttywait()->ttysleep()-> 
cv_timedwait_sig()->sleepq_block()->issignal()->sigswitch()

lwp_exit() called for the last LWP triggers exit1() and this causes a panic.
The debugger related signals have short-circuit demise paths in
eventswitch() and other functions, before calling sigswitch().

This change restores the original behavior, but there is an open question
whether the kernel crash is a red herring of misbehavior of ttywait().
This should fix PR kern/54618 by David H. Gutteridge

Fix a race condition when handling concurrent LWP signals and add a test

Fix a race condition that caused PT_GET_SIGINFO to return incorrect
information when multiple signals were delivered concurrently
to different LWPs.  Add a regression test that verifies that when 50
threads concurrently use pthread_kill() on themselves, the debugger
receives all signals with correct information.

The kernel uses separate signal queues for each LWP.  However,
the signal context used to implement PT_GET_SIGINFO is stored in 'struct
proc' and therefore common to all LWPs in the process.  Previously,
this member was filled in kpsignal2(), i.e. when the signal was sent.

This meant that if another LWP managed to send another signal
concurrently, the data was overwritten before the process was stopped.

As a result, PT_GET_SIGINFO did not report the correct LWP and signal
(it could even report a different signal than wait()).  This can be
quite reliably reproduced with the number of 20 LWPs, however it can
also occur with 10.

This patch moves setting of signal context to issignal(), just before
the process is actually stopped.  The data is taken from per-LWP
or per-process signal queue.  The added test confirms that the debugger
correctly receives all signals, and PT_GET_SIGINFO reports both correct
LWP and signal number.
Reviewed by kamil.

Remove preprocessor switch TEST_VFORK_ENABLED in t_ptrace_wait*
vfork(2) tests are now enabled always and confirmed to be stable.

Remove preprocessor switch TEST_LWP_ENABLED in t_ptrace_wait*
LWP tests are now enabled always and confirmed to be stable.


To generate a diff of this commit:
cvs rdiff -u -r1.364.2.7 -r1.364.2.8 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.58.2.8 -r1.58.2.9 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.131.2.5 -r1.131.2.6 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: [netbsd-9] src/sys/lib/libsa

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:17:15 UTC 2019

Modified Files:
src/sys/lib/libsa [netbsd-9]: loadfile_elf32.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #361):

sys/lib/libsa/loadfile_elf32.c: revision 1.56

Make sure we're dealing with a static binary. Otherwise we could crash if
the user mistakenly tries to boot a KASLR kernel with 'boot' instead of
'pkboot'. Now we fail cleanly. Reported by cryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.2.1 src/sys/lib/libsa/loadfile_elf32.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/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.55 src/sys/lib/libsa/loadfile_elf32.c:1.55.2.1
--- src/sys/lib/libsa/loadfile_elf32.c:1.55	Sun Jul 21 16:53:17 2019
+++ src/sys/lib/libsa/loadfile_elf32.c	Wed Oct 23 19:17:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.55 2019/07/21 16:53:17 rin Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.55.2.1 2019/10/23 19:17:15 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 2008, 2017 The NetBSD Foundation, Inc.
@@ -699,6 +699,11 @@ ELFNAMEEND(loadfile_static)(int fd, Elf_
 
 	internalize_ehdr(elf->e_ident[EI_DATA], elf);
 
+	if (elf->e_type != ET_EXEC) {
+		errno = EINVAL;
+		return 1;
+	}
+
 	sz = elf->e_phnum * sizeof(Elf_Phdr);
 	phdr = ALLOC(sz);
 	ret = ELFNAMEEND(readfile_local)(fd, elf->e_phoff, phdr, sz);



CVS commit: [netbsd-9] src/sys/lib/libsa

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:17:15 UTC 2019

Modified Files:
src/sys/lib/libsa [netbsd-9]: loadfile_elf32.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #361):

sys/lib/libsa/loadfile_elf32.c: revision 1.56

Make sure we're dealing with a static binary. Otherwise we could crash if
the user mistakenly tries to boot a KASLR kernel with 'boot' instead of
'pkboot'. Now we fail cleanly. Reported by cryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.2.1 src/sys/lib/libsa/loadfile_elf32.c

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



CVS commit: [netbsd-9] src/sys/arch

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:14:19 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: cpu.c locore.S
src/sys/arch/aarch64/include [netbsd-9]: cpu.h param.h
src/sys/arch/arm/acpi [netbsd-9]: cpu_acpi.c
src/sys/arch/arm/arm32 [netbsd-9]: cpu.c
src/sys/arch/arm/fdt [netbsd-9]: cpu_fdt.c
src/sys/arch/arm/include [netbsd-9]: cpu.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #359):

sys/arch/aarch64/aarch64/locore.S: revision 1.42
sys/arch/aarch64/aarch64/locore.S: revision 1.43
sys/arch/aarch64/aarch64/locore.S: revision 1.44
sys/arch/arm/fdt/cpu_fdt.c: revision 1.28
sys/arch/aarch64/include/cpu.h: revision 1.14
sys/arch/aarch64/include/param.h: revision 1.12
sys/arch/arm/arm32/cpu.c: revision 1.133
sys/arch/arm/arm32/cpu.c: revision 1.134
sys/arch/arm/include/cpu.h: revision 1.101
sys/arch/arm/acpi/cpu_acpi.c: revision 1.7
sys/arch/aarch64/aarch64/cpu.c: revision 1.23
sys/arch/aarch64/aarch64/cpu.c: revision 1.24
sys/arch/aarch64/aarch64/cpu.c: revision 1.25

Increase aarch64 MAXCPUS to 256.

 -

Invalidate dcache before polling AP hatched status

 -

Avoid overlap between BP and last AP stack. AP stacks are now in order of
increasing address order.

Spotted by and idea from mlelstv.

 -

Use separate cacheline aligned arrays for mbox and hatched as before.

 -

cpu_hatched_p only for MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/aarch64/include/param.h
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/arch/arm/acpi/cpu_acpi.c
cvs rdiff -u -r1.129 -r1.129.4.1 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/arch/arm/fdt/cpu_fdt.c
cvs rdiff -u -r1.100 -r1.100.4.1 src/sys/arch/arm/include/cpu.h

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



CVS commit: [netbsd-9] src/sys/arch

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:14:19 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: cpu.c locore.S
src/sys/arch/aarch64/include [netbsd-9]: cpu.h param.h
src/sys/arch/arm/acpi [netbsd-9]: cpu_acpi.c
src/sys/arch/arm/arm32 [netbsd-9]: cpu.c
src/sys/arch/arm/fdt [netbsd-9]: cpu_fdt.c
src/sys/arch/arm/include [netbsd-9]: cpu.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #359):

sys/arch/aarch64/aarch64/locore.S: revision 1.42
sys/arch/aarch64/aarch64/locore.S: revision 1.43
sys/arch/aarch64/aarch64/locore.S: revision 1.44
sys/arch/arm/fdt/cpu_fdt.c: revision 1.28
sys/arch/aarch64/include/cpu.h: revision 1.14
sys/arch/aarch64/include/param.h: revision 1.12
sys/arch/arm/arm32/cpu.c: revision 1.133
sys/arch/arm/arm32/cpu.c: revision 1.134
sys/arch/arm/include/cpu.h: revision 1.101
sys/arch/arm/acpi/cpu_acpi.c: revision 1.7
sys/arch/aarch64/aarch64/cpu.c: revision 1.23
sys/arch/aarch64/aarch64/cpu.c: revision 1.24
sys/arch/aarch64/aarch64/cpu.c: revision 1.25

Increase aarch64 MAXCPUS to 256.

 -

Invalidate dcache before polling AP hatched status

 -

Avoid overlap between BP and last AP stack. AP stacks are now in order of
increasing address order.

Spotted by and idea from mlelstv.

 -

Use separate cacheline aligned arrays for mbox and hatched as before.

 -

cpu_hatched_p only for MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/aarch64/include/param.h
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/arch/arm/acpi/cpu_acpi.c
cvs rdiff -u -r1.129 -r1.129.4.1 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/arch/arm/fdt/cpu_fdt.c
cvs rdiff -u -r1.100 -r1.100.4.1 src/sys/arch/arm/include/cpu.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/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.20 src/sys/arch/aarch64/aarch64/cpu.c:1.20.2.1
--- src/sys/arch/aarch64/aarch64/cpu.c:1.20	Tue Jul 16 20:29:53 2019
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Oct 23 19:14:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.20 2019/07/16 20:29:53 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.20.2.1 2019/10/23 19:14:19 martin Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.20 2019/07/16 20:29:53 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.20.2.1 2019/10/23 19:14:19 martin Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -69,8 +69,8 @@ static void cpu_setup_sysctl(device_t, s
 #ifdef MULTIPROCESSOR
 uint64_t cpu_mpidr[MAXCPUS];
 
-volatile u_int arm_cpu_hatched __cacheline_aligned = 0;
-volatile uint32_t arm_cpu_mbox __cacheline_aligned = 0;
+volatile u_int aarch64_cpu_mbox[howmany(MAXCPUS, sizeof(u_int))] __cacheline_aligned = { 0 };
+volatile u_int aarch64_cpu_hatched[howmany(MAXCPUS, sizeof(u_int))] __cacheline_aligned = { 0 };
 u_int arm_cpu_max = 1;
 
 static kmutex_t cpu_hatch_lock;
@@ -126,7 +126,7 @@ cpu_attach(device_t dv, cpuid_t id)
 		/* ci_id is stored by own cpus when hatching */
 
 		cpu_info[ncpu] = ci;
-		if ((arm_cpu_hatched & __BIT(unit)) == 0) {
+		if (cpu_hatched_p(unit) == 0) {
 			ci->ci_dev = dv;
 			dv->dv_private = ci;
 			ci->ci_index = -1;
@@ -499,27 +499,33 @@ cpu_setup_sysctl(device_t dv, struct cpu
 void
 cpu_boot_secondary_processors(void)
 {
+	u_int n, bit;
+
 	if ((boothowto & RB_MD1) != 0)
 		return;
 
 	mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
 
-	VPRINTF("%s: writing mbox with %#x\n", __func__, arm_cpu_hatched);
+	VPRINTF("%s: starting secondary processors\n", __func__);
 
 	/* send mbox to have secondary processors do cpu_hatch() */
-	atomic_or_32(&arm_cpu_mbox, arm_cpu_hatched);
+	for (n = 0; n < __arraycount(aarch64_cpu_mbox); n++)
+		atomic_or_uint(&aarch64_cpu_mbox[n], aarch64_cpu_hatched[n]);
 	__asm __volatile ("sev; sev; sev");
 
 	/* wait all cpus have done cpu_hatch() */
-	while (membar_consumer(), arm_cpu_mbox & arm_cpu_hatched) {
-		__asm __volatile ("wfe");
+	for (n = 0; n < __arraycount(aarch64_cpu_mbox); n++) {
+		while (membar_consumer(), aarch64_cpu_mbox[n] & aarch64_cpu_hatched[n]) {
+			__asm __volatile ("wfe");
+		}
+		/* Add processors to kcpuset */
+		for (bit = 0; bit < 32; bit++) {
+			if (aarch64_cpu_hatched[n] & __BIT(bit))
+kcpuset_set(kcpuset_attached, n * 32 + bit);
+		}
 	}
 
 	VPRINTF("%s: secondary processors hatched\n", __func__);
-
-	/* add available processors to kcpuset */
-	uint32_t mbox = arm_cpu_hatched;
-	kcpuset_export_u32(kcp

CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 18:55:36 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: file-prefix-map.c

Log Message:
Since add_debug_regex_map is used in opts-global.c unconditionally, we can't
disable the code with #ifndef __NetBSD__ because it breaks cross-building.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 18:55:36 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: file-prefix-map.c

Log Message:
Since add_debug_regex_map is used in opts-global.c unconditionally, we can't
disable the code with #ifndef __NetBSD__ because it breaks cross-building.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/file-prefix-map.c
diff -u src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.2 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.3
--- src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.2	Tue Oct  1 17:17:28 2019
+++ src/external/gpl3/gcc/dist/gcc/file-prefix-map.c	Wed Oct 23 14:55:36 2019
@@ -123,7 +123,8 @@ remap_macro_filename (const char *filena
   return remap_filename (macro_prefix_maps, filename);
 }
 
-#ifndef __NetBSD__
+/* Original GCC version disabled. The NetBSD version handles regex */
+#if 0
 /* Remap using -fdebug-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.  */
 const char *
@@ -131,7 +132,12 @@ remap_debug_filename (const char *filena
 {
   return remap_filename (debug_prefix_maps, filename);
 }
-#else
+#endif
+
+/*
+ * The following code is a NetBSD extension that allows regex and
+ * \[0-9] substitutition arguments.
+ */
 
 /* Perform user-specified mapping of debug filename prefixes.  Return
the new name corresponding to FILENAME.  */
@@ -238,4 +244,3 @@ remap_debug_filename (const char *filena
 {
return remap_debug_regex_filename (remap_debug_prefix_filename (filename));
 }
-#endif



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

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 18:09:18 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #358):

sys/dev/pci/ahcisata_pci.c: revision 1.56

ahcisata: make sure bus mastering and memory space are actually enabled
This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.


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



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

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 18:09:18 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #358):

sys/dev/pci/ahcisata_pci.c: revision 1.56

ahcisata: make sure bus mastering and memory space are actually enabled
This makes the "ROCKPro64 PCI-e to Dual SATA-II Interface Card" work.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.4.1 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.55 src/sys/dev/pci/ahcisata_pci.c:1.55.4.1
--- src/sys/dev/pci/ahcisata_pci.c:1.55	Sun Jan 27 02:08:42 2019
+++ src/sys/dev/pci/ahcisata_pci.c	Wed Oct 23 18:09:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.55.4.1 2019/10/23 18:09:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55 2019/01/27 02:08:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55.4.1 2019/10/23 18:09:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -394,6 +394,7 @@ ahci_pci_attach(device_t parent, device_
 	struct ahci_softc *sc = &psc->ah_sc;
 	bool ahci_cap_64bit;
 	bool ahci_bad_64bit;
+	pcireg_t reg;
 
 	sc->sc_atac.atac_dev = self;
 
@@ -447,6 +448,10 @@ ahci_pci_attach(device_t parent, device_
 		AHCIDEBUG_PRINT(("%s: SATA mode\n", AHCINAME(sc)), DEBUG_PROBE);
 	}
 
+	reg = pci_conf_read(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG);
+	reg |= (PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE);
+	pci_conf_write(psc->sc_pc, psc->sc_pcitag, PCI_COMMAND_STATUS_REG, reg);
+
 	ahci_attach(sc);
 
 	if (!pmf_device_register(self, NULL, ahci_pci_resume))



CVS commit: src/usr.sbin/sysinst

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 18:08:31 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.pl

Log Message:
Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.pl

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

Modified files:

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.23 src/usr.sbin/sysinst/msg.mi.pl:1.24
--- src/usr.sbin/sysinst/msg.mi.pl:1.23	Wed Oct  2 11:16:04 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Wed Oct 23 18:08:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.23 2019/10/02 11:16:04 maya Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.24 2019/10/23 18:08:31 kamil Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -75,15 +75,16 @@ message mount_failed
 
 message hello
 {Witaj w sysinst, systemie instalacyjnym NetBSD-@@VERSION@@.
-To oparte na menu narzedzie zostalo stworzone aby pomoc ci zainstalowac
-NetBSD na twardym dysku, lub zaktualizowac istniejacy system NetBSD,
-zuzywajac minimum czasu. W ponizszych menu mozesz zmienic aktualne
-ustawienia poprzez naciskanie klawiszy (a, b, c, ...). Klawisze strzalek
-takze moga dzialac. Aktywujesz ustawienie poprzez nacisniecie ENTER.
+To oparte na menu narzedzie (sysinst) zostalo zaprojektowane w celu
+ulatwienia instalacji NetBSD na dysku twardym, lub uaktualnienia istniejacego 
+systemu NetBSD przy minimalnym nakladzie pracy. W ponizszych menu, aby wybrac
+pozycje wpisz litere (a, b, c, ...). Mozesz tez uzyc CTRL+N/CTRL+P, aby wybrac
+nastepna/poprzednia pozycje. Klawisze strzalek i Page-up/Page-down takze moga
+dzialac. Aby aktywowac biezacy wybor z menu, nacisnij klawisz Enter.
 }
 
 message thanks
-{Dziekujemy za uzywanie NetBSD!
+{Dziekujemy za wybranie NetBSD!
 }
 
 message installusure
@@ -483,8 +484,12 @@ message distset
 {Dystrybucja NetBSD jest rozbita w kolekcje pakietow dystrybucyjnych.
 Czesc z nich to pakiety podstawowe wymagane przez wszystkie instalacje,
 a czesc nie jest przez wszystkie wymagana. Mozesz zainstalowac je
-wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow.
-} /* XXX add 'minimal installation' */
+wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow. Mozesz
+takze zainstalowac tylko podstawowy zestaw (minimalna instalacja), lub
+wybrac te, ktore chcesz (Inna instalacja)
+}
+
+
 
 message ftpsource
 {Ponizej masz site %s, katalog, uzytkownika, oraz haslo gotowe do uzycia.



CVS commit: src/usr.sbin/sysinst

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 18:08:31 UTC 2019

Modified Files:
src/usr.sbin/sysinst: msg.mi.pl

Log Message:
Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.pl

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



CVS commit: [netbsd-9] src/sys/dev/ic

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 18:06:46 UTC 2019

Modified Files:
src/sys/dev/ic [netbsd-9]: ahcisata_core.c

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #357):

sys/dev/ic/ahcisata_core.c: revision 1.76

Ensure cmdh_prdtl is 0 in ahci_do_reset_drive().
(I'm probably just being paranoid here.)


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.75.4.1 src/sys/dev/ic/ahcisata_core.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/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.75 src/sys/dev/ic/ahcisata_core.c:1.75.4.1
--- src/sys/dev/ic/ahcisata_core.c:1.75	Sun Apr  7 17:46:49 2019
+++ src/sys/dev/ic/ahcisata_core.c	Wed Oct 23 18:06:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.75 2019/04/07 17:46:49 bouyer Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.75.4.1 2019/10/23 18:06:46 martin Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.75 2019/04/07 17:46:49 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.75.4.1 2019/10/23 18:06:46 martin Exp $");
 
 #include 
 #include 
@@ -842,6 +842,7 @@ again:
 	cmd_tbl = achp->ahcic_cmd_tbl[c_slot];
 	cmd_h->cmdh_flags = htole16(AHCI_CMDH_F_RST | AHCI_CMDH_F_CBSY |
 	RHD_FISLEN / 4 | (drive << AHCI_CMDH_F_PMP_SHIFT));
+	cmd_h->cmdh_prdtl = 0;
 	cmd_h->cmdh_prdbc = 0;
 	memset(cmd_tbl->cmdt_cfis, 0, 64);
 	cmd_tbl->cmdt_cfis[fis_type] = RHD_FISTYPE;



CVS commit: [netbsd-9] src/sys/dev/ic

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 18:06:46 UTC 2019

Modified Files:
src/sys/dev/ic [netbsd-9]: ahcisata_core.c

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #357):

sys/dev/ic/ahcisata_core.c: revision 1.76

Ensure cmdh_prdtl is 0 in ahci_do_reset_drive().
(I'm probably just being paranoid here.)


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.75.4.1 src/sys/dev/ic/ahcisata_core.c

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



CVS commit: src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 16:26:42 UTC 2019

Modified Files:
src: UPDATING

Log Message:
Add note for GCC 8 builds (see PR 54644)


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/UPDATING

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



CVS commit: src

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 16:26:42 UTC 2019

Modified Files:
src: UPDATING

Log Message:
Add note for GCC 8 builds (see PR 54644)


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.303 src/UPDATING:1.304
--- src/UPDATING:1.303	Tue Oct  1 09:36:56 2019
+++ src/UPDATING	Wed Oct 23 16:26:42 2019
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.303 2019/10/01 09:36:56 mrg Exp $
+$NetBSD: UPDATING,v 1.304 2019/10/23 16:26:42 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,14 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20191022:
+	Ports amd64 and aarch64 switched to GCC 8.3 by default.
+	In-place ("expert mode", build.sh -E) builds are not supported
+	when going from a GCC 7 userland to GCC 8. Do a regular
+	build to a different DESTDIR (or preferably: build.sh -U) at least
+	once and install sets, or download compt.{tar.xz,tgz} from the
+	daily builds and install that before doing the next in-place build.
+
 20191001:
 
 	GCC 8.3 was imported.  Builds of src/tools/gcc may fail if



CVS commit: src/sys/dev/ic

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 14:44:41 UTC 2019

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Missing ata_channel_unlock(chp). Noted by mjg@freebsd.


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 src/sys/dev/ic/wdc.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/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.293 src/sys/dev/ic/wdc.c:1.294
--- src/sys/dev/ic/wdc.c:1.293	Tue Oct 22 08:09:11 2019
+++ src/sys/dev/ic/wdc.c	Wed Oct 23 10:44:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.293 2019/10/22 12:09:11 martin Exp $ */
+/*	$NetBSD: wdc.c,v 1.294 2019/10/23 14:44:41 christos Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.293 2019/10/22 12:09:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.294 2019/10/23 14:44:41 christos Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -296,8 +296,10 @@ wdc_drvprobe(struct ata_channel *chp)
 	int i, j, error, tfd;
 
 	ata_channel_lock(chp);
-	if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0)
+	if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0) {
+		ata_channel_unlock(chp);
 		return;
+	}
 	if (wdcprobe1(chp, 0) == 0) {
 		/* No drives, abort the attach here. */
 		atabus_free_drives(chp);



CVS commit: src/etc/rc.d

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 14:45:38 UTC 2019

Modified Files:
src/etc/rc.d: sshd

Log Message:
simplify more (from rudolf)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/etc/rc.d/sshd

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

Modified files:

Index: src/etc/rc.d/sshd
diff -u src/etc/rc.d/sshd:1.29 src/etc/rc.d/sshd:1.30
--- src/etc/rc.d/sshd:1.29	Sat May 26 15:18:11 2018
+++ src/etc/rc.d/sshd	Wed Oct 23 10:45:38 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.29 2018/05/26 19:18:11 riastradh Exp $
+# $NetBSD: sshd,v 1.30 2019/10/23 14:45:38 christos Exp $
 #
 
 # PROVIDE: sshd
@@ -20,7 +20,7 @@ sshd_keygen()
 (
 	keygen="/usr/bin/ssh-keygen"
 	umask 022
-	while read type bits filename version name;  do
+	while read type bits filename;  do
 		f="/etc/ssh/$filename"
 		if [ -f "$f" ]; then
 			continue
@@ -33,10 +33,10 @@ sshd_keygen()
 		"${keygen}" -t "${type}" ${bitarg} -f "${f}" -N '' -q && \
 		printf "ssh-keygen: " && "${keygen}" -f "${f}" -l
 	done << _EOF
-dsa	1024	ssh_host_dsa_key	2	DSA
-ecdsa	521	ssh_host_ecdsa_key	1	ECDSA
-ed25519	-1	ssh_host_ed25519_key	1	ED25519
-rsa	0	ssh_host_rsa_key	2	RSA
+dsa	1024	ssh_host_dsa_key
+ecdsa	521	ssh_host_ecdsa_key
+ed25519	-1	ssh_host_ed25519_key
+rsa	0	ssh_host_rsa_key
 _EOF
 )
 }



CVS commit: src/sys/dev/ic

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 14:44:41 UTC 2019

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Missing ata_channel_unlock(chp). Noted by mjg@freebsd.


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 src/sys/dev/ic/wdc.c

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



CVS commit: src/etc/rc.d

2019-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 23 14:45:38 UTC 2019

Modified Files:
src/etc/rc.d: sshd

Log Message:
simplify more (from rudolf)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/etc/rc.d/sshd

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



CVS commit: src

2019-10-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Oct 23 12:02:56 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Three changes in libnvmm:

 - Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.

 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.

 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libnvmm/h_mem_assist.c

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

Modified files:

Index: src/lib/libnvmm/libnvmm.c
diff -u src/lib/libnvmm/libnvmm.c:1.15 src/lib/libnvmm/libnvmm.c:1.16
--- src/lib/libnvmm/libnvmm.c:1.15	Wed Oct 23 07:01:11 2019
+++ src/lib/libnvmm/libnvmm.c	Wed Oct 23 12:02:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm.c,v 1.15 2019/10/23 07:01:11 maxv Exp $	*/
+/*	$NetBSD: libnvmm.c,v 1.16 2019/10/23 12:02:55 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -260,12 +260,6 @@ nvmm_machine_configure(struct nvmm_machi
 	struct nvmm_ioc_machine_configure args;
 	int ret;
 
-	switch (op) {
-	case NVMM_MACH_CONF_CALLBACKS:
-		memcpy(&mach->cbs, conf, sizeof(mach->cbs));
-		return 0;
-	}
-
 	args.machid = mach->machid;
 	args.op = op;
 	args.conf = conf;
@@ -335,6 +329,12 @@ nvmm_vcpu_configure(struct nvmm_machine 
 	struct nvmm_ioc_vcpu_configure args;
 	int ret;
 
+	switch (op) {
+	case NVMM_VCPU_CONF_CALLBACKS:
+		memcpy(&vcpu->cbs, conf, sizeof(vcpu->cbs));
+		return 0;
+	}
+
 	args.machid = mach->machid;
 	args.cpuid = vcpu->cpuid;
 	args.op = op;

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.36 src/lib/libnvmm/libnvmm_x86.c:1.37
--- src/lib/libnvmm/libnvmm_x86.c:1.36	Wed Oct 23 07:01:11 2019
+++ src/lib/libnvmm/libnvmm_x86.c	Wed Oct 23 12:02:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.36 2019/10/23 07:01:11 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.37 2019/10/23 12:02:55 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -555,9 +555,10 @@ rep_set_cnt(struct nvmm_x64_state *state
 }
 
 static int
-read_guest_memory(struct nvmm_machine *mach, struct nvmm_x64_state *state,
+read_guest_memory(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
 gvaddr_t gva, uint8_t *data, size_t size)
 {
+	struct nvmm_x64_state *state = vcpu->state;
 	struct nvmm_mem mem;
 	nvmm_prot_t prot;
 	gpaddr_t gpa;
@@ -585,11 +586,13 @@ read_guest_memory(struct nvmm_machine *m
 	is_mmio = (ret == -1);
 
 	if (is_mmio) {
+		mem.mach = mach;
+		mem.vcpu = vcpu;
 		mem.data = data;
 		mem.gpa = gpa;
 		mem.write = false;
 		mem.size = size;
-		(*mach->cbs.mem)(&mem);
+		(*vcpu->cbs.mem)(&mem);
 	} else {
 		if (__predict_false(!(prot & NVMM_PROT_READ))) {
 			errno = EFAULT;
@@ -599,7 +602,7 @@ read_guest_memory(struct nvmm_machine *m
 	}
 
 	if (remain > 0) {
-		ret = read_guest_memory(mach, state, gva + size,
+		ret = read_guest_memory(mach, vcpu, gva + size,
 		data + size, remain);
 	} else {
 		ret = 0;
@@ -609,9 +612,10 @@ read_guest_memory(struct nvmm_machine *m
 }
 
 static int
-write_guest_memory(struct nvmm_machine *mach, struct nvmm_x64_state *state,
+write_guest_memory(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
 gvaddr_t gva, uint8_t *data, size_t size)
 {
+	struct nvmm_x64_state *state = vcpu->state;
 	struct nvmm_mem mem;
 	nvmm_prot_t prot;
 	gpaddr_t gpa;
@@ -639,11 +643,13 @@ write_guest_memory(struct nvmm_machine *
 	is_mmio = (ret == -1);
 
 	if (is_mmio) {
+		mem.mach = mach;
+		mem.vcpu = vcpu;
 		mem.data = data;
 		mem.gpa = gpa;
 		mem.write = true;
 		mem.size = size;
-		(*mach->cbs.mem)(&mem);
+		(*vcpu->cbs.mem)(&mem);
 	} else {
 		if (__predict_false(!(prot & NVMM_PROT_WRITE))) {
 			errno = EFAULT;
@@ -653,7 +659,7 @@ write_guest_memory(struct nvmm_machine *
 	}
 
 	if (remain > 0) {
-		ret = write_guest_memory(mach, state, gva + size,
+		ret = write_guest_memory(mach, vcpu, gva + size,
 		data + size, remain);
 	} else {
 		ret = 0;
@@ -664,12 +670,12 @@ write_guest_memory(struct nvmm_machine *
 
 /* -- */
 
-static int fetch_segment(struct nvmm_machine *, struct nvmm_x64_state *);
+static int fetch_segment(struct nvmm_machine *, struct nvmm_vcpu *);
 
 #define NVMM_IO_BATCH_SIZE	32
 
 static int
-assist_io_batch(struct nvmm_machine *mach, struct nvmm_x64_state *state,
+assist_io_batch(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
 struct nvmm_io *io, gvaddr_t gva, uint64_t cnt)
 {
 	uint8_t iobuf[NVMM_IO_BATCH_SIZE];
@@ -683,18 +

CVS commit: src

2019-10-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Oct 23 12:02:56 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Three changes in libnvmm:

 - Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.

 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.

 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libnvmm/h_mem_assist.c

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



CVS commit: src/sys/external/bsd/compiler_rt/dist/lib/msan

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 11:27:08 UTC 2019

Modified Files:
src/sys/external/bsd/compiler_rt/dist/lib/msan: msan_interceptors.cc

Log Message:
Correct the __libc_thr_keycreate signature in the MSan interceptor

Noted by gcc8.

In practice it might have no impact on the functionality.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc

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



CVS commit: src/sys/external/bsd/compiler_rt/dist/lib/msan

2019-10-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Oct 23 11:27:08 UTC 2019

Modified Files:
src/sys/external/bsd/compiler_rt/dist/lib/msan: msan_interceptors.cc

Log Message:
Correct the __libc_thr_keycreate signature in the MSan interceptor

Noted by gcc8.

In practice it might have no impact on the functionality.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc

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/compiler_rt/dist/lib/msan/msan_interceptors.cc
diff -u src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc:1.1.1.1 src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc:1.2
--- src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc:1.1.1.1	Tue Jan  8 05:40:32 2019
+++ src/sys/external/bsd/compiler_rt/dist/lib/msan/msan_interceptors.cc	Wed Oct 23 11:27:08 2019
@@ -1057,7 +1057,7 @@ INTERCEPTOR(int, pthread_key_create, __s
 }
 
 #if SANITIZER_NETBSD
-INTERCEPTOR(void, __libc_thr_keycreate, void *m, void (*dtor)(void *value)) \
+INTERCEPTOR(int, __libc_thr_keycreate, __sanitizer_pthread_key_t *m, void (*dtor)(void *value)) \
   ALIAS(WRAPPER_NAME(pthread_key_create));
 #endif
 



Re: CVS commit: src/etc/rc.d

2019-10-23 Thread rudolf

Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Mon Apr  9 15:02:39 UTC 2018

Modified Files:
src/etc/rc.d: sshd

Log Message:
Simplify so we don't have to hard-code the key filenames in two places.



There are some leftovers in the script after the simplification, the 
"version" and "name" input arguments are unused now. Please see the 
attached diff.


Kind regards,

r.
diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd
index 038f817ebe43..dfc4d0b91077 100755
--- a/etc/rc.d/sshd
+++ b/etc/rc.d/sshd
@@ -20,7 +20,7 @@ sshd_keygen()
 (
 	keygen="/usr/bin/ssh-keygen"
 	umask 022
-	while read type bits filename version name;  do
+	while read type bits filename;  do
 		f="/etc/ssh/$filename"
 		if [ -f "$f" ]; then
 			continue
@@ -33,10 +33,10 @@ sshd_keygen()
 		"${keygen}" -t "${type}" ${bitarg} -f "${f}" -N '' -q && \
 		printf "ssh-keygen: " && "${keygen}" -f "${f}" -l
 	done << _EOF
-dsa	1024	ssh_host_dsa_key	2	DSA
-ecdsa	521	ssh_host_ecdsa_key	1	ECDSA
-ed25519	-1	ssh_host_ed25519_key	1	ED25519
-rsa	0	ssh_host_rsa_key	2	RSA
+dsa	1024	ssh_host_dsa_key
+ecdsa	521	ssh_host_ecdsa_key
+ed25519	-1	ssh_host_ed25519_key
+rsa	0	ssh_host_rsa_key
 _EOF
 )
 }


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

2019-10-23 Thread Kamil Rytarowski
On 22.10.2019 14:09, Martin Husemann wrote:
> Module Name:  src
> Committed By: martin
> Date: Tue Oct 22 12:09:11 UTC 2019
> 
> Modified Files:
>   src/sys/dev/ic: wdc.c
> 
> Log Message:
> Fix channel locking - patch from Christos.
> 
> 

>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.292 2019/09/14 17:11:39 tsutsui Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.293 2019/10/22 12:09:11 martin Exp $");
>  
>  #include "opt_ata.h"
>  #include "opt_wdc.h"
> @@ -295,15 +295,16 @@ wdc_drvprobe(struct ata_channel *chp)
>   u_int8_t st0 = 0, st1 = 0;
>   int i, j, error, tfd;
>  
> + ata_channel_lock(chp);
>   if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0)

Missing ata_channel_unlock(chp)?

Noted by mjg@freebsd.

>   return;
>   if (wdcprobe1(chp, 0) == 0) {
>   /* No drives, abort the attach here. */
>   atabus_free_drives(chp);
> + ata_channel_unlock(chp);
>   return;
>   }
>  




signature.asc
Description: OpenPGP digital signature


CVS commit: src

2019-10-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Oct 23 07:01:12 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/sys/dev/nvmm: nvmm.c nvmm.h nvmm_internal.h nvmm_ioctl.h
src/sys/dev/nvmm/x86: nvmm_x86.h nvmm_x86_svm.c nvmm_x86_vmx.c
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.

 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.

 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().

 - Rename the following things for consistency:
   nvmm_exit*  -> nvmm_vcpu_exit*
   nvmm_event* -> nvmm_vcpu_event*
   NVMM_EXIT_* -> NVMM_VCPU_EXIT_*
   NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
   NVMM_EVENT_EXCEPTION-> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.

 - Slightly reorganize the MI/MD definitions, for internal clarity.

 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.

 - Change the types of several variables:
   event.type  enum -> u_int
   event.vectoruint64_t -> uint8_t
   exit.u.*msr.msr:uint64_t -> uint32_t
   exit.u.io.type: enum -> bool
   exit.u.io.seg:  int -> int8_t
   cap.arch.mxcsr_mask:uint64_t -> uint32_t
   cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t

 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.

 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.

 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.

 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
uint32_t mask:1;
uint32_t exit:1;
uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.12 -r1.13 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/nvmm/nvmm.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/nvmm/nvmm.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/nvmm/nvmm_internal.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/nvmm/nvmm_ioctl.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libnvmm/h_mem_assist.c

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



CVS commit: src

2019-10-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Oct 23 07:01:12 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.c libnvmm_x86.c nvmm.h
src/sys/dev/nvmm: nvmm.c nvmm.h nvmm_internal.h nvmm_ioctl.h
src/sys/dev/nvmm/x86: nvmm_x86.h nvmm_x86_svm.c nvmm_x86_vmx.c
src/tests/lib/libnvmm: h_io_assist.c h_mem_assist.c

Log Message:
Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.

 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.

 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().

 - Rename the following things for consistency:
   nvmm_exit*  -> nvmm_vcpu_exit*
   nvmm_event* -> nvmm_vcpu_event*
   NVMM_EXIT_* -> NVMM_VCPU_EXIT_*
   NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
   NVMM_EVENT_EXCEPTION-> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.

 - Slightly reorganize the MI/MD definitions, for internal clarity.

 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.

 - Change the types of several variables:
   event.type  enum -> u_int
   event.vectoruint64_t -> uint8_t
   exit.u.*msr.msr:uint64_t -> uint32_t
   exit.u.io.type: enum -> bool
   exit.u.io.seg:  int -> int8_t
   cap.arch.mxcsr_mask:uint64_t -> uint32_t
   cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t

 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.

 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.

 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.

 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
uint32_t mask:1;
uint32_t exit:1;
uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libnvmm/libnvmm.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.12 -r1.13 src/lib/libnvmm/nvmm.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/nvmm/nvmm.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/nvmm/nvmm.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/nvmm/nvmm_internal.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/nvmm/nvmm_ioctl.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libnvmm/h_io_assist.c
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libnvmm/h_mem_assist.c

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

Modified files:

Index: src/lib/libnvmm/libnvmm.c
diff -u src/lib/libnvmm/libnvmm.c:1.14 src/lib/libnvmm/libnvmm.c:1.15
--- src/lib/libnvmm/libnvmm.c:1.14	Sat Jun  8 07:27:44 2019
+++ src/lib/libnvmm/libnvmm.c	Wed Oct 23 07:01:11 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: libnvmm.c,v 1.14 2019/06/08 07:27:44 maxv Exp $	*/
+/*	$NetBSD: libnvmm.c,v 1.15 2019/10/23 07:01:11 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -161,7 +161,7 @@ nvmm_init(void)
 {
 	if (nvmm_fd != -1)
 		return 0;
-	nvmm_fd = open("/dev/nvmm", O_RDWR);
+	nvmm_fd = open("/dev/nvmm", O_RDONLY | O_CLOEXEC);
 	if (nvmm_fd == -1)
 		return -1;
 	if (nvmm_capability(&__capability) == -1) {
@@ -169,6 +169,13 @@ nvmm_init(void)
 		nvmm_fd = -1;
 		return -1;
 	}
+	if (__capability.version != NVMM_KERN_VERSION) {
+		close(nvmm_fd);
+		nvmm_fd = -1;
+		errno = EPROGMISMATCH;
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -322,6 +329,25 @@ nvmm_vcpu_destroy(struct nvmm_machine *m
 }
 
 int
+nvmm_vcpu_configure(struct nvmm_machine *mach, struct nvmm_vcpu *vcpu,
+uint64_t op, void *conf)
+{
+	struct nvmm_ioc_vcpu_configure args;
+	int ret;
+
+	args.machid = mach->machid;
+	args.cpuid = vcpu->cpuid;
+	args