CVS commit: src/sys

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 04:51:41 UTC 2019

Modified Files:
src/sys/arch/ews4800mips/include: sbd_tr2.h
src/sys/arch/mips/rmi: rmixl_iobus.c rmixl_iobusvar.h
src/sys/arch/x86/include: smbiosvar.h
src/sys/dev/ata: ata.c

Log Message:
 Fix typo (s/controler/controller/).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/include/sbd_tr2.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_iobus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/rmi/rmixl_iobusvar.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/smbiosvar.h
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/ata/ata.c

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



CVS commit: src/sys

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 04:51:41 UTC 2019

Modified Files:
src/sys/arch/ews4800mips/include: sbd_tr2.h
src/sys/arch/mips/rmi: rmixl_iobus.c rmixl_iobusvar.h
src/sys/arch/x86/include: smbiosvar.h
src/sys/dev/ata: ata.c

Log Message:
 Fix typo (s/controler/controller/).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/include/sbd_tr2.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_iobus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/rmi/rmixl_iobusvar.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/smbiosvar.h
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/ata/ata.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/ews4800mips/include/sbd_tr2.h
diff -u src/sys/arch/ews4800mips/include/sbd_tr2.h:1.2 src/sys/arch/ews4800mips/include/sbd_tr2.h:1.3
--- src/sys/arch/ews4800mips/include/sbd_tr2.h:1.2	Mon Apr 28 20:23:18 2008
+++ src/sys/arch/ews4800mips/include/sbd_tr2.h	Wed Aug 21 04:51:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbd_tr2.h,v 1.2 2008/04/28 20:23:18 martin Exp $	*/
+/*	$NetBSD: sbd_tr2.h,v 1.3 2019/08/21 04:51:41 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -135,7 +135,7 @@
 /* read operation invokes channel attention. */
 #define	ETHER_SETADDR_REG	((volatile uint32_t *)0xbb06)
 
-/* DCC (DMA controler. Parallel port and FDD use this.) */
+/* DCC (DMA controller. Parallel port and FDD use this.) */
 struct DCC {
 	uint32_t addr;	/* DMA address */
 	uint32_t cnt;	/* transfer count */

Index: src/sys/arch/mips/rmi/rmixl_iobus.c
diff -u src/sys/arch/mips/rmi/rmixl_iobus.c:1.4 src/sys/arch/mips/rmi/rmixl_iobus.c:1.5
--- src/sys/arch/mips/rmi/rmixl_iobus.c:1.4	Sun Sep 16 09:25:47 2018
+++ src/sys/arch/mips/rmi/rmixl_iobus.c	Wed Aug 21 04:51:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_iobus.c,v 1.4 2018/09/16 09:25:47 skrll Exp $	*/
+/*	$NetBSD: rmixl_iobus.c,v 1.5 2019/08/21 04:51:41 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 /*
  * RMI Peripherals IO Bus support
- * - interface to NOR, NAND, PCMCIA Memory controlers, 
+ * - interface to NOR, NAND, PCMCIA Memory controllers, 
  * - manages the 10 Chip Selects
  * - manages the "Flash" interrupts
  * - manages the "Flash" errors
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_iobus.c,v 1.4 2018/09/16 09:25:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_iobus.c,v 1.5 2019/08/21 04:51:41 msaitoh Exp $");
 
 #include "locators.h"
 
@@ -73,7 +73,7 @@ typedef struct {
  
 typedef struct rmixl_iobus_softc {
 	device_t		sc_dev;
-	bus_space_tag_t		sc_obio_bst;	/* for iobus device controler access */
+	bus_space_tag_t		sc_obio_bst;	/* for iobus device controller access */
 	bus_space_handle_t	sc_obio_bsh;	/*  "   " "  " " */
 	bus_addr_t		sc_obio_addr;
 	bus_size_t		sc_obio_size;

Index: src/sys/arch/mips/rmi/rmixl_iobusvar.h
diff -u src/sys/arch/mips/rmi/rmixl_iobusvar.h:1.1 src/sys/arch/mips/rmi/rmixl_iobusvar.h:1.2
--- src/sys/arch/mips/rmi/rmixl_iobusvar.h:1.1	Fri Mar 18 01:04:09 2011
+++ src/sys/arch/mips/rmi/rmixl_iobusvar.h	Wed Aug 21 04:51:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_iobusvar.h,v 1.1 2011/03/18 01:04:09 cliff Exp $	*/
+/*	$NetBSD: rmixl_iobusvar.h,v 1.2 2019/08/21 04:51:41 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
 #define _RMIXL_IOBUSVAR_H_
 
 struct rmixl_iobus_attach_args {
-	bus_space_tag_t		ia_obio_bst;	/* for iobus controler access */
+	bus_space_tag_t		ia_obio_bst;	/* for iobus controller access */
 	bus_space_handle_t	ia_obio_bsh;	/*  "   " " " */
 	bus_space_tag_t		ia_iobus_bst;	/* for iobus access */
 	bus_addr_t		ia_iobus_addr;	/* device iobus address */

Index: src/sys/arch/x86/include/smbiosvar.h
diff -u src/sys/arch/x86/include/smbiosvar.h:1.5 src/sys/arch/x86/include/smbiosvar.h:1.6
--- src/sys/arch/x86/include/smbiosvar.h:1.5	Tue Dec 25 16:45:02 2018
+++ src/sys/arch/x86/include/smbiosvar.h	Wed Aug 21 04:51:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbiosvar.h,v 1.5 2018/12/25 16:45:02 mlelstv Exp $ */
+/*	$NetBSD: smbiosvar.h,v 1.6 2019/08/21 04:51:41 msaitoh Exp $ */
 /*
  * Copyright (c) 2006 Gordon Willem Klok 
  * Copyright (c) 2005 Jordan Hargrave
@@ -153,8 +153,8 @@ struct smbios_struct_bios {
 	uint32_t	charext;
 	uint8_t	major_rel;
 	uint8_t	minor_rel;
-	uint8_t	ecf_mjr_rel;	/* embedded controler firmware */
-	uint8_t 	ecf_min_rel;	/* embedded controler firmware */
+	uint8_t	ecf_mjr_rel;	/* embedded controller firmware */
+	uint8_t 	ecf_min_rel;	/* embedded controller firmware */
 } __packed;
 
 /*

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.149 src/sys/dev/ata/ata.c:1.150
--- src/sys/dev/ata/ata.c:1.149	Sat May 25 16:30:18 2019
+++ src/sys/dev/ata/ata.c	Wed Aug 21 

CVS commit: src/sys

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 04:17:41 UTC 2019

Modified Files:
src/sys/arch/alpha/conf: files.alpha
src/sys/arch/evbarm/conf: CP3100 GUMSTIX TWINTAIL
src/sys/arch/evbmips/conf: files.sbmips
src/sys/arch/hpcarm/conf: NETBOOKPRO WZERO3
src/sys/arch/hpcmips/conf: files.hpcmips
src/sys/arch/hpcmips/dev: mq200subr.c
src/sys/arch/mips/atheros/dev: ehci_arbus.c
src/sys/arch/pmax/pmax: memc_3min.c
src/sys/arch/powerpc/booke/dev: pq3ehci.c
src/sys/arch/sbmips/conf: files.sbmips
src/sys/arch/shark/shark: i8042.c
src/sys/arch/sparc/include: intr.h
src/sys/arch/zaurus/conf: GENERIC
src/sys/dev/mvme: memcvar.h

Log Message:
 Fix typo (s/contoller/controller/).


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/alpha/conf/files.alpha
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbarm/conf/CP3100
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/evbarm/conf/GUMSTIX
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/evbarm/conf/TWINTAIL
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/conf/files.sbmips
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hpcarm/conf/NETBOOKPRO
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/hpcarm/conf/WZERO3
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/hpcmips/conf/files.hpcmips
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcmips/dev/mq200subr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/atheros/dev/ehci_arbus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/pmax/pmax/memc_3min.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/dev/pq3ehci.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sbmips/conf/files.sbmips
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/shark/shark/i8042.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/include/intr.h
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mvme/memcvar.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/alpha/conf/files.alpha
diff -u src/sys/arch/alpha/conf/files.alpha:1.190 src/sys/arch/alpha/conf/files.alpha:1.191
--- src/sys/arch/alpha/conf/files.alpha:1.190	Mon Mar 25 19:24:30 2019
+++ src/sys/arch/alpha/conf/files.alpha	Wed Aug 21 04:17:40 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.alpha,v 1.190 2019/03/25 19:24:30 maxv Exp $
+# $NetBSD: files.alpha,v 1.191 2019/08/21 04:17:40 msaitoh Exp $
 #
 # alpha-specific configuration info
 
@@ -443,7 +443,7 @@ include "compat/ossaudio/files.ossaudio"
 # needs to be before its isa and pci attachments.  This answer is
 # non-optimal, but I don't have a better answer right now.
 
-# PCIC pcmcia contoller
+# PCIC pcmcia controller
 # XXX this needs to be done very late, so it's done here.  This feels
 # like a kludge, but it might be for the best.
 

Index: src/sys/arch/evbarm/conf/CP3100
diff -u src/sys/arch/evbarm/conf/CP3100:1.48 src/sys/arch/evbarm/conf/CP3100:1.49
--- src/sys/arch/evbarm/conf/CP3100:1.48	Wed Aug  1 20:04:10 2018
+++ src/sys/arch/evbarm/conf/CP3100	Wed Aug 21 04:17:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: CP3100,v 1.48 2018/08/01 20:04:10 maxv Exp $
+#	$NetBSD: CP3100,v 1.49 2019/08/21 04:17:40 msaitoh Exp $
 #
 #	CP3100 -- Certance CP3100 Kernel
 #
@@ -160,7 +160,7 @@ wd*	at atabus? drive ? flags 0x
 
 # SCSI: Symbios Logic 53c1010
 #
-# Wire down the Target/Host instances. Disable the target contoller for
+# Wire down the Target/Host instances. Disable the target controller for
 # now as we don't currently support SCSI target mode.
 siop0		at pci0 dev 2 function 1	# Host controller
 #siop1		at pci0 dev 2 function 0	# Target controller

Index: src/sys/arch/evbarm/conf/GUMSTIX
diff -u src/sys/arch/evbarm/conf/GUMSTIX:1.100 src/sys/arch/evbarm/conf/GUMSTIX:1.101
--- src/sys/arch/evbarm/conf/GUMSTIX:1.100	Fri Apr 26 22:46:03 2019
+++ src/sys/arch/evbarm/conf/GUMSTIX	Wed Aug 21 04:17:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GUMSTIX,v 1.100 2019/04/26 22:46:03 sevan Exp $
+#	$NetBSD: GUMSTIX,v 1.101 2019/08/21 04:17:40 msaitoh Exp $
 #
 #	GUMSTIX -- Gumstix. Inc. gumstix platforms kernel
 #
@@ -196,7 +196,7 @@ ohci0	at pxaip? addr 0x4c00 intr 3	#
 		# ALSO NEEDS pxaudc
 pxaudc0	at pxaip? addr 0x4060
 
-# integrated MMC/SD contoller
+# integrated MMC/SD controller
 pxamci0	at pxaip? addr 0x4110 size 0x48
 sdmmc*	at pxamci?
 #options 	PXAMCI_DEBUG

Index: src/sys/arch/evbarm/conf/TWINTAIL
diff -u src/sys/arch/evbarm/conf/TWINTAIL:1.74 src/sys/arch/evbarm/conf/TWINTAIL:1.75
--- src/sys/arch/evbarm/conf/TWINTAIL:1.74	Tue Oct 23 19:58:52 2018
+++ src/sys/arch/evbarm/conf/TWINTAIL	Wed Aug 21 04:17:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: TWINTAIL,v 1.74 2018/10/23 19:58:52 jdolecek Exp $
+#	$NetBSD: TWINTAIL,v 1.75 2019/08/21 04:17:40 msaitoh Exp $
 #
 #	TWINTAIL -- Genetec corp. G4255EB-X002 Evaluation Board Kernel
 #
@@ -342,7 +342,7 @@ options 	PXA2X0_DMAC_DMOVER_CONCURRENCY=
 #options 	PXA2X0_DMAC_FIXED_PRIORITY	# Don't want 

CVS commit: src/sys

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 04:17:41 UTC 2019

Modified Files:
src/sys/arch/alpha/conf: files.alpha
src/sys/arch/evbarm/conf: CP3100 GUMSTIX TWINTAIL
src/sys/arch/evbmips/conf: files.sbmips
src/sys/arch/hpcarm/conf: NETBOOKPRO WZERO3
src/sys/arch/hpcmips/conf: files.hpcmips
src/sys/arch/hpcmips/dev: mq200subr.c
src/sys/arch/mips/atheros/dev: ehci_arbus.c
src/sys/arch/pmax/pmax: memc_3min.c
src/sys/arch/powerpc/booke/dev: pq3ehci.c
src/sys/arch/sbmips/conf: files.sbmips
src/sys/arch/shark/shark: i8042.c
src/sys/arch/sparc/include: intr.h
src/sys/arch/zaurus/conf: GENERIC
src/sys/dev/mvme: memcvar.h

Log Message:
 Fix typo (s/contoller/controller/).


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/alpha/conf/files.alpha
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbarm/conf/CP3100
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/evbarm/conf/GUMSTIX
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/evbarm/conf/TWINTAIL
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/conf/files.sbmips
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hpcarm/conf/NETBOOKPRO
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/hpcarm/conf/WZERO3
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/hpcmips/conf/files.hpcmips
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcmips/dev/mq200subr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/atheros/dev/ehci_arbus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/pmax/pmax/memc_3min.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/dev/pq3ehci.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sbmips/conf/files.sbmips
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/shark/shark/i8042.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/include/intr.h
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mvme/memcvar.h

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



CVS commit: src/sys/dev/pci

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 02:10:21 UTC 2019

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

Log Message:
 Whitespace fixes. No functional change.


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

2019-08-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 21 02:10:21 UTC 2019

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

Log Message:
 Whitespace fixes. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/dev/pci/pci_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/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.215 src/sys/dev/pci/pci_subr.c:1.216
--- src/sys/dev/pci/pci_subr.c:1.215	Thu Jul 18 07:49:26 2019
+++ src/sys/dev/pci/pci_subr.c	Wed Aug 21 02:10:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.215 2019/07/18 07:49:26 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.216 2019/08/21 02:10:20 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.215 2019/07/18 07:49:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.216 2019/08/21 02:10:20 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -209,7 +209,7 @@ static const struct pci_class pci_subcla
 
 /* PCI bridge programming interface */
 static const struct pci_class pci_interface_pcibridge[] = {
-	{ "",			PCI_INTERFACE_BRIDGE_PCI_PCI, NULL,	},
+	{ "",			PCI_INTERFACE_BRIDGE_PCI_PCI,	NULL,	},
 	{ "subtractive decode",	PCI_INTERFACE_BRIDGE_PCI_SUBDEC, NULL,	},
 	{ NULL,			0,NULL,	},
 };
@@ -223,8 +223,8 @@ static const struct pci_class pci_interf
 
 /* Advanced Switching programming interface */
 static const struct pci_class pci_interface_advsw[] = {
-	{ "custom interface",	PCI_INTERFACE_ADVSW_CUSTOM, NULL, },
-	{ "ASI-SIG",		PCI_INTERFACE_ADVSW_ASISIG, NULL, },
+	{ "custom interface",	PCI_INTERFACE_ADVSW_CUSTOM,	NULL, },
+	{ "ASI-SIG",		PCI_INTERFACE_ADVSW_ASISIG,	NULL, },
 	{ NULL,			0,NULL,	},
 };
 
@@ -304,7 +304,7 @@ static const struct pci_class pci_subcla
 /*
  * Class 0x08.
  * Base system peripheral.
- */ 
+ */
 
 /* PIC programming interface */
 static const struct pci_class pci_interface_pic[] = {
@@ -429,10 +429,10 @@ static const struct pci_class pci_interf
 
 /* IPMI programming interface */
 static const struct pci_class pci_interface_ipmi[] = {
-	{ "SMIC",		PCI_INTERFACE_IPMI_SMIC,		NULL,},
-	{ "keyboard",		PCI_INTERFACE_IPMI_KBD,			NULL,},
-	{ "block transfer",	PCI_INTERFACE_IPMI_BLOCKXFER,		NULL,},
-	{ NULL,			0,	NULL,},
+	{ "SMIC",		PCI_INTERFACE_IPMI_SMIC,	NULL,	},
+	{ "keyboard",		PCI_INTERFACE_IPMI_KBD,		NULL,	},
+	{ "block transfer",	PCI_INTERFACE_IPMI_BLOCKXFER,	NULL,	},
+	{ NULL,			0,NULL,	},
 };
 
 /* Subclasses */
@@ -478,8 +478,8 @@ static const struct pci_class pci_subcla
 
 /* Intelligent IO programming interface */
 static const struct pci_class pci_interface_i2o[] = {
-	{ "FIFO at offset 0x40", PCI_INTERFACE_I2O_FIFOAT40,		NULL,},
-	{ NULL,			0,	NULL,},
+	{ "FIFO at offset 0x40", PCI_INTERFACE_I2O_FIFOAT40,	NULL,	},
+	{ NULL,			0,NULL,	},
 };
 
 /* Subclasses */
@@ -494,9 +494,9 @@ static const struct pci_class pci_subcla
  * Satellite communication controller.
  */
 static const struct pci_class pci_subclass_satcom[] = {
-	{ "TV",			PCI_SUBCLASS_SATCOM_TV,	 	NULL,	},
-	{ "audio",		PCI_SUBCLASS_SATCOM_AUDIO, 	NULL,	},
-	{ "voice",		PCI_SUBCLASS_SATCOM_VOICE, 	NULL,	},
+	{ "TV",			PCI_SUBCLASS_SATCOM_TV,		NULL,	},
+	{ "audio",		PCI_SUBCLASS_SATCOM_AUDIO,	NULL,	},
+	{ "voice",		PCI_SUBCLASS_SATCOM_VOICE,	NULL,	},
 	{ "data",		PCI_SUBCLASS_SATCOM_DATA,	NULL,	},
 	{ "miscellaneous",	PCI_SUBCLASS_SATCOM_MISC,	NULL,	},
 	{ NULL,			0,NULL,	},
@@ -507,9 +507,9 @@ static const struct pci_class pci_subcla
  * Encryption/Decryption controller.
  */
 static const struct pci_class pci_subclass_crypto[] = {
-	{ "network/computing",	PCI_SUBCLASS_CRYPTO_NETCOMP, 	NULL,	},
+	{ "network/computing",	PCI_SUBCLASS_CRYPTO_NETCOMP,	NULL,	},
 	{ "entertainment",	PCI_SUBCLASS_CRYPTO_ENTERTAINMENT, NULL,},
-	{ "miscellaneous",	PCI_SUBCLASS_CRYPTO_MISC, 	NULL,	},
+	{ "miscellaneous",	PCI_SUBCLASS_CRYPTO_MISC,	NULL,	},
 	{ NULL,			0,NULL,	},
 };
 
@@ -585,7 +585,7 @@ DEV_VERBOSE_DEFINE(pci);
  * a positive value if the dest buffer would have overflowed.
  */
 
-static int __printflike(3,4)
+static int __printflike(3, 4)
 snappendf(char **dest, size_t *len, const char * restrict fmt, ...)
 {
 	va_list	ap;
@@ -609,7 +609,7 @@ snappendf(char **dest, size_t *len, cons
 	/* Update dest & len to point at trailing NUL */
 	*dest += count;
 	*len -= count;
-		
+
 	return 0;
 }
 
@@ -1285,7 +1285,7 @@ pci_conf_print_pcix_cap_2ndbusmode(int n
 		printf("PCI-X 266 (Mode 2)\n");
 	else
 		printf("PCI-X 533 (Mode 2)\n");
-	
+
 	printf("  Error protection: %s\n", (num <= 3) ? "parity" : "ECC");
 	switch (num & 0x03) {
 	default:
@@ -1564,7 +1564,7 @@ pci_conf_print_secure_cap(const pcireg_t
 	onoff("IOMMU Miscellaneous Information Register 1", reg,
 	PCI_SECURE_CAP_EXT);
 	havemisc1 = reg & PCI_SECURE_CAP_EXT;

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

2019-08-20 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 20 23:32:33 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3399_iomux.c

Log Message:
rk3399_iomux: add some #ifdef'd out code to enable the on-chip debug port


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk3399_iomux.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/rockchip/rk3399_iomux.c
diff -u src/sys/arch/arm/rockchip/rk3399_iomux.c:1.4 src/sys/arch/arm/rockchip/rk3399_iomux.c:1.5
--- src/sys/arch/arm/rockchip/rk3399_iomux.c:1.4	Tue Apr 30 22:42:32 2019
+++ src/sys/arch/arm/rockchip/rk3399_iomux.c	Tue Aug 20 23:32:33 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_iomux.c,v 1.4 2019/04/30 22:42:32 jmcneill Exp $ */
+/* $NetBSD: rk3399_iomux.c,v 1.5 2019/08/20 23:32:33 tnn Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -29,7 +29,7 @@
 //#define RK3399_IOMUX_DEBUG
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.4 2019/04/30 22:42:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.5 2019/08/20 23:32:33 tnn Exp $");
 
 #include 
 #include 
@@ -450,6 +450,36 @@ rk3399_iomux_match(device_t parent, cfda
 	return of_match_compat_data(faa->faa_phandle, compat_data);
 }
 
+#ifdef RK3399_IOMUX_FORCE_ENABLE_SWJ_DP
+/*
+ * This enables the SWJ-DP (Serial Wire JTAG Debug Port).
+ * If you enable this you must also disable sdhc due to pin conflicts.
+ */
+static void
+rk3399_iomux_force_enable_swj_dp(struct rk3399_iomux_softc * const sc)
+{
+	struct syscon * const syscon = sc->sc_syscon[RK_IOMUX_REGS_GRF];
+	uint32_t val;
+
+	aprint_normal_dev(sc->sc_dev, "enabling on-chip debugging\n");
+#define GRF_GPIO4B_IOMUX	0xe024
+#define GRF_GPIO4B_IOMUX_TCK	__BITS(5,4)
+#define GRF_GPIO4B_IOMUX_TMS	__BITS(7,6)
+#define GRF_SOC_CON7		0xe21c
+#define GRF_SOC_CON7_FORCE_JTAG	__BIT(12)
+	LOCK(syscon);
+	val = RD4(syscon, GRF_GPIO4B_IOMUX);
+	val &= ~(GRF_GPIO4B_IOMUX_TCK | GRF_GPIO4B_IOMUX_TMS);
+	val |= __SHIFTIN(0x2, GRF_GPIO4B_IOMUX_TCK);
+	val |= __SHIFTIN(0x2, GRF_GPIO4B_IOMUX_TMS);
+	WR4(syscon, GRF_GPIO4B_IOMUX, val);
+	val = RD4(syscon, GRF_SOC_CON7);
+	val |= GRF_SOC_CON7_FORCE_JTAG;
+	WR4(syscon, GRF_SOC_CON7, val);
+	UNLOCK(syscon);
+}
+#endif
+
 static void
 rk3399_iomux_attach(device_t parent, device_t self, void *aux)
 {
@@ -492,4 +522,8 @@ rk3399_iomux_attach(device_t parent, dev
 
 		config_found(self, , NULL);
 	}
+
+#ifdef RK3399_IOMUX_FORCE_ENABLE_SWJ_DP
+	rk3399_iomux_force_enable_swj_dp(sc);
+#endif
 }



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

2019-08-20 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 20 23:32:33 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3399_iomux.c

Log Message:
rk3399_iomux: add some #ifdef'd out code to enable the on-chip debug port


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk3399_iomux.c

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



CVS commit: src

2019-08-20 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug 20 21:18:10 UTC 2019

Modified Files:
src/sbin/mount_umap: mount_umap.c
src/sys/miscfs/umapfs: umap.h

Log Message:
Clean up debugging cruft that somehow made it into my previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/mount_umap/mount_umap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/miscfs/umapfs/umap.h

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

Modified files:

Index: src/sbin/mount_umap/mount_umap.c
diff -u src/sbin/mount_umap/mount_umap.c:1.25 src/sbin/mount_umap/mount_umap.c:1.26
--- src/sbin/mount_umap/mount_umap.c:1.25	Tue Aug 20 21:07:21 2019
+++ src/sbin/mount_umap/mount_umap.c	Tue Aug 20 21:18:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_umap.c,v 1.25 2019/08/20 21:07:21 wiz Exp $	*/
+/*	$NetBSD: mount_umap.c,v 1.26 2019/08/20 21:18:10 perseant Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = "@(#)mount_umap.c	8.5 (Berkeley) 4/26/95";
 #else
-__RCSID("$NetBSD: mount_umap.c,v 1.25 2019/08/20 21:07:21 wiz Exp $");
+__RCSID("$NetBSD: mount_umap.c,v 1.26 2019/08/20 21:18:10 perseant Exp $");
 #endif
 #endif /* not lint */
 
@@ -252,10 +252,6 @@ mount_umap(int argc, char *argv[])
 	args.gmapdata = gmapdata;
 	args.fsid = fsid;
 
-	printf("sizeof export_args30 = %d, sizeof layer_args = %d, sizeof umap_args = %d\n",
-		(int)sizeof(struct export_args30),
-		(int)sizeof(struct layer_args),
-		(int)sizeof(struct umap_args));
 	if (mount(MOUNT_UMAP, target, mntflags, , sizeof args) == -1)
 		err(1, "%s on %s", source, target);
 	if (mntflags & MNT_GETARGS) {

Index: src/sys/miscfs/umapfs/umap.h
diff -u src/sys/miscfs/umapfs/umap.h:1.18 src/sys/miscfs/umapfs/umap.h:1.19
--- src/sys/miscfs/umapfs/umap.h:1.18	Tue Aug 20 20:18:54 2019
+++ src/sys/miscfs/umapfs/umap.h	Tue Aug 20 21:18:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: umap.h,v 1.18 2019/08/20 20:18:54 perseant Exp $	*/
+/*	$NetBSD: umap.h,v 1.19 2019/08/20 21:18:10 perseant Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -95,11 +95,11 @@ void umap_mapids(struct mount *v_mount, 
 #define	MOUNTTOUMAPMOUNT(mp) ((struct umap_mount *)((mp)->mnt_data))
 #define	VTOUMAP(vp) ((struct umap_node *)(vp)->v_data)
 #define UMAPTOV(xp) ((xp)->umap_vnode)
-/* #ifdef UMAPFS_DIAGNOSTIC
+#ifdef UMAPFS_DIAGNOSTIC
 #define	UMAPVPTOLOWERVP(vp) layer_checkvp((vp), __FILE__, __LINE__)
-#else */
+#else
 #define	UMAPVPTOLOWERVP(vp) (VTOUMAP(vp)->umap_lowervp)
-/* #endif */
+#endif
 
 extern int (**umap_vnodeop_p)(void *);
 extern struct vfsops umapfs_vfsops;



CVS commit: src

2019-08-20 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug 20 21:18:10 UTC 2019

Modified Files:
src/sbin/mount_umap: mount_umap.c
src/sys/miscfs/umapfs: umap.h

Log Message:
Clean up debugging cruft that somehow made it into my previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/mount_umap/mount_umap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/miscfs/umapfs/umap.h

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



CVS commit: src/sbin/mount_umap

2019-08-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug 20 21:07:21 UTC 2019

Modified Files:
src/sbin/mount_umap: mount_umap.8 mount_umap.c

Log Message:
Sort options in usage.

filesystem -> file system


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/mount_umap/mount_umap.8
cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_umap/mount_umap.c

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

Modified files:

Index: src/sbin/mount_umap/mount_umap.8
diff -u src/sbin/mount_umap/mount_umap.8:1.20 src/sbin/mount_umap/mount_umap.8:1.21
--- src/sbin/mount_umap/mount_umap.8:1.20	Tue Aug 20 20:18:54 2019
+++ src/sbin/mount_umap/mount_umap.8	Tue Aug 20 21:07:21 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount_umap.8,v 1.20 2019/08/20 20:18:54 perseant Exp $
+.\"	$NetBSD: mount_umap.8,v 1.21 2019/08/20 21:07:21 wiz Exp $
 .\"
 .\" Copyright (c) 1992, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -41,8 +41,8 @@
 .Nd user and group ID remapping file system layer
 .Sh SYNOPSIS
 .Nm
-.Op Fl o Ar options
 .Op Fl i Ar fsid
+.Op Fl o Ar options
 .Fl g Ar gid-mapfile
 .Fl u Ar uid-mapfile
 .Ar target
@@ -74,8 +74,8 @@ This flag is required.
 .It Fl i Ar fsid
 Use the specified
 .Ar fsid
-for the filesystem ID, rather than choosing one at random.
-This is useful if the filesystem is to be exported.
+for the file system ID, rather than choosing one at random.
+This is useful if the file system is to be exported.
 .It Fl o
 Options are specified with a
 .Fl o

Index: src/sbin/mount_umap/mount_umap.c
diff -u src/sbin/mount_umap/mount_umap.c:1.24 src/sbin/mount_umap/mount_umap.c:1.25
--- src/sbin/mount_umap/mount_umap.c:1.24	Tue Aug 20 20:18:54 2019
+++ src/sbin/mount_umap/mount_umap.c	Tue Aug 20 21:07:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_umap.c,v 1.24 2019/08/20 20:18:54 perseant Exp $	*/
+/*	$NetBSD: mount_umap.c,v 1.25 2019/08/20 21:07:21 wiz Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = "@(#)mount_umap.c	8.5 (Berkeley) 4/26/95";
 #else
-__RCSID("$NetBSD: mount_umap.c,v 1.24 2019/08/20 20:18:54 perseant Exp $");
+__RCSID("$NetBSD: mount_umap.c,v 1.25 2019/08/20 21:07:21 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -269,6 +269,6 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-"usage: mount_umap [-o options] [-i fsid] -g groupmap -u usermap target_fs mount_point\n");
+"usage: mount_umap [-i fsid] [-o options] -g groupmap -u usermap target_fs mount_point\n");
 	exit(1);
 }



CVS commit: src/sbin/mount_umap

2019-08-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug 20 21:07:21 UTC 2019

Modified Files:
src/sbin/mount_umap: mount_umap.8 mount_umap.c

Log Message:
Sort options in usage.

filesystem -> file system


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/mount_umap/mount_umap.8
cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_umap/mount_umap.c

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



CVS commit: src

2019-08-20 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug 20 20:18:54 UTC 2019

Modified Files:
src/sbin/mount_umap: mount_umap.8 mount_umap.c
src/sys/miscfs/umapfs: umap.h umap_vfsops.c

Log Message:
Allow the user to specify the filesystem ID for umapfs at mount time,
allowing a consistent filesystem ID across reboots.  Closes PR #54471.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/mount_umap/mount_umap.8
cvs rdiff -u -r1.23 -r1.24 src/sbin/mount_umap/mount_umap.c
cvs rdiff -u -r1.17 -r1.18 src/sys/miscfs/umapfs/umap.h
cvs rdiff -u -r1.100 -r1.101 src/sys/miscfs/umapfs/umap_vfsops.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/sysmon

2019-08-20 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 20 18:43:57 UTC 2019

Modified Files:
src/sys/dev/sysmon: sysmon_power.c

Log Message:
Fix info leak, not all of 'pev' is initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/sysmon/sysmon_power.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/sysmon/sysmon_power.c
diff -u src/sys/dev/sysmon/sysmon_power.c:1.60 src/sys/dev/sysmon/sysmon_power.c:1.61
--- src/sys/dev/sysmon/sysmon_power.c:1.60	Fri Mar  1 11:06:56 2019
+++ src/sys/dev/sysmon/sysmon_power.c	Tue Aug 20 18:43:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_power.c,v 1.60 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: sysmon_power.c,v 1.61 2019/08/20 18:43:57 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.60 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.61 2019/08/20 18:43:57 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -331,6 +331,8 @@ sysmon_power_daemon_task(struct power_ev
 	if (!ped || !ped->dict || !pev_data)
 		return EINVAL;
 
+	memset(, 0, sizeof(pev));
+
 	mutex_enter(_power_event_queue_mtx);
 	
 	switch (event) {



CVS commit: src/sys/dev/sysmon

2019-08-20 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 20 18:43:57 UTC 2019

Modified Files:
src/sys/dev/sysmon: sysmon_power.c

Log Message:
Fix info leak, not all of 'pev' is initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/sysmon/sysmon_power.c

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



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

2019-08-20 Thread Kamil Rytarowski
On 07.08.2019 08:28, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Wed Aug  7 06:28:03 UTC 2019
> 
> Modified Files:
>   src/sys/arch/amd64/conf: GENERIC
> 
> Log Message:
> Sync with reality.
> 
> 

Can we enable USER_LDT by default in GENERIC?

> To generate a diff of this commit:
> cvs rdiff -u -r1.532 -r1.533 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.532 
> src/sys/arch/amd64/conf/GENERIC:1.533
> --- src/sys/arch/amd64/conf/GENERIC:1.532 Thu Aug  1 13:48:50 2019
> +++ src/sys/arch/amd64/conf/GENERIC   Wed Aug  7 06:28:03 2019
> @@ -1,4 +1,4 @@
> -# $NetBSD: GENERIC,v 1.532 2019/08/01 13:48:50 msaitoh Exp $
> +# $NetBSD: GENERIC,v 1.533 2019/08/07 06:28:03 maxv 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.532 $"
> +#ident   "GENERIC-$Revision: 1.533 $"
>  
>  maxusers 64  # estimated number of users
>  
> @@ -74,15 +74,12 @@ options   USERCONF# userconf(4) support
>  options  SYSCTL_INCLUDE_DESCR# Include sysctl descriptions in kernel
>  
>  # CPU-related options
> +#options USER_LDT# User-settable LDT, used by Wine
>  options  SVS # Separate Virtual Space
>  makeoptions  SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2
>   # migitation
>  options  SPECTRE_V2_GCC_MITIGATION
>  
> -# USER_LDT. You need to disable SVS to use it.
> -#options USER_LDT# user-settable LDT; used by WINE
> -#no options  SVS
> -
>  # CPU features
>  acpicpu* at cpu? # ACPI CPU (including frequency scaling)
>  coretemp*at cpu? # Intel on-die thermal sensor
> 




signature.asc
Description: OpenPGP digital signature


CVS commit: src/common/lib/libc/hash/murmurhash

2019-08-20 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Tue Aug 20 15:17:02 UTC 2019

Modified Files:
src/common/lib/libc/hash/murmurhash: murmurhash.c

Log Message:
add now required includes for memcpy prototypes analogue to other hash functions

(fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/hash/murmurhash/murmurhash.c

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



CVS commit: src/common/lib/libc/hash/murmurhash

2019-08-20 Thread Lars Reichardt
Module Name:src
Committed By:   para
Date:   Tue Aug 20 15:17:02 UTC 2019

Modified Files:
src/common/lib/libc/hash/murmurhash: murmurhash.c

Log Message:
add now required includes for memcpy prototypes analogue to other hash functions

(fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/hash/murmurhash/murmurhash.c

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

Modified files:

Index: src/common/lib/libc/hash/murmurhash/murmurhash.c
diff -u src/common/lib/libc/hash/murmurhash/murmurhash.c:1.7 src/common/lib/libc/hash/murmurhash/murmurhash.c:1.8
--- src/common/lib/libc/hash/murmurhash/murmurhash.c:1.7	Tue Aug 20 12:33:26 2019
+++ src/common/lib/libc/hash/murmurhash/murmurhash.c	Tue Aug 20 15:17:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $	*/
+/*	$NetBSD: murmurhash.c,v 1.8 2019/08/20 15:17:02 para Exp $	*/
 
 /*
  * MurmurHash2 -- from the original code:
@@ -14,15 +14,19 @@
 #include 
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.8 2019/08/20 15:17:02 para Exp $");
+
+#include 
 
 #else
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $");
+__RCSID("$NetBSD: murmurhash.c,v 1.8 2019/08/20 15:17:02 para Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
+#include 
+
 #endif
 
 #include 



Re: CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Maxime Villard

Le 20/08/2019 à 11:32, Christos Zoulas a écrit :

Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/netbsd32/netbsd32_ioctl.h

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


Pieces of code like this one which touch kernel entry points should go through
proper reviewing because they can cause immense trouble. They should not be
committed and enabled by default blindly like you just did.

Here are my remarks:

1) In compat_drm_agp_info(), seems like it should be info64to32.

2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
st32 which should be set to the values of st64, not the other way around.

3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).

4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
this function it seems.

Etc, that's just after a quick glance. I will disable this code until it
receives proper review.


CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:26:06 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
>From maxv@:

1) In compat_drm_agp_info(), seems like it should be info64to32.
2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
   st32 which should be set to the values of st64, not the other way around.
3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).
4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
   this function it seems.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_drm.c

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



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:26:06 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
>From maxv@:

1) In compat_drm_agp_info(), seems like it should be info64to32.
2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
   st32 which should be set to the values of st64, not the other way around.
3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).
4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
   this function it seems.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_drm.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_drm.c
diff -u src/sys/compat/netbsd32/netbsd32_drm.c:1.2 src/sys/compat/netbsd32/netbsd32_drm.c:1.3
--- src/sys/compat/netbsd32/netbsd32_drm.c:1.2	Tue Aug 20 05:55:49 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 10:26:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */
+/*	$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $");
 
 #include 
 #include 
@@ -338,16 +338,18 @@ compat_drm_getstats(struct file *file, v
 		return error;
 
 	st64.count = st32.count;
+	if (st64.count > __arraycount(st64.data))
+		return EINVAL;
 
 	error = drm_ioctl(file, DRM_IOCTL_GET_STATS, );
 	if (error)
 		return error;
 
-	// XXX: or does that need to be count?
-	for (int i = 0; i < __arraycount(st64.data); ++i) {
-		st64.data[i].value = st32.data[i].value;
-		st64.data[i].type = st32.data[i].type;
+	for (int i = 0; i < st64.count; ++i) {
+		st32.data[i].value = st64.data[i].value;
+		st32.data[i].type = st64.data[i].type;
 	}
+	st32.count = st64.count;
 
 	return copyout(arg, , sizeof(s32));
 }
@@ -565,15 +567,15 @@ compat_drm_dma(struct file *file, void *
 	if ((error = copyin(, arg, sizeof(d32))) != 0)
 		return error;
 
-	dma64to32(, );
+	dma32to64(, );
 
 	error = drm_ioctl(file, DRM_IOCTL_DMA, );
 	if (error)
 		return error;
 
-	dma32to64(, );
+	dma64to32(, );
 
-	return 0;
+	return copyout(arg, , sizeof(d32));
 }
 
 //XXX:i commented the below line for later use
@@ -592,7 +594,7 @@ compat_drm_agp_enable(struct file *file,
 	if ((error = copyin(, arg, sizeof(m32))) != 0)
 		return error;
 
-	m32.mode = m64.mode;
+	m64.mode = m32.mode;
 
 	return drm_ioctl(file, DRM_IOCTL_AGP_ENABLE, );
 }
@@ -612,17 +614,17 @@ typedef struct drm_agp_info32 {
 } drm_agp_info32_t;
 
 static void 
-info32to64(struct drm_agp_info *i64, const drm_agp_info32_t *i32)
+info64to32(drm_agp_info32_t *i32, const struct drm_agp_info *i64)
 {
-	i64->agp_version_major = i32->agp_version_major;
-	i64->agp_version_minor = i32->agp_version_minor;
-	i64->mode = i32->mode;
-	i64->aperture_base = i32->aperture_base;
-	i64->aperture_size = i32->aperture_size;
-	i64->memory_allowed = i32->memory_allowed;
-	i64->memory_used = i64->memory_used;
-	i64->id_vendor = i32->id_vendor;
-	i64->id_device = i32->id_device;
+	i32->agp_version_major = i64->agp_version_major;
+	i32->agp_version_minor = i64->agp_version_minor;
+	i32->mode = i64->mode;
+	i32->aperture_base = i64->aperture_base;
+	i32->aperture_size = i64->aperture_size;
+	i32->memory_allowed = i64->memory_allowed;
+	i32->memory_used = i64->memory_used;
+	i32->id_vendor = i64->id_vendor;
+	i32->id_device = i64->id_device;
 }
 
 static int 
@@ -636,7 +638,7 @@ compat_drm_agp_info(struct file *file, v
 	if (error)
 		return error;
 	
-	info32to64(,);
+	info64to32(, );
 	
 	return copyout(arg, , sizeof(i32));
 



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:12:33 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32

Log Message:
make things compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32

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

Modified files:

Index: src/sys/compat/netbsd32/files.netbsd32
diff -u src/sys/compat/netbsd32/files.netbsd32:1.47 src/sys/compat/netbsd32/files.netbsd32:1.48
--- src/sys/compat/netbsd32/files.netbsd32:1.47	Tue Aug 20 08:25:41 2019
+++ src/sys/compat/netbsd32/files.netbsd32	Tue Aug 20 10:12:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netbsd32,v 1.47 2019/08/20 12:25:41 maxv Exp $
+#	$NetBSD: files.netbsd32,v 1.48 2019/08/20 14:12:33 christos Exp $
 #
 # config file description for machine-independent netbsd32 compat code.
 # included by ports that need it.
@@ -8,7 +8,7 @@
 
 define	compat_netbsd32
 
-makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
+#makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
 
 file	compat/netbsd32/netbsd32_core.c		compat_netbsd32 & coredump
 file	compat/netbsd32/netbsd32_exec_elf32.c	compat_netbsd32 & exec_elf32



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:12:33 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32

Log Message:
make things compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32

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



CVS commit: src/share/man/man4

2019-08-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Aug 20 14:03:56 UTC 2019

Modified Files:
src/share/man/man4: options.4

Log Message:
Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.507 src/share/man/man4/options.4

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



CVS commit: src/share/man/man4

2019-08-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Aug 20 14:03:56 UTC 2019

Modified Files:
src/share/man/man4: options.4

Log Message:
Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.507 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.506 src/share/man/man4/options.4:1.507
--- src/share/man/man4/options.4:1.506	Wed May 22 15:17:48 2019
+++ src/share/man/man4/options.4	Tue Aug 20 14:03:55 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.506 2019/05/22 15:17:48 wiz Exp $
+.\"	$NetBSD: options.4,v 1.507 2019/08/20 14:03:55 gson Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd May 21, 2019
+.Dd August 20, 2019
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -604,9 +604,6 @@ is useful for debugging kernel crash dum
 See
 .Xr gdb 1
 for details.
-This also turns on
-.Em options DEBUG
-(which see).
 .It Cd options DEBUG
 Turns on miscellaneous kernel debugging.
 Since options are turned into preprocessor defines (see above),



CVS commit: src/sys/dev/usb

2019-08-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 20 12:40:19 UTC 2019

Modified Files:
src/sys/dev/usb: xhci.c

Log Message:
typo in error message


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/xhci.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/usb

2019-08-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 20 12:40:19 UTC 2019

Modified Files:
src/sys/dev/usb: xhci.c

Log Message:
typo in error message


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/xhci.c

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

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.107 src/sys/dev/usb/xhci.c:1.108
--- src/sys/dev/usb/xhci.c:1.107	Wed May  8 06:31:02 2019
+++ src/sys/dev/usb/xhci.c	Tue Aug 20 12:40:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.107 2019/05/08 06:31:02 mrg Exp $	*/
+/*	$NetBSD: xhci.c,v 1.108 2019/08/20 12:40:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107 2019/05/08 06:31:02 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.108 2019/08/20 12:40:18 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -790,7 +790,7 @@ xhci_id_protocols(struct xhci_softc *sc,
 	/* Index arrays with 0..n-1 where ports are numbered 1..n */
 	for (size_t cp = cpo - 1; cp < cpo + cpc - 1; cp++) {
 		if (sc->sc_ctlrportmap[cp] != 0) {
-			aprint_error_dev(sc->sc_dev, "contoller port %zu "
+			aprint_error_dev(sc->sc_dev, "controller port %zu "
 			"already assigned", cp);
 			continue;
 		}



CVS commit: src/sys

2019-08-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 20 12:33:05 UTC 2019

Modified Files:
src/sys/arch/amd64/include: param.h
src/sys/arch/i386/include: param.h
src/sys/sys: param.h

Log Message:
New macro ALIGNED_POINTER_LOAD.

To be used with ALIGNED_POINTER(p,t) instead of writing *(const t *)p
directly.  This way, on machines without strict alignment, we can use
memcpy to pacify sanitizers, while getting the same compiled code in
the end with a single (say) MOV instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/i386/include/param.h
cvs rdiff -u -r1.609 -r1.610 src/sys/sys/param.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/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.30 src/sys/arch/amd64/include/param.h:1.31
--- src/sys/arch/amd64/include/param.h:1.30	Sat Mar 16 11:50:48 2019
+++ src/sys/arch/amd64/include/param.h	Tue Aug 20 12:33:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.30 2019/03/16 11:50:48 rin Exp $	*/
+/*	$NetBSD: param.h,v 1.31 2019/08/20 12:33:04 riastradh Exp $	*/
 
 #ifdef __x86_64__
 
@@ -21,7 +21,8 @@
 #define	MACHINE_ARCH	"x86_64"
 #define MID_MACHINE	MID_X86_64
 
-#define ALIGNED_POINTER(p,t)	1
+#define ALIGNED_POINTER(p,t)		1
+#define ALIGNED_POINTER_LOAD(q,p,t)	memcpy((q), (p), sizeof(t))
 
 /*
  * Align stack as required by AMD64 System V ABI. This is because

Index: src/sys/arch/i386/include/param.h
diff -u src/sys/arch/i386/include/param.h:1.84 src/sys/arch/i386/include/param.h:1.85
--- src/sys/arch/i386/include/param.h:1.84	Mon Jan  7 22:00:31 2019
+++ src/sys/arch/i386/include/param.h	Tue Aug 20 12:33:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.84 2019/01/07 22:00:31 jdolecek Exp $	*/
+/*	$NetBSD: param.h,v 1.85 2019/08/20 12:33:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -58,7 +58,8 @@
 #define	MACHINE_ARCH	"i386"
 #define	MID_MACHINE	MID_I386
 
-#define ALIGNED_POINTER(p,t)	1
+#define ALIGNED_POINTER(p,t)		1
+#define ALIGNED_POINTER_LOAD(q,p,t)	memcpy((q), (p), sizeof(t))
 
 #define	PGSHIFT		12		/* LOG2(NBPG) */
 #define	NBPG		(1 << PGSHIFT)	/* bytes/page */

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.609 src/sys/sys/param.h:1.610
--- src/sys/sys/param.h:1.609	Tue Aug 20 06:37:06 2019
+++ src/sys/sys/param.h	Tue Aug 20 12:33:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.609 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.610 2019/08/20 12:33:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -253,9 +253,22 @@
  * any desired pointer type.
  *
  * ALIGNED_POINTER is a boolean macro that checks whether an address
- * is valid to fetch data elements of type t from on this architecture.
- * This does not reflect the optimal alignment, just the possibility
- * (within reasonable limits).
+ * is valid to fetch data elements of type t from on this architecture
+ * using ALIGNED_POINTER_LOAD.  This does not reflect the optimal
+ * alignment, just the possibility (within reasonable limits).
+ *
+ *	uint32_t x;
+ *	unsigned char *p = ...;
+ *
+ *	if (ALIGNED_POINTER(p, uint32_t)) {
+ *		uint32_t t;
+ *		ALIGNED_POINTER_LOAD(, p, uint32_t);
+ *		x = t;
+ *	} else {
+ *		uint32_t t;
+ *		memcpy(, p, sizeof(t));
+ *		x = t;
+ *	}
  *
  */
 #define ALIGNBYTES	__ALIGNBYTES
@@ -265,6 +278,9 @@
 #ifndef ALIGNED_POINTER
 #define	ALIGNED_POINTER(p,t)	uintptr_t)(p)) & (sizeof(t) - 1)) == 0)
 #endif
+#ifndef ALIGNED_POINTER_LOAD
+#define	ALIGNED_POINTER_LOAD(q,p,t)	(*(q) = *((const t *)(p)))
+#endif
 
 /*
  * Historic priority levels.  These are meaningless and remain only



CVS commit: src/common/lib/libc/hash/murmurhash

2019-08-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 20 12:33:26 UTC 2019

Modified Files:
src/common/lib/libc/hash/murmurhash: murmurhash.c

Log Message:
Fix byte order bug in murmurhash and pacify sanitizers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/hash/murmurhash/murmurhash.c

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



CVS commit: src/common/lib/libc/hash/murmurhash

2019-08-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 20 12:33:26 UTC 2019

Modified Files:
src/common/lib/libc/hash/murmurhash: murmurhash.c

Log Message:
Fix byte order bug in murmurhash and pacify sanitizers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/hash/murmurhash/murmurhash.c

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

Modified files:

Index: src/common/lib/libc/hash/murmurhash/murmurhash.c
diff -u src/common/lib/libc/hash/murmurhash/murmurhash.c:1.6 src/common/lib/libc/hash/murmurhash/murmurhash.c:1.7
--- src/common/lib/libc/hash/murmurhash/murmurhash.c:1.6	Sat Oct 26 21:06:38 2013
+++ src/common/lib/libc/hash/murmurhash/murmurhash.c	Tue Aug 20 12:33:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: murmurhash.c,v 1.6 2013/10/26 21:06:38 rmind Exp $	*/
+/*	$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $	*/
 
 /*
  * MurmurHash2 -- from the original code:
@@ -14,12 +14,12 @@
 #include 
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.6 2013/10/26 21:06:38 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $");
 
 #else
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: murmurhash.c,v 1.6 2013/10/26 21:06:38 rmind Exp $");
+__RCSID("$NetBSD: murmurhash.c,v 1.7 2019/08/20 12:33:26 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -51,7 +51,10 @@ murmurhash2(const void *key, size_t len,
 
 	if (__predict_true(ALIGNED_POINTER(key, uint32_t))) {
 		while (len >= sizeof(uint32_t)) {
-			uint32_t k = *(const uint32_t *)data;
+			uint32_t k;
+
+			ALIGNED_POINTER_LOAD(, data, uint32_t);
+			k = htole32(k);
 
 			k *= m;
 			k ^= k >> r;



CVS commit: src/sys

2019-08-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 20 12:33:05 UTC 2019

Modified Files:
src/sys/arch/amd64/include: param.h
src/sys/arch/i386/include: param.h
src/sys/sys: param.h

Log Message:
New macro ALIGNED_POINTER_LOAD.

To be used with ALIGNED_POINTER(p,t) instead of writing *(const t *)p
directly.  This way, on machines without strict alignment, we can use
memcpy to pacify sanitizers, while getting the same compiled code in
the end with a single (say) MOV instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/i386/include/param.h
cvs rdiff -u -r1.609 -r1.610 src/sys/sys/param.h

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



CVS commit: src/distrib

2019-08-20 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Aug 20 12:26:39 UTC 2019

Modified Files:
src/distrib/hpcarm/miniroot: list
src/distrib/hpcmips/miniroot: list
src/distrib/hpcsh/miniroot: list

Log Message:
sysctl(8) is useful to have in the install env when debugging


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/hpcarm/miniroot/list
cvs rdiff -u -r1.18 -r1.19 src/distrib/hpcmips/miniroot/list
cvs rdiff -u -r1.10 -r1.11 src/distrib/hpcsh/miniroot/list

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

Modified files:

Index: src/distrib/hpcarm/miniroot/list
diff -u src/distrib/hpcarm/miniroot/list:1.10 src/distrib/hpcarm/miniroot/list:1.11
--- src/distrib/hpcarm/miniroot/list:1.10	Sat Nov 30 08:27:17 2013
+++ src/distrib/hpcarm/miniroot/list	Tue Aug 20 12:26:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.10 2013/11/30 08:27:17 nakayama Exp $
+#	$NetBSD: list,v 1.11 2019/08/20 12:26:38 sevan Exp $
 
 # extras in bin
 PROG	bin/csh
@@ -13,6 +13,7 @@ PROG	sbin/fdisk
 PROG	sbin/fsck_msdos
 PROG	sbin/mount_msdos
 PROG	sbin/newfs_msdos
+PROG	sbin/sysctl
 
 # extras in /usr.bin
 PROG	usr/bin/netstat

Index: src/distrib/hpcmips/miniroot/list
diff -u src/distrib/hpcmips/miniroot/list:1.18 src/distrib/hpcmips/miniroot/list:1.19
--- src/distrib/hpcmips/miniroot/list:1.18	Sat Nov 30 08:27:17 2013
+++ src/distrib/hpcmips/miniroot/list	Tue Aug 20 12:26:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.18 2013/11/30 08:27:17 nakayama Exp $
+#	$NetBSD: list,v 1.19 2019/08/20 12:26:39 sevan Exp $
 
 # extras in bin
 PROG	bin/csh
@@ -13,6 +13,7 @@ PROG	sbin/fdisk
 PROG	sbin/fsck_msdos
 PROG	sbin/mount_msdos
 PROG	sbin/newfs_msdos
+PROG	sbin/sysctl
 
 # extras in /usr.bin
 PROG	usr/bin/netstat

Index: src/distrib/hpcsh/miniroot/list
diff -u src/distrib/hpcsh/miniroot/list:1.10 src/distrib/hpcsh/miniroot/list:1.11
--- src/distrib/hpcsh/miniroot/list:1.10	Sat Nov 30 08:27:18 2013
+++ src/distrib/hpcsh/miniroot/list	Tue Aug 20 12:26:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.10 2013/11/30 08:27:18 nakayama Exp $
+#	$NetBSD: list,v 1.11 2019/08/20 12:26:38 sevan Exp $
 
 # extras in bin
 #PROG	bin/csh
@@ -13,6 +13,7 @@ PROG	sbin/fdisk
 PROG	sbin/fsck_msdos
 PROG	sbin/mount_msdos
 PROG	sbin/newfs_msdos
+PROG	sbin/sysctl
 
 # extras in /usr.bin
 #PROG	usr/bin/netstat



CVS commit: src/distrib

2019-08-20 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Aug 20 12:26:39 UTC 2019

Modified Files:
src/distrib/hpcarm/miniroot: list
src/distrib/hpcmips/miniroot: list
src/distrib/hpcsh/miniroot: list

Log Message:
sysctl(8) is useful to have in the install env when debugging


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/hpcarm/miniroot/list
cvs rdiff -u -r1.18 -r1.19 src/distrib/hpcmips/miniroot/list
cvs rdiff -u -r1.10 -r1.11 src/distrib/hpcsh/miniroot/list

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



CVS commit: src/sys

2019-08-20 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 20 12:25:41 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32
src/sys/modules/compat_netbsd32: Makefile

Log Message:
Disable netbsd32_drm.c until it receives proper review.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r1.26 -r1.27 src/sys/modules/compat_netbsd32/Makefile

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

2019-08-20 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Aug 20 12:08:17 UTC 2019

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

Log Message:
Give syspkg name to xbase mi files


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/distrib/sets/lists/xbase/mi

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

2019-08-20 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Aug 20 12:08:17 UTC 2019

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

Log Message:
Give syspkg name to xbase mi files


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/distrib/sets/lists/xbase/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/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.153 src/distrib/sets/lists/xbase/mi:1.154
--- src/distrib/sets/lists/xbase/mi:1.153	Tue Aug 13 12:29:00 2019
+++ src/distrib/sets/lists/xbase/mi	Tue Aug 20 12:08:17 2019
@@ -1,11 +1,11 @@
-# $NetBSD: mi,v 1.153 2019/08/13 12:29:00 uki Exp $
+# $NetBSD: mi,v 1.154 2019/08/20 12:08:17 uki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
 ./etc/mtree/set.xbase	xbase-sys-root
 ./usr/X11R7		base-x11-root	xorg
 ./usr/X11R7/bin		base-x11-root	xorg
-./usr/X11R7/bin/Xmark	-unknown-	xorg
+./usr/X11R7/bin/Xmark	xbase-x11perf-bin	xorg
 ./usr/X11R7/bin/appres	xbase-appres-bin	xorg
 ./usr/X11R7/bin/atobm	xbase-bitmap-bin	xorg
 ./usr/X11R7/bin/bdftopcfxbase-bdftopcf-bin	xorg
@@ -14,7 +14,7 @@
 ./usr/X11R7/bin/bitmap	xbase-bitmap-bin	xorg
 ./usr/X11R7/bin/bmtoa	xbase-bitmap-bin	xorg
 ./usr/X11R7/bin/ccmakedepxbase-ccmakedep-bin	xorg
-./usr/X11R7/bin/cleanlinks-unknown-	xorg
+./usr/X11R7/bin/cleanlinksxbase-cleanlinks-bin	xorg
 ./usr/X11R7/bin/ctwm	xbase-ctwm-bin	xorg
 ./usr/X11R7/bin/cxpm	xbase-cxpm-bin	xorg
 ./usr/X11R7/bin/dga	xbase-xf86dga-bin	xorg
@@ -28,7 +28,7 @@
 ./usr/X11R7/bin/fc-queryxbase-fc-query-bin	xorg
 ./usr/X11R7/bin/fc-scan	xbase-fc-scan-bin	xorg
 ./usr/X11R7/bin/fc-validatexbase-fc-validate-bin	xorg
-./usr/X11R7/bin/fillblnk-unknown-	xorg
+./usr/X11R7/bin/fillblnkxbase-x11perf-bin	xorg
 ./usr/X11R7/bin/fonttosfntxbase-fonttosfnt-bin	xorg
 ./usr/X11R7/bin/fslsfontsxbase-fslsfonts-bin	xorg
 ./usr/X11R7/bin/fstobdf	xbase-fstobdf-bin	xorg
@@ -42,16 +42,16 @@
 ./usr/X11R7/bin/lndir	xbase-lndir-bin	xorg
 ./usr/X11R7/bin/luit	xbase-luit-bin	xorg
 ./usr/X11R7/bin/makedependxbase-makedepend-bin	xorg
-./usr/X11R7/bin/makeg	-unknown-	xorg
+./usr/X11R7/bin/makeg	xbase-makeg-bin	xorg
 ./usr/X11R7/bin/makestrsxbase-makestrs-bin	xorg
 ./usr/X11R7/bin/mergelibxbase-mergelib-bin	xorg
-./usr/X11R7/bin/mkdirhier-unknown-	xorg
+./usr/X11R7/bin/mkdirhierxbase-mkdirhier-bin	xorg
 ./usr/X11R7/bin/mkfontdirxbase-mkfontdir-bin	xorg
 ./usr/X11R7/bin/mkfontscalexbase-mkfontscale-tools	xorg
 ./usr/X11R7/bin/mkhtmlindexxbase-mkhtmlindex-bin	xorg
 ./usr/X11R7/bin/oclock	xbase-oclock-bin	xorg
-./usr/X11R7/bin/perfboth-unknown-	xorg
-./usr/X11R7/bin/perfratio-unknown-	xorg
+./usr/X11R7/bin/perfbothxbase-x11perf-bin	xorg
+./usr/X11R7/bin/perfratioxbase-x11perf-bin	xorg
 ./usr/X11R7/bin/proxymngrxbase-proxymngr-bin	xorg
 ./usr/X11R7/bin/resize	xbase-xterm-bin	xorg
 ./usr/X11R7/bin/revpath	xbase-revpath-bin	xorg
@@ -65,7 +65,7 @@
 ./usr/X11R7/bin/transsetxbase-transset-bin	xorg
 ./usr/X11R7/bin/twm	xbase-twm-bin	xorg
 ./usr/X11R7/bin/ucs2any	xbase-ucs2any-tools	xorg
-./usr/X11R7/bin/uxterm	-unknown-	xorg
+./usr/X11R7/bin/uxterm	xbase-xterm-bin	xorg
 ./usr/X11R7/bin/viewres	xbase-viewres-bin	xorg
 ./usr/X11R7/bin/x11perf	xbase-x11perf-bin	xorg
 ./usr/X11R7/bin/x11perfcompxbase-x11perf-bin	xorg
@@ -167,96 +167,96 @@
 ./usr/X11R7/include/X11/extensions			base-x11-root	xorg
 ./usr/X11R7/include/X11/fontsbase-x11-root	xorg
 ./usr/X11R7/include/X11/pixmapsbase-x11-root	xorg
-./usr/X11R7/include/X11/pixmaps/NetBSD-bw.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/NetBSD-bw.xpm		xbase-x11-bin	xorg
 ./usr/X11R7/include/X11/pixmaps/NetBSD-flag.png		xbase-xdm-bin	xorg
-./usr/X11R7/include/X11/pixmaps/NetBSD-flag1.xpm	-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm	-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/NetBSD-inv.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/NetBSD.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/NetBSD-flag1.xpm	xbase-x11-bin	xorg
+./usr/X11R7/include/X11/pixmaps/NetBSD-flag2.xpm	xbase-x11-bin	xorg
+./usr/X11R7/include/X11/pixmaps/NetBSD-inv.xpm		xbase-x11-bin	xorg
+./usr/X11R7/include/X11/pixmaps/NetBSD.xpm		xbase-x11-bin	xorg
 ./usr/X11R7/include/X11/pixmaps/ctwmbase-x11-root	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Expand15.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Iconify15.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Lightning15.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Menu15.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Resize15.xpm		-unknown-	xorg
-./usr/X11R7/include/X11/pixmaps/ctwm/3D_Zoom15.xpm		-unknown-	xorg

CVS commit: [netbsd-9] src/doc

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:46:44 UTC 2019

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

Log Message:
Tickets #99 - #102


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 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.24 src/doc/CHANGES-9.0:1.1.2.25
--- src/doc/CHANGES-9.0:1.1.2.24	Mon Aug 19 16:12:04 2019
+++ src/doc/CHANGES-9.0	Tue Aug 20 11:46:44 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.24 2019/08/19 16:12:04 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.25 2019/08/20 11:46:44 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2106,3 +2106,27 @@ tests/net/if/t_ifconfig.sh			1.21
 	otherwise subsequent ioctls will not work. Add a test for this.
 	[ozaki-r, ticket #98]
 
+sys/arch/x86/pci/if_vmx.c			1.46-1.48
+
+	vmx(4):
+	- uses interrupt distribution for each queue like ixg(4).
+	- fix panic when detaching.
+	- add basic statistics counters.
+	[knakahara, ticket #99]
+
+external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c 1.5
+
+	zfs: fix pools on wedges.
+	[hannken, ticket #100]
+
+external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c 1.12
+
+	Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.
+	[hannken, ticket #101]
+
+external/cddl/osnet/sys/kern/taskq.c		1.11
+
+	task_executor: prevent use after free, the task function may free
+	the tasq entry.
+	[hannken, ticket #102]
+



CVS commit: [netbsd-9] src/doc

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:46:44 UTC 2019

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

Log Message:
Tickets #99 - #102


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 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/external/cddl/osnet/sys/kern

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:45:35 UTC 2019

Modified Files:
src/external/cddl/osnet/sys/kern [netbsd-9]: taskq.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #102):

external/cddl/osnet/sys/kern/taskq.c: revision 1.11

task_executor: prevent use after free, the task function may free
the tasq entry.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.2.1 src/external/cddl/osnet/sys/kern/taskq.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/external/cddl/osnet/sys/kern

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:45:35 UTC 2019

Modified Files:
src/external/cddl/osnet/sys/kern [netbsd-9]: taskq.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #102):

external/cddl/osnet/sys/kern/taskq.c: revision 1.11

task_executor: prevent use after free, the task function may free
the tasq entry.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.2.1 src/external/cddl/osnet/sys/kern/taskq.c

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

Modified files:

Index: src/external/cddl/osnet/sys/kern/taskq.c
diff -u src/external/cddl/osnet/sys/kern/taskq.c:1.10 src/external/cddl/osnet/sys/kern/taskq.c:1.10.2.1
--- src/external/cddl/osnet/sys/kern/taskq.c:1.10	Tue Jun 11 09:05:33 2019
+++ src/external/cddl/osnet/sys/kern/taskq.c	Tue Aug 20 11:45:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: taskq.c,v 1.10 2019/06/11 09:05:33 hannken Exp $	*/
+/*	$NetBSD: taskq.c,v 1.10.2.1 2019/08/20 11:45:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,6 +75,7 @@ task_executor(struct threadpool_job *job
 	struct taskq_executor *state = (struct taskq_executor *)job;
 	taskq_t *tq = state->te_self;
 	taskq_ent_t *tqe; 
+	bool is_dynamic;
 	int error;
 
 	lwp_setspecific(taskq_lwp_key, tq);
@@ -97,13 +98,14 @@ task_executor(struct threadpool_job *job
 		tqe = SIMPLEQ_FIRST(>tq_list);
 		KASSERT(tqe != NULL);
 		SIMPLEQ_REMOVE_HEAD(>tq_list, tqent_list);
+		is_dynamic = tqe->tqent_dynamic;
 		tqe->tqent_queued = 0;
 		mutex_exit(>tq_lock);
 
 		(*tqe->tqent_func)(tqe->tqent_arg);
 
 		mutex_enter(>tq_lock);
-		if (tqe->tqent_dynamic)
+		if (is_dynamic)
 			kmem_free(tqe, sizeof(*tqe));
 		tq->tq_active--;
 	}



CVS commit: [netbsd-9] src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:44:15 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: vdev_disk.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #101):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.12

Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.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/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:44:15 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: vdev_disk.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #101):

external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.12

Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11.2.1
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11	Wed Jun 12 04:20:18 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c	Tue Aug 20 11:44:14 2019
@@ -220,23 +220,33 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 	}
 
 	/* XXXNETBSD Once tls-maxphys gets merged this block becomes:
-		pdk = disk_find_blk(vp->v_rdev);
+		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0)
+			pdk = disk_find(dkw.dkw_parent);
+		else
+			pdk = disk_find_blk(vp->v_rdev);
 		dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS);
 	*/
 	{
 		struct buf buf = { .b_bcount = MAXPHYS };
-		const char *dev_name;
 
-		dev_name = devsw_blk2name(major(vp->v_rdev));
-		if (dev_name) {
-			char disk_name[16];
-
-			snprintf(disk_name, sizeof(disk_name), "%s%d",
-			dev_name, DISKUNIT(vp->v_rdev));
-			pdk = disk_find(disk_name);
-			if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
-(*pdk->dk_driver->d_minphys)();
+		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0) {
+			pdk = disk_find(dkw.dkw_parent);
+		} else {
+			const char *dev_name;
+
+			dev_name = devsw_blk2name(major(vp->v_rdev));
+			if (dev_name) {
+char disk_name[16];
+
+snprintf(disk_name, sizeof(disk_name), "%s%d",
+dev_name, DISKUNIT(vp->v_rdev));
+pdk = disk_find(disk_name);
+			} else {
+pdk = NULL;
+			}
 		}
+		if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
+			(*pdk->dk_driver->d_minphys)();
 		dvd->vd_maxphys = buf.b_bcount;
 	}
 



CVS commit: [netbsd-9] src/external/cddl/osnet/dist/lib/libzfs/common

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:42:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common [netbsd-9]:
libzfs_import.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #100):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.5

Always open the raw block devices as "" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c

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

Modified files:

Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c
diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.4 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.4.4.1
--- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.4	Mon May 28 21:05:06 2018
+++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c	Tue Aug 20 11:42:35 2019
@@ -1262,9 +1262,7 @@ zpool_find_import_impl(libzfs_handle_t *
 			static const char mib_name[] = "hw.disknames";
 			size_t len;
 			char *disknames, *last, *name;
-			char part;
 
-			part = getrawpartition();
 			if (sysctlbyname(mib_name, NULL, , NULL, 0) == -1) {
 zfs_error_aux(hdl, strerror(errno));
 (void) zfs_error_fmt(hdl, EZFS_BADPATH,
@@ -1277,11 +1275,10 @@ zpool_find_import_impl(libzfs_handle_t *
 			disknames = zfs_alloc(hdl, len + 2);
 			(void)sysctlbyname(mib_name, disknames, , NULL, 0);
 
-
 			for ((name = strtok_r(disknames, " ", )); name;
 			(name = strtok_r(NULL, " ", ))) {
 slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
-slice->rn_name = zfs_asprintf(hdl, "%s%c", name, 'a' + part);
+slice->rn_name = zfs_strdup(hdl, name);
 slice->rn_avl = _cache;
 slice->rn_dfd = dfd;
 slice->rn_hdl = hdl;



CVS commit: [netbsd-9] src/external/cddl/osnet/dist/lib/libzfs/common

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:42:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common [netbsd-9]:
libzfs_import.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #100):

external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c: revision 1.5

Always open the raw block devices as "" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c

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



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

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:31:46 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #99):

sys/arch/x86/pci/if_vmx.c: revision 1.46
sys/arch/x86/pci/if_vmx.c: revision 1.47
sys/arch/x86/pci/if_vmx.c: revision 1.48

vmx(4) uses interrupt distribution for each queue like ixg(4).

fix panic when vmx(4) is detached.

add vmx(4) basic statistics counters.
Sorry, I have forgotten this TODO in r1.40 commit message.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.2.1 src/sys/arch/x86/pci/if_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/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.45 src/sys/arch/x86/pci/if_vmx.c:1.45.2.1
--- src/sys/arch/x86/pci/if_vmx.c:1.45	Tue Jul 30 11:16:15 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Tue Aug 20 11:31:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.45 2019/07/30 11:16:15 knakahara Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.45.2.1 2019/08/20 11:31:46 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.45 2019/07/30 11:16:15 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.45.2.1 2019/08/20 11:31:46 martin Exp $");
 
 #include 
 #include 
@@ -31,6 +31,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -199,6 +200,13 @@ struct vmxnet3_txqueue {
 	char vxtxq_name[16];
 
 	void *vxtxq_si;
+
+	struct evcnt vxtxq_intr;
+	struct evcnt vxtxq_defer;
+	struct evcnt vxtxq_deferreq;
+	struct evcnt vxtxq_pcqdrop;
+	struct evcnt vxtxq_transmitdef;
+	struct evcnt vxtxq_watchdogto;
 };
 
 struct vmxnet3_rxq_stats {
@@ -218,6 +226,10 @@ struct vmxnet3_rxqueue {
 	struct vmxnet3_rxq_stats vxrxq_stats;
 	struct vmxnet3_rxq_shared *vxrxq_rs;
 	char vxrxq_name[16];
+
+	struct evcnt vxrxq_intr;
+	struct evcnt vxrxq_defer;
+	struct evcnt vxrxq_deferreq;
 };
 
 struct vmxnet3_queue {
@@ -270,6 +282,12 @@ struct vmxnet3_softc {
 	int vmx_max_rxsegs;
 
 	struct vmxnet3_statistics vmx_stats;
+	struct evcnt vmx_event_intr;
+	struct evcnt vmx_event_link;
+	struct evcnt vmx_event_txqerror;
+	struct evcnt vmx_event_rxqerror;
+	struct evcnt vmx_event_dic;
+	struct evcnt vmx_event_debug;
 
 	int vmx_intr_type;
 	int vmx_intr_mask_mode;
@@ -348,6 +366,9 @@ void vmxnet3_set_interrupt_idx(struct vm
 int vmxnet3_setup_interrupts(struct vmxnet3_softc *);
 int vmxnet3_setup_sysctl(struct vmxnet3_softc *);
 
+int vmxnet3_setup_stats(struct vmxnet3_softc *);
+void vmxnet3_teardown_stats(struct vmxnet3_softc *);
+
 int vmxnet3_init_rxq(struct vmxnet3_softc *, int);
 int vmxnet3_init_txq(struct vmxnet3_softc *, int);
 int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *);
@@ -630,6 +651,10 @@ vmxnet3_attach(device_t parent, device_t
 	if (error)
 		return;
 
+	error = vmxnet3_setup_stats(sc);
+	if (error)
+		return;
+
 	sc->vmx_flags |= VMXNET3_FLAG_ATTACHED;
 }
 
@@ -654,6 +679,7 @@ vmxnet3_detach(device_t self, int flags)
 		if_detach(ifp);
 	}
 
+	vmxnet3_teardown_stats(sc);
 	sysctl_teardown(>vmx_sysctllog);
 
 	vmxnet3_free_interrupts(sc);
@@ -858,11 +884,13 @@ vmxnet3_free_interrupts(struct vmxnet3_s
 	int i;
 
 	workqueue_destroy(sc->vmx_queue_wq);
-	for (i = 0; i < sc->vmx_nintrs; i++) {
+	for (i = 0; i < sc->vmx_ntxqueues; i++) {
 		struct vmxnet3_queue *vmxq =  >vmx_queue[i];
 
 		softint_disestablish(vmxq->vxq_si);
 		vmxq->vxq_si = NULL;
+	}
+	for (i = 0; i < sc->vmx_nintrs; i++) {
 		pci_intr_disestablish(pc, sc->vmx_ihs[i]);
 	}
 	pci_intr_release(pc, sc->vmx_intrs, sc->vmx_nintrs);
@@ -876,6 +904,7 @@ vmxnet3_setup_msix_interrupts(struct vmx
 	pci_intr_handle_t *intr;
 	void **ihs;
 	int intr_idx, i, use_queues, error;
+	kcpuset_t *affinity;
 	const char *intrstr;
 	char intrbuf[PCI_INTRSTR_LEN];
 	char xnamebuf[32];
@@ -903,6 +932,16 @@ vmxnet3_setup_msix_interrupts(struct vmx
 		}
 		aprint_normal_dev(sc->vmx_dev, "txrx interrupting at %s\n", intrstr);
 
+		kcpuset_create(, true);
+		kcpuset_set(affinity, intr_idx % ncpu);
+		error = interrupt_distribute(*ihs, affinity, NULL);
+		if (error) {
+			aprint_normal_dev(sc->vmx_dev,
+			"%s cannot be changed affinity, use default CPU\n",
+			intrstr);
+		}
+		kcpuset_destroy(affinity);
+
 		vmxq->vxq_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
 		vmxnet3_handle_queue, vmxq);
 		if (vmxq->vxq_si == NULL) {
@@ -1909,6 +1948,93 @@ out:
 	return error;
 }
 
+int
+vmxnet3_setup_stats(struct vmxnet3_softc *sc)
+{
+	struct vmxnet3_queue *vmxq;
+	struct vmxnet3_txqueue *txq;
+	struct vmxnet3_rxqueue *rxq;
+	int i;
+
+	for (i = 0; i < sc->vmx_ntxqueues; i++) {
+		vmxq = >vmx_queue[i];
+		txq = >vxq_txqueue;
+		evcnt_attach_dynamic(>vxtxq_intr, EVCNT_TYPE_INTR,
+		   

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

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 11:31:46 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #99):

sys/arch/x86/pci/if_vmx.c: revision 1.46
sys/arch/x86/pci/if_vmx.c: revision 1.47
sys/arch/x86/pci/if_vmx.c: revision 1.48

vmx(4) uses interrupt distribution for each queue like ixg(4).

fix panic when vmx(4) is detached.

add vmx(4) basic statistics counters.
Sorry, I have forgotten this TODO in r1.40 commit message.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.2.1 src/sys/arch/x86/pci/if_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/net

2019-08-20 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Aug 20 10:59:00 UTC 2019

Modified Files:
src/sys/net: if.c

Log Message:
if: announce flag changes other than up or down

For example toggling promiscuous mode or disabling ARP.

XXX Pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 src/sys/net/if.c

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



CVS commit: src/sys/net

2019-08-20 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Aug 20 10:59:00 UTC 2019

Modified Files:
src/sys/net: if.c

Log Message:
if: announce flag changes other than up or down

For example toggling promiscuous mode or disabling ARP.

XXX Pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.458 src/sys/net/if.c:1.459
--- src/sys/net/if.c:1.458	Thu Aug 15 04:20:59 2019
+++ src/sys/net/if.c	Tue Aug 20 10:59:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.458 2019/08/15 04:20:59 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.459 2019/08/20 10:59:00 roy Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.458 2019/08/15 04:20:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.459 2019/08/20 10:59:00 roy Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2914,6 +2914,7 @@ ifioctl_common(struct ifnet *ifp, u_long
 	struct ifreq *ifr;
 	struct ifcapreq *ifcr;
 	struct ifdatareq *ifdr;
+	unsigned short flags;
 
 	switch (cmd) {
 	case SIOCSIFCAP:
@@ -2985,8 +2986,13 @@ ifioctl_common(struct ifnet *ifp, u_long
 			splx(s);
 		}
 		KERNEL_UNLOCK_IF_IFP_MPSAFE(ifp);
-		ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
-			(ifr->ifr_flags &~ IFF_CANTCHANGE);
+		flags = (ifp->if_flags & IFF_CANTCHANGE) |
+		(ifr->ifr_flags &~ IFF_CANTCHANGE);
+		if (ifp->if_flags != flags) {
+			ifp->if_flags = flags;
+			/* Notify that the flags have changed. */
+			rt_ifmsg(ifp);
+		}
 		break;
 	case SIOCGIFFLAGS:
 		ifr = data;



Re: CVS commit: src/tests/net

2019-08-20 Thread Ryota Ozaki
On Tue, Aug 20, 2019 at 6:58 PM Martin Husemann  wrote:
>
> On Tue, Aug 20, 2019 at 06:50:31PM +0900, Ryota Ozaki wrote:
> > Hmm, okay, I'm going to disable the feature until the issue is addressed.
>
> Could it be page size related?

I'm not sure.

My fresh chroot environment for ATF tests on amd64 also fails so
I guess I'm missing something important :-/

Anyway I disabled the feature in -current for now.

  ozaki-r


Re: CVS commit: src/tests/net

2019-08-20 Thread Martin Husemann
On Tue, Aug 20, 2019 at 06:50:31PM +0900, Ryota Ozaki wrote:
> Hmm, okay, I'm going to disable the feature until the issue is addressed.

Could it be page size related?

Martin


CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:55:49 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
add NetBSD copyright.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_drm.c

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



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:55:49 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
add NetBSD copyright.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_drm.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_drm.c
diff -u src/sys/compat/netbsd32/netbsd32_drm.c:1.1 src/sys/compat/netbsd32/netbsd32_drm.c:1.2
--- src/sys/compat/netbsd32/netbsd32_drm.c:1.1	Tue Aug 20 05:32:21 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 05:55:49 2019
@@ -1,6 +1,9 @@
-/*	$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */
+/*	$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */
 
 /*
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
  * This code was written by Surya Shankar for GSoC 2019.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $");
 
 #include 
 #include 



CVS commit: src/tests/net

2019-08-20 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Aug 20 09:53:45 UTC 2019

Modified Files:
src/tests/net: net_common.sh

Log Message:
Disable rump_server_check_memleaks for now

It doesn't work in some cases.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/net/net_common.sh

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

Modified files:

Index: src/tests/net/net_common.sh
diff -u src/tests/net/net_common.sh:1.34 src/tests/net/net_common.sh:1.35
--- src/tests/net/net_common.sh:1.34	Mon Aug 19 03:22:47 2019
+++ src/tests/net/net_common.sh	Tue Aug 20 09:53:45 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: net_common.sh,v 1.34 2019/08/19 03:22:47 ozaki-r Exp $
+#	$NetBSD: net_common.sh,v 1.35 2019/08/20 09:53:45 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -350,7 +350,8 @@ rump_server_check_poolleaks()
 rump_server_check_memleaks()
 {
 
-	rump_server_check_poolleaks llentrypl
+	# XXX this doesn't work in some cases for unknown reasons
+	#rump_server_check_poolleaks llentrypl
 	# This doesn't work for objects allocated through pool_cache
 	#rump_server_check_poolleaks mbpl
 	#rump_server_check_poolleaks mclpl



CVS commit: src/tests/net

2019-08-20 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Aug 20 09:53:45 UTC 2019

Modified Files:
src/tests/net: net_common.sh

Log Message:
Disable rump_server_check_memleaks for now

It doesn't work in some cases.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/net/net_common.sh

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



Re: CVS commit: src/tests/net

2019-08-20 Thread Ryota Ozaki
On Tue, Aug 20, 2019 at 6:35 PM Martin Husemann  wrote:
>
> On Tue, Aug 20, 2019 at 07:53:28AM +0200, Martin Husemann wrote:
> > On Tue, Aug 20, 2019 at 11:21:08AM +0900, Ryota Ozaki wrote:
> > > Is it an issue specific to sparc64?
> >
> > No, same happens on (big endian) arm. Endianess issue?
> > I'll do a little endian arm run today.
>
> Nope, evbarm fails the same:
>
> net/if_bridge/t_rtable (484/833): 6 test cases
> bridge_rtable_basic: [10.960250s] Failed: $target$reqs != $target$rels 
> (llentrypl10 != llentrypl6)
> bridge_rtable_delete_member: [14.861957s] Failed: $target$reqs != 
> $target$rels (llentrypl10 != llentrypl6)
> bridge_rtable_flush: [13.062212s] Failed: $target$reqs != $target$rels 
> (llentrypl10 != llentrypl6)
> bridge_rtable_manyaddrs: [131.755625s] Failed: $target$reqs != 
> $target$rels (llentrypl10 != llentrypl6)
> bridge_rtable_maxaddr: [11.661263s] Failed: $target$reqs != $target$rels 
> (llentrypl10 != llentrypl6)
> bridge_rtable_timeout: [11.652307s] Failed: $target$reqs != $target$rels 
> (llentrypl10 != llentrypl6)
> [194.004564s]

Hmm, okay, I'm going to disable the feature until the issue is addressed.

  ozaki-r


CVS commit: src/sys/modules/compat_netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:36:41 UTC 2019

Modified Files:
src/sys/modules/compat_netbsd32: Makefile

Log Message:
Add netbsd32 drm support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/modules/compat_netbsd32/Makefile

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

Modified files:

Index: src/sys/modules/compat_netbsd32/Makefile
diff -u src/sys/modules/compat_netbsd32/Makefile:1.25 src/sys/modules/compat_netbsd32/Makefile:1.26
--- src/sys/modules/compat_netbsd32/Makefile:1.25	Mon Jun 17 21:40:29 2019
+++ src/sys/modules/compat_netbsd32/Makefile	Tue Aug 20 05:36:40 2019
@@ -1,17 +1,33 @@
-#	$NetBSD: Makefile,v 1.25 2019/06/18 01:40:29 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2019/08/20 09:36:40 christos Exp $
 
 .include "../Makefile.inc"
 .include "../Makefile.assym"
 
 KMOD=	compat_netbsd32
 
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+NETBSD32_DRMKMS?=yes
+.endif
+
 CPPFLAGS+=	-DCOMPAT_NETBSD32
 CPPFLAGS+=	-DEXEC_ELF32 -DEXEC_ELF64
 CPPFLAGS+=	-DCOREDUMP -DNTP -DVMSWAP
 CPPFLAGS+=	-DKTRACE -DMODULAR -DQUOTA
 CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
 
+.if ${NETBSD32_DRMKMS:Uno} == "yes"
+CPPFLAGS+=	-DNETBSD32_DRMKMS
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/common/include
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/drm2/include
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/drm2/dist
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/drm2/dist/include
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/drm2/dist/uapi
+.endif
+
 .PATH:	${S}/compat/netbsd32
+.if ${NETBSD32_DRMKMS:Uno} == "yes"
+SRCS+=	netbsd32_drm.c
+.endif
 SRCS+=	netbsd32_core.c		netbsd32_event.c
 SRCS+=	netbsd32_exec_elf32.c	netbsd32_execve.c
 SRCS+=	netbsd32_fd.c		netbsd32_fs.c



CVS commit: src/sys/modules/compat_netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:36:41 UTC 2019

Modified Files:
src/sys/modules/compat_netbsd32: Makefile

Log Message:
Add netbsd32 drm support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/modules/compat_netbsd32/Makefile

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



Re: CVS commit: src/tests/net

2019-08-20 Thread Martin Husemann
On Tue, Aug 20, 2019 at 07:53:28AM +0200, Martin Husemann wrote:
> On Tue, Aug 20, 2019 at 11:21:08AM +0900, Ryota Ozaki wrote:
> > Is it an issue specific to sparc64?
> 
> No, same happens on (big endian) arm. Endianess issue?
> I'll do a little endian arm run today.

Nope, evbarm fails the same:

net/if_bridge/t_rtable (484/833): 6 test cases
bridge_rtable_basic: [10.960250s] Failed: $target$reqs != $target$rels 
(llentrypl10 != llentrypl6)
bridge_rtable_delete_member: [14.861957s] Failed: $target$reqs != 
$target$rels (llentrypl10 != llentrypl6)
bridge_rtable_flush: [13.062212s] Failed: $target$reqs != $target$rels 
(llentrypl10 != llentrypl6)
bridge_rtable_manyaddrs: [131.755625s] Failed: $target$reqs != $target$rels 
(llentrypl10 != llentrypl6)
bridge_rtable_maxaddr: [11.661263s] Failed: $target$reqs != $target$rels 
(llentrypl10 != llentrypl6)
bridge_rtable_timeout: [11.652307s] Failed: $target$reqs != $target$rels 
(llentrypl10 != llentrypl6)
[194.004564s]

Martin


CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/files.netbsd32
diff -u src/sys/compat/netbsd32/files.netbsd32:1.45 src/sys/compat/netbsd32/files.netbsd32:1.46
--- src/sys/compat/netbsd32/files.netbsd32:1.45	Mon Jun 17 21:36:50 2019
+++ src/sys/compat/netbsd32/files.netbsd32	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netbsd32,v 1.45 2019/06/18 01:36:50 christos Exp $
+#	$NetBSD: files.netbsd32,v 1.46 2019/08/20 09:32:21 christos Exp $
 #
 # config file description for machine-independent netbsd32 compat code.
 # included by ports that need it.
@@ -7,10 +7,14 @@
 # own file lists.
 
 define	compat_netbsd32
+
+makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
+
 file	compat/netbsd32/netbsd32_core.c		compat_netbsd32 & coredump
 file	compat/netbsd32/netbsd32_exec_elf32.c	compat_netbsd32 & exec_elf32
 file	compat/netbsd32/netbsd32_exec_aout.c	compat_netbsd32 & exec_aout
 file	compat/netbsd32/netbsd32_netbsd.c	compat_netbsd32
+file	compat/netbsd32/netbsd32_drm.c		compat_netbsd32 & drmkms
 file	compat/netbsd32/netbsd32_event.c	compat_netbsd32
 file	compat/netbsd32/netbsd32_execve.c	compat_netbsd32
 file	compat/netbsd32/netbsd32_fd.c		compat_netbsd32

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103	Fri May 17 03:37:12 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1517,6 +1517,12 @@ netbsd32_ioctl(struct lwp *l,
 		IOCTL_STRUCT_CONV_TO(DIOCLWEDGES, dkwedge_list);
 
 	default:
+#ifdef NETBSD32_DRMKMS
+		if (IOCGROUP(com) == 'd') {
+			error = netbsd32_drm_ioctl(fp, com, data32, l);
+			break;
+		}
+#endif
 #ifdef NETBSD32_MD_IOCTL
 		error = netbsd32_md_ioctl(fp, com, data32, l);
 #else

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.68
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67	Fri May 17 03:37:12 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.67 2019/05/17 07:37:12 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.68 2019/08/20 09:32:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -36,6 +36,9 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 /* we define some handy macros here... */
@@ -624,3 +627,5 @@ struct netbsd32_disk_strategy {
 
 #define DIOCGSTRATEGY32		_IOR('d', 125, struct netbsd32_disk_strategy)
 #define DIOCSSTRATEGY32		_IOW('d', 126, struct netbsd32_disk_strategy)
+
+int	netbsd32_drm_ioctl(struct file *, unsigned long, void *, struct lwp *);

Added files:

Index: src/sys/compat/netbsd32/netbsd32_drm.c
diff -u /dev/null src/sys/compat/netbsd32/netbsd32_drm.c:1.1
--- /dev/null	Tue Aug 20 05:32:21 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 05:32:21 2019
@@ -0,0 +1,974 @@
+/*	$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */
+
+/*
+ * This code was written by Surya Shankar for GSoC 2019.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 

CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/netbsd32/netbsd32_ioctl.h

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



CVS commit: src/sys/net80211

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:28:00 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_ioctl.h

Log Message:
Include  for IFNAMSIZ


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/net80211/ieee80211_ioctl.h

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



CVS commit: src/sys/net80211

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:28:00 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_ioctl.h

Log Message:
Include  for IFNAMSIZ


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/net80211/ieee80211_ioctl.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/net80211/ieee80211_ioctl.h
diff -u src/sys/net80211/ieee80211_ioctl.h:1.25 src/sys/net80211/ieee80211_ioctl.h:1.26
--- src/sys/net80211/ieee80211_ioctl.h:1.25	Sat Jan 26 21:08:48 2019
+++ src/sys/net80211/ieee80211_ioctl.h	Tue Aug 20 05:28:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_ioctl.h,v 1.25 2019/01/27 02:08:48 pgoyette Exp $	*/
+/*	$NetBSD: ieee80211_ioctl.h,v 1.26 2019/08/20 09:28:00 christos Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -39,6 +39,7 @@
  * IEEE 802.11 ioctls.
  */
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/external/cddl/osnet/sys/kern

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:12:50 UTC 2019

Modified Files:
src/external/cddl/osnet/sys/kern: taskq.c

Log Message:
task_executor: prevent use after free, the task function may free
the tasq entry.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/sys/kern/taskq.c

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



CVS commit: src/external/cddl/osnet/sys/kern

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:12:50 UTC 2019

Modified Files:
src/external/cddl/osnet/sys/kern: taskq.c

Log Message:
task_executor: prevent use after free, the task function may free
the tasq entry.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/cddl/osnet/sys/kern/taskq.c

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

Modified files:

Index: src/external/cddl/osnet/sys/kern/taskq.c
diff -u src/external/cddl/osnet/sys/kern/taskq.c:1.10 src/external/cddl/osnet/sys/kern/taskq.c:1.11
--- src/external/cddl/osnet/sys/kern/taskq.c:1.10	Tue Jun 11 09:05:33 2019
+++ src/external/cddl/osnet/sys/kern/taskq.c	Tue Aug 20 08:12:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: taskq.c,v 1.10 2019/06/11 09:05:33 hannken Exp $	*/
+/*	$NetBSD: taskq.c,v 1.11 2019/08/20 08:12:50 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,6 +75,7 @@ task_executor(struct threadpool_job *job
 	struct taskq_executor *state = (struct taskq_executor *)job;
 	taskq_t *tq = state->te_self;
 	taskq_ent_t *tqe; 
+	bool is_dynamic;
 	int error;
 
 	lwp_setspecific(taskq_lwp_key, tq);
@@ -97,13 +98,14 @@ task_executor(struct threadpool_job *job
 		tqe = SIMPLEQ_FIRST(>tq_list);
 		KASSERT(tqe != NULL);
 		SIMPLEQ_REMOVE_HEAD(>tq_list, tqent_list);
+		is_dynamic = tqe->tqent_dynamic;
 		tqe->tqent_queued = 0;
 		mutex_exit(>tq_lock);
 
 		(*tqe->tqent_func)(tqe->tqent_arg);
 
 		mutex_enter(>tq_lock);
-		if (tqe->tqent_dynamic)
+		if (is_dynamic)
 			kmem_free(tqe, sizeof(*tqe));
 		tq->tq_active--;
 	}



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:12:14 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: vdev_disk.c

Log Message:
Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.12
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.11	Wed Jun 12 04:20:18 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c	Tue Aug 20 08:12:14 2019
@@ -220,23 +220,33 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 	}
 
 	/* XXXNETBSD Once tls-maxphys gets merged this block becomes:
-		pdk = disk_find_blk(vp->v_rdev);
+		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0)
+			pdk = disk_find(dkw.dkw_parent);
+		else
+			pdk = disk_find_blk(vp->v_rdev);
 		dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS);
 	*/
 	{
 		struct buf buf = { .b_bcount = MAXPHYS };
-		const char *dev_name;
 
-		dev_name = devsw_blk2name(major(vp->v_rdev));
-		if (dev_name) {
-			char disk_name[16];
-
-			snprintf(disk_name, sizeof(disk_name), "%s%d",
-			dev_name, DISKUNIT(vp->v_rdev));
-			pdk = disk_find(disk_name);
-			if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
-(*pdk->dk_driver->d_minphys)();
+		if (VOP_IOCTL(vp, DIOCGWEDGEINFO, , FREAD, NOCRED) == 0) {
+			pdk = disk_find(dkw.dkw_parent);
+		} else {
+			const char *dev_name;
+
+			dev_name = devsw_blk2name(major(vp->v_rdev));
+			if (dev_name) {
+char disk_name[16];
+
+snprintf(disk_name, sizeof(disk_name), "%s%d",
+dev_name, DISKUNIT(vp->v_rdev));
+pdk = disk_find(disk_name);
+			} else {
+pdk = NULL;
+			}
 		}
+		if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
+			(*pdk->dk_driver->d_minphys)();
 		dvd->vd_maxphys = buf.b_bcount;
 	}
 



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:12:14 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: vdev_disk.c

Log Message:
Rearrange the evaluation of "dvd_maxphys" so it works for wedges too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c

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



CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:11:21 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_import.c

Log Message:
Always open the raw block devices as "" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c

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

Modified files:

Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c
diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.4 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.5
--- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.4	Mon May 28 21:05:06 2018
+++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c	Tue Aug 20 08:11:21 2019
@@ -1262,9 +1262,7 @@ zpool_find_import_impl(libzfs_handle_t *
 			static const char mib_name[] = "hw.disknames";
 			size_t len;
 			char *disknames, *last, *name;
-			char part;
 
-			part = getrawpartition();
 			if (sysctlbyname(mib_name, NULL, , NULL, 0) == -1) {
 zfs_error_aux(hdl, strerror(errno));
 (void) zfs_error_fmt(hdl, EZFS_BADPATH,
@@ -1277,11 +1275,10 @@ zpool_find_import_impl(libzfs_handle_t *
 			disknames = zfs_alloc(hdl, len + 2);
 			(void)sysctlbyname(mib_name, disknames, , NULL, 0);
 
-
 			for ((name = strtok_r(disknames, " ", )); name;
 			(name = strtok_r(NULL, " ", ))) {
 slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
-slice->rn_name = zfs_asprintf(hdl, "%s%c", name, 'a' + part);
+slice->rn_name = zfs_strdup(hdl, name);
 slice->rn_avl = _cache;
 slice->rn_dfd = dfd;
 slice->rn_hdl = hdl;



CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common

2019-08-20 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 20 08:11:21 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_import.c

Log Message:
Always open the raw block devices as "" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c

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



CVS commit: src/usr.sbin/sysinst

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 06:38:18 UTC 2019

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

Log Message:
PR install/54480: when upgrading a system and re-mounting the target /
with proper options, and the installed system does not use NAME= syntax
in fstab(5), use the device name we used to get here, instead of the
name from fstab, it might be different to what the real system calls the
device (compact flash root showing up as wd0 native, but sd? on the
card reader used for updating it right now).

This is an abuse of the upgrade functionality and in general pretty dangerous
when multiple devices are used in the upgraded fstab (e.g. separate /usr),
and it used to work more by accident with the old code.

However, it is a quite usefull way to upgrade tiny systems with compact flash
root, and it used to work - so support it properly (as far as we can).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/disks.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/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.50 src/usr.sbin/sysinst/disks.c:1.51
--- src/usr.sbin/sysinst/disks.c:1.50	Thu Aug  8 13:45:19 2019
+++ src/usr.sbin/sysinst/disks.c	Tue Aug 20 06:38:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.50 2019/08/08 13:45:19 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.51 2019/08/20 06:38:17 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1484,12 +1484,14 @@ process_found_fs(struct data *list, size
 	const char *fsname = (const char*)item->var;
 	part_id pno;
 	struct disk_partitions *parts;
-	bool first;
+	size_t len;
+	bool first, is_root;
 
 	if (num < 2 || strstr(list[2].u.s_val, "noauto") != NULL)
 		return 0;
 
-	if ((strcmp(list[1].u.s_val, "/") == 0) && target_mounted())
+	is_root = strcmp(list[1].u.s_val, "/") == 0;
+	if (is_root && target_mounted())
 		return 0;
 
 	if (strcmp(item->head, name_prefix) == 0) {
@@ -1502,11 +1504,36 @@ process_found_fs(struct data *list, size
 		parts->pscheme->get_part_device(parts, pno,
 		rdev, sizeof(rdev), NULL, raw_dev_name, true);
 	} else {
-		/* plain device name */
-		strcpy(rdev, "/dev/r");
-		strlcat(rdev, list[0].u.s_val, sizeof(rdev));
-		strcpy(dev, "/dev/");
-		strlcat(dev, list[0].u.s_val, sizeof(dev));
+		/* this fstab entry uses the plain device name */
+		if (is_root) {
+			/*
+			 * PR 54480: we can not use the current device name
+			 * as it might be different from the real environment.
+			 * This is an abuse of the functionality, but it used
+			 * to work before (and still does work if only a single
+			 * target disk is involved).
+			 * Use the device name from the current "pm" instead.
+			 */
+			strcpy(rdev, "/dev/r");
+			strlcat(rdev, pm->diskdev, sizeof(rdev));
+			strcpy(dev, "/dev/");
+			strlcat(dev, pm->diskdev, sizeof(dev));
+			/* copy over the partition letter, if any */
+			len = strlen(list[0].u.s_val);
+			if (list[0].u.s_val[len-1] >= 'a' &&
+			list[0].u.s_val[len-1] <=
+			('a' + getmaxpartitions())) {
+strlcat(rdev, [0].u.s_val[len-1],
+sizeof(rdev));
+strlcat(dev, [0].u.s_val[len-1],
+sizeof(dev));
+			}
+		} else {
+			strcpy(rdev, "/dev/r");
+			strlcat(rdev, list[0].u.s_val, sizeof(rdev));
+			strcpy(dev, "/dev/");
+			strlcat(dev, list[0].u.s_val, sizeof(dev));
+		}
 	}
 
 	if (with_fsck) {



CVS commit: src/usr.sbin/sysinst

2019-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 20 06:38:18 UTC 2019

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

Log Message:
PR install/54480: when upgrading a system and re-mounting the target /
with proper options, and the installed system does not use NAME= syntax
in fstab(5), use the device name we used to get here, instead of the
name from fstab, it might be different to what the real system calls the
device (compact flash root showing up as wd0 native, but sd? on the
card reader used for updating it right now).

This is an abuse of the upgrade functionality and in general pretty dangerous
when multiple devices are used in the upgraded fstab (e.g. separate /usr),
and it used to work more by accident with the old code.

However, it is a quite usefull way to upgrade tiny systems with compact flash
root, and it used to work - so support it properly (as far as we can).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/sysinst/disks.c

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



CVS commit: src/sys

2019-08-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 20 06:37:06 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_cue.c if_kue.c
if_mue.c if_smsc.c if_udav.c if_upl.c if_ure.c if_url.c if_urndis.c
usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
couple more changes to usbnet(9):

- MII read/write reg return int instead of usbd_status (requested by skrll)
- usbnet_attach_ifp(9) changes arg, two mii-specific flags are placed by a
  pointer to new struct usbnet_mii.  if not NULL, then attach an MII to this
  interface like previous have_mii parameter.  use this to allow ure(4) to
  properly pass PHY location to mii_attach().

welcome netbsd 9.99.10.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/if_axen.c src/sys/dev/usb/if_upl.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/usb/if_kue.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_urndis.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.608 -r1.609 src/sys/sys/param.h

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.117 src/sys/dev/usb/if_axe.c:1.118
--- src/sys/dev/usb/if_axe.c:1.117	Mon Aug 19 07:33:37 2019
+++ src/sys/dev/usb/if_axe.c	Tue Aug 20 06:37:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.117 2019/08/19 07:33:37 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.118 2019/08/20 06:37:06 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.117 2019/08/19 07:33:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.118 2019/08/20 06:37:06 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -259,8 +259,8 @@ CFATTACH_DECL_NEW(axe, sizeof(struct axe
 static void	axe_stop(struct ifnet *, int);
 static int	axe_ioctl(struct ifnet *, u_long, void *);
 static int	axe_init(struct ifnet *);
-static usbd_status axe_mii_read_reg(struct usbnet *, int, int, uint16_t *);
-static usbd_status axe_mii_write_reg(struct usbnet *, int, int, uint16_t);
+static int	axe_mii_read_reg(struct usbnet *, int, int, uint16_t *);
+static int	axe_mii_write_reg(struct usbnet *, int, int, uint16_t);
 static void	axe_mii_statchg(struct ifnet *);
 static void	axe_rx_loop(struct usbnet *, struct usbnet_chain *, uint32_t);
 static unsigned axe_tx_prepare(struct usbnet *, struct mbuf *,
@@ -313,7 +313,7 @@ axe_cmd(struct axe_softc *sc, int cmd, i
 	return err;
 }
 
-static usbd_status
+static int
 axe_mii_read_reg(struct usbnet *un, int phy, int reg, uint16_t *val)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
@@ -324,7 +324,7 @@ axe_mii_read_reg(struct usbnet *un, int 
 	DPRINTFN(30, "phy 0x%jx reg 0x%jx\n", phy, reg, 0, 0);
 
 	if (un->un_phyno != phy)
-		return USBD_INVAL;
+		return EINVAL;
 
 	axe_cmd(sc, AXE_CMD_MII_OPMODE_SW, 0, 0, NULL);
 
@@ -333,7 +333,7 @@ axe_mii_read_reg(struct usbnet *un, int 
 
 	if (err) {
 		aprint_error_dev(un->un_dev, "read PHY failed\n");
-		return err;
+		return EIO;
 	}
 
 	*val = le16toh(data);
@@ -349,10 +349,10 @@ axe_mii_read_reg(struct usbnet *un, int 
 
 	DPRINTFN(30, "phy 0x%jx reg 0x%jx val %#jx", phy, reg, *val, 0);
 
-	return USBD_NORMAL_COMPLETION;
+	return 0;
 }
 
-static usbd_status
+static int
 axe_mii_write_reg(struct usbnet *un, int phy, int reg, uint16_t val)
 {
 	struct axe_softc * const sc = usbnet_softc(un);
@@ -360,7 +360,7 @@ axe_mii_write_reg(struct usbnet *un, int
 	uint16_t aval;
 
 	if (un->un_phyno != phy)
-		return USBD_INVAL;
+		return EINVAL;
 
 	aval = htole16(val);
 
@@ -368,7 +368,9 @@ axe_mii_write_reg(struct usbnet *un, int
 	err = axe_cmd(sc, AXE_CMD_MII_WRITE_REG, reg, phy, );
 	axe_cmd(sc, AXE_CMD_MII_OPMODE_HW, 0, 0, NULL);
 
-	return err;
+	if (err)
+		return EIO;
+	return 0;
 }
 
 static void
@@ -861,6 +863,7 @@ void
 axe_attach(device_t parent, device_t self, void *aux)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
+	UBSNET_MII_DECL_DEFAULT(unm);
 	struct axe_softc *sc = device_private(self);
 	struct usbnet * const un = >axe_un;
 	struct usb_attach_arg *uaa = aux;
@@ -1009,8 +1012,9 @@ axe_attach(device_t parent, device_t sel
 		adv_pause = 0;
 	adv_pause = 0;
 
-	usbnet_attach_ifp(un, true, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST,
-	0, adv_pause);
+	unm.un_mii_flags = adv_pause;
+	usbnet_attach_ifp(un, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST,
+	0, );
 }
 
 

CVS commit: src/sys

2019-08-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 20 06:37:06 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_cue.c if_kue.c
if_mue.c if_smsc.c if_udav.c if_upl.c if_ure.c if_url.c if_urndis.c
usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
couple more changes to usbnet(9):

- MII read/write reg return int instead of usbd_status (requested by skrll)
- usbnet_attach_ifp(9) changes arg, two mii-specific flags are placed by a
  pointer to new struct usbnet_mii.  if not NULL, then attach an MII to this
  interface like previous have_mii parameter.  use this to allow ure(4) to
  properly pass PHY location to mii_attach().

welcome netbsd 9.99.10.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/if_axen.c src/sys/dev/usb/if_upl.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/usb/if_kue.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_urndis.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.608 -r1.609 src/sys/sys/param.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/usb

2019-08-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 20 06:18:54 UTC 2019

Modified Files:
src/sys/dev/usb: usbnet.c

Log Message:
properly fix the kernhist calls.

one must cast and cast and cast and maybe a fish will be caught...


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/usb/usbnet.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/usb

2019-08-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 20 06:18:54 UTC 2019

Modified Files:
src/sys/dev/usb: usbnet.c

Log Message:
properly fix the kernhist calls.

one must cast and cast and cast and maybe a fish will be caught...


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/usb/usbnet.c

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

Modified files:

Index: src/sys/dev/usb/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.20 src/sys/dev/usb/usbnet.c:1.21
--- src/sys/dev/usb/usbnet.c:1.20	Mon Aug 19 07:33:37 2019
+++ src/sys/dev/usb/usbnet.c	Tue Aug 20 06:18:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.20 2019/08/19 07:33:37 mrg Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.21 2019/08/20 06:18:54 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.20 2019/08/19 07:33:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.21 2019/08/20 06:18:54 mrg Exp $");
 
 #include 
 #include 
@@ -277,7 +277,7 @@ usbnet_input(struct usbnet * const un, u
 
 	usbnet_isowned_rx(un);
 	DPRINTFN(0, "called! un %jx buf %jx len %ju",
-	(uintmax_t)un, (uintmax_t)buf, buflen, 0);
+	(uintmax_t)(uintptr_t)un, (uintmax_t)(uintptr_t)buf, buflen, 0);
 
 	m = usbnet_newbuf(buflen);
 	if (m == NULL) {