CVS commit: src/tests/net

2020-02-19 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 20 07:58:19 UTC 2020

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

Log Message:
tests: dump stats of an interface before destroying it


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

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



CVS commit: src/tests/net

2020-02-19 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 20 07:58:19 UTC 2020

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

Log Message:
tests: dump stats of an interface before destroying it


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

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

Modified files:

Index: src/tests/net/net_common.sh
diff -u src/tests/net/net_common.sh:1.37 src/tests/net/net_common.sh:1.38
--- src/tests/net/net_common.sh:1.37	Mon Aug 26 04:50:32 2019
+++ src/tests/net/net_common.sh	Thu Feb 20 07:58:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: net_common.sh,v 1.37 2019/08/26 04:50:32 ozaki-r Exp $
+#	$NetBSD: net_common.sh,v 1.38 2020/02/20 07:58:19 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -398,6 +398,9 @@ rump_server_destroy_ifaces()
 	while read sock ifname; do
 		export RUMP_SERVER=$sock
 		if rump.ifconfig -l |grep -q $ifname; then
+			if $DEBUG; then
+rump.ifconfig -v $ifname
+			fi
 			atf_check -s exit:0 rump.ifconfig $ifname destroy
 		fi
 		atf_check -s exit:0 -o ignore rump.ifconfig



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

2020-02-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 20 07:52:55 UTC 2020

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

Log Message:
Use orr instead of mov (an alias for orr) to appease clang... *shrug*


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/aarch64/aarch64/locore.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/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.57 src/sys/arch/aarch64/aarch64/locore.S:1.58
--- src/sys/arch/aarch64/aarch64/locore.S:1.57	Sat Feb 15 13:51:33 2020
+++ src/sys/arch/aarch64/aarch64/locore.S	Thu Feb 20 07:52:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.57 2020/02/15 13:51:33 tnn Exp $	*/
+/*	$NetBSD: locore.S,v 1.58 2020/02/20 07:52:55 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -38,7 +38,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.57 2020/02/15 13:51:33 tnn Exp $")
+RCSID("$NetBSD: locore.S,v 1.58 2020/02/20 07:52:55 skrll Exp $")
 
 #ifdef AARCH64_DEVICE_MEM_STRONGLY_ORDERED
 #define	MAIR_DEVICE_MEM		MAIR_DEVICE_nGnRnE
@@ -455,7 +455,8 @@ mp_vstart:
 
 	/* x28 = _cpu_hatched[cpuindex / (sizeof(u_long) * NBBY)] */
 	adrl	x0, _C_LABEL(arm_cpu_hatched)
-	mov	x1, x27, lsr #6
+	// Appease clang - mov	x1, x27, lsr #6
+	orr	x1, xzr, x27, lsr #6
 	add	x28, x0, x1, lsl #3
 
 	/* x29 = __BIT(cpuindex % (sizeof(u_long) * NBBY)) */
@@ -476,7 +477,8 @@ mp_vstart:
 
 	/* x28 = _cpu_mbox[cpuindex / (sizeof(u_long) * NBBY)] */
 	adrl	x0, _C_LABEL(arm_cpu_mbox)
-	mov	x1, x27, lsr #6
+	// Appease clang - mov	x1, x27, lsr #6
+	orr	x1, xzr, x27, lsr #6
 	add	x28, x0, x1, lsl #3
 
 	/* wait for the mailbox start bit to become true */



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

2020-02-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 20 07:52:55 UTC 2020

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

Log Message:
Use orr instead of mov (an alias for orr) to appease clang... *shrug*


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/aarch64/aarch64/locore.S

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



CVS commit: src

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 07:07:02 UTC 2020

Modified Files:
src/lib/libpthread/arch/powerpc: pthread_md.h
src/sys/arch/powerpc/powerpc: sig_machdep.c

Log Message:
libpthread sets initial value of MSR for lwp's. However, appropriate
value differs b/w oea/booke/ibm4xx, and there's no way to obtain it
from userland. Therefore, this initial value should be corrected by
cpu_setmcontext().

- Comment this in libpthread
- Add KASSERT in cpu_mcontext_validate()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libpthread/arch/powerpc/pthread_md.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/powerpc/sig_machdep.c

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

Modified files:

Index: src/lib/libpthread/arch/powerpc/pthread_md.h
diff -u src/lib/libpthread/arch/powerpc/pthread_md.h:1.7 src/lib/libpthread/arch/powerpc/pthread_md.h:1.8
--- src/lib/libpthread/arch/powerpc/pthread_md.h:1.7	Tue Jan 25 19:12:05 2011
+++ src/lib/libpthread/arch/powerpc/pthread_md.h	Thu Feb 20 07:07:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_md.h,v 1.7 2011/01/25 19:12:05 christos Exp $	*/
+/*	$NetBSD: pthread_md.h,v 1.8 2020/02/20 07:07:02 rin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -53,7 +53,10 @@ pthread__sp(void)
 /*
  * Set initial, sane values for registers whose values aren't just
  * "don't care".
- * 0xd032 is PSL_USERSET from arch/powerpc/include/psl.h
+ *
+ * XXX
+ * "Sane value" for MSR differs between oea/booke/ibm4xx, but no way to
+ * obtain from userland. It should be corrected by cpu_setmcontext().
  */
 #define _INITCONTEXT_U_MD(ucp)		\
 	(ucp)->uc_mcontext.__gregs[_REG_MSR] = 0xd032;

Index: src/sys/arch/powerpc/powerpc/sig_machdep.c
diff -u src/sys/arch/powerpc/powerpc/sig_machdep.c:1.46 src/sys/arch/powerpc/powerpc/sig_machdep.c:1.47
--- src/sys/arch/powerpc/powerpc/sig_machdep.c:1.46	Tue Nov 27 14:09:54 2018
+++ src/sys/arch/powerpc/powerpc/sig_machdep.c	Thu Feb 20 07:07:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.46 2018/11/27 14:09:54 maxv Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.47 2020/02/20 07:07:02 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.46 2018/11/27 14:09:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.47 2020/02/20 07:07:02 rin Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_altivec.h"
@@ -191,6 +191,8 @@ cpu_getmcontext(struct lwp *l, mcontext_
 int
 cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp)
 {
+
+	KASSERT(PSL_USEROK_P(mcp->__gregs[_REG_MSR]));
 	return 0;
 }
 



CVS commit: src

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 07:07:02 UTC 2020

Modified Files:
src/lib/libpthread/arch/powerpc: pthread_md.h
src/sys/arch/powerpc/powerpc: sig_machdep.c

Log Message:
libpthread sets initial value of MSR for lwp's. However, appropriate
value differs b/w oea/booke/ibm4xx, and there's no way to obtain it
from userland. Therefore, this initial value should be corrected by
cpu_setmcontext().

- Comment this in libpthread
- Add KASSERT in cpu_mcontext_validate()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libpthread/arch/powerpc/pthread_md.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/powerpc/sig_machdep.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 06:36:05 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Oops, sort header again. My bad...


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/powerpc/ibm4xx/trap.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 06:36:05 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Oops, sort header again. My bad...


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.73 src/sys/arch/powerpc/ibm4xx/trap.c:1.74
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.73	Thu Feb 20 05:57:49 2020
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Thu Feb 20 06:36:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.73 2020/02/20 05:57:49 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.74 2020/02/20 06:36:04 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.73 2020/02/20 05:57:49 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.74 2020/02/20 06:36:04 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -96,10 +96,10 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.7
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
+#include 
 
 #include 
 #include 



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 06:12:47 UTC 2020

Modified Files:
src/sys/arch/powerpc/powerpc: fpu.c powerpc_machdep.c

Log Message:
Provide no-op's as pcu_ops_md_defs[PCU_FPU] even if !PPC_HAVE_FPU.

This is required by subr_pcu.c rev 1.21 and later:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_pcu.c#rev1.21

Otherwise, panic occurs when FP instruction is emulated on machines
without FPU.

Note that PowerPC UISA as well as SVR4 ABI require FP instructions,
and emulation is enabled unconditionally on machines without FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/powerpc/fpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/powerpc/powerpc/powerpc_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/fpu.c
diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.38 src/sys/arch/powerpc/powerpc/fpu.c:1.39
--- src/sys/arch/powerpc/powerpc/fpu.c:1.38	Thu Mar 16 16:13:20 2017
+++ src/sys/arch/powerpc/powerpc/fpu.c	Thu Feb 20 06:12:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.38 2017/03/16 16:13:20 chs Exp $	*/
+/*	$NetBSD: fpu.c,v 1.39 2020/02/20 06:12:47 rin Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.38 2017/03/16 16:13:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.39 2020/02/20 06:12:47 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -47,19 +47,15 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.38
 #include 
 #include 
 
-#ifdef PPC_HAVE_FPU
 static void fpu_state_load(lwp_t *, u_int);
 static void fpu_state_save(lwp_t *);
 static void fpu_state_release(lwp_t *);
-#endif
 
 const pcu_ops_t fpu_ops = {
 	.pcu_id = PCU_FPU,
-#ifdef PPC_HAVE_FPU
 	.pcu_state_load = fpu_state_load,
 	.pcu_state_save = fpu_state_save,
 	.pcu_state_release = fpu_state_release,
-#endif
 };
 
 bool
@@ -74,10 +70,10 @@ fpu_mark_used(lwp_t *l)
 	pcu_discard(_ops, l, true);
 }
 
-#ifdef PPC_HAVE_FPU
 void
 fpu_state_load(lwp_t *l, u_int flags)
 {
+#ifdef PPC_HAVE_FPU
 	struct pcb * const pcb = lwp_getpcb(l);
 
 	if ((flags & PCU_VALID) == 0) {
@@ -98,6 +94,7 @@ fpu_state_load(lwp_t *l, u_int flags)
 
 	curcpu()->ci_ev_fpusw.ev_count++;
 	l->l_md.md_utf->tf_srr1 |= PSL_FP|(pcb->pcb_flags & (PCB_FE0|PCB_FE1));
+#endif
 }
 
 /*
@@ -106,6 +103,7 @@ fpu_state_load(lwp_t *l, u_int flags)
 void
 fpu_state_save(lwp_t *l)
 {
+#ifdef PPC_HAVE_FPU
 	struct pcb * const pcb = lwp_getpcb(l);
 
 	const register_t msr = mfmsr();
@@ -117,14 +115,18 @@ fpu_state_save(lwp_t *l)
 
 	mtmsr(msr);
 	__asm volatile ("isync");
+#endif
 }
 
 void
 fpu_state_release(lwp_t *l)
 {
+#ifdef PPC_HAVE_FPU
 	l->l_md.md_utf->tf_srr1 &= ~PSL_FP;
+#endif
 }
 
+#ifdef PPC_HAVE_FPU
 #define	STICKYBITS	(FPSCR_VX|FPSCR_OX|FPSCR_UX|FPSCR_ZX|FPSCR_XX)
 #define	STICKYSHIFT	25
 #define	MASKBITS	(FPSCR_VE|FPSCR_OE|FPSCR_UE|FPSCR_ZE|FPSCR_XE)

Index: src/sys/arch/powerpc/powerpc/powerpc_machdep.c
diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.76 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.77
--- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.76	Mon Feb 17 21:49:27 2020
+++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c	Thu Feb 20 06:12:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerpc_machdep.c,v 1.76 2020/02/17 21:49:27 ad Exp $	*/
+/*	$NetBSD: powerpc_machdep.c,v 1.77 2020/02/20 06:12:47 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.76 2020/02/17 21:49:27 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.77 2020/02/20 06:12:47 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -89,9 +89,7 @@ extern int powersave;
 char *booted_kernel;
 
 const pcu_ops_t * const pcu_ops_md_defs[PCU_UNIT_COUNT] = {
-#if defined(PPC_HAVE_FPU)
 	[PCU_FPU] = _ops,
-#endif
 #if defined(ALTIVEC) || defined(PPC_HAVE_SPE)
 	[PCU_VEC] = _ops,
 #endif



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 06:12:47 UTC 2020

Modified Files:
src/sys/arch/powerpc/powerpc: fpu.c powerpc_machdep.c

Log Message:
Provide no-op's as pcu_ops_md_defs[PCU_FPU] even if !PPC_HAVE_FPU.

This is required by subr_pcu.c rev 1.21 and later:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_pcu.c#rev1.21

Otherwise, panic occurs when FP instruction is emulated on machines
without FPU.

Note that PowerPC UISA as well as SVR4 ABI require FP instructions,
and emulation is enabled unconditionally on machines without FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/powerpc/fpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/powerpc/powerpc/powerpc_machdep.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:57:49 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Convert mi_userret(9) into powerpc-specific userret().

This is necessary in order to support RAS.

There are some sanity checks in userret() as well.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/powerpc/ibm4xx/trap.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:57:49 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Convert mi_userret(9) into powerpc-specific userret().

This is necessary in order to support RAS.

There are some sanity checks in userret() as well.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.72 src/sys/arch/powerpc/ibm4xx/trap.c:1.73
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.72	Thu Feb 20 05:55:24 2020
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Thu Feb 20 05:57:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.72 2020/02/20 05:55:24 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.73 2020/02/20 05:57:49 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.72 2020/02/20 05:55:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.73 2020/02/20 05:57:49 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -82,7 +82,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.7
 #include 
 #include 
 #include 
-#include 
 
 #if defined(KGDB)
 #include 
@@ -97,6 +96,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.7
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -348,8 +348,8 @@ brain_damage:
 		panic("trap");
 	}
 
-	/* Invoke MI userret code */
-	mi_userret(l);
+	/* Invoke powerpc userret code */
+	userret(l, tf);
 }
 
 int



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:55:24 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Sort more headers...


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.71 src/sys/arch/powerpc/ibm4xx/trap.c:1.72
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.71	Thu Feb 20 05:46:08 2020
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Thu Feb 20 05:55:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.71 2020/02/20 05:46:08 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.72 2020/02/20 05:55:24 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.71 2020/02/20 05:46:08 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.72 2020/02/20 05:55:24 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -76,13 +76,13 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.7
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #if defined(KGDB)
 #include 



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:55:24 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Sort more headers...


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/powerpc/ibm4xx/trap.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:46:08 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Sort headers.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.70 src/sys/arch/powerpc/ibm4xx/trap.c:1.71
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.70	Sun Apr  7 05:25:55 2019
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Thu Feb 20 05:46:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.70 2019/04/07 05:25:55 thorpej Exp $	*/
+/*	$NetBSD: trap.c,v 1.71 2020/02/20 05:46:08 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2019/04/07 05:25:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.71 2020/02/20 05:46:08 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -100,10 +100,10 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.7
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
+#include 
 #include 
 
 #include 



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:46:08 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Sort headers.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/powerpc/ibm4xx/trap.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:34:37 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Clear ti_ctx when flushing a TLB entry for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/ibm4xx/pmap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.78 src/sys/arch/powerpc/ibm4xx/pmap.c:1.79
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.78	Thu Feb 20 05:21:54 2020
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Feb 20 05:34:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.78 2020/02/20 05:21:54 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.79 2020/02/20 05:34:37 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2020/02/20 05:21:54 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.79 2020/02/20 05:34:37 rin Exp $");
 
 #include 
 #include 
@@ -1535,6 +1535,7 @@ ctx_flush(int cnum)
 #endif
 			/* Invalidate particular TLB entry regardless of locked status */
 			__asm volatile("tlbwe %0,%1,0" : :"r"(0),"r"(i));
+			tlb_info[i].ti_ctx = 0;
 			tlb_info[i].ti_flags = 0;
 		}
 	}



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:34:37 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Clear ti_ctx when flushing a TLB entry for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/ibm4xx/pmap.c

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



Re: CVS commit: src/doc

2020-02-19 Thread Christos Zoulas
Not reproducible:

 build.sh command:./build.sh -P -U -E -x -m sparc64 -a sparc64 -D 
/usr/obj/sparc64-sparc64/release -R /usr/obj/sparc64-sparc64/media -j 40 release
 build.sh started:Wed Feb 19 15:27:23 EST 2020
 NetBSD version:  9.99.47
 MACHINE: sparc64
 MACHINE_ARCH:sparc64
 Build platform:  NetBSD 9.99.18 amd64
 HOST_SH: /bin/sh
 No $TOOLDIR/bin/nbmake, needs building.
 Bootstrapping nbmake
 MAKECONF file:   /etc/mk.conf
 TOOLDIR path:/usr/obj/sparc64-sparc64/tools
 DESTDIR path:/usr/obj/sparc64-sparc64/release
 RELEASEDIR path: /usr/obj/sparc64-sparc64/media
 Created /usr/obj/sparc64-sparc64/tools/bin/nbmake
 Updated makewrapper: /usr/obj/sparc64-sparc64/tools/bin/nbmake-sparc64
 Tools built to /usr/obj/sparc64-sparc64/tools
 MKREPRO_TIMESTAMPWed Feb 19 19:18:01 UTC 2020
 Successful make release
 build.sh ended:  Wed Feb 19 17:48:15 EST 2020
===> .



> On Feb 19, 2020, at 11:09 AM, Kamil Rytarowski  wrote:
> 
> Signed PGP part
> On 19.02.2020 16:32, Kamil Rytarowski wrote:
>> On 18.02.2020 22:14, Christos Zoulas wrote:
>>> Module Name:src
>>> Committed By:   christos
>>> Date:   Tue Feb 18 21:14:16 UTC 2020
>>> 
>>> Modified Files:
>>> src/doc: 3RDPARTY CHANGES
>>> 
>>> Log Message:
>>> new awk
>>> 
>>> 
>>> To generate a diff of this commit:
>>> cvs rdiff -u -r1.1690 -r1.1691 src/doc/3RDPARTY
>>> cvs rdiff -u -r1.2649 -r1.2650 src/doc/CHANGES
>>> 
>>> Please note that diffs are not public domain; they are subject to the
>>> copyright notices on the relevant files.
>>> 
>> 
>> This upgrade broke MKLLVM HAVE_LLVM build (at least for -m sparc64).
>> 
> 
> Log:
> 
> isters.S |  sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1
> /^\2(\3\4$/;"  >> tags.tmp
> In file included from /usr/src/lib/libc/compat/rpc/compat_pmap_rmtcall.c:50:
> In file included from
> /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpc.h:75:
> /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
> error: unknown type name 'rpcblist'
> extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
>   ^
> 1 error generated.
> --- compat_pmap_rmtcall.o ---
> *** [compat_pmap_rmtcall.o] Error code 1
> nbmake[6]: stopped in /usr/src/lib/libc
> In file included from /usr/src/lib/libc/compat/rpc/compat_rpcb.c:50:
> /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
> error: unknown type name 'rpcblist'
> extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
>   ^
> 1 error generated.
> --- compat_rpcb.o ---
> *** [compat_rpcb.o] Error code 1
> 
> nbmake[6]: stopped in /usr/src/lib/libc
> 2 errors
> 
> nbmake[6]: stopped in /usr/src/lib/libc
> --- dependall ---
> *** [dependall] Error code 2
> nbmake[5]: stopped in /usr/src/lib/libc
> 1 error
> nbmake[5]: stopped in /usr/src/lib/libc
> *** Failed target:  dependall-libc
> *** Failed command: _makedirtarget() { dir="$1"; shift; target="$1";
> shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .)
> this="lib/"; real="/usr/src/lib" ;; *) this="lib/${dir}/";
> real="/usr/src/lib/${dir}" ;; esac; show=${this:-.}; echo "${target}
> ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /public/netbsd-sparc64/tooldir.NetBSD-9.99.46-amd64/bin/nbmake
> _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget libc dependall
> *** Error code 2
> 
> Stop.
> nbmake[4]: stopped in /usr/src/lib
> --- build_install ---
> *** [build_install] Error code 1
> 
> nbmake[3]: stopped in /usr/src/lib
> 1 error
> 
> nbmake[3]: stopped in /usr/src/lib
> --- do-lib ---
> *** [do-lib] Error code 2
> 
> nbmake[2]: stopped in /usr/src
> 1 error
> 
> nbmake[2]: stopped in /usr/src
> --- build ---
> *** [build] Error code 2
> 
> nbmake[1]: stopped in /usr/src
> 1 error
> 
> nbmake[1]: stopped in /usr/src
> --- distribution ---
> *** [distribution] Error code 2
> 
> nbmake: stopped in /usr/src
> 1 error
> 
> nbmake: stopped in /usr/src
> 
> ERROR: Failed to make distribution
> 
> 
> 



signature.asc
Description: Message signed with OpenPGP


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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:21:55 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Fix off-by-one error for ctx (ASID).

Note that NUM_CTX = 256 = 0 stands for disabling protection by ASID.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/powerpc/ibm4xx/pmap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.77 src/sys/arch/powerpc/ibm4xx/pmap.c:1.78
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.77	Thu Feb 20 05:13:16 2020
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Feb 20 05:21:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.78 2020/02/20 05:21:54 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2020/02/20 05:21:54 rin Exp $");
 
 #include 
 #include 
@@ -1563,7 +1563,7 @@ ctx_alloc(struct pmap *pm)
 	/* Find a likely context. */
 	cnum = next;
 	do {
-		if ((++cnum) > NUMCTX)
+		if ((++cnum) >= NUMCTX)
 			cnum = MINCTX;
 	} while (ctxbusy[cnum] != NULL && cnum != next);
 
@@ -1573,7 +1573,7 @@ oops:
 		cnum = MINCTX; /* Never steal ctx 0 or 1 */
 	if (ctx_flush(cnum)) {
 		/* oops -- something's wired. */
-		if ((++cnum) > NUMCTX)
+		if ((++cnum) >= NUMCTX)
 			cnum = MINCTX;
 		goto oops;
 	}



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:21:55 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Fix off-by-one error for ctx (ASID).

Note that NUM_CTX = 256 = 0 stands for disabling protection by ASID.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/powerpc/ibm4xx/pmap.c

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:13:16 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Fix NULL dereference; "pap" argument of pmap_extract(9) can be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/powerpc/ibm4xx/pmap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.76 src/sys/arch/powerpc/ibm4xx/pmap.c:1.77
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.76	Sat Dec 24 19:02:16 2016
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Feb 20 05:13:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.76 2016/12/24 19:02:16 cherry Exp $	*/
+/*	$NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.76 2016/12/24 19:02:16 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $");
 
 #include 
 #include 
@@ -1021,7 +1021,7 @@ pmap_extract(struct pmap *pm, vaddr_t va
 	int s;
 
 	s = splvm();
-	if (pm->pm_ptbl[seg] && (pa = pm->pm_ptbl[seg][ptn])) {
+	if (pm->pm_ptbl[seg] && (pa = pm->pm_ptbl[seg][ptn]) && pap) {
 		*pap = TTE_PA(pa) | (va & PGOFSET);
 	}
 	splx(s);



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:13:16 UTC 2020

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Fix NULL dereference; "pap" argument of pmap_extract(9) can be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src/sys/arch/powerpc

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:10:02 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: pio.h
src/sys/arch/powerpc/pic: intr.c
src/sys/arch/powerpc/powerpc: bus_dma.c pio_subr.S

Log Message:
eieio is implemented as sync on 40x. Therefore, "sync; eieio" and
"eieio; sync" can be replaced by a single sync.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/pio.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/pic/intr.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/powerpc/pio_subr.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/powerpc/include/pio.h
diff -u src/sys/arch/powerpc/include/pio.h:1.7 src/sys/arch/powerpc/include/pio.h:1.8
--- src/sys/arch/powerpc/include/pio.h:1.7	Mon Jan 30 23:34:58 2012
+++ src/sys/arch/powerpc/include/pio.h	Thu Feb 20 05:10:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pio.h,v 1.7 2012/01/30 23:34:58 matt Exp $ */
+/*	$NetBSD: pio.h,v 1.8 2020/02/20 05:10:01 rin Exp $ */
 /*	$OpenBSD: pio.h,v 1.1 1997/10/13 10:53:47 pefo Exp $ */
 
 /*
@@ -39,6 +39,13 @@
  * I/O macros.
  */
 
+#if defined(PPC_IBM4XX) && !defined(PPC_IBM440)
+/* eieio is implemented as sync */
+#define IO_BARRIER() __asm volatile("sync")
+#else
+#define IO_BARRIER() __asm volatile("eieio; sync")
+#endif
+
 static __inline void __outb(volatile uint8_t *a, uint8_t v);
 static __inline void __outw(volatile uint16_t *a, uint16_t v);
 static __inline void __outl(volatile uint32_t *a, uint32_t v);
@@ -64,35 +71,35 @@ static __inline void
 __outb(volatile uint8_t *a, uint8_t v)
 {
 	*a = v;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
 __outw(volatile uint16_t *a, uint16_t v)
 {
 	*a = v;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
 __outl(volatile uint32_t *a, uint32_t v)
 {
 	*a = v;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
 __outwrb(volatile uint16_t *a, uint16_t v)
 {
 	__asm volatile("sthbrx %0, 0, %1" :: "r"(v), "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
 __outlrb(volatile uint32_t *a, uint32_t v)
 {
 	__asm volatile("stwbrx %0, 0, %1" :: "r"(v), "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline uint8_t
@@ -101,7 +108,7 @@ __inb(volatile uint8_t *a)
 	uint8_t _v_;
 
 	_v_ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 	return _v_;
 }
 
@@ -111,7 +118,7 @@ __inw(volatile uint16_t *a)
 	uint16_t _v_;
 
 	_v_ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 	return _v_;
 }
 
@@ -121,7 +128,7 @@ __inl(volatile uint32_t *a)
 	uint32_t _v_;
 
 	_v_ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 	return _v_;
 }
 
@@ -131,7 +138,7 @@ __inwrb(volatile uint16_t *a)
 	uint16_t _v_;
 
 	__asm volatile("lhbrx %0, 0, %1" : "=r"(_v_) : "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 	return _v_;
 }
 
@@ -141,7 +148,7 @@ __inlrb(volatile uint32_t *a)
 	uint32_t _v_;
 
 	__asm volatile("lwbrx %0, 0, %1" : "=r"(_v_) : "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 	return _v_;
 }
 
@@ -175,7 +182,7 @@ __outsb(volatile uint8_t *a, const uint8
 {
 	while (c--)
 		*a = *s++;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -183,7 +190,7 @@ __outsw(volatile uint16_t *a, const uint
 {
 	while (c--)
 		*a = *s++;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -191,7 +198,7 @@ __outsl(volatile uint32_t *a, const uint
 {
 	while (c--)
 		*a = *s++;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -199,7 +206,7 @@ __outswrb(volatile uint16_t *a, const ui
 {
 	while (c--)
 		__asm volatile("sthbrx %0, 0, %1" :: "r"(*s++), "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -207,7 +214,7 @@ __outslrb(volatile uint32_t *a, const ui
 {
 	while (c--)
 		__asm volatile("stwbrx %0, 0, %1" :: "r"(*s++), "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -215,7 +222,7 @@ __insb(volatile uint8_t *a, uint8_t *d, 
 {
 	while (c--)
 		*d++ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -223,7 +230,7 @@ __insw(volatile uint16_t *a, uint16_t *d
 {
 	while (c--)
 		*d++ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -231,7 +238,7 @@ __insl(volatile uint32_t *a, uint32_t *d
 {
 	while (c--)
 		*d++ = *a;
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -239,7 +246,7 @@ __inswrb(volatile uint16_t *a, uint16_t 
 {
 	while (c--)
 		__asm volatile("lhbrx %0, 0, %1" : "=r"(*d++) : "r"(a));
-	__asm volatile("eieio; sync");
+	IO_BARRIER();
 }
 
 static __inline void
@@ -247,7 +254,7 @@ __inslrb(volatile uint32_t 

CVS commit: src/sys/arch/powerpc

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:10:02 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: pio.h
src/sys/arch/powerpc/pic: intr.c
src/sys/arch/powerpc/powerpc: bus_dma.c pio_subr.S

Log Message:
eieio is implemented as sync on 40x. Therefore, "sync; eieio" and
"eieio; sync" can be replaced by a single sync.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/pio.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/pic/intr.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/powerpc/pio_subr.S

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:03:54 UTC 2020

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc

Log Message:
Add PPC_IBM440 flag as 440 is significantly different from 40x processors.
(It may be more easily supported by booke than by ibm4xx.)


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/powerpc/conf/files.powerpc

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 05:03:54 UTC 2020

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc

Log Message:
Add PPC_IBM440 flag as 440 is significantly different from 40x processors.
(It may be more easily supported by booke than by ibm4xx.)


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/powerpc/conf/files.powerpc

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

Modified files:

Index: src/sys/arch/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.92 src/sys/arch/powerpc/conf/files.powerpc:1.93
--- src/sys/arch/powerpc/conf/files.powerpc:1.92	Sat Apr  6 03:06:26 2019
+++ src/sys/arch/powerpc/conf/files.powerpc	Thu Feb 20 05:03:54 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: files.powerpc,v 1.92 2019/04/06 03:06:26 thorpej Exp $
+#	$NetBSD: files.powerpc,v 1.93 2020/02/20 05:03:54 rin Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC PPC_HAVE_SPE
 defflag	opt_openpic.h	OPENPIC_DISTRIBUTE
 defparam opt_ppcparam.h	L2CR_CONFIG L3CR_CONFIG INTSTK CLOCKBASE VERBOSE_INITPPC
-defflag	opt_ppcarch.h	PPC_OEA PPC_OEA601 PPC_OEA64 PPC_OEA64_BRIDGE PPC_MPC8XX PPC_IBM4XX PPC_IBM403 PPC_BOOKE
+defflag	opt_ppcarch.h	PPC_OEA PPC_OEA601 PPC_OEA64 PPC_OEA64_BRIDGE PPC_MPC8XX PPC_IBM4XX PPC_IBM403 PPC_IBM440 PPC_BOOKE
 defflag opt_ppccache.h	CACHE_PROTO_MEI
 defflag opt_pmap.h	PMAPDEBUG PMAPCHECK PMAPCOUNTERS PMAP_MINIMALTLB
 defparam opt_pmap.h	PTEGCOUNT PMAP_MEMLIMIT



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 04:59:43 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: intr.h

Log Message:
Fix !__HAVE_FAST_SOFTINTS build for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/intr.h

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



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 04:59:43 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: intr.h

Log Message:
Fix !__HAVE_FAST_SOFTINTS build for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/intr.h

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

Modified files:

Index: src/sys/arch/powerpc/include/intr.h
diff -u src/sys/arch/powerpc/include/intr.h:1.14 src/sys/arch/powerpc/include/intr.h:1.15
--- src/sys/arch/powerpc/include/intr.h:1.14	Thu Oct 24 23:03:35 2019
+++ src/sys/arch/powerpc/include/intr.h	Thu Feb 20 04:59:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $ */
+/*	$NetBSD: intr.h,v 1.15 2020/02/20 04:59:43 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -28,7 +28,7 @@
 
 #ifndef _LOCORE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.15 2020/02/20 04:59:43 rin Exp $");
 #endif
 
 #ifndef _POWERPC_INTR_MACHDEP_H_
@@ -92,8 +92,10 @@ struct intrhand {
 
 void softint_fast_dispatch(struct lwp *, int);
 
+#ifdef __HAVE_FAST_SOFTINTS
 #define softint_init_md		powerpc_softint_init_md
 #define softint_trigger		powerpc_softint_trigger
+#endif
 
 #ifdef __IMASK_T
 typedef __IMASK_T imask_t;



CVS commit: src/sys/uvm

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 04:54:47 UTC 2020

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

Log Message:
Make this compile again with PGALLOC_VERBOSE.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/uvm/uvm_pglist.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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.79 src/sys/uvm/uvm_pglist.c:1.80
--- src/sys/uvm/uvm_pglist.c:1.79	Tue Dec 31 13:07:14 2019
+++ src/sys/uvm/uvm_pglist.c	Thu Feb 20 04:54:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.79 2019/12/31 13:07:14 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.79 2019/12/31 13:07:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $");
 
 #include 
 #include 
@@ -118,7 +118,7 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 	paddr_t cidx = 0;	/* XXX: GCC */
 #endif
 #ifdef PGALLOC_VERBOSE
-	printf("pgalloc: contig %d pgs from psi %zd\n", num, ps - vm_physmem);
+	printf("pgalloc: contig %d pgs from psi %d\n", num, psi);
 #endif
 
 	low = atop(low);
@@ -197,8 +197,8 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 		 * Found a suitable starting page.  See if the range is free.
 		 */
 #ifdef PGALLOC_VERBOSE
-		printf("%s: ps=%p candidate=%#x end=%#x skip=%#x, align=%#"PRIxPADDR,
-		__func__, ps, candidateidx, end, skip, alignment);
+		printf("%s: psi=%d candidate=%#x end=%#x skip=%#x, align=%#"PRIxPADDR,
+		__func__, psi, candidateidx, end, skip, alignment);
 #endif
 		/*
 		 * We start at the end and work backwards since if we find a



CVS commit: src/sys/uvm

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 04:54:47 UTC 2020

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

Log Message:
Make this compile again with PGALLOC_VERBOSE.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/uvm/uvm_pglist.c

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



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

2020-02-19 Thread Rin Okuyama

On 2020/02/18 6:55, Andrew Doran wrote:

I corrected the cpu_ast() case.  Yes it's curious why ibm4xx calls
mi_userret() directly; that seems wrong (I have not changed it though).  I
think it definitely makes more sense to deal with OWEUPC before userret().


Thank you!

Now, I'm working on fixing ibm4xx. IMO, there's no reason to use
mi_userret() here, and I will commit a fix later with other commits.

Thanks,
rin


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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:44:06 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c

Log Message:
Add support for brcm,bcm2711-emmc2


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/broadcom/bcm2835_emmc.c

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



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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:44:06 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c

Log Message:
Add support for brcm,bcm2711-emmc2


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/broadcom/bcm2835_emmc.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/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.35 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.36
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.35	Mon Dec 30 16:41:38 2019
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Thu Feb 20 01:44:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.35 2019/12/30 16:41:38 skrll Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.36 2020/02/20 01:44:06 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.35 2019/12/30 16:41:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.36 2020/02/20 01:44:06 jmcneill Exp $");
 
 #include "bcmdmac.h"
 
@@ -91,17 +91,24 @@ static void bcmemmc_dma_done(uint32_t, u
 CFATTACH_DECL_NEW(bcmemmc, sizeof(struct bcmemmc_softc),
 bcmemmc_match, bcmemmc_attach, NULL, NULL);
 
+enum bcmemmc_type {
+	BCM2835_SDHCI,
+	BCM2711_EMMC2,
+};
+
+static const struct of_compat_data compat_data[] = {
+	{ "brcm,bcm2835-sdhci",		BCM2835_SDHCI },
+	{ "brcm,bcm2711-emmc2",		BCM2711_EMMC2 },
+	{ NULL }
+};
+
 /* ARGSUSED */
 static int
 bcmemmc_match(device_t parent, struct cfdata *match, void *aux)
 {
-	const char * const compatible[] = {
-	"brcm,bcm2835-sdhci",
-	NULL
-	};
 	struct fdt_attach_args * const faa = aux;
 
-	return of_match_compatible(faa->faa_phandle, compatible);
+	return of_match_compat_data(faa->faa_phandle, compat_data);
 }
 
 /* ARGSUSED */
@@ -111,9 +118,13 @@ bcmemmc_attach(device_t parent, device_t
 	struct bcmemmc_softc *sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
 	prop_dictionary_t dict = device_properties(self);
+	const int phandle = faa->faa_phandle;
 	bool disable = false;
+	enum bcmemmc_type type;
 	int error;
 
+	type = of_search_compatible(phandle, compat_data)->data;
+
 	sc->sc.sc_dev = self;
 	sc->sc.sc_dmat = faa->faa_dmat;
 	sc->sc.sc_flags = 0;
@@ -137,7 +148,6 @@ bcmemmc_attach(device_t parent, device_t
 	bus_addr_t addr;
 	bus_size_t size;
 
-	const int phandle = faa->faa_phandle;
 	error = fdtbus_get_reg(phandle, 0, , );
 	if (error) {
 		aprint_error_dev(sc->sc.sc_dev, "unable to map device\n");
@@ -185,6 +195,9 @@ bcmemmc_attach(device_t parent, device_t
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
 #if NBCMDMAC > 0
+	if (type != BCM2835_SDHCI)
+		goto done;
+
 	sc->sc_dmac = bcm_dmac_alloc(BCM_DMAC_TYPE_NORMAL, IPL_SDMMC,
 	bcmemmc_dma_done, sc);
 	if (sc->sc_dmac == NULL)



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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:43:08 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm283x_platform.c

Log Message:
Remove custom bus dma tag handling.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/broadcom/bcm283x_platform.c

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



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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:43:08 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm283x_platform.c

Log Message:
Remove custom bus dma tag handling.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/broadcom/bcm283x_platform.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/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.34 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.35
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.34	Wed Jan  1 13:54:32 2020
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Thu Feb 20 01:43:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.34 2020/01/01 13:54:32 skrll Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.35 2020/02/20 01:43:07 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.34 2020/01/01 13:54:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.35 2020/02/20 01:43:07 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -109,7 +109,6 @@ __KERNEL_RCSID(0, "$NetBSD: bcm283x_plat
 #endif
 
 #define RPI_CPU_MAX	4
-#define BCM2711_DMA_SIZE	0x3c00
 
 void bcm2835_platform_early_putchar(char c);
 void bcm2836_platform_early_putchar(char c);
@@ -267,28 +266,6 @@ bcm2711_a4x_bs_mmap(void *t, bus_addr_t 
 	return bcm2711_bs_mmap(t, ba, 4 * offset, prot, flags);
 }
 
-struct arm32_dma_range bcm2835_dma_ranges[] = {
-	[0] = {
-		.dr_sysbase = 0,
-		.dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT,
-	}
-};
-
-struct arm32_dma_range bcm2836_dma_ranges[] = {
-	[0] = {
-		.dr_sysbase = 0,
-		.dr_busbase = BCM2835_BUSADDR_CACHE_DIRECT,
-	}
-};
-
-struct arm32_dma_range bcm2711_dma_ranges[] = {
-	[0] = {
-		.dr_sysbase = 0,
-		.dr_busbase = BCM2835_BUSADDR_CACHE_DIRECT,
-	}
-};
-
-
 #if defined(SOC_BCM2835)
 static const struct pmap_devmap *
 bcm2835_platform_devmap(void)
@@ -1321,11 +1298,6 @@ bcm2835_platform_init_attach_args(struct
 
 	faa->faa_bst = _bs_tag;
 	faa->faa_a4x_bst = _a4x_bs_tag;
-	faa->faa_dmat = _bus_dma_tag;
-
-	bcm2835_bus_dma_tag._ranges = bcm2835_dma_ranges;
-	bcm2835_bus_dma_tag._nranges = __arraycount(bcm2835_dma_ranges);
-	bcm2835_dma_ranges[0].dr_len = bcm283x_memorysize;
 }
 #endif
 
@@ -1336,11 +1308,6 @@ bcm2836_platform_init_attach_args(struct
 
 	faa->faa_bst = _bs_tag;
 	faa->faa_a4x_bst = _a4x_bs_tag;
-	faa->faa_dmat = _bus_dma_tag;
-
-	bcm2835_bus_dma_tag._ranges = bcm2836_dma_ranges;
-	bcm2835_bus_dma_tag._nranges = __arraycount(bcm2836_dma_ranges);
-	bcm2836_dma_ranges[0].dr_len = bcm283x_memorysize;
 }
 
 static void
@@ -1349,11 +1316,6 @@ bcm2711_platform_init_attach_args(struct
 
 	faa->faa_bst = _bs_tag;
 	faa->faa_a4x_bst = _a4x_bs_tag;
-	faa->faa_dmat = _bus_dma_tag;
-
-	bcm2835_bus_dma_tag._ranges = bcm2711_dma_ranges;
-	bcm2835_bus_dma_tag._nranges = __arraycount(bcm2711_dma_ranges);
-	bcm2711_dma_ranges[0].dr_len = BCM2711_DMA_SIZE;
 }
 #endif
 



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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:36:38 UTC 2020

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

Log Message:
Attach bcmgpio before devices that may need it


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 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.136 src/sys/arch/evbarm/conf/GENERIC64:1.137
--- src/sys/arch/evbarm/conf/GENERIC64:1.136	Thu Feb  6 01:37:46 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Thu Feb 20 01:36:37 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.136 2020/02/06 01:37:46 mrg Exp $
+#	$NetBSD: GENERIC64,v 1.137 2020/02/20 01:36:37 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -288,7 +288,7 @@ sunxigmacclk*	at fdt? pass 2		# Allwinne
 tegra210car*	at fdt? pass 3		# NVIDIA Tegra CAR (T210)
 
 # GPIO controller
-bcmgpio*	at fdt?			# Broadcom BCM283x GPIO
+bcmgpio*	at fdt? pass 3		# Broadcom BCM283x GPIO
 imxgpio*	at fdt? pass 3		# IMX GPIO
 mesonpinctrl*	at fdt? pass 2		# Amlogic Meson GPIO
 plgpio*		at fdt?			# ARM PrimeCell PL061 GPIO



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

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:36:38 UTC 2020

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

Log Message:
Attach bcmgpio before devices that may need it


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



CVS commit: src/sys

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:35:55 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: files.fdt
src/sys/dev/fdt: fdt_subr.c fdtbus.c fdtvar.h
Added Files:
src/sys/arch/evbarm/fdt: fdt_dma_machdep.c

Log Message:
Add dma-ranges support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/fdt/fdt_dma_machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/fdt/fdtvar.h

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

Modified files:

Index: src/sys/arch/evbarm/conf/files.fdt
diff -u src/sys/arch/evbarm/conf/files.fdt:1.5 src/sys/arch/evbarm/conf/files.fdt:1.6
--- src/sys/arch/evbarm/conf/files.fdt:1.5	Tue Oct 30 22:32:33 2018
+++ src/sys/arch/evbarm/conf/files.fdt	Thu Feb 20 01:35:55 2020
@@ -1,8 +1,9 @@
-#	$NetBSD: files.fdt,v 1.5 2018/10/30 22:32:33 jmcneill Exp $
+#	$NetBSD: files.fdt,v 1.6 2020/02/20 01:35:55 jmcneill Exp $
 #
 # FDT-based kernel configuration info
 #
 
+file	arch/evbarm/fdt/fdt_dma_machdep.c	fdt
 file	arch/evbarm/fdt/fdt_machdep.c		fdt
 file	arch/evbarm/fdt/fdt_memory.c		fdt
 

Index: src/sys/dev/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.33 src/sys/dev/fdt/fdt_subr.c:1.34
--- src/sys/dev/fdt/fdt_subr.c:1.33	Sun Feb 16 20:28:18 2020
+++ src/sys/dev/fdt/fdt_subr.c	Thu Feb 20 01:35:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.33 2020/02/16 20:28:18 thorpej Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.34 2020/02/20 01:35:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.33 2020/02/16 20:28:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.34 2020/02/20 01:35:55 jmcneill Exp $");
 
 #include "opt_fdt.h"
 
@@ -95,7 +95,7 @@ fdtbus_set_decoderegprop(bool decode)
 	fdtbus_decoderegprop = decode;
 }
 
-static int
+int
 fdtbus_get_addr_cells(int phandle)
 {
 	uint32_t addr_cells;
@@ -106,7 +106,7 @@ fdtbus_get_addr_cells(int phandle)
 	return addr_cells;
 }
 
-static int
+int
 fdtbus_get_size_cells(int phandle)
 {
 	uint32_t size_cells;
@@ -193,7 +193,7 @@ fdtbus_get_path(int phandle, char *buf, 
 	return true;
 }
 
-static uint64_t
+uint64_t
 fdtbus_get_cells(const uint8_t *buf, int cells)
 {
 	switch (cells) {

Index: src/sys/dev/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.32 src/sys/dev/fdt/fdtbus.c:1.33
--- src/sys/dev/fdt/fdtbus.c:1.32	Tue Jan 28 08:09:19 2020
+++ src/sys/dev/fdt/fdtbus.c	Thu Feb 20 01:35:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.32 2020/01/28 08:09:19 martin Exp $ */
+/* $NetBSD: fdtbus.c,v 1.33 2020/02/20 01:35:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.32 2020/01/28 08:09:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.33 2020/02/20 01:35:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -202,6 +202,7 @@ fdt_init_attach_args(const struct fdt_at
 	faa->faa_phandle = node->n_phandle;
 	faa->faa_name = node->n_name;
 	faa->faa_quiet = quiet;
+	faa->faa_dmat = node->n_faa.faa_dmat;
 }
 
 static bool
@@ -230,6 +231,66 @@ fdt_add_bus_match(device_t bus, const in
 	}
 }
 
+static int
+fdt_dma_translate(int phandle, struct fdt_dma_range **ranges, u_int *nranges)
+{
+	const uint8_t *data;
+	int len, n;
+
+	const int parent = OF_parent(phandle);
+	if (parent == -1)
+		return 1;	/* done searching */
+
+	data = fdtbus_get_prop(phandle, "dma-ranges", );
+	if (data == NULL)
+		return 1;	/* no dma-ranges property, stop searching */
+
+	if (len == 0)
+		return 0;	/* dma-ranges property is empty, keep going */
+
+	const int addr_cells = fdtbus_get_addr_cells(phandle);
+	const int size_cells = fdtbus_get_size_cells(phandle);
+	const int paddr_cells = fdtbus_get_addr_cells(parent);
+	if (addr_cells == -1 || size_cells == -1 || paddr_cells == -1)
+		return 1;
+
+	const int entry_size = (addr_cells + paddr_cells + size_cells) * 4;
+
+	*nranges = len / entry_size;
+	*ranges = kmem_alloc(sizeof(struct fdt_dma_range) * *nranges, KM_SLEEP);
+	for (n = 0; len >= entry_size; n++, len -= entry_size) {
+		const uint64_t cba = fdtbus_get_cells(data, addr_cells);
+		data += addr_cells * 4;
+		const uint64_t pba = fdtbus_get_cells(data, paddr_cells);
+		data += paddr_cells * 4;
+		const uint64_t cl = fdtbus_get_cells(data, size_cells);
+		data += size_cells * 4;
+
+		(*ranges)[n].dr_sysbase = pba;
+		(*ranges)[n].dr_busbase = cba;
+		(*ranges)[n].dr_len = cl;
+	}
+
+	return 1;
+}
+
+static bus_dma_tag_t
+fdt_get_dma_tag(struct fdt_node *node)
+{
+	struct fdt_dma_range *ranges = NULL;
+	u_int nranges = 0;
+	int parent;
+
+	parent = OF_parent(node->n_phandle);
+	while (parent != -1) {
+		if (fdt_dma_translate(parent, , ) != 0)
+			break;
+		

CVS commit: src/sys

2020-02-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 20 01:35:55 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: files.fdt
src/sys/dev/fdt: fdt_subr.c fdtbus.c fdtvar.h
Added Files:
src/sys/arch/evbarm/fdt: fdt_dma_machdep.c

Log Message:
Add dma-ranges support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/fdt/fdt_dma_machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/fdt/fdtvar.h

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



Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Roy Marples

On 19/02/2020 22:29, Kamil Rytarowski wrote:

Why do you need terminfo/termios in ./build.sh tools?


We build the nbtic tool so we can build the terminfo database.

Roy


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Joerg Sonnenberger
On Wed, Feb 19, 2020 at 11:29:09PM +0100, Kamil Rytarowski wrote:
> On 19.02.2020 23:03, Joerg Sonnenberger wrote:
> > On Wed, Feb 19, 2020 at 04:10:17PM +0100, Kamil Rytarowski wrote:
> >> On 19.02.2020 14:32, Joerg Sonnenberger wrote:
> >>> Module Name:  src
> >>> Committed By: joerg
> >>> Date: Wed Feb 19 13:32:40 UTC 2020
> >>>
> >>> Modified Files:
> >>>   src/external/apache2/llvm/config/llvm/Config: config.h.in
> >>>
> >>> Log Message:
> >>> Revert last. It was objected to pre-commit, there is no actual error
> >>> analysis or report and there is existing logic supposed to handle this.
> >>>
> >>>
> >>> To generate a diff of this commit:
> >>> cvs rdiff -u -r1.2 -r1.3 \
> >>> src/external/apache2/llvm/config/llvm/Config/config.h.in
> >>>
> >>> Please note that diffs are not public domain; they are subject to the
> >>> copyright notices on the relevant files.
> >>>
> >>
> >> Objected pre-commit? Nothing reached me and I see nothing in logs.
> >>
> >> No report? It was discussed in public syzkaller ML and semipublic IRC
> >> channel with 5 people involved.
> >>
> >> https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0
> >>
> >> No analysis? There is analysis in the commit message that we remove
> >> optional features.
> >>
> >> I request either to reintroduce it now or land another fix.
> > 
> > While I am on many mailing lists, I'm certainly not on all lists. I
> > answered in the only forum where I saw the message. I am strongly
> > objecting here because you make the tools compiler a lot less usable.
> > You haven't acutally shown *why* the existing logic doesn't work.
> > 
> 
> The existing logic does not work as it is breaking bootstrap on
> Linux/Ubuntu as presented here:
> 
> https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0

Yes and that is completely useless for figuring out the why.

Joerg


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Kamil Rytarowski
On 19.02.2020 23:03, Joerg Sonnenberger wrote:
> On Wed, Feb 19, 2020 at 04:10:17PM +0100, Kamil Rytarowski wrote:
>> On 19.02.2020 14:32, Joerg Sonnenberger wrote:
>>> Module Name:src
>>> Committed By:   joerg
>>> Date:   Wed Feb 19 13:32:40 UTC 2020
>>>
>>> Modified Files:
>>> src/external/apache2/llvm/config/llvm/Config: config.h.in
>>>
>>> Log Message:
>>> Revert last. It was objected to pre-commit, there is no actual error
>>> analysis or report and there is existing logic supposed to handle this.
>>>
>>>
>>> To generate a diff of this commit:
>>> cvs rdiff -u -r1.2 -r1.3 \
>>> src/external/apache2/llvm/config/llvm/Config/config.h.in
>>>
>>> Please note that diffs are not public domain; they are subject to the
>>> copyright notices on the relevant files.
>>>
>>
>> Objected pre-commit? Nothing reached me and I see nothing in logs.
>>
>> No report? It was discussed in public syzkaller ML and semipublic IRC
>> channel with 5 people involved.
>>
>> https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0
>>
>> No analysis? There is analysis in the commit message that we remove
>> optional features.
>>
>> I request either to reintroduce it now or land another fix.
> 
> While I am on many mailing lists, I'm certainly not on all lists. I
> answered in the only forum where I saw the message. I am strongly
> objecting here because you make the tools compiler a lot less usable.
> You haven't acutally shown *why* the existing logic doesn't work.
> 

The existing logic does not work as it is breaking bootstrap on
Linux/Ubuntu as presented here:

https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0

> Joerg
> 

Why do you need terminfo/termios in ./build.sh tools?

We need to fix bootstrap on Linux and it is easier to remove terminfo
features and termios ones. We don't need to handle terminal resizing
detection or colors for tools.

Instead of supporting these features dynamically it is easier to disable
them unconditionally. But if you insist to detect them dynamically and
maintain it, please land a patch that will resurrect the bot.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Joerg Sonnenberger
On Wed, Feb 19, 2020 at 04:10:17PM +0100, Kamil Rytarowski wrote:
> On 19.02.2020 14:32, Joerg Sonnenberger wrote:
> > Module Name:src
> > Committed By:   joerg
> > Date:   Wed Feb 19 13:32:40 UTC 2020
> > 
> > Modified Files:
> > src/external/apache2/llvm/config/llvm/Config: config.h.in
> > 
> > Log Message:
> > Revert last. It was objected to pre-commit, there is no actual error
> > analysis or report and there is existing logic supposed to handle this.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.2 -r1.3 \
> > src/external/apache2/llvm/config/llvm/Config/config.h.in
> > 
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> > 
> 
> Objected pre-commit? Nothing reached me and I see nothing in logs.
> 
> No report? It was discussed in public syzkaller ML and semipublic IRC
> channel with 5 people involved.
> 
> https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0
> 
> No analysis? There is analysis in the commit message that we remove
> optional features.
> 
> I request either to reintroduce it now or land another fix.

While I am on many mailing lists, I'm certainly not on all lists. I
answered in the only forum where I saw the message. I am strongly
objecting here because you make the tools compiler a lot less usable.
You haven't acutally shown *why* the existing logic doesn't work.

Joerg


CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:51:21 UTC 2020

Modified Files:
src/usr.sbin/sysinst: defs.h main.c sysinst.8

Log Message:
Remove unused "rel" global variable and make the -r option a no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/sysinst.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/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.55 src/usr.sbin/sysinst/defs.h:1.56
--- src/usr.sbin/sysinst/defs.h:1.55	Mon Feb 10 14:55:53 2020
+++ src/usr.sbin/sysinst/defs.h	Wed Feb 19 21:51:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.55 2020/02/10 14:55:53 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.56 2020/02/19 21:51:21 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -362,7 +362,6 @@ struct install_partition_desc {
 
 int debug;		/* set by -D option */
 
-char rel[SSTRSIZE];
 char machine[SSTRSIZE];
 
 int ignorerror;

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.21 src/usr.sbin/sysinst/main.c:1.22
--- src/usr.sbin/sysinst/main.c:1.21	Wed Feb 19 18:08:03 2020
+++ src/usr.sbin/sysinst/main.c	Wed Feb 19 21:51:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.21 2020/02/19 18:08:03 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.22 2020/02/19 21:51:21 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -87,7 +87,7 @@ struct f_arg {
 };
 
 static const struct f_arg fflagopts[] = {
-	{"release", REL, rel, sizeof rel},
+	{"release", REL, NULL, 0},
 	{"machine", MACH, machine, sizeof machine},
 	{"xfer dir", "/usr/INSTALL", xfer_dir, sizeof xfer_dir},
 	{"ext dir", "", ext_dir_bin, sizeof ext_dir_bin},
@@ -192,8 +192,7 @@ main(int argc, char **argv)
 			debug = 1;
 			break;
 		case 'r':
-			/* Release name other than compiled in release. */
-			strlcpy(rel, optarg, sizeof rel);
+			/* Release name - ignore for compatibility with older versions */
 			break;
 		case 'f':
 			/* Definition file to read. */
@@ -551,6 +550,8 @@ process_f_flag(char *f_name)
 			len = strlen(arg->name);
 			if (memcmp(cp, arg->name, len) != 0)
 continue;
+			if (arg->var == NULL || arg->size == 0)
+continue;
 			cp1 = cp + len;
 			cp1 += strspn(cp1, " \t");
 			if (*cp1++ != '=')

Index: src/usr.sbin/sysinst/sysinst.8
diff -u src/usr.sbin/sysinst/sysinst.8:1.1 src/usr.sbin/sysinst/sysinst.8:1.2
--- src/usr.sbin/sysinst/sysinst.8:1.1	Wed Feb 19 21:42:54 2020
+++ src/usr.sbin/sysinst/sysinst.8	Wed Feb 19 21:51:21 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysinst.8,v 1.1 2020/02/19 21:42:54 martin Exp $
+.\"	$NetBSD: sysinst.8,v 1.2 2020/02/19 21:51:21 martin Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -34,7 +34,6 @@
 .Nm
 .Op Fl D
 .Op Fl f Ar definition_file
-.Op Fl r Ar release
 .Sh DESCRIPTION
 .Nm
 is a menu-based program that may be used to install or upgrade a
@@ -60,11 +59,6 @@ as a file for definitions other than the
 See the
 .Sx DEFINITION FILE
 section for its format.
-.It Fl r Ar release
-Use
-.Ar release
-as the release name if it is different to the one compiled.
-Currently unused.
 .El
 .Sh DEFINITION FILE
 A definition file can be used with
@@ -84,7 +78,6 @@ respectively, as determined by the image
 is used on):
 .Bl -column "targetroot mount" "pub/NetBSD/NetBSD-REL"
 .It Sy "option name" Ta Sy "default value" Ta Sy "description"
-.It release Ta REL Ta Release name (also set by Fl r Ar release )
 .It machine Ta MACH Ta Machine architecture
 .It xfer dir Ta /usr/INSTALL Ta Transfer dir
 .It ext dir Ta "" Ta Extract dir (will usually be set later on)



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:51:21 UTC 2020

Modified Files:
src/usr.sbin/sysinst: defs.h main.c sysinst.8

Log Message:
Remove unused "rel" global variable and make the -r option a no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/sysinst.8

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



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:49:48 UTC 2020

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
Do not force -Os optimization (unless SMALLPROG)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/Makefile.inc

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

Modified files:

Index: src/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.33 src/usr.sbin/sysinst/Makefile.inc:1.34
--- src/usr.sbin/sysinst/Makefile.inc:1.33	Wed Feb 19 21:45:09 2020
+++ src/usr.sbin/sysinst/Makefile.inc	Wed Feb 19 21:49:48 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.33 2020/02/19 21:45:09 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.34 2020/02/19 21:49:48 martin Exp $
 #
 # Makefile for sysinst
 
@@ -117,11 +117,11 @@ O0TRACKING=	-fvar-tracking-assignments -
 .endif
 CPPFLAGS+=-DDEBUG
 DBG +=-g -O0 ${O0TRACKING}
-.endif
-
-.if empty(DBG:M-g)
+.else
+.if defined(SMALLPROG)
 COPTS += -Os
 .endif
+.endif
 
 .if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
 CPPFLAGS+=-DINET6



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:49:48 UTC 2020

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
Do not force -Os optimization (unless SMALLPROG)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/Makefile.inc

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



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:45:10 UTC 2020

Modified Files:
src/usr.sbin/sysinst: Makefile.inc disklabel.c

Log Message:
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/sysinst/disklabel.c

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

Modified files:

Index: src/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.32 src/usr.sbin/sysinst/Makefile.inc:1.33
--- src/usr.sbin/sysinst/Makefile.inc:1.32	Wed Feb 19 21:42:53 2020
+++ src/usr.sbin/sysinst/Makefile.inc	Wed Feb 19 21:45:09 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.32 2020/02/19 21:42:53 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.33 2020/02/19 21:45:09 martin Exp $
 #
 # Makefile for sysinst
 
@@ -128,6 +128,7 @@ CPPFLAGS+=-DINET6
 .endif
 
 COPTS+=	${GCC_NO_FORMAT_TRUNCATION}
+COPTS.disklabel.c+= ${GCC_NO_STRINGOP_TRUNCATION}
 
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.36 src/usr.sbin/sysinst/disklabel.c:1.37
--- src/usr.sbin/sysinst/disklabel.c:1.36	Wed Feb 19 18:08:03 2020
+++ src/usr.sbin/sysinst/disklabel.c	Wed Feb 19 21:45:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.36 2020/02/19 18:08:03 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.37 2020/02/19 21:45:09 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -934,7 +934,7 @@ disklabel_set_disk_pack_name(struct disk
 	struct disklabel_disk_partitions *parts =
 	(struct disklabel_disk_partitions*)arg;
 
-	strlcpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
+	strncpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
 	return true;
 }
 



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:45:10 UTC 2020

Modified Files:
src/usr.sbin/sysinst: Makefile.inc disklabel.c

Log Message:
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/sysinst/disklabel.c

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



CVS commit: src

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:42:54 UTC 2020

Modified Files:
src/share/man/man8: Makefile
src/usr.sbin/sysinst: Makefile.inc
Added Files:
src/usr.sbin/sysinst: sysinst.8
Removed Files:
src/share/man/man8: sysinst.8

Log Message:
Move sysinst man page next to the source


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/share/man/man8/Makefile
cvs rdiff -u -r1.6 -r0 src/share/man/man8/sysinst.8
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/sysinst.8

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



CVS commit: src

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 21:42:54 UTC 2020

Modified Files:
src/share/man/man8: Makefile
src/usr.sbin/sysinst: Makefile.inc
Added Files:
src/usr.sbin/sysinst: sysinst.8
Removed Files:
src/share/man/man8: sysinst.8

Log Message:
Move sysinst man page next to the source


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/share/man/man8/Makefile
cvs rdiff -u -r1.6 -r0 src/share/man/man8/sysinst.8
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/sysinst.8

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/man8/Makefile
diff -u src/share/man/man8/Makefile:1.109 src/share/man/man8/Makefile:1.110
--- src/share/man/man8/Makefile:1.109	Wed Jun 12 09:03:32 2019
+++ src/share/man/man8/Makefile	Wed Feb 19 21:42:54 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.109 2019/06/12 09:03:32 mrg Exp $
+#	$NetBSD: Makefile,v 1.110 2020/02/19 21:42:54 martin Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/5/93
 
 MAN=	MAKEDEV.8 MAKEDEV.local.8 afterboot.8 boot.8 compat_30.8 \
@@ -8,7 +8,7 @@ MAN=	MAKEDEV.8 MAKEDEV.local.8 afterboot
 	creds_msdos.8 \
 	diskless.8 hpcboot.8 \
 	intro.8 nis.8 pam.8 rc.8 rc.subr.8 rescue.8 \
-	sysinst.8 veriexec.8 \
+	veriexec.8 \
 	wizd.8
 MLINKS+=MAKEDEV.8 makedev.8
 MLINKS+=MAKEDEV.local.8 makedev.local.8

Index: src/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.31 src/usr.sbin/sysinst/Makefile.inc:1.32
--- src/usr.sbin/sysinst/Makefile.inc:1.31	Mon Dec 16 13:48:44 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Wed Feb 19 21:42:53 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.31 2019/12/16 13:48:44 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.32 2020/02/19 21:42:53 martin Exp $
 #
 # Makefile for sysinst
 
@@ -7,7 +7,7 @@
 .endif
 
 PROG=		sysinst
-NOMAN=		# defined
+MAN=		sysinst.8
 
 WARNS=		4
 

Added files:

Index: src/usr.sbin/sysinst/sysinst.8
diff -u /dev/null src/usr.sbin/sysinst/sysinst.8:1.1
--- /dev/null	Wed Feb 19 21:42:54 2020
+++ src/usr.sbin/sysinst/sysinst.8	Wed Feb 19 21:42:54 2020
@@ -0,0 +1,125 @@
+.\"	$NetBSD: sysinst.8,v 1.1 2020/02/19 21:42:54 martin Exp $
+.\"
+.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 30, 2012
+.Dt SYSINST 8
+.Os
+.Sh NAME
+.Nm sysinst
+.Nd install or upgrade a NetBSD system
+.Sh SYNOPSIS
+.Nm
+.Op Fl D
+.Op Fl f Ar definition_file
+.Op Fl r Ar release
+.Sh DESCRIPTION
+.Nm
+is a menu-based program that may be used to install or upgrade a
+.Nx
+system.
+It
+is usually invoked automatically when the system is booted
+from appropriate installation media.
+.Pp
+.Nm
+is usually not present on a
+.Nx
+system that has been fully installed.
+.Pp
+The following options are available:
+.Bl -tag -width XfXdefinition_fileXX
+.It Fl D
+Switch on debugging.
+.It Fl f Ar definition_file
+Use
+.Ar definition_file
+as a file for definitions other than the defaults.
+See the
+.Sx DEFINITION FILE
+section for its format.
+.It Fl r Ar release
+Use
+.Ar release
+as the release name if it is different to the one compiled.
+Currently unused.
+.El
+.Sh DEFINITION FILE
+A definition file can be used with
+.Nm
+to control several aspects of the installation or upgrade process.
+Options can be stored within the file as
+.Dl option = value
+pairs.
+Options include the following, shown with their defaults
+as well as a description
+.Dq ( REL
+and
+.Dq MACH
+are the release and architecture
+respectively, as determined by the image
+.Nm
+is 

Re: CVS commit: src/doc

2020-02-19 Thread Christos Zoulas
On Feb 19,  5:09pm, n...@gmx.com (Kamil Rytarowski) wrote:
-- Subject: Re: CVS commit: src/doc

| On 19.02.2020 16:32, Kamil Rytarowski wrote:
| > On 18.02.2020 22:14, Christos Zoulas wrote:
| >> Module Name:   src
| >> Committed By:  christos
| >> Date:  Tue Feb 18 21:14:16 UTC 2020
| >>
| >> Modified Files:
| >>src/doc: 3RDPARTY CHANGES
| >>
| >> Log Message:
| >> new awk
| >>
| >>
| >> To generate a diff of this commit:
| >> cvs rdiff -u -r1.1690 -r1.1691 src/doc/3RDPARTY
| >> cvs rdiff -u -r1.2649 -r1.2650 src/doc/CHANGES
| >>
| >> Please note that diffs are not public domain; they are subject to the
| >> copyright notices on the relevant files.
| >>
| >=20
| > This upgrade broke MKLLVM HAVE_LLVM build (at least for -m sparc64).
| >=20
| 
| Log:
| 
| isters.S |  sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1
| /^\2(\3\4$/;"  >> tags.tmp
| In file included from /usr/src/lib/libc/compat/rpc/compat_pmap_rmtcall.c:50=
| :
| In file included from
| /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpc.h:75:
| /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
| error: unknown type name 'rpcblist'
| extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
|^
| 1 error generated.
| --- compat_pmap_rmtcall.o ---
| *** [compat_pmap_rmtcall.o] Error code 1
| nbmake[6]: stopped in /usr/src/lib/libc
| In file included from /usr/src/lib/libc/compat/rpc/compat_rpcb.c:50:
| /public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
| error: unknown type name 'rpcblist'
| extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);

building.

christos


CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 18:08:03 UTC 2020

Modified Files:
src/usr.sbin/sysinst: disklabel.c disks.c main.c target.c

Log Message:
Use strlcpy in a few places to guarnatee 0-terminated strings


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.65 -r1.66 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/target.c

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

Modified files:

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.35 src/usr.sbin/sysinst/disklabel.c:1.36
--- src/usr.sbin/sysinst/disklabel.c:1.35	Thu Feb  6 11:46:35 2020
+++ src/usr.sbin/sysinst/disklabel.c	Wed Feb 19 18:08:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.35 2020/02/06 11:46:35 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.36 2020/02/19 18:08:03 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -934,7 +934,7 @@ disklabel_set_disk_pack_name(struct disk
 	struct disklabel_disk_partitions *parts =
 	(struct disklabel_disk_partitions*)arg;
 
-	strncpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
+	strlcpy(parts->l.d_packname, pack, sizeof(parts->l.d_packname));
 	return true;
 }
 

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.65 src/usr.sbin/sysinst/disks.c:1.66
--- src/usr.sbin/sysinst/disks.c:1.65	Thu Feb  6 19:08:38 2020
+++ src/usr.sbin/sysinst/disks.c	Wed Feb 19 18:08:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.65 2020/02/06 19:08:38 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.66 2020/02/19 18:08:03 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1347,7 +1347,7 @@ make_fstab(struct install_partition_desc
 			break;
 		case FS_SWAP:
 			if (swap_dev[0] == 0) {
-strncpy(swap_dev, dev, sizeof swap_dev);
+strlcpy(swap_dev, dev, sizeof swap_dev);
 dump_dev = ",dp";
 			} else {
 dump_dev = "";

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.20 src/usr.sbin/sysinst/main.c:1.21
--- src/usr.sbin/sysinst/main.c:1.20	Thu Jan 16 16:47:19 2020
+++ src/usr.sbin/sysinst/main.c	Wed Feb 19 18:08:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.20 2020/01/16 16:47:19 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.21 2020/02/19 18:08:03 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -193,7 +193,7 @@ main(int argc, char **argv)
 			break;
 		case 'r':
 			/* Release name other than compiled in release. */
-			strncpy(rel, optarg, sizeof rel);
+			strlcpy(rel, optarg, sizeof rel);
 			break;
 		case 'f':
 			/* Definition file to read. */

Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.12 src/usr.sbin/sysinst/target.c:1.13
--- src/usr.sbin/sysinst/target.c:1.12	Thu Feb  6 15:08:04 2020
+++ src/usr.sbin/sysinst/target.c	Wed Feb 19 18:08:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: target.c,v 1.12 2020/02/06 15:08:04 martin Exp $	*/
+/*	$NetBSD: target.c,v 1.13 2020/02/19 18:08:03 martin Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.12 2020/02/06 15:08:04 martin Exp $");
+__RCSID("$NetBSD: target.c,v 1.13 2020/02/19 18:08:03 martin Exp $");
 #endif
 
 /*
@@ -436,8 +436,8 @@ cp_within_target(const char *frompath, c
 	char realfrom[STRSIZE];
 	char realto[STRSIZE];
 
-	strncpy(realfrom, target_expand(frompath), STRSIZE);
-	strncpy(realto, target_expand(topath), STRSIZE);
+	strlcpy(realfrom, target_expand(frompath), sizeof realfrom);
+	strlcpy(realto, target_expand(topath), sizeof realto);
 
 	if (access(realfrom, R_OK) == -1 && optional)
 		return 0;



CVS commit: src/usr.sbin/sysinst

2020-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 19 18:08:03 UTC 2020

Modified Files:
src/usr.sbin/sysinst: disklabel.c disks.c main.c target.c

Log Message:
Use strlcpy in a few places to guarnatee 0-terminated strings


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.65 -r1.66 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/target.c

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



CVS commit: src/tests/lib/libc/sys

2020-02-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 19 17:13:00 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Fix clang(1) build

Namespace a symbol that can be unused.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.162 src/tests/lib/libc/sys/t_ptrace_wait.c:1.163
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.162	Thu Feb 13 15:27:41 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Feb 19 17:13:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.162 2020/02/13 15:27:41 mgorny Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.163 2020/02/19 17:13:00 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.162 2020/02/13 15:27:41 mgorny Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.163 2020/02/19 17:13:00 kamil Exp $");
 
 #define __LEGACY_PT_LWPINFO
 
@@ -8948,6 +8948,7 @@ THREAD_CONCURRENT_TEST(thread_concurrent
 "Verify that concurrent signals issued to a single thread are reported "
 "correctly and passed back to a handler function");
 
+#if defined(__i386__) || defined(__x86_64__)
 THREAD_CONCURRENT_TEST(thread_concurrent_breakpoints, TCSH_DISCARD,
 THREAD_CONCURRENT_BREAKPOINT_NUM, 0, 0,
 "Verify that concurrent breakpoints are reported correctly");
@@ -8998,6 +8999,7 @@ THREAD_CONCURRENT_TEST(thread_concurrent
 THREAD_CONCURRENT_WATCHPOINT_NUM,
 "Verify that concurrent breakpoints, watchpoints and signals are reported "
 "correctly and passed back to a handler function");
+#endif
 
 #endif /*defined(TWAIT_HAVE_STATUS)*/
 



CVS commit: src/tests/lib/libc/sys

2020-02-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 19 17:13:00 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Fix clang(1) build

Namespace a symbol that can be unused.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/tests/lib/libc/sys/t_ptrace_wait.c

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



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

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 17:05:06 UTC 2020

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

Log Message:
Mark previous #ifdef __NetBSD__, per request from hannken.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.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/spa_history.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.6
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.5	Wed Feb 19 16:11:19 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c	Wed Feb 19 17:05:06 2020
@@ -540,9 +540,17 @@ spa_history_log_internal_dd(dsl_dir_t *d
 void
 spa_history_log_version(spa_t *spa, const char *operation)
 {
+#ifdef __NetBSD__
 	spa_history_log_internal(spa, operation, NULL,
 	"pool version %llu; software version %llu/%d; %s %s %s %s %s",
 	(u_longlong_t)spa_version(spa), SPA_VERSION, ZPL_VERSION,
 	utsname.sysname, utsname.nodename, utsname.release, utsname.version,
 	utsname.machine);
+#else
+	spa_history_log_internal(spa, operation, NULL,
+	"pool version %llu; software version %llu/%d; uts %s %s %s %s",
+	(u_longlong_t)spa_version(spa), SPA_VERSION, ZPL_VERSION,
+	utsname.nodename, utsname.release, utsname.version,
+	utsname.machine);
+#endif
 }



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

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 17:05:06 UTC 2020

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

Log Message:
Mark previous #ifdef __NetBSD__, per request from hannken.


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

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



CVS commit: src/external/cddl/osnet

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:11:19 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_history.c
src/external/cddl/osnet/sys/kern: misc.c

Log Message:
Report the OS name and release appropriately for NetBSD.

We are not OpenSolaris or uts!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/sys/kern/misc.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/spa_history.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.5
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c:1.4	Mon May 28 21:05:07 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c	Wed Feb 19 16:11:19 2020
@@ -541,8 +541,8 @@ void
 spa_history_log_version(spa_t *spa, const char *operation)
 {
 	spa_history_log_internal(spa, operation, NULL,
-	"pool version %llu; software version %llu/%d; uts %s %s %s %s",
+	"pool version %llu; software version %llu/%d; %s %s %s %s %s",
 	(u_longlong_t)spa_version(spa), SPA_VERSION, ZPL_VERSION,
-	utsname.nodename, utsname.release, utsname.version,
+	utsname.sysname, utsname.nodename, utsname.release, utsname.version,
 	utsname.machine);
 }

Index: src/external/cddl/osnet/sys/kern/misc.c
diff -u src/external/cddl/osnet/sys/kern/misc.c:1.7 src/external/cddl/osnet/sys/kern/misc.c:1.8
--- src/external/cddl/osnet/sys/kern/misc.c:1.7	Tue Dec 31 14:51:29 2019
+++ src/external/cddl/osnet/sys/kern/misc.c	Wed Feb 19 16:11:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.7 2019/12/31 14:51:29 pgoyette Exp $	*/
+/*	$NetBSD: misc.c,v 1.8 2020/02/19 16:11:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@ opensolaris_utsname_init(void *arg)
 	strlcpy(utsname.sysname, ostype, sizeof(utsname.sysname));
 	strlcpy(utsname.nodename, hostname, sizeof(utsname.nodename));
 	strlcpy(utsname.release, osrelease, sizeof(utsname.release));
-	strlcpy(utsname.version, "OpenSolaris", sizeof(utsname.version));
+	strlcpy(utsname.version, version, sizeof(utsname.version));
 	strlcpy(utsname.machine, machine, sizeof(utsname.machine));
 }
 



CVS commit: src/external/cddl/osnet

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:11:19 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_history.c
src/external/cddl/osnet/sys/kern: misc.c

Log Message:
Report the OS name and release appropriately for NetBSD.

We are not OpenSolaris or uts!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/sys/kern/misc.c

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



Re: CVS commit: src/doc

2020-02-19 Thread Kamil Rytarowski
On 19.02.2020 16:32, Kamil Rytarowski wrote:
> On 18.02.2020 22:14, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Tue Feb 18 21:14:16 UTC 2020
>>
>> Modified Files:
>>  src/doc: 3RDPARTY CHANGES
>>
>> Log Message:
>> new awk
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.1690 -r1.1691 src/doc/3RDPARTY
>> cvs rdiff -u -r1.2649 -r1.2650 src/doc/CHANGES
>>
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
>>
> 
> This upgrade broke MKLLVM HAVE_LLVM build (at least for -m sparc64).
> 

Log:

isters.S |  sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1
/^\2(\3\4$/;"  >> tags.tmp
In file included from /usr/src/lib/libc/compat/rpc/compat_pmap_rmtcall.c:50:
In file included from
/public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpc.h:75:
/public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
error: unknown type name 'rpcblist'
extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
   ^
1 error generated.
--- compat_pmap_rmtcall.o ---
*** [compat_pmap_rmtcall.o] Error code 1
nbmake[6]: stopped in /usr/src/lib/libc
In file included from /usr/src/lib/libc/compat/rpc/compat_rpcb.c:50:
/public/netbsd-sparc64/destdir.sparc64/usr/include/rpc/rpcb_clnt.h:68:8:
error: unknown type name 'rpcblist'
extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
   ^
1 error generated.
--- compat_rpcb.o ---
*** [compat_rpcb.o] Error code 1

nbmake[6]: stopped in /usr/src/lib/libc
2 errors

nbmake[6]: stopped in /usr/src/lib/libc
--- dependall ---
*** [dependall] Error code 2
nbmake[5]: stopped in /usr/src/lib/libc
1 error
nbmake[5]: stopped in /usr/src/lib/libc
*** Failed target:  dependall-libc
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1";
shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .)
this="lib/"; real="/usr/src/lib" ;; *) this="lib/${dir}/";
real="/usr/src/lib/${dir}" ;; esac; show=${this:-.}; echo "${target}
===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
/public/netbsd-sparc64/tooldir.NetBSD-9.99.46-amd64/bin/nbmake
_THISDIR_="${this}" "$@" ${target}; }; _makedirtarget libc dependall
*** Error code 2

Stop.
nbmake[4]: stopped in /usr/src/lib
--- build_install ---
*** [build_install] Error code 1

nbmake[3]: stopped in /usr/src/lib
1 error

nbmake[3]: stopped in /usr/src/lib
--- do-lib ---
*** [do-lib] Error code 2

nbmake[2]: stopped in /usr/src
1 error

nbmake[2]: stopped in /usr/src
--- build ---
*** [build] Error code 2

nbmake[1]: stopped in /usr/src
1 error

nbmake[1]: stopped in /usr/src
--- distribution ---
*** [distribution] Error code 2

nbmake: stopped in /usr/src
1 error

nbmake: stopped in /usr/src

ERROR: Failed to make distribution



signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:07:38 UTC 2020

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

Log Message:
usbdi dtrace probes


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/dev/usb/usbdi.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/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.194 src/sys/dev/usb/usbdi.c:1.195
--- src/sys/dev/usb/usbdi.c:1.194	Mon Feb 17 08:16:44 2020
+++ src/sys/dev/usb/usbdi.c	Wed Feb 19 16:07:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.194 2020/02/17 08:16:44 riastradh Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.195 2020/02/19 16:07:37 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.194 2020/02/17 08:16:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.195 2020/02/19 16:07:37 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /* UTF-8 encoding stuff */
@@ -62,6 +63,58 @@ __KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.
 
 extern int usbdebug;
 
+SDT_PROBE_DEFINE5(usb, device, pipe, open,
+"struct usbd_interface *"/*iface*/,
+"uint8_t"/*address*/,
+"uint8_t"/*flags*/,
+"int"/*ival*/,
+"struct usbd_pipe *"/*pipe*/);
+
+SDT_PROBE_DEFINE7(usb, device, pipe, open__intr,
+"struct usbd_interface *"/*iface*/,
+"uint8_t"/*address*/,
+"uint8_t"/*flags*/,
+"int"/*ival*/,
+"usbd_callback"/*cb*/,
+"void *"/*cookie*/,
+"struct usbd_pipe *"/*pipe*/);
+
+SDT_PROBE_DEFINE2(usb, device, pipe, transfer__start,
+"struct usbd_pipe *"/*pipe*/,
+"struct usbd_xfer *"/*xfer*/);
+SDT_PROBE_DEFINE3(usb, device, pipe, transfer__done,
+"struct usbd_pipe *"/*pipe*/,
+"struct usbd_xfer *"/*xfer*/,
+"usbd_status"/*err*/);
+SDT_PROBE_DEFINE2(usb, device, pipe, start,
+"struct usbd_pipe *"/*pipe*/,
+"struct usbd_xfer *"/*xfer*/);
+
+SDT_PROBE_DEFINE1(usb, device, pipe, close,  "struct usbd_pipe *"/*pipe*/);
+SDT_PROBE_DEFINE1(usb, device, pipe, abort__start,
+"struct usbd_pipe *"/*pipe*/);
+SDT_PROBE_DEFINE1(usb, device, pipe, abort__done,
+"struct usbd_pipe *"/*pipe*/);
+SDT_PROBE_DEFINE1(usb, device, pipe, clear__endpoint__stall,
+"struct usbd_pipe *"/*pipe*/);
+SDT_PROBE_DEFINE1(usb, device, pipe, clear__endpoint__toggle,
+"struct usbd_pipe *"/*pipe*/);
+
+SDT_PROBE_DEFINE5(usb, device, xfer, create,
+"struct usbd_xfer *"/*xfer*/,
+"struct usbd_pipe *"/*pipe*/,
+"size_t"/*len*/,
+"unsigned int"/*flags*/,
+"unsigned int"/*nframes*/);
+SDT_PROBE_DEFINE1(usb, device, xfer, start,  "struct usbd_xfer *"/*xfer*/);
+SDT_PROBE_DEFINE1(usb, device, xfer, preabort,  "struct usbd_xfer *"/*xfer*/);
+SDT_PROBE_DEFINE1(usb, device, xfer, abort,  "struct usbd_xfer *"/*xfer*/);
+SDT_PROBE_DEFINE1(usb, device, xfer, timeout,  "struct usbd_xfer *"/*xfer*/);
+SDT_PROBE_DEFINE2(usb, device, xfer, done,
+"struct usbd_xfer *"/*xfer*/,
+"usbd_status"/*status*/);
+SDT_PROBE_DEFINE1(usb, device, xfer, destroy,  "struct usbd_xfer *"/*xfer*/);
+
 Static usbd_status usbd_ar_pipe(struct usbd_pipe *);
 Static void usbd_start_next(struct usbd_pipe *);
 Static usbd_status usbd_open_pipe_ival
@@ -195,6 +248,8 @@ usbd_open_pipe_ival(struct usbd_interfac
 		return err;
 	LIST_INSERT_HEAD(>ui_pipes, p, up_next);
 	*pipe = p;
+	SDT_PROBE5(usb, device, pipe, open,
+	iface, address, flags, ival, p);
 	return USBD_NORMAL_COMPLETION;
 }
 
@@ -228,6 +283,8 @@ usbd_open_pipe_intr(struct usbd_interfac
 	*pipe = ipipe;
 	if (err != USBD_IN_PROGRESS)
 		goto bad3;
+	SDT_PROBE7(usb, device, pipe, open__intr,
+	iface, address, flags, ival, cb, priv, ipipe);
 	return USBD_NORMAL_COMPLETION;
 
  bad3:
@@ -248,6 +305,7 @@ usbd_close_pipe(struct usbd_pipe *pipe)
 	KASSERT(pipe != NULL);
 
 	usbd_lock_pipe(pipe);
+	SDT_PROBE1(usb, device, pipe, close,  pipe);
 
 	if (!SIMPLEQ_EMPTY(>up_queue)) {
 		printf("WARNING: pipe closed with active xfers on addr %d\n",
@@ -285,6 +343,7 @@ usbd_transfer(struct usbd_xfer *xfer)
 	"xfer = %#jx, flags = %#jx, pipe = %#jx, running = %jd",
 	(uintptr_t)xfer, xfer->ux_flags, (uintptr_t)pipe, pipe->up_running);
 	KASSERT(xfer->ux_status == USBD_NOT_STARTED);
+	SDT_PROBE1(usb, device, xfer, start,  xfer);
 
 #ifdef USB_DEBUG
 	if (usbdebug > 5)
@@ -295,6 +354,7 @@ usbd_transfer(struct usbd_xfer *xfer)
 	if (pipe->up_aborting) {
 		USBHIST_LOG(usbdebug, "<- done xfer %#jx, aborting",
 		(uintptr_t)xfer, 0, 0, 0);
+		SDT_PROBE2(usb, device, xfer, done,  xfer, USBD_CANCELLED);
 		return USBD_CANCELLED;
 	}
 
@@ -326,7 +386,9 @@ usbd_transfer(struct usbd_xfer *xfer)
 	}
 
 	/* xfer is not valid after the transfer method unless synchronous */
+	SDT_PROBE2(usb, device, pipe, 

CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:07:38 UTC 2020

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

Log Message:
usbdi dtrace probes


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/dev/usb/usbdi.c

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



CVS commit: src/sys/dev/scsipi

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:05:41 UTC 2020

Modified Files:
src/sys/dev/scsipi: scsipi_base.c
Added Files:
src/sys/dev/scsipi: scsi_sdt.h

Log Message:
Sprinkle some dtrace probes into scsi(4).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/scsipi/scsi_sdt.h
cvs rdiff -u -r1.184 -r1.185 src/sys/dev/scsipi/scsipi_base.c

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

Modified files:

Index: src/sys/dev/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.184 src/sys/dev/scsipi/scsipi_base.c:1.185
--- src/sys/dev/scsipi/scsipi_base.c:1.184	Sun Nov 10 21:16:37 2019
+++ src/sys/dev/scsipi/scsipi_base.c	Wed Feb 19 16:05:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.184 2019/11/10 21:16:37 chs Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.185 2020/02/19 16:05:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.184 2019/11/10 21:16:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.185 2020/02/19 16:05:41 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -51,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: scsipi_base.
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -62,6 +63,38 @@ __KERNEL_RCSID(0, "$NetBSD: scsipi_base.
 
 #include 
 
+SDT_PROVIDER_DEFINE(scsi);
+
+SDT_PROBE_DEFINE3(scsi, base, tag, get,
+"struct scsipi_xfer *"/*xs*/, "uint8_t"/*tag*/, "uint8_t"/*type*/);
+SDT_PROBE_DEFINE3(scsi, base, tag, put,
+"struct scsipi_xfer *"/*xs*/, "uint8_t"/*tag*/, "uint8_t"/*type*/);
+
+SDT_PROBE_DEFINE3(scsi, base, adapter, request__start,
+"struct scsipi_channel *"/*chan*/,
+"scsipi_adapter_req_t"/*req*/,
+"void *"/*arg*/);
+SDT_PROBE_DEFINE3(scsi, base, adapter, request__done,
+"struct scsipi_channel *"/*chan*/,
+"scsipi_adapter_req_t"/*req*/,
+"void *"/*arg*/);
+
+SDT_PROBE_DEFINE1(scsi, base, queue, batch__start,
+"struct scsipi_channel *"/*chan*/);
+SDT_PROBE_DEFINE2(scsi, base, queue, run,
+"struct scsipi_channel *"/*chan*/,
+"struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, queue, batch__done,
+"struct scsipi_channel *"/*chan*/);
+
+SDT_PROBE_DEFINE1(scsi, base, xfer, execute,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, enqueue,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, done,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, redone,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, complete,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, restart,  "struct scsipi_xfer *"/*xs*/);
+SDT_PROBE_DEFINE1(scsi, base, xfer, free,  "struct scsipi_xfer *"/*xs*/);
+
 static int	scsipi_complete(struct scsipi_xfer *);
 static void	scsipi_request_sense(struct scsipi_xfer *);
 static int	scsipi_enqueue(struct scsipi_xfer *);
@@ -378,6 +411,8 @@ scsipi_get_tag(struct scsipi_xfer *xs)
 	}
 
 	xs->xs_tag_id = tag;
+	SDT_PROBE3(scsi, base, tag, get,
+	xs, xs->xs_tag_id, xs->xs_tag_type);
 }
 
 /*
@@ -395,6 +430,9 @@ scsipi_put_tag(struct scsipi_xfer *xs)
 
 	KASSERT(mutex_owned(chan_mtx(periph->periph_channel)));
 
+	SDT_PROBE3(scsi, base, tag, put,
+	xs, xs->xs_tag_id, xs->xs_tag_type);
+
 	word = xs->xs_tag_id >> 5;
 	bit = xs->xs_tag_id & 0x1f;
 
@@ -541,6 +579,7 @@ scsipi_put_xs(struct scsipi_xfer *xs)
 	struct scsipi_periph *periph = xs->xs_periph;
 	int flags = xs->xs_control;
 
+	SDT_PROBE1(scsi, base, xfer, free,  xs);
 	SC_DEBUG(periph, SCSIPI_DB3, ("scsipi_free_xs\n"));
 	KASSERT(mutex_owned(chan_mtx(periph->periph_channel)));
 
@@ -1559,6 +1598,7 @@ scsipi_done(struct scsipi_xfer *xs)
 #endif
 
 	mutex_enter(chan_mtx(chan));
+	SDT_PROBE1(scsi, base, xfer, done,  xs);
 	/*
 	 * The resource this command was using is now free.
 	 */
@@ -1573,6 +1613,7 @@ scsipi_done(struct scsipi_xfer *xs)
 		 * that this won't ever happen (and can be turned into
 		 * a KASSERT().
 		 */
+		SDT_PROBE1(scsi, base, xfer, redone,  xs);
 		mutex_exit(chan_mtx(chan));
 		goto out;
 	}
@@ -1704,6 +1745,8 @@ scsipi_complete(struct scsipi_xfer *xs)
 	struct scsipi_channel *chan = periph->periph_channel;
 	int error;
 
+	SDT_PROBE1(scsi, base, xfer, complete,  xs);
+
 #ifdef DIAGNOSTIC
 	if ((xs->xs_control & XS_CTL_ASYNC) != 0 && xs->bp == NULL)
 		panic("scsipi_complete: XS_CTL_ASYNC but no buf");
@@ -1872,6 +1915,7 @@ scsipi_complete(struct scsipi_xfer *xs)
 
 	mutex_enter(chan_mtx(chan));
 	if (error == ERESTART) {
+		SDT_PROBE1(scsi, base, xfer, restart,  xs);
 		/*
 		 * If we get here, the periph has been thawed and frozen
 		 * again if we had to issue recovery commands.  Alternatively,
@@ -1981,6 +2025,8 @@ scsipi_enqueue(struct scsipi_xfer *xs)
 	struct scsipi_channel *chan = xs->xs_periph->periph_channel;
 	

CVS commit: src/sys/dev/scsipi

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:05:41 UTC 2020

Modified Files:
src/sys/dev/scsipi: scsipi_base.c
Added Files:
src/sys/dev/scsipi: scsi_sdt.h

Log Message:
Sprinkle some dtrace probes into scsi(4).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/scsipi/scsi_sdt.h
cvs rdiff -u -r1.184 -r1.185 src/sys/dev/scsipi/scsipi_base.c

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



CVS commit: src/sys/dev

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:04:40 UTC 2020

Modified Files:
src/sys/dev/ic: ahcisata_core.c mvsata.c siisata.c
src/sys/dev/scsipi: atapi_wdc.c scsiconf.c
src/sys/dev/usb: umass_scsipi.c

Log Message:
C99 initializers for scsipi_bustype.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.135 -r1.136 src/sys/dev/scsipi/atapi_wdc.c
cvs rdiff -u -r1.285 -r1.286 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/usb/umass_scsipi.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.81 src/sys/dev/ic/ahcisata_core.c:1.82
--- src/sys/dev/ic/ahcisata_core.c:1.81	Sat Jan 18 11:26:11 2020
+++ src/sys/dev/ic/ahcisata_core.c	Wed Feb 19 16:04:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.81 2020/01/18 11:26:11 simonb Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.82 2020/02/19 16:04:39 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.81 2020/01/18 11:26:11 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.82 2020/02/19 16:04:39 riastradh Exp $");
 
 #include 
 #include 
@@ -99,12 +99,12 @@ static void ahci_atapi_kill_xfer(struct 
 static void ahci_atapi_probe_device(struct atapibus_softc *, int);
 
 static const struct scsipi_bustype ahci_atapi_bustype = {
-	SCSIPI_BUSTYPE_ATAPI,
-	atapi_scsipi_cmd,
-	atapi_interpret_sense,
-	atapi_print_addr,
-	ahci_atapi_kill_pending,
-	NULL,
+	.bustype_type = SCSIPI_BUSTYPE_ATAPI,
+	.bustype_cmd = atapi_scsipi_cmd,
+	.bustype_interpret_sense = atapi_interpret_sense,
+	.bustype_printaddr = atapi_print_addr,
+	.bustype_kill_pending = ahci_atapi_kill_pending,
+	.bustype_async_event_xfer_mode = NULL,
 };
 #endif /* NATAPIBUS */
 

Index: src/sys/dev/ic/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.52 src/sys/dev/ic/mvsata.c:1.53
--- src/sys/dev/ic/mvsata.c:1.52	Fri Dec 27 09:41:50 2019
+++ src/sys/dev/ic/mvsata.c	Wed Feb 19 16:04:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.52 2019/12/27 09:41:50 msaitoh Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.53 2020/02/19 16:04:39 riastradh Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.52 2019/12/27 09:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.53 2020/02/19 16:04:39 riastradh Exp $");
 
 #include "opt_mvsata.h"
 
@@ -235,12 +235,12 @@ static const struct ata_bustype mvsata_a
 
 #if NATAPIBUS > 0
 static const struct scsipi_bustype mvsata_atapi_bustype = {
-	SCSIPI_BUSTYPE_ATAPI,
-	atapi_scsipi_cmd,
-	atapi_interpret_sense,
-	atapi_print_addr,
-	mvsata_atapi_kill_pending,
-	NULL,
+	.bustype_type = SCSIPI_BUSTYPE_ATAPI,
+	.bustype_cmd = atapi_scsipi_cmd,
+	.bustype_interpret_sense = atapi_interpret_sense,
+	.bustype_printaddr = atapi_print_addr,
+	.bustype_kill_pending = mvsata_atapi_kill_pending,
+	.bustype_async_event_xfer_mode = NULL,
 };
 #endif /* NATAPIBUS */
 #endif

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.40 src/sys/dev/ic/siisata.c:1.41
--- src/sys/dev/ic/siisata.c:1.40	Sun Nov 10 21:16:35 2019
+++ src/sys/dev/ic/siisata.c	Wed Feb 19 16:04:39 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.40 2019/11/10 21:16:35 chs Exp $ */
+/* $NetBSD: siisata.c,v 1.41 2020/02/19 16:04:39 riastradh Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.40 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.41 2020/02/19 16:04:39 riastradh Exp $");
 
 #include 
 #include 
@@ -198,12 +198,12 @@ const struct ata_bustype siisata_ata_bus
 
 #if NATAPIBUS > 0
 static const struct scsipi_bustype siisata_atapi_bustype = {
-	SCSIPI_BUSTYPE_ATAPI,
-	atapi_scsipi_cmd,
-	atapi_interpret_sense,
-	atapi_print_addr,
-	siisata_atapi_kill_pending,
-	NULL,
+	.bustype_type = SCSIPI_BUSTYPE_ATAPI,
+	.bustype_cmd = atapi_scsipi_cmd,
+	.bustype_interpret_sense = atapi_interpret_sense,
+	.bustype_printaddr = atapi_print_addr,
+	.bustype_kill_pending = siisata_atapi_kill_pending,
+	.bustype_async_event_xfer_mode = NULL,
 };
 #endif /* NATAPIBUS */
 

Index: src/sys/dev/scsipi/atapi_wdc.c
diff -u src/sys/dev/scsipi/atapi_wdc.c:1.135 src/sys/dev/scsipi/atapi_wdc.c:1.136
--- src/sys/dev/scsipi/atapi_wdc.c:1.135	Wed Feb 12 00:19:07 2020
+++ src/sys/dev/scsipi/atapi_wdc.c	Wed Feb 19 16:04:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: atapi_wdc.c,v 1.135 2020/02/12 00:19:07 chs Exp $	*/
+/*	$NetBSD: atapi_wdc.c,v 1.136 2020/02/19 16:04:39 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel 

CVS commit: src/sys/dev

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:04:40 UTC 2020

Modified Files:
src/sys/dev/ic: ahcisata_core.c mvsata.c siisata.c
src/sys/dev/scsipi: atapi_wdc.c scsiconf.c
src/sys/dev/usb: umass_scsipi.c

Log Message:
C99 initializers for scsipi_bustype.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.135 -r1.136 src/sys/dev/scsipi/atapi_wdc.c
cvs rdiff -u -r1.285 -r1.286 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/usb/umass_scsipi.c

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:04:01 UTC 2020

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

Log Message:
umass dtrace probes


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/dev/usb/umass.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/umass.c
diff -u src/sys/dev/usb/umass.c:1.179 src/sys/dev/usb/umass.c:1.180
--- src/sys/dev/usb/umass.c:1.179	Wed Feb 19 16:02:50 2020
+++ src/sys/dev/usb/umass.c	Wed Feb 19 16:04:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.179 2020/02/19 16:02:50 riastradh Exp $	*/
+/*	$NetBSD: umass.c,v 1.180 2020/02/19 16:04:01 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.179 2020/02/19 16:02:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.180 2020/02/19 16:04:01 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -144,6 +144,7 @@ __KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -157,6 +158,56 @@ __KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.
 #include 
 #include 
 
+SDT_PROBE_DEFINE1(usb, umass, device, attach__start,
+"struct umass_softc *"/*sc*/);
+SDT_PROBE_DEFINE2(usb, umass, device, attach__done,
+"struct umass_softc *"/*sc*/, "usbd_status"/*err*/);
+SDT_PROBE_DEFINE1(usb, umass, device, detach__start,
+"struct umass_softc *"/*sc*/);
+SDT_PROBE_DEFINE2(usb, umass, device, detach__done,
+"struct umass_softc *"/*sc*/, "int"/*error*/);
+
+SDT_PROBE_DEFINE7(usb, umass, transfer, start__bbb,
+"struct umass_softc *"/*sc*/,
+"transfer_cb_f"/*cb*/,
+"void *"/*priv*/,
+"void *"/*data*/,
+"int"/*datalen*/,
+"int"/*dir*/,
+"int"/*timeout*/);
+SDT_PROBE_DEFINE7(usb, umass, transfer, start__cbi,
+"struct umass_softc *"/*sc*/,
+"transfer_cb_f"/*cb*/,
+"void *"/*priv*/,
+"void *"/*data*/,
+"int"/*datalen*/,
+"int"/*dir*/,
+"int"/*timeout*/);
+SDT_PROBE_DEFINE7(usb, umass, transfer, done,
+"struct umass_softc *"/*sc*/,
+"transfer_cb_f"/*cb*/,
+"void *"/*priv*/,
+"void *"/*data*/,
+"int"/*datalen*/,
+"int"/*resid*/,
+"int"/*status*/);	/* STATUS_* */
+
+SDT_PROBE_DEFINE3(usb, umass, bbb, state,
+"struct umass_softc *"/*sc*/,
+"struct usbd_xfer *"/*xfer*/,
+"usbd_status"/*err*/);
+SDT_PROBE_DEFINE2(usb, umass, bbb, reset,
+"struct umass_softc *"/*sc*/,
+"int"/*status*/);
+
+SDT_PROBE_DEFINE3(usb, umass, cbi, state,
+"struct umass_softc *"/*sc*/,
+"struct usbd_xfer *"/*xfer*/,
+"usbd_status"/*err*/);
+SDT_PROBE_DEFINE2(usb, umass, cbi, reset,
+"struct umass_softc *"/*sc*/,
+"int"/*status*/);
+
 #ifdef USB_DEBUG
 #ifdef UMASS_DEBUG
 int umassdebug = 0;
@@ -335,6 +386,8 @@ umass_attach(device_t parent, device_t s
 	usbd_status err;
 	int i, error;
 
+	SDT_PROBE1(usb, umass, device, attach__start,  sc);
+
 	sc->sc_dev = self;
 
 	aprint_naive("\n");
@@ -382,6 +435,8 @@ umass_attach(device_t parent, device_t s
 		default:
 			DPRINTFM(UDMASS_GEN, "Unsupported wire protocol %ju",
 			uiaa->uiaa_proto, 0, 0, 0);
+			SDT_PROBE2(usb, umass, device, attach__done,
+			sc, USBD_IOERROR);
 			return;
 		}
 	}
@@ -405,6 +460,8 @@ umass_attach(device_t parent, device_t s
 		default:
 			DPRINTFM(UDMASS_GEN, "Unsupported command protocol %ju",
 			uiaa->uiaa_subclass, 0, 0, 0);
+			SDT_PROBE2(usb, umass, device, attach__done,
+			sc, USBD_IOERROR);
 			return;
 		}
 	}
@@ -451,6 +508,7 @@ umass_attach(device_t parent, device_t s
 		err = (*quirk->uq_init)(sc);
 		if (err) {
 			aprint_error_dev(self, "quirk init failed\n");
+			SDT_PROBE2(usb, umass, device, attach__done,  sc, err);
 			umass_disco(sc);
 			return;
 		}
@@ -473,6 +531,8 @@ umass_attach(device_t parent, device_t s
 		if (ed == NULL) {
 			aprint_error_dev(self,
 			"could not read endpoint descriptor\n");
+			SDT_PROBE2(usb, umass, device, attach__done,
+			sc, USBD_IOERROR);
 			return;
 		}
 		if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
@@ -515,6 +575,7 @@ umass_attach(device_t parent, device_t s
 		if (err) {
 			aprint_error_dev(self, "unable to get Max Lun: %s\n",
 			usbd_errstr(err));
+			SDT_PROBE2(usb, umass, device, attach__done,  sc, err);
 			return;
 		}
 		if (sc->maxlun > 0)
@@ -532,6 +593,7 @@ umass_attach(device_t parent, device_t s
 	if (err) {
 		aprint_error_dev(self, "cannot open %u-out pipe (bulk)\n",
 		sc->sc_epaddr[UMASS_BULKOUT]);
+		SDT_PROBE2(usb, umass, device, attach__done,  sc, err);
 		umass_disco(sc);
 		return;
 	}
@@ -543,6 +605,7 @@ umass_attach(device_t parent, device_t s
 	if (err) {
 		aprint_error_dev(self, "could not open %u-in pipe (bulk)\n",
 		sc->sc_epaddr[UMASS_BULKIN]);
+		SDT_PROBE2(usb, umass, device, attach__done,  sc, err);
 		umass_disco(sc);
 		

CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:04:01 UTC 2020

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

Log Message:
umass dtrace probes


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/dev/usb/umass.c

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:03:30 UTC 2020

Modified Files:
src/sys/dev/usb: usb.c
Added Files:
src/sys/dev/usb: usb_sdt.h

Log Message:
New dtrace usb provider, with a handful of probes in usb.c.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/usb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/usb_sdt.h

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

Modified files:

Index: src/sys/dev/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.182 src/sys/dev/usb/usb.c:1.183
--- src/sys/dev/usb/usb.c:1.182	Wed Feb 12 15:59:44 2020
+++ src/sys/dev/usb/usb.c	Wed Feb 19 16:03:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.182 2020/02/12 15:59:44 riastradh Exp $	*/
+/*	$NetBSD: usb.c,v 1.183 2020/02/19 16:03:30 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.182 2020/02/12 15:59:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.183 2020/02/19 16:03:30 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -65,6 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.18
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -73,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.18
 #include 
 #include 
 #include 
+#include 
 
 #include "ioconf.h"
 
@@ -155,6 +157,54 @@ struct usb_taskq {
 
 static struct usb_taskq usb_taskq[USB_NUM_TASKQS];
 
+/* XXX wrong place */
+#ifdef KDTRACE_HOOKS
+#define	__dtrace_used
+#else
+#define	__dtrace_used	__unused
+#endif
+
+SDT_PROVIDER_DEFINE(usb);
+
+SDT_PROBE_DEFINE3(usb, kernel, task, add,
+"struct usbd_device *"/*dev*/, "struct usb_task *"/*task*/, "int"/*q*/);
+SDT_PROBE_DEFINE2(usb, kernel, task, rem__start,
+"struct usbd_device *"/*dev*/, "struct usb_task *"/*task*/);
+SDT_PROBE_DEFINE3(usb, kernel, task, rem__done,
+"struct usbd_device *"/*dev*/,
+"struct usb_task *"/*task*/,
+"bool"/*removed*/);
+SDT_PROBE_DEFINE4(usb, kernel, task, rem__wait__start,
+"struct usbd_device *"/*dev*/,
+"struct usb_task *"/*task*/,
+"int"/*queue*/,
+"kmutex_t *"/*interlock*/);
+SDT_PROBE_DEFINE5(usb, kernel, task, rem__wait__done,
+"struct usbd_device *"/*dev*/,
+"struct usb_task *"/*task*/,
+"int"/*queue*/,
+"kmutex_t *"/*interlock*/,
+"bool"/*done*/);
+
+SDT_PROBE_DEFINE1(usb, kernel, task, start,  "struct usb_task *"/*task*/);
+SDT_PROBE_DEFINE1(usb, kernel, task, done,  "struct usb_task *"/*task*/);
+
+SDT_PROBE_DEFINE1(usb, kernel, bus, needs__explore,
+"struct usbd_bus *"/*bus*/);
+SDT_PROBE_DEFINE1(usb, kernel, bus, needs__reattach,
+"struct usbd_bus *"/*bus*/);
+SDT_PROBE_DEFINE1(usb, kernel, bus, discover__start,
+"struct usbd_bus *"/*bus*/);
+SDT_PROBE_DEFINE1(usb, kernel, bus, discover__done,
+"struct usbd_bus *"/*bus*/);
+SDT_PROBE_DEFINE1(usb, kernel, bus, explore__start,
+"struct usbd_bus *"/*bus*/);
+SDT_PROBE_DEFINE1(usb, kernel, bus, explore__done,
+"struct usbd_bus *"/*bus*/);
+
+SDT_PROBE_DEFINE1(usb, kernel, event, add,  "struct usb_event *"/*uep*/);
+SDT_PROBE_DEFINE1(usb, kernel, event, drop,  "struct usb_event *"/*uep*/);
+
 dev_type_open(usbopen);
 dev_type_close(usbclose);
 dev_type_read(usbread);
@@ -412,6 +462,7 @@ usb_add_task(struct usbd_device *dev, st
 	struct usb_taskq *taskq;
 
 	USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
+	SDT_PROBE3(usb, kernel, task, add,  dev, task, queue);
 
 	KASSERT(0 <= queue);
 	KASSERT(queue < USB_NUM_TASKQS);
@@ -446,6 +497,7 @@ usb_rem_task(struct usbd_device *dev, st
 	unsigned queue;
 
 	USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
+	SDT_PROBE2(usb, kernel, task, rem__start,  dev, task);
 
 	while ((queue = task->queue) != USB_NUM_TASKQS) {
 		struct usb_taskq *taskq = _taskq[queue];
@@ -454,11 +506,14 @@ usb_rem_task(struct usbd_device *dev, st
 			TAILQ_REMOVE(>tasks, task, next);
 			task->queue = USB_NUM_TASKQS;
 			mutex_exit(>lock);
+			SDT_PROBE3(usb, kernel, task, rem__done,
+			dev, task, true);
 			return true; /* removed from the queue */
 		}
 		mutex_exit(>lock);
 	}
 
+	SDT_PROBE3(usb, kernel, task, rem__done,  dev, task, false);
 	return false;		/* was not removed from the queue */
 }
 
@@ -489,6 +544,8 @@ usb_rem_task_wait(struct usbd_device *de
 	bool removed;
 
 	USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
+	SDT_PROBE4(usb, kernel, task, rem__wait__start,
+	dev, task, queue, interlock);
 	ASSERT_SLEEPABLE();
 	KASSERT(0 <= queue);
 	KASSERT(queue < USB_NUM_TASKQS);
@@ -527,6 +584,8 @@ usb_rem_task_wait(struct usbd_device *de
 	if (interlock && !removed)
 		mutex_enter(interlock);
 
+	SDT_PROBE5(usb, kernel, task, rem__wait__done,
+	dev, task, queue, interlock, removed);
 	return removed;
 }
 
@@ -629,8 +688,10 @@ usb_task_thread(void *arg)
 
 			if (!mpsafe)
 KERNEL_LOCK(1, curlwp);
+			SDT_PROBE1(usb, kernel, task, start,  task);
 			

CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:03:30 UTC 2020

Modified Files:
src/sys/dev/usb: usb.c
Added Files:
src/sys/dev/usb: usb_sdt.h

Log Message:
New dtrace usb provider, with a handful of probes in usb.c.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/usb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/usb_sdt.h

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:02:34 UTC 2020

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

Log Message:
Consolidate logic to call the transfer callback.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/dev/usb/umass.c

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:02:50 UTC 2020

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

Log Message:
Make sure the umass transfer callback is run in error branches.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/dev/usb/umass.c

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:02:34 UTC 2020

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

Log Message:
Consolidate logic to call the transfer callback.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/dev/usb/umass.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/umass.c
diff -u src/sys/dev/usb/umass.c:1.177 src/sys/dev/usb/umass.c:1.178
--- src/sys/dev/usb/umass.c:1.177	Wed Feb 19 16:00:28 2020
+++ src/sys/dev/usb/umass.c	Wed Feb 19 16:02:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.177 2020/02/19 16:00:28 riastradh Exp $	*/
+/*	$NetBSD: umass.c,v 1.178 2020/02/19 16:02:33 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.177 2020/02/19 16:00:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.178 2020/02/19 16:02:33 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -236,6 +236,8 @@ Static usbd_status umass_setup_ctrl_tran
 struct usbd_xfer *);
 Static void umass_clear_endpoint_stall(struct umass_softc *, int,
 struct usbd_xfer *);
+Static void umass_transfer_done(struct umass_softc *, int, int);
+Static void umass_transfer_reset(struct umass_softc *);
 #if 0
 Static void umass_reset(struct umass_softc *, transfer_cb_f, void *);
 #endif
@@ -1009,6 +1011,26 @@ umass_clear_endpoint_stall(struct umass_
 	umass_setup_ctrl_transfer(sc, >sc_req, NULL, 0, 0, xfer);
 }
 
+Static void
+umass_transfer_done(struct umass_softc *sc, int residue, int status)
+{
+	UMASSHIST_FUNC(); UMASSHIST_CALLED();
+
+	sc->transfer_state = TSTATE_IDLE;
+	sc->transfer_cb(sc, sc->transfer_priv, residue, status);
+}
+
+Static void
+umass_transfer_reset(struct umass_softc *sc)
+{
+	UMASSHIST_FUNC(); UMASSHIST_CALLED();
+
+	sc->transfer_state = TSTATE_IDLE;
+	if (sc->transfer_priv)
+		sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen,
+		sc->transfer_status);
+}
+
 #if 0
 Static void
 umass_reset(struct umass_softc *sc, transfer_cb_f cb, void *priv)
@@ -1217,8 +1239,7 @@ umass_bbb_state(struct usbd_xfer *xfer, 
 		DPRINTFM(UDMASS_BBB, "sc %#jx xfer %#jx cancelled",
 		(uintptr_t)sc, (uintptr_t)xfer, 0, 0);
 
-		sc->transfer_state = TSTATE_IDLE;
-		sc->transfer_cb(sc, sc->transfer_priv, 0, STATUS_TIMEOUT);
+		umass_transfer_done(sc, 0, STATUS_TIMEOUT);
 		return;
 	}
 
@@ -1454,17 +1475,11 @@ umass_bbb_state(struct usbd_xfer *xfer, 
 			"res = %jd", (uintptr_t)sc, residue, 0, 0);
 
 			/* SCSI command failed but transfer was succesful */
-			sc->transfer_state = TSTATE_IDLE;
-			sc->transfer_cb(sc, sc->transfer_priv, residue,
-	STATUS_CMD_FAILED);
-
+			umass_transfer_done(sc, residue, STATUS_CMD_FAILED);
 			return;
 
 		} else {	/* success */
-			sc->transfer_state = TSTATE_IDLE;
-			sc->transfer_cb(sc, sc->transfer_priv, residue,
-	STATUS_CMD_OK);
-
+			umass_transfer_done(sc, residue, STATUS_CMD_OK);
 			return;
 		}
 
@@ -1496,12 +1511,7 @@ umass_bbb_state(struct usbd_xfer *xfer, 
 			   device_xname(sc->sc_dev), usbd_errstr(err));
 			/* no error recovery, otherwise we end up in a loop */
 
-		sc->transfer_state = TSTATE_IDLE;
-		if (sc->transfer_priv) {
-			sc->transfer_cb(sc, sc->transfer_priv,
-	sc->transfer_datalen,
-	sc->transfer_status);
-		}
+		umass_transfer_reset(sc);
 
 		return;
 
@@ -1669,8 +1679,7 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 	if (err == USBD_CANCELLED) {
 		DPRINTFM(UDMASS_BBB, "sc %#jx xfer %#jx cancelled",
 			(uintptr_t)sc, (uintptr_t)xfer, 0, 0);
-		sc->transfer_state = TSTATE_IDLE;
-		sc->transfer_cb(sc, sc->transfer_priv, 0, STATUS_TIMEOUT);
+		umass_transfer_done(sc, 0, STATUS_TIMEOUT);
 		return;
 	}
 
@@ -1700,12 +1709,8 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 			 * Section 2.4.3.1.1 states that the bulk in endpoints
 			 * should not stalled at this point.
 			 */
-
-			sc->transfer_state = TSTATE_IDLE;
-			sc->transfer_cb(sc, sc->transfer_priv,
-	sc->transfer_datalen,
-	STATUS_CMD_FAILED);
-
+			umass_transfer_done(sc, sc->transfer_datalen,
+			STATUS_CMD_FAILED);
 			return;
 		} else if (err) {
 			DPRINTFM(UDMASS_CBI, "sc %#jx: failed to send ADSC",
@@ -1794,10 +1799,9 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 			/* No command completion interrupt. Request
 			 * sense to get status of command.
 			 */
-			sc->transfer_state = TSTATE_IDLE;
-			sc->transfer_cb(sc, sc->transfer_priv,
-sc->transfer_datalen - sc->transfer_actlen,
-STATUS_CMD_UNKNOWN);
+			umass_transfer_done(sc,
+			sc->transfer_datalen - sc->transfer_actlen,
+			STATUS_CMD_UNKNOWN);
 		}
 		return;
 
@@ -1848,9 +1852,9 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 status = STATUS_CMD_FAILED;
 
 			/* No autosense, command successful */
-			sc->transfer_state = TSTATE_IDLE;
-			

CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:02:50 UTC 2020

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

Log Message:
Make sure the umass transfer callback is run in error branches.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/dev/usb/umass.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/umass.c
diff -u src/sys/dev/usb/umass.c:1.178 src/sys/dev/usb/umass.c:1.179
--- src/sys/dev/usb/umass.c:1.178	Wed Feb 19 16:02:33 2020
+++ src/sys/dev/usb/umass.c	Wed Feb 19 16:02:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.178 2020/02/19 16:02:33 riastradh Exp $	*/
+/*	$NetBSD: umass.c,v 1.179 2020/02/19 16:02:50 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.178 2020/02/19 16:02:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.179 2020/02/19 16:02:50 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -995,8 +995,11 @@ umass_clear_endpoint_stall(struct umass_
 {
 	UMASSHIST_FUNC(); UMASSHIST_CALLED();
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
 		return;
+	}
 
 	DPRINTFM(UDMASS_BBB, "Clear endpoint 0x%02jx stall",
 	sc->sc_epaddr[endpt], 0, 0, 0);
@@ -1008,7 +1011,9 @@ umass_clear_endpoint_stall(struct umass_
 	USETW(sc->sc_req.wValue, UF_ENDPOINT_HALT);
 	USETW(sc->sc_req.wIndex, sc->sc_epaddr[endpt]);
 	USETW(sc->sc_req.wLength, 0);
-	umass_setup_ctrl_transfer(sc, >sc_req, NULL, 0, 0, xfer);
+	if (umass_setup_ctrl_transfer(sc, >sc_req, NULL, 0, 0, xfer))
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
 }
 
 Static void
@@ -1055,8 +1060,10 @@ umass_bbb_reset(struct umass_softc *sc, 
 		   "sc->sc_wire == 0x%02x wrong for umass_bbb_reset\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 		return;
+	}
 
 	/*
 	 * Reset recovery (5.3.4 in Universal Serial Bus Mass Storage Class)
@@ -1085,8 +1092,9 @@ umass_bbb_reset(struct umass_softc *sc, 
 	USETW(sc->sc_req.wValue, 0);
 	USETW(sc->sc_req.wIndex, sc->sc_ifaceno);
 	USETW(sc->sc_req.wLength, 0);
-	umass_setup_ctrl_transfer(sc, >sc_req, NULL, 0, 0,
-  sc->transfer_xfer[XFER_BBB_RESET1]);
+	if (umass_setup_ctrl_transfer(sc, >sc_req, NULL, 0, 0,
+		sc->transfer_xfer[XFER_BBB_RESET1]))
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 }
 
 Static void
@@ -1104,8 +1112,10 @@ umass_bbb_transfer(struct umass_softc *s
 		   "sc->sc_wire == 0x%02x wrong for umass_bbb_transfer\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		cb(sc, priv, datalen, STATUS_WIRE_FAILED);
 		return;
+	}
 
 	/* Be a little generous. */
 	sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
@@ -1243,8 +1253,11 @@ umass_bbb_state(struct usbd_xfer *xfer, 
 		return;
 	}
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
 		return;
+	}
 
 	switch (sc->transfer_state) {
 
@@ -1561,8 +1574,10 @@ umass_cbi_reset(struct umass_softc *sc, 
 		   "sc->sc_wire == 0x%02x wrong for umass_cbi_reset\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 		return;
+	}
 
 	/*
 	 * Command Block Reset Protocol
@@ -1598,8 +1613,9 @@ umass_cbi_reset(struct umass_softc *sc, 
 	for (i = 2; i < SEND_DIAGNOSTIC_CMDLEN; i++)
 		sc->cbl[i] = 0xff;
 
-	umass_cbi_adsc(sc, sc->cbl, SEND_DIAGNOSTIC_CMDLEN, 0,
-		   sc->transfer_xfer[XFER_CBI_RESET1]);
+	if (umass_cbi_adsc(sc, sc->cbl, SEND_DIAGNOSTIC_CMDLEN, 0,
+		sc->transfer_xfer[XFER_CBI_RESET1]))
+		umass_transfer_done(sc, sc->transfer_datalen, status);
 	/* XXX if the command fails we should reset the port on the bub */
 }
 
@@ -1617,8 +1633,10 @@ umass_cbi_transfer(struct umass_softc *s
 		   "sc->sc_wire == 0x%02x wrong for umass_cbi_transfer\n",
 		   sc->sc_wire);
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		cb(sc, priv, datalen, STATUS_WIRE_FAILED);
 		return;
+	}
 
 	/* Be a little generous. */
 	sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
@@ -1683,8 +1701,11 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 		return;
 	}
 
-	if (sc->sc_dying)
+	if (sc->sc_dying) {
+		umass_transfer_done(sc, sc->transfer_datalen,
+		STATUS_WIRE_FAILED);
 		return;
+	}
 
 	/*
 	 * State handling for CBI transfers.
@@ -1882,6 +1903,10 @@ umass_cbi_state(struct usbd_xfer *xfer, 
 umass_transfer_done(sc,
 sc->transfer_datalen - sc->transfer_actlen,
 status);
+			} else {
+/* XXX What to do?  */
+umass_transfer_done(sc, sc->transfer_datalen,
+STATUS_WIRE_FAILED);
 			}
 		}
 		return;



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:01:37 UTC 2020

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

Log Message:
Fix mistakes in timeout/abort/completion changes in motg(4).

- Call usbd_xfer_schedule_timeout so we actually do time out.

- Don't call usbd_xfer_trycomplete until all the data have been
  transferred -- it commits to completion, not timeout.

- Use xfer->ux_status != USBD_IN_PROGRESS to test whether, after a
  partial write, an xfer has been interrupted or timed out and need
  not be continued.

- Remove wrong assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/motg.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/motg.c
diff -u src/sys/dev/usb/motg.c:1.30 src/sys/dev/usb/motg.c:1.31
--- src/sys/dev/usb/motg.c:1.30	Tue Feb 18 17:50:20 2020
+++ src/sys/dev/usb/motg.c	Wed Feb 19 16:01:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.30 2020/02/18 17:50:20 riastradh Exp $	*/
+/*	$NetBSD: motg.c,v 1.31 2020/02/19 16:01:37 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.30 2020/02/18 17:50:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.31 2020/02/19 16:01:37 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1350,6 +1350,7 @@ motg_device_ctrl_start1(struct motg_soft
 		err = USBD_NOT_STARTED;
 		goto end;
 	}
+	usbd_xfer_schedule_timeout(xfer);
 	xfer->ux_status = USBD_IN_PROGRESS;
 	KASSERT(otgpipe == MOTG_PIPE2MPIPE(xfer->ux_pipe));
 	KASSERT(otgpipe->hw_ep == ep);
@@ -1427,15 +1428,8 @@ motg_device_ctrl_intr_rx(struct motg_sof
 	MOTGHIST_FUNC(); MOTGHIST_CALLED();
 
 	KASSERT(mutex_owned(>sc_lock));
-
-	/*
-	 * Try to claim this xfer for completion.  If it has already
-	 * completed or aborted, drop it on the floor.
-	 */
-	if (!usbd_xfer_trycomplete(xfer))
-		return;
-
 	KASSERT(ep->phase == DATA_IN || ep->phase == STATUS_IN);
+
 	/* select endpoint 0 */
 	UWRITE1(sc, MUSB2_REG_EPINDEX, 0);
 
@@ -1528,7 +1522,12 @@ motg_device_ctrl_intr_rx(struct motg_sof
 complete:
 	ep->phase = IDLE;
 	ep->xfer = NULL;
-	if (xfer && xfer->ux_status == USBD_IN_PROGRESS) {
+	/*
+	 * Try to claim this xfer for completion.  If it has already
+	 * completed or aborted, drop it on the floor.
+	 */
+	if (xfer && usbd_xfer_trycomplete(xfer)) {
+		KASSERT(xfer->ux_status == USBD_IN_PROGRESS);
 		KASSERT(new_status != USBD_IN_PROGRESS);
 		xfer->ux_status = new_status;
 		usb_transfer_complete(xfer);
@@ -1550,13 +1549,6 @@ motg_device_ctrl_intr_tx(struct motg_sof
 
 	KASSERT(mutex_owned(>sc_lock));
 
-	/*
-	 * Try to claim this xfer for completion.  If it has already
-	 * completed or aborted, drop it on the floor.
-	 */
-	if (!usbd_xfer_trycomplete(xfer))
-		return;
-
 	if (ep->phase == DATA_IN || ep->phase == STATUS_IN) {
 		motg_device_ctrl_intr_rx(sc);
 		return;
@@ -1603,7 +1595,7 @@ motg_device_ctrl_intr_tx(struct motg_sof
 		/* data still not sent */
 		return;
 	}
-	if (xfer == NULL)
+	if (xfer == NULL || xfer->ux_status != USBD_IN_PROGRESS)
 		goto complete;
 	if (ep->phase == STATUS_OUT) {
 		/*
@@ -1675,7 +1667,12 @@ motg_device_ctrl_intr_tx(struct motg_sof
 complete:
 	ep->phase = IDLE;
 	ep->xfer = NULL;
-	if (xfer && xfer->ux_status == USBD_IN_PROGRESS) {
+	/*
+	 * Try to claim this xfer for completion.  If it has already
+	 * completed or aborted, drop it on the floor.
+	 */
+	if (xfer && usbd_xfer_trycomplete(xfer)) {
+		KASSERT(xfer->ux_status == USBD_IN_PROGRESS);
 		KASSERT(new_status != USBD_IN_PROGRESS);
 		xfer->ux_status = new_status;
 		usb_transfer_complete(xfer);
@@ -1810,6 +1807,7 @@ motg_device_data_start1(struct motg_soft
 		err = USBD_NOT_STARTED;
 		goto end;
 	}
+	usbd_xfer_schedule_timeout(xfer);
 	xfer->ux_status = USBD_IN_PROGRESS;
 	KASSERT(otgpipe == MOTG_PIPE2MPIPE(xfer->ux_pipe));
 	KASSERT(otgpipe->hw_ep == ep);
@@ -2055,7 +2053,12 @@ complete:
 	(xfer != NULL) ? xfer->ux_status : 0, 0, 0);
 	ep->phase = IDLE;
 	ep->xfer = NULL;
-	if (xfer && xfer->ux_status == USBD_IN_PROGRESS) {
+	/*
+	 * Try to claim this xfer for completion.  If it has already
+	 * completed or aborted, drop it on the floor.
+	 */
+	if (xfer && usbd_xfer_trycomplete(xfer)) {
+		KASSERT(xfer->ux_status == USBD_IN_PROGRESS);
 		KASSERT(new_status != USBD_IN_PROGRESS);
 		xfer->ux_status = new_status;
 		usb_transfer_complete(xfer);
@@ -2075,14 +2078,6 @@ motg_device_intr_tx(struct motg_softc *s
 	MOTGHIST_FUNC(); MOTGHIST_CALLED();
 
 	KASSERT(mutex_owned(>sc_lock));
-
-	/*
-	 * Try to claim this xfer for completion.  If it has already
-	 * completed or aborted, drop it on the floor.
-	 */
-	if (!usbd_xfer_trycomplete(xfer))
-		return;
-
 	KASSERT(ep->ep_number == epnumber);
 
 	DPRINTFN(MD_BULK, " on ep %jd", epnumber, 0, 0, 0);
@@ -2144,12 +2139,14 @@ 

CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:01:37 UTC 2020

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

Log Message:
Fix mistakes in timeout/abort/completion changes in motg(4).

- Call usbd_xfer_schedule_timeout so we actually do time out.

- Don't call usbd_xfer_trycomplete until all the data have been
  transferred -- it commits to completion, not timeout.

- Use xfer->ux_status != USBD_IN_PROGRESS to test whether, after a
  partial write, an xfer has been interrupted or timed out and need
  not be continued.

- Remove wrong assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/motg.c

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



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:00:28 UTC 2020

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

Log Message:
Abort default pipe too on detach before detaching children.

This ensures that pending xfers on the default pipe will be aborted
before we wait for children, which, in the case of scsibus -> sd,
means waiting for pending xfers to complete -- xfers that may never
complete if something is wedged.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/umass.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/umass.c
diff -u src/sys/dev/usb/umass.c:1.176 src/sys/dev/usb/umass.c:1.177
--- src/sys/dev/usb/umass.c:1.176	Fri Dec  6 07:12:39 2019
+++ src/sys/dev/usb/umass.c	Wed Feb 19 16:00:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.176 2019/12/06 07:12:39 maxv Exp $	*/
+/*	$NetBSD: umass.c,v 1.177 2020/02/19 16:00:28 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.176 2019/12/06 07:12:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.177 2020/02/19 16:00:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -809,6 +809,7 @@ umass_detach(device_t self, int flags)
 		if (sc->sc_pipe[i] != NULL)
 			usbd_abort_pipe(sc->sc_pipe[i]);
 	}
+	usbd_abort_default_pipe(sc->sc_udev);
 
 	/* Do we really need reference counting?  Perhaps in ioctl() */
 	mutex_enter(>sc_lock);



CVS commit: src/sys/dev/usb

2020-02-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Feb 19 16:00:28 UTC 2020

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

Log Message:
Abort default pipe too on detach before detaching children.

This ensures that pending xfers on the default pipe will be aborted
before we wait for children, which, in the case of scsibus -> sd,
means waiting for pending xfers to complete -- xfers that may never
complete if something is wedged.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/umass.c

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



Re: CVS commit: src/doc

2020-02-19 Thread Kamil Rytarowski
On 18.02.2020 22:14, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Tue Feb 18 21:14:16 UTC 2020
> 
> Modified Files:
>   src/doc: 3RDPARTY CHANGES
> 
> Log Message:
> new awk
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1690 -r1.1691 src/doc/3RDPARTY
> cvs rdiff -u -r1.2649 -r1.2650 src/doc/CHANGES
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

This upgrade broke MKLLVM HAVE_LLVM build (at least for -m sparc64).



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Kamil Rytarowski
On 19.02.2020 14:32, Joerg Sonnenberger wrote:
> Module Name:  src
> Committed By: joerg
> Date: Wed Feb 19 13:32:40 UTC 2020
> 
> Modified Files:
>   src/external/apache2/llvm/config/llvm/Config: config.h.in
> 
> Log Message:
> Revert last. It was objected to pre-commit, there is no actual error
> analysis or report and there is existing logic supposed to handle this.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.2 -r1.3 \
> src/external/apache2/llvm/config/llvm/Config/config.h.in
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

Objected pre-commit? Nothing reached me and I see nothing in logs.

No report? It was discussed in public syzkaller ML and semipublic IRC
channel with 5 people involved.

https://syzkaller.appspot.com/text?tag=CrashLog=11aafc09e0

No analysis? There is analysis in the commit message that we remove
optional features.

I request either to reintroduce it now or land another fix.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Feb 19 13:32:40 UTC 2020

Modified Files:
src/external/apache2/llvm/config/llvm/Config: config.h.in

Log Message:
Revert last. It was objected to pre-commit, there is no actual error
analysis or report and there is existing logic supposed to handle this.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/llvm/config/llvm/Config/config.h.in

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



CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Feb 19 13:32:40 UTC 2020

Modified Files:
src/external/apache2/llvm/config/llvm/Config: config.h.in

Log Message:
Revert last. It was objected to pre-commit, there is no actual error
analysis or report and there is existing logic supposed to handle this.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/llvm/config/llvm/Config/config.h.in

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

Modified files:

Index: src/external/apache2/llvm/config/llvm/Config/config.h.in
diff -u src/external/apache2/llvm/config/llvm/Config/config.h.in:1.2 src/external/apache2/llvm/config/llvm/Config/config.h.in:1.3
--- src/external/apache2/llvm/config/llvm/Config/config.h.in:1.2	Wed Feb 19 09:59:39 2020
+++ src/external/apache2/llvm/config/llvm/Config/config.h.in	Wed Feb 19 13:32:40 2020
@@ -312,15 +312,11 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_UIO_H 1
 
-#if !HAVE_NBTOOL_CONFIG_H
 /* Define if the setupterm() function is supported this platform. */
 #define HAVE_TERMINFO 1
-#endif
 
-#if !HAVE_NBTOOL_CONFIG_H
 /* Define to 1 if you have the  header file. */
 #define HAVE_TERMIOS_H 1
-#endif
 
 /* Define to 1 if the system has the type `uint64_t'. */
 #define HAVE_UINT64_T 1



Re: CVS commit: src/lib/libpthread

2020-02-19 Thread Ryo ONODERA
Hi,

Kamil Rytarowski  writes:

> On 13.02.2020 20:03, Ryo ONODERA wrote:
>> Hi,
>> 
>> Kamil Rytarowski  writes:
>> 
>>> On 12.02.2020 15:01, Ryo ONODERA wrote:
 Hi,

 Kamil Rytarowski  writes:

> Hello,
>
> I will have a look at them.

 Thank you.
 Real fix is welcome.

 And multimedia/handbrake has workaround already.
 I have workaround patches for lang/mono6 (like your nspr patch).
 I will commit them after some tests.

>>>
>>> libblueray real fix patch is pending upstream.
>>>
>>> https://code.videolan.org/videolan/libbluray/merge_requests/17
>> 
>> Thank you very much!
>> I will apply this to multimedia/handbrake too.
>> 
>
> HandBrake is now patched upstream:
>
> https://github.com/HandBrake/HandBrake/commit/73e958d198aba4cab8f434be6cf0661da1a2f91b
>
>>> I will look into mono next.
>> 
>> Excellent.
>> 
> What is the reproducer for mono?
>

Remove the folowing patches:
lang/mono6/patches/patch-external_corert_src_Native_gc_env_gcenv.structs.h
lang/mono6/patches/patch-mono_metadata_w32mutex-unix.
lang/mono6/patches/patch-libgc_pthread__stop__world.c
lang/mono6/patches/patch-libgc_pthread__support.c
lang/mono6/patches/patch-mono_utils_mono-threads-posix.c

And run "make" in your pkgsrc/lang/mono6 directory.
During build, you will get SIGSEGVs.

Thank you.

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Re: CVS commit: src/lib/libpthread

2020-02-19 Thread Kamil Rytarowski
On 13.02.2020 20:03, Ryo ONODERA wrote:
> Hi,
> 
> Kamil Rytarowski  writes:
> 
>> On 12.02.2020 15:01, Ryo ONODERA wrote:
>>> Hi,
>>>
>>> Kamil Rytarowski  writes:
>>>
 Hello,

 I will have a look at them.
>>>
>>> Thank you.
>>> Real fix is welcome.
>>>
>>> And multimedia/handbrake has workaround already.
>>> I have workaround patches for lang/mono6 (like your nspr patch).
>>> I will commit them after some tests.
>>>
>>
>> libblueray real fix patch is pending upstream.
>>
>> https://code.videolan.org/videolan/libbluray/merge_requests/17
> 
> Thank you very much!
> I will apply this to multimedia/handbrake too.
> 

HandBrake is now patched upstream:

https://github.com/HandBrake/HandBrake/commit/73e958d198aba4cab8f434be6cf0661da1a2f91b

>> I will look into mono next.
> 
> Excellent.
> 
What is the reproducer for mono?



signature.asc
Description: OpenPGP digital signature


CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 19 09:59:39 UTC 2020

Modified Files:
src/external/apache2/llvm/config/llvm/Config: config.h.in

Log Message:
Disable HAVE_TERMINFO and HAVE_TERMIOS_H for ./build.sh tools build

These headers enable optional features and are not portable to all host
Operating Systems.

Speculative fix for certain Linux distributions.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/llvm/config/llvm/Config/config.h.in

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

Modified files:

Index: src/external/apache2/llvm/config/llvm/Config/config.h.in
diff -u src/external/apache2/llvm/config/llvm/Config/config.h.in:1.1 src/external/apache2/llvm/config/llvm/Config/config.h.in:1.2
--- src/external/apache2/llvm/config/llvm/Config/config.h.in:1.1	Mon Nov 11 22:45:02 2019
+++ src/external/apache2/llvm/config/llvm/Config/config.h.in	Wed Feb 19 09:59:39 2020
@@ -312,11 +312,15 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_UIO_H 1
 
+#if !HAVE_NBTOOL_CONFIG_H
 /* Define if the setupterm() function is supported this platform. */
 #define HAVE_TERMINFO 1
+#endif
 
+#if !HAVE_NBTOOL_CONFIG_H
 /* Define to 1 if you have the  header file. */
 #define HAVE_TERMIOS_H 1
+#endif
 
 /* Define to 1 if the system has the type `uint64_t'. */
 #define HAVE_UINT64_T 1



CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 19 09:59:39 UTC 2020

Modified Files:
src/external/apache2/llvm/config/llvm/Config: config.h.in

Log Message:
Disable HAVE_TERMINFO and HAVE_TERMIOS_H for ./build.sh tools build

These headers enable optional features and are not portable to all host
Operating Systems.

Speculative fix for certain Linux distributions.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/llvm/config/llvm/Config/config.h.in

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



CVS commit: src/sys/dev/pci

2020-02-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb 19 09:00:34 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add a couple of GPUs i have:

product ATI RADEON_HD4290  0x9714  Radeon HD4290 Graphics
product NVIDIA GF_440  0x0de0  GeForce GT 440


To generate a diff of this commit:
cvs rdiff -u -r1.1397 -r1.1398 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1397 src/sys/dev/pci/pcidevs:1.1398
--- src/sys/dev/pci/pcidevs:1.1397	Tue Jan 28 02:27:46 2020
+++ src/sys/dev/pci/pcidevs	Wed Feb 19 09:00:34 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1397 2020/01/28 02:27:46 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1398 2020/02/19 09:00:34 mrg Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1775,6 +1775,7 @@ product ATI RADEON_HD6480G_1	0x9648	Rade
 product ATI RADEON_HD6480G_2	0x9649	Radeon HD 6480G
 product ATI RADEON_HD6530D	0x964a	Radeon HD 6530D
 product ATI RADEON_HD4200	0x9712	Radeon HD4200 Mobility
+product ATI RADEON_HD4290	0x9714	Radeon HD4290 Graphics
 product ATI RADEON_HD4250	0x9715	Radeon HD4250 GPU (RS880)
 product ATI RADEON_HD6310	0x9802	Radeon HD6310 Graphics
 product ATI RADEON_HD6320	0x9806	Radeon HD6320 Graphics
@@ -6664,6 +6665,7 @@ product NVIDIA	GEFORCE_210_HDA	0x0be3	Ge
 product NVIDIA	GF100_HDA	0x0be5	GF100 HD Audio
 product NVIDIA	GF108_HDA	0x0bea	GF108 HD Audio
 product NVIDIA	GF116_HDA	0x0bee	GF116 HD Audio
+product NVIDIA	GF_440		0x0de0	GeForce GT 440
 product NVIDIA	GF_GT640M	0x0fd2	GeForce GT 640M
 product NVIDIA	GT520		0x1040	GeForce GT 520
 product NVIDIA	GEFORCE_510	0x1042	GeForce 510



CVS commit: src/sys/dev/pci

2020-02-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb 19 09:00:44 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1385 -r1.1386 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1384 -r1.1385 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2020-02-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb 19 09:00:34 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add a couple of GPUs i have:

product ATI RADEON_HD4290  0x9714  Radeon HD4290 Graphics
product NVIDIA GF_440  0x0de0  GeForce GT 440


To generate a diff of this commit:
cvs rdiff -u -r1.1397 -r1.1398 src/sys/dev/pci/pcidevs

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