CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 12 03:27:29 UTC 2020

Modified Files:
src/usr.bin/make: make_malloc.c

Log Message:
make(1): in bmake_strndup, only scan the relevant part of the string

Just in case the given str is not really a string.

The POSIX 2018 documentation on strndup does not specify as clearly as
possible whether s has to be a string or whether raw memory is
acceptable as well.  It only indirectly calls the s parameter of strndup
a string.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/make_malloc.c

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



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 12 03:27:29 UTC 2020

Modified Files:
src/usr.bin/make: make_malloc.c

Log Message:
make(1): in bmake_strndup, only scan the relevant part of the string

Just in case the given str is not really a string.

The POSIX 2018 documentation on strndup does not specify as clearly as
possible whether s has to be a string or whether raw memory is
acceptable as well.  It only indirectly calls the s parameter of strndup
a string.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/make_malloc.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/make/make_malloc.c
diff -u src/usr.bin/make/make_malloc.c:1.12 src/usr.bin/make/make_malloc.c:1.13
--- src/usr.bin/make/make_malloc.c:1.12	Fri Jul  3 08:02:55 2020
+++ src/usr.bin/make/make_malloc.c	Wed Aug 12 03:27:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make_malloc.c,v 1.12 2020/07/03 08:02:55 rillig Exp $	*/
+/*	$NetBSD: make_malloc.c,v 1.13 2020/08/12 03:27:29 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include 
-__RCSID("$NetBSD: make_malloc.c,v 1.12 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.13 2020/08/12 03:27:29 rillig Exp $");
 #endif
 
 #include 
@@ -95,9 +95,9 @@ bmake_strndup(const char *str, size_t ma
 	if (str == NULL)
 		return NULL;
 
-	len = strlen(str);
-	if (len > max_len)
-		len = max_len;
+	for (len = 0; len < max_len; len++)
+	if (str[len] == '\0')
+		break;
 	p = bmake_malloc(len + 1);
 	memcpy(p, str, len);
 	p[len] = '\0';



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 12 03:05:57 UTC 2020

Modified Files:
src/usr.bin/make: dir.c

Log Message:
make(1): make Dir_MakeFlags simpler

This avoids unnecessary string allocations, especially for long lists.

There is no unit test to cover this code.  Since this is an obscure,
undocumented part of make, I wasn't able to come up with a unit test.
Therefore I resorted to write a separate testing program to verify the
expected results.

$ cat <<'EOF' >dir_test.c
#include 

#include "make.h"
#include "dir.h"

int main(int argc, char **argv)
{
int i;
Lst lst;
char *flags;

lst = Lst_Init(FALSE);
for (i = 1; i < argc; i++)
Dir_AddDir(lst, argv[i]);
flags = Dir_MakeFlags("-I", lst);

printf("%s\n", flags);
free(flags);
return 0;
}
EOF

# Needs some trivial patches to Makefile and main.c
$ make PROG=dir_test EXTRA_SRCS=dir_test.c EXTRA_CPPFLAGS=-DNO_MAIN \
   COPTS.main.c=-Wno-unused-function NOMAN=1

$ ./dir_test a b c

$ mkdir a b c
$ ./dir_test a b c
 -Ia -Ib -Ic
$ rmdir a b c


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/dir.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/make/dir.c
diff -u src/usr.bin/make/dir.c:1.87 src/usr.bin/make/dir.c:1.88
--- src/usr.bin/make/dir.c:1.87	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/dir.c	Wed Aug 12 03:05:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.87 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.88 2020/08/12 03:05:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.87 2020/08/10 19:53:19 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.88 2020/08/12 03:05:57 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.87 2020/08/10 19:53:19 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.88 2020/08/12 03:05:57 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1723,26 +1723,22 @@ Dir_CopyDir(void *p)
 char *
 Dir_MakeFlags(const char *flag, Lst path)
 {
-char *str;			/* the string which will be returned */
-char *s1, *s2;		/* the current directory preceded by 'flag' */
+Buffer buf;
 LstNode ln;			/* the node of the current directory */
-Path *p;			/* the structure describing the current
- * directory */
 
-str = bmake_strdup("");
+Buf_Init(, 0);
 
 if (Lst_Open(path) == SUCCESS) {
 	while ((ln = Lst_Next(path)) != NULL) {
-	p = (Path *)Lst_Datum(ln);
-	s2 = str_concat2(flag, p->name);
-	str = str_concat3(s1 = str, " ", s2);
-	free(s1);
-	free(s2);
+	Path *p = (Path *)Lst_Datum(ln);
+	Buf_AddStr(, " ");
+	Buf_AddStr(, flag);
+	Buf_AddStr(, p->name);
 	}
 	Lst_Close(path);
 }
 
-return str;
+return Buf_Destroy(, FALSE);
 }
 
 /*-



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 12 03:05:57 UTC 2020

Modified Files:
src/usr.bin/make: dir.c

Log Message:
make(1): make Dir_MakeFlags simpler

This avoids unnecessary string allocations, especially for long lists.

There is no unit test to cover this code.  Since this is an obscure,
undocumented part of make, I wasn't able to come up with a unit test.
Therefore I resorted to write a separate testing program to verify the
expected results.

$ cat <<'EOF' >dir_test.c
#include 

#include "make.h"
#include "dir.h"

int main(int argc, char **argv)
{
int i;
Lst lst;
char *flags;

lst = Lst_Init(FALSE);
for (i = 1; i < argc; i++)
Dir_AddDir(lst, argv[i]);
flags = Dir_MakeFlags("-I", lst);

printf("%s\n", flags);
free(flags);
return 0;
}
EOF

# Needs some trivial patches to Makefile and main.c
$ make PROG=dir_test EXTRA_SRCS=dir_test.c EXTRA_CPPFLAGS=-DNO_MAIN \
   COPTS.main.c=-Wno-unused-function NOMAN=1

$ ./dir_test a b c

$ mkdir a b c
$ ./dir_test a b c
 -Ia -Ib -Ic
$ rmdir a b c


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/dir.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/aarch64/aarch64

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 19:46:56 UTC 2020

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

Log Message:
Improve a comment


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

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/db_interface.c
diff -u src/sys/arch/aarch64/aarch64/db_interface.c:1.8 src/sys/arch/aarch64/aarch64/db_interface.c:1.9
--- src/sys/arch/aarch64/aarch64/db_interface.c:1.8	Sun Aug  2 06:58:16 2020
+++ src/sys/arch/aarch64/aarch64/db_interface.c	Tue Aug 11 19:46:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.8 2020/08/02 06:58:16 maxv Exp $ */
+/* $NetBSD: db_interface.c,v 1.9 2020/08/11 19:46:56 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.8 2020/08/02 06:58:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.9 2020/08/11 19:46:56 skrll Exp $");
 
 #include 
 #include 
@@ -121,10 +121,11 @@ db_write_text(vaddr_t addr, size_t size,
 		pte = *ptep;
 
 		/*
-		 * change to writable. require to keep execute permission.
-		 * because if the block/page to which the target address belongs and
-		 * the block/page to which this function itself belongs are the same,
-		 * if drop PROT_EXECUTE and TLB invalidate, the program stop...
+		 * change to writable.  it is required to keep execute permission.
+		 * because if the block/page to which the target address belongs is
+		 * the same as the block/page to which this function belongs, then
+		 * if PROT_EXECUTE is dropped and TLB is invalidated, the program
+		 * will stop...
 		 */
 		pmap_kvattr(addr, VM_PROT_EXECUTE|VM_PROT_READ|VM_PROT_WRITE);
 		aarch64_tlbi_all();



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

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 19:46:56 UTC 2020

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

Log Message:
Improve a comment


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

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



CVS commit: [netbsd-9] src/sys

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 19:13:43 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom [netbsd-9]: bcm2835_spi.c
src/sys/dev/spi [netbsd-9]: spi.c spivar.h

Log Message:
Pull up following revision(s) (requested by 1043):

sys/dev/spi/spivar.h: revision 1.10
sys/arch/arm/broadcom/bcm2835_spi.c: revision 1.7
sys/dev/spi/spi.c: revision 1.15

Use mutex for lwp/interrupt coordination. using splX() simply does not work
on multiprocessor systems.

fixes PR kern/55506


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/sys/arch/arm/broadcom/bcm2835_spi.c
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.7 -r1.7.4.1 src/sys/dev/spi/spivar.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/broadcom/bcm2835_spi.c
diff -u src/sys/arch/arm/broadcom/bcm2835_spi.c:1.5 src/sys/arch/arm/broadcom/bcm2835_spi.c:1.5.8.1
--- src/sys/arch/arm/broadcom/bcm2835_spi.c:1.5	Sun Dec 10 21:38:26 2017
+++ src/sys/arch/arm/broadcom/bcm2835_spi.c	Tue Aug 11 19:13:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_spi.c,v 1.5 2017/12/10 21:38:26 skrll Exp $	*/
+/*	$NetBSD: bcm2835_spi.c,v 1.5.8.1 2020/08/11 19:13:43 martin Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.5 2017/12/10 21:38:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.5.8.1 2020/08/11 19:13:43 martin Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ struct bcmspi_softc {
 	bus_space_handle_t	sc_ioh;
 	void			*sc_intrh;
 	struct spi_controller	sc_spi;
+	kmutex_tsc_mutex;
 	SIMPLEQ_HEAD(,spi_transfer) sc_q;
 	struct spi_transfer	*sc_transfer;
 	struct spi_chunk	*sc_wchunk;
@@ -131,6 +132,7 @@ bcmspi_attach(device_t parent, device_t 
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
 	sc->sc_spi.sct_cookie = sc;
+	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_VM);
 	sc->sc_spi.sct_configure = bcmspi_configure;
 	sc->sc_spi.sct_transfer = bcmspi_transfer;
 	sc->sc_spi.sct_nslaves = 3;
@@ -188,14 +190,13 @@ static int
 bcmspi_transfer(void *cookie, struct spi_transfer *st)
 {
 	struct bcmspi_softc * const sc = cookie;
-	int s;
 
-	s = splbio();
+	mutex_enter(>sc_mutex);
 	spi_transq_enqueue(>sc_q, st);
 	if (sc->sc_running == false) {
 		bcmspi_start(sc);
 	}
-	splx(s);
+	mutex_exit(>sc_mutex);
 	return 0;
 }
 
@@ -225,13 +226,13 @@ bcmspi_start(struct bcmspi_softc * const
 		if (!cold)
 			return;
 
-		int s = splbio();
 		for (;;) {
+		mutex_exit(>sc_mutex);
 			bcmspi_intr(sc);
+			mutex_enter(>sc_mutex);
 			if (ISSET(st->st_flags, SPI_F_DONE))
 break;
 		}
-		splx(s);
 	}
 
 	sc->sc_running = false;
@@ -290,6 +291,7 @@ bcmspi_intr(void *cookie)
 	struct spi_transfer *st;
 	uint32_t cs;
 
+	mutex_enter(>sc_mutex);
 	cs = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SPI_CS);
 	if (ISSET(cs, SPI_CS_DONE)) {
 		if (sc->sc_wchunk != NULL) {
@@ -313,5 +315,6 @@ bcmspi_intr(void *cookie)
 	}
 
 end:
+	mutex_exit(>sc_mutex);
 	return ISSET(cs, SPI_CS_DONE|SPI_CS_RXR);
 }

Index: src/sys/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.11 src/sys/dev/spi/spi.c:1.11.4.1
--- src/sys/dev/spi/spi.c:1.11	Sat Mar  9 07:53:12 2019
+++ src/sys/dev/spi/spi.c	Tue Aug 11 19:13:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.11 2019/03/09 07:53:12 mlelstv Exp $ */
+/* $NetBSD: spi.c,v 1.11.4.1 2020/08/11 19:13:43 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.11 2019/03/09 07:53:12 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.11.4.1 2020/08/11 19:13:43 martin Exp $");
 
 #include "locators.h"
 
@@ -175,7 +175,7 @@ spi_attach(device_t parent, device_t sel
 	aprint_naive(": SPI bus\n");
 	aprint_normal(": SPI bus\n");
 
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_BIO);
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(>sc_cv, "spictl");
 
 	sc->sc_controller = *sba->sba_controller;
@@ -349,7 +349,7 @@ void
 spi_transfer_init(struct spi_transfer *st)
 {
 
-	mutex_init(>st_lock, MUTEX_DEFAULT, IPL_BIO);
+	mutex_init(>st_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(>st_cv, "spixfr");
 
 	st->st_flags = 0;

Index: src/sys/dev/spi/spivar.h
diff -u src/sys/dev/spi/spivar.h:1.7 src/sys/dev/spi/spivar.h:1.7.4.1
--- src/sys/dev/spi/spivar.h:1.7	Sat Feb 23 10:43:25 2019
+++ src/sys/dev/spi/spivar.h	Tue Aug 11 19:13:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: spivar.h,v 1.7 2019/02/23 10:43:25 mlelstv Exp $ */
+/* $NetBSD: spivar.h,v 1.7.4.1 2020/08/11 19:13:43 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -103,7 +103,7 @@ struct spi_chunk {
 struct spi_transfer {
 	struct spi_chunk *st_chunks;		/* chained bufs */
 	SIMPLEQ_ENTRY(spi_transfer) st_chain;	/* chain of submitted jobs */
-	

CVS commit: [netbsd-9] src/sys

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 19:13:43 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom [netbsd-9]: bcm2835_spi.c
src/sys/dev/spi [netbsd-9]: spi.c spivar.h

Log Message:
Pull up following revision(s) (requested by 1043):

sys/dev/spi/spivar.h: revision 1.10
sys/arch/arm/broadcom/bcm2835_spi.c: revision 1.7
sys/dev/spi/spi.c: revision 1.15

Use mutex for lwp/interrupt coordination. using splX() simply does not work
on multiprocessor systems.

fixes PR kern/55506


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/sys/arch/arm/broadcom/bcm2835_spi.c
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.7 -r1.7.4.1 src/sys/dev/spi/spivar.h

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



CVS commit: [netbsd-9] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 19:12:34 UTC 2020

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

Log Message:
Ticket #1045


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

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.92 src/doc/CHANGES-9.1:1.1.2.93
--- src/doc/CHANGES-9.1:1.1.2.92	Tue Aug 11 17:07:09 2020
+++ src/doc/CHANGES-9.1	Tue Aug 11 19:12:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.92 2020/08/11 17:07:09 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.93 2020/08/11 19:12:33 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -4042,3 +4042,13 @@ sys/dev/pci/mpii.c1.25
 	mpii(4): make it compilable without bio(4).
 	[jnemeth, ticket #1044]
 
+sys/dev/ic/dwc_gmac.c1.66-1.70
+sys/dev/ic/dwc_gmac_reg.h			1.20
+sys/kern/uipc_mbuf.c1.235
+
+	awge(4): fix issue that caused rx packets to be corrupt with
+	DIAGNOSTIC kernel, avoid cache line alignement issues.
+	Some optimizations and bug fixes.
+	Mask all the MMC counter interrupts if the MMC module is present.
+	[mrg, ticket #1045]
+



CVS commit: [netbsd-9] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 19:12:34 UTC 2020

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

Log Message:
Ticket #1045


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

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



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:52:03 UTC 2020

Modified Files:
src/usr.bin/make: main.c

Log Message:
make(1): replace snprintf/malloc in ReadMakefile with str_concat3


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/usr.bin/make/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.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.303 src/usr.bin/make/main.c:1.304
--- src/usr.bin/make/main.c:1.303	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/main.c	Tue Aug 11 18:52:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.303 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.303 2020/08/10 19:53:19 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $";
 #else
 #include 
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.303 2020/08/10 19:53:19 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.304 2020/08/11 18:52:03 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1517,8 +1517,7 @@ ReadMakefile(const void *p, const void *
 {
 	const char *fname = p;		/* makefile to read */
 	int fd;
-	size_t len = MAXPATHLEN;
-	char *name, *path = bmake_malloc(len);
+	char *name, *path = NULL;
 
 	if (!strcmp(fname, "-")) {
 		Parse_File(NULL /*stdin*/, -1);
@@ -1526,22 +1525,16 @@ ReadMakefile(const void *p, const void *
 	} else {
 		/* if we've chdir'd, rebuild the path name */
 		if (strcmp(curdir, objdir) && *fname != '/') {
-			size_t plen = strlen(curdir) + strlen(fname) + 2;
-			if (len < plen)
-path = bmake_realloc(path, len = 2 * plen);
-
-			(void)snprintf(path, len, "%s/%s", curdir, fname);
+			path = str_concat3(curdir, "/", fname);
 			fd = open(path, O_RDONLY);
 			if (fd != -1) {
 fname = path;
 goto found;
 			}
+			free(path);
 
 			/* If curdir failed, try objdir (ala .depend) */
-			plen = strlen(objdir) + strlen(fname) + 2;
-			if (len < plen)
-path = bmake_realloc(path, len = 2 * plen);
-			(void)snprintf(path, len, "%s/%s", objdir, fname);
+			path = str_concat3(objdir, "/", fname);
 			fd = open(path, O_RDONLY);
 			if (fd != -1) {
 fname = path;



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:52:03 UTC 2020

Modified Files:
src/usr.bin/make: main.c

Log Message:
make(1): replace snprintf/malloc in ReadMakefile with str_concat3


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/usr.bin/make/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.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:44:52 UTC 2020

Modified Files:
src/usr.bin/make: make.h suff.c

Log Message:
make(1): convert Suff.flags from #define to enum

This increases debugging support since the debugger can now display
symbolic names instead of an integer bit mask.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/usr.bin/make/make.h
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/suff.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/make/make.h
diff -u src/usr.bin/make/make.h:1.114 src/usr.bin/make/make.h:1.115
--- src/usr.bin/make/make.h:1.114	Mon Aug 10 19:30:30 2020
+++ src/usr.bin/make/make.h	Tue Aug 11 18:44:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.114 2020/08/10 19:30:30 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.115 2020/08/11 18:44:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -224,7 +224,7 @@ typedef struct GNode {
 Hash_Table  context;	/* The local variables */
 Lst commands;  	/* Creation commands */
 
-struct _Suff*suffix;	/* Suffix for the node (determined by
+struct Suff *suffix;	/* Suffix for the node (determined by
  * Suff_FindDeps and opaque to everyone
  * but the Suff module) */
 const char	*fname;	/* filename where the GNode got defined */

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.95 src/usr.bin/make/suff.c:1.96
--- src/usr.bin/make/suff.c:1.95	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/suff.c	Tue Aug 11 18:44:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c	8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -150,16 +150,19 @@ static Lst   transforms;	/* Lst of t
 
 static intsNum = 0;	/* Counter for assigning suffix numbers */
 
+typedef enum {
+SUFF_INCLUDE	= 0x01,	/* One which is #include'd */
+SUFF_LIBRARY	= 0x02,	/* One which contains a library */
+SUFF_NULL		= 0x04	/* The empty suffix */
+} SuffFlags;
+
 /*
  * Structure describing an individual suffix.
  */
-typedef struct _Suff {
+typedef struct Suff {
 char *name;		/* The suffix itself */
 int		 nameLen;	/* Length of the suffix */
-short	 flags;  	/* Type of suffix */
-#define SUFF_INCLUDE	  0x01	/* One which is #include'd */
-#define SUFF_LIBRARY	  0x02	/* One which contains a library */
-#define SUFF_NULL 	  0x04	/* The empty suffix */
+SuffFlags	 flags;  	/* Type of suffix */
 Lst	 searchPath;	/* The path along which files of this suffix
  * may be found */
 int  sNum;	  	/* The suffix number */



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:44:52 UTC 2020

Modified Files:
src/usr.bin/make: make.h suff.c

Log Message:
make(1): convert Suff.flags from #define to enum

This increases debugging support since the debugger can now display
symbolic names instead of an integer bit mask.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/usr.bin/make/make.h
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/suff.c

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



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:41:46 UTC 2020

Modified Files:
src/usr.bin/make: arch.c nonints.h str.c

Log Message:
make(1): add str_concat4 to make the other code simpler

There's no need for arch.c to call strlen when there is a high-level API
for the same purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/make/arch.c
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/make/str.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.81 src/usr.bin/make/arch.c:1.82
--- src/usr.bin/make/arch.c:1.81	Mon Aug  3 20:26:09 2020
+++ src/usr.bin/make/arch.c	Tue Aug 11 18:41:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.81 2020/08/03 20:26:09 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.82 2020/08/11 18:41:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.81 2020/08/03 20:26:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.82 2020/08/11 18:41:46 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.81 2020/08/03 20:26:09 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.82 2020/08/11 18:41:46 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -354,7 +354,6 @@ Arch_ParseArchive(char **linePtr, Lst no
 	char*buf;
 	char*sacrifice;
 	char*oldMemName = memName;
-	size_t   sz;
 
 	memName = Var_Subst(memName, ctxt, VARE_UNDEFERR | VARE_WANTRES);
 
@@ -363,10 +362,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 	 * variables and multi-word variable values The results
 	 * are just placed at the end of the nodeLst we're returning.
 	 */
-	sz = strlen(memName)+strlen(libName)+3;
-	buf = sacrifice = bmake_malloc(sz);
-
-	snprintf(buf, sz, "%s(%s)", libName, memName);
+	buf = sacrifice = str_concat4(libName, "(", memName, ")");
 
 	if (strchr(memName, '$') && strcmp(memName, oldMemName) == 0) {
 		/*

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.93 src/usr.bin/make/nonints.h:1.94
--- src/usr.bin/make/nonints.h:1.93	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/nonints.h	Tue Aug 11 18:41:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.93 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.94 2020/08/11 18:41:46 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -136,6 +136,7 @@ Lst Parse_MainName(void);
 /* str.c */
 char *str_concat2(const char *, const char *);
 char *str_concat3(const char *, const char *, const char *);
+char *str_concat4(const char *, const char *, const char *, const char *);
 char **brk_string(const char *, int *, Boolean, char **);
 char *Str_FindSubstring(const char *, const char *);
 Boolean Str_Match(const char *, const char *);

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.59 src/usr.bin/make/str.c:1.60
--- src/usr.bin/make/str.c:1.59	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/str.c	Tue Aug 11 18:41:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.59 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.60 2020/08/11 18:41:46 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.59 2020/08/10 19:53:19 rillig Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.60 2020/08/11 18:41:46 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)str.c	5.8 (Berkeley) 6/1/90";
 #else
-__RCSID("$NetBSD: str.c,v 1.59 2020/08/10 19:53:19 rillig Exp $");
+__RCSID("$NetBSD: str.c,v 1.60 2020/08/11 18:41:46 rillig Exp $");
 #endif
 #endif/* not lint */
 #endif
@@ -109,6 +109,22 @@ str_concat3(const char *s1, const char *
 	return result;
 }
 
+/* Return the concatenation of s1, s2, s3 and s4, freshly allocated. */
+char *
+str_concat4(const char *s1, const char *s2, const char *s3, const char *s4)
+{
+	size_t len1 = strlen(s1);
+	size_t len2 = strlen(s2);
+	size_t len3 = strlen(s3);
+	size_t len4 = strlen(s4);
+	char *result = bmake_malloc(len1 + len2 + len3 + len4 + 1);
+	memcpy(result, s1, len1);
+	memcpy(result + len1, s2, len2);
+	memcpy(result + len1 + len2, s3, len3);
+	memcpy(result + len1 + len2 + len3, s4, len4 + 1);
+	return result;
+}
+
 /*-
  * brk_string --
  *	Fracture a string into an array of words (as delineated by tabs or



CVS commit: src/usr.bin/make

2020-08-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Aug 11 18:41:46 UTC 2020

Modified Files:
src/usr.bin/make: arch.c nonints.h str.c

Log Message:
make(1): add str_concat4 to make the other code simpler

There's no need for arch.c to call strlen when there is a high-level API
for the same purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/make/arch.c
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/make/str.c

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



CVS commit: [netbsd-9] src/sys

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:14:21 UTC 2020

Modified Files:
src/sys/dev/ic [netbsd-9]: dwc_gmac.c dwc_gmac_reg.h
src/sys/kern [netbsd-9]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1045):

sys/kern/uipc_mbuf.c: revision 1.235
sys/dev/ic/dwc_gmac.c: revision 1.70
sys/dev/ic/dwc_gmac_reg.h: revision 1.20
sys/dev/ic/dwc_gmac.c: revision 1.66
sys/dev/ic/dwc_gmac.c: revision 1.67
sys/dev/ic/dwc_gmac.c: revision 1.68

awge: fix issue that caused rx packets to be corrupt with DIAGNOSTIC kernel

It seems the hardware can only reliably do rx DMA to addresses that are
dcache size aligned. This is hinted at by some GMAC data sheets but hard to
find an authoritative source.

on non-DIAGNOSTIC kernels we always implicitly get MCLBYTES-aligned mbuf
data pointers, but with the reintroduction of POOL_REDZONE for DIAGNOSTIC
we can get 8-byte alignment due to redzone padding. So align rx pointers to
64 bytes which should be good for both arm32 and aarch64.
While here change some bus_dmamap_load() to bus_dmamap_load_mbuf() and add
one missing bus_dmamap_sync(). Also fixes the code to not assume that
MCLBYTES == AWGE_MAX_PACKET. User may override MCLSHIFT in kernel config.
correct pointer arithmetics

mcl_cache: align items to COHERENCY_UNIT

Because we do cache incoherent DMA to/from mbufs we cannot safely share
share cache lines with adjacent items that may be concurrently accessed.

awge: drop redundant m_adj(). Handled via uipc_mbuf.c r1.235 instead.

Mask all the MMC counter interrupts if the MMC module is present.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.64.2.1 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/dev/ic/dwc_gmac_reg.h
cvs rdiff -u -r1.232 -r1.232.4.1 src/sys/kern/uipc_mbuf.c

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



CVS commit: [netbsd-9] src/sys

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:14:21 UTC 2020

Modified Files:
src/sys/dev/ic [netbsd-9]: dwc_gmac.c dwc_gmac_reg.h
src/sys/kern [netbsd-9]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1045):

sys/kern/uipc_mbuf.c: revision 1.235
sys/dev/ic/dwc_gmac.c: revision 1.70
sys/dev/ic/dwc_gmac_reg.h: revision 1.20
sys/dev/ic/dwc_gmac.c: revision 1.66
sys/dev/ic/dwc_gmac.c: revision 1.67
sys/dev/ic/dwc_gmac.c: revision 1.68

awge: fix issue that caused rx packets to be corrupt with DIAGNOSTIC kernel

It seems the hardware can only reliably do rx DMA to addresses that are
dcache size aligned. This is hinted at by some GMAC data sheets but hard to
find an authoritative source.

on non-DIAGNOSTIC kernels we always implicitly get MCLBYTES-aligned mbuf
data pointers, but with the reintroduction of POOL_REDZONE for DIAGNOSTIC
we can get 8-byte alignment due to redzone padding. So align rx pointers to
64 bytes which should be good for both arm32 and aarch64.
While here change some bus_dmamap_load() to bus_dmamap_load_mbuf() and add
one missing bus_dmamap_sync(). Also fixes the code to not assume that
MCLBYTES == AWGE_MAX_PACKET. User may override MCLSHIFT in kernel config.
correct pointer arithmetics

mcl_cache: align items to COHERENCY_UNIT

Because we do cache incoherent DMA to/from mbufs we cannot safely share
share cache lines with adjacent items that may be concurrently accessed.

awge: drop redundant m_adj(). Handled via uipc_mbuf.c r1.235 instead.

Mask all the MMC counter interrupts if the MMC module is present.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.64.2.1 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/dev/ic/dwc_gmac_reg.h
cvs rdiff -u -r1.232 -r1.232.4.1 src/sys/kern/uipc_mbuf.c

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

Modified files:

Index: src/sys/dev/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.64 src/sys/dev/ic/dwc_gmac.c:1.64.2.1
--- src/sys/dev/ic/dwc_gmac.c:1.64	Sun Jul 21 08:24:32 2019
+++ src/sys/dev/ic/dwc_gmac.c	Tue Aug 11 17:14:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.64 2019/07/21 08:24:32 mrg Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.64.2.1 2020/08/11 17:14:21 martin Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.64 2019/07/21 08:24:32 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.64.2.1 2020/08/11 17:14:21 martin Exp $");
 
 /* #define	DWC_GMAC_DEBUG	1 */
 
@@ -254,6 +254,16 @@ dwc_gmac_attach(struct dwc_gmac_softc *s
 	} else {
 		sc->sc_descm = _methods_standard;
 	}
+	if (hwft & GMAC_DMA_FEAT_RMON) {
+		uint32_t val;
+
+		/* Mask all MMC interrupts */
+		val = 0x;
+		bus_space_write_4(sc->sc_bst, sc->sc_bsh,
+		GMAC_MMC_RX_INT_MSK, val);
+		bus_space_write_4(sc->sc_bst, sc->sc_bsh,
+		GMAC_MMC_TX_INT_MSK, val);
+	}
 
 	/*
 	 * Allocate Tx and Rx rings
@@ -499,15 +509,22 @@ dwc_gmac_alloc_rx_ring(struct dwc_gmac_s
 			error = ENOMEM;
 			goto fail;
 		}
+		data->rd_m->m_len = data->rd_m->m_pkthdr.len
+		= data->rd_m->m_ext.ext_size;
+		if (data->rd_m->m_len > AWGE_MAX_PACKET) {
+			data->rd_m->m_len = data->rd_m->m_pkthdr.len
+			= AWGE_MAX_PACKET;
+		}
 
-		error = bus_dmamap_load(sc->sc_dmat, data->rd_map,
-		mtod(data->rd_m, void *), MCLBYTES, NULL,
-		BUS_DMA_READ | BUS_DMA_NOWAIT);
+		error = bus_dmamap_load_mbuf(sc->sc_dmat, data->rd_map,
+		data->rd_m, BUS_DMA_READ | BUS_DMA_NOWAIT);
 		if (error != 0) {
 			aprint_error_dev(sc->sc_dev,
 			"could not load rx buf DMA map #%d", i);
 			goto fail;
 		}
+		bus_dmamap_sync(sc->sc_dmat, data->rd_map, 0,
+		data->rd_map->dm_mapsize, BUS_DMASYNC_PREREAD);
 		physaddr = data->rd_map->dm_segs[0].ds_addr;
 
 		desc = >sc_rxq.r_desc[i];
@@ -516,7 +533,7 @@ dwc_gmac_alloc_rx_ring(struct dwc_gmac_s
 		desc->ddesc_next = htole32(ring->r_physaddr
 		+ next * sizeof(*desc));
 		sc->sc_descm->rx_init_flags(desc);
-		sc->sc_descm->rx_set_len(desc, AWGE_MAX_PACKET);
+		sc->sc_descm->rx_set_len(desc, data->rd_m->m_len);
 		sc->sc_descm->rx_set_owned_by_dev(desc);
 	}
 
@@ -538,13 +555,15 @@ dwc_gmac_reset_rx_ring(struct dwc_gmac_s
 	struct dwc_gmac_rx_ring *ring)
 {
 	struct dwc_gmac_dev_dmadesc *desc;
+	struct dwc_gmac_rx_data *data;
 	int i;
 
 	mutex_enter(>r_mtx);
 	for (i = 0; i < AWGE_RX_RING_COUNT; i++) {
 		desc = >sc_rxq.r_desc[i];
+		data = >sc_rxq.r_data[i];
 		sc->sc_descm->rx_init_flags(desc);
-		sc->sc_descm->rx_set_len(desc, AWGE_MAX_PACKET);
+		sc->sc_descm->rx_set_len(desc, data->rd_m->m_len);
 		sc->sc_descm->rx_set_owned_by_dev(desc);
 	}
 
@@ -1264,6 +1283,10 @@ dwc_gmac_rx_intr(struct dwc_gmac_softc *
 			ifp->if_ierrors++;
 			goto skip;
 		}
+		mnew->m_len = mnew->m_pkthdr.len = mnew->m_ext.ext_size;
+		if 

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

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:07:55 UTC 2020

Modified Files:
src/sys/dev [netbsd-8]: dev_verbose.h

Log Message:
Additionally pull up following revision(s) (requested by uwe in ticket #1584):

sys/dev/dev_verbose.h: revision 1.4

DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535


To generate a diff of this commit:
cvs rdiff -u -r1.2.10.1 -r1.2.10.2 src/sys/dev/dev_verbose.h

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

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:08:36 UTC 2020

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

Log Message:
Ammend ticket #1584 for additional pullups


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

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.28 src/doc/CHANGES-8.3:1.1.2.29
--- src/doc/CHANGES-8.3:1.1.2.28	Tue Aug 11 07:21:28 2020
+++ src/doc/CHANGES-8.3	Tue Aug 11 17:08:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.28 2020/08/11 07:21:28 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.29 2020/08/11 17:08:36 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -821,7 +821,7 @@ usr.bin/w/w.c	1.88-1.90
 	Handle hostname from DISPLAY="[2001:db8::dead:beef]:0" or similar.
 	[kim, ticket #1583]
 
-sys/dev/dev_verbose.h1.3
+sys/dev/dev_verbose.h1.3,1.4
 
 	PR 55535: make built-in verbose modules available before the
 	start of the autoconfiguration.
@@ -998,3 +998,4 @@ sys/dev/pci/mpii.c1.25
 	[jnemeth, ticket #1596]
 
 
+



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

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:07:55 UTC 2020

Modified Files:
src/sys/dev [netbsd-8]: dev_verbose.h

Log Message:
Additionally pull up following revision(s) (requested by uwe in ticket #1584):

sys/dev/dev_verbose.h: revision 1.4

DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535


To generate a diff of this commit:
cvs rdiff -u -r1.2.10.1 -r1.2.10.2 src/sys/dev/dev_verbose.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/dev_verbose.h
diff -u src/sys/dev/dev_verbose.h:1.2.10.1 src/sys/dev/dev_verbose.h:1.2.10.2
--- src/sys/dev/dev_verbose.h:1.2.10.1	Wed Aug  5 14:48:35 2020
+++ src/sys/dev/dev_verbose.h	Tue Aug 11 17:07:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_verbose.h,v 1.2.10.1 2020/08/05 14:48:35 martin Exp $ */
+/*	$NetBSD: dev_verbose.h,v 1.2.10.2 2020/08/11 17:07:55 martin Exp $ */
 
 /*
  * Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ tag ## _load_verbose(void)		\
 {	\
 	\
 	if (tag ## verbose_loaded == 0)	\
-		module_autoload(# tag "verbose", MODULE_CLASS_MISC);	\
+		module_autoload(# tag "verbose", MODULE_CLASS_DRIVER);	\
 }	\
 	\
 static const char *			\



CVS commit: [netbsd-8] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:08:36 UTC 2020

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

Log Message:
Ammend ticket #1584 for additional pullups


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

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



CVS commit: [netbsd-9] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:07:09 UTC 2020

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

Log Message:
Ammend ticket #1037 for additional pullups


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

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



CVS commit: [netbsd-9] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:07:09 UTC 2020

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

Log Message:
Ammend ticket #1037 for additional pullups


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

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.91 src/doc/CHANGES-9.1:1.1.2.92
--- src/doc/CHANGES-9.1:1.1.2.91	Sun Aug  9 14:17:17 2020
+++ src/doc/CHANGES-9.1	Tue Aug 11 17:07:09 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.91 2020/08/09 14:17:17 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.92 2020/08/11 17:07:09 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -3981,7 +3981,7 @@ distrib/notes/evbarm/xfer			1.5
 	Remove Arm OABI -> EABI change notice.
 	[nia, ticket #1036]
 
-sys/dev/dev_verbose.h1.3
+sys/dev/dev_verbose.h1.3,1.4
 
 	PR 55535: make built-in verbose modules available before the
 	start of the autoconfiguration.



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

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:06:18 UTC 2020

Modified Files:
src/sys/dev [netbsd-9]: dev_verbose.h

Log Message:
Additionally pull up following revision(s) (requested by uwe in ticket #1037):

sys/dev/dev_verbose.h: revision 1.4

DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535


To generate a diff of this commit:
cvs rdiff -u -r1.2.26.1 -r1.2.26.2 src/sys/dev/dev_verbose.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/dev_verbose.h
diff -u src/sys/dev/dev_verbose.h:1.2.26.1 src/sys/dev/dev_verbose.h:1.2.26.2
--- src/sys/dev/dev_verbose.h:1.2.26.1	Wed Aug  5 14:47:04 2020
+++ src/sys/dev/dev_verbose.h	Tue Aug 11 17:06:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_verbose.h,v 1.2.26.1 2020/08/05 14:47:04 martin Exp $ */
+/*	$NetBSD: dev_verbose.h,v 1.2.26.2 2020/08/11 17:06:18 martin Exp $ */
 
 /*
  * Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ tag ## _load_verbose(void)		\
 {	\
 	\
 	if (tag ## verbose_loaded == 0)	\
-		module_autoload(# tag "verbose", MODULE_CLASS_MISC);	\
+		module_autoload(# tag "verbose", MODULE_CLASS_DRIVER);	\
 }	\
 	\
 static const char *			\



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

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 17:06:18 UTC 2020

Modified Files:
src/sys/dev [netbsd-9]: dev_verbose.h

Log Message:
Additionally pull up following revision(s) (requested by uwe in ticket #1037):

sys/dev/dev_verbose.h: revision 1.4

DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535


To generate a diff of this commit:
cvs rdiff -u -r1.2.26.1 -r1.2.26.2 src/sys/dev/dev_verbose.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/nvmm/x86

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:48:42 UTC 2020

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svmfunc.S nvmm_x86_vmxfunc.S

Log Message:
Micro-optimize: use pushq instead of pushw. To avoid LCP stalls and
unaligned stack accesses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S \
src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.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/dev/nvmm/x86/nvmm_x86_svmfunc.S
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.4 src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.5
--- src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S:1.4	Sun Jul 19 06:36:37 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S	Tue Aug 11 15:48:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svmfunc.S,v 1.4 2020/07/19 06:36:37 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svmfunc.S,v 1.5 2020/08/11 15:48:42 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -75,10 +75,10 @@
 
 #define HOST_SAVE_TR		\
 	strw	%ax		;\
-	pushw	%ax
+	pushq	%rax
 
 #define HOST_RESTORE_TR\
-	popw	%ax;\
+	popq	%rax;\
 	movzwq	%ax,%rdx			;\
 	movq	CPUVAR(GDT),%rax		;\
 	andq	$~0x0200,4(%rax,%rdx, 1)	;\
@@ -86,10 +86,10 @@
 
 #define HOST_SAVE_LDT		\
 	sldtw	%ax		;\
-	pushw	%ax
+	pushq	%rax
 
 #define HOST_RESTORE_LDT	\
-	popw	%ax		;\
+	popq	%rax		;\
 	lldtw	%ax
 
 /*
Index: src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.4 src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.5
--- src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S:1.4	Sun Jul 19 06:36:37 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S	Tue Aug 11 15:48:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmxfunc.S,v 1.4 2020/07/19 06:36:37 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmxfunc.S,v 1.5 2020/08/11 15:48:42 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -100,10 +100,10 @@ END(_vmx_vmxoff)
 
 #define HOST_SAVE_LDT		\
 	sldtw	%ax		;\
-	pushw	%ax
+	pushq	%rax
 
 #define HOST_RESTORE_LDT	\
-	popw	%ax		;\
+	popq	%rax		;\
 	lldtw	%ax
 
 /*



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:48:42 UTC 2020

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svmfunc.S nvmm_x86_vmxfunc.S

Log Message:
Micro-optimize: use pushq instead of pushw. To avoid LCP stalls and
unaligned stack accesses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S \
src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S

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



CVS commit: src/doc

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:35:17 UTC 2020

Modified Files:
src/doc: TODO.nvmm

Log Message:
sync


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/TODO.nvmm

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

Modified files:

Index: src/doc/TODO.nvmm
diff -u src/doc/TODO.nvmm:1.4 src/doc/TODO.nvmm:1.5
--- src/doc/TODO.nvmm:1.4	Wed May 20 21:05:21 2020
+++ src/doc/TODO.nvmm	Tue Aug 11 15:35:17 2020
@@ -8,10 +8,8 @@ Known issues in NVMM, low priority in mo
 
  * AMD: we don't support VCPU_CONF_TPR, would be nice to.
 
- * AMD: need to do comprehensive CPUID filtering.
-
- * Intel: we have comprehensive CPUID filtering, but should we limit the highest
-   leaf?
+ * AMD: need to do comprehensive CPUID filtering, like we already do on
+   Intel.
 
 == LIBNVMM ==
 



CVS commit: src/doc

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:35:17 UTC 2020

Modified Files:
src/doc: TODO.nvmm

Log Message:
sync


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/TODO.nvmm

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



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:31:52 UTC 2020

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

Log Message:
Improve the CPUID emulation on nvmm-intel:

 - Limit the highest extended leaf.
 - Limit 0x0007 to ECX=0, for future-proofness.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 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.68 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.69
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.68	Tue Aug 11 15:27:46 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Tue Aug 11 15:31:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.68 2020/08/11 15:27:46 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.69 2020/08/11 15:31:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.68 2020/08/11 15:27:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.69 2020/08/11 15:31:51 maxv Exp $");
 
 #include 
 #include 
@@ -1172,6 +1172,7 @@ error:
 #define VMX_CPUID_MAX_HYPERVISOR	0x4000
 #define VMX_CPUID_MAX_EXTENDED		0x8008
 static uint32_t vmx_cpuid_max_basic __read_mostly;
+static uint32_t vmx_cpuid_max_extended __read_mostly;
 
 static void
 vmx_inkernel_exec_cpuid(struct vmx_cpudata *cpudata, uint64_t eax, uint64_t ecx)
@@ -1203,6 +1204,11 @@ vmx_inkernel_handle_cpuid(struct nvmm_ma
 			eax = vmx_cpuid_max_basic;
 			vmx_inkernel_exec_cpuid(cpudata, eax, ecx);
 		}
+	} else {
+		if (__predict_false(eax > vmx_cpuid_max_extended)) {
+			eax = vmx_cpuid_max_basic;
+			vmx_inkernel_exec_cpuid(cpudata, eax, ecx);
+		}
 	}
 
 	switch (eax) {
@@ -1248,12 +1254,22 @@ vmx_inkernel_handle_cpuid(struct nvmm_ma
 		cpudata->gprs[NVMM_X64_GPR_RDX] = 0;
 		break;
 	case 0x0007: /* Structured Extended Feature Flags Enumeration */
-		cpudata->gprs[NVMM_X64_GPR_RAX] &= nvmm_cpuid_0007.eax;
-		cpudata->gprs[NVMM_X64_GPR_RBX] &= nvmm_cpuid_0007.ebx;
-		cpudata->gprs[NVMM_X64_GPR_RCX] &= nvmm_cpuid_0007.ecx;
-		cpudata->gprs[NVMM_X64_GPR_RDX] &= nvmm_cpuid_0007.edx;
-		if (vmx_procbased_ctls2 & PROC_CTLS2_INVPCID_ENABLE) {
-			cpudata->gprs[NVMM_X64_GPR_RBX] |= CPUID_SEF_INVPCID;
+		switch (ecx) {
+		case 0:
+			cpudata->gprs[NVMM_X64_GPR_RAX] = 0;
+			cpudata->gprs[NVMM_X64_GPR_RBX] &= nvmm_cpuid_0007.ebx;
+			cpudata->gprs[NVMM_X64_GPR_RCX] &= nvmm_cpuid_0007.ecx;
+			cpudata->gprs[NVMM_X64_GPR_RDX] &= nvmm_cpuid_0007.edx;
+			if (vmx_procbased_ctls2 & PROC_CTLS2_INVPCID_ENABLE) {
+cpudata->gprs[NVMM_X64_GPR_RBX] |= CPUID_SEF_INVPCID;
+			}
+			break;
+		default:
+			cpudata->gprs[NVMM_X64_GPR_RAX] = 0;
+			cpudata->gprs[NVMM_X64_GPR_RBX] = 0;
+			cpudata->gprs[NVMM_X64_GPR_RCX] = 0;
+			cpudata->gprs[NVMM_X64_GPR_RDX] = 0;
+			break;
 		}
 		break;
 	case 0x0008: /* Empty */
@@ -1365,6 +1381,9 @@ vmx_inkernel_handle_cpuid(struct nvmm_ma
 		memcpy(>gprs[NVMM_X64_GPR_RDX], " ___", 4);
 		break;
 
+	case 0x8000:
+		cpudata->gprs[NVMM_X64_GPR_RAX] = vmx_cpuid_max_extended;
+		break;
 	case 0x8001:
 		cpudata->gprs[NVMM_X64_GPR_RAX] &= nvmm_cpuid_8001.eax;
 		cpudata->gprs[NVMM_X64_GPR_RBX] &= nvmm_cpuid_8001.ebx;
@@ -3346,6 +3365,7 @@ vmx_init(void)
 	uint64_t xc, msr;
 	struct vmxon *vmxon;
 	uint32_t revision;
+	u_int descs[4];
 	paddr_t pa;
 	vaddr_t va;
 	int error;
@@ -3356,9 +3376,13 @@ vmx_init(void)
 	/* Init the XCR0 mask. */
 	vmx_xcr0_mask = VMX_XCR0_MASK_DEFAULT & x86_xsave_features;
 
-	/* Init the max CPUID leaves. */
+	/* Init the max basic CPUID leaf. */
 	vmx_cpuid_max_basic = uimin(cpuid_level, VMX_CPUID_MAX_BASIC);
 
+	/* Init the max extended CPUID leaf. */
+	x86_cpuid(0x8000, descs);
+	vmx_cpuid_max_extended = uimin(descs[0], VMX_CPUID_MAX_EXTENDED);
+
 	/* Init the TLB flush op, the EPT flush op and the EPTP type. */
 	msr = rdmsr(MSR_IA32_VMX_EPT_VPID_CAP);
 	if ((msr & IA32_VMX_EPT_VPID_INVVPID_CONTEXT) != 0) {



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:31:52 UTC 2020

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

Log Message:
Improve the CPUID emulation on nvmm-intel:

 - Limit the highest extended leaf.
 - Limit 0x0007 to ECX=0, for future-proofness.


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



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:27:46 UTC 2020

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

Log Message:
Improve emulation of MSR_IA32_ARCH_CAPABILITIES: publish only the *_NO
bits. Initially they were the only ones there, but Intel then added other
bits we aren't interested in, and they must be filtered out.


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



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:27:46 UTC 2020

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

Log Message:
Improve emulation of MSR_IA32_ARCH_CAPABILITIES: publish only the *_NO
bits. Initially they were the only ones there, but Intel then added other
bits we aren't interested in, and they must be filtered out.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 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.67 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.68
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.67	Wed Aug  5 15:20:09 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Tue Aug 11 15:27:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.67 2020/08/05 15:20:09 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.68 2020/08/11 15:27:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.67 2020/08/05 15:20:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.68 2020/08/11 15:27:46 maxv Exp $");
 
 #include 
 #include 
@@ -1734,6 +1734,24 @@ vmx_inkernel_handle_msr(struct nvmm_mach
 			cpudata->gprs[NVMM_X64_GPR_RDX] = (val >> 32);
 			goto handled;
 		}
+		if (exit->u.rdmsr.msr == MSR_IA32_ARCH_CAPABILITIES) {
+			u_int descs[4];
+			if (cpuid_level < 7) {
+goto error;
+			}
+			x86_cpuid(7, descs);
+			if (!(descs[3] & CPUID_SEF_ARCH_CAP)) {
+goto error;
+			}
+			val = rdmsr(MSR_IA32_ARCH_CAPABILITIES);
+			val &= (IA32_ARCH_RDCL_NO |
+			IA32_ARCH_SSB_NO |
+			IA32_ARCH_MDS_NO |
+			IA32_ARCH_TAA_NO);
+			cpudata->gprs[NVMM_X64_GPR_RAX] = (val & 0x);
+			cpudata->gprs[NVMM_X64_GPR_RDX] = (val >> 32);
+			goto handled;
+		}
 		for (i = 0; i < __arraycount(msr_ignore_list); i++) {
 			if (msr_ignore_list[i] != exit->u.rdmsr.msr)
 continue;
@@ -2765,8 +2783,6 @@ vmx_vcpu_init(struct nvmm_machine *mach,
 	vmx_vcpu_msr_allow(cpudata->msrbm, MSR_FSBASE, true, true);
 	vmx_vcpu_msr_allow(cpudata->msrbm, MSR_GSBASE, true, true);
 	vmx_vcpu_msr_allow(cpudata->msrbm, MSR_TSC, true, false);
-	vmx_vcpu_msr_allow(cpudata->msrbm, MSR_IA32_ARCH_CAPABILITIES,
-	true, false);
 	vmx_vmwrite(VMCS_MSR_BITMAP, (uint64_t)cpudata->msrbm_pa);
 
 	/*



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:23:10 UTC 2020

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

Log Message:
Hide OSPKE. NFC since the host never uses PKU, but still.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/nvmm/x86/nvmm_x86.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.11 src/sys/dev/nvmm/x86/nvmm_x86.c:1.12
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.11	Wed Aug  5 15:38:28 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Tue Aug 11 15:23:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.11 2020/08/05 15:38:28 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.12 2020/08/11 15:23:10 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.11 2020/08/05 15:38:28 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.12 2020/08/11 15:23:10 maxv Exp $");
 
 #include 
 #include 
@@ -338,7 +338,7 @@ const struct nvmm_x86_cpuid_mask nvmm_cp
 	/* CPUID_SEF_AVX512_VBMI excluded */
 	CPUID_SEF_UMIP |
 	/* CPUID_SEF_PKU excluded */
-	CPUID_SEF_OSPKE |
+	/* CPUID_SEF_OSPKE excluded */
 	/* CPUID_SEF_WAITPKG excluded */
 	/* CPUID_SEF_AVX512_VBMI2 excluded */
 	/* CPUID_SEF_CET_SS excluded */



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

2020-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 11 15:23:10 UTC 2020

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

Log Message:
Hide OSPKE. NFC since the host never uses PKU, but still.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/nvmm/x86/nvmm_x86.c

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



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

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:19:16 UTC 2020

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

Log Message:
new openldap.h


To generate a diff of this commit:
cvs rdiff -u -r1.2341 -r1.2342 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2341 src/distrib/sets/lists/comp/mi:1.2342
--- src/distrib/sets/lists/comp/mi:1.2341	Sun Jul 26 14:11:43 2020
+++ src/distrib/sets/lists/comp/mi	Tue Aug 11 09:19:15 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2341 2020/07/26 18:11:43 christos Exp $
+#	$NetBSD: mi,v 1.2342 2020/08/11 13:19:15 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -2652,6 +2652,7 @@
 ./usr/include/objc/sarray.h			comp-obsolete		obsolete
 ./usr/include/objc/thr.h			comp-c-include		gcc
 ./usr/include/objc/typedstream.h		comp-obsolete		obsolete
+./usr/include/openldap.h			comp-ldap-include	ldap
 ./usr/include/openpgpsdk/accumulate.h		comp-obsolete		obsolete
 ./usr/include/openpgpsdk/armour.h		comp-obsolete		obsolete
 ./usr/include/openpgpsdk/callback.h		comp-obsolete		obsolete



CVS commit: src/doc

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:18:04 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new openldap


To generate a diff of this commit:
cvs rdiff -u -r1.1741 -r1.1742 src/doc/3RDPARTY
cvs rdiff -u -r1.2726 -r1.2727 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/distrib/sets/lists/comp

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:19:16 UTC 2020

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

Log Message:
new openldap.h


To generate a diff of this commit:
cvs rdiff -u -r1.2341 -r1.2342 src/distrib/sets/lists/comp/mi

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



CVS commit: src/doc

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:18:04 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new openldap


To generate a diff of this commit:
cvs rdiff -u -r1.1741 -r1.1742 src/doc/3RDPARTY
cvs rdiff -u -r1.2726 -r1.2727 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/3RDPARTY
diff -u src/doc/3RDPARTY:1.1741 src/doc/3RDPARTY:1.1742
--- src/doc/3RDPARTY:1.1741	Mon Aug  3 17:12:29 2020
+++ src/doc/3RDPARTY	Tue Aug 11 09:18:04 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1741 2020/08/03 21:12:29 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1742 2020/08/11 13:18:04 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1017,12 +1017,12 @@ Notes:
 We have lots of local fixes.
 
 Package:	OpenLDAP
-Version:	2.4.48
+Version:	2.4.50
 Current Vers:	2.4.50
 Maintainer:	OpenLDAP Foundation
 Archive Site:	http://www.openldap.org/
 Home Page:	http://www.openldap.org/
-Date:		2020-06-13
+Date:		2020-08-11
 Mailing List:
 Responsible:
 License:	BSD (3-clause)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2726 src/doc/CHANGES:1.2727
--- src/doc/CHANGES:1.2726	Mon Aug  3 17:12:29 2020
+++ src/doc/CHANGES	Tue Aug 11 09:18:04 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2726 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2727 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -269,3 +269,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	acpi(4): Updated ACPICA to 20200717. [christos 20200802]
 	bind: Import version 9.16.5. [christos 20200803]
 	dhcp: Import version 4.4.2. [christos 20200803]
+	openldap: Import 2.4.50. [christos 20200811]



CVS commit: src/external/bsd/openldap

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:15:43 UTC 2020

Modified Files:
src/external/bsd/openldap: Makefile openldap2netbsd
src/external/bsd/openldap/dist/build: config.guess config.sub mkversion
version.h
src/external/bsd/openldap/dist/clients/tools: common.c common.h
ldapcompare.c ldapdelete.c ldapexop.c ldapmodify.c ldapmodrdn.c
ldappasswd.c ldapsearch.c ldapurl.c ldapwhoami.c
src/external/bsd/openldap/dist/contrib/ldapc++: config.guess config.sub
src/external/bsd/openldap/dist/contrib/ldapc++/src: LDAPAddRequest.h
LDAPAsynConnection.h LDAPAttrType.h LDAPAttribute.h
LDAPAttributeList.h LDAPBindRequest.h LDAPCompareRequest.h
LDAPConnection.h LDAPConstraints.h LDAPControl.h LDAPControlSet.h
LDAPDeleteRequest.h LDAPEntry.h LDAPEntryList.h LDAPException.h
LDAPExtRequest.h LDAPExtResult.h LDAPMessage.h LDAPMessageQueue.h
LDAPModDNRequest.h LDAPModList.h LDAPModification.h
LDAPModifyRequest.h LDAPObjClass.h LDAPRebind.h LDAPRebindAuth.h
LDAPReferenceList.h LDAPRequest.h LDAPResult.h LDAPSaslBindResult.h
LDAPSchema.h LDAPSearchReference.h LDAPSearchRequest.h
LDAPSearchResult.h LDAPSearchResults.h LDAPUrl.h LDAPUrlList.h
LdifReader.h LdifWriter.h SaslInteraction.h
SaslInteractionHandler.h StringList.h TlsOptions.h debug.h
src/external/bsd/openldap/dist/contrib/ldapc++/src/ac: time.h
src/external/bsd/openldap/dist/contrib/slapd-modules/acl: posixgroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/addpartial:
addpartial-overlay.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allop: allop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/allowed: allowed.c
src/external/bsd/openldap/dist/contrib/slapd-modules/autogroup:
autogroup.c
src/external/bsd/openldap/dist/contrib/slapd-modules/cloak: cloak.c
src/external/bsd/openldap/dist/contrib/slapd-modules/denyop: denyop.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dsaschema:
dsaschema.c
src/external/bsd/openldap/dist/contrib/slapd-modules/dupent: dupent.c
src/external/bsd/openldap/dist/contrib/slapd-modules/kinit: kinit.c
src/external/bsd/openldap/dist/contrib/slapd-modules/lastmod: lastmod.c
src/external/bsd/openldap/dist/contrib/slapd-modules/noopsrch:
noopsrch.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nops: nops.c
src/external/bsd/openldap/dist/contrib/slapd-modules/nssov: alias.c
ether.c group.c host.c netgroup.c network.c nssov.c nssov.h pam.c
passwd.c protocol.c rpc.c service.c shadow.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd: kerberos.c
netscape.c radius.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/argon2:
pw-argon2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/pbkdf2:
pw-pbkdf2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/passwd/sha2:
slapd-sha2.c
src/external/bsd/openldap/dist/contrib/slapd-modules/proxyOld:
proxyOld.c
src/external/bsd/openldap/dist/contrib/slapd-modules/samba4: pguid.c
rdnval.c vernum.c
src/external/bsd/openldap/dist/contrib/slapd-modules/smbk5pwd:
smbk5pwd.c
src/external/bsd/openldap/dist/contrib/slapd-modules/trace: trace.c
src/external/bsd/openldap/dist/contrib/slapi-plugins/addrdnvalues:
addrdnvalues.c
src/external/bsd/openldap/dist/include: Makefile.in avl.h
getopt-compat.h lber.h lber_pvt.h ldap.h ldap_cdefs.h
ldap_defaults.h ldap_int_thread.h ldap_log.h ldap_pvt.h
ldap_pvt_thread.h ldap_pvt_uc.h ldap_queue.h ldap_rq.h
ldap_schema.h ldap_utf8.h ldif.h lutil.h lutil_hash.h lutil_ldap.h
lutil_lockf.h lutil_md5.h lutil_sha1.h openldap.h portable.hin
rewrite.h slapi-plugin.h sysexits-compat.h
src/external/bsd/openldap/dist/include/ac: alloca.h assert.h bytes.h
crypt.h ctype.h dirent.h errno.h fdset.h localize.h param.h regex.h
setproctitle.h signal.h socket.h stdarg.h stdlib.h string.h
sysexits.h syslog.h termios.h time.h unistd.h wait.h
src/external/bsd/openldap/dist/libraries/liblber: assert.c bprint.c
debug.c decode.c dtest.c encode.c etest.c idtest.c io.c lber-int.h
memory.c nt_err.c options.c sockbuf.c stdio.c
src/external/bsd/openldap/dist/libraries/libldap: abandon.c add.c
addentry.c apitest.c assertion.c bind.c cancel.c charray.c
compare.c controls.c cyrus.c dds.c delete.c deref.c dnssrv.c
dntest.c error.c extended.c fetch.c 

CVS import: src/external/bsd/openldap/dist

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:12:30 UTC 2020

Update of /cvsroot/src/external/bsd/openldap/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv25437

Log Message:
OpenLDAP 2.4.50 Release (2020/04/28)
Fixed client benign typos (ITS#8890)
Fixed libldap type cast (ITS#9175)
Fixed libldap retry loop in ldap_int_tls_connect (ITS#8650)
Fixed libldap_r race on Windows mutex initialization (ITS#9181)
Fixed liblunicode memory leak (ITS#9198)
Fixed slapd benign typos (ITS#8890)
Fixed slapd to limit depth of nested filters (ITS#9202)
Fixed slapd-mdb memory leak in dnSuperiorMatch (ITS#9214)
Fixed slapo-pcache database initialization (ITS#9182)
Fixed slapo-ppolicy callback (ITS#9171)
Build
Fix olcDatabaseDummy initialization for windows (ITS#7074)
Fix detection for ws2tcpip.h for windows (ITS#8383)
Fix back-mdb types for windows (ITS#7878)
Contrib
Update ldapc++ config.guess and config.sub to support newer
architectures (ITS#7855)
Added pw-argon2 module (ITS#9233, ITS#8575, ITS#9203, ITS#9206)
Documentation
slapd-ldap(5) - Clarify idassert-authzfrom behavior (ITS#9003)
slapd-meta(5) - Remove client-pr option (ITS#8683)
slapdinex(8) - Fix truncate option information for back-mdb (ITS#9230)

OpenLDAP 2.4.49 Release (2020/01/30)
Added slapd-monitor database entry count for slapd-mdb (ITS#9154)
Fixed client tools to not add controls on cancel/abandon (ITS#9145)
Fixed client tools SyncInfo message to be LDIF compliant (ITS#8116)
Fixed libldap to correctly free sb (ITS#9081, ITS#8755)
Fixed libldap descriptor leak if ldaps fails (ITS#9147)
Fixed libldap remove unnecessary global mutex for GnuTLS (ITS#9069)
Fixed slapd syntax evaluation of preferredDeliveryMethod (ITS#9067)
Fixed slapd to relax domainScope control check (ITS#9100)
Fixed slapd to have cleaner error handling during connection setup
 (ITS#9112)
Fixed slapd data check when processing cancel exop (ITS#9124)
Fixed slapd attribute description processing (ITS#9128)
Fixed slapd-ldap to set oldctrls correctly (ITS#9076)
Fixed slapd-mdb to honor unchecked limit with alias deref (ITS#7657)
Fixed slapd-mdb missing final commit with slapindex (ITS#9095)
Fixed slapd-mdb drop attr mappings added in an aborted txn (ITS#9091)
Fixed slapd-mdb nosync FLAG configuration handling (ITS#9150)
Fixed slapd-monitor global operation counter reporting (ITS#9119)
Fixed slapo-ppolicy when used with slapauth (ITS#8629)
Fixed slapo-ppolicy to add a missed normalised copy of pwdChangedTime 
(ITS#9126)
Fixed slapo-syncprov fix sessionlog init (ITS#9146)
Fixed slapo-unique loop termination (ITS#9077)
Build Environment
Fix mkdep to honor TMPDIR if set (ITS#9062)
Remove ICU library detection (ITS#9144)
Update config.guess and config.sub to support newer architectures
(ITS#7855)
Disable ITS8521 regression test as it is no longer valid (ITS#9015)
Documentation
admin24 - Fix inconsistent whitespace in replication section (ITS#9153)
slapd-config(5)/slapd.conf(5) - Fix missing bold tag for keyword
(ITS#9063)
slapd-ldap(5) - Document "tls none" option (ITS#9071)
slapo-ppolicy(5) - Correctly document pwdGraceAuthnLimit (ITS#9065)


Status:

Vendor Tag: OPENLDAP
Release Tags:   OPENLDAP2_4_50

U src/external/bsd/openldap/dist/CHANGES
U src/external/bsd/openldap/dist/LICENSE
U src/external/bsd/openldap/dist/INSTALL
U src/external/bsd/openldap/dist/configure
U src/external/bsd/openldap/dist/configure.in
U src/external/bsd/openldap/dist/COPYRIGHT
U src/external/bsd/openldap/dist/Makefile.in
U src/external/bsd/openldap/dist/aclocal.m4
U src/external/bsd/openldap/dist/ANNOUNCEMENT
U src/external/bsd/openldap/dist/README
U src/external/bsd/openldap/dist/build/mkdep
U src/external/bsd/openldap/dist/build/info.mk
U src/external/bsd/openldap/dist/build/openldap.m4
U src/external/bsd/openldap/dist/build/srv.mk
U src/external/bsd/openldap/dist/build/mkvers.bat
U src/external/bsd/openldap/dist/build/mkdep.aix
U src/external/bsd/openldap/dist/build/version.h
U src/external/bsd/openldap/dist/build/shtool
U src/external/bsd/openldap/dist/build/LICENSE-2.0.1
C src/external/bsd/openldap/dist/build/config.guess
U src/external/bsd/openldap/dist/build/man.mk
U src/external/bsd/openldap/dist/build/top.mk
U src/external/bsd/openldap/dist/build/dir.mk
U src/external/bsd/openldap/dist/build/ltmain.sh
C src/external/bsd/openldap/dist/build/mkversion
U src/external/bsd/openldap/dist/build/version.var
U src/external/bsd/openldap/dist/build/lib-shared.mk
U src/external/bsd/openldap/dist/build/lib.mk
U src/external/bsd/openldap/dist/build/mkrelease
U src/external/bsd/openldap/dist/build/lib-static.mk
U src/external/bsd/openldap/dist/build/rules.mk
U 

CVS import: src/external/bsd/openldap/dist

2020-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 11 13:12:30 UTC 2020

Update of /cvsroot/src/external/bsd/openldap/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv25437

Log Message:
OpenLDAP 2.4.50 Release (2020/04/28)
Fixed client benign typos (ITS#8890)
Fixed libldap type cast (ITS#9175)
Fixed libldap retry loop in ldap_int_tls_connect (ITS#8650)
Fixed libldap_r race on Windows mutex initialization (ITS#9181)
Fixed liblunicode memory leak (ITS#9198)
Fixed slapd benign typos (ITS#8890)
Fixed slapd to limit depth of nested filters (ITS#9202)
Fixed slapd-mdb memory leak in dnSuperiorMatch (ITS#9214)
Fixed slapo-pcache database initialization (ITS#9182)
Fixed slapo-ppolicy callback (ITS#9171)
Build
Fix olcDatabaseDummy initialization for windows (ITS#7074)
Fix detection for ws2tcpip.h for windows (ITS#8383)
Fix back-mdb types for windows (ITS#7878)
Contrib
Update ldapc++ config.guess and config.sub to support newer
architectures (ITS#7855)
Added pw-argon2 module (ITS#9233, ITS#8575, ITS#9203, ITS#9206)
Documentation
slapd-ldap(5) - Clarify idassert-authzfrom behavior (ITS#9003)
slapd-meta(5) - Remove client-pr option (ITS#8683)
slapdinex(8) - Fix truncate option information for back-mdb (ITS#9230)

OpenLDAP 2.4.49 Release (2020/01/30)
Added slapd-monitor database entry count for slapd-mdb (ITS#9154)
Fixed client tools to not add controls on cancel/abandon (ITS#9145)
Fixed client tools SyncInfo message to be LDIF compliant (ITS#8116)
Fixed libldap to correctly free sb (ITS#9081, ITS#8755)
Fixed libldap descriptor leak if ldaps fails (ITS#9147)
Fixed libldap remove unnecessary global mutex for GnuTLS (ITS#9069)
Fixed slapd syntax evaluation of preferredDeliveryMethod (ITS#9067)
Fixed slapd to relax domainScope control check (ITS#9100)
Fixed slapd to have cleaner error handling during connection setup
 (ITS#9112)
Fixed slapd data check when processing cancel exop (ITS#9124)
Fixed slapd attribute description processing (ITS#9128)
Fixed slapd-ldap to set oldctrls correctly (ITS#9076)
Fixed slapd-mdb to honor unchecked limit with alias deref (ITS#7657)
Fixed slapd-mdb missing final commit with slapindex (ITS#9095)
Fixed slapd-mdb drop attr mappings added in an aborted txn (ITS#9091)
Fixed slapd-mdb nosync FLAG configuration handling (ITS#9150)
Fixed slapd-monitor global operation counter reporting (ITS#9119)
Fixed slapo-ppolicy when used with slapauth (ITS#8629)
Fixed slapo-ppolicy to add a missed normalised copy of pwdChangedTime 
(ITS#9126)
Fixed slapo-syncprov fix sessionlog init (ITS#9146)
Fixed slapo-unique loop termination (ITS#9077)
Build Environment
Fix mkdep to honor TMPDIR if set (ITS#9062)
Remove ICU library detection (ITS#9144)
Update config.guess and config.sub to support newer architectures
(ITS#7855)
Disable ITS8521 regression test as it is no longer valid (ITS#9015)
Documentation
admin24 - Fix inconsistent whitespace in replication section (ITS#9153)
slapd-config(5)/slapd.conf(5) - Fix missing bold tag for keyword
(ITS#9063)
slapd-ldap(5) - Document "tls none" option (ITS#9071)
slapo-ppolicy(5) - Correctly document pwdGraceAuthnLimit (ITS#9065)


Status:

Vendor Tag: OPENLDAP
Release Tags:   OPENLDAP2_4_50

U src/external/bsd/openldap/dist/CHANGES
U src/external/bsd/openldap/dist/LICENSE
U src/external/bsd/openldap/dist/INSTALL
U src/external/bsd/openldap/dist/configure
U src/external/bsd/openldap/dist/configure.in
U src/external/bsd/openldap/dist/COPYRIGHT
U src/external/bsd/openldap/dist/Makefile.in
U src/external/bsd/openldap/dist/aclocal.m4
U src/external/bsd/openldap/dist/ANNOUNCEMENT
U src/external/bsd/openldap/dist/README
U src/external/bsd/openldap/dist/build/mkdep
U src/external/bsd/openldap/dist/build/info.mk
U src/external/bsd/openldap/dist/build/openldap.m4
U src/external/bsd/openldap/dist/build/srv.mk
U src/external/bsd/openldap/dist/build/mkvers.bat
U src/external/bsd/openldap/dist/build/mkdep.aix
U src/external/bsd/openldap/dist/build/version.h
U src/external/bsd/openldap/dist/build/shtool
U src/external/bsd/openldap/dist/build/LICENSE-2.0.1
C src/external/bsd/openldap/dist/build/config.guess
U src/external/bsd/openldap/dist/build/man.mk
U src/external/bsd/openldap/dist/build/top.mk
U src/external/bsd/openldap/dist/build/dir.mk
U src/external/bsd/openldap/dist/build/ltmain.sh
C src/external/bsd/openldap/dist/build/mkversion
U src/external/bsd/openldap/dist/build/version.var
U src/external/bsd/openldap/dist/build/lib-shared.mk
U src/external/bsd/openldap/dist/build/lib.mk
U src/external/bsd/openldap/dist/build/mkrelease
U src/external/bsd/openldap/dist/build/lib-static.mk
U src/external/bsd/openldap/dist/build/rules.mk
U 

CVS commit: src/sys/dev

2020-08-11 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 11 12:10:10 UTC 2020

Modified Files:
src/sys/dev: dev_verbose.h

Log Message:
DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.

Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


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

2020-08-11 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 11 12:10:10 UTC 2020

Modified Files:
src/sys/dev: dev_verbose.h

Log Message:
DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.

Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/dev_verbose.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/dev_verbose.h
diff -u src/sys/dev/dev_verbose.h:1.3 src/sys/dev/dev_verbose.h:1.4
--- src/sys/dev/dev_verbose.h:1.3	Mon Aug  3 18:19:35 2020
+++ src/sys/dev/dev_verbose.h	Tue Aug 11 12:10:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_verbose.h,v 1.3 2020/08/03 18:19:35 uwe Exp $ */
+/*	$NetBSD: dev_verbose.h,v 1.4 2020/08/11 12:10:10 uwe Exp $ */
 
 /*
  * Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ tag ## _load_verbose(void)		\
 {	\
 	\
 	if (tag ## verbose_loaded == 0)	\
-		module_autoload(# tag "verbose", MODULE_CLASS_MISC);	\
+		module_autoload(# tag "verbose", MODULE_CLASS_DRIVER);	\
 }	\
 	\
 static const char *			\



Re: CVS commit: src/sys

2020-08-11 Thread Robert Swindells


matthew green  wrote:
>however, i'm looking at the changes and i'm not 100% convinced
>it's safe to simply replace this file as-is.
>
> - struct v4l2_pix_format is laid out differently
> - enum v4l2_buf_type <-> u_int32_t does not seem safe, in
>   eg struct v4l2_buffer.  i *think* it may be, but it won't
>   work with eg, -fshort-enums now.
> - struct v4l2_rect width/height are now unsigned (probably ok?)
> - struct v4l2_window has a new member (global_alpha)

Both v4l2_pix_format and v4l2_window are used in a union that is
padded to 200 bytes.

Where does -fshort-enums get used ? It looks to me that it would have
broken alignment of other struct members if it had been defined.


CVS commit: src

2020-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 11 09:51:57 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk
src/tools/gcc: gcc-version.mk

Log Message:
update GCC 7 version to nb4 20200810, and fix the unknown GCC version
error assignment from "=?" to "?=" so it works as designed.


To generate a diff of this commit:
cvs rdiff -u -r1.1202 -r1.1203 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.18 -r1.19 src/tools/gcc/gcc-version.mk

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



CVS commit: src

2020-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 11 09:51:57 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk
src/tools/gcc: gcc-version.mk

Log Message:
update GCC 7 version to nb4 20200810, and fix the unknown GCC version
error assignment from "=?" to "?=" so it works as designed.


To generate a diff of this commit:
cvs rdiff -u -r1.1202 -r1.1203 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.18 -r1.19 src/tools/gcc/gcc-version.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.1202 src/share/mk/bsd.own.mk:1.1203
--- src/share/mk/bsd.own.mk:1.1202	Tue Jul 21 14:42:44 2020
+++ src/share/mk/bsd.own.mk	Tue Aug 11 09:51:57 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1202 2020/07/21 14:42:44 tsutsui Exp $
+#	$NetBSD: bsd.own.mk,v 1.1203 2020/08/11 09:51:57 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -83,7 +83,7 @@ EXTERNAL_GCC_SUBDIR?=	gcc.old
 .elif ${HAVE_GCC} == 8
 EXTERNAL_GCC_SUBDIR?=	gcc
 .else
-EXTERNAL_GCC_SUBDIR=?	/does/not/exist
+EXTERNAL_GCC_SUBDIR?=	/does/not/exist
 .endif
 .else
 MKGCCCMDS?=	no

Index: src/tools/gcc/gcc-version.mk
diff -u src/tools/gcc/gcc-version.mk:1.18 src/tools/gcc/gcc-version.mk:1.19
--- src/tools/gcc/gcc-version.mk:1.18	Wed Mar 11 10:07:01 2020
+++ src/tools/gcc/gcc-version.mk	Tue Aug 11 09:51:57 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: gcc-version.mk,v 1.18 2020/03/11 10:07:01 mrg Exp $
+#	$NetBSD: gcc-version.mk,v 1.19 2020/08/11 09:51:57 mrg Exp $
 
 # common location for tools and native build
 
 .if ${HAVE_GCC} == 7
-NETBSD_GCC_VERSION=nb3 20190319
+NETBSD_GCC_VERSION=nb4 20200810
 .elif ${HAVE_GCC} == 8
 NETBSD_GCC_VERSION=nb1 20200311
 .endif



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

2020-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 11 08:45:56 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/dist: LAST_UPDATED MD5SUMS NEWS
src/external/gpl3/gcc.old/dist/contrib: test_summary
src/external/gpl3/gcc.old/dist/fixincludes: fixincl.x inclhack.def
src/external/gpl3/gcc.old/dist/fixincludes/tests/base/architecture/ppc:
math.h
src/external/gpl3/gcc.old/dist/gcc: BASE-VER DATESTAMP builtins.c
calls.c cfgcleanup.c cfghooks.c cfghooks.h cfgloop.h cfgloopmanip.c
cfgrtl.c combine.c config.gcc convert.c dce.c df-core.c dse.c
dwarf2out.c except.c explow.c expmed.c expr.c final.c fold-const.c
function.c gcse.c gengtype-lex.c ggc-page.c gimple-fold.c
gimple-pretty-print.c gimple-ssa-sprintf.c
gimple-ssa-strength-reduction.c gimple.c gimple.h gimplify.c
graphite-scop-detection.c input.c internal-fn.c internal-fn.h
ipa-cp.c ipa-icf-gimple.c ipa-inline.c ipa-prop.c ipa-pure-const.c
ipa-reference.c ipa-utils.c ipa-utils.h ira.c loop-unroll.c
lra-constraints.c lra.c lto-streamer-in.c lto-streamer-out.c
lto-streamer.h lto-wrapper.c match.pd omp-expand.c omp-low.c
omp-simd-clone.c optabs.c optc-save-gen.awk opth-gen.awk
opts-common.c opts-global.c opts.c resource.c rtl.h rtlanal.c
store-motion.c symtab.c toplev.c tree-cfg.c tree-complex.c
tree-core.h tree-data-ref.c tree-data-ref.h tree-inline.c
tree-inline.h tree-loop-distribution.c tree-outof-ssa.c
tree-scalar-evolution.c tree-sra.c tree-ssa-copy.c tree-ssa-dom.c
tree-ssa-forwprop.c tree-ssa-loop-ch.c tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c tree-ssa-loop-split.c tree-ssa-math-opts.c
tree-ssa-phiopt.c tree-ssa-phiprop.c tree-ssa-pre.c
tree-ssa-reassoc.c tree-ssa-sccvn.c tree-ssa-sccvn.h
tree-ssa-sink.c tree-ssa-strlen.c tree-ssa-structalias.c
tree-ssanames.c tree-streamer-in.c tree-streamer-out.c
tree-vect-data-refs.c tree-vect-slp.c tree-vect-stmts.c tree-vrp.c
tree.c tree.h valtrack.c varasm.c xcoffout.c xcoffout.h
src/external/gpl3/gcc.old/dist/gcc/c: c-decl.c c-parser.c c-tree.h
c-typeck.c

Log Message:
merge GCC 7.5.0 into gcc.old.  .. just in time to be obsolete? :)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/LAST_UPDATED \
src/external/gpl3/gcc.old/dist/MD5SUMS \
src/external/gpl3/gcc.old/dist/NEWS
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/dist/contrib/test_summary
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc.old/dist/fixincludes/fixincl.x
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc.old/dist/fixincludes/inclhack.def
cvs rdiff -u -r1.7 -r1.8 \

src/external/gpl3/gcc.old/dist/fixincludes/tests/base/architecture/ppc/math.h
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc.old/dist/gcc/BASE-VER \
src/external/gpl3/gcc.old/dist/gcc/DATESTAMP \
src/external/gpl3/gcc.old/dist/gcc/builtins.c \
src/external/gpl3/gcc.old/dist/gcc/calls.c \
src/external/gpl3/gcc.old/dist/gcc/combine.c \
src/external/gpl3/gcc.old/dist/gcc/dwarf2out.c \
src/external/gpl3/gcc.old/dist/gcc/expmed.c \
src/external/gpl3/gcc.old/dist/gcc/expr.c \
src/external/gpl3/gcc.old/dist/gcc/fold-const.c \
src/external/gpl3/gcc.old/dist/gcc/function.c \
src/external/gpl3/gcc.old/dist/gcc/gengtype-lex.c \
src/external/gpl3/gcc.old/dist/gcc/gimplify.c \
src/external/gpl3/gcc.old/dist/gcc/ipa-cp.c \
src/external/gpl3/gcc.old/dist/gcc/omp-low.c \
src/external/gpl3/gcc.old/dist/gcc/opts.c \
src/external/gpl3/gcc.old/dist/gcc/tree-cfg.c \
src/external/gpl3/gcc.old/dist/gcc/tree-inline.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-math-opts.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-reassoc.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-sccvn.c \
src/external/gpl3/gcc.old/dist/gcc/tree-ssa-structalias.c \
src/external/gpl3/gcc.old/dist/gcc/tree-vrp.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/dist/gcc/cfgcleanup.c \
src/external/gpl3/gcc.old/dist/gcc/cfghooks.c \
src/external/gpl3/gcc.old/dist/gcc/cfghooks.h \
src/external/gpl3/gcc.old/dist/gcc/cfgloop.h \
src/external/gpl3/gcc.old/dist/gcc/cfgloopmanip.c \
src/external/gpl3/gcc.old/dist/gcc/df-core.c \
src/external/gpl3/gcc.old/dist/gcc/except.c \
src/external/gpl3/gcc.old/dist/gcc/gimple-pretty-print.c \
src/external/gpl3/gcc.old/dist/gcc/gimple-ssa-strength-reduction.c \
src/external/gpl3/gcc.old/dist/gcc/gimple.c \
src/external/gpl3/gcc.old/dist/gcc/gimple.h \
src/external/gpl3/gcc.old/dist/gcc/graphite-scop-detection.c \
src/external/gpl3/gcc.old/dist/gcc/internal-fn.c \
src/external/gpl3/gcc.old/dist/gcc/ipa-reference.c 

CVS commit: [netbsd-8] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 07:21:28 UTC 2020

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

Log Message:
Ammend #1582 for additional build fix


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

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.27 src/doc/CHANGES-8.3:1.1.2.28
--- src/doc/CHANGES-8.3:1.1.2.27	Sun Aug  9 14:18:56 2020
+++ src/doc/CHANGES-8.3	Tue Aug 11 07:21:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.27 2020/08/09 14:18:56 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.28 2020/08/11 07:21:28 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -357,7 +357,7 @@ sys/arch/x86/x86/procfs_machdep.c		1.37,
 	Add AMD protected processor identification number (ppin).
 	[msaitoh, ticket #1581]
 
-external/mit/xorg/lib/libX11/extensions/Makefile up to 1.2
+external/mit/xorg/lib/libX11/extensions/Makefile up to 1.2 (plus patch)
 external/mit/xorg/lib/libX11/Makefile   up to 1.14
 external/mit/xorg/lib/libX11/Makefile.libx11up to 1.19
 external/mit/xorg/lib/libX11/Makefile.ximcp up to 1.5



CVS commit: [netbsd-8] src/doc

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 07:21:28 UTC 2020

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

Log Message:
Ammend #1582 for additional build fix


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

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



CVS commit: [netbsd-8] src/external/mit/xorg/lib/libX11/extensions

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 07:20:10 UTC 2020

Modified Files:
src/external/mit/xorg/lib/libX11/extensions [netbsd-8]: Makefile

Log Message:
Apply patch, requested by maya in ticket #1582:

Do not install XKBgeom.h here, a (minimal different, but content wise
identical) version is already installed from external/mit/kbproto.

The solution applied to HEAD is too intrusive to be used for this branch.


To generate a diff of this commit:
cvs rdiff -u -r1.2.6.2 -r1.2.6.3 \
src/external/mit/xorg/lib/libX11/extensions/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/mit/xorg/lib/libX11/extensions/Makefile
diff -u src/external/mit/xorg/lib/libX11/extensions/Makefile:1.2.6.2 src/external/mit/xorg/lib/libX11/extensions/Makefile:1.2.6.3
--- src/external/mit/xorg/lib/libX11/extensions/Makefile:1.2.6.2	Wed Aug  5 14:16:41 2020
+++ src/external/mit/xorg/lib/libX11/extensions/Makefile	Tue Aug 11 07:20:10 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.2.6.2 2020/08/05 14:16:41 martin Exp $
+# $NetBSD: Makefile,v 1.2.6.3 2020/08/11 07:20:10 martin Exp $
 
 NOPROG=	yes
 
-INCS=  XKBgeom.h
+INCS=  #XKBgeom.h
 INCSDIR=${X11INCDIR}/X11/extensions
 
 .include 



CVS commit: [netbsd-8] src/external/mit/xorg/lib/libX11/extensions

2020-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 11 07:20:10 UTC 2020

Modified Files:
src/external/mit/xorg/lib/libX11/extensions [netbsd-8]: Makefile

Log Message:
Apply patch, requested by maya in ticket #1582:

Do not install XKBgeom.h here, a (minimal different, but content wise
identical) version is already installed from external/mit/kbproto.

The solution applied to HEAD is too intrusive to be used for this branch.


To generate a diff of this commit:
cvs rdiff -u -r1.2.6.2 -r1.2.6.3 \
src/external/mit/xorg/lib/libX11/extensions/Makefile

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/arm32

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 07:03:34 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
s/pmaphist/maphist/


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/arch/arm/arm32/pmap.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/arm32

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 07:03:34 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
s/pmaphist/maphist/


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.419 src/sys/arch/arm/arm32/pmap.c:1.420
--- src/sys/arch/arm/arm32/pmap.c:1.419	Mon Aug 10 05:40:21 2020
+++ src/sys/arch/arm/arm32/pmap.c	Tue Aug 11 07:03:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.419 2020/08/10 05:40:21 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.420 2020/08/11 07:03:33 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.419 2020/08/10 05:40:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.420 2020/08/11 07:03:33 skrll Exp $");
 
 #include 
 #include 
@@ -4841,7 +4841,7 @@ pmap_unwire(pmap_t pm, vaddr_t va)
 
 	pmap_release_pmap_lock(pm);
 
-	UVMHIST_LOG(pmaphist, " <-- done", 0, 0, 0, 0);
+	UVMHIST_LOG(maphist, " <-- done", 0, 0, 0, 0);
 }
 
 #ifdef ARM_MMU_EXTENDED
@@ -5178,7 +5178,7 @@ pmap_remove_all(pmap_t pm)
 {
 
 	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(pmaphist, "(pm=%#jx)", (uintptr_t)pmap, 0, 0, 0);
+	UVMHIST_CALLARGS(maphist, "(pm=%#jx)", (uintptr_t)pmap, 0, 0, 0);
 
 	KASSERT(pm != pmap_kernel());
 
@@ -5207,7 +5207,7 @@ pmap_remove_all(pmap_t pm)
 #endif
 	pm->pm_remove_all = true;
 
-	UVMHIST_LOG(pmaphist, " <-- done", 0, 0, 0, 0);
+	UVMHIST_LOG(maphist, " <-- done", 0, 0, 0, 0);
 	return false;
 }
 



CVS commit: src/sys/uvm/pmap

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 06:54:14 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
s/pmaphist/maphist/ for now


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/uvm/pmap/pmap_tlb.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.35 src/sys/uvm/pmap/pmap_tlb.c:1.36
--- src/sys/uvm/pmap/pmap_tlb.c:1.35	Tue Aug 11 06:09:44 2020
+++ src/sys/uvm/pmap/pmap_tlb.c	Tue Aug 11 06:54:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.35 2020/08/11 06:09:44 skrll Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.36 2020/08/11 06:54:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.35 2020/08/11 06:09:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.36 2020/08/11 06:54:14 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -215,7 +215,7 @@ static void
 pmap_tlb_pai_check(struct pmap_tlb_info *ti, bool locked_p)
 {
 	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(pmaphist, "(ti=%#jx)", (uintptr_t)ti, 0, 0, 0);
+	UVMHIST_CALLARGS(maphist, "(ti=%#jx)", (uintptr_t)ti, 0, 0, 0);
 
 #ifdef DIAGNOSTIC
 	struct pmap_asid_info *pai;
@@ -236,7 +236,7 @@ pmap_tlb_pai_check(struct pmap_tlb_info 
 	if (!locked_p)
 		TLBINFO_UNLOCK(ti);
 #endif
-	UVMHIST_LOG(pmaphist, " <-- done", 0, 0, 0, 0);
+	UVMHIST_LOG(maphist, " <-- done", 0, 0, 0, 0);
 }
 
 static void



CVS commit: src/sys/uvm/pmap

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 06:54:14 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
s/pmaphist/maphist/ for now


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/uvm/pmap/pmap_tlb.c

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/sun

2020-08-11 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Aug 11 06:49:09 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/sun: sun.h sunInit.c sunIo.c

Log Message:
Remove more redundant command option arg checks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/hw/sun/sun.h
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/sun

2020-08-11 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Aug 11 06:49:09 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/sun: sun.h sunInit.c sunIo.c

Log Message:
Remove more redundant command option arg checks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/hw/sun/sun.h
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sun.h
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sun.h:1.6 xsrc/external/mit/xorg-server/dist/hw/sun/sun.h:1.7
--- xsrc/external/mit/xorg-server/dist/hw/sun/sun.h:1.6	Sun Aug  9 07:35:42 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sun.h	Tue Aug 11 06:49:09 2020
@@ -298,6 +298,7 @@ extern fbFd		sunFbs[];
 extern Bool		sunSwapLkeys;
 extern Bool		sunForceMono;
 extern Bool		sunDebug;
+extern char		*sunDeviceList;
 extern Bool		sunFlipPixels;
 extern Bool		sunFbInfo;
 extern Bool		sunCG4Frob;

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.8 xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.9
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.8	Sun Aug  9 11:51:31 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c	Tue Aug 11 06:49:09 2020
@@ -131,6 +131,7 @@ static Bool	sunDevsInited = FALSE;
 
 Bool sunSwapLkeys = FALSE;
 Bool sunDebug = FALSE;
+char *sunDeviceList = NULL;
 Bool sunForceMono = FALSE;
 Bool sunFlipPixels = FALSE;
 Bool sunFbInfo = FALSE;
@@ -402,14 +403,9 @@ GetDeviceList(int argc, char **argv)
 {
 int		i;
 char	*envList = NULL;
-char	*cmdList = NULL;
+char	*cmdList = sunDeviceList;
 char	**deviceList = NULL;
 
-for (i = 1; i < argc; i++)
-	if (strcmp (argv[i], "-dev") == 0 && i+1 < argc) {
-	cmdList = argv[i + 1];
-	break;
-	}
 if (!cmdList)
 	envList = getenv ("XDEVICE");
 

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.3 xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.4
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.3	Sun Aug  9 07:35:42 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c	Tue Aug 11 06:49:09 2020
@@ -209,7 +209,9 @@ ddxProcessArgument(int argc, char *argv[
 	return 1;
 }
 if (strcmp (argv[i], "-dev") == 0) {	/* -dev /dev/mumble */
-	if (++i >= argc) UseMsg ();
+	if (++i >= argc)
+	UseMsg();
+	sunDeviceList = argv[i];
 	return 2;
 }
 if (strcmp (argv[i], "-mono") == 0) {	/* -mono */
@@ -228,14 +230,6 @@ ddxProcessArgument(int argc, char *argv[
 	sunFbInfo = TRUE;
 	return 1;
 }
-if (strcmp (argv[i], "-kbd") == 0) {	/* -kbd */
-	if (++i >= argc) UseMsg();
-	return 2;
-}
-if (strcmp (argv[i], "-protect") == 0) {	/* -protect */
-	if (++i >= argc) UseMsg();
-	return 2;
-}
 if (strcmp (argv[i], "-cg4frob") == 0) {
 	sunCG4Frob = TRUE;
 	return 1;



CVS commit: src/sys/uvm/pmap

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 06:09:44 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap.c pmap_tlb.c

Log Message:
More UVMHIST_LOG.  Remove some commented output printfs.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.34 -r1.35 src/sys/uvm/pmap/pmap_tlb.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.52 src/sys/uvm/pmap/pmap.c:1.53
--- src/sys/uvm/pmap/pmap.c:1.52	Tue Aug 11 05:43:45 2020
+++ src/sys/uvm/pmap/pmap.c	Tue Aug 11 06:09:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.52 2020/08/11 05:43:45 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.53 2020/08/11 06:09:44 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.52 2020/08/11 05:43:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.53 2020/08/11 06:09:44 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -388,6 +388,8 @@ pmap_page_set_attributes(struct vm_page_
 static void
 pmap_page_syncicache(struct vm_page *pg)
 {
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLED(pmaphist);
 #ifndef MULTIPROCESSOR
 	struct pmap * const curpmap = curlwp->l_proc->p_vmspace->vm_map.pmap;
 #endif
@@ -403,9 +405,14 @@ pmap_page_syncicache(struct vm_page *pg)
 	VM_PAGEMD_PVLIST_READLOCK(mdpg);
 	pmap_pvlist_check(mdpg);
 
+	UVMHIST_LOG(pmaphist, "pv %jx pv_pmap %jx\n", (uintptr_t)pv,
+	 (uintptr_t)pv->pv_pmap, 0, 0);
+
 	if (pv->pv_pmap != NULL) {
 		for (; pv != NULL; pv = pv->pv_next) {
 #ifdef MULTIPROCESSOR
+			UVMHIST_LOG(pmaphist, "pv %jx pv_pmap %jx\n",
+			(uintptr_t)pv, (uintptr_t)pv->pv_pmap, 0, 0);
 			kcpuset_merge(onproc, pv->pv_pmap->pm_onproc);
 			if (kcpuset_match(onproc, kcpuset_running)) {
 break;

Index: src/sys/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.34 src/sys/uvm/pmap/pmap_tlb.c:1.35
--- src/sys/uvm/pmap/pmap_tlb.c:1.34	Sun Aug  9 06:26:49 2020
+++ src/sys/uvm/pmap/pmap_tlb.c	Tue Aug 11 06:09:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.34 2020/08/09 06:26:49 skrll Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.35 2020/08/11 06:09:44 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.34 2020/08/09 06:26:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.35 2020/08/11 06:09:44 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -214,6 +214,9 @@ pmap_tlb_intersecting_onproc_p(pmap_t pm
 static void
 pmap_tlb_pai_check(struct pmap_tlb_info *ti, bool locked_p)
 {
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(pmaphist, "(ti=%#jx)", (uintptr_t)ti, 0, 0, 0);
+
 #ifdef DIAGNOSTIC
 	struct pmap_asid_info *pai;
 	if (!locked_p)
@@ -233,6 +236,7 @@ pmap_tlb_pai_check(struct pmap_tlb_info 
 	if (!locked_p)
 		TLBINFO_UNLOCK(ti);
 #endif
+	UVMHIST_LOG(pmaphist, " <-- done", 0, 0, 0, 0);
 }
 
 static void
@@ -268,9 +272,13 @@ pmap_tlb_pai_reset(struct pmap_tlb_info 
 	 */
 	if (PMAP_TLB_FLUSH_ASID_ON_RESET) {
 #ifndef MULTIPROCESSOR
+		UVMHIST_LOG(maphist, " ... asid %u flushed", pai->pai_asid, 0,
+		0, 0);
 		tlb_invalidate_asids(pai->pai_asid, pai->pai_asid);
 #endif
 		if (TLBINFO_ASID_INUSE_P(ti, pai->pai_asid)) {
+			UVMHIST_LOG(maphist, " ... asid marked unused",
+			pai->pai_asid, 0, 0, 0);
 			TLBINFO_ASID_MARK_UNUSED(ti, pai->pai_asid);
 			ti->ti_asids_free++;
 		}
@@ -363,13 +371,13 @@ pmap_tlb_info_init(struct pmap_tlb_info 
 #endif /* MULTIPROCESSOR */
 	KASSERT(ti == _tlb0_info);
 	KASSERT(ti->ti_lock == _tlb0_lock);
-	//printf("ti_lock %p ", ti->ti_lock);
+
 	mutex_init(ti->ti_lock, MUTEX_DEFAULT, IPL_SCHED);
 #if defined(MULTIPROCESSOR) && PMAP_TLB_MAX > 1
 	kcpuset_create(>ti_kcpuset, true);
 	kcpuset_set(ti->ti_kcpuset, cpu_index(curcpu()));
 #endif
-	//printf("asid ");
+
 	if (ti->ti_asid_max == 0) {
 		ti->ti_asid_max = pmap_md_tlb_asid_max();
 		ti->ti_asids_free = TLBINFO_ASID_INITIAL_FREE(ti->ti_asid_max);
@@ -991,12 +999,13 @@ pmap_tlb_asid_deactivate(pmap_t pm)
 	}
 #endif
 	curcpu()->ci_pmap_asid_cur = KERNEL_PID;
-	UVMHIST_LOG(maphist, " <-- done (pm=%#jx)", (uintptr_t)pm, 0, 0, 0);
 	tlb_set_asid(KERNEL_PID);
+
 	pmap_tlb_pai_check(cpu_tlb_info(curcpu()), false);
 #if defined(DEBUG)
 	pmap_tlb_asid_check();
 #endif
+	UVMHIST_LOG(maphist, " <-- done (pm=%#jx)", (uintptr_t)pm, 0, 0, 0);
 }
 
 void



CVS commit: src/sys/uvm/pmap

2020-08-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 11 06:09:44 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap.c pmap_tlb.c

Log Message:
More UVMHIST_LOG.  Remove some commented output printfs.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.34 -r1.35 src/sys/uvm/pmap/pmap_tlb.c

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