CVS commit: src/etc/rc.d

2018-05-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat May 26 00:17:54 UTC 2018

Modified Files:
src/etc/rc.d: sshd

Log Message:
Silence ssh-keygen output when host keys are generated. Instead, print only
key fingerprints. This replaces dozens of lines out ASCII art output with
something more reasonable:

armv7# service sshd start
ssh-keygen: 1024 SHA256:ynP4BQ2B0Fknnf9PfF4QoUDlYi0+7rNfYXTOYP2cDic root@armv7 
(DSA)
ssh-keygen: 521 SHA256:Eoj382aaJNlSxuq/aYj3AXgxfMJAkyVPoCQd2BNjJiA root@armv7 
(ECDSA)
ssh-keygen: 256 SHA256:+e9/qTbbN/g6xvkadtHsmIQ+Pc0afZRxbXJsk2HKIzY root@armv7 
(ED25519)
ssh-keygen: 2048 SHA256:urNaF/m6oiCe5hXFZBxGLW2PvLz0ibtRFrqYw6R+qTw root@armv7 
(RSA)
ssh-keygen: 256 SHA256:Su2Nal2W3vrFz8ukpcSXngl1/bu6xUm1nSvbxTHe9Js root@armv7 
(XMSS)
Starting sshd.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/etc/rc.d/sshd

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

Modified files:

Index: src/etc/rc.d/sshd
diff -u src/etc/rc.d/sshd:1.27 src/etc/rc.d/sshd:1.28
--- src/etc/rc.d/sshd:1.27	Mon Apr  9 15:02:39 2018
+++ src/etc/rc.d/sshd	Sat May 26 00:17:54 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.27 2018/04/09 15:02:39 christos Exp $
+# $NetBSD: sshd,v 1.28 2018/05/26 00:17:54 jmcneill Exp $
 #
 
 # PROVIDE: sshd
@@ -30,7 +30,8 @@ sshd_keygen()
 		0)	bitarg="${ssh_keygen_flags}";;
 		*)	bitarg="-b ${bits}";;
 		esac
-		"${keygen}" -t "${type}" ${bitarg} -f "${f}" -N ''
+		"${keygen}" -t "${type}" ${bitarg} -f "${f}" -N '' -q && \
+		printf "ssh-keygen: " && "${keygen}" -f "${f}" -l
 	done << _EOF
 dsa	1024	ssh_host_dsa_key	2	DSA
 ecdsa	521	ssh_host_ecdsa_key	1	ECDSA



CVS commit: src/sys/arch/powerpc

2018-05-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May 25 23:00:34 UTC 2018

Modified Files:
src/sys/arch/powerpc/include: cpu.h
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
copy HID1 from the boot CPU to secondary CPUs as well on 64bit CPUs
now the 2nd CPU on my G5s runs at full speed


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/powerpc/oea/cpu_subr.c

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

Modified files:

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.105 src/sys/arch/powerpc/include/cpu.h:1.106
--- src/sys/arch/powerpc/include/cpu.h:1.105	Fri May  4 17:01:29 2018
+++ src/sys/arch/powerpc/include/cpu.h	Fri May 25 23:00:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.105 2018/05/04 17:01:29 macallan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.106 2018/05/25 23:00:34 macallan Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -164,6 +164,7 @@ struct cpu_hatch_data {
 	uint32_t hatch_tbl;
 #if defined(PPC_OEA64_BRIDGE) || defined (_ARCH_PPC64)
 	uint64_t hatch_hid0;
+	uint64_t hatch_hid1;
 	uint64_t hatch_hid4;
 	uint64_t hatch_hid5;
 #else

Index: src/sys/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.93 src/sys/arch/powerpc/oea/cpu_subr.c:1.94
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.93	Fri May  4 17:01:29 2018
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Fri May 25 23:00:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.93 2018/05/04 17:01:29 macallan Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.94 2018/05/25 23:00:34 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.93 2018/05/04 17:01:29 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.94 2018/05/25 23:00:34 macallan Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_ppccache.h"
@@ -1316,6 +1316,7 @@ cpu_spinup(device_t self, struct cpu_inf
 
 	h->hatch_hid0 = mfspr(SPR_HID0);
 #if defined(PPC_OEA64_BRIDGE) || defined (_ARCH_PPC64)
+	h->hatch_hid1 = mfspr(SPR_HID1);
 	h->hatch_hid4 = mfspr(SPR_HID4);
 	h->hatch_hid5 = mfspr(SPR_HID5);
 	printf("HIDs: %016llx %016llx\n", h->hatch_hid4, h->hatch_hid5);
@@ -1439,6 +1440,7 @@ cpu_hatch(void)
 	if ((oeacpufeat & OEACPU_64_BRIDGE) != 0) {
 
 		mtspr64(SPR_HID0, h->hatch_hid0);
+		mtspr64(SPR_HID1, h->hatch_hid1);
 		mtspr64(SPR_HID4, h->hatch_hid4);
 		mtspr64(SPR_HID5, h->hatch_hid5);
 		mtspr64(SPR_HIOR, 0);



CVS commit: src/etc/defaults

2018-05-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri May 25 20:48:54 UTC 2018

Modified Files:
src/etc/defaults: rc.conf

Log Message:
Provide resize_disklabel=NO default.  Used by arm images and is not
part of the stock rc.d yet.  This silences rc when you delete the
whole resize_* block from rc.conf after the first boot.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/etc/defaults/rc.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/rc.conf
diff -u src/etc/defaults/rc.conf:1.142 src/etc/defaults/rc.conf:1.143
--- src/etc/defaults/rc.conf:1.142	Wed Apr 18 04:27:47 2018
+++ src/etc/defaults/rc.conf	Fri May 25 20:48:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.142 2018/04/18 04:27:47 martin Exp $
+#	$NetBSD: rc.conf,v 1.143 2018/05/25 20:48:54 uwe Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -120,6 +120,7 @@ lvm=NO
 #
 savecore=YES		savecore_flags="-z"
 			savecore_dir="/var/crash"
+resize_disklabel=NO# resize partion to fill disk
 resize_root=NO	# resize root to fill partition
 per_user_tmp=NO	# per-user /tmp directories
 per_user_tmp_dir="/private/tmp"			# real storage for /tmp



CVS commit: src/sys/uvm

2018-05-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri May 25 20:11:03 UTC 2018

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

Log Message:
add the KASSERT() for loan_count wrap-around to all places which increase it


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/uvm/uvm_loan.c

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

Modified files:

Index: src/sys/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.86 src/sys/uvm/uvm_loan.c:1.87
--- src/sys/uvm/uvm_loan.c:1.86	Sat May 19 11:02:33 2018
+++ src/sys/uvm/uvm_loan.c	Fri May 25 20:11:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.86 2018/05/19 11:02:33 jdolecek Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.87 2018/05/25 20:11:03 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.86 2018/05/19 11:02:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.87 2018/05/25 20:11:03 jdolecek Exp $");
 
 #include 
 #include 
@@ -475,6 +475,7 @@ uvm_loanpage(struct vm_page **pgpp, int 
 			pmap_page_protect(pg, VM_PROT_READ);
 		}
 		pg->loan_count++;
+		KASSERT(pg->loan_count > 0);	/* detect wrap-around */
 		uvm_pageactivate(pg);
 		mutex_exit(_pageqlock);
 	}
@@ -788,6 +789,7 @@ uvm_loanuobj(struct uvm_faultinfo *ufi, 
 		pmap_page_protect(pg, VM_PROT_READ);
 	}
 	pg->loan_count++;
+	KASSERT(pg->loan_count > 0);	/* detect wrap-around */
 	pg->uanon = anon;
 	anon->an_page = pg;
 	anon->an_lock = /* TODO: share amap lock */
@@ -879,6 +881,7 @@ again:
 	if ((flags & UVM_LOAN_TOANON) == 0) {	/* loaning to kernel-page */
 		mutex_enter(_pageqlock);
 		pg->loan_count++;
+		KASSERT(pg->loan_count > 0);	/* detect wrap-around */
 		mutex_exit(_pageqlock);
 		mutex_exit(uvm_loanzero_object.vmobjlock);
 		**output = pg;
@@ -919,6 +922,7 @@ again:
 	pg->uanon = anon;
 	mutex_enter(_pageqlock);
 	pg->loan_count++;
+	KASSERT(pg->loan_count > 0);	/* detect wrap-around */
 	uvm_pageactivate(pg);
 	mutex_exit(_pageqlock);
 	mutex_exit(>an_lock);



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

2018-05-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 25 19:56:47 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun8i_a83t_gpio.c

Log Message:
hdmiddc -> hdmi for function name on PH6/PH7/PH8


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sun8i_a83t_gpio.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/sunxi/sun8i_a83t_gpio.c
diff -u src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c:1.2 src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c:1.3
--- src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c:1.2	Tue Apr  3 16:01:25 2018
+++ src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c	Fri May 25 19:56:47 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i_a83t_gpio.c,v 1.2 2018/04/03 16:01:25 bouyer Exp $ */
+/* $NetBSD: sun8i_a83t_gpio.c,v 1.3 2018/05/25 19:56:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun8i_a83t_gpio.c,v 1.2 2018/04/03 16:01:25 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun8i_a83t_gpio.c,v 1.3 2018/05/25 19:56:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -146,9 +146,9 @@ static const struct sunxi_gpio_pins a83t
 	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "irq" } },
 	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "irq" } },
 	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "irq" } },
-	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "irq" } },
-	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "irq" } },
-	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "irq" } },
+	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "irq" } },
+	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "irq" } },
+	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "irq" } },
 	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "irq" } },
 	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "irq" } },
 	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "irq" } },



CVS commit: src/sys/conf

2018-05-25 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri May 25 19:48:12 UTC 2018

Modified Files:
src/sys/conf: dts.mk

Log Message:
Compile dtbs with -@ so that fdtoverlay(1) et.al. can symbolically
reference phandles.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/conf/dts.mk

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

Modified files:

Index: src/sys/conf/dts.mk
diff -u src/sys/conf/dts.mk:1.8 src/sys/conf/dts.mk:1.9
--- src/sys/conf/dts.mk:1.8	Sun Dec 10 14:29:47 2017
+++ src/sys/conf/dts.mk	Fri May 25 19:48:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: dts.mk,v 1.8 2017/12/10 14:29:47 christos Exp $
+# $NetBSD: dts.mk,v 1.9 2018/05/25 19:48:12 jakllsch Exp $
 
 DTSARCH?=${MACHINE_CPU}
 DTSGNUARCH?=${DTSARCH}
@@ -33,7 +33,7 @@ DTSPATH=${DTSINC} ${DTSDIR} dts
 	(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
 	-include ${.IMPSRC} /dev/null | \
 	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
-	-p ${DTSPADDING} -b 0 -o /dev/null -d /dev/stdout | \
+	-p ${DTSPADDING} -b 0 -@ -o /dev/null -d /dev/stdout | \
 	${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' \
 	-e 's@@${.IMPSRC}@' && \
 	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
@@ -46,7 +46,7 @@ DTSPATH=${DTSINC} ${DTSDIR} dts
 	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
 	-include ${.IMPSRC} /dev/null | \
 	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
-	-p ${DTSPADDING} -b 0 -o ${.TARGET}
+	-p ${DTSPADDING} -b 0 -@ -o ${.TARGET}
 
 .PATH.dts: ${DTSDIR}
 



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

2018-05-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 25 16:30:03 UTC 2018

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

Log Message:
Fix typo in local macro name, pointed out by uwe


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_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/tests/lib/libc/sys/t_syscall.c
diff -u src/tests/lib/libc/sys/t_syscall.c:1.1 src/tests/lib/libc/sys/t_syscall.c:1.2
--- src/tests/lib/libc/sys/t_syscall.c:1.1	Fri May 25 15:42:30 2018
+++ src/tests/lib/libc/sys/t_syscall.c	Fri May 25 16:30:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_syscall.c,v 1.1 2018/05/25 15:42:30 martin Exp $	*/
+/*	$NetBSD: t_syscall.c,v 1.2 2018/05/25 16:30:03 martin Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_syscall.c,v 1.1 2018/05/25 15:42:30 martin Exp $");
+__RCSID("$NetBSD: t_syscall.c,v 1.2 2018/05/25 16:30:03 martin Exp $");
 
 
 #include 
@@ -44,9 +44,9 @@ __RCSID("$NetBSD: t_syscall.c,v 1.1 2018
 #include 
 
 #if !defined(_LP64) && BYTE_ORDER == _BIG_ENDIAN
-#define __SYSCALL_TO_UINPTRT(V)	((uintptr_t)((V)>>32))
+#define __SYSCALL_TO_UINTPTR_T(V)	((uintptr_t)((V)>>32))
 #else
-#define __SYSCALL_TO_UINPTRT(V)	((uintptr_t)(V))
+#define __SYSCALL_TO_UINTPTR_T(V)	((uintptr_t)(V))
 #endif
 
 static const char secrect_data[1024] = {
@@ -98,7 +98,7 @@ ATF_TC_BODY(mmap___syscall, tc)
 
 	write(fd, secrect_data, sizeof(secrect_data));
 
-	p = (const char *)__SYSCALL_TO_UINPTRT(__syscall(SYS_mmap,
+	p = (const char *)__SYSCALL_TO_UINTPTR_T(__syscall(SYS_mmap,
 		0, sizeof(secrect_data), PROT_READ, MAP_PRIVATE, fd, 0, 0, 0));
 	ATF_REQUIRE(p != NULL);
 



CVS commit: src/sys/arch/amd64/stand/prekern

2018-05-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri May 25 16:01:31 UTC 2018

Modified Files:
src/sys/arch/amd64/stand/prekern: locore.S

Log Message:
Hide a bunch of local symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amd64/stand/prekern/locore.S

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

Modified files:

Index: src/sys/arch/amd64/stand/prekern/locore.S
diff -u src/sys/arch/amd64/stand/prekern/locore.S:1.7 src/sys/arch/amd64/stand/prekern/locore.S:1.8
--- src/sys/arch/amd64/stand/prekern/locore.S:1.7	Fri Dec 22 07:37:27 2017
+++ src/sys/arch/amd64/stand/prekern/locore.S	Fri May 25 16:01:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.7 2017/12/22 07:37:27 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.8 2018/05/25 16:01:31 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2007, 2008, 2016, 2017 The NetBSD Foundation, Inc.
@@ -230,7 +230,7 @@ ENTRY(start)
 	/* Load 'bootinfo' */
 	movl	12(%esp),%eax
 	testl	%eax,%eax		/* bootinfo = NULL? */
-	jz	bootinfo_finished
+	jz	.Lbootinfo_finished
 
 	movl	(%eax),%ebx		/* number of entries */
 	movl	$_C_LABEL(bootinfo),%ebp
@@ -239,9 +239,9 @@ ENTRY(start)
 	movl	%ebx,(%edx)
 	addl	$4,%edx
 
-bootinfo_entryloop:
+.Lbootinfo_entryloop:
 	testl	%ebx,%ebx		/* no remaining entries? */
-	jz	bootinfo_finished
+	jz	.Lbootinfo_finished
 
 	addl	$4,%eax
 	movl	(%eax),%ecx		/* address of entry */
@@ -253,7 +253,7 @@ bootinfo_entryloop:
 	movl	%edx,%edi
 	addl	(%ecx),%edx		/* update dest pointer */
 	cmpl	%ebp,%edx		/* beyond bootinfo+BOOTINFO_MAXSIZE? */
-	jg	bootinfo_overflow
+	jg	.Lbootinfo_overflow
 
 	movl	%ecx,%esi
 	movl	%eax,%ecx
@@ -280,9 +280,9 @@ bootinfo_entryloop:
 	popl	%esi
 	popl	%edi
 	subl	$1,%ebx			/* decrement the # of entries */
-	jmp	bootinfo_entryloop
+	jmp	.Lbootinfo_entryloop
 
-bootinfo_overflow:
+.Lbootinfo_overflow:
 	/*
 	 * Cleanup for overflow case. Pop the registers, and correct the number
 	 * of entries.
@@ -294,7 +294,7 @@ bootinfo_overflow:
 	movl	%ebp,%edx
 	subl	%ebx,(%edx)		/* correct the number of entries */
 
-bootinfo_finished:
+.Lbootinfo_finished:
 	/* Load 'esym' */
 	movl	16(%esp),%eax
 	movl	$_C_LABEL(esym),%ebp
@@ -331,9 +331,9 @@ bootinfo_finished:
 	movl	$0x8001,%eax
 	cpuid
 	andl	$CPUID_NOX,%edx
-	jz	no_NOX
+	jz	.Lno_NOX
 	movl	$PG_NX32,_C_LABEL(nox_flag)
-no_NOX:
+.Lno_NOX:
 
 /*
  * There are four levels of pages in amd64: PML4 -> PDP -> PD -> PT. They will
@@ -517,9 +517,9 @@ no_NOX:
 	orl	$(EFER_LME|EFER_SCE),%eax
 	movl	_C_LABEL(nox_flag),%ebx
 	cmpl	$0,%ebx
-	je 	skip_NOX
+	je 	.Lskip_NOX
 	orl	$(EFER_NXE),%eax
-skip_NOX:
+.Lskip_NOX:
 	wrmsr
 
 	/*



CVS commit: src/sys/dev/hid

2018-05-25 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 25 15:52:46 UTC 2018

Modified Files:
src/sys/dev/hid: hidms.c

Log Message:
Fix HIDMS_DEBUG build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hid/hidms.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/hid/hidms.c
diff -u src/sys/dev/hid/hidms.c:1.1 src/sys/dev/hid/hidms.c:1.2
--- src/sys/dev/hid/hidms.c:1.1	Sun Dec 10 17:03:07 2017
+++ src/sys/dev/hid/hidms.c	Fri May 25 15:52:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hidms.c,v 1.1 2017/12/10 17:03:07 bouyer Exp $	*/
+/*	$NetBSD: hidms.c,v 1.2 2018/05/25 15:52:45 ryoon Exp $	*/
 
 /*
  * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hidms.c,v 1.1 2017/12/10 17:03:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hidms.c,v 1.2 2018/05/25 15:52:45 ryoon Exp $");
 
 #include 
 #include 
@@ -211,6 +211,9 @@ hidms_attach(device_t self, struct hidms
 const struct wsmouse_accessops *ops)
 {
 	struct wsmousedev_attach_args a;
+#ifdef HIDMS_DEBUG
+	int i;
+#endif
 	aprint_normal(": %d button%s%s%s%s%s%s%s%s%s\n",
 	ms->nbuttons, ms->nbuttons == 1 ? "" : "s",
 	ms->flags & HIDMS_W ? ", W" : "",



CVS commit: src/sys/arch/amd64/stand/prekern

2018-05-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri May 25 15:52:11 UTC 2018

Modified Files:
src/sys/arch/amd64/stand/prekern: prekern.c trap.S

Log Message:
Rename the entry points of the prekern, rename the array and move it into
.rodata.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amd64/stand/prekern/prekern.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/stand/prekern/trap.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/stand/prekern/prekern.c
diff -u src/sys/arch/amd64/stand/prekern/prekern.c:1.7 src/sys/arch/amd64/stand/prekern/prekern.c:1.8
--- src/sys/arch/amd64/stand/prekern/prekern.c:1.7	Sun Nov 26 11:01:09 2017
+++ src/sys/arch/amd64/stand/prekern/prekern.c	Fri May 25 15:52:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: prekern.c,v 1.7 2017/11/26 11:01:09 maxv Exp $	*/
+/*	$NetBSD: prekern.c,v 1.8 2018/05/25 15:52:11 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -58,7 +58,7 @@ static struct x86_64_tss prekern_tss;
 
 #define IDTVEC(name) __CONCAT(X, name)
 typedef void (vector)(void);
-extern vector *IDTVEC(exceptions)[];
+extern vector *x86_exceptions[];
 
 void fatal(char *msg)
 {
@@ -211,7 +211,7 @@ init_idt(void)
 
 	idt = (struct gate_descriptor *)
 	for (i = 0; i < NCPUIDT; i++) {
-		setgate([i], IDTVEC(exceptions)[i], 0, SDT_SYS386IGT,
+		setgate([i], x86_exceptions[i], 0, SDT_SYS386IGT,
 		SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 	}
 

Index: src/sys/arch/amd64/stand/prekern/trap.S
diff -u src/sys/arch/amd64/stand/prekern/trap.S:1.2 src/sys/arch/amd64/stand/prekern/trap.S:1.3
--- src/sys/arch/amd64/stand/prekern/trap.S:1.2	Fri Dec 22 07:37:27 2017
+++ src/sys/arch/amd64/stand/prekern/trap.S	Fri May 25 15:52:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.S,v 1.2 2017/12/22 07:37:27 maxv Exp $	*/
+/*	$NetBSD: trap.S,v 1.3 2018/05/25 15:52:11 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -90,91 +90,72 @@ IDTVEC(trap09)
 	ZTRAPENTRY(T_FPOPFLT)
 IDTVEC_END(trap09)
 
-IDTVEC(trap0a)
+IDTVEC(trap10)
 	TRAPENTRY(T_TSSFLT)
-IDTVEC_END(trap0a)
+IDTVEC_END(trap10)
 
-IDTVEC(trap0b)		/* #NP() Segment not present */
+IDTVEC(trap11)
 	ZTRAPENTRY(T_SEGNPFLT)
-IDTVEC_END(trap0b)
+IDTVEC_END(trap11)
 
-IDTVEC(trap0c)		/* #SS() Stack exception */
+IDTVEC(trap12)
 	ZTRAPENTRY(T_STKFLT)
-IDTVEC_END(trap0c)
+IDTVEC_END(trap12)
 
-IDTVEC(trap0d)		/* #GP() General protection */
+IDTVEC(trap13)
 	ZTRAPENTRY(T_PROTFLT)
-IDTVEC_END(trap0d)
+IDTVEC_END(trap13)
 
-IDTVEC(trap0e)
+IDTVEC(trap14)
 	TRAPENTRY(T_PAGEFLT)
-IDTVEC_END(trap0e)
+IDTVEC_END(trap14)
 
-IDTVEC(trap0f)
+IDTVEC(trap15)
 	ZTRAPENTRY(T_ASTFLT)
-IDTVEC_END(trap0f)
+IDTVEC_END(trap15)
 
-IDTVEC(trap10)
+IDTVEC(trap16)
 	ZTRAPENTRY(T_ARITHTRAP)
-IDTVEC_END(trap10)
+IDTVEC_END(trap16)
 
-IDTVEC(trap11)
+IDTVEC(trap17)
 	TRAPENTRY(T_ALIGNFLT)
-IDTVEC_END(trap11)
+IDTVEC_END(trap17)
 
-IDTVEC(trap12)
+IDTVEC(trap18)
 	ZTRAPENTRY(T_MCA)
-IDTVEC_END(trap12)
+IDTVEC_END(trap18)
 
-IDTVEC(trap13)
+IDTVEC(trap19)
 	ZTRAPENTRY(T_XMM)
-IDTVEC_END(trap13)
+IDTVEC_END(trap19)
 
-IDTVEC(trap14)
-IDTVEC(trap15)
-IDTVEC(trap16)
-IDTVEC(trap17)
-IDTVEC(trap18)
-IDTVEC(trap19)
-IDTVEC(trap1a)
-IDTVEC(trap1b)
-IDTVEC(trap1c)
-IDTVEC(trap1d)
-IDTVEC(trap1e)
-IDTVEC(trap1f)
+IDTVEC(trap20)
+IDTVEC(trap21)
+IDTVEC(trap22)
+IDTVEC(trap23)
+IDTVEC(trap24)
+IDTVEC(trap25)
+IDTVEC(trap26)
+IDTVEC(trap27)
+IDTVEC(trap28)
+IDTVEC(trap29)
+IDTVEC(trap30)
+IDTVEC(trap31)
 	/* 20 - 31 reserved for future exp */
 	ZTRAPENTRY(T_RESERVED)
-IDTVEC_END(trap1f)
-IDTVEC_END(trap1e)
-IDTVEC_END(trap1d)
-IDTVEC_END(trap1c)
-IDTVEC_END(trap1b)
-IDTVEC_END(trap1a)
-IDTVEC_END(trap19)
-IDTVEC_END(trap18)
-IDTVEC_END(trap17)
-IDTVEC_END(trap16)
-IDTVEC_END(trap15)
-IDTVEC_END(trap14)
-
-IDTVEC(exceptions)
-	.quad	_C_LABEL(Xtrap00), _C_LABEL(Xtrap01)
-	.quad	_C_LABEL(Xtrap02), _C_LABEL(Xtrap03)
-	.quad	_C_LABEL(Xtrap04), _C_LABEL(Xtrap05)
-	.quad	_C_LABEL(Xtrap06), _C_LABEL(Xtrap07)
-	.quad	_C_LABEL(Xtrap08), _C_LABEL(Xtrap09)
-	.quad	_C_LABEL(Xtrap0a), _C_LABEL(Xtrap0b)
-	.quad	_C_LABEL(Xtrap0c), _C_LABEL(Xtrap0d)
-	.quad	_C_LABEL(Xtrap0e), _C_LABEL(Xtrap0f)
-	.quad	_C_LABEL(Xtrap10), _C_LABEL(Xtrap11)
-	.quad	_C_LABEL(Xtrap12), _C_LABEL(Xtrap13)
-	.quad	_C_LABEL(Xtrap14), _C_LABEL(Xtrap15)
-	.quad	_C_LABEL(Xtrap16), _C_LABEL(Xtrap17)
-	.quad	_C_LABEL(Xtrap18), _C_LABEL(Xtrap19)
-	.quad	_C_LABEL(Xtrap1a), _C_LABEL(Xtrap1b)
-	.quad	_C_LABEL(Xtrap1c), _C_LABEL(Xtrap1d)
-	.quad	_C_LABEL(Xtrap1e), _C_LABEL(Xtrap1f)
-IDTVEC_END(exceptions)
+IDTVEC_END(trap31)
+IDTVEC_END(trap30)
+IDTVEC_END(trap29)
+IDTVEC_END(trap28)
+IDTVEC_END(trap27)
+IDTVEC_END(trap26)
+IDTVEC_END(trap25)
+IDTVEC_END(trap24)
+IDTVEC_END(trap23)
+IDTVEC_END(trap22)
+IDTVEC_END(trap21)
+IDTVEC_END(trap20)
 
 /*
  * Arguments pushed on the stack:
@@ -191,3 +172,24 @@ NENTRY(alltraps)
 	call	

CVS commit: src/sys/dev/acpi

2018-05-25 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 25 15:48:00 UTC 2018

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

Log Message:
If fixed feature buttons exist, print detection messages.


To generate a diff of this commit:
cvs rdiff -u -r1.270 -r1.271 src/sys/dev/acpi/acpi.c

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.270 src/sys/dev/acpi/acpi.c:1.271
--- src/sys/dev/acpi/acpi.c:1.270	Sat May  5 17:16:23 2018
+++ src/sys/dev/acpi/acpi.c	Fri May 25 15:48:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.270 2018/05/05 17:16:23 christos Exp $	*/
+/*	$NetBSD: acpi.c,v 1.271 2018/05/25 15:48:00 ryoon Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.270 2018/05/05 17:16:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.271 2018/05/25 15:48:00 ryoon Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -1195,7 +1195,7 @@ acpi_register_fixed_button(struct acpi_s
 		goto fail;
 	}
 
-	aprint_debug_dev(sc->sc_dev, "fixed %s button present\n",
+	aprint_normal_dev(sc->sc_dev, "fixed %s button present\n",
 	(type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep");
 
 	return;



CVS commit: src/distrib/sets/lists

2018-05-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 25 15:42:48 UTC 2018

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
Add new test program


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.784 -r1.785 src/distrib/sets/lists/tests/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/mi
diff -u src/distrib/sets/lists/debug/mi:1.248 src/distrib/sets/lists/debug/mi:1.249
--- src/distrib/sets/lists/debug/mi:1.248	Fri May 18 06:39:58 2018
+++ src/distrib/sets/lists/debug/mi	Fri May 25 15:42:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.248 2018/05/18 06:39:58 kamil Exp $
+# $NetBSD: mi,v 1.249 2018/05/25 15:42:48 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2129,6 +2129,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_socketpair.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_stat.debug			tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_swapcontext.debug		tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_syscall.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_timer_create.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_truncate.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_ucontext.debug		tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.784 src/distrib/sets/lists/tests/mi:1.785
--- src/distrib/sets/lists/tests/mi:1.784	Thu May 24 14:54:36 2018
+++ src/distrib/sets/lists/tests/mi	Fri May 25 15:42:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.784 2018/05/24 14:54:36 christos Exp $
+# $NetBSD: mi,v 1.785 2018/05/25 15:42:48 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2813,6 +2813,7 @@
 ./usr/tests/lib/libc/sys/t_socketpair		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_stat			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_swapcontext		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/sys/t_syscall		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_timer_create		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_truncate		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/sys/t_ucontext		tests-lib-tests		compattestfile,atf



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

2018-05-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 25 15:42:30 UTC 2018

Modified Files:
src/tests/lib/libc/sys: Makefile
Added Files:
src/tests/lib/libc/sys: t_syscall.c

Log Message:
Add a test to verify syscall() and/or __syscall() are working.
This used to trigger a panic (see PR kern/53261) on arm.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_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/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.51 src/tests/lib/libc/sys/Makefile:1.52
--- src/tests/lib/libc/sys/Makefile:1.51	Fri May 18 06:39:58 2018
+++ src/tests/lib/libc/sys/Makefile	Fri May 25 15:42:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2018/05/18 06:39:58 kamil Exp $
+# $NetBSD: Makefile,v 1.52 2018/05/25 15:42:30 martin Exp $
 
 MKMAN=	no
 
@@ -70,6 +70,7 @@ TESTS_C+=		t_sigtimedwait
 TESTS_C+=		t_socketpair
 TESTS_C+=		t_swapcontext
 TESTS_C+=		t_stat
+TESTS_C+=		t_syscall
 TESTS_C+=		t_timer_create
 TESTS_C+=		t_truncate
 TESTS_C+=		t_ucontext

Added files:

Index: src/tests/lib/libc/sys/t_syscall.c
diff -u /dev/null src/tests/lib/libc/sys/t_syscall.c:1.1
--- /dev/null	Fri May 25 15:42:30 2018
+++ src/tests/lib/libc/sys/t_syscall.c	Fri May 25 15:42:30 2018
@@ -0,0 +1,117 @@
+/*	$NetBSD: t_syscall.c,v 1.1 2018/05/25 15:42:30 martin Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Martin Husemann.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+__RCSID("$NetBSD: t_syscall.c,v 1.1 2018/05/25 15:42:30 martin Exp $");
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if !defined(_LP64) && BYTE_ORDER == _BIG_ENDIAN
+#define __SYSCALL_TO_UINPTRT(V)	((uintptr_t)((V)>>32))
+#else
+#define __SYSCALL_TO_UINPTRT(V)	((uintptr_t)(V))
+#endif
+
+static const char secrect_data[1024] = {
+	"my secret key\n"
+};
+
+#define	FILE_NAME	"dummy"
+
+#ifndef _LP64
+ATF_TC(mmap_syscall);
+
+ATF_TC_HEAD(mmap_syscall, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Tests mmap(2) via syscall(2)");
+}
+
+ATF_TC_BODY(mmap_syscall, tc)
+{
+	int fd;
+	const char *p;
+
+	fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
+	ATF_REQUIRE(fd != -1);
+
+	write(fd, secrect_data, sizeof(secrect_data));
+
+	p = (const char *)syscall(SYS_mmap,
+		0, sizeof(secrect_data), PROT_READ, MAP_PRIVATE, fd, 0, 0, 0);
+	ATF_REQUIRE(p != NULL);
+
+ 	ATF_REQUIRE(strcmp(p, secrect_data) == 0);
+}
+#endif
+
+ATF_TC(mmap___syscall);
+
+ATF_TC_HEAD(mmap___syscall, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Tests mmap(2) via __syscall(2)");
+}
+
+ATF_TC_BODY(mmap___syscall, tc)
+{
+	int fd;
+	const char *p;
+
+	fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
+	ATF_REQUIRE(fd != -1);
+
+	write(fd, secrect_data, sizeof(secrect_data));
+
+	p = (const char *)__SYSCALL_TO_UINPTRT(__syscall(SYS_mmap,
+		0, sizeof(secrect_data), PROT_READ, MAP_PRIVATE, fd, 0, 0, 0));
+	ATF_REQUIRE(p != NULL);
+
+	ATF_REQUIRE(strcmp(p, secrect_data) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+#ifndef _LP64
+	ATF_TP_ADD_TC(tp, mmap_syscall);
+#endif
+	ATF_TP_ADD_TC(tp, mmap___syscall);
+
+	return atf_no_error();
+}



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

2018-05-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 25 15:37:58 UTC 2018

Modified Files:
src/sys/arch/arm/arm: syscall.c

Log Message:
PR kern/53261: handle SYS_syscall indirection in MD code - the generic
version would misalign the argument array.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/arm/arm/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/arch/arm/arm/syscall.c
diff -u src/sys/arch/arm/arm/syscall.c:1.64 src/sys/arch/arm/arm/syscall.c:1.65
--- src/sys/arch/arm/arm/syscall.c:1.64	Wed Jan 24 09:04:44 2018
+++ src/sys/arch/arm/arm/syscall.c	Fri May 25 15:37:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.64 2018/01/24 09:04:44 skrll Exp $	*/
+/*	$NetBSD: syscall.c,v 1.65 2018/05/25 15:37:57 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.64 2018/01/24 09:04:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.65 2018/05/25 15:37:57 martin Exp $");
 
 #include 
 #include 
@@ -185,9 +185,10 @@ syscall(struct trapframe *tf, lwp_t *l, 
 	struct proc * const p = l->l_proc;
 	const struct sysent *callp;
 	int error;
-	u_int nargs;
+	u_int nargs, off = 0;
 	register_t *args;
-	uint64_t copyargs64[sizeof(register_t)*(2+SYS_MAXSYSARGS+1)/sizeof(uint64_t)];
+	uint64_t copyargs64[sizeof(register_t) *
+			(2+SYS_MAXSYSARGS+1)/sizeof(uint64_t)];
 	register_t *copyargs = (register_t *)copyargs64;
 	register_t rval[2];
 	ksiginfo_t ksi;
@@ -221,17 +222,29 @@ syscall(struct trapframe *tf, lwp_t *l, 
 	}
 
 	code &= (SYS_NSYSENT - 1);
+
+	if (__predict_false(code == SYS_syscall)) {
+		off = 1;
+		code = tf->tf_r0;
+		code &= (SYS_NSYSENT - 1);
+		if (__predict_false(code == SYS_syscall)) {
+			error = EINVAL;
+			goto bad;
+		}
+	}
+
 	callp = p->p_emul->e_sysent + code;
 	nargs = callp->sy_narg;
-	if (nargs > 4) {
+
+	if ((nargs+off) > 4) {
 		args = copyargs;
-		memcpy(args, >tf_r0, 4 * sizeof(register_t));
-		error = copyin((void *)tf->tf_usr_sp, args + 4,
-		(nargs - 4) * sizeof(register_t));
+		memcpy(args, >tf_r0+off, (4-off) * sizeof(register_t));
+		error = copyin((void *)tf->tf_usr_sp, args + 4 - off,
+		(nargs - 4 + off) * sizeof(register_t));
 		if (error)
 			goto bad;
 	} else {
-		args = >tf_r0;
+		args = >tf_r0 + off;
 	}
 
 	error = sy_invoke(callp, l, args, rval, code);



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

2018-05-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri May 25 15:33:56 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S

Log Message:
When the previous contrext is in kernel mode we are not guaranteed to have
a 16-byte-aligned stack pointer, so align it. That's what the CPU would do
on exception entry.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/amd64/amd64/amd64_trap.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/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.41 src/sys/arch/amd64/amd64/amd64_trap.S:1.42
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.41	Tue May  8 17:20:44 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Fri May 25 15:33:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.41 2018/05/08 17:20:44 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.42 2018/05/25 15:33:56 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -121,6 +121,7 @@
 		movq	PCB_RSP0(%rax),%rax
 	.else
 		movq	TF_RSP(%rsp),%rax
+		andq	$(~0xF),%rax
 	.endif
 
 	subq	$(5*8),%rax



CVS commit: src/sys/arch/ia64/ia64

2018-05-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri May 25 06:34:02 UTC 2018

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

Log Message:
Don't use uvm_emap_size, emap was removed


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/ia64/ia64/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/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.36 src/sys/arch/ia64/ia64/pmap.c:1.37
--- src/sys/arch/ia64/ia64/pmap.c:1.36	Sat Apr  8 20:59:27 2017
+++ src/sys/arch/ia64/ia64/pmap.c	Fri May 25 06:34:02 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $ */
+/* $NetBSD: pmap.c,v 1.37 2018/05/25 06:34:02 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.37 2018/05/25 06:34:02 jdolecek Exp $");
 
 #include 
 #include 
@@ -438,7 +438,7 @@ pmap_bootstrap(void)
 	bufsz = buf_memcalc();
 	buf_setvalimit(bufsz);
 
-	nkpt = (((ubc_nwins << ubc_winshift) + uvm_emap_size +
+	nkpt = (((ubc_nwins << ubc_winshift) +
 		 bufsz + 16 * NCARGS + pager_map_size) / PAGE_SIZE +
 		USRIOSIZE + (maxproc * UPAGES) + nkmempages) / NKPTEPG;