CVS commit: src/usr.sbin/postinstall

2015-07-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul  2 09:53:12 UTC 2015

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
PR install/50020: postinstall does not check for mandoc in /etc/man.conf.
Add a check, but ask the user to fix manually (the file could have local
modifications).


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.195 src/usr.sbin/postinstall/postinstall:1.196
--- src/usr.sbin/postinstall/postinstall:1.195	Thu Jul  2 09:31:56 2015
+++ src/usr.sbin/postinstall/postinstall	Thu Jul  2 09:53:12 2015
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.195 2015/07/02 09:31:56 martin Exp $
+# $NetBSD: postinstall,v 1.196 2015/07/02 09:53:12 martin Exp $
 #
-# Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
+# Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -2007,6 +2007,33 @@ do_catpages()
 	return $failed
 }
 
+#
+#	man.conf
+#
+additem manconf check for a mandoc usage in /etc/man.conf
+do_manconf()
+{
+	[ -n $1 ] || err 3 USAGE: do_manconf  fix|check
+	op=$1
+	failed=0
+
+	[ -f ${DEST_DIR}/etc/man.conf ] || return 0
+	if ${GREP} -w mandoc ${DEST_DIR}/etc/man.conf /dev/null 21;
+	then
+		failed=0;
+	else
+		failed=1
+		notfixed=
+		if [ ${op} = fix ]; then
+			notfixed=${NOT_FIXED}
+		fi
+		msg The file /etc/man.conf has not been adapted to mandoc usage, you
+		msg probably want to copy a new version over. ${notfixed}
+	fi
+
+	return ${failed}
+}
+
 
 #
 #	ptyfsoldnodes



CVS commit: src/sys/dev/usb

2015-07-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  2 08:35:44 UTC 2015

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

Log Message:
From FreeBSD rev1.30 via OpenBSD:
 - always initialise the pipe multiplier to a valid value
 - do not unchain the the interrupt QHs immediately after initialisation

Prompted by msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.239 src/sys/dev/usb/ehci.c:1.240
--- src/sys/dev/usb/ehci.c:1.239	Mon May 11 06:44:36 2015
+++ src/sys/dev/usb/ehci.c	Thu Jul  2 08:35:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.239 2015/05/11 06:44:36 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.240 2015/07/02 08:35:44 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.239 2015/05/11 06:44:36 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.240 2015/07/02 08:35:44 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -519,8 +519,8 @@ ehci_init(ehci_softc_t *sc)
 			EHCI_LINK_QH);
 		}
 		sqh-qh.qh_endp = htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH));
+		sqh-qh.qh_endphub = htole32(EHCI_QH_SET_MULT(1))
 		sqh-qh.qh_curqtd = EHCI_NULL;
-		sqh-next = NULL;
 		sqh-qh.qh_qtd.qtd_next = EHCI_NULL;
 		sqh-qh.qh_qtd.qtd_altnext = EHCI_NULL;
 		sqh-qh.qh_qtd.qtd_status = htole32(EHCI_QTD_HALTED);



CVS commit: src/sys/dev/usb

2015-07-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  2 09:05:06 UTC 2015

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

Log Message:
Somehow the ; disappeared from the previouis commit


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.240 src/sys/dev/usb/ehci.c:1.241
--- src/sys/dev/usb/ehci.c:1.240	Thu Jul  2 08:35:44 2015
+++ src/sys/dev/usb/ehci.c	Thu Jul  2 09:05:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.240 2015/07/02 08:35:44 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.241 2015/07/02 09:05:06 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.240 2015/07/02 08:35:44 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.241 2015/07/02 09:05:06 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -519,7 +519,7 @@ ehci_init(ehci_softc_t *sc)
 			EHCI_LINK_QH);
 		}
 		sqh-qh.qh_endp = htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH));
-		sqh-qh.qh_endphub = htole32(EHCI_QH_SET_MULT(1))
+		sqh-qh.qh_endphub = htole32(EHCI_QH_SET_MULT(1));
 		sqh-qh.qh_curqtd = EHCI_NULL;
 		sqh-qh.qh_qtd.qtd_next = EHCI_NULL;
 		sqh-qh.qh_qtd.qtd_altnext = EHCI_NULL;



CVS commit: src/usr.sbin/postinstall

2015-07-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul  2 09:31:56 UTC 2015

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Simplify previous, pass awk as TOOL_AWK (that is what the makefile uses),
create an obj dir for make and force it to use that.
This version now works with read-only source again.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.194 src/usr.sbin/postinstall/postinstall:1.195
--- src/usr.sbin/postinstall/postinstall:1.194	Wed Jul  1 12:40:07 2015
+++ src/usr.sbin/postinstall/postinstall	Thu Jul  2 09:31:56 2015
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.194 2015/07/01 12:40:07 martin Exp $
+# $NetBSD: postinstall,v 1.195 2015/07/02 09:31:56 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1178,11 +1178,13 @@ do_mtree()
 	if ! $SOURCEMODE; then
 		MTREE_DIR=${SRC_DIR}/etc/mtree
 	else
-		env AWK={$AWK:Q} ${MAKE} -s -C ${SRC_DIR}/etc/mtree emit_dist_file  \
-		${SCRATCHDIR}/NetBSD.dist
-		${MAKE} -s -C ${SRC_DIR}/etc/mtree clean /dev/null 21
+		/bin/rm -rf ${SCRATCHDIR}/obj
+		mkdir ${SCRATCHDIR}/obj
+		${MAKE} -s -C ${SRC_DIR}/etc/mtree TOOL_AWK=${AWK} \
+		MAKEOBJDIR=${SCRATCHDIR}/obj emit_dist_file  \
 		${SCRATCHDIR}/NetBSD.dist
 		MTREE_DIR=${SCRATCHDIR}
+		/bin/rm -rf ${SCRATCHDIR}/obj
 	fi
 	compare_dir $1 ${MTREE_DIR} ${DEST_DIR}/etc/mtree 444 NetBSD.dist
 	failed=$(( ${failed} + $? ))



CVS commit: src/sys/arch/arm

2015-07-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  2 08:33:31 UTC 2015

Modified Files:
src/sys/arch/arm/arm: cpufunc.c
src/sys/arch/arm/arm32: sys_machdep.c

Log Message:
Use armreg_*_{read,write} instead of handcrafted asm

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/arm/arm/cpufunc.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/arm32/sys_machdep.c

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

Modified files:

Index: src/sys/arch/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.155 src/sys/arch/arm/arm/cpufunc.c:1.156
--- src/sys/arch/arm/arm/cpufunc.c:1.155	Wed Jun  3 02:30:11 2015
+++ src/sys/arch/arm/arm/cpufunc.c	Thu Jul  2 08:33:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.155 2015/06/03 02:30:11 hsuenaga Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.156 2015/07/02 08:33:31 skrll Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.155 2015/06/03 02:30:11 hsuenaga Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.156 2015/07/02 08:33:31 skrll Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_cpuoptions.h
@@ -1494,17 +1494,16 @@ static int	arm_dcache_log2_linesize;
 static inline u_int
 get_cachesize_cp15(int cssr)
 {
-	u_int csid;
-
 #if defined(CPU_ARMV7)
 	__asm volatile(.arch\tarmv7a);
-	__asm volatile(mcr p15, 2, %0, c0, c0, 0 :: r (cssr));
-	__asm volatile(isb ::: memory);	/* sync to the new cssr */
+
+	armreg_csselr_write(cssr);
+	arm_isb();			 /* sync to the new cssr */
+
 #else
 	__asm volatile(mcr p15, 1, %0, c0, c0, 2 :: r (cssr) : memory);
 #endif
-	__asm volatile(mrc p15, 1, %0, c0, c0, 0 : =r (csid));
-	return csid;
+	return armreg_ccsidr_read();
 }
 #endif
 
@@ -1565,8 +1564,7 @@ get_cachetype_cp15(void)
 	u_int ctype, isize, dsize;
 	u_int multiplier;
 
-	__asm volatile(mrc p15, 0, %0, c0, c0, 1
-		: =r (ctype));
+	ctype = armreg_ctr_read();
 
 	/*
 	 * ...and thus spake the ARM ARM:
@@ -3002,7 +3000,7 @@ arm11_setup(char *args)
 	__asm volatile (mcr\tp15, 0, r0, c7, c7, 0 : : );
 
 	/* Allow detection code to find the VFP if it's fitted.  */
-	__asm volatile (mcr\tp15, 0, %0, c1, c0, 2 : : r (0x0fff));
+	armreg_cpacr_write(0x0fff);
 
 	/* Set the control register */
 	curcpu()-ci_ctrl = cpuctrl;
@@ -3051,7 +3049,7 @@ arm11mpcore_setup(char *args)
 	__asm volatile (mcr\tp15, 0, r0, c7, c7, 0 : : );
 
 	/* Allow detection code to find the VFP if it's fitted.  */
-	__asm volatile (mcr\tp15, 0, %0, c1, c0, 2 : : r (0x0fff));
+	armreg_cpacr_write(0x0fff);
 
 	/* Set the control register */
 	curcpu()-ci_ctrl = cpu_control(cpuctrlmask, cpuctrl);
@@ -3274,7 +3272,7 @@ arm11x6_setup(char *args)
 	__asm volatile (mcr\tp15, 0, %0, c7, c7, 0 : : r(sbz));
 
 	/* Allow detection code to find the VFP if it's fitted.  */
-	__asm volatile (mcr\tp15, 0, %0, c1, c0, 2 : : r (0x0fff));
+	armreg_cpacr_write(0x0fff);
 
 	/* Set the control register */
 	curcpu()-ci_ctrl = cpuctrl;
@@ -3592,15 +3590,13 @@ xscale_setup(char *args)
 	cpu_control(0x, cpuctrl);
 
 	/* Make sure write coalescing is turned on */
-	__asm volatile(mrc p15, 0, %0, c1, c0, 1
-		: =r (auxctl));
+	auxctl = armreg_auxctl_read();
 #ifdef XSCALE_NO_COALESCE_WRITES
 	auxctl |= XSCALE_AUXCTL_K;
 #else
 	auxctl = ~XSCALE_AUXCTL_K;
 #endif
-	__asm volatile(mcr p15, 0, %0, c1, c0, 1
-		: : r (auxctl));
+	armreg_auxctl_write(auxctl);
 }
 #endif	/* CPU_XSCALE */
 

Index: src/sys/arch/arm/arm32/sys_machdep.c
diff -u src/sys/arch/arm/arm32/sys_machdep.c:1.21 src/sys/arch/arm/arm32/sys_machdep.c:1.22
--- src/sys/arch/arm/arm32/sys_machdep.c:1.21	Sun Mar 22 21:45:12 2015
+++ src/sys/arch/arm/arm32/sys_machdep.c	Thu Jul  2 08:33:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.21 2015/03/22 21:45:12 joerg Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.22 2015/07/02 08:33:31 skrll Exp $	*/
 
 /*
  * Copyright (c) 1995-1997 Mark Brinicombe.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_machdep.c,v 1.21 2015/03/22 21:45:12 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_machdep.c,v 1.22 2015/07/02 08:33:31 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -170,8 +170,9 @@ cpu_lwp_setprivate(lwp_t *l, void *addr)
 {
 #ifdef _ARM_ARCH_6
 	if (l == curlwp) {
+		u_int val = (u_int)addr;
 		kpreempt_disable();
-		__asm __volatile(mcr p15, 0, %0, c13, c0, 3 : : r (addr));
+		armreg_tpidruro_write(val);
 		kpreempt_enable();
 	}
 	return 0;



CVS commit: src/external/gpl3/gdb/dist/gdb

2015-07-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul  2 14:54:42 UTC 2015

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-thread.c

Log Message:
td_close() needs to be able to write to the process image, so call sooner,
before we detach from it.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/dist/gdb/nbsd-thread.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/gpl3/gdb/dist/gdb/nbsd-thread.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.21 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.22
--- src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.21	Wed Jul 16 07:48:37 2014
+++ src/external/gpl3/gdb/dist/gdb/nbsd-thread.c	Thu Jul  2 10:54:42 2015
@@ -146,8 +146,6 @@ nbsd_thread_activate (void)
 static void
 nbsd_thread_deactivate (void)
 {
-  td_close (main_ta);
-
   inferior_ptid = main_ptid;
   main_ptid = minus_one_ptid;
   cached_thread = main_ptid;
@@ -197,6 +195,7 @@ nbsd_thread_detach (struct target_ops *o
 {
   struct target_ops *beneath = find_target_beneath (ops);
   unpush_target (ops);
+  td_close (main_ta);
   /* Ordinarily, gdb caches solib information, but this means that it
  won't call the new_obfile hook on a reattach. Clear the symbol file
  cache so that attach - detach - attach works. */



CVS import: src/crypto/external/bsd/openssh/dist

2015-07-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  3 00:54:48 UTC 2015

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21228

Log Message:
Changes since OpenSSH 6.8
=

This is primarily a bugfix release.

Security


 * ssh(1): when forwarding X11 connections with ForwardX11Trusted=no,
   connections made after ForwardX11Timeout expired could be permitted
   and no longer subject to XSECURITY restrictions because of an
   ineffective timeout check in ssh(1) coupled with fail open
   behaviour in the X11 server when clients attempted connections with
   expired credentials. This problem was reported by Jann Horn.

 * ssh-agent(1): fix weakness of agent locking (ssh-add -x) to
   password guessing by implementing an increasing failure delay,
   storing a salted hash of the password rather than the password
   itself and using a timing-safe comparison function for verifying
   unlock attempts. This problem was reported by Ryan Castellucci.

New Features


 * ssh(1), sshd(8): promote chacha20-poly1...@openssh.com to be the
   default cipher

 * sshd(8): support admin-specified arguments to AuthorizedKeysCommand;
   bz#2081

 * sshd(8): add AuthorizedPrincipalsCommand that allows retrieving
   authorized principals information from a subprocess rather than
   a file.

 * ssh(1), ssh-add(1): support PKCS#11 devices with external PIN
   entry devices bz#2240

 * sshd(8): allow GSSAPI host credential check to be relaxed for
   multihomed hosts via GSSAPIStrictAcceptorCheck option; bz#928

 * ssh-keygen(1): support ssh-keygen -lF hostname to search
   known_hosts and print key hashes rather than full keys.

 * ssh-agent(1): add -D flag to leave ssh-agent in foreground without
   enabling debug mode; bz#2381

Bugfixes


 * ssh(1), sshd(8): deprecate legacy SSH2_MSG_KEX_DH_GEX_REQUEST_OLD
   message and do not try to use it against some 3rd-party SSH
   implementations that use it (older PuTTY, WinSCP).

 * Many fixes for problems caused by compile-time deactivation of
   SSH1 support (including bz#2369)

 * ssh(1), sshd(8): cap DH-GEX group size at 4Kbits for Cisco
   implementations as some would fail when attempting to use group
   sizes 4K; bz#2209

 * ssh(1): fix out-of-bound read in EscapeChar configuration option
   parsing; bz#2396

 * sshd(8): fix application of PermitTunnel, LoginGraceTime,
   AuthenticationMethods and StreamLocalBindMask options in Match
   blocks

 * ssh(1), sshd(8): improve disconnection message on TCP reset;
   bz#2257

 * ssh(1): remove failed remote forwards established by muliplexing
   from the list of active forwards; bz#2363

 * sshd(8): make parsing of authorized_keys environment= options
   independent of PermitUserEnv being enabled; bz#2329

 * sshd(8): fix post-auth crash with permitopen=none; bz#2355

 * ssh(1), ssh-add(1), ssh-keygen(1): allow new-format private keys
   to be encrypted with AEAD ciphers; bz#2366

 * ssh(1): allow ListenAddress, Port and AddressFamily configuration
   options to appear in any order; bz#86

 * sshd(8): check for and reject missing arguments for VersionAddendum
   and ForceCommand; bz#2281

 * ssh(1), sshd(8): don't treat unknown certificate extensions as
   fatal; bz#2387

 * ssh-keygen(1): make stdout and stderr output consistent; bz#2325

 * ssh(1): mention missing DISPLAY environment in debug log when X11
   forwarding requested; bz#1682

 * sshd(8): correctly record login when UseLogin is set; bz#378

 * sshd(8): Add some missing options to sshd -T output and fix output
   of VersionAddendum and HostCertificate. bz#2346   

 * Document and improve consistency of options that accept a none
   argument TrustedUserCAKeys, RevokedKeys (bz#2382),
   AuthorizedPrincipalsFile (bz#2288)

 * ssh(1): include remote username in debug output; bz#2368

 * sshd(8): avoid compatibility problem with some versions of Tera
   Term, which would crash when they received the hostkeys notification
   message (hostkeys...@openssh.com)

 * sshd(8): mention ssh-keygen -E as useful when comparing legacy MD5
   host key fingerprints; bz#2332

 * ssh(1): clarify pseudo-terminal request behaviour and use make
   manual language consistent; bz#1716

 * ssh(1): document that the TERM environment variable is not subject
   to SendEnv and AcceptEnv; bz#2386


Status:

Vendor Tag: OPENSSH
Release Tags:   v69-20150530

C src/crypto/external/bsd/openssh/dist/PROTOCOL.agent
C src/crypto/external/bsd/openssh/dist/hostfile.c
U src/crypto/external/bsd/openssh/dist/LICENCE
U src/crypto/external/bsd/openssh/dist/OVERVIEW
C src/crypto/external/bsd/openssh/dist/PROTOCOL
U src/crypto/external/bsd/openssh/dist/PROTOCOL.chacha20poly1305
U src/crypto/external/bsd/openssh/dist/PROTOCOL.certkeys
U src/crypto/external/bsd/openssh/dist/auth-bsdauth.c
U src/crypto/external/bsd/openssh/dist/PROTOCOL.key
U 

CVS commit: src/distrib/sets/lists

2015-07-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  3 01:01:00 UTC 2015

Modified Files:
src/distrib/sets/lists/base: ad.aarch64 ad.arm ad.riscv md.sparc64
shl.mi
src/distrib/sets/lists/debug: ad.aarch64 ad.arm ad.riscv md.sparc64
shl.mi

Log Message:
new libssh


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/distrib/sets/lists/base/ad.aarch64
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.19 -r1.20 src/distrib/sets/lists/base/ad.riscv
cvs rdiff -u -r1.252 -r1.253 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.741 -r1.742 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/debug/ad.aarch64
cvs rdiff -u -r1.66 -r1.67 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.19 -r1.20 src/distrib/sets/lists/debug/ad.riscv
cvs rdiff -u -r1.82 -r1.83 src/distrib/sets/lists/debug/md.sparc64
cvs rdiff -u -r1.102 -r1.103 src/distrib/sets/lists/debug/shl.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/base/ad.aarch64
diff -u src/distrib/sets/lists/base/ad.aarch64:1.23 src/distrib/sets/lists/base/ad.aarch64:1.24
--- src/distrib/sets/lists/base/ad.aarch64:1.23	Fri May 29 08:28:08 2015
+++ src/distrib/sets/lists/base/ad.aarch64	Thu Jul  2 21:00:59 2015
@@ -1,4 +1,4 @@
-# $NetBSD: ad.aarch64,v 1.23 2015/05/29 12:28:08 christos Exp $
+# $NetBSD: ad.aarch64,v 1.24 2015/07/03 01:00:59 christos Exp $
 ./lib/eabi	base-compat-shlib	compat
 ./lib/eabi/npf	base-npf-shlib		compat
 ./lib/eabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -297,8 +297,8 @@
 ./usr/lib/eabi/libsl.so.5.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/eabi/libsqlite3.so.1			base-compat-shlib	compat,pic
 ./usr/lib/eabi/libsqlite3.so.1.2			base-compat-shlib	compat,pic
-./usr/lib/eabi/libssh.so.24			base-compat-shlib	compat,pic,crypto
-./usr/lib/eabi/libssh.so.24.0			base-compat-shlib	compat,pic,crypto
+./usr/lib/eabi/libssh.so.25			base-compat-shlib	compat,pic,crypto
+./usr/lib/eabi/libssh.so.25.0			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabi/libssl.so.10			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabi/libssl.so.10.5			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabi/libstdc++.so.7			base-compat-shlib	compat,pic,cxx,gcccmds,libstdcxx
@@ -615,8 +615,8 @@
 ./usr/lib/eabihf/libsl.so.5.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/eabihf/libsqlite3.so.1			base-compat-shlib	compat,pic
 ./usr/lib/eabihf/libsqlite3.so.1.2			base-compat-shlib	compat,pic
-./usr/lib/eabihf/libssh.so.24			base-compat-shlib	compat,pic,crypto
-./usr/lib/eabihf/libssh.so.24.0			base-compat-shlib	compat,pic,crypto
+./usr/lib/eabihf/libssh.so.25			base-compat-shlib	compat,pic,crypto
+./usr/lib/eabihf/libssh.so.25.0			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabihf/libssl.so.10			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabihf/libssl.so.10.5			base-compat-shlib	compat,pic,crypto
 ./usr/lib/eabihf/libstdc++.so.7			base-compat-shlib	compat,pic,cxx,gcccmds,libstdcxx
@@ -931,8 +931,8 @@
 ./usr/lib/oabi/libsl.so.5.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/oabi/libsqlite3.so.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libsqlite3.so.1.2		base-compat-shlib	compat,pic
-./usr/lib/oabi/libssh.so.24			base-compat-shlib	compat,pic,crypto
-./usr/lib/oabi/libssh.so.24.0			base-compat-shlib	compat,pic,crypto
+./usr/lib/oabi/libssh.so.25			base-compat-shlib	compat,pic,crypto
+./usr/lib/oabi/libssh.so.25.0			base-compat-shlib	compat,pic,crypto
 ./usr/lib/oabi/libssl.so.10			base-compat-shlib	compat,pic,crypto
 ./usr/lib/oabi/libssl.so.10.5			base-compat-shlib	compat,pic,crypto
 ./usr/lib/oabi/libstdc++.so.7			base-compat-shlib	compat,pic,cxx,gcccmds,libstdcxx

Index: src/distrib/sets/lists/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.75 src/distrib/sets/lists/base/ad.arm:1.76
--- src/distrib/sets/lists/base/ad.arm:1.75	Sat May 30 13:39:56 2015
+++ src/distrib/sets/lists/base/ad.arm	Thu Jul  2 21:00:59 2015
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.75 2015/05/30 17:39:56 joerg Exp $
+# $NetBSD: ad.arm,v 1.76 2015/07/03 01:00:59 christos Exp $
 ./lib/oabi	base-compat-shlib	compat
 ./lib/oabi/npf	base-npf-shlib		compat
 ./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -303,8 +303,8 @@
 ./usr/lib/oabi/libsqlite3.so.1.2		base-compat-shlib	compat,pic
 ./usr/lib/oabi/libss.so.6			base-compat-shlib	obsolete
 ./usr/lib/oabi/libss.so.6.0			base-compat-shlib	obsolete
-./usr/lib/oabi/libssh.so.24			base-compat-shlib	compat,pic,crypto
-./usr/lib/oabi/libssh.so.24.0			base-compat-shlib	compat,pic,crypto
+./usr/lib/oabi/libssh.so.25			base-compat-shlib	compat,pic,crypto
+./usr/lib/oabi/libssh.so.25.0			base-compat-shlib	compat,pic,crypto
 ./usr/lib/oabi/libssl.so.10			base-compat-shlib	compat,pic,crypto
 ./usr/lib/oabi/libssl.so.10.5			base-compat-shlib	compat,pic,crypto

CVS commit: src/sys/compat/linux/common

2015-07-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul  3 02:24:28 UTC 2015

Modified Files:
src/sys/compat/linux/common: linux_sched.c

Log Message:
PR/50021: Rin Okuyama: Fix linux affinity syscalls
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/common/linux_sched.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/linux/common/linux_sched.c
diff -u src/sys/compat/linux/common/linux_sched.c:1.67 src/sys/compat/linux/common/linux_sched.c:1.68
--- src/sys/compat/linux/common/linux_sched.c:1.67	Sun Nov  9 12:48:08 2014
+++ src/sys/compat/linux/common/linux_sched.c	Thu Jul  2 22:24:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sched.c,v 1.67 2014/11/09 17:48:08 maxv Exp $	*/
+/*	$NetBSD: linux_sched.c,v 1.68 2015/07/03 02:24:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_sched.c,v 1.67 2014/11/09 17:48:08 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_sched.c,v 1.68 2015/07/03 02:24:28 christos Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -65,6 +65,9 @@ __KERNEL_RCSID(0, $NetBSD: linux_sched.
 static int linux_clone_nptl(struct lwp *, const struct linux_sys_clone_args *,
 register_t *);
 
+/* Unlike Linux, dynamically calculate CPU mask size */
+#define	LINUX_CPU_MASK_SIZE (sizeof(long) * ((ncpu + LONG_BIT - 1) / LONG_BIT))
+
 #if DEBUG_LINUX
 #define DPRINTF(x) uprintf x
 #else
@@ -627,6 +630,10 @@ linux_sys_gettid(struct lwp *l, const vo
 	return 0;
 }
 
+/*
+ * The affinity syscalls assume that the layout of our cpu kcpuset is
+ * the same as linux's: a linear bitmask.
+ */
 int
 linux_sys_sched_getaffinity(struct lwp *l, const struct linux_sys_sched_getaffinity_args *uap, register_t *retval)
 {
@@ -635,39 +642,45 @@ linux_sys_sched_getaffinity(struct lwp *
 		syscallarg(unsigned int) len;
 		syscallarg(unsigned long *) mask;
 	} */
-	proc_t *p;
-	unsigned long *lp, *data;
-	int error, size, nb = ncpu;
+	struct lwp *t;
+	kcpuset_t *kcset;
+	size_t size;
+	cpuid_t i;
+	int error;
 
-	/* Unlike Linux, dynamically calculate cpu mask size */
-	size = sizeof(long) * ((ncpu + LONG_BIT - 1) / LONG_BIT);
+	size = LINUX_CPU_MASK_SIZE;
 	if (SCARG(uap, len)  size)
 		return EINVAL;
 
-	/* XXX: Pointless check.  TODO: Actually implement this. */
-	mutex_enter(proc_lock);
-	p = proc_find(SCARG(uap, pid));
-	mutex_exit(proc_lock);
-	if (p == NULL) {
+	/* Lock the LWP */
+	t = lwp_find2(SCARG(uap, pid), l-l_lid);
+	if (t == NULL)
 		return ESRCH;
-	}
-
-	/* 
-	 * return the actual number of CPU, tag all of them as available 
-	 * The result is a mask, the first CPU being in the least significant
-	 * bit.
-	 */
-	data = kmem_zalloc(size, KM_SLEEP);
-	lp = data;
-	while (nb  LONG_BIT) {
-		*lp++ = ~0UL;
-		nb -= LONG_BIT;
-	}
-	if (nb)
-		*lp = (1  ncpu) - 1;
 
-	error = copyout(data, SCARG(uap, mask), size);
-	kmem_free(data, size);
+	/* Check the permission */
+	if (kauth_authorize_process(l-l_cred,
+	KAUTH_PROCESS_SCHEDULER_GETAFFINITY, t-l_proc, NULL, NULL, NULL)) {
+		mutex_exit(t-l_proc-p_lock);
+		return EPERM;
+	}
+
+	kcpuset_create(kcset, true);
+	lwp_lock(t);
+	if (t-l_affinity != NULL)
+		kcpuset_copy(kcset, t-l_affinity);
+	else {
+		/*
+		 * All available CPUs should be masked when affinity has not
+		 * been set.
+		 */
+		kcpuset_zero(kcset);
+		for (i = 0; i  ncpu; i++)
+			kcpuset_set(kcset, i);
+	}
+	lwp_unlock(t);
+	mutex_exit(t-l_proc-p_lock);
+	error = kcpuset_copyout(kcset, (cpuset_t *)SCARG(uap, mask), size);
+	kcpuset_unuse(kcset, NULL);
 	*retval = size;
 	return error;
 }
@@ -680,17 +693,17 @@ linux_sys_sched_setaffinity(struct lwp *
 		syscallarg(unsigned int) len;
 		syscallarg(unsigned long *) mask;
 	} */
-	proc_t *p;
+	struct sys__sched_setaffinity_args ssa;
+	size_t size;
 
-	/* XXX: Pointless check.  TODO: Actually implement this. */
-	mutex_enter(proc_lock);
-	p = proc_find(SCARG(uap, pid));
-	mutex_exit(proc_lock);
-	if (p == NULL) {
-		return ESRCH;
-	}
+	size = LINUX_CPU_MASK_SIZE;
+	if (SCARG(uap, len)  size)
+		return EINVAL;
 
-	/* Let's ignore it */
-	DPRINTF((%s\n, __func__));
-	return 0;
+	SCARG(ssa, pid) = SCARG(uap, pid);
+	SCARG(ssa, lid) = l-l_lid;
+	SCARG(ssa, size) = size;
+	SCARG(ssa, cpuset) = (cpuset_t *)SCARG(uap, mask);
+
+	return sys__sched_setaffinity(l, ssa, retval);
 }