CVS commit: src/sys/uvm/pmap

2020-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr 14 05:43:57 UTC 2020

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

Log Message:
Fix UVMHIST bulid


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

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

Modified files:

Index: src/sys/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.32 src/sys/uvm/pmap/pmap_tlb.c:1.33
--- src/sys/uvm/pmap/pmap_tlb.c:1.32	Sun Apr 12 15:36:18 2020
+++ src/sys/uvm/pmap/pmap_tlb.c	Tue Apr 14 05:43:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.32 2020/04/12 15:36:18 skrll Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.33 2020/04/14 05:43:57 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.32 2020/04/12 15:36:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.33 2020/04/14 05:43:57 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -241,7 +241,7 @@ pmap_tlb_pai_reset(struct pmap_tlb_info 
 {
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLARGS(maphist, "(ti=%#jx, pai=%#jx, pm=%#jx): asid %u",
-	ti, (uintptr_t)pai, (uintptr_t)pm, pai->pai_asid);
+	(uintptr_t)ti, (uintptr_t)pai, (uintptr_t)pm, pai->pai_asid);
 
 	/*
 	 * We must have an ASID but it must not be onproc (on a processor).



CVS commit: src

2020-04-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Apr 14 03:16:27 UTC 2020

Modified Files:
src/distrib/sets/lists/base: mi
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks: Makefile

Log Message:
Since dhcpcd-hools/02-dump seems to have been removed from the
repository, don't attempt to install it, and don't expect it to
be installed.If a better fix is to return 02-dump, then this
change can be reverted (by anyone, just go ahead and do it).

dhcpcd(8) should also have mention of 02-dump removed, if removing
it was intentional.


To generate a diff of this commit:
cvs rdiff -u -r1.1239 -r1.1240 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1239 src/distrib/sets/lists/base/mi:1.1240
--- src/distrib/sets/lists/base/mi:1.1239	Sat Apr  4 19:50:53 2020
+++ src/distrib/sets/lists/base/mi	Tue Apr 14 03:16:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1239 2020/04/04 19:50:53 christos Exp $
+# $NetBSD: mi,v 1.1240 2020/04/14 03:16:26 kre Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -476,7 +476,7 @@
 ./libexec/devpubd-run-hooks			base-sysutil-root
 ./libexec/dhcpcd-hooksbase-dhcpcd-root
 ./libexec/dhcpcd-hooks/01-test			base-dhcpcd-root
-./libexec/dhcpcd-hooks/02-dump			base-dhcpcd-root
+./libexec/dhcpcd-hooks/02-dump			base-obsolete  obsolete
 ./libexec/dhcpcd-hooks/10-mtu			base-obsolete  obsolete
 ./libexec/dhcpcd-hooks/10-resolv.conf		base-obsolete  obsolete
 ./libexec/dhcpcd-hooks/14-lookup-hostname	base-obsolete  obsolete

Index: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile
diff -u src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.5 src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.6
--- src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.5	Fri Apr  3 15:02:11 2020
+++ src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile	Tue Apr 14 03:16:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2020/04/03 15:02:11 roy Exp $
+# $NetBSD: Makefile,v 1.6 2020/04/14 03:16:27 kre Exp $
 #
 
 .include 
@@ -7,7 +7,7 @@
 HOOKSRC=	${DIST}/hooks
 .PATH:		${HOOKSRC}
 
-FILES=		01-test 02-dump 20-resolv.conf 30-hostname
+FILES=		01-test 20-resolv.conf 30-hostname
 FILES+=		50-ntp.conf
 
 FILESDIR=	/libexec/dhcpcd-hooks



CVS commit: src/sys/gdbscripts

2020-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 14 00:08:07 UTC 2020

Modified Files:
src/sys/gdbscripts: vdump

Log Message:
catch up with field move


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/gdbscripts/vdump

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

Modified files:

Index: src/sys/gdbscripts/vdump
diff -u src/sys/gdbscripts/vdump:1.6 src/sys/gdbscripts/vdump:1.7
--- src/sys/gdbscripts/vdump:1.6	Wed Dec 14 10:48:55 2016
+++ src/sys/gdbscripts/vdump	Mon Apr 13 20:08:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: vdump,v 1.6 2016/12/14 15:48:55 hannken Exp $
+#	$NetBSD: vdump,v 1.7 2020/04/14 00:08:07 christos Exp $
 
 #	@(#)vdump	8.1 (Berkeley) 6/10/93
 #
@@ -8,7 +8,7 @@ define dumpvnodes
 	set $vp = (struct vnode *)$arg0
 	set $vi = (struct vnode_impl *)$arg0
 	while ($vp)
-		printf "vnode=0x%x lruf=0x%x mountf=0x%x usecount=%d\n", $vp, $vi->vi_lrulist.tqe_next, $vp->v_mntvnodes.tqe_next, $vp->v_uobj.uo_refs
+		printf "vnode=0x%x lruf=0x%x mountf=0x%x usecount=%d\n", $vp, $vi->vi_lrulist.tqe_next, $vi->vi_mntvnodes.tqe_next, $vp->v_uobj.uo_refs
 		set $vi = (struct vnode_impl *)$vi->vi_lrulist.tqe_next
 		set $vp = (struct vnode *)$vi
 	end



CVS commit: src/sys/arch

2020-04-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 13 22:54:12 UTC 2020

Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/xen/include: evtchn.h
src/sys/arch/xen/x86: xen_intr.c xen_ipi.c
src/sys/arch/xen/xen: clock.c evtchn.c

Log Message:
By default, events are bound to CPU 0 (exept for IPIs and VTIMERs which
are bound to a different CPU at creation time).
Recent MI changes caused the scheduler to choose a different CPU when
probing and attaching xennet devices (I guess it's the xenbus thread which
runs on a different CPU). This cause the callback to be called on a different
CPU than the one expected by the kernel, and the event is ignored.
It is handled when the clock causes the callback to be called on the right
CPU, which is why xennet still run, but slowly.

Change event_set_handler() to do a EVTCHNOP_bind_vcpu if requested to,
and make sure we don't do it for IPIs and VIRQs (for theses, the op fails).


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/xen/include/evtchn.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/xen_intr.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/xen/xen/evtchn.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/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.119 src/sys/arch/x86/include/cpu.h:1.120
--- src/sys/arch/x86/include/cpu.h:1.119	Fri Apr 10 14:35:26 2020
+++ src/sys/arch/x86/include/cpu.h	Mon Apr 13 22:54:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.119 2020/04/10 14:35:26 bouyer Exp $	*/
+/*	$NetBSD: cpu.h,v 1.120 2020/04/13 22:54:11 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -307,9 +307,6 @@ struct cpu_info {
 	 */
 	uint64_t	ci_xen_systime_ns_skew;
 
-	/* Xen periodic timer interrupt handle.  */
-	struct intrhand	*ci_xen_timer_intrhand;
-
 	/*
 	 * Clockframe for timer interrupt handler.
 	 * Saved at entry via event callback.

Index: src/sys/arch/xen/include/evtchn.h
diff -u src/sys/arch/xen/include/evtchn.h:1.28 src/sys/arch/xen/include/evtchn.h:1.29
--- src/sys/arch/xen/include/evtchn.h:1.28	Mon Apr  6 19:26:00 2020
+++ src/sys/arch/xen/include/evtchn.h	Mon Apr 13 22:54:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.h,v 1.28 2020/04/06 19:26:00 jdolecek Exp $	*/
+/*	$NetBSD: evtchn.h,v 1.29 2020/04/13 22:54:12 bouyer Exp $	*/
 
 /*
  *
@@ -42,7 +42,7 @@ unsigned int evtchn_do_event(int, struct
 void call_evtchn_do_event(int, struct intrframe *);
 void call_xenevt_event(int);
 int event_set_handler(int, int (*func)(void *), void *, int, const char *,
-const char *, bool);
+const char *, bool, bool);
 int event_remove_handler(int, int (*func)(void *), void *);
 
 struct cpu_info;

Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.21 src/sys/arch/xen/x86/xen_intr.c:1.22
--- src/sys/arch/xen/x86/xen_intr.c:1.21	Mon Apr  6 19:26:00 2020
+++ src/sys/arch/xen/x86/xen_intr.c	Mon Apr 13 22:54:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_intr.c,v 1.21 2020/04/06 19:26:00 jdolecek Exp $	*/
+/*	$NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.21 2020/04/06 19:26:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -170,7 +170,7 @@ xen_intr_establish_xname(int legacy_irq,
 		sizeof(intrstr_buf));
 
 		event_set_handler(pin, handler, arg, level, intrstr, xname,
-		known_mpsafe);
+		known_mpsafe, true);
 
 		rih = kmem_zalloc(sizeof(*rih), cold ? KM_NOSLEEP : KM_SLEEP);
 		if (rih == NULL) {

Index: src/sys/arch/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.35 src/sys/arch/xen/x86/xen_ipi.c:1.36
--- src/sys/arch/xen/x86/xen_ipi.c:1.35	Sun Dec  1 15:34:46 2019
+++ src/sys/arch/xen/x86/xen_ipi.c	Mon Apr 13 22:54:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.35 2019/12/01 15:34:46 ad Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35 2019/12/01 15:34:46 ad Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35 2019/12/01 15:34:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.36 2020/04/13 22:54:12 bouyer Exp $");
 
 #include "opt_ddb.h"
 
@@ -98,6 +98,8 @@ xen_ipi_handler(void *arg)
 
 	ci = curcpu();
 	regs = arg;
+
+	KASSERT(ci == arg);
 	
 	pending = 

CVS commit: src/sys/uvm

2020-04-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Apr 13 22:22:19 UTC 2020

Modified Files:
src/sys/uvm: uvm_fault.c

Log Message:
uvm_fault_check(): if MADV_SEQUENTIAL, change lower lock type to RW_WRITER
in case many threads are concurrently doing "sequential" access, to avoid
excessive mixing of read/write lock holds.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/uvm/uvm_fault.c

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

Modified files:

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.224 src/sys/uvm/uvm_fault.c:1.225
--- src/sys/uvm/uvm_fault.c:1.224	Mon Mar 23 10:35:56 2020
+++ src/sys/uvm/uvm_fault.c	Mon Apr 13 22:22:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.224 2020/03/23 10:35:56 skrll Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.225 2020/04/13 22:22:19 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.224 2020/03/23 10:35:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.225 2020/04/13 22:22:19 ad Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -1184,10 +1184,15 @@ uvm_fault_check(
 		if (amap)
 			uvmfault_anonflush(*ranons, nback);
 
-		/* flush object? */
+		/*
+		 * flush object?  change lock type to RW_WRITER, to avoid
+		 * excessive competition between read/write locks if many
+		 * threads doing "sequential access".
+		 */
 		if (uobj) {
 			voff_t uoff;
 
+			flt->lower_lock_type = RW_WRITER;
 			uoff = ufi->entry->offset + eoff;
 			rw_enter(uobj->vmobjlock, RW_WRITER);
 			(void) (uobj->pgops->pgo_put)(uobj, uoff, uoff +



CVS commit: src/usr.sbin/rtsold

2020-04-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 13 20:44:40 UTC 2020

Modified Files:
src/usr.sbin/rtsold: rtsold.8

Log Message:
Remove trailing dot in SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/rtsold/rtsold.8

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/rtsold/rtsold.8
diff -u src/usr.sbin/rtsold/rtsold.8:1.38 src/usr.sbin/rtsold/rtsold.8:1.39
--- src/usr.sbin/rtsold/rtsold.8:1.38	Mon Apr 13 15:23:18 2020
+++ src/usr.sbin/rtsold/rtsold.8	Mon Apr 13 20:44:39 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtsold.8,v 1.38 2020/04/13 15:23:18 uwe Exp $
+.\"	$NetBSD: rtsold.8,v 1.39 2020/04/13 20:44:39 wiz Exp $
 .\"	$KAME: rtsold.8,v 1.17 2001/07/09 22:30:37 itojun Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -52,4 +52,4 @@ about it without changing the actual rou
 .Dl dhcpcd -dB6T --nodhcp6 < Ns Ar interface Ns \^>
 .\"
 .Sh SEE ALSO
-.Xr dhcpcd 8 .
+.Xr dhcpcd 8



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

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 20:09:13 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
KASSERT() that requested I/O size is <= XBD_MAX_XFER - this can happen
e.g. with custom DomU kernel which doesn't have the value for MAXPHYS
reduced to 32k like the XEN3_DOMU config


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.106 src/sys/arch/xen/xen/xbd_xenbus.c:1.107
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.106	Mon Apr 13 16:29:59 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Mon Apr 13 20:09:13 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.107 2020/04/13 20:09:13 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.107 2020/04/13 20:09:13 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -965,6 +965,8 @@ xbd_diskstart(device_t self, struct buf 
 	DPRINTF(("xbd_diskstart(%p): b_bcount = %ld\n",
 	bp, (long)bp->b_bcount));
 
+	KASSERT(bp->b_bcount <= XBD_MAX_XFER);
+
 	mutex_enter(>sc_lock);
 
 	if (sc->sc_shutdown != BLKIF_SHUTDOWN_RUN) {



CVS commit: src/sys/miscfs/specfs

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 20:02:27 UTC 2020

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
when determining I/O block size for VBLK device, only use pi_bsize
returned by DIOCGPARTINFO if it's bigger than DEV_BSIZE and less
than MAXBSIZE (MAXPHYS)

fixes panic "buf mem pool index 8" in buf_mempoolidx() when the
disklabel contains bsize 128KB and something reads the block device -
buffer cache can't allocate bufs bigger than MAXPHYS


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.176 src/sys/miscfs/specfs/spec_vnops.c:1.177
--- src/sys/miscfs/specfs/spec_vnops.c:1.176	Sun Sep 22 22:59:39 2019
+++ src/sys/miscfs/specfs/spec_vnops.c	Mon Apr 13 20:02:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.176 2019/09/22 22:59:39 christos Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.177 2020/04/13 20:02:27 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.176 2019/09/22 22:59:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.177 2020/04/13 20:02:27 jdolecek Exp $");
 
 #include 
 #include 
@@ -717,7 +717,7 @@ spec_read(void *v)
 			return (EINVAL);
 
 		if (bdev_ioctl(vp->v_rdev, DIOCGPARTINFO, , FREAD, l) == 0)
-			bsize = pi.pi_bsize;
+			bsize = imin(imax(pi.pi_bsize, DEV_BSIZE), MAXBSIZE);
 		else
 			bsize = BLKDEV_IOSIZE;
 
@@ -786,7 +786,7 @@ spec_write(void *v)
 			return (EINVAL);
 
 		if (bdev_ioctl(vp->v_rdev, DIOCGPARTINFO, , FREAD, l) == 0)
-			bsize = pi.pi_bsize;
+			bsize = imin(imax(pi.pi_bsize, DEV_BSIZE), MAXBSIZE);
 		else
 			bsize = BLKDEV_IOSIZE;
 



CVS commit: src

2020-04-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Apr 13 19:23:20 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vfsops.c
src/external/cddl/osnet/sys/sys: vnode.h
src/sys/coda: coda_namecache.c coda_subr.c coda_vnops.c
src/sys/fs/msdosfs: msdosfs_denode.c msdosfs_vfsops.c msdosfs_vnops.c
src/sys/fs/nilfs: nilfs_vnops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/ptyfs: ptyfs_vnops.c
src/sys/fs/udf: udf_vfsops.c udf_vnops.c
src/sys/fs/v7fs: v7fs_vnops.c
src/sys/kern: exec_subr.c vfs_cache.c vfs_getcwd.c vfs_mount.c
vfs_subr.c vfs_vnode.c vfs_vnops.c
src/sys/miscfs/fdesc: fdesc_vfsops.c
src/sys/miscfs/genfs: layer_subr.c layer_vnops.c
src/sys/miscfs/nullfs: null_vfsops.c
src/sys/miscfs/overlay: overlay_vfsops.c
src/sys/miscfs/umapfs: umap_vfsops.c
src/sys/nfs: nfs_vfsops.c nfs_vnops.c
src/sys/rump/librump/rumpvfs: rump_vfs.c rumpfs.c
src/sys/sys: vnode.h
src/sys/ufs/lfs: lfs_vnops.c
src/sys/ufs/mfs: mfs_vnops.c
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed().  Signature matches
FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
cvs rdiff -u -r1.15 -r1.16 src/external/cddl/osnet/sys/sys/vnode.h
cvs rdiff -u -r1.26 -r1.27 src/sys/coda/coda_namecache.c
cvs rdiff -u -r1.31 -r1.32 src/sys/coda/coda_subr.c
cvs rdiff -u -r1.110 -r1.111 src/sys/coda/coda_vnops.c
cvs rdiff -u -r1.57 -r1.58 src/sys/fs/msdosfs/msdosfs_denode.c
cvs rdiff -u -r1.134 -r1.135 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.100 -r1.101 src/sys/fs/msdosfs/msdosfs_vnops.c
cvs rdiff -u -r1.38 -r1.39 src/sys/fs/nilfs/nilfs_vnops.c
cvs rdiff -u -r1.109 -r1.110 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.57 -r1.58 src/sys/fs/ptyfs/ptyfs_vnops.c
cvs rdiff -u -r1.78 -r1.79 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.109 -r1.110 src/sys/fs/udf/udf_vnops.c
cvs rdiff -u -r1.27 -r1.28 src/sys/fs/v7fs/v7fs_vnops.c
cvs rdiff -u -r1.83 -r1.84 src/sys/kern/exec_subr.c
cvs rdiff -u -r1.138 -r1.139 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/vfs_getcwd.c
cvs rdiff -u -r1.77 -r1.78 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.484 -r1.485 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.119 -r1.120 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.95 -r1.96 src/sys/miscfs/fdesc/fdesc_vfsops.c
cvs rdiff -u -r1.37 -r1.38 src/sys/miscfs/genfs/layer_subr.c
cvs rdiff -u -r1.69 -r1.70 src/sys/miscfs/genfs/layer_vnops.c
cvs rdiff -u -r1.98 -r1.99 src/sys/miscfs/nullfs/null_vfsops.c
cvs rdiff -u -r1.70 -r1.71 src/sys/miscfs/overlay/overlay_vfsops.c
cvs rdiff -u -r1.102 -r1.103 src/sys/miscfs/umapfs/umap_vfsops.c
cvs rdiff -u -r1.240 -r1.241 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.313 -r1.314 src/sys/nfs/nfs_vnops.c
cvs rdiff -u -r1.90 -r1.91 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.155 -r1.156 src/sys/rump/librump/rumpvfs/rumpfs.c
cvs rdiff -u -r1.294 -r1.295 src/sys/sys/vnode.h
cvs rdiff -u -r1.331 -r1.332 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -u -r1.59 -r1.60 src/sys/ufs/mfs/mfs_vnops.c
cvs rdiff -u -r1.250 -r1.251 src/sys/ufs/ufs/ufs_vnops.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/zfs_vfsops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.26 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.27
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c:1.26	Fri Jan 17 20:08:06 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c	Mon Apr 13 19:23:17 2020
@@ -1994,7 +1994,7 @@ zfs_mount(vfs_t *vfsp, const char *path,
 	mutex_enter(mvp->v_interlock);
 	if ((uap->flags & MS_REMOUNT) == 0 &&
 	(uap->flags & MS_OVERLAY) == 0 &&
-	(mvp->v_count != 1 || (mvp->v_flag & VROOT))) {
+	(vrefcnt(mvp) != 1 || (mvp->v_flag & VROOT))) {
 		mutex_exit(mvp->v_interlock);
 		return (SET_ERROR(EBUSY));
 	}

Index: src/external/cddl/osnet/sys/sys/vnode.h
diff -u src/external/cddl/osnet/sys/sys/vnode.h:1.15 src/external/cddl/osnet/sys/sys/vnode.h:1.16
--- src/external/cddl/osnet/sys/sys/vnode.h:1.15	Sat Jan 12 10:44:36 2019
+++ src/external/cddl/osnet/sys/sys/vnode.h	Mon Apr 13 19:23:17 2020
@@ -1,5 +1,4 @@
-
-/*	$NetBSD: vnode.h,v 1.15 2019/01/12 10:44:36 hannken Exp $	*/
+/*	$NetBSD: vnode.h,v 1.16 2020/04/13 19:23:17 ad Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -156,7 +155,7 @@ int	vn_is_readonly(vnode_t *);
 #define	vn_vfsunlock(vp)	do { } while (0)
 #define	vn_ismntpt(vp)		((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL)
 #define	vn_mountedvfs(vp)	

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

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 16:29:59 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
make xbd(4) D_MPSAFE


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.105 src/sys/arch/xen/xen/xbd_xenbus.c:1.106
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.105	Sun Apr 12 20:17:36 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Mon Apr 13 16:29:59 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.105 2020/04/12 20:17:36 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.105 2020/04/12 20:17:36 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -109,7 +110,7 @@ struct xbd_req {
 	} req_rw;
 	struct {
 		int s_error;
-		volatile int s_done;
+		int s_done;
 	} req_sync;
 	} u;
 };
@@ -121,18 +122,20 @@ struct xbd_req {
 struct xbd_xenbus_softc {
 	struct dk_softc sc_dksc;	/* Must be first in this struct */
 	struct xenbus_device *sc_xbusd;
+	unsigned int sc_evtchn;
 
 	struct intrhand *sc_ih; /* Interrupt handler for this instance. */
-	
-	blkif_front_ring_t sc_ring;
-
-	unsigned int sc_evtchn;
+	kmutex_t sc_lock;
+	kcondvar_t sc_cache_flush_cv;
+	kcondvar_t sc_req_cv;
+	kcondvar_t sc_detach_cv;
+	kcondvar_t sc_suspend_cv;
 
+	blkif_front_ring_t sc_ring;
 	grant_ref_t sc_ring_gntref;
 
 	struct xbd_req sc_reqs[XBD_RING_SIZE];
 	SLIST_HEAD(,xbd_req) sc_xbdreq_head; /* list of free requests */
-	bool sc_xbdreq_wait; /* special waiting on xbd_req */
 
 	int sc_backend_status; /* our status with backend */
 #define BLKIF_STATE_DISCONNECTED 0
@@ -202,7 +205,7 @@ const struct bdevsw xbd_bdevsw = {
 	.d_dump = xbddump,
 	.d_psize = xbdsize,
 	.d_discard = nodiscard,
-	.d_flag = D_DISK
+	.d_flag = D_DISK | D_MPSAFE
 };
 
 const struct cdevsw xbd_cdevsw = {
@@ -217,7 +220,7 @@ const struct cdevsw xbd_cdevsw = {
 	.d_mmap = nommap,
 	.d_kqfilter = nokqfilter,
 	.d_discard = nodiscard,
-	.d_flag = D_DISK
+	.d_flag = D_DISK | D_MPSAFE
 };
 
 extern struct cfdriver xbd_cd;
@@ -268,6 +271,12 @@ xbd_xenbus_attach(device_t parent, devic
 	sc->sc_xbusd = xa->xa_xbusd;
 	sc->sc_xbusd->xbusd_otherend_changed = xbd_backend_changed;
 
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_BIO);
+	cv_init(>sc_cache_flush_cv, "xbdsync");
+	cv_init(>sc_req_cv, "xbdreq");
+	cv_init(>sc_detach_cv, "xbddetach");
+	cv_init(>sc_suspend_cv, "xbdsuspend");
+
 	/* initialize free requests list */
 	SLIST_INIT(>sc_xbdreq_head);
 	for (i = 0; i < XBD_RING_SIZE; i++) {
@@ -313,37 +322,43 @@ static int
 xbd_xenbus_detach(device_t dev, int flags)
 {
 	struct xbd_xenbus_softc *sc = device_private(dev);
-	int bmaj, cmaj, i, mn, rc, s;
+	int bmaj, cmaj, i, mn, rc;
+
+	DPRINTF(("%s: xbd_detach\n", device_xname(dev)));
 
 	rc = disk_begindetach(>sc_dksc.sc_dkdev, NULL, dev, flags);
 	if (rc != 0)
 		return rc;
 
-	s = splbio(); /* XXXSMP */
-	DPRINTF(("%s: xbd_detach\n", device_xname(dev)));
+	mutex_enter(>sc_lock);
 	if (sc->sc_shutdown == BLKIF_SHUTDOWN_RUN) {
 		sc->sc_shutdown = BLKIF_SHUTDOWN_LOCAL;
+
 		/* wait for requests to complete */
 		while (sc->sc_backend_status == BLKIF_STATE_CONNECTED &&
 		disk_isbusy(>sc_dksc.sc_dkdev)) {
-			/* XXXSMP */
-			tsleep(xbd_xenbus_detach, PRIBIO, "xbddetach", hz/2);
+			cv_timedwait(>sc_detach_cv, >sc_lock, hz/2);
 		}
+		mutex_exit(>sc_lock);
 
+		/* Trigger state transition with backend */
 		xenbus_switch_state(sc->sc_xbusd, NULL, XenbusStateClosing);
+
+		mutex_enter(>sc_lock);
 	}
 	if ((flags & DETACH_FORCE) == 0) {
 		/* xbd_xenbus_detach already in progress */
-		wakeup(xbd_xenbus_detach); /* XXXSMP */
-		splx(s);
+		cv_broadcast(>sc_detach_cv);
+		mutex_exit(>sc_lock);
 		return EALREADY;
 	}
+	mutex_exit(>sc_lock);
 	while (xenbus_read_driver_state(sc->sc_xbusd->xbusd_otherend)
 	!= XenbusStateClosed) {
-		/* XXXSMP */
-		tsleep(xbd_xenbus_detach, PRIBIO, "xbddetach2", hz/2);
+		mutex_enter(>sc_lock);
+		cv_timedwait(>sc_detach_cv, >sc_lock, hz/2);
+		mutex_exit(>sc_lock);
 	}
-	splx(s);
 
 	/* locate the major number */
 	bmaj = bdevsw_lookup_major(_bdevsw);
@@ -355,6 +370,7 @@ xbd_xenbus_detach(device_t dev, int flag
 		vdevgone(bmaj, mn, mn, VBLK);
 		vdevgone(cmaj, mn, mn, VCHR);
 	}
+
 	if (sc->sc_backend_status == BLKIF_STATE_CONNECTED) {
 		/* Delete all of our wedges. */
 		dkwedge_delall(>sc_dksc.sc_dkdev);
@@ -372,10 +388,10 @@ xbd_xenbus_detach(device_t dev, int flag
 	

CVS commit: src/sys/kern

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 16:09:22 UTC 2020

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

Log Message:
Use relaxed atomics on spc_mcount.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/kern/kern_runq.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_runq.c
diff -u src/sys/kern/kern_runq.c:1.66 src/sys/kern/kern_runq.c:1.67
--- src/sys/kern/kern_runq.c:1.66	Mon Apr 13 15:54:45 2020
+++ src/sys/kern/kern_runq.c	Mon Apr 13 16:09:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.67 2020/04/13 16:09:21 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.67 2020/04/13 16:09:21 maxv Exp $");
 
 #include "opt_dtrace.h"
 
@@ -214,8 +214,10 @@ sched_enqueue(struct lwp *l)
 	}
 	spc->spc_flags &= ~SPCF_IDLE;
 	spc->spc_count++;
-	if ((l->l_pflag & LP_BOUND) == 0)
-		spc->spc_mcount++;
+	if ((l->l_pflag & LP_BOUND) == 0) {
+		atomic_store_relaxed(>spc_mcount,
+		atomic_load_relaxed(>spc_mcount) + 1);
+	}
 
 	/*
 	 * Update the value of highest priority in the runqueue,
@@ -249,8 +251,10 @@ sched_dequeue(struct lwp *l)
 		spc->spc_migrating = NULL;
 
 	spc->spc_count--;
-	if ((l->l_pflag & LP_BOUND) == 0)
-		spc->spc_mcount--;
+	if ((l->l_pflag & LP_BOUND) == 0) {
+		atomic_store_relaxed(>spc_mcount,
+		atomic_load_relaxed(>spc_mcount) - 1);
+	}
 
 	q_head = sched_getrq(spc, eprio);
 	TAILQ_REMOVE(q_head, l, l_runq);
@@ -641,7 +645,7 @@ sched_catchlwp(struct cpu_info *ci)
 	gentle = ((curspc->spc_flags & SPCF_1STCLASS) == 0 ||
 	(spc->spc_flags & SPCF_1STCLASS) != 0);
 
-	if (spc->spc_mcount < (gentle ? min_catch : 1) ||
+	if (atomic_load_relaxed(>spc_mcount) < (gentle ? min_catch : 1) ||
 	curspc->spc_psid != spc->spc_psid) {
 		spc_unlock(ci);
 		return NULL;
@@ -772,7 +776,8 @@ sched_steal(struct cpu_info *ci, struct 
 
 	spc = >ci_schedstate;
 	tspc = >ci_schedstate;
-	if (tspc->spc_mcount != 0 && spc->spc_psid == tspc->spc_psid) {
+	if (atomic_load_relaxed(>spc_mcount) != 0 &&
+	spc->spc_psid == tspc->spc_psid) {
 		spc_dlock(ci, tci);
 		l = sched_catchlwp(tci);
 		spc_unlock(ci);
@@ -856,7 +861,7 @@ sched_idle(void)
 			tspc = >ci_schedstate;
 			if (ci == inner || ci == mci ||
 			spc->spc_psid != tspc->spc_psid ||
-			tspc->spc_mcount < min_catch) {
+			atomic_load_relaxed(>spc_mcount) < min_catch) {
 continue;
 			}
 			spc_dlock(ci, inner);



CVS commit: src/sys

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 15:54:45 UTC 2020

Modified Files:
src/sys/kern: kern_condvar.c kern_runq.c kern_sleepq.c kern_timeout.c
sched_m2.c vfs_mount.c vfs_vnode.c
src/sys/netinet: tcp_usrreq.c
src/sys/uvm: uvm_pdaemon.c

Log Message:
hardclock_ticks -> getticks()


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_condvar.c
cvs rdiff -u -r1.65 -r1.66 src/sys/kern/kern_runq.c
cvs rdiff -u -r1.64 -r1.65 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/kern_timeout.c
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/sched_m2.c
cvs rdiff -u -r1.76 -r1.77 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.118 -r1.119 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.225 -r1.226 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.125 -r1.126 src/sys/uvm/uvm_pdaemon.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_condvar.c
diff -u src/sys/kern/kern_condvar.c:1.45 src/sys/kern/kern_condvar.c:1.46
--- src/sys/kern/kern_condvar.c:1.45	Fri Apr 10 17:16:21 2020
+++ src/sys/kern/kern_condvar.c	Mon Apr 13 15:54:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_condvar.c,v 1.45 2020/04/10 17:16:21 ad Exp $	*/
+/*	$NetBSD: kern_condvar.c,v 1.46 2020/04/13 15:54:45 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.45 2020/04/10 17:16:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.46 2020/04/13 15:54:45 maxv Exp $");
 
 #include 
 #include 
@@ -340,13 +340,13 @@ cv_timedwaitbt(kcondvar_t *cv, kmutex_t 
 	KASSERTMSG(epsilon != NULL, "specify maximum requested delay");
 
 	/*
-	 * hardclock_ticks is technically int, but nothing special
+	 * getticks() is technically int, but nothing special
 	 * happens instead of overflow, so we assume two's-complement
 	 * wraparound and just treat it as unsigned.
 	 */
-	start = hardclock_ticks;
+	start = getticks();
 	error = cv_timedwait(cv, mtx, bintime2timo(bt));
-	end = hardclock_ticks;
+	end = getticks();
 
 	slept = timo2bintime(end - start);
 	/* bt := bt - slept */
@@ -383,13 +383,13 @@ cv_timedwaitbt_sig(kcondvar_t *cv, kmute
 	KASSERTMSG(epsilon != NULL, "specify maximum requested delay");
 
 	/*
-	 * hardclock_ticks is technically int, but nothing special
+	 * getticks() is technically int, but nothing special
 	 * happens instead of overflow, so we assume two's-complement
 	 * wraparound and just treat it as unsigned.
 	 */
-	start = hardclock_ticks;
+	start = getticks();
 	error = cv_timedwait_sig(cv, mtx, bintime2timo(bt));
-	end = hardclock_ticks;
+	end = getticks();
 
 	slept = timo2bintime(end - start);
 	/* bt := bt - slept */

Index: src/sys/kern/kern_runq.c
diff -u src/sys/kern/kern_runq.c:1.65 src/sys/kern/kern_runq.c:1.66
--- src/sys/kern/kern_runq.c:1.65	Sat Apr  4 20:17:58 2020
+++ src/sys/kern/kern_runq.c	Mon Apr 13 15:54:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.65 2020/04/04 20:17:58 ad Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.65 2020/04/04 20:17:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.66 2020/04/13 15:54:45 maxv Exp $");
 
 #include "opt_dtrace.h"
 
@@ -417,7 +417,7 @@ lwp_cache_hot(const struct lwp *l)
 	if (__predict_false(l->l_slptime != 0 || l->l_rticks == 0))
 		return false;
 
-	return (hardclock_ticks - l->l_rticks < mstohz(cacheht_time));
+	return (getticks() - l->l_rticks < mstohz(cacheht_time));
 }
 
 /*
@@ -840,10 +840,10 @@ sched_idle(void)
 	 * XXX Should probably look at 2nd class CPUs first, but they will
 	 * shed jobs via preempt() anyway.
 	 */
-	if (spc->spc_nextskim > hardclock_ticks) {
+	if (spc->spc_nextskim > getticks()) {
 		return;
 	}
-	spc->spc_nextskim = hardclock_ticks + mstohz(skim_interval);
+	spc->spc_nextskim = getticks() + mstohz(skim_interval);
 
 	/* In the outer loop scroll through all CPU packages, starting here. */
 	first = ci->ci_package1st;
@@ -1057,7 +1057,7 @@ sched_nextlwp(void)
 
 	/* Update the last run time on switch */
 	l = curlwp;
-	l->l_rticksum += (hardclock_ticks - l->l_rticks);
+	l->l_rticksum += (getticks() - l->l_rticks);
 
 	/* Return to idle LWP if there is a migrating thread */
 	spc = >ci_schedstate;
@@ -1075,7 +1075,7 @@ sched_nextlwp(void)
 	KASSERT(l != NULL);
 
 	sched_oncpu(l);
-	l->l_rticks = hardclock_ticks;
+	l->l_rticks = getticks();
 
 	return l;
 }
@@ -1204,7 +1204,7 @@ sched_print_runqueue(void (*pr)(const ch
 			l->l_flag, l->l_stat == LSRUN ? "RQ" :
 			(l->l_stat == LSSLEEP ? "SQ" : "-"),
 			l, ci->ci_index, (tci ? tci->ci_index : -1),
-			(u_int)(hardclock_ticks - l->l_rticks));
+			(u_int)(getticks() - l->l_rticks));
 		

CVS commit: src/doc

2020-04-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Apr 13 15:48:55 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-9.0.1


To generate a diff of this commit:
cvs rdiff -u -r1.1709 -r1.1710 src/doc/3RDPARTY
cvs rdiff -u -r1.2671 -r1.2672 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1709 src/doc/3RDPARTY:1.1710
--- src/doc/3RDPARTY:1.1709	Sun Apr  5 21:56:04 2020
+++ src/doc/3RDPARTY	Mon Apr 13 15:48:55 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1709 2020/04/05 21:56:04 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1710 2020/04/13 15:48:55 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	9.0.0
-Current Vers:	9.0.0
+Version:	9.0.1
+Current Vers:	9.0.1
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-04-02
+Date:		2020-04-13
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2671 src/doc/CHANGES:1.2672
--- src/doc/CHANGES:1.2671	Mon Apr 13 09:28:14 2020
+++ src/doc/CHANGES	Mon Apr 13 15:48:55 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2671 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2672 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -174,3 +174,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	aarch64: Add support for Branch Target Identification (BTI).
 		[maxv 20200413]
 	umass(4): Removed obsolete ISD-ATA support [jdolecek 202000413]
+	dhcpcd(8): Import version 9.0.1 [roy 20200413]



CVS commit: src/external/bsd/dhcpcd/dist

2020-04-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Apr 13 15:46:26 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
if-options.c ipv6.c ipv6.h ipv6nd.c script.c
Removed Files:
src/external/bsd/dhcpcd/dist/hooks: 00-linux 02-dump

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/dhcpcd/dist/hooks/00-linux \
src/external/bsd/dhcpcd/dist/hooks/02-dump
cvs rdiff -u -r1.34 -r1.35 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.32 -r1.33 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/if-bsd.c \
src/external/bsd/dhcpcd/dist/src/ipv6nd.c
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/dhcpcd/dist/src/ipv6.c \
src/external/bsd/dhcpcd/dist/src/ipv6.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/dhcpcd/dist/src/script.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/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.34 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.35
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.34	Thu Apr  2 12:41:48 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Mon Apr 13 15:46:26 2020
@@ -2301,7 +2301,7 @@ dhcp_bind(struct interface *ifp)
 	if (!state->lease.frominfo &&
 	!(ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC)))
 		if (write_lease(ifp, state->new, state->new_len) == -1)
-			logerr(__func__);
+			logerr("write_lease: %s", state->leasefile);
 
 	/* Close the BPF filter as we can now receive DHCP messages
 	 * on a UDP socket. */
@@ -3370,7 +3370,7 @@ is_packet_udp_bootp(void *packet, size_t
 	memcpy(, (char *)ip + ip_hlen, sizeof(udp));
 	if (ntohs(udp.uh_ulen) < sizeof(udp))
 		return false;
-	if (ip_hlen + (size_t)ntohs(udp.uh_ulen) > plen)
+	if (ip_hlen + ntohs(udp.uh_ulen) > plen)
 		return false;
 
 	/* Check it's to and from the right ports. */

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.16 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.17
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.16	Thu Apr  2 12:41:48 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Mon Apr 13 15:46:26 2020
@@ -2503,10 +2503,8 @@ dhcp6_writelease(const struct interface 
 	logdebugx("%s: writing lease `%s'", ifp->name, state->leasefile);
 
 	fd = open(state->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
-	if (fd == -1) {
-		logerr(__func__);
+	if (fd == -1)
 		return -1;
-	}
 	bytes = write(fd, state->new, state->new_len);
 	close(fd);
 	return bytes;
@@ -2710,7 +2708,7 @@ dhcp6_ifdelegateaddr(struct interface *i
 		vl |= sla->suffix;
 		be64enc(daddr.s6_addr + 8, vl);
 	} else {
-		dadcounter = ipv6_makeaddr(, ifp, , pfxlen);
+		dadcounter = ipv6_makeaddr(, ifp, , pfxlen, 0);
 		if (dadcounter == -1) {
 			logerrx("%s: error adding slaac to prefix_len %d",
 			ifp->name, pfxlen);
@@ -3162,7 +3160,8 @@ dhcp6_bind(struct interface *ifp, const 
 			ifp->name, state->expire);
 		rt_build(ifp->ctx, AF_INET6);
 		if (!confirmed && !timedout)
-			dhcp6_writelease(ifp);
+			if (dhcp6_writelease(ifp) == -1)
+logerr("dhcp6_writelease: %s",state->leasefile);
 #ifndef SMALL
 		dhcp6_delegate_prefix(ifp);
 #endif

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.32 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.33
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.32	Thu Apr  2 12:41:48 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Mon Apr 13 15:46:26 2020
@@ -781,8 +781,10 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *
 			 * maybe on a new network. */
 			ipv6nd_startexpire(ifp);
 #endif
+#ifdef IPV6_MANAGETEMPADDR
 			/* RFC4941 Section 3.5 */
-			ipv6_gentempifid(ifp);
+			ipv6_regentempaddrs(ifp);
+#endif
 #endif
 			dhcpcd_startinterface(ifp);
 		}
@@ -1552,26 +1554,39 @@ dhcpcd_handleargs(struct dhcpcd_ctx *ctx
 		ctx->options |= DHCPCD_DUMPLEASE;
 		size_t nifaces = 0;
 
-		for (oi = optind; oi < argc; oi++) {
-			if ((ifp = if_find(ctx->ifaces, argv[oi])) == NULL)
-continue;
+		TAILQ_FOREACH(ifp, ctx->ifaces, next) {
 			if (!ifp->active)
 continue;
-			opt = send_interface(NULL, ifp, af);
-			if (opt != -1)
+			for (oi = optind; oi < argc; oi++) {
+if (strcmp(ifp->name, argv[oi]) == 0)
+	break;
+			}
+			if (optind == argc || oi < argc) {
+opt = send_interface(NULL, ifp, af);
+if (opt == -1)
+	goto dumperr;
 nifaces += (size_t)opt;
+			}
 		}
 		if (write(fd->fd, , sizeof(nifaces)) != sizeof(nifaces))
-			return -1;
-		for (oi = optind; oi < argc; oi++) {
-			if ((ifp = if_find(ctx->ifaces, argv[oi])) == NULL)
-continue;
+			goto dumperr;
+		TAILQ_FOREACH(ifp, ctx->ifaces, next) {
 			if 

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

2020-04-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Apr 13 15:42:22 UTC 2020

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

Log Message:
Update to dhcpcd-9.0.1 with the following changes:

* privsep: Improve error when we don't have permission to write lease
  PR bin/55135
* privsep: Fix hooks restarting other daemons 

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_0_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
C src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
C src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

9 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/sys/dev/wsfb

2020-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 13 15:26:58 UTC 2020

Modified Files:
src/sys/dev/wsfb: genfb.c

Log Message:
 Get genfb's address offset correctly when the vaule >= 4G. OK's by jmcneill.

 Tested on Intel BXNUC10I3FNK (Comet Lake U).


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/wsfb/genfb.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/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.71 src/sys/dev/wsfb/genfb.c:1.72
--- src/sys/dev/wsfb/genfb.c:1.71	Sun Feb 23 14:44:23 2020
+++ src/sys/dev/wsfb/genfb.c	Mon Apr 13 15:26:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.71 2020/02/23 14:44:23 martin Exp $ */
+/*	$NetBSD: genfb.c,v 1.72 2020/04/13 15:26:57 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.71 2020/02/23 14:44:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.72 2020/04/13 15:26:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -102,7 +102,7 @@ genfb_init(struct genfb_softc *sc)
 {
 	prop_dictionary_t dict;
 	uint64_t cmap_cb, pmf_cb, mode_cb, bl_cb, br_cb, fbaddr;
-	uint32_t fboffset;
+	uint64_t fboffset;
 	bool console;
 
 	dict = device_properties(sc->sc_dev);
@@ -124,13 +124,12 @@ genfb_init(struct genfb_softc *sc)
 		return;
 	}
 
-	/* XXX should be a 64bit value */
-	if (!prop_dictionary_get_uint32(dict, "address", )) {
+	if (!prop_dictionary_get_uint64(dict, "address", )) {
 		GPRINTF("no address property\n");
 		return;
 	}
 
-	sc->sc_fboffset = fboffset;
+	sc->sc_fboffset = (bus_addr_t)fboffset;
 
 	sc->sc_fbaddr = NULL;
 	if (prop_dictionary_get_uint64(dict, "virtual_address", )) {



CVS commit: src/usr.sbin/rtsold

2020-04-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr 13 15:23:18 UTC 2020

Modified Files:
src/usr.sbin/rtsold: rtsold.8

Log Message:
Use .Dl for one line literal display.  Add SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/rtsold/rtsold.8

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/rtsold/rtsold.8
diff -u src/usr.sbin/rtsold/rtsold.8:1.37 src/usr.sbin/rtsold/rtsold.8:1.38
--- src/usr.sbin/rtsold/rtsold.8:1.37	Sun Oct 22 18:09:33 2017
+++ src/usr.sbin/rtsold/rtsold.8	Mon Apr 13 15:23:18 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtsold.8,v 1.37 2017/10/22 18:09:33 abhinav Exp $
+.\"	$NetBSD: rtsold.8,v 1.38 2020/04/13 15:23:18 uwe Exp $
 .\"	$KAME: rtsold.8,v 1.17 2001/07/09 22:30:37 itojun Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -48,6 +48,8 @@ as their functionality is now included i
 .Pp
 For example to send a routing solicitation message and print information
 about it without changing the actual routing table:
-.Bd -literal
-	dhcpcd -dB6T --nodhcp6 
-.Ed
+.Pp
+.Dl dhcpcd -dB6T --nodhcp6 < Ns Ar interface Ns \^>
+.\"
+.Sh SEE ALSO
+.Xr dhcpcd 8 .



CVS commit: src/sys/uvm

2020-04-13 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Apr 13 15:16:14 UTC 2020

Modified Files:
src/sys/uvm: uvm_pglist.h

Log Message:
Comments


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.h
diff -u src/sys/uvm/uvm_pglist.h:1.10 src/sys/uvm/uvm_pglist.h:1.11
--- src/sys/uvm/uvm_pglist.h:1.10	Sat Dec 28 08:33:35 2019
+++ src/sys/uvm/uvm_pglist.h	Mon Apr 13 15:16:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.h,v 1.10 2019/12/28 08:33:35 martin Exp $	*/
+/*	$NetBSD: uvm_pglist.h,v 1.11 2020/04/13 15:16:14 ad Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001, 2008, 2019 The NetBSD Foundation, Inc.
@@ -49,7 +49,9 @@ LIST_HEAD(pgflist, vm_page);
  * pglist = _free[freelist].pgfl_buckets[bucket].pgb_color[color];
  *
  * Freelists provide a priority ordering of pages for allocation, based upon
- * how valuable they are for special uses (e.g. device driver DMA).
+ * how valuable they are for special uses (e.g.  device driver DMA).  MD
+ * code decides the number and structure of these.  They are always arranged
+ * in descending order of allocation priority.
  *
  * Pages are then grouped in buckets according to some common factor, for
  * example L2/L3 cache locality.  Each bucket has its own lock, and the
@@ -66,15 +68,10 @@ struct pgflbucket {
 };
 
 /*
- * At the root, the freelists.  MD code decides the number and structure of
- * these.  They are always arranged in descending order of allocation
- * priority.
- *
  * 8 buckets should be enough to cover most all current x86 systems (2019),
  * given the way package/core/smt IDs are structured on x86.  For systems
  * that report high package counts despite having a single physical CPU
- * package (e.g. Ampere eMAG) a little bit of sharing isn't going to hurt
- * in the least.
+ * package (e.g. Ampere eMAG) a little bit of sharing isn't going to hurt.
  */
 #define	PGFL_MAX_BUCKETS	8
 struct pgfreelist {



CVS commit: src/sys/netinet6

2020-04-13 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Mon Apr 13 14:04:27 UTC 2020

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

Log Message:
Fix default route selection

The primary issue was that in revision 1.79 a check was added in the
nd6_defrouter_select() search loop to ignore the entry if RA processing
is enabled on its interface.  In practice this results in all entries
being ignored.

This fix reverses the condition, so that an entry is ignored when RA
processing is NOT enabled on its interface.  Further, the entry is
only ignored for being selected as the default router.  The currently
installed router must be identified regardless of the (current) status
of its interface, so that we can delete the route before installing a
new one.

I also added error logging when adding or deleting a route fails. This
should help the administrator (or kernel developer) in noticing possible
problems.

Finally, if deleting a route fails, the corresponding default route
entry no longer has its "installed" flag cleared, so that deletion will
be retried.  At a minimum, this will cause repeated messages about the
failed deletion as opposed to only getting repeated messages about the
installation of a new default route failing.

Fixes PR kern/55091 and also PR bin/54997 as far as the behaviour
observed with ndp(8).


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/netinet6/nd6_rtr.c

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

Modified files:

Index: src/sys/netinet6/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.147 src/sys/netinet6/nd6_rtr.c:1.148
--- src/sys/netinet6/nd6_rtr.c:1.147	Fri Dec 27 10:17:56 2019
+++ src/sys/netinet6/nd6_rtr.c	Mon Apr 13 14:04:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_rtr.c,v 1.147 2019/12/27 10:17:56 msaitoh Exp $	*/
+/*	$NetBSD: nd6_rtr.c,v 1.148 2020/04/13 14:04:27 kim Exp $	*/
 /*	$KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.147 2019/12/27 10:17:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.148 2020/04/13 14:04:27 kim Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -487,6 +487,11 @@ defrouter_addreq(struct nd_defrouter *ne
 	if (error == 0) {
 		nd6_numroutes++;
 		newdr->installed = 1;
+	} else {
+		char ip6buf[INET6_ADDRSTRLEN];
+		log(LOG_ERR, "defrouter_addreq: "
+		"error %d adding default router %s on %s\n",
+		error, IN6_PRINT(ip6buf, >rtaddr), newdr->ifp->if_xname);
 	}
 #ifndef NET_MPSAFE
 	splx(s);
@@ -596,10 +601,15 @@ defrouter_delreq(struct nd_defrouter *dr
 
 	error = rtrequest_newmsg(RTM_DELETE, , , ,
 	RTF_GATEWAY);
-	if (error == 0)
+	if (error == 0) {
 		nd6_numroutes--;
-
-	dr->installed = 0;
+		dr->installed = 0;
+	} else {
+		char ip6buf[INET6_ADDRSTRLEN];
+		log(LOG_ERR, "defrouter_delreq: "
+		"error %d deleting default router %s on %s\n",
+		error, IN6_PRINT(ip6buf, >rtaddr), dr->ifp->if_xname);
+	}
 }
 
 /*
@@ -675,14 +685,6 @@ nd6_defrouter_select(void)
 	 * the ordering rule of the list described in defrtrlist_update().
 	 */
 	ND_DEFROUTER_LIST_FOREACH(dr) {
-		ndi = ND_IFINFO(dr->ifp);
-		if (nd6_accepts_rtadv(ndi))
-			continue;
-
-		if (selected_dr == NULL &&
-		nd6_is_llinfo_probreach(dr))
-			selected_dr = dr;
-
 		if (dr->installed && !installed_dr)
 			installed_dr = dr;
 		else if (dr->installed && installed_dr) {
@@ -690,6 +692,14 @@ nd6_defrouter_select(void)
 			log(LOG_ERR, "nd6_defrouter_select: more than one router"
 			" is installed\n");
 		}
+
+		ndi = ND_IFINFO(dr->ifp);
+		if (!nd6_accepts_rtadv(ndi))
+			continue;
+
+		if (selected_dr == NULL &&
+		nd6_is_llinfo_probreach(dr))
+			selected_dr = dr;
 	}
 	/*
 	 * If none of the default routers was found to be reachable,



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

2020-04-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 13 12:14:56 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: gicv3.c

Log Message:
Apply similar fix from gic.c that fixed "left shift of 255 by 24 places
cannot be represented in type 'int'" warnings from UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/cortex/gicv3.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/cortex/gicv3.c
diff -u src/sys/arch/arm/cortex/gicv3.c:1.24 src/sys/arch/arm/cortex/gicv3.c:1.25
--- src/sys/arch/arm/cortex/gicv3.c:1.24	Thu Feb 13 02:12:06 2020
+++ src/sys/arch/arm/cortex/gicv3.c	Mon Apr 13 12:14:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.24 2020/02/13 02:12:06 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.25 2020/04/13 12:14:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -31,7 +31,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.24 2020/02/13 02:12:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.25 2020/04/13 12:14:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -178,7 +178,7 @@ gicv3_establish_irq(struct pic_softc *pi
 			gicr_write_4(sc, n, GICR_ICFGRn(is->is_irq / 16), icfg);
 
 			ipriority = gicr_read_4(sc, n, GICR_IPRIORITYRn(is->is_irq / 4));
-			ipriority &= ~(0xff << ipriority_shift);
+			ipriority &= ~(0xffU << ipriority_shift);
 			ipriority |= (ipriority_val << ipriority_shift);
 			gicr_write_4(sc, n, GICR_IPRIORITYRn(is->is_irq / 4), ipriority);
 		}
@@ -202,7 +202,7 @@ gicv3_establish_irq(struct pic_softc *pi
 
 		/* Update interrupt priority */
 		ipriority = gicd_read_4(sc, GICD_IPRIORITYRn(is->is_irq / 4));
-		ipriority &= ~(0xff << ipriority_shift);
+		ipriority &= ~(0xffU << ipriority_shift);
 		ipriority |= (ipriority_val << ipriority_shift);
 		gicd_write_4(sc, GICD_IPRIORITYRn(is->is_irq / 4), ipriority);
 	}
@@ -277,7 +277,7 @@ gicv3_redist_enable(struct gicv3_softc *
 		for (o = 0; o < 4; o++, byte_shift += 8) {
 			struct intrsource * const is = sc->sc_pic.pic_sources[n + o];
 			if (is == NULL)
-priority |= 0xff << byte_shift;
+priority |= (0xffU << byte_shift);
 			else {
 const u_int ipriority_val = IPL_TO_PRIORITY(sc, is->is_ipl);
 priority |= ipriority_val << byte_shift;



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

2020-04-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 13 12:14:04 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: gic.c

Log Message:
Fix "left shift of 255 by 24 places cannot be represented in type 'int'"
warning from UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/cortex/gic.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/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.38 src/sys/arch/arm/cortex/gic.c:1.39
--- src/sys/arch/arm/cortex/gic.c:1.38	Fri Nov 16 23:25:09 2018
+++ src/sys/arch/arm/cortex/gic.c	Mon Apr 13 12:14:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.38 2018/11/16 23:25:09 jmcneill Exp $	*/
+/*	$NetBSD: gic.c,v 1.39 2020/04/13 12:14:04 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.38 2018/11/16 23:25:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.39 2020/04/13 12:14:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -415,7 +415,7 @@ armgic_establish_irq(struct pic_softc *p
 		 * There are 4 irqs per TARGETS register.  For now bind
 		 * to the primary cpu.
 		 */
-		targets &= ~(0xff << byte_shift);
+		targets &= ~(0xffU << byte_shift);
 #if 0
 #ifdef MULTIPROCESSOR
 		if (is->is_mpsafe) {
@@ -455,7 +455,7 @@ armgic_establish_irq(struct pic_softc *p
 	 */
 	const bus_size_t priority_reg = GICD_IPRIORITYRn(is->is_irq / 4);
 	uint32_t priority = gicd_read(sc, priority_reg);
-	priority &= ~(0xff << byte_shift);
+	priority &= ~(0xffU << byte_shift);
 	priority |= armgic_ipl_to_priority(is->is_ipl) << byte_shift;
 	gicd_write(sc, priority_reg, priority);
 }



CVS commit: src/sys/dev/acpi

2020-04-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 13 12:08:06 UTC 2020

Modified Files:
src/sys/dev/acpi: acpi_mcfg.c

Log Message:
Work around a compiler issue when building on aarch64 with KUBSAN.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/acpi/acpi_mcfg.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/acpi/acpi_mcfg.c
diff -u src/sys/dev/acpi/acpi_mcfg.c:1.18 src/sys/dev/acpi/acpi_mcfg.c:1.19
--- src/sys/dev/acpi/acpi_mcfg.c:1.18	Sun Feb  2 16:31:25 2020
+++ src/sys/dev/acpi/acpi_mcfg.c	Mon Apr 13 12:08:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.18 2020/02/02 16:31:25 jmcneill Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.19 2020/04/13 12:08:05 jmcneill Exp $	*/
 
 /*-
  * Copyright (C) 2015 NONAKA Kimihiro 
@@ -28,7 +28,7 @@
 #include "opt_pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.18 2020/02/02 16:31:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.19 2020/04/13 12:08:05 jmcneill Exp $");
 
 #include 
 #include 
@@ -750,7 +750,8 @@ acpimcfg_configure_bus_cb(ACPI_RESOURCE 
 		}
 		ex = pcires->memext;
 		s = "non-prefetchable";
-	} else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) {
+	} else {
+		KASSERT(res->Data.Address.ResourceType == ACPI_IO_RANGE);
 		if (pcires->ioext == NULL) {
 			pcires->ioext = extent_create("pciio", 0, ULONG_MAX,
 			NULL, 0, EX_WAITOK);
@@ -764,7 +765,6 @@ acpimcfg_configure_bus_cb(ACPI_RESOURCE 
 		}
 		ex = pcires->ioext;
 		s = "i/o";
-		
 	}
 
 	switch (res->Type) {



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

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 11:44:20 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add KUBSAN.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/evbarm/conf/GENERIC64

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/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.151 src/sys/arch/evbarm/conf/GENERIC64:1.152
--- src/sys/arch/evbarm/conf/GENERIC64:1.151	Mon Apr 13 05:40:26 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Mon Apr 13 11:44:20 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.151 2020/04/13 05:40:26 maxv Exp $
+#	$NetBSD: GENERIC64,v 1.152 2020/04/13 11:44:20 maxv Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -172,6 +172,11 @@ options 	INCLUDE_CONFIG_FILE
 #makeoptions 	ARMV85_BTI=1
 #options 	ARMV85_BTI
 
+# Kernel Undefined Behavior Sanitizer (kUBSan). Use UBSAN_ALWAYS_FATAL
+# if you want panics instead of warnings.
+#options 	KUBSAN			# mandatory
+#options 	UBSAN_ALWAYS_FATAL	# optional
+
 # Kernel Address Sanitizer (kASan). The quarantine is optional and can
 # help KASAN find more use-after-frees. Use KASAN_PANIC if you want panics
 # instead of warnings.



CVS commit: src/sys/ddb

2020-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 13 11:43:27 UTC 2020

Modified Files:
src/sys/ddb: db_command.c

Log Message:
Handle "no count" properly in db_kernhist_print_cmd


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/ddb/db_command.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.169 src/sys/ddb/db_command.c:1.170
--- src/sys/ddb/db_command.c:1.169	Tue Mar 10 15:58:36 2020
+++ src/sys/ddb/db_command.c	Mon Apr 13 11:43:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.169 2020/03/10 15:58:36 christos Exp $	*/
+/*	$NetBSD: db_command.c,v 1.170 2020/04/13 11:43:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.169 2020/03/10 15:58:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.170 2020/04/13 11:43:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1290,6 +1290,10 @@ db_kernhist_print_cmd(db_expr_t addr, bo
 
 	if (!have_addr)
 		addr = 0;
+
+	if (count == -1)
+		count = 0;
+
 	kernhist_print((void *)(uintptr_t)addr, count, modif, db_printf);
 }
 #endif



CVS commit: src/sys/rump/dev/lib/libumass

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 11:27:22 UTC 2020

Modified Files:
src/sys/rump/dev/lib/libumass: Makefile

Log Message:
unhook umass_isdata.c from here too


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/dev/lib/libumass/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/rump/dev/lib/libumass/Makefile
diff -u src/sys/rump/dev/lib/libumass/Makefile:1.10 src/sys/rump/dev/lib/libumass/Makefile:1.11
--- src/sys/rump/dev/lib/libumass/Makefile:1.10	Mon Oct 19 16:16:34 2015
+++ src/sys/rump/dev/lib/libumass/Makefile	Mon Apr 13 11:27:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2015/10/19 16:16:34 pooka Exp $
+#	$NetBSD: Makefile,v 1.11 2020/04/13 11:27:22 jdolecek Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../dev/usb
@@ -9,7 +9,7 @@ COMMENT=USB mass storage driver
 IOCONF=	UMASS.ioconf
 
 .if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
-SRCS=	umass.c umass_isdata.c umass_quirks.c umass_scsipi.c
+SRCS=	umass.c umass_quirks.c umass_scsipi.c
 
 SRCS+=	umass_component.c
 .else



CVS commit: src/share/man/man4

2020-04-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Apr 13 11:17:28 UTC 2020

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

Log Message:
Add xref to umodem(4).  Mistake picked up by wizd(8), but somewhat
unexpectedly it didn't correct the reference to the one I meant but
got wrong.  Need to remember to file a bug report against wizd(8).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/uxrcom.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/uxrcom.4
diff -u src/share/man/man4/uxrcom.4:1.3 src/share/man/man4/uxrcom.4:1.4
--- src/share/man/man4/uxrcom.4:1.3	Mon Apr 13 08:46:39 2020
+++ src/share/man/man4/uxrcom.4	Mon Apr 13 11:17:27 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uxrcom.4,v 1.3 2020/04/13 08:46:39 wiz Exp $
+.\"	$NetBSD: uxrcom.4,v 1.4 2020/04/13 11:17:27 simonb Exp $
 .\"	$OpenBSD: uxrcom.4,v 1.1 2019/03/27 22:11:21 kettenis Exp $
 .\"
 .\" Copyright (c) 2019 Mark Kettenis 
@@ -50,6 +50,7 @@ which makes it behave like a
 .Xr tty 4 ,
 .Xr ucom 4 ,
 .Xr uhub 4 ,
+.Xr umodem 4 ,
 .Xr usb 4
 .Sh HISTORY
 The



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

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 09:30:42 UTC 2020

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

Log Message:
remove wd* at umass?, it was dropped


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/amd64/conf/ALL

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/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.147 src/sys/arch/amd64/conf/ALL:1.148
--- src/sys/arch/amd64/conf/ALL:1.147	Wed Mar 25 17:06:17 2020
+++ src/sys/arch/amd64/conf/ALL	Mon Apr 13 09:30:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.147 2020/03/25 17:06:17 jdolecek Exp $
+# $NetBSD: ALL,v 1.148 2020/04/13 09:30:42 jdolecek Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.147 $"
+#ident		"ALL-$Revision: 1.148 $"
 
 maxusers	64		# estimated number of users
 
@@ -1198,7 +1198,6 @@ uhso*	at uhub? port ? configuration ?
 
 # USB Mass Storage
 umass*	at uhub? port ? configuration ? interface ?
-wd*	at umass?
 
 # USB audio
 uaudio* at uhub? port ? configuration ?



CVS commit: src/sys/dev

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 10:49:35 UTC 2020

Modified Files:
src/sys/dev/ata: ata.c ata_recovery.c ata_wdc.c atavar.h satapmp_subr.c
wd.c
src/sys/dev/ic: ahcisata_core.c mvsata.c siisata.c wdc.c wdcvar.h
src/sys/dev/scsipi: atapi_wdc.c

Log Message:
fix use-after-free for ata xfer on bio submission found by KASAN

driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself

PR kern/55169 by Nick Hudson


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ata/ata_recovery.c
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ata/satapmp_subr.c
cvs rdiff -u -r1.461 -r1.462 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.298 -r1.299 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/ic/wdcvar.h
cvs rdiff -u -r1.137 -r1.138 src/sys/dev/scsipi/atapi_wdc.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.154 src/sys/dev/ata/ata.c:1.155
--- src/sys/dev/ata/ata.c:1.154	Sat Apr  4 21:36:15 2020
+++ src/sys/dev/ata/ata.c	Mon Apr 13 10:49:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.154 2020/04/04 21:36:15 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.155 2020/04/13 10:49:34 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.154 2020/04/04 21:36:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.155 2020/04/13 10:49:34 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -847,13 +847,8 @@ ata_get_params(struct ata_drive_datas *d
 	xfer->c_ata_c.flags = AT_READ | flags;
 	xfer->c_ata_c.data = tb;
 	xfer->c_ata_c.bcount = ATA_BSIZE;
-	if ((*atac->atac_bustype_ata->ata_exec_command)(drvp,
-		xfer) != ATACMD_COMPLETE) {
-		ATADEBUG_PRINT(("ata_get_parms: wdc_exec_command failed\n"),
-		DEBUG_FUNCS|DEBUG_PROBE);
-		rv = CMD_AGAIN;
-		goto out;
-	}
+	(*atac->atac_bustype_ata->ata_exec_command)(drvp, xfer);
+	ata_wait_cmd(chp, xfer);
 	if (xfer->c_ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
 		ATADEBUG_PRINT(("ata_get_parms: ata_c.flags=0x%x\n",
 		xfer->c_ata_c.flags), DEBUG_FUNCS|DEBUG_PROBE);
@@ -937,11 +932,8 @@ ata_set_mode(struct ata_drive_datas *drv
 	xfer->c_ata_c.r_count = mode;
 	xfer->c_ata_c.flags = flags;
 	xfer->c_ata_c.timeout = 1000; /* 1s */
-	if ((*atac->atac_bustype_ata->ata_exec_command)(drvp,
-		xfer) != ATACMD_COMPLETE) {
-		rv = CMD_AGAIN;
-		goto out;
-	}
+	(*atac->atac_bustype_ata->ata_exec_command)(drvp, xfer);
+	ata_wait_cmd(chp, xfer);
 	if (xfer->c_ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
 		rv = CMD_ERR;
 		goto out;

Index: src/sys/dev/ata/ata_recovery.c
diff -u src/sys/dev/ata/ata_recovery.c:1.3 src/sys/dev/ata/ata_recovery.c:1.4
--- src/sys/dev/ata/ata_recovery.c:1.3	Sat Apr  4 22:30:02 2020
+++ src/sys/dev/ata/ata_recovery.c	Mon Apr 13 10:49:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_recovery.c,v 1.3 2020/04/04 22:30:02 jdolecek Exp $	*/
+/*	$NetBSD: ata_recovery.c,v 1.4 2020/04/13 10:49:34 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata_recovery.c,v 1.3 2020/04/04 22:30:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_recovery.c,v 1.4 2020/04/13 10:49:34 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -103,11 +103,9 @@ ata_read_log_ext_ncq(struct ata_drive_da
 	xfer->c_ata_c.data = tb;
 	xfer->c_ata_c.bcount = sizeof(chp->recovery_blk);
 
-	if ((*atac->atac_bustype_ata->ata_exec_command)(drvp,
-		xfer) != ATACMD_COMPLETE) {
-		rv = EAGAIN;
-		goto out;
-	}
+	(*atac->atac_bustype_ata->ata_exec_command)(drvp, xfer);
+	ata_wait_cmd(chp, xfer);
+
 	if (xfer->c_ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
 		rv = EINVAL;
 		goto out;

Index: src/sys/dev/ata/ata_wdc.c
diff -u src/sys/dev/ata/ata_wdc.c:1.114 src/sys/dev/ata/ata_wdc.c:1.115
--- src/sys/dev/ata/ata_wdc.c:1.114	Sat Apr  4 21:36:15 2020
+++ src/sys/dev/ata/ata_wdc.c	Mon Apr 13 10:49:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_wdc.c,v 1.114 

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

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 09:34:03 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: Makefile.amd64

Log Message:
Make KASAN compatible with LLVM. Same as GCC, except that LLVM aggressively
inlines the shadow checks, and this causes problems at boot time; so we
pass -asan-instrumentation-with-call-threshold=0 to force callbacks instead
of inlines.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/amd64/conf/Makefile.amd64

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/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.82 src/sys/arch/amd64/conf/Makefile.amd64:1.83
--- src/sys/arch/amd64/conf/Makefile.amd64:1.82	Sat Apr  4 07:03:57 2020
+++ src/sys/arch/amd64/conf/Makefile.amd64	Mon Apr 13 09:34:02 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.82 2020/04/04 07:03:57 maxv Exp $
+#	$NetBSD: Makefile.amd64,v 1.83 2020/04/13 09:34:02 maxv Exp $
 
 # Makefile for NetBSD
 #
@@ -49,12 +49,21 @@ CFLAGS+=  -mindirect-branch=thunk-in
 CFLAGS+=  -mindirect-branch-register
 .endif
 
-.if ${KASAN:U0} > 0 && ${HAVE_GCC:U0} > 0
+.if ${KASAN:U0} > 0
+.if ${HAVE_GCC:U0} > 0
 KASANFLAGS=	-fsanitize=kernel-address \
 		--param asan-globals=1 --param asan-stack=1 \
 		--param asan-instrument-allocas=1 \
 		-fsanitize-address-use-after-scope \
 		-fasan-shadow-offset=0xDFFF9000
+.elif ${HAVE_LLVM:Uno} == "yes"
+KASANFLAGS=	-fsanitize=kernel-address \
+		-mllvm -asan-globals=1 -mllvm -asan-stack=1 \
+		-mllvm -asan-instrument-dynamic-allocas=1 \
+		-mllvm -asan-use-after-scope=1 \
+		-mllvm -asan-instrumentation-with-call-threshold=0 \
+		-mllvm -asan-mapping-offset=0xDFFF9000
+.endif
 .for f in subr_asan.c subr_kcov.c
 KASANFLAGS.${f}=	# empty
 .endfor



CVS commit: src/sys/dev/usb

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 09:26:43 UTC 2020

Modified Files:
src/sys/dev/usb: FILES files.usb umass.c umass_quirks.c
Removed Files:
src/sys/dev/usb: umass_isdata.c umass_isdata.h

Log Message:
remove obsolete support for ISD-ATA umass(4) adapters


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/FILES
cvs rdiff -u -r1.173 -r1.174 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/umass.c
cvs rdiff -u -r1.44 -r0 src/sys/dev/usb/umass_isdata.c
cvs rdiff -u -r1.4 -r0 src/sys/dev/usb/umass_isdata.h
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/usb/umass_quirks.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/FILES
diff -u src/sys/dev/usb/FILES:1.14 src/sys/dev/usb/FILES:1.15
--- src/sys/dev/usb/FILES:1.14	Wed Jan 29 18:39:04 2020
+++ src/sys/dev/usb/FILES	Mon Apr 13 09:26:43 2020
@@ -45,8 +45,6 @@ ukbdmap.c		wscons key mapping for ukbd
 ukbdvar.h		API for ukbd.c
 ulpt.c			USB printer class driver
 umass.c			USB mass storage wire protocol driver
-umass_isdata.c		In-System Design ATA over bulk-only driver
-umass_isdata.h		  and definitions for it
 umass_quirks.c		Table of strange umass devices
 umass_quirks.h		  and definitions for it
 umass_scsipi.c		umass command protocol driver

Index: src/sys/dev/usb/files.usb
diff -u src/sys/dev/usb/files.usb:1.173 src/sys/dev/usb/files.usb:1.174
--- src/sys/dev/usb/files.usb:1.173	Sun Apr 12 01:10:54 2020
+++ src/sys/dev/usb/files.usb	Mon Apr 13 09:26:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.usb,v 1.173 2020/04/12 01:10:54 simonb Exp $
+#	$NetBSD: files.usb,v 1.174 2020/04/13 09:26:43 jdolecek Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -54,7 +54,6 @@ defflag opt_usb.h	UHSO_DEBUG: USB_DEBUG
 defflag opt_usb.h	UIPAD_DEBUG: USB_DEBUG
 defflag opt_usb.h	UIPAQ_DEBUG: USB_DEBUG
 defflag opt_usb.h	UIRDA_DEBUG: USB_DEBUG
-defflag opt_usb.h	UISDATA_DEBUG: USB_DEBUG
 defflag opt_usb.h	UKBD_DEBUG: USB_DEBUG
 defflag opt_usb.h	UKYOPON_DEBUG: USB_DEBUG
 defflag opt_usb.h	ULPT_DEBUG: USB_DEBUG
@@ -199,10 +198,9 @@ file	dev/usb/ulpt.c			ulpt			needs-flag
 
 
 # Mass storage
-device	umass: scsi, atapi, ata_hl
+device	umass: scsi, atapi
 attach	umass at usbifif
 file	dev/usb/umass.c			umass
-file	dev/usb/umass_isdata.c		umass & wd & atabus
 file	dev/usb/umass_quirks.c		umass
 file	dev/usb/umass_scsipi.c		umass & (scsibus | atapibus)
 

Index: src/sys/dev/usb/umass.c
diff -u src/sys/dev/usb/umass.c:1.183 src/sys/dev/usb/umass.c:1.184
--- src/sys/dev/usb/umass.c:1.183	Sat Mar 14 03:01:36 2020
+++ src/sys/dev/usb/umass.c	Mon Apr 13 09:26:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.183 2020/03/14 03:01:36 christos Exp $	*/
+/*	$NetBSD: umass.c,v 1.184 2020/04/13 09:26:43 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.183 2020/03/14 03:01:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.184 2020/04/13 09:26:43 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -132,7 +132,6 @@ __KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.
 
 #include "atapibus.h"
 #include "scsibus.h"
-#include "wd.h"
 
 #include 
 #include 
@@ -153,7 +152,6 @@ __KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -814,14 +812,6 @@ umass_attach(device_t parent, device_t s
 #endif
 		break;
 
-	case UMASS_CPROTO_ISD_ATA:
-#if NWD > 0 && NATABUS > 0
-		error = umass_isdata_attach(sc);
-#else
-		aprint_error_dev(self, "isdata not configured\n");
-#endif
-		break;
-
 	default:
 		aprint_error_dev(self, "command protocol=%#x not supported\n",
 		sc->sc_cmd);
@@ -918,14 +908,6 @@ umass_detach(device_t self, int flags)
 #endif
 			break;
 
-		case UMASS_CPROTO_ISD_ATA:
-#if NWD > 0
-			umass_isdata_detach(sc);
-#else
-			aprint_error_dev(self, "isdata not configured\n");
-#endif
-			break;
-
 		default:
 			/* nothing to do */
 			break;

Index: src/sys/dev/usb/umass_quirks.c
diff -u src/sys/dev/usb/umass_quirks.c:1.100 src/sys/dev/usb/umass_quirks.c:1.101
--- src/sys/dev/usb/umass_quirks.c:1.100	Sat Oct 28 00:37:12 2017
+++ src/sys/dev/usb/umass_quirks.c	Mon Apr 13 09:26:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass_quirks.c,v 1.100 2017/10/28 00:37:12 pgoyette Exp $	*/
+/*	$NetBSD: umass_quirks.c,v 1.101 2020/04/13 09:26:43 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.100 2017/10/28 00:37:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.101 2020/04/13 09:26:43 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -73,32 +73,6 @@ Static void umass_fixup_sony(struct umas
  * - 

CVS commit: src/share/man/man9

2020-04-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 13 08:59:14 UTC 2020

Modified Files:
src/share/man/man9: pool.9 pool_cache.9

Log Message:
Remove superfluous whitespace & macros.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/share/man/man9/pool.9
cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/pool_cache.9

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/man9/pool.9
diff -u src/share/man/man9/pool.9:1.48 src/share/man/man9/pool.9:1.49
--- src/share/man/man9/pool.9:1.48	Mon Apr 13 00:27:16 2020
+++ src/share/man/man9/pool.9	Mon Apr 13 08:59:14 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pool.9,v 1.48 2020/04/13 00:27:16 chs Exp $
+.\"	$NetBSD: pool.9,v 1.49 2020/04/13 08:59:14 wiz Exp $
 .\"
 .\" Copyright (c) 1997, 1998, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -193,7 +193,6 @@ The handle identifying the pool resource
 A pointer to a pool item previously obtained by
 .Fn pool_get .
 .El
-.Pp
 .Ss SETTING POOL RESOURCE WATERMARKS AND LIMITS
 A pool will attempt to increase its resource usage to keep up with the demand
 for its items.
@@ -218,7 +217,7 @@ and
 respectively.
 The defaults for these limits are
 .Dv 0
-and 
+and
 .Dv UINT_MAX ,
 respectively.
 Changing these limits will cause memory to be immediately allocated to the pool

Index: src/share/man/man9/pool_cache.9
diff -u src/share/man/man9/pool_cache.9:1.21 src/share/man/man9/pool_cache.9:1.22
--- src/share/man/man9/pool_cache.9:1.21	Mon Apr 13 00:27:16 2020
+++ src/share/man/man9/pool_cache.9	Mon Apr 13 08:59:14 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pool_cache.9,v 1.21 2020/04/13 00:27:16 chs Exp $
+.\"	$NetBSD: pool_cache.9,v 1.22 2020/04/13 08:59:14 wiz Exp $
 .\"
 .\" Copyright (c)2003 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -152,7 +152,6 @@ cache locality in multiprocessor systems
 .Pp
 Allocate and initialize a pool cache.
 The arguments are:
-.Pp
 .Bl -tag -width four
 .It Fa size
 .Pp



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

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 09:18:10 UTC 2020

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

Log Message:
drop note about wd not being supported for umass


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x68k/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/x68k/conf/GENERIC
diff -u src/sys/arch/x68k/conf/GENERIC:1.197 src/sys/arch/x68k/conf/GENERIC:1.198
--- src/sys/arch/x68k/conf/GENERIC:1.197	Wed Jan 29 18:39:03 2020
+++ src/sys/arch/x68k/conf/GENERIC	Mon Apr 13 09:18:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.197 2020/01/29 18:39:03 maya Exp $
+# $NetBSD: GENERIC,v 1.198 2020/04/13 09:18:10 jdolecek Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/x68k/conf/std.x68k"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.197 $"
+#ident 		"GENERIC-$Revision: 1.198 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -332,7 +332,7 @@ bmd*	at intio0 addr 0xecebf0		# Nereid
 # Option N.V. Wireless WAN modems
 #uhso*	at uhub? port ? configuration ?
 
-# USB Mass Storage; wd not supported
+# USB Mass Storage
 #umass*	at uhub? port ? configuration ? interface ?
 #atapibus* at umass?
 #scsibus* at umass?



CVS commit: src/doc

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 09:28:14 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
note removal of ISD-ATA for umass(4)


To generate a diff of this commit:
cvs rdiff -u -r1.2670 -r1.2671 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2670 src/doc/CHANGES:1.2671
--- src/doc/CHANGES:1.2670	Mon Apr 13 06:24:52 2020
+++ src/doc/CHANGES	Mon Apr 13 09:28:14 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2670 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2671 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -173,3 +173,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[maxv 20200412]
 	aarch64: Add support for Branch Target Identification (BTI).
 		[maxv 20200413]
+	umass(4): Removed obsolete ISD-ATA support [jdolecek 202000413]



CVS commit: src/share/man/man4

2020-04-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 13 08:46:39 UTC 2020

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

Log Message:
Fix date. Remove Xr to non-existent modem(4). Serial comma. Use more macros.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/uxrcom.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/uxrcom.4
diff -u src/share/man/man4/uxrcom.4:1.2 src/share/man/man4/uxrcom.4:1.3
--- src/share/man/man4/uxrcom.4:1.2	Sun Apr 12 02:04:12 2020
+++ src/share/man/man4/uxrcom.4	Mon Apr 13 08:46:39 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uxrcom.4,v 1.2 2020/04/12 02:04:12 simonb Exp $
+.\"	$NetBSD: uxrcom.4,v 1.3 2020/04/13 08:46:39 wiz Exp $
 .\"	$OpenBSD: uxrcom.4,v 1.1 2019/03/27 22:11:21 kettenis Exp $
 .\"
 .\" Copyright (c) 2019 Mark Kettenis 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: March 27 2019 $
+.Dd April 12, 2020
 .Dt UXRCOM 4
 .Os
 .Sh NAME
@@ -28,7 +28,7 @@
 The
 .Nm
 driver supports serial adapters based on the
-XR21V1410, XR21V1412 and XR21V1414 chipsets.
+XR21V1410, XR21V1412, and XR21V1414 chipsets.
 Devices range from single port to eight port (implemented as a
 USB hub and two
 .Nm
@@ -50,7 +50,6 @@ which makes it behave like a
 .Xr tty 4 ,
 .Xr ucom 4 ,
 .Xr uhub 4 ,
-.Xr modem 4 ,
 .Xr usb 4
 .Sh HISTORY
 The
@@ -77,4 +76,4 @@ The
 driver was written by
 by
 .An Simon Burge
-.Aq sim...@netbsd.org .
+.Aq Mt sim...@netbsd.org .



CVS commit: src/share/man/man4

2020-04-13 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 13 09:15:54 UTC 2020

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

Log Message:
remove the In-System design note, related code is about to be dropped and
it doesn't make sense to have a note about things we don't support


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man4/umass.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/umass.4
diff -u src/share/man/man4/umass.4:1.27 src/share/man/man4/umass.4:1.28
--- src/share/man/man4/umass.4:1.27	Mon Oct 29 21:03:16 2018
+++ src/share/man/man4/umass.4	Mon Apr 13 09:15:54 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: umass.4,v 1.27 2018/10/29 21:03:16 wiz Exp $
+.\" $NetBSD: umass.4,v 1.28 2020/04/13 09:15:54 jdolecek Exp $
 .\"
 .\" Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 23, 2018
+.Dd April 13, 2020
 .Dt UMASS 4
 .Os
 .Sh NAME
@@ -79,8 +79,3 @@ The
 .Nm
 driver appeared in
 .Nx 1.5 .
-.Sh NOTES
-The driver has some support for certain adapters from In-System
-Design that use the (non-standardized) ATA protocol over Bulk-Only.
-This hardware is very rare, and the support very likely no longer
-works after ATA subsystem redesign to support NCQ on October 7, 2017.



CVS commit: src/share/man/man4

2020-04-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 13 08:45:11 UTC 2020

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

Log Message:
Bump date for previous


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/ucom.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/ucom.4
diff -u src/share/man/man4/ucom.4:1.28 src/share/man/man4/ucom.4:1.29
--- src/share/man/man4/ucom.4:1.28	Sun Apr 12 01:10:54 2020
+++ src/share/man/man4/ucom.4	Mon Apr 13 08:45:11 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ucom.4,v 1.28 2020/04/12 01:10:54 simonb Exp $
+.\" $NetBSD: ucom.4,v 1.29 2020/04/13 08:45:11 wiz Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 5, 2019
+.Dd April 12, 2020
 .Dt UCOM 4
 .Os
 .Sh NAME



CVS commit: src/sys/uvm/pmap

2020-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 13 08:05:22 UTC 2020

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/uvm/pmap/pmap_synci.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap_synci.c
diff -u src/sys/uvm/pmap/pmap_synci.c:1.4 src/sys/uvm/pmap/pmap_synci.c:1.5
--- src/sys/uvm/pmap/pmap_synci.c:1.4	Wed Dec 18 11:27:56 2019
+++ src/sys/uvm/pmap/pmap_synci.c	Mon Apr 13 08:05:22 2020
@@ -29,7 +29,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_synci.c,v 1.4 2019/12/18 11:27:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_synci.c,v 1.5 2020/04/13 08:05:22 skrll Exp $");
 
 #define __PMAP_PRIVATE
 
@@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_synci.c
 #include 
 #include 
 #include 
- 
+
 #include 
 
 #if defined(MULTIPROCESSOR)



CVS commit: src/sys/dev

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 08:05:02 UTC 2020

Modified Files:
src/sys/dev: cgd.c ld.c md.c vnd.c
src/sys/dev/ata: wd.c
src/sys/dev/scsipi: cd.c sd.c

Log Message:
constify


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/cgd.c
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/ld.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/md.c
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/vnd.c
cvs rdiff -u -r1.460 -r1.461 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.343 -r1.344 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.328 -r1.329 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/cgd.c
diff -u src/sys/dev/cgd.c:1.124 src/sys/dev/cgd.c:1.125
--- src/sys/dev/cgd.c:1.124	Fri Mar 20 19:03:13 2020
+++ src/sys/dev/cgd.c	Mon Apr 13 08:05:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.124 2020/03/20 19:03:13 tnn Exp $ */
+/* $NetBSD: cgd.c,v 1.125 2020/04/13 08:05:02 maxv Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.124 2020/03/20 19:03:13 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.125 2020/04/13 08:05:02 maxv Exp $");
 
 #include 
 #include 
@@ -233,7 +233,7 @@ static int	cgdinit(struct cgd_softc *, c
 static void	cgd_cipher(struct cgd_softc *, void *, void *,
 			   size_t, daddr_t, size_t, int);
 
-static struct dkdriver cgddkdriver = {
+static const struct dkdriver cgddkdriver = {
 .d_minphys  = minphys,
 .d_open = cgdopen,
 .d_close = cgdclose,

Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.109 src/sys/dev/ld.c:1.110
--- src/sys/dev/ld.c:1.109	Sun Mar  1 03:21:54 2020
+++ src/sys/dev/ld.c	Mon Apr 13 08:05:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld.c,v 1.109 2020/03/01 03:21:54 riastradh Exp $	*/
+/*	$NetBSD: ld.c,v 1.110 2020/04/13 08:05:02 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.109 2020/03/01 03:21:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.110 2020/04/13 08:05:02 maxv Exp $");
 
 #include 
 #include 
@@ -110,7 +110,7 @@ const struct cdevsw ld_cdevsw = {
 	.d_flag = D_DISK | D_MPSAFE
 };
 
-static struct	dkdriver lddkdriver = {
+static const struct	dkdriver lddkdriver = {
 	.d_open = ldopen,
 	.d_close = ldclose,
 	.d_strategy = ldstrategy,

Index: src/sys/dev/md.c
diff -u src/sys/dev/md.c:1.83 src/sys/dev/md.c:1.84
--- src/sys/dev/md.c:1.83	Sat Jan 18 14:02:18 2020
+++ src/sys/dev/md.c	Mon Apr 13 08:05:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.83 2020/01/18 14:02:18 ad Exp $	*/
+/*	$NetBSD: md.c,v 1.84 2020/04/13 08:05:02 maxv Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.83 2020/01/18 14:02:18 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.84 2020/04/13 08:05:02 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_md.h"
@@ -131,7 +131,7 @@ const struct cdevsw md_cdevsw = {
 	.d_flag = D_DISK | D_MPSAFE
 };
 
-static struct dkdriver mddkdriver = {
+static const struct dkdriver mddkdriver = {
 	.d_strategy = mdstrategy,
 	.d_minphys = minphys
 };

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.275 src/sys/dev/vnd.c:1.276
--- src/sys/dev/vnd.c:1.275	Fri Apr 10 10:53:02 2020
+++ src/sys/dev/vnd.c	Mon Apr 13 08:05:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.275 2020/04/10 10:53:02 jdolecek Exp $	*/
+/*	$NetBSD: vnd.c,v 1.276 2020/04/13 08:05:02 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008, 2020 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.275 2020/04/10 10:53:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.276 2020/04/13 08:05:02 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -235,9 +235,9 @@ CFATTACH_DECL3_NEW(vnd, sizeof(struct vn
 vnd_match, vnd_attach, vnd_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
 
 static struct vnd_softc	*vnd_spawn(int);
-int	vnd_destroy(device_t);
+static int	vnd_destroy(device_t);
 
-static struct	dkdriver vnddkdriver = {
+static const struct	dkdriver vnddkdriver = {
 	.d_strategy = vndstrategy,
 	.d_minphys = minphys
 };
@@ -308,7 +308,7 @@ vnd_spawn(int unit)
 	return device_private(config_attach_pseudo(cf));
 }
 
-int
+static int
 vnd_destroy(device_t dev)
 {
 	int error;

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.460 src/sys/dev/ata/wd.c:1.461
--- src/sys/dev/ata/wd.c:1.460	Tue Apr  7 13:22:05 2020
+++ src/sys/dev/ata/wd.c	Mon Apr 13 08:05:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.460 2020/04/07 13:22:05 jdolecek Exp $ */
+/*	$NetBSD: wd.c,v 1.461 2020/04/13 08:05:02 maxv Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, 

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

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 07:32:36 UTC 2020

Modified Files:
src/sys/arch/aarch64/conf: Makefile.aarch64

Log Message:
Add KASAN instrumentation on on-stack VLAs, same as amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/conf/Makefile.aarch64

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/Makefile.aarch64
diff -u src/sys/arch/aarch64/conf/Makefile.aarch64:1.19 src/sys/arch/aarch64/conf/Makefile.aarch64:1.20
--- src/sys/arch/aarch64/conf/Makefile.aarch64:1.19	Mon Apr 13 05:40:25 2020
+++ src/sys/arch/aarch64/conf/Makefile.aarch64	Mon Apr 13 07:32:36 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.aarch64,v 1.19 2020/04/13 05:40:25 maxv Exp $
+#	$NetBSD: Makefile.aarch64,v 1.20 2020/04/13 07:32:36 maxv Exp $
 
 # Makefile for NetBSD
 #
@@ -55,6 +55,7 @@ CFLAGS+=	-mbranch-protection=bti
 .if ${KASAN:U0} > 0 && ${HAVE_GCC:U0} > 0
 KASANFLAGS=	-fsanitize=kernel-address \
 		--param asan-globals=1 --param asan-stack=1 \
+		--param asan-instrument-allocas=1 \
 		-fsanitize-address-use-after-scope \
 		-fasan-shadow-offset=0xDFFF6000
 .for f in subr_asan.c



CVS commit: src/sys/uvm

2020-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 13 07:11:08 UTC 2020

Modified Files:
src/sys/uvm: uvm_stat.h

Log Message:
Oops, forgot the empty macro version of UVMHIST_CALLARGS


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/uvm/uvm_stat.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/uvm/uvm_stat.h
diff -u src/sys/uvm/uvm_stat.h:1.53 src/sys/uvm/uvm_stat.h:1.54
--- src/sys/uvm/uvm_stat.h:1.53	Wed Apr  8 07:56:34 2020
+++ src/sys/uvm/uvm_stat.h	Mon Apr 13 07:11:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_stat.h,v 1.53 2020/04/08 07:56:34 skrll Exp $	*/
+/*	$NetBSD: uvm_stat.h,v 1.54 2020/04/13 07:11:08 skrll Exp $	*/
 
 /*
  * Copyright (c) 2011 Matthew R. Green
@@ -72,6 +72,7 @@
 #define UVMHIST_LINK_STATIC(NAME)
 #define UVMHIST_LOG(NAME,FMT,A,B,C,D)
 #define UVMHIST_CALLED(NAME)
+#define UVMHIST_CALLARGS(NAME,FMT,A,B,C,D)
 #define UVMHIST_FUNC(FNAME)
 
 #endif



CVS commit: src/sys

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 07:09:51 UTC 2020

Modified Files:
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/amd64/include: types.h
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include: bus_defs.h bus_funcs.h
src/sys/kern: subr_asan.c
Added Files:
src/sys/arch/arm/arm: bus_stubs.c

Log Message:
Add KASAN-DMA support on aarch64, same as amd64. Discussed with skrll@.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/arm/bus_stubs.c
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/include/bus_funcs.h
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/subr_asan.c

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

Modified files:

Index: src/sys/arch/aarch64/conf/files.aarch64
diff -u src/sys/arch/aarch64/conf/files.aarch64:1.20 src/sys/arch/aarch64/conf/files.aarch64:1.21
--- src/sys/arch/aarch64/conf/files.aarch64:1.20	Sat Feb 15 08:16:10 2020
+++ src/sys/arch/aarch64/conf/files.aarch64	Mon Apr 13 07:09:50 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.aarch64,v 1.20 2020/02/15 08:16:10 skrll Exp $
+#	$NetBSD: files.aarch64,v 1.21 2020/04/13 07:09:50 maxv Exp $
 
 defflag opt_cpuoptions.h	AARCH64_ALIGNMENT_CHECK
 defflag opt_cpuoptions.h	AARCH64_EL0_STACK_ALIGNMENT_CHECK
@@ -86,6 +86,7 @@ file	arch/aarch64/aarch64/bus_space_noti
 file	arch/arm/arm/arm_cpu_topology.c
 file	arch/arm/arm/arm_generic_dma.c
 file	arch/arm/arm/bootconfig.c
+file	arch/arm/arm/bus_stubs.c
 file	arch/arm/arm/cpu_subr.c
 file	arch/arm/arm32/bus_dma.c
 file	arch/aarch64/aarch64/aarch64_machdep.c

Index: src/sys/arch/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.65 src/sys/arch/amd64/include/types.h:1.66
--- src/sys/arch/amd64/include/types.h:1.65	Tue Mar 17 17:18:49 2020
+++ src/sys/arch/amd64/include/types.h	Mon Apr 13 07:09:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.65 2020/03/17 17:18:49 maxv Exp $	*/
+/*	$NetBSD: types.h,v 1.66 2020/04/13 07:09:50 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -109,7 +109,6 @@ typedef	unsigned char		__cpu_simple_lock
 #include "opt_kmsan.h"
 #ifdef KASAN
 #define __HAVE_KASAN_INSTR_BUS
-#define __HAVE_KASAN_INSTR_DMA
 #endif
 #if defined(__x86_64__) && !defined(XENPV)
 #if !defined(KASAN) && !defined(KMSAN)

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.155 src/sys/arch/arm/conf/files.arm:1.156
--- src/sys/arch/arm/conf/files.arm:1.155	Mon Apr 13 05:40:25 2020
+++ src/sys/arch/arm/conf/files.arm	Mon Apr 13 07:09:51 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.155 2020/04/13 05:40:25 maxv Exp $
+#	$NetBSD: files.arm,v 1.156 2020/04/13 07:09:51 maxv Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -158,6 +158,8 @@ define	bus_space_generic
 file	arch/arm/arm/bus_space_asm_generic.S	bus_space_generic
 file	arch/arm/arm/bus_space_notimpl.S	arm32
 
+file	arch/arm/arm/bus_stubs.c
+
 file	arch/arm/arm/arm_cpu_topology.c
 file	arch/arm/arm/arm_machdep.c
 file	arch/arm/arm/ast.c

Index: src/sys/arch/arm/include/bus_defs.h
diff -u src/sys/arch/arm/include/bus_defs.h:1.14 src/sys/arch/arm/include/bus_defs.h:1.15
--- src/sys/arch/arm/include/bus_defs.h:1.14	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/arm/include/bus_defs.h	Mon Apr 13 07:09:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.14 2019/12/28 17:19:43 jmcneill Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.15 2020/04/13 07:09:51 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -66,6 +66,7 @@
 
 #if defined(_KERNEL_OPT)
 #include "opt_arm_bus_space.h"
+#include "opt_kasan.h"
 #endif
 
 /*
@@ -484,6 +485,11 @@ struct arm32_bus_dmamap {
 	/*
 	 * PUBLIC MEMBERS: these are used by machine-independent code.
 	 */
+#if defined(KASAN)
+	void		*dm_buf;
+	bus_size_t	dm_buflen;
+	int		dm_buftype;
+#endif
 	bus_size_t	dm_maxsegsz;	/* largest possible segment */
 	bus_size_t	dm_mapsize;	/* size of the mapping */
 	int		dm_nsegs;	/* # valid segments in mapping */

Index: src/sys/arch/arm/include/bus_funcs.h
diff -u src/sys/arch/arm/include/bus_funcs.h:1.8 src/sys/arch/arm/include/bus_funcs.h:1.9
--- src/sys/arch/arm/include/bus_funcs.h:1.8	Tue Jul 16 11:32:07 2019
+++ src/sys/arch/arm/include/bus_funcs.h	Mon Apr 13 07:09:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_funcs.h,v 1.8 2019/07/16 11:32:07 skrll Exp $	*/
+/*	$NetBSD: bus_funcs.h,v 1.9 2020/04/13 07:09:51 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -638,29 +638,17 @@ bs_po_8_proto(f);
 struct mbuf;
 struct uio;
 
-#define	bus_dmamap_create(t, s, n, m, b, f, p)			\
-	

CVS commit: src/doc

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 06:24:52 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
Note PAC and BTI.


To generate a diff of this commit:
cvs rdiff -u -r1.2669 -r1.2670 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2669 src/doc/CHANGES:1.2670
--- src/doc/CHANGES:1.2669	Sun Apr  5 21:56:04 2020
+++ src/doc/CHANGES	Mon Apr 13 06:24:52 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2669 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2670 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -169,3 +169,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	xen: remove legacy rx-flip support from xennet(4) and xvif(4)
 		[jdolecek 20200405]
 	OpenSSL: Imported 1.1.1f. [christos 20200405]
+	aarch64: Add support for Pointer Authentication (PAC).
+		[maxv 20200412]
+	aarch64: Add support for Branch Target Identification (BTI).
+		[maxv 20200413]



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

2020-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 13 06:02:03 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S

Log Message:
Meant to do a store here, not a load. Ie we want to replace the initial
weak key by the stronger one we just generated.

Rototilled this place too many times.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/aarch64/cpuswitch.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.17 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.18
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.17	Mon Apr 13 05:40:25 2020
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Mon Apr 13 06:02:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.17 2020/04/13 05:40:25 maxv Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.18 2020/04/13 06:02:03 maxv Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include "opt_ddb.h"
 #include "opt_kasan.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.17 2020/04/13 05:40:25 maxv Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.18 2020/04/13 06:02:03 maxv Exp $")
 
 	ARMV8_DEFINE_OPTIONS
 
@@ -249,10 +249,10 @@ ENTRY_NP(lwp_trampoline)
 	cbz	w4, 1f
 	mov	x26, x1
 	bl	_C_LABEL(cprng_strong64)
-	ldr	x0, [x26, #L_MD_IA_KERN_LO]
+	str	x0, [x26, #L_MD_IA_KERN_LO]
 	msr	APIAKeyLo_EL1, x0
 	bl	_C_LABEL(cprng_strong64)
-	ldr	x0, [x26, #L_MD_IA_KERN_HI]
+	str	x0, [x26, #L_MD_IA_KERN_HI]
 	msr	APIAKeyHi_EL1, x0
 1:
 #endif