CVS commit: src/usr.bin/ftp

2020-07-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jul 15 19:23:44 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Try to improve markup for better PostScript output.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/ftp/ftp.1

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

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.140 src/usr.bin/ftp/ftp.1:1.141
--- src/usr.bin/ftp/ftp.1:1.140	Wed Jul 15 17:36:38 2020
+++ src/usr.bin/ftp/ftp.1	Wed Jul 15 19:23:44 2020
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: ftp.1,v 1.140 2020/07/15 17:36:38 uwe Exp $
+.\" 	$NetBSD: ftp.1,v 1.141 2020/07/15 19:23:44 uwe Exp $
 .\"
 .\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -475,18 +475,16 @@ Toggle command line editing, and context
 completion.
 This is automatically enabled if input is from a terminal, and
 disabled otherwise.
-.It Ic epsv epsv4 epsv6
+.It Ic epsv , epsv4 , epsv6
 Toggle the use of the extended
 .Dv EPSV
 and
 .Dv EPRT
 commands on all IP, IPv4, and IPv6 connections respectively.
 First try
-.Dv EPSV /
-.Dv EPRT ,
+.Dv EPSV Ns \^/\^ Ns Dv EPRT ,
 and then
-.Dv PASV /
-.Dv PORT .
+.Dv PASV Ns \^/\^ Ns Dv PORT .
 This is enabled by default.
 If an extended command fails then this option will be temporarily
 disabled for the duration of the current connection, or until
@@ -589,7 +587,7 @@ Expansion of a directory name is likely 
 different from expansion of the name of an ordinary file:
 the exact result depends on the foreign operating system and ftp server,
 and can be previewed by doing
-.Ql mls remote-files \-
+.Sq Li mls remote-files \- .
 Note:
 .Ic mget ,
 .Ic mput
@@ -670,32 +668,32 @@ To invoke a macro, use the
 command (see above).
 .Pp
 The macro processor interprets
-.Sq $
+.Ql $
 and
-.Sq \e
+.Ql \e
 as special characters.
 A
-.Sq $
+.Ql $
 followed by a number (or numbers) is replaced by the
 corresponding argument on the macro invocation command line.
 A
-.Sq $
+.Ql $
 followed by an
-.Sq i
+.Ql i
 signals the macro processor that the executing macro is to be
 looped.
 On the first pass
-.Dq $i
+.Ql $i
 is replaced by the first argument on the macro invocation command
 line, on the second pass it is replaced by the second argument,
 and so on.
 A
-.Sq \e
+.Ql \e
 followed by any character is replaced by that character.
 Use the
-.Sq \e
+.Ql \e
 to prevent special treatment of the
-.Sq $ .
+.Ql $ .
 .It Ic mdelete Op Ar remote-files
 Delete the
 .Ar remote-files
@@ -730,7 +728,7 @@ Files are transferred into the local wor
 which can be changed with
 .Ql lcd directory ;
 new local directories can be created with
-.Ql "\&! mkdir directory" .
+.Sq Li "\&! mkdir directory" .
 .It Ic mkdir Ar directory-name
 Make a directory on the remote machine.
 .It Ic mls Ar remote-files local-file
@@ -753,7 +751,7 @@ Display the contents of
 in a machine-parsable form, using
 .Dv MLSD .
 The format of display can be changed with
-.Sq "remopts mlst ..." .
+.Sq Li "remopts mlst ..." .
 .It Ic mlst Op Ar remote-path
 Display the details about
 .Ar remote-path
@@ -761,7 +759,7 @@ Display the details about
 in a machine-parsable form, using
 .Dv MLST .
 The format of display can be changed with
-.Sq "remopts mlst ..." .
+.Sq Li "remopts mlst ..." .
 .It Ic mode Ar mode-name
 Set the file transfer
 .Ic mode
@@ -807,7 +805,7 @@ If the file does not
 exist on the current system, the remote file is considered
 .Ic newer .
 Otherwise, this command is identical to
-.Ar get .
+.Ic get .
 .It Ic nlist Op Ar remote-path Op Ar local-file
 A synonym for
 .Ic ls .
@@ -832,7 +830,8 @@ The mapping follows the pattern set by
 .Ar inpattern
 and
 .Ar outpattern .
-.Op Ar Inpattern
+.Pp
+.Ar inpattern
 is a template for incoming filenames (which may have already been
 processed according to the
 .Ic ntrans
@@ -841,16 +840,16 @@ and
 settings).
 Variable templating is accomplished by including the
 sequences
-.Dq $1 ,
-.Dq $2 ,
-\&...
-.Dq $9
+.Ql $1 ,
+.Ql $2 ,
+\&...\|,
+.Ql $9
 in
 .Ar inpattern .
 Use
-.Sq \e
+.Ql \e
 to prevent this special treatment of the
-.Sq $
+.Ql $
 character.
 All other characters are treated literally, and are used to determine the
 .Ic nmap
@@ -858,53 +857,72 @@ All other characters are treated literal
 variable values.
 For example, given
 .Ar inpattern
-$1.$2 and the remote file name "mydata.data", $1 would have the value
-"mydata", and $2 would have the value "data".
+.Sq Li $1.$2
+and the remote file name
+.Sq Li mydata.data ,
+.Ql $1
+would have the value
+.Sq Li mydata ,
+and
+.Ql $2
+would have the value
+.Sq Li data .
+.Pp
 The
 .Ar outpattern
 determines the resulting mapped filename.
 The sequences
-.Dq $1 ,
-.Dq $2 ,
-\&...
-.Dq $9
+.Ql $1 ,
+.Ql $2 ,
+\&...\|,
+.Ql $9
 are replaced by any value resulting from the
 .Ar inpattern
 template.
 The sequence
-.Dq $0
+.Ql $0
 is replaced by the original filename.
 

CVS commit: src/usr.bin/ftp

2020-07-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jul 15 19:23:44 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Try to improve markup for better PostScript output.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/ftp/ftp.1

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



CVS commit: src/share/man/man5

2020-07-15 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Jul 15 17:46:06 UTC 2020

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
MKBSDTAR is yes by default


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/share/man/man5/mk.conf.5

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

Modified files:

Index: src/share/man/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.79 src/share/man/man5/mk.conf.5:1.80
--- src/share/man/man5/mk.conf.5:1.79	Mon Sep 16 12:57:10 2019
+++ src/share/man/man5/mk.conf.5	Wed Jul 15 17:46:06 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mk.conf.5,v 1.79 2019/09/16 12:57:10 gson Exp $
+.\"	$NetBSD: mk.conf.5,v 1.80 2020/07/15 17:46:06 leot Exp $
 .\"
 .\"  Copyright (c) 1999-2003 The NetBSD Foundation, Inc.
 .\"  All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 16, 2019
+.Dd July 15, 2020
 .Dt MK.CONF 5
 .Os
 .\" turn off hyphenation
@@ -256,7 +256,7 @@ If
 .Dq no ,
 .Xr pax 1
 based frontends are used.
-.DFLTn
+.DFLTy
 .
 .It Sy MKCATPAGES
 .YorN



CVS commit: src/share/man/man5

2020-07-15 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Jul 15 17:46:06 UTC 2020

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
MKBSDTAR is yes by default


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/share/man/man5/mk.conf.5

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



CVS commit: src/share/man/man5

2020-07-15 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Jul 15 17:55:34 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
Document unbound and unbound_chrootdir.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/share/man/man5/rc.conf.5

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

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.184 src/share/man/man5/rc.conf.5:1.185
--- src/share/man/man5/rc.conf.5:1.184	Wed Jul 15 16:52:48 2020
+++ src/share/man/man5/rc.conf.5	Wed Jul 15 17:55:34 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.184 2020/07/15 16:52:48 jruoho Exp $
+.\"	$NetBSD: rc.conf.5,v 1.185 2020/07/15 17:55:34 leot Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -1184,6 +1184,19 @@ only one machine running both should hav
 .Fl M
 flag given to
 .Xr timed 8 .
+.It Sy unbound
+Boolean value.
+Runs
+.Xr unbound 8 .
+.It Sy unbound_chrootdir
+A string.
+If non-blank and
+.Sy unbound
+is true, run
+.Xr unbound 8
+.Xr chroot 2 Ns ed
+to
+.Sy unbound_chrootdir .
 .El
 .Ss Routing daemons
 .Bl -tag -width net_interfaces



CVS commit: src/share/man/man5

2020-07-15 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Jul 15 17:55:34 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
Document unbound and unbound_chrootdir.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/share/man/man5/rc.conf.5

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:25:08 UTC 2020

Modified Files:
src/sys/arch/x86/conf [netbsd-9]: files.x86
src/sys/arch/x86/include [netbsd-9]: apicvar.h cpu.h
src/sys/arch/x86/x86 [netbsd-9]: cpu.c hyperv.c tsc.c
src/sys/arch/xen/conf [netbsd-9]: files.xen

Log Message:
Pull up the following, requested by msaitoh in ticket #1015

sys/arch/x86/conf/files.x86 1.108 (via patch)
sys/arch/x86/include/apicvar.h  1.7 (via patch)
sys/arch/x86/include/cpu.h  1.121 (via patch)
sys/arch/x86/x86/cpu.c  1.185 (via patch)
sys/arch/x86/x86/hyperv.c   1.7 (via patch)
sys/arch/x86/x86/tsc.c  1.41 (via patch)
sys/arch/xen/conf/files.xen 1.181 (via patch)

Get TSC frequency from CPUID 0x15 and/or x16 if it's available.
This change fixes a problem that newer Intel processors' timer
counts very slowly.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/x86/include/apicvar.h
cvs rdiff -u -r1.107 -r1.107.2.1 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.171.2.1 -r1.171.2.2 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.4.4.1 -r1.4.4.2 src/sys/arch/x86/x86/hyperv.c
cvs rdiff -u -r1.37.8.1 -r1.37.8.2 src/sys/arch/x86/x86/tsc.c
cvs rdiff -u -r1.178 -r1.178.4.1 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.107 src/sys/arch/x86/conf/files.x86:1.107.4.1
--- src/sys/arch/x86/conf/files.x86:1.107	Fri Feb 15 08:54:01 2019
+++ src/sys/arch/x86/conf/files.x86	Wed Jul 15 17:25:08 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.107 2019/02/15 08:54:01 nonaka Exp $
+#	$NetBSD: files.x86,v 1.107.4.1 2020/07/15 17:25:08 martin Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI
@@ -91,6 +91,7 @@ file	arch/x86/x86/efi.c		machdep
 file	arch/x86/x86/errata.c		machdep
 file	arch/x86/x86/genfb_machdep.c	machdep
 file	arch/x86/x86/identcpu.c		machdep
+file	arch/x86/x86/identcpu_subr.c	machdep
 file	arch/x86/x86/i8259.c		machdep
 file	arch/x86/x86/intr.c		machdep
 file	arch/x86/x86/kgdb_machdep.c	kgdb

Index: src/sys/arch/x86/include/apicvar.h
diff -u src/sys/arch/x86/include/apicvar.h:1.6 src/sys/arch/x86/include/apicvar.h:1.6.2.1
--- src/sys/arch/x86/include/apicvar.h:1.6	Fri Jun 14 09:23:42 2019
+++ src/sys/arch/x86/include/apicvar.h	Wed Jul 15 17:25:08 2020
@@ -1,4 +1,4 @@
-/* 	$NetBSD: apicvar.h,v 1.6 2019/06/14 09:23:42 msaitoh Exp $ */
+/* 	$NetBSD: apicvar.h,v 1.6.2.1 2020/07/15 17:25:08 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -54,4 +54,7 @@ struct apic_attach_args {
 void apic_format_redir(const char *, const char *, int, int, uint32_t,
 uint32_t);
 
+/* For lapic.c */
+extern uint32_t lapic_per_second;
+
 #endif /* !_X86_APICVAR_H_ */

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.107 src/sys/arch/x86/include/cpu.h:1.107.2.1
--- src/sys/arch/x86/include/cpu.h:1.107	Wed Jun 26 12:29:00 2019
+++ src/sys/arch/x86/include/cpu.h	Wed Jul 15 17:25:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.107 2019/06/26 12:29:00 mgorny Exp $	*/
+/*	$NetBSD: cpu.h,v 1.107.2.1 2020/07/15 17:25:08 martin Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -483,6 +483,9 @@ void 	cpu_probe(struct cpu_info *);
 void	cpu_identify(struct cpu_info *);
 void	identify_hypervisor(void);
 
+/* identcpu_subr.c */
+uint64_t cpu_tsc_freq_cpuid(struct cpu_info *);
+
 typedef enum vm_guest {
 	VM_GUEST_NO = 0,
 	VM_GUEST_VM,

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.171.2.1 src/sys/arch/x86/x86/cpu.c:1.171.2.2
--- src/sys/arch/x86/x86/cpu.c:1.171.2.1	Tue Jan 21 11:36:36 2020
+++ src/sys/arch/x86/x86/cpu.c	Wed Jul 15 17:25:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.171.2.1 2020/01/21 11:36:36 martin Exp $	*/
+/*	$NetBSD: cpu.c,v 1.171.2.2 2020/07/15 17:25:08 martin Exp $	*/
 
 /*
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.171.2.1 2020/01/21 11:36:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.171.2.2 2020/07/15 17:25:08 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -1261,12 +1261,20 @@ cpu_shutdown(device_t dv, int how)
 	return cpu_stop(dv);
 }
 
+/* Get the TSC frequency and set it to ci->ci_data.cpu_cc_freq. */
 void
 cpu_get_tsc_freq(struct cpu_info *ci)
 {
-	uint64_t last_tsc;
+	uint64_t freq = 0, last_tsc;
 
-	if (cpu_hascounter()) {
+	if (cpu_hascounter())
+		freq = 

CVS commit: src/usr.bin/ftp

2020-07-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jul 15 17:36:38 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Do not use "[...]", just "..." is enough.

Conventionally the ellipsis already expresses optional repetition,
e.g. .Ar without arguments produces "file ...".


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/ftp/ftp.1

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

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.139 src/usr.bin/ftp/ftp.1:1.140
--- src/usr.bin/ftp/ftp.1:1.139	Wed Jul 15 16:41:16 2020
+++ src/usr.bin/ftp/ftp.1	Wed Jul 15 17:36:38 2020
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: ftp.1,v 1.139 2020/07/15 16:41:16 pgoyette Exp $
+.\" 	$NetBSD: ftp.1,v 1.140 2020/07/15 17:36:38 uwe Exp $
 .\"
 .\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -138,12 +138,11 @@
 .Oc
 .Sm on
 .Ek
-.Op Ar \&.\&.\&.
+.Ar \&...
 .Nm
 .Bk -words
-.Fl u Ar url Ar file
+.Fl u Ar url Ar
 .Ek
-.Op Ar \&.\&.\&.
 .Sh DESCRIPTION
 .Nm
 is the user interface to the Internet standard File Transfer Protocol.
@@ -283,7 +282,7 @@ bytes/second.
 Refer to
 .Ic rate
 for more information.
-.It Fl u Ar url file Op \&.\&.\&.
+.It Fl u Ar url Ar
 Upload files on the command line to
 .Ar url
 where



CVS commit: src/usr.bin/ftp

2020-07-15 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jul 15 17:36:38 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Do not use "[...]", just "..." is enough.

Conventionally the ellipsis already expresses optional repetition,
e.g. .Ar without arguments produces "file ...".


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/ftp/ftp.1

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:27:25 UTC 2020

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

Log Message:
Tickets #1014 and #1015


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.1

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.78 src/doc/CHANGES-9.1:1.1.2.79
--- src/doc/CHANGES-9.1:1.1.2.78	Wed Jul 15 15:52:24 2020
+++ src/doc/CHANGES-9.1	Wed Jul 15 17:27:25 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.78 2020/07/15 15:52:24 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.79 2020/07/15 17:27:25 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -3424,3 +3424,24 @@ sys/arch/i386/stand/boot/boot2.c		1.74
 	PR 55490: let the consdev command also set speed.
 	[kim, ticket #1013]
 
+sys/dev/pci/if_ti.c1.116-1.120 via patch
+sys/dev/pci/if_tireg.h1.26
+
+	- Don't clear CFI and priority bit to pass them to the upper layer.
+	- Add support for Farallon PN9000SX from FreeBSD.
+	- Fix typo in comment.
+	- Style fix.
+	[msaitoh, ticket #1014]
+
+sys/arch/x86/conf/files.x86			1.108 (via patch)
+sys/arch/x86/include/apicvar.h			1.7 (via patch)
+sys/arch/x86/include/cpu.h			1.121 (via patch)
+sys/arch/x86/x86/cpu.c1.185 (via patch)
+sys/arch/x86/x86/hyperv.c			1.7 (via patch)
+sys/arch/x86/x86/tsc.c1.41 (via patch)
+sys/arch/xen/conf/files.xen			1.181 (via patch)
+
+	Get TSC frequency from CPUID 0x15 and/or x16 if it's available.
+	This change fixes a problem that newer Intel processors' timer
+	counts very slowly.
+	[msaitoh, ticket #1015]



CVS commit: [netbsd-9] src/doc

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:27:25 UTC 2020

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

Log Message:
Tickets #1014 and #1015


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.1

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:25:08 UTC 2020

Modified Files:
src/sys/arch/x86/conf [netbsd-9]: files.x86
src/sys/arch/x86/include [netbsd-9]: apicvar.h cpu.h
src/sys/arch/x86/x86 [netbsd-9]: cpu.c hyperv.c tsc.c
src/sys/arch/xen/conf [netbsd-9]: files.xen

Log Message:
Pull up the following, requested by msaitoh in ticket #1015

sys/arch/x86/conf/files.x86 1.108 (via patch)
sys/arch/x86/include/apicvar.h  1.7 (via patch)
sys/arch/x86/include/cpu.h  1.121 (via patch)
sys/arch/x86/x86/cpu.c  1.185 (via patch)
sys/arch/x86/x86/hyperv.c   1.7 (via patch)
sys/arch/x86/x86/tsc.c  1.41 (via patch)
sys/arch/xen/conf/files.xen 1.181 (via patch)

Get TSC frequency from CPUID 0x15 and/or x16 if it's available.
This change fixes a problem that newer Intel processors' timer
counts very slowly.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/x86/include/apicvar.h
cvs rdiff -u -r1.107 -r1.107.2.1 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.171.2.1 -r1.171.2.2 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.4.4.1 -r1.4.4.2 src/sys/arch/x86/x86/hyperv.c
cvs rdiff -u -r1.37.8.1 -r1.37.8.2 src/sys/arch/x86/x86/tsc.c
cvs rdiff -u -r1.178 -r1.178.4.1 src/sys/arch/xen/conf/files.xen

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:47:27 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_div.c

Log Message:
Do not raise divide-by-zero exception when dividend is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/fpu/fpu_div.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_div.c
diff -u src/sys/arch/powerpc/fpu/fpu_div.c:1.5 src/sys/arch/powerpc/fpu/fpu_div.c:1.6
--- src/sys/arch/powerpc/fpu/fpu_div.c:1.5	Sat Jun 27 03:07:57 2020
+++ src/sys/arch/powerpc/fpu/fpu_div.c	Wed Jul 15 07:47:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_div.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
+/*	$NetBSD: fpu_div.c,v 1.6 2020/07/15 07:47:27 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.6 2020/07/15 07:47:27 rin Exp $");
 
 #include 
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -200,7 +200,6 @@ fpu_div(struct fpemu *fe)
 		return (x);
 	}
 	if (ISZERO(x)) {
-		fe->fe_cx |= FPSCR_ZX;
 		if (x->fp_class == y->fp_class) {
 			fe->fe_cx |= FPSCR_VXZDZ;
 			return (fpu_newnan(fe));



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:47:27 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_div.c

Log Message:
Do not raise divide-by-zero exception when dividend is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/fpu/fpu_div.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:44:34 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not use curlwp twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.32 src/sys/arch/powerpc/booke/trap.c:1.33
--- src/sys/arch/powerpc/booke/trap.c:1.32	Tue Jul  7 00:49:09 2020
+++ src/sys/arch/powerpc/booke/trap.c	Wed Jul 15 07:44:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -477,10 +477,12 @@ pgm_exception(struct trapframe *tf, ksig
 	}
 
 	if (tf->tf_esr & ESR_PIL) {
-		struct pcb * const pcb = lwp_getpcb(curlwp);
-		if (__predict_false(!fpu_used_p(curlwp))) {
+		struct lwp * const l = curlwp;
+		struct pcb * const pcb = lwp_getpcb(l);
+
+		if (__predict_false(!fpu_used_p(l))) {
 			memset(>pcb_fpu, 0, sizeof(pcb->pcb_fpu));
-			fpu_mark_used(curlwp);
+			fpu_mark_used(l);
 		}
 		if (fpu_emulate(tf, >pcb_fpu, ksi)) {
 			if (ksi->ksi_signo == 0) {



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:44:34 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not use curlwp twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/trap.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:37:25 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Remove old workaround foe cache problem on ibm4xx.
The problem seems gone already.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.24 src/sys/arch/powerpc/fpu/fpu_emu.c:1.25
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.24	Mon Jul  6 10:31:23 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 07:37:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.24 2020/07/06 10:31:23 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.25 2020/07/15 07:37:25 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,11 +76,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.24 2020/07/06 10:31:23 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.25 2020/07/15 07:37:25 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
-#include "opt_ppcarch.h"
 #endif
 
 #include 
@@ -260,17 +259,6 @@ fpu_emulate(struct trapframe *tf, struct
 			opc_disasm((vaddr_t)(tf->tf_srr0), insn.i_int);
 		}
 #endif
-#if defined(PPC_IBM4XX) && defined(DDB) && defined(DEBUG)
-		/*
-		*  retry an illegal insn once due to cache issues.
-		*/
-		static int lastill = 0;
-		if (lastill == tf->tf_srr0) {
-			if (fpe_debug & FPE_EX)
-Debugger();
-		}
-		lastill = tf->tf_srr0;
-#endif /* PPC_IBM4XX && DDB && DEBUG */
 		return false;
 	}
 }



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:37:25 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Remove old workaround foe cache problem on ibm4xx.
The problem seems gone already.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:52:58 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Do not set ksi->ksi_addr twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:14:41 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto: ppccap.c

Log Message:
PR port-powerpc/55425

Update comment; FPU emulation seems to work just fine now. However,
FPU-optimized code should still be avoided for better performance,
if FPU is not present.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/openssl/dist/crypto/ppccap.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/ppccap.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.16 src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.17
--- src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.16	Tue Jul  7 01:47:47 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/ppccap.c	Wed Jul 15 08:14:41 2020
@@ -375,8 +375,7 @@ void OPENSSL_cpuid_setup(void)
 
 /*
  * If machdep.fpu_present == 0, FPU is absent and emulated by software.
- * Avoid using it as calculation results may not be correct in bit-to-bit
- * precision.
+ * Avoid using it for better performance.
  */
 error = sysctlbyname("machdep.fpu_present", , , NULL, 0);
 if (error != 0 || (error == 0 && val != 0))



CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:58:52 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: cpu.h instr.h
src/sys/arch/powerpc/powerpc: powerpc_machdep.c trap.c

Log Message:
Factor out emulation code for m[ft]msr in user mode from oea, and
adjust it for systems without FPU.

Now, it can be used from booke and ibm4xx in order to support fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/instr.h
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/powerpc/powerpc/powerpc_machdep.c
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/powerpc/powerpc/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.114 src/sys/arch/powerpc/include/cpu.h:1.115
--- src/sys/arch/powerpc/include/cpu.h:1.114	Tue Jul  7 01:39:23 2020
+++ src/sys/arch/powerpc/include/cpu.h	Wed Jul 15 08:58:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.114 2020/07/07 01:39:23 rin Exp $	*/
+/*	$NetBSD: cpu.h,v 1.115 2020/07/15 08:58:51 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -391,6 +391,8 @@ void	icache_inv(vaddr_t, vsize_t);
 void *	mapiodev(paddr_t, psize_t, bool);
 void	unmapiodev(vaddr_t, vsize_t);
 
+int	emulate_mxmsr(struct lwp *, struct trapframe *, uint32_t);
+
 #ifdef MULTIPROCESSOR
 int	md_setup_trampoline(volatile struct cpu_hatch_data *,
 	struct cpu_info *);

Index: src/sys/arch/powerpc/include/instr.h
diff -u src/sys/arch/powerpc/include/instr.h:1.8 src/sys/arch/powerpc/include/instr.h:1.9
--- src/sys/arch/powerpc/include/instr.h:1.8	Mon Feb 27 06:54:00 2017
+++ src/sys/arch/powerpc/include/instr.h	Wed Jul 15 08:58:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.h,v 1.8 2017/02/27 06:54:00 chs Exp $ */
+/*	$NetBSD: instr.h,v 1.9 2020/07/15 08:58:51 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -405,12 +405,6 @@ union instr {
 #define	OPC_MFSPR_REG(o)	(((o) >> 21) & 0x1f)
 #define	OPC_MFSPR_P(o, spr)	(((o) & OPC_MFSPR_MASK) == OPC_MFSPR(spr))
 
-#define	OPC_MFMSR_CODE		0x7ca6
-#define	OPC_MFMSR_MASK		0xfc1f
-#define	OPC_MFMSR		OPC_MFMSR_CODE
-#define	OPC_MFMSR_REG(o)	(((o) >> 21) & 0x1f)
-#define	OPC_MFMSR_P(o)		(((o) & OPC_MFMSR_MASK) == OPC_MFMSR_CODE)
-
 /*
  * booke doesn't have lwsync even though gcc emits it so we have to emulate it.
  */

Index: src/sys/arch/powerpc/powerpc/powerpc_machdep.c
diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.79 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.80
--- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.79	Tue Jul  7 01:39:23 2020
+++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c	Wed Jul 15 08:58:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerpc_machdep.c,v 1.79 2020/07/07 01:39:23 rin Exp $	*/
+/*	$NetBSD: powerpc_machdep.c,v 1.80 2020/07/15 08:58:52 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.79 2020/07/07 01:39:23 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.80 2020/07/15 08:58:52 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -738,6 +738,82 @@ cpu_debug_dump(void)
 #endif	/* DDB */
 #endif /* MULTIPROCESSOR */
 
+int
+emulate_mxmsr(struct lwp *l, struct trapframe *tf, uint32_t opcode)
+{
+
+#define	OPC_MFMSR_CODE		0x7ca6
+#define	OPC_MFMSR_MASK		0xfc1f
+#define	OPC_MFMSR_P(o)		(((o) & OPC_MFMSR_MASK) == OPC_MFMSR_CODE)
+
+#define	OPC_MTMSR_CODE		0x7c000124
+#define	OPC_MTMSR_MASK		0xfc1f
+#define	OPC_MTMSR_P(o)		(((o) & OPC_MTMSR_MASK) == OPC_MTMSR_CODE)
+
+#define	OPC_MXMSR_REG(o)	(((o) >> 21) & 0x1f)
+
+	if (OPC_MFMSR_P(opcode)) {
+		struct pcb * const pcb = lwp_getpcb(l);
+		register_t msr = tf->tf_srr1 & PSL_USERSRR1;
+
+		if (fpu_used_p(l))
+			msr |= PSL_FP;
+#ifdef ALTIVEC
+		if (vec_used_p(l))
+			msr |= PSL_VEC;
+#endif
+
+		msr |= (pcb->pcb_flags & PSL_FE_PREC);
+		tf->tf_fixreg[OPC_MXMSR_REG(opcode)] = msr;
+		return 1;
+	}
+
+	if (OPC_MTMSR_P(opcode)) {
+		struct pcb * const pcb = lwp_getpcb(l);
+		register_t msr = tf->tf_fixreg[OPC_MXMSR_REG(opcode)];
+
+		/*
+		 * Ignore the FP enable bit in the requested MSR.
+		 * It might be set in the thread's actual MSR but the
+		 * user code isn't allowed to change it.
+		 */
+		msr &= ~PSL_FP;
+#ifdef ALTIVEC
+		msr &= ~PSL_VEC;
+#endif
+
+		/*
+		 * Don't let the user muck with bits he's not allowed to.
+		 */
+#ifdef PPC_HAVE_FPU
+		if (!PSL_USEROK_P(msr))
+#else
+		if (!PSL_USEROK_P(msr & ~PSL_FE_PREC))
+#endif
+			return 0;
+
+		/*
+		 * For now, only update the FP exception mode.
+		 */
+		pcb->pcb_flags &= ~PSL_FE_PREC;
+		pcb->pcb_flags |= msr & PSL_FE_PREC;
+
+#ifdef PPC_HAVE_FPU
+		/*
+		 * If we think we have the FPU, update SRR1 too.  If we're
+		 * wrong userret() will take care of it.
+		 */
+		if 

CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:58:52 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: cpu.h instr.h
src/sys/arch/powerpc/powerpc: powerpc_machdep.c trap.c

Log Message:
Factor out emulation code for m[ft]msr in user mode from oea, and
adjust it for systems without FPU.

Now, it can be used from booke and ibm4xx in order to support fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/instr.h
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/powerpc/powerpc/powerpc_machdep.c
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/powerpc/powerpc/trap.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:16:35 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Do not raise SIGFPE unless MSR[FE0] or MSR[FE1] is set via fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.29 src/sys/arch/powerpc/fpu/fpu_emu.c:1.30
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.29	Wed Jul 15 08:29:07 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 09:16:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.29 2020/07/15 08:29:07 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.30 2020/07/15 09:16:35 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.29 2020/07/15 08:29:07 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.30 2020/07/15 09:16:35 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -92,6 +92,8 @@ __KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 
 #include 
 
 #include 
+#include 
+
 #include 
 #include 
 #include 
@@ -191,6 +193,7 @@ fpu_dumpfpn(struct fpn *fp)
 bool
 fpu_emulate(struct trapframe *tf, struct fpreg *fpf, ksiginfo_t *ksi)
 {
+	struct pcb *pcb;
 	union instr insn;
 	struct fpemu fe;
 
@@ -229,11 +232,15 @@ fpu_emulate(struct trapframe *tf, struct
 	}
 	switch (fpu_execute(tf, , )) {
 	case 0:
+success:
 		DPRINTF(FPE_EX, ("fpu_emulate: success\n"));
 		tf->tf_srr0 += 4;
 		return true;
 
 	case FPE:
+		pcb = lwp_getpcb(curlwp);
+		if ((pcb->pcb_flags & PSL_FE_PREC) == 0)
+			goto success;
 		DPRINTF(FPE_EX, ("fpu_emulate: SIGFPE\n"));
 		ksi->ksi_signo = SIGFPE;
 		ksi->ksi_trap = EXC_PGM;



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:16:35 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Do not raise SIGFPE unless MSR[FE0] or MSR[FE1] is set via fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:54:25 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
For trap instruction, ksi_code should be TRAP_BRKPT not TRAP_TRACE.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:10:41 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
PR port-powerpc/55425

Fix emulation for mtfsf; source register is frB here.

Now, userland processes successfully change rounding mode, by which
FPU-optimized code in OpenSSL works just fine as far as I can see.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.27 src/sys/arch/powerpc/fpu/fpu_emu.c:1.28
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.27	Wed Jul 15 07:54:25 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 08:10:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.27 2020/07/15 07:54:25 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.28 2020/07/15 08:10:41 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.27 2020/07/15 07:54:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.28 2020/07/15 08:10:41 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -586,7 +586,7 @@ fpu_execute(struct trapframe *tf, struct
 		if (rt & (1fpreg[rb];
 fe->fe_cx = mask & a[1];
 fe->fe_fpscr = (fe->fe_fpscr&~mask) | 
 	(fe->fe_cx);



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:10:41 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
PR port-powerpc/55425

Fix emulation for mtfsf; source register is frB here.

Now, userland processes successfully change rounding mode, by which
FPU-optimized code in OpenSSL works just fine as far as I can see.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:14:41 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto: ppccap.c

Log Message:
PR port-powerpc/55425

Update comment; FPU emulation seems to work just fine now. However,
FPU-optimized code should still be avoided for better performance,
if FPU is not present.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/openssl/dist/crypto/ppccap.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:36:35 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Try to fix FPSCR bits in the end of emulation:

- FPSCR[FEX] is not a sticky bit.
- Turn on FPSCR[FEX] if the emulated instruction causes invalid operation,
  and invalid operation exception is not masked out.
- FPSCR[VX] is not a sticky bit, however it should be set when at least
  one of FPSCR[VXfoo] bits (they are sticky!) is set.
- FPSCR[FX] is a sticky bit, and it should be set if FPSCR is modified by
  instructions other than mtfsf{,i}.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:36:35 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Try to fix FPSCR bits in the end of emulation:

- FPSCR[FEX] is not a sticky bit.
- Turn on FPSCR[FEX] if the emulated instruction causes invalid operation,
  and invalid operation exception is not masked out.
- FPSCR[VX] is not a sticky bit, however it should be set when at least
  one of FPSCR[VXfoo] bits (they are sticky!) is set.
- FPSCR[FX] is a sticky bit, and it should be set if FPSCR is modified by
  instructions other than mtfsf{,i}.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.31 src/sys/arch/powerpc/fpu/fpu_emu.c:1.32
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.31	Wed Jul 15 09:22:26 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 09:36:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.31 2020/07/15 09:22:26 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.32 2020/07/15 09:36:35 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.31 2020/07/15 09:22:26 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.32 2020/07/15 09:36:35 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -147,7 +147,9 @@ FPU_EMU_EVCNT_DECL(fnmadd);
 			FPSCR_VXZDZ|FPSCR_VXIMZ|FPSCR_VXVC|FPSCR_VXSOFT|\
 			FPSCR_VXSQRT|FPSCR_VXCVI)
 #define	FPSR_EX		(FPSCR_VE|FPSCR_OE|FPSCR_UE|FPSCR_ZE|FPSCR_XE)
-#define	FPSR_EXOP	(FPSR_EX_MSK&(~FPSR_EX))
+#define	FPSR_INV	(FPSCR_VXSNAN|FPSCR_VXISI|FPSCR_VXIDI|		\
+			FPSCR_VXZDZ|FPSCR_VXIMZ|FPSCR_VXVC|FPSCR_VXSOFT|\
+			FPSCR_VXSQRT|FPSCR_VXCVI)
 
 
 int fpe_debug = 0;
@@ -287,6 +289,7 @@ fpu_execute(struct trapframe *tf, struct
 	int ra, rb, rc, rt, type, mask, fsr, cx, bf, setcr;
 	unsigned int cond;
 	struct fpreg *fs;
+	int mtfsf = 0;
 
 	/* Setup work. */
 	fp = NULL;
@@ -550,6 +553,7 @@ fpu_execute(struct trapframe *tf, struct
 	sizeof(double));
 break;
 			case	OPC63_MTFSFI:
+mtfsf = 1;
 FPU_EMU_EVCNT_INCR(mtfsfi);
 DPRINTF(FPE_INSN, ("fpu_execute: MTFSFI\n"));
 rb >>= 1;
@@ -585,6 +589,7 @@ fpu_execute(struct trapframe *tf, struct
 	sizeof(fs->fpscr));
 break;
 			case	OPC63_MTFSF:
+mtfsf = 1;
 FPU_EMU_EVCNT_INCR(mtfsf);
 DPRINTF(FPE_INSN, ("fpu_execute: MTFSF\n"));
 if ((rt = instr.i_xfl.i_flm) == -1)
@@ -769,11 +774,10 @@ fpu_execute(struct trapframe *tf, struct
 	if (fp)
 		fpu_implode(fe, fp, type, (u_int *)>fpreg[rt]);
 	cx = fe->fe_cx;
-	fsr = fe->fe_fpscr;
+	fsr = fe->fe_fpscr & ~(FPSCR_FEX|FPSCR_VX);
 	if (cx != 0) {
-		fsr &= ~FPSCR_FX;
-		if ((cx^fsr)_EX_MSK)
-			fsr |= FPSCR_FX;
+		if (cx & FPSR_INV)
+			cx |= FPSCR_VX;
 		mask = fsr & FPSR_EX;
 		mask <<= (25-3);
 		if (cx & mask) 
@@ -782,11 +786,13 @@ fpu_execute(struct trapframe *tf, struct
 			/* Need to replace CC */
 			fsr &= ~FPSCR_FPRF;
 		}
-		if (cx & (FPSR_EXOP))
-			fsr |= FPSCR_VX;
 		fsr |= cx;
 		DPRINTF(FPE_INSN, ("fpu_execute: cx %x, fsr %x\n", cx, fsr));
 	}
+	if (fsr & FPSR_INV)
+		fsr |= FPSCR_VX;
+	if (mtfsf == 0 && ((fsr ^ fe->fe_fpscr) & FPSR_EX_MSK))
+		fsr |= FPSCR_FX;
 
 	if (cond) {
 		cond = fsr & 0xf000;



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:58:34 UTC 2020

Modified Files:
src/sys/arch/macppc/macppc: pic_u3_ht.c

Log Message:
Add NetBSD RCSID. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/macppc/macppc/pic_u3_ht.c

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

Modified files:

Index: src/sys/arch/macppc/macppc/pic_u3_ht.c
diff -u src/sys/arch/macppc/macppc/pic_u3_ht.c:1.8 src/sys/arch/macppc/macppc/pic_u3_ht.c:1.9
--- src/sys/arch/macppc/macppc/pic_u3_ht.c:1.8	Sun Jul 12 23:58:30 2020
+++ src/sys/arch/macppc/macppc/pic_u3_ht.c	Wed Jul 15 09:58:34 2020
@@ -1,3 +1,4 @@
+/*	$NetBSD: pic_u3_ht.c,v 1.9 2020/07/15 09:58:34 rin Exp $	*/
 /*-
  * Copyright (c) 2013 Phileas Fogg
  * All rights reserved.
@@ -25,6 +26,7 @@
  */
 
 #include 
+__KERNEL_RCSID(0, "$NetBSD: pic_u3_ht.c,v 1.9 2020/07/15 09:58:34 rin Exp $");
 
 #include "opt_openpic.h"
 #include "opt_interrupt.h"



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:58:34 UTC 2020

Modified Files:
src/sys/arch/macppc/macppc: pic_u3_ht.c

Log Message:
Add NetBSD RCSID. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/macppc/macppc/pic_u3_ht.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:58:26 UTC 2020

Modified Files:
src/sys/arch/powerpc/powerpc: trap.c

Log Message:
Rename emulated_opcode() to emulate_privileged() for clarity.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/powerpc/powerpc/trap.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:58:26 UTC 2020

Modified Files:
src/sys/arch/powerpc/powerpc: trap.c

Log Message:
Rename emulated_opcode() to emulate_privileged() for clarity.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/powerpc/powerpc/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.161 src/sys/arch/powerpc/powerpc/trap.c:1.162
--- src/sys/arch/powerpc/powerpc/trap.c:1.161	Mon Jul  6 11:24:57 2020
+++ src/sys/arch/powerpc/powerpc/trap.c	Wed Jul 15 07:58:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.161 2020/07/06 11:24:57 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.162 2020/07/15 07:58:26 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -35,7 +35,7 @@
 #define	__UCAS_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.161 2020/07/06 11:24:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.162 2020/07/15 07:58:26 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -69,7 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 #include 
 #include 
 
-static int emulated_opcode(struct lwp *, struct trapframe *);
+static int emulate_privileged(struct lwp *, struct trapframe *);
 static int fix_unaligned(struct lwp *, struct trapframe *);
 static inline vaddr_t setusr(vaddr_t, size_t *);
 static inline void unsetusr(void);
@@ -435,7 +435,7 @@ vm_signal:
 ksi.ksi_signo = SIGFPE;
 ksi.ksi_code = fpu_get_fault_code();
 			} else if (tf->tf_srr1 & 0x4) {
-if (emulated_opcode(l, tf)) {
+if (emulate_privileged(l, tf)) {
 	tf->tf_srr0 += 4;
 	break;
 }
@@ -1076,8 +1076,8 @@ fix_unaligned(struct lwp *l, struct trap
 	return -1;
 }
 
-int
-emulated_opcode(struct lwp *l, struct trapframe *tf)
+static int
+emulate_privileged(struct lwp *l, struct trapframe *tf)
 {
 	uint32_t opcode;
 



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:29:07 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
FPSCR[FEX] is not a sticky bit; it is always cleared when read from
userland via mffs on real hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:29:07 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
FPSCR[FEX] is not a sticky bit; it is always cleared when read from
userland via mffs on real hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.28 src/sys/arch/powerpc/fpu/fpu_emu.c:1.29
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.28	Wed Jul 15 08:10:41 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 08:29:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.28 2020/07/15 08:10:41 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.29 2020/07/15 08:29:07 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.28 2020/07/15 08:10:41 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.29 2020/07/15 08:29:07 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -571,6 +571,8 @@ fpu_execute(struct trapframe *tf, struct
 			case	OPC63_MFFS:
 FPU_EMU_EVCNT_INCR(mffs);
 DPRINTF(FPE_INSN, ("fpu_execute: MFFS\n"));
+/* XXX FEX is not sticky */
+fs->fpscr &= ~FPSCR_FEX;
 memcpy(>fpreg[rt], >fpscr,
 	sizeof(fs->fpscr));
 break;



CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:19:49 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: fpu.h
src/sys/arch/powerpc/powerpc: fpu.c

Log Message:
Expose fpu_get_fault_code() even if !PPC_HAVE_FPU, and
adjust it to systems without FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/fpu.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/fpu.c

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

Modified files:

Index: src/sys/arch/powerpc/include/fpu.h
diff -u src/sys/arch/powerpc/include/fpu.h:1.24 src/sys/arch/powerpc/include/fpu.h:1.25
--- src/sys/arch/powerpc/include/fpu.h:1.24	Mon Jul  6 10:52:12 2020
+++ src/sys/arch/powerpc/include/fpu.h	Wed Jul 15 09:19:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.h,v 1.24 2020/07/06 10:52:12 rin Exp $	*/
+/*	$NetBSD: fpu.h,v 1.25 2020/07/15 09:19:49 rin Exp $	*/
 
 /*-
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -83,6 +83,8 @@ void	fpu_mark_used(struct lwp *);
 void	fpu_restore_from_mcontext(struct lwp *, const mcontext_t *);
 bool	fpu_save_to_mcontext(struct lwp *, mcontext_t *, unsigned int *);
 
+int	fpu_get_fault_code(void);
+
 extern const pcu_ops_t fpu_ops;
 
 /* List of PowerPC architectures that support FPUs. */
@@ -112,8 +114,6 @@ fpu_discard(lwp_t *l)
 void	fpu_load_from_fpreg(const struct fpreg *);
 void	fpu_unload_to_fpreg(struct fpreg *);
 
-int	fpu_get_fault_code(void);
-
 #endif /* PPC_HAVE_FPU */
 #endif /* _KERNEL */
 

Index: src/sys/arch/powerpc/powerpc/fpu.c
diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.41 src/sys/arch/powerpc/powerpc/fpu.c:1.42
--- src/sys/arch/powerpc/powerpc/fpu.c:1.41	Mon Jul  6 10:52:12 2020
+++ src/sys/arch/powerpc/powerpc/fpu.c	Wed Jul 15 09:19:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.41 2020/07/06 10:52:12 rin Exp $	*/
+/*	$NetBSD: fpu.c,v 1.42 2020/07/15 09:19:49 rin Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.41 2020/07/06 10:52:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.42 2020/07/15 09:19:49 rin Exp $");
 
 #include 
 #include 
@@ -124,7 +124,6 @@ fpu_state_release(lwp_t *l)
 #endif
 }
 
-#ifdef PPC_HAVE_FPU
 #define	STICKYBITS	(FPSCR_VX|FPSCR_OX|FPSCR_UX|FPSCR_ZX|FPSCR_XX)
 #define	STICKYSHIFT	25
 #define	MASKBITS	(FPSCR_VE|FPSCR_OE|FPSCR_UE|FPSCR_ZE|FPSCR_XE)
@@ -139,6 +138,7 @@ fpu_get_fault_code(void)
 	uint32_t fpscr, ofpscr;
 	int code;
 
+#ifdef PPC_HAVE_FPU
 	kpreempt_disable();
 
 	struct cpu_info * const ci = curcpu();
@@ -182,6 +182,10 @@ fpu_get_fault_code(void)
 	}
 
 	kpreempt_enable();
+#else /* !PPC_HAVE_FPU */
+	fpscr64 = *(uint64_t *)>pcb_fpu.fpscr;
+	((uint32_t *)>pcb_fpu.fpscr)[_QUAD_LOWWORD] &= ~MASKBITS;
+#endif
 
 	/*
 	 * Now determine the fault type.  First we test to see if any of sticky
@@ -207,7 +211,6 @@ fpu_get_fault_code(void)
 	elsecode = 0;
 	return code;
 }
-#endif /* PPC_HAVE_FPU */
 
 bool
 fpu_save_to_mcontext(lwp_t *l, mcontext_t *mcp, unsigned int *flagp)



CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:19:49 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: fpu.h
src/sys/arch/powerpc/powerpc: fpu.c

Log Message:
Expose fpu_get_fault_code() even if !PPC_HAVE_FPU, and
adjust it to systems without FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/fpu.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/fpu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:54:25 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
For trap instruction, ksi_code should be TRAP_BRKPT not TRAP_TRACE.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.26 src/sys/arch/powerpc/fpu/fpu_emu.c:1.27
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.26	Wed Jul 15 07:52:58 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 07:54:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.26 2020/07/15 07:52:58 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.27 2020/07/15 07:54:25 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.26 2020/07/15 07:52:58 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.27 2020/07/15 07:54:25 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -224,7 +224,7 @@ fpu_emulate(struct trapframe *tf, struct
 		DPRINTF(FPE_EX, ("fpu_emulate: SIGTRAP\n"));
 		ksi->ksi_signo = SIGTRAP;
 		ksi->ksi_trap = EXC_PGM;
-		ksi->ksi_code = TRAP_TRACE;
+		ksi->ksi_code = TRAP_BRKPT;
 		return true;
 	}
 	switch (fpu_execute(tf, , )) {



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:52:58 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Do not set ksi->ksi_addr twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.25 src/sys/arch/powerpc/fpu/fpu_emu.c:1.26
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.25	Wed Jul 15 07:37:25 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 07:52:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.25 2020/07/15 07:37:25 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.26 2020/07/15 07:52:58 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.25 2020/07/15 07:37:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.26 2020/07/15 07:52:58 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -211,7 +211,6 @@ fpu_emulate(struct trapframe *tf, struct
 		ksi->ksi_signo = SIGSEGV;
 		ksi->ksi_trap = EXC_ISI;
 		ksi->ksi_code = SEGV_MAPERR;
-		ksi->ksi_addr = (void *)tf->tf_srr0;
 		return true;
 	}
 
@@ -226,7 +225,6 @@ fpu_emulate(struct trapframe *tf, struct
 		ksi->ksi_signo = SIGTRAP;
 		ksi->ksi_trap = EXC_PGM;
 		ksi->ksi_code = TRAP_TRACE;
-		ksi->ksi_addr = (void *)tf->tf_srr0;
 		return true;
 	}
 	switch (fpu_execute(tf, , )) {



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:48:40 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Treat trap instruction from userland correctly in EXC_PGM handler;
raise SIGTRAP with TRAP_BRKPT instead of SIGILL.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.83 src/sys/arch/powerpc/ibm4xx/trap.c:1.84
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.83	Mon Jul  6 10:41:43 2020
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Wed Jul 15 08:48:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.83 2020/07/06 10:41:43 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.84 2020/07/15 08:48:40 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.83 2020/07/06 10:41:43 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2020/07/15 08:48:40 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -309,27 +309,38 @@ vm_signal:
 		break;
 
 	case EXC_PGM|EXC_USER:
-		/*
-		 * Illegal insn:
-		 *
-		 * let's try to see if its FPU and can be emulated.
-		 */
 		curcpu()->ci_data.cpu_ntrap++;
-		pcb = lwp_getpcb(l);
 
-		if (__predict_false(!fpu_used_p(l))) {
-			memset(>pcb_fpu, 0, sizeof(pcb->pcb_fpu));
-			fpu_mark_used(l);
-		}
+		KSI_INIT_TRAP();
+		ksi.ksi_trap = EXC_PGM;
+		ksi.ksi_addr = (void *)tf->tf_srr0;
 
-		if (fpu_emulate(tf, >pcb_fpu, )) {
-			if (ksi.ksi_signo == 0)	/* was emulated */
+		if (tf->tf_esr & ESR_PTR) {
+sigtrap:
+			if (p->p_raslist != NULL &&
+			ras_lookup(p, (void *)tf->tf_srr0) != (void *) -1) {
+tf->tf_srr1 += 4;
 break;
+			}
+			ksi.ksi_code = TRAP_BRKPT;
+			ksi.ksi_signo = SIGTRAP;
 		} else {
-			ksi.ksi_signo = SIGILL;
-			ksi.ksi_code = ILL_ILLOPC;
-			ksi.ksi_trap = EXC_PGM;
-			ksi.ksi_addr = (void *)tf->tf_srr0;
+			pcb = lwp_getpcb(l);
+
+			if (__predict_false(!fpu_used_p(l))) {
+memset(>pcb_fpu, 0, sizeof(pcb->pcb_fpu));
+fpu_mark_used(l);
+			}
+
+			if (fpu_emulate(tf, >pcb_fpu, )) {
+if (ksi.ksi_signo == 0)	/* was emulated */
+	break;
+else if (ksi.ksi_signo == SIGTRAP)
+	goto sigtrap;	/* XXX H/W bug? */
+			} else {
+ksi.ksi_code = ILL_ILLOPC;
+ksi.ksi_signo = SIGILL;
+			}
 		}
 
 		trapsignal(l, );



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 08:48:40 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Treat trap instruction from userland correctly in EXC_PGM handler;
raise SIGTRAP with TRAP_BRKPT instead of SIGILL.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/powerpc/ibm4xx/trap.c

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



CVS commit: src/usr.bin/ftp

2020-07-15 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul 15 08:56:06 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
ftp.1: don't wrap "[[user@]host [port]]"


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/ftp/ftp.1

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

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.137 src/usr.bin/ftp/ftp.1:1.138
--- src/usr.bin/ftp/ftp.1:1.137	Mon Jul 13 11:17:14 2020
+++ src/usr.bin/ftp/ftp.1	Wed Jul 15 08:56:05 2020
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: ftp.1,v 1.137 2020/07/13 11:17:14 lukem Exp $
+.\" 	$NetBSD: ftp.1,v 1.138 2020/07/15 08:56:05 lukem Exp $
 .\"
 .\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .\"
 .\"	@(#)ftp.1	8.3 (Berkeley) 10/9/94
 .\"
-.Dd July 13, 2020
+.Dd July 15, 2020
 .Dt FTP 1
 .Os
 .Sh NAME
@@ -88,8 +88,7 @@
 .Bk -words
 .\" [[user@]host [port]]
 .Oo
-.Oo Ar user Ns Li \&@ Oc Ns Ar host
-.Op Ar port
+.Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Op Ar port Oc
 .Oc
 .Ek
 .Bk -words



CVS commit: src/usr.bin/ftp

2020-07-15 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul 15 08:56:06 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
ftp.1: don't wrap "[[user@]host [port]]"


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/ftp/ftp.1

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



CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:10:14 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
For booke and ibm4xx, emulate m[ft]msr in user mode, in the same
manner as oea.

Now, user process can decide by itself whether floating-point
exception triggers SIGFPE or not via fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.33 src/sys/arch/powerpc/booke/trap.c:1.34
--- src/sys/arch/powerpc/booke/trap.c:1.33	Wed Jul 15 07:44:34 2020
+++ src/sys/arch/powerpc/booke/trap.c	Wed Jul 15 09:10:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.34 2020/07/15 09:10:14 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.34 2020/07/15 09:10:14 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -437,10 +437,7 @@ emulate_opcode(struct trapframe *tf, ksi
 		return true;
 	}
 
-	/*
-	 * If we bothered to emulate FP, we would try to do so here.
-	 */
-	return false;
+	return emulate_mxmsr(curlwp, tf, opcode);
 }
 
 static int

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.84 src/sys/arch/powerpc/ibm4xx/trap.c:1.85
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.84	Wed Jul 15 08:48:40 2020
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Wed Jul 15 09:10:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.84 2020/07/15 08:48:40 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.85 2020/07/15 09:10:14 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2020/07/15 08:48:40 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2020/07/15 09:10:14 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -287,6 +287,7 @@ vm_signal:
 		if (rv == 0) {
 			break;
 		}
+isi:
 		KSI_INIT_TRAP();
 		ksi.ksi_trap = EXC_ISI;
 		ksi.ksi_addr = (void *)tf->tf_srr0;
@@ -324,6 +325,20 @@ sigtrap:
 			}
 			ksi.ksi_code = TRAP_BRKPT;
 			ksi.ksi_signo = SIGTRAP;
+		} else if (tf->tf_esr & ESR_PPR) {
+			uint32_t opcode;
+
+			rv = copyin((void *)tf->tf_srr0, ,
+			sizeof(opcode));
+			if (rv)
+goto isi;
+			if (emulate_mxmsr(l, tf, opcode)) {
+tf->tf_srr0 += 4;
+break;
+			}
+
+			ksi.ksi_code = ILL_PRVOPC;
+			ksi.ksi_signo = SIGILL;
 		} else {
 			pcb = lwp_getpcb(l);
 



CVS commit: src/sys/arch/powerpc

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:10:14 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
For booke and ibm4xx, emulate m[ft]msr in user mode, in the same
manner as oea.

Now, user process can decide by itself whether floating-point
exception triggers SIGFPE or not via fenv(3).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/powerpc/ibm4xx/trap.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:22:26 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Set ksi_code correctly via fpu_get_fault_code() for SIGFPE.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.30 src/sys/arch/powerpc/fpu/fpu_emu.c:1.31
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.30	Wed Jul 15 09:16:35 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 09:22:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.30 2020/07/15 09:16:35 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.31 2020/07/15 09:22:26 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.30 2020/07/15 09:16:35 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.31 2020/07/15 09:22:26 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -244,6 +244,7 @@ success:
 		DPRINTF(FPE_EX, ("fpu_emulate: SIGFPE\n"));
 		ksi->ksi_signo = SIGFPE;
 		ksi->ksi_trap = EXC_PGM;
+		ksi->ksi_code = fpu_get_fault_code();
 		return true;
 
 	case FAULT:



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:22:26 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Set ksi_code correctly via fpu_get_fault_code() for SIGFPE.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/fpu/fpu_emu.c

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



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:42:43 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Now, FPU emulation for booke and ibm4xx works fine at a level where
all the related ATF tests pass correctly. However, there still remain
problems:

- FEX and VX bits for FPSCR cannot be modified by mcrfs, mtfsf{,i},
  and mtfsb[01].
- Invalid operations should be treated differently depending on
  FPSCR[VE].

Therefore, comment them in order not to be forgotten.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.32 src/sys/arch/powerpc/fpu/fpu_emu.c:1.33
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.32	Wed Jul 15 09:36:35 2020
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Jul 15 09:42:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.32 2020/07/15 09:36:35 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.33 2020/07/15 09:42:43 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.32 2020/07/15 09:36:35 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.33 2020/07/15 09:42:43 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -605,6 +605,15 @@ fpu_execute(struct trapframe *tf, struct
 fe->fe_cx = mask & a[1];
 fe->fe_fpscr = (fe->fe_fpscr&~mask) | 
 	(fe->fe_cx);
+/*
+ * XXX
+ * Forbidden to set FEX and VX, also for
+ * mcrfs, mtfsfi, and mtfsb[01].
+ *
+ * XXX
+ * Handle invalid operation differently,
+ * depending on VE.
+ */
 /* XXX weird stuff about OX, FX, FEX, and VX should be handled */
 break;
 			case	OPC63_FCTID:



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

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 09:42:43 UTC 2020

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
Now, FPU emulation for booke and ibm4xx works fine at a level where
all the related ATF tests pass correctly. However, there still remain
problems:

- FEX and VX bits for FPSCR cannot be modified by mcrfs, mtfsf{,i},
  and mtfsb[01].
- Invalid operations should be treated differently depending on
  FPSCR[VE].

Therefore, comment them in order not to be forgotten.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/fpu/fpu_emu.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/sbin/rndctl

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:44:08 UTC 2020

Modified Files:
src/sbin/rndctl [netbsd-9]: rndctl.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1006):

sbin/rndctl/rndctl.c: revision 1.32
sbin/rndctl/rndctl.c: revision 1.33

Accept both byte orders for random seed in `rndctl -L'.

The file format was defined with a machine-dependent 32-bit integer
field (the estimated number of bits of entropy in the process that
generated it).  Take whichever byte order gives a number that is
reasonable, i.e. lower than the number of bits in the buffer.

Continue to have `rndctl -S' generate it in machine-dependent byte
order for now, so that if you roll back to an older rndctl(8) then
`rndctl -L' on the same machine will still be able to load it with
the right entropy estimate.  In a future revision, perhaps we can
change it to be little-endian.

Sort includes.


To generate a diff of this commit:
cvs rdiff -u -r1.30.18.1 -r1.30.18.2 src/sbin/rndctl/rndctl.c

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

Modified files:

Index: src/sbin/rndctl/rndctl.c
diff -u src/sbin/rndctl/rndctl.c:1.30.18.1 src/sbin/rndctl/rndctl.c:1.30.18.2
--- src/sbin/rndctl/rndctl.c:1.30.18.1	Tue Dec 17 12:45:30 2019
+++ src/sbin/rndctl/rndctl.c	Wed Jul 15 13:44:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndctl.c,v 1.30.18.1 2019/12/17 12:45:30 martin Exp $	*/
+/*	$NetBSD: rndctl.c,v 1.30.18.2 2020/07/15 13:44:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 Michael Graff.
@@ -28,29 +28,28 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-#include 
-#include 
-#include 
 
+#include 
 #ifndef lint
-__RCSID("$NetBSD: rndctl.c,v 1.30.18.1 2019/12/17 12:45:30 martin Exp $");
+__RCSID("$NetBSD: rndctl.c,v 1.30.18.2 2020/07/15 13:44:08 martin Exp $");
 #endif
 
-
+#include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
 
 typedef struct {
 	const char *a_name;
@@ -192,9 +191,8 @@ do_save(const char *filename, const void
 	MIN(sizeof(rs.data), UINT32_MAX/NBBY)*NBBY);
 
 	/*
-	 * Compute the checksum on the 32-bit entropy count, in host
-	 * byte order (XXX this means it is not portable across
-	 * different-endian platforms!), followed by the seed data.
+	 * Compute the checksum on the 32-bit entropy count, followed
+	 * by the seed data.
 	 */
 	SHA1Init();
 	SHA1Update(, (const uint8_t *), sizeof(rs.entropy));
@@ -309,6 +307,17 @@ do_load(const char *filename)
 		rs.entropy = 0;
 	}
 
+	/*
+	 * If the entropy is insensibly large, try byte-swapping.
+	 * Otherwise assume the file is corrupted and act as though it
+	 * has zero entropy.
+	 */
+	if (howmany(rs.entropy, NBBY) > sizeof(rs.data)) {
+		rs.entropy = bswap32(rs.entropy);
+		if (howmany(rs.entropy, NBBY) > sizeof(rs.data))
+			rs.entropy = 0;
+	}
+
 	/* Format the ioctl request.  */
 	rd.len = MIN(sizeof(rd.data), sizeof(rs.data));
 	rd.entropy = rs.entropy;



CVS commit: [netbsd-9] src/sbin/rndctl

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:44:08 UTC 2020

Modified Files:
src/sbin/rndctl [netbsd-9]: rndctl.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1006):

sbin/rndctl/rndctl.c: revision 1.32
sbin/rndctl/rndctl.c: revision 1.33

Accept both byte orders for random seed in `rndctl -L'.

The file format was defined with a machine-dependent 32-bit integer
field (the estimated number of bits of entropy in the process that
generated it).  Take whichever byte order gives a number that is
reasonable, i.e. lower than the number of bits in the buffer.

Continue to have `rndctl -S' generate it in machine-dependent byte
order for now, so that if you roll back to an older rndctl(8) then
`rndctl -L' on the same machine will still be able to load it with
the right entropy estimate.  In a future revision, perhaps we can
change it to be little-endian.

Sort includes.


To generate a diff of this commit:
cvs rdiff -u -r1.30.18.1 -r1.30.18.2 src/sbin/rndctl/rndctl.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/share/man/man9

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:47:40 UTC 2020

Modified Files:
src/share/man/man9 [netbsd-9]: rnd.9

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1007):

share/man/man9/rnd.9: revision 1.26
share/man/man9/rnd.9: revision 1.27

Update rnd(9) man page to reflect reality since netbsd-7.
- Note rndsource_setcb, RND_FLAG_HASCB, and rnd_add_data_sync.
- Note user's obligation to serialize access to each rndsource.

Simplify macro usage.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.18.1 src/share/man/man9/rnd.9

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



CVS commit: [netbsd-9] src/share/man/man9

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:47:40 UTC 2020

Modified Files:
src/share/man/man9 [netbsd-9]: rnd.9

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1007):

share/man/man9/rnd.9: revision 1.26
share/man/man9/rnd.9: revision 1.27

Update rnd(9) man page to reflect reality since netbsd-7.
- Note rndsource_setcb, RND_FLAG_HASCB, and rnd_add_data_sync.
- Note user's obligation to serialize access to each rndsource.

Simplify macro usage.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.18.1 src/share/man/man9/rnd.9

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

Modified files:

Index: src/share/man/man9/rnd.9
diff -u src/share/man/man9/rnd.9:1.25 src/share/man/man9/rnd.9:1.25.18.1
--- src/share/man/man9/rnd.9:1.25	Mon Apr 13 22:23:54 2015
+++ src/share/man/man9/rnd.9	Wed Jul 15 13:47:40 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.9,v 1.25 2015/04/13 22:23:54 riastradh Exp $
+.\"	$NetBSD: rnd.9,v 1.25.18.1 2020/07/15 13:47:40 martin Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,17 +35,22 @@
 .Nm rnd_attach_source ,
 .Nm rnd_detach_source ,
 .Nm rnd_add_data ,
+.Nm rnd_add_data_sync ,
 .Nm rnd_add_uint32
 .Nd functions to make a device available for entropy collection
 .Sh SYNOPSIS
 .In sys/rndsource.h
 .Ft void
+.Fn rndsource_setcb "krndsource_t *rnd_source" "void (*callback)(size_t, void *)" "void *cookie"
+.Ft void
 .Fn rnd_attach_source "krndsource_t *rnd_source" "char *devname" "uint32_t source_type" "uint32_t flags"
 .Ft void
 .Fn rnd_detach_source "krndsource_t *rnd_source"
 .Ft void
 .Fn rnd_add_data "krndsource_t *rnd_source" "void *data" "uint32_t len" "uint32_t entropy"
 .Ft void
+.Fn rnd_add_data_sync "krndsource_t *rnd_source" "void *data" "uint32_t len" "uint32_t entropy"
+.Ft void
 .Fn rnd_add_uint32 "krndsource_t *rnd_source" "uint32_t datum"
 .Sh DESCRIPTION
 These
@@ -58,6 +63,9 @@ and
 .Pa ( /dev/random )
 interfaces.
 .Pp
+The caller must zero an
+.Fa rnd_source
+object before using it.
 Ideally the first argument
 .Fa rnd_source
 of these functions gets included in the devices' entity struct,
@@ -65,9 +73,55 @@ but any means to permanently (statically
 to one incarnation of the device is ok.
 Do not share
 .Fa rnd_source
-structures between two devices.
-.Pp
+structures between two devices, and make sure to serialize all access
+to each
+.Fa rnd_source ,
+for example with
+.Xr mutex 9 .
 .Bl -tag -width 8n
+.It Fn rndsource_setcb "krndsource_t *rnd_source" "void (*callback)(size_t, void *)" "void *cookie"
+This function sets a callback to be invoked when the kernel entropy
+pool is hungry.
+It is optional; if used, it must be used
+.Em before
+.Fn rnd_attach_source ,
+and the caller must pass
+.Dv RND_FLAG_HASCB
+to
+.Fn rnd_attach_source
+in order for the callback to be used.
+The callback is invoked as
+.Fa callback ( Fa nbytes , Fa cookie ) ,
+where
+.Fa nbytes
+is the number of bytes requested for the entropy pool, and
+.Fa cookie
+is the cookie that was passed to
+.Fn rndsource_setcb .
+The callback normally does one of two things:
+.Bl -dash
+.It
+Sends a request to a hardware device for entropy and returns.
+The hardware will later return data asynchronously by an interrupt, and
+the callback will use
+.Fn rnd_add_data
+or
+.Fn rnd_add_uint32
+to add the data to the pool.
+.It
+Synchronously gathers entropy from hardware \(em for example, by a CPU
+instruction like Intel RDSEED.
+In this case, in order to add data to the pool
+.Em before
+returning, the callback
+.Em must
+use
+.Fn rnd_add_data_sync ,
+not
+.Fn rnd_add_data
+or
+.Fn rnd_add_uint32 .
+.El
 .It Fn rnd_attach_source "krndsource_t *rnd_source" "char *devname" "uint32_t source_type" "uint32_t flags"
 This function announces the availability of a device for entropy collection.
 It must be called before the source struct pointed to by
@@ -109,7 +163,10 @@ are the logical OR of
 the pool estimate)
 .Dv RND_FLAG_ESTIMATE_TIME
 (use a delta estimator to count bits of entropy from this source's timestamps
-towards the pool estimate).
+towards the pool estimate)
+.Dv RND_FLAG_HASCB
+(caller specified a callback with
+.Fn rndsource_setcb ) .
 For many devices,
 .Dv RND_FLAG_DEFAULT
 .Dv ( RND_FLAG_COLLECT_VALUE | RND_FLAG_COLLECT_TIME | RND_FLAG_ESTIMATE_TIME )
@@ -119,7 +176,6 @@ Note that devices of type
 default to
 .Dv RND_FLAG_COLLECT_VALUE | RND_FLAG_COLLECT_TIME
 (no entropy counted).
-.Pp
 .It Fn rnd_detach_source "krndsource_t *rnd_source"
 This function disconnects the device from entropy collection.
 .It Fn rnd_add_uint32 "krndsource_t *rnd_source" "uint32_t datum"
@@ -155,6 +211,14 @@ of randomness, passing
 for
 .Va rnd_source
 is permitted, and the device does not need to be attached.
+.Pp
+.Fn rnd_add_uint32
+.Em must not
+be used during a callback as set with
+.Fn rndsource_setcb ;
+use
+.Fn 

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 14:02:36 UTC 2020

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: coretemp.c

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

sys/arch/x86/x86/coretemp.c: revision 1.37

  Add special handling for model 0x0f stepping >=2 or mode 0x0e to get Tjmax.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/arch/x86/x86/coretemp.c

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

Modified files:

Index: src/sys/arch/x86/x86/coretemp.c
diff -u src/sys/arch/x86/x86/coretemp.c:1.36 src/sys/arch/x86/x86/coretemp.c:1.36.4.1
--- src/sys/arch/x86/x86/coretemp.c:1.36	Wed Jul 11 03:36:32 2018
+++ src/sys/arch/x86/x86/coretemp.c	Wed Jul 15 14:02:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: coretemp.c,v 1.36 2018/07/11 03:36:32 msaitoh Exp $ */
+/* $NetBSD: coretemp.c,v 1.36.4.1 2020/07/15 14:02:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.36 2018/07/11 03:36:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.36.4.1 2020/07/15 14:02:36 martin Exp $");
 
 #include 
 #include 
@@ -271,6 +271,19 @@ coretemp_tjmax(device_t self)
 	sc->sc_tjmax = 100;
 
 	if ((model == 0x0f && stepping >= 2) || (model == 0x0e)) {
+		/*
+		 * Check MSR_IA32_PLATFORM_ID(0x17) bit 28. It's not documented
+		 * in the datasheet, but the following page describes the
+		 * detail:
+		 *   http://software.intel.com/en-us/articles/
+		 * mobile-intel-core2-processor-detection-table/
+		 *   Was: http://softwarecommunity.intel.com/Wiki/Mobility/
+		 * 720.htm
+		 */
+		if (rdmsr_safe(MSR_IA32_PLATFORM_ID, ) != 0)
+			goto notee;
+		if ((model < 0x17) && ((msr & __BIT(28)) == 0))
+			goto notee;
 
 		if (rdmsr_safe(MSR_IA32_EXT_CONFIG, ) == EFAULT)
 			return;
@@ -290,6 +303,7 @@ coretemp_tjmax(device_t self)
 		} else
 			sc->sc_tjmax = 90;
 	} else {
+notee:
 		/*
 		 * Attempt to get Tj(max) from IA32_TEMPERATURE_TARGET,
 		 * but only consider the interval [70, 110] C as valid.



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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 14:09:04 UTC 2020

Modified Files:
src/sys/dev/hid [netbsd-9]: hid.h
src/sys/dev/usb [netbsd-9]: uhid.c usbhid.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1010):

sys/dev/usb/uhid.c: revision 1.112
sys/dev/usb/uhid.c: revision 1.113
sys/dev/hid/hid.h: revision 1.4
sys/dev/hid/hid.h: revision 1.5
sys/dev/usb/usbhid.h: revision 1.19

Add fido constants, and turn hid "raw" mode for fido devices.

Add ioctls to get and set raw mode.

Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/dev/hid/hid.h
cvs rdiff -u -r1.108.2.1 -r1.108.2.2 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.18 -r1.18.6.1 src/sys/dev/usb/usbhid.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/hid/hid.h
diff -u src/sys/dev/hid/hid.h:1.3 src/sys/dev/hid/hid.h:1.3.4.1
--- src/sys/dev/hid/hid.h:1.3	Thu Nov 15 23:01:45 2018
+++ src/sys/dev/hid/hid.h	Wed Jul 15 14:09:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.3 2018/11/15 23:01:45 jakllsch Exp $	*/
+/*	$NetBSD: hid.h,v 1.3.4.1 2020/07/15 14:09:04 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.h,v 1.7 1999/11/17 22:33:40 n_hibma Exp $ */
 
 /*
@@ -123,7 +123,8 @@ int hid_is_collection(const void *, int,
 #define HUP_CAMERA_CONTROL	0x0090
 #define HUP_ARCADE		0x0091
 #define HUP_VENDOR		0x00ff
-#define HUP_MICROSOFT		0xff00
+#define HUP_FIDO		0xf1d0U
+#define HUP_MICROSOFT		0xff00U
 /* XXX compat */
 #define HUP_APPLE		0x00ff
 #define HUP_WACOM		0xff00
@@ -396,6 +397,9 @@ int hid_is_collection(const void *, int,
 /* Usages, Consumer */
 #define HUC_AC_PAN		0x0238
 
+/* Usages, FIDO */
+#define HUF_U2FHID		0x0001
+
 #define HID_USAGE2(p, u) (((p) << 16) | u)
 #define HID_GET_USAGE(u) ((u) & 0x)
 #define HID_GET_USAGE_PAGE(u) (((u) >> 16) & 0x)

Index: src/sys/dev/usb/uhid.c
diff -u src/sys/dev/usb/uhid.c:1.108.2.1 src/sys/dev/usb/uhid.c:1.108.2.2
--- src/sys/dev/usb/uhid.c:1.108.2.1	Thu Jan  2 09:42:06 2020
+++ src/sys/dev/usb/uhid.c	Wed Jul 15 14:09:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhid.c,v 1.108.2.1 2020/01/02 09:42:06 martin Exp $	*/
+/*	$NetBSD: uhid.c,v 1.108.2.2 2020/07/15 14:09:04 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2008, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.108.2.1 2020/01/02 09:42:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.108.2.2 2020/07/15 14:09:04 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -104,6 +104,7 @@ struct uhid_softc {
 #define UHID_IMMED	0x02	/* return read data immediately */
 
 	int sc_refcnt;
+	int sc_raw;
 	u_char sc_dying;
 };
 
@@ -184,6 +185,8 @@ uhid_attach(device_t parent, device_t se
 	sc->sc_isize = hid_report_size(desc, size, hid_input,   repid);
 	sc->sc_osize = hid_report_size(desc, size, hid_output,  repid);
 	sc->sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+	sc->sc_raw =  hid_is_collection(desc, size, uha->reportid,
+	HID_USAGE2(HUP_FIDO, HUF_U2FHID));
 
 	aprint_naive("\n");
 	aprint_normal(": input=%d, output=%d, feature=%d\n",
@@ -482,15 +485,32 @@ uhid_do_write(struct uhid_softc *sc, str
 		return EIO;
 
 	size = sc->sc_osize;
-	error = 0;
 	if (uio->uio_resid != size || size == 0)
 		return EINVAL;
 	error = uiomove(sc->sc_obuf, size, uio);
+#ifdef UHID_DEBUG
+	if (uhiddebug > 5) {
+		uint32_t i;
+
+		DPRINTF(("%s: outdata[%d] =", device_xname(sc->sc_hdev.sc_dev),
+		error));
+		for (i = 0; i < size; i++)
+			DPRINTF((" %02x", sc->sc_obuf[i]));
+		DPRINTF(("\n"));
+	}
+#endif
 	if (!error) {
-		err = uhidev_set_report(>sc_hdev, UHID_OUTPUT_REPORT,
-	sc->sc_obuf, size);
-		if (err)
+		if (sc->sc_raw)
+			err = uhidev_write(sc->sc_hdev.sc_parent, sc->sc_obuf,
+			size);
+		else
+			err = uhidev_set_report(>sc_hdev,
+			UHID_OUTPUT_REPORT, sc->sc_obuf, size);
+		if (err) {
+			DPRINTF(("%s: err = %d\n",
+			device_xname(sc->sc_hdev.sc_dev), err));
 			error = EIO;
+		}
 	}
 
 	return error;
@@ -582,6 +602,14 @@ uhid_do_ioctl(struct uhid_softc *sc, u_l
 		mutex_exit(proc_lock);
 		break;
 
+	case USB_HID_GET_RAW:
+		*(int *)addr = sc->sc_raw;
+		break;
+
+	case USB_HID_SET_RAW:
+		sc->sc_raw = *(int *)addr;
+		break;
+
 	case USB_GET_REPORT_DESC:
 		uhidev_get_report_desc(sc->sc_hdev.sc_parent, , );
 		rd = (struct usb_ctl_report_desc *)addr;

Index: src/sys/dev/usb/usbhid.h
diff -u src/sys/dev/usb/usbhid.h:1.18 src/sys/dev/usb/usbhid.h:1.18.6.1
--- src/sys/dev/usb/usbhid.h:1.18	Sun Jul 15 18:36:51 2018
+++ src/sys/dev/usb/usbhid.h	Wed Jul 15 14:09:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbhid.h,v 1.18 2018/07/15 18:36:51 maya Exp $	*/
+/*	$NetBSD: usbhid.h,v 1.18.6.1 2020/07/15 14:09:04 martin Exp $	*/
 /*	$FreeBSD: 

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:30:20 UTC 2020

Modified Files:
src/sys/kern [netbsd-9]: subr_percpu.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1005):

sys/kern/subr_percpu.c: revision 1.20

Allow equality in this assertion.

This can happen if we lose the race mentioned in percpu_cpu_swap.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.14.1 src/sys/kern/subr_percpu.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/kern

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:30:20 UTC 2020

Modified Files:
src/sys/kern [netbsd-9]: subr_percpu.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1005):

sys/kern/subr_percpu.c: revision 1.20

Allow equality in this assertion.

This can happen if we lose the race mentioned in percpu_cpu_swap.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.14.1 src/sys/kern/subr_percpu.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/subr_percpu.c
diff -u src/sys/kern/subr_percpu.c:1.18 src/sys/kern/subr_percpu.c:1.18.14.1
--- src/sys/kern/subr_percpu.c:1.18	Wed May 31 23:54:17 2017
+++ src/sys/kern/subr_percpu.c	Wed Jul 15 13:30:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_percpu.c,v 1.18 2017/05/31 23:54:17 chs Exp $	*/
+/*	$NetBSD: subr_percpu.c,v 1.18.14.1 2020/07/15 13:30:20 martin Exp $	*/
 
 /*-
  * Copyright (c)2007,2008 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.18 2017/05/31 23:54:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.18.14.1 2020/07/15 13:30:20 martin Exp $");
 
 #include 
 #include 
@@ -149,7 +149,7 @@ percpu_cpu_enlarge(size_t size)
 			where = xc_unicast(0, percpu_cpu_swap, ci, , ci);
 			xc_wait(where);
 		}
-		KASSERT(pcc.pcc_size < size);
+		KASSERT(pcc.pcc_size <= size);
 		if (pcc.pcc_data != NULL) {
 			kmem_free(pcc.pcc_data, pcc.pcc_size);
 		}



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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:52:05 UTC 2020

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

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1008):

sys/dev/usb/ualea.c: revision 1.10

Turn XXX comment into KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.9.10.1 -r1.9.10.2 src/sys/dev/usb/ualea.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/usb/ualea.c
diff -u src/sys/dev/usb/ualea.c:1.9.10.1 src/sys/dev/usb/ualea.c:1.9.10.2
--- src/sys/dev/usb/ualea.c:1.9.10.1	Mon Jul 13 14:32:20 2020
+++ src/sys/dev/usb/ualea.c	Wed Jul 15 13:52:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ualea.c,v 1.9.10.1 2020/07/13 14:32:20 martin Exp $	*/
+/*	$NetBSD: ualea.c,v 1.9.10.2 2020/07/15 13:52:05 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9.10.1 2020/07/13 14:32:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9.10.2 2020/07/15 13:52:05 martin Exp $");
 
 #include 
 #include 
@@ -198,12 +198,9 @@ ualea_xfer(struct ualea_softc *sc)
 	ualea_xfer_done);
 
 	/* Issue xfer or complain if we can't.  */
-	/*
-	 * XXX Does USBD_NORMAL_COMPLETION (= 0) make sense here?  The
-	 * xfer can't complete synchronously because of the lock.
-	 */
 	status = usbd_transfer(sc->sc_xfer);
-	if (status && status != USBD_IN_PROGRESS) {
+	KASSERT(status != USBD_NORMAL_COMPLETION); /* asynchronous xfer */
+	if (status != USBD_IN_PROGRESS) {
 		aprint_error_dev(sc->sc_dev, "failed to issue xfer: %d\n",
 		status);
 		/* We failed -- let someone else have a go.  */



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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 13:52:05 UTC 2020

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

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1008):

sys/dev/usb/ualea.c: revision 1.10

Turn XXX comment into KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.9.10.1 -r1.9.10.2 src/sys/dev/usb/ualea.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/x86/x86

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 14:02:36 UTC 2020

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: coretemp.c

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

sys/arch/x86/x86/coretemp.c: revision 1.37

  Add special handling for model 0x0f stepping >=2 or mode 0x0e to get Tjmax.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/arch/x86/x86/coretemp.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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 14:09:04 UTC 2020

Modified Files:
src/sys/dev/hid [netbsd-9]: hid.h
src/sys/dev/usb [netbsd-9]: uhid.c usbhid.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1010):

sys/dev/usb/uhid.c: revision 1.112
sys/dev/usb/uhid.c: revision 1.113
sys/dev/hid/hid.h: revision 1.4
sys/dev/hid/hid.h: revision 1.5
sys/dev/usb/usbhid.h: revision 1.19

Add fido constants, and turn hid "raw" mode for fido devices.

Add ioctls to get and set raw mode.

Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/dev/hid/hid.h
cvs rdiff -u -r1.108.2.1 -r1.108.2.2 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.18 -r1.18.6.1 src/sys/dev/usb/usbhid.h

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



CVS commit: src/sys/arch/i386/stand/boot

2020-07-15 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Wed Jul 15 12:36:30 UTC 2020

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c

Log Message:
Let consdev command also set speed

Adapted from PR install/55490 by Sunil Nimmagadda


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/i386/stand/boot/boot2.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/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.73 src/sys/arch/i386/stand/boot/boot2.c:1.74
--- src/sys/arch/i386/stand/boot/boot2.c:1.73	Sat Apr  4 19:50:54 2020
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Jul 15 12:36:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.73 2020/04/04 19:50:54 christos Exp $	*/
+/*	$NetBSD: boot2.c,v 1.74 2020/07/15 12:36:30 kim Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -449,7 +449,7 @@ command_help(char *arg)
 	   "ls [dev:][path]\n"
 #endif
 	   "dev [dev:]\n"
-	   "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
+	   "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n"
 	   "vesa {modenum|on|off|enabled|disabled|list}\n"
 #ifndef SMALL
 	   "menu (reenters boot menu, if defined in boot.cfg)\n"
@@ -581,14 +581,32 @@ void
 command_consdev(char *arg)
 {
 	const struct cons_devs *cdp;
+	char *sep;
+	int speed;
+
+	sep = strchr(arg, ',');
+	if (sep != NULL)
+		*sep++ = '\0';
 
 	for (cdp = cons_devs; cdp->name; cdp++) {
-		if (strcmp(arg, cdp->name) == 0) {
-			initio(cdp->tag);
-			print_banner();
-			return;
+		if (strcmp(arg, cdp->name) != 0)
+			continue;
+
+		if (sep != NULL) {
+			if (cdp->tag == CONSDEV_PC)
+goto error;
+
+			speed = atoi(sep);
+			if (speed < 0)
+goto error;
+			boot_params.bp_conspeed = speed;
 		}
+
+		initio(cdp->tag);
+		print_banner();
+		return;
 	}
+error:
 	printf("invalid console device.\n");
 }
 



CVS commit: [netbsd-9] src/share/man/man4

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:48:26 UTC 2020

Modified Files:
src/share/man/man4 [netbsd-9]: wskbd.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1012):

share/man/man4/wskbd.4: revision 1.20
share/man/man4/wskbd.4: revision 1.21

Whitespace/macro usage fixes.
obviously wrong country code


To generate a diff of this commit:
cvs rdiff -u -r1.16.34.1 -r1.16.34.2 src/share/man/man4/wskbd.4

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

Modified files:

Index: src/share/man/man4/wskbd.4
diff -u src/share/man/man4/wskbd.4:1.16.34.1 src/share/man/man4/wskbd.4:1.16.34.2
--- src/share/man/man4/wskbd.4:1.16.34.1	Mon Jul 13 14:22:47 2020
+++ src/share/man/man4/wskbd.4	Wed Jul 15 15:48:25 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: wskbd.4,v 1.16.34.1 2020/07/13 14:22:47 martin Exp $
+.\" $NetBSD: wskbd.4,v 1.16.34.2 2020/07/15 15:48:25 martin Exp $
 .\"
 .\" Copyright (c) 1999
 .\" 	Matthias Drochner.  All rights reserved.
@@ -118,8 +118,9 @@ wskbd device instance.
 The following encodings are supported.
 Device drivers for legacy keyboard interfaces may only support a subset
 of these.
-However, generally, all encodings are supported by 
-.Xr pckbd 4 and
+However, generally, all encodings are supported by
+.Xr pckbd 4
+and
 .Xr ukbd 4 .
 .Bl -column " us.colemak" " KB_US|KB_COLEMAK" "language"
 .It Sy "wsconsctl" Ta Sy "define" Ta Sy "language"
@@ -134,7 +135,7 @@ However, generally, all encodings are su
 .It Li dk Ta KB_DK Ta Danish with
 .Dq dead accents
 .It Li nl Ta KB_NL Ta Dutch
-.It Li ee Ta KB_DK Ta Estonian with
+.It Li ee Ta KB_EE Ta Estonian with
 .Dq dead accents
 .It Li fi Ta KB_FI Ta Finnish
 .It Li fr Ta KB_FR Ta French



CVS commit: [netbsd-9] src/share/man/man4

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:48:26 UTC 2020

Modified Files:
src/share/man/man4 [netbsd-9]: wskbd.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1012):

share/man/man4/wskbd.4: revision 1.20
share/man/man4/wskbd.4: revision 1.21

Whitespace/macro usage fixes.
obviously wrong country code


To generate a diff of this commit:
cvs rdiff -u -r1.16.34.1 -r1.16.34.2 src/share/man/man4/wskbd.4

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



CVS commit: [netbsd-9] src

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:51:03 UTC 2020

Modified Files:
src/share/man/man8/man8.x86 [netbsd-9]: boot.8
src/sys/arch/i386/stand/boot [netbsd-9]: boot2.c

Log Message:
Pull up following revision(s) (requested by kim in ticket #1013):

sys/arch/i386/stand/boot/boot2.c: revision 1.74
share/man/man8/man8.x86/boot.8: revision 1.21

Let consdev command also set speed
Adapted from PR install/55490 by Sunil Nimmagadda

Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 src/share/man/man8/man8.x86/boot.8
cvs rdiff -u -r1.70.8.1 -r1.70.8.2 src/sys/arch/i386/stand/boot/boot2.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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:51:03 UTC 2020

Modified Files:
src/share/man/man8/man8.x86 [netbsd-9]: boot.8
src/sys/arch/i386/stand/boot [netbsd-9]: boot2.c

Log Message:
Pull up following revision(s) (requested by kim in ticket #1013):

sys/arch/i386/stand/boot/boot2.c: revision 1.74
share/man/man8/man8.x86/boot.8: revision 1.21

Let consdev command also set speed
Adapted from PR install/55490 by Sunil Nimmagadda

Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 src/share/man/man8/man8.x86/boot.8
cvs rdiff -u -r1.70.8.1 -r1.70.8.2 src/sys/arch/i386/stand/boot/boot2.c

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

Modified files:

Index: src/share/man/man8/man8.x86/boot.8
diff -u src/share/man/man8/man8.x86/boot.8:1.15.2.3 src/share/man/man8/man8.x86/boot.8:1.15.2.4
--- src/share/man/man8/man8.x86/boot.8:1.15.2.3	Tue Sep 17 19:45:02 2019
+++ src/share/man/man8/man8.x86/boot.8	Wed Jul 15 15:51:03 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: boot.8,v 1.15.2.3 2019/09/17 19:45:02 martin Exp $
+.\"	$NetBSD: boot.8,v 1.15.2.4 2020/07/15 15:51:03 martin Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
 .\"
-.Dd August 18, 2019
+.Dd July 15, 2020
 .Dt BOOT 8 x86
 .Os
 .Sh NAME
@@ -363,7 +363,7 @@ flag in
 .Va boothowto .
 Boot the system in silent mode.
 .El
-.It Ic consdev Va dev
+.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
 Immediately switch the console to the specified device
 .Va dev
 and reprint the banner.
@@ -379,6 +379,17 @@ See
 .Sx Console Selection Policy
 in
 .Xr x86/boot_console 8 .
+.Pp
+A
+.Va speed
+for the serial port is optional and defaults to 9600.
+If a value of zero is specified, then the current baud rate (set by the
+BIOS) will be used.
+Setting the
+.Va speed
+with the
+.Ar pc
+device is not possible.
 .It Ic dev Op Va device
 Set the default drive and partition for subsequent file system
 operations.

Index: src/sys/arch/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.70.8.1 src/sys/arch/i386/stand/boot/boot2.c:1.70.8.2
--- src/sys/arch/i386/stand/boot/boot2.c:1.70.8.1	Fri Sep 13 07:00:13 2019
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Jul 15 15:51:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.70.8.1 2019/09/13 07:00:13 martin Exp $	*/
+/*	$NetBSD: boot2.c,v 1.70.8.2 2020/07/15 15:51:03 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -443,7 +443,7 @@ command_help(char *arg)
 	   "ls [dev:][path]\n"
 #endif
 	   "dev [dev:]\n"
-	   "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
+	   "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n"
 	   "vesa {modenum|on|off|enabled|disabled|list}\n"
 #ifndef SMALL
 	   "menu (reenters boot menu, if defined in boot.cfg)\n"
@@ -575,14 +575,32 @@ void
 command_consdev(char *arg)
 {
 	const struct cons_devs *cdp;
+	char *sep;
+	int speed;
+
+	sep = strchr(arg, ',');
+	if (sep != NULL)
+		*sep++ = '\0';
 
 	for (cdp = cons_devs; cdp->name; cdp++) {
-		if (strcmp(arg, cdp->name) == 0) {
-			initio(cdp->tag);
-			print_banner();
-			return;
+		if (strcmp(arg, cdp->name) != 0)
+			continue;
+
+		if (sep != NULL) {
+			if (cdp->tag == CONSDEV_PC)
+goto error;
+
+			speed = atoi(sep);
+			if (speed < 0)
+goto error;
+			boot_params.bp_conspeed = speed;
 		}
+
+		initio(cdp->tag);
+		print_banner();
+		return;
 	}
+error:
 	printf("invalid console device.\n");
 }
 



CVS commit: [netbsd-9] src/doc

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:52:24 UTC 2020

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

Log Message:
Tickets #1005 - #1010, #1012, #1013


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.77 -r1.1.2.78 src/doc/CHANGES-9.1

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.77 src/doc/CHANGES-9.1:1.1.2.78
--- src/doc/CHANGES-9.1:1.1.2.77	Tue Jul 14 13:38:12 2020
+++ src/doc/CHANGES-9.1	Wed Jul 15 15:52:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.77 2020/07/14 13:38:12 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.78 2020/07/15 15:52:24 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -3380,3 +3380,47 @@ lib/libcurses/newwin.c1.58
 	PR 55484: newwin() - fix crash with negative ncols.
 	[uwe, ticket #1004]
 
+sys/kern/subr_percpu.c1.20
+
+	Fix assertion.
+	[riastradh, ticket #1005]
+
+sbin/rndctl/rndctl.c1.32,1.33
+
+	Accept both byte orders for random seed in `rndctl -L'.
+	[riastradh, ticket #1006]
+
+share/man/man9/rnd.91.26,1.27
+
+	Update rnd(9) man page to reflect reality since netbsd-7.
+	[riastradh, ticket #1007]
+
+sys/dev/usb/ualea.c1.10
+
+	Turn XXX comment into KASSERT.
+	[riastradh, ticket #1008]
+
+sys/arch/x86/x86/coretemp.c			1.37
+
+	Add special handling for model 0x0f stepping >=2 or mode 0x0e to get
+	Tjmax.
+	[msaitoh, ticket #1009]
+
+sys/dev/hid/hid.h1.4,1.5
+sys/dev/usb/uhid.c1.112,1.113
+sys/dev/usb/usbhid.h1.19
+
+	Add support for USB HID raw mode for U2F/FIDO2 security keys.
+	[riastradh, ticket #1010]
+
+share/man/man4/wskbd.41.20,1.21
+
+	Various fixes.
+	[nia, ticket #1012]
+
+share/man/man8/man8.x86/boot.8			1.21
+sys/arch/i386/stand/boot/boot2.c		1.74
+
+	PR 55490: let the consdev command also set speed.
+	[kim, ticket #1013]
+



CVS commit: [netbsd-9] src/doc

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:52:24 UTC 2020

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

Log Message:
Tickets #1005 - #1010, #1012, #1013


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.77 -r1.1.2.78 src/doc/CHANGES-9.1

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



CVS commit: [netbsd-8] src

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:54:50 UTC 2020

Modified Files:
src/share/man/man8/man8.x86 [netbsd-8]: boot.8
src/sys/arch/i386/stand/boot [netbsd-8]: boot2.c

Log Message:
Pull up following revision(s) (requested by kim in ticket #1575):

sys/arch/i386/stand/boot/boot2.c: revision 1.74
share/man/man8/man8.x86/boot.8: revision 1.21

Let consdev command also set speed
Adapted from PR install/55490 by Sunil Nimmagadda

Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.11.4.4 -r1.11.4.5 src/share/man/man8/man8.x86/boot.8
cvs rdiff -u -r1.66.10.1 -r1.66.10.2 src/sys/arch/i386/stand/boot/boot2.c

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



CVS commit: [netbsd-8] src

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:54:50 UTC 2020

Modified Files:
src/share/man/man8/man8.x86 [netbsd-8]: boot.8
src/sys/arch/i386/stand/boot [netbsd-8]: boot2.c

Log Message:
Pull up following revision(s) (requested by kim in ticket #1575):

sys/arch/i386/stand/boot/boot2.c: revision 1.74
share/man/man8/man8.x86/boot.8: revision 1.21

Let consdev command also set speed
Adapted from PR install/55490 by Sunil Nimmagadda

Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.11.4.4 -r1.11.4.5 src/share/man/man8/man8.x86/boot.8
cvs rdiff -u -r1.66.10.1 -r1.66.10.2 src/sys/arch/i386/stand/boot/boot2.c

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

Modified files:

Index: src/share/man/man8/man8.x86/boot.8
diff -u src/share/man/man8/man8.x86/boot.8:1.11.4.4 src/share/man/man8/man8.x86/boot.8:1.11.4.5
--- src/share/man/man8/man8.x86/boot.8:1.11.4.4	Wed Sep 18 17:30:05 2019
+++ src/share/man/man8/man8.x86/boot.8	Wed Jul 15 15:54:50 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: boot.8,v 1.11.4.4 2019/09/18 17:30:05 martin Exp $
+.\"	$NetBSD: boot.8,v 1.11.4.5 2020/07/15 15:54:50 martin Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
 .\"
-.Dd September 13, 2019
+.Dd July 15, 2020
 .Dt BOOT 8 x86
 .Os
 .Sh NAME
@@ -363,7 +363,7 @@ flag in
 .Va boothowto .
 Boot the system in silent mode.
 .El
-.It Ic consdev Va dev
+.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
 Immediately switch the console to the specified device
 .Va dev
 and reprint the banner.
@@ -379,6 +379,17 @@ See
 .Sx Console Selection Policy
 in
 .Xr x86/boot_console 8 .
+.Pp
+A
+.Va speed
+for the serial port is optional and defaults to 9600.
+If a value of zero is specified, then the current baud rate (set by the
+BIOS) will be used.
+Setting the
+.Va speed
+with the
+.Ar pc
+device is not possible.
 .It Ic dev Op Va device
 Set the default drive and partition for subsequent file system
 operations.

Index: src/sys/arch/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.66.10.1 src/sys/arch/i386/stand/boot/boot2.c:1.66.10.2
--- src/sys/arch/i386/stand/boot/boot2.c:1.66.10.1	Tue Sep 17 18:26:53 2019
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Jul 15 15:54:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.66.10.1 2019/09/17 18:26:53 martin Exp $	*/
+/*	$NetBSD: boot2.c,v 1.66.10.2 2020/07/15 15:54:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -440,7 +440,7 @@ command_help(char *arg)
 	   "ls [dev:][path]\n"
 #endif
 	   "dev [dev:]\n"
-	   "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
+	   "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n"
 	   "vesa {modenum|on|off|enabled|disabled|list}\n"
 #ifndef SMALL
 	   "menu (reenters boot menu, if defined in boot.cfg)\n"
@@ -563,14 +563,32 @@ void
 command_consdev(char *arg)
 {
 	const struct cons_devs *cdp;
+	char *sep;
+	int speed;
+
+	sep = strchr(arg, ',');
+	if (sep != NULL)
+		*sep++ = '\0';
 
 	for (cdp = cons_devs; cdp->name; cdp++) {
-		if (strcmp(arg, cdp->name) == 0) {
-			initio(cdp->tag);
-			print_banner();
-			return;
+		if (strcmp(arg, cdp->name) != 0)
+			continue;
+
+		if (sep != NULL) {
+			if (cdp->tag == CONSDEV_PC)
+goto error;
+
+			speed = atoi(sep);
+			if (speed < 0)
+goto error;
+			boot_params.bp_conspeed = speed;
 		}
+
+		initio(cdp->tag);
+		print_banner();
+		return;
 	}
+error:
 	printf("invalid console device.\n");
 }
 



CVS commit: [netbsd-8] src/doc

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:55:49 UTC 2020

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

Log Message:
Ticket #1575


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.20 src/doc/CHANGES-8.3:1.1.2.21
--- src/doc/CHANGES-8.3:1.1.2.20	Tue Jul 14 13:40:37 2020
+++ src/doc/CHANGES-8.3	Wed Jul 15 15:55:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.20 2020/07/14 13:40:37 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.21 2020/07/15 15:55:49 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -285,3 +285,9 @@ lib/libcurses/newwin.c1.58
 	PR 55484: newwin() - fix crash with negative ncols.
 	[uwe, ticket #1574]
 
+share/man/man8/man8.x86/boot.8			1.21
+sys/arch/i386/stand/boot/boot2.c		1.74
+
+	PR 55490: let the consdev command also set speed.
+	[kim, ticket #1575]
+



CVS commit: [netbsd-8] src/doc

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 15:55:49 UTC 2020

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

Log Message:
Ticket #1575


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/doc/CHANGES-8.3

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



CVS commit: src/sys/dev/sdmmc

2020-07-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 15 15:57:52 UTC 2020

Modified Files:
src/sys/dev/sdmmc: sdhc.c sdhcreg.h

Log Message:
Identify SDHC 4.1 and 4.2. From {DragonFly,Free}BSD.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sdmmc/sdhcreg.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/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.106 src/sys/dev/sdmmc/sdhc.c:1.107
--- src/sys/dev/sdmmc/sdhc.c:1.106	Mon Oct 28 18:11:15 2019
+++ src/sys/dev/sdmmc/sdhc.c	Wed Jul 15 15:57:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.106 2019/10/28 18:11:15 joerg Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.107 2020/07/15 15:57:52 msaitoh Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.106 2019/10/28 18:11:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.107 2020/07/15 15:57:52 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -324,6 +324,12 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	case SDHC_SPEC_VERS_400:
 		aprint_normal("4.0");
 		break;
+	case SDHC_SPEC_VERS_410:
+		aprint_normal("4.1");
+		break;
+	case SDHC_SPEC_VERS_420:
+		aprint_normal("4.2");
+		break;
 	case SDHC_SPEC_NOVERS:
 		hp->specver = -1;
 		aprint_normal("NO-VERS");

Index: src/sys/dev/sdmmc/sdhcreg.h
diff -u src/sys/dev/sdmmc/sdhcreg.h:1.20 src/sys/dev/sdmmc/sdhcreg.h:1.21
--- src/sys/dev/sdmmc/sdhcreg.h:1.20	Wed Oct 23 05:20:52 2019
+++ src/sys/dev/sdmmc/sdhcreg.h	Wed Jul 15 15:57:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcreg.h,v 1.20 2019/10/23 05:20:52 hkenken Exp $	*/
+/*	$NetBSD: sdhcreg.h,v 1.21 2020/07/15 15:57:52 msaitoh Exp $	*/
 /*	$OpenBSD: sdhcreg.h,v 1.4 2006/07/30 17:20:40 fgsch Exp $	*/
 
 /*
@@ -248,6 +248,8 @@
 #define SDHC_SPEC_VERS_200		0x01
 #define SDHC_SPEC_VERS_300		0x02
 #define SDHC_SPEC_VERS_400		0x03
+#define SDHC_SPEC_VERS_410		0x04
+#define SDHC_SPEC_VERS_420		0x05
 #define SDHC_SPEC_NOVERS		0xff	/* dummy */
 
 /* SDHC_CAPABILITIES decoding */



CVS commit: src/sys/dev/sdmmc

2020-07-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 15 15:57:52 UTC 2020

Modified Files:
src/sys/dev/sdmmc: sdhc.c sdhcreg.h

Log Message:
Identify SDHC 4.1 and 4.2. From {DragonFly,Free}BSD.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sdmmc/sdhcreg.h

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



CVS commit: src/share/man/man8/man8.x86

2020-07-15 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Wed Jul 15 12:38:30 UTC 2020

Modified Files:
src/share/man/man8/man8.x86: boot.8

Log Message:
Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man8/man8.x86/boot.8

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

Modified files:

Index: src/share/man/man8/man8.x86/boot.8
diff -u src/share/man/man8/man8.x86/boot.8:1.20 src/share/man/man8/man8.x86/boot.8:1.21
--- src/share/man/man8/man8.x86/boot.8:1.20	Mon Sep 16 01:57:58 2019
+++ src/share/man/man8/man8.x86/boot.8	Wed Jul 15 12:38:30 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: boot.8,v 1.20 2019/09/16 01:57:58 manu Exp $
+.\"	$NetBSD: boot.8,v 1.21 2020/07/15 12:38:30 kim Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
 .\"
-.Dd September 13, 2019
+.Dd July 15, 2020
 .Dt BOOT 8 x86
 .Os
 .Sh NAME
@@ -363,7 +363,7 @@ flag in
 .Va boothowto .
 Boot the system in silent mode.
 .El
-.It Ic consdev Va dev
+.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
 Immediately switch the console to the specified device
 .Va dev
 and reprint the banner.
@@ -379,6 +379,17 @@ See
 .Sx Console Selection Policy
 in
 .Xr x86/boot_console 8 .
+.Pp
+A
+.Va speed
+for the serial port is optional and defaults to 9600.
+If a value of zero is specified, then the current baud rate (set by the
+BIOS) will be used.
+Setting the
+.Va speed
+with the
+.Ar pc
+device is not possible.
 .It Ic dev Op Va device
 Set the default drive and partition for subsequent file system
 operations.



CVS commit: src/share/man/man8/man8.x86

2020-07-15 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Wed Jul 15 12:38:30 UTC 2020

Modified Files:
src/share/man/man8/man8.x86: boot.8

Log Message:
Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man8/man8.x86/boot.8

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



CVS commit: src

2020-07-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Jul 15 12:15:31 UTC 2020

Modified Files:
src/distrib/evbmips/instkernel/instkernel: Makefile
src/doc: CHANGES
src/etc/etc.evbmips: Makefile.inc
Added Files:
src/sys/arch/evbmips/conf: INSTALL_OCTEON OCTEON
Removed Files:
src/sys/arch/evbmips/conf: ERLITE INSTALL_ERLITE

Log Message:
Rename the evbmips ERLITE kernel to OCTEON now that it supports more
than just the EdgeRouter Lite.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/evbmips/instkernel/instkernel/Makefile
cvs rdiff -u -r1.2714 -r1.2715 src/doc/CHANGES
cvs rdiff -u -r1.22 -r1.23 src/etc/etc.evbmips/Makefile.inc
cvs rdiff -u -r1.27 -r0 src/sys/arch/evbmips/conf/ERLITE
cvs rdiff -u -r1.2 -r0 src/sys/arch/evbmips/conf/INSTALL_ERLITE
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/INSTALL_OCTEON \
src/sys/arch/evbmips/conf/OCTEON

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

Modified files:

Index: src/distrib/evbmips/instkernel/instkernel/Makefile
diff -u src/distrib/evbmips/instkernel/instkernel/Makefile:1.6 src/distrib/evbmips/instkernel/instkernel/Makefile:1.7
--- src/distrib/evbmips/instkernel/instkernel/Makefile:1.6	Sat May  9 02:12:29 2015
+++ src/distrib/evbmips/instkernel/instkernel/Makefile	Wed Jul 15 12:15:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2015/05/09 02:12:29 matt Exp $
+#	$NetBSD: Makefile,v 1.7 2020/07/15 12:15:30 simonb Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -20,7 +20,7 @@ MDSETTARGETS+=		INSTALL_XLSATX64	${RAMDI
 .if ${MACHINE_ARCH} == "mips64el"
 MDSETTARGETS+=		INSTALL_LOONGSON	${RAMDISK}	-
 .else
-MDSETTARGETS+=		INSTALL_ERLITE		${RAMDISK}	-
+MDSETTARGETS+=		INSTALL_OCTEON		${RAMDISK}	-
 .endif
 
 .else

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2714 src/doc/CHANGES:1.2715
--- src/doc/CHANGES:1.2714	Wed Jul 15 02:26:07 2020
+++ src/doc/CHANGES	Wed Jul 15 12:15:31 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2714 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2715 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -251,3 +251,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	ciss(4): Add support for PERFORMANT mode, and enable MSI/MSI-X
 		for adapters supporting it [jdolecek 20200714]
 	ciss(4): Match new HP Smart Array adapters [jdolecek 20200714]
+	evbmips: Renamed kernel config files:
+		ERLITE -> OCTEON
+		INSTALL_ERLITE -> INSTALL_OCTEON
+		[simonb 20200715]

Index: src/etc/etc.evbmips/Makefile.inc
diff -u src/etc/etc.evbmips/Makefile.inc:1.22 src/etc/etc.evbmips/Makefile.inc:1.23
--- src/etc/etc.evbmips/Makefile.inc:1.22	Tue Aug 15 10:11:31 2017
+++ src/etc/etc.evbmips/Makefile.inc	Wed Jul 15 12:15:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.22 2017/08/15 10:11:31 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.23 2020/07/15 12:15:30 simonb Exp $
 #
 #	etc.evbmips/Makefile.inc -- evbmips-specific etc Makefile targets
 #
@@ -26,8 +26,8 @@ KERNEL_SETS+=		LOONGSON
 BUILD_KERNELS+=		INSTALL_LOONGSON
 KERNEL_SETS+=		GDIUM64
 . else
-KERNEL_SETS+=		ERLITE
-BUILD_KERNELS+=		INSTALL_ERLITE
+KERNEL_SETS+=		OCTEON
+BUILD_KERNELS+=		INSTALL_OCTEON
 . endif
 .else
 KERNEL_SETS=		ALCHEMY DB120 DBAU1500 DBAU1550 MALTA RB433UAH

Added files:

Index: src/sys/arch/evbmips/conf/INSTALL_OCTEON
diff -u /dev/null src/sys/arch/evbmips/conf/INSTALL_OCTEON:1.1
--- /dev/null	Wed Jul 15 12:15:31 2020
+++ src/sys/arch/evbmips/conf/INSTALL_OCTEON	Wed Jul 15 12:15:30 2020
@@ -0,0 +1,16 @@
+# $NetBSD: INSTALL_OCTEON,v 1.1 2020/07/15 12:15:30 simonb Exp $
+
+include		"arch/evbmips/conf/OCTEON"
+
+#ident 		"INSTALL_ERLITE-$Revision: 1.1 $"
+
+# Enable the hooks used for initializing the root memory-disk.
+# The ramdisk size must be kept in sync manually with the size of
+# the `ramdisk' image (which is built in distrib/evbmips/ramdisk/ramdisk).
+pseudo-device	md# memory disk device
+options 	MEMORY_DISK_HOOKS
+options 	MEMORY_DISK_IS_ROOT		# force root on memory disk
+options 	MEMORY_DISK_SERVER=0		# no userspace memory disk
+options 	MEMORY_DISK_ROOT_SIZE=12288	# size of memory disk, in blocks
+
+makeoptions	NEED_MDSETIMAGE="yes"
Index: src/sys/arch/evbmips/conf/OCTEON
diff -u /dev/null src/sys/arch/evbmips/conf/OCTEON:1.1
--- /dev/null	Wed Jul 15 12:15:31 2020
+++ src/sys/arch/evbmips/conf/OCTEON	Wed Jul 15 12:15:30 2020
@@ -0,0 +1,180 @@
+#	$NetBSD: OCTEON,v 1.1 2020/07/15 12:15:30 simonb Exp $
+
+include 	"arch/mips/conf/std.octeon"
+include 	"arch/evbmips/conf/files.octeon"
+
+#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+#ident 		"ERLITE-$Revision: 1.1 $"
+
+maxusers	32
+
+# Options for necessary to use MD
+#options 	MEMORY_DISK_HOOKS
+#options 	MEMORY_DISK_IS_R

CVS commit: src

2020-07-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Jul 15 12:15:31 UTC 2020

Modified Files:
src/distrib/evbmips/instkernel/instkernel: Makefile
src/doc: CHANGES
src/etc/etc.evbmips: Makefile.inc
Added Files:
src/sys/arch/evbmips/conf: INSTALL_OCTEON OCTEON
Removed Files:
src/sys/arch/evbmips/conf: ERLITE INSTALL_ERLITE

Log Message:
Rename the evbmips ERLITE kernel to OCTEON now that it supports more
than just the EdgeRouter Lite.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/evbmips/instkernel/instkernel/Makefile
cvs rdiff -u -r1.2714 -r1.2715 src/doc/CHANGES
cvs rdiff -u -r1.22 -r1.23 src/etc/etc.evbmips/Makefile.inc
cvs rdiff -u -r1.27 -r0 src/sys/arch/evbmips/conf/ERLITE
cvs rdiff -u -r1.2 -r0 src/sys/arch/evbmips/conf/INSTALL_ERLITE
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/INSTALL_OCTEON \
src/sys/arch/evbmips/conf/OCTEON

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



CVS commit: src/sys/arch/i386/stand/boot

2020-07-15 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Wed Jul 15 12:36:30 UTC 2020

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c

Log Message:
Let consdev command also set speed

Adapted from PR install/55490 by Sunil Nimmagadda


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/i386/stand/boot/boot2.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/ic

2020-07-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul 15 14:33:59 UTC 2020

Modified Files:
src/sys/dev/ic: cissvar.h

Log Message:
g/c unused sc_channel_raw, sc_adapter_raw


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/cissvar.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/ic/cissvar.h
diff -u src/sys/dev/ic/cissvar.h:1.10 src/sys/dev/ic/cissvar.h:1.11
--- src/sys/dev/ic/cissvar.h:1.10	Tue Jul 14 12:04:46 2020
+++ src/sys/dev/ic/cissvar.h	Wed Jul 15 14:33:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cissvar.h,v 1.10 2020/07/14 12:04:46 jdolecek Exp $	*/
+/*	$NetBSD: cissvar.h,v 1.11 2020/07/15 14:33:58 jdolecek Exp $	*/
 /*	$OpenBSD: cissvar.h,v 1.15 2013/05/30 16:15:02 deraadt Exp $	*/
 
 /*
@@ -47,9 +47,7 @@ struct ciss_softc {
 	int			sc_flush;
 
 	struct scsipi_channel	sc_channel;
-	struct scsipi_channel	*sc_channel_raw;
 	struct scsipi_adapter	sc_adapter;
-	struct scsipi_adapter	*sc_adapter_raw;
 	struct callout		sc_hb;
 
 	u_int	sc_flags;



CVS commit: src/sys/dev/ic

2020-07-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul 15 14:33:59 UTC 2020

Modified Files:
src/sys/dev/ic: cissvar.h

Log Message:
g/c unused sc_channel_raw, sc_adapter_raw


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/cissvar.h

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



CVS commit: src/sys/uvm

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 15:08:26 UTC 2020

Modified Files:
src/sys/uvm: uvm_physseg.c

Log Message:
Fix typo. Use PRIxPADDR rather than casting.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/uvm/uvm_physseg.c

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



CVS commit: src/sys/uvm

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 15:08:26 UTC 2020

Modified Files:
src/sys/uvm: uvm_physseg.c

Log Message:
Fix typo. Use PRIxPADDR rather than casting.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/uvm/uvm_physseg.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/uvm/uvm_physseg.c
diff -u src/sys/uvm/uvm_physseg.c:1.16 src/sys/uvm/uvm_physseg.c:1.17
--- src/sys/uvm/uvm_physseg.c:1.16	Mon Jul 13 10:46:10 2020
+++ src/sys/uvm/uvm_physseg.c	Wed Jul 15 15:08:26 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_physseg.c,v 1.16 2020/07/13 10:46:10 mrg Exp $ */
+/* $NetBSD: uvm_physseg.c,v 1.17 2020/07/15 15:08:26 rin Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1209,8 +1209,8 @@ uvm_page_physload(paddr_t start, paddr_t
 	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
 		panic("uvm_page_physload: bad free list %d", free_list);
 	if (start >= end)
-		panic("uvm_page_physload: start[%llx] >= en[%llx]d",
-		(unsigned long long)start, (unsigned long long)end);
+		panic("uvm_page_physload: start[%" PRIxPADDR "] >= end[%"
+		PRIxPADDR "]", start, end);
 
 	if (uvm_physseg_plug(start, end - start, ) == false) {
 		panic("uvm_physseg_plug() failed at boot.");



CVS commit: src/usr.bin/ftp

2020-07-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jul 15 16:41:16 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Remove now-extraneous Op since we already have Oo and Oc to enclose
the Ar port.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/ftp/ftp.1

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

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.138 src/usr.bin/ftp/ftp.1:1.139
--- src/usr.bin/ftp/ftp.1:1.138	Wed Jul 15 08:56:05 2020
+++ src/usr.bin/ftp/ftp.1	Wed Jul 15 16:41:16 2020
@@ -1,4 +1,4 @@
-.\" 	$NetBSD: ftp.1,v 1.138 2020/07/15 08:56:05 lukem Exp $
+.\" 	$NetBSD: ftp.1,v 1.139 2020/07/15 16:41:16 pgoyette Exp $
 .\"
 .\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -88,7 +88,7 @@
 .Bk -words
 .\" [[user@]host [port]]
 .Oo
-.Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Op Ar port Oc
+.Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Ar port Oc
 .Oc
 .Ek
 .Bk -words



CVS commit: src/usr.bin/ftp

2020-07-15 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jul 15 16:41:16 UTC 2020

Modified Files:
src/usr.bin/ftp: ftp.1

Log Message:
Remove now-extraneous Op since we already have Oo and Oc to enclose
the Ar port.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/ftp/ftp.1

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



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:46:11 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
Note modules.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/share/man/man5/rc.conf.5

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

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.182 src/share/man/man5/rc.conf.5:1.183
--- src/share/man/man5/rc.conf.5:1.182	Wed Jun 24 10:30:43 2020
+++ src/share/man/man5/rc.conf.5	Wed Jul 15 16:46:11 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.182 2020/06/24 10:30:43 jruoho Exp $
+.\"	$NetBSD: rc.conf.5,v 1.183 2020/07/15 16:46:11 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -55,7 +55,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 24, 2020
+.Dd July 15, 2020
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -338,6 +338,10 @@ assumes yes as the answer to all operato
 This might be important with hosts where the administrator does not have
 access to the console and an unsuccessful shutdown must not make the host
 unbootable even if the file system checks would fail in preen mode.
+.It Sy modules
+Boolean value.
+If true, loads the modules specified in
+.Xr modules.conf 5 .
 .It Sy no_swap
 Boolean value.
 Should be true if you have deliberately configured your system with no swap.



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:46:11 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
Note modules.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/share/man/man5/rc.conf.5

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



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:52:49 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
's/blacklistd/blocklistd/'. Note also blocklistd_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/share/man/man5/rc.conf.5

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

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.183 src/share/man/man5/rc.conf.5:1.184
--- src/share/man/man5/rc.conf.5:1.183	Wed Jul 15 16:46:11 2020
+++ src/share/man/man5/rc.conf.5	Wed Jul 15 16:52:48 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.183 2020/07/15 16:46:11 jruoho Exp $
+.\"	$NetBSD: rc.conf.5,v 1.184 2020/07/15 16:52:48 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -698,12 +698,14 @@ with the
 .Fl l
 flag and suppresses warnings about interfaces in this list that
 do not have an ifconfig file or variable.
-.It Sy blacklistd
+.It Sy blocklistd
 Boolean value.
 Runs
-.Xr blacklistd 8
+.Xr blocklistd 8
 to dynamically block hosts on a DoS according to configuration set in
-.Xr blacklistd.conf 5
+.Xr blocklistd.conf 5
+Passes
+.Sy blocklistd_flags .
 .It Sy dhcpcd
 Boolean value.
 Set true to configure some or all network interfaces using dhcpcd.



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:52:49 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
's/blacklistd/blocklistd/'. Note also blocklistd_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/share/man/man5/rc.conf.5

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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:16:59 UTC 2020

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

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1014:

sys/dev/pci/if_ti.c 1.116-1.120 via patch
sys/dev/pci/if_tireg.h  1.26

- Don't clear CFI and priority bit to pass them to the upper layer.
- Add support for Farallon PN9000SX from FreeBSD.
- Fix typo in comment.
- Style fix.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.112.2.1 src/sys/dev/pci/if_ti.c
cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/dev/pci/if_tireg.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_ti.c
diff -u src/sys/dev/pci/if_ti.c:1.112 src/sys/dev/pci/if_ti.c:1.112.2.1
--- src/sys/dev/pci/if_ti.c:1.112	Tue Jul  9 08:46:59 2019
+++ src/sys/dev/pci/if_ti.c	Wed Jul 15 17:16:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ti.c,v 1.112 2019/07/09 08:46:59 msaitoh Exp $ */
+/* $NetBSD: if_ti.c,v 1.112.2.1 2020/07/15 17:16:59 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.112 2019/07/09 08:46:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.112.2.1 2020/07/15 17:16:59 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -140,6 +140,8 @@ static const struct ti_type ti_devs[] = 
 		"Netgear GA620 1000BASE-T Ethernet" },
 	{ PCI_VENDOR_SGI, PCI_PRODUCT_SGI_TIGON,
 		"Silicon Graphics Gigabit Ethernet" },
+	{ PCI_VENDOR_DEC, PCI_PRODUCT_DEC_PN9000SX,
+		"Farallon PN9000SX Gigabit Ethernet" },
 	{ 0, 0, NULL }
 };
 
@@ -216,7 +218,7 @@ ti_eeprom_putbyte(struct ti_softc *sc, i
 	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN);
 
 	/*
-	 * Feed in each bit and stobe the clock.
+	 * Feed in each bit and strobe the clock.
 	 */
 	for (i = 0x80; i; i >>= 1) {
 		if (byte & i) {
@@ -762,7 +764,7 @@ ti_newbuf_std(struct ti_softc *sc, int i
 }
 
 /*
- * Intialize a mini receive ring descriptor. This only applies to
+ * Initialize a mini receive ring descriptor. This only applies to
  * the Tigon 2.
  */
 static int
@@ -903,7 +905,7 @@ ti_init_rx_ring_std(struct ti_softc *sc)
 	for (i = 0; i < TI_SSLOTS; i++) {
 		if (ti_newbuf_std(sc, i, NULL, 0) == ENOBUFS)
 			return (ENOBUFS);
-	};
+	}
 
 	TI_UPDATE_STDPROD(sc, i - 1);
 	sc->ti_std = i - 1;
@@ -941,7 +943,7 @@ ti_init_rx_ring_jumbo(struct ti_softc *s
 	for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
 		if (ti_newbuf_jumbo(sc, i, NULL) == ENOBUFS)
 			return (ENOBUFS);
-	};
+	}
 
 	TI_UPDATE_JUMBOPROD(sc, i - 1);
 	sc->ti_jumbo = i - 1;
@@ -974,7 +976,7 @@ ti_init_rx_ring_mini(struct ti_softc *sc
 	for (i = 0; i < TI_MSLOTS; i++) {
 		if (ti_newbuf_mini(sc, i, NULL, 0) == ENOBUFS)
 			return (ENOBUFS);
-	};
+	}
 
 	TI_UPDATE_MINIPROD(sc, i - 1);
 	sc->ti_mini = i - 1;
@@ -2026,10 +2028,8 @@ ti_rxeof(struct ti_softc *sc)
 			break;
 		}
 
-		if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) {
-			/* ti_vlan_tag also has the priority, trim it */
-			vlan_set_tag(m, cur_rx->ti_vlan_tag & 0x0fff);
-		}
+		if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG)
+			vlan_set_tag(m, cur_rx->ti_vlan_tag);
 
 		if_percpuq_enqueue(ifp->if_percpuq, m);
 	}
@@ -2205,7 +2205,7 @@ ti_stats_update(struct ti_softc *sc)
 }
 
 /*
- * Encapsulate an mbuf chain in the tx ring  by coupling the mbuf data
+ * Encapsulate an mbuf chain in the tx ring by coupling the mbuf data
  * pointers to descriptors.
  */
 static int
@@ -2684,7 +2684,7 @@ ti_ifmedia_sts(struct ifnet *ifp, struct
 static int
 ti_ether_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-	struct ifaddr *ifa = (struct ifaddr *) data;
+	struct ifaddr *ifa = (struct ifaddr *)data;
 	struct ti_softc *sc = ifp->if_softc;
 
 	if ((ifp->if_flags & IFF_UP) == 0) {
@@ -2717,7 +2717,7 @@ static int
 ti_ioctl(struct ifnet *ifp, u_long command, void *data)
 {
 	struct ti_softc		*sc = ifp->if_softc;
-	struct ifreq		*ifr = (struct ifreq *) data;
+	struct ifreq		*ifr = (struct ifreq *)data;
 	int			s, error = 0;
 	struct ti_cmd_desc	cmd;
 

Index: src/sys/dev/pci/if_tireg.h
diff -u src/sys/dev/pci/if_tireg.h:1.21 src/sys/dev/pci/if_tireg.h:1.21.4.1
--- src/sys/dev/pci/if_tireg.h:1.21	Tue Mar  5 08:25:02 2019
+++ src/sys/dev/pci/if_tireg.h	Wed Jul 15 17:16:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tireg.h,v 1.21 2019/03/05 08:25:02 msaitoh Exp $ */
+/* $NetBSD: if_tireg.h,v 1.21.4.1 2020/07/15 17:16:59 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -39,7 +39,7 @@
  * which can be accessed with the CSR_READ_4()/CSR_WRITE_4() macros.
  * Each register must be accessed using 32 bit operations.
  *
- * All reegisters are accessed through a 16K shared memory block.
+ * All registers are accessed through a 16K shared memory block.
  * The first group of registers are actually copies of the PCI
  * configuration space registers.
  */



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

2020-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 17:16:59 UTC 2020

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

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1014:

sys/dev/pci/if_ti.c 1.116-1.120 via patch
sys/dev/pci/if_tireg.h  1.26

- Don't clear CFI and priority bit to pass them to the upper layer.
- Add support for Farallon PN9000SX from FreeBSD.
- Fix typo in comment.
- Style fix.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.112.2.1 src/sys/dev/pci/if_ti.c
cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/dev/pci/if_tireg.h

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



CVS commit: src/sys/dev/pci

2020-07-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jul 16 01:20:38 UTC 2020

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

Log Message:
Set PCI_COMMAND_MASTER_ENABLE and PCI_COMMAND_MEM_ENABLE
to activate the pci devices

This configuration is needed when BIOS or UEFI do not make them set.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_ixl.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/pci

2020-07-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Jul 16 01:20:38 UTC 2020

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

Log Message:
Set PCI_COMMAND_MASTER_ENABLE and PCI_COMMAND_MEM_ENABLE
to activate the pci devices

This configuration is needed when BIOS or UEFI do not make them set.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.67 src/sys/dev/pci/if_ixl.c:1.68
--- src/sys/dev/pci/if_ixl.c:1.67	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/pci/if_ixl.c	Thu Jul 16 01:20:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.67 2020/06/11 02:39:30 thorpej Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.68 2020/07/16 01:20:38 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.67 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.68 2020/07/16 01:20:38 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -764,7 +764,8 @@ static unsigned int	 ixl_param_tx_ndescs
 static unsigned int	 ixl_param_rx_ndescs = 1024;
 
 static enum i40e_mac_type
-ixl_mactype(pci_product_id_t);
+	ixl_mactype(pci_product_id_t);
+static void	ixl_pci_csr_setup(pci_chipset_tag_t, pcitag_t);
 static void	ixl_clear_hw(struct ixl_softc *);
 static int	ixl_pf_reset(struct ixl_softc *);
 
@@ -1107,6 +1108,8 @@ ixl_attach(device_t parent, device_t sel
 
 	sc->sc_mac_type = ixl_mactype(PCI_PRODUCT(pa->pa_id));
 
+	ixl_pci_csr_setup(pa->pa_pc, pa->pa_tag);
+
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, IXL_PCIREG);
 	if (pci_mapreg_map(pa, IXL_PCIREG, memtype, 0,
 	>sc_memt, >sc_memh, NULL, >sc_mems)) {
@@ -1943,6 +1946,17 @@ ixl_mactype(pci_product_id_t id)
 	return I40E_MAC_GENERIC;
 }
 
+static void
+ixl_pci_csr_setup(pci_chipset_tag_t pc, pcitag_t tag)
+{
+	pcireg_t csr;
+
+	csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
+	csr |= (PCI_COMMAND_MASTER_ENABLE |
+	PCI_COMMAND_MEM_ENABLE);
+	pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+}
+
 static inline void *
 ixl_hmc_kva(struct ixl_softc *sc, enum ixl_hmc_types type, unsigned int i)
 {



CVS commit: src/share/dict

2020-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jul 16 03:08:58 UTC 2020

Modified Files:
src/share/dict: web2

Log Message:
+craptacular

(originally suggested by pgoyette)


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/share/dict/web2

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

Modified files:

Index: src/share/dict/web2
diff -u src/share/dict/web2:1.53 src/share/dict/web2:1.54
--- src/share/dict/web2:1.53	Mon Jul 13 23:56:41 2020
+++ src/share/dict/web2	Thu Jul 16 03:08:58 2020
@@ -45097,6 +45097,7 @@ crapple
 crappo
 craps
 crapshooter
+craptacular
 crapulate
 crapulence
 crapulent



CVS commit: src/share/dict

2020-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jul 16 03:08:58 UTC 2020

Modified Files:
src/share/dict: web2

Log Message:
+craptacular

(originally suggested by pgoyette)


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/share/dict/web2

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