CVS commit: src/sys/arch/xen/xen

2018-10-07 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Oct  8 05:42:45 UTC 2018

Modified Files:
src/sys/arch/xen/xen: pciback.c xpci_xenbus.c

Log Message:
Convert the last remaining users of event_set_handler() to
intr_establish_xname(,_pic,...)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/xen/xpci_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/pciback.c
diff -u src/sys/arch/xen/xen/pciback.c:1.14 src/sys/arch/xen/xen/pciback.c:1.15
--- src/sys/arch/xen/xen/pciback.c:1.14	Sun Jun 24 20:15:00 2018
+++ src/sys/arch/xen/xen/pciback.c	Mon Oct  8 05:42:44 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: pciback.c,v 1.14 2018/06/24 20:15:00 jdolecek Exp $  */
+/*  $NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $  */
 
 /*
  * Copyright (c) 2009 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.14 2018/06/24 20:15:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -188,6 +188,7 @@ struct pb_xenbus_instance {
 	struct pciback_pci_devlist pbx_pb_pci_dev; /* list of exported PCI devices */
 	/* communication with the domU */
 unsigned int pbx_evtchn; /* our even channel */
+	struct intrhand *pbx_ih;
 struct xen_pci_sharedinfo *pbx_sh_info;
 struct xen_pci_op op;
 grant_handle_t pbx_shinfo_handle; /* to unmap shared page */
@@ -524,9 +525,7 @@ pciback_xenbus_destroy(void *arg)
 	int err;
 
 	hypervisor_mask_event(pbxi->pbx_evtchn);
-	event_remove_handler(pbxi->pbx_evtchn,
-	pciback_xenbus_evthandler, pbxi);
-
+	intr_disestablish(pbxi->pbx_ih);
 	mutex_enter(_xenbus_lock);
 	SLIST_REMOVE(_xenbus_instances,
 	pbxi, pb_xenbus_instance, pbx_next);
@@ -620,8 +619,9 @@ pciback_xenbus_frontend_changed(void *ar
 		x86_sfence();
 		xenbus_switch_state(xbusd, NULL, XenbusStateConnected);
 		x86_sfence();
-		event_set_handler(pbxi->pbx_evtchn, pciback_xenbus_evthandler,
-		pbxi, IPL_BIO, "pciback", "pciback"); // XXX intr info?
+		pbxi->pbx_ih = intr_establish_xname(0, _pic, pbxi->pbx_evtchn, IST_LEVEL, IPL_BIO,
+		pciback_xenbus_evthandler, pbxi, true, "pciback");
+		KASSERT(pbxi->pbx_ih != NULL);
 		hypervisor_enable_event(pbxi->pbx_evtchn);
 		hypervisor_notify_via_evtchn(pbxi->pbx_evtchn);
 		break;

Index: src/sys/arch/xen/xen/xpci_xenbus.c
diff -u src/sys/arch/xen/xen/xpci_xenbus.c:1.18 src/sys/arch/xen/xen/xpci_xenbus.c:1.19
--- src/sys/arch/xen/xen/xpci_xenbus.c:1.18	Sun Aug 19 01:33:26 2018
+++ src/sys/arch/xen/xen/xpci_xenbus.c	Mon Oct  8 05:42:45 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: xpci_xenbus.c,v 1.18 2018/08/19 01:33:26 riastradh Exp $  */
+/*  $NetBSD: xpci_xenbus.c,v 1.19 2018/10/08 05:42:45 cherry Exp $  */
 
 /*
  * Copyright (c) 2009 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.18 2018/08/19 01:33:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.19 2018/10/08 05:42:45 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -188,8 +188,9 @@ xpci_xenbus_resume(void *p)
 	aprint_verbose_dev(sc->sc_dev, "using event channel %d\n",
 	sc->sc_evtchn);
 #if 0
-	event_set_handler(sc->sc_evtchn, _handler, sc,
-	IPL_BIO, device_xname(sc->sc_dev));
+	intr_establish_xname(0, _pic, pbxi->pbx_evtchn, IST_LEVEL,
+	IPL_BIO, _handler, sc, true,
+	device_xname(sc->sc_dev));
 #endif
 
 again:



CVS commit: src/bin/sh

2018-10-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct  7 23:17:52 UTC 2018

Modified Files:
src/bin/sh: alias.c

Log Message:
When listing aliases, sort them alphabetically.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/bin/sh/alias.c

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

Modified files:

Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.16 src/bin/sh/alias.c:1.17
--- src/bin/sh/alias.c:1.16	Mon Jul 24 12:34:45 2017
+++ src/bin/sh/alias.c	Sun Oct  7 23:17:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: alias.c,v 1.16 2017/07/24 12:34:45 kre Exp $	*/
+/*	$NetBSD: alias.c,v 1.17 2018/10/07 23:17:52 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.16 2017/07/24 12:34:45 kre Exp $");
+__RCSID("$NetBSD: alias.c,v 1.17 2018/10/07 23:17:52 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -58,6 +58,8 @@ __RCSID("$NetBSD: alias.c,v 1.16 2017/07
 struct alias *atab[ATABSIZE];
 
 STATIC void setalias(char *, char *);
+STATIC int by_name(const void *, const void *);
+STATIC void list_aliases(void);
 STATIC int unalias(char *);
 STATIC struct alias **hashalias(const char *);
 
@@ -204,9 +206,47 @@ alias_text(void *dummy __unused, const c
 	return ap->val;
 }
 
-/*
- * TODO - sort output
- */
+STATIC int
+by_name(const void *a, const void *b)
+{
+
+	return strcmp(
+		(*(const struct alias * const *)a)->name,
+		(*(const struct alias * const *)b)->name);
+}
+
+STATIC void
+list_aliases(void)
+{
+	size_t i, j, n;
+	const struct alias **aliases;
+	const struct alias *ap;
+
+	n = 0;
+	for (i = 0; i < ATABSIZE; i++)
+		for (ap = atab[i]; ap != NULL; ap = ap->next)
+			if (ap->name[0] != '\0')
+n++;
+
+	aliases = ckmalloc(n * sizeof aliases[0]);
+
+	j = 0;
+	for (i = 0; i < ATABSIZE; i++)
+		for (ap = atab[i]; ap != NULL; ap = ap->next)
+			if (ap->name[0] != '\0')
+aliases[j++] = ap;
+
+	qsort(aliases, n, sizeof aliases[0], by_name);
+
+	for (i = 0; i < n; i++) {
+		out1fmt("alias %s=", aliases[i]->name);
+		print_quoted(aliases[i]->val);
+		out1c('\n');
+	}
+
+	ckfree(aliases);
+}
+
 int
 aliascmd(int argc, char **argv)
 {
@@ -215,18 +255,10 @@ aliascmd(int argc, char **argv)
 	struct alias *ap;
 
 	if (argc == 1) {
-		int i;
-
-		for (i = 0; i < ATABSIZE; i++)
-			for (ap = atab[i]; ap; ap = ap->next) {
-if (*ap->name != '\0') {
-	out1fmt("alias %s=", ap->name);
-	print_quoted(ap->val);
-	out1c('\n');
-}
-			}
+		list_aliases();
 		return (0);
 	}
+
 	while ((n = *++argv) != NULL) {
 		if ((v = strchr(n+1, '=')) == NULL) { /* n+1: funny ksh stuff */
 			if ((ap = lookupalias(n, 0)) == NULL) {



CVS commit: src/usr.sbin/vnconfig

2018-10-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct  7 20:30:50 UTC 2018

Modified Files:
src/usr.sbin/vnconfig: vnconfig.8 vnconfig.c

Log Message:
Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/vnconfig/vnconfig.8
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/vnconfig/vnconfig.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/vnconfig/vnconfig.8
diff -u src/usr.sbin/vnconfig/vnconfig.8:1.44 src/usr.sbin/vnconfig/vnconfig.8:1.45
--- src/usr.sbin/vnconfig/vnconfig.8:1.44	Sun Oct  7 11:51:26 2018
+++ src/usr.sbin/vnconfig/vnconfig.8	Sun Oct  7 20:30:50 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vnconfig.8,v 1.44 2018/10/07 11:51:26 mlelstv Exp $
+.\"	$NetBSD: vnconfig.8,v 1.45 2018/10/07 20:30:50 wiz Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -70,7 +70,7 @@
 .Sh SYNOPSIS
 .Nm
 .\" Fcf:lm:rt:uvz
-.Op Fl crivz
+.Op Fl cirvz
 .Op Fl f Ar disktab
 .Op Fl t Ar typename
 .Ar vnode_disk
@@ -144,6 +144,9 @@ option should look up in
 .Ar disktab
 instead of in
 .Pa /etc/disktab .
+.It Fl i
+Configure the device to use regular file I/O even when direct I/O using
+bmap/strategy would be possible.
 .It Fl l
 List the vnd devices and indicate which ones are in use.
 If one or more specific
@@ -168,9 +171,6 @@ is set to 0,
 then only vnd devices currently in use will be shown.
 .It Fl r
 Configure the device as read-only.
-.It Fl i
-Configure the device to use regular file I/O even when direct I/O using
-bmap/strategy would be possible.
 .It Fl t Ar typename
 If configuring the device, look up
 .Ar typename

Index: src/usr.sbin/vnconfig/vnconfig.c
diff -u src/usr.sbin/vnconfig/vnconfig.c:1.47 src/usr.sbin/vnconfig/vnconfig.c:1.48
--- src/usr.sbin/vnconfig/vnconfig.c:1.47	Sun Oct  7 11:51:26 2018
+++ src/usr.sbin/vnconfig/vnconfig.c	Sun Oct  7 20:30:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnconfig.c,v 1.47 2018/10/07 11:51:26 mlelstv Exp $	*/
+/*	$NetBSD: vnconfig.c,v 1.48 2018/10/07 20:30:50 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -432,7 +432,7 @@ usage(void)
 {
 	const char *p = getprogname();
 	(void)fprintf(stderr, 
-	"Usage: %s [-crivz] [-f dsktab] [-t type] vnode_disk"
+	"Usage: %s [-cirvz] [-f dsktab] [-t type] vnode_disk"
 		" reg-file [geomspec]\n"
 	"   %s -u [-Fv] vnode_disk\n"
 	"   %s -l [-m num | vnode_disk...]\n", p, p, p);



CVS commit: src/sys/dev/scsipi

2018-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  7 18:14:32 UTC 2018

Modified Files:
src/sys/dev/scsipi: scsiconf.c scsipiconf.h sd.c

Log Message:
Handle the SATA to USB external enclosure sold by "Sabrent" and
made by JMicro (vendor=0x152d product=0x0578). This bridge does
not understand FUA, so add a quirk for it.


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.128 -r1.129 src/sys/dev/scsipi/scsipiconf.h
cvs rdiff -u -r1.325 -r1.326 src/sys/dev/scsipi/sd.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.281 src/sys/dev/scsipi/scsiconf.c:1.282
--- src/sys/dev/scsipi/scsiconf.c:1.281	Sat Sep  1 03:20:29 2018
+++ src/sys/dev/scsipi/scsiconf.c	Sun Oct  7 14:14:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.281 2018/09/01 07:20:29 mlelstv Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.282 2018/10/07 18:14:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.281 2018/09/01 07:20:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.282 2018/10/07 18:14:32 christos Exp $");
 
 #include 
 #include 
@@ -631,6 +631,8 @@ static const struct scsi_quirk_inquiry_p
 	 ""	   , "DFRSS2F",		 ""},	  PQUIRK_AUTOSAVE},
 	{{T_DIRECT, T_FIXED,
 	 "Initio  ", "",		 ""},	  PQUIRK_NOBIGMODESENSE},
+	{{T_DIRECT, T_FIXED,
+	 "JMicron ", "Generic ", ""},	  PQUIRK_NOFUA},
 	{{T_DIRECT, T_REMOV,
 	 "MPL ", "MC-DISK-", ""}, PQUIRK_NOLUNS},
 	{{T_DIRECT, T_FIXED,

Index: src/sys/dev/scsipi/scsipiconf.h
diff -u src/sys/dev/scsipi/scsipiconf.h:1.128 src/sys/dev/scsipi/scsipiconf.h:1.129
--- src/sys/dev/scsipi/scsipiconf.h:1.128	Sat Sep  1 03:20:29 2018
+++ src/sys/dev/scsipi/scsipiconf.h	Sun Oct  7 14:14:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipiconf.h,v 1.128 2018/09/01 07:20:29 mlelstv Exp $	*/
+/*	$NetBSD: scsipiconf.h,v 1.129 2018/10/07 18:14:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -478,6 +478,7 @@ struct scsipi_periph {
 #define PQUIRK_CAP_WIDE16	0x0010	/* SCSI device with ST wide op*/
 #define PQUIRK_CAP_NODT		0x0020	/* signals DT, but can't. */
 #define PQUIRK_START		0x0040	/* needs start before tur */
+#define	PQUIRK_NOFUA		0x0080	/* does not grok FUA */
 
 
 /*

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.325 src/sys/dev/scsipi/sd.c:1.326
--- src/sys/dev/scsipi/sd.c:1.325	Sat Jun 17 18:35:50 2017
+++ src/sys/dev/scsipi/sd.c	Sun Oct  7 14:14:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.325 2017/06/17 22:35:50 mlelstv Exp $	*/
+/*	$NetBSD: sd.c,v 1.326 2018/10/07 18:14:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.325 2017/06/17 22:35:50 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.326 2018/10/07 18:14:32 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -655,6 +655,7 @@ sd_diskstart(device_t dev, struct buf *b
 	struct scsipi_xfer *xs;
 	int error, flags, nblks, cmdlen;
 	int cdb_flags;
+	bool havefua = !(periph->periph_quirks & PQUIRK_NOFUA);
 
 	mutex_enter(chan_mtx(chan));
 
@@ -703,12 +704,13 @@ sd_diskstart(device_t dev, struct buf *b
 	 * selection, as 6-byte CDB doesn't support the flags.
 	 */
 	cdb_flags = 0;
+	if (havefua) {
+		if (bp->b_flags & B_MEDIA_FUA)
+			cdb_flags |= SRWB_FUA;
 
-	if (bp->b_flags & B_MEDIA_FUA)
-		cdb_flags |= SRWB_FUA;
-
-	if (bp->b_flags & B_MEDIA_DPO)
-		cdb_flags |= SRWB_DPO;
+		if (bp->b_flags & B_MEDIA_DPO)
+			cdb_flags |= SRWB_DPO;
+	}
 
 	/*
 	 * Fill out the scsi command.  Use the smallest CDB possible
@@ -1846,7 +1848,8 @@ sd_getcache(struct sd_softc *sd, int *bi
 	 * Support for FUA/DPO, defined starting with SCSI-2. Use only
 	 * if device claims to support it, according to the MODE SENSE.
 	 */
-	if (ISSET(dev_spec, SMH_DSP_DPOFUA))
+	if (!(periph->periph_quirks & PQUIRK_NOFUA) &&
+	ISSET(dev_spec, SMH_DSP_DPOFUA))
 		bits |= DKCACHE_FUA | DKCACHE_DPO;
 
 	memset(_sense, 0, sizeof(scsipi_sense));



CVS commit: src/distrib/common/bootimage

2018-10-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  7 18:07:00 UTC 2018

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Support .tar.xz sets


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.17 src/distrib/common/bootimage/Makefile.bootimage:1.18
--- src/distrib/common/bootimage/Makefile.bootimage:1.17	Sat Feb 11 08:08:00 2017
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Oct  7 18:07:00 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.17 2017/02/11 08:08:00 pgoyette Exp $
+#	$NetBSD: Makefile.bootimage,v 1.18 2018/10/07 18:07:00 martin Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -217,6 +217,7 @@ WORKFSTAB?=	work.fstab
 WORKRCCONF?=	work.rc.conf
 WORKFS?=work.rootfs
 TARGETFS?=  imgroot.fs
+TAR_SUFF=	${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz}
 
 CLEANFILES+=	${WORKSPEC} ${WORKFSTAB} ${WORKRCCONF} ${WORKFS}
 CLEANFILES+=	${TARGETFS}
@@ -231,12 +232,12 @@ ${TARGETFS}: prepare_md_post
 	fi;
 	@${MKDIR} ${MKDIRPERM} ${WORKDIR}
 .for set in ${IMG_SETS}
-	@if [ ! -f ${SETS_DIR}/${set}.tgz ]; then 			\
-		echo "Missing ${SETS_DIR}/${set}.tgz, aborting";	\
+	@if [ ! -f ${SETS_DIR}/${set}.${TAR_SUFF} ]; then 		\
+		echo "Missing ${SETS_DIR}/${set}.${TAR_SUFF}, aborting";\
 		false; 			\
 	fi
-	@echo Extracting ${set}.tgz ...
-	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.tgz .)
+	@echo Extracting ${set}.${TAR_SUFF} ...
+	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.${TAR_SUFF} .)
 .endfor
 .if defined(SECONDARY_BOOT)
 	@echo Copying secondary boot...



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

2018-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct  7 18:03:59 UTC 2018

Modified Files:
src/sys/arch/aarch64/conf: kern.ldscript

Log Message:
Don't use a magic number for COHERENCY_UNIT use COHERENCY_UNIT


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/conf/kern.ldscript

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

Modified files:

Index: src/sys/arch/aarch64/conf/kern.ldscript
diff -u src/sys/arch/aarch64/conf/kern.ldscript:1.9 src/sys/arch/aarch64/conf/kern.ldscript:1.10
--- src/sys/arch/aarch64/conf/kern.ldscript:1.9	Mon Sep 10 17:25:21 2018
+++ src/sys/arch/aarch64/conf/kern.ldscript	Sun Oct  7 18:03:59 2018
@@ -42,17 +42,17 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(64);	/* COHERENCY_UNIT */
+	. = ALIGN(COHERENCY_UNIT);
 	.data.cacheline_aligned :
 	{
 		*(.data.cacheline_aligned)
 	}
-	. = ALIGN(64);	/* COHERENCY_UNIT */
+	. = ALIGN(COHERENCY_UNIT);
 	.data.read_mostly :
 	{
 		*(.data.read_mostly)
 	}
-	. = ALIGN(64);	/* COHERENCY_UNIT */
+	. = ALIGN(COHERENCY_UNIT);
 
 	_edata = .;
 	PROVIDE (edata = .);



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

2018-10-07 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sun Oct  7 16:36:36 UTC 2018

Modified Files:
src/sys/arch/x86/x86: i8259.c ioapic.c

Log Message:
In the case of a shared GSI, bind will fail, so we do not attempt this.
The sharing is accomplished by demultiplexing the port event of the first
bind. This is accomplished in intr.c:intr_establish_xname()

Note that the pic_delroute() is buggy (commented suitably) for the shared
gsi case, since it will unbind reset it unconditionally, leaving the other
shared callbacks stranded.

This problem will go awaywhen we unify further with native code, as this
case is taken care of appropriately in that case.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/i8259.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/x86/ioapic.c

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

Modified files:

Index: src/sys/arch/x86/x86/i8259.c
diff -u src/sys/arch/x86/x86/i8259.c:1.19 src/sys/arch/x86/x86/i8259.c:1.20
--- src/sys/arch/x86/x86/i8259.c:1.19	Sun Oct  7 05:28:51 2018
+++ src/sys/arch/x86/x86/i8259.c	Sun Oct  7 16:36:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i8259.c,v 1.19 2018/10/07 05:28:51 cherry Exp $	*/
+/*	$NetBSD: i8259.c,v 1.20 2018/10/07 16:36:36 cherry Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i8259.c,v 1.19 2018/10/07 05:28:51 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i8259.c,v 1.20 2018/10/07 16:36:36 cherry Exp $");
 
 #include  
 #include 
@@ -267,6 +267,14 @@ i8259_setup(struct pic *pic, struct cpu_
 	int port, irq;
 	irq = vect2irq[idtvec];
 	KASSERT(irq != 0);
+	if (irq2port[irq] != 0) {
+		/* 
+		 * Shared interrupt - we can't rebind.
+		 *  The port is shared instead.
+		 */
+		return;
+	}
+	
 	port = bind_pirq_to_evtch(irq);
 	KASSERT(port < NR_EVENT_CHANNELS);
 	KASSERT(port >= 0);
@@ -292,6 +300,7 @@ i8259_unsetup(struct pic *pic, struct cp
 
 	KASSERT(port < NR_EVENT_CHANNELS);
 
+	/* XXX: This is problematic for shared interrupts */
 	KASSERT(irq2port[irq] != 0);
 	irq2port[irq] = 0;
 

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.57 src/sys/arch/x86/x86/ioapic.c:1.58
--- src/sys/arch/x86/x86/ioapic.c:1.57	Sun Oct  7 05:28:51 2018
+++ src/sys/arch/x86/x86/ioapic.c	Sun Oct  7 16:36:36 2018
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.57 2018/10/07 05:28:51 cherry Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.58 2018/10/07 16:36:36 cherry Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.57 2018/10/07 05:28:51 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.58 2018/10/07 16:36:36 cherry Exp $");
 
 #include "opt_ddb.h"
 
@@ -576,6 +576,15 @@ ioapic_addroute(struct pic *pic, struct 
 	int port, irq;
 	irq = vect2irq[idtvec];
 	KASSERT(irq != 0);
+
+	if (irq2port[irq] != 0) {
+		/* 
+		 * Shared interrupt - we can't rebind.
+		 *  The port is shared instead.
+		 */
+		return;
+	}
+
 	port = bind_pirq_to_evtch(irq);
 	KASSERT(port < NR_EVENT_CHANNELS);
 	KASSERT(port >= 0);
@@ -602,6 +611,7 @@ ioapic_delroute(struct pic *pic, struct 
 
 	KASSERT(port < NR_EVENT_CHANNELS);
 
+	/* XXX: This is problematic for shared interrupts */
 	KASSERT(irq2port[irq] != 0);
 	irq2port[irq] = 0;
 



CVS commit: [jdolecek-ncqfixes] src/sys/dev/ic

2018-10-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Oct  7 15:44:48 UTC 2018

Modified Files:
src/sys/dev/ic [jdolecek-ncqfixes]: ahcisata_core.c

Log Message:
move atastart() call after xfer deactivation during ATA command completion,
so that it's executed after the slot is freed


To generate a diff of this commit:
cvs rdiff -u -r1.62.2.7 -r1.62.2.8 src/sys/dev/ic/ahcisata_core.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.62.2.7 src/sys/dev/ic/ahcisata_core.c:1.62.2.8
--- src/sys/dev/ic/ahcisata_core.c:1.62.2.7	Thu Oct  4 17:59:35 2018
+++ src/sys/dev/ic/ahcisata_core.c	Sun Oct  7 15:44:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.62.2.7 2018/10/04 17:59:35 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.62.2.8 2018/10/07 15:44:47 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.62.2.7 2018/10/04 17:59:35 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.62.2.8 2018/10/07 15:44:47 jdolecek Exp $");
 
 #include 
 #include 
@@ -1233,6 +1233,9 @@ ahci_cmd_complete(struct ata_channel *ch
 	achp->ahcic_cmds_active &= ~(1U << xfer->c_slot);
 	ata_deactivate_xfer(chp, xfer);
 
+	if ((ata_c->flags & (AT_TIMEOU|AT_ERROR)) == 0)
+		atastart(chp);
+
 	return 0;
 }
 
@@ -1243,7 +1246,6 @@ ahci_cmd_done(struct ata_channel *chp, s
 	struct ahci_channel *achp = (struct ahci_channel *)chp;
 	struct ata_command *ata_c = >c_ata_c;
 	uint16_t *idwordbuf;
-	int flags = ata_c->flags;
 	int i;
 
 	AHCIDEBUG_PRINT(("ahci_cmd_done channel %d flags %#x/%#x\n",
@@ -1273,9 +1275,6 @@ ahci_cmd_done(struct ata_channel *chp, s
 		ata_c->flags |= AT_XFDONE;
 
 	ahci_cmd_done_end(chp, xfer);
-
-	if ((flags & (AT_TIMEOU|AT_ERROR)) == 0)
-		atastart(chp);
 }
 
 static void



CVS commit: [jdolecek-ncqfixes] src/sys/dev/ic

2018-10-07 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Oct  7 15:42:47 UTC 2018

Modified Files:
src/sys/dev/ic [jdolecek-ncqfixes]: siisata.c

Log Message:
call atastart() when ATA command completes without timeout or error, similar
to AHCI


To generate a diff of this commit:
cvs rdiff -u -r1.35.6.7 -r1.35.6.8 src/sys/dev/ic/siisata.c

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

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.35.6.7 src/sys/dev/ic/siisata.c:1.35.6.8
--- src/sys/dev/ic/siisata.c:1.35.6.7	Thu Oct  4 17:59:35 2018
+++ src/sys/dev/ic/siisata.c	Sun Oct  7 15:42:47 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.35.6.7 2018/10/04 17:59:35 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.35.6.8 2018/10/07 15:42:47 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.35.6.7 2018/10/04 17:59:35 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.35.6.8 2018/10/07 15:42:47 jdolecek Exp $");
 
 #include 
 #include 
@@ -1180,6 +1180,9 @@ siisata_cmd_complete(struct ata_channel 
 	siisata_deactivate_prb(schp, xfer->c_slot);
 	ata_deactivate_xfer(chp, xfer);
 
+	if ((ata_c->flags & (AT_TIMEOU|AT_ERROR)) == 0)
+		atastart(chp);
+
 	return 0;
 }
 



CVS commit: src/usr.bin/xlint

2018-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  7 14:20:01 UTC 2018

Modified Files:
src/usr.bin/xlint/common: lp64.h
src/usr.bin/xlint/lint1: scan.l

Log Message:
Disable __int128 checks if we are not building on a 64 bit host (
this is suboptimal, but it is the easiest way).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/common/lp64.h
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/scan.l

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

Modified files:

Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.5 src/usr.bin/xlint/common/lp64.h:1.6
--- src/usr.bin/xlint/common/lp64.h:1.5	Fri Sep  7 11:16:15 2018
+++ src/usr.bin/xlint/common/lp64.h	Sun Oct  7 10:20:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lp64.h,v 1.5 2018/09/07 15:16:15 christos Exp $	*/
+/*	$NetBSD: lp64.h,v 1.6 2018/10/07 14:20:01 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -67,6 +67,9 @@
 #define	TARG_QUAD_MIN	((-TARG_QUAD_MAX) - 1)
 #define	TARG_UQUAD_MAX	((uint64_t) -1)
 
+#ifndef _LP64
+/* XXX on a 32 build for a 64 build host we skip these */
 #define	TARG_INT128_MAX		((__int128_t) (((__uint128_t) -1) >> 1))
 #define	TARG_INT128_MIN		((-TARG_INT128_MAX) - 1)
 #define	TARG_UINT128_MAX	((__uint128_t) -1)
+#endif

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.83 src/usr.bin/xlint/lint1/scan.l:1.84
--- src/usr.bin/xlint/lint1/scan.l:1.83	Fri Sep  7 11:16:15 2018
+++ src/usr.bin/xlint/lint1/scan.l	Sun Oct  7 10:20:01 2018
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.83 2018/09/07 15:16:15 christos Exp $ */
+/* $NetBSD: scan.l,v 1.84 2018/10/07 14:20:01 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.83 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.84 2018/10/07 14:20:01 christos Exp $");
 #endif
 
 #include 
@@ -558,7 +558,7 @@ icon(int base)
 	char	c, *eptr;
 	tspec_t	typ;
 	int	ansiu;
-#ifdef INT128_SIZE
+#ifdef TARG_INT128_MAX
 	__uint128_t uq = 0;
 	static	tspec_t contypes[2][4] = {
 		{ INT,  LONG,  QUAD, INT128, },
@@ -689,17 +689,21 @@ icon(int base)
 		break;
 #ifdef INT128_SIZE
 	case INT128:
+#ifdef TARG_INT128_MAX
 		if (uq > TARG_INT128_MAX && !tflag) {
 			typ = UINT128;
 			if (!sflag)
 ansiu = 1;
 		}
+#endif
 		break;
 	case UINT128:
+#ifdef TARG_INT128_MAX
 		if (uq > TARG_UINT128_MAX) {
 			/* integer constant out of range */
 			warning(252);
 		}
+#endif
 		break;
 #endif
 		/* LINTED206: (enumeration values not handled in switch) */



CVS commit: src/sys/dev

2018-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  7 12:00:07 UTC 2018

Modified Files:
src/sys/dev: vnd.c

Log Message:
Use IO_DIRECT for file I/O to reduce buffer cache contention.

Restore old behaviour to flush pages only when usage exceeds 1MB.

No longer use PGO_SYNCIO, regular writes to the device do not require
the data to reach stable storage, the DIOCCACHESYNC ioctl is used
for that.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.268 src/sys/dev/vnd.c:1.269
--- src/sys/dev/vnd.c:1.268	Sun Oct  7 11:54:14 2018
+++ src/sys/dev/vnd.c	Sun Oct  7 12:00:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.268 2018/10/07 11:54:14 mlelstv Exp $	*/
+/*	$NetBSD: vnd.c,v 1.269 2018/10/07 12:00:07 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.268 2018/10/07 11:54:14 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.269 2018/10/07 12:00:07 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -159,6 +159,7 @@ struct vndxfer {
 (MAKEDISKDEV(major((dev)), vndunit((dev)), RAW_PART))
 
 #define	VND_MAXPENDING(vnd)	((vnd)->sc_maxactive * 4)
+#define	VND_MAXPAGES(vnd)	(1024 * 1024 / PAGE_SIZE)
 
 
 static void	vndclear(struct vnd_softc *, int);
@@ -810,12 +811,22 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 	bp->b_error =
 	vn_rdwr(doread ? UIO_READ : UIO_WRITE,
 	vp, bp->b_data, len, offset, UIO_SYSSPACE,
-	IO_ADV_ENCODE(POSIX_FADV_NOREUSE), vnd->sc_cred, , NULL);
+	IO_ADV_ENCODE(POSIX_FADV_NOREUSE) | IO_DIRECT,
+		vnd->sc_cred, , NULL);
 	bp->b_resid = resid;
 
+	/*
+	 * Avoid caching too many pages, the vnd user
+	 * is usually a filesystem and caches itself.
+	 * We need some amount of caching to not hinder
+	 * read-ahead and write-behind operations.
+	 */
 	mutex_enter(vp->v_interlock);
-	(void) VOP_PUTPAGES(vp, 0, 0,
-	PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE | PGO_SYNCIO);
+	if (vp->v_uobj.uo_npages > VND_MAXPAGES(vnd))
+		(void) VOP_PUTPAGES(vp, 0, 0,
+		PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE);
+	else
+		mutex_exit(vp->v_interlock);
 
 	fstrans_done(vp->v_mount);
 



CVS commit: src/sys/dev

2018-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  7 11:54:14 UTC 2018

Modified Files:
src/sys/dev: vnd.c

Log Message:
Calculate a missing cylinder count in the geometry spec from image size.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.267 src/sys/dev/vnd.c:1.268
--- src/sys/dev/vnd.c:1.267	Sun Oct  7 11:51:26 2018
+++ src/sys/dev/vnd.c	Sun Oct  7 11:54:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.267 2018/10/07 11:51:26 mlelstv Exp $	*/
+/*	$NetBSD: vnd.c,v 1.268 2018/10/07 11:54:14 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.267 2018/10/07 11:51:26 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.268 2018/10/07 11:54:14 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -1427,7 +1427,6 @@ vndioctl(dev_t dev, u_long cmd, void *da
 			 * Sanity-check the sector size.
 			 */
 			if (!DK_DEV_BSIZE_OK(vnd->sc_geom.vng_secsize) ||
-			vnd->sc_geom.vng_ncylinders == 0 ||
 			vnd->sc_geom.vng_ntracks == 0 ||
 			vnd->sc_geom.vng_nsectors == 0) {
 error = EINVAL;
@@ -1435,6 +1434,14 @@ vndioctl(dev_t dev, u_long cmd, void *da
 			}
 
 			/*
+			 * Compute missing cylinder count from size
+			 */
+			if (vnd->sc_geom.vng_ncylinders == 0)
+vnd->sc_geom.vng_ncylinders = vnd->sc_size /
+	(vnd->sc_geom.vng_ntracks *
+	vnd->sc_geom.vng_nsectors);
+
+			/*
 			 * Compute the size (in DEV_BSIZE blocks) specified
 			 * by the geometry.
 			 */



CVS commit: src

2018-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  7 11:51:26 UTC 2018

Modified Files:
src/sys/dev: vnd.c vndvar.h
src/usr.sbin/vnconfig: vnconfig.8 vnconfig.c

Log Message:
Add flag to enforce file I/O even when bmap/strategy would be possible.
This makes it easier to compare both modes, it also allows coherent
operation between vnd device and image file.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/sys/dev/vnd.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/vndvar.h
cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/vnconfig/vnconfig.8
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/vnconfig/vnconfig.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/vnd.c
diff -u src/sys/dev/vnd.c:1.266 src/sys/dev/vnd.c:1.267
--- src/sys/dev/vnd.c:1.266	Fri Oct  5 09:51:55 2018
+++ src/sys/dev/vnd.c	Sun Oct  7 11:51:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.266 2018/10/05 09:51:55 hannken Exp $	*/
+/*	$NetBSD: vnd.c,v 1.267 2018/10/07 11:51:26 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.266 2018/10/05 09:51:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.267 2018/10/07 11:51:26 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -1243,6 +1243,8 @@ vndioctl(dev_t dev, u_long cmd, void *da
 		fflags = FREAD;
 		if ((vio->vnd_flags & VNDIOF_READONLY) == 0)
 			fflags |= FWRITE;
+		if ((vio->vnd_flags & VNDIOF_FILEIO) != 0)
+			vnd->sc_flags |= VNF_USE_VN_RDWR;
 		error = pathbuf_copyin(vio->vnd_file, );
 		if (error) {
 			goto unlock_and_exit;
@@ -1266,7 +1268,7 @@ vndioctl(dev_t dev, u_long cmd, void *da
 
 		/* If using a compressed file, initialize its info */
 		/* (or abort with an error if kernel has no compression) */
-		if (vio->vnd_flags & VNF_COMP) {
+		if (vio->vnd_flags & VNDIOF_COMP) {
 #ifdef VND_COMPRESSION
 			struct vnd_comp_header *ch;
 			int i;

Index: src/sys/dev/vndvar.h
diff -u src/sys/dev/vndvar.h:1.37 src/sys/dev/vndvar.h:1.38
--- src/sys/dev/vndvar.h:1.37	Thu Sep 20 07:18:38 2018
+++ src/sys/dev/vndvar.h	Sun Oct  7 11:51:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vndvar.h,v 1.37 2018/09/20 07:18:38 mlelstv Exp $	*/
+/*	$NetBSD: vndvar.h,v 1.38 2018/10/07 11:51:26 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -98,6 +98,8 @@ struct vnd_ioctl {
 #define	VNDIOF_HASGEOM	0x01		/* use specified geometry */
 #define	VNDIOF_READONLY	0x02		/* as read-only device */
 #define	VNDIOF_FORCE	0x04		/* force close */
+#define	VNDIOF_FILEIO	0x08		/* have to use read/write */
+#define	VNDIOF_COMP	0x0400		/* must stay the same as VNF_COMP */
 
 #ifdef _KERNEL
 

Index: src/usr.sbin/vnconfig/vnconfig.8
diff -u src/usr.sbin/vnconfig/vnconfig.8:1.43 src/usr.sbin/vnconfig/vnconfig.8:1.44
--- src/usr.sbin/vnconfig/vnconfig.8:1.43	Tue May  1 09:03:49 2018
+++ src/usr.sbin/vnconfig/vnconfig.8	Sun Oct  7 11:51:26 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vnconfig.8,v 1.43 2018/05/01 09:03:49 uwe Exp $
+.\"	$NetBSD: vnconfig.8,v 1.44 2018/10/07 11:51:26 mlelstv Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -70,7 +70,7 @@
 .Sh SYNOPSIS
 .Nm
 .\" Fcf:lm:rt:uvz
-.Op Fl crvz
+.Op Fl crivz
 .Op Fl f Ar disktab
 .Op Fl t Ar typename
 .Ar vnode_disk
@@ -168,6 +168,9 @@ is set to 0,
 then only vnd devices currently in use will be shown.
 .It Fl r
 Configure the device as read-only.
+.It Fl i
+Configure the device to use regular file I/O even when direct I/O using
+bmap/strategy would be possible.
 .It Fl t Ar typename
 If configuring the device, look up
 .Ar typename

Index: src/usr.sbin/vnconfig/vnconfig.c
diff -u src/usr.sbin/vnconfig/vnconfig.c:1.46 src/usr.sbin/vnconfig/vnconfig.c:1.47
--- src/usr.sbin/vnconfig/vnconfig.c:1.46	Mon Mar 12 01:15:00 2018
+++ src/usr.sbin/vnconfig/vnconfig.c	Sun Oct  7 11:51:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnconfig.c,v 1.46 2018/03/12 01:15:00 christos Exp $	*/
+/*	$NetBSD: vnconfig.c,v 1.47 2018/10/07 11:51:26 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -98,6 +98,7 @@
 
 static int	verbose = 0;
 static int	readonly = 0;
+static int	fileio = 0;
 static int	force = 0;
 static int	compressed = 0;
 static int	minimum = DUMMY_FREE;
@@ -116,7 +117,7 @@ main(int argc, char *argv[])
 	char *end;
 	unsigned long cnt;
 
-	while ((ch = getopt(argc, argv, "Fcf:lm:rt:uvz")) != -1) {
+	while ((ch = getopt(argc, argv, "Fcf:lm:rit:uvz")) != -1) {
 		switch (ch) {
 		case 'F':
 			force = 1;
@@ -140,6 +141,9 @@ main(int argc, char *argv[])
 		case 'r':
 			readonly = 1;
 			break;
+		case 'i':
+			fileio = 1;
+			break;
 		case 't':
 			tabname = optarg;
 			break;
@@ -321,6 +325,9 @@ config(char *dev, char *file, char *geom
 	if (compressed)
 		vndio.vnd_flags |= VNF_COMP;
 
+	if (fileio)
+		vndio.vnd_flags |= 

CVS commit: src/sys/arch/xen

2018-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  7 11:25:55 UTC 2018

Modified Files:
src/sys/arch/xen/include: xen.h
src/sys/arch/xen/x86: autoconf.c

Log Message:
Support bootspec.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/x86/autoconf.c

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

Modified files:

Index: src/sys/arch/xen/include/xen.h
diff -u src/sys/arch/xen/include/xen.h:1.39 src/sys/arch/xen/include/xen.h:1.40
--- src/sys/arch/xen/include/xen.h:1.39	Thu Jul 26 15:38:26 2018
+++ src/sys/arch/xen/include/xen.h	Sun Oct  7 11:25:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen.h,v 1.39 2018/07/26 15:38:26 maxv Exp $	*/
+/*	$NetBSD: xen.h,v 1.40 2018/10/07 11:25:55 mlelstv Exp $	*/
 
 /*
  *
@@ -44,7 +44,7 @@ struct xen_netinfo {
 };
 
 union xen_cmdline_parseinfo {
-	char			xcp_bootdev[16]; /* sizeof(dv_xname) */
+	char			xcp_bootdev[144];
 	struct xen_netinfo	xcp_netinfo;
 	char			xcp_console[16];
 	char			xcp_pcidevs[64];

Index: src/sys/arch/xen/x86/autoconf.c
diff -u src/sys/arch/xen/x86/autoconf.c:1.19 src/sys/arch/xen/x86/autoconf.c:1.20
--- src/sys/arch/xen/x86/autoconf.c:1.19	Sat Jul 29 06:29:32 2017
+++ src/sys/arch/xen/x86/autoconf.c	Sun Oct  7 11:25:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.19 2017/07/29 06:29:32 maxv Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.20 2018/10/07 11:25:55 mlelstv Exp $	*/
 /*	NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp 	*/
 
 /*-
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2017/07/29 06:29:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2018/10/07 11:25:55 mlelstv Exp $");
 
 #include "opt_xen.h"
 #include "opt_multiprocessor.h"
@@ -150,7 +150,8 @@ cpu_rootconf(void)
 	cpu_bootconf();
 
 	printf("boot device: %s\n",
-	booted_device ? device_xname(booted_device) : "");
+	booted_device ? device_xname(booted_device) :
+	bootspec ? bootspec : "");
 	rootconf();
 }
 
@@ -164,6 +165,7 @@ cpu_bootconf(void)
 	device_t dv;
 	deviter_t di;
 	union xen_cmdline_parseinfo xcp;
+	static char bootspecbuf[sizeof(xcp.xcp_bootdev)];
 
 	if (booted_device)
 		return;
@@ -200,6 +202,18 @@ cpu_bootconf(void)
 		break;
 	}
 	deviter_release();
+
+	if (booted_device)
+		return;
+
+	/*
+	 * not a boot device name, pass through to MI code
+	 */
+	if (xcp.xcp_bootdev[0] != '\0') {
+		strlcpy(bootspecbuf, xcp.xcp_bootdev, sizeof(bootspecbuf));
+		bootspec = bootspecbuf;
+		return;
+	}
 }
 
 #include "pci.h"



CVS commit: src/sys/kern

2018-10-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  7 11:24:16 UTC 2018

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

Log Message:
Set rootdev for wedges.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/kern/kern_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/kern/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.219 src/sys/kern/kern_subr.c:1.220
--- src/sys/kern/kern_subr.c:1.219	Tue Nov 14 14:14:29 2017
+++ src/sys/kern/kern_subr.c	Sun Oct  7 11:24:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_subr.c,v 1.219 2017/11/14 14:14:29 jmcneill Exp $	*/
+/*	$NetBSD: kern_subr.c,v 1.220 2018/10/07 11:24:16 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.219 2017/11/14 14:14:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.220 2018/10/07 11:24:16 mlelstv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -432,11 +432,13 @@ setroot(device_t bootdv, int bootpartiti
 			goto haveroot;
 		}
 
-		if (rootdev == NODEV &&
-		dv != NULL && device_class(dv) == DV_DISK &&
-		device_is_a(dv, "dk") &&
-		(majdev = devsw_name2blk(device_xname(dv), NULL, 0)) >= 0)
+		if (dv != NULL && device_class(dv) == DV_DISK &&
+		!DEV_USES_PARTITIONS(dv) &&
+		(majdev = devsw_name2blk(device_xname(dv), NULL, 0)) >= 0) {
+			rootdv = dv;
 			rootdev = makedev(majdev, device_unit(dv));
+			goto haveroot;
+		}
 
 		rootdevname = devsw_blk2name(major(rootdev));
 		if (rootdevname == NULL) {



CVS commit: src/distrib/amd64/uefi-installimage

2018-10-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  7 10:33:44 UTC 2018

Modified Files:
src/distrib/amd64/uefi-installimage: Makefile.bootimage

Log Message:
Support .tar.xz format for sets.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/distrib/amd64/uefi-installimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/amd64/uefi-installimage/Makefile.bootimage
diff -u src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.6 src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.7
--- src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.6	Thu Feb 16 03:47:23 2017
+++ src/distrib/amd64/uefi-installimage/Makefile.bootimage	Sun Oct  7 10:33:44 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.6 2017/02/16 03:47:23 christos Exp $
+#	$NetBSD: Makefile.bootimage,v 1.7 2018/10/07 10:33:44 martin Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -228,6 +228,7 @@ SETS_DEFAULT+=	xbase xcomp xetc xfont xs
 .endif
 
 KERN_SET?=	kern-GENERIC
+TAR_SUFF=	${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz}
 SETS?=		${SETS_DEFAULT}
 IMG_SETS=	${KERN_SET} ${SETS}
 SETS_DIR?=	${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
@@ -257,12 +258,12 @@ ${TARGETFS}: prepare_md_post pre-targetf
 	fi;
 	@${MKDIR} ${MKDIRPERM} ${WORKDIR}
 .for set in ${IMG_SETS}
-	@if [ ! -f ${SETS_DIR}/${set}.tgz ]; then 			\
-		echo "Missing ${SETS_DIR}/${set}.tgz, aborting";	\
+	@if [ ! -f ${SETS_DIR}/${set}.${TAR_SUFF} ]; then 		\
+		echo "Missing ${SETS_DIR}/${set}.${TAR_SUFF}, aborting";\
 		false; 			\
 	fi
-	@echo Extracting ${set}.tgz ...
-	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.tgz .)
+	@echo Extracting ${set}.${TAR_SUFF} ...
+	@(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.${TAR_SUFF} .)
 .endfor
 .if defined(SECONDARY_BOOT)
 	@echo Copying secondary boot...



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

2018-10-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Oct  7 08:00:49 UTC 2018

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

Log Message:
Make it clear that you need to disable SVS if you enable USER_LDT. I could
make SVS compatible with it, but there has to be someone doing Wine work
first, to justify the effort.


To generate a diff of this commit:
cvs rdiff -u -r1.505 -r1.506 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.505 src/sys/arch/amd64/conf/GENERIC:1.506
--- src/sys/arch/amd64/conf/GENERIC:1.505	Thu Sep  6 05:36:49 2018
+++ src/sys/arch/amd64/conf/GENERIC	Sun Oct  7 08:00:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.505 2018/09/06 05:36:49 maxv Exp $
+# $NetBSD: GENERIC,v 1.506 2018/10/07 08:00:49 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.505 $"
+#ident		"GENERIC-$Revision: 1.506 $"
 
 maxusers	64		# estimated number of users
 
@@ -74,12 +74,15 @@ 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



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

2018-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct  7 07:51:54 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: std.amlogic

Log Message:
Remove a space that snuck in


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.amlogic

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.amlogic
diff -u src/sys/arch/evbarm/conf/std.amlogic:1.4 src/sys/arch/evbarm/conf/std.amlogic:1.5
--- src/sys/arch/evbarm/conf/std.amlogic:1.4	Sun Oct  7 07:48:43 2018
+++ src/sys/arch/evbarm/conf/std.amlogic	Sun Oct  7 07:51:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.amlogic,v 1.4 2018/10/07 07:48:43 skrll Exp $
+#	$NetBSD: std.amlogic,v 1.5 2018/10/07 07:51:54 skrll Exp $
 #
 
 machine		evbarm arm
@@ -9,7 +9,7 @@ include		"arch/evbarm/conf/files.amlogic
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_CPU_COUNTER
-options 	 __HAVE_CPU_UAREA_ALLOC_IDLELWP
+options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	ARM_HAS_VBAR



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

2018-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct  7 07:48:44 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: std.adi_brh std.altera std.amlogic
std.armadaxp std.armadillo9 std.bcm53xx std.beagle std.cp3100
std.exynos std.g42xxeb std.gemini std.generic64 std.gumstix
std.hawk std.hdl_g std.igepv2 std.imx23_olinuxino std.imx31
std.imx6ul std.imx7 std.integrator std.integrator_cp std.iq31244
std.iq80310 std.iq80321 std.ixdp425 std.ixm1200 std.kobo
std.lubbock std.marvell std.mini2440 std.mmnet std.mpcsa std.mv2120
std.n900 std.netwalker std.nitrogen6 std.npwr_fc std.nslu2
std.osk5912 std.overo std.rpi std.smdk2410 std.smdk2800 std.sunxi
std.tegra std.ti std.tisdp24xx std.tsarm std.vexpress std.viper
std.virt std.zynq

Log Message:
Whitespace consistency.

{make,}options
everything else just Modified files:

Index: src/sys/arch/evbarm/conf/std.adi_brh
diff -u src/sys/arch/evbarm/conf/std.adi_brh:1.10 src/sys/arch/evbarm/conf/std.adi_brh:1.11
--- src/sys/arch/evbarm/conf/std.adi_brh:1.10	Sun Dec 16 23:47:56 2012
+++ src/sys/arch/evbarm/conf/std.adi_brh	Sun Oct  7 07:48:43 2018
@@ -1,8 +1,8 @@
-#	$NetBSD: std.adi_brh,v 1.10 2012/12/16 23:47:56 matt Exp $
+#	$NetBSD: std.adi_brh,v 1.11 2018/10/07 07:48:43 skrll Exp $
 #
 # standard NetBSD/evbarm for ADI BRH options
 
-machine	evbarm arm
+machine		evbarm arm
 include		"arch/evbarm/conf/std.evbarm"
 
 # Pull in ADI BRH config definitions.
@@ -11,9 +11,9 @@ include		"arch/evbarm/conf/files.adi_brh
 options 	EXEC_AOUT
 
 options 	KERNEL_BASE_EXT=0xc000
-makeoptions	LOADADDRESS="0xc020"
-makeoptions	BOARDTYPE="adi_brh"
-makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.adi_brh"
+makeoptions 	LOADADDRESS="0xc020"
+makeoptions 	BOARDTYPE="adi_brh"
+makeoptions 	BOARDMKFRAG="${THISARM}/conf/mk.adi_brh"
 
 options 	ARM_INTR_IMPL=""
 
Index: src/sys/arch/evbarm/conf/std.lubbock
diff -u src/sys/arch/evbarm/conf/std.lubbock:1.10 src/sys/arch/evbarm/conf/std.lubbock:1.11
--- src/sys/arch/evbarm/conf/std.lubbock:1.10	Sun Dec 16 23:47:56 2012
+++ src/sys/arch/evbarm/conf/std.lubbock	Sun Oct  7 07:48:44 2018
@@ -1,8 +1,8 @@
-#	$NetBSD: std.lubbock,v 1.10 2012/12/16 23:47:56 matt Exp $
+#	$NetBSD: std.lubbock,v 1.11 2018/10/07 07:48:44 skrll Exp $
 #
 # standard NetBSD/evbarm for LUBBOCK options
 
-machine	evbarm arm
+machine		evbarm arm
 include		"arch/evbarm/conf/std.evbarm"
 
 # Pull in LUBBOCK config definitions.
@@ -12,13 +12,13 @@ options 	COTULLA
 options 	LUBBOCK
 
 options 	KERNEL_BASE_EXT=0xc000
-makeoptions	LOADADDRESS="0xc020"
-makeoptions	BOARDTYPE="lubbock"
-makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.lubbock"
+makeoptions 	LOADADDRESS="0xc020"
+makeoptions 	BOARDTYPE="lubbock"
+makeoptions 	BOARDMKFRAG="${THISARM}/conf/mk.lubbock"
 
 options 	ARM_INTR_IMPL=""
 
 # OS TimerThis is compatible to SA1110's OS Timer.
-saost*	at pxaip? addr 0x40a0 size 0x20
+saost* 		at pxaip? addr 0x40a0 size 0x20
 
 
Index: src/sys/arch/evbarm/conf/std.netwalker
diff -u src/sys/arch/evbarm/conf/std.netwalker:1.10 src/sys/arch/evbarm/conf/std.netwalker:1.11
--- src/sys/arch/evbarm/conf/std.netwalker:1.10	Sun Aug 24 07:59:22 2014
+++ src/sys/arch/evbarm/conf/std.netwalker	Sun Oct  7 07:48:44 2018
@@ -1,18 +1,18 @@
-#	$NetBSD: std.netwalker,v 1.10 2014/08/24 07:59:22 jnemeth Exp $
+#	$NetBSD: std.netwalker,v 1.11 2018/10/07 07:48:44 skrll Exp $
 #
 # standard NetBSD/evbarm options for Sharp NetWalker
 
-machine	evbarm arm
-include 	"arch/evbarm/conf/std.evbarm"
+machine		evbarm arm
+include		"arch/evbarm/conf/std.evbarm"
 
 # Pull in i.mx51 config definitions.
-include	  	"arch/evbarm/conf/files.netwalker"
+include		"arch/evbarm/conf/files.netwalker"
 
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_CPU_COUNTER
-options __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 options 	ARM_HAS_VBAR
 options 	TPIDRPRW_IS_CURCPU
 options 	CORTEX_PMC
@@ -21,9 +21,9 @@ options 	KERNEL_BASE_EXT=0x8000
 options 	EVBARM_BOARDTYPE="netwalker"
 options 	FPU_VFP
 
-makeoptions	LOADADDRESS="0x9010"
-makeoptions	BOARDTYPE="netwalker"
-makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.netwalker"
+makeoptions 	LOADADDRESS="0x9010"
+makeoptions 	BOARDTYPE="netwalker"
+makeoptions 	BOARDMKFRAG="${THISARM}/conf/mk.netwalker"
 
 options 	ARM_INTR_IMPL=""
-options		ARM_GENERIC_TODR
+options 	ARM_GENERIC_TODR

Index: src/sys/arch/evbarm/conf/std.altera
diff -u src/sys/arch/evbarm/conf/std.altera:1.1 src/sys/arch/evbarm/conf/std.altera:1.2
--- src/sys/arch/evbarm/conf/std.altera:1.1	Wed Sep 19 17:31:39 2018
+++ src/sys/arch/evbarm/conf/std.altera	Sun Oct  7 07:48:43 2018
@@ -1,22 +1,22 @@
-# $NetBSD: std.altera,v 1.1 2018/09/19 17:31:39 aymeric Exp $
+# $NetBSD: std.altera,v 1.2 2018/10/07 07:48:43 skrll Exp $
 
-machine