From owner-svn-src-stable-10@freebsd.org Sun Feb 19 03:17:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD4ACE3BCC; Sun, 19 Feb 2017 03:17:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86C661D21; Sun, 19 Feb 2017 03:17:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1J3HB1S059754; Sun, 19 Feb 2017 03:17:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1J3HBCm059753; Sun, 19 Feb 2017 03:17:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702190317.v1J3HBCm059753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Feb 2017 03:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313932 - stable/10/sys/fs/devfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2017 03:17:12 -0000 Author: kib Date: Sun Feb 19 03:17:11 2017 New Revision: 313932 URL: https://svnweb.freebsd.org/changeset/base/313932 Log: MFC r313797: Minor style fixes. Modified: stable/10/sys/fs/devfs/devfs_devs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_devs.c Sun Feb 19 03:11:14 2017 (r313931) +++ stable/10/sys/fs/devfs/devfs_devs.c Sun Feb 19 03:17:11 2017 (r313932) @@ -208,7 +208,7 @@ devfs_newdirent(char *name, int namelen) struct dirent d; d.d_namlen = namelen; - i = sizeof (*de) + GENERIC_DIRSIZ(&d); + i = sizeof(*de) + GENERIC_DIRSIZ(&d); de = malloc(i, M_DEVFS3, M_WAITOK | M_ZERO); de->de_dirent = (struct dirent *)(de + 1); de->de_dirent->d_namlen = namelen; @@ -246,7 +246,8 @@ devfs_parent_dirent(struct devfs_dirent } struct devfs_dirent * -devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) +devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, + struct devfs_dirent *dotdot, u_int inode) { struct devfs_dirent *dd; struct devfs_dirent *de; From owner-svn-src-stable-10@freebsd.org Sun Feb 19 21:10:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34ECDCE6042; Sun, 19 Feb 2017 21:10:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF241CB1; Sun, 19 Feb 2017 21:10:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1JLAZoF093275; Sun, 19 Feb 2017 21:10:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1JLAZM2093274; Sun, 19 Feb 2017 21:10:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702192110.v1JLAZM2093274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 19 Feb 2017 21:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313971 - stable/10/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2017 21:10:36 -0000 Author: pfg Date: Sun Feb 19 21:10:34 2017 New Revision: 313971 URL: https://svnweb.freebsd.org/changeset/base/313971 Log: MFC r313819: Remove outdated claim. Despite wishful thinking the removal of these old functions hasn't happened yet. Modified: stable/10/include/stdlib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/include/stdlib.h ============================================================================== --- stable/10/include/stdlib.h Sun Feb 19 21:08:10 2017 (r313970) +++ stable/10/include/stdlib.h Sun Feb 19 21:10:34 2017 (r313971) @@ -298,7 +298,7 @@ void srandomdev(void); long long strtonum(const char *, long long, long long, const char **); -/* Deprecated interfaces, to be removed in FreeBSD 6.0. */ +/* Deprecated interfaces, to be removed. */ __int64_t strtoq(const char *, char **, int); __uint64_t From owner-svn-src-stable-10@freebsd.org Mon Feb 20 10:51:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C80ECE60F1; Mon, 20 Feb 2017 10:51:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 190FC1AE9; Mon, 20 Feb 2017 10:51:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1KApk1X033564; Mon, 20 Feb 2017 10:51:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KApkkS033563; Mon, 20 Feb 2017 10:51:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702201051.v1KApkkS033563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Feb 2017 10:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313991 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2017 10:51:47 -0000 Author: kib Date: Mon Feb 20 10:51:46 2017 New Revision: 313991 URL: https://svnweb.freebsd.org/changeset/base/313991 Log: MFC r313693: Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers. Modified: stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_mmap.c ============================================================================== --- stable/10/sys/vm/vm_mmap.c Mon Feb 20 10:49:04 2017 (r313990) +++ stable/10/sys/vm/vm_mmap.c Mon Feb 20 10:51:46 2017 (r313991) @@ -113,14 +113,8 @@ struct sbrk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sbrk(td, uap) - struct thread *td; - struct sbrk_args *uap; +sys_sbrk(struct thread *td, struct sbrk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -132,14 +126,8 @@ struct sstk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sstk(td, uap) - struct thread *td; - struct sstk_args *uap; +sys_sstk(struct thread *td, struct sstk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -153,11 +141,9 @@ struct getpagesize_args { #endif int -ogetpagesize(td, uap) - struct thread *td; - struct getpagesize_args *uap; +ogetpagesize(struct thread *td, struct getpagesize_args *uap) { - /* MP SAFE */ + td->td_retval[0] = PAGE_SIZE; return (0); } @@ -189,9 +175,6 @@ struct mmap_args { }; #endif -/* - * MPSAFE - */ int sys_mmap(td, uap) struct thread *td; @@ -519,9 +502,6 @@ struct msync_args { int flags; }; #endif -/* - * MPSAFE - */ int sys_msync(td, uap) struct thread *td; @@ -574,9 +554,6 @@ struct munmap_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munmap(td, uap) struct thread *td; @@ -650,9 +627,6 @@ struct mprotect_args { int prot; }; #endif -/* - * MPSAFE - */ int sys_mprotect(td, uap) struct thread *td; @@ -692,13 +666,8 @@ struct minherit_args { int inherit; }; #endif -/* - * MPSAFE - */ int -sys_minherit(td, uap) - struct thread *td; - struct minherit_args *uap; +sys_minherit(struct thread *td, struct minherit_args *uap) { vm_offset_t addr; vm_size_t size, pageoff; @@ -733,13 +702,8 @@ struct madvise_args { }; #endif -/* - * MPSAFE - */ int -sys_madvise(td, uap) - struct thread *td; - struct madvise_args *uap; +sys_madvise(struct thread *td, struct madvise_args *uap) { vm_offset_t start, end; vm_map_t map; @@ -791,13 +755,8 @@ struct mincore_args { }; #endif -/* - * MPSAFE - */ int -sys_mincore(td, uap) - struct thread *td; - struct mincore_args *uap; +sys_mincore(struct thread *td, struct mincore_args *uap) { vm_offset_t addr, first_addr; vm_offset_t end, cend; @@ -1050,13 +1009,8 @@ struct mlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int -sys_mlock(td, uap) - struct thread *td; - struct mlock_args *uap; +sys_mlock(struct thread *td, struct mlock_args *uap) { return (vm_mlock(td->td_proc, td->td_ucred, uap->addr, uap->len)); @@ -1122,13 +1076,8 @@ struct mlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_mlockall(td, uap) - struct thread *td; - struct mlockall_args *uap; +sys_mlockall(struct thread *td, struct mlockall_args *uap) { vm_map_t map; int error; @@ -1199,13 +1148,8 @@ struct munlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_munlockall(td, uap) - struct thread *td; - struct munlockall_args *uap; +sys_munlockall(struct thread *td, struct munlockall_args *uap) { vm_map_t map; int error; @@ -1240,9 +1184,6 @@ struct munlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munlock(td, uap) struct thread *td; @@ -1397,8 +1338,6 @@ done: /* * vm_mmap_cdev() * - * MPSAFE - * * Helper function for vm_mmap. Perform sanity check specific for mmap * operations on cdevs. */ From owner-svn-src-stable-10@freebsd.org Mon Feb 20 20:16:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E56F6CE64ED; Mon, 20 Feb 2017 20:16:12 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B46411313; Mon, 20 Feb 2017 20:16:12 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1KKGBTN064962; Mon, 20 Feb 2017 20:16:11 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1KKGBx4064961; Mon, 20 Feb 2017 20:16:11 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702202016.v1KKGBx4064961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 20 Feb 2017 20:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313998 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2017 20:16:13 -0000 Author: ken Date: Mon Feb 20 20:16:11 2017 New Revision: 313998 URL: https://svnweb.freebsd.org/changeset/base/313998 Log: MFC 313895: ------------------------------------------------------------------------ r313895 | ken | 2017-02-17 13:15:27 -0700 (Fri, 17 Feb 2017) | 9 lines Make ctl(4) build with CTL_IO_DELAY defined. sys/cam/ctl/ctl.c: In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill it in before trying to dereference it. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Feb 20 20:12:02 2017 (r313997) +++ stable/10/sys/cam/ctl/ctl.c Mon Feb 20 20:16:11 2017 (r313998) @@ -12393,6 +12393,9 @@ ctl_datamove(union ctl_io *io) if (io->io_hdr.flags & CTL_FLAG_DELAY_DONE) { io->io_hdr.flags &= ~CTL_FLAG_DELAY_DONE; } else { + struct ctl_lun *lun; + + lun = CTL_LUN(io); if ((lun != NULL) && (lun->delay_info.datamove_delay > 0)) { From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:18:46 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C09CE7AF7; Tue, 21 Feb 2017 02:18:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54E891F23; Tue, 21 Feb 2017 02:18:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2IjpH011761; Tue, 21 Feb 2017 02:18:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2IjUp011759; Tue, 21 Feb 2017 02:18:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210218.v1L2IjUp011759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314004 - in stable/10: contrib/netbsd-tests/usr.bin/sed usr.bin/sed/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:18:46 -0000 Author: ngie Date: Tue Feb 21 02:18:45 2017 New Revision: 314004 URL: https://svnweb.freebsd.org/changeset/base/314004 Log: MFC r312520: Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test suite as usr.bin/sed/sed_test Don't expect :emptybackref to fail -- it succeeds on FreeBSD Expect :preserve_leading_ws_ia to fail -- it fails on ^/stable/10, but not on ^/stable/11 or ^/head Modified: stable/10/contrib/netbsd-tests/usr.bin/sed/t_sed.sh stable/10/usr.bin/sed/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/usr.bin/sed/t_sed.sh ============================================================================== --- stable/10/contrib/netbsd-tests/usr.bin/sed/t_sed.sh Tue Feb 21 02:15:58 2017 (r314003) +++ stable/10/contrib/netbsd-tests/usr.bin/sed/t_sed.sh Tue Feb 21 02:18:45 2017 (r314004) @@ -126,6 +126,8 @@ preserve_leading_ws_ia_head() { } preserve_leading_ws_ia_body() { + atf_expect_fail "fails on ^/stable/10" + atf_check -o inline:" 1 2 3\n4 5 6\n 7 8 9\n\n" \ -x 'echo | sed -e "/^$/i\\ 1 2 3\\ Modified: stable/10/usr.bin/sed/tests/Makefile ============================================================================== --- stable/10/usr.bin/sed/tests/Makefile Tue Feb 21 02:15:58 2017 (r314003) +++ stable/10/usr.bin/sed/tests/Makefile Tue Feb 21 02:18:45 2017 (r314004) @@ -1,5 +1,6 @@ # $FreeBSD$ +NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test TEST_METADATA.multi_test+= required_files="/usr/share/dict/words" @@ -31,7 +32,10 @@ FILES+= regress.s5.out FILES+= regress.sg.out FILES+= regress.sh FILES+= regress.y.out +ATF_TESTS_SH_SED_sed_test+= -e 's,atf_expect_fail "PR bin/28126",,g' +FILES+= d_c2048.in SUBDIR= regress.multitest.out +.include .include From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:23:29 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F070CE7EBC; Tue, 21 Feb 2017 02:23:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFBE4163F; Tue, 21 Feb 2017 02:23:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2NSSx015692; Tue, 21 Feb 2017 02:23:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2NS9t015691; Tue, 21 Feb 2017 02:23:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210223.v1L2NS9t015691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314006 - stable/10/usr.bin/bluetooth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:23:29 -0000 Author: ngie Date: Tue Feb 21 02:23:27 2017 New Revision: 314006 URL: https://svnweb.freebsd.org/changeset/base/314006 Log: MFC r313656: Use SRCTOP to define .include with usr.bin/Makefile.inc Modified: stable/10/usr.bin/bluetooth/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bluetooth/Makefile.inc ============================================================================== --- stable/10/usr.bin/bluetooth/Makefile.inc Tue Feb 21 02:19:19 2017 (r314005) +++ stable/10/usr.bin/bluetooth/Makefile.inc Tue Feb 21 02:23:27 2017 (r314006) @@ -1,4 +1,4 @@ # $FreeBSD$ -.include "${.CURDIR}/../../Makefile.inc" +.include "${SRCTOP}/usr.bin/Makefile.inc" From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:24:32 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5800CE7FCB; Tue, 21 Feb 2017 02:24:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84A4218FA; Tue, 21 Feb 2017 02:24:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2OVFm015860; Tue, 21 Feb 2017 02:24:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2OVEa015859; Tue, 21 Feb 2017 02:24:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210224.v1L2OVEa015859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314008 - stable/10/usr.bin/atm/sscop X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:24:32 -0000 Author: ngie Date: Tue Feb 21 02:24:31 2017 New Revision: 314008 URL: https://svnweb.freebsd.org/changeset/base/314008 Log: MFC r313653: Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output Modified: stable/10/usr.bin/atm/sscop/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/atm/sscop/Makefile ============================================================================== --- stable/10/usr.bin/atm/sscop/Makefile Tue Feb 21 02:23:57 2017 (r314007) +++ stable/10/usr.bin/atm/sscop/Makefile Tue Feb 21 02:24:31 2017 (r314008) @@ -1,6 +1,6 @@ # $FreeBSD$ -CONTRIB= ${.CURDIR}/../../../contrib/ngatm/sscop +CONTRIB= ${SRCTOP}/contrib/ngatm/sscop .PATH: ${CONTRIB} From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:33:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57968CE74E2; Tue, 21 Feb 2017 02:33:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224AC65D; Tue, 21 Feb 2017 02:33:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2XhkZ020451; Tue, 21 Feb 2017 02:33:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2Xgko020439; Tue, 21 Feb 2017 02:33:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210233.v1L2Xgko020439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314013 - in stable/10/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:33:44 -0000 Author: ngie Date: Tue Feb 21 02:33:41 2017 New Revision: 314013 URL: https://svnweb.freebsd.org/changeset/base/314013 Log: MFC r313679: Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu of ../ elsewhere This simplifies pathing in make/displayed output Modified: stable/10/usr.bin/svn/Makefile.inc stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svnadmin/Makefile stable/10/usr.bin/svn/svnbench/Makefile stable/10/usr.bin/svn/svndumpfilter/Makefile stable/10/usr.bin/svn/svnfsfs/Makefile stable/10/usr.bin/svn/svnlook/Makefile stable/10/usr.bin/svn/svnmucc/Makefile stable/10/usr.bin/svn/svnrdump/Makefile stable/10/usr.bin/svn/svnserve/Makefile stable/10/usr.bin/svn/svnsync/Makefile stable/10/usr.bin/svn/svnversion/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/svn/Makefile.inc ============================================================================== --- stable/10/usr.bin/svn/Makefile.inc Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/Makefile.inc Tue Feb 21 02:33:41 2017 (r314013) @@ -10,35 +10,33 @@ SVNLITE?= lite .if !defined(SVNDIR) -SVNDIR= ${.CURDIR}/../../../contrib/subversion/subversion -APRU= ${.CURDIR}/../../../contrib/apr-util -APR= ${.CURDIR}/../../../contrib/apr +SVNDIR= ${SRCTOP}/contrib/subversion/subversion +APRU= ${SRCTOP}/contrib/apr-util +APR= ${SRCTOP}/contrib/apr SQLITE= ${.CURDIR}/../../../contrib/sqlite3 WARNS?= 0 # definitely not warns friendly -.if exists(${.CURDIR}/../../Makefile.inc) -.include "${.CURDIR}/../../Makefile.inc" -.endif +.sinclude "${.CURDIR:H:H}/Makefile.inc" -LIBAPRDIR= ${.OBJDIR}/../lib/libapr -LIBAPR_UTILDIR= ${.OBJDIR}/../lib/libapr_util -LIBSQLITEDIR= ${.OBJDIR}/../lib/libsqlite3 -LIBSERFDIR= ${.OBJDIR}/../lib/libserf - -LIBSVN_CLIENTDIR= ${.OBJDIR}/../lib/libsvn_client -LIBSVN_DELTADIR= ${.OBJDIR}/../lib/libsvn_delta -LIBSVN_DIFFDIR= ${.OBJDIR}/../lib/libsvn_diff -LIBSVN_FSDIR= ${.OBJDIR}/../lib/libsvn_fs -LIBSVN_FS_FSDIR= ${.OBJDIR}/../lib/libsvn_fs_fs -LIBSVN_FS_UTILDIR= ${.OBJDIR}/../lib/libsvn_fs_util -LIBSVN_FS_XDIR= ${.OBJDIR}/../lib/libsvn_fs_x -LIBSVN_RADIR= ${.OBJDIR}/../lib/libsvn_ra -LIBSVN_RA_LOCALDIR= ${.OBJDIR}/../lib/libsvn_ra_local -LIBSVN_RA_SVNDIR= ${.OBJDIR}/../lib/libsvn_ra_svn -LIBSVN_RA_SERFDIR= ${.OBJDIR}/../lib/libsvn_ra_serf -LIBSVN_REPOSDIR= ${.OBJDIR}/../lib/libsvn_repos -LIBSVN_SUBRDIR= ${.OBJDIR}/../lib/libsvn_subr -LIBSVN_WCDIR= ${.OBJDIR}/../lib/libsvn_wc +LIBAPRDIR= ${.OBJDIR:H}/lib/libapr +LIBAPR_UTILDIR= ${.OBJDIR:H}/lib/libapr_util +LIBSQLITEDIR= ${.OBJDIR:H}/lib/libsqlite3 +LIBSERFDIR= ${.OBJDIR:H}/lib/libserf + +LIBSVN_CLIENTDIR= ${.OBJDIR:H}/lib/libsvn_client +LIBSVN_DELTADIR= ${.OBJDIR:H}/lib/libsvn_delta +LIBSVN_DIFFDIR= ${.OBJDIR:H}/lib/libsvn_diff +LIBSVN_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs +LIBSVN_FS_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs_fs +LIBSVN_FS_UTILDIR= ${.OBJDIR:H}/lib/libsvn_fs_util +LIBSVN_FS_XDIR= ${.OBJDIR:H}/lib/libsvn_fs_x +LIBSVN_RADIR= ${.OBJDIR:H}/lib/libsvn_ra +LIBSVN_RA_LOCALDIR= ${.OBJDIR:H}/lib/libsvn_ra_local +LIBSVN_RA_SVNDIR= ${.OBJDIR:H}/lib/libsvn_ra_svn +LIBSVN_RA_SERFDIR= ${.OBJDIR:H}/lib/libsvn_ra_serf +LIBSVN_REPOSDIR= ${.OBJDIR:H}/lib/libsvn_repos +LIBSVN_SUBRDIR= ${.OBJDIR:H}/lib/libsvn_subr +LIBSVN_WCDIR= ${.OBJDIR:H}/lib/libsvn_wc LIBAPR= ${LIBAPRDIR}/libapr.a LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a Modified: stable/10/usr.bin/svn/svn/Makefile ============================================================================== --- stable/10/usr.bin/svn/svn/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svn/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svn @@ -19,11 +19,11 @@ SRCS= add-cmd.c auth-cmd.c blame-cmd.c c resolved-cmd.c revert-cmd.c status-cmd.c similarity.c status.c \ svn.c switch-cmd.c unlock-cmd.c update-cmd.c upgrade-cmd.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnadmin/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnadmin/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnadmin/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnadmin @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}admin SRCS= svnadmin.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnbench/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnbench/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnbench/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnbench @@ -11,11 +11,11 @@ PROG= svn${SVNLITE}bench SRCS= help-cmd.c notify.c null-blame-cmd.c null-export-cmd.c \ null-info-cmd.c null-list-cmd.c null-log-cmd.c svnbench.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- stable/10/usr.bin/svn/svndumpfilter/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svndumpfilter/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svndumpfilter @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}dumpfilter SRCS= svndumpfilter.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnfsfs/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnfsfs/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnfsfs/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnfsfs @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}fsfs SRCS= dump-index-cmd.c load-index-cmd.c stats-cmd.c svnfsfs.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnlook/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnlook/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnlook/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnlook @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}look SRCS= svnlook.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnmucc/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnmucc/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnmucc/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnmucc @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}mucc SRCS= svnmucc.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnrdump/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnrdump/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnrdump/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnrdump @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}rdump SRCS= dump_editor.c load_editor.c svnrdump.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnserve/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnserve/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnserve/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnserve @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}serve SRCS= cyrus_auth.c log-escape.c logger.c serve.c svnserve.c winservice.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnsync/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnsync/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnsync/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnsync @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}sync SRCS= svnsync.c sync.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: stable/10/usr.bin/svn/svnversion/Makefile ============================================================================== --- stable/10/usr.bin/svn/svnversion/Makefile Tue Feb 21 02:33:28 2017 (r314012) +++ stable/10/usr.bin/svn/svnversion/Makefile Tue Feb 21 02:33:41 2017 (r314013) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnversion @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}version SRCS= svnversion.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:35:01 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14DE5CE759F; Tue, 21 Feb 2017 02:35:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D588F85A; Tue, 21 Feb 2017 02:35:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2YxVa020600; Tue, 21 Feb 2017 02:34:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2YxQY020599; Tue, 21 Feb 2017 02:34:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210234.v1L2YxQY020599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314014 - stable/10/usr.bin/awk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:35:01 -0000 Author: ngie Date: Tue Feb 21 02:34:59 2017 New Revision: 314014 URL: https://svnweb.freebsd.org/changeset/base/314014 Log: MFC r313654: Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix for maketab.c The former simplifies pathing in make/displayed output, whereas the latter was just unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in the Makefile. Modified: stable/10/usr.bin/awk/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/awk/Makefile ============================================================================== --- stable/10/usr.bin/awk/Makefile Tue Feb 21 02:33:41 2017 (r314013) +++ stable/10/usr.bin/awk/Makefile Tue Feb 21 02:34:59 2017 (r314014) @@ -1,6 +1,6 @@ # $FreeBSD$ -AWKSRC= ${.CURDIR}/../../contrib/one-true-awk +AWKSRC= ${SRCTOP}/contrib/one-true-awk .PATH: ${AWKSRC} PROG= awk @@ -25,6 +25,6 @@ proctab.c: maketab ./maketab > proctab.c build-tools: maketab -maketab: ytab.h ${AWKSRC}/maketab.c +maketab: ytab.h maketab.c .include From owner-svn-src-stable-10@freebsd.org Tue Feb 21 02:38:15 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23B4CE784E; Tue, 21 Feb 2017 02:38:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1639DCD; Tue, 21 Feb 2017 02:38:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L2cECr020962; Tue, 21 Feb 2017 02:38:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L2cEq4020961; Tue, 21 Feb 2017 02:38:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210238.v1L2cEq4020961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 02:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314016 - stable/10/usr.bin/bsdcat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 02:38:16 -0000 Author: ngie Date: Tue Feb 21 02:38:14 2017 New Revision: 314016 URL: https://svnweb.freebsd.org/changeset/base/314016 Log: MFC r313652: Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output Modified: stable/10/usr.bin/bsdcat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bsdcat/Makefile ============================================================================== --- stable/10/usr.bin/bsdcat/Makefile Tue Feb 21 02:35:16 2017 (r314015) +++ stable/10/usr.bin/bsdcat/Makefile Tue Feb 21 02:38:14 2017 (r314016) @@ -2,10 +2,10 @@ .include -_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive -_LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive +_LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive -PROG= bsdcat +PROG= bsdcat BSDCAT_VERSION_STRING= 3.2.2 .PATH: ${_LIBARCHIVEDIR}/cat From owner-svn-src-stable-10@freebsd.org Tue Feb 21 03:00:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2806BCE7147; Tue, 21 Feb 2017 03:00:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E75F319C7; Tue, 21 Feb 2017 03:00:34 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L30XdH029201; Tue, 21 Feb 2017 03:00:33 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L30X2Y029200; Tue, 21 Feb 2017 03:00:33 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210300.v1L30X2Y029200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 03:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314017 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 03:00:35 -0000 Author: sephe Date: Tue Feb 21 03:00:33 2017 New Revision: 314017 URL: https://svnweb.freebsd.org/changeset/base/314017 Log: MFC 311475 if: Defer the if_up until the ifnet.if_ioctl is called. This ensures the interface is initialized by the interface driver before it can be used by the rest of the system. Reviewed by: jhb, karels, gnn Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8905 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Tue Feb 21 02:38:14 2017 (r314016) +++ stable/10/sys/net/if.c Tue Feb 21 03:00:33 2017 (r314017) @@ -2266,7 +2266,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, { struct ifreq *ifr; struct ifstat *ifs; - int error = 0; + int error = 0, do_ifup = 0; int new_flags, temp_flags; size_t namelen, onamelen; size_t descrlen; @@ -2394,7 +2394,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, if_down(ifp); } else if (new_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) { - if_up(ifp); + do_ifup = 1; } /* See if permanently promiscuous mode bit is about to flip */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { @@ -2413,6 +2413,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, if (ifp->if_ioctl) { (void) (*ifp->if_ioctl)(ifp, cmd, data); } + if (do_ifup) + if_up(ifp); getmicrotime(&ifp->if_lastchange); break; From owner-svn-src-stable-10@freebsd.org Tue Feb 21 03:14:07 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6225CE78D2; Tue, 21 Feb 2017 03:14:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BB194E; Tue, 21 Feb 2017 03:14:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L3E6qW038035; Tue, 21 Feb 2017 03:14:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3E63G038030; Tue, 21 Feb 2017 03:14:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210314.v1L3E63G038030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 03:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314018 - in stable/10/sys/dev/hyperv: include utilities vmbus vmbus/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 03:14:07 -0000 Author: sephe Date: Tue Feb 21 03:14:05 2017 New Revision: 314018 URL: https://svnweb.freebsd.org/changeset/base/314018 Log: MFC 311743 hyperv: Add method to read 64bit Hyper-V specific time value. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9057 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c stable/10/sys/dev/hyperv/vmbus/hyperv.c stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Tue Feb 21 03:00:33 2017 (r314017) +++ stable/10/sys/dev/hyperv/include/hyperv.h Tue Feb 21 03:14:05 2017 (r314018) @@ -79,9 +79,17 @@ struct hyperv_guid { #define HYPERV_GUID_STRLEN 40 -int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +typedef uint64_t (*hyperv_tc64_t)(void); -extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +int hyperv_guid2str(const struct hyperv_guid *, char *, + size_t); + +/* + * hyperv_tc64 could be NULL, if there were no suitable Hyper-V + * specific timecounter. + */ +extern hyperv_tc64_t hyperv_tc64; +extern u_int hyperv_features; /* CPUID_HV_MSR_ */ #endif /* _KERNEL */ Modified: stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Feb 21 03:00:33 2017 (r314017) +++ stable/10/sys/dev/hyperv/utilities/vmbus_timesync.c Tue Feb 21 03:14:05 2017 (r314018) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); VMBUS_ICVER_LE(VMBUS_IC_VERSION(4, 0), (sc)->ic_msgver) #define VMBUS_TIMESYNC_DORTT(sc) \ - (VMBUS_TIMESYNC_MSGVER4((sc)) &&\ - (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + (VMBUS_TIMESYNC_MSGVER4((sc)) && hyperv_tc64 != NULL) static int vmbus_timesync_probe(device_t); static int vmbus_timesync_attach(device_t); @@ -117,7 +116,7 @@ vmbus_timesync(struct vmbus_ic_softc *sc uint64_t hv_ns, vm_ns, rtt = 0; if (VMBUS_TIMESYNC_DORTT(sc)) - rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; + rtt = hyperv_tc64() - sent_tc; hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(&vm_ts); Modified: stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Feb 21 03:00:33 2017 (r314017) +++ stable/10/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Tue Feb 21 03:14:05 2017 (r314018) @@ -118,8 +118,8 @@ hyperv_tsc_mmap(struct cdev *dev __unuse } #define HYPERV_TSC_TIMECOUNT(fence) \ -static u_int \ -hyperv_tsc_timecount_##fence(struct timecounter *tc) \ +static uint64_t \ +hyperv_tc64_tsc_##fence(void) \ { \ struct hyperv_reftsc *tsc_ref = hyperv_ref_tsc.tsc_ref; \ uint32_t seq; \ @@ -150,6 +150,13 @@ hyperv_tsc_timecount_##fence(struct time /* Fallback to the generic timecounter, i.e. rdmsr. */ \ return (rdmsr(MSR_HV_TIME_REF_COUNT)); \ } \ + \ +static u_int \ +hyperv_tsc_timecount_##fence(struct timecounter *tc __unused) \ +{ \ + \ + return (hyperv_tc64_tsc_##fence()); \ +} \ struct __hack HYPERV_TSC_TIMECOUNT(lfence); @@ -158,6 +165,7 @@ HYPERV_TSC_TIMECOUNT(mfence); static void hyperv_tsc_tcinit(void *dummy __unused) { + hyperv_tc64_t tc64 = NULL; uint64_t val, orig; if ((hyperv_features & @@ -170,11 +178,13 @@ hyperv_tsc_tcinit(void *dummy __unused) case CPU_VENDOR_AMD: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_mfence; + tc64 = hyperv_tc64_tsc_mfence; break; case CPU_VENDOR_INTEL: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_lfence; + tc64 = hyperv_tc64_tsc_lfence; break; default: @@ -199,6 +209,10 @@ hyperv_tsc_tcinit(void *dummy __unused) /* Register "enlightened" timecounter. */ tc_init(&hyperv_tsc_timecounter); + /* Install 64 bits timecounter method for other modules to use. */ + KASSERT(tc64 != NULL, ("tc64 is not set")); + hyperv_tc64 = tc64; + /* Add device for mmap(2). */ make_dev(&hyperv_tsc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0444, HYPERV_REFTSC_DEVNAME); Modified: stable/10/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv.c Tue Feb 21 03:00:33 2017 (r314017) +++ stable/10/sys/dev/hyperv/vmbus/hyperv.c Tue Feb 21 03:14:05 2017 (r314018) @@ -77,6 +77,8 @@ u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; +hyperv_tc64_t hyperv_tc64; + static struct timecounter hyperv_timecounter = { .tc_get_timecount = hyperv_get_timecount, .tc_poll_pps = NULL, @@ -96,6 +98,13 @@ hyperv_get_timecount(struct timecounter return rdmsr(MSR_HV_TIME_REF_COUNT); } +static uint64_t +hyperv_tc64_rdmsr(void) +{ + + return (rdmsr(MSR_HV_TIME_REF_COUNT)); +} + uint64_t hypercall_post_message(bus_addr_t msg_paddr) { @@ -232,6 +241,12 @@ hyperv_init(void *dummy __unused) if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { /* Register Hyper-V timecounter */ tc_init(&hyperv_timecounter); + + /* + * Install 64 bits timecounter method for other modules + * to use. + */ + hyperv_tc64 = hyperv_tc64_rdmsr; } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Tue Feb 21 03:00:33 2017 (r314017) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_et.c Tue Feb 21 03:14:05 2017 (r314018) @@ -50,13 +50,10 @@ __FBSDID("$FreeBSD$"); MSR_HV_STIMER_CFG_SINT_MASK) /* - * Two additionally required features: + * Additionally required feature: * - SynIC is needed for interrupt generation. - * - Time reference counter is needed to set ABS reference count to - * STIMER0_COUNT. */ -#define CPUID_HV_ET_MASK (CPUID_HV_MSR_TIME_REFCNT | \ - CPUID_HV_MSR_SYNIC | \ +#define CPUID_HV_ET_MASK (CPUID_HV_MSR_SYNIC | \ CPUID_HV_MSR_SYNTIMER) static void vmbus_et_identify(driver_t *, device_t); @@ -104,7 +101,7 @@ vmbus_et_start(struct eventtimer *et __u { uint64_t current; - current = rdmsr(MSR_HV_TIME_REF_COUNT); + current = hyperv_tc64(); current += hyperv_sbintime2count(first); wrmsr(MSR_HV_STIMER0_COUNT, current); @@ -133,7 +130,8 @@ vmbus_et_identify(driver_t *driver, devi { if (device_get_unit(parent) != 0 || device_find_child(parent, VMBUS_ET_NAME, -1) != NULL || - (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) + (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK || + hyperv_tc64 == NULL) return; device_add_child(parent, VMBUS_ET_NAME, -1); @@ -189,9 +187,8 @@ vmbus_et_attach(device_t dev) vmbus_et.et_start = vmbus_et_start; /* - * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will - * not return 0, since writing 0 to STIMER0_COUNT will disable - * STIMER0. + * Delay a bit to make sure that hyperv_tc64 will not return 0, + * since writing 0 to STIMER0_COUNT will disable STIMER0. */ DELAY(100); smp_rendezvous(NULL, vmbus_et_config, NULL, NULL); From owner-svn-src-stable-10@freebsd.org Tue Feb 21 03:28:01 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CDE8CE7E30; Tue, 21 Feb 2017 03:28:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB96EF6C; Tue, 21 Feb 2017 03:28:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L3RxZT042049; Tue, 21 Feb 2017 03:27:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3RxUM042045; Tue, 21 Feb 2017 03:27:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201702210327.v1L3RxUM042045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 21 Feb 2017 03:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314019 - in stable/10: share/man/man4 sys/dev/alc sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 03:28:01 -0000 Author: sephe Date: Tue Feb 21 03:27:59 2017 New Revision: 314019 URL: https://svnweb.freebsd.org/changeset/base/314019 Log: MFC 312250 alc: Add Killer E2500 support Reviewed by: jhb, yongari Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9058 Modified: stable/10/share/man/man4/alc.4 stable/10/sys/dev/alc/if_alc.c stable/10/sys/dev/alc/if_alcreg.h stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/alc.4 ============================================================================== --- stable/10/share/man/man4/alc.4 Tue Feb 21 03:14:05 2017 (r314018) +++ stable/10/share/man/man4/alc.4 Tue Feb 21 03:27:59 2017 (r314019) @@ -124,6 +124,8 @@ Atheros AR8172 PCI Express Fast Ethernet Killer E2200 Gigabit Ethernet controller .It Killer E2400 Gigabit Ethernet controller +.It +Killer E2500 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the Modified: stable/10/sys/dev/alc/if_alc.c ============================================================================== --- stable/10/sys/dev/alc/if_alc.c Tue Feb 21 03:14:05 2017 (r314018) +++ stable/10/sys/dev/alc/if_alc.c Tue Feb 21 03:27:59 2017 (r314019) @@ -122,6 +122,8 @@ static struct alc_ident alc_ident_table[ "Killer E2200 Gigabit Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, "Killer E2400 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2500, 9 * 1024, + "Killer E2500 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -1082,6 +1084,7 @@ alc_phy_down(struct alc_softc *sc) case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1401,6 +1404,7 @@ alc_attach(device_t dev) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: @@ -1479,7 +1483,8 @@ alc_attach(device_t dev) if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; /* - * Force maximum payload size to 128 bytes for E2200/E2400. + * Force maximum payload size to 128 bytes for + * E2200/E2400/E2500. * Otherwise it triggers DMA write error. */ if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) Modified: stable/10/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/10/sys/dev/alc/if_alcreg.h Tue Feb 21 03:14:05 2017 (r314018) +++ stable/10/sys/dev/alc/if_alcreg.h Tue Feb 21 03:27:59 2017 (r314019) @@ -50,6 +50,7 @@ #define DEVICEID_ATHEROS_AR8172 0x10A0 #define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_E2400 0xE0A1 +#define DEVICEID_ATHEROS_E2500 0xE0B1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Tue Feb 21 03:14:05 2017 (r314018) +++ stable/10/sys/dev/pci/pci.c Tue Feb 21 03:27:59 2017 (r314019) @@ -269,13 +269,14 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a - * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * Atheros AR8161/AR8162/E2200/E2400/E2500 Ethernet controllers have + * a bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0B11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-stable-10@freebsd.org Tue Feb 21 03:46:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4888FCE664C; Tue, 21 Feb 2017 03:46:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16BEF19F2; Tue, 21 Feb 2017 03:46:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L3kcoq050317; Tue, 21 Feb 2017 03:46:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3kbx9050310; Tue, 21 Feb 2017 03:46:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210346.v1L3kbx9050310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 03:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314020 - in stable/10/lib/libnetbsd: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 03:46:39 -0000 Author: ngie Date: Tue Feb 21 03:46:37 2017 New Revision: 314020 URL: https://svnweb.freebsd.org/changeset/base/314020 Log: MFC r313404: Improve libnetbsd compatibility with NetBSD This change is being made to diff reduce/reduce duplication in contrib/netbsd-tests and to facilitate further porting of software from NetBSD Add the following headers: - sys/event.h: -- sys/types.h is required for kqueue on FreeBSD, but not NetBSD. - sys/types.h: -- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD. Pull in sys/param.h to have parity with NetBSD. - sys/wait.h: -- Define wrusage as __wrusage for parity with NetBSD typedef. - glob.h -- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef. - pthread.h: -- Pull in pthread_np.h for _np functions defined separately on FreeBSD. Improve compatibility with NetBSD in the following headers: - sha1.h: -- define SHA1_CTX as SHA_CTX -- define SHA1Final as SHA1_Final - sha2.h: -- #include sha384 to pick up all of the SHA 384 bit macros and definitions. - util.h: -- Add sys/types.h to util.h to pollute the header for types used in flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them for the functions. Added: stable/10/lib/libnetbsd/glob.h - copied unchanged from r313404, head/lib/libnetbsd/glob.h stable/10/lib/libnetbsd/pthread.h - copied unchanged from r313404, head/lib/libnetbsd/pthread.h stable/10/lib/libnetbsd/sys/event.h - copied unchanged from r313404, head/lib/libnetbsd/sys/event.h stable/10/lib/libnetbsd/sys/types.h - copied unchanged from r313404, head/lib/libnetbsd/sys/types.h stable/10/lib/libnetbsd/sys/wait.h - copied unchanged from r313404, head/lib/libnetbsd/sys/wait.h Modified: stable/10/lib/libnetbsd/sha1.h stable/10/lib/libnetbsd/sha2.h stable/10/lib/libnetbsd/util.h Directory Properties: stable/10/ (props changed) Copied: stable/10/lib/libnetbsd/glob.h (from r313404, head/lib/libnetbsd/glob.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/glob.h Tue Feb 21 03:46:37 2017 (r314020, copy of r313404, head/lib/libnetbsd/glob.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_GLOB_H_ +#define _LIBNETBSD_GLOB_H_ + +#include_next + +#ifndef __gl_stat_t +#define __gl_stat_t struct stat +#endif + +#endif Copied: stable/10/lib/libnetbsd/pthread.h (from r313404, head/lib/libnetbsd/pthread.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/pthread.h Tue Feb 21 03:46:37 2017 (r314020, copy of r313404, head/lib/libnetbsd/pthread.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + * + * $FreeBSD$ + */ + +#ifndef _LIBNETBSD_PTHREAD_H_ +#define _LIBNETBSD_PTHREAD_H_ + +#include_next +#include + +#endif Modified: stable/10/lib/libnetbsd/sha1.h ============================================================================== --- stable/10/lib/libnetbsd/sha1.h Tue Feb 21 03:27:59 2017 (r314019) +++ stable/10/lib/libnetbsd/sha1.h Tue Feb 21 03:46:37 2017 (r314020) @@ -35,8 +35,11 @@ #include +#define SHA1_CTX SHA_CTX + #define SHA1End SHA1_End #define SHA1File SHA1_File +#define SHA1Final SHA1_Final #define SHA1Init SHA1_Init #define SHA1Update SHA1_Update Modified: stable/10/lib/libnetbsd/sha2.h ============================================================================== --- stable/10/lib/libnetbsd/sha2.h Tue Feb 21 03:27:59 2017 (r314019) +++ stable/10/lib/libnetbsd/sha2.h Tue Feb 21 03:46:37 2017 (r314020) @@ -34,6 +34,7 @@ #define _SHA2_H_ #include +#include #include #endif /* _SHA2_H_ */ Copied: stable/10/lib/libnetbsd/sys/event.h (from r313404, head/lib/libnetbsd/sys/event.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/event.h Tue Feb 21 03:46:37 2017 (r314020, copy of r313404, head/lib/libnetbsd/sys/event.h) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_EVENT_H_ +#define _LIBNETBSD_SYS_EVENT_H_ + +/* + * kqueue on FreeBSD requires sys/event.h, which in turn uses uintptr_t + * (defined in sys/types.h), so in order to accomodate their requirements, + * pull in sys/types.h as part of event.h. + */ +#include + +#include_next + +#endif Copied: stable/10/lib/libnetbsd/sys/types.h (from r313404, head/lib/libnetbsd/sys/types.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/types.h Tue Feb 21 03:46:37 2017 (r314020, copy of r313404, head/lib/libnetbsd/sys/types.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_TYPES_H_ +#define _LIBNETBSD_SYS_TYPES_H_ + +#include_next + +#include /* For NBBY */ + +#endif Copied: stable/10/lib/libnetbsd/sys/wait.h (from r313404, head/lib/libnetbsd/sys/wait.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libnetbsd/sys/wait.h Tue Feb 21 03:46:37 2017 (r314020, copy of r313404, head/lib/libnetbsd/sys/wait.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Dell, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * $FreeBSD$ * + */ + +#ifndef _LIBNETBSD_SYS_WAIT_H_ +#define _LIBNETBSD_SYS_WAIT_H_ + +#include_next + +#define wrusage __wrusage + +#endif Modified: stable/10/lib/libnetbsd/util.h ============================================================================== --- stable/10/lib/libnetbsd/util.h Tue Feb 21 03:27:59 2017 (r314019) +++ stable/10/lib/libnetbsd/util.h Tue Feb 21 03:46:37 2017 (r314020) @@ -30,12 +30,13 @@ * SUCH DAMAGE. */ -#ifndef _UTIL_H_ -#define _UTIL_H_ +#ifndef _LIBNETBSD_UTIL_H_ +#define _LIBNETBSD_UTIL_H_ +#include #include char *flags_to_string(u_long flags, const char *def); int string_to_flags(char **stringp, u_long *setp, u_long *clrp); -#endif /* _UTIL_H_ */ +#endif From owner-svn-src-stable-10@freebsd.org Tue Feb 21 03:50:58 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84596CE6A01; Tue, 21 Feb 2017 03:50:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 346C21FA6; Tue, 21 Feb 2017 03:50:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L3ovWT051434; Tue, 21 Feb 2017 03:50:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L3ovRK051433; Tue, 21 Feb 2017 03:50:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210350.v1L3ovRK051433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 03:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314023 - stable/10/lib/msun/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 03:50:58 -0000 Author: ngie Date: Tue Feb 21 03:50:57 2017 New Revision: 314023 URL: https://svnweb.freebsd.org/changeset/base/314023 Log: MFC r312213,r313713: r312213: Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check of the clang version This works around breakage on ^/stable/10 when running installworld from a ^/stable/10 host where the test wouldn't be compiled on the first go-around and would be missing when make installworld is run. PR: 208703 r313713: Handle clang 4.x+ with the compile-time exception added in r312213 It also fails the assertions noted in bug 208703 PR: 208703 PR: 217084 Modified: stable/10/lib/msun/tests/fmaxmin_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/tests/fmaxmin_test.c ============================================================================== --- stable/10/lib/msun/tests/fmaxmin_test.c Tue Feb 21 03:49:52 2017 (r314022) +++ stable/10/lib/msun/tests/fmaxmin_test.c Tue Feb 21 03:50:57 2017 (r314023) @@ -86,6 +86,8 @@ testall_r(long double big, long double s return (ok); } +const char *comment = NULL; + /* * Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl, * in all rounding modes and with the arguments in different orders. @@ -107,10 +109,18 @@ testall(int testnum, long double big, lo break; } } - printf("%sok %d - big = %.20Lg, small = %.20Lg\n", - (i == 4) ? "" : "not ", testnum, big, small); + printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n", + (i == 4) ? "" : "not ", testnum, big, small, + comment == NULL ? "" : comment); } +/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ +#if defined(__clang__) && \ + ((__clang_major__ > 3)) || \ + ((__clang_major__ == 3 && __clang_minor__ >= 8)) +#define affected_by_bug_208703 +#endif + int main(int argc, char *argv[]) { @@ -122,15 +132,23 @@ main(int argc, char *argv[]) testall(3, nextafterf(42.0, INFINITY), 42.0); testall(4, -5.0, -5.0); testall(5, -3.0, -4.0); +#ifdef affected_by_bug_208703 + comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)"; +#endif testall(6, 1.0, NAN); testall(7, INFINITY, NAN); + comment = NULL; testall(8, INFINITY, 1.0); testall(9, -3.0, -INFINITY); testall(10, 3.0, -INFINITY); +#ifdef affected_by_bug_208703 + comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)"; +#endif testall(11, NAN, NAN); /* This test isn't strictly required to work by C99. */ testall(12, 0.0, -0.0); + comment = NULL; return (0); } From owner-svn-src-stable-10@freebsd.org Tue Feb 21 05:13:17 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66CF8CE7F5C; Tue, 21 Feb 2017 05:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 339B23F4; Tue, 21 Feb 2017 05:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L5DGGq086369; Tue, 21 Feb 2017 05:13:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L5DGTJ086368; Tue, 21 Feb 2017 05:13:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702210513.v1L5DGTJ086368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 21 Feb 2017 05:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314026 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 05:13:17 -0000 Author: mav Date: Tue Feb 21 05:13:16 2017 New Revision: 314026 URL: https://svnweb.freebsd.org/changeset/base/314026 Log: MFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity. Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:12:42 2017 (r314025) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:13:16 2017 (r314026) @@ -1120,8 +1120,10 @@ ctl_backend_ramdisk_create(struct ctl_be STAILQ_INIT(&be_lun->cont_queue); sx_init(&be_lun->page_lock, "cram page lock"); - if (be_lun->cap_bytes == 0) + if (be_lun->cap_bytes == 0) { + be_lun->indir = 0; be_lun->pages = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK); + } be_lun->zero_page = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK|M_ZERO); mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF); From owner-svn-src-stable-10@freebsd.org Tue Feb 21 07:02:53 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 199E2CE749D; Tue, 21 Feb 2017 07:02:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE6F031C; Tue, 21 Feb 2017 07:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L72pab031378; Tue, 21 Feb 2017 07:02:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L72pSi031375; Tue, 21 Feb 2017 07:02:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702210702.v1L72pSi031375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 21 Feb 2017 07:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314028 - in stable/10/lib/libnetbsd: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 07:02:53 -0000 Author: ngie Date: Tue Feb 21 07:02:51 2017 New Revision: 314028 URL: https://svnweb.freebsd.org/changeset/base/314028 Log: Revert r314020 The test build I ran unfortunately didn't catch the fact that the sha384.h compat header is missing on ^/stable/10 due to some code not being MFCed Deleted: stable/10/lib/libnetbsd/glob.h stable/10/lib/libnetbsd/pthread.h stable/10/lib/libnetbsd/sys/event.h stable/10/lib/libnetbsd/sys/types.h stable/10/lib/libnetbsd/sys/wait.h Modified: stable/10/lib/libnetbsd/sha1.h stable/10/lib/libnetbsd/sha2.h stable/10/lib/libnetbsd/util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libnetbsd/sha1.h ============================================================================== --- stable/10/lib/libnetbsd/sha1.h Tue Feb 21 06:10:11 2017 (r314027) +++ stable/10/lib/libnetbsd/sha1.h Tue Feb 21 07:02:51 2017 (r314028) @@ -35,11 +35,8 @@ #include -#define SHA1_CTX SHA_CTX - #define SHA1End SHA1_End #define SHA1File SHA1_File -#define SHA1Final SHA1_Final #define SHA1Init SHA1_Init #define SHA1Update SHA1_Update Modified: stable/10/lib/libnetbsd/sha2.h ============================================================================== --- stable/10/lib/libnetbsd/sha2.h Tue Feb 21 06:10:11 2017 (r314027) +++ stable/10/lib/libnetbsd/sha2.h Tue Feb 21 07:02:51 2017 (r314028) @@ -34,7 +34,6 @@ #define _SHA2_H_ #include -#include #include #endif /* _SHA2_H_ */ Modified: stable/10/lib/libnetbsd/util.h ============================================================================== --- stable/10/lib/libnetbsd/util.h Tue Feb 21 06:10:11 2017 (r314027) +++ stable/10/lib/libnetbsd/util.h Tue Feb 21 07:02:51 2017 (r314028) @@ -30,13 +30,12 @@ * SUCH DAMAGE. */ -#ifndef _LIBNETBSD_UTIL_H_ -#define _LIBNETBSD_UTIL_H_ +#ifndef _UTIL_H_ +#define _UTIL_H_ -#include #include char *flags_to_string(u_long flags, const char *def); int string_to_flags(char **stringp, u_long *setp, u_long *clrp); -#endif +#endif /* _UTIL_H_ */ From owner-svn-src-stable-10@freebsd.org Tue Feb 21 08:57:29 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50DFCCE729C; Tue, 21 Feb 2017 08:57:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05EA696C; Tue, 21 Feb 2017 08:57:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L8vSos077159; Tue, 21 Feb 2017 08:57:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L8vSAB077156; Tue, 21 Feb 2017 08:57:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210857.v1L8vSAB077156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 08:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314029 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 08:57:29 -0000 Author: avg Date: Tue Feb 21 08:57:27 2017 New Revision: 314029 URL: https://svnweb.freebsd.org/changeset/base/314029 Log: MFC r313686: check remaining space in zfs implementations of vptocnp PR: 216939 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 21 07:02:51 2017 (r314028) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 21 08:57:27 2017 (r314029) @@ -1604,16 +1604,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc } if (sep == NULL) { mutex_exit(&sdp->sd_lock); - error = ENOENT; + error = SET_ERROR(ENOENT); } else { size_t len; len = strlen(sep->se_name); - *ap->a_buflen -= len; - bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); - mutex_exit(&sdp->sd_lock); - vref(dvp); - *ap->a_vpp = dvp; + if (*ap->a_buflen < len) { + mutex_exit(&sdp->sd_lock); + error = SET_ERROR(ENOMEM); + } else { + *ap->a_buflen -= len; + bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); + mutex_exit(&sdp->sd_lock); + vref(dvp); + *ap->a_vpp = dvp; + } } VN_RELE(dvp); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 21 07:02:51 2017 (r314028) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 21 08:57:27 2017 (r314029) @@ -5984,6 +5984,10 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) error = zfs_znode_parent_and_name(zp, &dzp, name); if (error == 0) { len = strlen(name); + if (*ap->a_buflen < len) + error = SET_ERROR(ENOMEM); + } + if (error == 0) { *ap->a_buflen -= len; bcopy(name, ap->a_buf + *ap->a_buflen, len); *ap->a_vpp = ZTOV(dzp); From owner-svn-src-stable-10@freebsd.org Tue Feb 21 09:13:40 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4423BCE7CB3; Tue, 21 Feb 2017 09:13:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2CF1750; Tue, 21 Feb 2017 09:13:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L9DdDt085482; Tue, 21 Feb 2017 09:13:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L9Ddm6085481; Tue, 21 Feb 2017 09:13:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210913.v1L9Ddm6085481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 09:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314032 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 09:13:40 -0000 Author: avg Date: Tue Feb 21 09:13:38 2017 New Revision: 314032 URL: https://svnweb.freebsd.org/changeset/base/314032 Log: MFC r313687: remove l2_padding_needed statistic from zfs arc Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 21 09:13:34 2017 (r314031) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 21 09:13:38 2017 (r314032) @@ -709,7 +709,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_asize; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -807,7 +806,6 @@ static arc_stats_t arc_stats = { { "l2_size", KSTAT_DATA_UINT64 }, { "l2_asize", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, From owner-svn-src-stable-10@freebsd.org Tue Feb 21 09:29:48 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C35FCE62B3; Tue, 21 Feb 2017 09:29:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E19226; Tue, 21 Feb 2017 09:29:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L9Tlhr089652; Tue, 21 Feb 2017 09:29:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L9Tksl089649; Tue, 21 Feb 2017 09:29:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702210929.v1L9Tksl089649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Feb 2017 09:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314034 - in stable/10/sys: fs/nfsserver rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 09:29:48 -0000 Author: avg Date: Tue Feb 21 09:29:46 2017 New Revision: 314034 URL: https://svnweb.freebsd.org/changeset/base/314034 Log: MFC r313735: add svcpool_close to handle killed nfsd threads PR: 204340 Reported by: Panzura Reviewed by: rmacklem Approved by: rmacklem Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/10/sys/rpc/svc.c stable/10/sys/rpc/svc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 21 09:29:11 2017 (r314033) +++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 21 09:29:46 2017 (r314034) @@ -554,18 +554,16 @@ nfsrvd_init(int terminating) nfsd_master_proc = NULL; NFSD_UNLOCK(); nfsrv_freeallbackchannel_xprts(); - svcpool_destroy(nfsrvd_pool); - nfsrvd_pool = NULL; + svcpool_close(nfsrvd_pool); + NFSD_LOCK(); + } else { + NFSD_UNLOCK(); + nfsrvd_pool = svcpool_create("nfsd", + SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); + nfsrvd_pool->sp_rcache = NULL; + nfsrvd_pool->sp_assign = fhanew_assign; + nfsrvd_pool->sp_done = fha_nd_complete; NFSD_LOCK(); } - - NFSD_UNLOCK(); - - nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); - nfsrvd_pool->sp_rcache = NULL; - nfsrvd_pool->sp_assign = fhanew_assign; - nfsrvd_pool->sp_done = fha_nd_complete; - - NFSD_LOCK(); } Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Tue Feb 21 09:29:11 2017 (r314033) +++ stable/10/sys/rpc/svc.c Tue Feb 21 09:29:46 2017 (r314034) @@ -75,6 +75,7 @@ static void svc_new_thread(SVCGROUP *grp static void xprt_unregister_locked(SVCXPRT *xprt); static void svc_change_space_used(SVCPOOL *pool, long delta); static bool_t svc_request_space_available(SVCPOOL *pool); +static void svcpool_cleanup(SVCPOOL *pool); /* *************** SVCXPRT related stuff **************** */ @@ -174,8 +175,12 @@ svcpool_create(const char *name, struct return pool; } -void -svcpool_destroy(SVCPOOL *pool) +/* + * Code common to svcpool_destroy() and svcpool_close(), which cleans up + * the pool data structures. + */ +static void +svcpool_cleanup(SVCPOOL *pool) { SVCGROUP *grp; SVCXPRT *xprt, *nxprt; @@ -211,6 +216,15 @@ svcpool_destroy(SVCPOOL *pool) mtx_lock(&pool->sp_lock); } mtx_unlock(&pool->sp_lock); +} + +void +svcpool_destroy(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); for (g = 0; g < SVC_MAXGROUPS; g++) { grp = &pool->sp_groups[g]; @@ -226,6 +240,30 @@ svcpool_destroy(SVCPOOL *pool) } /* + * Similar to svcpool_destroy(), except that it does not destroy the actual + * data structures. As such, "pool" may be used again. + */ +void +svcpool_close(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); + + /* Now, initialize the pool's state for a fresh svc_run() call. */ + mtx_lock(&pool->sp_lock); + pool->sp_state = SVCPOOL_INIT; + mtx_unlock(&pool->sp_lock); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + grp->sg_state = SVCPOOL_ACTIVE; + mtx_unlock(&grp->sg_lock); + } +} + +/* * Sysctl handler to get the present thread count on a pool */ static int Modified: stable/10/sys/rpc/svc.h ============================================================================== --- stable/10/sys/rpc/svc.h Tue Feb 21 09:29:11 2017 (r314033) +++ stable/10/sys/rpc/svc.h Tue Feb 21 09:29:46 2017 (r314034) @@ -729,6 +729,12 @@ extern SVCPOOL* svcpool_create(const cha extern void svcpool_destroy(SVCPOOL *pool); /* + * Close a service pool. Similar to svcpool_destroy(), but it does not + * free the data structures. As such, the pool can be used again. + */ +extern void svcpool_close(SVCPOOL *pool); + +/* * Transport independent svc_create routine. */ extern int svc_create(SVCPOOL *, void (*)(struct svc_req *, SVCXPRT *), From owner-svn-src-stable-10@freebsd.org Wed Feb 22 17:57:25 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 992BCCE9D10; Wed, 22 Feb 2017 17:57:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 686351363; Wed, 22 Feb 2017 17:57:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1MHvOKK092818; Wed, 22 Feb 2017 17:57:24 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1MHvO78092817; Wed, 22 Feb 2017 17:57:24 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201702221757.v1MHvO78092817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 22 Feb 2017 17:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314103 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2017 17:57:25 -0000 Author: marius Date: Wed Feb 22 17:57:24 2017 New Revision: 314103 URL: https://svnweb.freebsd.org/changeset/base/314103 Log: MFC: r311979 Reset the EIAC register to include the LINK status bit and restore link up/down notifications. Modified: stable/10/sys/dev/e1000/if_em.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Wed Feb 22 17:57:19 2017 (r314102) +++ stable/10/sys/dev/e1000/if_em.c Wed Feb 22 17:57:24 2017 (r314103) @@ -5157,7 +5157,7 @@ em_enable_intr(struct adapter *adapter) u32 ims_mask = IMS_ENABLE_MASK; if (hw->mac.type == e1000_82574) { - E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); + E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); ims_mask |= adapter->ims; } E1000_WRITE_REG(hw, E1000_IMS, ims_mask); From owner-svn-src-stable-10@freebsd.org Thu Feb 23 06:49:48 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58DC0CEA006; Thu, 23 Feb 2017 06:49:48 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F0DE154E; Thu, 23 Feb 2017 06:49:47 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1N6nl2P009169; Thu, 23 Feb 2017 06:49:47 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N6nl1Z009167; Thu, 23 Feb 2017 06:49:47 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702230649.v1N6nl1Z009167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 23 Feb 2017 06:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314121 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 06:49:48 -0000 Author: dexuan Date: Thu Feb 23 06:49:46 2017 New Revision: 314121 URL: https://svnweb.freebsd.org/changeset/base/314121 Log: MFC: r312685, r312686 Approved by: sephe (mentor) r312685 hyperv/hn: remember the channel pointer in struct hn_rx_ring This will be used by the coming NIC SR-IOV patch. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8909 r312686 hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt() It's unnecessary because the upper nework stack does the same checking. In the case of Hyper-V SR-IOV, we need to remove the checking because 1) multicast/broadcast packets are still received through the synthetic NIC and we need to inject the packets through the VF interface; 2) we must inject the packets even if the synthetic NIC is down, or has a different MTU from the VF device. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8962 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 05:40:59 2017 (r314120) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 06:49:46 2017 (r314121) @@ -2118,15 +2118,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v int size, do_lro = 0, do_csum = 1; int hash_type = M_HASHTYPE_OPAQUE; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - return (0); - - /* - * Bail out if packet contains more data than configured MTU. - */ - if (dlen > (ifp->if_mtu + ETHER_HDR_LEN)) { - return (0); - } else if (dlen <= MHLEN) { + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); @@ -4297,6 +4289,7 @@ hn_chan_attach(struct hn_softc *sc, stru KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED) == 0, ("RX ring %d already attached", idx)); rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED; + rxr->hn_chan = chan; if (bootverbose) { if_printf(sc->hn_ifp, "link RX ring %d to chan%u\n", Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Feb 23 05:40:59 2017 (r314120) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Feb 23 06:49:46 2017 (r314121) @@ -85,6 +85,8 @@ struct hn_rx_ring { void *hn_br; /* TX/RX bufring */ struct hyperv_dma hn_br_dma; + + struct vmbus_channel *hn_chan; } __aligned(CACHE_LINE_SIZE); #define HN_TRUST_HCSUM_IP 0x0001 From owner-svn-src-stable-10@freebsd.org Thu Feb 23 06:57:20 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954D6CEA2CF; Thu, 23 Feb 2017 06:57:20 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EE4219D7; Thu, 23 Feb 2017 06:57:20 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1N6vJ05013060; Thu, 23 Feb 2017 06:57:19 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N6vJ7Q013058; Thu, 23 Feb 2017 06:57:19 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702230657.v1N6vJ7Q013058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 23 Feb 2017 06:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314122 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 06:57:20 -0000 Author: dexuan Date: Thu Feb 23 06:57:18 2017 New Revision: 314122 URL: https://svnweb.freebsd.org/changeset/base/314122 Log: MFC: r312687, r312916 Approved by: sephe (mentor) r312687 ifnet: introduce event handlers for ifup/ifdown events Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together, mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). So the synthetic NIC driver needs to know when a VF device is becoming UP or DOWN and hence the patch is made. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8963 r312916 ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h Thank glebius for pointing this out: "The network stuff shall not be added to sys/eventhandler.h" Reviewed by: David_A_Bright_DELL.com, sephe, glebius Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9345 Modified: stable/10/sys/net/if.c stable/10/sys/net/if_var.h Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Thu Feb 23 06:49:46 2017 (r314121) +++ stable/10/sys/net/if.c Thu Feb 23 06:57:18 2017 (r314122) @@ -2183,6 +2183,7 @@ void if_down(struct ifnet *ifp) { + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN); if_unroute(ifp, IFF_UP, AF_UNSPEC); } @@ -2195,6 +2196,7 @@ if_up(struct ifnet *ifp) { if_route(ifp, IFF_UP, AF_UNSPEC); + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP); } /* Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Thu Feb 23 06:49:46 2017 (r314121) +++ stable/10/sys/net/if_var.h Thu Feb 23 06:57:18 2017 (r314122) @@ -424,6 +424,11 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); +/* Interface up/down event */ +#define IFNET_EVENT_UP 0 +#define IFNET_EVENT_DOWN 1 +typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); +EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); /* * interface groups From owner-svn-src-stable-10@freebsd.org Thu Feb 23 07:04:19 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E4ACEA532; Thu, 23 Feb 2017 07:04:19 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFDFC1E4E; Thu, 23 Feb 2017 07:04:18 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1N74H8x017104; Thu, 23 Feb 2017 07:04:17 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N74HHc017099; Thu, 23 Feb 2017 07:04:17 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702230704.v1N74HHc017099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 23 Feb 2017 07:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314123 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 07:04:19 -0000 Author: dexuan Date: Thu Feb 23 07:04:17 2017 New Revision: 314123 URL: https://svnweb.freebsd.org/changeset/base/314123 Log: MFC: r312688 Approved by: sephe (mentor) r312688 hyperv/hn: add the support for VF drivers (SR-IOV) Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and a VF NIC to work together (both NICs have the same MAC address), mainly to support seamless live migration. When the VF device becomes UP (or DOWN), the synthetic NIC driver needs to switch the data path from the synthetic NIC to the VF (or the opposite). Note: multicast/broadcast packets are still received through the synthetic NIC and we need to inject the packets through the VF interface (if the VF is UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP). Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8964 Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c stable/10/sys/dev/hyperv/netvsc/hn_nvs.h stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnreg.h stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Feb 23 06:57:18 2017 (r314122) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.c Thu Feb 23 07:04:17 2017 (r314123) @@ -500,6 +500,8 @@ hn_nvs_conf_ndis(struct hn_softc *sc, in conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; conf.nvs_mtu = mtu; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; + if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) + conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; /* NOTE: No response. */ error = hn_nvs_req_send(sc, &conf, sizeof(conf)); @@ -719,3 +721,15 @@ hn_nvs_send_rndis_ctrl(struct vmbus_chan return hn_nvs_send_rndis_sglist(chan, HN_NVS_RNDIS_MTYPE_CTRL, sndc, gpa, gpa_cnt); } + +void +hn_nvs_set_datapath(struct hn_softc *sc, uint32_t path) +{ + struct hn_nvs_datapath dp; + + memset(&dp, 0, sizeof(dp)); + dp.nvs_type = HN_NVS_TYPE_SET_DATAPATH; + dp.nvs_active_path = path; + + hn_nvs_req_send(sc, &dp, sizeof(dp)); +} Modified: stable/10/sys/dev/hyperv/netvsc/hn_nvs.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hn_nvs.h Thu Feb 23 06:57:18 2017 (r314122) +++ stable/10/sys/dev/hyperv/netvsc/hn_nvs.h Thu Feb 23 07:04:17 2017 (r314123) @@ -100,6 +100,7 @@ void hn_nvs_sent_xact(struct hn_nvs_sen int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); +void hn_nvs_set_datapath(struct hn_softc *sc, uint32_t path); extern struct hn_nvs_sendctx hn_nvs_sendctx_none; Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 06:57:18 2017 (r314122) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 07:04:17 2017 (r314123) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -85,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -211,6 +213,11 @@ struct hn_rxinfo { uint32_t hash_value; }; +struct hn_update_vf { + struct hn_rx_ring *rxr; + struct ifnet *vf; +}; + #define HN_RXINFO_VLAN 0x0001 #define HN_RXINFO_CSUM 0x0002 #define HN_RXINFO_HASHINF 0x0004 @@ -288,7 +295,7 @@ static int hn_txagg_pktmax_sysctl(SYSC static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); -static void hn_stop(struct hn_softc *); +static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); @@ -696,7 +703,8 @@ hn_rxfilter_config(struct hn_softc *sc) HN_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_PROMISC) { + if ((ifp->if_flags & IFF_PROMISC) || + (sc->hn_flags & HN_FLAG_VF)) { filter = NDIS_PACKET_TYPE_PROMISCUOUS; } else { filter = NDIS_PACKET_TYPE_DIRECTED; @@ -883,6 +891,119 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmr->ifm_active |= IFM_10G_T | IFM_FDX; } +static void +hn_update_vf_task(void *arg, int pending __unused) +{ + struct hn_update_vf *uv = arg; + + uv->rxr->hn_vf = uv->vf; +} + +static void +hn_update_vf(struct hn_softc *sc, struct ifnet *vf) +{ + struct hn_rx_ring *rxr; + struct hn_update_vf uv; + struct task task; + int i; + + HN_LOCK_ASSERT(sc); + + TASK_INIT(&task, 0, hn_update_vf_task, &uv); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + + if (i < sc->hn_rx_ring_inuse) { + uv.rxr = rxr; + uv.vf = vf; + vmbus_chan_run_task(rxr->hn_chan, &task); + } else { + rxr->hn_vf = vf; + } + } +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto out; + + hn_ifp = sc->hn_ifp; + + if (ifp == hn_ifp) + goto out; + + if (ifp->if_alloctype != IFT_ETHER) + goto out; + + /* Ignore lagg/vlan interfaces */ + if (strcmp(ifp->if_dname, "lagg") == 0 || + strcmp(ifp->if_dname, "vlan") == 0) + goto out; + + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + goto out; + + /* Now we're sure 'ifp' is a real VF device. */ + if (vf) { + if (sc->hn_flags & HN_FLAG_VF) + goto out; + + sc->hn_flags |= HN_FLAG_VF; + hn_rxfilter_config(sc); + } else { + if (!(sc->hn_flags & HN_FLAG_VF)) + goto out; + + sc->hn_flags &= ~HN_FLAG_VF; + if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + hn_rxfilter_config(sc); + else + hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); + } + + hn_nvs_set_datapath(sc, + vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); + + hn_update_vf(sc, vf ? ifp : NULL); + + if (vf) { + hn_suspend_mgmt(sc); + sc->hn_link_flags &= + ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); + if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + } else { + hn_resume_mgmt(sc); + } + + if (bootverbose) + if_printf(hn_ifp, "Data path is switched %s %s\n", + vf ? "to" : "from", if_name(ifp)); +out: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_event(void *arg, struct ifnet *ifp, int event) +{ + if (event != IFNET_EVENT_UP && event != IFNET_EVENT_DOWN) + return; + + hn_set_vf(arg, ifp, event == IFNET_EVENT_UP); +} + +static void +hn_ifaddr_event(void *arg, struct ifnet *ifp) +{ + hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1204,6 +1325,12 @@ hn_attach(device_t dev) sc->hn_mgmt_taskq = sc->hn_mgmt_taskq0; hn_update_link_status(sc); + sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, + hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); + + sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, + hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1218,6 +1345,11 @@ hn_detach(device_t dev) struct hn_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->hn_ifp; + if (sc->hn_ifaddr_evthand != NULL) + EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); + if (sc->hn_ifnet_evthand != NULL) + EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -1230,7 +1362,7 @@ hn_detach(device_t dev) HN_LOCK(sc); if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_stop(sc); + hn_stop(sc, true); /* * NOTE: * hn_stop() only suspends data, so managment @@ -2113,11 +2245,14 @@ static int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_rxinfo *info) { - struct ifnet *ifp = rxr->hn_ifp; + struct ifnet *ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; int hash_type = M_HASHTYPE_OPAQUE; + /* If the VF is active, inject the packet through the VF */ + ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { @@ -2426,7 +2561,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_stop(sc); + hn_stop(sc, false); } sc->hn_if_flags = ifp->if_flags; @@ -2516,7 +2651,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } static void -hn_stop(struct hn_softc *sc) +hn_stop(struct hn_softc *sc, bool detaching) { struct ifnet *ifp = sc->hn_ifp; int i; @@ -2537,6 +2672,13 @@ hn_stop(struct hn_softc *sc) atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; + + /* + * If the VF is active, make sure the filter is not 0, even if + * the synthetic NIC is down. + */ + if (!detaching && (sc->hn_flags & HN_FLAG_VF)) + hn_rxfilter_config(sc); } static void @@ -4848,7 +4990,8 @@ hn_suspend(struct hn_softc *sc) /* Disable polling. */ hn_polling(sc, 0); - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || + (sc->hn_flags & HN_FLAG_VF)) hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -4937,9 +5080,18 @@ static void hn_resume(struct hn_softc *sc) { - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || + (sc->hn_flags & HN_FLAG_VF)) hn_resume_data(sc); - hn_resume_mgmt(sc); + + /* + * When the VF is activated, the synthetic interface is changed + * to DOWN in hn_set_vf(). Here, if the VF is still active, we + * don't call hn_resume_mgmt() until the VF is deactivated in + * hn_set_vf(). + */ + if (!(sc->hn_flags & HN_FLAG_VF)) + hn_resume_mgmt(sc); /* * Re-enable polling if this interface is running and Modified: stable/10/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnreg.h Thu Feb 23 06:57:18 2017 (r314122) +++ stable/10/sys/dev/hyperv/netvsc/if_hnreg.h Thu Feb 23 07:04:17 2017 (r314123) @@ -133,6 +133,17 @@ struct hn_nvs_ndis_init { } __packed; CTASSERT(sizeof(struct hn_nvs_ndis_init) >= HN_NVS_REQSIZE_MIN); +#define HN_NVS_DATAPATH_SYNTHETIC 0 +#define HN_NVS_DATAPATH_VF 1 + +/* No response */ +struct hn_nvs_datapath { + uint32_t nvs_type; /* HN_NVS_TYPE_SET_DATAPATH */ + uint32_t nvs_active_path;/* HN_NVS_DATAPATH_* */ + uint32_t nvs_rsvd[6]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_datapath) >= HN_NVS_REQSIZE_MIN); + struct hn_nvs_rxbuf_conn { uint32_t nvs_type; /* HN_NVS_TYPE_RXBUF_CONN */ uint32_t nvs_gpadl; /* RXBUF vmbus GPADL */ Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Feb 23 06:57:18 2017 (r314122) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Thu Feb 23 07:04:17 2017 (r314123) @@ -59,6 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; + struct ifnet *hn_vf; /* SR-IOV VF */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -235,6 +236,9 @@ struct hn_softc { int hn_rss_ind_size; uint32_t hn_rss_hash; /* NDIS_HASH_ */ struct ndis_rssprm_toeplitz hn_rss; + + eventhandler_tag hn_ifaddr_evthand; + eventhandler_tag hn_ifnet_evthand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 @@ -245,6 +249,7 @@ struct hn_softc { #define HN_FLAG_NO_SLEEPING 0x0020 #define HN_FLAG_RXBUF_REF 0x0040 #define HN_FLAG_CHIM_REF 0x0080 +#define HN_FLAG_VF 0x0100 #define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) From owner-svn-src-stable-10@freebsd.org Thu Feb 23 07:07:22 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777F0CEA5E1; Thu, 23 Feb 2017 07:07:22 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CCC11FB3; Thu, 23 Feb 2017 07:07:22 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1N77L1K017287; Thu, 23 Feb 2017 07:07:21 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1N77LA2017286; Thu, 23 Feb 2017 07:07:21 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201702230707.v1N77LA2017286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Thu, 23 Feb 2017 07:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314124 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 07:07:22 -0000 Author: dexuan Date: Thu Feb 23 07:07:21 2017 New Revision: 314124 URL: https://svnweb.freebsd.org/changeset/base/314124 Log: MFC r312689, r312690 Approved by: sephe (mentor) r312689 hyperv/hn: add a sysctl name for the VF interface This makes it easier for the userland script to find the releated VF interface. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9101 r312690 hyperv/hn: add devctl_notify for VF_UP/DOWN events Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9102 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 07:04:17 2017 (r314123) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Thu Feb 23 07:07:21 2017 (r314124) @@ -294,6 +294,7 @@ static int hn_txagg_pkts_sysctl(SYSCTL static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -982,6 +983,9 @@ hn_set_vf(struct hn_softc *sc, struct if hn_resume_mgmt(sc); } + devctl_notify("HYPERV_NIC_VF", if_name(hn_ifp), + vf ? "VF_UP" : "VF_DOWN", NULL); + if (bootverbose) if_printf(hn_ifp, "Data path is switched %s %s\n", vf ? "to" : "from", if_name(ifp)); @@ -1232,6 +1236,9 @@ hn_attach(device_t dev) CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_polling_sysctl, "I", "Polling frequency: [100,1000000], 0 disable polling"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_vf_sysctl, "A", "Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -3205,6 +3212,22 @@ hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_vf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[128]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_vf; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; From owner-svn-src-stable-10@freebsd.org Thu Feb 23 16:05:13 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEEF6CEA64C; Thu, 23 Feb 2017 16:05:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA451E18; Thu, 23 Feb 2017 16:05:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NG5CF4040210; Thu, 23 Feb 2017 16:05:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NG5C0f040202; Thu, 23 Feb 2017 16:05:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702231605.v1NG5C0f040202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 16:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314143 - in stable/10: lib/libcrypt lib/libmd sys/conf sys/crypto/sha2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 16:05:13 -0000 Author: avg Date: Thu Feb 23 16:05:11 2017 New Revision: 314143 URL: https://svnweb.freebsd.org/changeset/base/314143 Log: MFC r263215,r263218,r285366: replace the kernel sha256 code r263215 copy these files from lib/libmd in preperation for moving these files into the kernel... r263218 replace the kernel's version w/ cperciva's implementation... r285366 Complete the move that was started w/ r263218.. Note that the last change is out of order with r282726 that I am going to merge as well. Many thanks to cperciva for the more efficient code and to jmg for integrating it into the kernel. Added: stable/10/sys/crypto/sha2/sha256.h - copied, changed from r263215, head/sys/crypto/sha2/sha256.h stable/10/sys/crypto/sha2/sha256c.c - copied, changed from r263215, head/sys/crypto/sha2/sha256c.c Modified: stable/10/lib/libcrypt/Makefile stable/10/lib/libmd/Makefile stable/10/sys/conf/files stable/10/sys/crypto/sha2/sha2.c stable/10/sys/crypto/sha2/sha2.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/Makefile ============================================================================== --- stable/10/lib/libcrypt/Makefile Thu Feb 23 15:30:21 2017 (r314142) +++ stable/10/lib/libcrypt/Makefile Thu Feb 23 16:05:11 2017 (r314143) @@ -9,7 +9,7 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 5 LIB= crypt -.PATH: ${.CURDIR}/../libmd +.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 SRCS= crypt.c misc.c \ crypt-md5.c md5c.c \ crypt-nthash.c md4c.c \ Modified: stable/10/lib/libmd/Makefile ============================================================================== --- stable/10/lib/libmd/Makefile Thu Feb 23 15:30:21 2017 (r314142) +++ stable/10/lib/libmd/Makefile Thu Feb 23 16:05:11 2017 (r314143) @@ -43,7 +43,7 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ sha256.ref sha256hl.c sha512.ref sha512hl.c CFLAGS+= -I${.CURDIR} -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Feb 23 15:30:21 2017 (r314142) +++ stable/10/sys/conf/files Thu Feb 23 16:05:11 2017 (r314143) @@ -545,6 +545,8 @@ crypto/sha1.c optional carp | crypto | netgraph_mppc_encryption | sctp crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ sctp | zfs +crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random | \ + sctp | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 ddb/db_access.c optional ddb Modified: stable/10/sys/crypto/sha2/sha2.c ============================================================================== --- stable/10/sys/crypto/sha2/sha2.c Thu Feb 23 15:30:21 2017 (r314142) +++ stable/10/sys/crypto/sha2/sha2.c Thu Feb 23 16:05:11 2017 (r314143) @@ -121,20 +121,10 @@ __FBSDID("$FreeBSD$"); * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. */ -#if 0 /*def SHA2_USE_INTTYPES_H*/ - typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ typedef uint64_t sha2_word64; /* Exactly 8 bytes */ -#else /* SHA2_USE_INTTYPES_H */ - -typedef u_int8_t sha2_byte; /* Exactly 1 byte */ -typedef u_int32_t sha2_word32; /* Exactly 4 bytes */ -typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ - -#endif /* SHA2_USE_INTTYPES_H */ - /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ @@ -183,8 +173,6 @@ typedef u_int64_t sha2_word64; /* Exactl */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) -/* 32-bit Rotate-right (used in SHA-256): */ -#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) @@ -192,12 +180,6 @@ typedef u_int64_t sha2_word64; /* Exactl #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) -/* Four of six logical functions used in SHA-256: */ -#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) -#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) -#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) -#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) - /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) @@ -210,43 +192,10 @@ typedef u_int64_t sha2_word64; /* Exactl * only. */ static void SHA512_Last(SHA512_CTX*); -static void SHA256_Transform(SHA256_CTX*, const sha2_word32*); static void SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ -/* Hash constant words K for SHA-256: */ -static const sha2_word32 K256[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -/* Initial hash value H for SHA-256: */ -static const sha2_word32 sha256_initial_hash_value[8] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL -}; - /* Hash constant words K for SHA-384 and SHA-512: */ static const sha2_word64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, @@ -323,301 +272,6 @@ static const char *sha2_hex_digits = "01 /*** SHA-256: *********************************************************/ -void SHA256_Init(SHA256_CTX* context) { - if (context == (SHA256_CTX*)0) { - return; - } - bcopy(sha256_initial_hash_value, context->state, SHA256_DIGEST_LENGTH); - bzero(context->buffer, SHA256_BLOCK_LENGTH); - context->bitcount = 0; -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-256 round macros: */ - -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE32(*data++, W256[j]); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + W256[j]; \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + (W256[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256(a,b,c,d,e,f,g,h) \ - s0 = W256[(j+1)&0x0f]; \ - s0 = sigma0_256(s0); \ - s1 = W256[(j+14)&0x0f]; \ - s1 = sigma1_256(s1); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - /* Rounds 0 to 15 (unrolled): */ - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds to 64: */ - do { - ROUND256(a,b,c,d,e,f,g,h); - ROUND256(h,a,b,c,d,e,f,g); - ROUND256(g,h,a,b,c,d,e,f); - ROUND256(f,g,h,a,b,c,d,e); - ROUND256(e,f,g,h,a,b,c,d); - ROUND256(d,e,f,g,h,a,b,c); - ROUND256(c,d,e,f,g,h,a,b); - ROUND256(b,c,d,e,f,g,h,a); - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, T2, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Copy data while converting to host byte order */ - REVERSE32(*data++,W256[j]); - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-256 compression function to update a..h with copy */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W256[(j+1)&0x0f]; - s0 = sigma0_256(s0); - s1 = W256[(j+14)&0x0f]; - s1 = sigma1_256(s1); - - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA256_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - bcopy(data, &context->buffer[usedspace], freespace); - context->bitcount += freespace << 3; - len -= freespace; - data += freespace; - SHA256_Transform(context, (sha2_word32*)context->buffer); - } else { - /* The buffer is not yet full */ - bcopy(data, &context->buffer[usedspace], len); - context->bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA256_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - SHA256_Transform(context, (const sha2_word32*)data); - context->bitcount += SHA256_BLOCK_LENGTH << 3; - len -= SHA256_BLOCK_LENGTH; - data += SHA256_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - bcopy(data, context->buffer, len); - context->bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { - sha2_word32 *d = (sha2_word32*)digest; - unsigned int usedspace; - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount,context->bitcount); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - bzero(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA256_BLOCK_LENGTH) { - bzero(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); - - /* And set-up for the last transform: */ - bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - } - } else { - /* Set-up for the last transform: */ - bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; - - /* Final transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); - -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE32(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else - bcopy(context->state, d, SHA256_DIGEST_LENGTH); -#endif - } - - /* Clean up state data: */ - bzero(context, sizeof(*context)); - usedspace = 0; -} - char *SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; @@ -641,7 +295,7 @@ char *SHA256_End(SHA256_CTX* context, ch return buffer; } -char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { +char* SHA256_Data(const void *data, unsigned int len, char *digest) { SHA256_CTX context; SHA256_Init(&context); Modified: stable/10/sys/crypto/sha2/sha2.h ============================================================================== --- stable/10/sys/crypto/sha2/sha2.h Thu Feb 23 15:30:21 2017 (r314142) +++ stable/10/sys/crypto/sha2/sha2.h Thu Feb 23 16:05:11 2017 (r314143) @@ -56,70 +56,17 @@ extern "C" { #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) -/*** SHA-256/384/512 Context Structures *******************************/ -/* NOTE: If your architecture does not define either u_intXX_t types or - * uintXX_t (from inttypes.h), you may need to define things by hand - * for your system: - */ -#if 0 -typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ -typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ -typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */ -#endif -/* - * Most BSD systems already define u_intXX_t types, as does Linux. - * Some systems, however, like Compaq's Tru64 Unix instead can use - * uintXX_t types defined by very recent ANSI C standards and included - * in the file: - * - * #include - * - * If you choose to use then please define: - * - * #define SHA2_USE_INTTYPES_H - * - * Or on the command line during compile: - * - * cc -DSHA2_USE_INTTYPES_H ... - */ -#if 0 /*def SHA2_USE_INTTYPES_H*/ - -typedef struct _SHA256_CTX { - uint32_t state[8]; - uint64_t bitcount; - uint8_t buffer[SHA256_BLOCK_LENGTH]; -} SHA256_CTX; +/*** SHA-384/512 Context Structures *******************************/ typedef struct _SHA512_CTX { uint64_t state[8]; uint64_t bitcount[2]; uint8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; -#else /* SHA2_USE_INTTYPES_H */ - -typedef struct _SHA256_CTX { - u_int32_t state[8]; - u_int64_t bitcount; - u_int8_t buffer[SHA256_BLOCK_LENGTH]; -} SHA256_CTX; -typedef struct _SHA512_CTX { - u_int64_t state[8]; - u_int64_t bitcount[2]; - u_int8_t buffer[SHA512_BLOCK_LENGTH]; -} SHA512_CTX; - -#endif /* SHA2_USE_INTTYPES_H */ - typedef SHA512_CTX SHA384_CTX; -/*** SHA-256/384/512 Function Prototypes ******************************/ - -void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); -void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); -char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); +/*** SHA-384/512 Function Prototypes ******************************/ void SHA384_Init(SHA384_CTX*); void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); @@ -137,4 +84,6 @@ char* SHA512_Data(const u_int8_t*, size_ } #endif /* __cplusplus */ +#include "sha256.h" + #endif /* __SHA2_H__ */ Copied and modified: stable/10/sys/crypto/sha2/sha256.h (from r263215, head/sys/crypto/sha2/sha256.h) ============================================================================== --- head/sys/crypto/sha2/sha256.h Sun Mar 16 00:57:26 2014 (r263215, copy source) +++ stable/10/sys/crypto/sha2/sha256.h Thu Feb 23 16:05:11 2017 (r314143) @@ -29,22 +29,58 @@ #ifndef _SHA256_H_ #define _SHA256_H_ +#ifndef _KERNEL #include +#endif typedef struct SHA256Context { uint32_t state[8]; uint64_t count; - unsigned char buf[64]; + uint8_t buf[64]; } SHA256_CTX; __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#ifndef SHA256_Init +#define SHA256_Init _libmd_SHA256_Init +#endif +#ifndef SHA256_Update +#define SHA256_Update _libmd_SHA256_Update +#endif +#ifndef SHA256_Final +#define SHA256_Final _libmd_SHA256_Final +#endif +#ifndef SHA256_End +#define SHA256_End _libmd_SHA256_End +#endif +#ifndef SHA256_File +#define SHA256_File _libmd_SHA256_File +#endif +#ifndef SHA256_FileChunk +#define SHA256_FileChunk _libmd_SHA256_FileChunk +#endif +#ifndef SHA256_Data +#define SHA256_Data _libmd_SHA256_Data +#endif + +#ifndef SHA256_Transform +#define SHA256_Transform _libmd_SHA256_Transform +#endif +#ifndef SHA256_version +#define SHA256_version _libmd_SHA256_version +#endif + void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); void SHA256_Final(unsigned char [32], SHA256_CTX *); char *SHA256_End(SHA256_CTX *, char *); +char *SHA256_Data(const void *, unsigned int, char *); +#ifndef _KERNEL char *SHA256_File(const char *, char *); char *SHA256_FileChunk(const char *, char *, off_t, off_t); -char *SHA256_Data(const void *, unsigned int, char *); +#endif __END_DECLS #endif /* !_SHA256_H_ */ Copied and modified: stable/10/sys/crypto/sha2/sha256c.c (from r263215, head/sys/crypto/sha2/sha256c.c) ============================================================================== --- head/sys/crypto/sha2/sha256c.c Sun Mar 16 00:57:26 2014 (r263215, copy source) +++ stable/10/sys/crypto/sha2/sha256c.c Thu Feb 23 16:05:11 2017 (r314143) @@ -30,7 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef _KERNEL +#include +#else #include +#endif #include "sha256.h" @@ -295,3 +299,18 @@ SHA256_Final(unsigned char digest[32], S /* Clear the context state */ memset((void *)ctx, 0, sizeof(*ctx)); } + +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ +#undef SHA256_Init +__weak_reference(_libmd_SHA256_Init, SHA256_Init); +#undef SHA256_Update +__weak_reference(_libmd_SHA256_Update, SHA256_Update); +#undef SHA256_Final +__weak_reference(_libmd_SHA256_Final, SHA256_Final); +#undef SHA256_Transform +__weak_reference(_libmd_SHA256_Transform, SHA256_Transform); +#endif From owner-svn-src-stable-10@freebsd.org Thu Feb 23 16:07:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A93CEA734; Thu, 23 Feb 2017 16:07:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56D26E; Thu, 23 Feb 2017 16:07:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NG7kZM040394; Thu, 23 Feb 2017 16:07:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NG7jNN040379; Thu, 23 Feb 2017 16:07:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702231607.v1NG7jNN040379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 16:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314144 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 16:07:48 -0000 Author: avg Date: Thu Feb 23 16:07:45 2017 New Revision: 314144 URL: https://svnweb.freebsd.org/changeset/base/314144 Log: MFC r282726: Ensure libmd symbols do not clash with libcrypto Add a prefix to all symbols in libmd to avoid incompatibilites with same-named, but not binary compatible, symbols from libcrypto. Also introduce Weak aliases to avoid the need to rebuild dependent binaries and a major version bump. PR: 199119 Modified: stable/10/lib/libmd/md4.h stable/10/lib/libmd/md4c.c stable/10/lib/libmd/md5.h stable/10/lib/libmd/md5c.c stable/10/lib/libmd/mdXhl.c stable/10/lib/libmd/ripemd.h stable/10/lib/libmd/rmd160c.c stable/10/lib/libmd/sha.h stable/10/lib/libmd/sha1c.c stable/10/lib/libmd/sha256.h stable/10/lib/libmd/sha256c.c stable/10/lib/libmd/sha512.h stable/10/lib/libmd/sha512c.c stable/10/lib/libmd/shadriver.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmd/md4.h ============================================================================== --- stable/10/lib/libmd/md4.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/md4.h Thu Feb 23 16:07:45 2017 (r314144) @@ -35,6 +35,18 @@ typedef struct MD4Context { #include __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define MD4Init _libmd_MD4Init +#define MD4Update _libmd_MD4Update +#define MD4Pad _libmd_MD4Pad +#define MD4Final _libmd_MD4Final +#define MD4End _libmd_MD4End +#define MD4File _libmd_MD4File +#define MD4FileChunk _libmd_MD4FileChunk +#define MD4Data _libmd_MD4Data + void MD4Init(MD4_CTX *); void MD4Update(MD4_CTX *, const void *, unsigned int); void MD4Pad(MD4_CTX *); Modified: stable/10/lib/libmd/md4c.c ============================================================================== --- stable/10/lib/libmd/md4c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/md4c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -290,3 +290,12 @@ unsigned int len; output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } + +#undef MD4Init +__weak_reference(_libmd_MD4Init, MD4Init); +#undef MD4Update +__weak_reference(_libmd_MD4Update, MD4Update); +#undef MD4Pad +__weak_reference(_libmd_MD4Pad, MD4Pad); +#undef MD4Final +__weak_reference(_libmd_MD4Final, MD4Final); Modified: stable/10/lib/libmd/md5.h ============================================================================== --- stable/10/lib/libmd/md5.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/md5.h Thu Feb 23 16:07:45 2017 (r314144) @@ -1,4 +1,23 @@ +/* $FreeBSD$ */ + #ifndef _MD5_H_ #define _MD5_H_ + +#ifndef _KERNEL + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define MD5Init _libmd_MD5Init +#define MD5Update _libmd_MD5Update +#define MD5Pad _libmd_MD5Pad +#define MD5Final _libmd_MD5Final +#define MD5Transform _libmd_MD5Transform +#define MD5End _libmd_MD5End +#define MD5File _libmd_MD5File +#define MD5FileChunk _libmd_MD5FileChunk +#define MD5Data _libmd_MD5Data + +#endif + #include #endif /* _MD5_H_ */ Modified: stable/10/lib/libmd/md5c.c ============================================================================== --- stable/10/lib/libmd/md5c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/md5c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include "md5.h" static void MD5Transform(u_int32_t [4], const unsigned char [64]); @@ -335,3 +335,14 @@ MD5Transform (state, block) /* Zeroize sensitive information. */ memset ((void *)x, 0, sizeof (x)); } + +#undef MD5Init +__weak_reference(_libmd_MD5Init, MD5Init); +#undef MD5Update +__weak_reference(_libmd_MD5Update, MD5Update); +#undef MD5Pad +__weak_reference(_libmd_MD5Pad, MD5Pad); +#undef MD5Final +__weak_reference(_libmd_MD5Final, MD5Final); +#undef MD5Transform +__weak_reference(_libmd_MD5Transform, MD5Transform); Modified: stable/10/lib/libmd/mdXhl.c ============================================================================== --- stable/10/lib/libmd/mdXhl.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/mdXhl.c Thu Feb 23 16:07:45 2017 (r314144) @@ -96,3 +96,12 @@ MDXData (const void *data, unsigned int MDXUpdate(&ctx,data,len); return (MDXEnd(&ctx, buf)); } + +#undef MDXEnd +__weak_reference(_libmd_MDXEnd, MDXEnd); +#undef MDXFile +__weak_reference(_libmd_MDXFile, MDXFile); +#undef MDXFileChunk +__weak_reference(_libmd_MDXFileChunk, MDXFileChunk); +#undef MDXData +__weak_reference(_libmd_MDXData, MDXData); Modified: stable/10/lib/libmd/ripemd.h ============================================================================== --- stable/10/lib/libmd/ripemd.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/ripemd.h Thu Feb 23 16:07:45 2017 (r314144) @@ -81,6 +81,21 @@ typedef struct RIPEMD160state_st { } RIPEMD160_CTX; __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define RIPEMD160_Init _libmd_RIPEMD160_Init +#define RIPEMD160_Update _libmd_RIPEMD160_Update +#define RIPEMD160_Final _libmd_RIPEMD160_Final +#define RIPEMD160_End _libmd_RIPEMD160_End +#define RIPEMD160_File _libmd_RIPEMD160_File +#define RIPEMD160_FileChunk _libmd_RIPEMD160_FileChunk +#define RIPEMD160_Data _libmd_RIPEMD160_Data + +#define RIPEMD160_Transform _libmd_RIPEMD160_Transform +#define RMD160_version _libmd_RMD160_version +#define ripemd160_block _libmd_ripemd160_block + void RIPEMD160_Init(RIPEMD160_CTX *c); void RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); Modified: stable/10/lib/libmd/rmd160c.c ============================================================================== --- stable/10/lib/libmd/rmd160c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/rmd160c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -545,3 +545,16 @@ unsigned long *l; } } #endif + +#undef RIPEMD160_Init +__weak_reference(_libmd_RIPEMD160_Init, RIPEMD160_Init); +#undef RIPEMD160_Update +__weak_reference(_libmd_RIPEMD160_Update, RIPEMD160_Update); +#undef RIPEMD160_Final +__weak_reference(_libmd_RIPEMD160_Final, RIPEMD160_Final); +#undef RIPEMD160_Transform +__weak_reference(_libmd_RIPEMD160_Transform, RIPEMD160_Transform); +#undef RMD160_version +__weak_reference(_libmd_RMD160_version, RMD160_version); +#undef ripemd160_block +__weak_reference(_libmd_ripemd160_block, ripemd160_block); Modified: stable/10/lib/libmd/sha.h ============================================================================== --- stable/10/lib/libmd/sha.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha.h Thu Feb 23 16:07:45 2017 (r314144) @@ -79,6 +79,33 @@ typedef struct SHAstate_st { #define SHA1_CTX SHA_CTX __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define SHA_Init _libmd_SHA_Init +#define SHA_Update _libmd_SHA_Update +#define SHA_Final _libmd_SHA_Final +#define SHA_End _libmd_SHA_End +#define SHA_File _libmd_SHA_File +#define SHA_FileChunk _libmd_SHA_FileChunk +#define SHA_Data _libmd_SHA_Data + +#define SHA_Transform _libmd_SHA_Transform +#define SHA_version _libmd_SHA_version +#define sha_block _libmd_sha_block + +#define SHA1_Init _libmd_SHA1_Init +#define SHA1_Update _libmd_SHA1_Update +#define SHA1_Final _libmd_SHA1_Final +#define SHA1_End _libmd_SHA1_End +#define SHA1_File _libmd_SHA1_File +#define SHA1_FileChunk _libmd_SHA1_FileChunk +#define SHA1_Data _libmd_SHA1_Data + +#define SHA1_Transform _libmd_SHA1_Transform +#define SHA1_version _libmd_SHA1_version +#define sha1_block _libmd_sha1_block + void SHA_Init(SHA_CTX *c); void SHA_Update(SHA_CTX *c, const void *data, size_t len); void SHA_Final(unsigned char *md, SHA_CTX *c); @@ -86,6 +113,7 @@ char *SHA_End(SHA_CTX *, char *); char *SHA_File(const char *, char *); char *SHA_FileChunk(const char *, char *, off_t, off_t); char *SHA_Data(const void *, unsigned int, char *); + void SHA1_Init(SHA_CTX *c); void SHA1_Update(SHA_CTX *c, const void *data, size_t len); void SHA1_Final(unsigned char *md, SHA_CTX *c); Modified: stable/10/lib/libmd/sha1c.c ============================================================================== --- stable/10/lib/libmd/sha1c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha1c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -488,3 +488,28 @@ SHA_CTX *c; /* memset((char *)&c,0,sizeof(c));*/ } + +#undef SHA_Init +__weak_reference(_libmd_SHA_Init, SHA_Init); +#undef SHA_Update +__weak_reference(_libmd_SHA_Update, SHA_Update); +#undef SHA_Final +__weak_reference(_libmd_SHA_Final, SHA_Final); +#undef SHA_Transform +__weak_reference(_libmd_SHA_Transform, SHA_Transform); +#undef SHA_version +__weak_reference(_libmd_SHA_version, SHA_version); +#undef sha_block +__weak_reference(_libmd_sha_block, sha_block); +#undef SHA1_Init +__weak_reference(_libmd_SHA1_Init, SHA1_Init); +#undef SHA1_Update +__weak_reference(_libmd_SHA1_Update, SHA1_Update); +#undef SHA1_Final +__weak_reference(_libmd_SHA1_Final, SHA1_Final); +#undef SHA1_Transform +__weak_reference(_libmd_SHA1_Transform, SHA1_Transform); +#undef SHA1_version +__weak_reference(_libmd_SHA1_version, SHA1_version); +#undef sha1_block +__weak_reference(_libmd_sha1_block, sha1_block); Modified: stable/10/lib/libmd/sha256.h ============================================================================== --- stable/10/lib/libmd/sha256.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha256.h Thu Feb 23 16:07:45 2017 (r314144) @@ -38,6 +38,20 @@ typedef struct SHA256Context { } SHA256_CTX; __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define SHA256_Init _libmd_SHA256_Init +#define SHA256_Update _libmd_SHA256_Update +#define SHA256_Final _libmd_SHA256_Final +#define SHA256_End _libmd_SHA256_End +#define SHA256_File _libmd_SHA256_File +#define SHA256_FileChunk _libmd_SHA256_FileChunk +#define SHA256_Data _libmd_SHA256_Data + +#define SHA256_Transform _libmd_SHA256_Transform +#define SHA256_version _libmd_SHA256_version + void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); void SHA256_Final(unsigned char [32], SHA256_CTX *); Modified: stable/10/lib/libmd/sha256c.c ============================================================================== --- stable/10/lib/libmd/sha256c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha256c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -298,3 +298,14 @@ SHA256_Final(unsigned char digest[32], S /* Clear the context state */ memset((void *)ctx, 0, sizeof(*ctx)); } + +#undef SHA256_Init +__weak_reference(_libmd_SHA256_Init, SHA256_Init); +#undef SHA256_Update +__weak_reference(_libmd_SHA256_Update, SHA256_Update); +#undef SHA256_Final +__weak_reference(_libmd_SHA256_Final, SHA256_Final); +#undef SHA256_Transform +__weak_reference(_libmd_SHA256_Transform, SHA256_Transform); +#undef SHA256_version +__weak_reference(_libmd_SHA256_version, SHA256_version); Modified: stable/10/lib/libmd/sha512.h ============================================================================== --- stable/10/lib/libmd/sha512.h Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha512.h Thu Feb 23 16:07:45 2017 (r314144) @@ -38,6 +38,20 @@ typedef struct SHA512Context { } SHA512_CTX; __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#define SHA512_Init _libmd_SHA512_Init +#define SHA512_Update _libmd_SHA512_Update +#define SHA512_Final _libmd_SHA512_Final +#define SHA512_End _libmd_SHA512_End +#define SHA512_File _libmd_SHA512_File +#define SHA512_FileChunk _libmd_SHA512_FileChunk +#define SHA512_Data _libmd_SHA512_Data + +#define SHA512_Transform _libmd_SHA512_Transform +#define SHA512_version _libmd_SHA512_version + void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const void *, size_t); void SHA512_Final(unsigned char [64], SHA512_CTX *); Modified: stable/10/lib/libmd/sha512c.c ============================================================================== --- stable/10/lib/libmd/sha512c.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/sha512c.c Thu Feb 23 16:07:45 2017 (r314144) @@ -318,3 +318,14 @@ SHA512_Final(unsigned char digest[64], S /* Clear the context state */ memset((void *)ctx, 0, sizeof(*ctx)); } + +#undef SHA512_Init +__weak_reference(_libmd_SHA512_Init, SHA512_Init); +#undef SHA512_Update +__weak_reference(_libmd_SHA512_Update, SHA512_Update); +#undef SHA512_Final +__weak_reference(_libmd_SHA512_Final, SHA512_Final); +#undef SHA512_Transform +__weak_reference(_libmd_SHA512_Transform, SHA512_Transform); +#undef SHA512_version +__weak_reference(_libmd_SHA512_version, SHA512_version); Modified: stable/10/lib/libmd/shadriver.c ============================================================================== --- stable/10/lib/libmd/shadriver.c Thu Feb 23 16:05:11 2017 (r314143) +++ stable/10/lib/libmd/shadriver.c Thu Feb 23 16:07:45 2017 (r314144) @@ -31,10 +31,13 @@ __FBSDID("$FreeBSD$"); #endif #if SHA == 1 +#undef SHA_Data #define SHA_Data SHA1_Data #elif SHA == 256 +#undef SHA_Data #define SHA_Data SHA256_Data #elif SHA == 512 +#undef SHA_Data #define SHA_Data SHA512_Data #endif From owner-svn-src-stable-10@freebsd.org Thu Feb 23 16:15:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 788C0CEAADA; Thu, 23 Feb 2017 16:15:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E4CEA5D; Thu, 23 Feb 2017 16:15:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NGFhXX044761; Thu, 23 Feb 2017 16:15:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NGFhAO044755; Thu, 23 Feb 2017 16:15:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702231615.v1NGFhAO044755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 16:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314146 - in stable/10/sys/modules: crypto geom/geom_bde random zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 16:15:44 -0000 Author: avg Date: Thu Feb 23 16:15:42 2017 New Revision: 314146 URL: https://svnweb.freebsd.org/changeset/base/314146 Log: MFC r263219: add sha256c.c to the various modules that included sha2.c... Modified: stable/10/sys/modules/crypto/Makefile stable/10/sys/modules/geom/geom_bde/Makefile stable/10/sys/modules/random/Makefile stable/10/sys/modules/zfs/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/crypto/Makefile ============================================================================== --- stable/10/sys/modules/crypto/Makefile Thu Feb 23 16:10:15 2017 (r314145) +++ stable/10/sys/modules/crypto/Makefile Thu Feb 23 16:15:42 2017 (r314146) @@ -14,7 +14,7 @@ SRCS += criov.c cryptosoft.c xform.c SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c -SRCS += sha1.c sha2.c +SRCS += sha1.c sha2.c sha256c.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h SRCS += opt_ddb.h opt_kdtrace.h SRCS += camellia.c camellia-api.c Modified: stable/10/sys/modules/geom/geom_bde/Makefile ============================================================================== --- stable/10/sys/modules/geom/geom_bde/Makefile Thu Feb 23 16:10:15 2017 (r314145) +++ stable/10/sys/modules/geom/geom_bde/Makefile Thu Feb 23 16:15:42 2017 (r314146) @@ -6,6 +6,6 @@ KMOD= geom_bde SRCS= g_bde.c g_bde_crypt.c g_bde_lock.c g_bde_work.c -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c .include Modified: stable/10/sys/modules/random/Makefile ============================================================================== --- stable/10/sys/modules/random/Makefile Thu Feb 23 16:10:15 2017 (r314145) +++ stable/10/sys/modules/random/Makefile Thu Feb 23 16:15:42 2017 (r314146) @@ -12,7 +12,7 @@ SRCS+= ivy.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c SRCS+= random_harvestq.c live_entropy_sources.c rwfile.c -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h CFLAGS+= -I${.CURDIR}/../.. Modified: stable/10/sys/modules/zfs/Makefile ============================================================================== --- stable/10/sys/modules/zfs/Makefile Thu Feb 23 16:10:15 2017 (r314145) +++ stable/10/sys/modules/zfs/Makefile Thu Feb 23 16:15:42 2017 (r314146) @@ -72,7 +72,7 @@ SRCS+= zmod_subr.c SRCS+= zutil.c .PATH: ${.CURDIR}/../../crypto/sha2 -SRCS+= sha2.c +SRCS+= sha2.c sha256c.c .PATH: ${SUNW}/common/zfs .include "${SUNW}/uts/common/Makefile.files" From owner-svn-src-stable-10@freebsd.org Thu Feb 23 18:54:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0979CE9177; Thu, 23 Feb 2017 18:54:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C901263; Thu, 23 Feb 2017 18:54:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NIsY28011639; Thu, 23 Feb 2017 18:54:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NIsYhg011633; Thu, 23 Feb 2017 18:54:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702231854.v1NIsYhg011633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 18:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314157 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 18:54:35 -0000 Author: avg Date: Thu Feb 23 18:54:33 2017 New Revision: 314157 URL: https://svnweb.freebsd.org/changeset/base/314157 Log: MFC r282736: Unbreak build following rev. 282726 (MFC-ed as r314144) Modified: stable/10/lib/libmd/md4.h stable/10/lib/libmd/md5.h stable/10/lib/libmd/ripemd.h stable/10/lib/libmd/sha.h stable/10/lib/libmd/sha256.h stable/10/lib/libmd/sha512.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmd/md4.h ============================================================================== --- stable/10/lib/libmd/md4.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/md4.h Thu Feb 23 18:54:33 2017 (r314157) @@ -38,14 +38,30 @@ __BEGIN_DECLS /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef MD4Init #define MD4Init _libmd_MD4Init +#endif +#ifndef MD4Update #define MD4Update _libmd_MD4Update +#endif +#ifndef MD4Pad #define MD4Pad _libmd_MD4Pad +#endif +#ifndef MD4Final #define MD4Final _libmd_MD4Final +#endif +#ifndef MD4End #define MD4End _libmd_MD4End +#endif +#ifndef MD4File #define MD4File _libmd_MD4File +#endif +#ifndef MD4FileChunk #define MD4FileChunk _libmd_MD4FileChunk +#endif +#ifndef MD4Data #define MD4Data _libmd_MD4Data +#endif void MD4Init(MD4_CTX *); void MD4Update(MD4_CTX *, const void *, unsigned int); Modified: stable/10/lib/libmd/md5.h ============================================================================== --- stable/10/lib/libmd/md5.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/md5.h Thu Feb 23 18:54:33 2017 (r314157) @@ -7,15 +7,33 @@ /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef MD5Init #define MD5Init _libmd_MD5Init +#endif +#ifndef MD5Update #define MD5Update _libmd_MD5Update +#endif +#ifndef MD5Pad #define MD5Pad _libmd_MD5Pad +#endif +#ifndef MD5Final #define MD5Final _libmd_MD5Final +#endif +#ifndef MD5Transform #define MD5Transform _libmd_MD5Transform +#endif +#ifndef MD5End #define MD5End _libmd_MD5End +#endif +#ifndef MD5File #define MD5File _libmd_MD5File +#endif +#ifndef MD5FileChunk #define MD5FileChunk _libmd_MD5FileChunk +#endif +#ifndef MD5Data #define MD5Data _libmd_MD5Data +#endif #endif Modified: stable/10/lib/libmd/ripemd.h ============================================================================== --- stable/10/lib/libmd/ripemd.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/ripemd.h Thu Feb 23 18:54:33 2017 (r314157) @@ -84,17 +84,37 @@ __BEGIN_DECLS /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef RIPEMD160_Init #define RIPEMD160_Init _libmd_RIPEMD160_Init +#endif +#ifndef RIPEMD160_Update #define RIPEMD160_Update _libmd_RIPEMD160_Update +#endif +#ifndef RIPEMD160_Final #define RIPEMD160_Final _libmd_RIPEMD160_Final +#endif +#ifndef RIPEMD160_End #define RIPEMD160_End _libmd_RIPEMD160_End +#endif +#ifndef RIPEMD160_File #define RIPEMD160_File _libmd_RIPEMD160_File +#endif +#ifndef RIPEMD160_FileChunk #define RIPEMD160_FileChunk _libmd_RIPEMD160_FileChunk +#endif +#ifndef RIPEMD160_Data #define RIPEMD160_Data _libmd_RIPEMD160_Data +#endif +#ifndef RIPEMD160_Transform #define RIPEMD160_Transform _libmd_RIPEMD160_Transform +#endif +#ifndef RMD160_version #define RMD160_version _libmd_RMD160_version +#endif +#ifndef ripemd160_block #define ripemd160_block _libmd_ripemd160_block +#endif void RIPEMD160_Init(RIPEMD160_CTX *c); void RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, Modified: stable/10/lib/libmd/sha.h ============================================================================== --- stable/10/lib/libmd/sha.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/sha.h Thu Feb 23 18:54:33 2017 (r314157) @@ -82,29 +82,69 @@ __BEGIN_DECLS /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA_Init #define SHA_Init _libmd_SHA_Init +#endif +#ifndef SHA_Update #define SHA_Update _libmd_SHA_Update +#endif +#ifndef SHA_Final #define SHA_Final _libmd_SHA_Final +#endif +#ifndef SHA_End #define SHA_End _libmd_SHA_End +#endif +#ifndef SHA_File #define SHA_File _libmd_SHA_File +#endif +#ifndef SHA_FileChunk #define SHA_FileChunk _libmd_SHA_FileChunk +#endif +#ifndef SHA_Data #define SHA_Data _libmd_SHA_Data +#endif +#ifndef SHA_Transform #define SHA_Transform _libmd_SHA_Transform +#endif +#ifndef SHA_version #define SHA_version _libmd_SHA_version +#endif +#ifndef sha_block #define sha_block _libmd_sha_block +#endif +#ifndef SHA1_Init #define SHA1_Init _libmd_SHA1_Init +#endif +#ifndef SHA1_Update #define SHA1_Update _libmd_SHA1_Update +#endif +#ifndef SHA1_Final #define SHA1_Final _libmd_SHA1_Final +#endif +#ifndef SHA1_End #define SHA1_End _libmd_SHA1_End +#endif +#ifndef SHA1_File #define SHA1_File _libmd_SHA1_File +#endif +#ifndef SHA1_FileChunk #define SHA1_FileChunk _libmd_SHA1_FileChunk +#endif +#ifndef SHA1_Data #define SHA1_Data _libmd_SHA1_Data +#endif +#ifndef SHA1_Transform #define SHA1_Transform _libmd_SHA1_Transform +#endif +#ifndef SHA1_version #define SHA1_version _libmd_SHA1_version +#endif +#ifndef sha1_block #define sha1_block _libmd_sha1_block +#endif void SHA_Init(SHA_CTX *c); void SHA_Update(SHA_CTX *c, const void *data, size_t len); Modified: stable/10/lib/libmd/sha256.h ============================================================================== --- stable/10/lib/libmd/sha256.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/sha256.h Thu Feb 23 18:54:33 2017 (r314157) @@ -41,16 +41,34 @@ __BEGIN_DECLS /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA256_Init #define SHA256_Init _libmd_SHA256_Init +#endif +#ifndef SHA256_Update #define SHA256_Update _libmd_SHA256_Update +#endif +#ifndef SHA256_Final #define SHA256_Final _libmd_SHA256_Final +#endif +#ifndef SHA256_End #define SHA256_End _libmd_SHA256_End +#endif +#ifndef SHA256_File #define SHA256_File _libmd_SHA256_File +#endif +#ifndef SHA256_FileChunk #define SHA256_FileChunk _libmd_SHA256_FileChunk +#endif +#ifndef SHA256_Data #define SHA256_Data _libmd_SHA256_Data +#endif +#ifndef SHA256_Transform #define SHA256_Transform _libmd_SHA256_Transform +#endif +#ifndef SHA256_version #define SHA256_version _libmd_SHA256_version +#endif void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); Modified: stable/10/lib/libmd/sha512.h ============================================================================== --- stable/10/lib/libmd/sha512.h Thu Feb 23 18:15:04 2017 (r314156) +++ stable/10/lib/libmd/sha512.h Thu Feb 23 18:54:33 2017 (r314157) @@ -41,16 +41,34 @@ __BEGIN_DECLS /* Ensure libmd symbols do not clash with libcrypto */ +#ifndef SHA512_Init #define SHA512_Init _libmd_SHA512_Init +#endif +#ifndef SHA512_Update #define SHA512_Update _libmd_SHA512_Update +#endif +#ifndef SHA512_Final #define SHA512_Final _libmd_SHA512_Final +#endif +#ifndef SHA512_End #define SHA512_End _libmd_SHA512_End +#endif +#ifndef SHA512_File #define SHA512_File _libmd_SHA512_File +#endif +#ifndef SHA512_FileChunk #define SHA512_FileChunk _libmd_SHA512_FileChunk +#endif +#ifndef SHA512_Data #define SHA512_Data _libmd_SHA512_Data +#endif +#ifndef SHA512_Transform #define SHA512_Transform _libmd_SHA512_Transform +#endif +#ifndef SHA512_version #define SHA512_version _libmd_SHA512_version +#endif void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const void *, size_t); From owner-svn-src-stable-10@freebsd.org Thu Feb 23 21:54:18 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 385DBCEB828; Thu, 23 Feb 2017 21:54:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5CE6C3E; Thu, 23 Feb 2017 21:54:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NLsH3h086249; Thu, 23 Feb 2017 21:54:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NLsHs7086248; Thu, 23 Feb 2017 21:54:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702232154.v1NLsHs7086248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 21:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314182 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 21:54:18 -0000 Author: avg Date: Thu Feb 23 21:54:16 2017 New Revision: 314182 URL: https://svnweb.freebsd.org/changeset/base/314182 Log: fixup r314143, MFC of r285366 didn't remove files that it should have Deleted: stable/10/lib/libmd/sha256.h stable/10/lib/libmd/sha256c.c From owner-svn-src-stable-10@freebsd.org Thu Feb 23 22:10:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8760CEBC48; Thu, 23 Feb 2017 22:10:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A069114B4; Thu, 23 Feb 2017 22:10:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NMAcDN090565; Thu, 23 Feb 2017 22:10:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NMAc6O090558; Thu, 23 Feb 2017 22:10:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702232210.v1NMAc6O090558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Feb 2017 22:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314184 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 22:10:39 -0000 Author: avg Date: Thu Feb 23 22:10:37 2017 New Revision: 314184 URL: https://svnweb.freebsd.org/changeset/base/314184 Log: MFC r282774: Unbreak MIPS build following r282726 (MFCed in r314144) Modified: stable/10/lib/libmd/Makefile stable/10/lib/libmd/md4c.c stable/10/lib/libmd/md5c.c stable/10/lib/libmd/mdXhl.c stable/10/lib/libmd/rmd160c.c stable/10/lib/libmd/sha1c.c stable/10/lib/libmd/sha512c.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmd/Makefile ============================================================================== --- stable/10/lib/libmd/Makefile Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/Makefile Thu Feb 23 22:10:37 2017 (r314184) @@ -42,7 +42,13 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \ sha256.ref sha256hl.c sha512.ref sha512hl.c -CFLAGS+= -I${.CURDIR} +# Define WEAK_REFS to provide weak aliases for libmd symbols +# +# Note that the same sources are also used internally by libcrypt, +# in which case: +# * macros are used to rename symbols to libcrypt internal names +# * no weak aliases are generated +CFLAGS+= -I${.CURDIR} -DWEAK_REFS .PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 .if exists(${MACHINE_ARCH}/sha.S) Modified: stable/10/lib/libmd/md4c.c ============================================================================== --- stable/10/lib/libmd/md4c.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/md4c.c Thu Feb 23 22:10:37 2017 (r314184) @@ -291,6 +291,11 @@ unsigned int len; (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef MD4Init __weak_reference(_libmd_MD4Init, MD4Init); #undef MD4Update @@ -299,3 +304,4 @@ __weak_reference(_libmd_MD4Update, MD4Up __weak_reference(_libmd_MD4Pad, MD4Pad); #undef MD4Final __weak_reference(_libmd_MD4Final, MD4Final); +#endif Modified: stable/10/lib/libmd/md5c.c ============================================================================== --- stable/10/lib/libmd/md5c.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/md5c.c Thu Feb 23 22:10:37 2017 (r314184) @@ -336,6 +336,11 @@ MD5Transform (state, block) memset ((void *)x, 0, sizeof (x)); } +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef MD5Init __weak_reference(_libmd_MD5Init, MD5Init); #undef MD5Update @@ -346,3 +351,4 @@ __weak_reference(_libmd_MD5Pad, MD5Pad); __weak_reference(_libmd_MD5Final, MD5Final); #undef MD5Transform __weak_reference(_libmd_MD5Transform, MD5Transform); +#endif Modified: stable/10/lib/libmd/mdXhl.c ============================================================================== --- stable/10/lib/libmd/mdXhl.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/mdXhl.c Thu Feb 23 22:10:37 2017 (r314184) @@ -97,6 +97,11 @@ MDXData (const void *data, unsigned int return (MDXEnd(&ctx, buf)); } +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef MDXEnd __weak_reference(_libmd_MDXEnd, MDXEnd); #undef MDXFile @@ -105,3 +110,4 @@ __weak_reference(_libmd_MDXFile, MDXFile __weak_reference(_libmd_MDXFileChunk, MDXFileChunk); #undef MDXData __weak_reference(_libmd_MDXData, MDXData); +#endif Modified: stable/10/lib/libmd/rmd160c.c ============================================================================== --- stable/10/lib/libmd/rmd160c.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/rmd160c.c Thu Feb 23 22:10:37 2017 (r314184) @@ -546,6 +546,11 @@ unsigned long *l; } #endif +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef RIPEMD160_Init __weak_reference(_libmd_RIPEMD160_Init, RIPEMD160_Init); #undef RIPEMD160_Update @@ -558,3 +563,4 @@ __weak_reference(_libmd_RIPEMD160_Transf __weak_reference(_libmd_RMD160_version, RMD160_version); #undef ripemd160_block __weak_reference(_libmd_ripemd160_block, ripemd160_block); +#endif Modified: stable/10/lib/libmd/sha1c.c ============================================================================== --- stable/10/lib/libmd/sha1c.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/sha1c.c Thu Feb 23 22:10:37 2017 (r314184) @@ -488,7 +488,11 @@ SHA_CTX *c; /* memset((char *)&c,0,sizeof(c));*/ } - +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef SHA_Init __weak_reference(_libmd_SHA_Init, SHA_Init); #undef SHA_Update @@ -513,3 +517,4 @@ __weak_reference(_libmd_SHA1_Transform, __weak_reference(_libmd_SHA1_version, SHA1_version); #undef sha1_block __weak_reference(_libmd_sha1_block, sha1_block); +#endif Modified: stable/10/lib/libmd/sha512c.c ============================================================================== --- stable/10/lib/libmd/sha512c.c Thu Feb 23 22:08:35 2017 (r314183) +++ stable/10/lib/libmd/sha512c.c Thu Feb 23 22:10:37 2017 (r314184) @@ -319,6 +319,11 @@ SHA512_Final(unsigned char digest[64], S memset((void *)ctx, 0, sizeof(*ctx)); } +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ #undef SHA512_Init __weak_reference(_libmd_SHA512_Init, SHA512_Init); #undef SHA512_Update @@ -327,5 +332,4 @@ __weak_reference(_libmd_SHA512_Update, S __weak_reference(_libmd_SHA512_Final, SHA512_Final); #undef SHA512_Transform __weak_reference(_libmd_SHA512_Transform, SHA512_Transform); -#undef SHA512_version -__weak_reference(_libmd_SHA512_version, SHA512_version); +#endif From owner-svn-src-stable-10@freebsd.org Fri Feb 24 09:30:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECCD3CEBF94; Fri, 24 Feb 2017 09:30:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC26211CB; Fri, 24 Feb 2017 09:30:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1O9UpZ1069678; Fri, 24 Feb 2017 09:30:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1O9UpH3069677; Fri, 24 Feb 2017 09:30:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702240930.v1O9UpH3069677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Feb 2017 09:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314197 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 09:30:53 -0000 Author: kib Date: Fri Feb 24 09:30:51 2017 New Revision: 314197 URL: https://svnweb.freebsd.org/changeset/base/314197 Log: MFC r313493: Define ELF_ST_VISIBILITY(). Modified: stable/10/sys/sys/elf_generic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/elf_generic.h ============================================================================== --- stable/10/sys/sys/elf_generic.h Fri Feb 24 09:16:21 2017 (r314196) +++ stable/10/sys/sys/elf_generic.h Fri Feb 24 09:30:51 2017 (r314197) @@ -84,5 +84,6 @@ __ElfType(Ssize); #define ELF_ST_BIND __ELFN(ST_BIND) #define ELF_ST_TYPE __ELFN(ST_TYPE) #define ELF_ST_INFO __ELFN(ST_INFO) +#define ELF_ST_VISIBILITY __ELFN(ST_VISIBILITY) #endif /* !_SYS_ELF_GENERIC_H_ */ From owner-svn-src-stable-10@freebsd.org Fri Feb 24 11:07:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 967C5CEBC29; Fri, 24 Feb 2017 11:07:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 587BF687; Fri, 24 Feb 2017 11:07:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OB7nDu009092; Fri, 24 Feb 2017 11:07:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OB7nrv009091; Fri, 24 Feb 2017 11:07:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702241107.v1OB7nrv009091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Feb 2017 11:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314199 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 11:07:50 -0000 Author: kib Date: Fri Feb 24 11:07:49 2017 New Revision: 314199 URL: https://svnweb.freebsd.org/changeset/base/314199 Log: MFC r313494: Handle protected symbols in rtld. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Feb 24 10:20:13 2017 (r314198) +++ stable/10/libexec/rtld-elf/rtld.c Fri Feb 24 11:07:49 2017 (r314199) @@ -3833,15 +3833,19 @@ symlook_default(SymLook *req, const Obj_ donelist_init(&donelist); symlook_init_from_req(&req1, req); - /* Look first in the referencing object if linked symbolically. */ - if (refobj->symbolic && !donelist_check(&donelist, refobj)) { - res = symlook_obj(&req1, refobj); - if (res == 0) { - req->sym_out = req1.sym_out; - req->defobj_out = req1.defobj_out; - assert(req->defobj_out != NULL); - } + /* + * Look first in the referencing object if linked symbolically, + * and similarly handle protected symbols. + */ + res = symlook_obj(&req1, refobj); + if (res == 0 && (refobj->symbolic || + ELF_ST_VISIBILITY(req1.sym_out->st_other) == STV_PROTECTED)) { + req->sym_out = req1.sym_out; + req->defobj_out = req1.defobj_out; + assert(req->defobj_out != NULL); } + if (refobj->symbolic || req->defobj_out != NULL) + donelist_check(&donelist, refobj); symlook_global(req, &donelist); From owner-svn-src-stable-10@freebsd.org Fri Feb 24 11:30:29 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE427CEA50B; Fri, 24 Feb 2017 11:30:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D0C149C; Fri, 24 Feb 2017 11:30:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OBUSNH017887; Fri, 24 Feb 2017 11:30:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OBUS3G017886; Fri, 24 Feb 2017 11:30:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702241130.v1OBUS3G017886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Feb 2017 11:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314201 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 11:30:30 -0000 Author: kib Date: Fri Feb 24 11:30:28 2017 New Revision: 314201 URL: https://svnweb.freebsd.org/changeset/base/314201 Log: MFC r313800: Do not access memory past the buffer end. Do not accept and silently truncate too long hostname. Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvfsops.c Fri Feb 24 11:25:32 2017 (r314200) +++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c Fri Feb 24 11:30:28 2017 (r314201) @@ -1149,8 +1149,13 @@ nfs_mount(struct mount *mp) error = EINVAL; goto out; } - bcopy(args.hostname, hst, MNAMELEN); - hst[MNAMELEN - 1] = '\0'; + if (len >= MNAMELEN) { + vfs_mount_error(mp, "Hostname too long"); + error = EINVAL; + goto out; + } + bcopy(args.hostname, hst, len); + hst[len] = '\0'; } if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0) From owner-svn-src-stable-10@freebsd.org Fri Feb 24 11:34:02 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09DABCEA791; Fri, 24 Feb 2017 11:34:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A59EA18B3; Fri, 24 Feb 2017 11:34:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OBY0ZY021669; Fri, 24 Feb 2017 11:34:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OBY0T6021668; Fri, 24 Feb 2017 11:34:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702241134.v1OBY0T6021668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Feb 2017 11:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314202 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 11:34:02 -0000 Author: kib Date: Fri Feb 24 11:34:00 2017 New Revision: 314202 URL: https://svnweb.freebsd.org/changeset/base/314202 Log: MFC r313496: Increase a chance of devfs_close() calling d_close cdevsw method. Modified: stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Fri Feb 24 11:30:28 2017 (r314201) +++ stable/10/sys/kern/vfs_vnops.c Fri Feb 24 11:34:00 2017 (r314202) @@ -412,12 +412,9 @@ vn_writechk(vp) /* * Vnode close call */ -int -vn_close(vp, flags, file_cred, td) - register struct vnode *vp; - int flags; - struct ucred *file_cred; - struct thread *td; +static int +vn_close1(struct vnode *vp, int flags, struct ucred *file_cred, + struct thread *td, bool keep_ref) { struct mount *mp; int error, lock_flags; @@ -438,11 +435,22 @@ vn_close(vp, flags, file_cred, td) __func__, vp, vp->v_writecount); } error = VOP_CLOSE(vp, flags, file_cred, td); - vput(vp); + if (keep_ref) + VOP_UNLOCK(vp, 0); + else + vput(vp); vn_finished_write(mp); return (error); } +int +vn_close(struct vnode *vp, int flags, struct ucred *file_cred, + struct thread *td) +{ + + return (vn_close1(vp, flags, file_cred, td, false)); +} + /* * Heuristic to detect sequential operation. */ @@ -1624,16 +1632,15 @@ vn_closefile(fp, td) struct vnode *vp; struct flock lf; int error; + bool ref; vp = fp->f_vnode; fp->f_ops = &badfileops; + ref= (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) - vref(vp); - - error = vn_close(vp, fp->f_flag, fp->f_cred, td); + error = vn_close1(vp, fp->f_flag, fp->f_cred, td, ref); - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) { + if (__predict_false(ref)) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; From owner-svn-src-stable-10@freebsd.org Fri Feb 24 20:51:41 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 561B1CEB27A; Fri, 24 Feb 2017 20:51:41 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1717DE07; Fri, 24 Feb 2017 20:51:41 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OKpegw051879; Fri, 24 Feb 2017 20:51:40 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OKpdcE051872; Fri, 24 Feb 2017 20:51:39 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702242051.v1OKpdcE051872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 24 Feb 2017 20:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314221 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 20:51:41 -0000 Author: ken Date: Fri Feb 24 20:51:39 2017 New Revision: 314221 URL: https://svnweb.freebsd.org/changeset/base/314221 Log: MFC r313893 ------------------------------------------------------------------------ r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines Add task attribute support to camcontrol(8). Users can use the new generic argument, -Q task_attr, to specify a task attribute (simple, ordered, head of queue, aca) for the commands issued. The the default is simple, which works with all SCSI devices that support tagged queueing. This will mostly be useful for debugging target behavior in certain situations. You can try it out by compiling CTL with CTL_IO_DELAY turned on (in sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL LUNs: ctladm delay 0:0 -l done -t 10 camcontrol tur da34 -v And at then before the 10 second timer is up, in another terminal: camcontrol inquiry da34 -Q ordered -v The Inquiry should complete just after the TUR completes. Ordinarily it would complete first because of the delay injection, but because the task attribute is set to ordered in this case, CTL holds it up until the previous command has completed. sbin/camcontrol/camcontrol.c: Add the new generic argument, -Q, which allows the user to specify a SCSI task attribute. The user can specify task attributes by name or numerically. Add a new task_attr arguments to SCSI sub-functions. sbin/camcontrol/attrib.c, sbin/camcontrol/camcontrol.h, sbin/camcontrol/fwdownload.c, sbin/camcontrol/modeedit.c, sbin/camcontrol/persist.c, sbin/camcontrol/timestamp.c, sbin/camcontrol/zone.c: Add the new task_attr argument to SCSI sub-functions. sbin/camcontrol/camcontrol.8: Document the new -Q option, and add an example. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/sbin/camcontrol/attrib.c stable/10/sbin/camcontrol/camcontrol.8 stable/10/sbin/camcontrol/camcontrol.c stable/10/sbin/camcontrol/camcontrol.h stable/10/sbin/camcontrol/fwdownload.c stable/10/sbin/camcontrol/modeedit.c stable/10/sbin/camcontrol/persist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/attrib.c ============================================================================== --- stable/10/sbin/camcontrol/attrib.c Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/attrib.c Fri Feb 24 20:51:39 2017 (r314221) @@ -106,7 +106,8 @@ static struct scsi_nv output_format_map[ int scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode, int err_recover) + int task_attr, int retry_count, int timeout, int verbosemode, + int err_recover) { union ccb *ccb = NULL; int attr_num = -1; @@ -317,7 +318,7 @@ scsiattrib(struct cam_device *device, in scsi_read_attribute(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*service_action*/ read_service_action, /*element*/ element_address, /*elem_type*/ element_type, Modified: stable/10/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.8 Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/camcontrol.8 Fri Feb 24 20:51:39 2017 (r314221) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2017 +.Dd February 17, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -397,6 +397,17 @@ It may take some other actions, dependin the command. .It Fl n Ar dev_name Specify the device type to operate on, e.g.\& "da", "cd". +.It Fl Q Ar task_attr +.Tn SCSI +task attribute for the command, if it is a +.Tn SCSI +command. +This may be ordered, simple, head, or aca. +In most cases this is not needed. +The default is simple, which works with all +.Tn SCSI +devices. +The task attribute may also be specified numerically. .It Fl t Ar timeout SCSI command timeout in seconds. This overrides the default timeout for @@ -2143,7 +2154,7 @@ information if the command fails since t .Fl v switch was not specified. .Bd -literal -offset indent -camcontrol tur da1 -E -C 4 -t 50 -v +camcontrol tur da1 -E -C 4 -t 50 -Q head -v .Ed .Pp Send a test unit ready command to da1. @@ -2156,6 +2167,9 @@ flag) if the command fails. Since error recovery is turned on, the disk will be spun up if it is not currently spinning. The +.Tn SCSI +task attribute for the command will be set to Head of Queue. +The .Nm utility will report whether the disk is ready. .Bd -literal -offset indent Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/camcontrol.c Fri Feb 24 20:51:39 2017 (r314221) @@ -168,6 +168,14 @@ struct ata_set_max_pwd u_int16_t reserved2[239]; }; +static struct scsi_nv task_attrs[] = { + { "simple", MSG_SIMPLE_Q_TAG }, + { "head", MSG_HEAD_OF_Q_TAG }, + { "ordered", MSG_ORDERED_Q_TAG }, + { "iwr", MSG_IGN_WIDE_RESIDUE }, + { "aca", MSG_ACA_TASK } +}; + static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GPqsS:X"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; @@ -259,12 +267,14 @@ static int getdevlist(struct cam_device #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); #ifndef MINIMALISTIC -static int testunitready(struct cam_device *device, int retry_count, - int timeout, int quiet); +static int testunitready(struct cam_device *device, int task_attr, + int retry_count, int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout); -static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); -static int scsiserial(struct cam_device *device, int retry_count, int timeout); + int task_attr, int retry_count, int timeout); +static int scsiinquiry(struct cam_device *device, int task_attr, + int retry_count, int timeout); +static int scsiserial(struct cam_device *device, int task_attr, + int retry_count, int timeout); #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); @@ -274,11 +284,14 @@ static int scanlun_or_reset_dev(path_id_ lun_id_t lun, int scan); #ifndef MINIMALISTIC static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static void modepage(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsicmd(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int smpreportgeneral(struct cam_device *device, int argc, char **argv, @@ -303,16 +316,21 @@ static int get_cpi(struct cam_device *de static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd); static int get_print_cts(struct cam_device *device, int user_settings, int quiet, struct ccb_trans_settings *cts); -static int ratecontrol(struct cam_device *device, int retry_count, - int timeout, int argc, char **argv, char *combinedopt); +static int ratecontrol(struct cam_device *device, int task_attr, + int retry_count, int timeout, int argc, char **argv, + char *combinedopt); static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int atasecurity(struct cam_device *device, int retry_count, int timeout, @@ -325,8 +343,8 @@ static int scsiprintoneopcode(struct cam static int scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf, uint32_t valid_len); static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, - int verbose); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose); static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ @@ -644,8 +662,8 @@ getdevtree(int argc, char **argv, char * #ifndef MINIMALISTIC static int -testunitready(struct cam_device *device, int retry_count, int timeout, - int quiet) +testunitready(struct cam_device *device, int task_attr, int retry_count, + int timeout, int quiet) { int error = 0; union ccb *ccb; @@ -655,7 +673,7 @@ testunitready(struct cam_device *device, scsi_test_unit_ready(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -699,7 +717,7 @@ testunitready(struct cam_device *device, static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; int error = 0; @@ -710,13 +728,19 @@ scsistart(struct cam_device *device, int * If we're stopping, send an ordered tag so the drive in question * will finish any previously queued writes before stopping. If * the device isn't capable of tagged queueing, or if tagged - * queueing is turned off, the tag action is a no-op. - */ + * queueing is turned off, the tag action is a no-op. We override + * the default simple tag, although this also has the effect of + * overriding the user's wishes if he wanted to specify a simple + * tag. + */ + if ((startstop == 0) + && (task_attr == MSG_SIMPLE_Q_TAG)) + task_attr = MSG_ORDERED_Q_TAG; + scsi_start_stop(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ startstop ? MSG_SIMPLE_Q_TAG : - MSG_ORDERED_Q_TAG, + /* tag_action */ task_attr, /* start/stop */ startstop, /* load_eject */ loadeject, /* immediate */ 0, @@ -777,7 +801,7 @@ scsistart(struct cam_device *device, int int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { int c; int error = 0; @@ -806,13 +830,13 @@ scsidoinquiry(struct cam_device *device, arglist |= CAM_ARG_INQ_MASK; if (arglist & CAM_ARG_GET_STDINQ) - error = scsiinquiry(device, retry_count, timeout); + error = scsiinquiry(device, task_attr, retry_count, timeout); if (error != 0) return(error); if (arglist & CAM_ARG_GET_SERIAL) - scsiserial(device, retry_count, timeout); + scsiserial(device, task_attr, retry_count, timeout); if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); @@ -821,7 +845,8 @@ scsidoinquiry(struct cam_device *device, } static int -scsiinquiry(struct cam_device *device, int retry_count, int timeout) +scsiinquiry(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_inquiry_data *inq_buf; @@ -883,7 +908,7 @@ scsiinquiry(struct cam_device *device, i scsi_inquiry(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)inq_buf, /* inq_len */ SHORT_INQUIRY_LENGTH, /* evpd */ 0, @@ -935,7 +960,8 @@ scsiinquiry(struct cam_device *device, i } static int -scsiserial(struct cam_device *device, int retry_count, int timeout) +scsiserial(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_vpd_unit_serial_number *serial_buf; @@ -964,7 +990,7 @@ scsiserial(struct cam_device *device, in scsi_inquiry(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)serial_buf, /* inq_len */ sizeof(*serial_buf), /* evpd */ 1, @@ -3400,7 +3426,7 @@ static struct scsi_nv defect_list_type_m static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb = NULL; struct scsi_read_defect_data_hdr_10 *hdr10 = NULL; @@ -3542,7 +3568,7 @@ next_batch: scsi_read_defects(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*list_format*/ list_format, /*addr_desc_index*/ starting_offset, /*data_ptr*/ defect_list, @@ -3980,7 +4006,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC void mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retry_count, int timeout, u_int8_t *data, int datalen) + int task_attr, int retry_count, int timeout, u_int8_t *data, + int datalen) { union ccb *ccb; int retval; @@ -3995,7 +4022,7 @@ mode_sense(struct cam_device *device, in scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* dbd */ dbd, /* pc */ pc << 6, /* page */ page, @@ -4030,8 +4057,8 @@ mode_sense(struct cam_device *device, in } void -mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen) +mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -4046,7 +4073,7 @@ mode_select(struct cam_device *device, i scsi_mode_select(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* scsi_page_fmt */ 1, /* save_pages */ save_pages, /* param_buf */ data, @@ -4081,7 +4108,7 @@ mode_select(struct cam_device *device, i void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { char *str_subpage; int c, page = -1, subpage = -1, pc = 0; @@ -4128,16 +4155,17 @@ modepage(struct cam_device *device, int errx(1, "you must specify a mode page!"); if (list != 0) { - mode_list(device, dbd, pc, list > 1, retry_count, timeout); + mode_list(device, dbd, pc, list > 1, task_attr, retry_count, + timeout); } else { mode_edit(device, dbd, pc, page, subpage, edit, binary, - retry_count, timeout); + task_attr, retry_count, timeout); } } static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int32_t flags = CAM_DIR_NONE; @@ -4382,7 +4410,7 @@ scsicmd(struct cam_device *device, int a /*retries*/ retry_count, /*cbfcnp*/ NULL, /*flags*/ flags, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*data_ptr*/ data_ptr, /*dxfer_len*/ data_bytes, /*sense_len*/ SSD_FULL_SIZE, @@ -5333,8 +5361,8 @@ get_print_cts_bailout: } static int -ratecontrol(struct cam_device *device, int retry_count, int timeout, - int argc, char **argv, char *combinedopt) +ratecontrol(struct cam_device *device, int task_attr, int retry_count, + int timeout, int argc, char **argv, char *combinedopt) { int c; union ccb *ccb; @@ -5664,7 +5692,7 @@ ratecontrol(struct cam_device *device, i } } if (send_tur) { - retval = testunitready(device, retry_count, timeout, + retval = testunitready(device, task_attr, retry_count, timeout, (arglist & CAM_ARG_VERBOSE) ? 0 : 1); /* * If the TUR didn't succeed, just bail. @@ -5689,7 +5717,7 @@ ratecontrol_bailout: static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c; @@ -5738,7 +5766,7 @@ scsiformat(struct cam_device *device, in "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsiformat: error sending inquiry"); @@ -5810,7 +5838,7 @@ scsiformat(struct cam_device *device, in scsi_format_unit(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* ileave */ 0, /* data_ptr */ data_ptr, @@ -5869,7 +5897,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -5979,7 +6007,7 @@ scsiformat_bailout: static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; @@ -6144,7 +6172,7 @@ scsisanitize(struct cam_device *device, "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsisanitize: error sending inquiry"); @@ -6202,7 +6230,7 @@ scsisanitize(struct cam_device *device, scsi_sanitize(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* control */ 0, /* data_ptr */ data_ptr, @@ -6277,7 +6305,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -6389,7 +6417,7 @@ scsisanitize_bailout: static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c, countonly, lunsonly; @@ -6466,7 +6494,7 @@ retry: scsi_report_luns(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*select_report*/ report_type, /*rpl_buf*/ lundata, /*alloc_len*/ alloc_len, @@ -6631,7 +6659,7 @@ bailout: static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten; @@ -6717,7 +6745,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, &rcap, SSD_FULL_SIZE, /*timeout*/ timeout ? timeout : 5000); @@ -6759,7 +6787,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity_16(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*lba*/ 0, /*reladdr*/ 0, /*pmi*/ 0, @@ -8200,8 +8228,8 @@ ataaxm(struct cam_device *device, int ar int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, int verbosemode, - uint32_t *fill_len, uint8_t **data_ptr) + int timeout_desc, int task_attr, int retry_count, int timeout, + int verbosemode, uint32_t *fill_len, uint8_t **data_ptr) { union ccb *ccb = NULL; uint8_t *buf = NULL; @@ -8268,7 +8296,7 @@ retry_alloc: scsi_report_supported_opcodes(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*options*/ options, /*req_opcode*/ opcode, /*req_service_action*/ service_action, @@ -8568,7 +8596,8 @@ bailout: static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbosemode) + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbosemode) { int c; uint32_t opcode = 0, service_action = 0; @@ -8632,8 +8661,9 @@ scsiopcodes(struct cam_device *device, i goto bailout; } retval = scsigetopcodes(device, opcode_set, opcode, show_sa_errors, - sa_set, service_action, td_set, retry_count, - timeout, verbosemode, &valid_len, &buf); + sa_set, service_action, td_set, task_attr, + retry_count, timeout, verbosemode, &valid_len, + &buf); if (retval != 0) goto bailout; @@ -8816,6 +8846,7 @@ usage(int printlong) "-u unit specify unit number, e.g. \"0\", \"5\"\n" "-E have the kernel attempt to perform SCSI error recovery\n" "-C count specify the SCSI command retry count (needs -E to work)\n" +"-Q task_attr specify ordered, simple or head tag type for SCSI cmds\n" "modepage arguments:\n" "-l list all available mode pages\n" "-m page specify the mode page to view or edit\n" @@ -8988,10 +9019,11 @@ main(int argc, char **argv) int timeout = 0, retry_count = 1; camcontrol_optret optreturn; char *tstr; - const char *mainopt = "C:En:t:u:v"; + const char *mainopt = "C:En:Q:t:u:v"; const char *subopt = NULL; char combinedopt[256]; int error = 0, optstart = 2; + int task_attr = MSG_SIMPLE_Q_TAG; int devopen = 1; #ifndef MINIMALISTIC path_id_t bus; @@ -9145,6 +9177,40 @@ main(int argc, char **argv) tstr++; device = (char *)strdup(tstr); break; + case 'Q': { + char *endptr; + int table_entry = 0; + + tstr = optarg; + while (isspace(*tstr) && (*tstr != '\0')) + tstr++; + if (isdigit(*tstr)) { + task_attr = strtol(tstr, &endptr, 0); + if (*endptr != '\0') { + errx(1, "Invalid queue option " + "%s", tstr); + } + } else { + size_t table_size; + scsi_nv_status status; + + table_size = sizeof(task_attrs) / + sizeof(task_attrs[0]); + status = scsi_get_nv(task_attrs, + table_size, tstr, &table_entry, + SCSI_NV_FLAG_IG_CASE); + if (status == SCSI_NV_FOUND) + task_attr = task_attrs[ + table_entry].value; + else { + errx(1, "%s option %s", + (status == SCSI_NV_AMBIGUOUS)? + "ambiguous" : "invalid", + tstr); + } + } + break; + } case 't': timeout = strtol(optarg, NULL, 0); if (timeout < 0) @@ -9210,19 +9276,20 @@ main(int argc, char **argv) break; #ifndef MINIMALISTIC case CAM_CMD_TUR: - error = testunitready(cam_dev, retry_count, timeout, 0); + error = testunitready(cam_dev, task_attr, retry_count, + timeout, 0); break; case CAM_CMD_INQUIRY: error = scsidoinquiry(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_IDENTIFY: error = ataidentify(cam_dev, retry_count, timeout); break; case CAM_CMD_STARTSTOP: error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, - arglist & CAM_ARG_EJECT, retry_count, - timeout); + arglist & CAM_ARG_EJECT, task_attr, + retry_count, timeout); break; #endif /* MINIMALISTIC */ case CAM_CMD_RESCAN: @@ -9234,15 +9301,15 @@ main(int argc, char **argv) #ifndef MINIMALISTIC case CAM_CMD_READ_DEFECTS: error = readdefects(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_MODE_PAGE: modepage(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SCSI_CMD: error = scsicmd(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SMP_CMD: error = smpcmd(cam_dev, argc, argv, combinedopt, @@ -9272,22 +9339,23 @@ main(int argc, char **argv) error = tagcontrol(cam_dev, argc, argv, combinedopt); break; case CAM_CMD_RATE: - error = ratecontrol(cam_dev, retry_count, timeout, - argc, argv, combinedopt); + error = ratecontrol(cam_dev, task_attr, retry_count, + timeout, argc, argv, combinedopt); break; case CAM_CMD_FORMAT: error = scsiformat(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, retry_count, + timeout); break; case CAM_CMD_REPORTLUNS: error = scsireportluns(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_READCAP: error = scsireadcapacity(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_IDLE: case CAM_CMD_STANDBY: @@ -9306,25 +9374,30 @@ main(int argc, char **argv) break; case CAM_CMD_DOWNLOAD_FW: error = fwdownload(cam_dev, argc, argv, combinedopt, - arglist & CAM_ARG_VERBOSE, retry_count, timeout); + arglist & CAM_ARG_VERBOSE, task_attr, retry_count, + timeout); break; case CAM_CMD_SANITIZE: error = scsisanitize(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_ATTRIB: error = scsiattrib(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_OPCODES: error = scsiopcodes(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: error = scsireprobe(cam_dev); Modified: stable/10/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.h Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/camcontrol.h Fri Feb 24 20:51:39 2017 (r314221) @@ -71,29 +71,32 @@ void build_ata_cmd(union ccb *ccb, uint3 camcontrol_devtype devtype); int camxferrate(struct cam_device *device); int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, - int timeout); + char *combinedopt, int printerrors, int task_attr, + int retry_count, int timeout); void mode_sense(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retry_count, int timeout, uint8_t *data, - int datalen); -void mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int subpage, int task_attr, int retry_count, int timeout, + uint8_t *data, int datalen); +void mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen); +void mode_edit(struct cam_device *device, int dbd, int pc, int page, + int subpage, int edit, int binary, int task_attr, int retry_count, int timeout); +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int task_attr, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, - int verbosemode, uint32_t *fill_len, uint8_t **data_ptr); + int timeout_desc, int task_attr, int retry_count, + int timeout, int verbosemode, uint32_t *fill_len, + uint8_t **data_ptr); int scsipersist(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose, int err_recover); int scsiattrib(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbose, int err_recover); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); Modified: stable/10/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/10/sbin/camcontrol/fwdownload.c Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/fwdownload.c Fri Feb 24 20:51:39 2017 (r314221) @@ -263,7 +263,7 @@ static const struct fw_timeout_desc fw_t static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev, struct ata_params *ident_buf); static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout); + int task_attr, int retry_count, int timeout); static int fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, char *buf, const char *fw_img_path, int quiet); @@ -317,7 +317,7 @@ fw_get_vendor(struct cam_device *cam_dev static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { struct scsi_report_supported_opcodes_one *one; struct scsi_report_supported_opcodes_timeout *td; @@ -349,6 +349,7 @@ fw_get_timeout(struct cam_device *cam_de /*sa_set*/ 0, /*service_action*/ 0, /*timeout_desc*/ 1, + /*task_attr*/ task_attr, /*retry_count*/ retry_count, /*timeout*/ 10000, /*verbose*/ 0, @@ -901,7 +902,8 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, int timeout) + char *combinedopt, int printerrors, int task_attr, int retry_count, + int timeout) { struct fw_vendor *vp; char *fw_img_path = NULL; @@ -976,7 +978,7 @@ fwdownload(struct cam_device *device, in && (devtype == CC_DT_SCSI)) errx(1, "Unsupported device"); - retval = fw_get_timeout(device, vp, retry_count, timeout); + retval = fw_get_timeout(device, vp, task_attr, retry_count, timeout); if (retval != 0) { warnx("Unable to get a firmware download timeout value"); goto bailout; @@ -994,8 +996,8 @@ fwdownload(struct cam_device *device, in " into the following device:\n", fw_img_path); if (devtype == CC_DT_SCSI) { - if (scsidoinquiry(device, argc, argv, combinedopt, 0, - 5000) != 0) { + if (scsidoinquiry(device, argc, argv, combinedopt, + MSG_SIMPLE_Q_TAG, 0, 5000) != 0) { warnx("Error sending inquiry"); retval = 1; goto bailout; Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/modeedit.c Fri Feb 24 20:51:39 2017 (r314221) @@ -106,10 +106,11 @@ static int editentry_set(char *name, c int editonly); static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, + int timeout); static void editlist_save(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, int timeout); static void nameentry_create(int page, int subpage, char *name); static struct pagename *nameentry_lookup(int page, int subpage); static int load_format(const char *pagedb_path, int lpage, @@ -118,8 +119,8 @@ static int modepage_write(FILE *file, static int modepage_read(FILE *file); static void modepage_edit(void); static void modepage_dump(struct cam_device *device, int dbd, - int pc, int page, int subpage, int retries, - int timeout); + int pc, int page, int subpage, int task_attr, + int retries, int timeout); static void cleanup_editfile(void); @@ -550,7 +551,7 @@ load_format(const char *pagedb_path, int static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -562,8 +563,8 @@ editlist_populate(struct cam_device *dev STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, 1, page, subpage, task_attr, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); @@ -581,14 +582,14 @@ editlist_populate(struct cam_device *dev buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void editlist_save(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -602,7 +603,7 @@ editlist_save(struct cam_device *device, return; /* Preload the CDB buffer with the current mode page data. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); /* Initial headers & offsets. */ @@ -639,7 +640,8 @@ editlist_save(struct cam_device *device, * recorded. */ mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); + task_attr, retries, timeout, (u_int8_t *)mh, + sizeof(*mh) + hlen + len); } static int @@ -809,7 +811,7 @@ modepage_edit(void) static void modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout) + int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -818,7 +820,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_page_header_sp *mphsp; size_t indx, len; - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; @@ -853,7 +855,7 @@ cleanup_editfile(void) void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout) + int edit, int binary, int task_attr, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -884,8 +886,8 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, dbd, pc, page, subpage, retry_count, - timeout); + editlist_populate(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } if (edit) { @@ -894,10 +896,12 @@ mode_edit(struct cam_device *device, int errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); + editlist_save(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); + modepage_dump(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); @@ -906,7 +910,7 @@ mode_edit(struct cam_device *device, int void mode_list(struct cam_device *device, int dbd, int pc, int subpages, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ @@ -927,7 +931,7 @@ mode_list(struct cam_device *device, int /* Build the list of all mode pages by querying the "all pages" page. */ mode_sense(device, dbd, pc, SMS_ALL_PAGES_PAGE, subpages ? SMS_SUBPAGE_ALL : 0, - retry_count, timeout, data, sizeof(data)); + task_attr, retry_count, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ Modified: stable/10/sbin/camcontrol/persist.c ============================================================================== --- stable/10/sbin/camcontrol/persist.c Fri Feb 24 20:47:56 2017 (r314220) +++ stable/10/sbin/camcontrol/persist.c Fri Feb 24 20:51:39 2017 (r314221) @@ -423,7 +423,8 @@ persist_print_full(struct scsi_per_res_i int scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode, int err_recover) + int task_attr, int retry_count, int timeout, int verbosemode, + int err_recover) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Fri Feb 24 21:22:15 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF75CEBCEB; Fri, 24 Feb 2017 21:22:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0814666B; Fri, 24 Feb 2017 21:22:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OLMEck066340; Fri, 24 Feb 2017 21:22:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OLMD3e066334; Fri, 24 Feb 2017 21:22:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702242122.v1OLMD3e066334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 24 Feb 2017 21:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314224 - in stable/10/sys/dev: hpt27xx hptnr hptrr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 21:22:15 -0000 Author: pfg Date: Fri Feb 24 21:22:13 2017 New Revision: 314224 URL: https://svnweb.freebsd.org/changeset/base/314224 Log: MFC r313554: Clean redundant MIN/MAX declarations in some HighPoint drivers. The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX() internally which match the macros from sys/param.h. MIN() is not used, MAX is only used once and can be replaced with the max() version in libkern.h which operates on u_ints. MFC after: 2 weeks Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c stable/10/sys/dev/hpt27xx/ldm.h stable/10/sys/dev/hptnr/hptnr_osm_bsd.c stable/10/sys/dev/hptnr/ldm.h stable/10/sys/dev/hptrr/hptrr_osm_bsd.c stable/10/sys/dev/hptrr/ldm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Fri Feb 24 21:22:13 2017 (r314224) @@ -297,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_lock_vbus(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/10/sys/dev/hpt27xx/ldm.h ============================================================================== --- stable/10/sys/dev/hpt27xx/ldm.h Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hpt27xx/ldm.h Fri Feb 24 21:22:13 2017 (r314224) @@ -59,10 +59,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((int)(a) - (int)(b) >= 0) Modified: stable/10/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hptnr/hptnr_osm_bsd.c Fri Feb 24 21:22:13 2017 (r314224) @@ -294,7 +294,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/10/sys/dev/hptnr/ldm.h ============================================================================== --- stable/10/sys/dev/hptnr/ldm.h Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hptnr/ldm.h Fri Feb 24 21:22:13 2017 (r314224) @@ -58,9 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; Modified: stable/10/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Fri Feb 24 21:22:13 2017 (r314224) @@ -300,7 +300,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) - count = MAX(vd->u.array.transform->source->cmds_per_request, + count = max(vd->u.array.transform->source->cmds_per_request, vd->u.array.transform->target->cmds_per_request); else count = vd->cmds_per_request; Modified: stable/10/sys/dev/hptrr/ldm.h ============================================================================== --- stable/10/sys/dev/hptrr/ldm.h Fri Feb 24 21:20:48 2017 (r314223) +++ stable/10/sys/dev/hptrr/ldm.h Fri Feb 24 21:22:13 2017 (r314224) @@ -58,10 +58,6 @@ extern "C" { #error "Please redefine MAX_PARTITIONS_PER_DISK!!!" #endif -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) - - typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ]; #define hpt_time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) From owner-svn-src-stable-10@freebsd.org Fri Feb 24 21:38:42 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65CA5CEC19E; Fri, 24 Feb 2017 21:38:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34BA41253; Fri, 24 Feb 2017 21:38:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OLcfcp071776; Fri, 24 Feb 2017 21:38:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OLcf41071775; Fri, 24 Feb 2017 21:38:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702242138.v1OLcf41071775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 24 Feb 2017 21:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314227 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 21:38:42 -0000 Author: pfg Date: Fri Feb 24 21:38:41 2017 New Revision: 314227 URL: https://svnweb.freebsd.org/changeset/base/314227 Log: MFC r313897: ext2fs: Remove unused assignment. The value is re-assigned a few lines later without being read. Found by: Clang static analyzer Modified: stable/10/sys/fs/ext2fs/ext2_htree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_htree.c Fri Feb 24 21:35:59 2017 (r314226) +++ stable/10/sys/fs/ext2fs/ext2_htree.c Fri Feb 24 21:38:41 2017 (r314227) @@ -766,7 +766,6 @@ ext2_htree_add_entry(struct vnode *dvp, root_entires = info.h_levels[0].h_entries; newidxblock = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); dst_node = (struct ext2fs_htree_node *)newidxblock; - dst_entries = dst_node->h_entries; memset(&dst_node->h_fake_dirent, 0, sizeof(dst_node->h_fake_dirent)); dst_node->h_fake_dirent.e2d_reclen = blksize; From owner-svn-src-stable-10@freebsd.org Sat Feb 25 00:42:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB5BCEB264; Sat, 25 Feb 2017 00:42:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0A3159D; Sat, 25 Feb 2017 00:42:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1P0gisC049351; Sat, 25 Feb 2017 00:42:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P0gioU049350; Sat, 25 Feb 2017 00:42:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702250042.v1P0gioU049350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 25 Feb 2017 00:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314236 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 00:42:45 -0000 Author: ngie Date: Sat Feb 25 00:42:44 2017 New Revision: 314236 URL: https://svnweb.freebsd.org/changeset/base/314236 Log: MFC r313924,r313925: r313924: Quote path to doxygen/kyua in test(1) -x check This is a basic stopgap against ${LOCALBASE} containing spaces in it r313925: Include ${LOCALBASE}/bin in $PATH when running "make checkworld" Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH, which means that the tests fail when run via "make checkworld" because $PATH is restricted to exclude directory elements like "${LOCALBASE}/bin". Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sat Feb 25 00:42:17 2017 (r314235) +++ stable/10/Makefile.inc1 Sat Feb 25 00:42:44 2017 (r314236) @@ -1199,11 +1199,11 @@ packagekernel: # Run test suite on installed world. # checkworld: .PHONY - @if [ ! -x ${LOCALBASE}/bin/kyua ]; then \ + @if [ ! -x "${LOCALBASE}/bin/kyua" ]; then \ echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \ exit 1; \ fi - ${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile + ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile # # @@ -1212,7 +1212,7 @@ checkworld: .PHONY # Build the API documentation with doxygen # doxygen: .PHONY - @if [ ! -x ${LOCALBASE}/bin/doxygen ]; then \ + @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \ echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ exit 1; \ fi From owner-svn-src-stable-10@freebsd.org Sat Feb 25 01:53:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF0ACEC2D7; Sat, 25 Feb 2017 01:53:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4108139D; Sat, 25 Feb 2017 01:53:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1P1rkt2077668; Sat, 25 Feb 2017 01:53:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P1rkH4077667; Sat, 25 Feb 2017 01:53:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702250153.v1P1rkH4077667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 25 Feb 2017 01:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314238 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 01:53:47 -0000 Author: mav Date: Sat Feb 25 01:53:45 2017 New Revision: 314238 URL: https://svnweb.freebsd.org/changeset/base/314238 Log: MFC r313910: Change XCOPY memory allocations. Before this change XCOPY code could allocate memory in chunks up to 16-32MB (VMware does XCOPY in 4MB chunks by default), that could be difficult for VM subsystem to do due to KVA fragmentation, that sometimes created huge allocation delays, blocking any I/O for respective LU for that time. This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now. 1MB is also not a cookie, but ZFS also can do that for large blocks, so it should be less dramatic. As drawback this increases CPU overhead, but it still look acceptable comparing to time consumed by ZFS read/write. Modified: stable/10/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Sat Feb 25 01:52:07 2017 (r314237) +++ stable/10/sys/cam/ctl/ctl_tpc.c Sat Feb 25 01:53:45 2017 (r314238) @@ -85,6 +85,7 @@ struct tpc_io { uint8_t target; uint32_t cscd; uint64_t lun; + uint8_t *buf; struct tpc_list *list; struct runl run; TAILQ_ENTRY(tpc_io) rlinks; @@ -127,7 +128,6 @@ struct tpc_list { off_t curbytes; int curops; int stage; - uint8_t *buf; off_t segsectors; off_t segbytes; int tbdio; @@ -813,9 +813,9 @@ tpc_process_b2b(struct tpc_list *list) while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); ctl_free_io(tior->io); + free(tior->buf, M_CTL); free(tior, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -874,7 +874,6 @@ tpc_process_b2b(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; donebytes = 0; @@ -894,11 +893,12 @@ tpc_process_b2b(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -919,7 +919,7 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, @@ -1029,9 +1029,9 @@ tpc_process_register_key(struct tpc_list while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1064,9 +1064,9 @@ tpc_process_register_key(struct tpc_list TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); datalen = sizeof(struct scsi_per_res_out_parms); - list->buf = malloc(datalen, M_CTL, M_WAITOK); + tio->buf = malloc(datalen, M_CTL, M_WAITOK); ctl_scsi_persistent_res_out(tio->io, - list->buf, datalen, SPRO_REGISTER, -1, + tio->buf, datalen, SPRO_REGISTER, -1, scsi_8btou64(seg->res_key), scsi_8btou64(seg->sa_res_key), /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; @@ -1166,9 +1166,9 @@ tpc_process_wut(struct tpc_list *list) while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1233,8 +1233,6 @@ tpc_process_wut(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK | - (list->token == NULL ? M_ZERO : 0)); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; //printf("Copy chunk of %ju sectors from %ju to %ju\n", list->segsectors, @@ -1257,11 +1255,12 @@ tpc_process_wut(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -1280,7 +1279,7 @@ tpc_process_wut(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, From owner-svn-src-stable-10@freebsd.org Sat Feb 25 08:07:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC07ACEC3C5; Sat, 25 Feb 2017 08:07:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 869418F3; Sat, 25 Feb 2017 08:07:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1P87TB8028673; Sat, 25 Feb 2017 08:07:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1P87TNJ028670; Sat, 25 Feb 2017 08:07:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201702250807.v1P87TNJ028670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 25 Feb 2017 08:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314251 - in stable: 10/contrib/ipfilter/lib 10/sys/contrib/ipfilter/netinet 11/contrib/ipfilter/lib 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 08:07:30 -0000 Author: cy Date: Sat Feb 25 08:07:28 2017 New Revision: 314251 URL: https://svnweb.freebsd.org/changeset/base/314251 Log: MFC r312787: Currently the fragment info is placed at the top of the linked list under a shared read lock. This patch attempts to upgrade the lock to an exclusive write lock. If the exclusive write lock fails to be obtained, the current fragment is not placed at the head of the list. This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which effectively removed the section of code that performed the reordering). The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c. The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch by emulating the mutex in userspace when exercised by ipftest(1). Inspired by: NetBSD ip_frag.c r1.4 Modified: stable/10/contrib/ipfilter/lib/rwlock_emul.c stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/lib/rwlock_emul.c stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ipfilter/lib/rwlock_emul.c ============================================================================== --- stable/10/contrib/ipfilter/lib/rwlock_emul.c Sat Feb 25 06:11:59 2017 (r314250) +++ stable/10/contrib/ipfilter/lib/rwlock_emul.c Sat Feb 25 08:07:28 2017 (r314251) @@ -56,6 +56,27 @@ void eMrwlock_write_enter(rw, file, line } +void eMrwlock_try_upgrade(rw, file, line) + eMrwlock_t *rw; + char *file; + int line; +{ + if (rw->eMrw_magic != EMM_MAGIC) { + fprintf(stderr, "%s:eMrwlock_write_enter(%p): bad magic: %#x\n", + rw->eMrw_owner, rw, rw->eMrw_magic); + abort(); + } + if (rw->eMrw_read != 0 || rw->eMrw_write != 0) { + fprintf(stderr, + "%s:eMrwlock_try_upgrade(%p): already locked: %d/%d\n", + rw->eMrw_owner, rw, rw->eMrw_read, rw->eMrw_write); + abort(); + } + rw->eMrw_write++; + rw->eMrw_heldin = file; + rw->eMrw_heldat = line; +} + void eMrwlock_downgrade(rw, file, line) eMrwlock_t *rw; char *file; Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sat Feb 25 06:11:59 2017 (r314250) +++ stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sat Feb 25 08:07:28 2017 (r314251) @@ -162,6 +162,7 @@ struct ether_addr { # define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) # define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) # define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) # define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) # define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) # define RWLOCK_EXIT(x) do { \ @@ -406,6 +407,8 @@ extern void freembt __P((mb_t *)); # define MUTEX_DOWNGRADE(x) eMrwlock_downgrade(&(x)->ipf_emu, \ __FILE__, __LINE__) +# define MUTEX_TRY_UPGRADE(x) eMrwlock_try_upgrade(&(x)->ipf_emu, \ + __FILE__, __LINE__) # define READ_ENTER(x) eMrwlock_read_enter(&(x)->ipf_emu, \ __FILE__, __LINE__) # define RWLOCK_INIT(x, y) eMrwlock_init(&(x)->ipf_emu, y) @@ -656,6 +659,7 @@ extern char *ipf_getifname __P((struct i # define READ_ENTER(x) ; # define WRITE_ENTER(x) ; # define MUTEX_DOWNGRADE(x) ; +# define MUTEX_TRY_UPGRADE(x) ; # define RWLOCK_INIT(x, y) ; # define RWLOCK_EXIT(x) ; # define RW_DESTROY(x) ; Modified: stable/10/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Sat Feb 25 06:11:59 2017 (r314250) +++ stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Sat Feb 25 08:07:28 2017 (r314251) @@ -743,7 +743,7 @@ ipf_frag_lookup(softc, softf, fin, table } else if (off == 0) f->ipfr_seen0 = 1; - if (f != table[idx]) { + if (f != table[idx] && MUTEX_TRY_UPGRADE(lock)) { ipfr_t **fp; /* @@ -761,6 +761,7 @@ ipf_frag_lookup(softc, softf, fin, table table[idx]->ipfr_hprev = &f->ipfr_hnext; f->ipfr_hprev = table + idx; table[idx] = f; + MUTEX_DOWNGRADE(lock); } /* From owner-svn-src-stable-10@freebsd.org Sat Feb 25 19:28:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D9FBCED6FB; Sat, 25 Feb 2017 19:28:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61F0CFA5; Sat, 25 Feb 2017 19:28:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1PJSnJJ099422; Sat, 25 Feb 2017 19:28:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1PJSnoI099419; Sat, 25 Feb 2017 19:28:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702251928.v1PJSnoI099419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 25 Feb 2017 19:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314277 - in stable/10/usr.sbin/pw: . tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 19:28:50 -0000 Author: bapt Date: Sat Feb 25 19:28:49 2017 New Revision: 314277 URL: https://svnweb.freebsd.org/changeset/base/314277 Log: MFC r312644, r312650 r312644: Readd a feature lost in pw(8) refactoring pw usermod foo -m It used to be able to (re)create the home directory if it didn't exists r312650: Really restore the old behaviour for pw usermod -m It again reinstall missing skel files without overwriting changed one Add a regression test about it PR: 216224 Reported by: ae Modified: stable/10/usr.sbin/pw/psdate.c stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/pw_usermod.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/psdate.c ============================================================================== --- stable/10/usr.sbin/pw/psdate.c Sat Feb 25 19:16:20 2017 (r314276) +++ stable/10/usr.sbin/pw/psdate.c Sat Feb 25 19:28:49 2017 (r314277) @@ -41,12 +41,8 @@ static const char rcsid[] = static int numerics(char const * str) { - int rc = isdigit((unsigned char)*str); - if (rc) - while (isdigit((unsigned char)*str) || *str == 'x') - ++str; - return rc && !*str; + return (str[strspn(str, "0123456789x")] == '\0'); } static int Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Sat Feb 25 19:16:20 2017 (r314276) +++ stable/10/usr.sbin/pw/pw_user.c Sat Feb 25 19:28:49 2017 (r314277) @@ -1495,7 +1495,7 @@ pw_user_mod(int argc, char **argv, char intmax_t id = -1; int ch, fd = -1; size_t i, j; - bool quiet, createhome, pretty, dryrun, nis, edited, docreatehome; + bool quiet, createhome, pretty, dryrun, nis, edited; bool precrypted; mode_t homemode = 0; time_t expire_days, password_days, now; @@ -1505,7 +1505,7 @@ pw_user_mod(int argc, char **argv, char passwd = NULL; class = nispasswd = NULL; quiet = createhome = pretty = dryrun = nis = precrypted = false; - edited = docreatehome = false; + edited = false; if (arg1 != NULL) { if (arg1[strspn(arg1, "0123456789")] == '\0') @@ -1706,8 +1706,6 @@ pw_user_mod(int argc, char **argv, char if (!createhome) warnx("WARNING: home `%s' does not exist", pwd->pw_dir); - else - docreatehome = true; } else if (!S_ISDIR(st.st_mode)) { warnx("WARNING: home `%s' is not a directory", pwd->pw_dir); @@ -1799,7 +1797,7 @@ pw_user_mod(int argc, char **argv, char * that this also `works' for editing users if -m is used, but * existing files will *not* be overwritten. */ - if (PWALTDIR() != PWF_ALT && docreatehome && pwd->pw_dir && + if (PWALTDIR() != PWF_ALT && createhome && pwd->pw_dir && *pwd->pw_dir == '/' && pwd->pw_dir[1]) { if (!skel) skel = cnf->dotdir; Modified: stable/10/usr.sbin/pw/tests/pw_usermod.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_usermod.sh Sat Feb 25 19:16:20 2017 (r314276) +++ stable/10/usr.sbin/pw/tests/pw_usermod.sh Sat Feb 25 19:28:49 2017 (r314277) @@ -253,6 +253,26 @@ user_mod_w_yes_body() { $(atf_get_srcdir)/crypt $passhash "foo" } +atf_test_case user_mod_m +user_mod_m_body() { + populate_root_etc_skel + + mkdir -p ${HOME}/home + mkdir -p ${HOME}/skel + echo "entry" > ${HOME}/skel/.file + atf_check -s exit:0 ${RPW} useradd foo + ! test -d ${HOME}/home/foo || atf_fail "Directory should not have been created" + atf_check -s exit:0 ${RPW} usermod foo -m -k /skel + test -d ${HOME}/home/foo || atf_fail "Directory should have been created" + test -f ${HOME}/home/foo/.file || atf_fail "Skell files not added" + echo "entry" > ${HOME}/skel/.file2 + atf_check -s exit:0 ${RPW} usermod foo -m -k /skel + test -f ${HOME}/home/foo/.file2 || atf_fail "Skell files not added" + echo > ${HOME}/home/foo/.file2 + atf_check -s exit:0 ${RPW} usermod foo -m -k /skel + atf_check -s exit:0 -o inline:"\n" cat ${HOME}/home/foo/.file2 +} + atf_init_test_cases() { atf_add_test_case user_mod @@ -275,4 +295,5 @@ atf_init_test_cases() { atf_add_test_case user_mod_w_none atf_add_test_case user_mod_w_random atf_add_test_case user_mod_w_yes + atf_add_test_case user_mod_m }