CVS commit: src/sys/arch/x68k/x68k

2019-04-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr  4 04:31:01 UTC 2019

Modified Files:
src/sys/arch/x68k/x68k: machdep.c

Log Message:
Remove cpuspeed info for 68060.
- On 68060, it's not accurate so worthless.
- I don't have 68040 so I leave it untouched.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/x68k/x68k/machdep.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/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.199 src/sys/arch/x68k/x68k/machdep.c:1.200
--- src/sys/arch/x68k/x68k/machdep.c:1.199	Thu Apr  4 03:36:15 2019
+++ src/sys/arch/x68k/x68k/machdep.c	Thu Apr  4 04:31:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.199 2019/04/04 03:36:15 isaki Exp $	*/
+/*	$NetBSD: machdep.c,v 1.200 2019/04/04 04:31:01 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2019/04/04 03:36:15 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2019/04/04 04:31:01 isaki Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -327,7 +327,7 @@ identifycpu(void)
 {
 	/* there's alot of XXX in here... */
 	const char *cpu_type, *mach, *mmu, *fpu;
-	char clock[16];
+	char clock[20];
 	char emubuf[20];
 	char cpubuf[16];
 	uint32_t pcr;
@@ -362,11 +362,10 @@ identifycpu(void)
 		break;
 	}
 
+	clock[0] = '\0';
 	emubuf[0] = '\0';
 	check_emulator(emubuf, sizeof(emubuf));
 
-	cpuspeed = 2048 / delay_divisor;
-	snprintf(clock, sizeof(clock), "%dMHz", cpuspeed);
 	switch (cputype) {
 	case CPU_68060:
 		/* from amiga */
@@ -376,22 +375,30 @@ identifycpu(void)
 		(pcr & 0x1) ? "LC/EC" : "", (pcr >> 8) & 0xff);
 		cpu_type = cpubuf;
 		mmu = "/MMU";
-		cpuspeed = 128 / delay_divisor;
-		snprintf(clock, sizeof(clock), "%d/%dMHz", cpuspeed*2, cpuspeed);
+		/*
+		 * This delay_divisor method cannot get accurate cpuspeed
+		 * for 68060.
+		 */
+		clock[0] = '\0';
 		break;
 	case CPU_68040:
 		cpu_type = "m68040";
 		mmu = "/MMU";
 		cpuspeed = 759 / delay_divisor;
-		snprintf(clock, sizeof(clock), "%d/%dMHz", cpuspeed*2, cpuspeed);
+		snprintf(clock, sizeof(clock), ", %d/%dMHz clock",
+		cpuspeed*2, cpuspeed);
 		break;
 	case CPU_68030:
 		cpu_type = "m68030";
 		mmu = "/MMU";
+		cpuspeed = 2048 / delay_divisor;
+		snprintf(clock, sizeof(clock), ", %dMHz clock", cpuspeed);
 		break;
 	case CPU_68020:
 		cpu_type = "m68020";
 		mmu = ", m68851 MMU";
+		cpuspeed = 2048 / delay_divisor;
+		snprintf(clock, sizeof(clock), ", %dMHz clock", cpuspeed);
 		break;
 	default:
 		cpu_type = "unknown";
@@ -402,7 +409,7 @@ identifycpu(void)
 		fpu = fpu_descr[fputype];
 	else
 		fpu = ", unknown FPU";
-	cpu_setmodel("X68%s (%s CPU%s%s, %s clock)%s%s",
+	cpu_setmodel("X68%s (%s CPU%s%s%s)%s%s",
 	mach, cpu_type, mmu, fpu, clock,
 		emubuf[0] ? " on " : "", emubuf);
 	printf("%s\n", cpu_getmodel());



CVS commit: src/sys/arch/x68k/x68k

2019-04-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr  4 03:36:15 UTC 2019

Modified Files:
src/sys/arch/x68k/x68k: machdep.c

Log Message:
Display 68060 revision.  From amiga/amiga/machdep.c.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/x68k/x68k/machdep.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/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.198 src/sys/arch/x68k/x68k/machdep.c:1.199
--- src/sys/arch/x68k/x68k/machdep.c:1.198	Thu Mar 14 16:59:10 2019
+++ src/sys/arch/x68k/x68k/machdep.c	Thu Apr  4 03:36:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.198 2019/03/14 16:59:10 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.199 2019/04/04 03:36:15 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.198 2019/03/14 16:59:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2019/04/04 03:36:15 isaki Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -329,6 +329,8 @@ identifycpu(void)
 	const char *cpu_type, *mach, *mmu, *fpu;
 	char clock[16];
 	char emubuf[20];
+	char cpubuf[16];
+	uint32_t pcr;
 
 	/*
 	 * check machine type constant
@@ -367,7 +369,12 @@ identifycpu(void)
 	snprintf(clock, sizeof(clock), "%dMHz", cpuspeed);
 	switch (cputype) {
 	case CPU_68060:
-		cpu_type = "m68060";
+		/* from amiga */
+		__asm(".word 0x4e7a,0x0808; movl %%d0,%0"
+		: "=d"(pcr) : : "d0");
+		snprintf(cpubuf, sizeof(cpubuf), "m68%s060 rev.%d",
+		(pcr & 0x1) ? "LC/EC" : "", (pcr >> 8) & 0xff);
+		cpu_type = cpubuf;
 		mmu = "/MMU";
 		cpuspeed = 128 / delay_divisor;
 		snprintf(clock, sizeof(clock), "%d/%dMHz", cpuspeed*2, cpuspeed);



CVS commit: src/usr.bin/ftp

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  4 00:36:09 UTC 2019

Modified Files:
src/usr.bin/ftp: fetch.c ssl.c ssl.h

Log Message:
Make fetch_read() return size_t like fread() does. It is bogus to
have one backing implementation that returns different values and
types than the other.  Handle error setting properly; i.e. bail
out if the internal read returned an error. Now we get a proper
error message when the the server resets our connection instead of
a warning that the right failed with an invalid argument.

The server used for testing was:
http://capeweather.dyndns.org:8080/graphs/3474.png
Which seems to be unreliable :-)


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ftp/ssl.h

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

Modified files:

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.230 src/usr.bin/ftp/fetch.c:1.231
--- src/usr.bin/ftp/fetch.c:1.230	Sat Feb 10 21:51:58 2018
+++ src/usr.bin/ftp/fetch.c	Wed Apr  3 20:36:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.230 2018/02/11 02:51:58 christos Exp $	*/
+/*	$NetBSD: fetch.c,v 1.231 2019/04/04 00:36:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.230 2018/02/11 02:51:58 christos Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.231 2019/04/04 00:36:09 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -1640,10 +1640,14 @@ fetch_url(const char *url, const char *p
 			if (ischunked)
 bufrem = MIN(chunksize, bufrem);
 			while (bufrem > 0) {
+size_t nr = MIN((off_t)bufsize, bufrem);
 flen = fetch_read(xferbuf, sizeof(char),
-MIN((off_t)bufsize, bufrem), fin);
-if (flen <= 0)
+nr, fin);
+if (flen == 0) {
+	if (fetch_error(fin))
+		goto chunkerror;
 	goto chunkdone;
+}
 bytes += flen;
 bufrem -= flen;
 if (fwrite(xferbuf, sizeof(char), flen, fout)
@@ -1694,7 +1698,7 @@ fetch_url(const char *url, const char *p
 	} while (ischunked);
 
 /* XXX: deal with optional trailer & CRLF here? */
-
+chunkerror:
 	if (hash && !progress && bytes > 0) {
 		if (bytes < mark)
 			(void)putc('#', ttyout);

Index: src/usr.bin/ftp/ssl.c
diff -u src/usr.bin/ftp/ssl.c:1.6 src/usr.bin/ftp/ssl.c:1.7
--- src/usr.bin/ftp/ssl.c:1.6	Tue Feb  6 14:26:02 2018
+++ src/usr.bin/ftp/ssl.c	Wed Apr  3 20:36:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl.c,v 1.6 2018/02/06 19:26:02 christos Exp $	*/
+/*	$NetBSD: ssl.c,v 1.7 2019/04/04 00:36:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -34,7 +34,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ssl.c,v 1.6 2018/02/06 19:26:02 christos Exp $");
+__RCSID("$NetBSD: ssl.c,v 1.7 2019/04/04 00:36:09 christos Exp $");
 #endif
 
 #include 
@@ -348,7 +348,7 @@ fetch_cache_data(struct fetch_connect *c
 	return 0;
 }
 
-ssize_t
+size_t
 fetch_read(void *ptr, size_t size, size_t nmemb, struct fetch_connect *conn)
 {
 	struct timeval now, timeout, delta;
@@ -408,6 +408,7 @@ fetch_read(void *ptr, size_t size, size_
 		else
 			rlen = fetch_nonssl_read(conn->sd, buf, len);
 		if (rlen == 0) {
+			conn->iseof = 1;
 			break;
 		} else if (rlen > 0) {
 			len -= rlen;
@@ -415,9 +416,10 @@ fetch_read(void *ptr, size_t size, size_
 			total += rlen;
 			continue;
 		} else if (rlen == FETCH_READ_ERROR) {
+			conn->iserr = errno;
 			if (errno == EINTR)
 fetch_cache_data(conn, start, total);
-			return -1;
+			return 0;
 		}
 		FD_ZERO(&readfds);
 		while (!FD_ISSET(conn->sd, &readfds)) {
@@ -425,8 +427,8 @@ fetch_read(void *ptr, size_t size, size_
 			if (quit_time > 0) {
 gettimeofday(&now, NULL);
 if (!timercmp(&timeout, &now, >)) {
-	errno = ETIMEDOUT;
-	return -1;
+	conn->iserr = ETIMEDOUT;
+	return 0;
 }
 timersub(&timeout, &now, &delta);
 			}
@@ -435,7 +437,8 @@ fetch_read(void *ptr, size_t size, size_
 quit_time > 0 ? &delta : NULL) < 0) {
 if (errno == EINTR)
 	continue;
-return -1;
+conn->iserr = errno;
+return 0;
 			}
 		}
 	}
@@ -451,7 +454,7 @@ char *
 fetch_getln(char *str, int size, struct fetch_connect *conn)
 {
 	size_t tmpsize;
-	ssize_t len;
+	size_t len;
 	char c;
 
 	if (conn->buf == NULL) {
@@ -474,13 +477,12 @@ fetch_getln(char *str, int size, struct 
 	conn->buflen = 0;
 	do {
 		len = fetch_read(&c, sizeof(c), 1, conn);
-		if (len == -1) {
-			conn->iserr = 1;
-			return NULL;
-		}
 		if (len == 0) {
-			conn->iseof = 1;
-			break;
+			if (conn->iserr)
+return NULL;
+			if (conn->iseof)
+break;
+			abort();
 		}
 		conn->buf[conn->buflen++] = c;
 		if (conn->buflen == conn->bufsize) {
@@ -532,8 +534,8 @@ fetch_getline(struct fetch_connect *conn
 	} else if (len == buflen - 1) {	/* line too long */
 		while (1) {
 			c

CVS commit: src/sys

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 22:10:52 UTC 2019

Modified Files:
src/sys/arch/alpha/alpha: disksubr.c
src/sys/arch/amiga/amiga: disksubr.c
src/sys/arch/arc/arc: disksubr.c
src/sys/arch/arm/arm: disksubr.c
src/sys/arch/atari/atari: disksubr.c
src/sys/arch/cobalt/cobalt: disksubr.c
src/sys/arch/evbmips/evbmips: disksubr.c
src/sys/arch/evbmips/sbmips: disksubr.c
src/sys/arch/evbppc/evbppc: disksubr.c
src/sys/arch/ews4800mips/include: disklabel.h
src/sys/arch/hp300/hp300: disksubr.c
src/sys/arch/hpc/hpc: disksubr.c
src/sys/arch/hppa/hppa: disksubr.c
src/sys/arch/luna68k/luna68k: disksubr.c
src/sys/arch/mac68k/include: disklabel.h
src/sys/arch/mac68k/mac68k: disksubr.c
src/sys/arch/macppc/include: disklabel.h
src/sys/arch/mipsco/mipsco: disksubr.c
src/sys/arch/mvme68k/mvme68k: disksubr.c
src/sys/arch/news68k/news68k: disksubr.c
src/sys/arch/newsmips/newsmips: disksubr.c
src/sys/arch/next68k/next68k: disksubr.c
src/sys/arch/ofppc/ofppc: disksubr.c
src/sys/arch/playstation2/playstation2: disksubr.c
src/sys/arch/pmax/pmax: disksubr.c
src/sys/arch/sbmips/sbmips: disksubr.c
src/sys/arch/sgimips/sgimips: disksubr.c
src/sys/arch/sh3/sh3: disksubr.c
src/sys/arch/vax/vax: disksubr.c
src/sys/arch/x68k/x68k: disksubr.c
src/sys/dev/sun: disksubr.c
src/sys/kern: subr_disk.c subr_disk_mbr.c

Log Message:
centralize setdisklabel(9)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/alpha/alpha/disksubr.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/amiga/amiga/disksubr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arc/arc/disksubr.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/arm/disksubr.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/atari/atari/disksubr.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/cobalt/cobalt/disksubr.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbmips/evbmips/disksubr.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/evbmips/sbmips/disksubr.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbppc/evbppc/disksubr.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ews4800mips/include/disklabel.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hp300/hp300/disksubr.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hpc/hpc/disksubr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/disksubr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/luna68k/luna68k/disksubr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mac68k/include/disklabel.h
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mac68k/mac68k/disksubr.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/macppc/include/disklabel.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mipsco/mipsco/disksubr.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mvme68k/mvme68k/disksubr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/news68k/news68k/disksubr.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/newsmips/newsmips/disksubr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/next68k/next68k/disksubr.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/ofppc/ofppc/disksubr.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/playstation2/playstation2/disksubr.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/pmax/pmax/disksubr.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sbmips/sbmips/disksubr.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sgimips/sgimips/disksubr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sh3/sh3/disksubr.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/vax/vax/disksubr.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x68k/x68k/disksubr.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/sun/disksubr.c
cvs rdiff -u -r1.123 -r1.124 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.49 -r1.50 src/sys/kern/subr_disk_mbr.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/alpha/alpha/disksubr.c
diff -u src/sys/arch/alpha/alpha/disksubr.c:1.41 src/sys/arch/alpha/alpha/disksubr.c:1.42
--- src/sys/arch/alpha/alpha/disksubr.c:1.41	Sun Feb  5 21:14:11 2012
+++ src/sys/arch/alpha/alpha/disksubr.c	Wed Apr  3 18:10:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.41 2012/02/06 02:14:11 matt Exp $ */
+/* $NetBSD: disksubr.c,v 1.42 2019/04/03 22:10:49 christos Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.41 2012/02/06 02:14:11 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.42 2019/04/03 22:10:49 christos Exp $");
 
 #include 
 #include 
@@ -141,59 +141,6 @@ done:
 }
 
 /*
- * Check new disk label for sensibility before setting it.
- */
-int
-setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask, struct cpu_disklabel *clp)
-{
-	int i;
-	struct partition *opp, *npp;
-
-	/* sanity clause */
-	if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0 ||
-	(nlp->d_secsize 

CVS commit: src/share/mk

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 21:41:21 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
vax "cough" works, with gcc-7


To generate a diff of this commit:
cvs rdiff -u -r1.1122 -r1.1123 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1122 src/share/mk/bsd.own.mk:1.1123
--- src/share/mk/bsd.own.mk:1.1122	Wed Apr  3 11:26:35 2019
+++ src/share/mk/bsd.own.mk	Wed Apr  3 17:41:21 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1122 2019/04/03 15:26:35 joerg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1123 2019/04/03 21:41:21 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -61,8 +61,7 @@ TOOLCHAIN_MISSING?=	no
 .if \
 ${MACHINE_CPU} == "hppa"	|| \
 ${MACHINE_CPU} == "ia64"	|| \
-${MACHINE_ARCH} == "powerpc64"	|| \
-${MACHINE_CPU} == "vax"
+${MACHINE_ARCH} == "powerpc64"
 HAVE_GCC?=	6
 .endif
 HAVE_GCC?=	7



CVS commit: src/doc

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 21:40:24 UTC 2019

Modified Files:
src/doc: HACKS

Log Message:
mention rtld vax hack


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.188 src/doc/HACKS:1.189
--- src/doc/HACKS:1.188	Wed Apr  3 16:34:18 2019
+++ src/doc/HACKS	Wed Apr  3 17:40:24 2019
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.188 2019/04/03 20:34:18 scole Exp $
+# $NetBSD: HACKS,v 1.189 2019/04/03 21:40:24 christos Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -911,3 +911,12 @@ desc
 	uninitialized index.  Submitted a request for change with upstream
 	mailing list, but never got a response
 kcah
+
+port	vax
+hack	compile rtld.c with -O0
+cdate	Wed Apr  3 17:38:38 EDT 2019
+who	christos
+file	src/libexec/ld.elf_so/Makefile: 1.141
+descr	Disable optimization for rtld.c on the vax with gcc-7. Crashes on the
+	second pass loop with elm == 0x
+kcah



CVS commit: src/libexec/ld.elf_so

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 21:37:58 UTC 2019

Modified Files:
src/libexec/ld.elf_so: Makefile

Log Message:
Disable optimization for rtld.c on the vax with gcc-7.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/libexec/ld.elf_so/Makefile

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/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.140 src/libexec/ld.elf_so/Makefile:1.141
--- src/libexec/ld.elf_so/Makefile:1.140	Thu Dec 27 13:58:14 2018
+++ src/libexec/ld.elf_so/Makefile	Wed Apr  3 17:37:58 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.140 2018/12/27 18:58:14 christos Exp $
+#	$NetBSD: Makefile,v 1.141 2019/04/03 21:37:58 christos Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -124,6 +124,10 @@ CPPFLAGS+=	-DRTLD_DEFAULT_LIBRARY_PATH=\
 COPTS.rtld.c+=	-Wno-stack-protector
 COPTS.symbol.c+=-Wno-stack-protector
 
+.if ${MACHINE_CPU} == "vax"
+COPTS.rtld.c+=	-O0
+.endif
+
 LDADD+=		-Wl,--version-script=${.CURDIR}/symbols.map
 LDADD+=		-L${CLIBOBJ} -L${DESTDIR}${LIBDIR}
 .if ${MKPICLIB} != "no"



CVS commit: src/sys/arch/ia64

2019-04-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr  3 21:03:06 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
add note about pmap.c compilation warnings


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.4 src/sys/arch/ia64/TODO:1.5
--- src/sys/arch/ia64/TODO:1.4	Wed Jan 30 22:53:22 2019
+++ src/sys/arch/ia64/TODO	Wed Apr  3 21:03:06 2019
@@ -15,6 +15,10 @@ What works:
 
 Tasks remaining, first couple seem most important:
 
+- pmap.c is getting compilation warnings (for gcc6 & gcc7) like
+  /var/tmp//cckQKcKn.s:7614: Warning: Use of 'st8' may violate RAW dependency 'RR#' (data)
+  ...
+  how to change compile flags for specific kernel file like "CFLAGS.pmap.c+= -O0" ?
 - context switching and forking appear unfinished,
   vm_machdep.c::cpu_lwp_fork() appears incomplete
 - pmap module, imported from freebsd but still needs more work and



CVS commit: src/doc

2019-04-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr  3 20:34:18 UTC 2019

Modified Files:
src/doc: HACKS

Log Message:
Remove obsoleted ia64 gcc 4.5.3 hacks


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.187 src/doc/HACKS:1.188
--- src/doc/HACKS:1.187	Sun Apr  9 19:02:23 2017
+++ src/doc/HACKS	Wed Apr  3 20:34:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.187 2017/04/09 19:02:23 scole Exp $
+# $NetBSD: HACKS,v 1.188 2019/04/03 20:34:18 scole Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -811,42 +811,6 @@ port	emips
 
 port	ia64
 
-	hack	libc hesiod.c file does not compile with -O2 (internal
-		compiler error in gcc 4.5.3)
-	cdate	Thu Dec 27 08:05:43 CET 2012
-	who	martin
-	file	src/lib/libc/net/Makefile.inc: 1.82
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:1507: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 15
-		{standard input}:1506: Warning: This is the location of the conflicting usage
-		{standard input}: Error: 2 warnings, treating warnings as errors
-	kcah
-
-	hack	libelf libelf_extended.c compiler error in gcc 4.5.3
-	cdate	Thu Dec 27 09:05:51 CET 2012
-	who	martin
-	file	src/external/bsd/libelf/lib/Makefile: 1.3
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:87: Warning: Use of 'adds' may violate RAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
-		{standard input}:87: Warning: Only the first path encountering the conflict is reported
-		{standard input}:85: Warning: This is the location of the conflicting usage
-	kcah
-
-	hack	compiler error with gcc 4.5.x
-	cdate	Thu Dec 27 15:15:25 CET 2012
-	who	martin
-	file	src/crypto/external/bsd/netpgp/lib/verify/Makefile: 1.5
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:22979: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8
-		{standard input}:22978: Warning: This is the location of the conflicting usage
-	kcah
-
 	hack	libgcc unwind dummy function
 	cdate	Fri Apr 17 14:31:03 CEST 2015
 	who	martin



CVS commit: src/etc/mtree

2019-04-03 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed Apr  3 19:52:38 UTC 2019

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

Log Message:
Fix previous.
sparc64 is automatically added, so leave the sparc line.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/etc/mtree/NetBSD.dist.sparc64

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.sparc64
diff -u src/etc/mtree/NetBSD.dist.sparc64:1.13 src/etc/mtree/NetBSD.dist.sparc64:1.14
--- src/etc/mtree/NetBSD.dist.sparc64:1.13	Tue Mar 12 10:07:49 2019
+++ src/etc/mtree/NetBSD.dist.sparc64	Wed Apr  3 19:52:38 2019
@@ -1,3 +1,3 @@
-#	$NetBSD: NetBSD.dist.sparc64,v 1.13 2019/03/12 10:07:49 mrg Exp $
+#	$NetBSD: NetBSD.dist.sparc64,v 1.14 2019/04/03 19:52:38 nakayama Exp $
 
-./usr/include/sparc64
+./usr/include/sparc



CVS commit: src/sys/netinet6

2019-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  3 19:23:38 UTC 2019

Modified Files:
src/sys/netinet6: ip6_output.c

Log Message:
Fix small read overflow; harmless, because since I removed RH0, the memory
access on IPV6_RTHDR that would normally be illegal is not needed, and GCC
automatically removes it.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/netinet6/ip6_output.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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.217 src/sys/netinet6/ip6_output.c:1.218
--- src/sys/netinet6/ip6_output.c:1.217	Mon Feb  4 10:48:46 2019
+++ src/sys/netinet6/ip6_output.c	Wed Apr  3 19:23:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.217 2019/02/04 10:48:46 mrg Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.218 2019/04/03 19:23:38 maxv Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.217 2019/02/04 10:48:46 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.218 2019/04/03 19:23:38 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2772,7 +2772,7 @@ ip6_setpktopts(struct mbuf *control, str
 			return (EINVAL);
 
 		cm = mtod(control, struct cmsghdr *);
-		if (cm->cmsg_len == 0 || cm->cmsg_len > control->m_len)
+		if (cm->cmsg_len < CMSG_LEN(0) || cm->cmsg_len > control->m_len)
 			return (EINVAL);
 		if (cm->cmsg_level != IPPROTO_IPV6)
 			continue;



CVS commit: src/sys/arch/amd64/stand/prekern

2019-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  3 19:14:25 UTC 2019

Modified Files:
src/sys/arch/amd64/stand/prekern: console.c

Log Message:
When scrolling the screen don't forget to update the last line. Whatever,
there is no case where the screen scrolls actually.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/stand/prekern/console.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/amd64/stand/prekern/console.c
diff -u src/sys/arch/amd64/stand/prekern/console.c:1.3 src/sys/arch/amd64/stand/prekern/console.c:1.4
--- src/sys/arch/amd64/stand/prekern/console.c:1.3	Fri Nov 17 07:07:52 2017
+++ src/sys/arch/amd64/stand/prekern/console.c	Wed Apr  3 19:14:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: console.c,v 1.3 2017/11/17 07:07:52 maxv Exp $	*/
+/*	$NetBSD: console.c,v 1.4 2019/04/03 19:14:25 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -61,7 +61,7 @@ static void check_scroll(void)
 	memset(&cons_buffer[0] + (CONS_WID * 2) * (CONS_HEI-1), 0,
 	(CONS_WID * 2));
 	cons_y--;
-	memcpy(cons_start, &cons_buffer[0], (CONS_WID * 2) * (CONS_HEI-1));
+	memcpy(cons_start, &cons_buffer[0], CONS_WID * 2 * CONS_HEI);
 }
 
 void print_ext(int color, char *buf)



CVS commit: src/sys/dev/nvmm/x86

2019-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  3 19:10:58 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c nvmm_x86.h nvmm_x86_vmx.c

Log Message:
VMX: if PAT is not valid, #GP on WRMSR, rather than crashing the guest.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86.c:1.4 src/sys/dev/nvmm/x86/nvmm_x86.c:1.5
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.4	Wed Apr  3 17:32:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Wed Apr  3 19:10:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.4 2019/04/03 17:32:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.5 2019/04/03 19:10:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.4 2019/04/03 17:32:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.5 2019/04/03 19:10:58 maxv Exp $");
 
 #include 
 #include 
@@ -313,3 +313,19 @@ const struct nvmm_x86_cpuid_mask nvmm_cp
 	CPUID_EM64T | CPUID_3DNOW2 |
 	CPUID_3DNOW
 };
+
+bool
+nvmm_x86_pat_validate(uint64_t val)
+{
+	uint8_t *pat = (uint8_t *)&val;
+	size_t i;
+
+	for (i = 0; i < 8; i++) {
+		if (__predict_false(pat[i] & ~__BITS(2,0)))
+			return false;
+		if (__predict_false(pat[i] == 2 || pat[i] == 3))
+			return false;
+	}
+
+	return true;
+}

Index: src/sys/dev/nvmm/x86/nvmm_x86.h
diff -u src/sys/dev/nvmm/x86/nvmm_x86.h:1.9 src/sys/dev/nvmm/x86/nvmm_x86.h:1.10
--- src/sys/dev/nvmm/x86/nvmm_x86.h:1.9	Wed Apr  3 17:32:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.h	Wed Apr  3 19:10:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.h,v 1.9 2019/04/03 17:32:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.h,v 1.10 2019/04/03 19:10:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -186,6 +186,7 @@ extern const struct nvmm_x64_state nvmm_
 extern const struct nvmm_x86_cpuid_mask nvmm_cpuid_0001;
 extern const struct nvmm_x86_cpuid_mask nvmm_cpuid_0007;
 extern const struct nvmm_x86_cpuid_mask nvmm_cpuid_8001;
+bool nvmm_x86_pat_validate(uint64_t);
 #endif
 
 #endif /* ASM_NVMM */

Index: src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.22 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.23
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.22	Wed Apr  3 18:05:55 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Wed Apr  3 19:10:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.22 2019/04/03 18:05:55 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.23 2019/04/03 19:10:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.22 2019/04/03 18:05:55 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.23 2019/04/03 19:10:58 maxv Exp $");
 
 #include 
 #include 
@@ -1502,7 +1502,11 @@ vmx_inkernel_handle_msr(struct nvmm_mach
 			goto handled;
 		}
 		if (exit->u.msr.msr == MSR_CR_PAT) {
-			vmx_vmwrite(VMCS_GUEST_IA32_PAT, exit->u.msr.val);
+			val = exit->u.msr.val;
+			if (__predict_false(!nvmm_x86_pat_validate(val))) {
+goto error;
+			}
+			vmx_vmwrite(VMCS_GUEST_IA32_PAT, val);
 			goto handled;
 		}
 		if (exit->u.msr.msr == MSR_MISC_ENABLE) {
@@ -1522,6 +1526,10 @@ vmx_inkernel_handle_msr(struct nvmm_mach
 handled:
 	vmx_inkernel_advance();
 	return true;
+
+error:
+	vmx_inject_gp(mach, vcpu);
+	return true;
 }
 
 static void



CVS commit: src/sys/dev/nvmm/x86

2019-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  3 18:05:55 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_vmx.c

Log Message:
Add new VMCS bits.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.21 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.22
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.21	Wed Apr  3 17:32:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Wed Apr  3 18:05:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.21 2019/04/03 17:32:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.22 2019/04/03 18:05:55 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.21 2019/04/03 17:32:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.22 2019/04/03 18:05:55 maxv Exp $");
 
 #include 
 #include 
@@ -205,6 +205,7 @@ int vmx_vmresume(uint64_t *gprs);
 #define VMCS_VIRTUAL_EXCEPTION			0x202A
 #define VMCS_XSS_EXIT_BITMAP			0x202C
 #define VMCS_ENCLS_EXIT_BITMAP			0x202E
+#define VMCS_SUBPAGE_PERM_TABLE_PTR		0x2030
 #define VMCS_TSC_MULTIPLIER			0x2032
 /* 64-bit read-only fields */
 #define VMCS_GUEST_PHYSICAL_ADDRESS		0x2400
@@ -229,7 +230,7 @@ int vmx_vmresume(uint64_t *gprs);
 #define		PIN_CTLS_NMI_EXITING		__BIT(3)
 #define		PIN_CTLS_VIRTUAL_NMIS		__BIT(5)
 #define		PIN_CTLS_ACTIVATE_PREEMPT_TIMER	__BIT(6)
-#define		PIN_CTLS_PROCESS_POSTEd_INTS	__BIT(7)
+#define		PIN_CTLS_PROCESS_POSTED_INTS	__BIT(7)
 #define VMCS_PROCBASED_CTLS			0x4002
 #define		PROC_CTLS_INT_WINDOW_EXITING	__BIT(2)
 #define		PROC_CTLS_USE_TSC_OFFSETTING	__BIT(3)
@@ -319,7 +320,9 @@ int vmx_vmresume(uint64_t *gprs);
 #define		PROC_CTLS2_CONCEAL_VMX_FROM_PT	__BIT(19)
 #define		PROC_CTLS2_XSAVES_ENABLE	__BIT(20)
 #define		PROC_CTLS2_MODE_BASED_EXEC_EPT	__BIT(22)
+#define		PROC_CTLS2_SUBPAGE_PERMISSIONS	__BIT(23)
 #define		PROC_CTLS2_USE_TSC_SCALING	__BIT(25)
+#define		PROC_CTLS2_ENCLV_EXITING	__BIT(28)
 #define VMCS_PLE_GAP0x4020
 #define VMCS_PLE_WINDOW0x4022
 /* 32-bit read-only data fields */



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

2019-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr  3 17:55:27 UTC 2019

Modified Files:
src/sys/arch/arm/arm: armv6_start.S

Log Message:
Debug output alignment


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/arm/armv6_start.S

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/arm/armv6_start.S
diff -u src/sys/arch/arm/arm/armv6_start.S:1.9 src/sys/arch/arm/arm/armv6_start.S:1.10
--- src/sys/arch/arm/arm/armv6_start.S:1.9	Tue Apr  2 20:00:36 2019
+++ src/sys/arch/arm/arm/armv6_start.S	Wed Apr  3 17:55:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv6_start.S,v 1.9 2019/04/02 20:00:36 jmcneill Exp $	*/
+/*	$NetBSD: armv6_start.S,v 1.10 2019/04/03 17:55:27 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2017, 2018 The NetBSD Foundation, Inc.
@@ -118,13 +118,13 @@ ENTRY_NP(generic_start)
 
 	// We can now call functions
 
-	VPRINTF("\n\rpc   :")
+	VPRINTF("\n\rpc: ")
 	VPRINTX(pc)
 
-	VPRINTF("\n\roff  :")
+	VPRINTF("\n\roff   : ")
 	VPRINTX(R_VTOPDIFF)
 
-	VPRINTF("\n\rsp   :")
+	VPRINTF("\n\rsp: ")
 	VPRINTX(sp)
 
 	ldr	R_TMP1, =kern_vtopdiff
@@ -150,7 +150,7 @@ ENTRY_NP(generic_start)
 	/*
 	 * ARM boot protocol has FDT address in r2 which is now in r6
 	 */
-	VPRINTF("\n\rfdt  :")
+	VPRINTF("\n\rfdt   : ")
 	ldr	R_TMP1, =fdt_addr_r
 	sub	R_TMP1, R_TMP1, R_VTOPDIFF
 	str	r6, [R_TMP1]
@@ -160,22 +160,22 @@ ENTRY_NP(generic_start)
 #endif
 
 #ifdef VERBOSE_INIT_ARM
-	VPRINTF("\n\rmidr :")
+	VPRINTF("\n\rmidr  : ")
 	mrc	p15, 0, r0, c0, c0, 0	// MIDR
 	VPRINTX(r0)
 	VPRINTF("\n\rrevidr: ")
 	mrc	p15, 0, r0, c0, c0, 6	// REVIDR
 	VPRINTX(r0)
-	VPRINTF("\n\rmpidr:")
+	VPRINTF("\n\rmpidr : ")
 	mrc	p15, 0, r0, c0, c0, 5	// MPIDR
 	VPRINTX(r0)
-	VPRINTF("\n\rttb0 :")
+	VPRINTF("\n\rttb0  : ")
 	mrc	p15, 0, r0, c2, c0, 0	// TTBR0 read
 	VPRINTX(r0)
-	VPRINTF("\n\rttb1 :")
+	VPRINTF("\n\rttb1  : ")
 	mrc	p15, 0, r0, c2, c0, 1	// TTBR1 read
 	VPRINTX(r0)
-	VPRINTF("\n\rttcr :")
+	VPRINTF("\n\rttcr  : ")
 	mrc	p15, 0, r0, c2, c0, 2	// TTBCR read
 	VPRINTX(r0)
 	VPRINTF("\n\r")



CVS commit: src/sys/dev/nvmm/x86

2019-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr  3 17:32:58 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c nvmm_x86.h nvmm_x86_svm.c
nvmm_x86_vmx.c

Log Message:
Add MSR_TSC.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86.c:1.3 src/sys/dev/nvmm/x86/nvmm_x86.c:1.4
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.3	Sun Mar  3 07:01:09 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Wed Apr  3 17:32:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.3 2019/03/03 07:01:09 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.4 2019/04/03 17:32:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.3 2019/03/03 07:01:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.4 2019/04/03 17:32:58 maxv Exp $");
 
 #include 
 #include 
@@ -210,6 +210,7 @@ const struct nvmm_x64_state nvmm_x86_res
 		PATENTRY(2, PAT_UCMINUS) | PATENTRY(3, PAT_UC) |
 		PATENTRY(4, PAT_WB) | PATENTRY(5, PAT_WT) |
 		PATENTRY(6, PAT_UCMINUS) | PATENTRY(7, PAT_UC),
+		[NVMM_X64_MSR_TSC] = 0,
 	},
 
 	.misc = {

Index: src/sys/dev/nvmm/x86/nvmm_x86.h
diff -u src/sys/dev/nvmm/x86/nvmm_x86.h:1.8 src/sys/dev/nvmm/x86/nvmm_x86.h:1.9
--- src/sys/dev/nvmm/x86/nvmm_x86.h:1.8	Sun Mar  3 07:01:09 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.h	Wed Apr  3 17:32:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.h,v 1.8 2019/03/03 07:01:09 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.h,v 1.9 2019/04/03 17:32:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -95,7 +95,8 @@
 #define NVMM_X64_MSR_SYSENTER_ESP	7
 #define NVMM_X64_MSR_SYSENTER_EIP	8
 #define NVMM_X64_MSR_PAT		9
-#define NVMM_X64_NMSR			10
+#define NVMM_X64_MSR_TSC		10
+#define NVMM_X64_NMSR			11
 
 /* Misc. */
 #define NVMM_X64_MISC_INT_SHADOW	0

Index: src/sys/dev/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.35 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.36
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.35	Thu Mar 21 20:21:41 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Wed Apr  3 17:32:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.35 2019/03/21 20:21:41 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.36 2019/04/03 17:32:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.35 2019/03/21 20:21:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.36 2019/04/03 17:32:58 maxv Exp $");
 
 #include 
 #include 
@@ -505,6 +505,7 @@ struct svm_cpudata {
 	/* General */
 	bool shared_asid;
 	bool gtlb_want_flush;
+	bool gtsc_want_update;
 	uint64_t vcpu_htlb_gen;
 
 	/* VMCB */
@@ -538,7 +539,7 @@ struct svm_cpudata {
 	uint64_t gxcr0;
 	uint64_t gprs[NVMM_X64_NGPR];
 	uint64_t drs[NVMM_X64_NDR];
-	uint64_t tsc_offset;
+	uint64_t gtsc;
 	struct xsave_header gfpu __aligned(64);
 };
 
@@ -1000,10 +1001,8 @@ svm_inkernel_handle_msr(struct nvmm_mach
 			goto handled;
 		}
 		if (exit->u.msr.msr == MSR_TSC) {
-			cpudata->tsc_offset = exit->u.msr.val - cpu_counter();
-			vmcb->ctrl.tsc_offset = cpudata->tsc_offset +
-			curcpu()->ci_data.cpu_cc_skew;
-			svm_vmcb_cache_flush(vmcb, VMCB_CTRL_VMCB_CLEAN_I);
+			cpudata->gtsc = exit->u.msr.val;
+			cpudata->gtsc_want_update = true;
 			goto handled;
 		}
 		for (i = 0; i < __arraycount(msr_ignore_list); i++) {
@@ -1268,9 +1267,8 @@ svm_vcpu_run(struct nvmm_machine *mach, 
 	svm_htlb_catchup(vcpu, hcpu);
 
 	if (vcpu->hcpu_last != hcpu) {
-		vmcb->ctrl.tsc_offset = cpudata->tsc_offset +
-		curcpu()->ci_data.cpu_cc_skew;
 		svm_vmcb_cache_flush_all(vmcb);
+		cpudata->gtsc_want_update = true;
 	}
 
 	svm_vcpu_guest_dbregs_enter(vcpu);
@@ -1283,6 +1281,11 @@ svm_vcpu_run(struct nvmm_machine *mach, 
 			vmcb->ctrl.tlb_ctrl = 0;
 		}
 
+		if (__predict_false(cpudata->gtsc_want_update)) {
+			vmcb->ctrl.tsc_offset = cpudata->gtsc - rdtsc();
+			svm_vmcb_cache_flush(vmcb, VMCB_CTRL_VMCB_CLEAN_I);
+		}
+
 		s = splhigh();
 		machgen = svm_htlb_flush(machdata, cpudata);
 		svm_vcpu_guest_fpu_enter(vcpu);
@@ -1295,6 +1298,7 @@ svm_vcpu_run(struct nvmm_machine *mach, 
 
 		if (vmcb->ctrl.exitcode != VMCB_EXITCODE_INVALID) {
 			cpudata->gtlb_want_flush = false;
+			cpudata->gtsc_want_update = false;
 			vcpu->hcpu_last = hcpu;
 		}
 
@@ -1376,6 +1380,8 @@ svm_vcpu_run(struct nvmm_machine *mach, 
 		}
 	}
 
+	cpudata->gtsc = rdtsc() + vmcb->ctrl.tsc_offset;
+
 	svm_vcpu_guest_misc_leave(vcpu);
 	svm_vcpu_guest_dbregs_leave(vcpu);
 
@@ -1644,6 +1650,9 

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

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 16:30:29 UTC 2019

Modified Files:
src/sys/arch/sun2/conf: RAMDISK

Log Message:
Gut more stuff so we fit. Last working RAMDISK kernel was 6.1.5.
Nobody runs this stuff anymore, so consider that netbsd 9 might be
the last sun2 release.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sun2/conf/RAMDISK

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/sun2/conf/RAMDISK
diff -u src/sys/arch/sun2/conf/RAMDISK:1.59 src/sys/arch/sun2/conf/RAMDISK:1.60
--- src/sys/arch/sun2/conf/RAMDISK:1.59	Wed Aug  1 16:04:14 2018
+++ src/sys/arch/sun2/conf/RAMDISK	Wed Apr  3 12:30:28 2019
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.59 2018/08/01 20:04:14 maxv Exp $
+# $NetBSD: RAMDISK,v 1.60 2019/04/03 16:30:28 christos Exp $
 
 # RAMDISK: Root/swap on ramdisk
 # This kernel is used to:
@@ -27,7 +27,7 @@ maxusers	2
 #options 	SYSVSEM		# System V semaphores
 #options 	SYSVSHM		# System V shared memory
 #options 	INSECURE	# disable kernel security level
-options 	USERCONF	# userconf(4) support
+#options 	USERCONF	# userconf(4) support
 options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 #options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
@@ -51,12 +51,12 @@ options 	PIPE_SOCKETPAIR	# smaller, but 
 #options 	COMPAT_SUNOS	# can run SunOS 4.1.1 executables
 #options 	COMPAT_AOUT_M68K # support for NetBSD a.out executables
 #options 	EXEC_AOUT	# support for a.out executables
-options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+#options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # Filesystem options
 file-system	FFS		# Berkeley Fast Filesystem
-file-system	NFS		# Sun NFS client support
-file-system	CD9660		# ISO 9660 + Rock Ridge file system
+#file-system	NFS		# Sun NFS client support
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
 #file-system	FDESC		# /dev/fd/*
 #file-system	KERNFS		# /kern
 #file-system	NULLFS		# loopback file system
@@ -70,7 +70,7 @@ file-system	CD9660		# ISO 9660 + Rock Ri
 #options 	QUOTA		# legacy UFS quotas
 #options 	QUOTA2		# new, in-filesystem UFS quotas
 #options 	FFS_EI		# FFS Endian Independent support
-options 	NFS_V2_ONLY	# Exclude NFS3 code to save space
+#options 	NFS_V2_ONLY	# Exclude NFS3 code to save space
 options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
@@ -172,7 +172,7 @@ scsibus* at sc?
 scsibus* at si?
 sd*	at scsibus? target ? lun ?		# SCSI disks
 st*	at scsibus? target ? lun ?		# SCSI tapes
-cd*	at scsibus? target ? lun ?		# SCSI CD-ROMs
+#cd*	at scsibus? target ? lun ?		# SCSI CD-ROMs
 #ch*	at scsibus? target ? lun ?		# SCSI changer devices
 #ss*	at scsibus? target ? lun ?		# SCSI scanners
 #ses*	at scsibus? target ? lun ?		# SCSI SES/SAF-TE
@@ -219,7 +219,7 @@ pcons0	at mainbus0			# PROM console
  Miscellaneous.
 pseudo-device	loop			# network loopback
 #pseudo-device	bpfilter		# packet filter
-pseudo-device	sl			# CSLIP
+#pseudo-device	sl			# CSLIP
 #pseudo-device	ppp			# PPP
 #pseudo-device	tun			# network tunneling over tty
 #pseudo-device	gre			# generic L3 over IP tunnel



CVS commit: src

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:26:35 UTC 2019

Modified Files:
src/external/mit/xorg/lib: libmesa.mk
src/external/mit/xorg/lib/gallium: Makefile
src/share/mk: bsd.README bsd.own.mk

Log Message:
Use and enable MKLLVMRT for HAVE_MESA_VER=18.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/lib/libmesa.mk
cvs rdiff -u -r1.19 -r1.20 src/external/mit/xorg/lib/gallium/Makefile
cvs rdiff -u -r1.388 -r1.389 src/share/mk/bsd.README
cvs rdiff -u -r1.1121 -r1.1122 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/external/mit/xorg/lib/libmesa.mk
diff -u src/external/mit/xorg/lib/libmesa.mk:1.5 src/external/mit/xorg/lib/libmesa.mk:1.6
--- src/external/mit/xorg/lib/libmesa.mk:1.5	Fri Mar 15 03:10:25 2019
+++ src/external/mit/xorg/lib/libmesa.mk	Wed Apr  3 15:26:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: libmesa.mk,v 1.5 2019/03/15 03:10:25 mrg Exp $
+#	$NetBSD: libmesa.mk,v 1.6 2019/04/03 15:26:34 joerg Exp $
 #
 # Consumer of this Makefile should set MESA_SRC_MODULES.
 
@@ -527,7 +527,7 @@ CPPFLAGS+=	\
 	-DENABLE_SHADER_CACHE \
 	-DHAVE_MINCORE
 
-.if ${MKLLVM} == "yes"
+.if ${MKLLVMRT} != "no"
 CPPFLAGS+=	\
 	-DHAVE_LLVM=0x0700 \
 	-DMESA_LLVM_VERSION_PATCH=0

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.19 src/external/mit/xorg/lib/gallium/Makefile:1.20
--- src/external/mit/xorg/lib/gallium/Makefile:1.19	Sun Mar 10 10:51:58 2019
+++ src/external/mit/xorg/lib/gallium/Makefile	Wed Apr  3 15:26:34 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2019/03/10 10:51:58 mrg Exp $
+# $NetBSD: Makefile,v 1.20 2019/04/03 15:26:34 joerg Exp $
 
 # Link the gallium mega driver.
 
@@ -13,15 +13,13 @@ LIB=		gallium_dri
 DRIDIR=		${X11USRLIBDIR}/modules/dri
 DRIDEBUGDIR=	${DEBUGDIR}${X11USRLIBDIR}/modules/dri
 
-LLVM_TOOLCONF_OBJDIR!=	cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
-LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
+LLVM_INCLUDE_OBJDIR!=	cd ${NETBSDSRCDIR}/external/bsd/llvm/include && ${PRINTOBJDIR}
 
 CXXFLAGS+=	-std=c++11
 CFLAGS+=	-std=gnu11
 CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libdrm \
 		-I${NETBSDSRCDIR}/external/bsd/llvm/dist/llvm/include \
-		-I${LLVM_TOOLCONF_OBJDIR}/config/include \
-		-I${LLVM_INCLUDE_OBJDIR}
+		-I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/bsd/llvm/config
 
 GALLIUM_SUBDIRS= \
 	auxiliary \
@@ -91,7 +89,7 @@ BUILD_I915=0
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 BUILD_RADEON=1
 BUILD_I915=1
-.if ${MKLLVM} == "yes"
+.if ${MKLLVMRT} != "no"
 BUILD_LLVMPIPE=1
 .endif
 .endif
@@ -160,7 +158,7 @@ GALLIUM_SOURCES.auxiliary/draw= \
 	draw_vs_exec.c \
 	draw_vs_variant.c
 
-.if ${MKLLVM:Uno} != "no"
+.if ${MKLLVMRT} != "no"
 GALLIUM_SOURCES.auxiliary/draw+= \
 	draw_llvm.c \
 	draw_llvm_sample.c \
@@ -963,7 +961,7 @@ LIBDPLIBS+=	execinfo	${.CURDIR}/../../..
 # gallium drivers requiring LLVM
 .if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1
 
-LLVM_LIB_DIR!=	cd ${.CURDIR}/../../../../../external/bsd/llvm/lib; ${PRINTOBJDIR}
+LLVM_LIB_DIR!=	cd ${.CURDIR}/../../../../../external/bsd/llvm/librt; ${PRINTOBJDIR}
 
 LLVM_LIBS=	\
 		TransformsCoroutines \
@@ -1023,8 +1021,8 @@ LLVM_LIBS+=	\
 		Support
 
 .for llvm_library in ${LLVM_LIBS}
-DPADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}.a
-LDADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}.a
+DPADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
+LDADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
 .endfor
 
 .endif  # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.388 src/share/mk/bsd.README:1.389
--- src/share/mk/bsd.README:1.388	Wed Apr  3 15:17:23 2019
+++ src/share/mk/bsd.README	Wed Apr  3 15:26:35 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.388 2019/04/03 15:17:23 joerg Exp $
+#	$NetBSD: bsd.README,v 1.389 2019/04/03 15:26:35 joerg Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -322,6 +322,11 @@ MKLLVM		If "yes", build and install clan
 		(see below for details).
 		Default: no
 
+MKLLVMRT	If "yes", build the LLVM PIC libraries necessary for the
+		AMDGPU backend and the native JIT of the target architecture,
+		if supported.
+		Default: no, enabled automatically with HAVE_MESA_VER=18.
+
 MKLVM		If "no", don't build or install the logical volume manager
 		and device mapper tools and libraries
 		Default: yes

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1121 src/share/mk/bsd.own.mk:1.1122
--- src/share/mk/bsd.own.mk:1.1121	Wed Apr  3 15:23:29 2019
+++ src/share/mk/bsd.own.mk	Wed Apr  3 15:26:35 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1121 2019/04/03 15:23:29 joerg Exp $
+#	$

CVS commit: src/share/mk

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:23:29 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Provide a default value of no for MKLLVMRT.


To generate a diff of this commit:
cvs rdiff -u -r1.1120 -r1.1121 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1120 src/share/mk/bsd.own.mk:1.1121
--- src/share/mk/bsd.own.mk:1.1120	Wed Apr  3 15:12:45 2019
+++ src/share/mk/bsd.own.mk	Wed Apr  3 15:23:29 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1120 2019/04/03 15:12:45 joerg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1121 2019/04/03 15:23:29 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1169,7 +1169,7 @@ _MKVARS.no= \
 	MKFIRMWARE \
 	MKGROFFHTMLDOC \
 	MKKYUA \
-	MKLIBCXX MKLLD MKLLDB MKLLVM MKLINT \
+	MKLIBCXX MKLLD MKLLDB MKLLVM MKLLVMRT MKLINT \
 	MKMANZ MKMCLINKER \
 	MKNSD \
 	MKOBJDIRS \



CVS commit: src

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:22:06 UTC 2019

Modified Files:
src/external/bsd: Makefile
src/external/bsd/llvm: Makefile Makefile.inc
src/external/bsd/llvm/bin/clang: Makefile
src/external/bsd/llvm/config/llvm/Config: AsmParsers.def
AsmPrinters.def Disassemblers.def Targets.def
src/external/bsd/llvm/include: Makefile
src/external/bsd/llvm/lib: Makefile
src/lib: Makefile
src/tools: Makefile
Added Files:
src/external/bsd/llvm/librt: Makefile Makefile.inc
src/external/bsd/llvm/librt/libLLVMAArch64AsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64AsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64CodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64Disassembler: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64MCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64TargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMAArch64Utils: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUMCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUTargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMAMDGPUUtils: Makefile
src/external/bsd/llvm/librt/libLLVMARMAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMARMAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMARMCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMARMDisassembler: Makefile
src/external/bsd/llvm/librt/libLLVMARMMCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMARMTargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMARMUtils: Makefile
src/external/bsd/llvm/librt/libLLVMAnalysis: Makefile
src/external/bsd/llvm/librt/libLLVMAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMBinaryFormat: Makefile
src/external/bsd/llvm/librt/libLLVMBitReader: Makefile
src/external/bsd/llvm/librt/libLLVMCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMDebugInfoCodeView: Makefile
src/external/bsd/llvm/librt/libLLVMExecutionEngine: Makefile
src/external/bsd/llvm/librt/libLLVMGlobalISel: Makefile
src/external/bsd/llvm/librt/libLLVMIR: Makefile
src/external/bsd/llvm/librt/libLLVMIRReader: Makefile
src/external/bsd/llvm/librt/libLLVMInstCombine: Makefile
src/external/bsd/llvm/librt/libLLVMInstrumentation: Makefile
src/external/bsd/llvm/librt/libLLVMLinker: Makefile
src/external/bsd/llvm/librt/libLLVMMC: Makefile
src/external/bsd/llvm/librt/libLLVMMCDisassembler: Makefile
src/external/bsd/llvm/librt/libLLVMMCJIT: Makefile
src/external/bsd/llvm/librt/libLLVMMCParser: Makefile
src/external/bsd/llvm/librt/libLLVMMipsAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMMipsAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMMipsCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMMipsDisassembler: Makefile
src/external/bsd/llvm/librt/libLLVMMipsMCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMMipsTargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMObject: Makefile
src/external/bsd/llvm/librt/libLLVMPasses: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCDisassembler: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCMCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMPowerPCTargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMProfileData: Makefile
src/external/bsd/llvm/librt/libLLVMRuntimeDyld: Makefile
src/external/bsd/llvm/librt/libLLVMScalarOpts: Makefile
src/external/bsd/llvm/librt/libLLVMSelectionDAG: Makefile
src/external/bsd/llvm/librt/libLLVMSparcAsmParser: Makefile
src/external/bsd/llvm/librt/libLLVMSparcAsmPrinter: Makefile
src/external/bsd/llvm/librt/libLLVMSparcCodeGen: Makefile
src/external/bsd/llvm/librt/libLLVMSparcDisassembler: Makefile
src/external/bsd/llvm/librt/libLLVMSparcMCTargetDesc: Makefile
src/external/bsd/llvm/librt/libLLVMSparcTargetInfo: Makefile
src/external/bsd/llvm/librt/libLLVMSupport: Makefile
src/external/bsd/llvm/librt/libLLVMTarget: Makefile
src/external/bsd/llvm/librt/libLLVMTransformsAggressiveInstCombine:
Makefile
src/external/bsd/llvm/librt/libLLVMTransformsCoroutin

CVS commit: src/share/mk

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:17:23 UTC 2019

Modified Files:
src/share/mk: bsd.README

Log Message:
Document MKLLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.387 -r1.388 src/share/mk/bsd.README

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.387 src/share/mk/bsd.README:1.388
--- src/share/mk/bsd.README:1.387	Tue Jan  1 19:06:38 2019
+++ src/share/mk/bsd.README	Wed Apr  3 15:17:23 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.387 2019/01/01 19:06:38 christos Exp $
+#	$NetBSD: bsd.README,v 1.388 2019/04/03 15:17:23 joerg Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -317,6 +317,11 @@ MKLINKLIB	If "no", act as "MKLINT=no MKP
 MKLINT		If "no", don't build or install the lint libraries.
 		Default: yes
 
+MKLLVM		If "yes", build and install clang as host tool and target
+		compiler.  Use as system compiler is enabled with HAVE_LLVM
+		(see below for details).
+		Default: no
+
 MKLVM		If "no", don't build or install the logical volume manager
 		and device mapper tools and libraries
 		Default: yes



CVS commit: src/tools/llvm-lib

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:15:17 UTC 2019

Removed Files:
src/tools/llvm-lib/libLLVMAMDGPUAsmParser: Makefile
src/tools/llvm-lib/libLLVMAMDGPUAsmPrinter: Makefile
src/tools/llvm-lib/libLLVMAMDGPUCodeGen: Makefile
src/tools/llvm-lib/libLLVMAMDGPUDisassembler: Makefile
src/tools/llvm-lib/libLLVMAMDGPUMCTargetDesc: Makefile
src/tools/llvm-lib/libLLVMAMDGPUTargetInfo: Makefile
src/tools/llvm-lib/libLLVMAMDGPUUtils: Makefile
src/tools/llvm-lib/libLLVMExecutionEngine: Makefile
src/tools/llvm-lib/libLLVMMCJIT: Makefile

Log Message:
Undo tools part of the AMDGPU changes for LLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUAsmParser/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUAsmPrinter/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUCodeGen/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUDisassembler/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUMCTargetDesc/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUTargetInfo/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMAMDGPUUtils/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMExecutionEngine/Makefile
cvs rdiff -u -r1.1 -r0 src/tools/llvm-lib/libLLVMMCJIT/Makefile

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



CVS commit: src

2019-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr  3 15:12:45 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386 mi
src/distrib/sets/lists/debug: mi
src/external/bsd/llvm/bin: Makefile
src/external/bsd/llvm/include: Makefile
src/external/bsd/llvm/lib: Makefile
src/share/mk: bsd.own.mk
src/tools: Makefile

Log Message:
Revert MKLLVMCMDS changes.


To generate a diff of this commit:
cvs rdiff -u -r1.270 -r1.271 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.186 -r1.187 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.2264 -r1.2265 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.280 -r1.281 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/llvm/bin/Makefile
cvs rdiff -u -r1.47 -r1.48 src/external/bsd/llvm/include/Makefile
cvs rdiff -u -r1.48 -r1.49 src/external/bsd/llvm/lib/Makefile
cvs rdiff -u -r1.1119 -r1.1120 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.199 -r1.200 src/tools/Makefile

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

Modified files:

Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.270 src/distrib/sets/lists/comp/md.amd64:1.271
--- src/distrib/sets/lists/comp/md.amd64:1.270	Wed Mar 20 22:51:37 2019
+++ src/distrib/sets/lists/comp/md.amd64	Wed Apr  3 15:12:44 2019
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.270 2019/03/20 22:51:37 mrg Exp $
+# $NetBSD: md.amd64,v 1.271 2019/04/03 15:12:44 joerg Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -332,85 +332,85 @@
 ./usr/include/clang-5.0/xsaveoptintrin.h	comp-obsolete		obsolete
 ./usr/include/clang-5.0/xsavesintrin.h		comp-obsolete		obsolete
 ./usr/include/clang-5.0/xtestintrin.h		comp-obsolete		obsolete
-./usr/include/clang-7.0/__wmmintrin_aes.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/__wmmintrin_pclmul.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/adxintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/ammintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx2intrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512bitalgintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512bwintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512cdintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512dqintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512erintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512fintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512ifmaintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512ifmavlintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512pfintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vbmi2intrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vbmiintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vbmivlintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlbitalgintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlbwintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlcdintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vldqintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlvbmi2intrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vlvnniintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vnniintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vpopcntdqintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avx512vpopcntdqvlintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/avxintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/bmi2intrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/bmiintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/cetintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/cldemoteintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/clflushoptintrin.h	comp-c-include		llvmcmds
-./usr/include/clang-7.0/clwbintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/clzerointrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/cpuid.h			comp-c-include		llvmcmds
-./usr/include/clang-7.0/emmintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/f16cintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/fma4intrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/fmaintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/fxsrintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/gfniintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/ia32intrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/immintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/invpcidintrin.h		comp-c-include		llvmcmds
-./usr/include/clang-7.0/lwpintrin.h		comp-c-include		llvmcmds
-

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

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 11:30:28 UTC 2019

Modified Files:
src/sys/arch/pmax/conf: RAMDISK RAMDISK64

Log Message:
Adjust for bigger ramdisk


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/pmax/conf/RAMDISK
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/pmax/conf/RAMDISK64

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/pmax/conf/RAMDISK
diff -u src/sys/arch/pmax/conf/RAMDISK:1.16 src/sys/arch/pmax/conf/RAMDISK:1.17
--- src/sys/arch/pmax/conf/RAMDISK:1.16	Sun Mar 31 12:11:57 2019
+++ src/sys/arch/pmax/conf/RAMDISK	Wed Apr  3 07:30:28 2019
@@ -1,4 +1,4 @@
-# 	$NetBSD: RAMDISK,v 1.16 2019/03/31 16:11:57 christos Exp $
+# 	$NetBSD: RAMDISK,v 1.17 2019/04/03 11:30:28 christos Exp $
 #
 # Install kernel with ramdisk added.
 # The ramdisk is be too big to netboot directly via ECOFF on some machines,
@@ -13,7 +13,7 @@ include	"arch/pmax/conf/INSTALL"
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=8000	# size of memory disk, in blocks (4000kB)
+options 	MEMORY_DISK_ROOT_SIZE=8200	# size of memory disk, in blocks (4100kB)
 #options 	MEMORY_DISK_ROOT_SIZE=2880	# 1.44M, same as a floppy
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 

Index: src/sys/arch/pmax/conf/RAMDISK64
diff -u src/sys/arch/pmax/conf/RAMDISK64:1.5 src/sys/arch/pmax/conf/RAMDISK64:1.6
--- src/sys/arch/pmax/conf/RAMDISK64:1.5	Sun Mar 31 12:11:57 2019
+++ src/sys/arch/pmax/conf/RAMDISK64	Wed Apr  3 07:30:28 2019
@@ -1,4 +1,4 @@
-# 	$NetBSD: RAMDISK64,v 1.5 2019/03/31 16:11:57 christos Exp $
+# 	$NetBSD: RAMDISK64,v 1.6 2019/04/03 11:30:28 christos Exp $
 #
 # Install kernel with ramdisk added.
 # The ramdisk is be too big to netboot directly via ECOFF on some machines,
@@ -13,7 +13,7 @@ include	"arch/pmax/conf/INSTALL64"
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=8000	# size of memory disk, in blocks (4000kB)
+options 	MEMORY_DISK_ROOT_SIZE=8200	# size of memory disk, in blocks (4100kB)
 
 # File systems: need MFS
 file-system 	MFS		# memory file system



CVS commit: src/distrib/pmax/ramdisk

2019-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 11:29:40 UTC 2019

Modified Files:
src/distrib/pmax/ramdisk: Makefile

Log Message:
Give us a bit of breathing room since the calculated size of mkfs is not
working.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/pmax/ramdisk/Makefile

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

Modified files:

Index: src/distrib/pmax/ramdisk/Makefile
diff -u src/distrib/pmax/ramdisk/Makefile:1.50 src/distrib/pmax/ramdisk/Makefile:1.51
--- src/distrib/pmax/ramdisk/Makefile:1.50	Fri Mar 29 12:06:28 2019
+++ src/distrib/pmax/ramdisk/Makefile	Wed Apr  3 07:29:39 2019
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.50 2019/03/29 16:06:28 christos Exp $
+#	$NetBSD: Makefile,v 1.51 2019/04/03 11:29:39 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
 IMAGETAR=	diskimage.tgz
-IMAGESIZE=	4000k
+IMAGESIZE=	4100k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1



CVS commit: src/sys/kern

2019-04-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  3 08:34:33 UTC 2019

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

Log Message:
Remove support for early SIGTRAP (fork related) signals in kpsignal2()

This function is no longer used to handle early SIGTRAP signals for
fork-related events for ptrace(2).


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.351 src/sys/kern/kern_sig.c:1.352
--- src/sys/kern/kern_sig.c:1.351	Fri Mar  8 23:32:30 2019
+++ src/sys/kern/kern_sig.c	Wed Apr  3 08:34:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.351 2019/03/08 23:32:30 kamil Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.352 2019/04/03 08:34:33 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.351 2019/03/08 23:32:30 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.352 2019/04/03 08:34:33 kamil Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_dtrace.h"
@@ -1260,7 +1260,7 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 	ksiginfo_t *kp;
 	lwpid_t lid;
 	sig_t action;
-	bool toall, debtrap = false;
+	bool toall;
 	int error = 0;
 
 	KASSERT(!cpu_intr_p());
@@ -1273,13 +1273,8 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 	 * If the process is being created by fork, is a zombie or is
 	 * exiting, then just drop the signal here and bail out.
 	 */
-	if (p->p_stat == SIDL && signo == SIGTRAP
-	&& (p->p_slflag & PSL_TRACED)) {
-		/* allow an initial SIGTRAP for traced processes */
-		debtrap = true;
-	} else if (p->p_stat != SACTIVE && p->p_stat != SSTOP) {
+	if (p->p_stat != SACTIVE && p->p_stat != SSTOP)
 		return 0;
-	}
 
 	/* XXX for core dump/debugger */
 	p->p_sigctx.ps_lwp = ksi->ksi_lid;
@@ -1380,13 +1375,7 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
 	 * the signal to it.
 	 */
 	if (lid != 0) {
-		if (__predict_false(debtrap)) {
-			l = LIST_FIRST(&p->p_lwps);
-			if (l->l_lid != lid)
-l = NULL;
-		} else {
-			l = lwp_find(p, lid);
-		}
+		l = lwp_find(p, lid);
 		if (l != NULL) {
 			if ((error = sigput(&l->l_sigpend, p, kp)) != 0)
 goto out;



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

2019-04-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr  3 08:31:57 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
- fix missing else in SUBSUBTARGET_OVERRIDE_OPTIONS
- remove obsolete defines, and move stuff to be more like freebsd64.h
- remove common / already correctly defined overrides


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.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/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.18 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.19
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.18	Tue Feb  5 12:01:11 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Wed Apr  3 08:31:57 2019
@@ -152,6 +152,7 @@ extern int dot_symbols;
 		error ("-mcmodel incompatible with other toc options"); \
 	  SET_CMODEL (CMODEL_SMALL);			\
 	}			\
+	  else			\
 	{			\
 	  if (!global_options_set.x_rs6000_current_cmodel)	\
 		SET_CMODEL (CMODEL_MEDIUM);			\
@@ -262,20 +263,6 @@ extern int dot_symbols;
 
 #endif
 
-/* Use standard DWARF numbering for DWARF debugging information.  */
-#define RS6000_USE_DWARF_NUMBERING
-
-/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
-#undef  ADJUST_FIELD_ALIGN
-#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
-  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
-   ? 128\
-   : (TARGET_64BIT  \
-  && TARGET_ALIGN_NATURAL == 0  \
-  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)   		\
-   ? MIN ((COMPUTED), 32)   \
-   : (COMPUTED))
-
 /* PowerPC64 NetBSD increases natural record alignment to doubleword if
the first field is an FP double, only if in power alignment mode.  */
 #undef  ROUND_TYPE_ALIGN
@@ -326,13 +313,15 @@ extern int dot_symbols;
   do			\
 {			\
   NETBSD_OS_CPP_BUILTINS_ELF();			\
+  builtin_define ("__PPC__");			\
+  builtin_define ("__ppc__");			\
+  builtin_define ("__powerpc__");			\
   if (TARGET_ISEL)	\
 	builtin_define ("__PPC_ISEL__");		\
   if (TARGET_64BIT)	\
 	{		\
-	  builtin_define ("__PPC__");			\
+	  builtin_define ("__arch64__");		\
 	  builtin_define ("__PPC64__");			\
-	  builtin_define ("__powerpc__");		\
 	  builtin_define ("__powerpc64__");		\
 	  builtin_define_with_int_value ("__PIC__", 2);	\
 	  builtin_assert ("cpu=powerpc64");		\
@@ -390,6 +379,20 @@ extern int dot_symbols;
   %{rdynamic:-export-dynamic} \
   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
 
+/* Use standard DWARF numbering for DWARF debugging information.  */
+#define RS6000_USE_DWARF_NUMBERING
+
+/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
+#undef  ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
+  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
+   ? 128\
+   : (TARGET_64BIT  \
+  && TARGET_ALIGN_NATURAL == 0  \
+  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)   		\
+   ? MIN ((COMPUTED), 32)   \
+   : (COMPUTED))
+
 #undef  TOC_SECTION_ASM_OP
 #define TOC_SECTION_ASM_OP \
   (TARGET_64BIT		\
@@ -404,6 +407,43 @@ extern int dot_symbols;
   ? "\t.section\t\".got2\",\"aw\""			\
   : "\t.section\t\".got1\",\"aw\""))
 
+/* This is how to declare the size of a function.  */
+#undef  ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)\
+  do\
+{   \
+  if (!flag_inhibit_size_directive) \
+{   \
+  fputs ("\t.size\t", (FILE));  \
+  if (TARGET_64BIT && DOT_SYMBOLS)  \
+putc ('.', (FILE)); \
+  assemble_name ((FILE), (FNAME));  \
+  fputs (",.-", (FILE));\
+  rs6000_output_function_entry (FILE, FNAME);   \
+  putc ('\n', (FILE));  \
+}   \
+}   

CVS commit: src/tests/lib/libc/sys

2019-04-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  3 08:19:46 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
The *fork*_signalmasked ATF tests no longer fail

Add a fixup for signalmasking in the vforkdone_singalmasked test.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.101 src/tests/lib/libc/sys/t_ptrace_wait.c:1.102
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.101	Thu Mar 28 08:13:40 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Apr  3 08:19:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.101 2019/03/28 08:13:40 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.102 2019/04/03 08:19:46 kamil Exp $");
 
 #include 
 #include 
@@ -5221,9 +5221,6 @@ fork2_body(bool trackfork, bool trackvfo
 	ki_sigset_t kp_sigmask;
 	ki_sigset_t kp_sigignore;
 
-	if (masked)
-		atf_tc_expect_fail("Masked signal invisible to tracer");
-
 	if (trackfork)
 		fn = fork;
 	if (trackvfork || trackvforkdone)
@@ -5447,6 +5444,12 @@ fork2_body(bool trackfork, bool trackvfo
 		name[3] = child;
 		ATF_REQUIRE_EQ(sysctl(name, namelen, &kp, &len, NULL, 0), 0);
 
+		/*
+		 * SIGCHLD is now pending in the signal queue and
+		 * the kernel presents it to userland as a masked signal.
+		 */
+		sigdelset((sigset_t *)&kp.p_sigmask, SIGCHLD);
+
 		if (masked) {
 			DPRINTF("kp_sigmask="
 			"%#02" PRIx32 "%02" PRIx32 "%02" PRIx32 "%02"



CVS commit: src/sys

2019-04-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  3 08:08:00 UTC 2019

Modified Files:
src/sys/arch/alpha/alpha: syscall.c
src/sys/arch/arm/arm: syscall.c
src/sys/arch/hppa/hppa: trap.c
src/sys/arch/ia64/ia64: syscall.c
src/sys/arch/m68k/m68k: m68k_syscall.c
src/sys/arch/mips/mips: trap.c
src/sys/arch/powerpc/powerpc: syscall.c
src/sys/arch/riscv/riscv: riscv_machdep.c
src/sys/arch/sh3/sh3: vm_machdep.c
src/sys/arch/sparc/sparc: syscall.c
src/sys/arch/sparc64/sparc64: syscall.c
src/sys/arch/vax/vax: syscall.c
src/sys/arch/x86/x86: syscall.c
src/sys/kern: kern_fork.c

Log Message:
Rework the fork(2)/vfork(2) event signalling under ptrace(2)

Remove the constraint of SIGTRAP event being maskable by a tracee.

Now all SIGTRAP TRAP_CHLD events are delivered to debugger.

This code touches MD specific logic and the child_return routine.
It's an intermediate step with a room for refactoring in future and
right now the least invasive approach. This allows to assert expected
behavior in already existing ATF tests and make the code prettier
in future keeping the same semantics. Probably there is a need for a MI
wrapper of child_return for shared functionality between ports.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/alpha/alpha/syscall.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/arm/arm/syscall.c
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/hppa/hppa/trap.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/ia64/syscall.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/m68k/m68k/m68k_syscall.c
cvs rdiff -u -r1.246 -r1.247 src/sys/arch/mips/mips/trap.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/powerpc/powerpc/syscall.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sh3/sh3/vm_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sparc/sparc/syscall.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc64/sparc64/syscall.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/vax/vax/syscall.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/x86/syscall.c
cvs rdiff -u -r1.205 -r1.206 src/sys/kern/kern_fork.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/alpha/alpha/syscall.c
diff -u src/sys/arch/alpha/alpha/syscall.c:1.42 src/sys/arch/alpha/alpha/syscall.c:1.43
--- src/sys/arch/alpha/alpha/syscall.c:1.42	Wed Jun 26 15:09:59 2013
+++ src/sys/arch/alpha/alpha/syscall.c	Wed Apr  3 08:07:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.42 2013/06/26 15:09:59 matt Exp $ */
+/* $NetBSD: syscall.c,v 1.43 2019/04/03 08:07:59 kamil Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.42 2013/06/26 15:09:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.43 2019/04/03 08:07:59 kamil Exp $");
 
 #include 
 #include 
@@ -221,6 +221,18 @@ void
 child_return(void *arg)
 {
 	struct lwp * const l = arg;
+	struct proc *p = l->l_proc;
+
+	if (p->p_slflag & PSL_TRACED) {
+		mutex_enter(p->p_lock);
+		p->p_xsig = SIGTRAP;
+		p->p_sigctx.ps_faked = true; // XXX
+		p->p_sigctx.ps_info._signo = p->p_xsig;
+		p->p_sigctx.ps_info._code = TRAP_CHLD;
+		sigswitch(0, SIGTRAP, true);
+		// XXX ktrpoint(KTR_PSIG)
+		mutex_exit(p->p_lock);
+	}
 
 	/*
 	 * Return values in the frame set by cpu_lwp_fork().

Index: src/sys/arch/arm/arm/syscall.c
diff -u src/sys/arch/arm/arm/syscall.c:1.65 src/sys/arch/arm/arm/syscall.c:1.66
--- src/sys/arch/arm/arm/syscall.c:1.65	Fri May 25 15:37:57 2018
+++ src/sys/arch/arm/arm/syscall.c	Wed Apr  3 08:07:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.65 2018/05/25 15:37:57 martin Exp $	*/
+/*	$NetBSD: syscall.c,v 1.66 2019/04/03 08:07:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.65 2018/05/25 15:37:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.66 2019/04/03 08:07:59 kamil Exp $");
 
 #include 
 #include 
@@ -287,6 +287,19 @@ void
 child_return(void *arg)
 {
 	lwp_t * const l = arg;
+	struct proc *p = l->l_proc;
+
+	if (p->p_slflag & PSL_TRACED) {
+		mutex_enter(p->p_lock);
+		p->p_xsig = SIGTRAP;
+		p->p_sigctx.ps_faked = true; // XXX
+		p->p_sigctx.ps_info._signo = p->p_xsig;
+		p->p_sigctx.ps_info._code = TRAP_CHLD;
+		sigswitch(0, SIGTRAP, true);
+		// XXX ktrpoint(KTR_PSIG)
+		mutex_exit(p->p_lock);
+	}
+
 	struct trapframe * const tf = lwp_trapframe(l);
 
 	tf->tf_r0 = 0;
@@ -305,4 +318,3 @@ cpu_spawn_return(struct lwp *l)
 
 	userret(l);
 }
-

Index: src/sys/arch/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.107 src/sys/arch/hppa/hppa/trap.c:1.108
--- src/sys/arch/hppa/hppa/trap.c:1.107	Mon Mar  2 11:05:12 2015
+++ src/sys/arch/hppa/hppa/trap.c	Wed Apr  3 08:07:59