Re: CVS commit: src/sys/arch

2018-07-15 Thread Kamil Rytarowski
On 14.07.2018 18:29, m...@netbsd.org wrote:
> On Sat, Jul 14, 2018 at 03:09:41PM +, Maxime Villard wrote:
>> Module Name: src
>> Committed By:maxv
>> Date:Sat Jul 14 15:09:41 UTC 2018
>>
>> Modified Files:
>>  src/sys/arch/bebox/conf: INSTALL
>>  src/sys/arch/evbarm/conf: ARMADAXP ARMADILLO-IOT-G3 BCM5301X BCM56340
>>  CUBOX CUBOX-I DUOVERO EXYNOS GENERIC GENERIC.common GENERIC64
>>  GOLDENGATE IGEPV2 IMX31LITE IMX6UL-STARTER MARVELL_NAS N900
>>  NITROGEN6X OMAP5EVM OVERO PANDABOARD PEPPER SUNXI TEGRA TISDP2420
>>  TISDP2430 VEXPRESS_A15 VIRT VTC100
>>  src/sys/arch/sandpoint/conf: ENCPP1 SANDPOINT
>>
>> Log Message:
>> Remove "options IPKDB", and the other associated options, from the config
>> files.
>>
>> ipkdb is being retired. Its code is really old, and hasn't kept pace with
>> today's expectations: IPv6, SMP, modern NICs. The associated code for x86
>> was already removed because it was too incorrect to stay.
>>
>> There are plans to rewrite a similar feature from scratch.
>>
>> ok kamil christos
> 
> Looks like there are a lot of code references to IPKDB, still.
> Do we want to remove them?
> 


Yes, if we will find it useful and implementable in future, we will
reintroduce it.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys/dev/virtio

2018-07-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 16 02:36:39 UTC 2018

Modified Files:
src/sys/dev/virtio: virtio_mmiovar.h

Log Message:
Do the previous in the way it probably should have been in the first place.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/virtio/virtio_mmiovar.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/virtio

2018-07-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 16 02:36:39 UTC 2018

Modified Files:
src/sys/dev/virtio: virtio_mmiovar.h

Log Message:
Do the previous in the way it probably should have been in the first place.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/virtio/virtio_mmiovar.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/virtio/virtio_mmiovar.h
diff -u src/sys/dev/virtio/virtio_mmiovar.h:1.2 src/sys/dev/virtio/virtio_mmiovar.h:1.3
--- src/sys/dev/virtio/virtio_mmiovar.h:1.2	Mon Jul 16 00:33:00 2018
+++ src/sys/dev/virtio/virtio_mmiovar.h	Mon Jul 16 02:36:39 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_mmiovar.h,v 1.2 2018/07/16 00:33:00 kre Exp $ */
+/* $NetBSD: virtio_mmiovar.h,v 1.3 2018/07/16 02:36:39 kre Exp $ */
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
  * All rights reserved.
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _VIRTIO_MMIOREG_H_
-#define _VIRTIO_MMIOREG_H_
+#ifndef _VIRTIO_MMIOVAR_H_
+#define _VIRTIO_MMIOVAR_H_
 
 #include  /* XXX: move to non-pci */
 
@@ -48,4 +48,4 @@ void virtio_mmio_common_attach(struct vi
 int virtio_mmio_common_detach(struct virtio_mmio_softc *, int);
 int virtio_mmio_intr(void *);
 
-#endif /* _VIRTIO_MMIOREG_H_ */
+#endif /* _VIRTIO_MMIOVAR_H_ */



CVS commit: src/usr.sbin/tpctl

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 01:04:47 UTC 2018

Modified Files:
src/usr.sbin/tpctl: main.c

Log Message:
cast through intptr_t


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/tpctl/main.c

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



CVS commit: src/usr.sbin/tpctl

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 01:04:47 UTC 2018

Modified Files:
src/usr.sbin/tpctl: main.c

Log Message:
cast through intptr_t


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/tpctl/main.c

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

Modified files:

Index: src/usr.sbin/tpctl/main.c
diff -u src/usr.sbin/tpctl/main.c:1.6 src/usr.sbin/tpctl/main.c:1.7
--- src/usr.sbin/tpctl/main.c:1.6	Fri Nov 29 18:01:05 2013
+++ src/usr.sbin/tpctl/main.c	Sun Jul 15 21:04:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.6 2013/11/29 23:01:05 joerg Exp $	*/
+/*	$NetBSD: main.c,v 1.7 2018/07/16 01:04:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 TAKEMRUA Shin
@@ -49,7 +49,7 @@
 
 #ifndef lint
 #include 
-__RCSID("$NetBSD: main.c,v 1.6 2013/11/29 23:01:05 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 2018/07/16 01:04:47 christos Exp $");
 #endif /* not lint */
 
 void load_data(const char *, struct tpctl_data *);
@@ -380,7 +380,7 @@ drawcross(struct fb *fb, int x, int y, i
 int
 check_esc(void *data)
 {
-	int fd = (int)data;
+	int fd = (int)(intptr_t)data;
 	int flg, n, error;
 	char buf[1];
 	struct termios tm, raw;



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:47:54 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist: e_os.h

Log Message:
limit the aarch64 hack to clang.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssl/dist/e_os.h

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/e_os.h
diff -u src/crypto/external/bsd/openssl/dist/e_os.h:1.8 src/crypto/external/bsd/openssl/dist/e_os.h:1.9
--- src/crypto/external/bsd/openssl/dist/e_os.h:1.8	Wed Mar  7 11:06:57 2018
+++ src/crypto/external/bsd/openssl/dist/e_os.h	Sun Jul 15 20:47:54 2018
@@ -32,7 +32,7 @@ extern "C" {
 /*
  * BIO_printf format modifier for [u]int64_t.
  */
-# if !defined(__aarch64__) && (defined(__LP64__) || \
+# if !(defined(__aarch64__) && defined(__clang__)) && (defined(__LP64__) || \
  (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8))
 #  define BIO_PRI64 "l" /* 'll' does work "universally", but 'l' is
  * here to shut -Wformat warnings in LP64... */



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:47:54 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist: e_os.h

Log Message:
limit the aarch64 hack to clang.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssl/dist/e_os.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/virtio

2018-07-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 16 00:33:00 UTC 2018

Modified Files:
src/sys/dev/virtio: virtio_mmiovar.h

Log Message:
Be consistent with double include guard name (clang actually detects this)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/virtio/virtio_mmiovar.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/virtio/virtio_mmiovar.h
diff -u src/sys/dev/virtio/virtio_mmiovar.h:1.1 src/sys/dev/virtio/virtio_mmiovar.h:1.2
--- src/sys/dev/virtio/virtio_mmiovar.h:1.1	Wed Jun  6 20:35:36 2018
+++ src/sys/dev/virtio/virtio_mmiovar.h	Mon Jul 16 00:33:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_mmiovar.h,v 1.1 2018/06/06 20:35:36 jakllsch Exp $ */
+/* $NetBSD: virtio_mmiovar.h,v 1.2 2018/07/16 00:33:00 kre Exp $ */
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
  * All rights reserved.
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _VIRTIO_MMIOVAR_H_
+#ifndef _VIRTIO_MMIOREG_H_
 #define _VIRTIO_MMIOREG_H_
 
 #include  /* XXX: move to non-pci */



CVS commit: src/sys/dev/virtio

2018-07-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 16 00:33:00 UTC 2018

Modified Files:
src/sys/dev/virtio: virtio_mmiovar.h

Log Message:
Be consistent with double include guard name (clang actually detects this)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/virtio/virtio_mmiovar.h

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



CVS commit: src/compat

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:33:00 UTC 2018

Modified Files:
src/compat: archdirs.mk

Log Message:
gcc aarch64 does not have multilib


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/compat/archdirs.mk

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



CVS commit: src/compat

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:33:00 UTC 2018

Modified Files:
src/compat: archdirs.mk

Log Message:
gcc aarch64 does not have multilib


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/compat/archdirs.mk

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

Modified files:

Index: src/compat/archdirs.mk
diff -u src/compat/archdirs.mk:1.10 src/compat/archdirs.mk:1.11
--- src/compat/archdirs.mk:1.10	Wed May 27 11:35:23 2015
+++ src/compat/archdirs.mk	Sun Jul 15 20:33:00 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: archdirs.mk,v 1.10 2015/05/27 15:35:23 matt Exp $
+#	$NetBSD: archdirs.mk,v 1.11 2018/07/16 00:33:00 christos Exp $
 
 # list of subdirs used per-platform
 
@@ -26,6 +26,7 @@ ARCHDIR_SUBDIR= powerpc64/powerpc
 ARCHDIR_SUBDIR= riscv64/rv32
 .endif
 
+.if ${ACTIVE_CC} == "clang"
 .if (${MACHINE_ARCH} == "aarch64")
 ARCHDIR_SUBDIR+= arm/eabi
 ARCHDIR_SUBDIR+= arm/eabihf
@@ -33,3 +34,4 @@ ARCHDIR_SUBDIR+= arm/oabi
 .elif (${MACHINE_ARCH} == "aarch64eb")
 ARCHDIR_SUBDIR= arm/eabi
 .endif
+.endif



CVS commit: src/libexec/ld.elf_so/arch/aarch64

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:29:37 UTC 2018

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Initialize new_value to account for bogus return from the function.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.7 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.8
--- src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.7	Sun Feb  4 16:49:51 2018
+++ src/libexec/ld.elf_so/arch/aarch64/mdreloc.c	Sun Jul 15 20:29:37 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.7 2018/02/04 21:49:51 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.8 2018/07/16 00:29:37 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.7 2018/02/04 21:49:51 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.8 2018/07/16 00:29:37 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -311,7 +311,7 @@ Elf_Addr
 _rtld_bind(const Obj_Entry *obj, Elf_Word relaidx)
 {
 	const Elf_Rela *rela = obj->pltrela + relaidx;
-	Elf_Addr new_value;
+	Elf_Addr new_value = 0;
 
 	_rtld_shared_enter();
 	int err = _rtld_relocate_plt_object(obj, rela, _value);



CVS commit: src/libexec/ld.elf_so/arch/aarch64

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:29:37 UTC 2018

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Initialize new_value to account for bogus return from the function.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/libexec/ld.elf_so/arch/aarch64/mdreloc.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/lib/libcrypto/arch/aarch64

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:08:12 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64: crypto.inc

Log Message:
select assembler based on ACTIVE_CC


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc

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/lib/libcrypto/arch/aarch64

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:08:12 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64: crypto.inc

Log Message:
select assembler based on ACTIVE_CC


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc:1.2	Wed Mar  7 11:05:44 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/crypto.inc	Sun Jul 15 20:08:12 2018
@@ -3,6 +3,6 @@ CPUID_SRCS += arm64cpuid.S armcap.c
 CPUID = yes
 ARM_MAX_ARCH=8
 CPPFLAGS += -D__ARM_MAX_ARCH__=${ARM_MAX_ARCH}
-CFLAGS+= -no-integrated-as
+CFLAGS+= ${${ACTIVE_CC} == "clang" :? -no-integrated-as :}
 .include "../../crypto.inc"
 



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:04:47 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
Go back to using int for wchar_t as all the rest of the archs; using unsigned
int is complicated specially when it comes to comparing with WEOF etc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.2 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.3
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.2	Sun Jul 15 12:35:47 2018
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Sun Jul 15 20:04:47 2018
@@ -84,11 +84,6 @@
 #define TARGET_BINDS_LOCAL_P default_binds_local_p_2
 #endif
 
-/* Use the AAPCS type for wchar_t, override the one from
-   config/netbsd.h.  */
-#undef  WCHAR_TYPE
-#define WCHAR_TYPE  "unsigned int"
-
 #if 0
 #undef MCOUNT_NAME
 #define MCOUNT_NAME ".mcount"



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 16 00:04:47 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
Go back to using int for wchar_t as all the rest of the archs; using unsigned
int is complicated specially when it comes to comparing with WEOF etc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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



CVS commit: src/doc

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:57:45 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for ARMv7 performance event monitoring with tprof(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2411 -r1.2412 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2411 src/doc/CHANGES:1.2412
--- src/doc/CHANGES:1.2411	Sun Jul 15 16:26:27 2018
+++ src/doc/CHANGES	Sun Jul 15 23:57:45 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2411 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2412 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -178,3 +178,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	ipkdb(4): Removed. [maxv 20180714]
 	arm: Add support for ARMv8 performance event monitoring with tprof(4).
 		[jmcneill 20180715]
+	arm: Add support for ARMv7 performance event monitoring with tprof(4).
+		[jmcneill 20180715]



CVS commit: src/doc

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:57:45 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for ARMv7 performance event monitoring with tprof(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2411 -r1.2412 src/doc/CHANGES

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



CVS commit: src/usr.sbin/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:50:53 UTC 2018

Modified Files:
src/usr.sbin/tprof: Makefile
Added Files:
src/usr.sbin/tprof/arch: tprof_armv7.c

Log Message:
Add ARMv7 support.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/tprof/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/tprof/arch/tprof_armv7.c

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

Modified files:

Index: src/usr.sbin/tprof/Makefile
diff -u src/usr.sbin/tprof/Makefile:1.6 src/usr.sbin/tprof/Makefile:1.7
--- src/usr.sbin/tprof/Makefile:1.6	Sun Jul 15 16:25:31 2018
+++ src/usr.sbin/tprof/Makefile	Sun Jul 15 23:50:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2018/07/15 16:25:31 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.7 2018/07/15 23:50:53 jmcneill Exp $
 
 .PATH:	${.CURDIR}/arch
 
@@ -8,6 +8,8 @@ SRCS=	tprof.c tprof_analyze.c
 
 .if	${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 SRCS+=	tprof_x86.c
+.elif	!empty(MACHINE_ARCH:M*armv7*)
+SRCS+=	tprof_armv7.c
 .elif	${MACHINE_ARCH} == "aarch64"
 SRCS+=	tprof_armv8.c
 .else

Added files:

Index: src/usr.sbin/tprof/arch/tprof_armv7.c
diff -u /dev/null src/usr.sbin/tprof/arch/tprof_armv7.c:1.1
--- /dev/null	Sun Jul 15 23:50:53 2018
+++ src/usr.sbin/tprof/arch/tprof_armv7.c	Sun Jul 15 23:50:53 2018
@@ -0,0 +1,153 @@
+/* $NetBSD: tprof_armv7.c,v 1.1 2018/07/15 23:50:53 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "../tprof.h"
+
+struct pmu_event {
+	uint16_t		event;
+	const char		*name;
+};
+
+struct pmu_event_table {
+	const char		*name;
+	struct pmu_event	*events;
+	u_int			nevents;
+	struct pmu_event_table	*next;
+};
+
+/*
+ * Common event numbers, from ARM ARM.
+ */
+static struct pmu_event pmu_armv7_common_events[] = {
+	{ 0x00,	"SW_INCR" },
+	{ 0x01,	"L1I_CACHE_REFILL" },
+	{ 0x02,	"L1I_TLB_REFILL" },
+	{ 0x03,	"L1D_CACHE_REFILL" },
+	{ 0x04,	"L1D_CACHE" },
+	{ 0x05,	"L1D_TLB_REFILL" },
+	{ 0x06,	"LD_RETIRED" },
+	{ 0x07,	"ST_RETIRED" },
+	{ 0x08,	"INST_RETIRED" },
+	{ 0x09,	"EXC_TAKEN" },
+	{ 0x0a,	"EXC_RETURN" },
+	{ 0x0b,	"CID_WRITE_RETIRED" },
+	{ 0x0c,	"PC_WRITE_RETIRED" },
+	{ 0x0d,	"BR_IMMED_RETIRED" },
+	{ 0x0e,	"BR_RETURN_RETIRED" },
+	{ 0x0f,	"UNALIGNED_LDST_RETIRED" },
+	{ 0x10,	"BR_MIS_PRED" },
+	{ 0x11,	"CPU_CYCLES" },
+	{ 0x12,	"BR_PRED" },
+	{ 0x13,	"MEM_ACCESS" },
+	{ 0x14,	"L1I_CACHE" },
+	{ 0x15,	"L1D_CACHE_WB" },
+	{ 0x16,	"L2D_CACHE" },
+	{ 0x17,	"L2D_CACHE_REFILL" },
+	{ 0x18,	"L2D_CACHE_WB" },
+	{ 0x19,	"BUS_ACCESS" },
+	{ 0x1a,	"MEMORY_ERROR" },
+	{ 0x1b,	"INST_SPEC" },
+	{ 0x1c,	"TTBR_WRITE_RETIRED" },
+	{ 0x1d,	"BUS_CYCLES" },
+};
+
+static struct pmu_event_table pmu_armv7 = {
+	.name = "ARMv7 common architectural and microarchitectural events",
+	.events = pmu_armv7_common_events,
+	.nevents = __arraycount(pmu_armv7_common_events),
+	.next = NULL
+};
+
+static struct pmu_event_table *events = NULL;
+
+int
+tprof_event_init(uint32_t ident)
+{
+	if (ident != TPROF_IDENT_ARMV7_GENERIC)
+		return -1;
+
+	events = _armv7;
+
+	return 0;
+}
+
+static void
+tprof_event_list_table(struct pmu_event_table *tbl)
+{
+	u_int n;
+
+	printf("%s:\n", tbl->name);
+	for (n = 0; n < tbl->nevents; n++) {
+		printf("\t%s\n", tbl->events[n].name);
+	}
+
+	if (tbl->next)
+		tprof_event_list_table(tbl->next);
+}
+
+void
+tprof_event_list(void)
+{
+	tprof_event_list_table(events);
+}
+
+static void
+tprof_event_lookup_table(const char *name, struct tprof_param *param,
+struct pmu_event_table *tbl)
+{
+	u_int n;
+
+	for (n = 0; n 

CVS commit: src/usr.sbin/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:50:53 UTC 2018

Modified Files:
src/usr.sbin/tprof: Makefile
Added Files:
src/usr.sbin/tprof/arch: tprof_armv7.c

Log Message:
Add ARMv7 support.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/tprof/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/tprof/arch/tprof_armv7.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/evbarm/conf

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:48:45 UTC 2018

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

Log Message:
Enable armpmu and tprof


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/evbarm/conf/SUNXI

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



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:48:08 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt pmu_fdt.c

Log Message:
Add support for ARMv7 performance monitor (PMU).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/pmu_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.20 src/sys/arch/arm/fdt/files.fdt:1.21
--- src/sys/arch/arm/fdt/files.fdt:1.20	Sun Jul 15 16:07:49 2018
+++ src/sys/arch/arm/fdt/files.fdt	Sun Jul 15 23:48:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.20 2018/07/15 16:07:49 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.21 2018/07/15 23:48:08 jmcneill Exp $
 
 include	"dev/pckbport/files.pckbport"
 
@@ -53,6 +53,7 @@ file	arch/arm/fdt/psci_fdt.c			psci_fdt
 device	armpmu
 attach	armpmu at fdt with pmu_fdt
 file	arch/arm/fdt/pmu_fdt.c			pmu_fdt
+file	dev/tprof/tprof_armv7.c			pmu_fdt & arm32
 file	dev/tprof/tprof_armv8.c			pmu_fdt & aarch64
 
 attach	genfb at fdt with plfb_fdt: fdt_display_timing

Index: src/sys/arch/arm/fdt/pmu_fdt.c
diff -u src/sys/arch/arm/fdt/pmu_fdt.c:1.1 src/sys/arch/arm/fdt/pmu_fdt.c:1.2
--- src/sys/arch/arm/fdt/pmu_fdt.c:1.1	Sun Jul 15 16:07:49 2018
+++ src/sys/arch/arm/fdt/pmu_fdt.c	Sun Jul 15 23:48:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pmu_fdt.c,v 1.1 2018/07/15 16:07:49 jmcneill Exp $ */
+/* $NetBSD: pmu_fdt.c,v 1.2 2018/07/15 23:48:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.1 2018/07/15 16:07:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.2 2018/07/15 23:48:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -39,10 +39,14 @@ __KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 
 
 #include 
 
-#if defined(__aarch64__)
+#if defined(_ARM_ARCH_8)
 #include 
 #define arm_pmu_intr armv8_pmu_intr
 #define arm_pmu_init armv8_pmu_init
+#elif defined(_ARM_ARCH_7)
+#include 
+#define arm_pmu_intr armv7_pmu_intr
+#define arm_pmu_init armv7_pmu_init
 #endif
 
 #include 
@@ -59,6 +63,15 @@ static const char * const compatible[] =
 	"arm,cortex-a72-pmu",
 	"arm,cortex-a57-pmu",
 	"arm,cortex-a53-pmu",
+
+	"arm,cortex-a35-pmu",
+	"arm,cortex-a17-pmu",
+	"arm,cortex-a12-pmu",
+	"arm,cortex-a9-pmu",
+	"arm,cortex-a8-pmu",
+	"arm,cortex-a7-pmu",
+	"arm,cortex-a5-pmu",
+
 	NULL
 };
 



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:48:45 UTC 2018

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

Log Message:
Enable armpmu and tprof


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.79 src/sys/arch/evbarm/conf/SUNXI:1.80
--- src/sys/arch/evbarm/conf/SUNXI:1.79	Sat Jul 14 15:09:41 2018
+++ src/sys/arch/evbarm/conf/SUNXI	Sun Jul 15 23:48:45 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.79 2018/07/14 15:09:41 maxv Exp $
+#	$NetBSD: SUNXI,v 1.80 2018/07/15 23:48:45 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -174,6 +174,10 @@ cpus*		at fdt? pass 0
 cpu*		at fdt? pass 0
 cpufreqdt*	at cpu?
 
+# Performance monitors
+armpmu*		at fdt?
+pseudo-device	tprof
+
 # Power state coordination interface
 psci*		at fdt?
 



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:48:08 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt pmu_fdt.c

Log Message:
Add support for ARMv7 performance monitor (PMU).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/pmu_fdt.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/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:47:29 UTC 2018

Added Files:
src/sys/dev/tprof: tprof_armv7.c tprof_armv7.h

Log Message:
Add tprof backend for ARMv7 performance monitors.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/tprof/tprof_armv7.c \
src/sys/dev/tprof/tprof_armv7.h

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

Added files:

Index: src/sys/dev/tprof/tprof_armv7.c
diff -u /dev/null src/sys/dev/tprof/tprof_armv7.c:1.1
--- /dev/null	Sun Jul 15 23:47:29 2018
+++ src/sys/dev/tprof/tprof_armv7.c	Sun Jul 15 23:47:29 2018
@@ -0,0 +1,232 @@
+/* $NetBSD: tprof_armv7.c,v 1.1 2018/07/15 23:47:29 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv7.c,v 1.1 2018/07/15 23:47:29 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define	PMCR_D			__BIT(3)
+#define	PMCR_E			__BIT(0)
+
+#define	PMEVTYPER_P		__BIT(31)
+#define	PMEVTYPER_U		__BIT(30)
+#define	PMEVTYPER_EVTCOUNT	__BITS(7,0)
+
+static tprof_param_t armv7_pmu_param;
+static const u_int armv7_pmu_counter = 1;
+static uint32_t counter_val;
+static uint32_t counter_reset_val;
+
+static bool
+armv7_pmu_event_implemented(uint16_t event)
+{
+	uint32_t eid[2];
+
+	if (event >= 64)
+		return false;
+
+	eid[0] = armreg_pmceid0_read();
+	eid[1] = armreg_pmceid1_read();
+
+	const u_int idx = event / 32;
+	const u_int bit = event % 32;
+
+	if (eid[idx] & __BIT(bit))
+		return true;
+
+	return false;
+}
+
+static void
+armv7_pmu_set_pmevtyper(u_int counter, uint64_t val)
+{
+	armreg_pmselr_write(counter);
+	arm_isb();
+	armreg_pmxevtyper_write(val);
+}
+
+static void
+armv7_pmu_set_pmevcntr(u_int counter, uint32_t val)
+{
+	armreg_pmselr_write(counter);
+	arm_isb();
+	armreg_pmxevcntr_write(val);
+}
+
+static void
+armv7_pmu_start_cpu(void *arg1, void *arg2)
+{
+	const uint32_t counter_mask = __BIT(armv7_pmu_counter);
+	uint64_t pmcr, pmevtyper;
+
+	/* Enable performance monitor */
+	pmcr = armreg_pmcr_read();
+	pmcr |= PMCR_E;
+	armreg_pmcr_write(pmcr);
+
+	/* Disable event counter */
+	armreg_pmcntenclr_write(counter_mask);
+
+	/* Configure event counter */
+	pmevtyper = __SHIFTIN(armv7_pmu_param.p_event, PMEVTYPER_EVTCOUNT);
+	if (!ISSET(armv7_pmu_param.p_flags, TPROF_PARAM_USER))
+		pmevtyper |= PMEVTYPER_U;
+	if (!ISSET(armv7_pmu_param.p_flags, TPROF_PARAM_KERN))
+		pmevtyper |= PMEVTYPER_P;
+
+	armv7_pmu_set_pmevtyper(armv7_pmu_counter, pmevtyper);
+
+	/* Enable overflow interrupts */
+	armreg_pmintenset_write(counter_mask);
+
+	/* Clear overflow flag */
+	armreg_pmovsr_write(counter_mask);
+
+	/* Initialize event counter value */
+	armv7_pmu_set_pmevcntr(armv7_pmu_counter, counter_reset_val);
+
+	/* Enable event counter */
+	armreg_pmcntenset_write(counter_mask);
+}
+
+static void
+armv7_pmu_stop_cpu(void *arg1, void *arg2)
+{
+	const uint32_t counter_mask = __BIT(armv7_pmu_counter);
+	uint32_t pmcr;
+
+	/* Disable overflow interrupts */
+	armreg_pmintenclr_write(counter_mask);
+
+	/* Disable event counter */
+	armreg_pmcntenclr_write(counter_mask);
+
+	/* Disable performance monitor */
+	pmcr = armreg_pmcr_read();
+	pmcr &= ~PMCR_E;
+	armreg_pmcr_write(pmcr);
+}
+
+static uint64_t
+armv7_pmu_estimate_freq(void)
+{
+	uint64_t cpufreq = curcpu()->ci_data.cpu_cc_freq;
+	uint64_t freq = 1;
+	uint32_t pmcr;
+
+	counter_val = cpufreq / freq;
+	if (counter_val == 0)
+		counter_val = 40ULL / freq;
+
+	pmcr = armreg_pmcr_read();
+	if (pmcr & PMCR_D)
+		counter_val /= 64;
+
+	return freq;
+}
+
+static 

CVS commit: src/sys/dev/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:47:29 UTC 2018

Added Files:
src/sys/dev/tprof: tprof_armv7.c tprof_armv7.h

Log Message:
Add tprof backend for ARMv7 performance monitors.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/tprof/tprof_armv7.c \
src/sys/dev/tprof/tprof_armv7.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/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:46:25 UTC 2018

Modified Files:
src/sys/dev/tprof: tprof_types.h

Log Message:
Add TPROF_IDENT_ARMV7_GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/tprof/tprof_types.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/tprof/tprof_types.h
diff -u src/sys/dev/tprof/tprof_types.h:1.4 src/sys/dev/tprof/tprof_types.h:1.5
--- src/sys/dev/tprof/tprof_types.h:1.4	Sun Jul 15 18:55:05 2018
+++ src/sys/dev/tprof/tprof_types.h	Sun Jul 15 23:46:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_types.h,v 1.4 2018/07/15 18:55:05 jmcneill Exp $	*/
+/*	$NetBSD: tprof_types.h,v 1.5 2018/07/15 23:46:25 jmcneill Exp $	*/
 
 /*-
  * Copyright (c)2010,2011 YAMAMOTO Takashi,
@@ -65,5 +65,6 @@ typedef struct tprof_param {
 #define	TPROF_IDENT_INTEL_GENERIC	0x01
 #define	TPROF_IDENT_AMD_GENERIC		0x02
 #define	TPROF_IDENT_ARMV8_GENERIC	0x03
+#define	TPROF_IDENT_ARMV7_GENERIC	0x04
 
 #endif /* _DEV_TPROF_TPROF_TYPES_H_ */



CVS commit: src/sys/dev/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:46:25 UTC 2018

Modified Files:
src/sys/dev/tprof: tprof_types.h

Log Message:
Add TPROF_IDENT_ARMV7_GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/tprof/tprof_types.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/arm/include

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:46:57 UTC 2018

Modified Files:
src/sys/arch/arm/include: armreg.h

Log Message:
Add some PMC event registers


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/arm/include/armreg.h

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

Modified files:

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.121 src/sys/arch/arm/include/armreg.h:1.122
--- src/sys/arch/arm/include/armreg.h:1.121	Mon May 14 17:15:54 2018
+++ src/sys/arch/arm/include/armreg.h	Sun Jul 15 23:46:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.121 2018/05/14 17:15:54 joerg Exp $	*/
+/*	$NetBSD: armreg.h,v 1.122 2018/07/15 23:46:57 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -835,8 +835,16 @@ ARMREG_READ_INLINE(pmcntenclr, "p15,0,%0
 ARMREG_WRITE_INLINE(pmcntenclr, "p15,0,%0,c9,c12,2") /* PMC Count Enable Clear */
 ARMREG_READ_INLINE(pmovsr, "p15,0,%0,c9,c12,3") /* PMC Overflow Flag Status */
 ARMREG_WRITE_INLINE(pmovsr, "p15,0,%0,c9,c12,3") /* PMC Overflow Flag Status */
+ARMREG_READ_INLINE(pmselr, "p15,0,%0,c9,c12,5") /* PMC Event Counter Selection */
+ARMREG_WRITE_INLINE(pmselr, "p15,0,%0,c9,c12,5") /* PMC Event Counter Selection */
+ARMREG_READ_INLINE(pmceid0, "p15,0,%0,c9,c12,6") /* PMC Event ID 0 */
+ARMREG_READ_INLINE(pmceid1, "p15,0,%0,c9,c12,7") /* PMC Event ID 1 */
 ARMREG_READ_INLINE(pmccntr, "p15,0,%0,c9,c13,0") /* PMC Cycle Counter */
 ARMREG_WRITE_INLINE(pmccntr, "p15,0,%0,c9,c13,0") /* PMC Cycle Counter */
+ARMREG_READ_INLINE(pmxevtyper, "p15,0,%0,c9,c13,1") /* PMC Event Type Select */
+ARMREG_WRITE_INLINE(pmxevtyper, "p15,0,%0,c9,c13,1") /* PMC Event Type Select */
+ARMREG_READ_INLINE(pmxevcntr, "p15,0,%0,c9,c13,2") /* PMC Event Count */
+ARMREG_WRITE_INLINE(pmxevcntr, "p15,0,%0,c9,c13,2") /* PMC Event Count */
 ARMREG_READ_INLINE(pmuserenr, "p15,0,%0,c9,c14,0") /* PMC User Enable */
 ARMREG_WRITE_INLINE(pmuserenr, "p15,0,%0,c9,c14,0") /* PMC User Enable */
 ARMREG_READ_INLINE(pmintenset, "p15,0,%0,c9,c14,1") /* PMC Interrupt Enable Set */



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 23:46:57 UTC 2018

Modified Files:
src/sys/arch/arm/include: armreg.h

Log Message:
Add some PMC event registers


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/arm/include/armreg.h

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



CVS commit: src/sys/compat/linux/common

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 21:31:00 UTC 2018

Modified Files:
src/sys/compat/linux/common: linux_exec_elf32.c

Log Message:
- fix constants and explain limit
- use machine32 instead of hard-coded x86 stuff


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/compat/linux/common/linux_exec_elf32.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_exec_elf32.c
diff -u src/sys/compat/linux/common/linux_exec_elf32.c:1.96 src/sys/compat/linux/common/linux_exec_elf32.c:1.97
--- src/sys/compat/linux/common/linux_exec_elf32.c:1.96	Mon Jul  9 01:43:35 2018
+++ src/sys/compat/linux/common/linux_exec_elf32.c	Sun Jul 15 17:31:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_exec_elf32.c,v 1.96 2018/07/09 05:43:35 msaitoh Exp $	*/
+/*	$NetBSD: linux_exec_elf32.c,v 1.97 2018/07/15 21:31:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.96 2018/07/09 05:43:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.97 2018/07/15 21:31:00 christos Exp $");
 
 #ifndef ELFSIZE
 /* XXX should die */
@@ -323,8 +323,9 @@ ELFNAME2(linux,go_rt0_signature)(struct 
 		goto out;
 	}
 
-	if (sh[i].sh_size > 1024 * 1014)
-		sh[i].sh_size = 1014 * 1014;
+	// Don't scan more than 1MB
+	if (sh[i].sh_size > 1024 * 1024)
+		sh[i].sh_size = 1024 * 1024;
 
 	tmp = malloc(sh[i].sh_size, M_TEMP, M_WAITOK);
 	error = exec_read_from(l, epp->ep_vp, sh[i].sh_offset, tmp,
@@ -333,8 +334,9 @@ ELFNAME2(linux,go_rt0_signature)(struct 
 		goto out;
 
 #if (ELFSIZE == 32)
-	if (strcmp(machine, "amd64") == 0)
-		m = "i386";
+	extern const char machine32[] __weak;
+	if (machine32 != NULL)
+		m = machine32;
 	else
 		m = machine;
 #else



CVS commit: src/sys/compat/linux/common

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 21:31:00 UTC 2018

Modified Files:
src/sys/compat/linux/common: linux_exec_elf32.c

Log Message:
- fix constants and explain limit
- use machine32 instead of hard-coded x86 stuff


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/compat/linux/common/linux_exec_elf32.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/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 18:55:05 UTC 2018

Modified Files:
src/sys/dev/tprof: tprof_types.h

Log Message:
Define TPROF_IDENT_ARMV8_GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_types.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/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 18:55:05 UTC 2018

Modified Files:
src/sys/dev/tprof: tprof_types.h

Log Message:
Define TPROF_IDENT_ARMV8_GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_types.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/tprof/tprof_types.h
diff -u src/sys/dev/tprof/tprof_types.h:1.3 src/sys/dev/tprof/tprof_types.h:1.4
--- src/sys/dev/tprof/tprof_types.h:1.3	Fri Jul 13 07:56:29 2018
+++ src/sys/dev/tprof/tprof_types.h	Sun Jul 15 18:55:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_types.h,v 1.3 2018/07/13 07:56:29 maxv Exp $	*/
+/*	$NetBSD: tprof_types.h,v 1.4 2018/07/15 18:55:05 jmcneill Exp $	*/
 
 /*-
  * Copyright (c)2010,2011 YAMAMOTO Takashi,
@@ -64,5 +64,6 @@ typedef struct tprof_param {
 #define	TPROF_IDENT_NONE		0x00
 #define	TPROF_IDENT_INTEL_GENERIC	0x01
 #define	TPROF_IDENT_AMD_GENERIC		0x02
+#define	TPROF_IDENT_ARMV8_GENERIC	0x03
 
 #endif /* _DEV_TPROF_TPROF_TYPES_H_ */



CVS commit: src/sys/dev/usb

2018-07-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jul 15 18:36:51 UTC 2018

Modified Files:
src/sys/dev/usb: usbhid.h

Log Message:
Side-load dev/hid/hid.h to restore the previous visibility of macros
like HUP_GENERIC_DESKTOP.

This header is user-visible and used by third party code. with this
change we don't need to modify pkgsrc/emulators/vice to know about
new headers in -current. Other users probably exist.

ok xtos.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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/usb/usbhid.h
diff -u src/sys/dev/usb/usbhid.h:1.17 src/sys/dev/usb/usbhid.h:1.18
--- src/sys/dev/usb/usbhid.h:1.17	Sun Dec 10 17:03:07 2017
+++ src/sys/dev/usb/usbhid.h	Sun Jul 15 18:36:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbhid.h,v 1.17 2017/12/10 17:03:07 bouyer Exp $	*/
+/*	$NetBSD: usbhid.h,v 1.18 2018/07/15 18:36:51 maya Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbhid.h,v 1.7 1999/11/17 22:33:51 n_hibma Exp $ */
 
 /*
@@ -35,6 +35,8 @@
 #ifndef _DEV_USB_USBHID_H_
 #define _DEV_USB_USBHID_H_
 
+#include 
+
 #define UR_GET_HID_DESCRIPTOR	0x06
 #define  UDESC_HID		0x21
 #define  UDESC_REPORT		0x22



CVS commit: src/sys/dev/usb

2018-07-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jul 15 18:36:51 UTC 2018

Modified Files:
src/sys/dev/usb: usbhid.h

Log Message:
Side-load dev/hid/hid.h to restore the previous visibility of macros
like HUP_GENERIC_DESKTOP.

This header is user-visible and used by third party code. with this
change we don't need to modify pkgsrc/emulators/vice to know about
new headers in -current. Other users probably exist.

ok xtos.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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/evbarm/conf

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 18:00:14 UTC 2018

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

Log Message:
add pseudo-device tprof (fix build)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/conf/GENERIC64

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.28 src/sys/arch/evbarm/conf/GENERIC64:1.29
--- src/sys/arch/evbarm/conf/GENERIC64:1.28	Sun Jul 15 16:09:05 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Jul 15 18:00:14 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.28 2018/07/15 16:09:05 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.29 2018/07/15 18:00:14 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -88,6 +88,7 @@ cpu*		at fdt? pass 0
 
 # Performance monitors
 armpmu*		at fdt?
+pseudo-device	tprof
 
 # CPU frequency scaling
 cpufreqdt*	at cpu?



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 18:00:14 UTC 2018

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

Log Message:
add pseudo-device tprof (fix build)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/conf/GENERIC64

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



CVS commit: src/sys/dev/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:59:16 UTC 2018

Modified Files:
src/sys/dev/fdt: fdt_intr.c

Log Message:
Get rid of unnecessary calls to kmem_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/fdt/fdt_intr.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/fdt/fdt_intr.c
diff -u src/sys/dev/fdt/fdt_intr.c:1.16 src/sys/dev/fdt/fdt_intr.c:1.17
--- src/sys/dev/fdt/fdt_intr.c:1.16	Sun Jul 15 13:24:05 2018
+++ src/sys/dev/fdt/fdt_intr.c	Sun Jul 15 16:59:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.16 2018/07/15 13:24:05 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.17 2018/07/15 16:59:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.16 2018/07/15 13:24:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.17 2018/07/15 16:59:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -58,8 +58,8 @@ struct fdtbus_interrupt_cookie {
 static LIST_HEAD(, fdtbus_interrupt_cookie) fdtbus_interrupt_cookies =
 LIST_HEAD_INITIALIZER(fdtbus_interrupt_cookies);
 
-static u_int *	get_specifier_by_index(int, int, int *);
-static u_int *	get_specifier_from_map(int, const u_int *, int *);
+static const u_int *	get_specifier_by_index(int, int, int *);
+static const u_int *	get_specifier_from_map(int, const u_int *, int *);
 
 /*
  * Find the interrupt controller for a given node. This function will either
@@ -136,7 +136,7 @@ fdtbus_intr_establish(int phandle, u_int
 {
 	struct fdtbus_interrupt_controller *ic;
 	struct fdtbus_interrupt_cookie *c = NULL;
-	u_int *specifier;
+	const u_int *specifier;
 	int ihandle;
 	void *ih;
 
@@ -148,7 +148,7 @@ fdtbus_intr_establish(int phandle, u_int
 	if (ic == NULL)
 		return NULL;
 
-	ih = ic->ic_funcs->establish(ic->ic_dev, specifier,
+	ih = ic->ic_funcs->establish(ic->ic_dev, __UNCONST(specifier),
 	ipl, flags, func, arg);
 	if (ih != NULL) {
 		c = kmem_alloc(sizeof(*c), KM_SLEEP);
@@ -185,7 +185,7 @@ bool
 fdtbus_intr_str(int phandle, u_int index, char *buf, size_t buflen)
 {
 	struct fdtbus_interrupt_controller *ic;
-	u_int *specifier;
+	const u_int *specifier;
 	int ihandle;
 
 	specifier = get_specifier_by_index(phandle, index, );
@@ -194,7 +194,7 @@ fdtbus_intr_str(int phandle, u_int index
 	if (ic == NULL)
 		return false;
 
-	return ic->ic_funcs->intrstr(ic->ic_dev, specifier, buf, buflen);
+	return ic->ic_funcs->intrstr(ic->ic_dev, __UNCONST(specifier), buf, buflen);
 }
 
 static int
@@ -221,10 +221,10 @@ find_interrupt_cells(int phandle)
 	return 0;
 }
 
-static u_int *
+static const u_int *
 get_specifier_from_map(int phandle, const u_int *interrupt_spec, int *piphandle)
 {
-	u_int *result = NULL;
+	const u_int *result = NULL;
 	int len, resid;
 
 	const u_int *data = fdtbus_get_prop(phandle, "interrupt-map", );
@@ -267,15 +267,14 @@ get_specifier_from_map(int phandle, cons
 #endif
 
 		if (memcmp([cis_off], interrupt_spec, cis_cells * 4) == 0) {
-			const int slen = pus_cells + pis_cells;
 #ifdef FDT_INTR_DEBUG
+			const int slen = pus_cells + pis_cells;
 			printf(" intr map match iparent %08x slen %d:", iparent, slen);
 			for (int i = 0; i < slen; i++)
 printf(" %08x", p[pus_off + i]);
 			printf("\n");
 #endif
-			result = kmem_alloc(slen, KM_SLEEP);
-			memcpy(result, [pus_off], slen * 4);
+			result = [pus_off];
 			*piphandle = iparent;
 			goto done;
 		}
@@ -291,11 +290,10 @@ done:
 	return result;
 }
 
-static u_int *
+static const u_int *
 get_specifier_by_index(int phandle, int pindex, int *piphandle)
 {
 	const u_int *node_specifier;
-	u_int *specifier;
 	int interrupt_parent, interrupt_cells, len;
 
 	interrupt_parent = fdtbus_get_interrupt_parent(phandle);
@@ -320,10 +318,7 @@ get_specifier_by_index(int phandle, int 
 	if (of_hasprop(interrupt_parent, "interrupt-map"))
 		return get_specifier_from_map(interrupt_parent, node_specifier, piphandle);
 
-	specifier = kmem_alloc(interrupt_cells * sizeof(u_int), KM_SLEEP);
-	memcpy(specifier, node_specifier, interrupt_cells * 4);
-
 	*piphandle = interrupt_parent;
 
-	return specifier;
+	return node_specifier;
 }



CVS commit: src/sys/dev/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:59:16 UTC 2018

Modified Files:
src/sys/dev/fdt: fdt_intr.c

Log Message:
Get rid of unnecessary calls to kmem_alloc


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

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



CVS commit: src/external/gpl3/gcc/usr.bin/frontend

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 16:37:04 UTC 2018

Modified Files:
src/external/gpl3/gcc/usr.bin/frontend: Makefile

Log Message:
Give aarch64 the "special treatment", since mknative does not include the
target-specific build file.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/usr.bin/frontend/Makefile

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



CVS commit: src/external/gpl3/gcc/usr.bin/frontend

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 16:37:04 UTC 2018

Modified Files:
src/external/gpl3/gcc/usr.bin/frontend: Makefile

Log Message:
Give aarch64 the "special treatment", since mknative does not include the
target-specific build file.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/usr.bin/frontend/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/frontend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/frontend/Makefile:1.11 src/external/gpl3/gcc/usr.bin/frontend/Makefile:1.12
--- src/external/gpl3/gcc/usr.bin/frontend/Makefile:1.11	Wed Nov 15 02:47:40 2017
+++ src/external/gpl3/gcc/usr.bin/frontend/Makefile	Sun Jul 15 12:37:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2017/11/15 07:47:40 mrg Exp $
+#	$NetBSD: Makefile,v 1.12 2018/07/15 16:37:04 christos Exp $
 
 LIBISPRIVATE=	yes
 
@@ -20,6 +20,10 @@ SRCS+=		driver-i386.c
 SRCS+=		driver-rs6000.c
 .PATH:		${DIST}/gcc/config/rs6000
 .endif
+.if  ${GCC_MACHINE_ARCH} == "aarch64" 
+SRCS+=		driver-aarch64.c
+.PATH:		${DIST}/gcc/config/aarch64
+.endif
 
 .include "../Makefile.target-defines"
 



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 16:35:47 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
There is no more SUBTARGET_EXTRA_SPECS, so hijack the EXTRA_SPECS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.1 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.2
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.1	Sat Jul 14 19:47:32 2018
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Sun Jul 15 12:35:47 2018
@@ -20,10 +20,6 @@
 #ifndef GCC_AARCH64_NETBSD_H
 #define GCC_AARCH64_NETBSD_H
 
-#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS\
-  NETBSD_SUBTARGET_EXTRA_SPECS
-
 #define TARGET_LINKER_BIG_EMULATION "aarch64nbsdb"
 #define TARGET_LINKER_LITTLE_EMULATION "aarch64nbsd"
 
@@ -36,6 +32,8 @@
 #undef  SUBTARGET_EXTRA_LINK_SPEC
 #define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
 
+#define NETBSD_ENTRY_POINT "__start"
+
 #define NETBSD_TARGET_LINK_SPEC  "%{h*}			\
-X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} \
%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} \
@@ -96,4 +94,9 @@
 #define MCOUNT_NAME ".mcount"
 #endif
 
+#undef EXTRA_SPECS
+#define EXTRA_SPECS \
+  { "asm_cpu_spec", ASM_CPU_SPEC }, \
+  NETBSD_SUBTARGET_EXTRA_SPECS
+
 #endif  /* GCC_AARCH64_NETBSD_H */



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

2018-07-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 16:35:47 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
There is no more SUBTARGET_EXTRA_SPECS, so hijack the EXTRA_SPECS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h

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



CVS commit: src/doc

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:26:27 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for ARMv8 performance event monitoring with tprof(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2410 -r1.2411 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2410 src/doc/CHANGES:1.2411
--- src/doc/CHANGES:1.2410	Sun Jul 15 05:25:20 2018
+++ src/doc/CHANGES	Sun Jul 15 16:26:27 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2410 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2411 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -176,3 +176,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	kernel: Remove pmc(9) and X86PMC. Replaced by a revamped
 		tprof(4). [maxv 20180714]
 	ipkdb(4): Removed. [maxv 20180714]
+	arm: Add support for ARMv8 performance event monitoring with tprof(4).
+		[jmcneill 20180715]



CVS commit: src/doc

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:26:27 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
arm: Add support for ARMv8 performance event monitoring with tprof(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2410 -r1.2411 src/doc/CHANGES

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



CVS commit: src/usr.sbin/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:25:31 UTC 2018

Modified Files:
src/usr.sbin/tprof: Makefile
Added Files:
src/usr.sbin/tprof/arch: tprof_armv8.c

Log Message:
Add ARMv8 support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/tprof/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/tprof/arch/tprof_armv8.c

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

Modified files:

Index: src/usr.sbin/tprof/Makefile
diff -u src/usr.sbin/tprof/Makefile:1.5 src/usr.sbin/tprof/Makefile:1.6
--- src/usr.sbin/tprof/Makefile:1.5	Fri Jul 13 11:03:36 2018
+++ src/usr.sbin/tprof/Makefile	Sun Jul 15 16:25:31 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2018/07/13 11:03:36 maxv Exp $
+#	$NetBSD: Makefile,v 1.6 2018/07/15 16:25:31 jmcneill Exp $
 
 .PATH:	${.CURDIR}/arch
 
@@ -8,6 +8,8 @@ SRCS=	tprof.c tprof_analyze.c
 
 .if	${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 SRCS+=	tprof_x86.c
+.elif	${MACHINE_ARCH} == "aarch64"
+SRCS+=	tprof_armv8.c
 .else
 SRCS+=	tprof_noarch.c
 .endif

Added files:

Index: src/usr.sbin/tprof/arch/tprof_armv8.c
diff -u /dev/null src/usr.sbin/tprof/arch/tprof_armv8.c:1.1
--- /dev/null	Sun Jul 15 16:25:31 2018
+++ src/usr.sbin/tprof/arch/tprof_armv8.c	Sun Jul 15 16:25:31 2018
@@ -0,0 +1,180 @@
+/* $NetBSD: tprof_armv8.c,v 1.1 2018/07/15 16:25:31 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "../tprof.h"
+
+struct pmu_event {
+	uint16_t		event;
+	const char		*name;
+};
+
+struct pmu_event_table {
+	const char		*name;
+	struct pmu_event	*events;
+	u_int			nevents;
+	struct pmu_event_table	*next;
+};
+
+/*
+ * Common event numbers, from ARMv8 ARM.
+ */
+static struct pmu_event pmu_armv8_common_events[] = {
+	{ 0x,	"SW_INCR" },
+	{ 0x0001,	"L1I_CACHE_REFILL" },
+	{ 0x0002,	"L1I_TLB_REFILL" },
+	{ 0x0003,	"L1D_CACHE_REFILL" },
+	{ 0x0004,	"L1D_CACHE" },
+	{ 0x0005,	"L1D_TLB_REFILL" },
+	{ 0x0006,	"LD_RETIRED" },
+	{ 0x0007,	"ST_RETIRED" },
+	{ 0x0008,	"INST_RETIRED" },
+	{ 0x0009,	"EXC_TAKEN" },
+	{ 0x000a,	"EXC_RETURN" },
+	{ 0x000b,	"CID_WRITE_RETIRED" },
+	{ 0x000c,	"PC_WRITE_RETIRED" },
+	{ 0x000d,	"BR_IMMED_RETIRED" },
+	{ 0x000e,	"BR_RETURN_RETIRED" },
+	{ 0x000f,	"UNALIGNED_LDST_RETIRED" },
+	{ 0x0010,	"BR_MIS_PRED" },
+	{ 0x0011,	"CPU_CYCLES" },
+	{ 0x0012,	"BR_PRED" },
+	{ 0x0013,	"MEM_ACCESS" },
+	{ 0x0014,	"L1I_CACHE" },
+	{ 0x0015,	"L1D_CACHE_WB" },
+	{ 0x0016,	"L2D_CACHE" },
+	{ 0x0017,	"L2D_CACHE_REFILL" },
+	{ 0x0018,	"L2D_CACHE_WB" },
+	{ 0x0019,	"BUS_ACCESS" },
+	{ 0x001a,	"MEMORY_ERROR" },
+	{ 0x001b,	"INST_SPEC" },
+	{ 0x001c,	"TTBR_WRITE_RETIRED" },
+	{ 0x001d,	"BUS_CYCLES" },
+	{ 0x001e,	"CHAIN" },
+	{ 0x001f,	"L1D_CACHE_ALLOCATE" },
+	{ 0x0020,	"L2D_CACHE_ALLOCATE" },
+	{ 0x0021,	"BR_RETIRED" },
+	{ 0x0022,	"BR_MIS_PRED_RETIRED" },
+	{ 0x0023,	"STALL_FRONTEND" },
+	{ 0x0024,	"STALL_BACKEND" },
+	{ 0x0025,	"L1D_TLB" },
+	{ 0x0026,	"L1I_TLB" },
+	{ 0x0027,	"L2I_CACHE" },
+	{ 0x0028,	"L2I_CACHE_REFILL" },
+	{ 0x0029,	"L3D_CACHE_ALLOCATE" },
+	{ 0x002a,	"L3D_CACHE_REFILL" },
+	{ 0x002b,	"L3D_CACHE" },
+	{ 0x002c,	"L3D_CACHE_WB" },
+	{ 0x002d,	"L2D_TLB_REFILL" },
+	{ 0x002e,	"L2I_TLB_REFILL" },
+	{ 0x002f,	"L2D_TLB" },
+	{ 0x0030,	"L2I_TLB" },
+	{ 0x0031,	"REMOTE_ACCESS" },
+	{ 0x0032,	"LL_CACHE" },
+	{ 0x0033,	"LL_CACHE_MISS" },
+	{ 0x0034,	"DTLB_WALK" },
+	{ 0x0035,	"ITLB_WALK" },
+	{ 0x0036,	"LL_CACHE_RD" },
+	{ 0x0037,	"LL_CACHE_MISS_RD" },
+	{ 0x0038,	"REMOTE_ACCESS_RD" },
+};
+
+static struct pmu_event_table pmu_armv8 = {
+	

CVS commit: src/usr.sbin/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:25:31 UTC 2018

Modified Files:
src/usr.sbin/tprof: Makefile
Added Files:
src/usr.sbin/tprof/arch: tprof_armv8.c

Log Message:
Add ARMv8 support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/tprof/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/tprof/arch/tprof_armv8.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/evbarm/conf

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:09:05 UTC 2018

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

Log Message:
Add armpmu


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/conf/GENERIC64

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.27 src/sys/arch/evbarm/conf/GENERIC64:1.28
--- src/sys/arch/evbarm/conf/GENERIC64:1.27	Sat Jul 14 15:09:41 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sun Jul 15 16:09:05 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.27 2018/07/14 15:09:41 maxv Exp $
+#	$NetBSD: GENERIC64,v 1.28 2018/07/15 16:09:05 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -86,6 +86,9 @@ simplebus*	at fdt? pass 0
 cpus*		at fdt? pass 0
 cpu*		at fdt? pass 0
 
+# Performance monitors
+armpmu*		at fdt?
+
 # CPU frequency scaling
 cpufreqdt*	at cpu?
 



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:09:05 UTC 2018

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

Log Message:
Add armpmu


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/conf/GENERIC64

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



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:08:30 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Add more PMC registers


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/include/armreg.h

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

Modified files:

Index: src/sys/arch/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.10 src/sys/arch/aarch64/include/armreg.h:1.11
--- src/sys/arch/aarch64/include/armreg.h:1.10	Mon May 14 17:15:54 2018
+++ src/sys/arch/aarch64/include/armreg.h	Sun Jul 15 16:08:30 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.10 2018/05/14 17:15:54 joerg Exp $ */
+/* $NetBSD: armreg.h,v 1.11 2018/07/15 16:08:30 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -837,6 +837,70 @@ static const uintmax_t
 
 AARCH64REG_READ_INLINE(pmccntr_el0)
 
+AARCH64REG_READ_INLINE(pmceid0_el0);
+AARCH64REG_READ_INLINE(pmceid1_el0);
+
+AARCH64REG_WRITE_INLINE(pmcntenclr_el0);
+AARCH64REG_WRITE_INLINE(pmcntenset_el0);
+
+AARCH64REG_READ_INLINE(pmcr_el0)
+AARCH64REG_WRITE_INLINE(pmcr_el0)
+
+static const uintmax_t
+PMCR_IMP  = __BITS(31,24),	// Implementor code
+PMCR_IDCODE   = __BITS(23,16),	// Identification code
+PMCR_N= __BITS(15,11),	// Number of event counters
+PMCR_LC   = __BIT(6),		// Long cycle counter enable
+PMCR_DP   = __BIT(5),		// Disable cycle counter when event
+	// counting is prohibited
+PMCR_X= __BIT(4),		// Enable export of events
+PMCR_D= __BIT(3),		// Clock divider
+PMCR_C= __BIT(2),		// Cycle counter reset
+PMCR_P= __BIT(1),		// Event counter reset
+PMCR_E= __BIT(0);		// Enable
+
+
+AARCH64REG_READ_INLINE(pmevcntr1_el0);
+AARCH64REG_WRITE_INLINE(pmevcntr1_el0);
+
+AARCH64REG_READ_INLINE(pmevtyper1_el0)
+AARCH64REG_WRITE_INLINE(pmevtyper1_el0)
+
+static uintmax_t 
+PMEVTYPER_P   = __BIT(31),		// Don't count events in EL1
+PMEVTYPER_U   = __BIT(30),		// Don't count events in EL0
+PMEVTYPER_NSK = __BIT(29),		// Don't count events in NS EL1
+PMEVTYPER_NSU = __BIT(28),		// Don't count events in NS EL0
+PMEVTYPER_NSH = __BIT(27),		// Count events in NS EL2
+PMEVTYPER_M   = __BIT(26),		// Don't count events in EL3
+PMEVTYPER_MT  = __BIT(25),		// Count events on all CPUs with same
+	// aff1 level
+PMEVTYPER_EVTCOUNT = __BITS(15,0);	// Event to count
+
+AARCH64REG_WRITE_INLINE(pmintenclr_el1);
+AARCH64REG_WRITE_INLINE(pmintenset_el1);
+
+AARCH64REG_WRITE_INLINE(pmovsclr_el0);
+AARCH64REG_READ_INLINE(pmovsset_el0);
+AARCH64REG_WRITE_INLINE(pmovsset_el0);
+
+AARCH64REG_WRITE_INLINE(pmselr_el0);
+
+AARCH64REG_WRITE_INLINE(pmswinc_el0);
+
+AARCH64REG_READ_INLINE(pmuserenr_el0);
+AARCH64REG_WRITE_INLINE(pmuserenr_el0);
+
+AARCH64REG_READ_INLINE(pmxevcntr_el0);
+AARCH64REG_WRITE_INLINE(pmxevcntr_el0);
+
+AARCH64REG_READ_INLINE(pmxevtyper_el0);
+AARCH64REG_WRITE_INLINE(pmxevtyper_el0);
+
+/*
+ * Generic timer registers
+ */
+
 AARCH64REG_READ_INLINE(cntfrq_el0)
 
 AARCH64REG_READ_INLINE(cnthctl_el2)



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:08:30 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Add more PMC registers


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/include/armreg.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/arm/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:07:49 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
Add glue for ARMv8 performance monitor (PMU).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/pmu_fdt.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/arm/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:07:49 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
Add glue for ARMv8 performance monitor (PMU).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/pmu_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.19 src/sys/arch/arm/fdt/files.fdt:1.20
--- src/sys/arch/arm/fdt/files.fdt:1.19	Sat Jun 30 16:30:35 2018
+++ src/sys/arch/arm/fdt/files.fdt	Sun Jul 15 16:07:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.19 2018/06/30 16:30:35 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.20 2018/07/15 16:07:49 jmcneill Exp $
 
 include	"dev/pckbport/files.pckbport"
 
@@ -50,6 +50,11 @@ file	arch/arm/fdt/plrtc_fdt.c		plrtc_fdt
 attach	psci at fdt with psci_fdt
 file	arch/arm/fdt/psci_fdt.c			psci_fdt
 
+device	armpmu
+attach	armpmu at fdt with pmu_fdt
+file	arch/arm/fdt/pmu_fdt.c			pmu_fdt
+file	dev/tprof/tprof_armv8.c			pmu_fdt & aarch64
+
 attach	genfb at fdt with plfb_fdt: fdt_display_timing
 file	arch/arm/fdt/plfb_fdt.c			plfb_fdt
 

Added files:

Index: src/sys/arch/arm/fdt/pmu_fdt.c
diff -u /dev/null src/sys/arch/arm/fdt/pmu_fdt.c:1.1
--- /dev/null	Sun Jul 15 16:07:49 2018
+++ src/sys/arch/arm/fdt/pmu_fdt.c	Sun Jul 15 16:07:49 2018
@@ -0,0 +1,181 @@
+/* $NetBSD: pmu_fdt.c,v 1.1 2018/07/15 16:07:49 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.1 2018/07/15 16:07:49 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#if defined(__aarch64__)
+#include 
+#define arm_pmu_intr armv8_pmu_intr
+#define arm_pmu_init armv8_pmu_init
+#endif
+
+#include 
+
+static int	pmu_fdt_match(device_t, cfdata_t, void *);
+static void	pmu_fdt_attach(device_t, device_t, void *);
+
+static void	pmu_fdt_init(device_t);
+static int	pmu_fdt_intr_distribute(const int, int, void *);
+
+static const char * const compatible[] = {
+	"arm,armv8-pmuv3",
+	"arm,cortex-a73-pmu",
+	"arm,cortex-a72-pmu",
+	"arm,cortex-a57-pmu",
+	"arm,cortex-a53-pmu",
+	NULL
+};
+
+struct pmu_fdt_softc {
+	device_t	sc_dev;
+	int		sc_phandle;
+};
+
+CFATTACH_DECL_NEW(pmu_fdt, sizeof(struct pmu_fdt_softc),
+pmu_fdt_match, pmu_fdt_attach, NULL, NULL);
+
+static int
+pmu_fdt_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct fdt_attach_args * const faa = aux;
+
+	return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+pmu_fdt_attach(device_t parent, device_t self, void *aux)
+{
+	struct pmu_fdt_softc * const sc = device_private(self);
+	struct fdt_attach_args * const faa = aux;
+	const int phandle = faa->faa_phandle;
+
+	aprint_naive("\n");
+	aprint_normal(": Performance Monitor Unit\n");
+
+	sc->sc_dev = self;
+	sc->sc_phandle = phandle;
+
+	config_interrupts(self, pmu_fdt_init);
+}
+
+static void
+pmu_fdt_init(device_t self)
+{
+	struct pmu_fdt_softc * const sc = device_private(self);
+	const int phandle = sc->sc_phandle;
+	char intrstr[128];
+	int error, n;
+	void *ih;
+
+	for (n = 0; ; n++) {
+		ih = fdtbus_intr_establish(phandle, n, IPL_HIGH,
+		FDT_INTR_MPSAFE, arm_pmu_intr, NULL);
+		if (ih == NULL)
+			break;
+		if (!fdtbus_intr_str(phandle, n, intrstr, sizeof(intrstr))) {
+			aprint_error_dev(self,
+			"couldn't decode interrupt %u\n", n);
+			return;
+		}
+		aprint_normal_dev(self, "interrupting on %s\n", 

CVS commit: src/sys/dev/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:05:24 UTC 2018

Added Files:
src/sys/dev/tprof: tprof_armv8.c tprof_armv8.h

Log Message:
Add tprof backend for ARMv8 performance monitors.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/tprof/tprof_armv8.c \
src/sys/dev/tprof/tprof_armv8.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/tprof

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:05:24 UTC 2018

Added Files:
src/sys/dev/tprof: tprof_armv8.c tprof_armv8.h

Log Message:
Add tprof backend for ARMv8 performance monitors.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/tprof/tprof_armv8.c \
src/sys/dev/tprof/tprof_armv8.h

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

Added files:

Index: src/sys/dev/tprof/tprof_armv8.c
diff -u /dev/null src/sys/dev/tprof/tprof_armv8.c:1.1
--- /dev/null	Sun Jul 15 16:05:24 2018
+++ src/sys/dev/tprof/tprof_armv8.c	Sun Jul 15 16:05:24 2018
@@ -0,0 +1,225 @@
+/* $NetBSD: tprof_armv8.c,v 1.1 2018/07/15 16:05:24 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.1 2018/07/15 16:05:24 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+static tprof_param_t armv8_pmu_param;
+static const u_int armv8_pmu_counter = 1;
+static uint32_t counter_val;
+static uint32_t counter_reset_val;
+
+static bool
+armv8_pmu_event_implemented(uint16_t event)
+{
+	uint64_t eid[2];
+
+	if (event >= 64)
+		return false;
+
+	eid[0] = reg_pmceid0_el0_read();
+	eid[1] = reg_pmceid1_el0_read();
+
+	const u_int idx = event / 32;
+	const u_int bit = event % 32;
+
+	if (eid[idx] & __BIT(bit))
+		return true;
+
+	return false;
+}
+
+static void
+armv8_pmu_set_pmevtyper(u_int counter, uint64_t val)
+{
+	reg_pmselr_el0_write(counter);
+	arm_isb();
+	reg_pmxevtyper_el0_write(val);
+}
+
+static void
+armv8_pmu_set_pmevcntr(u_int counter, uint32_t val)
+{
+	reg_pmselr_el0_write(counter);
+	arm_isb();
+	reg_pmxevcntr_el0_write(val);
+}
+
+static void
+armv8_pmu_start_cpu(void *arg1, void *arg2)
+{
+	const uint32_t counter_mask = __BIT(armv8_pmu_counter);
+	uint64_t pmcr, pmevtyper;
+
+	/* Enable performance monitor */
+	pmcr = reg_pmcr_el0_read();
+	pmcr |= PMCR_E;
+	reg_pmcr_el0_write(pmcr);
+
+	/* Disable event counter */
+	reg_pmcntenclr_el0_write(counter_mask);
+
+	/* Configure event counter */
+	pmevtyper = __SHIFTIN(armv8_pmu_param.p_event, PMEVTYPER_EVTCOUNT);
+	if (!ISSET(armv8_pmu_param.p_flags, TPROF_PARAM_USER))
+		pmevtyper |= PMEVTYPER_U;
+	if (!ISSET(armv8_pmu_param.p_flags, TPROF_PARAM_KERN))
+		pmevtyper |= PMEVTYPER_P;
+
+	armv8_pmu_set_pmevtyper(armv8_pmu_counter, pmevtyper);
+
+	/* Enable overflow interrupts */
+	reg_pmintenset_el1_write(counter_mask);
+
+	/* Clear overflow flag */
+	reg_pmovsclr_el0_write(counter_mask);
+
+	/* Initialize event counter value */
+	armv8_pmu_set_pmevcntr(armv8_pmu_counter, counter_reset_val);
+
+	/* Enable event counter */
+	reg_pmcntenset_el0_write(counter_mask);
+}
+
+static void
+armv8_pmu_stop_cpu(void *arg1, void *arg2)
+{
+	const uint32_t counter_mask = __BIT(armv8_pmu_counter);
+	uint32_t pmcr;
+
+	/* Disable overflow interrupts */
+	reg_pmintenclr_el1_write(counter_mask);
+
+	/* Disable event counter */
+	reg_pmcntenclr_el0_write(counter_mask);
+
+	/* Disable performance monitor */
+	pmcr = reg_pmcr_el0_read();
+	pmcr &= ~PMCR_E;
+	reg_pmcr_el0_write(pmcr);
+}
+
+static uint64_t
+armv8_pmu_estimate_freq(void)
+{
+	uint64_t cpufreq = curcpu()->ci_data.cpu_cc_freq;
+	uint64_t freq = 1;
+	uint32_t pmcr;
+
+	counter_val = cpufreq / freq;
+	if (counter_val == 0)
+		counter_val = 40ULL / freq;
+
+	pmcr = reg_pmcr_el0_read();
+	if (pmcr & PMCR_D)
+		counter_val /= 64;
+
+	return freq;
+}
+
+static uint32_t
+armv8_pmu_ident(void)
+{
+	return TPROF_IDENT_ARMV8_GENERIC;
+}
+
+static int
+armv8_pmu_start(const tprof_param_t *param)
+{
+	uint64_t xc;

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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:04:07 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic.c

Log Message:
Support pic_set_affinity and pic_get_affinity


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/cortex/gic.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/arm/cortex

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:04:07 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gic.c

Log Message:
Support pic_set_affinity and pic_get_affinity


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/cortex/gic.c

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

Modified files:

Index: src/sys/arch/arm/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.34 src/sys/arch/arm/cortex/gic.c:1.35
--- src/sys/arch/arm/cortex/gic.c:1.34	Sat Apr 28 18:26:53 2018
+++ src/sys/arch/arm/cortex/gic.c	Sun Jul 15 16:04:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.34 2018/04/28 18:26:53 jakllsch Exp $	*/
+/*	$NetBSD: gic.c,v 1.35 2018/07/15 16:04:07 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.34 2018/04/28 18:26:53 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.35 2018/07/15 16:04:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -75,6 +75,8 @@ static void armgic_source_name(struct pi
 #ifdef MULTIPROCESSOR
 static void armgic_cpu_init(struct pic_softc *, struct cpu_info *);
 static void armgic_ipi_send(struct pic_softc *, const kcpuset_t *, u_long);
+static void armgic_get_affinity(struct pic_softc *, size_t, kcpuset_t *);
+static int armgic_set_affinity(struct pic_softc *, size_t, const kcpuset_t *);
 #endif
 
 static const struct pic_ops armgic_picops = {
@@ -88,6 +90,8 @@ static const struct pic_ops armgic_picop
 #ifdef MULTIPROCESSOR
 	.pic_cpu_init = armgic_cpu_init,
 	.pic_ipi_send = armgic_ipi_send,
+	.pic_get_affinity = armgic_get_affinity,
+	.pic_set_affinity = armgic_set_affinity,
 #endif
 };
 
@@ -104,6 +108,7 @@ static struct armgic_softc {
 	uint32_t sc_gic_valid_lines[1024/32];
 	uint32_t sc_enabled_local;
 #ifdef MULTIPROCESSOR
+	uint32_t sc_target[MAXCPUS];
 	uint32_t sc_mptargets;
 #endif
 	uint32_t sc_bptargets;
@@ -222,6 +227,63 @@ armgic_set_priority(struct pic_softc *pi
 	gicc_write(sc, GICC_PMR, priority);
 }
 
+#ifdef MULTIPROCESSOR
+static void
+armgic_get_affinity(struct pic_softc *pic, size_t irq, kcpuset_t *affinity)
+{
+	struct armgic_softc * const sc = PICTOSOFTC(pic);
+	const size_t group = irq / 32;
+	int n;
+
+	kcpuset_zero(affinity);
+	if (group == 0) {
+		/* All CPUs are targets for group 0 (SGI/PPI) */
+		for (n = 0; n < MAXCPUS; n++) {
+			if (sc->sc_target[n] != 0)
+kcpuset_set(affinity, n);
+		}
+	} else {
+		/* Find distributor targets (SPI) */
+		const u_int byte_shift = 8 * (irq & 3);
+		const bus_size_t targets_reg = GICD_ITARGETSRn(irq / 4);
+		const uint32_t targets = gicd_read(sc, targets_reg);
+		const uint32_t targets_val = (targets >> byte_shift) & 0xff;
+
+		for (n = 0; n < MAXCPUS; n++) {
+			if (sc->sc_target[n] & targets_val)
+kcpuset_set(affinity, n);
+		}
+	}
+}
+
+static int
+armgic_set_affinity(struct pic_softc *pic, size_t irq,
+const kcpuset_t *affinity)
+{
+	struct armgic_softc * const sc = PICTOSOFTC(pic);
+	const size_t group = irq / 32;
+	if (group == 0)
+		return EINVAL;
+
+	const u_int byte_shift = 8 * (irq & 3);
+	const bus_size_t targets_reg = GICD_ITARGETSRn(irq / 4);
+	uint32_t targets_val = 0;
+	int n;
+
+	for (n = 0; n < MAXCPUS; n++) {
+		if (kcpuset_isset(affinity, n))
+			targets_val |= sc->sc_target[n];
+	}
+
+	uint32_t targets = gicd_read(sc, targets_reg);
+	targets &= ~(0xff << byte_shift);
+	targets |= (targets_val << byte_shift);
+	gicd_write(sc, targets_reg, targets);
+
+	return 0;
+}
+#endif
+
 #ifdef __HAVE_PIC_FAST_SOFTINTS
 void
 softint_init_md(lwp_t *l, u_int level, uintptr_t *machdep_p)
@@ -451,7 +513,8 @@ void
 armgic_cpu_init(struct pic_softc *pic, struct cpu_info *ci)
 {
 	struct armgic_softc * const sc = PICTOSOFTC(pic);
-	sc->sc_mptargets |= gicd_find_targets(sc);
+	sc->sc_target[cpu_index(ci)] = gicd_find_targets(sc);
+	sc->sc_mptargets |= sc->sc_target[cpu_index(ci)];
 	KASSERTMSG(ci->ci_cpl == IPL_HIGH, "ipl %d not IPL_HIGH", ci->ci_cpl);
 	armgic_cpu_init_priorities(sc);
 	if (!CPU_IS_PRIMARY(ci)) {



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:03:25 UTC 2018

Modified Files:
src/sys/arch/arm/pic: pic.c picvar.h

Log Message:
Add support for setting and getting interrupt affinity.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/pic/picvar.h

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

Modified files:

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.43 src/sys/arch/arm/pic/pic.c:1.44
--- src/sys/arch/arm/pic/pic.c:1.43	Mon Jul  9 06:08:42 2018
+++ src/sys/arch/arm/pic/pic.c	Sun Jul 15 16:03:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.43 2018/07/09 06:08:42 ryo Exp $	*/
+/*	$NetBSD: pic.c,v 1.44 2018/07/15 16:03:24 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.43 2018/07/09 06:08:42 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.44 2018/07/15 16:03:24 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.43
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -881,3 +882,26 @@ intr_disestablish(void *ih)
 
 	pic_disestablish_source(is);
 }
+
+#ifdef MULTIPROCESSOR
+int
+interrupt_distribute(void *ih, const kcpuset_t *newset, kcpuset_t *oldset)
+{
+	struct intrsource * const is = ih;
+	struct pic_softc * const pic = is->is_pic;
+
+	if (pic == NULL)
+		return EOPNOTSUPP;
+	if (pic->pic_ops->pic_set_affinity == NULL ||
+	pic->pic_ops->pic_get_affinity == NULL)
+		return EOPNOTSUPP;
+
+	if (!is->is_mpsafe)
+		return EINVAL;
+
+	if (oldset != NULL)
+		pic->pic_ops->pic_get_affinity(pic, is->is_irq, oldset);
+
+	return pic->pic_ops->pic_set_affinity(pic, is->is_irq, newset);
+}
+#endif

Index: src/sys/arch/arm/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.16 src/sys/arch/arm/pic/picvar.h:1.17
--- src/sys/arch/arm/pic/picvar.h:1.16	Tue Jul  7 21:43:46 2015
+++ src/sys/arch/arm/pic/picvar.h	Sun Jul 15 16:03:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: picvar.h,v 1.16 2015/07/07 21:43:46 matt Exp $	*/
+/*	$NetBSD: picvar.h,v 1.17 2018/07/15 16:03:24 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -76,6 +76,10 @@ void	*pic_establish_intr(struct pic_soft
 	int (*func)(void *), void *arg);
 int	pic_alloc_irq(struct pic_softc *pic);
 void	pic_disestablish_source(struct intrsource *is);
+#ifdef MULTIPROCESSOR
+void	pic_distribute_source(struct intrsource *is, const kcpuset_t *,
+	kcpuset_t *);
+#endif
 void	pic_do_pending_ints(register_t psw, int newipl, void *frame);
 void	pic_dispatch(struct intrsource *is, void *frame);
 
@@ -114,6 +118,9 @@ struct intrsource {
 	uint8_t is_iplidx;
 	bool is_mpsafe;
 	char is_source[16];
+#ifdef MULTIPROCESSOR
+	kcpuset_t *is_affinity;
+#endif
 };
 
 struct pic_percpu {
@@ -156,6 +163,8 @@ struct pic_ops {
 #ifdef MULTIPROCESSOR
 	void (*pic_cpu_init)(struct pic_softc *, struct cpu_info *);
 	void (*pic_ipi_send)(struct pic_softc *, const kcpuset_t *, u_long);
+	int (*pic_set_affinity)(struct pic_softc *, size_t, const kcpuset_t *);
+	void (*pic_get_affinity)(struct pic_softc *, size_t, kcpuset_t *);
 #endif
 };
 



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 16:03:25 UTC 2018

Modified Files:
src/sys/arch/arm/pic: pic.c picvar.h

Log Message:
Add support for setting and getting interrupt affinity.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/pic/picvar.h

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



Re: CVS commit: src/sys/arch/arm/include

2018-07-15 Thread Christos Zoulas
In article <20180715143050.ga28...@britannica.bec.de>,
Joerg Sonnenberger   wrote:
>On Sat, Jul 14, 2018 at 08:36:13PM -0400, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sun Jul 15 00:36:13 UTC 2018
>> 
>> Modified Files:
>>  src/sys/arch/arm/include: int_fmtio.h
>> 
>> Log Message:
>> Fix formats for gcc where int64 is long not long long (like clang which
>> should be changed).
>
>As I said before, this patch is wrong. Clang will never hit the
>definitions anyway.

The patch is written this way to conservatively preserve the existing
behavior on aarch64 with clang. Once clang is fixed to not use long long
for int64, I will fix it. Of course it would have been easier for
me to remove the few lines in clang that cause this, but you are not
allowing it. Instead, I have to patch openssl, create this mess and
at the same time cause a flag day later when the port is more mature
which is undesirable. Things like this should be fixed sooner than
later.

christos



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

2018-07-15 Thread Christos Zoulas
In article <20180715143153.gb28...@britannica.bec.de>,
Joerg Sonnenberger   wrote:
>On Sat, Jul 14, 2018 at 07:41:43PM -0400, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sat Jul 14 23:41:43 UTC 2018
>> 
>> Modified Files:
>>  src/external/gpl3/gcc/dist/libiberty: alloca.c
>> 
>> Log Message:
>> clang does not like auto in c++
>
>This is not about Clang at all. auto has a quite different meaning with
>C++11 and that's even the default for newer GCC...

Yes, I totally understand that, but this is about "compiling c
files with c++" and the mode that clang chooses is different that
gcc's {how it interprets things, and what it warns and errors about)
is different. Removing the auto from the c file is harmless and makes
it compile under c++ with clang.

christos



Re: CVS commit: src/sys/arch/arm/include

2018-07-15 Thread Joerg Sonnenberger
On Sat, Jul 14, 2018 at 08:36:13PM -0400, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sun Jul 15 00:36:13 UTC 2018
> 
> Modified Files:
>   src/sys/arch/arm/include: int_fmtio.h
> 
> Log Message:
> Fix formats for gcc where int64 is long not long long (like clang which
> should be changed).

As I said before, this patch is wrong. Clang will never hit the
definitions anyway.

Joerg


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

2018-07-15 Thread Joerg Sonnenberger
On Sat, Jul 14, 2018 at 07:41:43PM -0400, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sat Jul 14 23:41:43 UTC 2018
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libiberty: alloca.c
> 
> Log Message:
> clang does not like auto in c++

This is not about Clang at all. auto has a quite different meaning with
C++11 and that's even the default for newer GCC...

Joerg


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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 13:34:43 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gic_fdt.c

Log Message:
Return the real interrupt handle from gic_fdt_establish


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/fdt/gic_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/gic_fdt.c
diff -u src/sys/arch/arm/fdt/gic_fdt.c:1.11 src/sys/arch/arm/fdt/gic_fdt.c:1.12
--- src/sys/arch/arm/fdt/gic_fdt.c:1.11	Tue Jul  3 12:12:03 2018
+++ src/sys/arch/arm/fdt/gic_fdt.c	Sun Jul 15 13:34:43 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.11 2018/07/03 12:12:03 jmcneill Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.12 2018/07/15 13:34:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.11 2018/07/03 12:12:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.12 2018/07/15 13:34:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -238,28 +239,36 @@ gic_fdt_establish(device_t dev, u_int *s
 	firqh->ih_arg = arg;
 	TAILQ_INSERT_TAIL(>intr_handlers, firqh, ih_next);
 
-	return firqh;
+	return firq->intr_ih;
 }
 
 static void
 gic_fdt_disestablish(device_t dev, void *ih)
 {
 	struct gic_fdt_softc * const sc = device_private(dev);
-	struct gic_fdt_irqhandler *firqh = ih;
-	struct gic_fdt_irq *firq = firqh->ih_irq;
-	const int irq = firq->intr_irq;
+	struct gic_fdt_irqhandler *firqh;
+	struct gic_fdt_irq *firq;
+	u_int n;
+
+	for (n = 0; n < GIC_MAXIRQ; n++) {
+		firq = sc->sc_irq[n];
+		if (firq->intr_ih != ih)
+			continue;
 
-	KASSERT(firq->intr_refcnt > 0);
+		KASSERT(firq->intr_refcnt > 0);
 
-	TAILQ_REMOVE(>intr_handlers, firqh, ih_next);
-	kmem_free(firqh, sizeof(*firqh));
+		if (firq->intr_refcnt > 1)
+			panic("%s: cannot disestablish shared irq", __func__);
 
-	firq->intr_refcnt--;
-	if (firq->intr_refcnt == 0) {
+		firqh = TAILQ_FIRST(>intr_handlers);
+		kmem_free(firqh, sizeof(*firqh));
 		intr_disestablish(firq->intr_ih);
 		kmem_free(firq, sizeof(*firq));
-		sc->sc_irq[irq] = NULL;
+		sc->sc_irq[n] = NULL;
+		return;
 	}
+
+	panic("%s: interrupt not established", __func__);
 }
 
 static int



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

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 13:34:43 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gic_fdt.c

Log Message:
Return the real interrupt handle from gic_fdt_establish


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/fdt/gic_fdt.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/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 13:24:05 UTC 2018

Modified Files:
src/sys/dev/fdt: fdt_intr.c

Log Message:
Return the interrupt controller's cookie directly from fdtbus_intr_establish


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/fdt/fdt_intr.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/fdt/fdt_intr.c
diff -u src/sys/dev/fdt/fdt_intr.c:1.15 src/sys/dev/fdt/fdt_intr.c:1.16
--- src/sys/dev/fdt/fdt_intr.c:1.15	Mon Jul  2 17:50:02 2018
+++ src/sys/dev/fdt/fdt_intr.c	Sun Jul 15 13:24:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.15 2018/07/02 17:50:02 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.16 2018/07/15 13:24:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.15 2018/07/02 17:50:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.16 2018/07/15 13:24:05 jmcneill Exp $");
 
 #include 
 #include 
@@ -51,8 +51,13 @@ static LIST_HEAD(, fdtbus_interrupt_cont
 struct fdtbus_interrupt_cookie {
 	struct fdtbus_interrupt_controller *c_ic;
 	void *c_ih;
+
+	LIST_ENTRY(fdtbus_interrupt_cookie) c_next;
 };
 
+static LIST_HEAD(, fdtbus_interrupt_cookie) fdtbus_interrupt_cookies =
+LIST_HEAD_INITIALIZER(fdtbus_interrupt_cookies);
+
 static u_int *	get_specifier_by_index(int, int, int *);
 static u_int *	get_specifier_from_map(int, const u_int *, int *);
 
@@ -149,19 +154,31 @@ fdtbus_intr_establish(int phandle, u_int
 		c = kmem_alloc(sizeof(*c), KM_SLEEP);
 		c->c_ic = ic;
 		c->c_ih = ih;
+		LIST_INSERT_HEAD(_interrupt_cookies, c, c_next);
 	}
 
-	return c;
+	return ih;
 }
 
 void
 fdtbus_intr_disestablish(int phandle, void *cookie)
 {
-	struct fdtbus_interrupt_cookie *c = cookie;
-	struct fdtbus_interrupt_controller *ic = c->c_ic;
-	void *ih = c->c_ih;
+	struct fdtbus_interrupt_controller *ic = NULL;
+	struct fdtbus_interrupt_cookie *c;
+
+	LIST_FOREACH(c, _interrupt_cookies, c_next) {
+		if (c->c_ih == cookie) {
+			ic = c->c_ic;
+			LIST_REMOVE(c, c_next);
+			kmem_free(c, sizeof(*c));
+			break;
+		}
+	}
+
+	if (ic != NULL)
+		panic("%s: interrupt handle not valid", __func__);
 
-	return ic->ic_funcs->disestablish(ic->ic_dev, ih);
+	return ic->ic_funcs->disestablish(ic->ic_dev, cookie);
 }
 
 bool



CVS commit: src/sys/dev/fdt

2018-07-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 15 13:24:05 UTC 2018

Modified Files:
src/sys/dev/fdt: fdt_intr.c

Log Message:
Return the interrupt controller's cookie directly from fdtbus_intr_establish


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/fdt/fdt_intr.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/doc

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 11:03:13 UTC 2018

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

Log Message:
Tickets #909 and #922


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.227 -r1.1.2.228 src/doc/CHANGES-8.0

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



CVS commit: [netbsd-8] src/doc

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 11:03:13 UTC 2018

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

Log Message:
Tickets #909 and #922


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.227 -r1.1.2.228 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.227 src/doc/CHANGES-8.0:1.1.2.228
--- src/doc/CHANGES-8.0:1.1.2.227	Fri Jul 13 16:16:32 2018
+++ src/doc/CHANGES-8.0	Sun Jul 15 11:03:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.227 2018/07/13 16:16:32 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.228 2018/07/15 11:03:13 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -14252,3 +14252,17 @@ usr.sbin/ndp/ndp.c1.52-1.54
 	Fix the host and address output when neighbor cache entry is deleted.
 	[nonaka, ticket #921]
 
+sys/arch/xen/xen/xennetback_xenbus.c		1.64 (patch)
+
+	Fix panic of DOM0 in xennetback_xenbus_destroy() on xl destroy of
+	DOMU with created, but non CONNECTED xennet.
+	[jdolecek, ticket #909]
+
+crypto/external/bsd/openssh/dist/ssh-agent.1	1.13
+crypto/external/bsd/openssh/dist/ssh-agent.c	1.23
+
+	Add /usr/pkg/lib and remove /usr/local/lib/ to/from the
+	whitelisted filesystem paths ssh-agent will look for PKCS11
+	related libraries.
+	[sevan, ticket #922]
+



CVS commit: [netbsd-8] src/crypto/external/bsd/openssh/dist

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:59:49 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist [netbsd-8]: ssh-agent.1
ssh-agent.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #922):

crypto/external/bsd/openssh/dist/ssh-agent.1: revision 1.13
crypto/external/bsd/openssh/dist/ssh-agent.c: revision 1.23

Amend whitelisted filesystem paths ssh-agent will look for PKCS11 related
libraries so that things work out of the box with pkgsrc without having to
explicitly whitelist things.

ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.4.1 \
src/crypto/external/bsd/openssh/dist/ssh-agent.1
cvs rdiff -u -r1.20.4.1 -r1.20.4.2 \
src/crypto/external/bsd/openssh/dist/ssh-agent.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/openssh/dist/ssh-agent.1
diff -u src/crypto/external/bsd/openssh/dist/ssh-agent.1:1.12 src/crypto/external/bsd/openssh/dist/ssh-agent.1:1.12.4.1
--- src/crypto/external/bsd/openssh/dist/ssh-agent.1:1.12	Tue Apr 18 18:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ssh-agent.1	Sun Jul 15 10:59:49 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ssh-agent.1,v 1.12 2017/04/18 18:41:46 christos Exp $
+.\"	$NetBSD: ssh-agent.1,v 1.12.4.1 2018/07/15 10:59:49 martin Exp $
 .\" $OpenBSD: ssh-agent.1,v 1.64 2016/11/30 06:54:26 jmc Exp $
 .\"
 .\"
@@ -131,7 +131,7 @@ that may be added using the
 option to
 .Xr ssh-add 1 .
 The default is to allow loading PKCS#11 libraries from
-.Dq /usr/lib/*,/usr/local/lib/* .
+.Dq /usr/lib/*,/usr/pkg/lib/* .
 PKCS#11 libraries that do not match the whitelist will be refused.
 See PATTERNS in
 .Xr ssh_config 5

Index: src/crypto/external/bsd/openssh/dist/ssh-agent.c
diff -u src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.20.4.1 src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.20.4.2
--- src/crypto/external/bsd/openssh/dist/ssh-agent.c:1.20.4.1	Mon Dec  4 10:55:18 2017
+++ src/crypto/external/bsd/openssh/dist/ssh-agent.c	Sun Jul 15 10:59:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssh-agent.c,v 1.20.4.1 2017/12/04 10:55:18 snj Exp $	*/
+/*	$NetBSD: ssh-agent.c,v 1.20.4.2 2018/07/15 10:59:49 martin Exp $	*/
 /* $OpenBSD: ssh-agent.c,v 1.224 2017/07/24 04:34:28 djm Exp $ */
 /*
  * Author: Tatu Ylonen 
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: ssh-agent.c,v 1.20.4.1 2017/12/04 10:55:18 snj Exp $");
+__RCSID("$NetBSD: ssh-agent.c,v 1.20.4.2 2018/07/15 10:59:49 martin Exp $");
 
 #include 	/* MIN MAX */
 #include 
@@ -82,7 +82,7 @@ __RCSID("$NetBSD: ssh-agent.c,v 1.20.4.1
 #endif
 
 #ifndef DEFAULT_PKCS11_WHITELIST
-# define DEFAULT_PKCS11_WHITELIST "/usr/lib*/*,/usr/local/lib*/*"
+# define DEFAULT_PKCS11_WHITELIST "/usr/lib*/*,/usr/pkg/lib*/*"
 #endif
 
 /* Maximum accepted message length */



CVS commit: [netbsd-8] src/crypto/external/bsd/openssh/dist

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:59:49 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist [netbsd-8]: ssh-agent.1
ssh-agent.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #922):

crypto/external/bsd/openssh/dist/ssh-agent.1: revision 1.13
crypto/external/bsd/openssh/dist/ssh-agent.c: revision 1.23

Amend whitelisted filesystem paths ssh-agent will look for PKCS11 related
libraries so that things work out of the box with pkgsrc without having to
explicitly whitelist things.

ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.4.1 \
src/crypto/external/bsd/openssh/dist/ssh-agent.1
cvs rdiff -u -r1.20.4.1 -r1.20.4.2 \
src/crypto/external/bsd/openssh/dist/ssh-agent.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/sys/arch/xen/xen

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:54:03 UTC 2018

Modified Files:
src/sys/arch/xen/xen [netbsd-8]: xennetback_xenbus.c

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

sys/arch/xen/xen/xennetback_xenbus.c: revision 1.64 (patch)

Fix panic of DOM0 in xennetback_xenbus_destroy() on xl destroy of
DOMU with created, but non CONNECTED xennet (such as when DOMU
panics during boot); only try to disestablish the intr if it was
actually setup.

While here protect xnetback_instances with mutex, and switch to use
kmem_zalloc() + KM_SLEEP / kmem_free() like xbdback_xenbus.c; add XXXSMP
to the other global variables, and at least mark them static


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.58.8.1 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.58 src/sys/arch/xen/xen/xennetback_xenbus.c:1.58.8.1
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.58	Thu Dec 15 09:28:04 2016
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sun Jul 15 10:54:03 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.58 2016/12/15 09:28:04 ozaki-r Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.58.8.1 2018/07/15 10:54:03 martin Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.58 2016/12/15 09:28:04 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.58.8.1 2018/07/15 10:54:03 martin Exp $");
 
 #include "opt_xen.h"
 
@@ -34,6 +34,7 @@ __KERNEL_RCSID(0, "$NetBSD: xennetback_x
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -140,9 +141,10 @@ static inline void xennetback_tx_respons
 int, int);
 static void xennetback_tx_free(struct mbuf * , void *, size_t, void *);
 
-SLIST_HEAD(, xnetback_instance) xnetback_instances;
+static SLIST_HEAD(, xnetback_instance) xnetback_instances;
+static kmutex_t xnetback_lock;
 
-static struct xnetback_instance *xnetif_lookup(domid_t, uint32_t);
+static bool xnetif_lookup(domid_t, uint32_t);
 static int  xennetback_evthandler(void *);
 
 static struct xenbus_backend_driver xvif_backend_driver = {
@@ -176,12 +178,13 @@ pool_cache_t xmit_pages_cache;
 pool_cache_t xmit_pages_cachep;
 
 /* arrays used in xennetback_ifstart(), too large to allocate on stack */
+/* XXXSMP */
 static mmu_update_t xstart_mmu[NB_XMIT_PAGES_BATCH];
 static multicall_entry_t xstart_mcl[NB_XMIT_PAGES_BATCH + 1];
 static gnttab_transfer_t xstart_gop_transfer[NB_XMIT_PAGES_BATCH];
 static gnttab_copy_t xstart_gop_copy[NB_XMIT_PAGES_BATCH];
-struct mbuf *mbufs_sent[NB_XMIT_PAGES_BATCH];
-struct _pages_pool_free {
+static struct mbuf *mbufs_sent[NB_XMIT_PAGES_BATCH];
+static struct _pages_pool_free {
 	vaddr_t va;
 	paddr_t pa;
 } pages_pool_free[NB_XMIT_PAGES_BATCH];
@@ -229,6 +232,8 @@ xvifattach(int n)
 #endif
 
 	SLIST_INIT(_instances);
+	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
+
 	xenbus_backend_register(_backend_driver);
 }
 
@@ -256,14 +261,10 @@ xennetback_xenbus_create(struct xenbus_d
 		return err;
 	}
 
-	if (xnetif_lookup(domid, handle) != NULL) {
+	if (xnetif_lookup(domid, handle)) {
 		return EEXIST;
 	}
-	xneti = malloc(sizeof(struct xnetback_instance), M_DEVBUF,
-	M_NOWAIT | M_ZERO);
-	if (xneti == NULL) {
-		return ENOMEM;
-	}
+	xneti = kmem_zalloc(sizeof(*xneti), KM_SLEEP);
 	xneti->xni_domid = domid;
 	xneti->xni_handle = handle;
 	xneti->xni_status = DISCONNECTED;
@@ -317,7 +318,9 @@ xennetback_xenbus_create(struct xenbus_d
 	if_attach(ifp);
 	ether_ifattach(>xni_if, xneti->xni_enaddr);
 
+	mutex_enter(_lock);
 	SLIST_INSERT_HEAD(_instances, xneti, next);
+	mutex_exit(_lock);
 
 	xbusd->xbusd_otherend_changed = xennetback_frontend_changed;
 
@@ -371,7 +374,7 @@ xennetback_xenbus_create(struct xenbus_d
 abort_xbt:
 	xenbus_transaction_end(xbt, 1);
 fail:
-	free(xneti, M_DEVBUF);
+	kmem_free(xneti, sizeof(*xneti));
 	return err;
 }
 
@@ -382,21 +385,22 @@ xennetback_xenbus_destroy(void *arg)
 	struct gnttab_unmap_grant_ref op;
 	int err;
 
-#if 0
-	if (xneti->xni_status == CONNECTED) {
-		return EBUSY;
-	}
-#endif
 	aprint_verbose_ifnet(>xni_if, "disconnecting\n");
-	hypervisor_mask_event(xneti->xni_evtchn);
-	event_remove_handler(xneti->xni_evtchn, xennetback_evthandler, xneti);
-	if (xneti->xni_softintr) {
-		softint_disestablish(xneti->xni_softintr);
-		xneti->xni_softintr = NULL;
+
+	if (xneti->xni_status == CONNECTED) {
+		hypervisor_mask_event(xneti->xni_evtchn);
+		event_remove_handler(xneti->xni_evtchn, xennetback_evthandler,
+		xneti);
+		if (xneti->xni_softintr) {
+			softint_disestablish(xneti->xni_softintr);
+			xneti->xni_softintr = NULL;
+		}
 	}
 
+ 	mutex_enter(_lock);
 	SLIST_REMOVE(_instances,
 	xneti, 

CVS commit: [netbsd-8] src/sys/arch/xen/xen

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:54:03 UTC 2018

Modified Files:
src/sys/arch/xen/xen [netbsd-8]: xennetback_xenbus.c

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

sys/arch/xen/xen/xennetback_xenbus.c: revision 1.64 (patch)

Fix panic of DOM0 in xennetback_xenbus_destroy() on xl destroy of
DOMU with created, but non CONNECTED xennet (such as when DOMU
panics during boot); only try to disestablish the intr if it was
actually setup.

While here protect xnetback_instances with mutex, and switch to use
kmem_zalloc() + KM_SLEEP / kmem_free() like xbdback_xenbus.c; add XXXSMP
to the other global variables, and at least mark them static


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.58.8.1 src/sys/arch/xen/xen/xennetback_xenbus.c

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



CVS commit: [netbsd-7] src/doc

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:49:02 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Ticket #1620


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-7.2

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



CVS commit: [netbsd-7] src/doc

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:49:02 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Ticket #1620


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-7.2

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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.95 src/doc/CHANGES-7.2:1.1.2.96
--- src/doc/CHANGES-7.2:1.1.2.95	Thu Jul 12 14:57:57 2018
+++ src/doc/CHANGES-7.2	Sun Jul 15 10:49:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.95 2018/07/12 14:57:57 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.96 2018/07/15 10:49:02 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5566,3 +5566,8 @@ usr.bin/printf/printf.c1.37-1.39
 	conversion.
 	[kre, ticket #1619]
 
+usr.bin/units/units.c1.26,1.27
+
+	Fix negative exponents and improve handling of negative numbers.
+	[dholland, ticket #1620]
+



CVS commit: [netbsd-7] src/usr.bin/units

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:47:54 UTC 2018

Modified Files:
src/usr.bin/units [netbsd-7]: units.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1620):

usr.bin/units/units.c: revision 1.26,1.27

Improve the parser. Now we understand negative exponents; fixes PR 50768.

Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.

 -

Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.4.1 src/usr.bin/units/units.c

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

Modified files:

Index: src/usr.bin/units/units.c
diff -u src/usr.bin/units/units.c:1.25 src/usr.bin/units/units.c:1.25.4.1
--- src/usr.bin/units/units.c:1.25	Tue Jan  7 02:07:09 2014
+++ src/usr.bin/units/units.c	Sun Jul 15 10:47:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: units.c,v 1.25 2014/01/07 02:07:09 joerg Exp $	*/
+/*	$NetBSD: units.c,v 1.25.4.1 2018/07/15 10:47:54 martin Exp $	*/
 
 /*
  * units.c   Copyright (c) 1993 by Adrian Mariano (adr...@cam.cornell.edu)
@@ -17,6 +17,7 @@
  * improvements you might make to this program.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -344,14 +345,41 @@ addunit(struct unittype * theunit, const
 	char *scratch, *savescr;
 	char *item;
 	char *divider, *slash;
+	char *minus;
+	size_t pos, len;
 	int doingtop;
 
 	savescr = scratch = dupstr(toadd);
-	for (slash = scratch + 1; *slash; slash++)
-		if (*slash == '-' &&
-		(tolower((unsigned char)*(slash - 1)) != 'e' ||
-		!strchr(".0123456789", *(slash + 1
-			*slash = ' ';
+
+	/*
+	 * "foot-pound" is the same as "foot pound". But don't
+	 * trash minus signs on numbers.
+	 *
+	 * 20160204 dholland: this used to let through only minus
+	 * signs at the beginning of the string or in the middle of a
+	 * floating constant (e.g. 3.6e-5), and a minus sign at the
+	 * beginning of the string failed further on. I have changed
+	 * it so any minus sign before a digit (or decimal point) is
+	 * treated as going with that digit.
+	 *
+	 * Note that this changed the interpretation of certain
+	 * marginally valid inputs like "3 N-5 s"; that used to be
+	 * interpreted as "3 N 5 s" or 15 N s, but now it reads as
+	 * "3 N -5 s" or -15 N s. However, it also makes negative
+	 * exponents on units work, which used to be silently trashed.
+	 */
+	for (minus = scratch + 1; *minus; minus++) {
+		if (*minus != '-') {
+			continue;
+		}
+		if (strchr(".0123456789", *(minus + 1))) {
+			continue;
+		}
+		*minus = ' ';
+	}
+
+	/* Process up to the next / in one go. */
+
 	slash = strchr(scratch, '/');
 	if (slash)
 		*slash = 0;
@@ -359,7 +387,9 @@ addunit(struct unittype * theunit, const
 	do {
 		item = strtok(scratch, " *\t\n/");
 		while (item) {
-			if (strchr("0123456789.", *item)) {
+			if ((*item == '-' && strchr("0123456789.", *(item+1)))
+			|| strchr("0123456789.", *item)) {
+			
 /* item starts with a number */
 char *endptr;
 double num;
@@ -415,14 +445,37 @@ addunit(struct unittype * theunit, const
 			}
 			else {	/* item is not a number */
 int repeat = 1;
+int flipthis = 0;
 
-if (strchr("23456789",
-item[strlen(item) - 1])) {
-	repeat = item[strlen(item) - 1] - '0';
-	item[strlen(item) - 1] = 0;
+pos = len = strlen(item);
+assert(pos > 0);
+while (strchr("0123456789", item[pos - 1])) {
+	pos--;
+	/* string began with non-digit */
+	assert(pos > 0);
+}
+if (pos < len) {
+	if (pos > 1 && item[pos - 1] == '-' &&
+	item[pos - 2] == '^') {
+		/* allow negative exponents */
+		pos--;
+	}
+	/* have an exponent */
+	repeat = strtol(item + pos, NULL, 10);
+	item[pos] = 0;
+	if (repeat == 0) {
+		/* not really the right msg */
+		zeroerror();
+		return 1;
+	}
+	if (repeat < 0) {
+		flipthis = 1;
+		repeat = -repeat;
+	}
 }
+flipthis ^= doingtop ^ flip;
 for (; repeat; repeat--)
-	if (addsubunit(doingtop ^ flip ? theunit->numerator : theunit->denominator, item))
+	if (addsubunit(flipthis ? theunit->numerator : theunit->denominator, item))
 		return 1;
 			}
 			item = strtok(NULL, " *\t/\n");



CVS commit: [netbsd-7] src/usr.bin/units

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 10:47:54 UTC 2018

Modified Files:
src/usr.bin/units [netbsd-7]: units.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1620):

usr.bin/units/units.c: revision 1.26,1.27

Improve the parser. Now we understand negative exponents; fixes PR 50768.

Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.

 -

Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.4.1 src/usr.bin/units/units.c

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



Re: CVS commit: src/sys/arch/x86/include

2018-07-15 Thread Paul Goyette




On Sun, 15 Jul 2018, Paul Goyette wrote:


Any chance that this will fix kern/52919?

If not, can we do some additional re-arrangement of struct cpu_info to 
address the problem?


And in any case, shouldn't this cause a bump in kernel version, since 
you've changed a structure that is shared between kernel and modules?


:)



Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Hum. Move the __HAVE_DIRECT_MAP block a little below, otherwise dynamically
loaded kernel modules use a wrong offset for some ci_* fields. Found when
modloading tprof_amd on an AMD 10h, the read of ci_signature was at a
wrong address, and the cpu family was not detected correctly.


+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


Re: CVS commit: src/sys/arch/x86/include

2018-07-15 Thread Paul Goyette

Any chance that this will fix kern/52919?

If not, can we do some additional re-arrangement of struct cpu_info to 
address the problem?




On Sun, 15 Jul 2018, Maxime Villard wrote:


Module Name:src
Committed By:   maxv
Date:   Sun Jul 15 08:47:43 UTC 2018

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Hum. Move the __HAVE_DIRECT_MAP block a little below, otherwise dynamically
loaded kernel modules use a wrong offset for some ci_* fields. Found when
modloading tprof_amd on an AMD 10h, the read of ci_signature was at a
wrong address, and the cpu family was not detected correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/include/cpu.h

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


!DSPAM:5b4b0a35163311665672011!




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


CVS commit: src/sys/arch/x86/include

2018-07-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 15 08:47:43 UTC 2018

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Hum. Move the __HAVE_DIRECT_MAP block a little below, otherwise dynamically
loaded kernel modules use a wrong offset for some ci_* fields. Found when
modloading tprof_amd on an AMD 10h, the read of ci_signature was at a
wrong address, and the cpu family was not detected correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/include/cpu.h

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

Modified files:

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.94 src/sys/arch/x86/include/cpu.h:1.95
--- src/sys/arch/x86/include/cpu.h:1.94	Sat Jun 30 14:21:19 2018
+++ src/sys/arch/x86/include/cpu.h	Sun Jul 15 08:47:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.94 2018/06/30 14:21:19 riastradh Exp $	*/
+/*	$NetBSD: cpu.h,v 1.95 2018/07/15 08:47:43 maxv Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -135,16 +135,6 @@ struct cpu_info {
 	volatile int	ci_mtx_count;	/* Negative count of spin mutexes */
 	volatile int	ci_mtx_oldspl;	/* Old SPL at this ci_idepth */
 
-#ifndef __HAVE_DIRECT_MAP
-#define VPAGE_SRC 0
-#define VPAGE_DST 1
-#define VPAGE_ZER 2
-#define VPAGE_PTP 3
-#define VPAGE_MAX 4
-	vaddr_t		vpage[VPAGE_MAX];
-	pt_entry_t	*vpage_pte[VPAGE_MAX];
-#endif
-
 	/* The following must be aligned for cmpxchg8b. */
 	struct {
 		uint32_t	ipending;
@@ -184,6 +174,16 @@ struct cpu_info {
 	u_int ci_cflush_lsize;	/* CLFLUSH insn line size */
 	struct x86_cache_info ci_cinfo[CAI_COUNT];
 
+#ifndef __HAVE_DIRECT_MAP
+#define VPAGE_SRC 0
+#define VPAGE_DST 1
+#define VPAGE_ZER 2
+#define VPAGE_PTP 3
+#define VPAGE_MAX 4
+	vaddr_t		vpage[VPAGE_MAX];
+	pt_entry_t	*vpage_pte[VPAGE_MAX];
+#endif
+
 #ifdef PAE
 	uint32_t	ci_pae_l3_pdirpa; /* PA of L3 PD */
 	pd_entry_t *	ci_pae_l3_pdir; /* VA pointer to L3 PD */



CVS commit: src/sys/arch/x86/include

2018-07-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 15 08:47:43 UTC 2018

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Hum. Move the __HAVE_DIRECT_MAP block a little below, otherwise dynamically
loaded kernel modules use a wrong offset for some ci_* fields. Found when
modloading tprof_amd on an AMD 10h, the read of ci_signature was at a
wrong address, and the cpu family was not detected correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/include/cpu.h

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



CVS commit: src/sys/kern

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 07:24:11 UTC 2018

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

Log Message:
More ipkdb removal


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/kern/subr_prf.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_prf.c
diff -u src/sys/kern/subr_prf.c:1.173 src/sys/kern/subr_prf.c:1.174
--- src/sys/kern/subr_prf.c:1.173	Sun Jul  1 09:53:54 2018
+++ src/sys/kern/subr_prf.c	Sun Jul 15 07:24:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.173 2018/07/01 09:53:54 jmcneill Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.174 2018/07/15 07:24:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,11 +37,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.173 2018/07/01 09:53:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.174 2018/07/15 07:24:11 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
-#include "opt_ipkdb.h"
 #include "opt_kgdb.h"
 #include "opt_dump.h"
 #include "opt_rnd_printf.h"
@@ -73,10 +72,6 @@ __KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v
 
 #include 
 
-#ifdef IPKDB
-#include 
-#endif
-
 static kmutex_t kprintf_mtx;
 static bool kprintf_inited = false;
 
@@ -327,9 +322,6 @@ vpanic(const char *fmt, va_list ap)
 	if (logenabled(msgbufp))
 		panicend = msgbufp->msg_bufx;
 
-#ifdef IPKDB
-	ipkdb_panic();
-#endif
 #ifdef KGDB
 	kgdb_panic();
 #endif



CVS commit: src/sys/kern

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 07:24:11 UTC 2018

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

Log Message:
More ipkdb removal


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/kern/subr_prf.c

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



CVS commit: src/sys/conf

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 07:07:15 UTC 2018

Modified Files:
src/sys/conf: files

Log Message:
More ipkdb removal


To generate a diff of this commit:
cvs rdiff -u -r1.1201 -r1.1202 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1201 src/sys/conf/files:1.1202
--- src/sys/conf/files:1.1201	Thu Jul 12 10:46:48 2018
+++ src/sys/conf/files	Sun Jul 15 07:07:15 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1201 2018/07/12 10:46:48 maxv Exp $
+#	$NetBSD: files,v 1.1202 2018/07/15 07:07:15 martin Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -443,11 +443,6 @@ define	arp
 #
 include "altq/files.altq"
 
-#
-# IPKDB kernel debugger
-#
-include "ipkdb/files.ipkdb"
-
 # Logical disk
 #
 device	ld: disk
@@ -742,9 +737,8 @@ file	dev/ic/dwc_gmac.c		awge
 
 # 8390-family Ethernet controllers
 #
-defflag	opt_ipkdb.h		IPKDB_DP8390
 define	dp8390nic
-file	dev/ic/dp8390.c			dp8390nic | ipkdb_dp8390
+file	dev/ic/dp8390.c			dp8390nic
 
 # National Semiconductor DP83905 AT/LANTIC Ethernet media support
 #
@@ -884,9 +878,8 @@ file	dev/ic/tms320av110.c		tms320av110
 # Novell NE2000-compatible Ethernet cards, based on the
 # National Semiconductor DS8390.
 #
-defflag	opt_ipkdb.h		IPKDB_NE			: IPKDB_DP8390
 device	ne: ether, ifnet, arp, dp8390nic, mii
-file	dev/ic/ne2000.c			ne | ipkdb_ne
+file	dev/ic/ne2000.c			ne
 
 # 8250/16[45]50-based "com" ports
 #



CVS commit: src/sys/conf

2018-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jul 15 07:07:15 UTC 2018

Modified Files:
src/sys/conf: files

Log Message:
More ipkdb removal


To generate a diff of this commit:
cvs rdiff -u -r1.1201 -r1.1202 src/sys/conf/files

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



CVS commit: src/share/dict

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:40:39 UTC 2018

Modified Files:
src/share/dict: web2

Log Message:
Add missing word: cactus. PR 53432.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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.51 src/share/dict/web2:1.52
--- src/share/dict/web2:1.51	Sun Jul  8 04:50:14 2018
+++ src/share/dict/web2	Sun Jul 15 06:40:39 2018
@@ -28420,6 +28420,7 @@ cacti
 cactiform
 cactoid
 Cactus
+cactus
 cacuminal
 cacuminate
 cacumination



CVS commit: src/share/dict

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:40:39 UTC 2018

Modified Files:
src/share/dict: web2

Log Message:
Add missing word: cactus. PR 53432.


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

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



CVS commit: src/sbin/restore

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:16:12 UTC 2018

Modified Files:
src/sbin/restore: restore.8

Log Message:
Document what rrestore is (was once) for. PR 53442.
 CVS: --


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sbin/restore/restore.8

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

Modified files:

Index: src/sbin/restore/restore.8
diff -u src/sbin/restore/restore.8:1.54 src/sbin/restore/restore.8:1.55
--- src/sbin/restore/restore.8:1.54	Mon Jul  3 21:33:42 2017
+++ src/sbin/restore/restore.8	Sun Jul 15 06:16:12 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: restore.8,v 1.54 2017/07/03 21:33:42 wiz Exp $
+.\"	$NetBSD: restore.8,v 1.55 2018/07/15 06:16:12 dholland Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)restore.8	8.4 (Berkeley) 5/1/95
 .\"
-.Dd April 30, 2007
+.Dd July 15, 2018
 .Dt RESTORE 8
 .Os
 .Sh NAME
@@ -406,6 +406,13 @@ preceded by its file type.
 Do not ask the user whether to abort the restore in the event of an error.
 Always try to skip over the bad block(s) and continue.
 .El
+.Pp
+The historic alternate name
+.Nm rrestore
+was once required when restoring from a remote host.
+This functionality is now built into
+.Nm
+itself.
 .Sh ENVIRONMENT
 If the following environment variable exists it will be used by
 .Nm :



CVS commit: src/sbin/restore

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:16:12 UTC 2018

Modified Files:
src/sbin/restore: restore.8

Log Message:
Document what rrestore is (was once) for. PR 53442.
 CVS: --


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sbin/restore/restore.8

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



CVS commit: src/sbin/dump

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:14:13 UTC 2018

Modified Files:
src/sbin/dump: dump.8

Log Message:
Document what rdump is (was once) for. PR 53442.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/dump/dump.8

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

Modified files:

Index: src/sbin/dump/dump.8
diff -u src/sbin/dump/dump.8:1.68 src/sbin/dump/dump.8:1.69
--- src/sbin/dump/dump.8:1.68	Mon Aug 15 00:03:14 2016
+++ src/sbin/dump/dump.8	Sun Jul 15 06:14:13 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dump.8,v 1.68 2016/08/15 00:03:14 sevan Exp $
+.\"	$NetBSD: dump.8,v 1.69 2018/07/15 06:14:13 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	 Regents of the University of California.
@@ -30,7 +30,7 @@
 .\"
 .\" @(#)dump.8	8.3 (Berkeley) 5/1/95
 .\"
-.Dd August 15, 2016
+.Dd July 15, 2018
 .Dt DUMP 8
 .Os
 .Sh NAME
@@ -449,6 +449,13 @@ argument of
 whilst a backup is in progress, statistics on the amount completed,
 current transfer rate, and estimated finished time, will be written
 to the standard error output.
+.Pp
+The historic alternate name
+.Nm rdump
+was once required when dumping to a remote host.
+This functionality is now built into
+.Nm
+itself.
 .Sh ENVIRONMENT
 If the following environment variables exist, they are used by
 .Nm .



CVS commit: src/sbin/dump

2018-07-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 15 06:14:13 UTC 2018

Modified Files:
src/sbin/dump: dump.8

Log Message:
Document what rdump is (was once) for. PR 53442.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/dump/dump.8

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



CVS commit: src/sys/arch/x86

2018-07-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 15 06:14:21 UTC 2018

Modified Files:
src/sys/arch/x86/x86: tprof_amdpmi.c tprof_pmi.c
Removed Files:
src/sys/arch/x86/include: tprof.h

Log Message:
Remove unused x86/include/tprof.h, there should be no need for this kind
of includes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/x86/include/tprof.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/tprof_amdpmi.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/x86/tprof_pmi.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/x86

2018-07-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 15 06:14:21 UTC 2018

Modified Files:
src/sys/arch/x86/x86: tprof_amdpmi.c tprof_pmi.c
Removed Files:
src/sys/arch/x86/include: tprof.h

Log Message:
Remove unused x86/include/tprof.h, there should be no need for this kind
of includes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/x86/include/tprof.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/tprof_amdpmi.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/x86/tprof_pmi.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/tprof_amdpmi.c
diff -u src/sys/arch/x86/x86/tprof_amdpmi.c:1.8 src/sys/arch/x86/x86/tprof_amdpmi.c:1.9
--- src/sys/arch/x86/x86/tprof_amdpmi.c:1.8	Fri Jul 13 07:56:29 2018
+++ src/sys/arch/x86/x86/tprof_amdpmi.c	Sun Jul 15 06:14:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_amdpmi.c,v 1.8 2018/07/13 07:56:29 maxv Exp $	*/
+/*	$NetBSD: tprof_amdpmi.c,v 1.9 2018/07/15 06:14:21 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.8 2018/07/13 07:56:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.9 2018/07/15 06:14:21 maxv Exp $");
 
 #include 
 #include 
@@ -70,7 +70,6 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi
 
 #include 		/* VM_MIN_KERNEL_ADDRESS */
 
-#include 
 #include 
 
 #include 

Index: src/sys/arch/x86/x86/tprof_pmi.c
diff -u src/sys/arch/x86/x86/tprof_pmi.c:1.15 src/sys/arch/x86/x86/tprof_pmi.c:1.16
--- src/sys/arch/x86/x86/tprof_pmi.c:1.15	Fri Jul 13 07:56:29 2018
+++ src/sys/arch/x86/x86/tprof_pmi.c	Sun Jul 15 06:14:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_pmi.c,v 1.15 2018/07/13 07:56:29 maxv Exp $	*/
+/*	$NetBSD: tprof_pmi.c,v 1.16 2018/07/15 06:14:21 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_pmi.c,v 1.15 2018/07/13 07:56:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_pmi.c,v 1.16 2018/07/15 06:14:21 maxv Exp $");
 
 #include 
 #include 
@@ -71,7 +71,6 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_pmi.c,
 
 #include 		/* VM_MIN_KERNEL_ADDRESS */
 
-#include 
 #include 
 
 #include