CVS commit: src/distrib/i386/installimage

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 05:29:00 UTC 2019

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
Bump for recent Mesa update.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/i386/installimage/Makefile

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



CVS commit: src/distrib/i386/installimage

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 05:29:00 UTC 2019

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
Bump for recent Mesa update.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/i386/installimage/Makefile

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

Modified files:

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.13 src/distrib/i386/installimage/Makefile:1.14
--- src/distrib/i386/installimage/Makefile:1.13	Sat Dec 15 18:03:17 2018
+++ src/distrib/i386/installimage/Makefile	Sun Apr  7 05:29:00 2019
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.13 2018/12/15 18:03:17 gson Exp $
+#	$NetBSD: Makefile,v 1.14 2019/04/07 05:29:00 rin Exp $
 
 .include 
 
 INSTIMGBASE=	NetBSD-${DISTRIBVER}-i386-install	# gives ${IMGBASE}.img
 
-INSTIMAGEMB?=	1450			# for all installation binaries
+INSTIMAGEMB?=	1600			# for all installation binaries
 
 PRIMARY_BOOT=		bootxx_ffsv1
 SECONDARY_BOOT=		boot



CVS commit: src/external/mit/xorg/lib/gallium

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 05:28:09 UTC 2019

Modified Files:
src/external/mit/xorg/lib/gallium: Makefile

Log Message:
Handle objdir correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/mit/xorg/lib/gallium/Makefile

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



CVS commit: src/external/mit/xorg/lib/gallium

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 05:28:09 UTC 2019

Modified Files:
src/external/mit/xorg/lib/gallium: Makefile

Log Message:
Handle objdir correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/mit/xorg/lib/gallium/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.20 src/external/mit/xorg/lib/gallium/Makefile:1.21
--- src/external/mit/xorg/lib/gallium/Makefile:1.20	Wed Apr  3 15:26:34 2019
+++ src/external/mit/xorg/lib/gallium/Makefile	Sun Apr  7 05:28:09 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2019/04/03 15:26:34 joerg Exp $
+# $NetBSD: Makefile,v 1.21 2019/04/07 05:28:09 rin Exp $
 
 # Link the gallium mega driver.
 
@@ -1021,8 +1021,10 @@ LLVM_LIBS+=	\
 		Support
 
 .for llvm_library in ${LLVM_LIBS}
-DPADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
-LDADD+=	${LLVM_LIB_DIR}/libLLVM${llvm_library}/libLLVM${llvm_library}_pic.a
+dir!=	cd ${LLVM_LIB_DIR}/libLLVM${llvm_library}; ${PRINTOBJDIR}
+lib=	${dir}/libLLVM${llvm_library}_pic.a
+DPADD+=	${lib}
+LDADD+=	${lib}
 .endfor
 
 .endif  # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1



CVS commit: src/sys/arch/powerpc

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 05:25:56 UTC 2019

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c copyin.c copyout.c
src/sys/arch/powerpc/ibm4xx: trap.c
src/sys/arch/powerpc/include: types.h
src/sys/arch/powerpc/include/booke: cpuvar.h
src/sys/arch/powerpc/powerpc: trap.c

Log Message:
Detangle some of the PowerPC CPU configuration spaghetti.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/copyin.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/copyout.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/booke/cpuvar.h
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/powerpc/powerpc/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/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.25 src/sys/arch/powerpc/booke/booke_machdep.c:1.26
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.25	Tue Dec  6 07:34:22 2016
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Sun Apr  7 05:25:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.25 2016/12/06 07:34:22 rin Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.26 2019/04/07 05:25:55 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.25 2016/12/06 07:34:22 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.26 2019/04/07 05:25:55 thorpej Exp $");
 
 #include "opt_modular.h"
 
@@ -566,8 +566,12 @@ cpu_write_1(bus_addr_t a, uint8_t v)
 void
 booke_sstep(struct trapframe *tf)
 {
+	uint32_t insn;
+
 	KASSERT(tf->tf_srr1 & PSL_DE);
-	const uint32_t insn = ufetch_32((const void *)tf->tf_srr0);
+	if (ufetch_32((const void *)tf->tf_srr0, ) != 0)
+		return;
+
 	register_t dbcr0 = DBCR0_IAC1 | DBCR0_IDM;
 	register_t dbcr1 = DBCR1_IAC1US_USER | DBCR1_IAC1ER_DS1;
 	if ((insn >> 28) == 4) {

Index: src/sys/arch/powerpc/booke/copyin.c
diff -u src/sys/arch/powerpc/booke/copyin.c:1.6 src/sys/arch/powerpc/booke/copyin.c:1.7
--- src/sys/arch/powerpc/booke/copyin.c:1.6	Thu Jul 24 23:27:25 2014
+++ src/sys/arch/powerpc/booke/copyin.c	Sun Apr  7 05:25:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyin.c,v 1.6 2014/07/24 23:27:25 joerg Exp $	*/
+/*	$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,10 +36,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.6 2014/07/24 23:27:25 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $");
+
+#define	__UFETCHSTORE_PRIVATE
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -60,7 +63,6 @@ copyin_byte(const uint8_t * const usaddr
 	return data;
 }
 
-#if 0
 static inline uint16_t
 copyin_halfword(const uint16_t * const usaddr16, register_t ds_msr)
 {
@@ -75,7 +77,6 @@ copyin_halfword(const uint16_t * const u
 	: [ds_msr] "r" (ds_msr), [usaddr16] "b" (usaddr16));
 	return data;
 }
-#endif
 
 static inline uint32_t
 copyin_word(const uint32_t * const usaddr32, register_t ds_msr)
@@ -199,22 +200,58 @@ copyin_words(vaddr_t usaddr, vaddr_t kda
 	}
 }
 
-uint32_t
-ufetch_32(const void *vusaddr)
+int
+_ufetch_8(const uint8_t *vusaddr, uint8_t *valp)
+{
+	struct pcb * const pcb = lwp_getpcb(curlwp);
+	struct faultbuf env;
+
+	if (setfault() != 0) {
+		pcb->pcb_onfault = NULL;
+		return EFAULT;
+	}
+
+	*valp = copyin_byte(vusaddr, mfmsr() | PSL_DS);
+
+	pcb->pcb_onfault = NULL;
+
+	return 0;
+}
+
+int
+_ufetch_16(const uint16_t *vusaddr, uint16_t *valp)
 {
 	struct pcb * const pcb = lwp_getpcb(curlwp);
 	struct faultbuf env;
 
 	if (setfault() != 0) {
 		pcb->pcb_onfault = NULL;
-		return -1;
+		return EFAULT;
 	}
 
-	uint32_t rv = copyin_word(vusaddr, mfmsr() | PSL_DS);
+	*valp = copyin_halfword(vusaddr, mfmsr() | PSL_DS);
 
 	pcb->pcb_onfault = NULL;
 
-	return rv;
+	return 0;
+}
+
+int
+_ufetch_32(const uint32_t *vusaddr, uint32_t *valp)
+{
+	struct pcb * const pcb = lwp_getpcb(curlwp);
+	struct faultbuf env;
+
+	if (setfault() != 0) {
+		pcb->pcb_onfault = NULL;
+		return EFAULT;
+	}
+
+	*valp = copyin_word(vusaddr, mfmsr() | PSL_DS);
+
+	pcb->pcb_onfault = NULL;
+
+	return 0;
 }
 
 int

Index: src/sys/arch/powerpc/booke/copyout.c
diff -u src/sys/arch/powerpc/booke/copyout.c:1.4 src/sys/arch/powerpc/booke/copyout.c:1.5
--- src/sys/arch/powerpc/booke/copyout.c:1.4	Thu Jul 24 23:29:02 2014
+++ src/sys/arch/powerpc/booke/copyout.c	Sun Apr  7 05:25:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyout.c,v 1.4 2014/07/24 23:29:02 joerg Exp $	*/
+/*	$NetBSD: copyout.c,v 1.5 2019/04/07 05:25:55 thorpej Exp 

CVS commit: src/sys/arch/powerpc

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 05:25:56 UTC 2019

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c copyin.c copyout.c
src/sys/arch/powerpc/ibm4xx: trap.c
src/sys/arch/powerpc/include: types.h
src/sys/arch/powerpc/include/booke: cpuvar.h
src/sys/arch/powerpc/powerpc: trap.c

Log Message:
Detangle some of the PowerPC CPU configuration spaghetti.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/copyin.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/copyout.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/booke/cpuvar.h
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/powerpc/powerpc/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/arm/arm

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 04:11:56 UTC 2019

Modified Files:
src/sys/arch/arm/arm: fusu.S

Log Message:
Fix ARM_ARCH_* brain fart.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/arm/fusu.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/arm/arm/fusu.S
diff -u src/sys/arch/arm/arm/fusu.S:1.5 src/sys/arch/arm/arm/fusu.S:1.6
--- src/sys/arch/arm/arm/fusu.S:1.5	Sat Apr  6 03:06:24 2019
+++ src/sys/arch/arm/arm/fusu.S	Sun Apr  7 04:11:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fusu.S,v 1.5 2019/04/06 03:06:24 thorpej Exp $	*/
+/*	$NetBSD: fusu.S,v 1.6 2019/04/07 04:11:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@ ENTRY(_ufetch_8)
 	RETURN_SUCCESS
 END(_ufetch_8)
 
-#if (ARM_ARCH_2 + ARM_ARCH_3) > 0
+#if (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0
 /* LINTSTUB: int _ufetch_16_armv2(const uint16_t *uaddr, uint16_t *valp); */
 ENTRY(_ufetch_16_armv2)
 	UFETCHSTORE_PROLOGUE
@@ -114,10 +114,13 @@ ENTRY(_ufetch_16_armv2)
 	RETURN_SUCCESS
 END(_ufetch_16_armv2)
 
+/* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
+STRONG_ALIAS(_ufetch_16,_ufetch_16_armv2)
+
 #else /* XXX */
 
-/* LINTSTUB: int _ufetch_16_armv4(const uint16_t *uaddr, uint16_t *valp); */
-ENTRY(_ufetch_16_armv4)
+/* LINTSTUB: int _ufetch_16_armv6(const uint16_t *uaddr, uint16_t *valp); */
+ENTRY(_ufetch_16_armv6)
 	UFETCHSTORE_PROLOGUE
 
 	ldrht	r3, [r0]
@@ -125,15 +128,11 @@ ENTRY(_ufetch_16_armv4)
 
 	UFETCHSTORE_EPILOGUE
 	RETURN_SUCCESS
-END(_ufetch_16_armv4)
-#endif /* (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 + ARM_ARCH_7) > 0 */
+END(_ufetch_16_armv6)
 
 /* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
-#if (ARM_ARCH_2 + ARM_ARCH_3) > 0
-STRONG_ALIAS(_ufetch_16,_ufetch_16_armv2)
-#else
-STRONG_ALIAS(_ufetch_16,_ufetch_16_armv4)
-#endif /* #if (ARM_ARCH_2 + ARM_ARCH_3) > 0 */
+STRONG_ALIAS(_ufetch_16,_ufetch_16_armv6)
+#endif /* (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0 */
 
 /* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
 ENTRY(_ufetch_32)
@@ -156,7 +155,7 @@ ENTRY(_ustore_8)
 	RETURN_SUCCESS
 END(_ustore_8)
 
-#if (ARM_ARCH_2 + ARM_ARCH_3) > 0
+#if (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0
 /* LINTSTUB: int _ustore_16_armv2(uint16_t *uaddr, uint16_t val); */
 ENTRY(_ustore_16_armv2)
 	UFETCHSTORE_PROLOGUE
@@ -174,26 +173,24 @@ ENTRY(_ustore_16_armv2)
 	RETURN_SUCCESS
 END(_ustore_16_armv2)
 
+/* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
+STRONG_ALIAS(_ustore_16,_ustore_16_armv2)
+
 #else /* XXX */
 
 /* LINTSTUB: int _ustore_16_armv4(uint16_t *uaddr, uint16_t val); */
-ENTRY(_ustore_16_armv4)
+ENTRY(_ustore_16_armv6)
 	UFETCHSTORE_PROLOGUE
 
 	strht	r1, [r0]
 
 	UFETCHSTORE_EPILOGUE
 	RETURN_SUCCESS
-END(_ustore_16_armv4)
-#endif /* (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 + ARM_ARCH_7) > 0 */
+END(_ustore_16_armv6)
 
 /* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
-/* XXXJRT Run-time upgrade to armv4 version would be nice. */
-#if (ARM_ARCH_2 + ARM_ARCH_3) > 0
-STRONG_ALIAS(_ustore_16,_ustore_16_armv2)
-#else
-STRONG_ALIAS(_ustore_16,_ustore_16_armv4)
-#endif /* #if (ARM_ARCH_2 + ARM_ARCH_3) > 0 */
+STRONG_ALIAS(_ustore_16,_ustore_16_armv6)
+#endif /* (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0 */
 
 /* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */
 ENTRY(_ustore_32)



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

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 04:11:56 UTC 2019

Modified Files:
src/sys/arch/arm/arm: fusu.S

Log Message:
Fix ARM_ARCH_* brain fart.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/arm/fusu.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/arc/arc

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:53:53 UTC 2019

Modified Files:
src/sys/arch/arc/arc: locore_machdep.S

Log Message:
Remove dead codes, that are #if 0'd for more than 19 years!


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arc/arc/locore_machdep.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/arc/arc

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:53:53 UTC 2019

Modified Files:
src/sys/arch/arc/arc: locore_machdep.S

Log Message:
Remove dead codes, that are #if 0'd for more than 19 years!


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arc/arc/locore_machdep.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/arc/arc/locore_machdep.S
diff -u src/sys/arch/arc/arc/locore_machdep.S:1.16 src/sys/arch/arc/arc/locore_machdep.S:1.17
--- src/sys/arch/arc/arc/locore_machdep.S:1.16	Fri Nov 27 03:23:04 2009
+++ src/sys/arch/arc/arc/locore_machdep.S	Sun Apr  7 03:53:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_machdep.S,v 1.16 2009/11/27 03:23:04 rmind Exp $	*/
+/*	$NetBSD: locore_machdep.S,v 1.17 2019/04/07 03:53:53 rin Exp $	*/
 /*	$OpenBSD: locore.S,v 1.12 1997/04/19 17:19:43 pefo Exp $	*/
 
 /*
@@ -195,140 +195,3 @@ LEAF(fillw)
 	jr	ra
 	nop
 END(fillw)
-
-/*#ifdef DEBUG*/ /* for minidebug.c: fix trap() to use this */
-#if 0
-/*
- * Read a long and return it.
- * Note: addresses can be unaligned!
- *
- * long
-L* mdbpeek(addr)
-L*	caddt_t addr;
-L* {
-L*	return (*(long *)addr);
-L* }
- */
-LEAF(mdbpeek)
-	li	v0, MDBERR
-	sw	v0, UADDR+PCB_ONFAULT
-	and	v0, a0, 3		# unaligned address?
-	bne	v0, zero, 1f
-	nop
-	b	2f
-	lw	v0, (a0)		# aligned access
-1:
-	LWHI	v0, 0(a0)		# get next 4 bytes (unaligned)
-	LWLO	v0, 3(a0)
-2:
-	j	ra			# made it w/o errors
-	sw	zero, UADDR+PCB_ONFAULT
-mdberr:
-	li	v0, 1			# trap sends us here
-	sw	v0, mdbmkfault
-	j	ra
-	nop
-END(mdbpeek)
-
-/*
- * Write a long to 'addr'.
- * Note: addresses can be unaligned!
- *
-L* void
-L* mdbpoke(addr, value)
-L*	caddt_t addr;
-L*	long value;
-L* {
-L*	*(long *)addr = value;
-L* }
- */
-LEAF(mdbpoke)
-	li	v0, MDBERR
-	sw	v0, UADDR+PCB_ONFAULT
-	and	v0, a0, 3		# unaligned address?
-	bne	v0, zero, 1f
-	nop
-	b	2f
-	sw	a1, (a0)		# aligned access
-1:
-	SWHI	a1, 0(a0)		# store next 4 bytes (unaligned)
-	SWLO	a1, 3(a0)
-	and	a0, a0, ~3		# align address for cache flush
-2:
-	sw	zero, UADDR+PCB_ONFAULT
-	b	R4K_FlushICache		# flush instruction cache
-	li	a1, 8
-END(mdbpoke)
-
-/*
- * Save registers and state so we can do a 'mdbreset' (like longjmp) later.
- * Always returns zero.
- *
-L* int mdb_savearea[11];
-L*
-L* int
-L* mdbsetexit()
-L* {
-L*	mdb_savearea[0] = 0;
-L*	return (0);
-L* }
- */
-	.comm	mdb_savearea, (11 * 4)
-
-LEAF(mdbsetexit)
-	la	a0, mdb_savearea
-	sw	s0, 0(a0)
-	sw	s1, 4(a0)
-	sw	s2, 8(a0)
-	sw	s3, 12(a0)
-	sw	s4, 16(a0)
-	sw	s5, 20(a0)
-	sw	s6, 24(a0)
-	sw	s7, 28(a0)
-	sw	sp, 32(a0)
-	sw	s8, 36(a0)
-	sw	ra, 40(a0)
-	j	ra
-	move	v0, zero
-END(mdbsetexit)
-
-/*
- * Restore registers and state (like longjmp) and return x.
- *
-L* int
-L* mdbreset(x)
-L* {
-L*	return (x);
-L* }
- */
-LEAF(mdbreset)
-	la	v0, mdb_savearea
-	lw	ra, 40(v0)
-	lw	s0, 0(v0)
-	lw	s1, 4(v0)
-	lw	s2, 8(v0)
-	lw	s3, 12(v0)
-	lw	s4, 16(v0)
-	lw	s5, 20(v0)
-	lw	s6, 24(v0)
-	lw	s7, 28(v0)
-	lw	sp, 32(v0)
-	lw	s8, 36(v0)
-	j	ra
-	move	v0, a0
-END(mdbreset)
-
-/*
- * Trap into the debugger.
- *
-L* void
-L* mdbpanic()
-L* {
-L* }
- */
-LEAF(mdbpanic)
-	break	BREAK_SOVER_VAL
-	j	ra
-	nop
-END(mdbpanic)
-#endif /* DEBUG */



CVS commit: src/sys/arch/arc

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:49:24 UTC 2019

Modified Files:
src/sys/arch/arc: TODO

Log Message:
UADDR was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arc/TODO

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/arc/TODO
diff -u src/sys/arch/arc/TODO:1.30 src/sys/arch/arc/TODO:1.31
--- src/sys/arch/arc/TODO:1.30	Fri Jun 20 12:31:55 2014
+++ src/sys/arch/arc/TODO	Sun Apr  7 03:49:24 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO,v 1.30 2014/06/20 12:31:55 joerg Exp $
+$NetBSD: TODO,v 1.31 2019/04/07 03:49:24 rin Exp $
 
 To do list (in some particular order)
 XXX some entries might be obsolete.
@@ -59,8 +59,6 @@ XXX some entries might be obsolete.
 
 o	remove inb/outb
 
-o	remove UADDR
-
 o	fix mem_clusters[] usage.
 
 o	redesign interrupt handler framework.



CVS commit: src/sys/arch/arc

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:49:24 UTC 2019

Modified Files:
src/sys/arch/arc: TODO

Log Message:
UADDR was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arc/TODO

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



CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:43:55 UTC 2019

Modified Files:
src/tests/modules/ufetchstore: t_ufetchstore.c

Log Message:
Revert previous. arc port was fixed correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/modules/ufetchstore/t_ufetchstore.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/modules/ufetchstore/t_ufetchstore.c
diff -u src/tests/modules/ufetchstore/t_ufetchstore.c:1.2 src/tests/modules/ufetchstore/t_ufetchstore.c:1.3
--- src/tests/modules/ufetchstore/t_ufetchstore.c:1.2	Sun Apr  7 03:35:25 2019
+++ src/tests/modules/ufetchstore/t_ufetchstore.c	Sun Apr  7 03:43:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ufetchstore.c,v 1.2 2019/04/07 03:35:25 rin Exp $	*/
+/*	$NetBSD: t_ufetchstore.c,v 1.3 2019/04/07 03:43:55 rin Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2019\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ufetchstore.c,v 1.2 2019/04/07 03:35:25 rin Exp $");
+__RCSID("$NetBSD: t_ufetchstore.c,v 1.3 2019/04/07 03:43:55 rin Exp $");
 
 #include 
 #include 
@@ -85,7 +85,7 @@ load_module(void)
 #endif /* ! SKIP_MODULE */
 }
 
-#define	UADDR64(x)	((uintptr_t)(x))
+#define	UADDR(x)	((uintptr_t)(x))
 
 static void
 unload_module(void)
@@ -144,7 +144,7 @@ static int
 do_ufetch_8(const uint8_t *uaddr, uint8_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_LOAD,
 		.size = 8,
 	};
@@ -158,7 +158,7 @@ static int
 do_ufetch_16(const uint16_t *uaddr, uint16_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_LOAD,
 		.size = 16,
 	};
@@ -172,7 +172,7 @@ static int
 do_ufetch_32(const uint32_t *uaddr, uint32_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_LOAD,
 		.size = 32,
 	};
@@ -187,7 +187,7 @@ static int
 do_ufetch_64(const uint64_t *uaddr, uint64_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_LOAD,
 		.size = 64,
 	};
@@ -202,7 +202,7 @@ static int
 do_ustore_8(uint8_t *uaddr, uint8_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_STORE,
 		.size = 8,
 		.val8 = val,
@@ -216,7 +216,7 @@ static int
 do_ustore_16(uint16_t *uaddr, uint16_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_STORE,
 		.size = 16,
 		.val16 = val,
@@ -230,7 +230,7 @@ static int
 do_ustore_32(uint32_t *uaddr, uint32_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_STORE,
 		.size = 32,
 		.val32 = val,
@@ -245,7 +245,7 @@ static int
 do_ustore_64(uint64_t *uaddr, uint64_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_STORE,
 		.size = 64,
 		.val64 = val,
@@ -260,7 +260,7 @@ static int
 do_ucas_32(uint32_t *uaddr, uint32_t expected, uint32_t new, uint32_t *actualp)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_CAS,
 		.size = 32,
 		.val32 = new,
@@ -277,7 +277,7 @@ static int
 do_ucas_64(uint64_t *uaddr, uint64_t expected, uint64_t new, uint64_t *actualp)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR64(uaddr),
+		.uaddr64 = UADDR(uaddr),
 		.test_op = OP_CAS,
 		.size = 64,
 		.val64 = new,



CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:43:55 UTC 2019

Modified Files:
src/tests/modules/ufetchstore: t_ufetchstore.c

Log Message:
Revert previous. arc port was fixed correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/modules/ufetchstore/t_ufetchstore.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/arc/include

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 03:42:31 UTC 2019

Modified Files:
src/sys/arch/arc/include: param.h

Log Message:
G/C some obsolete definitions (we haven't had a fixed u. for quite
some time).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arc/include/param.h

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

Modified files:

Index: src/sys/arch/arc/include/param.h
diff -u src/sys/arch/arc/include/param.h:1.32 src/sys/arch/arc/include/param.h:1.33
--- src/sys/arch/arc/include/param.h:1.32	Thu Feb  7 04:31:49 2019
+++ src/sys/arch/arc/include/param.h	Sun Apr  7 03:42:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.32 2019/02/07 04:31:49 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.33 2019/04/07 03:42:31 thorpej Exp $	*/
 /*  $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
 
 /*
@@ -59,15 +59,6 @@
 #define	KERNBASE	0x8000	/* start of kernel virtual */
 #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
 
-#if defined(_LOCORE) && defined(notyet)
-#define	UADDR		0xc000	/* address of u */
-#else
-#define	UADDR		0xc000	/* address of u */
-#endif
-#define USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
-#define	UVPN		(UADDR>>PGSHIFT)/* virtual page number of u */
-#define	KERNELSTACK	(UADDR+UPAGES*NBPG)	/* top of kernel stack */
-
 /* bytes to disk blocks */
 #define	btodb(x)	((x) >> DEV_BSHIFT)
 #define dbtob(x)	((x) << DEV_BSHIFT)



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

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Apr  7 03:42:31 UTC 2019

Modified Files:
src/sys/arch/arc/include: param.h

Log Message:
G/C some obsolete definitions (we haven't had a fixed u. for quite
some time).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arc/include/param.h

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



CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:35:25 UTC 2019

Modified Files:
src/tests/modules/ufetchstore: t_ufetchstore.c

Log Message:
Avoid redefining UADDR for arc.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/modules/ufetchstore/t_ufetchstore.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/modules/ufetchstore/t_ufetchstore.c
diff -u src/tests/modules/ufetchstore/t_ufetchstore.c:1.1 src/tests/modules/ufetchstore/t_ufetchstore.c:1.2
--- src/tests/modules/ufetchstore/t_ufetchstore.c:1.1	Sat Apr  6 03:06:29 2019
+++ src/tests/modules/ufetchstore/t_ufetchstore.c	Sun Apr  7 03:35:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ufetchstore.c,v 1.1 2019/04/06 03:06:29 thorpej Exp $	*/
+/*	$NetBSD: t_ufetchstore.c,v 1.2 2019/04/07 03:35:25 rin Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2019\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ufetchstore.c,v 1.1 2019/04/06 03:06:29 thorpej Exp $");
+__RCSID("$NetBSD: t_ufetchstore.c,v 1.2 2019/04/07 03:35:25 rin Exp $");
 
 #include 
 #include 
@@ -85,7 +85,7 @@ load_module(void)
 #endif /* ! SKIP_MODULE */
 }
 
-#define	UADDR(x)	((uintptr_t)(x))
+#define	UADDR64(x)	((uintptr_t)(x))
 
 static void
 unload_module(void)
@@ -144,7 +144,7 @@ static int
 do_ufetch_8(const uint8_t *uaddr, uint8_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_LOAD,
 		.size = 8,
 	};
@@ -158,7 +158,7 @@ static int
 do_ufetch_16(const uint16_t *uaddr, uint16_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_LOAD,
 		.size = 16,
 	};
@@ -172,7 +172,7 @@ static int
 do_ufetch_32(const uint32_t *uaddr, uint32_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_LOAD,
 		.size = 32,
 	};
@@ -187,7 +187,7 @@ static int
 do_ufetch_64(const uint64_t *uaddr, uint64_t *res)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_LOAD,
 		.size = 64,
 	};
@@ -202,7 +202,7 @@ static int
 do_ustore_8(uint8_t *uaddr, uint8_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_STORE,
 		.size = 8,
 		.val8 = val,
@@ -216,7 +216,7 @@ static int
 do_ustore_16(uint16_t *uaddr, uint16_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_STORE,
 		.size = 16,
 		.val16 = val,
@@ -230,7 +230,7 @@ static int
 do_ustore_32(uint32_t *uaddr, uint32_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_STORE,
 		.size = 32,
 		.val32 = val,
@@ -245,7 +245,7 @@ static int
 do_ustore_64(uint64_t *uaddr, uint64_t val)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_STORE,
 		.size = 64,
 		.val64 = val,
@@ -260,7 +260,7 @@ static int
 do_ucas_32(uint32_t *uaddr, uint32_t expected, uint32_t new, uint32_t *actualp)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_CAS,
 		.size = 32,
 		.val32 = new,
@@ -277,7 +277,7 @@ static int
 do_ucas_64(uint64_t *uaddr, uint64_t expected, uint64_t new, uint64_t *actualp)
 {
 	struct ufetchstore_test_args args = {
-		.uaddr64 = UADDR(uaddr),
+		.uaddr64 = UADDR64(uaddr),
 		.test_op = OP_CAS,
 		.size = 64,
 		.val64 = new,



CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 03:35:25 UTC 2019

Modified Files:
src/tests/modules/ufetchstore: t_ufetchstore.c

Log Message:
Avoid redefining UADDR for arc.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/modules/ufetchstore/t_ufetchstore.c

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



CVS commit: src/sys/kern

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 02:58:02 UTC 2019

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

Log Message:
Fix previous. We define _KERNEL for rump in opt_rumpkernel.h.

XXX This works because arch's with _RUMP_NATIVEABI=yes and therefore
XXX without _RUMPKERNEL (amd64 and i386) do not have their own
XXX setdisklabel(9). We may need another macro, e.g., _RUMP.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/subr_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/sys/kern/subr_disklabel.c
diff -u src/sys/kern/subr_disklabel.c:1.2 src/sys/kern/subr_disklabel.c:1.3
--- src/sys/kern/subr_disklabel.c:1.2	Fri Apr  5 01:10:32 2019
+++ src/sys/kern/subr_disklabel.c	Sun Apr  7 02:58:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disklabel.c,v 1.2 2019/04/05 01:10:32 christos Exp $	*/
+/*	$NetBSD: subr_disklabel.c,v 1.3 2019/04/07 02:58:02 rin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -32,13 +32,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disklabel.c,v 1.2 2019/04/05 01:10:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disklabel.c,v 1.3 2019/04/07 02:58:02 rin Exp $");
 
 #include 
 #include 
 #include 
 
-#if !defined(__HAVE_SETDISKLABEL) || !defined(_KERNEL)
+#if !defined(__HAVE_SETDISKLABEL) || defined(_RUMPKERNEL)
 
 #ifdef DEBUG
 #define DPRINTF(a, ...) printf(a, ##__VA_ARGS__)



CVS commit: src/sys/kern

2019-04-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Apr  7 02:58:02 UTC 2019

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

Log Message:
Fix previous. We define _KERNEL for rump in opt_rumpkernel.h.

XXX This works because arch's with _RUMP_NATIVEABI=yes and therefore
XXX without _RUMPKERNEL (amd64 and i386) do not have their own
XXX setdisklabel(9). We may need another macro, e.g., _RUMP.


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

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



CVS commit: src/etc/defaults

2019-04-06 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Apr  7 02:08:08 UTC 2019

Modified Files:
src/etc/defaults: npf.boot.conf

Log Message:
Allow DHCP
Neighbour Advertisement should be allowed both ways, otherwise
ipv6nd_sendadvertisement() from dhcpcd logs "Network is unreachable"


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/defaults/npf.boot.conf

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

Modified files:

Index: src/etc/defaults/npf.boot.conf
diff -u src/etc/defaults/npf.boot.conf:1.1 src/etc/defaults/npf.boot.conf:1.2
--- src/etc/defaults/npf.boot.conf:1.1	Tue Apr  2 01:50:32 2019
+++ src/etc/defaults/npf.boot.conf	Sun Apr  7 02:08:08 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: npf.boot.conf,v 1.1 2019/04/02 01:50:32 sevan Exp $
+#	$NetBSD: npf.boot.conf,v 1.2 2019/04/07 02:08:08 sevan Exp $
 #
 # /etc/defaults/npf.boot.conf --
 #	initial configuration for npf(4)
@@ -25,11 +25,15 @@ pass stateful out to any port domain
 # (the DHCP server can be down or not responding).
 pass stateful out proto icmp icmp-type echo all
 
+# Allow DHCP
+pass out family inet4 proto udp from any port bootpc to any port bootps
+pass in family inet4 proto udp from any port bootps to any port bootpc
+
 # Allow IPv6 router/neighbor solicitation and advertisement.
 pass out  family inet6 proto ipv6-icmp icmp-type rtsol all
 pass in family inet6 proto ipv6-icmp icmp-type rtadv all
 pass out  family inet6 proto ipv6-icmp icmp-type neighsol all
-pass in family inet6 proto ipv6-icmp icmp-type neighadv all
+pass family inet6 proto ipv6-icmp icmp-type neighadv all
 
 # Enable CARP, to avoid spurious failovers.
 pass proto carp all



CVS commit: src/etc/defaults

2019-04-06 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Apr  7 02:08:08 UTC 2019

Modified Files:
src/etc/defaults: npf.boot.conf

Log Message:
Allow DHCP
Neighbour Advertisement should be allowed both ways, otherwise
ipv6nd_sendadvertisement() from dhcpcd logs "Network is unreachable"


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/defaults/npf.boot.conf

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



CVS commit: src/sys/dev/ic

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr  7 01:39:12 UTC 2019

Modified Files:
src/sys/dev/ic: spdmem.c

Log Message:
Fix spelling of symeti^Hric


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/spdmem.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/spdmem.c
diff -u src/sys/dev/ic/spdmem.c:1.30 src/sys/dev/ic/spdmem.c:1.31
--- src/sys/dev/ic/spdmem.c:1.30	Thu Dec 27 02:54:00 2018
+++ src/sys/dev/ic/spdmem.c	Sun Apr  7 01:39:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.30 2018/12/27 02:54:00 msaitoh Exp $ */
+/* $NetBSD: spdmem.c,v 1.31 2019/04/07 01:39:12 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.30 2018/12/27 02:54:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.31 2019/04/07 01:39:12 pgoyette Exp $");
 
 #include 
 #include 
@@ -942,7 +942,7 @@ decode_ddr4(const struct sysctlnode *nod
 	"%d rows, %d cols, %d ranks%s, %d banks/group, %d bank groups\n",
 	s->sm_ddr4.ddr4_rows + 12, s->sm_ddr4.ddr4_cols + 9,
 	ranks, (ranks > 1) ? ((s->sm_ddr4.ddr4_rank_mix == 1)
-		? " (asymmetric)" : " (symmetiric)") : "",
+		? " (asymmetric)" : " (symmetric)") : "",
 	1 << (2 + s->sm_ddr4.ddr4_logbanks),
 	1 << s->sm_ddr4.ddr4_bankgroups);
 



CVS commit: src/sys/dev/ic

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr  7 01:39:12 UTC 2019

Modified Files:
src/sys/dev/ic: spdmem.c

Log Message:
Fix spelling of symeti^Hric


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

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



CVS commit: src/usr.bin/ftp

2019-04-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 00:44:54 UTC 2019

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
redo the connection waiting handling to make it more clear.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ftp/ssl.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.bin/ftp/ssl.c
diff -u src/usr.bin/ftp/ssl.c:1.7 src/usr.bin/ftp/ssl.c:1.8
--- src/usr.bin/ftp/ssl.c:1.7	Wed Apr  3 20:36:09 2019
+++ src/usr.bin/ftp/ssl.c	Sat Apr  6 20:44:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl.c,v 1.7 2019/04/04 00:36:09 christos Exp $	*/
+/*	$NetBSD: ssl.c,v 1.8 2019/04/07 00:44:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -34,7 +34,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ssl.c,v 1.7 2019/04/04 00:36:09 christos Exp $");
+__RCSID("$NetBSD: ssl.c,v 1.8 2019/04/07 00:44:54 christos Exp $");
 #endif
 
 #include 
@@ -88,6 +88,7 @@ fetch_writev(struct fetch_connect *conn,
 	struct timeval now, timeout, delta;
 	fd_set writefds;
 	ssize_t len, total;
+	int fd = conn->sd;
 	int r;
 
 	if (quit_time > 0) {
@@ -98,8 +99,8 @@ fetch_writev(struct fetch_connect *conn,
 
 	total = 0;
 	while (iovcnt > 0) {
-		while (quit_time > 0 && !FD_ISSET(conn->sd, )) {
-			FD_SET(conn->sd, );
+		while (quit_time > 0 && !FD_ISSET(fd, )) {
+			FD_SET(fd, );
 			gettimeofday(, NULL);
 			delta.tv_sec = timeout.tv_sec - now.tv_sec;
 			delta.tv_usec = timeout.tv_usec - now.tv_usec;
@@ -112,7 +113,7 @@ fetch_writev(struct fetch_connect *conn,
 return -1;
 			}
 			errno = 0;
-			r = select(conn->sd + 1, NULL, , NULL, );
+			r = select(fd + 1, NULL, , NULL, );
 			if (r == -1) {
 if (errno == EINTR)
 	continue;
@@ -123,7 +124,7 @@ fetch_writev(struct fetch_connect *conn,
 		if (conn->ssl != NULL)
 			len = SSL_write(conn->ssl, iov->iov_base, iov->iov_len);
 		else
-			len = writev(conn->sd, iov, iovcnt);
+			len = writev(fd, iov, iovcnt);
 		if (len == 0) {
 			/* we consider a short write a failure */
 			/* XXX perhaps we shouldn't in the SSL case */
@@ -131,7 +132,7 @@ fetch_writev(struct fetch_connect *conn,
 			return -1;
 		}
 		if (len < 0) {
-			if (errno == EINTR)
+			if (errno == EINTR || errno == EAGAIN)
 continue;
 			return -1;
 		}
@@ -149,11 +150,8 @@ fetch_writev(struct fetch_connect *conn,
 	return total;
 }
 
-/*
- * Write to a connection w/ timeout
- */
-static int
-fetch_write(struct fetch_connect *conn, const char *str, size_t len)
+static ssize_t
+fetch_write(const void *str, size_t len, struct fetch_connect *conn)
 {
 	struct iovec iov[1];
 
@@ -182,7 +180,7 @@ fetch_printf(struct fetch_connect *conn,
 		return -1;
 	}
 
-	r = fetch_write(conn, msg, len);
+	r = fetch_write(msg, len, conn);
 	free(msg);
 	return r;
 }
@@ -211,15 +209,16 @@ fetch_clearerr(struct fetch_connect *con
 int
 fetch_flush(struct fetch_connect *conn)
 {
-	int v;
 
 	if (conn->issock) {
+		int fd = conn->sd;
+		int v;
 #ifdef TCP_NOPUSH
 		v = 0;
-		setsockopt(conn->sd, IPPROTO_TCP, TCP_NOPUSH, , sizeof(v));
+		setsockopt(fd, IPPROTO_TCP, TCP_NOPUSH, , sizeof(v));
 #endif
 		v = 1;
-		setsockopt(conn->sd, IPPROTO_TCP, TCP_NODELAY, , sizeof(v));
+		setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, , sizeof(v));
 	}
 	return 0;
 }
@@ -272,23 +271,19 @@ fetch_fdopen(int sd, const char *fmode)
 int
 fetch_close(struct fetch_connect *conn)
 {
-	int rv = 0;
+	if (conn == NULL)
+		return 0;
 
-	if (conn != NULL) {
-		fetch_flush(conn);
-		SSL_free(conn->ssl);
-		rv = close(conn->sd);
-		if (rv < 0) {
-			errno = rv;
-			rv = EOF;
-		}
-		free(conn->cache.buf);
-		free(conn->buf);
-		free(conn);
-	}
-	return rv;
+	fetch_flush(conn);
+	SSL_free(conn->ssl);
+	close(conn->sd);
+	free(conn->cache.buf);
+	free(conn->buf);
+	free(conn);
+	return 0;
 }
 
+#define FETCH_WRITE_WAIT	-3
 #define FETCH_READ_WAIT		-2
 #define FETCH_READ_ERROR	-1
 
@@ -296,19 +291,19 @@ static ssize_t
 fetch_ssl_read(SSL *ssl, void *buf, size_t len)
 {
 	ssize_t rlen;
-	int ssl_err;
-
 	rlen = SSL_read(ssl, buf, len);
-	if (rlen < 0) {
-		ssl_err = SSL_get_error(ssl, rlen);
-		if (ssl_err == SSL_ERROR_WANT_READ ||
-		ssl_err == SSL_ERROR_WANT_WRITE) {
-			return FETCH_READ_WAIT;
-		}
+	if (rlen >= 0)
+		return rlen;
+
+	switch (SSL_get_error(ssl, rlen)) {
+	case SSL_ERROR_WANT_READ:
+		return FETCH_READ_WAIT;
+	case SSL_ERROR_WANT_WRITE:
+		return FETCH_WRITE_WAIT;
+	default:
 		ERR_print_errors_fp(ttyout);
 		return FETCH_READ_ERROR;
 	}
-	return rlen;
 }
 
 static ssize_t
@@ -317,7 +312,7 @@ fetch_nonssl_read(int sd, void *buf, siz
 	ssize_t rlen;
 
 	rlen = read(sd, buf, len);
-	if (rlen < 0) {
+	if (rlen == -1) {
 		if (errno == EAGAIN || errno == EINTR)
 			return FETCH_READ_WAIT;
 		return FETCH_READ_ERROR;
@@ -348,14 +343,45 @@ fetch_cache_data(struct fetch_connect *c
 	return 0;
 }
 
+static int
+fetch_wait(struct fetch_connect *conn, ssize_t rlen, struct 

CVS commit: src/usr.bin/ftp

2019-04-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 00:44:54 UTC 2019

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
redo the connection waiting handling to make it more clear.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ftp/ssl.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/sparc64/include

2019-04-06 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Apr  6 21:40:15 UTC 2019

Modified Files:
src/sys/arch/sparc64/include: psl.h

Log Message:
The real cause for removing asm inline code on clang is that the
"r" constraint cannot handle 64-bit and is treated as 32-bit.

So code that refers to the upper 32-bit (manuf or impl) of the %ver
register is removed by optimization.

Use 32-bit kernel code as a workaround when referring to the %ver
register.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc64/include/psl.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/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.59 src/sys/arch/sparc64/include/psl.h:1.60
--- src/sys/arch/sparc64/include/psl.h:1.59	Fri Apr  5 12:15:41 2019
+++ src/sys/arch/sparc64/include/psl.h	Sat Apr  6 21:40:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.59 2019/04/05 12:15:41 nakayama Exp $ */
+/*	$NetBSD: psl.h,v 1.60 2019/04/06 21:40:15 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -292,9 +292,8 @@
  * Put "memory" to asm inline on sun4v to avoid issuing rdpr %ver
  * before checking cputyp as a result of code moving by compiler
  * optimization.
- * For clang, to prevent it from being removed by optimization.
  */
-#if defined(SUN4V) || defined(__clang__)
+#ifdef SUN4V
 #define constasm_clobbers "memory"
 #else
 #define constasm_clobbers
@@ -323,11 +322,13 @@ static __inline void set##name(type _val
 	__asm volatile(#wr " %0,0,%" #reg : : "r" (_val) : "memory");	\
 }
 
-#ifdef __arch64__
+/*
+ * XXX: clang's "r" constraint cannot handle 64-bit,
+ * so use 32-bit kernel code as a workaround.
+ */
+#if defined(__arch64__) && !defined(__clang__)
 #define SPARC64_RDCONST64_DEF(rd, name, reg) \
 	SPARC64_RDCONST_DEF(rd, name, reg, uint64_t)
-#define SPARC64_RD64_DEF(rd, name, reg) SPARC64_RD_DEF(rd, name, reg, uint64_t)
-#define SPARC64_WR64_DEF(wr, name, reg) SPARC64_WR_DEF(wr, name, reg, uint64_t)
 #else
 #define SPARC64_RDCONST64_DEF(rd, name, reg)\
 static __inline __constfunc uint64_t get##name(void)			\
@@ -337,6 +338,12 @@ static __inline __constfunc uint64_t get
 		: "=r" (_hi), "=r" (_lo) : : constasm_clobbers);	\
 	return ((uint64_t)_hi << 32) | _lo;\
 }
+#endif
+
+#ifdef __arch64__
+#define SPARC64_RD64_DEF(rd, name, reg) SPARC64_RD_DEF(rd, name, reg, uint64_t)
+#define SPARC64_WR64_DEF(wr, name, reg) SPARC64_WR_DEF(wr, name, reg, uint64_t)
+#else
 #define SPARC64_RD64_DEF(rd, name, reg)	\
 static __inline uint64_t get##name(void)\
 {	\



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

2019-04-06 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Apr  6 21:40:15 UTC 2019

Modified Files:
src/sys/arch/sparc64/include: psl.h

Log Message:
The real cause for removing asm inline code on clang is that the
"r" constraint cannot handle 64-bit and is treated as 32-bit.

So code that refers to the upper 32-bit (manuf or impl) of the %ver
register is removed by optimization.

Use 32-bit kernel code as a workaround when referring to the %ver
register.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc64/include/psl.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

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 20:25:27 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: copy.S
src/sys/arch/i386/i386: copy.S

Log Message:
Fix a think-o / paste-o in the max user address check, pointed out
by maxv@.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/copy.S
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/i386/copy.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/amd64/amd64/copy.S
diff -u src/sys/arch/amd64/amd64/copy.S:1.31 src/sys/arch/amd64/amd64/copy.S:1.32
--- src/sys/arch/amd64/amd64/copy.S:1.31	Sat Apr  6 03:06:24 2019
+++ src/sys/arch/amd64/amd64/copy.S	Sat Apr  6 20:25:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.31 2019/04/06 03:06:24 thorpej Exp $	*/
+/*	$NetBSD: copy.S,v 1.32 2019/04/06 20:25:26 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -386,15 +386,15 @@ END(copystr)
 
 /**/
 
-#define	UFETCHSTORE_PROLOGUE		\
-	movq	$VM_MAXUSER_ADDRESS-1,%r11			;	\
+#define	UFETCHSTORE_PROLOGUE(x)		\
+	movq	$VM_MAXUSER_ADDRESS-x,%r11			;	\
 	cmpq	%r11,%rdi	;	\
 	ja	_C_LABEL(copy_efault)
 
 /* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
 ENTRY(_ufetch_8)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(1)
 
 	SMAP_DISABLE
 .L_ufetch_8_start:
@@ -411,7 +411,7 @@ END(_ufetch_8)
 /* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
 ENTRY(_ufetch_16)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(2)
 
 	SMAP_DISABLE
 .L_ufetch_16_start:
@@ -428,7 +428,7 @@ END(_ufetch_16)
 /* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
 ENTRY(_ufetch_32)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(4)
 
 	SMAP_DISABLE
 .L_ufetch_32_start:
@@ -445,7 +445,7 @@ END(_ufetch_32)
 /* LINTSTUB: int _ufetch_64(const uint64_t *uaddr, uint64_t *valp); */
 ENTRY(_ufetch_64)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(8)
 
 	SMAP_DISABLE
 .L_ufetch_64_start:
@@ -462,7 +462,7 @@ END(_ufetch_64)
 /* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
 ENTRY(_ustore_8)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(1)
 
 	SMAP_DISABLE
 .L_ustore_8_start:
@@ -478,7 +478,7 @@ END(_ustore_8)
 /* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
 ENTRY(_ustore_16)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(2)
 
 	SMAP_DISABLE
 .L_ustore_16_start:
@@ -494,7 +494,7 @@ END(_ustore_16)
 /* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */
 ENTRY(_ustore_32)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(4)
 
 	SMAP_DISABLE
 .L_ustore_32_start:
@@ -510,7 +510,7 @@ END(_ustore_32)
 /* LINTSTUB: int _ustore_64(uint64_t *uaddr, uint64_t val); */
 ENTRY(_ustore_64)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(8)
 
 	SMAP_DISABLE
 .L_ustore_64_start:

Index: src/sys/arch/i386/i386/copy.S
diff -u src/sys/arch/i386/i386/copy.S:1.29 src/sys/arch/i386/i386/copy.S:1.30
--- src/sys/arch/i386/i386/copy.S:1.29	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/i386/i386/copy.S	Sat Apr  6 20:25:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.29 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: copy.S,v 1.30 2019/04/06 20:25:27 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2004, 2008 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.29 2019/04/06 03:06:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.30 2019/04/06 20:25:27 thorpej Exp $");
 
 #include "assym.h"
 
@@ -500,15 +500,15 @@ END(copystr)
 
 /**/
 
-#define	UFETCHSTORE_PROLOGUE		\
+#define	UFETCHSTORE_PROLOGUE(x)		\
 	movl	4(%esp),%edx	;	\
-	cmpl	$VM_MAXUSER_ADDRESS-4,%edx			;	\
+	cmpl	$VM_MAXUSER_ADDRESS-x,%edx			;	\
 	ja	_C_LABEL(ufetchstore_efault)
 
 /* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
 ENTRY(_ufetch_8)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(1)
 
 	SMAP_DISABLE
 .L_ufetch_8_start:
@@ -526,7 +526,7 @@ END(_ufetch_8)
 /* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
 ENTRY(_ufetch_16)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(2)
 
 	SMAP_DISABLE
 .L_ufetch_16_start:
@@ -544,7 +544,7 @@ END(_ufetch_16)
 /* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
 ENTRY(_ufetch_32)
 	DEFERRED_SWITCH_CHECK
-	UFETCHSTORE_PROLOGUE
+	UFETCHSTORE_PROLOGUE(4)
 
 	SMAP_DISABLE
 .L_ufetch_32_start:
@@ -562,7 +562,7 @@ END(_ufetch_32)
 /* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
 ENTRY(_ustore_8)
 	DEFERRED_SWITCH_CHECK
-	

CVS commit: src/sys/arch

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 20:25:27 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: copy.S
src/sys/arch/i386/i386: copy.S

Log Message:
Fix a think-o / paste-o in the max user address check, pointed out
by maxv@.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/copy.S
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/i386/copy.S

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



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

2019-04-06 Thread Robert Elz
Date:Sat, 6 Apr 2019 10:48:32 -0700
From:Jason Thorpe 
Message-ID:  

  | The only situation I know of where it's wacky is sparc64-built-as-ILP32
  | and mips64-built-as-ILP32, where register_t is 64-bit and long is 32-bit.

But that is kind of the point - from qhat I can see from a (very) quick
scan, register_t is used almost exclusively for syscall args/results
(for which it makes sense) - and those are objects which are likely being
copied to/from user space.

Just like ufetch_ptr() exists, even though a pointer is almost always
the same as an int or a long in terms of number of bits, etc, register_t
will essentially always be one or the other - but we never really know
which.

Unlike most of the other contrived types (size_t, intmax_t, ptrdiff_t)
which aren't all that frequently shunted around, register_t is, which
is why (just like ptr_t) I believe it would be one which should have its
own access functions.

But I will leave it for you to decide what is really needed there.

kre



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

2019-04-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Apr  6 18:30:20 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Fix race conditions about pmap_page_protect() and pmap_enter().

while handling same PTE by these functions in same time, there
is a critical path that the number of valid PTEs and wire_count
are inconsistent, and it caused KASSERT.
Need to hold a pv_lock while modifying them.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/aarch64/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/aarch64/aarch64

2019-04-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Apr  6 18:30:20 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
Fix race conditions about pmap_page_protect() and pmap_enter().

while handling same PTE by these functions in same time, there
is a critical path that the number of valid PTEs and wire_count
are inconsistent, and it caused KASSERT.
Need to hold a pv_lock while modifying them.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/aarch64/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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.38 src/sys/arch/aarch64/aarch64/pmap.c:1.39
--- src/sys/arch/aarch64/aarch64/pmap.c:1.38	Wed Mar 20 07:05:06 2019
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sat Apr  6 18:30:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.38 2019/03/20 07:05:06 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.39 2019/04/06 18:30:20 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.38 2019/03/20 07:05:06 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.39 2019/04/06 18:30:20 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -908,8 +908,6 @@ _pmap_remove_pv(struct vm_page *pg, stru
 
 	md = VM_PAGE_TO_MD(pg);
 
-	pmap_pv_lock(md);
-
 	TAILQ_FOREACH(pv, >mdpg_pvhead, pv_link) {
 		if ((pm == pv->pv_pmap) && (va == pv->pv_va)) {
 			TAILQ_REMOVE(>mdpg_pvhead, pv, pv_link);
@@ -923,8 +921,6 @@ _pmap_remove_pv(struct vm_page *pg, stru
 	}
 #endif
 
-	pmap_pv_unlock(md);
-
 	return pv;
 }
 
@@ -1008,8 +1004,6 @@ _pmap_enter_pv(struct vm_page *pg, struc
 
 	md = VM_PAGE_TO_MD(pg);
 
-	pmap_pv_lock(md);
-
 	/* pv is already registered? */
 	TAILQ_FOREACH(pv, >mdpg_pvhead, pv_link) {
 		if ((pm == pv->pv_pmap) && (va == pv->pv_va)) {
@@ -1018,8 +1012,6 @@ _pmap_enter_pv(struct vm_page *pg, struc
 	}
 
 	if (pv == NULL) {
-		pmap_pv_unlock(md);
-
 		/*
 		 * create and link new pv.
 		 * pv is already allocated at beginning of _pmap_enter().
@@ -1034,7 +1026,6 @@ _pmap_enter_pv(struct vm_page *pg, struc
 		pv->pv_pa = pa;
 		pv->pv_ptep = ptep;
 
-		pmap_pv_lock(md);
 		TAILQ_INSERT_HEAD(>mdpg_pvhead, pv, pv_link);
 		PMAP_COUNT(pv_enter);
 
@@ -1047,7 +1038,6 @@ _pmap_enter_pv(struct vm_page *pg, struc
 #endif
 	}
 
-	pmap_pv_unlock(md);
 	return 0;
 }
 
@@ -1283,6 +1273,7 @@ pmap_create(void)
 	pm->pm_asid = -1;
 	TAILQ_INIT(>pm_vmlist);
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_VM);
+
 	pm->pm_l0table_pa = pmap_alloc_pdp(pm, NULL, true);
 	KASSERT(pm->pm_l0table_pa != POOL_PADDR_INVALID);
 	pm->pm_l0table = (pd_entry_t *)AARCH64_PA_TO_KVA(pm->pm_l0table_pa);
@@ -1438,17 +1429,14 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	struct vm_page *pg, *pdppg, *pdppg0;
 	struct pv_entry *spv, *opv = NULL;
 	pd_entry_t pde;
-	pt_entry_t attr, pte, *ptep;
-#ifdef UVMHIST
-	pt_entry_t opte;
-#endif
+	pt_entry_t attr, pte, opte, *ptep;
 	pd_entry_t *l0, *l1, *l2, *l3;
 	paddr_t pdppa, pdppa0;
 	uint32_t mdattr;
 	unsigned int idx;
 	int error = 0;
 	const bool user = (pm != pmap_kernel());
-	bool need_sync_icache, exists;
+	bool need_sync_icache, need_update_pv;
 	bool l3only = true;
 
 	UVMHIST_FUNC(__func__);
@@ -1496,9 +1484,11 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 		 * pool_cache_get() may call pmap_kenter() internally.
 		 */
 		spv = pool_cache_get(&_pmap_pv_pool, PR_NOWAIT);
+		need_update_pv = true;
 	} else {
 		PMAP_COUNT(unmanaged_mappings);
 		spv = NULL;
+		need_update_pv = false;
 	}
 
 	pm_lock(pm);
@@ -1512,12 +1502,13 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	pde = l0[idx];
 	if (!l0pde_valid(pde)) {
 		/* no need to increment L0 occupancy. L0 page never freed */
-		pdppa = pmap_alloc_pdp(pm, , false);	/* L1 pdp */
+		pdppa = pmap_alloc_pdp(pm, , flags);	/* L1 pdp */
 		if (pdppa == POOL_PADDR_INVALID) {
 			if (flags & PMAP_CANFAIL) {
 error = ENOMEM;
-goto done;
+goto fail0;
 			}
+			pm_unlock(pm);
 			panic("%s: cannot allocate L1 table", __func__);
 		}
 		atomic_swap_64([idx], pdppa | L0_TABLE);
@@ -1534,12 +1525,13 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	if (!l1pde_valid(pde)) {
 		pdppa0 = pdppa;
 		pdppg0 = pdppg;
-		pdppa = pmap_alloc_pdp(pm, , false);	/* L2 pdp */
+		pdppa = pmap_alloc_pdp(pm, , flags);	/* L2 pdp */
 		if (pdppa == POOL_PADDR_INVALID) {
 			if (flags & PMAP_CANFAIL) {
 error = ENOMEM;
-goto done;
+goto fail0;
 			}
+			pm_unlock(pm);
 			panic("%s: cannot allocate L2 table", __func__);
 		}
 		atomic_swap_64([idx], pdppa | L1_TABLE);
@@ -1557,12 +1549,13 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	if (!l2pde_valid(pde)) {
 		pdppa0 = pdppa;
 		pdppg0 = pdppg;
-		pdppa = pmap_alloc_pdp(pm, , false);	/* L3 pdp */
+		pdppa = pmap_alloc_pdp(pm, , flags);	/* L3 pdp */
 		if (pdppa == POOL_PADDR_INVALID) {
 			if (flags & 

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

2019-04-06 Thread Jason Thorpe



> On Apr 6, 2019, at 10:45 AM, Robert Elz  wrote:
> 
> Actually, fetching & storing registers (register_t) is a common enough
> thing that it might be worth having ufetch_reg (and ustore_reg), probably
> as MD #defines that map into one of the other calls.

The only situation I know of where it's wacky is sparc64-built-as-ILP32 and 
mips64-built-as-ILP32, where register_t is 64-bit and long is 32-bit.

-- thorpej



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

2019-04-06 Thread Robert Elz
Actually, fetching & storing registers (register_t) is a common enough
thing that it might be worth having ufetch_reg (and ustore_reg), probably
as MD #defines that map into one of the other calls.

kre



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 17:42:28 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
Revert previous (1.5) and return to the one before that (1.4), and
just allow things to be broken if this is used on a system where
register_t is int (32 bits) and long is 64 bits.Badly broken...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/freebsd/freebsd_syscall.c

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

Modified files:

Index: src/sys/compat/freebsd/freebsd_syscall.c
diff -u src/sys/compat/freebsd/freebsd_syscall.c:1.5 src/sys/compat/freebsd/freebsd_syscall.c:1.6
--- src/sys/compat/freebsd/freebsd_syscall.c:1.5	Sat Apr  6 17:27:58 2019
+++ src/sys/compat/freebsd/freebsd_syscall.c	Sat Apr  6 17:42:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_syscall.c,v 1.5 2019/04/06 17:27:58 kre Exp $	*/
+/*	$NetBSD: freebsd_syscall.c,v 1.6 2019/04/06 17:42:28 kre Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.5 2019/04/06 17:27:58 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.6 2019/04/06 17:42:28 kre Exp $");
 
 #include 
 #include 
@@ -88,7 +88,7 @@ freebsd_syscall(struct trapframe *frame)
 		/*
 		 * Code is first argument, followed by actual args.
 		 */
-		error = ufetch_int((void *)params, );
+		error = ufetch_long((void *)params, (u_long *));
 		if (error)
 			goto bad;
 		params += sizeof(int);
@@ -98,9 +98,9 @@ freebsd_syscall(struct trapframe *frame)
 		 * Like syscall, but code is a quad, so as to maintain
 		 * quad alignment for the rest of the arguments.
 		 */
-		error = ufetch_int((void *)(params +
+		error = ufetch_long((void *)(params +
 	 _QUAD_LOWWORD * sizeof(int)),
-);
+(u_long *));
 		if (error)
 			goto bad;
 		params += sizeof(quad_t);



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 17:42:28 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
Revert previous (1.5) and return to the one before that (1.4), and
just allow things to be broken if this is used on a system where
register_t is int (32 bits) and long is 64 bits.Badly broken...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/freebsd/freebsd_syscall.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/compat/freebsd

2019-04-06 Thread Robert Elz
Date:Sat, 6 Apr 2019 10:30:39 -0700
From:Jason Thorpe 
Message-ID:  <047ba730-614e-46fd-85e2-f501d18f4...@me.com>

  | This is wrong -- register_t is 64-bit on amd64 ... so u_long
  | is the better choice of cast.

It was wrong anyway, it needs to be an unsigned type (even though
code is signed) ... but yes, I will switch it back to the previous
version, and we can just hope that this stuff never gets used on
a system where long is 64 bits and register_t is 32.

kre



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 17:27:59 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
Revert previous.   Instead change ufetch_long() to ufetch_int() in
both calls (and also remove the cast on the earlier).

These replaced fuword, to fetch a register_t (ie: int).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/freebsd/freebsd_syscall.c

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

Modified files:

Index: src/sys/compat/freebsd/freebsd_syscall.c
diff -u src/sys/compat/freebsd/freebsd_syscall.c:1.4 src/sys/compat/freebsd/freebsd_syscall.c:1.5
--- src/sys/compat/freebsd/freebsd_syscall.c:1.4	Sat Apr  6 16:22:09 2019
+++ src/sys/compat/freebsd/freebsd_syscall.c	Sat Apr  6 17:27:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_syscall.c,v 1.4 2019/04/06 16:22:09 kre Exp $	*/
+/*	$NetBSD: freebsd_syscall.c,v 1.5 2019/04/06 17:27:58 kre Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.4 2019/04/06 16:22:09 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.5 2019/04/06 17:27:58 kre Exp $");
 
 #include 
 #include 
@@ -88,7 +88,7 @@ freebsd_syscall(struct trapframe *frame)
 		/*
 		 * Code is first argument, followed by actual args.
 		 */
-		error = ufetch_long((void *)params, (u_long *));
+		error = ufetch_int((void *)params, );
 		if (error)
 			goto bad;
 		params += sizeof(int);
@@ -98,9 +98,9 @@ freebsd_syscall(struct trapframe *frame)
 		 * Like syscall, but code is a quad, so as to maintain
 		 * quad alignment for the rest of the arguments.
 		 */
-		error = ufetch_long((void *)(params +
+		error = ufetch_int((void *)(params +
 	 _QUAD_LOWWORD * sizeof(int)),
-(u_long *));
+);
 		if (error)
 			goto bad;
 		params += sizeof(quad_t);



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 17:27:59 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
Revert previous.   Instead change ufetch_long() to ufetch_int() in
both calls (and also remove the cast on the earlier).

These replaced fuword, to fetch a register_t (ie: int).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/freebsd/freebsd_syscall.c

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



CVS commit: src/regress/libexec/ld.elf_so

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 16:25:52 UTC 2019

Modified Files:
src/regress/libexec/ld.elf_so: Makefile
Removed Files:
src/regress/libexec/ld.elf_so/expand: Makefile

Log Message:
Eliminate regress/libexec/ld.elf_so/expand

This test does not contain any code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/regress/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.3 -r0 src/regress/libexec/ld.elf_so/expand/Makefile

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



CVS commit: src/regress/libexec/ld.elf_so

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 16:25:52 UTC 2019

Modified Files:
src/regress/libexec/ld.elf_so: Makefile
Removed Files:
src/regress/libexec/ld.elf_so/expand: Makefile

Log Message:
Eliminate regress/libexec/ld.elf_so/expand

This test does not contain any code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/regress/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.3 -r0 src/regress/libexec/ld.elf_so/expand/Makefile

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

Modified files:

Index: src/regress/libexec/ld.elf_so/Makefile
diff -u src/regress/libexec/ld.elf_so/Makefile:1.2 src/regress/libexec/ld.elf_so/Makefile:1.3
--- src/regress/libexec/ld.elf_so/Makefile:1.2	Fri May 18 21:41:38 2007
+++ src/regress/libexec/ld.elf_so/Makefile	Sat Apr  6 16:25:52 2019
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.2 2007/05/18 21:41:38 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2019/04/06 16:25:52 kamil Exp $
 
 .include 
 
-SUBDIR+= expand origin
+SUBDIR+= origin
 
 .include 



CVS commit: src/sys/arch/sparc/sparc

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 16:22:01 UTC 2019

Modified Files:
src/sys/arch/sparc/sparc: db_trace.c

Log Message:
Fix building crash(8) on sparc after ufetch / ustore changes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sparc/sparc/db_trace.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/sparc/sparc/db_trace.c
diff -u src/sys/arch/sparc/sparc/db_trace.c:1.36 src/sys/arch/sparc/sparc/db_trace.c:1.37
--- src/sys/arch/sparc/sparc/db_trace.c:1.36	Sat Apr  6 03:06:27 2019
+++ src/sys/arch/sparc/sparc/db_trace.c	Sat Apr  6 16:22:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.36 2019/04/06 03:06:27 thorpej Exp $ */
+/*	$NetBSD: db_trace.c,v 1.37 2019/04/06 16:22:01 thorpej Exp $ */
 
 /*
  * Mach Operating System
@@ -27,11 +27,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.36 2019/04/06 03:06:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.37 2019/04/06 16:22:01 thorpej Exp $");
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -51,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: db_trace.c,v
 #define ONINTSTACK(fr)	(0)
 #endif
 
+#ifdef _KERNEL
 static db_addr_t
 db_fetch_word(const void *uaddr)
 {
@@ -60,6 +62,7 @@ db_fetch_word(const void *uaddr)
 		val = (u_int)-1;
 	return val;
 }
+#endif /* _KERNEL */
 
 void
 db_stack_trace_print(db_expr_t addr, bool have_addr,



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 16:22:09 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
If using a cast for  to make it a u_long * is acceptable a
few lines earlier, it should work here too.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/freebsd/freebsd_syscall.c

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

Modified files:

Index: src/sys/compat/freebsd/freebsd_syscall.c
diff -u src/sys/compat/freebsd/freebsd_syscall.c:1.3 src/sys/compat/freebsd/freebsd_syscall.c:1.4
--- src/sys/compat/freebsd/freebsd_syscall.c:1.3	Sat Apr  6 03:06:28 2019
+++ src/sys/compat/freebsd/freebsd_syscall.c	Sat Apr  6 16:22:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_syscall.c,v 1.3 2019/04/06 03:06:28 thorpej Exp $	*/
+/*	$NetBSD: freebsd_syscall.c,v 1.4 2019/04/06 16:22:09 kre Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.3 2019/04/06 03:06:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.4 2019/04/06 16:22:09 kre Exp $");
 
 #include 
 #include 
@@ -100,7 +100,7 @@ freebsd_syscall(struct trapframe *frame)
 		 */
 		error = ufetch_long((void *)(params +
 	 _QUAD_LOWWORD * sizeof(int)),
-);
+(u_long *));
 		if (error)
 			goto bad;
 		params += sizeof(quad_t);



CVS commit: src/sys/arch/sparc/sparc

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 16:22:01 UTC 2019

Modified Files:
src/sys/arch/sparc/sparc: db_trace.c

Log Message:
Fix building crash(8) on sparc after ufetch / ustore changes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sparc/sparc/db_trace.c

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



CVS commit: src/sys/compat/freebsd

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 16:22:09 UTC 2019

Modified Files:
src/sys/compat/freebsd: freebsd_syscall.c

Log Message:
If using a cast for  to make it a u_long * is acceptable a
few lines earlier, it should work here too.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/freebsd/freebsd_syscall.c

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



CVS commit: src/sys/kern

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 15:52:35 UTC 2019

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

Log Message:
Treat _RUMPKERNEL like a __HAVE_UCAS_FULL platform.  Add a comment
explaining what's going on.  Fixes librump build on sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_copy.c

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

Modified files:

Index: src/sys/kern/subr_copy.c
diff -u src/sys/kern/subr_copy.c:1.9 src/sys/kern/subr_copy.c:1.10
--- src/sys/kern/subr_copy.c:1.9	Sat Apr  6 03:06:28 2019
+++ src/sys/kern/subr_copy.c	Sat Apr  6 15:52:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_copy.c,v 1.9 2019/04/06 03:06:28 thorpej Exp $	*/
+/*	$NetBSD: subr_copy.c,v 1.10 2019/04/06 15:52:35 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008, 2019
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.9 2019/04/06 03:06:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.10 2019/04/06 15:52:35 thorpej Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 #define	__UCAS_PRIVATE
@@ -375,7 +375,15 @@ do {	\
 } while (/*CONSTCOND*/0)
 #endif /* __NO_STRICT_ALIGNMENT */
 
-#ifndef __HAVE_UCAS_FULL
+/*
+ * __HAVE_UCAS_FULL platforms provide _ucas_32() and _ucas_64() themselves.
+ * _RUMPKERNEL also provides it's own _ucas_32() and _ucas_64().
+ *
+ * In all other cases, we provide generic implementations that work on
+ * all platforms.
+ */
+
+#if !defined(__HAVE_UCAS_FULL) && !defined(_RUMPKERNEL)
 #if !defined(__HAVE_UCAS_MP) && defined(MULTIPROCESSOR)
 #include 
 #include 
@@ -522,7 +530,7 @@ _ucas_64(volatile uint64_t *uaddr, uint6
 	return error;
 }
 #endif /* _LP64 */
-#endif /* ! __HAVE_UCAS_FULL */
+#endif /* ! __HAVE_UCAS_FULL && ! _RUMPKERNEL */
 
 int
 ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new, uint32_t *ret)



CVS commit: src/sys/kern

2019-04-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  6 15:52:35 UTC 2019

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

Log Message:
Treat _RUMPKERNEL like a __HAVE_UCAS_FULL platform.  Add a comment
explaining what's going on.  Fixes librump build on sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_copy.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

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 15:41:54 UTC 2019

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

Log Message:
Add new tests in ATF t_fork/t_vfork

Verify whether nested fork(2)/vfork(2)/clone(2) calls are supported in a
fork(2)ed/vforked(2) child.

The interesting ones are non-forked parent and non-forked child scenarios,
in particular double vfork(2).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_fork.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_fork.c
diff -u src/tests/lib/libc/sys/t_fork.c:1.3 src/tests/lib/libc/sys/t_fork.c:1.4
--- src/tests/lib/libc/sys/t_fork.c:1.3	Sat May 19 05:10:16 2018
+++ src/tests/lib/libc/sys/t_fork.c	Sat Apr  6 15:41:54 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: t_fork.c,v 1.3 2018/05/19 05:10:16 kamil Exp $	*/
+/*	$NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $	*/
 
 /*-
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,15 +27,17 @@
  */
 
 #include 
-__COPYRIGHT("@(#) Copyright (c) 2018\
+__COPYRIGHT("@(#) Copyright (c) 2018, 2019\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_fork.c,v 1.3 2018/05/19 05:10:16 kamil Exp $");
+__RCSID("$NetBSD: t_fork.c,v 1.4 2019/04/06 15:41:54 kamil Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -242,7 +244,7 @@ ATF_TC_HEAD(test, tc)\
 {		\
 		\
 	atf_tc_set_md_var(tc, "descr",		\
-	"raise " #sig " in vfork(2)ed child");\
+	"raise " #sig " in a child");	\
 }		\
 		\
 ATF_TC_BODY(test, tc)\
@@ -260,6 +262,97 @@ RAISE(raise6, SIGABRT) /* regular abort 
 RAISE(raise7, SIGHUP)  /* hangup */
 RAISE(raise8, SIGCONT) /* continued? */
 
+/// 
+
+static int
+clone_func(void *arg __unused)
+{
+
+	return 0;
+}
+
+static void
+nested_raw(const char *fn, volatile int flags)
+{
+	int status;
+	pid_t child, child2, wpid;
+	const size_t stack_size = 1024 * 1024;
+	void *stack, *stack_base;
+
+	stack = malloc(stack_size);
+	ATF_REQUIRE(stack != NULL);
+
+#ifdef __MACHINE_STACK_GROWS_UP
+	stack_base = stack;
+#else
+	stack_base = (char *)stack + stack_size;
+#endif
+
+	flags |= SIGCHLD;
+
+	child = FORK();
+	ATF_REQUIRE(child != 1);
+	if (child == 0) {
+		if (strcmp(fn, "fork") == 0)
+			child2 = fork();
+		else if (strcmp(fn, "vfork") == 0)
+			child2 = vfork();
+		else if (strcmp(fn, "clone") == 0)
+			child2 = __clone(clone_func, stack_base, flags, NULL);
+		else
+			__unreachable();
+
+		ASSERT_NEQ(child2, -1);
+
+		if ((strcmp(fn, "fork") == 0) || (strcmp(fn, "vfork") == 0)) {
+			if (child2 == 0)
+_exit(0);
+		}
+
+		wpid = waitpid(child2, , 0);
+		ASSERT_EQ(child2, wpid);
+		ASSERT_EQ(!!WIFEXITED(status), true);
+		ASSERT_EQ(!!WIFCONTINUED(status), false);
+		ASSERT_EQ(!!WIFSIGNALED(status), false);
+		ASSERT_EQ(!!WIFSTOPPED(status), false);
+		ASSERT_EQ(WEXITSTATUS(status), 0);
+
+		_exit(0);
+	}
+	wpid = waitpid(child, , 0);
+
+	ATF_REQUIRE_EQ(wpid, child);
+	ATF_REQUIRE_EQ(!!WIFEXITED(status), true);
+	ATF_REQUIRE_EQ(!!WIFCONTINUED(status), false);
+	ATF_REQUIRE_EQ(!!WIFSIGNALED(status), false);
+	ATF_REQUIRE_EQ(!!WIFSTOPPED(status), false);
+	ATF_REQUIRE_EQ(WEXITSTATUS(status), 0);
+}
+
+#define NESTED(test, fn, flags)			\
+ATF_TC(test);	\
+ATF_TC_HEAD(test, tc)\
+{		\
+		\
+	atf_tc_set_md_var(tc, "descr",		\
+	"Test nested " #fn " in a child");	\
+}		\
+		\
+ATF_TC_BODY(test, tc)\
+{		\
+		\
+	nested_raw(#fn, flags);			\
+}
+
+NESTED(nested_fork, fork, 0)
+NESTED(nested_vfork, vfork, 0)
+NESTED(nested_clone, clone, 0)
+NESTED(nested_clone_vm, clone, CLONE_VM)
+NESTED(nested_clone_fs, clone, CLONE_FS)
+NESTED(nested_clone_files, clone, CLONE_FILES)
+//NESTED(nested_clone_sighand, clone, CLONE_SIGHAND) // XXX
+NESTED(nested_clone_vfork, clone, CLONE_VFORK)
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, raise1);
@@ -271,5 +364,14 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, raise7);
 	ATF_TP_ADD_TC(tp, raise8);
 
+	ATF_TP_ADD_TC(tp, nested_fork);
+	ATF_TP_ADD_TC(tp, nested_vfork);
+	ATF_TP_ADD_TC(tp, nested_clone);
+	ATF_TP_ADD_TC(tp, nested_clone_vm);
+	ATF_TP_ADD_TC(tp, nested_clone_fs);
+	ATF_TP_ADD_TC(tp, nested_clone_files);
+//	ATF_TP_ADD_TC(tp, nested_clone_sighand); // XXX
+	ATF_TP_ADD_TC(tp, nested_clone_vfork);
+
 	return atf_no_error();
 }



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

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 15:41:54 UTC 2019

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

Log Message:
Add new tests in ATF t_fork/t_vfork

Verify whether nested fork(2)/vfork(2)/clone(2) calls are supported in a
fork(2)ed/vforked(2) child.

The interesting ones are non-forked parent and non-forked child scenarios,
in particular double vfork(2).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_fork.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

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 15:35:09 UTC 2019

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

Log Message:
Simplify FORK_TEST in ATF t_ptrace_wait*

Reduce the scope of combinations that were planned to be tested from the
same function body.

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 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.104 src/tests/lib/libc/sys/t_ptrace_wait.c:1.105
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.104	Fri Apr  5 23:01:09 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sat Apr  6 15:35:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.104 2019/04/05 23:01:09 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.105 2019/04/06 15:35:09 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.104 2019/04/05 23:01:09 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.105 2019/04/06 15:35:09 kamil Exp $");
 
 #include 
 #include 
@@ -2946,7 +2946,7 @@ EVENTMASK_PRESERVED(eventmask_preserved_
 
 static void
 fork_body(pid_t (*fn)(void), bool trackfork, bool trackvfork,
-bool trackvforkdone, bool detachchild, bool detachparent)
+bool trackvforkdone)
 {
 	const int exitval = 5;
 	const int exitval2 = 15;
@@ -3118,61 +3118,47 @@ fork_body(pid_t (*fn)(void), bool trackf
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
-#define FORK_TEST(name,descr,fun,tfork,tvfork,tvforkdone,detchild,detparent) \
+#define FORK_TEST(name,fun,tfork,tvfork,tvforkdone)			\
 ATF_TC(name);\
 ATF_TC_HEAD(name, tc)			\
 {	\
-	atf_tc_set_md_var(tc, "descr", descr);\
+	atf_tc_set_md_var(tc, "descr", "Verify " #fun "(2) "		\
+	"called with 0%s%s%s in EVENT_MASK",			\
+	tfork ? "|PTRACE_FORK" : "",\
+	tvfork ? "|PTRACE_VFORK" : "",\
+	tvforkdone ? "|PTRACE_VFORK_DONE" : "");			\
 }	\
 	\
 ATF_TC_BODY(name, tc)			\
 {	\
 	\
-	fork_body(fun, tfork, tvfork, tvforkdone, detchild, detparent);	\
+	fork_body(fun, tfork, tvfork, tvforkdone);			\
 }
 
-#define F false
-#define T true
-
-#define F_IF__0(x)
-#define F_IF__1(x) x
-#define F_IF__(x,y) F_IF__ ## x (y)
-#define F_IF_(x,y) F_IF__(x,y)
-#define F_IF(x,y) F_IF_(x,y)
-
-#define DSCR(function,forkbit,vforkbit,vforkdonebit,dchildbit,dparentbit) \
-	"Verify " #function "(2) called with 0"\
-	F_IF(forkbit,"|PTRACE_FORK")	\
-	F_IF(vforkbit,"|PTRACE_VFORK")	\
-	F_IF(vforkdonebit,"|PTRACE_VFORK_DONE")\
-	" in EVENT_MASK."		\
-	F_IF(dchildbit," Detach child in this test.")			\
-	F_IF(dparentbit," Detach parent in this test.")
-
-FORK_TEST(fork1, DSCR(fork,0,0,0,0,0), fork, F, F, F, F, F)
+FORK_TEST(fork1, fork, false, false, false)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(fork2, DSCR(fork,1,0,0,0,0), fork, T, F, F, F, F)
-FORK_TEST(fork3, DSCR(fork,0,1,0,0,0), fork, F, T, F, F, F)
-FORK_TEST(fork4, DSCR(fork,1,1,0,0,0), fork, T, T, F, F, F)
+FORK_TEST(fork2, fork, true, false, false)
+FORK_TEST(fork3, fork, false, true, false)
+FORK_TEST(fork4, fork, true, true, false)
 #endif
-FORK_TEST(fork5, DSCR(fork,0,0,1,0,0), fork, F, F, T, F, F)
+FORK_TEST(fork5, fork, false, false, true)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(fork6, DSCR(fork,1,0,1,0,0), fork, T, F, T, F, F)
-FORK_TEST(fork7, DSCR(fork,0,1,1,0,0), fork, F, T, T, F, F)
-FORK_TEST(fork8, DSCR(fork,1,1,1,0,0), fork, T, T, T, F, F)
+FORK_TEST(fork6, fork, true, false, true)
+FORK_TEST(fork7, fork, false, true, true)
+FORK_TEST(fork8, fork, true, true, true)
 #endif
 
-FORK_TEST(vfork1, DSCR(vfork,0,0,0,0,0), vfork, F, F, F, F, F)
+FORK_TEST(vfork1, vfork, false, false, false)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(vfork2, DSCR(vfork,1,0,0,0,0), vfork, T, F, F, F, F)
-FORK_TEST(vfork3, DSCR(vfork,0,1,0,0,0), vfork, F, T, F, F, F)
-FORK_TEST(vfork4, DSCR(vfork,1,1,0,0,0), vfork, T, T, F, F, F)
+FORK_TEST(vfork2, vfork, true, false, false)
+FORK_TEST(vfork3, vfork, false, true, false)
+FORK_TEST(vfork4, vfork, true, true, false)
 #endif
-FORK_TEST(vfork5, DSCR(vfork,0,0,1,0,0), vfork, F, F, T, F, F)
+FORK_TEST(vfork5, vfork, false, false, true)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(vfork6, DSCR(vfork,1,0,1,0,0), vfork, T, F, T, F, F)
-FORK_TEST(vfork7, DSCR(vfork,0,1,1,0,0), vfork, F, T, T, F, F)
-FORK_TEST(vfork8, DSCR(vfork,1,1,1,0,0), vfork, T, T, T, F, F)
+FORK_TEST(vfork6, vfork, true, false, true)
+FORK_TEST(vfork7, vfork, false, true, true)
+FORK_TEST(vfork8, vfork, true, true, true)
 #endif
 
 /// 



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

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 15:35:09 UTC 2019

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

Log Message:
Simplify FORK_TEST in ATF t_ptrace_wait*

Reduce the scope of combinations that were planned to be tested from the
same function body.

NFCI


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



Re: CVS commit: src/sys

2019-04-06 Thread Christos Zoulas
Thanks!

christos

> On Apr 6, 2019, at 8:28 AM, Kamil Rytarowski  wrote:
> 
> 
> Done. I'm still working on adding more test scenarios for fork-related
> events. I've just covered basic clone(2) scenarios and undisclosed
> another bug in the code sitting since 2012.



CVS commit: src/distrib/sets/lists/debug

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 12:34:30 UTC 2019

Modified Files:
src/distrib/sets/lists/debug: module.mi

Log Message:
Register t_ufetchstore.debug in distrib files


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/debug/module.mi

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



CVS commit: src/distrib/sets/lists/debug

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 12:34:30 UTC 2019

Modified Files:
src/distrib/sets/lists/debug: module.mi

Log Message:
Register t_ufetchstore.debug in distrib files


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/debug/module.mi

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

Modified files:

Index: src/distrib/sets/lists/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.2 src/distrib/sets/lists/debug/module.mi:1.3
--- src/distrib/sets/lists/debug/module.mi:1.2	Sat Feb 23 11:23:07 2019
+++ src/distrib/sets/lists/debug/module.mi	Sat Apr  6 12:34:30 2019
@@ -1,5 +1,6 @@
-# $NetBSD: module.mi,v 1.2 2019/02/23 11:23:07 mlelstv Exp $
+# $NetBSD: module.mi,v 1.3 2019/04/06 12:34:30 kamil Exp $
 ./usr/libdata/debug/usr/tests/modules/k_helper3.debug	tests-sys-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/modules/t_builtin.debug	tests-sys-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/modules/t_kcov.debug	tests-sys-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/modules/t_modctl.debug	tests-sys-debug		debug,atf,rump
+./usr/libdata/debug/usr/tests/modules/t_ufetchstore.debug	tests-sys-debug		debug,atf,rump



CVS commit: src/distrib/sets/lists/comp

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 12:33:19 UTC 2019

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

Log Message:
Correct ustore(9) entry for MKCATPAGES=yes


To generate a diff of this commit:
cvs rdiff -u -r1.2267 -r1.2268 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2267 src/distrib/sets/lists/comp/mi:1.2268
--- src/distrib/sets/lists/comp/mi:1.2267	Sat Apr  6 09:33:07 2019
+++ src/distrib/sets/lists/comp/mi	Sat Apr  6 12:33:18 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2267 2019/04/06 09:33:07 kamil Exp $
+#	$NetBSD: mi,v 1.2268 2019/04/06 12:33:18 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11916,7 +11916,7 @@
 ./usr/share/man/cat9/usbdi.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/useracc.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/userret.0			comp-sys-catman		.cat
-./usr/share/man/cat9/ustore.9			comp-sys-catman		.cat
+./usr/share/man/cat9/ustore.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/ustore_16.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/ustore_32.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/ustore_64.0		comp-sys-catman		.cat



CVS commit: src/distrib/sets/lists/comp

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 12:33:19 UTC 2019

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

Log Message:
Correct ustore(9) entry for MKCATPAGES=yes


To generate a diff of this commit:
cvs rdiff -u -r1.2267 -r1.2268 src/distrib/sets/lists/comp/mi

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



Re: CVS commit: src/sys

2019-04-06 Thread Kamil Rytarowski
On 04.04.2019 21:32, Christos Zoulas wrote:
> In article <86734bad-b0e6-57dc-3e0f-5d7c124fa...@gmx.com>,
> Kamil Rytarowski   wrote:
>> -=-=-=-=-=-
>> -=-=-=-=-=-
>>
>> On 04.04.2019 02:42, Christos Zoulas wrote:
>>> Intermediate or not quality counts  It would have been simple
>> enough to write the function once and call it from 13 places, perhaps
>> even less work!
>>>
>>
>> It does. I'm waiting now on releng test results (the service seems to be
>> returning 503) and I will switch to a centralized form.
>>
>> Quality matters so I will also fixup in one go vfork(2) KTR reports in a
>> child. It was handled accordingly only in the MD version for sparc and
>> sparc64 and shall be centralized.
> 
> Thanks! I was oversensitized because I had to gc 13 slightly different MD
> copies of setdisklabel(9).
> 
> christos
> 

Done. I'm still working on adding more test scenarios for fork-related
events. I've just covered basic clone(2) scenarios and undisclosed
another bug in the code sitting since 2012.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr  6 11:54:25 UTC 2019

Added Files:
src/tests/modules/ufetchstore: Makefile

Log Message:
Add missing Makefile.

Grabbed from thorpej's github repository.
XXX not actually built tested...


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/modules/ufetchstore/Makefile

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

Added files:

Index: src/tests/modules/ufetchstore/Makefile
diff -u /dev/null src/tests/modules/ufetchstore/Makefile:1.1
--- /dev/null	Sat Apr  6 11:54:25 2019
+++ src/tests/modules/ufetchstore/Makefile	Sat Apr  6 11:54:25 2019
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2019/04/06 11:54:25 maya Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/modules
+CPPFLAGS+=	-D_KERNTYPES -I${.CURDIR}/module
+
+# Ideally this test could be in the parent Makefile, which could not descend
+# into this directory at all.  Unfortunately, the etc/mtree/NetBSD.dist file
+# creates the 'modules' subdirectory unconditionally, which if left empty
+# will confuse atf-run.  Therefore we must install, at the very least, the
+# Atffile into it.
+TESTS_C=	t_ufetchstore
+
+SUBDIR+=	module
+
+.include 



CVS commit: src/sys

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 11:54:21 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: syscall.c
src/sys/arch/alpha/alpha: syscall.c
src/sys/arch/arm/arm: syscall.c
src/sys/arch/hppa/hppa: trap.c
src/sys/arch/ia64/ia64: syscall.c
src/sys/arch/m68k/m68k: m68k_syscall.c
src/sys/arch/mips/mips: trap.c
src/sys/arch/powerpc/powerpc: syscall.c
src/sys/arch/riscv/riscv: riscv_machdep.c
src/sys/arch/sh3/sh3: vm_machdep.c
src/sys/arch/sparc/sparc: syscall.c
src/sys/arch/sparc64/sparc64: syscall.c
src/sys/arch/usermode/usermode: syscall.c
src/sys/arch/vax/vax: syscall.c
src/sys/arch/x86/x86: syscall.c
src/sys/kern: kern_fork.c
src/sys/sys: proc.h

Log Message:
Centralized shared part of child_return() into MI part

Add a new function md_child_return() for MD specific bits only.

New child_return() is now part of MI and central code that handles
uniformly tracing code (KTR and ptrace(2)).

Synchronize value passed to ktrsysret() among ports to SYS_fork. This is
a traditional value and accessing p_lflag to check for PL_PPWAIT shall
use locking against proc_lock. Returning SYS_fork vs SYS_vfork still isn't
correct enough as there are more entry points to forking code. Instead of
making it too good, just settle with plain SYS_fork for all ports.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/syscall.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/alpha/alpha/syscall.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/arm/arm/syscall.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hppa/hppa/trap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/ia64/syscall.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/m68k/m68k/m68k_syscall.c
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/mips/mips/trap.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/powerpc/powerpc/syscall.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sh3/sh3/vm_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc/sparc/syscall.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc64/sparc64/syscall.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/usermode/usermode/syscall.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/vax/vax/syscall.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/syscall.c
cvs rdiff -u -r1.207 -r1.208 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.351 -r1.352 src/sys/sys/proc.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/aarch64/aarch64/syscall.c
diff -u src/sys/arch/aarch64/aarch64/syscall.c:1.4 src/sys/arch/aarch64/aarch64/syscall.c:1.5
--- src/sys/arch/aarch64/aarch64/syscall.c:1.4	Fri Mar  1 02:40:01 2019
+++ src/sys/arch/aarch64/aarch64/syscall.c	Sat Apr  6 11:54:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.4 2019/03/01 02:40:01 mrg Exp $	*/
+/*	$NetBSD: syscall.c,v 1.5 2019/04/06 11:54:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.4 2019/03/01 02:40:01 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.5 2019/04/06 11:54:19 kamil Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -71,18 +71,14 @@ cpu_spawn_return(struct lwp *l)
 }
 
 void
-child_return(void *arg)
+md_child_return(struct lwp *l)
 {
-	struct lwp * const l = arg;
 	struct trapframe * const tf = l->l_md.md_utf;
 
 	tf->tf_reg[0] = 0;
 	tf->tf_reg[1] = 1;
 	tf->tf_spsr &= ~NZCV_C;
 	l->l_md.md_cpacr = CPACR_FPEN_NONE;
-
-	ktrsysret(SYS_fork, 0, 0);
-	/* Profiling? XXX */
 }
 #endif
 

Index: src/sys/arch/alpha/alpha/syscall.c
diff -u src/sys/arch/alpha/alpha/syscall.c:1.43 src/sys/arch/alpha/alpha/syscall.c:1.44
--- src/sys/arch/alpha/alpha/syscall.c:1.43	Wed Apr  3 08:07:59 2019
+++ src/sys/arch/alpha/alpha/syscall.c	Sat Apr  6 11:54:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.43 2019/04/03 08:07:59 kamil Exp $ */
+/* $NetBSD: syscall.c,v 1.44 2019/04/06 11:54:19 kamil Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.43 2019/04/03 08:07:59 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.44 2019/04/06 11:54:19 kamil Exp $");
 
 #include 
 #include 
@@ -218,28 +218,13 @@ syscall(struct lwp *l, uint64_t code, st
  * Process the tail end of a fork() for the child.
  */
 void
-child_return(void *arg)
+md_child_return(struct lwp *l)
 {
-	struct lwp * const l = arg;
-	struct proc *p = l->l_proc;
-
-	if (p->p_slflag & PSL_TRACED) {
-		mutex_enter(p->p_lock);
-		p->p_xsig = SIGTRAP;
-		p->p_sigctx.ps_faked = true; // XXX
-		p->p_sigctx.ps_info._signo = p->p_xsig;
-		p->p_sigctx.ps_info._code = TRAP_CHLD;
-		sigswitch(0, SIGTRAP, true);
-		// XXX 

CVS commit: src/tests/modules/ufetchstore

2019-04-06 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr  6 11:54:25 UTC 2019

Added Files:
src/tests/modules/ufetchstore: Makefile

Log Message:
Add missing Makefile.

Grabbed from thorpej's github repository.
XXX not actually built tested...


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/modules/ufetchstore/Makefile

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



CVS commit: src/sys

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 11:54:21 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: syscall.c
src/sys/arch/alpha/alpha: syscall.c
src/sys/arch/arm/arm: syscall.c
src/sys/arch/hppa/hppa: trap.c
src/sys/arch/ia64/ia64: syscall.c
src/sys/arch/m68k/m68k: m68k_syscall.c
src/sys/arch/mips/mips: trap.c
src/sys/arch/powerpc/powerpc: syscall.c
src/sys/arch/riscv/riscv: riscv_machdep.c
src/sys/arch/sh3/sh3: vm_machdep.c
src/sys/arch/sparc/sparc: syscall.c
src/sys/arch/sparc64/sparc64: syscall.c
src/sys/arch/usermode/usermode: syscall.c
src/sys/arch/vax/vax: syscall.c
src/sys/arch/x86/x86: syscall.c
src/sys/kern: kern_fork.c
src/sys/sys: proc.h

Log Message:
Centralized shared part of child_return() into MI part

Add a new function md_child_return() for MD specific bits only.

New child_return() is now part of MI and central code that handles
uniformly tracing code (KTR and ptrace(2)).

Synchronize value passed to ktrsysret() among ports to SYS_fork. This is
a traditional value and accessing p_lflag to check for PL_PPWAIT shall
use locking against proc_lock. Returning SYS_fork vs SYS_vfork still isn't
correct enough as there are more entry points to forking code. Instead of
making it too good, just settle with plain SYS_fork for all ports.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/syscall.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/alpha/alpha/syscall.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/arm/arm/syscall.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hppa/hppa/trap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/ia64/syscall.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/m68k/m68k/m68k_syscall.c
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/mips/mips/trap.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/powerpc/powerpc/syscall.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sh3/sh3/vm_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc/sparc/syscall.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc64/sparc64/syscall.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/usermode/usermode/syscall.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/vax/vax/syscall.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/syscall.c
cvs rdiff -u -r1.207 -r1.208 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.351 -r1.352 src/sys/sys/proc.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/nvmm/x86

2019-04-06 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Apr  6 11:49:53 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c nvmm_x86.h nvmm_x86_svm.c
nvmm_x86_vmx.c

Log Message:
Replace the misc[] state by a new compressed nvmm_x64_state_intr structure,
which describes the interruptibility state of the guest.

Add evt_pending, read-only, that allows the virtualizer to know if an event
is pending.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

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

Modified files:

Index: src/sys/dev/nvmm/x86/nvmm_x86.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86.c:1.5 src/sys/dev/nvmm/x86/nvmm_x86.c:1.6
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.5	Wed Apr  3 19:10:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Sat Apr  6 11:49:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.5 2019/04/03 19:10:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.6 2019/04/06 11:49:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.5 2019/04/03 19:10:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.6 2019/04/06 11:49:53 maxv Exp $");
 
 #include 
 #include 
@@ -213,10 +213,11 @@ const struct nvmm_x64_state nvmm_x86_res
 		[NVMM_X64_MSR_TSC] = 0,
 	},
 
-	.misc = {
-		[NVMM_X64_MISC_INT_SHADOW] = 0,
-		[NVMM_X64_MISC_INT_WINDOW_EXIT] = 0,
-		[NVMM_X64_MISC_NMI_WINDOW_EXIT] = 0,
+	.intr = {
+		.int_shadow = 0,
+		.int_window_exiting = 0,
+		.nmi_window_exiting = 0,
+		.evt_pending = 0,
 	},
 
 	.fpu = {

Index: src/sys/dev/nvmm/x86/nvmm_x86.h
diff -u src/sys/dev/nvmm/x86/nvmm_x86.h:1.10 src/sys/dev/nvmm/x86/nvmm_x86.h:1.11
--- src/sys/dev/nvmm/x86/nvmm_x86.h:1.10	Wed Apr  3 19:10:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.h	Sat Apr  6 11:49:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.h,v 1.10 2019/04/03 19:10:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.h,v 1.11 2019/04/06 11:49:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -98,12 +98,6 @@
 #define NVMM_X64_MSR_TSC		10
 #define NVMM_X64_NMSR			11
 
-/* Misc. */
-#define NVMM_X64_MISC_INT_SHADOW	0
-#define NVMM_X64_MISC_INT_WINDOW_EXIT	1
-#define NVMM_X64_MISC_NMI_WINDOW_EXIT	2
-#define NVMM_X64_NMISC			3
-
 #ifndef ASM_NVMM
 
 #include 
@@ -126,12 +120,21 @@ struct nvmm_x64_state_seg {
 	uint64_t base;		/* hidden */
 };
 
+struct nvmm_x64_state_intr {
+	uint64_t int_shadow:1;
+	uint64_t int_window_exiting:1;
+	uint64_t nmi_window_exiting:1;
+	uint64_t evt_pending:1;
+	uint64_t rsvd:60;
+};
+
 /* VM exit state indexes. */
 #define NVMM_X64_EXITSTATE_CR8			0
 #define NVMM_X64_EXITSTATE_RFLAGS		1
 #define NVMM_X64_EXITSTATE_INT_SHADOW		2
 #define NVMM_X64_EXITSTATE_INT_WINDOW_EXIT	3
 #define NVMM_X64_EXITSTATE_NMI_WINDOW_EXIT	4
+#define NVMM_X64_EXITSTATE_EVT_PENDING		5
 
 /* Flags. */
 #define NVMM_X64_STATE_SEGS	0x01
@@ -139,11 +142,11 @@ struct nvmm_x64_state_seg {
 #define NVMM_X64_STATE_CRS	0x04
 #define NVMM_X64_STATE_DRS	0x08
 #define NVMM_X64_STATE_MSRS	0x10
-#define NVMM_X64_STATE_MISC	0x20
+#define NVMM_X64_STATE_INTR	0x20
 #define NVMM_X64_STATE_FPU	0x40
 #define NVMM_X64_STATE_ALL	\
 	(NVMM_X64_STATE_SEGS | NVMM_X64_STATE_GPRS | NVMM_X64_STATE_CRS | \
-	 NVMM_X64_STATE_DRS | NVMM_X64_STATE_MSRS | NVMM_X64_STATE_MISC | \
+	 NVMM_X64_STATE_DRS | NVMM_X64_STATE_MSRS | NVMM_X64_STATE_INTR | \
 	 NVMM_X64_STATE_FPU)
 
 struct nvmm_x64_state {
@@ -152,7 +155,7 @@ struct nvmm_x64_state {
 	uint64_t crs[NVMM_X64_NCR];
 	uint64_t drs[NVMM_X64_NDR];
 	uint64_t msrs[NVMM_X64_NMSR];
-	uint64_t misc[NVMM_X64_NMISC];
+	struct nvmm_x64_state_intr intr;
 	struct fxsave fpu;
 };
 

Index: src/sys/dev/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.36 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.37
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.36	Wed Apr  3 17:32:58 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Sat Apr  6 11:49:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.36 2019/04/03 17:32:58 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.37 2019/04/06 11:49:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.36 2019/04/03 17:32:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.37 2019/04/06 11:49:53 maxv Exp $");
 
 #include 
 #include 
@@ -531,9 +531,10 @@ struct svm_cpudata {
 	bool ts_set;
 	struct xsave_header hfpu __aligned(64);
 
-	/* Event state */
+	/* Intr state */
 	bool int_window_exit;
 	bool nmi_window_exit;
+	bool evt_pending;
 
 	/* Guest state */
 	uint64_t gxcr0;
@@ -709,6 +710,8 @@ svm_vcpu_inject(struct nvmm_machine *mac
 	__SHIFTIN(1, 

CVS commit: src/sys/dev/nvmm/x86

2019-04-06 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Apr  6 11:49:53 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c nvmm_x86.h nvmm_x86_svm.c
nvmm_x86_vmx.c

Log Message:
Replace the misc[] state by a new compressed nvmm_x64_state_intr structure,
which describes the interruptibility state of the guest.

Add evt_pending, read-only, that allows the virtualizer to know if an event
is pending.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/nvmm/x86/nvmm_x86.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c

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



CVS commit: src/external/bsd/pkg_install/sbin/pkg_create

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Apr  6 10:37:57 UTC 2019

Modified Files:
src/external/bsd/pkg_install/sbin/pkg_create: Makefile

Log Message:
revert previkous it isn't needed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/pkg_install/sbin/pkg_create/Makefile

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

Modified files:

Index: src/external/bsd/pkg_install/sbin/pkg_create/Makefile
diff -u src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.3 src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.4
--- src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.3	Sat Apr  6 10:29:13 2019
+++ src/external/bsd/pkg_install/sbin/pkg_create/Makefile	Sat Apr  6 10:37:57 2019
@@ -1,11 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2019/04/06 10:29:13 pgoyette Exp $
+# $NetBSD: Makefile,v 1.4 2019/04/06 10:37:57 pgoyette Exp $
 # Original from FreeBSD, no rcs id.
 
 PROG= pkg_create
 SRCS= main.c perform.c pl.c util.c build.c
 
-COPTS.main.c+=	-Wno-error=implicit-fallthrough
-
 .include 
 
 .PATH:	${DIST}/create



CVS commit: src/external/bsd/pkg_install/sbin/pkg_create

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Apr  6 10:37:57 UTC 2019

Modified Files:
src/external/bsd/pkg_install/sbin/pkg_create: Makefile

Log Message:
revert previkous it isn't needed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/pkg_install/sbin/pkg_create/Makefile

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



Re: CVS commit: src/external/bsd/pkg_install/dist/create

2019-04-06 Thread Robert Elz
Date:Sat, 6 Apr 2019 08:29:02 +
From:"Robert Elz" 
Message-ID:  <20190406082902.1da38f...@cvs.netbsd.org>

  | Module Name:src
  | Committed By:   kre
  | Date:   Sat Apr  6 08:29:02 UTC 2019
  |
  | Modified Files:
  | src/external/bsd/pkg_install/dist/create: util.c
  |
  | Log Message:
  | Use __UNCONST() rather than a simple cast to free a const char *
  | while avoiding gcc noise.

Note that a better fix for this would probably be to remove the
const from the fields in the struct definition (in create.h)

As far as I can see, nothing needs (even conceptually) that they
be there - the data is always assigned as

ptr->owner = xstrdup(whatever);

where xstrdup() is just strdup() + error check, and strdup() is
the canonical way to correctly (if slowly) convert a const char *
into a char * ... making it be const char * again just seems wrong.

However, I will leave it for someone else to determine if that
really is a preferred solution.

kre



CVS commit: src/external/bsd/pkg_install/sbin/pkg_create

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Apr  6 10:29:13 UTC 2019

Modified Files:
src/external/bsd/pkg_install/sbin/pkg_create: Makefile

Log Message:
Treat implicit-fallthrough only as a warning


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/pkg_install/sbin/pkg_create/Makefile

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

Modified files:

Index: src/external/bsd/pkg_install/sbin/pkg_create/Makefile
diff -u src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.2 src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.3
--- src/external/bsd/pkg_install/sbin/pkg_create/Makefile:1.2	Mon Feb  2 20:47:21 2009
+++ src/external/bsd/pkg_install/sbin/pkg_create/Makefile	Sat Apr  6 10:29:13 2019
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2009/02/02 20:47:21 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2019/04/06 10:29:13 pgoyette Exp $
 # Original from FreeBSD, no rcs id.
 
 PROG= pkg_create
 SRCS= main.c perform.c pl.c util.c build.c
 
+COPTS.main.c+=	-Wno-error=implicit-fallthrough
+
 .include 
 
 .PATH:	${DIST}/create



CVS commit: src/external/bsd/pkg_install/sbin/pkg_create

2019-04-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Apr  6 10:29:13 UTC 2019

Modified Files:
src/external/bsd/pkg_install/sbin/pkg_create: Makefile

Log Message:
Treat implicit-fallthrough only as a warning


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/pkg_install/sbin/pkg_create/Makefile

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



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-04-06 Thread Maya Rashish
Module Name:xsrc
Committed By:   maya
Date:   Sat Apr  6 10:00:13 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_math.h

Log Message:
Use a name for the largest representable float

Actually intended to appease vax which has a floating point format
that doesn't match the same range as IEEE754 float.

(why not exp2f?)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 xsrc/external/mit/MesaLib/dist/src/util/u_math.h

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

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/util/u_math.h
diff -u xsrc/external/mit/MesaLib/dist/src/util/u_math.h:1.1.1.1 xsrc/external/mit/MesaLib/dist/src/util/u_math.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/util/u_math.h:1.1.1.1	Sun Mar 10 03:42:34 2019
+++ xsrc/external/mit/MesaLib/dist/src/util/u_math.h	Sat Apr  6 10:00:13 2019
@@ -117,7 +117,7 @@ util_fast_exp2(float x)
union fi epart;
 
if(x > 129.0f)
-  return 3.402823466e+38f;
+  return FLT_MAX;
 
if (x < -126.9f)
   return 0.0f;



CVS commit: xsrc/external/mit/MesaLib/dist/src/util

2019-04-06 Thread Maya Rashish
Module Name:xsrc
Committed By:   maya
Date:   Sat Apr  6 10:00:13 UTC 2019

Modified Files:
xsrc/external/mit/MesaLib/dist/src/util: u_math.h

Log Message:
Use a name for the largest representable float

Actually intended to appease vax which has a floating point format
that doesn't match the same range as IEEE754 float.

(why not exp2f?)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 xsrc/external/mit/MesaLib/dist/src/util/u_math.h

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



Re: CVS commit: src

2019-04-06 Thread Kamil Rytarowski
On 06.04.2019 05:06, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date: Sat Apr  6 03:06:29 UTC 2019
> 
> Modified Files:
>   src/distrib/sets/lists/comp: mi
>   src/distrib/sets/lists/tests: module.mi
>   src/share/man/man9: Makefile ipi.9 ucas.9
>   src/sys/arch/aarch64/aarch64: TODO fault.c fusu.S trap.c
>   src/sys/arch/aarch64/include: machdep.h
>   src/sys/arch/alpha/alpha: genassym.cf locore.s trap.c
>   src/sys/arch/alpha/include: alpha.h pcb.h types.h
>   src/sys/arch/amd64/amd64: copy.S trap.c
>   src/sys/arch/amd64/include: types.h
>   src/sys/arch/amiga/amiga: trap.c
>   src/sys/arch/arm/arm: arm_machdep.c fusu.S lock_cas.S undefined.c
>   src/sys/arch/arm/arm32: fault.c
>   src/sys/arch/arm/include: locore.h types.h
>   src/sys/arch/atari/atari: trap.c
>   src/sys/arch/cesfic/cesfic: machdep.c trap.c
>   src/sys/arch/hp300/hp300: trap.c
>   src/sys/arch/hppa/hppa: copy.S machdep.c trap.c
>   src/sys/arch/i386/i386: copy.S trap.c
>   src/sys/arch/i386/include: types.h
>   src/sys/arch/ia64/ia64: machdep.c support.S
>   src/sys/arch/luna68k/luna68k: trap.c
>   src/sys/arch/luna68k/stand/boot: machdep.c
>   src/sys/arch/m68k/fpe: fpu_calcea.c fpu_emulate.c
>   src/sys/arch/m68k/include: m68k.h
>   src/sys/arch/m68k/m68k: compat_16_machdep.c copy.s m68k_machdep.c
>   m68k_syscall.c m68k_trap.c regdump.c sunos_syscall.c
>   src/sys/arch/mac68k/mac68k: trap.c
>   src/sys/arch/mips/include: locore.h types.h
>   src/sys/arch/mips/mips: bds_emul.S copy.S db_disasm.c db_interface.c
>   fp.S lock_stubs_llsc.S lock_stubs_ras.S mips_emul.c mips_fixup.c
>   trap.c
>   src/sys/arch/mvme68k/mvme68k: trap.c
>   src/sys/arch/news68k/news68k: trap.c
>   src/sys/arch/next68k/next68k: trap.c
>   src/sys/arch/powerpc/conf: files.powerpc
>   src/sys/arch/powerpc/include: types.h
>   src/sys/arch/powerpc/powerpc: locore_subr.S trap.c
>   src/sys/arch/riscv/riscv: trap.c
>   src/sys/arch/sh3/include: pcb.h
>   src/sys/arch/sh3/sh3: db_disasm.c exception.c genassym.cf locore_subr.S
>   sh3_machdep.c syscall.c vm_machdep.c
>   src/sys/arch/sparc/sparc: compat_16_machdep.c db_trace.c locore.s
>   machdep.c sunos_machdep.c trap.c
>   src/sys/arch/sparc64/include: types.h
>   src/sys/arch/sparc64/sparc64: copy.S
>   src/sys/arch/sun2/sun2: trap.c
>   src/sys/arch/sun3/sun3: trap.c
>   src/sys/arch/usermode/include: types.h
>   src/sys/arch/usermode/usermode: copy.c
>   src/sys/arch/vax/vax: subr.S
>   src/sys/arch/x68k/x68k: trap.c
>   src/sys/compat/freebsd: freebsd_syscall.c
>   src/sys/compat/linux/arch/alpha: linux_osf1.c
>   src/sys/external/bsd/drm/dist/bsd-core: drmP.h
>   src/sys/kern: subr_copy.c subr_prof.c
>   src/sys/rump/librump/rumpkern: rumpcopy.c
>   src/sys/sys: param.h systm.h
>   src/sys/uvm: uvm_mmap.c
>   src/tests/modules: Makefile
> Added Files:
>   src/share/man/man9: ufetch.9 ustore.9
>   src/tests/modules/ufetchstore: Makefile.inc t_ufetchstore.c
>   src/tests/modules/ufetchstore/module: Makefile common.h
>   ufetchstore_tester.c
> Removed Files:
>   src/share/man/man9: fetch.9 store.9
>   src/sys/arch/powerpc/powerpc: fubyte.c fuswintr.c subyte.c suswintr.c
>   suword.c
> 
> Log Message:
> Overhaul the API used to fetch and store individual memory cells in
> userspace.  The old fetch(9) and store(9) APIs (fubyte(), fuword(),
> subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
> and ustore(9) APIs that can return proper error codes, etc. and are
> implemented consistently across all platforms.  The interrupt-safe
> variants are no longer supported (and several of the existing attempts
> at fuswintr(), etc. were buggy and not actually interrupt-safe).
> 
> Also augmement the ucas(9) API, making it consistently available on
> all plaforms, supporting uniprocessor and multiprocessor systems, even
> those that do not have CAS or LL/SC primitives.
> 
> Welcome to NetBSD 8.99.37.
> 
> 

Thanks for this work!

This commit contains unintended changes.

I've reverted llvmcmd part in the distrib files.

It removed also my recent changes to child_return() code. I will work on
this on my side now.

Please double check if there is anything else unintended.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/distrib/sets/lists/comp

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 09:33:07 UTC 2019

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

Log Message:
Revert llvm -> llvmcmds unintended changes in distrib files


To generate a diff of this commit:
cvs rdiff -u -r1.2266 -r1.2267 src/distrib/sets/lists/comp/mi

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



CVS commit: src/distrib/sets/lists/comp

2019-04-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr  6 09:33:07 UTC 2019

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

Log Message:
Revert llvm -> llvmcmds unintended changes in distrib files


To generate a diff of this commit:
cvs rdiff -u -r1.2266 -r1.2267 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2266 src/distrib/sets/lists/comp/mi:1.2267
--- src/distrib/sets/lists/comp/mi:1.2266	Sat Apr  6 03:06:23 2019
+++ src/distrib/sets/lists/comp/mi	Sat Apr  6 09:33:07 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2266 2019/04/06 03:06:23 thorpej Exp $
+#	$NetBSD: mi,v 1.2267 2019/04/06 09:33:07 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -13,10 +13,10 @@
 ./usr/bin/c89	comp-c-bin
 ./usr/bin/c99	comp-c-bin
 ./usr/bin/cc	comp-c-bin		gcccmds
-./usr/bin/clang	comp-c-bin		llvmcmds
-./usr/bin/clang++comp-c-bin		llvmcmds
-./usr/bin/clang-cppcomp-c-bin		llvmcmds
-./usr/bin/clang-tblgencomp-c-bin		llvmcmds
+./usr/bin/clang	comp-c-bin		llvm
+./usr/bin/clang++comp-c-bin		llvm
+./usr/bin/clang-cppcomp-c-bin		llvm
+./usr/bin/clang-tblgencomp-c-bin		llvm
 ./usr/bin/configcomp-util-bin
 ./usr/bin/crunchgencomp-c-bin
 ./usr/bin/crunchidecomp-c-bin
@@ -364,7 +364,7 @@
 ./usr/include/clang-4.0/stdatomic.h		comp-obsolete		obsolete
 ./usr/include/clang-4.0/stdnoreturn.h		comp-obsolete		obsolete
 ./usr/include/clang-5.0/stdatomic.h		comp-obsolete		obsolete
-./usr/include/clang-7.0/stdatomic.h		comp-c-include		llvmcmds
+./usr/include/clang-7.0/stdatomic.h		comp-c-include		llvm
 ./usr/include/complex.hcomp-c-include
 ./usr/include/cpio.hcomp-c-include
 ./usr/include/crypto/cryptodev.h		comp-c-include



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

2019-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 08:48:53 UTC 2019

Modified Files:
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Install the undefined instruction handlers only once, i.e. when attaching
on the BP.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/arm/vfp/vfp_init.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/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.61 src/sys/arch/arm/vfp/vfp_init.c:1.62
--- src/sys/arch/arm/vfp/vfp_init.c:1.61	Sun Mar 17 08:41:42 2019
+++ src/sys/arch/arm/vfp/vfp_init.c	Sat Apr  6 08:48:53 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.61 2019/03/17 08:41:42 skrll Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.62 2019/04/06 08:48:53 skrll Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -32,7 +32,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.61 2019/03/17 08:41:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.62 2019/04/06 08:48:53 skrll Exp $");
 
 #include 
 #include 
@@ -260,7 +260,8 @@ vfp_attach(struct cpu_info *ci)
 		if ((nsacr & nsacr_vfp) != nsacr_vfp) {
 			aprint_normal_dev(ci->ci_dev,
 			"VFP access denied (NSACR=%#x)\n", nsacr);
-			install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+			if (CPU_IS_PRIMARY(ci))
+install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
 			ci->ci_vfp_id = 0;
 			evcnt_attach_dynamic(>ci_vfp_evs[0],
 			EVCNT_TYPE_TRAP, NULL, ci->ci_cpuname,
@@ -290,7 +291,8 @@ vfp_attach(struct cpu_info *ci)
 		if (!vfp_p) {
 			aprint_normal_dev(ci->ci_dev,
 			"VFP access denied (CPACR=%#x)\n", cpacr);
-			install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+			if (CPU_IS_PRIMARY(ci))
+install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
 			ci->ci_vfp_id = 0;
 			evcnt_attach_dynamic(>ci_vfp_evs[0],
 			EVCNT_TYPE_TRAP, NULL, ci->ci_cpuname,
@@ -309,7 +311,8 @@ vfp_attach(struct cpu_info *ci)
 
 	if (undefined_test != 0) {
 		aprint_normal_dev(ci->ci_dev, "No VFP detected\n");
-		install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+		if (CPU_IS_PRIMARY(ci))
+			install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
 		ci->ci_vfp_id = 0;
 		return;
 	}
@@ -343,7 +346,8 @@ vfp_attach(struct cpu_info *ci)
 	default:
 		aprint_normal_dev(ci->ci_dev, "unrecognized VFP version %#x\n",
 		fpsid);
-		install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
+		if (CPU_IS_PRIMARY(ci))
+			install_coproc_handler(VFP_COPROC, vfp_fpscr_handler);
 		vfp_fpscr_changable = VFP_FPSCR_CSUM|VFP_FPSCR_ESUM
 		|VFP_FPSCR_RMODE;
 		vfp_fpscr_default = 0;
@@ -391,12 +395,14 @@ vfp_attach(struct cpu_info *ci)
 	ci->ci_cpuname, "vfp coproc re-use");
 	evcnt_attach_dynamic(>ci_vfp_evs[2], EVCNT_TYPE_TRAP, NULL,
 	ci->ci_cpuname, "vfp coproc fault");
-	install_coproc_handler(VFP_COPROC, vfp_handler);
-	install_coproc_handler(VFP_COPROC2, vfp_handler);
+	if (CPU_IS_PRIMARY(ci)) {
+		install_coproc_handler(VFP_COPROC, vfp_handler);
+		install_coproc_handler(VFP_COPROC2, vfp_handler);
 #ifdef CPU_CORTEX
-	if (cpu_neon_present)
-		install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
+		if (cpu_neon_present)
+			install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
 #endif
+	}
 }
 
 /* The real handler for VFP bounces.  */



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

2019-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 08:48:53 UTC 2019

Modified Files:
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Install the undefined instruction handlers only once, i.e. when attaching
on the BP.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/arm/vfp/vfp_init.c

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



CVS commit: src/sys/net

2019-04-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Apr  6 08:38:23 UTC 2019

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

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/slcompress.c

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

Modified files:

Index: src/sys/net/slcompress.c
diff -u src/sys/net/slcompress.c:1.40 src/sys/net/slcompress.c:1.41
--- src/sys/net/slcompress.c:1.40	Fri Aug  5 08:56:36 2016
+++ src/sys/net/slcompress.c	Sat Apr  6 08:38:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $   */
+/*	$NetBSD: slcompress.c,v 1.41 2019/04/06 08:38:23 msaitoh Exp $   */
 /*	Id: slcompress.c,v 1.3 1996/05/24 07:04:47 paulus Exp 	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.41 2019/04/06 08:38:23 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -118,9 +118,9 @@ sl_compress_setup(struct slcompress *com
 }
 
 
-/* ENCODE encodes a number that is known to be non-zero.  ENCODEZ
- * checks for zero (since zero has to be encoded in the long, 3 byte
- * form).
+/*
+ * ENCODE encodes a number that is known to be non-zero.  ENCODEZ checks for
+ * zero (since zero has to be encoded in the long, 3 byte form).
  */
 #define ENCODE(n) { \
 	if ((uint16_t)(n) >= 256) { \
@@ -190,11 +190,11 @@ sl_compress_tcp(struct mbuf *m, struct i
 	 * packet is IP proto TCP).
 	 */
 	if ((ip->ip_off & htons(0x3fff)) || m->m_len < 40)
-		return (TYPE_IP);
+		return TYPE_IP;
 
 	th = (struct tcphdr *)&((int32_t *)ip)[hlen];
 	if ((th->th_flags & (TH_SYN|TH_FIN|TH_RST|TH_ACK)) != TH_ACK)
-		return (TYPE_IP);
+		return TYPE_IP;
 	/*
 	 * Packet is compressible -- we're going to send either a
 	 * COMPRESSED_TCP or UNCOMPRESSED_TCP packet.  Either way we need
@@ -209,13 +209,12 @@ sl_compress_tcp(struct mbuf *m, struct i
 		/*
 		 * Wasn't the first -- search for it.
 		 *
-		 * States are kept in a circularly linked list with
-		 * last_cs pointing to the end of the list.  The
-		 * list is kept in lru order by moving a state to the
-		 * head of the list whenever it is referenced.  Since
-		 * the list is short and, empirically, the connection
-		 * we want is almost always near the front, we locate
-		 * states via linear search.  If we don't find a state
+		 * States are kept in a circularly linked list with last_cs
+		 * pointing to the end of the list.  The list is kept in lru
+		 * order by moving a state to the head of the list whenever it
+		 * is referenced.  Since the list is short and, empirically,
+		 * the connection we want is almost always near the front, we
+		 * locate states via linear search.  If we don't find a state
 		 * for the datagram, the oldest state is (re-)used.
 		 */
 		struct cstate *lcs;
@@ -244,13 +243,11 @@ sl_compress_tcp(struct mbuf *m, struct i
 		hlen += th->th_off;
 		hlen <<= 2;
 		if (hlen > m->m_len)
-			return (TYPE_IP);
+			return TYPE_IP;
 		goto uncompressed;
 
 	found:
-		/*
-		 * Found it -- move to the front on the connection list.
-		 */
+		/* Found it -- move to the front on the connection list. */
 		if (cs == lastcs)
 			comp->last_cs = lcs;
 		else {
@@ -276,7 +273,7 @@ sl_compress_tcp(struct mbuf *m, struct i
 	hlen += th->th_off;
 	hlen <<= 2;
 	if (hlen > m->m_len)
-		return (TYPE_IP);
+		return TYPE_IP;
 
 	if (((uint16_t *)ip)[0] != ((uint16_t *)>cs_ip)[0] ||
 	((uint16_t *)ip)[3] != ((uint16_t *)>cs_ip)[3] ||
@@ -289,20 +286,20 @@ sl_compress_tcp(struct mbuf *m, struct i
 		goto uncompressed;
 
 	/*
-	 * Figure out which of the changing fields changed.  The
-	 * receiver expects changes in the order: urgent, window,
-	 * ack, seq (the order minimizes the number of temporaries
-	 * needed in this section of code).
+	 * Figure out which of the changing fields changed.  The receiver
+	 * expects changes in the order: urgent, window, ack, seq (the order
+	 * minimizes the number of temporaries needed in this section of code).
 	 */
 	if (th->th_flags & TH_URG) {
 		deltaS = ntohs(th->th_urp);
 		ENCODEZ(deltaS);
 		changes |= NEW_U;
 	} else if (th->th_urp != oth->th_urp)
-		/* argh! URG not set but urp changed -- a sensible
-		 * implementation should never do this but RFC793
-		 * doesn't prohibit the change so we have to deal
-		 * with it. */
+		/*
+		 * argh! URG not set but urp changed -- a sensible
+		 * implementation should never do this but RFC793 doesn't
+		 * prohibit the change so we have to deal with it.
+		 */
 		 goto uncompressed;
 
 	deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win));
@@ -328,7 +325,6 @@ sl_compress_tcp(struct mbuf *m, struct i
 	}
 
 	switch (changes) {
-
 	case 0:
 		/*
 		 * Nothing changed. If this packet contains data and the
@@ -342,7 +338,7 @@ sl_compress_tcp(struct mbuf *m, struct i
 		   

CVS commit: src/sys/net

2019-04-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Apr  6 08:38:23 UTC 2019

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

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/slcompress.c

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



CVS commit: src/external/bsd/pkg_install/dist/create

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 08:29:02 UTC 2019

Modified Files:
src/external/bsd/pkg_install/dist/create: util.c

Log Message:
Use __UNCONST() rather than a simple cast to free a const char *
while avoiding gcc noise.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/pkg_install/dist/create/util.c

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

Modified files:

Index: src/external/bsd/pkg_install/dist/create/util.c
diff -u src/external/bsd/pkg_install/dist/create/util.c:1.1.1.4 src/external/bsd/pkg_install/dist/create/util.c:1.2
--- src/external/bsd/pkg_install/dist/create/util.c:1.1.1.4	Fri Apr  5 23:41:58 2019
+++ src/external/bsd/pkg_install/dist/create/util.c	Sat Apr  6 08:29:01 2019
@@ -147,8 +147,8 @@ void
 free_memory_file(struct memory_file *file)
 {
 	if (file != NULL) {
-		free((char *)file->owner);
-		free((char *)file->group);
+		free(__UNCONST(file->owner));
+		free(__UNCONST(file->group));
 		free(file->data);
 		free(file);
 	}



CVS commit: src/external/bsd/pkg_install/dist/create

2019-04-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr  6 08:29:02 UTC 2019

Modified Files:
src/external/bsd/pkg_install/dist/create: util.c

Log Message:
Use __UNCONST() rather than a simple cast to free a const char *
while avoiding gcc noise.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/pkg_install/dist/create/util.c

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



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:57:04 UTC 2019

Modified Files:
src/share/man/man9: ipi.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ipi.9

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

Modified files:

Index: src/share/man/man9/ipi.9
diff -u src/share/man/man9/ipi.9:1.3 src/share/man/man9/ipi.9:1.4
--- src/share/man/man9/ipi.9:1.3	Sat Apr  6 03:06:24 2019
+++ src/share/man/man9/ipi.9	Sat Apr  6 07:57:04 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: ipi.9,v 1.3 2019/04/06 03:06:24 thorpej Exp $
+.\" $NetBSD: ipi.9,v 1.4 2019/04/06 07:57:04 wiz Exp $
 .\"
 .\" Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -145,7 +145,6 @@ The
 member specifies a function to invoke and
 .Ar arg
 is the argument to be passed to the function.
-.Pp
 .Bl -tag -width compact
 .It Fn ipi_unicast "msg" "ci"
 Send an IPI to a remote CPU specified by



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:57:04 UTC 2019

Modified Files:
src/share/man/man9: ipi.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ipi.9

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



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:56:49 UTC 2019

Modified Files:
src/share/man/man9: ucas.9

Log Message:
Sort sections. Fix typo. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ucas.9

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

Modified files:

Index: src/share/man/man9/ucas.9
diff -u src/share/man/man9/ucas.9:1.3 src/share/man/man9/ucas.9:1.4
--- src/share/man/man9/ucas.9:1.3	Sat Apr  6 03:06:24 2019
+++ src/share/man/man9/ucas.9	Sat Apr  6 07:56:49 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucas.9,v 1.3 2019/04/06 03:06:24 thorpej Exp $
+.\"	$NetBSD: ucas.9,v 1.4 2019/04/06 07:56:49 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Jason R. Thorpe.
 .\" Copyright (c) 2011 YAMAMOTO Takashi,
@@ -52,7 +52,6 @@ user-space address.
 Except that they can be safely used for the kernel to access user-space
 address, they are semantically equivalents of
 .Xr atomic_cas 3 .
-.Pp
 .Bl -tag -width uptr
 .It Fa uptr
 The pointer to the variable.
@@ -65,16 +64,6 @@ The value to store to the variable.
 The pointer to the memory to store the old value of the variable.
 .El
 .\" 
-.Sh RETURN VALUES
-On success, these functions return 0.
-In that case, the caller can consult the value returned via
-.Fa retp
-to check the result of the CAS operation.
-Otherwise, these functions return an appropriate
-.Xr errno 9
-error code, typically
-.Dv EFAULT .
-.\" 
 .Sh IMPLEMENTATION NOTES
 The
 .Nm ucas
@@ -87,7 +76,6 @@ primitives have the following signatures
 the implementation and are not to be called by consumers of the
 .Nm ucas
 API:
-.Pp
 .Bl -tag -width _ucas_32
 .It Ft int Fn _ucas_32 \
 "volatile uint32_t *uptr" "uint32_t old" "uint32_t new" "uint32_t *retp" ;
@@ -139,7 +127,7 @@ operations
 and the multiprocessor implementation synchronizes with other CPUs using
 interprocessor interrupts.
 .Pp
-If a particular platform wishes ro use the generic implementation on
+If a particular platform wishes to use the generic implementation on
 uniprocessors but an optimized implementation on multiprocessors, the
 the platform should define
 .Dv __HAVE_UCAS_MP
@@ -155,6 +143,16 @@ if an
 platform
 .Pc .
 .\" 
+.Sh RETURN VALUES
+On success, these functions return 0.
+In that case, the caller can consult the value returned via
+.Fa retp
+to check the result of the CAS operation.
+Otherwise, these functions return an appropriate
+.Xr errno 9
+error code, typically
+.Dv EFAULT .
+.\" 
 .Sh SEE ALSO
 .Xr atomic_cas 3 ,
 .Xr intro 9



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:56:49 UTC 2019

Modified Files:
src/share/man/man9: ucas.9

Log Message:
Sort sections. Fix typo. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ucas.9

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



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:56:19 UTC 2019

Modified Files:
src/share/man/man9: ustore.9

Log Message:
Fix short description.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/ustore.9

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



CVS commit: src/share/man/man9

2019-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  6 07:56:19 UTC 2019

Modified Files:
src/share/man/man9: ustore.9

Log Message:
Fix short description.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/ustore.9

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

Modified files:

Index: src/share/man/man9/ustore.9
diff -u src/share/man/man9/ustore.9:1.1 src/share/man/man9/ustore.9:1.2
--- src/share/man/man9/ustore.9:1.1	Sat Apr  6 03:06:24 2019
+++ src/share/man/man9/ustore.9	Sat Apr  6 07:56:19 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ustore.9,v 1.1 2019/04/06 03:06:24 thorpej Exp $
+.\"	$NetBSD: ustore.9,v 1.2 2019/04/06 07:56:19 wiz Exp $
 .\"
 .\" Copyright (c) 2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,7 +41,7 @@
 .Nm ustore_int ,
 .Nm ustore_long ,
 .Nm ustore_ptr
-.Nd fetch data from user-space
+.Nd store data in user-space
 .Sh SYNOPSIS
 .In sys/systm.h
 .Ft int