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

2019-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 18:03:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_mapping.h

Log Message:
Unbreak the sanitizers for gcc. The sanitizer offset defined in
libsanitizer needs to match with the compiler concept of
TARGET_ASAN_SHADOW_OFFSET, since the compiler generates instructions
to access memory at that offset in the code, and expects the
sanitizer library to have mapped something there. If there is
disagreement, Mr. Segmentation Fault comes and resolves it for you.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h

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



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

2019-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 18:03:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_mapping.h

Log Message:
Unbreak the sanitizers for gcc. The sanitizer offset defined in
libsanitizer needs to match with the compiler concept of
TARGET_ASAN_SHADOW_OFFSET, since the compiler generates instructions
to access memory at that offset in the code, and expects the
sanitizer library to have mapped something there. If there is
disagreement, Mr. Segmentation Fault comes and resolves it for you.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.6	Tue Oct  1 06:38:23 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h	Fri Oct 25 14:03:59 2019
@@ -185,8 +185,10 @@ static const u64 kWindowsShadowOffset32 
 #define SHADOW_OFFSET kSystemZ_ShadowOffset64
 #  elif SANITIZER_FREEBSD
 #define SHADOW_OFFSET kFreeBSD_ShadowOffset64
-#  elif SANITIZER_NETBSD
-#define SHADOW_OFFSET kNetBSD_ShadowOffset64
+// XXX: see TARGET_ASAN_SHADOW_OFFSET in gcc.
+// for example ix86_asan_shadow_offset() in i386.c 
+// #  elif SANITIZER_NETBSD
+// #define SHADOW_OFFSET kNetBSD_ShadowOffset64
 #  elif SANITIZER_MAC
 #   define SHADOW_OFFSET kDefaultShadowOffset64
 #  elif defined(__mips64)



CVS commit: src

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 17:39:57 UTC 2019

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile isa.4
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/dev: DEVNAMES
src/sys/dev/isa: files.isa
Added Files:
src/share/man/man4: nct.4
src/sys/dev/isa: nct.c

Log Message:
Add support for Nuvoton NCT5104D GPIO chips, as found on PC Engines APU
systems. From Andrew Doran in PR kern/54648.


To generate a diff of this commit:
cvs rdiff -u -r1.1657 -r1.1658 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.684 -r1.685 src/share/man/man4/Makefile
cvs rdiff -u -r1.46 -r1.47 src/share/man/man4/isa.4
cvs rdiff -u -r0 -r1.1 src/share/man/man4/nct.4
cvs rdiff -u -r1.540 -r1.541 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1212 -r1.1213 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.322 -r1.323 src/sys/dev/DEVNAMES
cvs rdiff -u -r1.173 -r1.174 src/sys/dev/isa/files.isa
cvs rdiff -u -r0 -r1.1 src/sys/dev/isa/nct.c

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1657 src/distrib/sets/lists/man/mi:1.1658
--- src/distrib/sets/lists/man/mi:1.1657	Tue Oct 15 18:33:57 2019
+++ src/distrib/sets/lists/man/mi	Fri Oct 25 17:39:56 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1657 2019/10/15 18:33:57 christos Exp $
+# $NetBSD: mi,v 1.1658 2019/10/25 17:39:56 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1493,6 +1493,7 @@
 ./usr/share/man/cat4/nadb.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nca.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ncr.0			man-obsolete		obsolete
+./usr/share/man/cat4/nct.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ne.0			man-sys-catman		.cat
 ./usr/share/man/cat4/nele.0			man-sys-catman		.cat
 ./usr/share/man/cat4/neo.0			man-sys-catman		.cat
@@ -4626,6 +4627,7 @@
 ./usr/share/man/html4/mvsata.html		man-sys-htmlman		html
 ./usr/share/man/html4/nadb.html			man-sys-htmlman		html
 ./usr/share/man/html4/nca.html			man-sys-htmlman		html
+./usr/share/man/html4/nct.html			man-sys-htmlman		html
 ./usr/share/man/html4/ne.html			man-sys-htmlman		html
 ./usr/share/man/html4/nele.html			man-sys-htmlman		html
 ./usr/share/man/html4/neo.html			man-sys-htmlman		html
@@ -7613,6 +7615,7 @@
 ./usr/share/man/man4/nadb.4			man-sys-man		.man
 ./usr/share/man/man4/nca.4			man-sys-man		.man
 ./usr/share/man/man4/ncr.4			man-obsolete		obsolete
+./usr/share/man/man4/nct.4			man-sys-man		.man
 ./usr/share/man/man4/ne.4			man-sys-man		.man
 ./usr/share/man/man4/nele.4			man-sys-man		.man
 ./usr/share/man/man4/neo.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.684 src/share/man/man4/Makefile:1.685
--- src/share/man/man4/Makefile:1.684	Mon Oct  7 11:53:40 2019
+++ src/share/man/man4/Makefile	Fri Oct 25 17:39:57 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.684 2019/10/07 11:53:40 msaitoh Exp $
+#	$NetBSD: Makefile,v 1.685 2019/10/25 17:39:57 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -112,7 +112,7 @@ MAN+=	cz.4 epic.4 viaenv.4
 # machine-independent ISA devices
 MAN+=	aha.4 ai.4 aic.4 ast.4 ate.4 boca.4 cs.4 cy.4 ec.4 ef.4 \
 	eg.4 el.4 esp.4 ess.4 ex.4 fmv.4 gus.4 guspnp.4 ix.4 iy.4 \
-	le.4 lm.4 mcd.4 nca.4 rtfps.4 sb.4 sea.4 smsc.4 tcom.4 \
+	le.4 lm.4 mcd.4 nca.4 nct.4 rtfps.4 sb.4 sea.4 smsc.4 tcom.4 \
 	wds.4 we.4 wss.4 wt.4
 
 # machine-independent PCMCIA devices

Index: src/share/man/man4/isa.4
diff -u src/share/man/man4/isa.4:1.46 src/share/man/man4/isa.4:1.47
--- src/share/man/man4/isa.4:1.46	Mon Jul  3 21:30:58 2017
+++ src/share/man/man4/isa.4	Fri Oct 25 17:39:57 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: isa.4,v 1.46 2017/07/03 21:30:58 wiz Exp $
+.\"	$NetBSD: isa.4,v 1.47 2019/10/25 17:39:57 martin Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -29,7 +29,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 10, 2013
+.Dd October 25, 2019
 .Dt ISA 4
 .Os
 .Sh NAME
@@ -253,6 +253,8 @@ Aztech/PackardBell radio card.
 EGA graphics boards.
 .It lm
 National Semiconductor LM78, LM79 and compatible hardware monitors.
+.It nct
+Nuvoton NCT5104D SuperIO.
 .It pcdisplay
 PC display adapters.
 .It pcic
@@ -353,6 +355,7 @@ It is usually due to a suboptimally code
 .Xr mcd 4 ,
 .Xr mpu 4 ,
 .Xr nca 4 ,
+.Xr nct 4 ,
 .Xr ne 4 ,
 .Xr ntwoc 4 ,
 .Xr opl 4 ,

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.540 src/sys/arch/amd64/conf/GENERIC:1.541
--- src/sys/arch/amd64/conf/GENERIC:1.540	Fri Oct 25 17:25:23 2019
+++ src/sys/arch/amd64/conf/GENERIC	Fri Oct 25 

CVS commit: src

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 17:39:57 UTC 2019

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile isa.4
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/dev: DEVNAMES
src/sys/dev/isa: files.isa
Added Files:
src/share/man/man4: nct.4
src/sys/dev/isa: nct.c

Log Message:
Add support for Nuvoton NCT5104D GPIO chips, as found on PC Engines APU
systems. From Andrew Doran in PR kern/54648.


To generate a diff of this commit:
cvs rdiff -u -r1.1657 -r1.1658 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.684 -r1.685 src/share/man/man4/Makefile
cvs rdiff -u -r1.46 -r1.47 src/share/man/man4/isa.4
cvs rdiff -u -r0 -r1.1 src/share/man/man4/nct.4
cvs rdiff -u -r1.540 -r1.541 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1212 -r1.1213 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.322 -r1.323 src/sys/dev/DEVNAMES
cvs rdiff -u -r1.173 -r1.174 src/sys/dev/isa/files.isa
cvs rdiff -u -r0 -r1.1 src/sys/dev/isa/nct.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/amd64/conf

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 17:25:23 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.539 -r1.540 src/sys/arch/amd64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.539 src/sys/arch/amd64/conf/GENERIC:1.540
--- src/sys/arch/amd64/conf/GENERIC:1.539	Fri Oct 25 16:50:17 2019
+++ src/sys/arch/amd64/conf/GENERIC	Fri Oct 25 17:25:23 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.539 2019/10/25 16:50:17 martin Exp $
+# $NetBSD: GENERIC,v 1.540 2019/10/25 17:25:23 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.539 $"
+#ident		"GENERIC-$Revision: 1.540 $"
 
 maxusers	64		# estimated number of users
 
@@ -578,7 +578,7 @@ gpioow* 	at gpio?
 onewire*	at gpioow?
 
 # 1-Wire devices
-owtemp*at onewire? # Temperature sensors
+owtemp* 	at onewire?			# Temperature sensors
 
 # I2C support
 #gpioiic*	at gpio?



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

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 17:25:23 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.539 -r1.540 src/sys/arch/amd64/conf/GENERIC

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



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

2019-10-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Oct 25 17:17:30 UTC 2019

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
register the IPI before spinning up CPUs, and make sure to do it exactly once
with this, and previous commits, G5s with four CPUs work
tested by Romain Dolbeau


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/powerpc/oea/cpu_subr.c

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

Modified files:

Index: src/sys/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.101 src/sys/arch/powerpc/oea/cpu_subr.c:1.102
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.101	Fri Sep 20 21:27:29 2019
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Fri Oct 25 17:17:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.101 2019/09/20 21:27:29 macallan Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.102 2019/10/25 17:17:30 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.101 2019/09/20 21:27:29 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.102 2019/10/25 17:17:30 macallan Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_ppccache.h"
@@ -452,6 +452,12 @@ cpu_attach_common(device_t self, int id)
 	ci->ci_dev = self;
 	ci->ci_idlespin = cpu_idlespin;
 
+#ifdef MULTIPROCESSOR
+	/* Register IPI Interrupt */
+	if ((ipiops.ppc_establish_ipi) && (id == 0))
+		ipiops.ppc_establish_ipi(IST_LEVEL, IPL_HIGH, NULL);
+#endif
+
 	pvr = mfpvr();
 	vers = (pvr >> 16) & 0x;
 
@@ -1408,10 +1414,6 @@ cpu_spinup(device_t self, struct cpu_inf
 		return -1;
 	}
 
-	/* Register IPI Interrupt */
-	if (ipiops.ppc_establish_ipi)
-		ipiops.ppc_establish_ipi(IST_LEVEL, IPL_HIGH, NULL);
-
 	return 0;
 }
 



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

2019-10-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Oct 25 17:17:30 UTC 2019

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
register the IPI before spinning up CPUs, and make sure to do it exactly once
with this, and previous commits, G5s with four CPUs work
tested by Romain Dolbeau


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/powerpc/oea/cpu_subr.c

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



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

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:50:17 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
Add missing onewire temperature sensors, suggested by Andrew Doran.


To generate a diff of this commit:
cvs rdiff -u -r1.538 -r1.539 src/sys/arch/amd64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.538 src/sys/arch/amd64/conf/GENERIC:1.539
--- src/sys/arch/amd64/conf/GENERIC:1.538	Tue Oct  8 18:50:44 2019
+++ src/sys/arch/amd64/conf/GENERIC	Fri Oct 25 16:50:17 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.538 2019/10/08 18:50:44 maxv Exp $
+# $NetBSD: GENERIC,v 1.539 2019/10/25 16:50:17 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.538 $"
+#ident		"GENERIC-$Revision: 1.539 $"
 
 maxusers	64		# estimated number of users
 
@@ -577,6 +577,9 @@ gpio*		at gpiobus?
 gpioow* 	at gpio?
 onewire*	at gpioow?
 
+# 1-Wire devices
+owtemp*at onewire? # Temperature sensors
+
 # I2C support
 #gpioiic*	at gpio?
 #iic*		at gpioiic?



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

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:50:17 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
Add missing onewire temperature sensors, suggested by Andrew Doran.


To generate a diff of this commit:
cvs rdiff -u -r1.538 -r1.539 src/sys/arch/amd64/conf/GENERIC

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



CVS commit: src/sys/dev/onewire

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:25:14 UTC 2019

Modified Files:
src/sys/dev/onewire: onewire.c onewirereg.h owtemp.c

Log Message:
PR kern/54617: onewire(4):

 - Alter locking strategy to avoid deadlock on detach.
 - Auto bus probe chews CPU.  Increase interval from 3s to 10s.
 - Put temp sensor S/N in dev description so it can be identified.
 - Use mutex/condvar.

Patch from Andrew Doran.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/onewire/onewire.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/onewire/onewirereg.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/onewire/owtemp.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/onewire/onewire.c
diff -u src/sys/dev/onewire/onewire.c:1.16 src/sys/dev/onewire/onewire.c:1.17
--- src/sys/dev/onewire/onewire.c:1.16	Fri Jul 25 08:10:38 2014
+++ src/sys/dev/onewire/onewire.c	Fri Oct 25 16:25:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: onewire.c,v 1.16 2014/07/25 08:10:38 dholland Exp $ */
+/*	$NetBSD: onewire.c,v 1.17 2019/10/25 16:25:14 martin Exp $	*/
 /*	$OpenBSD: onewire.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.16 2014/07/25 08:10:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.17 2019/10/25 16:25:14 martin Exp $");
 
 /*
  * 1-Wire bus driver.
@@ -30,8 +30,7 @@ __KERNEL_RCSID(0, "$NetBSD: onewire.c,v 
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -45,18 +44,16 @@ __KERNEL_RCSID(0, "$NetBSD: onewire.c,v 
 #define DPRINTF(x)
 #endif
 
-//#define ONEWIRE_MAXDEVS		256
-#define ONEWIRE_MAXDEVS		8
-#define ONEWIRE_SCANTIME	3
+int	onewire_maxdevs = 8;
+int	onewire_scantime = 10;	/* was 3 seconds - too often */
 
 struct onewire_softc {
 	device_t			sc_dev;
-
 	struct onewire_bus *		sc_bus;
-	krwlock_t			sc_rwlock;
+	kmutex_t			sc_lock;
+	kcondvar_t			sc_scancv;
 	struct lwp *			sc_thread;
 	TAILQ_HEAD(, onewire_device)	sc_devs;
-
 	intsc_dying;
 };
 
@@ -64,7 +61,7 @@ struct onewire_device {
 	TAILQ_ENTRY(onewire_device)	d_list;
 	device_t			d_dev;
 	u_int64_t			d_rom;
-	intd_present;
+	boold_present;
 };
 
 static int	onewire_match(device_t, cfdata_t, void *);
@@ -79,21 +76,6 @@ static void	onewire_scan(struct onewire_
 CFATTACH_DECL_NEW(onewire, sizeof(struct onewire_softc),
 	onewire_match, onewire_attach, onewire_detach, onewire_activate);
 
-const struct cdevsw onewire_cdevsw = {
-	.d_open = noopen,
-	.d_close = noclose,
-	.d_read = noread,
-	.d_write = nowrite,
-	.d_ioctl = noioctl,
-	.d_stop = nostop,
-	.d_tty = notty,
-	.d_poll = nopoll,
-	.d_mmap = nommap,
-	.d_kqfilter = nokqfilter,
-	.d_discard = nodiscard,
-	.d_flag = D_OTHER
-};
-
 extern struct cfdriver onewire_cd;
 
 static int
@@ -110,14 +92,19 @@ onewire_attach(device_t parent, device_t
 
 	sc->sc_dev = self;
 	sc->sc_bus = oba->oba_bus;
-	rw_init(>sc_rwlock);
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(>sc_scancv, "owscan");
 	TAILQ_INIT(>sc_devs);
 
 	aprint_normal("\n");
 
-	if (kthread_create(PRI_NONE, 0, NULL, onewire_thread, sc,
-	>sc_thread, "%s", device_xname(self)) != 0)
+	if (kthread_create(PRI_NONE, KTHREAD_MUSTJOIN | KTHREAD_MPSAFE, NULL,
+	onewire_thread, sc, >sc_thread, "%s", device_xname(self)) != 0) {
 		aprint_error_dev(self, "can't create kernel thread\n");
+		/* Normally the kthread destroys these. */
+		mutex_destroy(>sc_lock);
+		cv_destroy(>sc_scancv);
+	}
 }
 
 static int
@@ -126,17 +113,17 @@ onewire_detach(device_t self, int flags)
 	struct onewire_softc *sc = device_private(self);
 	int rv;
 
-	sc->sc_dying = 1;
 	if (sc->sc_thread != NULL) {
-		wakeup(sc->sc_thread);
-		tsleep(>sc_dying, PWAIT, "owdt", 0);
+		mutex_enter(>sc_lock);
+		sc->sc_dying = 1;
+		cv_broadcast(>sc_scancv);
+		mutex_exit(>sc_lock);
+		/* Must no longer touch sc_lock nor sc_scancv. */
+		kthread_join(sc->sc_thread);
 	}
 
-	onewire_lock(sc);
 	//rv = config_detach_children(self, flags);
 	rv = 0;  /* XXX riz */
-	onewire_unlock(sc);
-	rw_destroy(>sc_rwlock);
 
 	return rv;
 }
@@ -170,7 +157,7 @@ onewire_print(void *aux, const char *pnp
 		(uint)ONEWIRE_ROM_FAMILY_TYPE(oa->oa_rom));
 	else
 		aprint_normal("\"%s\"", famname);
-	aprint_normal(" sn %012llx", ONEWIRE_ROM_SN(oa->oa_rom));
+	aprint_normal(" sn %012" PRIx64, ONEWIRE_ROM_SN(oa->oa_rom));
 
 	if (pnp != NULL)
 		aprint_normal(" at %s", pnp);
@@ -192,7 +179,7 @@ onewire_lock(void *arg)
 {
 	struct onewire_softc *sc = arg;
 
-	rw_enter(>sc_rwlock, RW_WRITER);
+	mutex_enter(>sc_lock);
 }
 
 void
@@ -200,7 +187,7 @@ onewire_unlock(void *arg)
 {
 	struct onewire_softc *sc = arg;
 
-	rw_exit(>sc_rwlock);
+	mutex_exit(>sc_lock);
 }
 
 int
@@ -209,6 +196,8 @@ onewire_reset(void *arg)
 	struct onewire_softc *sc = arg;
 	struct onewire_bus *bus = sc->sc_bus;
 
+	KASSERT(mutex_owned(>sc_lock));
+
 	

CVS commit: src/sys/dev/onewire

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:25:14 UTC 2019

Modified Files:
src/sys/dev/onewire: onewire.c onewirereg.h owtemp.c

Log Message:
PR kern/54617: onewire(4):

 - Alter locking strategy to avoid deadlock on detach.
 - Auto bus probe chews CPU.  Increase interval from 3s to 10s.
 - Put temp sensor S/N in dev description so it can be identified.
 - Use mutex/condvar.

Patch from Andrew Doran.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/onewire/onewire.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/onewire/onewirereg.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/onewire/owtemp.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/filemon

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:22:48 UTC 2019

Modified Files:
src/sys/dev/filemon: filemon_wrapper.c

Log Message:
>From the compilers point of view sys_exit returns a value.
Adjust the filemon wrapper accordingly (newer gcc is unhappy with the
function pointer casts otherwise and the amd64/ALL kernel fails to build).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/filemon/filemon_wrapper.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/filemon

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:22:48 UTC 2019

Modified Files:
src/sys/dev/filemon: filemon_wrapper.c

Log Message:
>From the compilers point of view sys_exit returns a value.
Adjust the filemon wrapper accordingly (newer gcc is unhappy with the
function pointer casts otherwise and the amd64/ALL kernel fails to build).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/filemon/filemon_wrapper.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/filemon/filemon_wrapper.c
diff -u src/sys/dev/filemon/filemon_wrapper.c:1.11 src/sys/dev/filemon/filemon_wrapper.c:1.12
--- src/sys/dev/filemon/filemon_wrapper.c:1.11	Wed Nov 25 07:34:49 2015
+++ src/sys/dev/filemon/filemon_wrapper.c	Fri Oct 25 16:22:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: filemon_wrapper.c,v 1.11 2015/11/25 07:34:49 pgoyette Exp $	*/
+/*	$NetBSD: filemon_wrapper.c,v 1.12 2019/10/25 16:22:48 martin Exp $	*/
 
 /*
  * Copyright (c) 2010, Juniper Networks, Inc.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.11 2015/11/25 07:34:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.12 2019/10/25 16:22:48 martin Exp $");
 
 #include 
 #include 
@@ -43,7 +43,7 @@ static int filemon_wrapper_chdir(struct 
 register_t *);
 static int filemon_wrapper_execve(struct lwp *, struct sys_execve_args *,
 register_t *);
-static void filemon_wrapper_sys_exit(struct lwp *, struct sys_exit_args *,
+static int filemon_wrapper_sys_exit(struct lwp *, struct sys_exit_args *,
 register_t *);
 static int filemon_wrapper_fork(struct lwp *, const void *, register_t *);
 static int filemon_wrapper_link(struct lwp *, struct sys_link_args *,
@@ -380,7 +380,7 @@ out:
 }
 
 
-static void
+static int
 filemon_wrapper_sys_exit(struct lwp * l, struct sys_exit_args * uap,
 register_t * retval)
 {
@@ -398,8 +398,7 @@ filemon_wrapper_sys_exit(struct lwp * l,
 
 		rw_exit(>fm_mtx);
 	}
-	sys_exit(l, uap, retval);
-	/* NOT REACHED */
+	return sys_exit(l, uap, retval);
 }
 
 static int



CVS commit: [netbsd-9] src/doc

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:02:11 UTC 2019

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

Log Message:
Ticket #381


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

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



CVS commit: [netbsd-9] src/doc

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:02:11 UTC 2019

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

Log Message:
Ticket #381


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.86 src/doc/CHANGES-9.0:1.1.2.87
--- src/doc/CHANGES-9.0:1.1.2.86	Thu Oct 24 16:34:51 2019
+++ src/doc/CHANGES-9.0	Fri Oct 25 16:02:11 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.86 2019/10/24 16:34:51 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.87 2019/10/25 16:02:11 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5282,3 +5282,8 @@ sys/external/bsd/drm/dist/shared-core/r1
 	Fix undefined behaviour.
 	[hauke, ticket #379]
 
+sys/arch/evbarm/conf/mk.beagle			1.13
+
+	BEAGLE* kernel expects NetBSD bootargs (command line, no FDT).
+	[mlelstv, ticket #381]
+



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

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:01:17 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf [netbsd-9]: mk.beagle

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #381):

sys/arch/evbarm/conf/mk.beagle: revision 1.13

BEAGLE* kernel expects NetBSD bootargs (command line, no FDT).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/arch/evbarm/conf/mk.beagle

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



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

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 16:01:17 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf [netbsd-9]: mk.beagle

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #381):

sys/arch/evbarm/conf/mk.beagle: revision 1.13

BEAGLE* kernel expects NetBSD bootargs (command line, no FDT).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/arch/evbarm/conf/mk.beagle

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

Modified files:

Index: src/sys/arch/evbarm/conf/mk.beagle
diff -u src/sys/arch/evbarm/conf/mk.beagle:1.12 src/sys/arch/evbarm/conf/mk.beagle:1.12.2.1
--- src/sys/arch/evbarm/conf/mk.beagle:1.12	Sat May 18 08:49:23 2019
+++ src/sys/arch/evbarm/conf/mk.beagle	Fri Oct 25 16:01:17 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.beagle,v 1.12 2019/05/18 08:49:23 skrll Exp $
+#	$NetBSD: mk.beagle,v 1.12.2.1 2019/10/25 16:01:17 martin Exp $
 .if ${KERNEL_BUILD:T:MPANDA*} != ""
 CPPFLAGS+=		-mcpu=cortex-a9
 .elif ${KERNEL_BUILD:T:MOMAP5*} != ""
@@ -13,7 +13,7 @@ SYSTEM_FIRST_SFILE=	${ARM}/arm/armv6_sta
 
 _OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh
 
-MKUBOOTIMAGEARGS=	-A arm -T kernel -O linux
+MKUBOOTIMAGEARGS=	-A arm -T kernel -O netbsd
 MKUBOOTIMAGEARGS+=	-a $(LOADADDRESS) -e $(LOADADDRESS)
 MKUBOOTIMAGEARGS+=	-n "NetBSD/$(BOARDTYPE) ${_OSRELEASE}"
 MKUBOOTIMAGEARGS_NONE=	${MKUBOOTIMAGEARGS} -C none



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:49:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c partitions.c partitions.h

Log Message:
On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/partitions.h

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.53 src/usr.sbin/sysinst/disks.c:1.54
--- src/usr.sbin/sysinst/disks.c:1.53	Mon Oct 21 16:10:54 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.53 2019/10/21 16:10:54 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.54 2019/10/25 12:49:58 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -901,7 +901,8 @@ find_disks(const char *doingwhat, bool a
 		pm_i->parts =
 		partitions_read_disk(
 		pm_i->diskdev,
-		disk->dd_totsec);
+		disk->dd_totsec,
+		disk->dd_no_mbr);
 	}
 }
 continue;
@@ -929,7 +930,8 @@ find_disks(const char *doingwhat, bool a
 			pm->dlsize = disk->dd_cyl * disk->dd_head
 			* disk->dd_sec;
 
-		pm->parts = partitions_read_disk(pm->diskdev, disk->dd_totsec);
+		pm->parts = partitions_read_disk(pm->diskdev,
+		disk->dd_totsec, disk->dd_no_mbr);
 
 again:
 
@@ -1443,7 +1445,7 @@ find_part_by_name(const char *name, stru
 			if (strcmp(disks[n].dd_name, pm->diskdev) == 0)
 continue;
 			ps = partitions_read_disk(disks[n].dd_name,
-			disks[n].dd_totsec);
+			disks[n].dd_totsec, disks[n].dd_no_mbr);
 			if (ps == NULL)
 continue;
 			if (ps->pscheme->find_by_name == NULL)

Index: src/usr.sbin/sysinst/partitions.c
diff -u src/usr.sbin/sysinst/partitions.c:1.2 src/usr.sbin/sysinst/partitions.c:1.3
--- src/usr.sbin/sysinst/partitions.c:1.2	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/partitions.c	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.c,v 1.2 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: partitions.c,v 1.3 2019/10/25 12:49:58 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@ size_t num_available_part_schemes;
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *dev, daddr_t disk_size)
+partitions_read_disk(const char *dev, daddr_t disk_size, bool no_mbr)
 {
 	const struct disk_partitioning_scheme **ps;
 
@@ -53,6 +53,8 @@ partitions_read_disk(const char *dev, da
 		return NULL;
 
 	for (ps = available_part_schemes; *ps; ps++) {
+		if (no_mbr && (*ps)->name == MSG_parttype_mbr)
+			continue;
 		struct disk_partitions *parts =
 		(*ps)->read_from_disk(dev, 0, disk_size, *ps);
 		if (parts)

Index: src/usr.sbin/sysinst/partitions.h
diff -u src/usr.sbin/sysinst/partitions.h:1.6 src/usr.sbin/sysinst/partitions.h:1.7
--- src/usr.sbin/sysinst/partitions.h:1.6	Wed Aug 14 13:02:23 2019
+++ src/usr.sbin/sysinst/partitions.h	Fri Oct 25 12:49:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.h,v 1.6 2019/08/14 13:02:23 martin Exp $	*/
+/*	$NetBSD: partitions.h,v 1.7 2019/10/25 12:49:58 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -549,7 +549,7 @@ extern size_t num_available_part_schemes
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *, daddr_t disk_size);
+partitions_read_disk(const char *, daddr_t disk_size, bool no_mbr);
 
 /*
  * One time initialization



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:49:58 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c partitions.c partitions.h

Log Message:
On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/partitions.h

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



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:24:34 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c part_edit.c

Log Message:
Honor the "no_mbr" flag (used especially for raid and xbd devices)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/part_edit.c

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

Modified files:

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.28 src/usr.sbin/sysinst/bsddisklabel.c:1.29
--- src/usr.sbin/sysinst/bsddisklabel.c:1.28	Mon Oct 21 16:10:54 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Fri Oct 25 12:24:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.28 2019/10/21 16:10:54 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.29 2019/10/25 12:24:34 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1341,7 +1341,7 @@ make_bsd_partitions(struct install_parti
 		return true;
 
 	if (parts == NULL) {
-		pscheme = select_part_scheme(pm, NULL, true, NULL);
+		pscheme = select_part_scheme(pm, NULL, !pm->no_mbr, NULL);
 		if (pscheme == NULL)
 			return false;
 		parts = pscheme->create_new_for_disk(pm->diskdev,

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.8 src/usr.sbin/sysinst/part_edit.c:1.9
--- src/usr.sbin/sysinst/part_edit.c:1.8	Thu Oct 24 18:17:08 2019
+++ src/usr.sbin/sysinst/part_edit.c	Fri Oct 25 12:24:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.8 2019/10/24 18:17:08 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.9 2019/10/25 12:24:34 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,6 +1218,8 @@ select_part_scheme(
 		if (bootable && p->have_boot_support != NULL &&
 		!p->have_boot_support(dev->diskdev))
 			continue;
+		if (dev->no_mbr && p->name == MSG_parttype_mbr)
+			continue;
 		if (p->size_limit && dev->dlsize > p->size_limit) {
 			char buf[255], hum_lim[5];
 



CVS commit: src/usr.sbin/sysinst

2019-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 12:24:34 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c part_edit.c

Log Message:
Honor the "no_mbr" flag (used especially for raid and xbd devices)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/part_edit.c

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



CVS commit: src/lib/libnvmm

2019-10-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Oct 25 09:09:24 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.3

Log Message:
Update the libnvmm man page:

 - Sync the naming with reality.

 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.

 - Add a "VCPU Configuration" section.

 - Add a "Machine Ownership" section.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libnvmm/libnvmm.3

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

Modified files:

Index: src/lib/libnvmm/libnvmm.3
diff -u src/lib/libnvmm/libnvmm.3:1.19 src/lib/libnvmm/libnvmm.3:1.20
--- src/lib/libnvmm/libnvmm.3:1.19	Sat Jun  8 07:27:44 2019
+++ src/lib/libnvmm/libnvmm.3	Fri Oct 25 09:09:24 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnvmm.3,v 1.19 2019/06/08 07:27:44 maxv Exp $
+.\"	$NetBSD: libnvmm.3,v 1.20 2019/10/25 09:09:24 maxv Exp $
 .\"
 .\" Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 30, 2019
+.Dd October 25, 2019
 .Dt LIBNVMM 3
 .Os
 .Sh NAME
@@ -52,6 +52,9 @@
 .Ft int
 .Fn nvmm_vcpu_destroy "struct nvmm_machine *mach" "struct nvmm_vcpu *vcpu"
 .Ft int
+.Fn nvmm_vcpu_configure "struct nvmm_machine *mach" "struct nvmm_vcpu *vcpu" \
+"uint64_t op" "void *conf"
+.Ft int
 .Fn nvmm_vcpu_getstate "struct nvmm_machine *mach" "struct nvmm_vcpu *vcpu" \
 "uint64_t flags"
 .Ft int
@@ -133,6 +136,16 @@ destroys the virtual CPU identified by
 in the machine
 .Fa mach .
 .Pp
+.Fn nvmm_vcpu_configure
+configures, on the VCPU
+.Fa vcpu
+of machine
+.Fa mach ,
+the parameter indicated in
+.Fa op .
+.Fa conf
+describes the value of the parameter.
+.Pp
 .Fn nvmm_vcpu_getstate
 gets the state of the virtual CPU identified by
 .Fa vcpu
@@ -287,12 +300,28 @@ For example, the
 field indicates the maximum number of virtual machines supported, while
 .Cd max_vcpus
 indicates the maximum number of VCPUs supported per virtual machine.
+.Ss Machine Ownership
+When a process creates a virtual machine via
+.Fn nvmm_machine_create ,
+it is considered the owner of this machine.
+No other processes than the owner can operate a virtual machine.
+.Pp
+When an owner exits, all the virtual machines associated with it are destroyed,
+if they were not already destroyed by the owner itself via
+.Fn nvmm_machine_destroy .
+.Pp
+Virtual machines are not inherited across
+.Xr fork 9
+operations.
 .Ss Machine Configuration
 Emulator software can configure several parameters of a virtual machine by using
-.Fn nvmm_machine_configure ,
-which can take the following operations:
+.Fn nvmm_machine_configure .
+Currently, no parameters are implemented.
+.Ss VCPU Configuration
+Emulator software can configure several parameters of a VCPU by using
+.Fn nvmm_vcpu_configure , which can take the following operations:
 .Bd -literal
-#define NVMM_MACH_CONF_CALLBACKS	0
+#define NVMM_VCPU_CONF_CALLBACKS	0
 	...
 .Ed
 .Pp
@@ -386,8 +415,8 @@ A VCPU is described by a public structur
 struct nvmm_vcpu {
 	nvmm_cpuid_t cpuid;
 	struct nvmm_vcpu_state *state;
-	struct nvmm_event *event;
-	struct nvmm_exit *exit;
+	struct nvmm_vcpu_event *event;
+	struct nvmm_vcpu_exit *exit;
 };
 .Ed
 .Pp
@@ -399,11 +428,11 @@ they are initialized to special values b
 .Pp
 A call to
 .Fn nvmm_vcpu_getstate
-will fetch the relevant parts of the VCPU state and put them in
+will fetch the desired parts of the VCPU state and put them in
 .Fa vcpu->state .
 A call to
 .Fn nvmm_vcpu_setstate
-will install in the VCPU the relevant parts of
+will install in the VCPU the desired parts of
 .Fa vcpu->state .
 A call to
 .Fn nvmm_vcpu_inject
@@ -421,22 +450,28 @@ Emulator software should not modify the 
 different threads.
 .Ss Exit Reasons
 The
-.Cd nvmm_exit
+.Cd nvmm_vcpu_exit
 structure is used to handle VM exits:
 .Bd -literal
-/* Exit Reasons */
-#define NVMM_EXIT_NONE		0xULL
-#define NVMM_EXIT_MEMORY	0x0001ULL
-#define NVMM_EXIT_IO		0x0002ULL
-#define NVMM_EXIT_MSR		0x0003ULL
-#define NVMM_EXIT_INT_READY	0x0004ULL
-#define NVMM_EXIT_NMI_READY	0x0005ULL
-#define NVMM_EXIT_HALTED	0x0006ULL
-#define NVMM_EXIT_SHUTDOWN	0x0007ULL
-	...
-#define NVMM_EXIT_INVALID	0xULL
+/* Generic. */
+#define NVMM_VCPU_EXIT_NONE		0xULL
+#define NVMM_VCPU_EXIT_INVALID		0xULL
+/* x86: operations. */
+#define NVMM_VCPU_EXIT_MEMORY		0x0001ULL
+#define NVMM_VCPU_EXIT_IO		0x0002ULL
+/* x86: changes in VCPU state. */
+#define NVMM_VCPU_EXIT_SHUTDOWN		0x1000ULL
+#define NVMM_VCPU_EXIT_INT_READY	0x1001ULL
+#define NVMM_VCPU_EXIT_NMI_READY	0x1002ULL
+#define NVMM_VCPU_EXIT_HALTED		0x1003ULL
+/* 

CVS commit: src/lib/libnvmm

2019-10-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Oct 25 09:09:24 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm.3

Log Message:
Update the libnvmm man page:

 - Sync the naming with reality.

 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.

 - Add a "VCPU Configuration" section.

 - Add a "Machine Ownership" section.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libnvmm/libnvmm.3

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



Re: CVS commit: src

2019-10-25 Thread Kamil Rytarowski
On 25.10.2019 08:51, Martin Husemann wrote:
> On Fri, Oct 25, 2019 at 02:29:16AM +, m...@netbsd.org wrote:
>> Is this going to be a trend now of not even publicly proposing changes
>> and just going straight to core?
> 
> There was a publich discussion quite some time back with no clear result;
> Kamil, can you provide a pointer?
> 
> Martin
> 

http://mail-index.netbsd.org/tech-userlevel/2016/05/28/msg010051.html

+ me pinging (without echo) the community from time to time due the pain
of being different.

The discussions with the previous decision and following GNU libiconv
predate my involvement.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2019-10-25 Thread Martin Husemann
On Fri, Oct 25, 2019 at 02:29:16AM +, m...@netbsd.org wrote:
> Is this going to be a trend now of not even publicly proposing changes
> and just going straight to core?

There was a publich discussion quite some time back with no clear result;
Kamil, can you provide a pointer?

Martin